@luma.gl/webgl 9.0.0-alpha.52 → 9.0.0-alpha.54

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.
Files changed (29) hide show
  1. package/dist/adapter/converters/sampler-parameters.d.ts +2 -8
  2. package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
  3. package/dist/adapter/converters/sampler-parameters.js +12 -107
  4. package/dist/adapter/converters/sampler-parameters.js.map +1 -1
  5. package/dist/adapter/device-helpers/get-device-info.d.ts.map +1 -1
  6. package/dist/adapter/device-helpers/get-device-info.js +21 -3
  7. package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
  8. package/dist/adapter/resources/webgl-buffer.d.ts +4 -7
  9. package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
  10. package/dist/adapter/resources/webgl-buffer.js +13 -19
  11. package/dist/adapter/resources/webgl-buffer.js.map +1 -1
  12. package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
  13. package/dist/adapter/resources/webgl-texture.js +2 -3
  14. package/dist/adapter/resources/webgl-texture.js.map +1 -1
  15. package/dist/adapter/webgl-device.d.ts.map +1 -1
  16. package/dist/adapter/webgl-device.js +9 -7
  17. package/dist/adapter/webgl-device.js.map +1 -1
  18. package/dist/context/polyfill/polyfill-context.js +5 -2
  19. package/dist/context/polyfill/polyfill-context.js.map +1 -1
  20. package/dist/dist.dev.js +87 -65
  21. package/dist/index.cjs +161 -148
  22. package/dist.min.js +38 -38
  23. package/package.json +5 -5
  24. package/src/adapter/converters/sampler-parameters.ts +26 -151
  25. package/src/adapter/device-helpers/get-device-info.ts +24 -5
  26. package/src/adapter/resources/webgl-buffer.ts +46 -56
  27. package/src/adapter/resources/webgl-texture.ts +3 -4
  28. package/src/adapter/webgl-device.ts +13 -10
  29. package/src/context/polyfill/polyfill-context.ts +6 -2
package/dist.min.js CHANGED
@@ -4,49 +4,49 @@
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 Xn=Object.defineProperty;var Wc=Object.getOwnPropertyDescriptor;var Hc=Object.getOwnPropertyNames;var Xc=Object.prototype.hasOwnProperty;var Vc=(e,t)=>{for(var r in t)Xn(e,r,{get:t[r],enumerable:!0})},kc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Hc(t))!Xc.call(e,i)&&i!==r&&Xn(e,i,{get:()=>t[i],enumerable:!(n=Wc(t,i))||n.enumerable});return e};var Lc=e=>kc(Xn({},"__esModule",{value:!0}),e);var tm={};Vc(tm,{Accessor:()=>Pn,WEBGLBuffer:()=>pe,WEBGLCommandEncoder:()=>Fn,WEBGLFramebuffer:()=>we,WEBGLRenderPass:()=>En,WEBGLRenderPipeline:()=>xn,WEBGLRenderbuffer:()=>Tt,WEBGLResource:()=>hr,WEBGLSampler:()=>Ve,WEBGLShader:()=>Rn,WEBGLTexture:()=>se,WEBGLTransformFeedback:()=>jn,WEBGLVertexArray:()=>Mn,WebGLCanvasContext:()=>Sn,WebGLDevice:()=>le,WebGLResource:()=>hr,_TEXTURE_FORMATS:()=>He,_checkFloat32ColorAttachment:()=>fn,assertWebGL2Context:()=>sf,assertWebGLContext:()=>Gr,clear:()=>Nc,convertGLToTextureFormat:()=>Xe,copyToTexture:()=>Mc,getGLParameters:()=>nn,getShaderLayout:()=>In,getWebGL2Context:()=>Zt,isWebGL:()=>vo,isWebGL2:()=>Y,polyfillContext:()=>rn,popContextState:()=>ge,pushContextState:()=>Te,readPixelsToArray:()=>Fc,readPixelsToBuffer:()=>Dc,registerHeadlessGL:()=>li,resetGLParameters:()=>Of,setDeviceParameters:()=>sn,setGLParameters:()=>be,trackContextState:()=>rr,withDeviceParameters:()=>$f,withGLParameters:()=>ve});function Dt(e){return Dt=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},Dt(e)}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 si(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){Kc(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 Kc(e,t,r){return t=Yc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yc(e){var t=zc(e,"string");return Dt(t)==="symbol"?t:String(t)}function zc(e,t){if(Dt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Dt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $c="Failed to create WebGL context in Node.js, headless gl returned null",Zc=" 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.",Qc={width:1,height:1,debug:!0,throwOnError:!1},Tr=null;function li(e){Tr=e}function pi(){return Tr!==null}function di(e){e=si(si({},Qc),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(!Tr)throw new Error(Zc);var a=Tr(r,n,e);if(!a)throw new Error($c);return a}function Mt(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 G(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Mt()}var qc=globalThis.self||globalThis.window||globalThis.global,Ye=globalThis.window||globalThis.self||globalThis.global,Jc=globalThis.document||{},Be=globalThis.process||{},Gc=globalThis.console,hi=globalThis.navigator||{};var Sr=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",cm=G();var Vn=globalThis;function Ar(e){if(!e&&!G())return"Node";if(Mt(e))return"Electron";let t=e||hi.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Vn.chrome?"Chrome":Vn.safari?"Safari":Vn.mozInnerScreenX?"Firefox":"Unknown"}function es(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Rr=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=es(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 yi(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 _i(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 Or(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,c=["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+"),c]}var Er;(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"})(Er||(Er={}));var ts=10;function bi(e){return typeof e!="string"?e:(e=e.toUpperCase(),Er[e]||Er.WHITE)}function gi(e,t,r){if(!G&&typeof e=="string"){if(t){let n=bi(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=bi(r);e="\x1B[".concat(n+ts,"m").concat(e,"\x1B[49m")}}return e}function vi(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(c=>o===c)||(i[o]=a.bind(e)))}}function ze(e,t){if(!e)throw new Error(t||"Assertion failed")}function Fe(){let e;if(G()&&Ye.performance){var t,r;e=Ye===null||Ye===void 0||(t=Ye.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:G()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},rs={enabled:!0,level:0};function ye(){}var mi={},Ti={once:!0},xe=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Sr,this._startTs=Fe(),this._deltaTs=Fe(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Rr("__probe-".concat(this.id,"__"),rs),this.timeStamp("".concat(this.id," started")),vi(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((Fe()-this._startTs).toPrecision(10))}getDelta(){return Number((Fe()-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){ze(t,r)}warn(t){return this._getLogFunction(0,t,$e.warn,arguments,Ti)}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,Ti)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ye,n&&[n],{tag:as(r)}):ye}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:a=1}=t;return this._shouldLog(r||n)?G()?is({image:i,message:o,scale:a}):os({image:i,message:o,scale:a}):ye}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||ye)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=Si({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||ye)}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()>=Ai(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=Si({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,ze(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Fe();let a=o.tag||o.message;if(o.once&&a)if(!mi[a])mi[a]=Fe();else return ye;return r=ns(this.id,o.message,o),n.bind(console,r,...o.args)}return ye}};xe.VERSION=Sr;function Ai(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 ze(Number.isFinite(t)&&t>=0),t}function Si(e){let{logLevel:t,message:r}=e;e.logLevel=Ai(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 ze(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function ns(e,t,r){if(typeof t=="string"){let n=r.time?_i(yi(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=gi(t,r.color,r.background)}return t}function os(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ye}function is(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let a=Or(o,r,n);console.log(...a)},o.src=t,ye}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Or(t,r,n)),ye;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...Or(o,r,n)),o.src=t.toDataURL(),ye}return ye}function as(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Hm=new xe({id:"@probe.gl/log"});var D=new xe({id:"luma.gl"});function Ut(){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 De=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=Ut(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ut()-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 Ze=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 De?i=t:i=new De(r,n),this.stats[r]=i),i}};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 Ri(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,us(n.key),n)}}function fs(e,t,r){return t&&Ri(e.prototype,t),r&&Ri(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function us(e){var t=cs(e,"string");return jt(t)==="symbol"?t:String(t)}function cs(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 ss(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ls=function(){function e(){ss(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 Ze({id:n})),this.stats.get(n)},fs(e)}(),wr=new ls;function ps(){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||(G()&&D.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:D,stats:wr}),e}var Oi=ps();function ds(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function Ei(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:ds(e)}var kn={};function me(){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 Pr(e){return e>0&&(e&e-1)===0}function Qe(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 wi(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 hs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wi(Object(r),!0).forEach(function(n){ys(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ys(e,t,r){return t=Ii(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pi(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,Ii(n.key),n)}}function _s(e,t,r){return t&&Pi(e.prototype,t),r&&Pi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ii(e){var t=bs(e,"string");return Wt(t)==="symbol"?t:String(t)}function bs(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 gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var $=function(){function e(r,n,i){if(gs(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=vs(n,i);var o=this.props.id!=="undefined"?this.props.id:me(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()},_s(e)}();$.defaultProps={id:"undefined",handle:void 0,userData:void 0};function vs(e,t){var r=hs({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}function qe(e){return qe=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},qe(e)}var Ci;function Ni(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 Ln(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ni(Object(r),!0).forEach(function(n){ms(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ni(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ms(e,t,r){return t=Bi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ts(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xi(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,Bi(n.key),n)}}function Ss(e,t,r){return t&&xi(e.prototype,t),r&&xi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bi(e){var t=As(e,"string");return qe(t)==="symbol"?t:String(t)}function As(e,t){if(qe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rs(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 Os(e){var t=Ps();return function(){var n=Ir(e),i;if(t){var o=Ir(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Es(this,i)}}function Es(e,t){if(t&&(qe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ws(e)}function ws(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}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}}function Ir(e){return Ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ir(e)}Ci=Symbol.toStringTag;var te=function(e){Rs(r,e);var t=Os(r);function r(i,o){var a;Ts(this,r);var c=Ln({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?c.indexType="uint32":o.data instanceof Uint16Array&&(c.indexType="uint16")),a=t.call(this,i,c,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=o.usage||0,a.indexType=c.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")},Ss(r,[{key:Ci,get:function(){return"Buffer"}}]),r}($);te.defaultProps=Ln(Ln({},$.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 Ht(e){return Ht=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},Ht(e)}var Mi;function Fi(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 Yn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fi(Object(r),!0).forEach(function(n){Is(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Is(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 Ns(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Di(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 xs(e,t,r){return t&&Di(e.prototype,t),r&&Di(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ui(e){var t=Cs(e,"string");return Ht(t)==="symbol"?t:String(t)}function Cs(e,t){if(Ht(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ht(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}Mi=Symbol.toStringTag;var Je=function(){function e(r){Ns(this,e),this.id=void 0,this.statsManager=wr,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Yn(Yn({},e.defaultProps),r),this.id=this.props.id||me(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=Yn({},n);return(n.usage||0)&te.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":D.warn("indices buffer content must be of integer type")()),i},xs(e,[{key:Mi,get:function(){return"Device"}}]),e}();Je.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(D.get("debug")),break:[],gl:null};Je.VERSION=Oi;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 Nr(e,t){return Ds(e)||Fs(e,t)||Li(e,t)||Bs()}function Bs(){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 Fs(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Ds(e){if(Array.isArray(e))return e}function Ms(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Li(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,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Li(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}function Wi(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?Wi(Object(r),!0).forEach(function(n){Us(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Us(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 js(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xi(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 Ws(e,t,r){return t&&Xi(e.prototype,t),r&&Xi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ki(e){var t=Hs(e,"string");return Xt(t)==="symbol"?t:String(t)}function Hs(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)}var Xs=G()&&typeof document<"u",xr=function(){return Xs&&document.readyState==="complete"},Vs={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},Ge=function(){function e(r){var n=this;if(js(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=Hi(Hi({},Vs),r),r=this.props,!G()){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=Ks(r.canvas):this.canvas=r.canvas;else{var i,o,a=Ys(r),c=Ls(((i=r)===null||i===void 0?void 0:i.container)||null);c.insertBefore(a,c.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(u){var p=Ms(u),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=Nr(n,2),o=i[0],a=i[1];return o/a},t.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),i=Nr(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(),c=Nr(a,2),u=c[0],p=c[1];return zs(n,o,u,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)&&(D.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,o=this.htmlCanvas.width||1,a=this.htmlCanvas.height||1);var c=this._canvasSizeInfo;if(c.clientWidth!==o||c.clientHeight!==a||c.devicePixelRatio!==n){var u=n,p=Math.floor(o*u),b=Math.floor(a*u);this.htmlCanvas.width=p,this.htmlCanvas.height=b;var g=this.getDrawingBufferSize(),v=Nr(g,2),S=v[0],T=v[1];(S!==p||T!==b)&&(u=Math.min(S/o,T/a),this.htmlCanvas.width=Math.floor(o*u),this.htmlCanvas.height=Math.floor(a*u),D.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)},Ws(e,null,[{key:"isPageLoaded",get:function(){return xr()}}]),e}();Ge.pageLoaded=ks();function ks(){return xr()||typeof window>"u"?Promise.resolve():new Promise(function(e){window.addEventListener("load",function(){return e()})})}function Ls(e){if(typeof e=="string"){var t=document.getElementById(e);if(!t&&!xr())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 Ks(e){var t=document.getElementById(e);if(!t&&!xr())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!(t instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return t}function Ys(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 zs(e,t,r,n,i){var o=e,a=Vi(o[0],t,r),c=ki(o[1],t,n,i),u=Vi(o[0]+1,t,r),p=u===r-1?u:u-1;u=ki(o[1]+1,t,n,i);var b;return i?(u=u===0?u:u+1,b=c,c=u):b=u===n-1?u:u-1,{x:a,y:c,width:Math.max(p-a+1,1),height:Math.max(b-c+1,1)}}function Vi(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 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 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 zi(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){$s(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 $s(e,t,r){return t=Qi(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 $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,Qi(n.key),n)}}function Qs(e,t,r){return t&&$i(e.prototype,t),r&&$i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qi(e){var t=qs(e,"string");return et(t)==="symbol"?t:String(t)}function qs(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 Js(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 Gs(e){var t=rl();return function(){var n=Cr(e),i;if(t){var o=Cr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return el(this,i)}}function el(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 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 rl(){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 Cr(e){return Cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cr(e)}Zi=Symbol.toStringTag;var ae=function(e){Js(r,e);var t=Gs(r);function r(n,i){var o,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.defaultProps;return Zs(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 Qs(r,[{key:Zi,get:function(){return"Texture"}}]),r}($);ae.defaultProps=zi(zi({},$.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 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 nl(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ol(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.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function ol(e,t){if(e){if(typeof e=="string")return qi(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 qi(e,t)}}function qi(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 Ji(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 Gi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ji(Object(r),!0).forEach(function(n){il(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ji(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function il(e,t,r){return t=al(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function al(e){var t=fl(e,"string");return Vt(t)==="symbol"?t:String(t)}function fl(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 ta(e,t,r){var n="",i=t.split(/\r?\n/),o=e.slice().sort(function(v,S){return v.lineNum-S.lineNum});switch(r?.showSourceCode||"no"){case"all":for(var a=0,c=1;c<=i.length;c++)for(n+=ra(i[c-1],c,r);o.length>a&&o[a].lineNum===c;){var u=o[a++];n+=ea(u,i,u.lineNum,Gi(Gi({},r),{},{inlineSource:!1}))}return n;case"issues":case"no":var p=nl(e),b;try{for(p.s();!(b=p.n()).done;){var g=b.value;n+=ea(g,i,g.lineNum,{inlineSource:r?.showSourceCode!=="no"})}}catch(v){p.e(v)}finally{p.f()}return n}}function ea(e,t,r,n){if(n!=null&&n.inlineSource){var i=ul(t,r),o=e.linePos>0?"".concat(" ".repeat(e.linePos+5),`^^^
7
+ var __exports__=(()=>{var Xn=Object.defineProperty;var Hc=Object.getOwnPropertyDescriptor;var Xc=Object.getOwnPropertyNames;var Vc=Object.prototype.hasOwnProperty;var kc=(e,t)=>{for(var r in t)Xn(e,r,{get:t[r],enumerable:!0})},Lc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Xc(t))!Vc.call(e,i)&&i!==r&&Xn(e,i,{get:()=>t[i],enumerable:!(n=Hc(t,i))||n.enumerable});return e};var Kc=e=>Lc(Xn({},"__esModule",{value:!0}),e);var em={};kc(em,{Accessor:()=>In,WEBGLBuffer:()=>pe,WEBGLCommandEncoder:()=>Dn,WEBGLFramebuffer:()=>we,WEBGLRenderPass:()=>wn,WEBGLRenderPipeline:()=>Cn,WEBGLRenderbuffer:()=>Tt,WEBGLResource:()=>hr,WEBGLSampler:()=>Ve,WEBGLShader:()=>On,WEBGLTexture:()=>se,WEBGLTransformFeedback:()=>Wn,WEBGLVertexArray:()=>Un,WebGLCanvasContext:()=>An,WebGLDevice:()=>le,WebGLResource:()=>hr,_TEXTURE_FORMATS:()=>He,_checkFloat32ColorAttachment:()=>un,assertWebGL2Context:()=>sf,assertWebGLContext:()=>en,clear:()=>xc,convertGLToTextureFormat:()=>Xe,copyToTexture:()=>Uc,getGLParameters:()=>on,getShaderLayout:()=>Nn,getWebGL2Context:()=>Zt,isWebGL:()=>vo,isWebGL2:()=>Y,polyfillContext:()=>nn,popContextState:()=>ge,pushContextState:()=>Te,readPixelsToArray:()=>Dc,readPixelsToBuffer:()=>Mc,registerHeadlessGL:()=>li,resetGLParameters:()=>Of,setDeviceParameters:()=>ln,setGLParameters:()=>be,trackContextState:()=>rr,withDeviceParameters:()=>Zf,withGLParameters:()=>ve});function Dt(e){return Dt=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},Dt(e)}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 si(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){Yc(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 Yc(e,t,r){return t=zc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zc(e){var t=$c(e,"string");return Dt(t)==="symbol"?t:String(t)}function $c(e,t){if(Dt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Dt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zc="Failed to create WebGL context in Node.js, headless gl returned null",Qc=" 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.",qc={width:1,height:1,debug:!0,throwOnError:!1},Sr=null;function li(e){Sr=e}function pi(){return Sr!==null}function di(e){e=si(si({},qc),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(!Sr)throw new Error(Qc);var a=Sr(r,n,e);if(!a)throw new Error(Zc);return a}function Mt(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 G(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Mt()}var Jc=globalThis.self||globalThis.window||globalThis.global,Ye=globalThis.window||globalThis.self||globalThis.global,Gc=globalThis.document||{},Be=globalThis.process||{},es=globalThis.console,hi=globalThis.navigator||{};var Ar=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",um=G();var Vn=globalThis;function Rr(e){if(!e&&!G())return"Node";if(Mt(e))return"Electron";let t=e||hi.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Vn.chrome?"Chrome":Vn.safari?"Safari":Vn.mozInnerScreenX?"Firefox":"Unknown"}function ts(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=ts(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 yi(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 _i(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 Er(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,c=["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+"),c]}var wr;(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"})(wr||(wr={}));var rs=10;function bi(e){return typeof e!="string"?e:(e=e.toUpperCase(),wr[e]||wr.WHITE)}function gi(e,t,r){if(!G&&typeof e=="string"){if(t){let n=bi(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=bi(r);e="\x1B[".concat(n+rs,"m").concat(e,"\x1B[49m")}}return e}function vi(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(c=>o===c)||(i[o]=a.bind(e)))}}function ze(e,t){if(!e)throw new Error(t||"Assertion failed")}function Fe(){let e;if(G()&&Ye.performance){var t,r;e=Ye===null||Ye===void 0||(t=Ye.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:G()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ns={enabled:!0,level:0};function ye(){}var mi={},Ti={once:!0},xe=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Ar,this._startTs=Fe(),this._deltaTs=Fe(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Or("__probe-".concat(this.id,"__"),ns),this.timeStamp("".concat(this.id," started")),vi(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((Fe()-this._startTs).toPrecision(10))}getDelta(){return Number((Fe()-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){ze(t,r)}warn(t){return this._getLogFunction(0,t,$e.warn,arguments,Ti)}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,Ti)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ye,n&&[n],{tag:fs(r)}):ye}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:a=1}=t;return this._shouldLog(r||n)?G()?as({image:i,message:o,scale:a}):is({image:i,message:o,scale:a}):ye}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||ye)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=Si({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||ye)}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()>=Ai(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=Si({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,ze(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Fe();let a=o.tag||o.message;if(o.once&&a)if(!mi[a])mi[a]=Fe();else return ye;return r=os(this.id,o.message,o),n.bind(console,r,...o.args)}return ye}};xe.VERSION=Ar;function Ai(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 ze(Number.isFinite(t)&&t>=0),t}function Si(e){let{logLevel:t,message:r}=e;e.logLevel=Ai(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 ze(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function os(e,t,r){if(typeof t=="string"){let n=r.time?_i(yi(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=gi(t,r.color,r.background)}return t}function is(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ye}function as(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let a=Er(o,r,n);console.log(...a)},o.src=t,ye}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Er(t,r,n)),ye;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...Er(o,r,n)),o.src=t.toDataURL(),ye}return ye}function fs(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Wm=new xe({id:"@probe.gl/log"});var D=new xe({id:"luma.gl"});function Ut(){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 De=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=Ut(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ut()-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 Ze=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 De?i=t:i=new De(r,n),this.stats[r]=i),i}};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 Ri(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,cs(n.key),n)}}function us(e,t,r){return t&&Ri(e.prototype,t),r&&Ri(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function cs(e){var t=ss(e,"string");return jt(t)==="symbol"?t:String(t)}function ss(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 ls(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ps=function(){function e(){ls(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 Ze({id:n})),this.stats.get(n)},us(e)}(),Pr=new ps;function ds(){var e=typeof __VERSION__<"u"?__VERSION__:"running from 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||(G()&&D.log(1,"".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:D,stats:Pr}),e}var Oi=ds();function hs(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function Ei(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:hs(e)}var kn={};function me(){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 Ir(e){return e>0&&(e&e-1)===0}function Qe(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 wi(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 ys(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wi(Object(r),!0).forEach(function(n){_s(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _s(e,t,r){return t=Ii(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pi(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,Ii(n.key),n)}}function bs(e,t,r){return t&&Pi(e.prototype,t),r&&Pi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ii(e){var t=gs(e,"string");return Wt(t)==="symbol"?t:String(t)}function gs(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 vs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var $=function(){function e(r,n,i){if(vs(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=ms(n,i);var o=this.props.id!=="undefined"?this.props.id:me(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()},bs(e)}();$.defaultProps={id:"undefined",handle:void 0,userData:void 0};function ms(e,t){var r=ys({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}function qe(e){return qe=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},qe(e)}var Ci;function Ni(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 Ln(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ni(Object(r),!0).forEach(function(n){Ts(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ni(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ts(e,t,r){return t=Bi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ss(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xi(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,Bi(n.key),n)}}function As(e,t,r){return t&&xi(e.prototype,t),r&&xi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bi(e){var t=Rs(e,"string");return qe(t)==="symbol"?t:String(t)}function Rs(e,t){if(qe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Os(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 Es(e){var t=Is();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 ws(this,i)}}function ws(e,t){if(t&&(qe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ps(e)}function Ps(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Is(){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)}Ci=Symbol.toStringTag;var te=function(e){Os(r,e);var t=Es(r);function r(i,o){var a;Ss(this,r);var c=Ln({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?c.indexType="uint32":o.data instanceof Uint16Array&&(c.indexType="uint16")),a=t.call(this,i,c,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.debugData=new ArrayBuffer(0),a.usage=o.usage||0,a.indexType=c.indexType,a}var n=r.prototype;return n.readSyncWebGL2=function(o,a){throw new Error("not implemented")},n._setDebugData=function(o,a,c){var u=ArrayBuffer.isView(o)?o.buffer:o,p=Math.min(o?o.byteLength:c,r.DEBUG_DATA_MAX_LENGTH);o===null?this.debugData=new ArrayBuffer(p):a===0&&c===o.byteLength?this.debugData=u.slice(0,p):this.debugData=u.slice(a,a+p)},As(r,[{key:Ci,get:function(){return"Buffer"}}]),r}($);te.defaultProps=Ln(Ln({},$.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;te.DEBUG_DATA_MAX_LENGTH=32;function Ht(e){return Ht=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},Ht(e)}var Mi;function Fi(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 Yn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fi(Object(r),!0).forEach(function(n){Ns(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ns(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 xs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Di(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 Cs(e,t,r){return t&&Di(e.prototype,t),r&&Di(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ui(e){var t=Bs(e,"string");return Ht(t)==="symbol"?t:String(t)}function Bs(e,t){if(Ht(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ht(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}Mi=Symbol.toStringTag;var Je=function(){function e(r){xs(this,e),this.id=void 0,this.statsManager=Pr,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Yn(Yn({},e.defaultProps),r),this.id=this.props.id||me(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=Yn({},n);return(n.usage||0)&te.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":D.warn("indices buffer content must be of integer type")()),i},Cs(e,[{key:Mi,get:function(){return"Device"}}]),e}();Je.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(D.get("debug")),break:[],gl:null};Je.VERSION=Oi;function H(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}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 xr(e,t){return Ms(e)||Ds(e,t)||Li(e,t)||Fs()}function Fs(){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 Ds(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Ms(e){if(Array.isArray(e))return e}function Us(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Li(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,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Li(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}function Wi(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?Wi(Object(r),!0).forEach(function(n){js(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function js(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 Ws(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xi(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 Hs(e,t,r){return t&&Xi(e.prototype,t),r&&Xi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ki(e){var t=Xs(e,"string");return Xt(t)==="symbol"?t:String(t)}function Xs(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)}var Vs=G()&&typeof document<"u",Cr=function(){return Vs&&document.readyState==="complete"},ks={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},Ge=function(){function e(r){var n=this;if(Ws(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=Hi(Hi({},ks),r),r=this.props,!G()){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=Ys(r.canvas):this.canvas=r.canvas;else{var i,o,a=zs(r),c=Ks(((i=r)===null||i===void 0?void 0:i.container)||null);c.insertBefore(a,c.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(u){var p=Us(u),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=xr(n,2),o=i[0],a=i[1];return o/a},t.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),i=xr(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(),c=xr(a,2),u=c[0],p=c[1];return $s(n,o,u,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)&&(D.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,o=this.htmlCanvas.width||1,a=this.htmlCanvas.height||1);var c=this._canvasSizeInfo;if(c.clientWidth!==o||c.clientHeight!==a||c.devicePixelRatio!==n){var u=n,p=Math.floor(o*u),b=Math.floor(a*u);this.htmlCanvas.width=p,this.htmlCanvas.height=b;var g=this.getDrawingBufferSize(),v=xr(g,2),T=v[0],S=v[1];(T!==p||S!==b)&&(u=Math.min(T/o,S/a),this.htmlCanvas.width=Math.floor(o*u),this.htmlCanvas.height=Math.floor(a*u),D.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)},Hs(e,null,[{key:"isPageLoaded",get:function(){return Cr()}}]),e}();Ge.pageLoaded=Ls();function Ls(){return Cr()||typeof window>"u"?Promise.resolve():new Promise(function(e){window.addEventListener("load",function(){return e()})})}function Ks(e){if(typeof e=="string"){var t=document.getElementById(e);if(!t&&!Cr())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 Ys(e){var t=document.getElementById(e);if(!t&&!Cr())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!(t instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return t}function zs(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 $s(e,t,r,n,i){var o=e,a=Vi(o[0],t,r),c=ki(o[1],t,n,i),u=Vi(o[0]+1,t,r),p=u===r-1?u:u-1;u=ki(o[1]+1,t,n,i);var b;return i?(u=u===0?u:u+1,b=c,c=u):b=u===n-1?u:u-1,{x:a,y:c,width:Math.max(p-a+1,1),height:Math.max(b-c+1,1)}}function Vi(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 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 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 zi(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){Zs(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 Zs(e,t,r){return t=Qi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qs(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,Qi(n.key),n)}}function qs(e,t,r){return t&&$i(e.prototype,t),r&&$i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qi(e){var t=Js(e,"string");return et(t)==="symbol"?t:String(t)}function Js(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 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&&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 el(e){var t=nl();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 tl(this,i)}}function tl(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 rl(e)}function rl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nl(){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)}Zi=Symbol.toStringTag;var ae=function(e){Gs(r,e);var t=el(r);function r(n,i){var o,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.defaultProps;return Qs(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 qs(r,[{key:Zi,get:function(){return"Texture"}}]),r}($);ae.defaultProps=zi(zi({},$.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 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 ol(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=il(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.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function il(e,t){if(e){if(typeof e=="string")return qi(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 qi(e,t)}}function qi(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 Ji(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 Gi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ji(Object(r),!0).forEach(function(n){al(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ji(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function al(e,t,r){return t=fl(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fl(e){var t=ul(e,"string");return Vt(t)==="symbol"?t:String(t)}function ul(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 ta(e,t,r){var n="",i=t.split(/\r?\n/),o=e.slice().sort(function(v,T){return v.lineNum-T.lineNum});switch(r?.showSourceCode||"no"){case"all":for(var a=0,c=1;c<=i.length;c++)for(n+=ra(i[c-1],c,r);o.length>a&&o[a].lineNum===c;){var u=o[a++];n+=ea(u,i,u.lineNum,Gi(Gi({},r),{},{inlineSource:!1}))}return n;case"issues":case"no":var p=ol(e),b;try{for(p.s();!(b=p.n()).done;){var g=b.value;n+=ea(g,i,g.lineNum,{inlineSource:r?.showSourceCode!=="no"})}}catch(v){p.e(v)}finally{p.f()}return n}}function ea(e,t,r,n){if(n!=null&&n.inlineSource){var i=cl(t,r),o=e.linePos>0?"".concat(" ".repeat(e.linePos+5),`^^^
11
11
  `):"";return`
12
12
  `.concat(i).concat(o).concat(e.type.toUpperCase(),": ").concat(e.message,`
13
13
 
14
- `)}return n!=null&&n.html?`<div class='luma-compiler-log-error' style="color:red;"><b> `.concat(e.type.toUpperCase(),": ").concat(e.message,"</b></div>"):"".concat(e.type.toUpperCase(),": ").concat(e.message)}function ul(e,t,r){for(var n="",i=t-2;i<=t;i++){var o=e[i-1];o!==void 0&&(n+=ra(o,t,r))}return n}function ra(e,t,r){return"".concat(cl(String(t),4),": ").concat(e).concat(r!=null&&r.html?"<br/>":`
15
- `)}function cl(e,t){for(var r="",n=e.length;n<t;++n)r+=" ";return r+e}function $n(e,t){return{name:sl(e,t),language:"glsl",version:ll(e)}}function sl(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 ll(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 Me(e){return Me=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},Me(e)}var aa;function Zn(){"use strict";Zn=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 S(){}function T(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=T.prototype=v.prototype=Object.create(E);function x(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var F=R.arg,C=F.value;return C&&Me(C)=="object"&&r.call(C,"__await")?f.resolve(C.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(C).then(function(U){F.value=U,m(F)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,F){s(h,m,R,F)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return S.prototype=T,n(w,"constructor",{value:T,configurable:!0}),n(T,"constructor",{value:S,configurable:!0}),S.displayName=u(T,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===S||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,T):(l.__proto__=T,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},x(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},x(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(F,C){return m.type="throw",m.arg=f,s.next=F,C&&(s.method="next",s.arg=void 0),!!C}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function na(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function pl(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){na(o,n,i,a,c,"next",u)}function c(u){na(o,n,i,a,c,"throw",u)}a(void 0)})}}function oa(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 Qn(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){dl(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 dl(e,t,r){return t=fa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ia(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,fa(n.key),n)}}function yl(e,t,r){return t&&ia(e.prototype,t),r&&ia(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function fa(e){var t=_l(e,"string");return Me(t)==="symbol"?t:String(t)}function _l(e,t){if(Me(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Me(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&&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 gl(e){var t=Tl();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 vl(this,i)}}function vl(e,t){if(t&&(Me(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ml(e)}function ml(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tl(){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)}aa=Symbol.toStringTag;var Fr=function(e){bl(r,e);var t=gl(r);function r(i,o){var a;return hl(this,r),a=t.call(this,i,Qn({id:Sl(o)},o),r.defaultProps),a.stage=void 0,a.source=void 0,a.compilationStatus="pending",a.stage=a.props.stage,a.source=a.props.source,a}var n=r.prototype;return n.getCompilationInfoSync=function(){return null},n.debugShader=function(){var i=pl(Zn().mark(function a(){var c;return Zn().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:p.t0=this.props.debug,p.next=p.t0==="never"?3:p.t0==="errors"?4:p.t0==="warnings"||p.t0==="always"?7:8;break;case 3:return p.abrupt("return");case 4:if(this.compilationStatus!=="success"){p.next=6;break}return p.abrupt("return");case 6:return p.abrupt("break",8);case 7:return p.abrupt("break",8);case 8:return p.next=10,this.getCompilationInfo();case 10:if(c=p.sent,!(this.props.debug==="warnings"&&c?.length===0)){p.next=13;break}return p.abrupt("return");case 13:this._displayShaderLog(c);case 14:case"end":return p.stop()}},a,this)}));function o(){return i.apply(this,arguments)}return o}(),n._displayShaderLog=function(o){var a,c,u=this;if(!(typeof document>"u"||!((a=document)!==null&&a!==void 0&&a.createElement))){var p=$n(this.source).name,b="".concat(this.stage," ").concat(p),g=ta(o,this.source,{showSourceCode:"all",html:!0}),v=document.createElement("Button");v.innerHTML=`
14
+ `)}return n!=null&&n.html?`<div class='luma-compiler-log-error' style="color:red;"><b> `.concat(e.type.toUpperCase(),": ").concat(e.message,"</b></div>"):"".concat(e.type.toUpperCase(),": ").concat(e.message)}function cl(e,t,r){for(var n="",i=t-2;i<=t;i++){var o=e[i-1];o!==void 0&&(n+=ra(o,t,r))}return n}function ra(e,t,r){return"".concat(sl(String(t),4),": ").concat(e).concat(r!=null&&r.html?"<br/>":`
15
+ `)}function sl(e,t){for(var r="",n=e.length;n<t;++n)r+=" ";return r+e}function $n(e,t){return{name:ll(e,t),language:"glsl",version:pl(e)}}function ll(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 pl(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 Me(e){return Me=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},Me(e)}var aa;function Zn(){"use strict";Zn=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 T(){}function S(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=S.prototype=v.prototype=Object.create(E);function F(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var B=R.arg,x=B.value;return x&&Me(x)=="object"&&r.call(x,"__await")?f.resolve(x.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(x).then(function(U){B.value=U,m(B)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,B){s(h,m,R,B)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return T.prototype=S,n(w,"constructor",{value:S,configurable:!0}),n(S,"constructor",{value:T,configurable:!0}),T.displayName=u(S,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===T||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,S):(l.__proto__=S,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},F(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},F(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(B,x){return m.type="throw",m.arg=f,s.next=B,x&&(s.method="next",s.arg=void 0),!!x}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function na(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function dl(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){na(o,n,i,a,c,"next",u)}function c(u){na(o,n,i,a,c,"throw",u)}a(void 0)})}}function oa(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 Qn(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){hl(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 hl(e,t,r){return t=fa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ia(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,fa(n.key),n)}}function _l(e,t,r){return t&&ia(e.prototype,t),r&&ia(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function fa(e){var t=bl(e,"string");return Me(t)==="symbol"?t:String(t)}function bl(e,t){if(Me(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Me(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gl(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 vl(e){var t=Sl();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 ml(this,i)}}function ml(e,t){if(t&&(Me(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 Sl(){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)}aa=Symbol.toStringTag;var Dr=function(e){gl(r,e);var t=vl(r);function r(i,o){var a;return yl(this,r),a=t.call(this,i,Qn({id:Al(o)},o),r.defaultProps),a.stage=void 0,a.source=void 0,a.compilationStatus="pending",a.stage=a.props.stage,a.source=a.props.source,a}var n=r.prototype;return n.getCompilationInfoSync=function(){return null},n.debugShader=function(){var i=dl(Zn().mark(function a(){var c;return Zn().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:p.t0=this.props.debug,p.next=p.t0==="never"?3:p.t0==="errors"?4:p.t0==="warnings"||p.t0==="always"?7:8;break;case 3:return p.abrupt("return");case 4:if(this.compilationStatus!=="success"){p.next=6;break}return p.abrupt("return");case 6:return p.abrupt("break",8);case 7:return p.abrupt("break",8);case 8:return p.next=10,this.getCompilationInfo();case 10:if(c=p.sent,!(this.props.debug==="warnings"&&c?.length===0)){p.next=13;break}return p.abrupt("return");case 13:this._displayShaderLog(c);case 14:case"end":return p.stop()}},a,this)}));function o(){return i.apply(this,arguments)}return o}(),n._displayShaderLog=function(o){var a,c,u=this;if(!(typeof document>"u"||!((a=document)!==null&&a!==void 0&&a.createElement))){var p=$n(this.source).name,b="".concat(this.stage," ").concat(p),g=ta(o,this.source,{showSourceCode:"all",html:!0}),v=document.createElement("Button");v.innerHTML=`
16
16
  <h1>Shader Compilation Error in `.concat(b,`</h1><br /><br />
17
17
  <code style="user-select:text;"><pre>
18
18
  `).concat(g,`
19
- </pre></code>`),v.style.top="10px",v.style.left="10px",v.style.position="absolute",v.style.zIndex="9999",v.style.width="100%",v.style.textAlign="left",document.body.appendChild(v);var S=document.getElementsByClassName("luma-compiler-log-error");(c=S[0])!==null&&c!==void 0&&c.scrollIntoView&&S[0].scrollIntoView(),v.onclick=function(){var T="data:text/plain,".concat(encodeURIComponent(u.source));navigator.clipboard.writeText(T)}}},yl(r,[{key:aa,get:function(){return"Shader"}}]),r}($);Fr.defaultProps=Qn(Qn({},$.defaultProps),{},{language:"auto",stage:"vertex",source:"",sourceMap:null,entryPoint:"main",debug:"errors"});function Sl(e){return $n(e.source).name||e.id||me("unnamed ".concat(e.stage,"-shader"))}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)}var la;function ua(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 ca(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){Al(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 Al(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 Rl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sa(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 Ol(e,t,r){return t&&sa(e.prototype,t),r&&sa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function pa(e){var t=El(e,"string");return tt(t)==="symbol"?t:String(t)}function El(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 wl(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&&Jn(e,t)}function Jn(e,t){return Jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Jn(e,t)}function Pl(e){var t=xl();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 Il(this,i)}}function Il(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 Nl(e)}function Nl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xl(){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)}la=Symbol.toStringTag;var Mr=function(e){wl(r,e);var t=Pl(r);function r(n,i){return Rl(this,r),t.call(this,n,i,r.defaultProps)}return Ol(r,[{key:la,get:function(){return"Sampler"}}]),r}($);Mr.defaultProps=ca(ca({},$.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 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)}var _a;function da(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 rt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?da(Object(r),!0).forEach(function(n){Cl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):da(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cl(e,t,r){return t=ba(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bl(e,t){return Ul(e)||Ml(e,t)||Dl(e,t)||Fl()}function Fl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
20
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dl(e,t){if(e){if(typeof e=="string")return ha(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 ha(e,t)}}function ha(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 Ml(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Ul(e){if(Array.isArray(e))return e}function jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ya(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,ba(n.key),n)}}function Wl(e,t,r){return t&&ya(e.prototype,t),r&&ya(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ba(e){var t=Hl(e,"string");return nt(t)==="symbol"?t:String(t)}function Hl(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)}function Xl(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&&Gn(e,t)}function Gn(e,t){return Gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Gn(e,t)}function Vl(e){var t=Kl();return function(){var n=Ur(e),i;if(t){var o=Ur(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return kl(this,i)}}function kl(e,t){if(t&&(nt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ll(e)}function Ll(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kl(){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 Ur(e){return Ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ur(e)}_a=Symbol.toStringTag;var ot=function(e){Xl(r,e);var t=Vl(r);function r(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return jl(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 c=Array.isArray(o)?o:[o.width,o.height],u=Bl(c,2),p=u[0],b=u[1];a=a||b!==this.height||p!==this.width,this.width=p,this.height=b}a&&(D.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(c){if(typeof c=="string"){var u=o.createColorTexture(c);return o.attachResource(u),u}return c}),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 c=0;c<this.colorAttachments.length;++c)if(this.colorAttachments[c]){var u=this.device._createTexture(rt(rt({},this.colorAttachments[c].props),{},{width:o,height:a}));this.destroyAttachedResource(this.colorAttachments[c]),this.colorAttachments[c]=u,this.attachResource(u)}if(this.depthStencilAttachment){var p=this.device._createTexture(rt(rt({},this.depthStencilAttachment.props),{},{width:o,height:a}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=p,this.attachResource(p)}},Wl(r,[{key:_a,get:function(){return"Framebuffer"}}]),r}($);ot.defaultProps=rt(rt({},$.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});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 Ta;function ga(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 va(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ga(Object(r),!0).forEach(function(n){Yl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ga(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Yl(e,t,r){return t=Sa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zl(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,Sa(n.key),n)}}function $l(e,t,r){return t&&ma(e.prototype,t),r&&ma(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sa(e){var t=Zl(e,"string");return it(t)==="symbol"?t:String(t)}function Zl(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 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&&eo(e,t)}function eo(e,t){return eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},eo(e,t)}function ql(e){var t=ep();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 Jl(this,i)}}function Jl(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 Gl(e)}function Gl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ep(){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)}Ta=Symbol.toStringTag;var Wr=function(e){Ql(r,e);var t=ql(r);function r(n,i){var o;return zl(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 $l(r,[{key:Ta,get:function(){return"RenderPipeline"}}]),r}($);Wr.defaultProps=va(va({},$.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});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 Ea;function Aa(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 Ra(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){tp(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 tp(e,t,r){return t=wa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rp(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,wa(n.key),n)}}function np(e,t,r){return t&&Oa(e.prototype,t),r&&Oa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wa(e){var t=op(e,"string");return at(t)==="symbol"?t:String(t)}function op(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 ip(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&&to(e,t)}function to(e,t){return to=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},to(e,t)}function ap(e){var t=cp();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 fp(this,i)}}function fp(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 up(e)}function up(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cp(){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)}Ea=Symbol.toStringTag;var Xr=function(e){ip(r,e);var t=ap(r);function r(n,i){return rp(this,r),t.call(this,n,i,r.defaultProps)}return np(r,[{key:Ea,get:function(){return"RenderPass"}}]),r}($);Xr.defaultProps=Ra(Ra({},$.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});function ft(e){return ft=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},ft(e)}var xa;function Pa(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 Ia(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pa(Object(r),!0).forEach(function(n){sp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sp(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 lp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Na(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 pp(e,t,r){return t&&Na(e.prototype,t),r&&Na(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ca(e){var t=dp(e,"string");return ft(t)==="symbol"?t:String(t)}function dp(e,t){if(ft(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ft(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hp(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 yp(e){var t=gp();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 _p(this,i)}}function _p(e,t){if(t&&(ft(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bp(e)}function bp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gp(){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)}xa=Symbol.toStringTag;var kr=function(e){hp(r,e);var t=yp(r);function r(i,o){return lp(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){},pp(r,[{key:xa,get:function(){return"CommandEncoder"}}]),r}($);kr.defaultProps=Ia(Ia({},$.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 Da;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 vp(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){mp(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 mp(e,t,r){return t=Ma(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fa(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,Ma(n.key),n)}}function Sp(e,t,r){return t&&Fa(e.prototype,t),r&&Fa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ma(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 Rp(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 Op(e){var t=Pp();return function(){var n=Lr(e),i;if(t){var o=Lr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ep(this,i)}}function Ep(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 wp(e)}function wp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pp(){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 Lr(e){return Lr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lr(e)}Da=Symbol.toStringTag;var Kr=function(e){Rp(r,e);var t=Op(r);function r(n,i){return Tp(this,r),t.call(this,n,i,r.defaultProps)}return Sp(r,[{key:Da,get:function(){return"CommandBuffer"}}]),r}($);Kr.defaultProps=vp({},$.defaultProps);function Ip(e,t){return Bp(e)||Cp(e,t)||xp(e,t)||Np()}function Np(){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 xp(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 Cp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Bp(e){if(Array.isArray(e))return e}function ja(e){var t=Ip(Dp[e],2),r=t[0],n=t[1],i=r==="i32"||r==="u32",o=r!=="u32",a=Mp[r]*n,c=Fp(r,n);return{dataType:r,components:n,defaultVertexFormat:c,byteLength:a,integer:i,signed:o}}function Fp(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 Dp={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]},Mp={f32:4,f16:2,i32:4,u32:4};function Yr(e){var t=Wa[e],r=Up(t),n=e.includes("norm"),i=!n&&!e.startsWith("float"),o=e.startsWith("s");return{dataType:Wa[e],byteLength:r,integer:i,signed:o,normalized:n}}function Up(e){var t=jp[e];return t}var Wa={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},jp={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Wp(e,t){return kp(e)||Vp(e,t)||Xp(e,t)||Hp()}function Hp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
22
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xp(e,t){if(e){if(typeof e=="string")return Ha(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 Ha(e,t)}}function Ha(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 Vp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function kp(e){if(Array.isArray(e))return e}function oo(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=Wp(r,2),i=n[0],o=n[1],a=i,c=o?parseInt(o):1,u=Yr(a),p={type:a,components:c,byteLength:u.byteLength*c,integer:u.integer,signed:u.signed,normalized:u.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 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 io(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){Lp(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 Lp(e,t,r){return t=Kp(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kp(e){var t=Yp(e,"string");return kt(t)==="symbol"?t:String(t)}function Yp(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 ct(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=zp(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.
23
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function zp(e,t){if(e){if(typeof e=="string")return Va(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 Va(e,t)}}function Va(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 ka(e,t){var r={},n=ct(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=$p(e,t,o.name)}}catch(a){n.e(a)}finally{n.f()}return r}function La(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,n=ka(e,t),i=new Array(r).fill(null),o=0,a=Object.values(n);o<a.length;o++){var c=a[o];i[c.location]=c}return i}function $p(e,t,r){var n=Zp(e,r),i=Qp(t,r);if(!n)return null;var o=ja(n.type),a=i?.vertexFormat||o.defaultVertexFormat,c=oo(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:c.type,bufferComponents:c.components,normalized:c.normalized,integer:o.integer,stepMode:i?.stepMode||n.stepMode,byteOffset:i?.byteOffset||0,byteStride:i?.byteStride||0}}function Zp(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||D.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function Qp(e,t){qp(e);var r=Jp(e,t);return r||(r=Gp(e,t),r)?r:(D.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function qp(e){var t=ct(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&D.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function Jp(e,t){var r=ct(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 Gp(e,t){var r=ct(e),n;try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=o.byteStride;if(typeof o.byteStride!="number"){var c=ct(o.attributes||[]),u;try{for(c.s();!(u=c.n()).done;){var p=u.value,b=oo(p.format);a+=b.byteLength}}catch(v){c.e(v)}finally{c.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 ao(e,t){var r=io(io({},e),{},{attributes:e.attributes.map(function(a){return io({},a)})}),n=ct(t?.attributes||[]),i;try{var o=function(){var c=i.value,u=r.attributes.find(function(p){return p.name===c.name});u?(u.type=c.type||u.type,u.stepMode=c.stepMode||u.stepMode):D.warn("shader layout attribute ".concat(c.name," not present in shader"))};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}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 $a;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 Ya(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){ed(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 ed(e,t,r){return t=Za(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function td(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,Za(n.key),n)}}function rd(e,t,r){return t&&za(e.prototype,t),r&&za(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Za(e){var t=nd(e,"string");return st(t)==="symbol"?t:String(t)}function nd(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 od(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 id(e){var t=ud();return function(){var n=zr(e),i;if(t){var o=zr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ad(this,i)}}function ad(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 fd(e)}function fd(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ud(){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 zr(e){return zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zr(e)}$a=Symbol.toStringTag;var $r=function(e){od(r,e);var t=id(r);function r(n,i){var o;return td(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=La(i.renderPipeline.shaderLayout,i.renderPipeline.bufferLayout,o.maxVertexAttributes),o}return rd(r,[{key:$a,get:function(){return"VertexArray"}}]),r}($);$r.defaultProps=Ya(Ya({},$.defaultProps),{},{renderPipeline:null});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)}var Ga;function Qa(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 qa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qa(Object(r),!0).forEach(function(n){cd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cd(e,t,r){return t=ef(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ja(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,ef(n.key),n)}}function ld(e,t,r){return t&&Ja(e.prototype,t),r&&Ja(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ef(e){var t=pd(e,"string");return lt(t)==="symbol"?t:String(t)}function pd(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 dd(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&&uo(e,t)}function uo(e,t){return uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},uo(e,t)}function hd(e){var t=bd();return function(){var n=Zr(e),i;if(t){var o=Zr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yd(this,i)}}function yd(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 _d(e)}function _d(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bd(){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 Zr(e){return Zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zr(e)}Ga=Symbol.toStringTag;var Qr=function(e){dd(r,e);var t=hd(r);function r(n,i){return sd(this,r),t.call(this,n,i,r.defaultProps)}return ld(r,[{key:Ga,get:function(){return"TransformFeedback"}}]),r}($);Qr.defaultProps=qa(qa({},$.defaultProps),{},{layout:void 0,buffers:{}});function H(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}var qr;function tf(e){return(!qr||qr.byteLength<e)&&(qr=new ArrayBuffer(e)),qr}function co(e,t){var r=tf(e.BYTES_PER_ELEMENT*t);return new e(r,0,t)}function so(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,c=r.length,u=a*c,p=0,b=i;p<c;p++)t[b++]=r[p];for(;p<u;)p<u-p?(t.copyWithin(i+p,i,i+p),p*=2):(t.copyWithin(i+p,i,i+u-p),p=u);return e.target}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 rf(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 gd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rf(Object(r),!0).forEach(function(n){vd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vd(e,t,r){return t=md(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function md(e){var t=Td(e,"string");return Lt(t)==="symbol"?t:String(t)}function Td(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 Sd(e,t){return Ed(e)||Od(e,t)||Rd(e,t)||Ad()}function Ad(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
24
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rd(e,t){if(e){if(typeof e=="string")return nf(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 nf(e,t)}}function nf(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 Od(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Ed(e){if(Array.isArray(e))return e}var wd=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function Jr(e){var t=wd.exec(e);if(t){var r=Sd(t,6),n=r[1],i=r[2],o=r[3],a=r[4],c=r[5];if(n){var u="".concat(o).concat(i),p=Yr(u);return gd({format:n,components:n.length,srgb:a==="-srgb",unsized:c==="-unsized",webgl:c==="-webgl"},p)}}return Id(e)}var Pd={"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 Id(e){var t,r=Pd[e];if(!r)throw new Error("Unknown format ".concat(e));return{format:r.format||"",components:r.components||((t=r.format)===null||t===void 0?void 0:t.length)||1,byteLength:r.bpp||1,srgb:!1,unsized:!1}}function of(e){return Ei(e)!==null||typeof e=="number"||typeof e=="boolean"}function lo(e){var t={bindings:{},uniforms:{}};return Object.keys(e).forEach(function(r){var n=e[r];of(n)?t.uniforms[r]=n:t.bindings[r]=n}),t}function po(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 D.removed("Calling removed method ".concat(t,".").concat(a,": "),i)(),new Error(a)})})}function Nd(e,t){return Fd(e)||Bd(e,t)||Cd(e,t)||xd()}function xd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
25
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cd(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 Bd(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Fd(e){if(Array.isArray(e))return e}function ho(e,t,r){var n=r.removedProps,i=n===void 0?{}:n,o=r.deprecatedProps,a=o===void 0?{}:o,c=r.replacedProps,u=c===void 0?{}:c;for(var p in i)if(p in t){var b=i[p],g=b?"".concat(e,".").concat(i[p]):"N/A";D.removed("".concat(e,".").concat(p),g)()}for(var v in a)if(v in t){var S=a[v];D.deprecated("".concat(e,".").concat(v),"".concat(e,".").concat(S))()}for(var T=null,E=0,P=Object.entries(u);E<P.length;E++){var O=Nd(P[E],2),w=O[0],x=O[1];w in t&&(D.deprecated("".concat(e,".").concat(w),"".concat(e,".").concat(x))(),T=T||Object.assign({},t),T[x]=t[w],delete T[w])}return T||t}function yo(e){return yo=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},yo(e)}function Kt(){"use strict";Kt=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 S(){}function T(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=T.prototype=v.prototype=Object.create(E);function x(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var F=R.arg,C=F.value;return C&&yo(C)=="object"&&r.call(C,"__await")?f.resolve(C.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(C).then(function(U){F.value=U,m(F)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,F){s(h,m,R,F)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return S.prototype=T,n(w,"constructor",{value:T,configurable:!0}),n(T,"constructor",{value:S,configurable:!0}),S.displayName=u(T,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===S||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,T):(l.__proto__=T,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},x(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},x(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(F,C){return m.type="throw",m.arg=f,s.next=F,C&&(s.method="next",s.arg=void 0),!!C}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function ff(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function uf(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){ff(o,n,i,a,c,"next",u)}function c(u){ff(o,n,i,a,c,"throw",u)}a(void 0)})}}var Dd="";function go(e,t){return _o.apply(this,arguments)}function _o(){return _o=uf(Kt().mark(function e(t,r){return Kt().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,a){try{var c=new Image;c.onload=function(){return o(c)},c.onerror=function(){return a(new Error("Could not load image ".concat(t,".")))},c.crossOrigin=r?.crossOrigin||"anonymous",c.src=t.startsWith("http")?t:Dd+t}catch(u){a(u)}}));case 1:case"end":return i.stop()}},e)})),_o.apply(this,arguments)}function Yt(e,t){return bo.apply(this,arguments)}function bo(){return bo=uf(Kt().mark(function e(t,r){var n,i;return Kt().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(c,u){i.onload=c,i.onerror=function(p){return u(new Error("Unable to load script '".concat(t,"': ").concat(p)))},n.appendChild(i)}));case 8:case"end":return a.stop()}},e)})),bo.apply(this,arguments)}var zt={};function Md(e){globalThis.console&&globalThis.console.error&&globalThis.console.error(e)}function Ud(e){globalThis.console&&globalThis.console.log&&globalThis.console.log(e)}function jd(e,t){zt[e]=!0,t!==void 0&&Md(t)}function Wd(e){var t=e.getError;e.getError=function(){var n;do n=t.apply(e),n!==0&&(zt[n]=!0);while(n!==0);for(n in zt)if(zt[n])return delete zt[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 Ue=function(t){var r=this;this.gl=t,Wd(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 c=a.attribs[o];return c.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(o){var a=r.currentVertexArrayObject;a.maxAttrib=Math.max(a.maxAttrib,o);var c=a.attribs[o];return c.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 c=r.currentVertexArrayObject,u=c.attribs[o];switch(a){case 34975:return u.buffer;case 34338:return u.enabled;case 34339:return u.size;case 34340:return u.stride;case 34341:return u.type;case 34922:return u.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(o,a,c,u,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=c,v.normalized=u,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(){Ud("OESVertexArrayObject emulation library context restored"),r.reset_()},!0),this.reset_()};Ue.prototype.VERTEX_ARRAY_BINDING_OES=34229;Ue.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)};Ue.prototype.createVertexArrayOES=function(){var t=new $t(this);return this.vertexArrayObjects.push(t),t};Ue.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)};Ue.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof $t&&t.hasBeenBound&&t.ext===this)};Ue.prototype.bindVertexArrayOES=function(t){var r=this.gl;if(t&&!t.isAlive){jd(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,c=Math.max(i?i.maxAttrib:0,o.maxAttrib),u=0;u<=c;u++){var p=o.attribs[u],b=i?i.attribs[u]:null;if((!i||p.enabled!==b.enabled)&&(p.enabled?n.enableVertexAttribArray.call(r,u):n.disableVertexAttribArray.call(r,u)),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,u,p.size,p.type,p.normalized,p.stride,p.offset)}}this.currentArrayBuffer!==a&&n.bindBuffer.call(r,34962,this.currentArrayBuffer)}};function cf(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 Ue(this)),this.__OESVertexArrayObject))}}}var Hd="Invalid WebGLRenderingContext";var Xd="Requires WebGL2";function vo(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function Y(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function Zt(e){return Y(e)?e:null}function Gr(e){return H(vo(e),Hd),e}function sf(e){return H(Y(e),Xd),e}var z;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 Z(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=kd(e,"string");return Qt(t)==="symbol"?t:String(t)}function kd(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 lf="OES_element_index",pf="WEBGL_draw_buffers",Ld="EXT_disjoint_timer_query",Kd="EXT_disjoint_timer_query_webgl2",Yd="EXT_texture_filter_anisotropic",df="WEBGL_debug_renderer_info",zd=35723,$d=4352,Zd=36795,Qd=34047,qd=37445,Jd=37446,J=function(t){return Y(t)?void 0:0},Gd=(z={},Z(z,3074,function(e){return Y(e)?void 0:36064}),Z(z,zd,function(e){return Y(e)?void 0:$d}),Z(z,35977,J),Z(z,32937,J),Z(z,Zd,function(e,t){var r=Y(e)?e.getExtension(Kd):e.getExtension(Ld);return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0}),Z(z,qd,function(e,t){var r=e.getExtension(df);return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)}),Z(z,Jd,function(e,t){var r=e.getExtension(df);return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)}),Z(z,Qd,function(e,t){var r,n=((r=e.luma)===null||r===void 0||(r=r.extensions)===null||r===void 0?void 0:r[Yd])||e.getExtension("EXT_texture_filter_anisotropic");return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Z(z,32883,J),Z(z,35071,J),Z(z,37447,J),Z(z,36063,function(e,t){if(!Y(e)){var r=e.getExtension(pf);return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Z(z,35379,J),Z(z,35374,J),Z(z,35377,J),Z(z,34852,function(e){if(!Y(e)){var t=e.getExtension(pf);return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Z(z,36203,function(e){return e.getExtension(lf)?2147483647:65535}),Z(z,33001,function(e){return e.getExtension(lf)?16777216:65535}),Z(z,33e3,function(e){return 16777216}),Z(z,37157,J),Z(z,35373,J),Z(z,35657,J),Z(z,36183,J),Z(z,37137,J),Z(z,34045,J),Z(z,35978,J),Z(z,35979,J),Z(z,35968,J),Z(z,35376,J),Z(z,35375,J),Z(z,35659,J),Z(z,37154,J),Z(z,35371,J),Z(z,35658,J),Z(z,35076,J),Z(z,35077,J),Z(z,35380,J),z);function hf(e,t,r){var n=Gd[r],i=typeof n=="function"?n(e,t,r):n,o=i!==void 0?i:t(r);return o}function pt(e){var t=e.luma;if(!t){var r={_polyfilled:!1,_extensions:{}};e.luma=r}return e.luma}var dt;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 en(e,t,r){return t=eh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eh(e){var t=th(e,"string");return qt(t)==="symbol"?t:String(t)}function th(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 rh="OES_vertex_array_object",yf="ANGLE_instanced_arrays",nh="WEBGL_draw_buffers",oh="EXT_disjoint_timer_query",ih="EXT_texture_filter_anisotropic",ah="VertexArray requires WebGL2 or OES_vertex_array_object extension";function fh(e,t){return{webgl2:Y(e),ext:e.getExtension(t)}}var mo=(dt={},en(dt,rh,{meta:{suffix:"OES"},createVertexArray:function(){H(!1,ah)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),en(dt,yf,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,r){H(r===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),en(dt,nh,{meta:{suffix:"WEBGL"},drawBuffers:function(){H(!1)}}),en(dt,oh,{meta:{suffix:"EXT"},createQuery:function(){H(!1)},deleteQuery:function(){H(!1)},beginQuery:function(){H(!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){}}),dt),tn={readBuffer:function(t,r,n){Y(t)&&r(n)},getVertexAttrib:function(t,r,n,i){var o=fh(t,yf),a=o.webgl2,c=o.ext,u;switch(i){case 35069:u=a?void 0:!1;break;case 35070:u=!a&&!c?0:void 0;break;default:}return u!==void 0?u:r(n,i)},getProgramParameter:function(t,r,n,i){if(!Y(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(!Y(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=pt(t),a=o._extensions,c=a[ih];i=c&&c.TEXTURE_MAX_ANISOTROPY_EXT||34046;break;default:}return r(n,i)},getParameter:hf,hint:function(t,r,n,i){return r(n,i)}};function bf(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=uh(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.
26
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function uh(e,t){if(e){if(typeof e=="string")return _f(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 _f(e,t)}}function _f(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 rn(e){var t=pt(e);return t._polyfilled||(cf(e),ch(e),sh(e,mo),ph(e,{target:t,target2:e}),t._polyfilled=!0),e}function ch(e){var t=pt(e),r=e.getSupportedExtensions()||[],n=bf(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,a=e.getExtension(o);t._extensions[o]=a}}catch(c){n.e(c)}finally{n.f()}}function sh(e,t){var r=pt(e),n=bf(Object.getOwnPropertyNames(t)),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;o!=="overrides"&&lh(e,{extension:o,target:r,target2:e})}}catch(a){n.e(a)}finally{n.f()}}function lh(e,t){var r=t.extension,n=t.target,i=t.target2,o=mo[r];H(o);for(var a=o.meta,c=a===void 0?{}:a,u=c.suffix,p=u===void 0?"":u,b=e.getExtension(r),g=function(){var E=S[v],P="".concat(E).concat(p),O=null;E==="meta"||typeof e[E]=="function"||(b&&typeof b[P]=="function"?O=function(){return b[P].apply(b,arguments)}:typeof o[E]=="function"&&(O=o[E].bind(n))),O&&(n[E]=O,i[E]=O)},v=0,S=Object.keys(o);v<S.length;v++)g()}function ph(e,t){var r=t.target,n=t.target2;Object.keys(tn).forEach(function(i){if(typeof tn[i]=="function"){var o=e[i]?e[i].bind(e):function(){},a=tn[i].bind(null,e,o);r[i]=a,n[i]=a}})}var B,I,_e;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 To(e,t){return yh(e)||hh(e,t)||mf(e,t)||dh()}function dh(){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 hh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function yh(e){if(Array.isArray(e))return e}function re(e){return gh(e)||bh(e)||mf(e)||_h()}function _h(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
28
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mf(e,t){if(e){if(typeof e=="string")return Ao(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 Ao(e,t)}}function bh(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gh(e){if(Array.isArray(e))return Ao(e)}function Ao(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 _(e,t,r){return t=vh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vh(e){var t=mh(e,"string");return Gt(t)==="symbol"?t:String(t)}function mh(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)}var er=(B={},_(B,3042,!1),_(B,32773,new Float32Array([0,0,0,0])),_(B,32777,32774),_(B,34877,32774),_(B,32969,1),_(B,32968,0),_(B,32971,1),_(B,32970,0),_(B,3106,new Float32Array([0,0,0,0])),_(B,3107,[!0,!0,!0,!0]),_(B,2884,!1),_(B,2885,1029),_(B,2929,!1),_(B,2931,1),_(B,2932,513),_(B,2928,new Float32Array([0,1])),_(B,2930,!0),_(B,3024,!0),_(B,35725,null),_(B,36006,null),_(B,36007,null),_(B,34229,null),_(B,34964,null),_(B,2886,2305),_(B,33170,4352),_(B,2849,1),_(B,32823,!1),_(B,32824,0),_(B,10752,0),_(B,32926,!1),_(B,32928,!1),_(B,32938,1),_(B,32939,!1),_(B,3089,!1),_(B,3088,new Int32Array([0,0,1024,1024])),_(B,2960,!1),_(B,2961,0),_(B,2968,4294967295),_(B,36005,4294967295),_(B,2962,519),_(B,2967,0),_(B,2963,4294967295),_(B,34816,519),_(B,36003,0),_(B,36004,4294967295),_(B,2964,7680),_(B,2965,7680),_(B,2966,7680),_(B,34817,7680),_(B,34818,7680),_(B,34819,7680),_(B,2978,[0,0,1024,1024]),_(B,3333,4),_(B,3317,4),_(B,37440,!1),_(B,37441,!1),_(B,37443,37444),_(B,36389,null),_(B,36662,null),_(B,36663,null),_(B,35053,null),_(B,35055,null),_(B,35723,4352),_(B,36010,null),_(B,35977,!1),_(B,3330,0),_(B,3332,0),_(B,3331,0),_(B,3314,0),_(B,32878,0),_(B,3316,0),_(B,3315,0),_(B,32877,0),B),Ae=function(t,r,n){return r?t.enable(n):t.disable(n)},gf=function(t,r,n){return t.hint(n,r)},he=function(t,r,n){return t.pixelStorei(n,r)},vf=function(t,r,n){var i;return n===36006?i=Y(t)?36009:36160:i=36008,t.bindFramebuffer(i,r)},Jt=function(t,r,n){var i,o=(i={},_(i,34964,34962),_(i,36662,36662),_(i,36663,36663),_(i,35053,35051),_(i,35055,35052),i),a=o[n];t.bindBuffer(a,r)};function So(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Tf=(I={},_(I,3042,Ae),_(I,32773,function(e,t){return e.blendColor.apply(e,re(t))}),_(I,32777,"blendEquation"),_(I,34877,"blendEquation"),_(I,32969,"blendFunc"),_(I,32968,"blendFunc"),_(I,32971,"blendFunc"),_(I,32970,"blendFunc"),_(I,3106,function(e,t){return e.clearColor.apply(e,re(t))}),_(I,3107,function(e,t){return e.colorMask.apply(e,re(t))}),_(I,2884,Ae),_(I,2885,function(e,t){return e.cullFace(t)}),_(I,2929,Ae),_(I,2931,function(e,t){return e.clearDepth(t)}),_(I,2932,function(e,t){return e.depthFunc(t)}),_(I,2928,function(e,t){return e.depthRange.apply(e,re(t))}),_(I,2930,function(e,t){return e.depthMask(t)}),_(I,3024,Ae),_(I,35723,gf),_(I,35725,function(e,t){return e.useProgram(t)}),_(I,36007,function(e,t){return e.bindRenderbuffer(36161,t)}),_(I,36389,function(e,t){var r,n;return(r=(n=e).bindTransformFeedback)===null||r===void 0?void 0:r.call(n,36386,t)}),_(I,34229,function(e,t){return e.bindVertexArray(t)}),_(I,36006,vf),_(I,36010,vf),_(I,34964,Jt),_(I,36662,Jt),_(I,36663,Jt),_(I,35053,Jt),_(I,35055,Jt),_(I,2886,function(e,t){return e.frontFace(t)}),_(I,33170,gf),_(I,2849,function(e,t){return e.lineWidth(t)}),_(I,32823,Ae),_(I,32824,"polygonOffset"),_(I,10752,"polygonOffset"),_(I,35977,Ae),_(I,32926,Ae),_(I,32928,Ae),_(I,32938,"sampleCoverage"),_(I,32939,"sampleCoverage"),_(I,3089,Ae),_(I,3088,function(e,t){return e.scissor.apply(e,re(t))}),_(I,2960,Ae),_(I,2961,function(e,t){return e.clearStencil(t)}),_(I,2968,function(e,t){return e.stencilMaskSeparate(1028,t)}),_(I,36005,function(e,t){return e.stencilMaskSeparate(1029,t)}),_(I,2962,"stencilFuncFront"),_(I,2967,"stencilFuncFront"),_(I,2963,"stencilFuncFront"),_(I,34816,"stencilFuncBack"),_(I,36003,"stencilFuncBack"),_(I,36004,"stencilFuncBack"),_(I,2964,"stencilOpFront"),_(I,2965,"stencilOpFront"),_(I,2966,"stencilOpFront"),_(I,34817,"stencilOpBack"),_(I,34818,"stencilOpBack"),_(I,34819,"stencilOpBack"),_(I,2978,function(e,t){return e.viewport.apply(e,re(t))}),_(I,3333,he),_(I,3317,he),_(I,37440,he),_(I,37441,he),_(I,37443,he),_(I,3330,he),_(I,3332,he),_(I,3331,he),_(I,3314,he),_(I,32878,he),_(I,3316,he),_(I,3315,he),_(I,32877,he),_(I,"framebuffer",function(t,r){var n=r&&"handle"in r?r.handle:r;return t.bindFramebuffer(36160,n)}),_(I,"blend",function(t,r){return r?t.enable(3042):t.disable(3042)}),_(I,"blendColor",function(t,r){return t.blendColor.apply(t,re(r))}),_(I,"blendEquation",function(t,r){var n=typeof r=="number"?[r,r]:r;t.blendEquationSeparate.apply(t,re(n))}),_(I,"blendFunc",function(t,r){var n=r?.length===2?[].concat(re(r),re(r)):r;t.blendFuncSeparate.apply(t,re(n))}),_(I,"clearColor",function(t,r){return t.clearColor.apply(t,re(r))}),_(I,"clearDepth",function(t,r){return t.clearDepth(r)}),_(I,"clearStencil",function(t,r){return t.clearStencil(r)}),_(I,"colorMask",function(t,r){return t.colorMask.apply(t,re(r))}),_(I,"cull",function(t,r){return r?t.enable(2884):t.disable(2884)}),_(I,"cullFace",function(t,r){return t.cullFace(r)}),_(I,"depthTest",function(t,r){return r?t.enable(2929):t.disable(2929)}),_(I,"depthFunc",function(t,r){return t.depthFunc(r)}),_(I,"depthMask",function(t,r){return t.depthMask(r)}),_(I,"depthRange",function(t,r){return t.depthRange.apply(t,re(r))}),_(I,"dither",function(t,r){return r?t.enable(3024):t.disable(3024)}),_(I,"derivativeHint",function(t,r){t.hint(35723,r)}),_(I,"frontFace",function(t,r){return t.frontFace(r)}),_(I,"mipmapHint",function(t,r){return t.hint(33170,r)}),_(I,"lineWidth",function(t,r){return t.lineWidth(r)}),_(I,"polygonOffsetFill",function(t,r){return r?t.enable(32823):t.disable(32823)}),_(I,"polygonOffset",function(t,r){return t.polygonOffset.apply(t,re(r))}),_(I,"sampleCoverage",function(t,r){return t.sampleCoverage.apply(t,re(r))}),_(I,"scissorTest",function(t,r){return r?t.enable(3089):t.disable(3089)}),_(I,"scissor",function(t,r){return t.scissor.apply(t,re(r))}),_(I,"stencilTest",function(t,r){return r?t.enable(2960):t.disable(2960)}),_(I,"stencilMask",function(t,r){r=So(r)?r:[r,r];var n=r,i=To(n,2),o=i[0],a=i[1];t.stencilMaskSeparate(1028,o),t.stencilMaskSeparate(1029,a)}),_(I,"stencilFunc",function(t,r){r=So(r)&&r.length===3?[].concat(re(r),re(r)):r;var n=r,i=To(n,6),o=i[0],a=i[1],c=i[2],u=i[3],p=i[4],b=i[5];t.stencilFuncSeparate(1028,o,a,c),t.stencilFuncSeparate(1029,u,p,b)}),_(I,"stencilOp",function(t,r){r=So(r)&&r.length===3?[].concat(re(r),re(r)):r;var n=r,i=To(n,6),o=i[0],a=i[1],c=i[2],u=i[3],p=i[4],b=i[5];t.stencilOpSeparate(1028,o,a,c),t.stencilOpSeparate(1029,u,p,b)}),_(I,"viewport",function(t,r){return t.viewport.apply(t,re(r))}),I);function ne(e,t,r){return t[e]!==void 0?t[e]:r[e]}var Sf={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))}},Ro={enable:function(t,r){return t(_({},r,!0))},disable:function(t,r){return t(_({},r,!1))},pixelStorei:function(t,r,n){return t(_({},r,n))},hint:function(t,r,n){return t(_({},r,n))},useProgram:function(t,r){return t(_({},35725,r))},bindRenderbuffer:function(t,r,n){return t(_({},36007,n))},bindTransformFeedback:function(t,r,n){return t(_({},36389,n))},bindVertexArray:function(t,r){return t(_({},34229,r))},bindFramebuffer:function(t,r,n){var i;switch(r){case 36160:return t((i={},_(i,36006,n),_(i,36010,n),i));case 36009:return t(_({},36006,n));case 36008:return t(_({},36010,n));default:return null}},bindBuffer:function(t,r,n){var i,o=(i={},_(i,34962,[34964]),_(i,36662,[36662]),_(i,36663,[36663]),_(i,35051,[35053]),_(i,35052,[35055]),i)[r];return o?t(_({},o,n)):{valueChanged:!0}},blendColor:function(t,r,n,i,o){return t(_({},32773,new Float32Array([r,n,i,o])))},blendEquation:function(t,r){var n;return t((n={},_(n,32777,r),_(n,34877,r),n))},blendEquationSeparate:function(t,r,n){var i;return t((i={},_(i,32777,r),_(i,34877,n),i))},blendFunc:function(t,r,n){var i;return t((i={},_(i,32969,r),_(i,32968,n),_(i,32971,r),_(i,32970,n),i))},blendFuncSeparate:function(t,r,n,i,o){var a;return t((a={},_(a,32969,r),_(a,32968,n),_(a,32971,i),_(a,32970,o),a))},clearColor:function(t,r,n,i,o){return t(_({},3106,new Float32Array([r,n,i,o])))},clearDepth:function(t,r){return t(_({},2931,r))},clearStencil:function(t,r){return t(_({},2961,r))},colorMask:function(t,r,n,i,o){return t(_({},3107,[r,n,i,o]))},cullFace:function(t,r){return t(_({},2885,r))},depthFunc:function(t,r){return t(_({},2932,r))},depthRange:function(t,r,n){return t(_({},2928,new Float32Array([r,n])))},depthMask:function(t,r){return t(_({},2930,r))},frontFace:function(t,r){return t(_({},2886,r))},lineWidth:function(t,r){return t(_({},2849,r))},polygonOffset:function(t,r,n){var i;return t((i={},_(i,32824,r),_(i,10752,n),i))},sampleCoverage:function(t,r,n){var i;return t((i={},_(i,32938,r),_(i,32939,n),i))},scissor:function(t,r,n,i,o){return t(_({},3088,new Int32Array([r,n,i,o])))},stencilMask:function(t,r){var n;return t((n={},_(n,2968,r),_(n,36005,r),n))},stencilMaskSeparate:function(t,r,n){return t(_({},r===1028?2968:36005,n))},stencilFunc:function(t,r,n,i){var o;return t((o={},_(o,2962,r),_(o,2967,n),_(o,2963,i),_(o,34816,r),_(o,36003,n),_(o,36004,i),o))},stencilFuncSeparate:function(t,r,n,i,o){var a;return t((a={},_(a,r===1028?2962:34816,n),_(a,r===1028?2967:36003,i),_(a,r===1028?2963:36004,o),a))},stencilOp:function(t,r,n,i){var o;return t((o={},_(o,2964,r),_(o,2965,n),_(o,2966,i),_(o,34817,r),_(o,34818,n),_(o,34819,i),o))},stencilOpSeparate:function(t,r,n,i,o){var a;return t((a={},_(a,r===1028?2964:34817,n),_(a,r===1028?2965:34818,i),_(a,r===1028?2966:34819,o),a))},viewport:function(t,r,n,i,o){return t(_({},2978,[r,n,i,o]))}},Re=function(t,r){return t.isEnabled(r)},Oo=(_e={},_(_e,3042,Re),_(_e,2884,Re),_(_e,2929,Re),_(_e,3024,Re),_(_e,32823,Re),_(_e,32926,Re),_(_e,32928,Re),_(_e,3089,Re),_(_e,2960,Re),_(_e,35977,Re),_e),Af=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 Th(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.
29
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Sh(e,t){if(e){if(typeof e=="string")return Rf(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 Rf(e,t)}}function Rf(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(!Ah(t)){var i={};for(var o in t){var a=Number(o),c=Tf[o];c&&(typeof c=="string"?i[c]=!0:c(n,t[o],a))}var u=n.state&&n.state.cache;if(u)for(var p in i){var b=Sf[p];b(n,t,u)}}}function nn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:er,r=le.attach(e),n=r.gl;if(typeof t=="number"){var i=t,o=Oo[i];return o?o(n,i):n.getParameter(i)}var a=Array.isArray(t)?t:Object.keys(t),c={},u=Th(a),p;try{for(u.s();!(p=u.n()).done;){var b=p.value,g=Oo[b];c[b]=g?g(n,Number(b)):n.getParameter(Number(b))}}catch(v){u.e(v)}finally{u.f()}return c}function Of(e){be(e,er)}function Ah(e){for(var t in e)return!1;return!0}function Ef(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 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 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,Oh(n.key),n)}}function Rh(e,t,r){return t&&wf(e.prototype,t),r&&wf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oh(e){var t=Eh(e,"string");return tr(t)==="symbol"?t:String(t)}function Eh(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)}function wh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ph=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,c=a===void 0?function(){}:a;wh(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?nn(r):Object.assign({},er),this.log=c,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(){H(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 c in n){H(c!==void 0);var u=n[c],p=this.cache[c];Ef(u,p)||(i=!0,o=p,a&&!(c in a)&&(a[c]=p),this.cache[c]=u)}return{valueChanged:i,oldValue:o}},Rh(e)}();function je(e){return e.state}function rr(e,t){var r=t.enable,n=r===void 0?!0:r,i=t.copyState;if(H(i!==void 0),!e.state){e.state=new Ph(e,{copyState:i}),Nh(e);for(var o in Ro){var a=Ro[o];Ih(e,o,a)}Pf(e,"getParameter"),Pf(e,"isEnabled")}var c=je(e);return c.enable=n,e}function Te(e){var t=je(e);t||(rr(e,{copyState:!1}),t=je(e)),t.push()}function ge(e){var t=je(e);H(t),t.pop()}function Pf(e,t){var r=e[t].bind(e);e[t]=function(i){if(i===void 0||Af.has(i))return r(i);var o=je(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 Ih(e,t,r){if(e[t]){var n=e[t].bind(e);e[t]=function(){for(var o=je(e),a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];var p=r.apply(void 0,[o._updateCache].concat(c)),b=p.valueChanged,g=p.oldValue;return b&&n.apply(void 0,c),g},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}}function Nh(e){var t=e.useProgram.bind(e);e.useProgram=function(n){var i=je(e);i.program!==n&&(t(n),i.program=n)}}function nr(e){return nr=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},nr(e)}function If(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 ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?If(Object(r),!0).forEach(function(n){xh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):If(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xh(e,t,r){return t=Ch(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ch(e){var t=Bh(e,"string");return nr(t)==="symbol"?t:String(t)}function Bh(e,t){if(nr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(nr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fh={webgl2:!0,webgl1:!0,powerPreference:"high-performance",onContextLost:function(){return console.error("WebGL context lost")},onContextRestored:function(){return console.info("WebGL context restored")}};function Nf(e,t){t=ht(ht({},Fh),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=ht(ht({},t),{},{webgl1:!1})),t.type==="webgl1"&&(t=ht(ht({},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 c=t,u=c.onContextRestored;e.addEventListener("webglcontextrestored",function(p){return u(p)},!1)}return i}function xf(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,c=o||r,u=e.getParameter(7938),p=Dh(a,c),b=Mh(a,c),g="glsl",v=Y(e)?300:100;return{type:Y(e)?"webgl2":"webgl",gpu:p,gpuBackend:b,vendor:a,renderer:c,version:u,shadingLanguage:g,shadingLanguageVersion:v}}function Dh(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 Mh(e,t){return/ANGLE/i.exec(e)||/ANGLE/i.exec(t)?"angle":/Metal/i.exec(e)||/Metal/i.exec(t)?"metal":"unknown"}function Cf(){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 on(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,Oe;function fr(e){return fr=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},fr(e)}function Uh(e,t){return Xh(e)||Hh(e,t)||Wh(e,t)||jh()}function jh(){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 Wh(e,t){if(e){if(typeof e=="string")return Bf(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 Bf(e,t)}}function Bf(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 Hh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Xh(e){if(Array.isArray(e))return e}function oe(e,t,r){return t=Vh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vh(e){var t=kh(e,"string");return fr(t)==="symbol"?t:String(t)}function kh(e,t){if(fr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fe="texture-compression-bc",Q="texture-compression-astc",Ee="texture-compression-etc2",Lh="texture-compression-etc1-webgl",an="texture-compression-pvrtc-webgl",Eo="texture-compression-atc-webgl",or="WEBGL_compressed_texture_s3tc",ir="WEBGL_compressed_texture_s3tc_srgb",yt="EXT_texture_compression_rgtc",ar="EXT_texture_compression_bptc",Kh="WEBGL_compressed_texture_etc",Yh="WEBGL_compressed_texture_astc",zh="WEBGL_compressed_texture_etc1",$h="WEBGL_compressed_texture_pvrtc",Zh="WEBGL_compressed_texture_atc",Ff="EXT_sRGB",Ie="EXT_texture_norm16",Qh="WEBGL_color_buffer_float",qh="EXT_color_buffer_float",Se=function(t,r){return t.getExtension(r)},We=function(t,r){return r.every(function(n){return t.getExtension(n)})},wo={"texture-blend-float-webgl1":function(t){return Y(t)?!0:Se(t,"EXT_float_blend")},"texture-formats-srgb-webgl1":function(t){return Y(t)?!0:Se(t,Ff)},"texture-formats-depth-webgl1":function(t){return Y(t)?!0:Se(t,"WEBGL_depth_texture")},"texture-formats-float32-webgl1":function(t){return Y(t)?!0:Se(t,"OES_texture_float")},"texture-formats-float16-webgl1":function(t){return Y(t)?!0:Se(t,"OES_texture_half_float")},"texture-formats-norm16-webgl":function(t){return Y(t)?Se(t,Ie):!1},"texture-filter-linear-float32-webgl":function(t){return Se(t,"OES_texture_float_linear")},"texture-filter-linear-float16-webgl":function(t){return Se(t,"OES_texture_half_float_linear")},"texture-filter-anisotropic-webgl":function(t){return Se(t,"EXT_texture_filter_anisotropic")},"texture-renderable-float32-webgl":function(t){return Se(t,"EXT_color_buffer_float")},"texture-renderable-float16-webgl":function(t){return Se(t,"EXT_color_buffer_half_float")},"texture-compression-bc":function(t){return We(t,[or,ir,yt,ar])},"texture-compression-bc5-webgl":function(t){return We(t,[yt])},"texture-compression-etc2":function(t){return We(t,[Kh])},"texture-compression-astc":function(t){return We(t,[Yh])},"texture-compression-etc1-webgl":function(t){return We(t,[zh])},"texture-compression-pvrtc-webgl":function(t){return We(t,[$h])},"texture-compression-atc-webgl":function(t){return We(t,[Zh])}};function Jh(e,t){var r;return((r=wo[t])===null||r===void 0?void 0:r.call(wo,e))||!1}function Df(e){var t=Object.keys(wo);return t.filter(function(r){return Jh(e,r)})}var He={"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:Ie},"r16snorm-webgl":{gl:36760,b:2,c:1,f:"texture-formats-norm16-webgl",x:Ie},"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:Ff,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:Ie},"rg16snorm-webgl":{gl:36761,b:2,c:2,f:"texture-formats-norm16-webgl",x:Ie},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:Ie},"rgb16snorm-webgl":{gl:36762,b:2,c:3,f:"texture-formats-norm16-webgl",x:Ie},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:Ie},"rgba16snorm-webgl":{gl:36763,b:2,c:4,f:"texture-formats-norm16-webgl",x:Ie},"rgb32float-webgl":{gl:34837,gl1:6407,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",gl2ext:qh,gl1ext:Qh,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:or,f:fe},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:ir,f:fe},"bc1-rgba-unorm":{gl:33777,x:or,f:fe},"bc1-rgba-unorm-srgb":{gl:35916,x:ir,f:fe},"bc2-rgba-unorm":{gl:33778,x:or,f:fe},"bc2-rgba-unorm-srgb":{gl:35918,x:ir,f:fe},"bc3-rgba-unorm":{gl:33779,x:or,f:fe},"bc3-rgba-unorm-srgb":{gl:35919,x:ir,f:fe},"bc4-r-unorm":{gl:36283,x:yt,f:fe},"bc4-r-snorm":{gl:36284,x:yt,f:fe},"bc5-rg-unorm":{gl:36285,x:yt,f:fe},"bc5-rg-snorm":{gl:36286,x:yt,f:fe},"bc6h-rgb-ufloat":{gl:36495,x:ar,f:fe},"bc6h-rgb-float":{gl:36494,x:ar,f:fe},"bc7-rgba-unorm":{gl:36492,x:ar,f:fe},"bc7-rgba-unorm-srgb":{gl:36493,x:ar,f:fe},"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:an},"pvrtc-rgba4unorm-webgl":{gl:35842,f:an},"pvrtc-rbg2unorm-webgl":{gl:35841,f:an},"pvrtc-rgba2unorm-webgl":{gl:35843,f:an},"etc1-rbg-unorm-webgl":{gl:36196,f:Lh},"atc-rgb-unorm-webgl":{gl:35986,f:Eo},"atc-rgba-unorm-webgl":{gl:35986,f:Eo},"atc-rgbai-unorm-webgl":{gl:34798,f:Eo}},Gh=(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),ey=(Oe={},oe(Oe,5126,4),oe(Oe,5125,4),oe(Oe,5124,4),oe(Oe,5123,2),oe(Oe,5122,2),oe(Oe,5131,2),oe(Oe,5120,1),oe(Oe,5121,1),Oe);function ur(e,t){var r=Xe(t),n=He[r];if(!n||(Y(e)?n.gl===void 0:n.gl1===void 0))return!1;var i=n.x||Y(e)&&n.gl2ext||n.gl1ext;return i?Boolean(e.getExtension(i)):!0}function Mf(e,t){var r;return ur(e,t)&&((r=He[t])===null||r===void 0?void 0:r.renderbuffer)}function Xe(e){if(typeof e=="string")return e;var t=Object.entries(He).find(function(r){var n=Uh(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 cr(e,t){var r=He[e],n=t?r?.gl:r?.gl1;if(n===void 0)throw new Error("Unsupported texture format ".concat(e));return n}function Uf(e,t){var r=Xe(t);if(!ur(e,r))return!1;try{var n=Jr(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 jf(e,t){var r=Xe(t);return!(!ur(e,r)||typeof r=="number")}function _t(e,t){var r=Xe(e),n=cr(r,t),i=Jr(r);return{format:n,dataFormat:ty(i.format,i.integer,i.normalized,n),type:i.dataType?on(i.dataType):5121,compressed:i.compressed}}function Wf(e){var t=He[e];if(!(t!=null&&t.attachment))throw new Error("".concat(e," is not a depth stencil format"));return t.attachment}function fn(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,c=1,u=1,p=0,b=new Uint8Array([0,0,255,255]);e.texImage2D(3553,a,t,c,u,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 sr(e,t){var r=Xe(e),n=_t(r,t),i=Gh[n.dataFormat]||4,o=ey[n.type]||1;return i*o}function ty(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 ry(e,t){return iy(e)||oy(e,t)||Xf(e,t)||ny()}function ny(){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 oy(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function iy(e){if(Array.isArray(e))return e}function ay(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Xf(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,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Xf(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 Vf(e){var t=fy(e),r=ay(Df(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 fy(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(kf);r<n.length;r++){var i=n[r];uy(e,i)&&t.add(i)}return t}function uy(e,t){var r=kf[t];if(!r)return!1;var n=r||[],i=ry(n,2),o=i[0],a=i[1],c=Y(e)?a:o;if(typeof c=="boolean")return c;switch(t){case"texture-renderable-rgba32float-webgl":return Y(e)?Boolean(e.getExtension(c)):fn(e);case"glsl-derivatives":return Io(e,c);case"glsl-frag-data":return Io(e,c,{behavior:"require"});case"glsl-frag-depth":return Io(e,c);default:return Boolean(e.getExtension(c))}}var Po={};function Io(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!Cf(r))return!0;if(t in Po)return Po[t];var n=r.behavior||"enable",i="#extension GL_".concat(t," : ").concat(n,`
33
- 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 kf={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 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 k(e,t,r){return t=cy(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cy(e){var t=sy(e,"string");return lr(t)==="symbol"?t:String(t)}function sy(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 Lf(e){var t=Zt(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 Kf(e){var t,r=Zt(e);function n(o){return e.getParameter(o)}function i(o,a){return r?r.getParameter(o):a||0}return t={},k(t,33902,n(33902)),k(t,33901,n(33901)),k(t,3379,n(3379)),k(t,34076,n(34076)),k(t,34930,n(34930)),k(t,35661,n(35661)),k(t,35660,n(35660)),k(t,34024,n(34024)),k(t,36348,n(36348)),k(t,34921,n(34921)),k(t,36347,n(36347)),k(t,36349,n(36349)),k(t,3386,n(3386)),k(t,34047,n(34047)),k(t,32883,i(32883)),k(t,35071,i(35071)),k(t,37447,i(37447)),k(t,36063,i(36063)),k(t,35379,i(35379)),k(t,35374,i(35374)),k(t,35377,i(35377)),k(t,34852,i(34852)),k(t,36203,i(36203)),k(t,33001,i(33001)),k(t,33e3,i(33e3)),k(t,37157,i(37157)),k(t,35373,i(35373)),k(t,35657,i(35657)),k(t,36183,i(36183)),k(t,37137,i(37137)),k(t,34045,i(34045)),k(t,35978,i(35978)),k(t,35979,i(35979)),k(t,35968,i(35968)),k(t,35376,i(35376)),k(t,35375,i(35375)),k(t,35659,i(35659)),k(t,37154,i(37154)),k(t,35371,i(35371)),k(t,35658,i(35658)),k(t,35076,i(35076)),k(t,35077,i(35077)),k(t,35380,i(35380)),t}function ve(e,t,r){var n=le.attach(e),i=n.gl;if(ly(t))return r(e);var o=t.nocatch,a=o===void 0?!0:o;Te(i),be(i,t);var c;if(a)c=r(i),ge(i);else try{c=r(i)}finally{ge(i)}return c}function ly(e){for(var t in e)return!1;return!0}function zf(e,t,r,n){if(Qe(t))return n(e);Te(e.gl);try{return sn(e,t),be(e,r),n(e)}finally{ge(e.gl)}}function $f(e,t,r){if(Qe(t))return r(e);Te(e.gl);try{return sn(e,t),r(e)}finally{ge(e.gl)}}function sn(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(pr("frontFace",t.frontFace,{ccw:2305,cw:2304})),t.depthBias!==void 0&&n.polygonOffset(t.depthBias,t.depthBiasSlopeScale||0),t.depthWriteEnabled!==void 0&&n.depthMask(dy("depthWriteEnabled",t.depthWriteEnabled)),t.depthCompare&&(t.depthCompare!=="always"?n.enable(2929):n.disable(2929),n.depthFunc(cn("depthCompare",t.depthCompare))),t.stencilWriteMask){var i=t.stencilWriteMask;n.stencilMaskSeparate(1028,i),n.stencilMaskSeparate(1029,i)}if(t.stencilReadMask&&D.warn("stencilReadMask not supported under WebGL"),t.stencilCompare){var o=t.stencilReadMask||4294967295,a=cn("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 c=No("stencilPassOperation",t.stencilPassOperation),u=No("stencilFailOperation",t.stencilFailOperation),p=No("stencilDepthFailOperation",t.stencilDepthFailOperation);n.stencilOpSeparate(1028,u,p,c),n.stencilOpSeparate(1029,u,p,c)}if(t.blendColorOperation||t.blendAlphaOperation){n.enable(3042);var b=Yf("blendColorOperation",t.blendColorOperation||"add"),g=Yf("blendAlphaOperation",t.blendAlphaOperation||"add");n.blendEquationSeparate(b,g);var v=un("blendColorSrcFactor",t.blendColorSrcFactor||"one"),S=un("blendColorDstFactor",t.blendColorDstFactor||"zero"),T=un("blendAlphaSrcFactor",t.blendAlphaSrcFactor||"one"),E=un("blendAlphaDstFactor",t.blendAlphaDstFactor||"zero");n.blendFuncSeparate(v,S,T,E)}}function cn(e,t){return pr(e,t,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function No(e,t){return pr(e,t,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function Yf(e,t){return pr(e,t,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function un(e,t){return pr(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 py(e,t){return"Illegal parameter ".concat(t," for ").concat(e)}function pr(e,t,r){if(!(t in r))throw new Error(py(e,t));return r[t]}function dy(e,t){return t}function dr(e){return dr=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},dr(e)}function Zf(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 hy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zf(Object(r),!0).forEach(function(n){yy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yy(e,t,r){return t=_y(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _y(e){var t=by(e,"string");return dr(t)==="symbol"?t:String(t)}function by(e,t){if(dr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(dr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ln(e){var t={};return e.addressModeU&&(t[10242]=xo(e.addressModeU)),e.addressModeV&&(t[10243]=xo(e.addressModeV)),e.addressModeW&&(t[32882]=xo(e.addressModeW)),e.magFilter&&(t[10240]=Qf(e.magFilter)),(e.minFilter||e.mipmapFilter)&&(t[10241]=gy(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]=cn("compare",e.compare)),e.maxAnisotropy&&(t[34046]=e.maxAnisotropy),t}function xo(e){switch(e){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function Qf(e){switch(e){case"nearest":return 9728;case"linear":return 9729}}function gy(e,t){if(!t)return Qf(e);switch(e){case"nearest":return t==="nearest"?9984:9986;case"linear":return t==="nearest"?9985:9987}}function qf(e){var t=hy({},e);return e[10241]!==9728&&(t[10241]=9729),t[10242]=33071,t[10243]=33071,t}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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 S(){}function T(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=T.prototype=v.prototype=Object.create(E);function x(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var F=R.arg,C=F.value;return C&&Ne(C)=="object"&&r.call(C,"__await")?f.resolve(C.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(C).then(function(U){F.value=U,m(F)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,F){s(h,m,R,F)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return S.prototype=T,n(w,"constructor",{value:T,configurable:!0}),n(T,"constructor",{value:S,configurable:!0}),S.displayName=u(T,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===S||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,T):(l.__proto__=T,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},x(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},x(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(F,C){return m.type="throw",m.arg=f,s.next=F,C&&(s.method="next",s.arg=void 0),!!C}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function Jf(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function vy(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){Jf(o,n,i,a,c,"next",u)}function c(u){Jf(o,n,i,a,c,"throw",u)}a(void 0)})}}function Gf(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 eu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gf(Object(r),!0).forEach(function(n){my(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function my(e,t,r){return t=ru(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ne(e){return Ne=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},Ne(e)}function tu(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,ru(n.key),n)}}function Ty(e,t,r){return t&&tu(e.prototype,t),r&&tu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ru(e){var t=Sy(e,"string");return Ne(t)==="symbol"?t:String(t)}function Sy(e,t){if(Ne(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ne(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ay(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ry(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=Py();return function(){var n=pn(e),i;if(t){var o=pn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ey(this,i)}}function Ey(e,t){if(t&&(Ne(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wy(e)}function wy(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Py(){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 pn(e){return pn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pn(e)}var Iy=10,pe=function(e){Ry(r,e);var t=Oy(r);function r(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ay(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 c=Ne(a)==="object"?a.handle:void 0;return o.handle=c||o.gl.createBuffer(),i.setSpectorMetadata(o.handle,eu(eu({},o.props),{},{data:Ne(o.props.data)})),o.glTarget=Ny(o.props.usage),o.glUsage=xy(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,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:o.byteLength+a;H(ArrayBuffer.isView(o));var u=this._getWriteTarget();return this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,c,this.glUsage),this.gl.bufferSubData(u,a,o),this.gl.bindBuffer(u,null),this.debugData=o.slice(0,Iy),this.bytesUsed=c,this.byteLength=c,this.trackAllocatedMemory(c),this},n._initWithByteLength=function(o){H(o>=0);var a=o;o===0&&(a=new Float32Array(0));var c=this._getWriteTarget();return this.gl.bindBuffer(c,this.handle),this.gl.bufferData(c,a,this.glUsage),this.gl.bindBuffer(c,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,c=0,u=void 0,p=this.device.isWebGL2?36663:this.glTarget;this.gl.bindBuffer(p,this.handle),c!==0||u!==void 0?(this.device.assertWebGL2(),this.gl2.bufferSubData(p,a,o,c,u)):this.gl.bufferSubData(p,a,o),this.gl.bindBuffer(p,null)},n.readAsync=function(){var i=vy(Co().mark(function a(){var c,u,p,b,g,v=arguments;return Co().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return u=v.length>0&&v[0]!==void 0?v[0]:0,p=v.length>1?v[1]:void 0,this.device.assertWebGL2(),p=(c=p)!==null&&c!==void 0?c:this.byteLength,b=new Uint8Array(p),g=0,this.gl.bindBuffer(36662,this.handle),this.gl2.getBufferSubData(36662,u,b,g,p),this.gl.bindBuffer(36662,null),T.abrupt("return",b);case 10:case"end":return T.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},Ty(r)}(te);function Ny(e){return e&te.INDEX?34963:e&te.VERTEX?34962:e&te.UNIFORM?35345:34962}function xy(e){return e&te.INDEX||e&te.VERTEX?35044:e&te.UNIFORM?35048:35044}function bt(e){return bt=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},bt(e)}function Cy(e,t){return My(e)||Dy(e,t)||Fy(e,t)||By()}function By(){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 Fy(e,t){if(e){if(typeof e=="string")return nu(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 nu(e,t)}}function nu(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 Dy(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function My(e){if(Array.isArray(e))return e}function ou(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,jy(n.key),n)}}function Uy(e,t,r){return t&&ou(e.prototype,t),r&&ou(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jy(e){var t=Wy(e,"string");return bt(t)==="symbol"?t:String(t)}function Wy(e,t){if(bt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xy(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 Vy(e){var t=Ky();return function(){var n=dn(e),i;if(t){var o=dn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ky(this,i)}}function ky(e,t){if(t&&(bt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ly(e)}function Ly(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ky(){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 dn(e){return dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dn(e)}var Ve=function(e){Xy(r,e);var t=Vy(r);function r(i,o){var a;return Hy(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=ln(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,c=Object.entries(o);a<c.length;a++){var u=Cy(c[a],2),p=u[0],b=u[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}}},Uy(r)}(Mr);function Do(){"use strict";Do=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 S(){}function T(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=T.prototype=v.prototype=Object.create(E);function x(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var F=R.arg,C=F.value;return C&&Ce(C)=="object"&&r.call(C,"__await")?f.resolve(C.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(C).then(function(U){F.value=U,m(F)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,F){s(h,m,R,F)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return S.prototype=T,n(w,"constructor",{value:T,configurable:!0}),n(T,"constructor",{value:S,configurable:!0}),S.displayName=u(T,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===S||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,T):(l.__proto__=T,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},x(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},x(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(F,C){return m.type="throw",m.arg=f,s.next=F,C&&(s.method="next",s.arg=void 0),!!C}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function iu(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function zy(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){iu(o,n,i,a,c,"next",u)}function c(u){iu(o,n,i,a,c,"throw",u)}a(void 0)})}}function au(e,t){return Qy(e)||Zy(e,t)||su(e,t)||$y()}function $y(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zy(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Qy(e){if(Array.isArray(e))return e}function qy(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=su(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,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function su(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 Ce(e){return Ce=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},Ce(e)}function uu(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 hn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uu(Object(r),!0).forEach(function(n){Jy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jy(e,t,r){return t=lu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cu(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,lu(n.key),n)}}function Gy(e,t,r){return t&&cu(e.prototype,t),r&&cu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lu(e){var t=e_(e,"string");return Ce(t)==="symbol"?t:String(t)}function e_(e,t){if(Ce(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ce(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function t_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r_(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&&Mo(e,t)}function Mo(e,t){return Mo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Mo(e,t)}function n_(e){var t=i_();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 o_(this,i)}}function o_(e,t){if(t&&(Ce(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pu(e)}function pu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i_(){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 a_={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0},se=function(e){r_(r,e);var t=n_(r);function r(i,o){var a,c;return t_(this,r),c=t.call(this,i,hn(hn({},a_),{},{format:"rgba8unorm"},o)),c.MAX_ATTRIBUTES=void 0,c.device=void 0,c.gl=void 0,c.gl2=void 0,c.handle=void 0,c.sampler=void 0,c.glFormat=void 0,c.type=void 0,c.dataFormat=void 0,c.mipmaps=void 0,c.target=void 0,c.textureUnit=void 0,c.loaded=!1,c._video=void 0,c.device=i,c.gl=c.device.gl,c.gl2=c.device.gl2,c.handle=c.props.handle||c.gl.createTexture(),c.device.setSpectorMetadata(c.handle,hn(hn({},c.props),{},{data:Ce(c.props.data)})),c.glFormat=6408,c.target=f_(c.props),c.loaded=!1,typeof((a=c.props)===null||a===void 0?void 0:a.data)=="string"&&Object.assign(c.props,{data:go(c.props.data)}),c.initialize(c.props),Object.seal(pu(c)),c}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 c=a.data;if(c instanceof Promise)return c.then(function(f){return o.initialize(Object.assign({},a,{pixels:f,data:f}))}),this;var u=typeof HTMLVideoElement<"u"&&c instanceof HTMLVideoElement;if(u&&c.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,c.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,S=a.pixelStore,T=S===void 0?{}:S,E=a.textureUnit,P=E===void 0?void 0:E;c||(c=v);var O=a.width,w=a.height,x=a.dataFormat,N=a.type,X=a.compressed,M=X===void 0?!1:X,K=a.mipmaps,W=K===void 0?!0:K,V=a.depth,j=V===void 0?0:V,L=cr(a.format,this.device.isWebGL2),l=this._deduceParameters({format:a.format,type:N,dataFormat:x,compressed:M,data:c,width:O,height:w});return O=l.width,w=l.height,M=l.compressed,x=l.dataFormat,N=l.type,this.width=O,this.height=w,this.glFormat=L,this.type=N,this.dataFormat=x,this.textureUnit=P,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),W&&this.device.isWebGL1&&yn(this.width,this.height)&&(D.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaps"))(),W=!1),this.mipmaps=W,this.setImageData({data:c,width:O,height:w,depth:j,format:L,type:N,dataFormat:x,parameters:T,compressed:M}),this.setSampler(a.sampler),this._setSamplerParameters(b),W&&this.generateMipmap(),u&&(this._video={video:c,parameters:b,lastTime:c.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?c.currentTime:-1}),this},n.initializeCube=function(o){var a=this,c=o.mipmaps,u=c===void 0?!0:c,p=o.parameters,b=p===void 0?{}:p;return this.setCubeMapImageData(o).then(function(){a.loaded=!0,u&&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 Ve?(this.sampler=o,a=o.props):(this.sampler=new Ve(this.device,o),a=o);var c=ln(a);return this._setSamplerParameters(c),this},n.resize=function(o){var a=o.height,c=o.width,u=o.mipmaps,p=u===void 0?!1:u;return c!==this.width||a!==this.height?this.initialize({width:c,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,c=o.parameters,u=o.lastTime;if(u===a.currentTime||a.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:a,parameters:c}),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&&yn(this.width,this.height)?(D.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 c=o.target,u=c===void 0?this.target:c,p=o.pixels,b=p===void 0?null:p,g=o.level,v=g===void 0?0:g,S=o.glFormat,T=S===void 0?this.glFormat:S,E=o.offset,P=E===void 0?0:E,O=o.parameters,w=O===void 0?{}:O,x=o.data,N=x===void 0?null:x,X=o.type,M=X===void 0?this.type:X,K=o.width,W=K===void 0?this.width:K,V=o.height,j=V===void 0?this.height:V,L=o.dataFormat,l=L===void 0?this.dataFormat:L,f=o.compressed,s=f===void 0?!1:f;N||(N=b);var d=this._deduceParameters({format:this.props.format,type:M,dataFormat:l,compressed:s,data:N,width:W,height:j});M=d.type,l=d.dataFormat,s=d.compressed,W=d.width,j=d.height;var y=this.gl;y.bindTexture(this.target,this.handle);var h=null,m=this._getDataType({data:N,compressed:s});N=m.data,h=m.dataType;var A;if(ve(this.gl,w,function(){switch(h){case"null":y.texImage2D(u,v,T,W,j,0,l,M,N);break;case"typed-array":y.texImage2D(u,v,T,W,j,0,l,M,N,P);break;case"buffer":A=a.device.assertWebGL2(),A.bindBuffer(35052,N.handle||N),A.texImage2D(u,v,T,W,j,0,l,M,P),A.bindBuffer(35052,null);break;case"browser-object":a.device.isWebGL2?y.texImage2D(u,v,T,W,j,0,l,M,N):y.texImage2D(u,v,T,l,M,N);break;case"compressed":var F=qy(N.entries()),C;try{for(F.s();!(C=F.n()).done;){var U=au(C.value,2),Uc=U[0],mr=U[1];y.compressedTexImage2D(u,Uc,mr.format,mr.width,mr.height,0,mr.data)}}catch(jc){F.e(jc)}finally{F.f()}break;default:H(!1,"Unknown image data type")}}),N&&N.byteLength)this.trackAllocatedMemory(N.byteLength,"Texture");else{var R=sr(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*R,"Texture")}return this.loaded=!0,this},n.setSubImageData=function(o){var a=this,c=o.target,u=c===void 0?this.target:c,p=o.pixels,b=p===void 0?null:p,g=o.data,v=g===void 0?null:g,S=o.x,T=S===void 0?0:S,E=o.y,P=E===void 0?0:E,O=o.width,w=O===void 0?this.width:O,x=o.height,N=x===void 0?this.height:x,X=o.level,M=X===void 0?0:X,K=o.glFormat,W=K===void 0?this.glFormat:K,V=o.type,j=V===void 0?this.type:V,L=o.dataFormat,l=L===void 0?this.dataFormat:L,f=o.compressed,s=f===void 0?!1:f,d=o.offset,y=d===void 0?0:d,h=o.parameters,m=h===void 0?{}:h,A=this._deduceParameters({format:this.props.format,type:j,dataFormat:l,compressed:s,data:v,width:w,height:N});if(j=A.type,l=A.dataFormat,s=A.compressed,w=A.width,N=A.height,H(this.depth===1,"texSubImage not supported for 3D textures"),v||(v=b),v&&v.data){var R=v;v=R.data,w=R.shape[0],N=R.shape[1]}v instanceof pe&&(v=v.handle),this.gl.bindTexture(this.target,this.handle),ve(this.gl,m,function(){if(s)a.gl.compressedTexSubImage2D(u,M,T,P,w,N,W,v);else if(v===null)a.gl.texSubImage2D(u,M,T,P,w,N,l,j,null);else if(ArrayBuffer.isView(v))a.gl.texSubImage2D(u,M,T,P,w,N,l,j,v,y);else if(typeof WebGLBuffer<"u"&&v instanceof WebGLBuffer){var F=a.device.assertWebGL2();F.bindBuffer(35052,v),F.texSubImage2D(u,M,T,P,w,N,l,j,y),F.bindBuffer(35052,null)}else if(a.device.isWebGL2){var C=a.device.assertWebGL2();C.texSubImage2D(u,M,T,P,w,N,l,j,v)}else a.gl.texSubImage2D(u,M,T,P,l,j,v)}),this.gl.bindTexture(this.target,null)},n.copyFramebuffer=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return D.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,c=o.compressed,u=c===void 0?!1:c;return u?{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,c=o.data,u=o.width,p=o.height,b=o.dataFormat,g=o.type,v=o.compressed,S=_t(a,this.device.isWebGL2);b=b||S.dataFormat,g=g||S.type,v=v||S.compressed;var T=this._deduceImageSize(c,u,p);return u=T.width,p=T.height,{dataFormat:b,type:g,compressed:v,width:u,height:p,format:a,data:c}},n._deduceImageSize=function(o,a,c){var u;return typeof ImageData<"u"&&o instanceof ImageData?u={width:o.width,height:o.height}:typeof HTMLImageElement<"u"&&o instanceof HTMLImageElement?u={width:o.naturalWidth,height:o.naturalHeight}:typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement?u={width:o.width,height:o.height}:typeof ImageBitmap<"u"&&o instanceof ImageBitmap?u={width:o.width,height:o.height}:typeof HTMLVideoElement<"u"&&o instanceof HTMLVideoElement?u={width:o.videoWidth,height:o.videoHeight}:o?u={width:a,height:c}:u={width:a>=0?a:1,height:c>=0?c:1},H(u,"Could not deduced texture size"),H(a===void 0||u.width===a,"Deduced texture width does not match supplied width"),H(c===void 0||u.height===c,"Deduced texture height does not match supplied height"),u},n.setCubeMapImageData=function(){var i=zy(Do().mark(function a(c){var u=this,p,b,g,v,S,T,E,P,O,w,x;return Do().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return p=this.gl,b=c.width,g=c.height,v=c.pixels,S=c.data,T=c.format,E=T===void 0?6408:T,P=c.type,O=P===void 0?5121:P,w=v||S,X.next=5,Promise.all(r.FACES.map(function(M){var K=w[M];return Promise.all(Array.isArray(K)?K:[K])}));case 5:x=X.sent,this.bind(),r.FACES.forEach(function(M,K){x[K].length>1&&u.props.mipmaps!==!1&&D.warn("".concat(u.id," has mipmap and multiple LODs."))(),x[K].forEach(function(W,V){b&&g?p.texImage2D(M,V,E,b,g,0,E,O,W):p.texImage2D(M,V,E,E,O,W)})}),this.unbind();case 9:case"end":return X.stop()}},a,this)}));function o(a){return i.apply(this,arguments)}return o}(),n.setImageDataForFace=function(o){var a=this,c=o.face,u=o.width,p=o.height,b=o.pixels,g=o.data,v=o.format,S=v===void 0?6408:v,T=o.type,E=T===void 0?5121:T,P=this.gl,O=b||g;return this.bind(),O instanceof Promise?O.then(function(w){return a.setImageDataForFace(Object.assign({},o,{face:c,data:w,pixels:w}))}):this.width||this.height?P.texImage2D(c,0,S,u,p,0,S,E,O):P.texImage2D(c,0,S,S,E,O),this},n.setImageData3D=function(o){var a=this,c=o.level,u=c===void 0?0:c,p=o.dataFormat,b=o.format,g=o.type,v=o.width,S=o.height,T=o.depth,E=T===void 0?1:T,P=o.offset,O=P===void 0?0:P,w=o.data,x=o.parameters,N=x===void 0?{}:x;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);var X=_t(b,this.device.isWebGL2);if(ve(this.gl,N,function(){ArrayBuffer.isView(w)&&a.gl.texImage3D(a.target,u,X.format,v,S,E,0,X.dataFormat,X.type,w),w instanceof pe&&(a.gl.bindBuffer(35052,w.handle),a.gl.texImage3D(a.target,u,p,v,S,E,0,b,g,O))}),w&&w.byteLength)this.trackAllocatedMemory(w.byteLength,"Texture");else{var M=sr(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*this.depth*M,"Texture")}return this.loaded=!0,this},n._setSamplerParameters=function(o){if(this.device.isWebGL1&&yn(this.width,this.height)&&(o=qf(o)),!Qe(o)){u_(o),this.gl.bindTexture(this.target,this.handle);for(var a=0,c=Object.entries(o);a<c.length;a++){var u=au(c[a],2),p=u[0],b=u[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 c=this.device.isWebGL1&&yn(this.width,this.height);if(c)switch(o){case 10241:if(a!==9729&&a!==9728)return 9729;break;case 10242:case 10243:return 33071;default:break}return a},Gy(r)}(ae);se.FACES=[34069,34070,34071,34072,34073,34074];function f_(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 yn(e,t){return!e||!t?!1:!Pr(e)||!Pr(t)}function u_(e){D.log(1,"texture sampler parameters",e)()}function bn(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 H(n!==void 0,"Accessing undefined constant GL.".concat(t)),n}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 c_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s_(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.
37
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function s_(e,t){if(e){if(typeof e=="string")return du(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 du(e,t)}}function du(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 l_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hu(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,d_(n.key),n)}}function p_(e,t,r){return t&&hu(e.prototype,t),r&&hu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function d_(e){var t=h_(e,"string");return vt(t)==="symbol"?t:String(t)}function h_(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 y_(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&&Uo(e,t)}function Uo(e,t){return Uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Uo(e,t)}function __(e){var t=v_();return function(){var n=gn(e),i;if(t){var o=gn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return b_(this,i)}}function b_(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 g_(e)}function g_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v_(){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 gn(e){return gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gn(e)}var gt="Resource subclass must define virtual methods",hr=function(e){y_(r,e);var t=__(r);function r(i,o,a){var c;l_(this,r),c=t.call(this,i,o,a),c.device=void 0,c.gl=void 0,c.gl2=void 0,c._handle=void 0,c._bound=!1,c.byteLength=0,c.device=le.attach(i);var u=c.device.gl;Gr(u);var p=o||{},b=p.id;return c.gl=u,c.gl2=u,c.id=b||me(c.constructor.name),c._handle=o?.handle,c._handle===void 0&&(c._handle=c._createHandle()),c.byteLength=0,c}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,c=a===void 0?!1:a,u=this._handle&&this._deleteHandle(this._handle);return this._handle&&this.removeStats(),this._handle=null,u&&c&&u.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=bn(this.gl,o),H(o);var c=this.constructor.PARAMETERS||{},u=c[o];if(u){var p=Y(this.gl),b=(!("webgl2"in u)||p)&&(!("extension"in u)||this.gl.getExtension(u.extension));if(!b){var g=u.webgl1,v="webgl2"in u?u.webgl2:u.webgl1,S=p?v:g;return S}}return this._getParameter(o,a)},n.getParameters=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=o.parameters,c=o.keys,u=this.constructor.PARAMETERS||{},p=Y(this.gl),b={},g=a||Object.keys(u),v=c_(g),S;try{for(v.s();!(S=v.n()).done;){var T=S.value,E=u[T],P=E&&(!("webgl2"in E)||p)&&(!("extension"in E)||this.gl.getExtension(E.extension));if(P){var O=c?this.device.getGLKey(T):T;b[O]=this.getParameter(T,o),c&&E.type==="GLenum"&&(b[O]=this.device.getGLKey(b[O]))}}}catch(w){v.e(w)}finally{v.f()}return b},n.setParameter=function(o,a){o=bn(this.gl,o),H(o);var c=this.constructor.PARAMETERS||{},u=c[o];if(u){var p=Y(this.gl),b=(!("webgl2"in u)||p)&&(!("extension"in u)||this.gl.getExtension(u.extension));if(!b)throw new Error("Parameter not available on this platform");u.type==="GLenum"&&(a=bn(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,c){return po(this,o,a,c)},n.initialize=function(o){},n._createHandle=function(){throw new Error(gt)},n._deleteHandle=function(){throw new Error(gt)},n._bindHandle=function(o){throw new Error(gt)},n._getOptsFromHandle=function(){throw new Error(gt)},n._getParameter=function(o,a){throw new Error(gt)},n._setParameter=function(o,a){throw new Error(gt)},p_(r,[{key:"handle",get:function(){return this._handle}}]),r}($);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 gu;function yu(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?yu(Object(r),!0).forEach(function(n){m_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function m_(e,t,r){return t=vu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bu(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,vu(n.key),n)}}function S_(e,t,r){return t&&bu(e.prototype,t),r&&bu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vu(e){var t=A_(e,"string");return mt(t)==="symbol"?t:String(t)}function A_(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)}function R_(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 O_(e){var t=P_();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 E_(this,i)}}function E_(e,t){if(t&&(mt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w_(e)}function w_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P_(){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)}gu=Symbol.toStringTag;var Tt=function(e){R_(r,e);var t=O_(r);r.isTextureFormatSupported=function(o,a){return Mf(o.gl,a)};function r(i,o){var a;if(T_(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=cr(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,_u(_u({},o),{},{format:this.format,samples:this.samples})),this._initialize(this.props))},n._initialize=function(o){var a=o.format,c=o.width,u=o.height,p=o.samples;H(a,"Needs format"),this.trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),p!==0&&this.device.isWebGL2?this.gl2.renderbufferStorageMultisample(36161,p,this.glFormat,c,u):this.gl.renderbufferStorage(36161,this.glFormat,c,u),this.gl.bindRenderbuffer(36161,null),this.trackAllocatedMemory(c*u*(p||1)*sr(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)},S_(r,[{key:gu,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}(hr);Tt.defaultProps={id:void 0,handle:void 0,userData:void 0,format:void 0,width:1,height:1,samples:0};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 I_(e,t){return C_(e)||x_(e,t)||Su(e,t)||N_()}function N_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
38
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x_(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function C_(e){if(Array.isArray(e))return e}function B_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Su(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.
39
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Su(e,t){if(e){if(typeof e=="string")return mu(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 mu(e,t)}}function mu(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 F_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tu(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,M_(n.key),n)}}function D_(e,t,r){return t&&Tu(e.prototype,t),r&&Tu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function M_(e){var t=U_(e,"string");return St(t)==="symbol"?t:String(t)}function U_(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 mn(){return typeof Reflect<"u"&&Reflect.get?mn=Reflect.get.bind():mn=function(t,r,n){var i=j_(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},mn.apply(this,arguments)}function j_(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=At(e),e!==null););return e}function W_(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&&Wo(e,t)}function Wo(e,t){return Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Wo(e,t)}function H_(e){var t=k_();return function(){var n=At(e),i;if(t){var o=At(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return X_(this,i)}}function X_(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 V_(e)}function V_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k_(){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 At(e){return At=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},At(e)}var we=function(e){W_(r,e);var t=H_(r);function r(i,o){var a;F_(this,r),a=t.call(this,i,o),a.device=void 0,a.gl=void 0,a.handle=void 0;var c=o.handle===null;if(a.device=i,a.gl=i.gl,a.handle=a.props.handle||c?a.props.handle:a.gl.createFramebuffer(),!c){i.setSpectorMetadata(a.handle,{id:a.props.id,props:a.props}),a.autoCreateAttachmentTextures(),a.gl.bindFramebuffer(36160,a.handle);for(var u=0;u<a.colorAttachments.length;++u){var p=a.colorAttachments[u],b=36064+u;p&&a._attachOne(b,p)}a.depthStencilAttachment&&a._attachOne(Wf(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(){mn(At(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),c=o.checkFramebufferStatus(36160);if(o.bindFramebuffer(36160,a||null),c!==36053)throw new Error("Framebuffer ".concat(K_(c)))},n.createDepthStencilTexture=function(o){return new Tt(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 c=B_(this.colorAttachments),u;try{for(c.s();!(u=c.n()).done;){var p=u.value;p.resize({width:o,height:a})}}catch(b){c.e(b)}finally{c.f()}return this.depthStencilAttachment&&this.depthStencilAttachment.resize({width:o,height:a}),this},n._attachOne=function(o,a){if(a instanceof Tt)return this._attachWEBGLRenderbuffer(o,a),a;if(Array.isArray(a)){var c=I_(a,3),u=c[0],p=c[1],b=p===void 0?0:p,g=c[2],v=g===void 0?0:g;return this._attachTexture(o,u,b,v),u}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,c,u){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,u,c);break;case 34067:var v=L_(c);b.framebufferTexture2D(36160,o,v,a.handle,u);break;case 3553:b.framebufferTexture2D(36160,o,3553,a.handle,u);break;default:H(!1,"Illegal texture type")}b.bindTexture(a.target,null)},D_(r,[{key:"texture",get:function(){return this.colorAttachments[0]}}]),r}(ot);function L_(e){return e<34069?e+34069:e}function K_(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 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)}function Au(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,z_(n.key),n)}}function Y_(e,t,r){return t&&Au(e.prototype,t),r&&Au(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function z_(e){var t=$_(e,"string");return Rt(t)==="symbol"?t:String(t)}function $_(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 Z_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q_(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&&Ho(e,t)}function Ho(e,t){return Ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ho(e,t)}function q_(e){var t=eb();return function(){var n=Tn(e),i;if(t){var o=Tn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return J_(this,i)}}function J_(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 G_(e)}function G_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eb(){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 Tn(e){return Tn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tn(e)}var Sn=function(e){Q_(r,e);var t=q_(r);function r(i,o){var a;return Z_(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 we(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 c=this.device.gl.getExtension("STACKGL_resize_drawingbuffer");c&&o&&"width"in o&&"height"in o&&c.resize(o.width,o.height)},n.commit=function(){},Y_(r)}(Ge);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)}function Xo(){"use strict";Xo=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 S(){}function T(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=T.prototype=v.prototype=Object.create(E);function x(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var F=R.arg,C=F.value;return C&&Ot(C)=="object"&&r.call(C,"__await")?f.resolve(C.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(C).then(function(U){F.value=U,m(F)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,F){s(h,m,R,F)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return S.prototype=T,n(w,"constructor",{value:T,configurable:!0}),n(T,"constructor",{value:S,configurable:!0}),S.displayName=u(T,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===S||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,T):(l.__proto__=T,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},x(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},x(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(F,C){return m.type="throw",m.arg=f,s.next=F,C&&(s.method="next",s.arg=void 0),!!C}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function Ru(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 Ou(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ru(Object(r),!0).forEach(function(n){tb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ru(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tb(e,t,r){return t=rb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rb(e){var t=nb(e,"string");return Ot(t)==="symbol"?t:String(t)}function nb(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 Eu(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function ob(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){Eu(o,n,i,a,c,"next",u)}function c(u){Eu(o,n,i,a,c,"throw",u)}a(void 0)})}}var ib={spector:D.get("spector")||D.get("inspect")},ab="https://spectorcdn.babylonjs.com/spector.bundle.js",fb=1,de=null,wu=!1;function Pu(e){return Vo.apply(this,arguments)}function Vo(){return Vo=ob(Xo().mark(function e(t){return Xo().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,Yt(ab);case 4:n.next=9;break;case 6:n.prev=6,n.t0=n.catch(1),D.warn(String(n.t0));case 9:case"end":return n.stop()}},e,null,[[1,6]])})),Vo.apply(this,arguments)}function Iu(e){var t,r;if(e=Ou(Ou({},ib),e),!((t=e)!==null&&t!==void 0&&t.spector)||(!de&&globalThis.SPECTOR&&(D.probe(fb,"SPECTOR found and initialized")(),de=new globalThis.SPECTOR.Spector,globalThis.luma&&(globalThis.luma.spector=de)),!de))return null;if(!wu){var n,i;wu=!0,de.spyCanvases(),(n=de)===null||n===void 0||n.onCaptureStarted.add(function(c){return D.info("Spector capture started:",c)()}),(i=de)===null||i===void 0||i.onCapture.add(function(c){var u,p,b;D.info("Spector capture complete:",c)(),(u=de)===null||u===void 0||u.getResultUI(),(p=de)===null||p===void 0||p.resultView.display(),(b=de)===null||b===void 0||b.resultView.addCapture(c)})}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(c){return setTimeout(c,2e3)}).then(function(c){var u;D.info("Spector capture stopped after 2 seconds")(),(u=de)===null||u===void 0||u.stopCapture()})}return de}var ke=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}(ke||{});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 Lo(){"use strict";Lo=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 S(){}function T(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=T.prototype=v.prototype=Object.create(E);function x(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var F=R.arg,C=F.value;return C&&Et(C)=="object"&&r.call(C,"__await")?f.resolve(C.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(C).then(function(U){F.value=U,m(F)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,F){s(h,m,R,F)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return S.prototype=T,n(w,"constructor",{value:T,configurable:!0}),n(T,"constructor",{value:S,configurable:!0}),S.displayName=u(T,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===S||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,T):(l.__proto__=T,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},x(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},x(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(F,C){return m.type="throw",m.arg=f,s.next=F,C&&(s.method="next",s.arg=void 0),!!C}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function ub(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=cb(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.
40
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function cb(e,t){if(e){if(typeof e=="string")return Nu(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 Nu(e,t)}}function Nu(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 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,Du(n.key),n)}}function sb(e,t,r){return t&&xu(e.prototype,t),r&&xu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cu(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 Bu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cu(Object(r),!0).forEach(function(n){pb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pb(e,t,r){return t=Du(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Du(e){var t=db(e,"string");return Et(t)==="symbol"?t:String(t)}function db(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 Fu(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function hb(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){Fu(o,n,i,a,c,"next",u)}function c(u){Fu(o,n,i,a,c,"throw",u)}a(void 0)})}}var yb="https://unpkg.com/webgl-debug@2.0.1/index.js";function Mu(e){return e.luma=e.luma||{},e.luma}function Uu(){return Ko.apply(this,arguments)}function Ko(){return Ko=hb(Lo().mark(function e(){return Lo().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(G()&&!globalThis.WebGLDebugUtils)){r.next=5;break}return globalThis.global=globalThis.global||globalThis,globalThis.global.module={},r.next=5,Yt(yb);case 5:case"end":return r.stop()}},e)})),Ko.apply(this,arguments)}function ju(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e?t.debug?bb(e,t):_b(e):null}function _b(e){var t=Mu(e);return t.realContext?t.realContext:e}function bb(e,t){if(!globalThis.WebGLDebugUtils)return D.warn("webgl-debug not loaded")(),e;var r=Mu(e);if(r.debugContext)return r.debugContext;globalThis.WebGLDebugUtils.init(Bu(Bu({},ke),e));var n=globalThis.WebGLDebugUtils.makeDebugContext(e,gb.bind(null,t),vb.bind(null,t));for(var i in ke)!(i in n)&&typeof ke[i]=="number"&&(n[i]=ke[i]);var o=sb(function c(){lb(this,c)});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 ko(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 gb(e,t,r,n){n=Array.from(n).map(function(u){return u===void 0?"undefined":u});var i=globalThis.WebGLDebugUtils.glEnumToString(t),o=globalThis.WebGLDebugUtils.glFunctionArgsToString(r,n),a=e.webgl2?"gl2":"gl1",c="".concat(i," in ").concat(a,".").concat(r,"(").concat(o,")");D.error(c)();debugger;if(e.throwOnError)throw new Error(c)}function vb(e,t,r){var n="";if(D.level>=1&&(n=ko(t,r),D.log(1,n)()),e.break&&e.break.length>0){n=n||ko(t,r);var i=e.break.every(function(u){return n.indexOf(u)!==-1});if(i)debugger}var o=ub(r),a;try{for(o.s();!(a=o.n()).done;){var c=a.value;if(c===void 0){if(n=n||ko(t,r),e.throwOnError)throw new Error("Undefined argument: ".concat(n));D.error("Undefined argument: ".concat(n))();debugger}}}catch(u){o.e(u)}finally{o.f()}}function mb(e){return Vu(e)||Tb(e)||Yo(e)||Xu()}function Tb(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Sb(e,t){return Vu(e)||Ab(e,t)||Yo(e,t)||Xu()}function Xu(){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 Ab(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Vu(e){if(Array.isArray(e))return e}function Rb(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Yo(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.
42
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Yo(e,t){if(e){if(typeof e=="string")return Wu(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 Wu(e,t)}}function Wu(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 ku(e){var t=e.split(/\r?\n/),r=[],n=Rb(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 c=Sb(a,2),u=c[0],p=c[1];r.push({message:p.trim(),type:Hu(u),lineNum:0,linePos:0});continue}var b=mb(a),g=b[0],v=b[1],S=b[2],T=b.slice(3),E=parseInt(S,10);isNaN(E)&&(E=0);var P=parseInt(v,10);isNaN(P)&&(P=0),r.push({message:T.join(":").trim(),type:Hu(g),lineNum:E,linePos:P})}}}catch(O){n.e(O)}finally{n.f()}return r}function Hu(e){var t=["warning","error","info"],r=e.toLowerCase();return t.includes(r)?r:"info"}function Le(e){return Le=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},Le(e)}function zo(){"use strict";zo=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 S(){}function T(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=T.prototype=v.prototype=Object.create(E);function x(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var F=R.arg,C=F.value;return C&&Le(C)=="object"&&r.call(C,"__await")?f.resolve(C.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(C).then(function(U){F.value=U,m(F)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,F){s(h,m,R,F)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return S.prototype=T,n(w,"constructor",{value:T,configurable:!0}),n(T,"constructor",{value:S,configurable:!0}),S.displayName=u(T,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===S||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,T):(l.__proto__=T,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},x(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},x(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(F,C){return m.type="throw",m.arg=f,s.next=F,C&&(s.method="next",s.arg=void 0),!!C}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function Lu(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function Ob(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){Lu(o,n,i,a,c,"next",u)}function c(u){Lu(o,n,i,a,c,"throw",u)}a(void 0)})}}function Ku(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,wb(n.key),n)}}function Eb(e,t,r){return t&&Ku(e.prototype,t),r&&Ku(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wb(e){var t=Pb(e,"string");return Le(t)==="symbol"?t:String(t)}function Pb(e,t){if(Le(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Le(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ib(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nb(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 xb(e){var t=Fb();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 Cb(this,i)}}function Cb(e,t){if(t&&(Le(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bb(e)}function Bb(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fb(){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 Rn=function(e){Nb(r,e);var t=xb(r);function r(i,o){var a;switch(Ib(this,r),a=t.call(this,i,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.getCompilationInfo=function(){var i=Ob(zo().mark(function a(){return zo().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.getCompilationInfoSync());case 1:case"end":return u.stop()}},a,this)}));function o(){return i.apply(this,arguments)}return o}(),n.getCompilationInfoSync=function(){var o=this.device.gl.getShaderInfoLog(this.handle);return ku(o)},n._compile=function(o){var a=function(p){return p.startsWith("#version ")?p:`#version 100
43
- `.concat(p)};o=a(o);var c=this.device.gl;if(c.shaderSource(this.handle,o),c.compileShader(this.handle),this.compilationStatus=c.getShaderParameter(this.handle,35713)?"success":"error",this.debugShader(),this.compilationStatus==="error")throw new Error("GLSL compilation errors in ".concat(this.props.stage," shader ").concat(this.props.id))},Eb(r)}(Fr);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 Yu(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 Db(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yu(Object(r),!0).forEach(function(n){Mb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mb(e,t,r){return t=$u(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zu(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,$u(n.key),n)}}function Ub(e,t,r){return t&&zu(e.prototype,t),r&&zu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $u(e){var t=jb(e,"string");return wt(t)==="symbol"?t:String(t)}function jb(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 Wb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hb(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 Xb(e){var t=Lb();return function(){var n=On(e),i;if(t){var o=On(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Vb(this,i)}}function Vb(e,t){if(t&&(wt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kb(e)}function kb(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lb(){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 On(e){return On=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},On(e)}var Kb=256,Yb=1024,zb=16384,Zo=6144,En=function(e){Hb(r,e);var t=Xb(r);function r(i,o){var a;return Wb(this,r),a=t.call(this,i,o),a.device=void 0,a.glParameters=void 0,a.device=i,Te(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=Db({},this.glParameters),c=0;this.props.clearColor!==!1&&(c|=zb,a.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(c|=Kb,a.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(c|=Yb,a.clearStencil=this.props.clearStencil),c!==0&&ve(this.device,a,function(){o.device.gl.clear(c)})},n.clearColorBuffer=function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0];ve(this.device.gl2,{framebuffer:this.props.framebuffer},function(){switch(c.constructor){case Int32Array:o.device.gl2.clearBufferiv(Zo,a,c);break;case Uint32Array:o.device.gl2.clearBufferuiv(Zo,a,c);break;case Float32Array:default:o.device.gl2.clearBufferfv(Zo,a,c);break}})},Ub(r)}(Xr);var $b="Failed to deduce GL constant from typed array";function Zu(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($b)}}function yr(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 _r(e){return _r=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},_r(e)}function wn(e,t,r){return Zb()?wn=Reflect.construct.bind():wn=function(i,o,a){var c=[null];c.push.apply(c,o);var u=Function.bind.apply(i,c),p=new u;return a&&qo(p,a.prototype),p},wn.apply(null,arguments)}function Zb(){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 qo(e,t){return qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},qo(e,t)}function Qb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,Jb(n.key),n)}}function qb(e,t,r){return t&&Qu(e.prototype,t),r&&Qu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jb(e){var t=Gb(e,"string");return _r(t)==="symbol"?t:String(t)}function Gb(e,t){if(_r(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_r(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eg={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},tg={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Pn=function(){e.getBytesPerElement=function(n){var i=yr(n.type||5126);return i.BYTES_PER_ELEMENT},e.getBytesPerVertex=function(n){H(n.size);var i=yr(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 wn(e,[eg].concat(i))};function e(){var r=this;Qb(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=ho("Accessor",n,tg),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},qb(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 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 Ju(e,t){return ig(e)||og(e,t)||ng(e,t)||rg()}function rg(){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 ng(e,t){if(e){if(typeof e=="string")return qu(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 qu(e,t)}}function qu(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,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function ig(e){if(Array.isArray(e))return e}function ee(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=fg(e,"string");return br(t)==="symbol"?t:String(t)}function fg(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 Gu(e){return ug.includes(e)}var ug=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],ec=(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 Jo(e){var t=ec[e];if(!t)throw new Error("uniform");var r=Ju(t,4),n=r[0],i=r[1],o=r[3];return{format:o,components:i,glType:n}}function tc(e){var t=ec[e];if(!t)throw new Error("attribute");var r=Ju(t,5),n=r[1],i=r[3],o=r[4],a=i;return{attributeType:a,vertexFormat:o,components:n}}var ie;function gr(e){return gr=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},gr(e)}function cg(e,t){return dg(e)||pg(e,t)||lg(e,t)||sg()}function sg(){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){if(e){if(typeof e=="string")return rc(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 rc(e,t)}}function rc(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 pg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function dg(e){if(Array.isArray(e))return e}function nc(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 oc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nc(Object(r),!0).forEach(function(n){ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ue(e,t,r){return t=hg(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hg(e){var t=yg(e,"string");return gr(t)==="symbol"?t:String(t)}function yg(e,t){if(gr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function In(e,t){var r={attributes:[],bindings:[]};r.attributes=_g(e,t);for(var n=vg(e,t),i=0,o=n;i<o.length;i++){var a=o[i],c=a.uniforms.map(function(O){return{name:O.name,format:O.format,byteOffset:O.byteOffset,byteStride:O.byteStride,arrayLength:O.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:c})}for(var u=gg(e,t),p=0,b=0,g=u;b<g.length;b++){var v=g[b];if(Gu(v.type)){var S=Tg(v.type),T=S.viewDimension,E=S.sampleType;r.bindings.push({type:"texture",name:v.name,location:p,viewDimension:T,sampleType:E}),v.textureUnit=p,p+=1}}u.length&&(r.uniforms=u);var P=bg(e,t);return P!=null&&P.length&&(r.varyings=P),r}function _g(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,c=o.type,u=e.getAttribLocation(t,a);if(u>=0){var p=tc(c),b=p.attributeType,g=/instance/i.test(a)?"instance":"vertex";r.push({name:a,location:u,stepMode:g,type:b})}}return r.sort(function(v,S){return v.location-S.location}),r}function bg(e,t){if(!Y(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 c=a.name,u=a.type,p=a.size,b=Jo(u),g=b.glType,v=b.components,S=new Pn({type:g,size:p*v}),T={location:o,name:c,accessor:S};n.push(T)}return n.sort(function(E,P){return E.location-P.location}),n}function gg(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,c=o.size,u=o.type,p=Sg(a),b=p.name,g=p.isArray,v=e.getUniformLocation(t,b),S={location:v,name:b,size:c,type:u,isArray:g};if(r.push(S),S.size>1)for(var T=0;T<S.size;T++){var E="".concat(b,"[").concat(T,"]");v=e.getUniformLocation(t,E);var P=oc(oc({},S),{},{name:E,location:v});r.push(P)}}return r}function vg(e,t){if(!Y(e))return[];for(var r=e,n=function(P,O){return r.getActiveUniformBlockParameter(t,P,O)},i=[],o=r.getProgramParameter(t,35382),a=0;a<o;a++){for(var c={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:[]},u=n(a,35395)||[],p=r.getActiveUniforms(t,u,35383),b=r.getActiveUniforms(t,u,35384),g=r.getActiveUniforms(t,u,35387),v=r.getActiveUniforms(t,u,35388),S=0;S<c.uniformCount;++S){var T=r.getActiveUniform(t,u[S]);if(!T)throw new Error("activeInfo");c.uniforms.push({name:T.name,format:Jo(p[S]).format,type:p[S],arrayLength:b[S],byteOffset:g[S],byteStride:v[S]})}i.push(c)}return i.sort(function(E,P){return E.location-P.location}),i}var mg=(ie={},ue(ie,35678,["2d","float"]),ue(ie,35680,["cube","float"]),ue(ie,35679,["3d","float"]),ue(ie,35682,["3d","depth"]),ue(ie,36289,["2d-array","float"]),ue(ie,36292,["2d-array","depth"]),ue(ie,36293,["cube","float"]),ue(ie,36298,["2d","sint"]),ue(ie,36299,["3d","sint"]),ue(ie,36300,["cube","sint"]),ue(ie,36303,["2d-array","uint"]),ue(ie,36306,["2d","uint"]),ue(ie,36307,["3d","uint"]),ue(ie,36308,["cube","uint"]),ue(ie,36311,["2d-array","uint"]),ie);function Tg(e){var t=mg[e];if(!t)throw new Error("sampler");var r=cg(t,2),n=r[0],i=r[1];return{viewDimension:n,sampleType:i}}function Sg(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 ic(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 ac(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 fc(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 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 uc(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=dc(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,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function cc(e,t){return Og(e)||Rg(e,t)||dc(e,t)||Ag()}function Ag(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
47
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dc(e,t){if(e){if(typeof e=="string")return sc(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 sc(e,t)}}function sc(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 Rg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Og(e){if(Array.isArray(e))return e}function lc(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,wg(n.key),n)}}function Eg(e,t,r){return t&&lc(e.prototype,t),r&&lc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wg(e){var t=Pg(e,"string");return Pt(t)==="symbol"?t:String(t)}function Pg(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 Ig(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ng(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 xg(e){var t=Fg();return function(){var n=Nn(e),i;if(t){var o=Nn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Cg(this,i)}}function Cg(e,t){if(t&&(Pt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bg(e)}function Bg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fg(){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 Nn(e){return Nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Nn(e)}var pc=4,xn=function(e){Ng(r,e);var t=xg(r);function r(i,o){var a;Ig(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 c=o.varyings,u=o.bufferMode,p=u===void 0?35981:u;if(c&&c.length>0){var b;a.device.assertWebGL2(),a.varyings=c,(b=a.device.gl2)===null||b===void 0||b.transformFeedbackVaryings(a.handle,c,p)}return a._compileAndLink(),a.introspectedLayout=In(a.device.gl,a.handle),a.shaderLayout=ao(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,c=function(){var v=cc(p[u],2),S=v[0],T=v[1],E=a.shaderLayout.bindings.find(function(O){return O.name===S})||a.shaderLayout.bindings.find(function(O){return O.name==="".concat(S,"Uniforms")});if(!E){var P=a.shaderLayout.bindings.map(function(O){return'"'.concat(O.name,'"')}).join(", ");return D.warn('Unknown binding "'.concat(S,'" in render pipeline "').concat(a.id,'", expected one of ').concat(P))(),"continue"}switch(T||D.warn('Unsetting binding "'.concat(S,'" in render pipeline "').concat(a.id,'"'))(),E.type){case"uniform":if(!(T instanceof pe)&&!(T.buffer instanceof pe))throw new Error("buffer value");break;case"texture":if(!(T instanceof se||T instanceof we))throw new Error("texture value");break;case"sampler":D.warn("Ignoring sampler ".concat(S))();break;default:throw new Error(E.type)}a.bindings[S]=T},u=0,p=Object.entries(o);u<p.length;u++)var b=c()},n.setUniforms=function(o){var a=lo(o),c=a.bindings;Object.keys(c).forEach(function(u){D.warn('Unsupported value "'.concat(JSON.stringify(c[u]),'" used in setUniforms() for key ').concat(u,". Use setBindings() instead?"))()}),Object.assign(this.uniforms,o)},n.draw=function(o){var a,c=this,u=o.renderPass,p=o.vertexArray,b=o.vertexCount,g=o.instanceCount,v=o.firstVertex,S=v===void 0?0:v,T=o.transformFeedback,E=ac(this.props.topology),P=Boolean(p.indexBuffer),O=(a=p.indexBuffer)===null||a===void 0?void 0:a.glIndexType,w=Number(g)>0;if(!this._areTexturesRenderable()||b===0)return!1;this.device.gl.useProgram(this.handle),p.bindBeforeRender(u),T&&T.begin(this.props.topology),this._applyBindings(),this._applyUniforms();var x=u;return zf(this.device,this.props.parameters,x.glParameters,function(){if(P&&w){var N;(N=c.device.gl2)===null||N===void 0||N.drawElementsInstanced(E,b||0,O,S,g||0)}else if(P)c.device.gl.drawElements(E,b||0,O,S);else if(w){var X;(X=c.device.gl2)===null||X===void 0||X.drawArraysInstanced(E,S,b||0,g||0)}else c.device.gl.drawArrays(E,S,b||0);T&&T.end()}),p.unbindAfterRender(u),!0},n._compileAndLink=function(){var o=this.device.gl;o.attachShader(this.handle,this.vs.handle),o.attachShader(this.handle,this.fs.handle),D.time(pc,"linkProgram for ".concat(this.id))(),o.linkProgram(this.handle),D.timeEnd(pc,"linkProgram for ".concat(this.id))(),!o.debug&&D.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 c=o.getProgramParameter(this.handle,35715);if(!c)throw new Error("Error validating: ".concat(o.getProgramInfoLog(this.handle)))},n._areTexturesRenderable=function(){for(var o=!0,a=0,c=Object.entries(this.bindings);a<c.length;a++){var u=cc(c[a],2),p=u[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,c=0,u=uc(this.shaderLayout.bindings),p;try{for(u.s();!(p=u.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,S=o.getUniformBlockIndex(this.handle,v);if(S===4294967295)throw new Error("Invalid uniform block name ".concat(v));o.uniformBlockBinding(this.handle,c,S),g instanceof pe?o.bindBufferBase(35345,c,g.handle):o.bindBufferRange(35345,c,g.buffer.handle,g.offset||0,g.size||g.buffer.byteLength-g.offset),c+=1;break;case"texture":if(!(g instanceof se||g instanceof we))throw new Error("texture");var T=void 0;if(g instanceof se)T=g;else if(g instanceof we&&g.colorAttachments[0]instanceof se)D.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),T=g.colorAttachments[0];else throw new Error("No texture");o.activeTexture(33984+a),o.bindTexture(T.target,T.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(E){u.e(E)}finally{u.f()}},n._applyUniforms=function(){var o=uc(this.shaderLayout.uniforms||[]),a;try{for(o.s();!(a=o.n()).done;){var c,u=a.value,p=u.name,b=u.location,g=u.type,v=u.textureUnit,S=(c=this.uniforms[p])!==null&&c!==void 0?c:v;S!==void 0&&ic(this.device.gl,b,g,S)}}catch(T){o.e(T)}finally{o.f()}},Eg(r)}(Wr);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 Dg(e,t){return jg(e)||Ug(e,t)||_c(e,t)||Mg()}function Mg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
48
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ug(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function jg(e){if(Array.isArray(e))return e}function Wg(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_c(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.
49
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function _c(e,t){if(e){if(typeof e=="string")return hc(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 hc(e,t)}}function hc(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 yc(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,Xg(n.key),n)}}function Hg(e,t,r){return t&&yc(e.prototype,t),r&&yc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xg(e){var t=Vg(e,"string");return It(t)==="symbol"?t:String(t)}function Vg(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 kg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lg(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 Kg(e){var t=$g();return function(){var n=Cn(e),i;if(t){var o=Cn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Yg(this,i)}}function Yg(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 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 $g(){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 Cn(e){return Cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cn(e)}var bc=function(e){Lg(r,e);var t=Kg(r);function r(i){var o;return kg(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=Wg(o),c;try{for(a.s();!(c=a.n()).done;){var u=c.value;switch(u.name){case"copy-buffer-to-buffer":Zg(this.device,u.options);break;case"copy-buffer-to-texture":Qg(this.device,u.options);break;case"copy-texture-to-buffer":qg(this.device,u.options);break;case"copy-texture-to-texture":Jg(this.device,u.options);break}}}catch(p){a.e(p)}finally{a.f()}},Hg(r)}(Kr);function Zg(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 Qg(e,t){throw new Error("Not implemented")}function qg(e,t){var r=t.source,n=t.mipLevel,i=n===void 0?0:n,o=t.aspect,a=o===void 0?"all":o,c=t.width,u=c===void 0?t.source.width:c,p=t.height,b=p===void 0?t.source.height:p,g=t.depthOrArrayLayers,v=g===void 0?0:g,S=t.origin,T=S===void 0?[0,0]:S,E=t.destination,P=t.byteOffset,O=P===void 0?0:P,w=t.bytesPerRow,x=t.rowsPerImage;if(a!=="all")throw new Error("not supported");if(i!==0||v!==0||w||x)throw new Error("not implemented");var N=e.assertWebGL2(),X=gc(r),M=X.framebuffer,K=X.destroyFramebuffer;try{var W=E,V=u||M.width,j=b||M.height,L=_t(M.texture.format,!0),l=L.dataFormat,f=L.type;N.bindBuffer(35051,W.handle),N.bindFramebuffer(36160,M.handle),N.readPixels(T[0],T[1],V,j,l,f,O)}finally{N.bindBuffer(35051,null),N.bindFramebuffer(36160,null),K&&M.destroy()}}function Jg(e,t){var r=t.source,n=t.origin,i=n===void 0?[0,0]:n,o=t.destination,a=t.width,c=a===void 0?t.destination.width:a,u=t.height,p=u===void 0?t.destination.width:u,b=0,g=6408,v=gc(r),S=v.framebuffer,T=v.destroyFramebuffer,E=Dg(i,2),P=E[0],O=E[1],w=!1;e.gl.bindFramebuffer(36160,S.handle);var x=null,N;if(o instanceof se)x=o,c=Number.isFinite(c)?c:x.width,p=Number.isFinite(p)?p:x.height,x.bind(0),N=x.destination;else throw new Error("whoops");return w||e.gl.copyTexImage2D(N,b,g,P,O,c,p,0),x&&x.unbind(),T&&S.destroy(),x}function gc(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 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 vc(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,ev(n.key),n)}}function Gg(e,t,r){return t&&vc(e.prototype,t),r&&vc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ev(e){var t=tv(e,"string");return Nt(t)==="symbol"?t:String(t)}function tv(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)}function rv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nv(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 ov(e){var t=fv();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 iv(this,i)}}function iv(e,t){if(t&&(Nt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return av(e)}function av(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fv(){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)}var Fn=function(e){nv(r,e);var t=ov(r);function r(i,o){var a;return rv(this,r),a=t.call(this,i,o),a.device=void 0,a.commandBuffer=void 0,a.device=i,a.commandBuffer=new bc(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){},Gg(r)}(kr);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)}var Tc;function uv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mc(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,sv(n.key),n)}}function cv(e,t,r){return t&&mc(e.prototype,t),r&&mc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function sv(e){var t=lv(e,"string");return xt(t)==="symbol"?t:String(t)}function lv(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 Dn(){return typeof Reflect<"u"&&Reflect.get?Dn=Reflect.get.bind():Dn=function(t,r,n){var i=pv(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Dn.apply(this,arguments)}function pv(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ct(e),e!==null););return e}function dv(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&&ri(e,t)}function ri(e,t){return ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ri(e,t)}function hv(e){var t=bv();return function(){var n=Ct(e),i;if(t){var o=Ct(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yv(this,i)}}function yv(e,t){if(t&&(xt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _v(e)}function _v(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bv(){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 Ct(e){return Ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ct(e)}Tc=Symbol.toStringTag;var Mn=function(e){dv(r,e);var t=hv(r);r.isConstantAttributeZeroSupported=function(o){return o.info.type==="webgl2"||Ar()==="Chrome"};function r(i,o){var a;return uv(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(Dn(Ct(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 c=a;if(c.glTarget===34963)throw new Error("Use .setIndexBuffer()");var u=this._getAccessor(o),p=u.size,b=u.type,g=u.stride,v=u.offset,S=u.normalized,T=u.integer,E=u.divisor;this.device.gl2.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,c.handle),T?(this.device.assertWebGL2(),this.device.gl2.vertexAttribIPointer(o,p,b,g,v)):this.device.gl.vertexAttribPointer(o,p,b,S,g,v),this.device.gl.enableVertexAttribArray(o),this.device.gl2.vertexAttribDivisor(o,E||0),this.attributes[o]=c},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 c=on(a.bufferDataType);return{size:a.bufferComponents,type:c,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,c=r.isConstantAttributeZeroSupported(this.device),u=c||o!==0;(a||u)&&(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 c=gv(a),u=c.byteLength*o,p=c.length*o;if(this.buffer&&u!==this.buffer.byteLength)throw new Error("Buffer size is immutable, byte length ".concat(u," !== ").concat(this.buffer.byteLength,"."));var b=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:u}),b=b||!vv(c,this.bufferValue),b){var g=co(a.constructor,p);so({target:g,source:c,start:0,count:p}),this.buffer.write(g),this.bufferValue=a}return this.buffer},cv(r,[{key:Tc,get:function(){return"VertexArray"}}]),r}($r);function gv(e){return Array.isArray(e)?new Float32Array(e):e}function vv(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 Bt(e){return Bt=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},Bt(e)}function mv(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Tv(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.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Tv(e,t){if(e){if(typeof e=="string")return Sc(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 Sc(e,t)}}function Sc(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 Ac(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,Av(n.key),n)}}function Sv(e,t,r){return t&&Ac(e.prototype,t),r&&Ac(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Av(e){var t=Rv(e,"string");return Bt(t)==="symbol"?t:String(t)}function Rv(e,t){if(Bt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Bt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ov(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Un(){return typeof Reflect<"u"&&Reflect.get?Un=Reflect.get.bind():Un=function(t,r,n){var i=Ev(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Un.apply(this,arguments)}function Ev(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ft(e),e!==null););return e}function wv(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 Pv(e){var t=Nv();return function(){var n=Ft(e),i;if(t){var o=Ft(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Iv(this,i)}}function Iv(e,t){if(t&&(Bt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oc(e)}function Oc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nv(){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 Ft(e){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ft(e)}var jn=function(e){wv(r,e);var t=Pv(r);function r(i,o){var a;return Ov(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(Oc(a)),a}var n=r.prototype;return n.destroy=function(){this.gl2.deleteTransformFeedback(this.handle),Un(Ft(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(fc(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 c in o)a.setBuffer(c,o[c])})},n.setBuffer=function(o,a){var c=this._getVaryingIndex(o),u=this._getBufferRange(a),p=u.buffer,b=u.byteLength,g=u.byteOffset;if(c<0){this.unusedBuffers[o]=p,D.warn("".concat(this.id," unusedBuffers varying buffer ").concat(o))();return}this.buffers[c]={buffer:p,byteLength:b,byteOffset:g},this.bindOnUse||this._bindBuffer(c,p,g,b)},n.getBuffer=function(o){if(Rc(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,c=o.byteOffset,u=c===void 0?0:c,p=o.byteLength,b=p===void 0?o.buffer.byteLength:p;return{buffer:a,byteOffset:u,byteLength:b}},n._getVaryingIndex=function(o){if(Rc(o))return Number(o);var a=mv(this.layout.varyings),c;try{for(a.s();!(c=a.n()).done;){var u=c.value;if(o===u.name)return u.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]),c=a.buffer,u=a.byteLength,p=a.byteOffset;this._bindBuffer(Number(o),c,p,u)}},n._unbindBuffers=function(){for(var o in this.buffers)this.gl2.bindBufferBase(35982,Number(o),null)},n._bindBuffer=function(o,a){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,u=arguments.length>3?arguments[3]:void 0,p=a&&a.handle;!p||u===void 0?this.gl2.bindBufferBase(35982,o,p):this.gl2.bindBufferRange(35982,o,p,c,u)},Sv(r)}(Qr);function Rc(e){return typeof e=="number"?Number.isInteger(e):/^\d+$/.test(e)}function Ke(e){return Ke=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},Ke(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 Pe(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){xv(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 xv(e,t,r){return t=Ic(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oi(){"use strict";oi=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 S(){}function T(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=T.prototype=v.prototype=Object.create(E);function x(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var F=R.arg,C=F.value;return C&&Ke(C)=="object"&&r.call(C,"__await")?f.resolve(C.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(C).then(function(U){F.value=U,m(F)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,F){s(h,m,R,F)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return S.prototype=T,n(w,"constructor",{value:T,configurable:!0}),n(T,"constructor",{value:S,configurable:!0}),S.displayName=u(T,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===S||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,T):(l.__proto__=T,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},x(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},x(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(F,C){return m.type="throw",m.arg=f,s.next=F,C&&(s.method="next",s.arg=void 0),!!C}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function wc(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function Cv(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){wc(o,n,i,a,c,"next",u)}function c(u){wc(o,n,i,a,c,"throw",u)}a(void 0)})}}function Bv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pc(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,Ic(n.key),n)}}function Fv(e,t,r){return t&&Pc(e.prototype,t),r&&Pc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ic(e){var t=Dv(e,"string");return Ke(t)==="symbol"?t:String(t)}function Dv(e,t){if(Ke(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ke(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mv(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&&ii(e,t)}function ii(e,t){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ii(e,t)}function Uv(e){var t=Wv();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 jv(this,i)}}function jv(e,t){if(t&&(Ke(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ai(e)}function ai(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wv(){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 Wn=1,le=function(e){Mv(r,e);var t=Uv(r);r.isSupported=function(){return typeof WebGLRenderingContext<"u"||pi()},r.attach=function(o){if(o instanceof r)return o;if(o?.device instanceof Je)return o.device;if(!Hv(o))throw new Error("Invalid WebGLRenderingContext");return new r({gl:o})},r.create=function(){var i=Cv(oi().mark(function a(){var c,u,p=arguments;return oi().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(c=p.length>0&&p[0]!==void 0?p[0]:{},D.groupCollapsed(Wn,"WebGLDevice created"),typeof c.canvas!="string"){g.next=5;break}return g.next=5,Ge.pageLoaded;case 5:if(!(D.get("debug")||c.debug)){g.next=8;break}return g.next=8,Uu();case 8:if(u=c.spector,!(D.get("spector")||u)){g.next=12;break}return g.next=12,Pu();case 12:if(D.probe(Wn+1,"DOM is loaded")(),!(c.gl&&c.gl.device)){g.next=15;break}return g.abrupt("return",r.attach(c.gl));case 15:return g.abrupt("return",new r(c));case 16:case"end":return g.stop()}},a)}));function o(){return i.apply(this,arguments)}return o}();function r(i){var o,a;Bv(this,r),a=t.call(this,Pe(Pe({},i),{},{id:i.id||me("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 c=(o=i.gl)===null||o===void 0?void 0:o.device;if(c)throw new Error("WebGL context already attached to device ".concat(c.id));a.canvasContext=new Sn(ai(a),i),a.lost=new Promise(function(P){a._resolveContextLost=P});var u=function(O){var w,x;return(w=(x=a)._resolveContextLost)===null||w===void 0?void 0:w.call(x,{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||(G()?Nf(a.canvasContext.canvas,Pe(Pe({},i),{},{onContextLost:u})):null),p=p||(G()?null:di(Pe(Pe({},i),{},{onContextLost:u}))),!p)throw new Error("WebGL context creation failed");a.handle=p,a.gl=a.handle,a.gl2=a.gl,a.isWebGL2=Xv(a.gl),a.isWebGL1=!a.isWebGL2,a.info=xf(a.gl),a.gl.device=ai(a),a.gl._version=a.isWebGL2?2:1,rn(a.gl);var b=i.enable,g=b===void 0?!0:b,v=i.copyState,S=v===void 0?!1:v;if(rr(a.gl,{enable:g,copyState:S,log:function(){for(var O=arguments.length,w=new Array(O),x=0;x<O;x++)w[x]=arguments[x];return D.log.apply(D,[1].concat(w))()}}),G()&&i.debug&&(a.gl=ju(a.gl,Pe(Pe({},i),{},{webgl2:a.isWebGL2,throwOnError:!0})),a.gl2=a.gl,a.debug=!0,D.level=Math.max(D.level,1),D.warn("WebGL debug mode activated. Performance reduced.")()),G()&&i.spector){var T=a.handle.canvas||i.canvas;a.spector=Iu(Pe(Pe({},a.props),{},{canvas:T}))}var E="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 D.probe(Wn,E)(),D.groupEnd(Wn)(),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 ur(this.gl,o)},n.isTextureFormatFilterable=function(o){return Uf(this.gl,o)},n.isTextureFormatRenderable=function(o){return jf(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 Ve(this,o)},n.createShader=function(o){return new Rn(this,o)},n.createFramebuffer=function(o){return new we(this,o)},n.createRenderPipeline=function(o){return new xn(this,o)},n.createVertexArray=function(o){return new Mn(this,o)},n.beginRenderPass=function(o){return new En(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 jn(this,o)},n.getDefaultRenderPass=function(){return this.renderPass=this.renderPass||this.beginRenderPass({framebuffer:this.canvasContext.getCurrentFramebuffer()}),this.renderPass},n.createCommandEncoder=function(o){return new Fn(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,c=this.gl.getExtension("WEBGL_lose_context");return c&&(a=!0,c.loseContext()),(o=this._resolveContextLost)===null||o===void 0||o.call(this,{reason:"destroyed",message:"Application triggered context loss"}),a},n.pushState=function(){Te(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 c=Number(o);for(var u in a)if(a[u]===c)return"GL.".concat(u);return String(o)},n.setConstantAttribute=function(o,a){this._constants=this._constants||new Array(this.limits.maxVertexAttributes).fill(null);var c=this._constants[o];switch(c&&Kv(c,a)&&D.info(1,"setConstantAttribute(".concat(o,") could have been skipped, value unchanged"))(),this._constants[o]=a,a.constructor){case Float32Array:Vv(this,o,a);break;case Int32Array:kv(this,o,a);break;case Uint32Array:Lv(this,o,a);break;default:H(!1)}},Fv(r,[{key:"features",get:function(){return this._features=this._features||Vf(this.gl),this._features}},{key:"limits",get:function(){return this._limits=this._limits||Lf(this.gl),this._limits}},{key:"isLost",get:function(){return this.gl.isContextLost()}},{key:"webglLimits",get:function(){return this._webglLimits=this._webglLimits||Kf(this.gl),this._webglLimits}}]),r}(Je);le.type="webgl";function Hv(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function Xv(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function Vv(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:H(!1)}}function kv(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4iv(t,r)}function Lv(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4uiv(t,r)}function Kv(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 Yv=256,zv=1024,$v=16384;var Zv="clear: bad arguments";function Nc(e,t){var r=le.attach(e),n=t||{},i=n.framebuffer,o=i===void 0?null:i,a=n.color,c=a===void 0?null:a,u=n.depth,p=u===void 0?null:u,b=n.stencil,g=b===void 0?null:b,v={};o&&(v.framebuffer=o);var S=0;c&&(S|=$v,c!==!0&&(v.clearColor=c)),p&&(S|=Yv,p!==!0&&(v.clearDepth=p)),g&&(S|=zv,p!==!0&&(v.clearStencil=p)),H(S!==0,Zv),ve(r.gl,v,function(){r.gl.clear(S)})}function fi(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 H(!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 H(!1),0}}function vr(e){return vr=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},vr(e)}function Cc(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 Bc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cc(Object(r),!0).forEach(function(n){Qv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qv(e,t,r){return t=qv(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qv(e){var t=Jv(e,"string");return vr(t)==="symbol"?t:String(t)}function Jv(e,t){if(vr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(vr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fc(e,t){var r,n=t||{},i=n.sourceX,o=i===void 0?0:i,a=n.sourceY,c=a===void 0?0:a,u=n.sourceFormat,p=u===void 0?6408:u,b=n.sourceAttachment,g=b===void 0?36064:b,v=t||{},S=v.target,T=S===void 0?null:S,E=v.sourceWidth,P=v.sourceHeight,O=v.sourceType,w=ui(e),x=w.framebuffer,N=w.deleteFramebuffer;H(x);var X=x,M=X.gl,K=X.handle;E=E||x.width,P=P||x.height;var W=g-36064;O=O||((r=x.colorAttachments[W])===null||r===void 0?void 0:r.type)||5121,T=em(T,O,p,E,P),O=O||Zu(T);var V=M.bindFramebuffer(36160,K);return M.readPixels(o,c,E,P,p,O,T),M.bindFramebuffer(36160,V||null),N&&x.destroy(),T}function Dc(e,t){var r=t||{},n=r.sourceX,i=n===void 0?0:n,o=r.sourceY,a=o===void 0?0:o,c=r.sourceFormat,u=c===void 0?6408:c,p=r.targetByteOffset,b=p===void 0?0:p,g=t||{},v=g.target,S=g.sourceWidth,T=g.sourceHeight,E=g.sourceType,P=ui(e),O=P.framebuffer,w=P.deleteFramebuffer;H(O),S=S||O.width,T=T||O.height;var x=O;if(E=E||5121,!v){var N=fi(u),X=xc(E),M=b+S*T*N*X;v=x.device.createBuffer({byteLength:M})}var K=e.device.createCommandEncoder();return K.copyTextureToBuffer({source:e,width:S,height:T,origin:[i,a],destination:v,byteOffset:b}),K.destroy(),w&&O.destroy(),v}function Mc(e,t,r){var n=r||{},i=n.sourceX,o=i===void 0?0:i,a=n.sourceY,c=a===void 0?0:a,u=n.targetMipmaplevel,p=u===void 0?0:u,b=n.targetInternalFormat,g=b===void 0?6408:b,v=r||{},S=v.targetX,T=v.targetY,E=v.targetZ,P=v.width,O=v.height,w=ui(e),x=w.framebuffer,N=w.deleteFramebuffer;H(x);var X=x,M=X.device,K=X.handle,W=typeof S<"u"||typeof T<"u"||typeof E<"u";S=S||0,T=T||0,E=E||0;var V=M.gl.bindFramebuffer(36160,K);H(t);var j=null,L;if(t instanceof ae?(j=t,P=Number.isFinite(P)?P:j.width,O=Number.isFinite(O)?O:j.height,j.bind(0),L=j.target):L=t,!W)M.gl.copyTexImage2D(L,p,g,o,c,P,O,0);else switch(L){case 3553:case 34067:M.gl.copyTexSubImage2D(L,p,S,T,o,c,P,O);break;case 35866:case 32879:M.assertWebGL2(),M.gl2.copyTexSubImage3D(L,p,S,T,E,o,c,P,O);break;default:}return j&&j.unbind(),M.gl.bindFramebuffer(36160,V||null),N&&x.destroy(),j}function ui(e){return e instanceof ot?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Gv(e),deleteFramebuffer:!0}}function Gv(e,t){var r=e.device,n=e.width,i=e.height,o=e.id,a=r.createFramebuffer(Bc(Bc({},t),{},{id:"framebuffer-for-".concat(o),width:n,height:i,colorAttachments:[e]}));return a}function em(e,t,r,n,i){if(e)return e;t=t||5121;var o=yr(t,{clamped:!1}),a=fi(r);return new o(n*i*a)}return Lc(tm);})();
19
+ </pre></code>`),v.style.top="10px",v.style.left="10px",v.style.position="absolute",v.style.zIndex="9999",v.style.width="100%",v.style.textAlign="left",document.body.appendChild(v);var T=document.getElementsByClassName("luma-compiler-log-error");(c=T[0])!==null&&c!==void 0&&c.scrollIntoView&&T[0].scrollIntoView(),v.onclick=function(){var S="data:text/plain,".concat(encodeURIComponent(u.source));navigator.clipboard.writeText(S)}}},_l(r,[{key:aa,get:function(){return"Shader"}}]),r}($);Dr.defaultProps=Qn(Qn({},$.defaultProps),{},{language:"auto",stage:"vertex",source:"",sourceMap:null,entryPoint:"main",debug:"errors"});function Al(e){return $n(e.source).name||e.id||me("unnamed ".concat(e.stage,"-shader"))}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)}var la;function ua(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 ca(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){Rl(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 Rl(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 Ol(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sa(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 El(e,t,r){return t&&sa(e.prototype,t),r&&sa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function pa(e){var t=wl(e,"string");return tt(t)==="symbol"?t:String(t)}function wl(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 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&&Jn(e,t)}function Jn(e,t){return Jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Jn(e,t)}function Il(e){var t=Cl();return function(){var n=Mr(e),i;if(t){var o=Mr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Nl(this,i)}}function Nl(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 xl(e)}function xl(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 Mr(e){return Mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mr(e)}la=Symbol.toStringTag;var Ur=function(e){Pl(r,e);var t=Il(r);function r(n,i){return Ol(this,r),t.call(this,n,i,r.defaultProps)}return El(r,[{key:la,get:function(){return"Sampler"}}]),r}($);Ur.defaultProps=ca(ca({},$.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 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)}var _a;function da(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 rt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?da(Object(r),!0).forEach(function(n){Bl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):da(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bl(e,t,r){return t=ba(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fl(e,t){return jl(e)||Ul(e,t)||Ml(e,t)||Dl()}function Dl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
20
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ml(e,t){if(e){if(typeof e=="string")return ha(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 ha(e,t)}}function ha(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 Ul(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function jl(e){if(Array.isArray(e))return e}function Wl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ya(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,ba(n.key),n)}}function Hl(e,t,r){return t&&ya(e.prototype,t),r&&ya(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ba(e){var t=Xl(e,"string");return nt(t)==="symbol"?t:String(t)}function Xl(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)}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&&Gn(e,t)}function Gn(e,t){return Gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Gn(e,t)}function kl(e){var t=Yl();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 Ll(this,i)}}function Ll(e,t){if(t&&(nt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kl(e)}function Kl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yl(){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)}_a=Symbol.toStringTag;var ot=function(e){Vl(r,e);var t=kl(r);function r(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Wl(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 c=Array.isArray(o)?o:[o.width,o.height],u=Fl(c,2),p=u[0],b=u[1];a=a||b!==this.height||p!==this.width,this.width=p,this.height=b}a&&(D.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(c){if(typeof c=="string"){var u=o.createColorTexture(c);return o.attachResource(u),u}return c}),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 c=0;c<this.colorAttachments.length;++c)if(this.colorAttachments[c]){var u=this.device._createTexture(rt(rt({},this.colorAttachments[c].props),{},{width:o,height:a}));this.destroyAttachedResource(this.colorAttachments[c]),this.colorAttachments[c]=u,this.attachResource(u)}if(this.depthStencilAttachment){var p=this.device._createTexture(rt(rt({},this.depthStencilAttachment.props),{},{width:o,height:a}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=p,this.attachResource(p)}},Hl(r,[{key:_a,get:function(){return"Framebuffer"}}]),r}($);ot.defaultProps=rt(rt({},$.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});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 Ta;function ga(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 va(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ga(Object(r),!0).forEach(function(n){zl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ga(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zl(e,t,r){return t=Sa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $l(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,Sa(n.key),n)}}function Zl(e,t,r){return t&&ma(e.prototype,t),r&&ma(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sa(e){var t=Ql(e,"string");return it(t)==="symbol"?t:String(t)}function Ql(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 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&&eo(e,t)}function eo(e,t){return eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},eo(e,t)}function Jl(e){var t=tp();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 Gl(this,i)}}function Gl(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 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 Wr(e){return Wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wr(e)}Ta=Symbol.toStringTag;var Hr=function(e){ql(r,e);var t=Jl(r);function r(n,i){var o;return $l(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 Zl(r,[{key:Ta,get:function(){return"RenderPipeline"}}]),r}($);Hr.defaultProps=va(va({},$.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});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 Ea;function Aa(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 Ra(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){rp(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 rp(e,t,r){return t=wa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function np(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,wa(n.key),n)}}function op(e,t,r){return t&&Oa(e.prototype,t),r&&Oa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wa(e){var t=ip(e,"string");return at(t)==="symbol"?t:String(t)}function ip(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 ap(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&&to(e,t)}function to(e,t){return to=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},to(e,t)}function fp(e){var t=sp();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 up(this,i)}}function up(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 cp(e)}function cp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sp(){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)}Ea=Symbol.toStringTag;var Vr=function(e){ap(r,e);var t=fp(r);function r(n,i){return np(this,r),t.call(this,n,i,r.defaultProps)}return op(r,[{key:Ea,get:function(){return"RenderPass"}}]),r}($);Vr.defaultProps=Ra(Ra({},$.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});function ft(e){return ft=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},ft(e)}var xa;function Pa(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 Ia(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pa(Object(r),!0).forEach(function(n){lp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lp(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 pp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Na(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 dp(e,t,r){return t&&Na(e.prototype,t),r&&Na(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ca(e){var t=hp(e,"string");return ft(t)==="symbol"?t:String(t)}function hp(e,t){if(ft(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ft(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yp(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 _p(e){var t=vp();return function(){var n=kr(e),i;if(t){var o=kr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return bp(this,i)}}function bp(e,t){if(t&&(ft(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gp(e)}function gp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vp(){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 kr(e){return kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},kr(e)}xa=Symbol.toStringTag;var Lr=function(e){yp(r,e);var t=_p(r);function r(i,o){return pp(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){},dp(r,[{key:xa,get:function(){return"CommandEncoder"}}]),r}($);Lr.defaultProps=Ia(Ia({},$.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 Da;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 mp(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=Ma(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fa(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,Ma(n.key),n)}}function Ap(e,t,r){return t&&Fa(e.prototype,t),r&&Fa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ma(e){var t=Rp(e,"string");return ut(t)==="symbol"?t:String(t)}function Rp(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 Op(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 Ep(e){var t=Ip();return function(){var n=Kr(e),i;if(t){var o=Kr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return wp(this,i)}}function wp(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 Pp(e)}function Pp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ip(){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 Kr(e){return Kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kr(e)}Da=Symbol.toStringTag;var Yr=function(e){Op(r,e);var t=Ep(r);function r(n,i){return Sp(this,r),t.call(this,n,i,r.defaultProps)}return Ap(r,[{key:Da,get:function(){return"CommandBuffer"}}]),r}($);Yr.defaultProps=mp({},$.defaultProps);function Np(e,t){return Fp(e)||Bp(e,t)||Cp(e,t)||xp()}function xp(){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 Cp(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 Bp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Fp(e){if(Array.isArray(e))return e}function ja(e){var t=Np(Mp[e],2),r=t[0],n=t[1],i=r==="i32"||r==="u32",o=r!=="u32",a=Up[r]*n,c=Dp(r,n);return{dataType:r,components:n,defaultVertexFormat:c,byteLength:a,integer:i,signed:o}}function Dp(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 Mp={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]},Up={f32:4,f16:2,i32:4,u32:4};function zr(e){var t=Wa[e],r=jp(t),n=e.includes("norm"),i=!n&&!e.startsWith("float"),o=e.startsWith("s");return{dataType:Wa[e],byteLength:r,integer:i,signed:o,normalized:n}}function jp(e){var t=Wp[e];return t}var Wa={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},Wp={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Hp(e,t){return Lp(e)||kp(e,t)||Vp(e,t)||Xp()}function Xp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
22
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vp(e,t){if(e){if(typeof e=="string")return Ha(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 Ha(e,t)}}function Ha(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 kp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Lp(e){if(Array.isArray(e))return e}function oo(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=Hp(r,2),i=n[0],o=n[1],a=i,c=o?parseInt(o):1,u=zr(a),p={type:a,components:c,byteLength:u.byteLength*c,integer:u.integer,signed:u.signed,normalized:u.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 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 io(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){Kp(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 Kp(e,t,r){return t=Yp(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yp(e){var t=zp(e,"string");return kt(t)==="symbol"?t:String(t)}function zp(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 ct(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=$p(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.
23
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function $p(e,t){if(e){if(typeof e=="string")return Va(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 Va(e,t)}}function Va(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 ka(e,t){var r={},n=ct(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=Zp(e,t,o.name)}}catch(a){n.e(a)}finally{n.f()}return r}function La(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,n=ka(e,t),i=new Array(r).fill(null),o=0,a=Object.values(n);o<a.length;o++){var c=a[o];i[c.location]=c}return i}function Zp(e,t,r){var n=Qp(e,r),i=qp(t,r);if(!n)return null;var o=ja(n.type),a=i?.vertexFormat||o.defaultVertexFormat,c=oo(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:c.type,bufferComponents:c.components,normalized:c.normalized,integer:o.integer,stepMode:i?.stepMode||n.stepMode,byteOffset:i?.byteOffset||0,byteStride:i?.byteStride||0}}function Qp(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||D.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function qp(e,t){Jp(e);var r=Gp(e,t);return r||(r=ed(e,t),r)?r:(D.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Jp(e){var t=ct(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&D.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function Gp(e,t){var r=ct(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 ed(e,t){var r=ct(e),n;try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=o.byteStride;if(typeof o.byteStride!="number"){var c=ct(o.attributes||[]),u;try{for(c.s();!(u=c.n()).done;){var p=u.value,b=oo(p.format);a+=b.byteLength}}catch(v){c.e(v)}finally{c.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 ao(e,t){var r=io(io({},e),{},{attributes:e.attributes.map(function(a){return io({},a)})}),n=ct(t?.attributes||[]),i;try{var o=function(){var c=i.value,u=r.attributes.find(function(p){return p.name===c.name});u?(u.type=c.type||u.type,u.stepMode=c.stepMode||u.stepMode):D.warn("shader layout attribute ".concat(c.name," not present in shader"))};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}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 $a;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 Ya(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){td(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 td(e,t,r){return t=Za(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rd(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,Za(n.key),n)}}function nd(e,t,r){return t&&za(e.prototype,t),r&&za(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Za(e){var t=od(e,"string");return st(t)==="symbol"?t:String(t)}function od(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 id(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 ad(e){var t=cd();return function(){var n=$r(e),i;if(t){var o=$r(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return fd(this,i)}}function fd(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 ud(e)}function ud(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cd(){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 $r(e){return $r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$r(e)}$a=Symbol.toStringTag;var Zr=function(e){id(r,e);var t=ad(r);function r(n,i){var o;return rd(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=La(i.renderPipeline.shaderLayout,i.renderPipeline.bufferLayout,o.maxVertexAttributes),o}return nd(r,[{key:$a,get:function(){return"VertexArray"}}]),r}($);Zr.defaultProps=Ya(Ya({},$.defaultProps),{},{renderPipeline:null});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)}var Ga;function Qa(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 qa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qa(Object(r),!0).forEach(function(n){sd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sd(e,t,r){return t=ef(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ld(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ja(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,ef(n.key),n)}}function pd(e,t,r){return t&&Ja(e.prototype,t),r&&Ja(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ef(e){var t=dd(e,"string");return lt(t)==="symbol"?t:String(t)}function dd(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 hd(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&&uo(e,t)}function uo(e,t){return uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},uo(e,t)}function yd(e){var t=gd();return function(){var n=Qr(e),i;if(t){var o=Qr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return _d(this,i)}}function _d(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 bd(e)}function bd(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gd(){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 Qr(e){return Qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qr(e)}Ga=Symbol.toStringTag;var qr=function(e){hd(r,e);var t=yd(r);function r(n,i){return ld(this,r),t.call(this,n,i,r.defaultProps)}return pd(r,[{key:Ga,get:function(){return"TransformFeedback"}}]),r}($);qr.defaultProps=qa(qa({},$.defaultProps),{},{layout:void 0,buffers:{}});var Jr;function tf(e){return(!Jr||Jr.byteLength<e)&&(Jr=new ArrayBuffer(e)),Jr}function co(e,t){var r=tf(e.BYTES_PER_ELEMENT*t);return new e(r,0,t)}function so(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,c=r.length,u=a*c,p=0,b=i;p<c;p++)t[b++]=r[p];for(;p<u;)p<u-p?(t.copyWithin(i+p,i,i+p),p*=2):(t.copyWithin(i+p,i,i+u-p),p=u);return e.target}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 rf(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 vd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rf(Object(r),!0).forEach(function(n){md(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function md(e,t,r){return t=Td(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Td(e){var t=Sd(e,"string");return Lt(t)==="symbol"?t:String(t)}function Sd(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 Ad(e,t){return wd(e)||Ed(e,t)||Od(e,t)||Rd()}function Rd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
24
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Od(e,t){if(e){if(typeof e=="string")return nf(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 nf(e,t)}}function nf(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 Ed(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function wd(e){if(Array.isArray(e))return e}var Pd=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function Gr(e){var t=Pd.exec(e);if(t){var r=Ad(t,6),n=r[1],i=r[2],o=r[3],a=r[4],c=r[5];if(n){var u="".concat(o).concat(i),p=zr(u);return vd({format:n,components:n.length,srgb:a==="-srgb",unsized:c==="-unsized",webgl:c==="-webgl"},p)}}return Nd(e)}var Id={"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 Nd(e){var t,r=Id[e];if(!r)throw new Error("Unknown format ".concat(e));return{format:r.format||"",components:r.components||((t=r.format)===null||t===void 0?void 0:t.length)||1,byteLength:r.bpp||1,srgb:!1,unsized:!1}}function of(e){return Ei(e)!==null||typeof e=="number"||typeof e=="boolean"}function lo(e){var t={bindings:{},uniforms:{}};return Object.keys(e).forEach(function(r){var n=e[r];of(n)?t.uniforms[r]=n:t.bindings[r]=n}),t}function po(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 D.removed("Calling removed method ".concat(t,".").concat(a,": "),i)(),new Error(a)})})}function xd(e,t){return Dd(e)||Fd(e,t)||Bd(e,t)||Cd()}function Cd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
25
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bd(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 Fd(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Dd(e){if(Array.isArray(e))return e}function ho(e,t,r){var n=r.removedProps,i=n===void 0?{}:n,o=r.deprecatedProps,a=o===void 0?{}:o,c=r.replacedProps,u=c===void 0?{}:c;for(var p in i)if(p in t){var b=i[p],g=b?"".concat(e,".").concat(i[p]):"N/A";D.removed("".concat(e,".").concat(p),g)()}for(var v in a)if(v in t){var T=a[v];D.deprecated("".concat(e,".").concat(v),"".concat(e,".").concat(T))()}for(var S=null,E=0,P=Object.entries(u);E<P.length;E++){var O=xd(P[E],2),w=O[0],F=O[1];w in t&&(D.deprecated("".concat(e,".").concat(w),"".concat(e,".").concat(F))(),S=S||Object.assign({},t),S[F]=t[w],delete S[w])}return S||t}function yo(e){return yo=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},yo(e)}function Kt(){"use strict";Kt=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 T(){}function S(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=S.prototype=v.prototype=Object.create(E);function F(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var B=R.arg,x=B.value;return x&&yo(x)=="object"&&r.call(x,"__await")?f.resolve(x.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(x).then(function(U){B.value=U,m(B)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,B){s(h,m,R,B)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return T.prototype=S,n(w,"constructor",{value:S,configurable:!0}),n(S,"constructor",{value:T,configurable:!0}),T.displayName=u(S,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===T||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,S):(l.__proto__=S,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},F(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},F(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(B,x){return m.type="throw",m.arg=f,s.next=B,x&&(s.method="next",s.arg=void 0),!!x}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function ff(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function uf(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){ff(o,n,i,a,c,"next",u)}function c(u){ff(o,n,i,a,c,"throw",u)}a(void 0)})}}var Md="";function go(e,t){return _o.apply(this,arguments)}function _o(){return _o=uf(Kt().mark(function e(t,r){return Kt().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,a){try{var c=new Image;c.onload=function(){return o(c)},c.onerror=function(){return a(new Error("Could not load image ".concat(t,".")))},c.crossOrigin=r?.crossOrigin||"anonymous",c.src=t.startsWith("http")?t:Md+t}catch(u){a(u)}}));case 1:case"end":return i.stop()}},e)})),_o.apply(this,arguments)}function Yt(e,t){return bo.apply(this,arguments)}function bo(){return bo=uf(Kt().mark(function e(t,r){var n,i;return Kt().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(c,u){i.onload=c,i.onerror=function(p){return u(new Error("Unable to load script '".concat(t,"': ").concat(p)))},n.appendChild(i)}));case 8:case"end":return a.stop()}},e)})),bo.apply(this,arguments)}var zt={};function Ud(e){globalThis.console&&globalThis.console.error&&globalThis.console.error(e)}function jd(e){globalThis.console&&globalThis.console.log&&globalThis.console.log(e)}function Wd(e,t){zt[e]=!0,t!==void 0&&Ud(t)}function Hd(e){var t=e.getError;e.getError=function(){var n;do n=t.apply(e),n!==0&&(zt[n]=!0);while(n!==0);for(n in zt)if(zt[n])return delete zt[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 Ue=function(t){var r=this;this.gl=t,Hd(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 c=a.attribs[o];return c.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(o){var a=r.currentVertexArrayObject;a.maxAttrib=Math.max(a.maxAttrib,o);var c=a.attribs[o];return c.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 c=r.currentVertexArrayObject,u=c.attribs[o];switch(a){case 34975:return u.buffer;case 34338:return u.enabled;case 34339:return u.size;case 34340:return u.stride;case 34341:return u.type;case 34922:return u.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(o,a,c,u,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=c,v.normalized=u,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(){jd("OESVertexArrayObject emulation library context restored"),r.reset_()},!0),this.reset_()};Ue.prototype.VERTEX_ARRAY_BINDING_OES=34229;Ue.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)};Ue.prototype.createVertexArrayOES=function(){var t=new $t(this);return this.vertexArrayObjects.push(t),t};Ue.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)};Ue.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof $t&&t.hasBeenBound&&t.ext===this)};Ue.prototype.bindVertexArrayOES=function(t){var r=this.gl;if(t&&!t.isAlive){Wd(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,c=Math.max(i?i.maxAttrib:0,o.maxAttrib),u=0;u<=c;u++){var p=o.attribs[u],b=i?i.attribs[u]:null;if((!i||p.enabled!==b.enabled)&&(p.enabled?n.enableVertexAttribArray.call(r,u):n.disableVertexAttribArray.call(r,u)),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,u,p.size,p.type,p.normalized,p.stride,p.offset)}}this.currentArrayBuffer!==a&&n.bindBuffer.call(r,34962,this.currentArrayBuffer)}};function cf(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 Ue(this)),this.__OESVertexArrayObject))}}}var Xd="Invalid WebGLRenderingContext";var Vd="Requires WebGL2";function vo(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function Y(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function Zt(e){return Y(e)?e:null}function en(e){return H(vo(e),Xd),e}function sf(e){return H(Y(e),Vd),e}var z;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 Z(e,t,r){return t=kd(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kd(e){var t=Ld(e,"string");return Qt(t)==="symbol"?t:String(t)}function Ld(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 lf="OES_element_index",pf="WEBGL_draw_buffers",Kd="EXT_disjoint_timer_query",Yd="EXT_disjoint_timer_query_webgl2",zd="EXT_texture_filter_anisotropic",df="WEBGL_debug_renderer_info",$d=35723,Zd=4352,Qd=36795,qd=34047,Jd=37445,Gd=37446,J=function(t){return Y(t)?void 0:0},eh=(z={},Z(z,3074,function(e){return Y(e)?void 0:36064}),Z(z,$d,function(e){return Y(e)?void 0:Zd}),Z(z,35977,J),Z(z,32937,J),Z(z,Qd,function(e,t){var r=Y(e)?e.getExtension(Yd):e.getExtension(Kd);return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0}),Z(z,Jd,function(e,t){var r=e.getExtension(df);return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)}),Z(z,Gd,function(e,t){var r=e.getExtension(df);return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)}),Z(z,qd,function(e,t){var r,n=((r=e.luma)===null||r===void 0||(r=r.extensions)===null||r===void 0?void 0:r[zd])||e.getExtension("EXT_texture_filter_anisotropic");return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Z(z,32883,J),Z(z,35071,J),Z(z,37447,J),Z(z,36063,function(e,t){if(!Y(e)){var r=e.getExtension(pf);return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Z(z,35379,J),Z(z,35374,J),Z(z,35377,J),Z(z,34852,function(e){if(!Y(e)){var t=e.getExtension(pf);return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Z(z,36203,function(e){return e.getExtension(lf)?2147483647:65535}),Z(z,33001,function(e){return e.getExtension(lf)?16777216:65535}),Z(z,33e3,function(e){return 16777216}),Z(z,37157,J),Z(z,35373,J),Z(z,35657,J),Z(z,36183,J),Z(z,37137,J),Z(z,34045,J),Z(z,35978,J),Z(z,35979,J),Z(z,35968,J),Z(z,35376,J),Z(z,35375,J),Z(z,35659,J),Z(z,37154,J),Z(z,35371,J),Z(z,35658,J),Z(z,35076,J),Z(z,35077,J),Z(z,35380,J),z);function hf(e,t,r){var n=eh[r],i=typeof n=="function"?n(e,t,r):n,o=i!==void 0?i:t(r);return o}function pt(e){var t=e.luma;if(!t){var r={_polyfilled:!1,_extensions:{}};e.luma=r}return e.luma}var dt;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 tn(e,t,r){return t=th(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function th(e){var t=rh(e,"string");return qt(t)==="symbol"?t:String(t)}function rh(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 nh="OES_vertex_array_object",yf="ANGLE_instanced_arrays",oh="WEBGL_draw_buffers",ih="EXT_disjoint_timer_query",ah="EXT_texture_filter_anisotropic",fh="VertexArray requires WebGL2 or OES_vertex_array_object extension";function uh(e,t){return{webgl2:Y(e),ext:e.getExtension(t)}}var mo=(dt={},tn(dt,nh,{meta:{suffix:"OES"},createVertexArray:function(){H(!1,fh)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),tn(dt,yf,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,r){H(r===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),tn(dt,oh,{meta:{suffix:"WEBGL"},drawBuffers:function(){H(!1)}}),tn(dt,ih,{meta:{suffix:"EXT"},createQuery:function(){H(!1)},deleteQuery:function(){H(!1)},beginQuery:function(){H(!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){}}),dt),rn={readBuffer:function(t,r,n){Y(t)&&r(n)},getVertexAttrib:function(t,r,n,i){var o=uh(t,yf),a=o.webgl2,c=o.ext,u;switch(i){case 35069:u=a?void 0:!1;break;case 35070:u=!a&&!c?0:void 0;break;default:}return u!==void 0?u:r(n,i)},getProgramParameter:function(t,r,n,i){if(!Y(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(!Y(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=pt(t),a=o._extensions,c=a[ah];i=c&&c.TEXTURE_MAX_ANISOTROPY_EXT||34046;break;default:}return r(n,i)},getParameter:hf,hint:function(t,r,n,i){return r(n,i)}};function bf(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ch(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.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function ch(e,t){if(e){if(typeof e=="string")return _f(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 _f(e,t)}}function _f(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 nn(e){var t=pt(e);return t._polyfilled||(cf(e),sh(e),lh(e,mo),dh(e,{target:t,target2:e}),t._polyfilled=!0),e}function sh(e){var t=pt(e),r=e.getSupportedExtensions()||[],n=["WEBGL_polygon_mode"],i=bf(r),o;try{for(i.s();!(o=i.n()).done;){var a=o.value;if(!n.includes(a)){var c=e.getExtension(a);t._extensions[a]=c}}}catch(u){i.e(u)}finally{i.f()}}function lh(e,t){var r=pt(e),n=bf(Object.getOwnPropertyNames(t)),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;o!=="overrides"&&ph(e,{extension:o,target:r,target2:e})}}catch(a){n.e(a)}finally{n.f()}}function ph(e,t){var r=t.extension,n=t.target,i=t.target2,o=mo[r];H(o);for(var a=o.meta,c=a===void 0?{}:a,u=c.suffix,p=u===void 0?"":u,b=e.getExtension(r),g=function(){var E=T[v],P="".concat(E).concat(p),O=null;E==="meta"||typeof e[E]=="function"||(b&&typeof b[P]=="function"?O=function(){return b[P].apply(b,arguments)}:typeof o[E]=="function"&&(O=o[E].bind(n))),O&&(n[E]=O,i[E]=O)},v=0,T=Object.keys(o);v<T.length;v++)g()}function dh(e,t){var r=t.target,n=t.target2;Object.keys(rn).forEach(function(i){if(typeof rn[i]=="function"){var o=e[i]?e[i].bind(e):function(){},a=rn[i].bind(null,e,o);r[i]=a,n[i]=a}})}var C,I,_e;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 To(e,t){return _h(e)||yh(e,t)||mf(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 yh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function _h(e){if(Array.isArray(e))return e}function re(e){return vh(e)||gh(e)||mf(e)||bh()}function bh(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
28
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mf(e,t){if(e){if(typeof e=="string")return Ao(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 Ao(e,t)}}function gh(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vh(e){if(Array.isArray(e))return Ao(e)}function Ao(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 _(e,t,r){return t=mh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mh(e){var t=Th(e,"string");return Gt(t)==="symbol"?t:String(t)}function Th(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)}var er=(C={},_(C,3042,!1),_(C,32773,new Float32Array([0,0,0,0])),_(C,32777,32774),_(C,34877,32774),_(C,32969,1),_(C,32968,0),_(C,32971,1),_(C,32970,0),_(C,3106,new Float32Array([0,0,0,0])),_(C,3107,[!0,!0,!0,!0]),_(C,2884,!1),_(C,2885,1029),_(C,2929,!1),_(C,2931,1),_(C,2932,513),_(C,2928,new Float32Array([0,1])),_(C,2930,!0),_(C,3024,!0),_(C,35725,null),_(C,36006,null),_(C,36007,null),_(C,34229,null),_(C,34964,null),_(C,2886,2305),_(C,33170,4352),_(C,2849,1),_(C,32823,!1),_(C,32824,0),_(C,10752,0),_(C,32926,!1),_(C,32928,!1),_(C,32938,1),_(C,32939,!1),_(C,3089,!1),_(C,3088,new Int32Array([0,0,1024,1024])),_(C,2960,!1),_(C,2961,0),_(C,2968,4294967295),_(C,36005,4294967295),_(C,2962,519),_(C,2967,0),_(C,2963,4294967295),_(C,34816,519),_(C,36003,0),_(C,36004,4294967295),_(C,2964,7680),_(C,2965,7680),_(C,2966,7680),_(C,34817,7680),_(C,34818,7680),_(C,34819,7680),_(C,2978,[0,0,1024,1024]),_(C,3333,4),_(C,3317,4),_(C,37440,!1),_(C,37441,!1),_(C,37443,37444),_(C,36389,null),_(C,36662,null),_(C,36663,null),_(C,35053,null),_(C,35055,null),_(C,35723,4352),_(C,36010,null),_(C,35977,!1),_(C,3330,0),_(C,3332,0),_(C,3331,0),_(C,3314,0),_(C,32878,0),_(C,3316,0),_(C,3315,0),_(C,32877,0),C),Ae=function(t,r,n){return r?t.enable(n):t.disable(n)},gf=function(t,r,n){return t.hint(n,r)},he=function(t,r,n){return t.pixelStorei(n,r)},vf=function(t,r,n){var i;return n===36006?i=Y(t)?36009:36160:i=36008,t.bindFramebuffer(i,r)},Jt=function(t,r,n){var i,o=(i={},_(i,34964,34962),_(i,36662,36662),_(i,36663,36663),_(i,35053,35051),_(i,35055,35052),i),a=o[n];t.bindBuffer(a,r)};function So(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Tf=(I={},_(I,3042,Ae),_(I,32773,function(e,t){return e.blendColor.apply(e,re(t))}),_(I,32777,"blendEquation"),_(I,34877,"blendEquation"),_(I,32969,"blendFunc"),_(I,32968,"blendFunc"),_(I,32971,"blendFunc"),_(I,32970,"blendFunc"),_(I,3106,function(e,t){return e.clearColor.apply(e,re(t))}),_(I,3107,function(e,t){return e.colorMask.apply(e,re(t))}),_(I,2884,Ae),_(I,2885,function(e,t){return e.cullFace(t)}),_(I,2929,Ae),_(I,2931,function(e,t){return e.clearDepth(t)}),_(I,2932,function(e,t){return e.depthFunc(t)}),_(I,2928,function(e,t){return e.depthRange.apply(e,re(t))}),_(I,2930,function(e,t){return e.depthMask(t)}),_(I,3024,Ae),_(I,35723,gf),_(I,35725,function(e,t){return e.useProgram(t)}),_(I,36007,function(e,t){return e.bindRenderbuffer(36161,t)}),_(I,36389,function(e,t){var r,n;return(r=(n=e).bindTransformFeedback)===null||r===void 0?void 0:r.call(n,36386,t)}),_(I,34229,function(e,t){return e.bindVertexArray(t)}),_(I,36006,vf),_(I,36010,vf),_(I,34964,Jt),_(I,36662,Jt),_(I,36663,Jt),_(I,35053,Jt),_(I,35055,Jt),_(I,2886,function(e,t){return e.frontFace(t)}),_(I,33170,gf),_(I,2849,function(e,t){return e.lineWidth(t)}),_(I,32823,Ae),_(I,32824,"polygonOffset"),_(I,10752,"polygonOffset"),_(I,35977,Ae),_(I,32926,Ae),_(I,32928,Ae),_(I,32938,"sampleCoverage"),_(I,32939,"sampleCoverage"),_(I,3089,Ae),_(I,3088,function(e,t){return e.scissor.apply(e,re(t))}),_(I,2960,Ae),_(I,2961,function(e,t){return e.clearStencil(t)}),_(I,2968,function(e,t){return e.stencilMaskSeparate(1028,t)}),_(I,36005,function(e,t){return e.stencilMaskSeparate(1029,t)}),_(I,2962,"stencilFuncFront"),_(I,2967,"stencilFuncFront"),_(I,2963,"stencilFuncFront"),_(I,34816,"stencilFuncBack"),_(I,36003,"stencilFuncBack"),_(I,36004,"stencilFuncBack"),_(I,2964,"stencilOpFront"),_(I,2965,"stencilOpFront"),_(I,2966,"stencilOpFront"),_(I,34817,"stencilOpBack"),_(I,34818,"stencilOpBack"),_(I,34819,"stencilOpBack"),_(I,2978,function(e,t){return e.viewport.apply(e,re(t))}),_(I,3333,he),_(I,3317,he),_(I,37440,he),_(I,37441,he),_(I,37443,he),_(I,3330,he),_(I,3332,he),_(I,3331,he),_(I,3314,he),_(I,32878,he),_(I,3316,he),_(I,3315,he),_(I,32877,he),_(I,"framebuffer",function(t,r){var n=r&&"handle"in r?r.handle:r;return t.bindFramebuffer(36160,n)}),_(I,"blend",function(t,r){return r?t.enable(3042):t.disable(3042)}),_(I,"blendColor",function(t,r){return t.blendColor.apply(t,re(r))}),_(I,"blendEquation",function(t,r){var n=typeof r=="number"?[r,r]:r;t.blendEquationSeparate.apply(t,re(n))}),_(I,"blendFunc",function(t,r){var n=r?.length===2?[].concat(re(r),re(r)):r;t.blendFuncSeparate.apply(t,re(n))}),_(I,"clearColor",function(t,r){return t.clearColor.apply(t,re(r))}),_(I,"clearDepth",function(t,r){return t.clearDepth(r)}),_(I,"clearStencil",function(t,r){return t.clearStencil(r)}),_(I,"colorMask",function(t,r){return t.colorMask.apply(t,re(r))}),_(I,"cull",function(t,r){return r?t.enable(2884):t.disable(2884)}),_(I,"cullFace",function(t,r){return t.cullFace(r)}),_(I,"depthTest",function(t,r){return r?t.enable(2929):t.disable(2929)}),_(I,"depthFunc",function(t,r){return t.depthFunc(r)}),_(I,"depthMask",function(t,r){return t.depthMask(r)}),_(I,"depthRange",function(t,r){return t.depthRange.apply(t,re(r))}),_(I,"dither",function(t,r){return r?t.enable(3024):t.disable(3024)}),_(I,"derivativeHint",function(t,r){t.hint(35723,r)}),_(I,"frontFace",function(t,r){return t.frontFace(r)}),_(I,"mipmapHint",function(t,r){return t.hint(33170,r)}),_(I,"lineWidth",function(t,r){return t.lineWidth(r)}),_(I,"polygonOffsetFill",function(t,r){return r?t.enable(32823):t.disable(32823)}),_(I,"polygonOffset",function(t,r){return t.polygonOffset.apply(t,re(r))}),_(I,"sampleCoverage",function(t,r){return t.sampleCoverage.apply(t,re(r))}),_(I,"scissorTest",function(t,r){return r?t.enable(3089):t.disable(3089)}),_(I,"scissor",function(t,r){return t.scissor.apply(t,re(r))}),_(I,"stencilTest",function(t,r){return r?t.enable(2960):t.disable(2960)}),_(I,"stencilMask",function(t,r){r=So(r)?r:[r,r];var n=r,i=To(n,2),o=i[0],a=i[1];t.stencilMaskSeparate(1028,o),t.stencilMaskSeparate(1029,a)}),_(I,"stencilFunc",function(t,r){r=So(r)&&r.length===3?[].concat(re(r),re(r)):r;var n=r,i=To(n,6),o=i[0],a=i[1],c=i[2],u=i[3],p=i[4],b=i[5];t.stencilFuncSeparate(1028,o,a,c),t.stencilFuncSeparate(1029,u,p,b)}),_(I,"stencilOp",function(t,r){r=So(r)&&r.length===3?[].concat(re(r),re(r)):r;var n=r,i=To(n,6),o=i[0],a=i[1],c=i[2],u=i[3],p=i[4],b=i[5];t.stencilOpSeparate(1028,o,a,c),t.stencilOpSeparate(1029,u,p,b)}),_(I,"viewport",function(t,r){return t.viewport.apply(t,re(r))}),I);function ne(e,t,r){return t[e]!==void 0?t[e]:r[e]}var Sf={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))}},Ro={enable:function(t,r){return t(_({},r,!0))},disable:function(t,r){return t(_({},r,!1))},pixelStorei:function(t,r,n){return t(_({},r,n))},hint:function(t,r,n){return t(_({},r,n))},useProgram:function(t,r){return t(_({},35725,r))},bindRenderbuffer:function(t,r,n){return t(_({},36007,n))},bindTransformFeedback:function(t,r,n){return t(_({},36389,n))},bindVertexArray:function(t,r){return t(_({},34229,r))},bindFramebuffer:function(t,r,n){var i;switch(r){case 36160:return t((i={},_(i,36006,n),_(i,36010,n),i));case 36009:return t(_({},36006,n));case 36008:return t(_({},36010,n));default:return null}},bindBuffer:function(t,r,n){var i,o=(i={},_(i,34962,[34964]),_(i,36662,[36662]),_(i,36663,[36663]),_(i,35051,[35053]),_(i,35052,[35055]),i)[r];return o?t(_({},o,n)):{valueChanged:!0}},blendColor:function(t,r,n,i,o){return t(_({},32773,new Float32Array([r,n,i,o])))},blendEquation:function(t,r){var n;return t((n={},_(n,32777,r),_(n,34877,r),n))},blendEquationSeparate:function(t,r,n){var i;return t((i={},_(i,32777,r),_(i,34877,n),i))},blendFunc:function(t,r,n){var i;return t((i={},_(i,32969,r),_(i,32968,n),_(i,32971,r),_(i,32970,n),i))},blendFuncSeparate:function(t,r,n,i,o){var a;return t((a={},_(a,32969,r),_(a,32968,n),_(a,32971,i),_(a,32970,o),a))},clearColor:function(t,r,n,i,o){return t(_({},3106,new Float32Array([r,n,i,o])))},clearDepth:function(t,r){return t(_({},2931,r))},clearStencil:function(t,r){return t(_({},2961,r))},colorMask:function(t,r,n,i,o){return t(_({},3107,[r,n,i,o]))},cullFace:function(t,r){return t(_({},2885,r))},depthFunc:function(t,r){return t(_({},2932,r))},depthRange:function(t,r,n){return t(_({},2928,new Float32Array([r,n])))},depthMask:function(t,r){return t(_({},2930,r))},frontFace:function(t,r){return t(_({},2886,r))},lineWidth:function(t,r){return t(_({},2849,r))},polygonOffset:function(t,r,n){var i;return t((i={},_(i,32824,r),_(i,10752,n),i))},sampleCoverage:function(t,r,n){var i;return t((i={},_(i,32938,r),_(i,32939,n),i))},scissor:function(t,r,n,i,o){return t(_({},3088,new Int32Array([r,n,i,o])))},stencilMask:function(t,r){var n;return t((n={},_(n,2968,r),_(n,36005,r),n))},stencilMaskSeparate:function(t,r,n){return t(_({},r===1028?2968:36005,n))},stencilFunc:function(t,r,n,i){var o;return t((o={},_(o,2962,r),_(o,2967,n),_(o,2963,i),_(o,34816,r),_(o,36003,n),_(o,36004,i),o))},stencilFuncSeparate:function(t,r,n,i,o){var a;return t((a={},_(a,r===1028?2962:34816,n),_(a,r===1028?2967:36003,i),_(a,r===1028?2963:36004,o),a))},stencilOp:function(t,r,n,i){var o;return t((o={},_(o,2964,r),_(o,2965,n),_(o,2966,i),_(o,34817,r),_(o,34818,n),_(o,34819,i),o))},stencilOpSeparate:function(t,r,n,i,o){var a;return t((a={},_(a,r===1028?2964:34817,n),_(a,r===1028?2965:34818,i),_(a,r===1028?2966:34819,o),a))},viewport:function(t,r,n,i,o){return t(_({},2978,[r,n,i,o]))}},Re=function(t,r){return t.isEnabled(r)},Oo=(_e={},_(_e,3042,Re),_(_e,2884,Re),_(_e,2929,Re),_(_e,3024,Re),_(_e,32823,Re),_(_e,32926,Re),_(_e,32928,Re),_(_e,3089,Re),_(_e,2960,Re),_(_e,35977,Re),_e),Af=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 Sh(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ah(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.
29
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Ah(e,t){if(e){if(typeof e=="string")return Rf(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 Rf(e,t)}}function Rf(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(!Rh(t)){var i={};for(var o in t){var a=Number(o),c=Tf[o];c&&(typeof c=="string"?i[c]=!0:c(n,t[o],a))}var u=n.state&&n.state.cache;if(u)for(var p in i){var b=Sf[p];b(n,t,u)}}}function on(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:er,r=le.attach(e),n=r.gl;if(typeof t=="number"){var i=t,o=Oo[i];return o?o(n,i):n.getParameter(i)}var a=Array.isArray(t)?t:Object.keys(t),c={},u=Sh(a),p;try{for(u.s();!(p=u.n()).done;){var b=p.value,g=Oo[b];c[b]=g?g(n,Number(b)):n.getParameter(Number(b))}}catch(v){u.e(v)}finally{u.f()}return c}function Of(e){be(e,er)}function Rh(e){for(var t in e)return!1;return!0}function Ef(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 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 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,Eh(n.key),n)}}function Oh(e,t,r){return t&&wf(e.prototype,t),r&&wf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Eh(e){var t=wh(e,"string");return tr(t)==="symbol"?t:String(t)}function wh(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)}function Ph(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ih=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,c=a===void 0?function(){}:a;Ph(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?on(r):Object.assign({},er),this.log=c,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(){H(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 c in n){H(c!==void 0);var u=n[c],p=this.cache[c];Ef(u,p)||(i=!0,o=p,a&&!(c in a)&&(a[c]=p),this.cache[c]=u)}return{valueChanged:i,oldValue:o}},Oh(e)}();function je(e){return e.state}function rr(e,t){var r=t.enable,n=r===void 0?!0:r,i=t.copyState;if(H(i!==void 0),!e.state){e.state=new Ih(e,{copyState:i}),xh(e);for(var o in Ro){var a=Ro[o];Nh(e,o,a)}Pf(e,"getParameter"),Pf(e,"isEnabled")}var c=je(e);return c.enable=n,e}function Te(e){var t=je(e);t||(rr(e,{copyState:!1}),t=je(e)),t.push()}function ge(e){var t=je(e);H(t),t.pop()}function Pf(e,t){var r=e[t].bind(e);e[t]=function(i){if(i===void 0||Af.has(i))return r(i);var o=je(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 Nh(e,t,r){if(e[t]){var n=e[t].bind(e);e[t]=function(){for(var o=je(e),a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];var p=r.apply(void 0,[o._updateCache].concat(c)),b=p.valueChanged,g=p.oldValue;return b&&n.apply(void 0,c),g},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}}function xh(e){var t=e.useProgram.bind(e);e.useProgram=function(n){var i=je(e);i.program!==n&&(t(n),i.program=n)}}function nr(e){return nr=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},nr(e)}function If(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 ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?If(Object(r),!0).forEach(function(n){Ch(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):If(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ch(e,t,r){return t=Bh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bh(e){var t=Fh(e,"string");return nr(t)==="symbol"?t:String(t)}function Fh(e,t){if(nr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(nr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dh={webgl2:!0,webgl1:!0,powerPreference:"high-performance",onContextLost:function(){return console.error("WebGL context lost")},onContextRestored:function(){return console.info("WebGL context restored")}};function Nf(e,t){t=ht(ht({},Dh),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=ht(ht({},t),{},{webgl1:!1})),t.type==="webgl1"&&(t=ht(ht({},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 c=t,u=c.onContextRestored;e.addEventListener("webglcontextrestored",function(p){return u(p)},!1)}return i}function xf(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,c=o||r,u=e.getParameter(7938),p=Cf(a,c),b=Mh(a,c),g=Uh(a,c),v="glsl",T=Y(e)?300:100;return{type:Y(e)?"webgl2":"webgl",gpu:p,gpuType:g,gpuBackend:b,vendor:a,renderer:c,version:u,shadingLanguage:v,shadingLanguageVersion:T}}function Cf(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 Mh(e,t){return/Metal/i.exec(e)||/Metal/i.exec(t)?"metal":/ANGLE/i.exec(e)||/ANGLE/i.exec(t)?"opengl":"unknown"}function Uh(e,t){if(/SwiftShader/i.exec(e)||/SwiftShader/i.exec(t))return"cpu";var r=Cf(e,t);switch(r){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function Bf(){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 an(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,Oe;function fr(e){return fr=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},fr(e)}function jh(e,t){return Vh(e)||Xh(e,t)||Hh(e,t)||Wh()}function Wh(){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 Hh(e,t){if(e){if(typeof e=="string")return Ff(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 Ff(e,t)}}function Ff(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 Xh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Vh(e){if(Array.isArray(e))return e}function oe(e,t,r){return t=kh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kh(e){var t=Lh(e,"string");return fr(t)==="symbol"?t:String(t)}function Lh(e,t){if(fr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fe="texture-compression-bc",Q="texture-compression-astc",Ee="texture-compression-etc2",Kh="texture-compression-etc1-webgl",fn="texture-compression-pvrtc-webgl",Eo="texture-compression-atc-webgl",or="WEBGL_compressed_texture_s3tc",ir="WEBGL_compressed_texture_s3tc_srgb",yt="EXT_texture_compression_rgtc",ar="EXT_texture_compression_bptc",Yh="WEBGL_compressed_texture_etc",zh="WEBGL_compressed_texture_astc",$h="WEBGL_compressed_texture_etc1",Zh="WEBGL_compressed_texture_pvrtc",Qh="WEBGL_compressed_texture_atc",Df="EXT_sRGB",Ie="EXT_texture_norm16",qh="WEBGL_color_buffer_float",Jh="EXT_color_buffer_float",Se=function(t,r){return t.getExtension(r)},We=function(t,r){return r.every(function(n){return t.getExtension(n)})},wo={"texture-blend-float-webgl1":function(t){return Y(t)?!0:Se(t,"EXT_float_blend")},"texture-formats-srgb-webgl1":function(t){return Y(t)?!0:Se(t,Df)},"texture-formats-depth-webgl1":function(t){return Y(t)?!0:Se(t,"WEBGL_depth_texture")},"texture-formats-float32-webgl1":function(t){return Y(t)?!0:Se(t,"OES_texture_float")},"texture-formats-float16-webgl1":function(t){return Y(t)?!0:Se(t,"OES_texture_half_float")},"texture-formats-norm16-webgl":function(t){return Y(t)?Se(t,Ie):!1},"texture-filter-linear-float32-webgl":function(t){return Se(t,"OES_texture_float_linear")},"texture-filter-linear-float16-webgl":function(t){return Se(t,"OES_texture_half_float_linear")},"texture-filter-anisotropic-webgl":function(t){return Se(t,"EXT_texture_filter_anisotropic")},"texture-renderable-float32-webgl":function(t){return Se(t,"EXT_color_buffer_float")},"texture-renderable-float16-webgl":function(t){return Se(t,"EXT_color_buffer_half_float")},"texture-compression-bc":function(t){return We(t,[or,ir,yt,ar])},"texture-compression-bc5-webgl":function(t){return We(t,[yt])},"texture-compression-etc2":function(t){return We(t,[Yh])},"texture-compression-astc":function(t){return We(t,[zh])},"texture-compression-etc1-webgl":function(t){return We(t,[$h])},"texture-compression-pvrtc-webgl":function(t){return We(t,[Zh])},"texture-compression-atc-webgl":function(t){return We(t,[Qh])}};function Gh(e,t){var r;return((r=wo[t])===null||r===void 0?void 0:r.call(wo,e))||!1}function Mf(e){var t=Object.keys(wo);return t.filter(function(r){return Gh(e,r)})}var He={"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:Ie},"r16snorm-webgl":{gl:36760,b:2,c:1,f:"texture-formats-norm16-webgl",x:Ie},"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:Df,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:Ie},"rg16snorm-webgl":{gl:36761,b:2,c:2,f:"texture-formats-norm16-webgl",x:Ie},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:Ie},"rgb16snorm-webgl":{gl:36762,b:2,c:3,f:"texture-formats-norm16-webgl",x:Ie},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:Ie},"rgba16snorm-webgl":{gl:36763,b:2,c:4,f:"texture-formats-norm16-webgl",x:Ie},"rgb32float-webgl":{gl:34837,gl1:6407,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",gl2ext:Jh,gl1ext:qh,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:or,f:fe},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:ir,f:fe},"bc1-rgba-unorm":{gl:33777,x:or,f:fe},"bc1-rgba-unorm-srgb":{gl:35916,x:ir,f:fe},"bc2-rgba-unorm":{gl:33778,x:or,f:fe},"bc2-rgba-unorm-srgb":{gl:35918,x:ir,f:fe},"bc3-rgba-unorm":{gl:33779,x:or,f:fe},"bc3-rgba-unorm-srgb":{gl:35919,x:ir,f:fe},"bc4-r-unorm":{gl:36283,x:yt,f:fe},"bc4-r-snorm":{gl:36284,x:yt,f:fe},"bc5-rg-unorm":{gl:36285,x:yt,f:fe},"bc5-rg-snorm":{gl:36286,x:yt,f:fe},"bc6h-rgb-ufloat":{gl:36495,x:ar,f:fe},"bc6h-rgb-float":{gl:36494,x:ar,f:fe},"bc7-rgba-unorm":{gl:36492,x:ar,f:fe},"bc7-rgba-unorm-srgb":{gl:36493,x:ar,f:fe},"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:fn},"pvrtc-rgba4unorm-webgl":{gl:35842,f:fn},"pvrtc-rbg2unorm-webgl":{gl:35841,f:fn},"pvrtc-rgba2unorm-webgl":{gl:35843,f:fn},"etc1-rbg-unorm-webgl":{gl:36196,f:Kh},"atc-rgb-unorm-webgl":{gl:35986,f:Eo},"atc-rgba-unorm-webgl":{gl:35986,f:Eo},"atc-rgbai-unorm-webgl":{gl:34798,f:Eo}},ey=(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),ty=(Oe={},oe(Oe,5126,4),oe(Oe,5125,4),oe(Oe,5124,4),oe(Oe,5123,2),oe(Oe,5122,2),oe(Oe,5131,2),oe(Oe,5120,1),oe(Oe,5121,1),Oe);function ur(e,t){var r=Xe(t),n=He[r];if(!n||(Y(e)?n.gl===void 0:n.gl1===void 0))return!1;var i=n.x||Y(e)&&n.gl2ext||n.gl1ext;return i?Boolean(e.getExtension(i)):!0}function Uf(e,t){var r;return ur(e,t)&&((r=He[t])===null||r===void 0?void 0:r.renderbuffer)}function Xe(e){if(typeof e=="string")return e;var t=Object.entries(He).find(function(r){var n=jh(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 cr(e,t){var r=He[e],n=t?r?.gl:r?.gl1;if(n===void 0)throw new Error("Unsupported texture format ".concat(e));return n}function jf(e,t){var r=Xe(t);if(!ur(e,r))return!1;try{var n=Gr(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 Wf(e,t){var r=Xe(t);return!(!ur(e,r)||typeof r=="number")}function _t(e,t){var r=Xe(e),n=cr(r,t),i=Gr(r);return{format:n,dataFormat:ry(i.format,i.integer,i.normalized,n),type:i.dataType?an(i.dataType):5121,compressed:i.compressed}}function Hf(e){var t=He[e];if(!(t!=null&&t.attachment))throw new Error("".concat(e," is not a depth stencil format"));return t.attachment}function un(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,c=1,u=1,p=0,b=new Uint8Array([0,0,255,255]);e.texImage2D(3553,a,t,c,u,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 sr(e,t){var r=Xe(e),n=_t(r,t),i=ey[n.dataFormat]||4,o=ty[n.type]||1;return i*o}function ry(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 ny(e,t){return ay(e)||iy(e,t)||Vf(e,t)||oy()}function oy(){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 iy(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function ay(e){if(Array.isArray(e))return e}function fy(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Vf(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,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Vf(e,t){if(e){if(typeof e=="string")return Xf(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 Xf(e,t)}}function Xf(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 kf(e){var t=uy(e),r=fy(Mf(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 uy(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(Lf);r<n.length;r++){var i=n[r];cy(e,i)&&t.add(i)}return t}function cy(e,t){var r=Lf[t];if(!r)return!1;var n=r||[],i=ny(n,2),o=i[0],a=i[1],c=Y(e)?a:o;if(typeof c=="boolean")return c;switch(t){case"texture-renderable-rgba32float-webgl":return Y(e)?Boolean(e.getExtension(c)):un(e);case"glsl-derivatives":return Io(e,c);case"glsl-frag-data":return Io(e,c,{behavior:"require"});case"glsl-frag-depth":return Io(e,c);default:return Boolean(e.getExtension(c))}}var Po={};function Io(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!Bf(r))return!0;if(t in Po)return Po[t];var n=r.behavior||"enable",i="#extension GL_".concat(t," : ").concat(n,`
33
+ 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 Lf={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 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 k(e,t,r){return t=sy(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sy(e){var t=ly(e,"string");return lr(t)==="symbol"?t:String(t)}function ly(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 Kf(e){var t=Zt(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 Yf(e){var t,r=Zt(e);function n(o){return e.getParameter(o)}function i(o,a){return r?r.getParameter(o):a||0}return t={},k(t,33902,n(33902)),k(t,33901,n(33901)),k(t,3379,n(3379)),k(t,34076,n(34076)),k(t,34930,n(34930)),k(t,35661,n(35661)),k(t,35660,n(35660)),k(t,34024,n(34024)),k(t,36348,n(36348)),k(t,34921,n(34921)),k(t,36347,n(36347)),k(t,36349,n(36349)),k(t,3386,n(3386)),k(t,34047,n(34047)),k(t,32883,i(32883)),k(t,35071,i(35071)),k(t,37447,i(37447)),k(t,36063,i(36063)),k(t,35379,i(35379)),k(t,35374,i(35374)),k(t,35377,i(35377)),k(t,34852,i(34852)),k(t,36203,i(36203)),k(t,33001,i(33001)),k(t,33e3,i(33e3)),k(t,37157,i(37157)),k(t,35373,i(35373)),k(t,35657,i(35657)),k(t,36183,i(36183)),k(t,37137,i(37137)),k(t,34045,i(34045)),k(t,35978,i(35978)),k(t,35979,i(35979)),k(t,35968,i(35968)),k(t,35376,i(35376)),k(t,35375,i(35375)),k(t,35659,i(35659)),k(t,37154,i(37154)),k(t,35371,i(35371)),k(t,35658,i(35658)),k(t,35076,i(35076)),k(t,35077,i(35077)),k(t,35380,i(35380)),t}function ve(e,t,r){var n=le.attach(e),i=n.gl;if(py(t))return r(e);var o=t.nocatch,a=o===void 0?!0:o;Te(i),be(i,t);var c;if(a)c=r(i),ge(i);else try{c=r(i)}finally{ge(i)}return c}function py(e){for(var t in e)return!1;return!0}function $f(e,t,r,n){if(Qe(t))return n(e);Te(e.gl);try{return ln(e,t),be(e,r),n(e)}finally{ge(e.gl)}}function Zf(e,t,r){if(Qe(t))return r(e);Te(e.gl);try{return ln(e,t),r(e)}finally{ge(e.gl)}}function ln(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(pr("frontFace",t.frontFace,{ccw:2305,cw:2304})),t.depthBias!==void 0&&n.polygonOffset(t.depthBias,t.depthBiasSlopeScale||0),t.depthWriteEnabled!==void 0&&n.depthMask(hy("depthWriteEnabled",t.depthWriteEnabled)),t.depthCompare&&(t.depthCompare!=="always"?n.enable(2929):n.disable(2929),n.depthFunc(sn("depthCompare",t.depthCompare))),t.stencilWriteMask){var i=t.stencilWriteMask;n.stencilMaskSeparate(1028,i),n.stencilMaskSeparate(1029,i)}if(t.stencilReadMask&&D.warn("stencilReadMask not supported under WebGL"),t.stencilCompare){var o=t.stencilReadMask||4294967295,a=sn("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 c=No("stencilPassOperation",t.stencilPassOperation),u=No("stencilFailOperation",t.stencilFailOperation),p=No("stencilDepthFailOperation",t.stencilDepthFailOperation);n.stencilOpSeparate(1028,u,p,c),n.stencilOpSeparate(1029,u,p,c)}if(t.blendColorOperation||t.blendAlphaOperation){n.enable(3042);var b=zf("blendColorOperation",t.blendColorOperation||"add"),g=zf("blendAlphaOperation",t.blendAlphaOperation||"add");n.blendEquationSeparate(b,g);var v=cn("blendColorSrcFactor",t.blendColorSrcFactor||"one"),T=cn("blendColorDstFactor",t.blendColorDstFactor||"zero"),S=cn("blendAlphaSrcFactor",t.blendAlphaSrcFactor||"one"),E=cn("blendAlphaDstFactor",t.blendAlphaDstFactor||"zero");n.blendFuncSeparate(v,T,S,E)}}function sn(e,t){return pr(e,t,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function No(e,t){return pr(e,t,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function zf(e,t){return pr(e,t,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function cn(e,t){return pr(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 dy(e,t){return"Illegal parameter ".concat(t," for ").concat(e)}function pr(e,t,r){if(!(t in r))throw new Error(dy(e,t));return r[t]}function hy(e,t){return t}function dr(e){return dr=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},dr(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 yy(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){_y(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 _y(e,t,r){return t=by(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function by(e){var t=gy(e,"string");return dr(t)==="symbol"?t:String(t)}function gy(e,t){if(dr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(dr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pn(e){var t={};return e.addressModeU&&(t[10242]=xo(e.addressModeU)),e.addressModeV&&(t[10243]=xo(e.addressModeV)),e.addressModeW&&(t[32882]=xo(e.addressModeW)),e.magFilter&&(t[10240]=Jf(e.magFilter)),(e.minFilter||e.mipmapFilter)&&(t[10241]=vy(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]=sn("compare",e.compare)),e.maxAnisotropy&&(t[34046]=e.maxAnisotropy),t}function qf(e){var t=yy({},e);return e[10241]!==9728&&(t[10241]=9729),t[10242]=33071,t[10243]=33071,t}function xo(e){switch(e){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function Jf(e){switch(e){case"nearest":return 9728;case"linear":return 9729}}function vy(e,t){if(!t)return Jf(e);switch(e){case"nearest":return t==="nearest"?9984:9986;case"linear":return t==="nearest"?9985:9987}}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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 T(){}function S(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=S.prototype=v.prototype=Object.create(E);function F(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var B=R.arg,x=B.value;return x&&Ne(x)=="object"&&r.call(x,"__await")?f.resolve(x.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(x).then(function(U){B.value=U,m(B)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,B){s(h,m,R,B)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return T.prototype=S,n(w,"constructor",{value:S,configurable:!0}),n(S,"constructor",{value:T,configurable:!0}),T.displayName=u(S,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===T||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,S):(l.__proto__=S,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},F(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},F(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(B,x){return m.type="throw",m.arg=f,s.next=B,x&&(s.method="next",s.arg=void 0),!!x}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function Gf(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function my(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){Gf(o,n,i,a,c,"next",u)}function c(u){Gf(o,n,i,a,c,"throw",u)}a(void 0)})}}function eu(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 tu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eu(Object(r),!0).forEach(function(n){Ty(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ty(e,t,r){return t=nu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ne(e){return Ne=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},Ne(e)}function ru(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,nu(n.key),n)}}function Sy(e,t,r){return t&&ru(e.prototype,t),r&&ru(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function nu(e){var t=Ay(e,"string");return Ne(t)==="symbol"?t:String(t)}function Ay(e,t){if(Ne(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ne(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ry(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oy(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 Ey(e){var t=Iy();return function(){var n=dn(e),i;if(t){var o=dn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return wy(this,i)}}function wy(e,t){if(t&&(Ne(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Py(e)}function Py(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Iy(){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 dn(e){return dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dn(e)}var pe=function(e){Oy(r,e);var t=Ey(r);function r(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ry(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.device=i,o.gl=o.device.gl,o.gl2=o.device.gl2;var c=Ne(a)==="object"?a.handle:void 0;return o.handle=c||o.gl.createBuffer(),i.setSpectorMetadata(o.handle,tu(tu({},o.props),{},{data:Ne(o.props.data)})),o.glTarget=Ny(o.props.usage),o.glUsage=xy(o.props.usage),o.glIndexType=o.props.indexType==="uint32"?5125:5123,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,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:o.byteLength+a,u=this.glTarget;this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,c,this.glUsage),this.gl.bufferSubData(u,a,o),this.gl.bindBuffer(u,null),this.bytesUsed=c,this.byteLength=c,this._setDebugData(o,a,c),this.trackAllocatedMemory(c)},n._initWithByteLength=function(o){H(o>=0);var a=o;o===0&&(a=new Float32Array(0));var c=this.glTarget;return this.gl.bindBuffer(c,this.handle),this.gl.bufferData(c,a,this.glUsage),this.gl.bindBuffer(c,null),this.bytesUsed=o,this.byteLength=o,this._setDebugData(null,0,o),this.trackAllocatedMemory(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,c=0,u=void 0,p=this.device.isWebGL2?36663:this.glTarget;this.gl.bindBuffer(p,this.handle),c!==0||u!==void 0?(this.device.assertWebGL2(),this.gl2.bufferSubData(p,a,o,c,u)):this.gl.bufferSubData(p,a,o),this.gl.bindBuffer(p,null),this._setDebugData(o,a,o.byteLength)},n.readAsync=function(){var i=my(Co().mark(function a(){var c,u,p=arguments;return Co().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return c=p.length>0&&p[0]!==void 0?p[0]:0,u=p.length>1?p[1]:void 0,g.abrupt("return",this.readSyncWebGL2(c,u));case 3:case"end":return g.stop()}},a,this)}));function o(){return i.apply(this,arguments)}return o}(),n.readSyncWebGL2=function(){var o,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,c=arguments.length>1?arguments[1]:void 0;this.device.assertWebGL2(),c=(o=c)!==null&&o!==void 0?o:this.byteLength-a;var u=new Uint8Array(c),p=0;return this.gl.bindBuffer(36662,this.handle),this.gl2.getBufferSubData(36662,a,u,p,c),this.gl.bindBuffer(36662,null),this._setDebugData(u,a,c),u},Sy(r)}(te);function Ny(e){return e&te.INDEX?34963:e&te.VERTEX?34962:e&te.UNIFORM?35345:34962}function xy(e){return e&te.INDEX||e&te.VERTEX?35044:e&te.UNIFORM?35048:35044}function bt(e){return bt=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},bt(e)}function Cy(e,t){return My(e)||Dy(e,t)||Fy(e,t)||By()}function By(){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 Fy(e,t){if(e){if(typeof e=="string")return ou(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 ou(e,t)}}function ou(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 Dy(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function My(e){if(Array.isArray(e))return e}function iu(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,jy(n.key),n)}}function Uy(e,t,r){return t&&iu(e.prototype,t),r&&iu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jy(e){var t=Wy(e,"string");return bt(t)==="symbol"?t:String(t)}function Wy(e,t){if(bt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xy(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 Vy(e){var t=Ky();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 ky(this,i)}}function ky(e,t){if(t&&(bt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ly(e)}function Ly(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ky(){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 Ve=function(e){Xy(r,e);var t=Vy(r);function r(i,o){var a;return Hy(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=pn(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,c=Object.entries(o);a<c.length;a++){var u=Cy(c[a],2),p=u[0],b=u[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}}},Uy(r)}(Ur);function Do(){"use strict";Do=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 T(){}function S(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=S.prototype=v.prototype=Object.create(E);function F(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var B=R.arg,x=B.value;return x&&Ce(x)=="object"&&r.call(x,"__await")?f.resolve(x.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(x).then(function(U){B.value=U,m(B)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,B){s(h,m,R,B)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return T.prototype=S,n(w,"constructor",{value:S,configurable:!0}),n(S,"constructor",{value:T,configurable:!0}),T.displayName=u(S,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===T||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,S):(l.__proto__=S,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},F(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},F(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(B,x){return m.type="throw",m.arg=f,s.next=B,x&&(s.method="next",s.arg=void 0),!!x}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function au(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function Yy(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){au(o,n,i,a,c,"next",u)}function c(u){au(o,n,i,a,c,"throw",u)}a(void 0)})}}function fu(e,t){return Zy(e)||$y(e,t)||lu(e,t)||zy()}function zy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $y(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Zy(e){if(Array.isArray(e))return e}function Qy(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=lu(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,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function lu(e,t){if(e){if(typeof e=="string")return uu(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 uu(e,t)}}function uu(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 Ce(e){return Ce=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},Ce(e)}function cu(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 yn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cu(Object(r),!0).forEach(function(n){qy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qy(e,t,r){return t=pu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function su(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,pu(n.key),n)}}function Jy(e,t,r){return t&&su(e.prototype,t),r&&su(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function pu(e){var t=Gy(e,"string");return Ce(t)==="symbol"?t:String(t)}function Gy(e,t){if(Ce(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ce(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function e_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t_(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&&Mo(e,t)}function Mo(e,t){return Mo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Mo(e,t)}function r_(e){var t=o_();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 n_(this,i)}}function n_(e,t){if(t&&(Ce(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return du(e)}function du(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o_(){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)}var i_={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0},se=function(e){t_(r,e);var t=r_(r);function r(i,o){var a,c;return e_(this,r),c=t.call(this,i,yn(yn({},i_),{},{format:"rgba8unorm"},o)),c.MAX_ATTRIBUTES=void 0,c.device=void 0,c.gl=void 0,c.gl2=void 0,c.handle=void 0,c.sampler=void 0,c.glFormat=void 0,c.type=void 0,c.dataFormat=void 0,c.mipmaps=void 0,c.target=void 0,c.textureUnit=void 0,c.loaded=!1,c._video=void 0,c.device=i,c.gl=c.device.gl,c.gl2=c.device.gl2,c.handle=c.props.handle||c.gl.createTexture(),c.device.setSpectorMetadata(c.handle,yn(yn({},c.props),{},{data:Ce(c.props.data)})),c.glFormat=6408,c.target=a_(c.props),c.loaded=!1,typeof((a=c.props)===null||a===void 0?void 0:a.data)=="string"&&Object.assign(c.props,{data:go(c.props.data)}),c.initialize(c.props),Object.seal(du(c)),c}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 c=a.data;if(c instanceof Promise)return c.then(function(f){return o.initialize(Object.assign({},a,{pixels:f,data:f}))}),this;var u=typeof HTMLVideoElement<"u"&&c instanceof HTMLVideoElement;if(u&&c.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,c.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,T=a.pixelStore,S=T===void 0?{}:T,E=a.textureUnit,P=E===void 0?void 0:E;c||(c=v);var O=a.width,w=a.height,F=a.dataFormat,N=a.type,X=a.compressed,M=X===void 0?!1:X,K=a.mipmaps,W=K===void 0?!0:K,V=a.depth,j=V===void 0?0:V,L=cr(a.format,this.device.isWebGL2),l=this._deduceParameters({format:a.format,type:N,dataFormat:F,compressed:M,data:c,width:O,height:w});return O=l.width,w=l.height,M=l.compressed,F=l.dataFormat,N=l.type,this.width=O,this.height=w,this.glFormat=L,this.type=N,this.dataFormat=F,this.textureUnit=P,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),W&&this.device.isWebGL1&&_n(this.width,this.height)&&(D.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaps"))(),W=!1),this.mipmaps=W,this.setImageData({data:c,width:O,height:w,depth:j,format:L,type:N,dataFormat:F,parameters:S,compressed:M}),this.setSampler(a.sampler),this._setSamplerParameters(b),W&&this.generateMipmap(),u&&(this._video={video:c,parameters:b,lastTime:c.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?c.currentTime:-1}),this},n.initializeCube=function(o){var a=this,c=o.mipmaps,u=c===void 0?!0:c,p=o.parameters,b=p===void 0?{}:p;return this.setCubeMapImageData(o).then(function(){a.loaded=!0,u&&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 Ve?(this.sampler=o,a=o.props):(this.sampler=new Ve(this.device,o),a=o);var c=pn(a);return this._setSamplerParameters(c),this},n.resize=function(o){var a=o.height,c=o.width,u=o.mipmaps,p=u===void 0?!1:u;return c!==this.width||a!==this.height?this.initialize({width:c,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,c=o.parameters,u=o.lastTime;if(u===a.currentTime||a.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:a,parameters:c}),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&&_n(this.width,this.height)?(D.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 c=o.target,u=c===void 0?this.target:c,p=o.pixels,b=p===void 0?null:p,g=o.level,v=g===void 0?0:g,T=o.glFormat,S=T===void 0?this.glFormat:T,E=o.offset,P=E===void 0?0:E,O=o.parameters,w=O===void 0?{}:O,F=o.data,N=F===void 0?null:F,X=o.type,M=X===void 0?this.type:X,K=o.width,W=K===void 0?this.width:K,V=o.height,j=V===void 0?this.height:V,L=o.dataFormat,l=L===void 0?this.dataFormat:L,f=o.compressed,s=f===void 0?!1:f;N||(N=b);var d=this._deduceParameters({format:this.props.format,type:M,dataFormat:l,compressed:s,data:N,width:W,height:j});M=d.type,l=d.dataFormat,s=d.compressed,W=d.width,j=d.height;var y=this.gl;y.bindTexture(this.target,this.handle);var h=null,m=this._getDataType({data:N,compressed:s});N=m.data,h=m.dataType;var A;if(ve(this.gl,w,function(){switch(h){case"null":y.texImage2D(u,v,S,W,j,0,l,M,N);break;case"typed-array":y.texImage2D(u,v,S,W,j,0,l,M,N,P);break;case"buffer":A=a.device.assertWebGL2(),A.bindBuffer(35052,N.handle||N),A.texImage2D(u,v,S,W,j,0,l,M,P),A.bindBuffer(35052,null);break;case"browser-object":a.device.isWebGL2?y.texImage2D(u,v,S,W,j,0,l,M,N):y.texImage2D(u,v,S,l,M,N);break;case"compressed":var B=Qy(N.entries()),x;try{for(B.s();!(x=B.n()).done;){var U=fu(x.value,2),jc=U[0],Tr=U[1];y.compressedTexImage2D(u,jc,Tr.format,Tr.width,Tr.height,0,Tr.data)}}catch(Wc){B.e(Wc)}finally{B.f()}break;default:H(!1,"Unknown image data type")}}),N&&N.byteLength)this.trackAllocatedMemory(N.byteLength,"Texture");else{var R=sr(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*R,"Texture")}return this.loaded=!0,this},n.setSubImageData=function(o){var a=this,c=o.target,u=c===void 0?this.target:c,p=o.pixels,b=p===void 0?null:p,g=o.data,v=g===void 0?null:g,T=o.x,S=T===void 0?0:T,E=o.y,P=E===void 0?0:E,O=o.width,w=O===void 0?this.width:O,F=o.height,N=F===void 0?this.height:F,X=o.level,M=X===void 0?0:X,K=o.glFormat,W=K===void 0?this.glFormat:K,V=o.type,j=V===void 0?this.type:V,L=o.dataFormat,l=L===void 0?this.dataFormat:L,f=o.compressed,s=f===void 0?!1:f,d=o.offset,y=d===void 0?0:d,h=o.parameters,m=h===void 0?{}:h,A=this._deduceParameters({format:this.props.format,type:j,dataFormat:l,compressed:s,data:v,width:w,height:N});if(j=A.type,l=A.dataFormat,s=A.compressed,w=A.width,N=A.height,H(this.depth===1,"texSubImage not supported for 3D textures"),v||(v=b),v&&v.data){var R=v;v=R.data,w=R.shape[0],N=R.shape[1]}v instanceof pe&&(v=v.handle),this.gl.bindTexture(this.target,this.handle),ve(this.gl,m,function(){if(s)a.gl.compressedTexSubImage2D(u,M,S,P,w,N,W,v);else if(v===null)a.gl.texSubImage2D(u,M,S,P,w,N,l,j,null);else if(ArrayBuffer.isView(v))a.gl.texSubImage2D(u,M,S,P,w,N,l,j,v,y);else if(typeof WebGLBuffer<"u"&&v instanceof WebGLBuffer){var B=a.device.assertWebGL2();B.bindBuffer(35052,v),B.texSubImage2D(u,M,S,P,w,N,l,j,y),B.bindBuffer(35052,null)}else if(a.device.isWebGL2){var x=a.device.assertWebGL2();x.texSubImage2D(u,M,S,P,w,N,l,j,v)}else a.gl.texSubImage2D(u,M,S,P,l,j,v)}),this.gl.bindTexture(this.target,null)},n.copyFramebuffer=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return D.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,c=o.compressed,u=c===void 0?!1:c;return u?{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,c=o.data,u=o.width,p=o.height,b=o.dataFormat,g=o.type,v=o.compressed,T=_t(a,this.device.isWebGL2);b=b||T.dataFormat,g=g||T.type,v=v||T.compressed;var S=this._deduceImageSize(c,u,p);return u=S.width,p=S.height,{dataFormat:b,type:g,compressed:v,width:u,height:p,format:a,data:c}},n._deduceImageSize=function(o,a,c){var u;return typeof ImageData<"u"&&o instanceof ImageData?u={width:o.width,height:o.height}:typeof HTMLImageElement<"u"&&o instanceof HTMLImageElement?u={width:o.naturalWidth,height:o.naturalHeight}:typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement?u={width:o.width,height:o.height}:typeof ImageBitmap<"u"&&o instanceof ImageBitmap?u={width:o.width,height:o.height}:typeof HTMLVideoElement<"u"&&o instanceof HTMLVideoElement?u={width:o.videoWidth,height:o.videoHeight}:o?u={width:a,height:c}:u={width:a>=0?a:1,height:c>=0?c:1},H(u,"Could not deduced texture size"),H(a===void 0||u.width===a,"Deduced texture width does not match supplied width"),H(c===void 0||u.height===c,"Deduced texture height does not match supplied height"),u},n.setCubeMapImageData=function(){var i=Yy(Do().mark(function a(c){var u=this,p,b,g,v,T,S,E,P,O,w,F;return Do().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return p=this.gl,b=c.width,g=c.height,v=c.pixels,T=c.data,S=c.format,E=S===void 0?6408:S,P=c.type,O=P===void 0?5121:P,w=v||T,X.next=5,Promise.all(r.FACES.map(function(M){var K=w[M];return Promise.all(Array.isArray(K)?K:[K])}));case 5:F=X.sent,this.bind(),r.FACES.forEach(function(M,K){F[K].length>1&&u.props.mipmaps!==!1&&D.warn("".concat(u.id," has mipmap and multiple LODs."))(),F[K].forEach(function(W,V){b&&g?p.texImage2D(M,V,E,b,g,0,E,O,W):p.texImage2D(M,V,E,E,O,W)})}),this.unbind();case 9:case"end":return X.stop()}},a,this)}));function o(a){return i.apply(this,arguments)}return o}(),n.setImageDataForFace=function(o){var a=this,c=o.face,u=o.width,p=o.height,b=o.pixels,g=o.data,v=o.format,T=v===void 0?6408:v,S=o.type,E=S===void 0?5121:S,P=this.gl,O=b||g;return this.bind(),O instanceof Promise?O.then(function(w){return a.setImageDataForFace(Object.assign({},o,{face:c,data:w,pixels:w}))}):this.width||this.height?P.texImage2D(c,0,T,u,p,0,T,E,O):P.texImage2D(c,0,T,T,E,O),this},n.setImageData3D=function(o){var a=this,c=o.level,u=c===void 0?0:c,p=o.dataFormat,b=o.format,g=o.type,v=o.width,T=o.height,S=o.depth,E=S===void 0?1:S,P=o.offset,O=P===void 0?0:P,w=o.data,F=o.parameters,N=F===void 0?{}:F;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);var X=_t(b,this.device.isWebGL2);if(ve(this.gl,N,function(){ArrayBuffer.isView(w)&&a.gl.texImage3D(a.target,u,X.format,v,T,E,0,X.dataFormat,X.type,w),w instanceof pe&&(a.gl.bindBuffer(35052,w.handle),a.gl.texImage3D(a.target,u,p,v,T,E,0,b,g,O))}),w&&w.byteLength)this.trackAllocatedMemory(w.byteLength,"Texture");else{var M=sr(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*this.depth*M,"Texture")}return this.loaded=!0,this},n._setSamplerParameters=function(o){if(this.device.isWebGL1&&_n(this.width,this.height)&&(o=qf(o)),!Qe(o)){f_(o),this.gl.bindTexture(this.target,this.handle);for(var a=0,c=Object.entries(o);a<c.length;a++){var u=fu(c[a],2),p=u[0],b=u[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 c=this.device.isWebGL1&&_n(this.width,this.height);if(c)switch(o){case 10241:if(a!==9729&&a!==9728)return 9729;break;case 10242:case 10243:return 33071;default:break}return a},Jy(r)}(ae);se.FACES=[34069,34070,34071,34072,34073,34074];function a_(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 _n(e,t){return!e||!t?!1:!Ir(e)||!Ir(t)}function f_(e){D.log(1,"texture sampler parameters",e)()}function gn(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 H(n!==void 0,"Accessing undefined constant GL.".concat(t)),n}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 u_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c_(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.
37
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function c_(e,t){if(e){if(typeof e=="string")return hu(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 hu(e,t)}}function hu(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 s_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yu(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,p_(n.key),n)}}function l_(e,t,r){return t&&yu(e.prototype,t),r&&yu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p_(e){var t=d_(e,"string");return vt(t)==="symbol"?t:String(t)}function d_(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 h_(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&&Uo(e,t)}function Uo(e,t){return Uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Uo(e,t)}function y_(e){var t=g_();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 __(this,i)}}function __(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 b_(e)}function b_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g_(){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 gt="Resource subclass must define virtual methods",hr=function(e){h_(r,e);var t=y_(r);function r(i,o,a){var c;s_(this,r),c=t.call(this,i,o,a),c.device=void 0,c.gl=void 0,c.gl2=void 0,c._handle=void 0,c._bound=!1,c.byteLength=0,c.device=le.attach(i);var u=c.device.gl;en(u);var p=o||{},b=p.id;return c.gl=u,c.gl2=u,c.id=b||me(c.constructor.name),c._handle=o?.handle,c._handle===void 0&&(c._handle=c._createHandle()),c.byteLength=0,c}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,c=a===void 0?!1:a,u=this._handle&&this._deleteHandle(this._handle);return this._handle&&this.removeStats(),this._handle=null,u&&c&&u.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=gn(this.gl,o),H(o);var c=this.constructor.PARAMETERS||{},u=c[o];if(u){var p=Y(this.gl),b=(!("webgl2"in u)||p)&&(!("extension"in u)||this.gl.getExtension(u.extension));if(!b){var g=u.webgl1,v="webgl2"in u?u.webgl2:u.webgl1,T=p?v:g;return T}}return this._getParameter(o,a)},n.getParameters=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=o.parameters,c=o.keys,u=this.constructor.PARAMETERS||{},p=Y(this.gl),b={},g=a||Object.keys(u),v=u_(g),T;try{for(v.s();!(T=v.n()).done;){var S=T.value,E=u[S],P=E&&(!("webgl2"in E)||p)&&(!("extension"in E)||this.gl.getExtension(E.extension));if(P){var O=c?this.device.getGLKey(S):S;b[O]=this.getParameter(S,o),c&&E.type==="GLenum"&&(b[O]=this.device.getGLKey(b[O]))}}}catch(w){v.e(w)}finally{v.f()}return b},n.setParameter=function(o,a){o=gn(this.gl,o),H(o);var c=this.constructor.PARAMETERS||{},u=c[o];if(u){var p=Y(this.gl),b=(!("webgl2"in u)||p)&&(!("extension"in u)||this.gl.getExtension(u.extension));if(!b)throw new Error("Parameter not available on this platform");u.type==="GLenum"&&(a=gn(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,c){return po(this,o,a,c)},n.initialize=function(o){},n._createHandle=function(){throw new Error(gt)},n._deleteHandle=function(){throw new Error(gt)},n._bindHandle=function(o){throw new Error(gt)},n._getOptsFromHandle=function(){throw new Error(gt)},n._getParameter=function(o,a){throw new Error(gt)},n._setParameter=function(o,a){throw new Error(gt)},l_(r,[{key:"handle",get:function(){return this._handle}}]),r}($);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 vu;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 bu(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){v_(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 v_(e,t,r){return t=mu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gu(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,mu(n.key),n)}}function T_(e,t,r){return t&&gu(e.prototype,t),r&&gu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mu(e){var t=S_(e,"string");return mt(t)==="symbol"?t:String(t)}function S_(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)}function A_(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 R_(e){var t=w_();return function(){var n=mn(e),i;if(t){var o=mn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return O_(this,i)}}function O_(e,t){if(t&&(mt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return E_(e)}function E_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w_(){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 mn(e){return mn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},mn(e)}vu=Symbol.toStringTag;var Tt=function(e){A_(r,e);var t=R_(r);r.isTextureFormatSupported=function(o,a){return Uf(o.gl,a)};function r(i,o){var a;if(m_(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=cr(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,bu(bu({},o),{},{format:this.format,samples:this.samples})),this._initialize(this.props))},n._initialize=function(o){var a=o.format,c=o.width,u=o.height,p=o.samples;H(a,"Needs format"),this.trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),p!==0&&this.device.isWebGL2?this.gl2.renderbufferStorageMultisample(36161,p,this.glFormat,c,u):this.gl.renderbufferStorage(36161,this.glFormat,c,u),this.gl.bindRenderbuffer(36161,null),this.trackAllocatedMemory(c*u*(p||1)*sr(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)},T_(r,[{key:vu,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}(hr);Tt.defaultProps={id:void 0,handle:void 0,userData:void 0,format:void 0,width:1,height:1,samples:0};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 P_(e,t){return x_(e)||N_(e,t)||Au(e,t)||I_()}function I_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
38
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N_(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function x_(e){if(Array.isArray(e))return e}function C_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Au(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.
39
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Au(e,t){if(e){if(typeof e=="string")return Tu(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 Tu(e,t)}}function Tu(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 B_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Su(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,D_(n.key),n)}}function F_(e,t,r){return t&&Su(e.prototype,t),r&&Su(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function D_(e){var t=M_(e,"string");return St(t)==="symbol"?t:String(t)}function M_(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 Tn(){return typeof Reflect<"u"&&Reflect.get?Tn=Reflect.get.bind():Tn=function(t,r,n){var i=U_(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Tn.apply(this,arguments)}function U_(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=At(e),e!==null););return e}function j_(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&&Wo(e,t)}function Wo(e,t){return Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Wo(e,t)}function W_(e){var t=V_();return function(){var n=At(e),i;if(t){var o=At(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return H_(this,i)}}function H_(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 X_(e)}function X_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V_(){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 At(e){return At=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},At(e)}var we=function(e){j_(r,e);var t=W_(r);function r(i,o){var a;B_(this,r),a=t.call(this,i,o),a.device=void 0,a.gl=void 0,a.handle=void 0;var c=o.handle===null;if(a.device=i,a.gl=i.gl,a.handle=a.props.handle||c?a.props.handle:a.gl.createFramebuffer(),!c){i.setSpectorMetadata(a.handle,{id:a.props.id,props:a.props}),a.autoCreateAttachmentTextures(),a.gl.bindFramebuffer(36160,a.handle);for(var u=0;u<a.colorAttachments.length;++u){var p=a.colorAttachments[u],b=36064+u;p&&a._attachOne(b,p)}a.depthStencilAttachment&&a._attachOne(Hf(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(){Tn(At(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),c=o.checkFramebufferStatus(36160);if(o.bindFramebuffer(36160,a||null),c!==36053)throw new Error("Framebuffer ".concat(L_(c)))},n.createDepthStencilTexture=function(o){return new Tt(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 c=C_(this.colorAttachments),u;try{for(c.s();!(u=c.n()).done;){var p=u.value;p.resize({width:o,height:a})}}catch(b){c.e(b)}finally{c.f()}return this.depthStencilAttachment&&this.depthStencilAttachment.resize({width:o,height:a}),this},n._attachOne=function(o,a){if(a instanceof Tt)return this._attachWEBGLRenderbuffer(o,a),a;if(Array.isArray(a)){var c=P_(a,3),u=c[0],p=c[1],b=p===void 0?0:p,g=c[2],v=g===void 0?0:g;return this._attachTexture(o,u,b,v),u}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,c,u){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,u,c);break;case 34067:var v=k_(c);b.framebufferTexture2D(36160,o,v,a.handle,u);break;case 3553:b.framebufferTexture2D(36160,o,3553,a.handle,u);break;default:H(!1,"Illegal texture type")}b.bindTexture(a.target,null)},F_(r,[{key:"texture",get:function(){return this.colorAttachments[0]}}]),r}(ot);function k_(e){return e<34069?e+34069:e}function L_(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 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)}function Ru(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,Y_(n.key),n)}}function K_(e,t,r){return t&&Ru(e.prototype,t),r&&Ru(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Y_(e){var t=z_(e,"string");return Rt(t)==="symbol"?t:String(t)}function z_(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 $_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z_(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&&Ho(e,t)}function Ho(e,t){return Ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ho(e,t)}function Q_(e){var t=G_();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 q_(this,i)}}function q_(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 J_(e)}function J_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G_(){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 An=function(e){Z_(r,e);var t=Q_(r);function r(i,o){var a;return $_(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 we(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 c=this.device.gl.getExtension("STACKGL_resize_drawingbuffer");c&&o&&"width"in o&&"height"in o&&c.resize(o.width,o.height)},n.commit=function(){},K_(r)}(Ge);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)}function Xo(){"use strict";Xo=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 T(){}function S(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=S.prototype=v.prototype=Object.create(E);function F(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var B=R.arg,x=B.value;return x&&Ot(x)=="object"&&r.call(x,"__await")?f.resolve(x.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(x).then(function(U){B.value=U,m(B)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,B){s(h,m,R,B)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return T.prototype=S,n(w,"constructor",{value:S,configurable:!0}),n(S,"constructor",{value:T,configurable:!0}),T.displayName=u(S,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===T||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,S):(l.__proto__=S,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},F(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},F(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(B,x){return m.type="throw",m.arg=f,s.next=B,x&&(s.method="next",s.arg=void 0),!!x}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function Ou(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 Eu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ou(Object(r),!0).forEach(function(n){eb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ou(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eb(e,t,r){return t=tb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tb(e){var t=rb(e,"string");return Ot(t)==="symbol"?t:String(t)}function rb(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 wu(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function nb(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){wu(o,n,i,a,c,"next",u)}function c(u){wu(o,n,i,a,c,"throw",u)}a(void 0)})}}var ob={spector:D.get("spector")||D.get("inspect")},ib="https://spectorcdn.babylonjs.com/spector.bundle.js",ab=1,de=null,Pu=!1;function Iu(e){return Vo.apply(this,arguments)}function Vo(){return Vo=nb(Xo().mark(function e(t){return Xo().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,Yt(ib);case 4:n.next=9;break;case 6:n.prev=6,n.t0=n.catch(1),D.warn(String(n.t0));case 9:case"end":return n.stop()}},e,null,[[1,6]])})),Vo.apply(this,arguments)}function Nu(e){var t,r;if(e=Eu(Eu({},ob),e),!((t=e)!==null&&t!==void 0&&t.spector)||(!de&&globalThis.SPECTOR&&(D.probe(ab,"SPECTOR found and initialized")(),de=new globalThis.SPECTOR.Spector,globalThis.luma&&(globalThis.luma.spector=de)),!de))return null;if(!Pu){var n,i;Pu=!0,de.spyCanvases(),(n=de)===null||n===void 0||n.onCaptureStarted.add(function(c){return D.info("Spector capture started:",c)()}),(i=de)===null||i===void 0||i.onCapture.add(function(c){var u,p,b;D.info("Spector capture complete:",c)(),(u=de)===null||u===void 0||u.getResultUI(),(p=de)===null||p===void 0||p.resultView.display(),(b=de)===null||b===void 0||b.resultView.addCapture(c)})}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(c){return setTimeout(c,2e3)}).then(function(c){var u;D.info("Spector capture stopped after 2 seconds")(),(u=de)===null||u===void 0||u.stopCapture()})}return de}var ke=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}(ke||{});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 Lo(){"use strict";Lo=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 T(){}function S(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=S.prototype=v.prototype=Object.create(E);function F(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var B=R.arg,x=B.value;return x&&Et(x)=="object"&&r.call(x,"__await")?f.resolve(x.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(x).then(function(U){B.value=U,m(B)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,B){s(h,m,R,B)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return T.prototype=S,n(w,"constructor",{value:S,configurable:!0}),n(S,"constructor",{value:T,configurable:!0}),T.displayName=u(S,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===T||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,S):(l.__proto__=S,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},F(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},F(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(B,x){return m.type="throw",m.arg=f,s.next=B,x&&(s.method="next",s.arg=void 0),!!x}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function fb(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ub(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.
40
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function ub(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 Cu(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,Mu(n.key),n)}}function cb(e,t,r){return t&&Cu(e.prototype,t),r&&Cu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function sb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bu(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 Fu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bu(Object(r),!0).forEach(function(n){lb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lb(e,t,r){return t=Mu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mu(e){var t=pb(e,"string");return Et(t)==="symbol"?t:String(t)}function pb(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 Du(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function db(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){Du(o,n,i,a,c,"next",u)}function c(u){Du(o,n,i,a,c,"throw",u)}a(void 0)})}}var hb="https://unpkg.com/webgl-debug@2.0.1/index.js";function Uu(e){return e.luma=e.luma||{},e.luma}function ju(){return Ko.apply(this,arguments)}function Ko(){return Ko=db(Lo().mark(function e(){return Lo().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(G()&&!globalThis.WebGLDebugUtils)){r.next=5;break}return globalThis.global=globalThis.global||globalThis,globalThis.global.module={},r.next=5,Yt(hb);case 5:case"end":return r.stop()}},e)})),Ko.apply(this,arguments)}function Wu(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e?t.debug?_b(e,t):yb(e):null}function yb(e){var t=Uu(e);return t.realContext?t.realContext:e}function _b(e,t){if(!globalThis.WebGLDebugUtils)return D.warn("webgl-debug not loaded")(),e;var r=Uu(e);if(r.debugContext)return r.debugContext;globalThis.WebGLDebugUtils.init(Fu(Fu({},ke),e));var n=globalThis.WebGLDebugUtils.makeDebugContext(e,bb.bind(null,t),gb.bind(null,t));for(var i in ke)!(i in n)&&typeof ke[i]=="number"&&(n[i]=ke[i]);var o=cb(function c(){sb(this,c)});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 ko(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 bb(e,t,r,n){n=Array.from(n).map(function(u){return u===void 0?"undefined":u});var i=globalThis.WebGLDebugUtils.glEnumToString(t),o=globalThis.WebGLDebugUtils.glFunctionArgsToString(r,n),a=e.webgl2?"gl2":"gl1",c="".concat(i," in ").concat(a,".").concat(r,"(").concat(o,")");D.error(c)();debugger;if(e.throwOnError)throw new Error(c)}function gb(e,t,r){var n="";if(D.level>=1&&(n=ko(t,r),D.log(1,n)()),e.break&&e.break.length>0){n=n||ko(t,r);var i=e.break.every(function(u){return n.indexOf(u)!==-1});if(i)debugger}var o=fb(r),a;try{for(o.s();!(a=o.n()).done;){var c=a.value;if(c===void 0){if(n=n||ko(t,r),e.throwOnError)throw new Error("Undefined argument: ".concat(n));D.error("Undefined argument: ".concat(n))();debugger}}}catch(u){o.e(u)}finally{o.f()}}function vb(e){return ku(e)||mb(e)||Yo(e)||Vu()}function mb(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tb(e,t){return ku(e)||Sb(e,t)||Yo(e,t)||Vu()}function Vu(){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 Sb(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function ku(e){if(Array.isArray(e))return e}function Ab(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Yo(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.
42
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Yo(e,t){if(e){if(typeof e=="string")return Hu(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 Hu(e,t)}}function Hu(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 Lu(e){var t=e.split(/\r?\n/),r=[],n=Ab(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 c=Tb(a,2),u=c[0],p=c[1];r.push({message:p.trim(),type:Xu(u),lineNum:0,linePos:0});continue}var b=vb(a),g=b[0],v=b[1],T=b[2],S=b.slice(3),E=parseInt(T,10);isNaN(E)&&(E=0);var P=parseInt(v,10);isNaN(P)&&(P=0),r.push({message:S.join(":").trim(),type:Xu(g),lineNum:E,linePos:P})}}}catch(O){n.e(O)}finally{n.f()}return r}function Xu(e){var t=["warning","error","info"],r=e.toLowerCase();return t.includes(r)?r:"info"}function Le(e){return Le=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},Le(e)}function zo(){"use strict";zo=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 T(){}function S(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=S.prototype=v.prototype=Object.create(E);function F(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var B=R.arg,x=B.value;return x&&Le(x)=="object"&&r.call(x,"__await")?f.resolve(x.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(x).then(function(U){B.value=U,m(B)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,B){s(h,m,R,B)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return T.prototype=S,n(w,"constructor",{value:S,configurable:!0}),n(S,"constructor",{value:T,configurable:!0}),T.displayName=u(S,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===T||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,S):(l.__proto__=S,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},F(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},F(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(B,x){return m.type="throw",m.arg=f,s.next=B,x&&(s.method="next",s.arg=void 0),!!x}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function Ku(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).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(u){Ku(o,n,i,a,c,"next",u)}function c(u){Ku(o,n,i,a,c,"throw",u)}a(void 0)})}}function Yu(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,Eb(n.key),n)}}function Ob(e,t,r){return t&&Yu(e.prototype,t),r&&Yu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Eb(e){var t=wb(e,"string");return Le(t)==="symbol"?t:String(t)}function wb(e,t){if(Le(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Le(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ib(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 Nb(e){var t=Bb();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 xb(this,i)}}function xb(e,t){if(t&&(Le(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cb(e)}function Cb(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bb(){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 On=function(e){Ib(r,e);var t=Nb(r);function r(i,o){var a;switch(Pb(this,r),a=t.call(this,i,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.getCompilationInfo=function(){var i=Rb(zo().mark(function a(){return zo().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.getCompilationInfoSync());case 1:case"end":return u.stop()}},a,this)}));function o(){return i.apply(this,arguments)}return o}(),n.getCompilationInfoSync=function(){var o=this.device.gl.getShaderInfoLog(this.handle);return Lu(o)},n._compile=function(o){var a=function(p){return p.startsWith("#version ")?p:`#version 100
43
+ `.concat(p)};o=a(o);var c=this.device.gl;if(c.shaderSource(this.handle,o),c.compileShader(this.handle),this.compilationStatus=c.getShaderParameter(this.handle,35713)?"success":"error",this.debugShader(),this.compilationStatus==="error")throw new Error("GLSL compilation errors in ".concat(this.props.stage," shader ").concat(this.props.id))},Ob(r)}(Dr);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 zu(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 Fb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zu(Object(r),!0).forEach(function(n){Db(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Db(e,t,r){return t=Zu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $u(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,Zu(n.key),n)}}function Mb(e,t,r){return t&&$u(e.prototype,t),r&&$u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zu(e){var t=Ub(e,"string");return wt(t)==="symbol"?t:String(t)}function Ub(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 jb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wb(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 Hb(e){var t=kb();return function(){var n=En(e),i;if(t){var o=En(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Xb(this,i)}}function Xb(e,t){if(t&&(wt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vb(e)}function Vb(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}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 En(e){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},En(e)}var Lb=256,Kb=1024,Yb=16384,Zo=6144,wn=function(e){Wb(r,e);var t=Hb(r);function r(i,o){var a;return jb(this,r),a=t.call(this,i,o),a.device=void 0,a.glParameters=void 0,a.device=i,Te(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=Fb({},this.glParameters),c=0;this.props.clearColor!==!1&&(c|=Yb,a.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(c|=Lb,a.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(c|=Kb,a.clearStencil=this.props.clearStencil),c!==0&&ve(this.device,a,function(){o.device.gl.clear(c)})},n.clearColorBuffer=function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0];ve(this.device.gl2,{framebuffer:this.props.framebuffer},function(){switch(c.constructor){case Int32Array:o.device.gl2.clearBufferiv(Zo,a,c);break;case Uint32Array:o.device.gl2.clearBufferuiv(Zo,a,c);break;case Float32Array:default:o.device.gl2.clearBufferfv(Zo,a,c);break}})},Mb(r)}(Vr);var zb="Failed to deduce GL constant from typed array";function Qu(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(zb)}}function yr(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 _r(e){return _r=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},_r(e)}function Pn(e,t,r){return $b()?Pn=Reflect.construct.bind():Pn=function(i,o,a){var c=[null];c.push.apply(c,o);var u=Function.bind.apply(i,c),p=new u;return a&&qo(p,a.prototype),p},Pn.apply(null,arguments)}function $b(){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 qo(e,t){return qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},qo(e,t)}function Zb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,qb(n.key),n)}}function Qb(e,t,r){return t&&qu(e.prototype,t),r&&qu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function qb(e){var t=Jb(e,"string");return _r(t)==="symbol"?t:String(t)}function Jb(e,t){if(_r(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_r(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gb={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},eg={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},In=function(){e.getBytesPerElement=function(n){var i=yr(n.type||5126);return i.BYTES_PER_ELEMENT},e.getBytesPerVertex=function(n){H(n.size);var i=yr(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 Pn(e,[Gb].concat(i))};function e(){var r=this;Zb(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=ho("Accessor",n,eg),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},Qb(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 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 Gu(e,t){return og(e)||ng(e,t)||rg(e,t)||tg()}function tg(){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 rg(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 ng(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function og(e){if(Array.isArray(e))return e}function ee(e,t,r){return t=ig(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ig(e){var t=ag(e,"string");return br(t)==="symbol"?t:String(t)}function ag(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 ec(e){return fg.includes(e)}var fg=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],tc=(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 Jo(e){var t=tc[e];if(!t)throw new Error("uniform");var r=Gu(t,4),n=r[0],i=r[1],o=r[3];return{format:o,components:i,glType:n}}function rc(e){var t=tc[e];if(!t)throw new Error("attribute");var r=Gu(t,5),n=r[1],i=r[3],o=r[4],a=i;return{attributeType:a,vertexFormat:o,components:n}}var ie;function gr(e){return gr=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},gr(e)}function ug(e,t){return pg(e)||lg(e,t)||sg(e,t)||cg()}function cg(){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 sg(e,t){if(e){if(typeof e=="string")return nc(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 nc(e,t)}}function nc(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 lg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function pg(e){if(Array.isArray(e))return e}function oc(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 ic(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oc(Object(r),!0).forEach(function(n){ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ue(e,t,r){return t=dg(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dg(e){var t=hg(e,"string");return gr(t)==="symbol"?t:String(t)}function hg(e,t){if(gr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nn(e,t){var r={attributes:[],bindings:[]};r.attributes=yg(e,t);for(var n=gg(e,t),i=0,o=n;i<o.length;i++){var a=o[i],c=a.uniforms.map(function(O){return{name:O.name,format:O.format,byteOffset:O.byteOffset,byteStride:O.byteStride,arrayLength:O.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:c})}for(var u=bg(e,t),p=0,b=0,g=u;b<g.length;b++){var v=g[b];if(ec(v.type)){var T=mg(v.type),S=T.viewDimension,E=T.sampleType;r.bindings.push({type:"texture",name:v.name,location:p,viewDimension:S,sampleType:E}),v.textureUnit=p,p+=1}}u.length&&(r.uniforms=u);var P=_g(e,t);return P!=null&&P.length&&(r.varyings=P),r}function yg(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,c=o.type,u=e.getAttribLocation(t,a);if(u>=0){var p=rc(c),b=p.attributeType,g=/instance/i.test(a)?"instance":"vertex";r.push({name:a,location:u,stepMode:g,type:b})}}return r.sort(function(v,T){return v.location-T.location}),r}function _g(e,t){if(!Y(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 c=a.name,u=a.type,p=a.size,b=Jo(u),g=b.glType,v=b.components,T=new In({type:g,size:p*v}),S={location:o,name:c,accessor:T};n.push(S)}return n.sort(function(E,P){return E.location-P.location}),n}function bg(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,c=o.size,u=o.type,p=Tg(a),b=p.name,g=p.isArray,v=e.getUniformLocation(t,b),T={location:v,name:b,size:c,type:u,isArray:g};if(r.push(T),T.size>1)for(var S=0;S<T.size;S++){var E="".concat(b,"[").concat(S,"]");v=e.getUniformLocation(t,E);var P=ic(ic({},T),{},{name:E,location:v});r.push(P)}}return r}function gg(e,t){if(!Y(e))return[];for(var r=e,n=function(P,O){return r.getActiveUniformBlockParameter(t,P,O)},i=[],o=r.getProgramParameter(t,35382),a=0;a<o;a++){for(var c={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:[]},u=n(a,35395)||[],p=r.getActiveUniforms(t,u,35383),b=r.getActiveUniforms(t,u,35384),g=r.getActiveUniforms(t,u,35387),v=r.getActiveUniforms(t,u,35388),T=0;T<c.uniformCount;++T){var S=r.getActiveUniform(t,u[T]);if(!S)throw new Error("activeInfo");c.uniforms.push({name:S.name,format:Jo(p[T]).format,type:p[T],arrayLength:b[T],byteOffset:g[T],byteStride:v[T]})}i.push(c)}return i.sort(function(E,P){return E.location-P.location}),i}var vg=(ie={},ue(ie,35678,["2d","float"]),ue(ie,35680,["cube","float"]),ue(ie,35679,["3d","float"]),ue(ie,35682,["3d","depth"]),ue(ie,36289,["2d-array","float"]),ue(ie,36292,["2d-array","depth"]),ue(ie,36293,["cube","float"]),ue(ie,36298,["2d","sint"]),ue(ie,36299,["3d","sint"]),ue(ie,36300,["cube","sint"]),ue(ie,36303,["2d-array","uint"]),ue(ie,36306,["2d","uint"]),ue(ie,36307,["3d","uint"]),ue(ie,36308,["cube","uint"]),ue(ie,36311,["2d-array","uint"]),ie);function mg(e){var t=vg[e];if(!t)throw new Error("sampler");var r=ug(t,2),n=r[0],i=r[1];return{viewDimension:n,sampleType:i}}function Tg(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 ac(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 fc(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 uc(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 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 cc(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=hc(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,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function sc(e,t){return Rg(e)||Ag(e,t)||hc(e,t)||Sg()}function Sg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
47
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hc(e,t){if(e){if(typeof e=="string")return lc(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 lc(e,t)}}function lc(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 Ag(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Rg(e){if(Array.isArray(e))return e}function pc(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,Eg(n.key),n)}}function Og(e,t,r){return t&&pc(e.prototype,t),r&&pc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Eg(e){var t=wg(e,"string");return Pt(t)==="symbol"?t:String(t)}function wg(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 Pg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ig(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 Ng(e){var t=Bg();return function(){var n=xn(e),i;if(t){var o=xn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return xg(this,i)}}function xg(e,t){if(t&&(Pt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cg(e)}function Cg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bg(){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 xn(e){return xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xn(e)}var dc=4,Cn=function(e){Ig(r,e);var t=Ng(r);function r(i,o){var a;Pg(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 c=o.varyings,u=o.bufferMode,p=u===void 0?35981:u;if(c&&c.length>0){var b;a.device.assertWebGL2(),a.varyings=c,(b=a.device.gl2)===null||b===void 0||b.transformFeedbackVaryings(a.handle,c,p)}return a._compileAndLink(),a.introspectedLayout=Nn(a.device.gl,a.handle),a.shaderLayout=ao(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,c=function(){var v=sc(p[u],2),T=v[0],S=v[1],E=a.shaderLayout.bindings.find(function(O){return O.name===T})||a.shaderLayout.bindings.find(function(O){return O.name==="".concat(T,"Uniforms")});if(!E){var P=a.shaderLayout.bindings.map(function(O){return'"'.concat(O.name,'"')}).join(", ");return D.warn('Unknown binding "'.concat(T,'" in render pipeline "').concat(a.id,'", expected one of ').concat(P))(),"continue"}switch(S||D.warn('Unsetting binding "'.concat(T,'" in render pipeline "').concat(a.id,'"'))(),E.type){case"uniform":if(!(S instanceof pe)&&!(S.buffer instanceof pe))throw new Error("buffer value");break;case"texture":if(!(S instanceof se||S instanceof we))throw new Error("texture value");break;case"sampler":D.warn("Ignoring sampler ".concat(T))();break;default:throw new Error(E.type)}a.bindings[T]=S},u=0,p=Object.entries(o);u<p.length;u++)var b=c()},n.setUniforms=function(o){var a=lo(o),c=a.bindings;Object.keys(c).forEach(function(u){D.warn('Unsupported value "'.concat(JSON.stringify(c[u]),'" used in setUniforms() for key ').concat(u,". Use setBindings() instead?"))()}),Object.assign(this.uniforms,o)},n.draw=function(o){var a,c=this,u=o.renderPass,p=o.vertexArray,b=o.vertexCount,g=o.instanceCount,v=o.firstVertex,T=v===void 0?0:v,S=o.transformFeedback,E=fc(this.props.topology),P=Boolean(p.indexBuffer),O=(a=p.indexBuffer)===null||a===void 0?void 0:a.glIndexType,w=Number(g)>0;if(!this._areTexturesRenderable()||b===0)return!1;this.device.gl.useProgram(this.handle),p.bindBeforeRender(u),S&&S.begin(this.props.topology),this._applyBindings(),this._applyUniforms();var F=u;return $f(this.device,this.props.parameters,F.glParameters,function(){if(P&&w){var N;(N=c.device.gl2)===null||N===void 0||N.drawElementsInstanced(E,b||0,O,T,g||0)}else if(P)c.device.gl.drawElements(E,b||0,O,T);else if(w){var X;(X=c.device.gl2)===null||X===void 0||X.drawArraysInstanced(E,T,b||0,g||0)}else c.device.gl.drawArrays(E,T,b||0);S&&S.end()}),p.unbindAfterRender(u),!0},n._compileAndLink=function(){var o=this.device.gl;o.attachShader(this.handle,this.vs.handle),o.attachShader(this.handle,this.fs.handle),D.time(dc,"linkProgram for ".concat(this.id))(),o.linkProgram(this.handle),D.timeEnd(dc,"linkProgram for ".concat(this.id))(),!o.debug&&D.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 c=o.getProgramParameter(this.handle,35715);if(!c)throw new Error("Error validating: ".concat(o.getProgramInfoLog(this.handle)))},n._areTexturesRenderable=function(){for(var o=!0,a=0,c=Object.entries(this.bindings);a<c.length;a++){var u=sc(c[a],2),p=u[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,c=0,u=cc(this.shaderLayout.bindings),p;try{for(u.s();!(p=u.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,T=o.getUniformBlockIndex(this.handle,v);if(T===4294967295)throw new Error("Invalid uniform block name ".concat(v));o.uniformBlockBinding(this.handle,c,T),g instanceof pe?o.bindBufferBase(35345,c,g.handle):o.bindBufferRange(35345,c,g.buffer.handle,g.offset||0,g.size||g.buffer.byteLength-g.offset),c+=1;break;case"texture":if(!(g instanceof se||g instanceof we))throw new Error("texture");var S=void 0;if(g instanceof se)S=g;else if(g instanceof we&&g.colorAttachments[0]instanceof se)D.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),S=g.colorAttachments[0];else throw new Error("No texture");o.activeTexture(33984+a),o.bindTexture(S.target,S.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(E){u.e(E)}finally{u.f()}},n._applyUniforms=function(){var o=cc(this.shaderLayout.uniforms||[]),a;try{for(o.s();!(a=o.n()).done;){var c,u=a.value,p=u.name,b=u.location,g=u.type,v=u.textureUnit,T=(c=this.uniforms[p])!==null&&c!==void 0?c:v;T!==void 0&&ac(this.device.gl,b,g,T)}}catch(S){o.e(S)}finally{o.f()}},Og(r)}(Hr);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 Fg(e,t){return Ug(e)||Mg(e,t)||bc(e,t)||Dg()}function Dg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
48
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,c=[],u=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(b){p=!0,i=b}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return c}}function Ug(e){if(Array.isArray(e))return e}function jg(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=bc(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.
49
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function bc(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 _c(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,Hg(n.key),n)}}function Wg(e,t,r){return t&&_c(e.prototype,t),r&&_c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hg(e){var t=Xg(e,"string");return It(t)==="symbol"?t:String(t)}function Xg(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 Vg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kg(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 Lg(e){var t=zg();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 Kg(this,i)}}function Kg(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 Yg(e)}function Yg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zg(){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)}var gc=function(e){kg(r,e);var t=Lg(r);function r(i){var o;return Vg(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=jg(o),c;try{for(a.s();!(c=a.n()).done;){var u=c.value;switch(u.name){case"copy-buffer-to-buffer":$g(this.device,u.options);break;case"copy-buffer-to-texture":Zg(this.device,u.options);break;case"copy-texture-to-buffer":Qg(this.device,u.options);break;case"copy-texture-to-texture":qg(this.device,u.options);break}}}catch(p){a.e(p)}finally{a.f()}},Wg(r)}(Yr);function $g(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 Zg(e,t){throw new Error("Not implemented")}function Qg(e,t){var r=t.source,n=t.mipLevel,i=n===void 0?0:n,o=t.aspect,a=o===void 0?"all":o,c=t.width,u=c===void 0?t.source.width:c,p=t.height,b=p===void 0?t.source.height:p,g=t.depthOrArrayLayers,v=g===void 0?0:g,T=t.origin,S=T===void 0?[0,0]:T,E=t.destination,P=t.byteOffset,O=P===void 0?0:P,w=t.bytesPerRow,F=t.rowsPerImage;if(a!=="all")throw new Error("not supported");if(i!==0||v!==0||w||F)throw new Error("not implemented");var N=e.assertWebGL2(),X=vc(r),M=X.framebuffer,K=X.destroyFramebuffer;try{var W=E,V=u||M.width,j=b||M.height,L=_t(M.texture.format,!0),l=L.dataFormat,f=L.type;N.bindBuffer(35051,W.handle),N.bindFramebuffer(36160,M.handle),N.readPixels(S[0],S[1],V,j,l,f,O)}finally{N.bindBuffer(35051,null),N.bindFramebuffer(36160,null),K&&M.destroy()}}function qg(e,t){var r=t.source,n=t.origin,i=n===void 0?[0,0]:n,o=t.destination,a=t.width,c=a===void 0?t.destination.width:a,u=t.height,p=u===void 0?t.destination.width:u,b=0,g=6408,v=vc(r),T=v.framebuffer,S=v.destroyFramebuffer,E=Fg(i,2),P=E[0],O=E[1],w=!1;e.gl.bindFramebuffer(36160,T.handle);var F=null,N;if(o instanceof se)F=o,c=Number.isFinite(c)?c:F.width,p=Number.isFinite(p)?p:F.height,F.bind(0),N=F.destination;else throw new Error("whoops");return w||e.gl.copyTexImage2D(N,b,g,P,O,c,p,0),F&&F.unbind(),S&&T.destroy(),F}function vc(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 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 mc(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,Gg(n.key),n)}}function Jg(e,t,r){return t&&mc(e.prototype,t),r&&mc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gg(e){var t=ev(e,"string");return Nt(t)==="symbol"?t:String(t)}function ev(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)}function tv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rv(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 nv(e){var t=av();return function(){var n=Fn(e),i;if(t){var o=Fn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ov(this,i)}}function ov(e,t){if(t&&(Nt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iv(e)}function iv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function av(){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 Fn(e){return Fn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fn(e)}var Dn=function(e){rv(r,e);var t=nv(r);function r(i,o){var a;return tv(this,r),a=t.call(this,i,o),a.device=void 0,a.commandBuffer=void 0,a.device=i,a.commandBuffer=new gc(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){},Jg(r)}(Lr);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)}var Sc;function fv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tc(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,cv(n.key),n)}}function uv(e,t,r){return t&&Tc(e.prototype,t),r&&Tc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function cv(e){var t=sv(e,"string");return xt(t)==="symbol"?t:String(t)}function sv(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 Mn(){return typeof Reflect<"u"&&Reflect.get?Mn=Reflect.get.bind():Mn=function(t,r,n){var i=lv(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Mn.apply(this,arguments)}function lv(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ct(e),e!==null););return e}function pv(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&&ri(e,t)}function ri(e,t){return ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ri(e,t)}function dv(e){var t=_v();return function(){var n=Ct(e),i;if(t){var o=Ct(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return hv(this,i)}}function hv(e,t){if(t&&(xt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yv(e)}function yv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _v(){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 Ct(e){return Ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ct(e)}Sc=Symbol.toStringTag;var Un=function(e){pv(r,e);var t=dv(r);r.isConstantAttributeZeroSupported=function(o){return o.info.type==="webgl2"||Rr()==="Chrome"};function r(i,o){var a;return fv(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(Mn(Ct(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 c=a;if(c.glTarget===34963)throw new Error("Use .setIndexBuffer()");var u=this._getAccessor(o),p=u.size,b=u.type,g=u.stride,v=u.offset,T=u.normalized,S=u.integer,E=u.divisor;this.device.gl2.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,c.handle),S?(this.device.assertWebGL2(),this.device.gl2.vertexAttribIPointer(o,p,b,g,v)):this.device.gl.vertexAttribPointer(o,p,b,T,g,v),this.device.gl.enableVertexAttribArray(o),this.device.gl2.vertexAttribDivisor(o,E||0),this.attributes[o]=c},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 c=an(a.bufferDataType);return{size:a.bufferComponents,type:c,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,c=r.isConstantAttributeZeroSupported(this.device),u=c||o!==0;(a||u)&&(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 c=bv(a),u=c.byteLength*o,p=c.length*o;if(this.buffer&&u!==this.buffer.byteLength)throw new Error("Buffer size is immutable, byte length ".concat(u," !== ").concat(this.buffer.byteLength,"."));var b=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:u}),b=b||!gv(c,this.bufferValue),b){var g=co(a.constructor,p);so({target:g,source:c,start:0,count:p}),this.buffer.write(g),this.bufferValue=a}return this.buffer},uv(r,[{key:Sc,get:function(){return"VertexArray"}}]),r}(Zr);function bv(e){return Array.isArray(e)?new Float32Array(e):e}function gv(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 Bt(e){return Bt=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},Bt(e)}function vv(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=mv(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.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,c=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function mv(e,t){if(e){if(typeof e=="string")return Ac(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 Ac(e,t)}}function Ac(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 Rc(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,Sv(n.key),n)}}function Tv(e,t,r){return t&&Rc(e.prototype,t),r&&Rc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sv(e){var t=Av(e,"string");return Bt(t)==="symbol"?t:String(t)}function Av(e,t){if(Bt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Bt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jn(){return typeof Reflect<"u"&&Reflect.get?jn=Reflect.get.bind():jn=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}},jn.apply(this,arguments)}function Ov(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ft(e),e!==null););return e}function Ev(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 wv(e){var t=Iv();return function(){var n=Ft(e),i;if(t){var o=Ft(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Pv(this,i)}}function Pv(e,t){if(t&&(Bt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ec(e)}function Ec(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Iv(){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 Ft(e){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ft(e)}var Wn=function(e){Ev(r,e);var t=wv(r);function r(i,o){var a;return Rv(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(Ec(a)),a}var n=r.prototype;return n.destroy=function(){this.gl2.deleteTransformFeedback(this.handle),jn(Ft(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(uc(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 c in o)a.setBuffer(c,o[c])})},n.setBuffer=function(o,a){var c=this._getVaryingIndex(o),u=this._getBufferRange(a),p=u.buffer,b=u.byteLength,g=u.byteOffset;if(c<0){this.unusedBuffers[o]=p,D.warn("".concat(this.id," unusedBuffers varying buffer ").concat(o))();return}this.buffers[c]={buffer:p,byteLength:b,byteOffset:g},this.bindOnUse||this._bindBuffer(c,p,g,b)},n.getBuffer=function(o){if(Oc(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,c=o.byteOffset,u=c===void 0?0:c,p=o.byteLength,b=p===void 0?o.buffer.byteLength:p;return{buffer:a,byteOffset:u,byteLength:b}},n._getVaryingIndex=function(o){if(Oc(o))return Number(o);var a=vv(this.layout.varyings),c;try{for(a.s();!(c=a.n()).done;){var u=c.value;if(o===u.name)return u.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]),c=a.buffer,u=a.byteLength,p=a.byteOffset;this._bindBuffer(Number(o),c,p,u)}},n._unbindBuffers=function(){for(var o in this.buffers)this.gl2.bindBufferBase(35982,Number(o),null)},n._bindBuffer=function(o,a){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,u=arguments.length>3?arguments[3]:void 0,p=a&&a.handle;!p||u===void 0?this.gl2.bindBufferBase(35982,o,p):this.gl2.bindBufferRange(35982,o,p,c,u)},Tv(r)}(qr);function Oc(e){return typeof e=="number"?Number.isInteger(e):/^\d+$/.test(e)}function Ke(e){return Ke=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},Ke(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 Pe(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){Nv(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 Nv(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 oi(){"use strict";oi=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",c=i.toStringTag||"@@toStringTag";function u(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{u({},"")}catch{u=function(s,d,y){return s[d]=y}}function p(l,f,s,d){var y=f&&f.prototype instanceof v?f:v,h=Object.create(y.prototype),m=new V(d||[]);return n(h,"_invoke",{value:X(l,s,m)}),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 T(){}function S(){}var E={};u(E,o,function(){return this});var P=Object.getPrototypeOf,O=P&&P(P(j([])));O&&O!==t&&r.call(O,o)&&(E=O);var w=S.prototype=v.prototype=Object.create(E);function F(l){["next","throw","return"].forEach(function(f){u(l,f,function(s){return this._invoke(f,s)})})}function N(l,f){function s(y,h,m,A){var R=b(l[y],l,h);if(R.type!=="throw"){var B=R.arg,x=B.value;return x&&Ke(x)=="object"&&r.call(x,"__await")?f.resolve(x.__await).then(function(U){s("next",U,m,A)},function(U){s("throw",U,m,A)}):f.resolve(x).then(function(U){B.value=U,m(B)},function(U){return s("throw",U,m,A)})}A(R.arg)}var d;n(this,"_invoke",{value:function(h,m){function A(){return new f(function(R,B){s(h,m,R,B)})}return d=d?d.then(A,A):A()}})}function X(l,f,s){var d="suspendedStart";return function(y,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(y==="throw")throw h;return L()}for(s.method=y,s.arg=h;;){var m=s.delegate;if(m){var A=M(m,s);if(A){if(A===g)continue;return A}}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 R=b(l,f,s);if(R.type==="normal"){if(d=s.done?"completed":"suspendedYield",R.arg===g)continue;return{value:R.arg,done:s.done}}R.type==="throw"&&(d="completed",s.method="throw",s.arg=R.arg)}}}function M(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,M(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var y=b(d,l.iterator,f.arg);if(y.type==="throw")return f.method="throw",f.arg=y.arg,f.delegate=null,g;var h=y.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 K(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 W(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function j(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 y(){for(;++s<l.length;)if(r.call(l,s))return y.value=l[s],y.done=!1,y;return y.value=void 0,y.done=!0,y};return d.next=d}}return{next:L}}function L(){return{value:void 0,done:!0}}return T.prototype=S,n(w,"constructor",{value:S,configurable:!0}),n(S,"constructor",{value:T,configurable:!0}),T.displayName=u(S,c,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===T||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,S):(l.__proto__=S,u(l,c,"GeneratorFunction")),l.prototype=Object.create(w),l},e.awrap=function(l){return{__await:l}},F(N.prototype),u(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(l,f,s,d,y){y===void 0&&(y=Promise);var h=new N(p(l,f,s,d),y);return e.isGeneratorFunction(f)?h:h.next().then(function(m){return m.done?m.value:h.next()})},F(w),u(w,c,"Generator"),u(w,o,function(){return this}),u(w,"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 y(){for(;s.length;){var h=s.pop();if(h in f)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=j,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(W),!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(B,x){return m.type="throw",m.arg=f,s.next=B,x&&(s.method="next",s.arg=void 0),!!x}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],m=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var A=r.call(h,"catchLoc"),R=r.call(h,"finallyLoc");if(A&&R){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(A){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!R)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 y=this.tryEntries[d];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var m=h?h.completion:{};return m.type=f,m.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(m)},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),W(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 y=d.completion;if(y.type==="throw"){var h=y.arg;W(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:j(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function Pc(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(p){r(p);return}c.done?t(u):Promise.resolve(u).then(n,i)}function xv(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(u){Pc(o,n,i,a,c,"next",u)}function c(u){Pc(o,n,i,a,c,"throw",u)}a(void 0)})}}function Cv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,Nc(n.key),n)}}function Bv(e,t,r){return t&&Ic(e.prototype,t),r&&Ic(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nc(e){var t=Fv(e,"string");return Ke(t)==="symbol"?t:String(t)}function Fv(e,t){if(Ke(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ke(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dv(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&&ii(e,t)}function ii(e,t){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ii(e,t)}function Mv(e){var t=jv();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 Uv(this,i)}}function Uv(e,t){if(t&&(Ke(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ai(e)}function ai(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jv(){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 vr=1,le=function(e){Dv(r,e);var t=Mv(r);r.isSupported=function(){return typeof WebGLRenderingContext<"u"||pi()},r.attach=function(o){if(o instanceof r)return o;if(o?.device instanceof Je)return o.device;if(!Wv(o))throw new Error("Invalid WebGLRenderingContext");return new r({gl:o})},r.create=function(){var i=xv(oi().mark(function a(){var c,u,p,b,g=arguments;return oi().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(c=g.length>0&&g[0]!==void 0?g[0]:{},D.groupCollapsed(vr,"WebGLDevice created")(),typeof c.canvas!="string"){T.next=5;break}return T.next=5,Ge.pageLoaded;case 5:if(!(D.get("debug")||c.debug)){T.next=8;break}return T.next=8,ju();case 8:if(u=c.spector,!(D.get("spector")||u)){T.next=12;break}return T.next=12,Iu();case 12:if(D.probe(vr+1,"DOM is loaded")(),!(c.gl&&c.gl.device)){T.next=15;break}return T.abrupt("return",r.attach(c.gl));case 15:return p=new r(c),b="Created ".concat(p.info.type).concat(p.debug?" debug":""," context: ").concat(p.info.vendor,", ").concat(p.info.renderer," for canvas: ").concat(p.canvasContext.id),D.probe(vr,b)(),D.table(vr,p.info)(),D.groupEnd(vr)(),T.abrupt("return",p);case 21:case"end":return T.stop()}},a)}));function o(){return i.apply(this,arguments)}return o}();function r(i){var o,a;Cv(this,r),a=t.call(this,Pe(Pe({},i),{},{id:i.id||me("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 c=(o=i.gl)===null||o===void 0?void 0:o.device;if(c)throw new Error("WebGL context already attached to device ".concat(c.id));a.canvasContext=new An(ai(a),i),a.lost=new Promise(function(E){a._resolveContextLost=E});var u=function(P){var O,w;return(O=(w=a)._resolveContextLost)===null||O===void 0?void 0:O.call(w,{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||(G()?Nf(a.canvasContext.canvas,Pe(Pe({},i),{},{onContextLost:u})):null),p=p||(G()?null:di(Pe(Pe({},i),{},{onContextLost:u}))),!p)throw new Error("WebGL context creation failed");a.handle=p,a.gl=a.handle,a.gl2=a.gl,a.isWebGL2=Hv(a.gl),a.isWebGL1=!a.isWebGL2,a.info=xf(a.gl),a.gl.device=ai(a),a.gl._version=a.isWebGL2?2:1,nn(a.gl);var b=i.enable,g=b===void 0?!0:b,v=i.copyState,T=v===void 0?!1:v;if(rr(a.gl,{enable:g,copyState:T,log:function(){for(var P=arguments.length,O=new Array(P),w=0;w<P;w++)O[w]=arguments[w];return D.log.apply(D,[1].concat(O))()}}),G()&&i.debug&&(a.gl=Wu(a.gl,Pe(Pe({},i),{},{webgl2:a.isWebGL2,throwOnError:!0})),a.gl2=a.gl,a.debug=!0,D.level=Math.max(D.level,1),D.warn("WebGL debug mode activated. Performance reduced.")()),G()&&i.spector){var S=a.handle.canvas||i.canvas;a.spector=Nu(Pe(Pe({},a.props),{},{canvas:S}))}return 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 ur(this.gl,o)},n.isTextureFormatFilterable=function(o){return jf(this.gl,o)},n.isTextureFormatRenderable=function(o){return Wf(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 Ve(this,o)},n.createShader=function(o){return new On(this,o)},n.createFramebuffer=function(o){return new we(this,o)},n.createRenderPipeline=function(o){return new Cn(this,o)},n.createVertexArray=function(o){return new Un(this,o)},n.beginRenderPass=function(o){return new wn(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 Wn(this,o)},n.getDefaultRenderPass=function(){return this.renderPass=this.renderPass||this.beginRenderPass({framebuffer:this.canvasContext.getCurrentFramebuffer()}),this.renderPass},n.createCommandEncoder=function(o){return new Dn(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,c=this.gl.getExtension("WEBGL_lose_context");return c&&(a=!0,c.loseContext()),(o=this._resolveContextLost)===null||o===void 0||o.call(this,{reason:"destroyed",message:"Application triggered context loss"}),a},n.pushState=function(){Te(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 c=Number(o);for(var u in a)if(a[u]===c)return"GL.".concat(u);return String(o)},n.setConstantAttribute=function(o,a){this._constants=this._constants||new Array(this.limits.maxVertexAttributes).fill(null);var c=this._constants[o];switch(c&&Lv(c,a)&&D.info(1,"setConstantAttribute(".concat(o,") could have been skipped, value unchanged"))(),this._constants[o]=a,a.constructor){case Float32Array:Xv(this,o,a);break;case Int32Array:Vv(this,o,a);break;case Uint32Array:kv(this,o,a);break;default:H(!1)}},Bv(r,[{key:"features",get:function(){return this._features=this._features||kf(this.gl),this._features}},{key:"limits",get:function(){return this._limits=this._limits||Kf(this.gl),this._limits}},{key:"isLost",get:function(){return this.gl.isContextLost()}},{key:"webglLimits",get:function(){return this._webglLimits=this._webglLimits||Yf(this.gl),this._webglLimits}}]),r}(Je);le.type="webgl";function Wv(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function Hv(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function Xv(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:H(!1)}}function Vv(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4iv(t,r)}function kv(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4uiv(t,r)}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}var Kv=256,Yv=1024,zv=16384;var $v="clear: bad arguments";function xc(e,t){var r=le.attach(e),n=t||{},i=n.framebuffer,o=i===void 0?null:i,a=n.color,c=a===void 0?null:a,u=n.depth,p=u===void 0?null:u,b=n.stencil,g=b===void 0?null:b,v={};o&&(v.framebuffer=o);var T=0;c&&(T|=zv,c!==!0&&(v.clearColor=c)),p&&(T|=Kv,p!==!0&&(v.clearDepth=p)),g&&(T|=Yv,p!==!0&&(v.clearStencil=p)),H(T!==0,$v),ve(r.gl,v,function(){r.gl.clear(T)})}function fi(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 H(!1),0}}function Cc(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return H(!1),0}}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 Bc(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 Fc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bc(Object(r),!0).forEach(function(n){Zv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zv(e,t,r){return t=Qv(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qv(e){var t=qv(e,"string");return mr(t)==="symbol"?t:String(t)}function qv(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 Dc(e,t){var r,n=t||{},i=n.sourceX,o=i===void 0?0:i,a=n.sourceY,c=a===void 0?0:a,u=n.sourceFormat,p=u===void 0?6408:u,b=n.sourceAttachment,g=b===void 0?36064:b,v=t||{},T=v.target,S=T===void 0?null:T,E=v.sourceWidth,P=v.sourceHeight,O=v.sourceType,w=ui(e),F=w.framebuffer,N=w.deleteFramebuffer;H(F);var X=F,M=X.gl,K=X.handle;E=E||F.width,P=P||F.height;var W=g-36064;O=O||((r=F.colorAttachments[W])===null||r===void 0?void 0:r.type)||5121,S=Gv(S,O,p,E,P),O=O||Qu(S);var V=M.bindFramebuffer(36160,K);return M.readPixels(o,c,E,P,p,O,S),M.bindFramebuffer(36160,V||null),N&&F.destroy(),S}function Mc(e,t){var r=t||{},n=r.sourceX,i=n===void 0?0:n,o=r.sourceY,a=o===void 0?0:o,c=r.sourceFormat,u=c===void 0?6408:c,p=r.targetByteOffset,b=p===void 0?0:p,g=t||{},v=g.target,T=g.sourceWidth,S=g.sourceHeight,E=g.sourceType,P=ui(e),O=P.framebuffer,w=P.deleteFramebuffer;H(O),T=T||O.width,S=S||O.height;var F=O;if(E=E||5121,!v){var N=fi(u),X=Cc(E),M=b+T*S*N*X;v=F.device.createBuffer({byteLength:M})}var K=e.device.createCommandEncoder();return K.copyTextureToBuffer({source:e,width:T,height:S,origin:[i,a],destination:v,byteOffset:b}),K.destroy(),w&&O.destroy(),v}function Uc(e,t,r){var n=r||{},i=n.sourceX,o=i===void 0?0:i,a=n.sourceY,c=a===void 0?0:a,u=n.targetMipmaplevel,p=u===void 0?0:u,b=n.targetInternalFormat,g=b===void 0?6408:b,v=r||{},T=v.targetX,S=v.targetY,E=v.targetZ,P=v.width,O=v.height,w=ui(e),F=w.framebuffer,N=w.deleteFramebuffer;H(F);var X=F,M=X.device,K=X.handle,W=typeof T<"u"||typeof S<"u"||typeof E<"u";T=T||0,S=S||0,E=E||0;var V=M.gl.bindFramebuffer(36160,K);H(t);var j=null,L;if(t instanceof ae?(j=t,P=Number.isFinite(P)?P:j.width,O=Number.isFinite(O)?O:j.height,j.bind(0),L=j.target):L=t,!W)M.gl.copyTexImage2D(L,p,g,o,c,P,O,0);else switch(L){case 3553:case 34067:M.gl.copyTexSubImage2D(L,p,T,S,o,c,P,O);break;case 35866:case 32879:M.assertWebGL2(),M.gl2.copyTexSubImage3D(L,p,T,S,E,o,c,P,O);break;default:}return j&&j.unbind(),M.gl.bindFramebuffer(36160,V||null),N&&F.destroy(),j}function ui(e){return e instanceof ot?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Jv(e),deleteFramebuffer:!0}}function Jv(e,t){var r=e.device,n=e.width,i=e.height,o=e.id,a=r.createFramebuffer(Fc(Fc({},t),{},{id:"framebuffer-for-".concat(o),width:n,height:i,colorAttachments:[e]}));return a}function Gv(e,t,r,n,i){if(e)return e;t=t||5121;var o=yr(t,{clamped:!1}),a=fi(r);return new o(n*i*a)}return Kc(em);})();
51
51
  return __exports__;
52
52
  });