// ==UserScript== // @name Bilibili React Helper // @namespace bilibili-react-helper // @version 0.8.9 // @description 基于 React + TypeScript 的哔哩哔哩关系图谱增强脚本 // @author 1ris_W // @license AGPL3 // @match *://space.bilibili.com/* // @grant GM_xmlhttpRequest // @connect api.bilibili.com // @run-at document-start // @exclude *://api.bilibili.com/* // @exclude *://api.*.bilibili.com/* // @exclude *://*.bilibili.com/api/* // @exclude *://member.bilibili.com/studio/bs-editor/* // @exclude *://t.bilibili.com/h5/dynamic/specification // @exclude *://bbq.bilibili.com/* // @exclude *://message.bilibili.com/pages/nav/header_sync // @exclude *://s1.hdslb.com/bfs/seed/jinkela/short/cols/iframe.html // @exclude *://open-live.bilibili.com/* // ==/UserScript== (()=>{var e={25:(e,t,n)=>{"use strict";n.d(t,{r:()=>i});var r=n(806);class i extends r.F{get[Symbol.toStringTag](){return"RenderPipeline"}shaderLayout;bufferLayout;linkStatus="pending";hash="";constructor(e,t){super(e,t,i.defaultProps),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}static defaultProps={...r.F.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",colorAttachmentFormats:void 0,depthStencilAttachmentFormat:void 0,parameters:{},bindings:{},uniforms:{}}}},114:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});const r={};function i(e="id"){r[e]=r[e]||1;return`${e}-${r[e]++}`}},500:(e,t,n)=>{"use strict";n.d(t,{pF:()=>d,I7:()=>u,PI:()=>c});var r=n(2745),i=n(5932),o=n(114),s=n(1456),a=n(4394),l=n(1100);class c{}class u{features;disabledFeatures;constructor(e=[],t){this.features=new Set(e),this.disabledFeatures=t||{}}*[Symbol.iterator](){yield*this.features}has(e){return!this.disabledFeatures?.[e]&&this.features.has(e)}}class d{static defaultProps={id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,webgl:{},onError:(e,t)=>{},onResize:(e,t)=>{const[n,r]=e.getDevicePixelSize();i.R.log(1,`${e} resized => ${n}x${r}px`)()},onPositionChange:(e,t)=>{const[n,r]=e.getPosition();i.R.log(1,`${e} repositioned => ${n},${r}`)()},onVisibilityChange:e=>i.R.log(1,`${e} Visibility changed ${e.isVisible}`)(),onDevicePixelRatioChange:(e,t)=>i.R.log(1,`${e} DPR changed ${t.oldRatio} => ${e.devicePixelRatio}`)(),debug:i.R.get("debug")||void 0,debugShaders:i.R.get("debug-shaders")||void 0,debugFramebuffers:Boolean(i.R.get("debug-framebuffers")),debugFactories:Boolean(i.R.get("debug-factories")),debugWebGL:Boolean(i.R.get("debug-webgl")),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_reuseDevices:!1,_requestMaxLimits:!0,_cacheShaders:!1,_cachePipelines:!1,_cacheDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_handle:void 0};get[Symbol.toStringTag](){return"Device"}toString(){return`Device(${this.id})`}id;props;userData={};statsManager=r.d;timestamp=0;_reused=!1;_lumaData={};_textureCaps={};constructor(e){this.props={...d.defaultProps,...e},this.id=this.props.id||(0,o.L)(this[Symbol.toStringTag].toLowerCase())}getVertexFormatInfo(e){return(0,a.yx)(e)}isVertexFormatSupported(e){return!0}getTextureFormatInfo(e){return l.v.getInfo(e)}getTextureFormatCapabilities(e){let t=this._textureCaps[e];if(!t){const n=this._getDeviceTextureFormatCapabilities(e);t=this._getDeviceSpecificTextureFormatCapabilities(n),this._textureCaps[e]=t}return t}getMipLevelCount(e,t,n=1){const r=Math.max(e,t,n);return 1+Math.floor(Math.log2(r))}isExternalImage(e){return function(e){return"undefined"!=typeof ImageData&&e instanceof ImageData||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas}(e)}getExternalImageSize(e){return function(e){if("undefined"!=typeof ImageData&&e instanceof ImageData||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height};if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if("undefined"!=typeof VideoFrame&&e instanceof VideoFrame)return{width:e.displayWidth,height:e.displayHeight};throw new Error("Unknown image type")}(e)}isTextureFormatSupported(e){return this.getTextureFormatCapabilities(e).create}isTextureFormatFilterable(e){return this.getTextureFormatCapabilities(e).filter}isTextureFormatRenderable(e){return this.getTextureFormatCapabilities(e).render}isTextureFormatCompressed(e){return l.v.isCompressed(e)}pushDebugGroup(e){this.commandEncoder.pushDebugGroup(e)}popDebugGroup(){this.commandEncoder?.popDebugGroup()}insertDebugMarker(e){this.commandEncoder?.insertDebugMarker(e)}loseDevice(){return!1}incrementTimestamp(){return this.timestamp++}reportError(e,t,...n){return this.props.onError(e,t)?()=>{}:i.R.error(e.message,t,...n)}debug(){if(this.props.debug);else{const e="'Type luma.log.set({debug: true}) in console to enable debug breakpoints',\nor create a device with the 'debug: true' prop.";i.R.once(0,e)()}}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}beginRenderPass(e){return this.commandEncoder.beginRenderPass(e)}beginComputePass(e){return this.commandEncoder.beginComputePass(e)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(e,t){throw new Error("not implemented")}readPixelsToBufferWebGL(e,t){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,t){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}static _getCanvasContextProps(e){return!0===e.createCanvasContext?{}:e.createCanvasContext}_getDeviceTextureFormatCapabilities(e){const t=l.v.getCapabilities(e),n=e=>("string"==typeof e?this.features.has(e):e)??!0,r=n(t.create);return{format:e,create:r,render:r&&n(t.render),filter:r&&n(t.filter),blend:r&&n(t.blend),store:r&&n(t.store)}}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t={...e};if((e.usage||0)&s.h.INDEX&&(e.indexType||(e.data instanceof Uint32Array?t.indexType="uint32":e.data instanceof Uint16Array?t.indexType="uint16":e.data instanceof Uint8Array&&(t.data=new Uint16Array(e.data),t.indexType="uint16")),!t.indexType))throw new Error("indices buffer content must be of type uint16 or uint32");return t}}},502:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},758:(e,t,n)=>{"use strict";e.exports=n(2713)},806:(e,t,n)=>{"use strict";n.d(t,{F:()=>i});var r=n(114);class i{static defaultProps={id:"undefined",handle:void 0,userData:void 0};toString(){return`${this[Symbol.toStringTag]||this.constructor.name}:"${this.id}"`}id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(e,t,n){if(!e)throw new Error("no device");this._device=e,this.props=function(e,t){const n={...t};for(const t in e)void 0!==e[t]&&(n[t]=e[t]);return n}(t,n);const i="undefined"!==this.props.id?this.props.id:(0,r.L)(this[Symbol.toStringTag]);this.props.id=i,this.id=i,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}getProps(){return this.props}attachResource(e){this._attachedResources.add(e)}detachResource(e){this._attachedResources.delete(e)}destroyAttachedResource(e){this._attachedResources.delete(e)&&e.destroy()}destroyAttachedResources(){for(const e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){const e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get(`${t}s Active`).decrementCount()}trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const n=this._device.statsManager.getStats("Resource Counts");n.get("GPU Memory").addCount(e),n.get(`${t} Memory`).addCount(e),this.allocatedBytes=e}trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=this._device.statsManager.getStats("Resource Counts");t.get("GPU Memory").subtractCount(this.allocatedBytes),t.get(`${e} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){const e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}}},812:(e,t,n)=>{"use strict";n.d(t,{_G:()=>c,ic:()=>l,k2:()=>u});var r=n(5932),i=n(8722);const o=1;let s=null,a=!1;const l={debugSpectorJS:r.R.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function c(e){if(!globalThis.SPECTOR)try{await(0,i.k)(e.debugSpectorJSUrl||l.debugSpectorJSUrl)}catch(e){r.R.warn(String(e))}}function u(e){if(!(e={...l,...e}).debugSpectorJS)return null;if(!s&&globalThis.SPECTOR&&!globalThis.luma?.spector){r.R.probe(o,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:e}=globalThis.SPECTOR;s=new e,globalThis.luma&&(globalThis.luma.spector=s)}if(!s)return null;if(a||(a=!0,s.spyCanvases(),s?.onCaptureStarted.add(e=>r.R.info("Spector capture started:",e)()),s?.onCapture.add(e=>{r.R.info("Spector capture complete:",e)(),s?.getResultUI(), // @ts-expect-error private s?.resultView.display(), // @ts-expect-error private s?.resultView.addCapture(e)})),e.gl){const t=e.gl,n=t.device; // @ts-expect-error s?.startCapture(e.gl,500), // @ts-expect-error t.device=n,new Promise(e=>setTimeout(e,2e3)).then(e=>{r.R.info("Spector capture stopped after 2 seconds")(),s?.stopCapture()})}return s}},875:function(e,t,n){var r;!function(e,i){function o(e){var t=this;t.next=function(){var e,n,r=t.x,i=t.i;return e=r[i],n=(e^=e>>>7)^e<<24,n^=(e=r[i+1&7])^e>>>10,n^=(e=r[i+3&7])^e>>>3,n^=(e=r[i+4&7])^e<<7,e=r[i+7&7],n^=(e^=e<<13)^e<<9,r[i]=n,t.i=i+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function a(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&(r.x&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(t,n,t,i))||(i.exports=r):this.xorshift7=a}(0,e=n.nmd(e),n.amdD)},1100:(e,t,n)=>{"use strict";n.d(t,{v:()=>v});var r=n(3189);const i="texture-compression-bc",o="texture-compression-astc",s="texture-compression-etc2",a="texture-compression-pvrtc-webgl",l="texture-compression-atc-webgl",c="float32-renderable-webgl",u="float16-renderable-webgl",d="snorm8-renderable-webgl",h="norm16-renderable-webgl",f="snorm16-renderable-webgl",p="float32-filterable",m="float16-filterable-webgl";function g(e){const t=_[e];if(!t)throw new Error(`Unsupported texture format ${e}`);return t}const _={...{r8unorm:{},rg8unorm:{},"rgb8unorm-webgl":{},rgba8unorm:{},"rgba8unorm-srgb":{},r8snorm:{render:d},rg8snorm:{render:d},"rgb8snorm-webgl":{},rgba8snorm:{render:d},r8uint:{},rg8uint:{},rgba8uint:{},r8sint:{},rg8sint:{},rgba8sint:{},bgra8unorm:{},"bgra8unorm-srgb":{},r16unorm:{f:h},rg16unorm:{render:h},"rgb16unorm-webgl":{f:h},rgba16unorm:{render:h},r16snorm:{f},rg16snorm:{render:f},"rgb16snorm-webgl":{f:h},rgba16snorm:{render:f},r16uint:{},rg16uint:{},rgba16uint:{},r16sint:{},rg16sint:{},rgba16sint:{},r16float:{render:u,filter:"float16-filterable-webgl"},rg16float:{render:u,filter:m},rgba16float:{render:u,filter:m},r32uint:{},rg32uint:{},rgba32uint:{},r32sint:{},rg32sint:{},rgba32sint:{},r32float:{render:c,filter:p},rg32float:{render:!1,filter:p},"rgb32float-webgl":{render:c,filter:p},rgba32float:{render:c,filter:p},"rgba4unorm-webgl":{channels:"rgba",bitsPerChannel:[4,4,4,4],packed:!0},"rgb565unorm-webgl":{channels:"rgb",bitsPerChannel:[5,6,5,0],packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bitsPerChannel:[5,5,5,1],packed:!0},rgb9e5ufloat:{channels:"rgb",packed:!0,render:"rgb9e5ufloat-renderable-webgl"},rg11b10ufloat:{channels:"rgb",bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:c},rgb10a2unorm:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},rgb10a2uint:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},stencil8:{attachment:"stencil",bitsPerChannel:[8,0,0,0],dataType:"uint8"},depth16unorm:{attachment:"depth",bitsPerChannel:[16,0,0,0],dataType:"uint16"},depth24plus:{attachment:"depth",bitsPerChannel:[24,0,0,0],dataType:"uint32"},depth32float:{attachment:"depth",bitsPerChannel:[32,0,0,0],dataType:"float32"},"depth24plus-stencil8":{attachment:"depth-stencil",bitsPerChannel:[24,8,0,0],packed:!0},"depth32float-stencil8":{attachment:"depth-stencil",bitsPerChannel:[32,8,0,0],packed:!0}},...{"bc1-rgb-unorm-webgl":{f:i},"bc1-rgb-unorm-srgb-webgl":{f:i},"bc1-rgba-unorm":{f:i},"bc1-rgba-unorm-srgb":{f:i},"bc2-rgba-unorm":{f:i},"bc2-rgba-unorm-srgb":{f:i},"bc3-rgba-unorm":{f:i},"bc3-rgba-unorm-srgb":{f:i},"bc4-r-unorm":{f:i},"bc4-r-snorm":{f:i},"bc5-rg-unorm":{f:i},"bc5-rg-snorm":{f:i},"bc6h-rgb-ufloat":{f:i},"bc6h-rgb-float":{f:i},"bc7-rgba-unorm":{f:i},"bc7-rgba-unorm-srgb":{f:i},"etc2-rgb8unorm":{f:s},"etc2-rgb8unorm-srgb":{f:s},"etc2-rgb8a1unorm":{f:s},"etc2-rgb8a1unorm-srgb":{f:s},"etc2-rgba8unorm":{f:s},"etc2-rgba8unorm-srgb":{f:s},"eac-r11unorm":{f:s},"eac-r11snorm":{f:s},"eac-rg11unorm":{f:s},"eac-rg11snorm":{f:s},"astc-4x4-unorm":{f:o},"astc-4x4-unorm-srgb":{f:o},"astc-5x4-unorm":{f:o},"astc-5x4-unorm-srgb":{f:o},"astc-5x5-unorm":{f:o},"astc-5x5-unorm-srgb":{f:o},"astc-6x5-unorm":{f:o},"astc-6x5-unorm-srgb":{f:o},"astc-6x6-unorm":{f:o},"astc-6x6-unorm-srgb":{f:o},"astc-8x5-unorm":{f:o},"astc-8x5-unorm-srgb":{f:o},"astc-8x6-unorm":{f:o},"astc-8x6-unorm-srgb":{f:o},"astc-8x8-unorm":{f:o},"astc-8x8-unorm-srgb":{f:o},"astc-10x5-unorm":{f:o},"astc-10x5-unorm-srgb":{f:o},"astc-10x6-unorm":{f:o},"astc-10x6-unorm-srgb":{f:o},"astc-10x8-unorm":{f:o},"astc-10x8-unorm-srgb":{f:o},"astc-10x10-unorm":{f:o},"astc-10x10-unorm-srgb":{f:o},"astc-12x10-unorm":{f:o},"astc-12x10-unorm-srgb":{f:o},"astc-12x12-unorm":{f:o},"astc-12x12-unorm-srgb":{f:o},"pvrtc-rgb4unorm-webgl":{f:a},"pvrtc-rgba4unorm-webgl":{f:a},"pvrtc-rbg2unorm-webgl":{f:a},"pvrtc-rgba2unorm-webgl":{f:a},"etc1-rbg-unorm-webgl":{f:"texture-compression-etc1-webgl"},"atc-rgb-unorm-webgl":{f:l},"atc-rgba-unorm-webgl":{f:l},"atc-rgbai-unorm-webgl":{f:l}}},y=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],b=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;const v=new class{getInfo(e){return x(e)}isColor(e){return e.startsWith("rgba")||e.startsWith("bgra")||e.startsWith("rgb")}isDepthStencil(e){return e.startsWith("depth")||e.startsWith("stencil")}isCompressed(e){return y.some(t=>e.startsWith(t))}getCapabilities(e){const t=g(e),n={format:e,create:t.f??!0,render:t.render??!0,filter:t.filter??!0,blend:t.blend??!0,store:t.store??!0},r=x(e),i=e.startsWith("depth")||e.startsWith("stencil"),o=r?.signed,s=r?.integer,a=r?.webgl;return n.render&&=!o,n.filter&&=!(i||o||s||a),n}};function x(e){let t=function(e){const t=g(e),n=t.bytesPerPixel||1,r=t.bitsPerChannel||[8,8,8,8];delete t.bitsPerChannel,delete t.bytesPerPixel,delete t.f,delete t.render,delete t.filter,delete t.blend,delete t.store;const i={...t,format:e,attachment:t.attachment||"color",channels:t.channels||"r",components:t.components||t.channels?.length||1,bytesPerPixel:n,bitsPerChannel:r,dataType:t.dataType||"uint8",srgb:t.srgb??!1,packed:t.packed??!1,webgl:t.webgl??!1,integer:t.integer??!1,signed:t.signed??!1,normalized:t.normalized??!1,compressed:t.compressed??!1};return i}(e);if(v.isCompressed(e)){t.channels="rgb",t.components=3,t.bytesPerPixel=1,t.srgb=!1,t.compressed=!0;const n=function(e){const t=/.*-(\d+)x(\d+)-.*/.exec(e);if(t){const[,e,n]=t;return{blockWidth:Number(e),blockHeight:Number(n)}}return null}(e);n&&(t.blockWidth=n.blockWidth,t.blockHeight=n.blockHeight)}const n=b.exec(e);if(n){const[,i,o,s,a,l]=n,c=`${s}${o}`,u=(0,r.vE)(c),d=8*u.byteLength,h=i.length,f=[d,h>=2?d:0,h>=3?d:0,h>=4?d:0];t={format:e,attachment:t.attachment,dataType:u.signedType,components:h,channels:i,integer:u.integer,signed:u.signed,normalized:u.normalized,bitsPerChannel:f,bytesPerPixel:u.byteLength*i.length,packed:t.packed,srgb:t.srgb},"-webgl"===l&&(t.webgl=!0),"-srgb"===a&&(t.srgb=!0)}return e.endsWith("-webgl")&&(t.webgl=!0),e.endsWith("-srgb")&&(t.srgb=!0),t}},1456:(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var r=n(806);class i extends r.F{static INDEX=16;static VERTEX=32;static UNIFORM=64;static STORAGE=128;static INDIRECT=256;static QUERY_RESOLVE=512;static MAP_READ=1;static MAP_WRITE=2;static COPY_SRC=4;static COPY_DST=8;get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(e,t){const n={...t};(t.usage||0)&i.INDEX&&!t.indexType&&(t.data instanceof Uint32Array?n.indexType="uint32":t.data instanceof Uint16Array?n.indexType="uint16":t.data instanceof Uint8Array&&(n.indexType="uint8")),delete n.data,super(e,n,i.defaultProps),this.usage=n.usage||0,this.indexType=n.indexType,this.updateTimestamp=e.incrementTimestamp()}clone(e){return this.device.createBuffer({...this.props,...e})}static DEBUG_DATA_MAX_LENGTH=32;debugData=new ArrayBuffer(0);_setDebugData(e,t,n){const r=ArrayBuffer.isView(e)?e.buffer:e,o=Math.min(e?e.byteLength:n,i.DEBUG_DATA_MAX_LENGTH);null===r?this.debugData=new ArrayBuffer(o):0===t&&n===r.byteLength?this.debugData=r.slice(0,o):this.debugData=r.slice(t,t+o)}static defaultProps={...r.F.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",onMapped:void 0}}},1896:(e,t,n)=>{"use strict";e.exports=n(4733)},1976:(e,t,n)=>{"use strict";function r(e){return a[e]}function i(e){const[t,n]=s[e],r="i32"===t||"u32"===t,i="u32"!==t;return{primitiveType:t,components:n,byteLength:o[t]*n,integer:r,signed:i}}n.d(t,{k0:()=>r,wH:()=>i});const o={f32:4,f16:2,i32:4,u32:4},s={f32:["f32",1],"vec2":["f32",2],"vec3":["f32",3],"vec4":["f32",4],f16:["f16",1],"vec2":["f16",2],"vec3":["f16",3],"vec4":["f16",4],i32:["i32",1],"vec2":["i32",2],"vec3":["i32",3],"vec4":["i32",4],u32:["u32",1],"vec2":["u32",2],"vec3":["u32",3],"vec4":["u32",4]},a={f32:{type:"f32",components:1},f16:{type:"f16",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2":{type:"f32",components:2},"vec3":{type:"f32",components:3},"vec4":{type:"f32",components:4},"vec2":{type:"f16",components:2},"vec3":{type:"f16",components:3},"vec4":{type:"f16",components:4},"vec2":{type:"i32",components:2},"vec3":{type:"i32",components:3},"vec4":{type:"i32",components:4},"vec2":{type:"u32",components:2},"vec3":{type:"u32",components:3},"vec4":{type:"u32",components:4},"mat2x2":{type:"f32",components:4},"mat2x3":{type:"f32",components:6},"mat2x4":{type:"f32",components:8},"mat3x2":{type:"f32",components:6},"mat3x3":{type:"f32",components:9},"mat3x4":{type:"f32",components:12},"mat4x2":{type:"f32",components:8},"mat4x3":{type:"f32",components:12},"mat4x4":{type:"f32",components:16},"mat2x2":{type:"f16",components:4},"mat2x3":{type:"f16",components:6},"mat2x4":{type:"f16",components:8},"mat3x2":{type:"f16",components:6},"mat3x3":{type:"f16",components:9},"mat3x4":{type:"f16",components:12},"mat4x2":{type:"f16",components:8},"mat4x3":{type:"f16",components:12},"mat4x4":{type:"f16",components:16},"mat2x2":{type:"i32",components:4},"mat2x3":{type:"i32",components:6},"mat2x4":{type:"i32",components:8},"mat3x2":{type:"i32",components:6},"mat3x3":{type:"i32",components:9},"mat3x4":{type:"i32",components:12},"mat4x2":{type:"i32",components:8},"mat4x3":{type:"i32",components:12},"mat4x4":{type:"i32",components:16},"mat2x2":{type:"u32",components:4},"mat2x3":{type:"u32",components:6},"mat2x4":{type:"u32",components:8},"mat3x2":{type:"u32",components:6},"mat3x3":{type:"u32",components:9},"mat3x4":{type:"u32",components:12},"mat4x2":{type:"u32",components:8},"mat4x3":{type:"u32",components:12},"mat4x4":{type:"u32",components:16}},l={vec2i:"vec2",vec3i:"vec3",vec4i:"vec4",vec2u:"vec2",vec3u:"vec3",vec4u:"vec4",vec2f:"vec2",vec3f:"vec3",vec4f:"vec4",vec2h:"vec2",vec3h:"vec3",vec4h:"vec4"}},2093:e=>{"use strict";e.exports=function(e){return e[1]}},2434:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r{"use strict";n.d(t,{X:()=>i});var r=n(806);class i extends r.F{get[Symbol.toStringTag](){return"TextureView"}constructor(e,t){super(e,t,i.defaultProps)}static defaultProps={...r.F.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0}}},2670:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},2679:function(e,t,n){var r;!function(e,i){function o(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r>>4),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function a(e,t){var n=new o(e),r=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(t,n,t,i))||(i.exports=r):this.xorwow=a}(0,e=n.nmd(e),n.amdD)},2713:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=_.prototype;var v=b.prototype=new y;v.constructor=b,m(v,_.prototype),v.isPureReactComponent=!0;var x=Array.isArray,w=Object.prototype.hasOwnProperty,S={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function T(e,t,r){var i,o={},s=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(s=""+t.key),t)w.call(t,i)&&!E.hasOwnProperty(i)&&(o[i]=t[i]);var l=arguments.length-2;if(1===l)o.children=r;else if(1{"use strict";function r(){let e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const t=process.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}n.d(t,{d:()=>s});class i{constructor(e,t){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=e,this.type=t,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(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=r(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(r()-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)}}class o{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const t of Object.values(this.stats))e(t)}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(e=>this._getOrCreate(e))}_getOrCreate(e){const{name:t,type:n}=e;let r=this.stats[t];return r||(r=e instanceof i?e:new i(t,n),this.stats[t]=r),r}}const s=new class{stats=new Map;getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new o({id:e})),this.stats.get(e)}}},2754:(e,t,n)=>{"use strict";function r(e){ // @ts-expect-error if("undefined"!=typeof window&&"renderer"===window.process?.type)return!0;if("undefined"!=typeof process&&Boolean(process.versions?.electron))return!0;const t="undefined"!=typeof navigator&&navigator.userAgent,n=e||t;return Boolean(n&&n.indexOf("Electron")>=0)}n.d(t,{b:()=>r})},3189:(e,t,n)=>{"use strict";function r(e){const[t,n,r]=l[e],i=e.includes("norm");return{signedType:t,primitiveType:n,byteLength:r,normalized:i,integer:!i&&!e.startsWith("float"),signed:e.startsWith("s")}}function i(e){const t=e;switch(t){case"uint8":return"unorm8";case"sint8":return"snorm8";case"uint16":return"unorm16";case"sint16":return"snorm16";default:return t}}function o(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}function s(e){const t=ArrayBuffer.isView(e)?e.constructor:e;if(t===Uint8ClampedArray)return"uint8";const n=Object.values(l).find(e=>t===e[4]);if(!n)throw new Error(t.name);return n[0]}function a(e){const[,,,,t]=l[e];return t}n.d(t,{Ak:()=>a,JP:()=>o,K7:()=>i,h1:()=>s,vE:()=>r});const l={uint8:["uint8","u32",1,!1,Uint8Array],sint8:["sint8","i32",1,!1,Int8Array],unorm8:["uint8","f32",1,!0,Uint8Array],snorm8:["sint8","f32",1,!0,Int8Array],uint16:["uint16","u32",2,!1,Uint16Array],sint16:["sint16","i32",2,!1,Int16Array],unorm16:["uint16","u32",2,!0,Uint16Array],snorm16:["sint16","i32",2,!0,Int16Array],float16:["float16","f16",2,!1,Uint16Array],float32:["float32","f32",4,!1,Float32Array],uint32:["uint32","u32",4,!1,Uint32Array],sint32:["sint32","i32",4,!1,Int32Array]}},3611:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},3711:(e,t,n)=>{var r=n(7308),i=n(6989),o=n(2679),s=n(875),a=n(8993),l=n(9813),c=n(7713);c.alea=r,c.xor128=i,c.xorwow=o,c.xorshift7=s,c.xor4096=a,c.tychei=l,e.exports=c},4269:(e,t,n)=>{"use strict";n.d(t,{WebGLDevice:()=>ft});var r=n(500),i=n(5932); // @ts-nocheck TODO fix const o={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,35725:null,36006:null,36007:null,34229:null,34964:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32926:!1,32928:!1,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],36389:null,36662:null,36663:null,35053:null,35055:null,35723:4352,36010:null,35977:!1,3333:4,3317:4,37440:!1,37441:!1,37443:37444,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},s=(e,t,n)=>t?e.enable(n):e.disable(n),a=(e,t,n)=>e.hint(n,t),l=(e,t,n)=>e.pixelStorei(n,t),c=(e,t,n)=>{const r=36006===n?36009:36008;return e.bindFramebuffer(r,t)},u=(e,t,n)=>{const r={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[n];e.bindBuffer(r,t)};function d(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}const h={3042:s,32773:(e,t)=>e.blendColor(...t),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(e,t)=>e.clearColor(...t),3107:(e,t)=>e.colorMask(...t),2884:s,2885:(e,t)=>e.cullFace(t),2929:s,2931:(e,t)=>e.clearDepth(t),2932:(e,t)=>e.depthFunc(t),2928:(e,t)=>e.depthRange(...t),2930:(e,t)=>e.depthMask(t),3024:s,35723:a,35725:(e,t)=>e.useProgram(t),36007:(e,t)=>e.bindRenderbuffer(36161,t),36389:(e,t)=>e.bindTransformFeedback?.(36386,t),34229:(e,t)=>e.bindVertexArray(t),36006:c,36010:c,34964:u,36662:u,36663:u,35053:u,35055:u,2886:(e,t)=>e.frontFace(t),33170:a,2849:(e,t)=>e.lineWidth(t),32823:s,32824:"polygonOffset",10752:"polygonOffset",35977:s,32926:s,32928:s,32938:"sampleCoverage",32939:"sampleCoverage",3089:s,3088:(e,t)=>e.scissor(...t),2960:s,2961:(e,t)=>e.clearStencil(t),2968:(e,t)=>e.stencilMaskSeparate(1028,t),36005:(e,t)=>e.stencilMaskSeparate(1029,t),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(e,t)=>e.viewport(...t),34383:s,10754:s,12288:s,12289:s,12290:s,12291:s,12292:s,12293:s,12294:s,12295:s,3333:l,3317:l,37440:l,37441:l,37443:l,3330:l,3332:l,3331:l,3314:l,32878:l,3316:l,3315:l,32877:l,framebuffer:(e,t)=>{const n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:(e,t)=>t?e.enable(3042):e.disable(3042),blendColor:(e,t)=>e.blendColor(...t),blendEquation:(e,t)=>{const n="number"==typeof t?[t,t]:t;e.blendEquationSeparate(...n)},blendFunc:(e,t)=>{const n=2===t?.length?[...t,...t]:t;e.blendFuncSeparate(...n)},clearColor:(e,t)=>e.clearColor(...t),clearDepth:(e,t)=>e.clearDepth(t),clearStencil:(e,t)=>e.clearStencil(t),colorMask:(e,t)=>e.colorMask(...t),cull:(e,t)=>t?e.enable(2884):e.disable(2884),cullFace:(e,t)=>e.cullFace(t),depthTest:(e,t)=>t?e.enable(2929):e.disable(2929),depthFunc:(e,t)=>e.depthFunc(t),depthMask:(e,t)=>e.depthMask(t),depthRange:(e,t)=>e.depthRange(...t),dither:(e,t)=>t?e.enable(3024):e.disable(3024),derivativeHint:(e,t)=>{e.hint(35723,t)},frontFace:(e,t)=>e.frontFace(t),mipmapHint:(e,t)=>e.hint(33170,t),lineWidth:(e,t)=>e.lineWidth(t),polygonOffsetFill:(e,t)=>t?e.enable(32823):e.disable(32823),polygonOffset:(e,t)=>e.polygonOffset(...t),sampleCoverage:(e,t)=>e.sampleCoverage(t[0],t[1]||!1),scissorTest:(e,t)=>t?e.enable(3089):e.disable(3089),scissor:(e,t)=>e.scissor(...t),stencilTest:(e,t)=>t?e.enable(2960):e.disable(2960),stencilMask:(e,t)=>{t=d(t)?t:[t,t];const[n,r]=t;e.stencilMaskSeparate(1028,n),e.stencilMaskSeparate(1029,r)},stencilFunc:(e,t)=>{t=d(t)&&3===t.length?[...t,...t]:t;const[n,r,i,o,s,a]=t;e.stencilFuncSeparate(1028,n,r,i),e.stencilFuncSeparate(1029,o,s,a)},stencilOp:(e,t)=>{t=d(t)&&3===t.length?[...t,...t]:t;const[n,r,i,o,s,a]=t;e.stencilOpSeparate(1028,n,r,i),e.stencilOpSeparate(1029,o,s,a)},viewport:(e,t)=>e.viewport(...t)};function f(e,t,n){return void 0!==t[e]?t[e]:n[e]}const p={blendEquation:(e,t,n)=>e.blendEquationSeparate(f(32777,t,n),f(34877,t,n)),blendFunc:(e,t,n)=>e.blendFuncSeparate(f(32969,t,n),f(32968,t,n),f(32971,t,n),f(32970,t,n)),polygonOffset:(e,t,n)=>e.polygonOffset(f(32824,t,n),f(10752,t,n)),sampleCoverage:(e,t,n)=>e.sampleCoverage(f(32938,t,n),f(32939,t,n)),stencilFuncFront:(e,t,n)=>e.stencilFuncSeparate(1028,f(2962,t,n),f(2967,t,n),f(2963,t,n)),stencilFuncBack:(e,t,n)=>e.stencilFuncSeparate(1029,f(34816,t,n),f(36003,t,n),f(36004,t,n)),stencilOpFront:(e,t,n)=>e.stencilOpSeparate(1028,f(2964,t,n),f(2965,t,n),f(2966,t,n)),stencilOpBack:(e,t,n)=>e.stencilOpSeparate(1029,f(34817,t,n),f(34818,t,n),f(34819,t,n))},m={enable:(e,t)=>e({[t]:!0}),disable:(e,t)=>e({[t]:!1}),pixelStorei:(e,t,n)=>e({[t]:n}),hint:(e,t,n)=>e({[t]:n}),useProgram:(e,t)=>e({35725:t}),bindRenderbuffer:(e,t,n)=>e({36007:n}),bindTransformFeedback:(e,t,n)=>e({36389:n}),bindVertexArray:(e,t)=>e({34229:t}),bindFramebuffer:(e,t,n)=>{switch(t){case 36160:return e({36006:n,36010:n});case 36009:return e({36006:n});case 36008:return e({36010:n});default:return null}},bindBuffer:(e,t,n)=>{const r={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[t];return r?e({[r]:n}):{valueChanged:!0}},blendColor:(e,t,n,r,i)=>e({32773:new Float32Array([t,n,r,i])}),blendEquation:(e,t)=>e({32777:t,34877:t}),blendEquationSeparate:(e,t,n)=>e({32777:t,34877:n}),blendFunc:(e,t,n)=>e({32969:t,32968:n,32971:t,32970:n}),blendFuncSeparate:(e,t,n,r,i)=>e({32969:t,32968:n,32971:r,32970:i}),clearColor:(e,t,n,r,i)=>e({3106:new Float32Array([t,n,r,i])}),clearDepth:(e,t)=>e({2931:t}),clearStencil:(e,t)=>e({2961:t}),colorMask:(e,t,n,r,i)=>e({3107:[t,n,r,i]}),cullFace:(e,t)=>e({2885:t}),depthFunc:(e,t)=>e({2932:t}),depthRange:(e,t,n)=>e({2928:new Float32Array([t,n])}),depthMask:(e,t)=>e({2930:t}),frontFace:(e,t)=>e({2886:t}),lineWidth:(e,t)=>e({2849:t}),polygonOffset:(e,t,n)=>e({32824:t,10752:n}),sampleCoverage:(e,t,n)=>e({32938:t,32939:n}),scissor:(e,t,n,r,i)=>e({3088:new Int32Array([t,n,r,i])}),stencilMask:(e,t)=>e({2968:t,36005:t}),stencilMaskSeparate:(e,t,n)=>e({[1028===t?2968:36005]:n}),stencilFunc:(e,t,n,r)=>e({2962:t,2967:n,2963:r,34816:t,36003:n,36004:r}),stencilFuncSeparate:(e,t,n,r,i)=>e({[1028===t?2962:34816]:n,[1028===t?2967:36003]:r,[1028===t?2963:36004]:i}),stencilOp:(e,t,n,r)=>e({2964:t,2965:n,2966:r,34817:t,34818:n,34819:r}),stencilOpSeparate:(e,t,n,r,i)=>e({[1028===t?2964:34817]:n,[1028===t?2965:34818]:r,[1028===t?2966:34819]:i}),viewport:(e,t,n,r,i)=>e({2978:[t,n,r,i]})},g=(e,t)=>e.isEnabled(t),_={3042:g,2884:g,2929:g,3024:g,32823:g,32926:g,32928:g,3089:g,2960:g,35977:g},y=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 b(e,t){if(function(e){ // @ts-ignore dummy key variable for(const t in e)return!1;return!0}(t))return;const n={};for(const r in t){const i=Number(r),o=h[r]; // @ts-ignore TODO o&&("string"==typeof o? // @ts-ignore TODO n[o]=!0: // @ts-ignore TODO o(e,t[r],i))} // @ts-expect-error const r=e.state&&e.state.cache;if(r)for(const i in n){(0,p[i])(e,t,r)}}function v(e,t=o){if("number"==typeof t){const n=t,r=_[n]; // @ts-ignore TODO return r?r(e,n):e.getParameter(n)}const n=Array.isArray(t)?t:Object.keys(t),r={};for(const t of n){ // @ts-ignore TODO const n=_[t]; // @ts-ignore TODO r[t]=n?n(e,Number(t)):e.getParameter(Number(t))}return r}function x(e,t){if(e===t)return!0;if(w(e)&&w(t)&&e.length===t.length){for(let n=0;n{}),this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){const e=this.stateStack[this.stateStack.length-1];b(this.gl,e),this.stateStack.pop()}trackState(e,t){if(this.cache=t?.copyState?v(e):Object.assign({},o),this.initialized)throw new Error("WebGLStateTracker");this.initialized=!0, // @ts-expect-error this.gl.state=this,function(e){const t=e.useProgram.bind(e);e.useProgram=function(n){const r=S.get(e);r.program!==n&&(t(n),r.program=n)}}(e);for(const t in m){T(e,t,m[t])}E(e,"getParameter"),E(e,"isEnabled")}_updateCache(e){let t,n=!1;const r=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(const i in e){const o=e[i],s=this.cache[i];x(o,s)||(n=!0,t=s,r&&!(i in r)&&(r[i]=s),this.cache[i]=o)}return{valueChanged:n,oldValue:t}}}function E(e,t){const n=e[t].bind(e);e[t]=function(t){if(void 0===t||y.has(t))return n(t);const r=S.get(e);return t in r.cache||(r.cache[t]=n(t)),r.enable?r.cache[t]:n(t)},Object.defineProperty(e[t],"name",{value:`${t}-from-cache`,configurable:!1})}function T(e,t,n){if(!e[t])return;const r=e[t].bind(e);e[t]=function(...t){const i=S.get(e),{valueChanged:o,oldValue:s}=n(i._updateCache,...t);return o&&r(...t),s},Object.defineProperty(e[t],"name",{value:`${t}-to-cache`,configurable:!1})}function k(e,t,n){ // @ts-ignore TODO // @ts-ignore TODO return void 0===n[t]&&( // @ts-ignore TODO n[t]=e.getExtension(t)||null),n[t]}function A(e,t){const n=e.getParameter(7936),r=e.getParameter(7937);k(e,"WEBGL_debug_renderer_info",t);const i=t.WEBGL_debug_renderer_info,o=e.getParameter(i?i.UNMASKED_VENDOR_WEBGL:7936)||n,s=e.getParameter(i?i.UNMASKED_RENDERER_WEBGL:7937)||r,a=e.getParameter(7938),l=C(o,s),c=function(e,t){if(/Metal/i.exec(e)||/Metal/i.exec(t))return"metal";if(/ANGLE/i.exec(e)||/ANGLE/i.exec(t))return"opengl";return"unknown"}(o,s),u=function(e,t){if(/SwiftShader/i.exec(e)||/SwiftShader/i.exec(t))return"cpu";switch(C(e,t)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}(o,s);return{type:"webgl",gpu:l,gpuType:u,gpuBackend:c,vendor:o,renderer:s,version:a,shadingLanguage:"glsl",shadingLanguageVersion:300}}function C(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"}var R=n(1100);function I(e){switch(e){case"uint8":case"unorm8":return 5121;case"sint8":case"snorm8":return 5120;case"uint16":case"unorm16":return 5123;case"sint16":case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126} // @ts-ignore unreachable throw new Error(String(e))}const L="WEBGL_compressed_texture_s3tc",P="WEBGL_compressed_texture_s3tc_srgb",N="EXT_texture_compression_rgtc",M="EXT_texture_compression_bptc",O="EXT_texture_norm16",D="EXT_render_snorm",F={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat-renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[D],"norm16-renderable-webgl":[O],"snorm16-renderable-webgl":[O,D],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[L,P,N,M],"texture-compression-bc5-webgl":[N],"texture-compression-bc7-webgl":[M],"texture-compression-etc2":["WEBGL_compressed_texture_etc"],"texture-compression-astc":["WEBGL_compressed_texture_astc"],"texture-compression-etc1-webgl":["WEBGL_compressed_texture_etc1"],"texture-compression-pvrtc-webgl":["WEBGL_compressed_texture_pvrtc"],"texture-compression-atc-webgl":["WEBGL_compressed_texture_atc"]};const B={r8unorm:{gl:33321,rb:!0},r8snorm:{gl:36756},r8uint:{gl:33330,rb:!0},r8sint:{gl:33329,rb:!0},rg8unorm:{gl:33323,rb:!0},rg8snorm:{gl:36757},rg8uint:{gl:33336,rb:!0},rg8sint:{gl:33335,rb:!0},r16uint:{gl:33332,rb:!0},r16sint:{gl:33331,rb:!0},r16float:{gl:33325,rb:!0},r16unorm:{gl:33322,rb:!0},r16snorm:{gl:36760},"rgba4unorm-webgl":{gl:32854,rb:!0},"rgb565unorm-webgl":{gl:36194,rb:!0},"rgb5a1unorm-webgl":{gl:32855,rb:!0},"rgb8unorm-webgl":{gl:32849},"rgb8snorm-webgl":{gl:36758},rgba8unorm:{gl:32856},"rgba8unorm-srgb":{gl:35907},rgba8snorm:{gl:36759},rgba8uint:{gl:36220},rgba8sint:{gl:36238},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{gl:33338},rg16sint:{gl:33337},rg16float:{gl:33327,rb:!0},rg16unorm:{gl:33324},rg16snorm:{gl:36761},r32uint:{gl:33334,rb:!0},r32sint:{gl:33333,rb:!0},r32float:{gl:33326},rgb9e5ufloat:{gl:35901},rg11b10ufloat:{gl:35898,rb:!0},rgb10a2unorm:{gl:32857,rb:!0},rgb10a2uint:{gl:36975,rb:!0},"rgb16unorm-webgl":{gl:32852},"rgb16snorm-webgl":{gl:36762},rg32uint:{gl:33340,rb:!0},rg32sint:{gl:33339,rb:!0},rg32float:{gl:33328,rb:!0},rgba16uint:{gl:36214,rb:!0},rgba16sint:{gl:36232,rb:!0},rgba16float:{gl:34842},rgba16unorm:{gl:32859,rb:!0},rgba16snorm:{gl:36763},"rgb32float-webgl":{gl:34837,x:"EXT_color_buffer_float",dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,rb:!0},rgba32sint:{gl:36226,rb:!0},rgba32float:{gl:34836,rb:!0},stencil8:{gl:36168,rb:!0},depth16unorm:{gl:33189,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,dataFormat:6402,types:[5125]},depth32float:{gl:36012,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth32float-stencil8":{gl:36013,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:L},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:P},"bc1-rgba-unorm":{gl:33777,x:L},"bc1-rgba-unorm-srgb":{gl:35916,x:P},"bc2-rgba-unorm":{gl:33778,x:L},"bc2-rgba-unorm-srgb":{gl:35918,x:P},"bc3-rgba-unorm":{gl:33779,x:L},"bc3-rgba-unorm-srgb":{gl:35919,x:P},"bc4-r-unorm":{gl:36283,x:N},"bc4-r-snorm":{gl:36284,x:N},"bc5-rg-unorm":{gl:36285,x:N},"bc5-rg-snorm":{gl:36286,x:N},"bc6h-rgb-ufloat":{gl:36495,x:M},"bc6h-rgb-float":{gl:36494,x:M},"bc7-rgba-unorm":{gl:36492,x:M},"bc7-rgba-unorm-srgb":{gl:36493,x:M},"etc2-rgb8unorm":{gl:37492},"etc2-rgb8unorm-srgb":{gl:37494},"etc2-rgb8a1unorm":{gl:37496},"etc2-rgb8a1unorm-srgb":{gl:37497},"etc2-rgba8unorm":{gl:37493},"etc2-rgba8unorm-srgb":{gl:37495},"eac-r11unorm":{gl:37488},"eac-r11snorm":{gl:37489},"eac-rg11unorm":{gl:37490},"eac-rg11snorm":{gl:37491},"astc-4x4-unorm":{gl:37808},"astc-4x4-unorm-srgb":{gl:37840},"astc-5x4-unorm":{gl:37809},"astc-5x4-unorm-srgb":{gl:37841},"astc-5x5-unorm":{gl:37810},"astc-5x5-unorm-srgb":{gl:37842},"astc-6x5-unorm":{gl:37811},"astc-6x5-unorm-srgb":{gl:37843},"astc-6x6-unorm":{gl:37812},"astc-6x6-unorm-srgb":{gl:37844},"astc-8x5-unorm":{gl:37813},"astc-8x5-unorm-srgb":{gl:37845},"astc-8x6-unorm":{gl:37814},"astc-8x6-unorm-srgb":{gl:37846},"astc-8x8-unorm":{gl:37815},"astc-8x8-unorm-srgb":{gl:37847},"astc-10x5-unorm":{gl:37819},"astc-10x5-unorm-srgb":{gl:37851},"astc-10x6-unorm":{gl:37817},"astc-10x6-unorm-srgb":{gl:37849},"astc-10x8-unorm":{gl:37818},"astc-10x8-unorm-srgb":{gl:37850},"astc-10x10-unorm":{gl:37819},"astc-10x10-unorm-srgb":{gl:37851},"astc-12x10-unorm":{gl:37820},"astc-12x10-unorm-srgb":{gl:37852},"astc-12x12-unorm":{gl:37821},"astc-12x12-unorm-srgb":{gl:37853},"pvrtc-rgb4unorm-webgl":{gl:35840},"pvrtc-rgba4unorm-webgl":{gl:35842},"pvrtc-rbg2unorm-webgl":{gl:35841},"pvrtc-rgba2unorm-webgl":{gl:35843},"etc1-rbg-unorm-webgl":{gl:36196},"atc-rgb-unorm-webgl":{gl:35986},"atc-rgba-unorm-webgl":{gl:35986},"atc-rgbai-unorm-webgl":{gl:34798}};function U(e){const t=B[e],n=function(e){const t=B[e],n=t?.gl;if(void 0===n)throw new Error(`Unsupported texture format ${e}`);return n}(e),r=R.v.getInfo(e);return r.compressed&&(t.dataFormat=n),{internalFormat:n,format:t?.dataFormat||z(r.channels,r.integer,r.normalized,n),type:r.dataType?I(r.dataType):t?.types?.[0]||5121,compressed:r.compressed||!1}}function z(e,t,n,r){if(6408===r||6407===r)return r;switch(e){case"r":return t&&!n?36244:6403;case"rg":return t&&!n?33320:33319;case"rgb":return t&&!n?36248:6407;case"rgba":return t&&!n?36249:6408;case"bgra":throw new Error("bgra pixels not supported by WebGL");default:return 6408}}const $={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"};class G extends r.I7{gl;extensions;testedFeatures=new Set;constructor(e,t,n){super([],n),this.gl=e,this.extensions=t,k(e,"EXT_color_buffer_float",t)}*[Symbol.iterator](){const e=this.getFeatures();for(const t of e)this.has(t)&&(yield t);return[]}has(e){return!this.disabledFeatures?.[e]&&(this.testedFeatures.has(e)||(this.testedFeatures.add(e),function(e){return e in F}(e)&&function(e,t,n){return(F[t]||[]).every(t=>k(e,t,n))}(this.gl,e,this.extensions)&&this.features.add(e),this.getWebGLFeature(e)&&this.features.add(e)),this.features.has(e))}initializeFeatures(){const e=this.getFeatures().filter(e=>"polygon-mode-webgl"!==e);for(const t of e)this.has(t)}getFeatures(){return[...Object.keys($),...Object.keys(F)]}getWebGLFeature(e){const t=$[e];return"string"==typeof t?Boolean(k(this.gl,t,this.extensions)):Boolean(t)}}class j extends r.PI{get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderVariables(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}gl;limits={};constructor(e){super(),this.gl=e}getParameter(e){return void 0===this.limits[e]&&(this.limits[e]=this.gl.getParameter(e)),this.limits[e]||0}}var V=n(6106),W=n(114);class H{static isHTMLCanvas(e){return"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement}static isOffscreenCanvas(e){return"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas}static defaultProps={id:void 0,canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb",trackPosition:!1};id;props;canvas;htmlCanvas;offscreenCanvas;type;initialized;isInitialized=!1;isVisible=!0;cssWidth;cssHeight;devicePixelRatio;devicePixelWidth;devicePixelHeight;drawingBufferWidth;drawingBufferHeight;_initializedResolvers=function(){let e,t; // @ts-expect-error - in fact these are no used before initialized return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}();_resizeObserver;_intersectionObserver;_position;destroyed=!1;toString(){return`${this[Symbol.toStringTag]}(${this.id})`}constructor(e){if(this.props={...H.defaultProps,...e},e=this.props,this.initialized=this._initializedResolvers.promise,(0,V.B)()?e.canvas?"string"==typeof e.canvas?this.canvas=function(e){const t=document.getElementById(e);if(!H.isHTMLCanvas(t))throw new Error("Object is not a canvas element");return t}(e.canvas):this.canvas=e.canvas:this.canvas=function(e){const{width:t,height:n}=e,r=document.createElement("canvas");r.id=(0,W.L)("lumagl-auto-created-canvas"),r.width=t||1,r.height=n||1,r.style.width=Number.isFinite(t)?`${t}px`:"100%",r.style.height=Number.isFinite(n)?`${n}px`:"100%",e?.visible||(r.style.visibility="hidden");const i=function(e){if("string"==typeof e){const t=document.getElementById(e);if(!t)throw new Error(`${e} is not an HTML element`);return t}if(e)return e;return document.body}(e?.container||null);return i.insertBefore(r,i.firstChild),r}(e):this.canvas={width:e.width||1,height:e.height||1},H.isHTMLCanvas(this.canvas)?(this.id=e.id||this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):H.isOffscreenCanvas(this.canvas)?(this.id=e.id||"offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas):(this.id=e.id||"node-canvas-context",this.type="node"),this.cssWidth=this.htmlCanvas?.clientWidth||this.canvas.width,this.cssHeight=this.htmlCanvas?.clientHeight||this.canvas.height,this.devicePixelWidth=this.canvas.width,this.devicePixelHeight=this.canvas.height,this.drawingBufferWidth=this.canvas.width,this.drawingBufferHeight=this.canvas.height,this.devicePixelRatio=globalThis.devicePixelRatio||1,this._position=[0,0],H.isHTMLCanvas(this.canvas)){this._intersectionObserver=new IntersectionObserver(e=>this._handleIntersection(e)),this._intersectionObserver.observe(this.canvas),this._resizeObserver=new ResizeObserver(e=>this._handleResize(e));try{this._resizeObserver.observe(this.canvas,{box:"device-pixel-content-box"})}catch{this._resizeObserver.observe(this.canvas,{box:"content-box"})}setTimeout(()=>this._observeDevicePixelRatio(),0),this.props.trackPosition&&this._trackPosition()}}destroy(){this.destroyed=!0}setProps(e){return"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1,this._updateDrawingBufferSize()),this}getCSSSize(){return[this.cssWidth,this.cssHeight]}getPosition(){return this._position}getDevicePixelSize(){return[this.devicePixelWidth,this.devicePixelHeight]}getDrawingBufferSize(){return[this.drawingBufferWidth,this.drawingBufferHeight]}getMaxDrawingBufferSize(){const e=this.device.limits.maxTextureDimension2D;return[e,e]}setDrawingBufferSize(e,t){this.canvas.width=e,this.canvas.height=t,this.drawingBufferWidth=e,this.drawingBufferHeight=t}getDevicePixelRatio(){return"undefined"!=typeof window&&window.devicePixelRatio||1}cssToDevicePixels(e,t=!0){const n=this.cssToDeviceRatio(),[r,i]=this.getDrawingBufferSize();return function(e,t,n,r,i){const o=e,s=X(o[0],t,n);let a=q(o[1],t,r,i),l=X(o[0]+1,t,n);const c=l===n-1?l:l-1;let u;l=q(o[1]+1,t,r,i),i?(l=0===l?l:l+1,u=a,a=l):u=l===r-1?l:l-1;return{x:s,y:a,width:Math.max(c-s+1,1),height:Math.max(u-a+1,1)}}(e,n,r,i,t)}getPixelSize(){return this.getDevicePixelSize()}getAspect(){const[e,t]=this.getDevicePixelSize();return e/t}cssToDeviceRatio(){try{const[e]=this.getDrawingBufferSize(),[t]=this.getCSSSize();return t?e/t:1}catch{return 1}}resize(e){this.setDrawingBufferSize(e.width,e.height)}_setAutoCreatedCanvasId(e){"lumagl-auto-created-canvas"===this.htmlCanvas?.id&&(this.htmlCanvas.id=e)}_handleIntersection(e){const t=e.find(e=>e.target===this.canvas);if(!t)return;const n=t.isIntersecting;this.isVisible!==n&&(this.isVisible=n,this.device.props.onVisibilityChange(this))}_handleResize(e){const t=e.find(e=>e.target===this.canvas);if(!t)return;this.cssWidth=t.contentBoxSize[0].inlineSize,this.cssHeight=t.contentBoxSize[0].blockSize;const n=this.getDevicePixelSize(),r=t.devicePixelContentBoxSize?.[0].inlineSize||t.contentBoxSize[0].inlineSize*devicePixelRatio,i=t.devicePixelContentBoxSize?.[0].blockSize||t.contentBoxSize[0].blockSize*devicePixelRatio,[o,s]=this.getMaxDrawingBufferSize();this.devicePixelWidth=Math.max(1,Math.min(r,o)),this.devicePixelHeight=Math.max(1,Math.min(i,s)),this._updateDrawingBufferSize(),this.device.props.onResize(this,{oldPixelSize:n})}_updateDrawingBufferSize(){if(this.props.autoResize){if("number"==typeof this.props.useDevicePixels){const e=this.props.useDevicePixels;this.setDrawingBufferSize(this.cssWidth*e,this.cssHeight*e)}else this.props.useDevicePixels?this.setDrawingBufferSize(this.devicePixelWidth,this.devicePixelHeight):this.setDrawingBufferSize(this.cssWidth,this.cssHeight);this._updateDevice()}this._initializedResolvers.resolve(),this.isInitialized=!0,this.updatePosition()}_observeDevicePixelRatio(){const e=this.devicePixelRatio;this.devicePixelRatio=window.devicePixelRatio,this.updatePosition(),this.device.props.onDevicePixelRatioChange(this,{oldRatio:e}),matchMedia(`(resolution: ${this.devicePixelRatio}dppx)`).addEventListener("change",()=>this._observeDevicePixelRatio(),{once:!0})}_trackPosition(e=100){const t=setInterval(()=>{this.destroyed?clearInterval(t):this.updatePosition()},e)}updatePosition(){const e=this.htmlCanvas?.getBoundingClientRect();if(e){const t=[e.left,e.top];this._position??=t;if(t[0]!==this._position[0]||t[1]!==this._position[1]){const e=this._position;this._position=t,this.device.props.onPositionChange?.(this,{oldPosition:e})}}}}function X(e,t,n){return Math.min(Math.round(e*t),n-1)}function q(e,t,n,r){return r?Math.max(0,n-1-Math.round(e*t)):Math.min(Math.round(e*t),n-1)}var Y=n(806),K=n(6587);class Z extends Y.F{get[Symbol.toStringTag](){return"Framebuffer"}width;height;constructor(e,t={}){super(e,t,Z.defaultProps),this.width=this.props.width,this.height=this.props.height}clone(e){const t=this.colorAttachments.map(t=>t.texture.clone(e)),n=this.depthStencilAttachment&&this.depthStencilAttachment.texture.clone(e);return this.device.createFramebuffer({...this.props,colorAttachments:t,depthStencilAttachment:n})}resize(e){let t=!e;if(e){const[n,r]=Array.isArray(e)?e:[e.width,e.height];t=t||r!==this.height||n!==this.width,this.width=n,this.height=r}t&&(i.R.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(0===this.props.colorAttachments.length&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map((e,t)=>{if("string"==typeof e){const n=this.createColorTexture(e,t);return this.attachResource(n),n.view}return e instanceof K.g?e.view:e});const e=this.props.depthStencilAttachment;if(e)if("string"==typeof e){const t=this.createDepthStencilTexture(e);this.attachResource(t),this.depthStencilAttachment=t.view}else e instanceof K.g?this.depthStencilAttachment=e.view:this.depthStencilAttachment=e}createColorTexture(e,t){return this.device.createTexture({id:`${this.id}-color-attachment-${t}`,usage:K.g.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height,sampler:{magFilter:"linear",minFilter:"linear"}})}createDepthStencilTexture(e){return this.device.createTexture({id:`${this.id}-depth-stencil-attachment`,usage:K.g.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}resizeAttachments(e,t){for(let n=0;n(this._getCompilationStatus(),this.compilationStatus))}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){const e=this.device.gl.getShaderInfoLog(this.handle);return e?function(e){const t=e.split(/\r?\n/),n=[];for(const e of t){if(e.length<=1)continue;const t=e.split(":");if(2===t.length){const[e,r]=t;n.push({message:r.trim(),type:ae(e),lineNum:0,linePos:0});continue}const[r,i,o,...s]=t;let a=parseInt(o,10);isNaN(a)&&(a=0);let l=parseInt(i,10);isNaN(l)&&(l=0),n.push({message:s.join(":").trim(),type:ae(r),lineNum:a,linePos:l})}return n}(e):[]}getTranslatedSource(){const e=this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders;return e?.getTranslatedShaderSource(this.handle)||null}async _compile(e){e=e.startsWith("#version ")?e:`#version 300 es\n${e}`;const{gl:t}=this.device;if(t.shaderSource(this.handle,e),t.compileShader(this.handle),this.device.props.debug){if(this.device.features.has("compilation-status-async-webgl"))i.R.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),i.R.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader();else if(this._getCompilationStatus(),this.debugShader(),"error"===this.compilationStatus)throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`)}else this.compilationStatus="pending"}async _waitForCompilationComplete(){const e=async e=>await new Promise(t=>setTimeout(t,e));if(!this.device.features.has("compilation-status-async-webgl"))return void await e(10);const{gl:t}=this.device;for(;;){if(t.getShaderParameter(this.handle,37297))return;await e(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}}var ce=n(7372);function ue(e,t){const n=e,{gl:r}=n;if(t.cullMode)switch(t.cullMode){case"none":r.disable(2884);break;case"front":r.enable(2884),r.cullFace(1028);break;case"back":r.enable(2884),r.cullFace(1029)}if(t.frontFace&&r.frontFace(me("frontFace",t.frontFace,{ccw:2305,cw:2304})),t.unclippedDepth&&e.features.has("depth-clip-control")&&r.enable(34383),void 0!==t.depthBias&&(r.enable(32823),r.polygonOffset(t.depthBias,t.depthBiasSlopeScale||0)),t.provokingVertex&&e.features.has("provoking-vertex-webgl")){const e=n.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,r=me("provokingVertex",t.provokingVertex,{first:36429,last:36430});e?.provokingVertexWEBGL(r)}if((t.polygonMode||t.polygonOffsetLine)&&e.features.has("polygon-mode-webgl")){if(t.polygonMode){const e=n.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,r=me("polygonMode",t.polygonMode,{fill:6914,line:6913});e?.polygonModeWEBGL(1028,r),e?.polygonModeWEBGL(1029,r)}t.polygonOffsetLine&&r.enable(10754)}if(e.features.has("shader-clip-cull-distance-webgl")&&(t.clipDistance0&&r.enable(12288),t.clipDistance1&&r.enable(12289),t.clipDistance2&&r.enable(12290),t.clipDistance3&&r.enable(12291),t.clipDistance4&&r.enable(12292),t.clipDistance5&&r.enable(12293),t.clipDistance6&&r.enable(12294),t.clipDistance7&&r.enable(12295)),void 0!==t.depthWriteEnabled&&r.depthMask(t.depthWriteEnabled),t.depthCompare&&("always"!==t.depthCompare?r.enable(2929):r.disable(2929),r.depthFunc(de("depthCompare",t.depthCompare))),t.stencilWriteMask){const e=t.stencilWriteMask;r.stencilMaskSeparate(1028,e),r.stencilMaskSeparate(1029,e)}if(t.stencilReadMask&&i.R.warn("stencilReadMask not supported under WebGL"),t.stencilCompare){const e=t.stencilReadMask||4294967295,n=de("depthCompare",t.stencilCompare);"always"!==t.stencilCompare?r.enable(2960):r.disable(2960),r.stencilFuncSeparate(1028,n,0,e),r.stencilFuncSeparate(1029,n,0,e)}if(t.stencilPassOperation&&t.stencilFailOperation&&t.stencilDepthFailOperation){const e=he("stencilPassOperation",t.stencilPassOperation),n=he("stencilFailOperation",t.stencilFailOperation),i=he("stencilDepthFailOperation",t.stencilDepthFailOperation);r.stencilOpSeparate(1028,n,i,e),r.stencilOpSeparate(1029,n,i,e)}switch(t.blend){case!0:r.enable(3042);break;case!1:r.disable(3042)}if(t.blendColorOperation||t.blendAlphaOperation){const e=fe("blendColorOperation",t.blendColorOperation||"add"),n=fe("blendAlphaOperation",t.blendAlphaOperation||"add");r.blendEquationSeparate(e,n);const i=pe("blendColorSrcFactor",t.blendColorSrcFactor||"one"),o=pe("blendColorDstFactor",t.blendColorDstFactor||"zero"),s=pe("blendAlphaSrcFactor",t.blendAlphaSrcFactor||"one"),a=pe("blendAlphaDstFactor",t.blendAlphaDstFactor||"zero");r.blendFuncSeparate(i,o,s,a)}}function de(e,t){return me(e,t,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function he(e,t){return me(e,t,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function fe(e,t){return me(e,t,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function pe(e,t,n="color"){return me(e,t,{one:1,zero:0,src:768,"one-minus-src":769,dst:774,"one-minus-dst":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,constant:"color"===n?32769:32771,"one-minus-constant":"color"===n?32770:32772,src1:768,"one-minus-src1":769,"src1-alpha":770,"one-minus-src1-alpha":771})}function me(e,t,n){if(!(t in n))throw new Error(function(e,t){return`Illegal parameter ${t} for ${e}`}(e,t));return n[t]}function ge(e){let t=!0; // @ts-ignore key is unused for(const n in e){t=!1;break}return t}function _e(e){const t={};return e.addressModeU&&(t[10242]=ye(e.addressModeU)),e.addressModeV&&(t[10243]=ye(e.addressModeV)),e.addressModeW&&(t[32882]=ye(e.addressModeW)),e.magFilter&&(t[10240]=be(e.magFilter)),(e.minFilter||e.mipmapFilter)&&(t[10241]=function(e,t="none"){if(!t)return be(e);switch(t){case"none":return be(e);case"nearest":switch(e){case"nearest":return 9984;case"linear":return 9985}break;case"linear":switch(e){case"nearest":return 9986;case"linear":return 9987}}}(e.minFilter||"linear",e.mipmapFilter)),void 0!==e.lodMinClamp&&(t[33082]=e.lodMinClamp),void 0!==e.lodMaxClamp&&(t[33083]=e.lodMaxClamp),"comparison-sampler"===e.type&&(t[34892]=34894),e.compare&&(t[34893]=de("compare",e.compare)),e.maxAnisotropy&&(t[34046]=e.maxAnisotropy),t}function ye(e){switch(e){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function be(e){switch(e){case"nearest":return 9728;case"linear":return 9729}}class ve extends ce.L{device;handle;parameters;constructor(e,t){super(e,t),this.device=e,this.parameters=_e(t),this.handle=t.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle), // @ts-expect-error read-only/undefined this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(e){for(const[t,n]of Object.entries(e)){const e=Number(t);switch(e){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,e,n);break;default:this.device.gl.samplerParameteri(this.handle,e,n)}}}}function xe(e,t,n){if(function(e){ // @ts-ignore - dummy key variable for(const t in e)return!1;return!0}(t))return n(e);const{nocatch:r=!0}=t,i=S.get(e);let o;if(i.push(),b(e,t),r)o=n(e),i.pop();else try{o=n(e)}finally{i.pop()}return o}var we=n(2593);class Se extends we.X{device;gl;handle;texture;constructor(e,t){super(e,{...K.g.defaultProps,...t}),this.device=e,this.gl=this.device.gl,this.handle=null,this.texture=t.texture}}class Ee extends K.g{device;gl;handle; // @ts-ignore TODO - currently unused in WebGL. Create dummy sampler? sampler=void 0;view;glTarget;glFormat;glType;glInternalFormat;compressed;_textureUnit=0;constructor(e,t){super(e,t),this.device=e,this.gl=this.device.gl;const n=U(this.props.format);this.glTarget=function(e){switch(e){case"1d":case"cube-array":break;case"2d":return 3553;case"3d":return 32879;case"cube":return 34067;case"2d-array":return 35866}throw new Error(e)}(this.props.dimension),this.glInternalFormat=n.internalFormat,this.glFormat=n.format,this.glType=n.type,this.compressed=n.compressed,this.handle=this.props.handle||this.gl.createTexture(),this.device._setWebGLDebugMetadata(this.handle,this,{spector:this.props}),this.gl.bindTexture(this.glTarget,this.handle);const{dimension:r,width:i,height:o,depth:s,mipLevels:a,glTarget:l,glInternalFormat:c}=this;switch(r){case"2d":case"cube":this.gl.texStorage2D(l,a,c,i,o);break;case"2d-array":case"3d":this.gl.texStorage3D(l,a,c,i,o,s);break;default:throw new Error(r)}this.gl.bindTexture(this.glTarget,null),this._initializeData(t.data),this.setSampler(this.props.sampler), // @ts-ignore TODO - fix types this.view=new Se(this.device,{...this.props,texture:this}),Object.seal(this)}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}createView(e){return new Se(this.device,{...e,texture:this})}setSampler(e={}){super.setSampler(e);const t=_e(this.sampler.props);this._setSamplerParameters(t)}copyImageData(e){const t=this._normalizeCopyImageDataOptions(e),n=t.data,{width:r,height:i,depth:o}=this,{mipLevel:s=0,byteOffset:a=0,x:l=0,y:c=0,z:u=0}=t,{glFormat:d,glType:h,compressed:f}=this,p=Te(this.glTarget,this.dimension,u);let m;if(!this.compressed){const{bytesPerPixel:e}=this.device.getTextureFormatInfo(this.format);if(e){if(t.bytesPerRow%e!==0)throw new Error(`bytesPerRow (${t.bytesPerRow}) must be a multiple of bytesPerPixel (${e}) for ${this.format}`);m=t.bytesPerRow/e}}const g=this.compressed?{}:{...void 0!==m?{3314:m}:{},32878:t.rowsPerImage};this.gl.bindTexture(p,this.handle),xe(this.gl,g,()=>{switch(this.dimension){case"2d":case"cube":f?this.gl.compressedTexSubImage2D(p,s,l,c,r,i,d,n,a):this.gl.texSubImage2D(p,s,l,c,r,i,d,h,n,a);break;case"2d-array":case"3d":f?this.gl.compressedTexSubImage3D(p,s,l,c,u,r,i,o,d,n,a):this.gl.texSubImage3D(p,s,l,c,u,r,i,o,d,h,n,a)}}),this.gl.bindTexture(p,null)}copyExternalImage(e){const t=this._normalizeCopyExternalImageOptions(e);if(t.sourceX||t.sourceY)throw new Error("WebGL does not support sourceX/sourceY)");const{glFormat:n,glType:r}=this,{image:i,depth:o,mipLevel:s,x:a,y:l,z:c,width:u,height:d}=t,h=Te(this.glTarget,this.dimension,o),f=t.flipY?{37440:!0}:{};return this.gl.bindTexture(this.glTarget,this.handle),xe(this.gl,f,()=>{switch(this.dimension){case"2d":case"cube":this.gl.texSubImage2D(h,s,a,l,u,d,n,r,i);break;case"2d-array":case"3d":this.gl.texSubImage3D(h,s,a,l,c,u,d,o,n,r,i)}}),this.gl.bindTexture(this.glTarget,null),{width:t.width,height:t.height}}generateMipmapsWebGL(e){if(this.device.isTextureFormatRenderable(this.props.format)&&this.device.isTextureFormatFilterable(this.props.format)||(i.R.warn(`${this} is not renderable or filterable, may not be able to generate mipmaps`)(),e?.force))try{this.gl.bindTexture(this.glTarget,this.handle),this.gl.generateMipmap(this.glTarget)}catch(e){i.R.warn(`Error generating mipmap for ${this}: ${e.message}`)()}finally{this.gl.bindTexture(this.glTarget,null)}}_setSamplerParameters(e){i.R.log(2,`${this.id} sampler parameters`,this.device.getGLKeys(e))(),this.gl.bindTexture(this.glTarget,this.handle);for(const[t,n]of Object.entries(e)){const e=Number(t),r=n;switch(e){case 33082:case 33083:this.gl.texParameterf(this.glTarget,e,r);break;case 10240:case 10241:case 10242:case 10243:case 32882:case 34892:case 34893:this.gl.texParameteri(this.glTarget,e,r);break;case 34046:this.device.features.has("texture-filterable-anisotropic-webgl")&&this.gl.texParameteri(this.glTarget,e,r)}}this.gl.bindTexture(this.glTarget,null)}_getActiveUnit(){return this.gl.getParameter(34016)-33984}_bind(e){const{gl:t}=this; // @ts-ignore TODO fix types return void 0!==e&&(this._textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.glTarget,this.handle),e}_unbind(e){const{gl:t}=this;return void 0!==e&&(this._textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.glTarget,null),e}}function Te(e,t,n){return"cube"===t?34069+n:e}var ke=n(25),Ae=n(1976);function Ce(e){return Le[e]}function Re(e){ // @ts-ignore TODO return Boolean(Pe[e])}function Ie(e){return Pe[e]} // @ts-ignore TODO - fix the type confusion here const Le={5126:"f32",35664:"vec2",35665:"vec3",35666:"vec4",5124:"i32",35667:"vec2",35668:"vec3",35669:"vec4",5125:"u32",36294:"vec2",36295:"vec3",36296:"vec4",35670:"f32",35671:"vec2",35672:"vec3",35673:"vec4",35674:"mat2x2",35685:"mat2x3",35686:"mat2x4",35687:"mat3x2",35675:"mat3x3",35688:"mat3x4",35689:"mat4x2",35690:"mat4x3",35676:"mat4x4"},Pe={35678:{viewDimension:"2d",sampleType:"float"},35680:{viewDimension:"cube",sampleType:"float"},35679:{viewDimension:"3d",sampleType:"float"},35682:{viewDimension:"3d",sampleType:"depth"},36289:{viewDimension:"2d-array",sampleType:"float"},36292:{viewDimension:"2d-array",sampleType:"depth"},36293:{viewDimension:"cube",sampleType:"float"},36298:{viewDimension:"2d",sampleType:"sint"},36299:{viewDimension:"3d",sampleType:"sint"},36300:{viewDimension:"cube",sampleType:"sint"},36303:{viewDimension:"2d-array",sampleType:"uint"},36306:{viewDimension:"2d",sampleType:"uint"},36307:{viewDimension:"3d",sampleType:"uint"},36308:{viewDimension:"cube",sampleType:"uint"},36311:{viewDimension:"2d-array",sampleType:"uint"}},Ne={uint8:5121,sint8:5120,unorm8:5121,snorm8:5120,uint16:5123,sint16:5122,unorm16:5123,snorm16:5122,uint32:5125,sint32:5124,float16:5131,float32:5126};function Me(e,t){const n={attributes:[],bindings:[]};n.attributes=function(e,t){const n=[],r=e.getProgramParameter(t,35721);for(let i=0;i=0){const e=Ce(s),t=/instance/i.test(o)?"instance":"vertex";n.push({name:o,location:a,stepMode:t,type:e})}}return n.sort((e,t)=>e.location-t.location),n}(e,t);const r=function(e,t){const n=(n,r)=>e.getActiveUniformBlockParameter(t,n,r),r=[],i=e.getProgramParameter(t,35382);for(let o=0;oe.location-t.location),r}(e,t);for(const e of r){const t=e.uniforms.map(e=>({name:e.name,format:e.format,byteOffset:e.byteOffset,byteStride:e.byteStride,arrayLength:e.arrayLength}));n.bindings.push({type:"uniform",name:e.name,group:0,location:e.location,visibility:(e.vertex?1:0)&(e.fragment?2:0),minBindingSize:e.byteLength,uniforms:t})}const i=function(e,t){const n=[],r=e.getProgramParameter(t,35718);for(let i=0;i1)for(let r=0;re.location-t.location),n}(e,t);return s?.length&&(n.varyings=s),n}function Oe(e){if("]"!==e[e.length-1])return{name:e,length:1,isArray:!1};const t=/([^[]*)(\[[0-9]+\])?/.exec(e);if(!t||t.length<2)throw new Error(`Failed to parse GLSL uniform name ${e}`);return{name:t[1],length:t[2]?1:0,isArray:Boolean(t[2])}}function De(e,t,n,r){const i=e;let o=r;!0===o&&(o=1),!1===o&&(o=0);const s="number"==typeof o?[o]:o;switch(n){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("number"!=typeof r)throw new Error("samplers must be set to integers");return e.uniform1i(t,r);case 5126:return e.uniform1fv(t,s);case 35664:return e.uniform2fv(t,s);case 35665:return e.uniform3fv(t,s);case 35666:return e.uniform4fv(t,s);case 5124:case 35670:return e.uniform1iv(t,s);case 35667:case 35671:return e.uniform2iv(t,s);case 35668:case 35672:return e.uniform3iv(t,s);case 35669:case 35673:return e.uniform4iv(t,s);case 5125:return i.uniform1uiv(t,s,1);case 36294:return i.uniform2uiv(t,s,2);case 36295:return i.uniform3uiv(t,s,3);case 36296:return i.uniform4uiv(t,s,4);case 35674:return e.uniformMatrix2fv(t,!1,s);case 35675:return e.uniformMatrix3fv(t,!1,s);case 35676:return e.uniformMatrix4fv(t,!1,s);case 35685:return i.uniformMatrix2x3fv(t,!1,s);case 35686:return i.uniformMatrix2x4fv(t,!1,s);case 35687:return i.uniformMatrix3x2fv(t,!1,s);case 35688:return i.uniformMatrix3x4fv(t,!1,s);case 35689:return i.uniformMatrix4x2fv(t,!1,s);case 35690:return i.uniformMatrix4x3fv(t,!1,s)}throw new Error("Illegal uniform")}class Fe extends ke.r{device;handle;vs;fs;introspectedLayout;uniforms={};bindings={};varyings=null;_uniformCount=0;_uniformSetters={};get[Symbol.toStringTag](){return"WEBGLRenderPipeline"}constructor(e,t){super(e,t),this.device=e,this.handle=this.props.handle||this.device.gl.createProgram(),this.device._setWebGLDebugMetadata(this.handle,this,{spector:{id:this.props.id}}),this.vs=t.vs,this.fs=t.fs; // @ts-expect-error WebGL only const{varyings:n,bufferMode:r=35981}=t;n&&n.length>0&&(this.varyings=n,this.device.gl.transformFeedbackVaryings(this.handle,n,r)),this._linkShaders(),i.R.time(3,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=Me(this.device.gl,this.handle),i.R.timeEnd(3,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=t.shaderLayout?function(e,t){const n={...e,attributes:e.attributes.map(e=>({...e}))};for(const e of t?.attributes||[]){const t=n.attributes.find(t=>t.name===e.name);t?(t.type=e.type||t.type,t.stepMode=e.stepMode||t.stepMode):i.R.warn(`shader layout attribute ${e.name} not present in shader`)}return n}(this.introspectedLayout,t.shaderLayout):this.introspectedLayout}destroy(){this.handle&&(this.device.gl.useProgram(null),this.device.gl.deleteProgram(this.handle),this.destroyed=!0, // @ts-expect-error this.handle.destroyed=!0, // @ts-ignore this.handle=null)}setBindings(e,t){for(const[n,r]of Object.entries(e)){const e=this.shaderLayout.bindings.find(e=>e.name===n)||this.shaderLayout.bindings.find(e=>e.name===`${n}Uniforms`);if(!e){const e=this.shaderLayout.bindings.map(e=>`"${e.name}"`).join(", ");t?.disableWarnings||i.R.warn(`No binding "${n}" in render pipeline "${this.id}", expected one of ${e}`,r)();continue}switch(r||i.R.warn(`Unsetting binding "${n}" in render pipeline "${this.id}"`)(),e.type){case"uniform": // @ts-expect-error if(!(r instanceof oe||r.buffer instanceof oe))throw new Error("buffer value");break;case"texture":if(!(r instanceof Se||r instanceof Ee||r instanceof Q))throw new Error(`${this} Bad texture binding for ${n}`);break;case"sampler":i.R.warn(`Ignoring sampler ${n}`)();break;default:throw new Error(e.type)}this.bindings[n]=r}}draw(e){const{renderPass:t,parameters:n=this.props.parameters,topology:r=this.props.topology,vertexArray:o,vertexCount:s,instanceCount:a,isInstanced:l=!1,firstVertex:c=0,transformFeedback:u}=e,d=function(e){switch(e){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"triangle-list":return 4;case"triangle-strip":return 5;default:throw new Error(e)}}(r),h=Boolean(o.indexBuffer),f=o.indexBuffer?.glIndexType;if("success"!==this.linkStatus)return i.R.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable())return i.R.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;this.device.gl.useProgram(this.handle),o.bindBeforeRender(t),u&&u.begin(this.props.topology),this._applyBindings(),this._applyUniforms();const p=t;return function(e,t,n,r){if(ge(t))return r(e);const i=e;i.pushState();try{return ue(e,t),b(i.gl,n),r(e)}finally{i.popState()}}(this.device,n,p.glParameters,()=>{h&&l?this.device.gl.drawElementsInstanced(d,s||0,f,c,a||0):h?this.device.gl.drawElements(d,s||0,f,c):l?this.device.gl.drawArraysInstanced(d,c,s||0,a||0):this.device.gl.drawArrays(d,c,s||0),u&&u.end()}),o.unbindAfterRender(t),!0}async _linkShaders(){const{gl:e}=this.device;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),i.R.time(4,`linkProgram for ${this.id}`)(),e.linkProgram(this.handle),i.R.timeEnd(4,`linkProgram for ${this.id}`)(),i.R.level,!this.device.features.has("compilation-status-async-webgl")){const e=this._getLinkStatus();return void this._reportLinkStatus(e)}i.R.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),i.R.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();const t=this._getLinkStatus();this._reportLinkStatus(t)}async _reportLinkStatus(e){if("success"!==e){const t="link-error"===e?"Link error":"Validation error";switch(this.vs.compilationStatus){case"error":throw this.vs.debugShader(),new Error(`${this} ${t} during compilation of ${this.vs}`);case"pending":await this.vs.asyncCompilationStatus,this.vs.debugShader()}switch(this.fs?.compilationStatus){case"error":throw this.fs.debugShader(),new Error(`${this} ${t} during compilation of ${this.fs}`);case"pending":await this.fs.asyncCompilationStatus,this.fs.debugShader()}const n=this.device.gl.getProgramInfoLog(this.handle);this.device.reportError(new Error(`${t} during ${e}: ${n}`),this)(),this.device.debug()}}_getLinkStatus(){const{gl:e}=this.device;if(!e.getProgramParameter(this.handle,35714))return this.linkStatus="error","link-error";e.validateProgram(this.handle);return e.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation-error")}async _waitForLinkComplete(){const e=async e=>await new Promise(t=>setTimeout(t,e));if(!this.device.features.has("compilation-status-async-webgl"))return void await e(10);const{gl:t}=this.device;for(;;){if(t.getProgramParameter(this.handle,37297))return;await e(10)}}_areTexturesRenderable(){let e=!0;for(const t of this.shaderLayout.bindings)this.bindings[t.name]||this.bindings[t.name.replace(/Uniforms$/,"")]||(i.R.warn(`Binding ${t.name} not found in ${this.id}`)(),e=!1);return e}_applyBindings(){if("success"!==this.linkStatus)return;const{gl:e}=this.device;e.useProgram(this.handle);let t=0,n=0;for(const r of this.shaderLayout.bindings){const o=this.bindings[r.name]||this.bindings[r.name.replace(/Uniforms$/,"")];if(!o)throw new Error(`No value for binding ${r.name} in ${this.id}`);switch(r.type){case"uniform":const{name:s}=r,a=e.getUniformBlockIndex(this.handle,s);if(4294967295===a)throw new Error(`Invalid uniform block name ${s}`);e.uniformBlockBinding(this.handle,n,a),o instanceof oe?e.bindBufferBase(35345,n,o.handle):e.bindBufferRange(35345,n, // @ts-expect-error o.buffer.handle, // @ts-expect-error o.offset||0, // @ts-expect-error o.size||o.buffer.byteLength-o.offset),n+=1;break;case"texture":if(!(o instanceof Se||o instanceof Ee||o instanceof Q))throw new Error("texture");let l;if(o instanceof Se)l=o.texture;else if(o instanceof Ee)l=o;else{if(!(o instanceof Q&&o.colorAttachments[0]instanceof Se))throw new Error("No texture");i.R.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),l=o.colorAttachments[0].texture}e.activeTexture(33984+t),e.bindTexture(l.glTarget,l.handle),t+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${r.type}' not supported in WebGL`)}}}_applyUniforms(){for(const e of this.shaderLayout.uniforms||[]){const{name:t,location:n,type:r,textureUnit:i}=e,o=this.uniforms[t]??i;void 0!==o&&De(this.device.gl,n,r,o)}}}class Be extends Y.F{get[Symbol.toStringTag](){return"CommandEncoder"}constructor(e,t){super(e,t,Be.defaultProps)}static defaultProps={...Y.F.defaultProps,measureExecutionTime:void 0}}class Ue extends Y.F{get[Symbol.toStringTag](){return"CommandBuffer"}constructor(e,t){super(e,t,Ue.defaultProps)}static defaultProps={...Y.F.defaultProps}}class ze extends Ue{device;handle=null;commands=[];constructor(e){super(e,{}),this.device=e}_executeCommands(e=this.commands){for(const t of e)switch(t.name){case"copy-buffer-to-buffer":$e(this.device,t.options);break;case"copy-buffer-to-texture":Ge(this.device,t.options);break;case"copy-texture-to-buffer":je(this.device,t.options);break;case"copy-texture-to-texture":Ve(this.device,t.options);break;default:throw new Error(t.name)}}}function $e(e,t){const n=t.sourceBuffer,r=t.destinationBuffer;e.gl.bindBuffer(36662,n.handle),e.gl.bindBuffer(36663,r.handle),e.gl.copyBufferSubData(36662,36663,t.sourceOffset??0,t.destinationOffset??0,t.size),e.gl.bindBuffer(36662,null),e.gl.bindBuffer(36663,null)}function Ge(e,t){throw new Error("Not implemented")}function je(e,t){const{sourceTexture:n,mipLevel:r=0,aspect:i="all",width:o=t.sourceTexture.width,height:s=t.sourceTexture.height,depthOrArrayLayers:a=0,origin:l=[0,0],destinationBuffer:c,byteOffset:u=0,bytesPerRow:d,rowsPerImage:h}=t;if("all"!==i)throw new Error("aspect not supported in WebGL");if(0!==r||0!==a||d||h)throw new Error("not implemented");const{framebuffer:f,destroyFramebuffer:p}=We(n);let m;try{const t=c,n=o||f.width,r=s||f.height,i=U(f.colorAttachments[0].texture.props.format),a=i.format,d=i.type;e.gl.bindBuffer(35051,t.handle), // @ts-expect-error native bindFramebuffer is overridden by our state tracker m=e.gl.bindFramebuffer(36160,f.handle),e.gl.readPixels(l[0],l[1],n,r,a,d,u)}finally{e.gl.bindBuffer(35051,null),void 0!==m&&e.gl.bindFramebuffer(36160,m),p&&f.destroy()}}function Ve(e,t){const{sourceTexture:n,destinationMipLevel:r=0,origin:i=[0,0],destinationOrigin:o=[0,0],destinationTexture:s}=t;let{width:a=t.destinationTexture.width,height:l=t.destinationTexture.height}=t;const{framebuffer:c,destroyFramebuffer:u}=We(n),[d,h]=i,[f,p,m]=o,g=e.gl.bindFramebuffer(36160,c.handle);let _,y;if(!(s instanceof Ee))throw new Error("invalid destination");switch(_=s,a=Number.isFinite(a)?a:_.width,l=Number.isFinite(l)?l:_.height,_._bind(0),y=_.glTarget,y){case 3553:case 34067:e.gl.copyTexSubImage2D(y,r,f,p,d,h,a,l);break;case 35866:case 32879:e.gl.copyTexSubImage3D(y,r,f,p,m,d,h,a,l)}_&&_._unbind(),e.gl.bindFramebuffer(36160,g),u&&c.destroy()}function We(e){if(e instanceof K.g){const{width:t,height:n,id:r}=e;return{framebuffer:e.device.createFramebuffer({id:`framebuffer-for-${r}`,width:t,height:n,colorAttachments:[e]}),destroyFramebuffer:!0}}return{framebuffer:e,destroyFramebuffer:!1}}class He extends Y.F{static defaultClearColor=[0,0,0,1];static defaultClearDepth=1;static defaultClearStencil=0;get[Symbol.toStringTag](){return"RenderPass"}constructor(e,t){super(e,t=He.normalizeProps(e,t),He.defaultProps)}static normalizeProps(e,t){return t}static defaultProps={...Y.F.defaultProps,framebuffer:null,parameters:void 0,clearColor:He.defaultClearColor,clearColors:void 0,clearDepth:He.defaultClearDepth,clearStencil:He.defaultClearStencil,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0}}const Xe=[1,2,4,8];class qe extends He{device;handle=null;glParameters={};constructor(e,t){let n;if(super(e,t),this.device=e,!t?.parameters?.viewport)if(t?.framebuffer){const{width:e,height:r}=t.framebuffer;n=[0,0,e,r]}else{const[t,r]=e.getDefaultCanvasContext().getDrawingBufferSize();n=[0,0,t,r]}this.device.pushState(),this.setParameters({viewport:n,...this.props.parameters});const r=this.props.framebuffer;if(this.props.framebuffer&&r?.handle){const e=this.props.framebuffer.colorAttachments.map((e,t)=>36064+t);this.device.gl.drawBuffers(e)}else this.device.gl.drawBuffers([1029]);this.clear()}end(){this.device.popState()}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}setParameters(e={}){const t={...this.glParameters};t.framebuffer=this.props.framebuffer||null,this.props.depthReadOnly&&(t.depthMask=!this.props.depthReadOnly),t.stencilMask=this.props.stencilReadOnly?0:1,t[35977]=this.props.discard,e.viewport&&(e.viewport.length>=6?(t.viewport=e.viewport.slice(0,4),t.depthRange=[e.viewport[4],e.viewport[5]]):t.viewport=e.viewport),e.scissorRect&&(t.scissorTest=!0,t.scissor=e.scissorRect),e.blendConstant&&(t.blendColor=e.blendConstant),e.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),t[2967]=e.stencilReference),"colorMask"in e&&(t.colorMask=Xe.map(t=>Boolean(t&e.colorMask))),this.glParameters=t,b(this.device.gl,t)}beginOcclusionQuery(e){const t=this.props.occlusionQuerySet;t?.beginOcclusionQuery()}endOcclusionQuery(){const e=this.props.occlusionQuerySet;e?.endOcclusionQuery()}clear(){const e={...this.glParameters};let t=0;this.props.clearColors&&this.props.clearColors.forEach((e,t)=>{e&&this.clearColorBuffer(t,e)}),!1!==this.props.clearColor&&void 0===this.props.clearColors&&(t|=16384,e.clearColor=this.props.clearColor),!1!==this.props.clearDepth&&(t|=256,e.clearDepth=this.props.clearDepth),!1!==this.props.clearStencil&&(t|=1024,e.clearStencil=this.props.clearStencil),0!==t&&xe(this.device.gl,e,()=>{this.device.gl.clear(t)})}clearColorBuffer(e=0,t=[0,0,0,0]){xe(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:this.device.gl.clearBufferiv(6144,e,t);break;case Uint8Array:case Uint8ClampedArray:case Uint16Array:case Uint32Array:this.device.gl.clearBufferuiv(6144,e,t);break;case Float32Array:this.device.gl.clearBufferfv(6144,e,t);break;default:throw new Error("clearColorBuffer: color must be typed array")}})}}class Ye extends Be{device;handle=null;commandBuffer;constructor(e,t){super(e,t),this.device=e,this.commandBuffer=new ze(e)}destroy(){}finish(){return this.commandBuffer}beginRenderPass(e){return new qe(this.device,e)}beginComputePass(e){throw new Error("ComputePass not supported in WebGL")}copyBufferToBuffer(e){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:e})}copyBufferToTexture(e){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:e})}copyTextureToBuffer(e){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:e})}copyTextureToTexture(e){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:e})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}resolveQuerySet(e,t,n){}}var Ke=n(8854);class Ze extends Y.F{static defaultProps={...Y.F.defaultProps,shaderLayout:void 0,bufferLayout:[]};get[Symbol.toStringTag](){return"VertexArray"}maxVertexAttributes;attributeInfos;indexBuffer=null;attributes;constructor(e,t){super(e,t,Ze.defaultProps),this.maxVertexAttributes=e.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null),this.attributeInfos=(0,Ke.M)(t.shaderLayout,t.bufferLayout,this.maxVertexAttributes)}setConstantWebGL(e,t){this.device.reportError(new Error("constant attributes not supported"),this)()}}var Qe=n(8049),Je=n(2754),et=n(7911);class tt extends Ze{get[Symbol.toStringTag](){return"VertexArray"}device;handle;buffer=null;bufferValue=null;static isConstantAttributeZeroSupported(e){return"Chrome"==(t||(0,V.B)()?(0,Je.b)(t)?"Electron":(t||et.gM.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node");var t}constructor(e,t){super(e,t),this.device=e,this.handle=this.device.gl.createVertexArray()}destroy(){super.destroy(),this.buffer&&this.buffer?.destroy(),this.handle&&(this.device.gl.deleteVertexArray(this.handle), // @ts-expect-error read-only/undefined this.handle=void 0)}setIndexBuffer(e){const t=e;if(t&&34963!==t.glTarget)throw new Error("Use .setBuffer()");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,t?t.handle:null),this.indexBuffer=t,this.device.gl.bindVertexArray(null)}setBuffer(e,t){const n=t;if(34963===n.glTarget)throw new Error("Use .setIndexBuffer()");const{size:r,type:i,stride:o,offset:s,normalized:a,integer:l,divisor:c}=this._getAccessor(e);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,n.handle),l?this.device.gl.vertexAttribIPointer(e,r,i,o,s):this.device.gl.vertexAttribPointer(e,r,i,a,o,s),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(e),this.device.gl.vertexAttribDivisor(e,c||0),this.attributes[e]=n,this.device.gl.bindVertexArray(null)}setConstantWebGL(e,t){this._enable(e,!1),this.attributes[e]=t}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let e=0;e{for(const t in e)this.setBuffer(t,e[t])})}setBuffer(e,t){const n=this._getVaryingIndex(e),{buffer:r,byteLength:o,byteOffset:s}=this._getBufferRange(t);if(n<0)return this.unusedBuffers[e]=r,void i.R.warn(`${this.id} unusedBuffers varying buffer ${e}`)();this.buffers[n]={buffer:r,byteLength:o,byteOffset:s},this.bindOnUse||this._bindBuffer(n,r,s,o)}getBuffer(e){if(it(e))return this.buffers[e]||null;const t=this._getVaryingIndex(e);return t>=0?this.buffers[t]:null}bind(e=this.handle){if("function"!=typeof e)return this.gl.bindTransformFeedback(36386,e),this;let t;return this._bound?t=e():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,t=e(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),t}unbind(){this.bind(null)}_getBufferRange(e){if(e instanceof oe)return{buffer:e,byteOffset:0,byteLength:e.byteLength}; // @ts-expect-error Must be a BufferRange. const{buffer:t,byteOffset:n=0,byteLength:r=e.buffer.byteLength}=e;return{buffer:t,byteOffset:n,byteLength:r}}_getVaryingIndex(e){if(it(e))return Number(e);for(const t of this.layout.varyings||[])if(e===t.name)return t.location;return-1}_bindBuffers(){for(const e in this.buffers){const{buffer:t,byteLength:n,byteOffset:r}=this._getBufferRange(this.buffers[e]);this._bindBuffer(Number(e),t,r,n)}}_unbindBuffers(){for(const e in this.buffers)this.gl.bindBufferBase(35982,Number(e),null)}_bindBuffer(e,t,n=0,r){const i=t&&t.handle;i&&void 0!==r?this.gl.bindBufferRange(35982,e,i,n,r):this.gl.bindBufferBase(35982,e,i)}}function it(e){return"number"==typeof e?Number.isInteger(e):/^\d+$/.test(e)}class ot extends Y.F{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,t){super(e,t,ot.defaultProps)}static defaultProps={...Y.F.defaultProps,type:void 0,count:void 0}}class st extends ot{device;handle;target=null;_queryPending=!1;_pollingPromise=null;get[Symbol.toStringTag](){return"Query"}constructor(e,t){if(super(e,t),this.device=e,t.count>1)throw new Error("WebGL QuerySet can only have one value");const n=this.device.gl.createQuery();if(!n)throw new Error("WebGL query not supported");this.handle=n,Object.seal(this)}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(e){return this._begin(e?.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(e){this._queryPending||(this.target=e,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;const e=this.device.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((n,r)=>{const i=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(i)};requestAnimationFrame(i)}),this._pollingPromise}}var at=n(3189);function lt(e){switch(e){case 6406:case 33326:case 6403:case 36244:return 1;case 33339:case 33340:case 33328:case 33320:case 33319:return 2;case 6407:case 36248:case 34837:return 3;case 6408:case 36249:case 34836:return 4;default:return 0}}const ct={5124:"sint32",5125:"uint32",5122:"sint16",5123:"uint16",5120:"sint8",5121:"uint8",5126:"float32",5131:"float16",33635:"uint16",32819:"uint16",32820:"uint16",33640:"uint32",35899:"uint32",35902:"uint32",34042:"uint32",36269:"uint32"};function ut(e,t){const{sourceX:n=0,sourceY:r=0,sourceAttachment:i=0}=t||{};let{target:o=null,sourceWidth:s,sourceHeight:a,sourceDepth:l,sourceFormat:c,sourceType:u}=t||{};const{framebuffer:d,deleteFramebuffer:h}=dt(e),{gl:f,handle:p}=d;s||=d.width,a||=d.height;const m=d.colorAttachments[i]?.texture;if(!m)throw new Error(`Invalid framebuffer attachment ${i}`);l=m?.depth||1,c||=m?.glFormat||6408,u||=m?.glType||5121,o=function(e,t,n,r,i){if(e)return e;t||=5121;const o=(l=t,ct[l]),s=(0,at.Ak)(o),a=lt(n);var l;return new s(r*i*a)}(o,u,c,s,a);const g=(0,at.h1)(o);u=u||Ne[g];const _=f.bindFramebuffer(36160,p);return f.readBuffer(36064+i),f.readPixels(n,r,s,a,c,u,o),f.readBuffer(36064),f.bindFramebuffer(36160,_||null),h&&d.destroy(),o}function dt(e){return e instanceof Z?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:ht(e),deleteFramebuffer:!0}}function ht(e,t){const{device:n,width:r,height:i,id:o}=e;return n.createFramebuffer({...t,id:`framebuffer-for-${o}`,width:r,height:i,colorAttachments:[e]})}class ft extends r.pF{type="webgl";handle;features;limits;info;canvasContext;preferredColorFormat="rgba8unorm";preferredDepthFormat="depth24plus";commandEncoder;lost;_resolveContextLost;gl; // @ts-ignore TODO fix _constants;_extensions={};_polyfilled=!1;spectorJS;get[Symbol.toStringTag](){return"WebGLDevice"}toString(){return`${this[Symbol.toStringTag]}(${this.id})`}isVertexFormatSupported(e){return"unorm8x4-bgra"!==e}constructor(e){super({...e,id:e.id||re("webgl-device")});const t=r.pF._getCanvasContextProps(e);if(!t)throw new Error("WebGLDevice requires props.createCanvasContext to be set"); // @ts-expect-error device is attached to context let n=t.canvas?.gl?.device;if(n)throw new Error(`WebGL context already attached to device ${n.id}`);this.canvasContext=new J(this,t),this.lost=new Promise(e=>{this._resolveContextLost=e});const o={...e.webgl};"premultiplied"===t.alphaMode&&(o.premultipliedAlpha=!0),void 0!==e.powerPreference&&(o.powerPreference=e.powerPreference);const s=this.props._handle||function(e,t,n){let r="";const i={preserveDrawingBuffer:!0,...n};let o=null;if(o||=e.getContext("webgl2",i),i.failIfMajorPerformanceCaveat&&(r||="Only software GPU is available. Set `failIfMajorPerformanceCaveat: false` to allow."),o||n.failIfMajorPerformanceCaveat||(i.failIfMajorPerformanceCaveat=!1,o=e.getContext("webgl2",i), // @ts-expect-error o.luma||={}, // @ts-expect-error o.luma.softwareRenderer=!0),o||(o=e.getContext("webgl",{}),o&&(o=null,r||="Your browser only supports WebGL1")),!o)throw r||="Your browser does not support WebGL",new Error(`Failed to create WebGL context: ${r}`);const{onContextLost:s,onContextRestored:a}=t;return e.addEventListener("webglcontextlost",e=>s(e),!1),e.addEventListener("webglcontextrestored",e=>a(e),!1), // @ts-expect-error o.luma||={},o}(this.canvasContext.canvas,{onContextLost:e=>this._resolveContextLost?.({reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."}),onContextRestored:e=>console.log("WebGL context restored")},o);if(!s)throw new Error("WebGL context creation failed"); // @ts-expect-error luma.gl stores a device reference on the context. if(n=s.device,n){if(e._reuseDevices)return i.R.log(1,`Not creating a new Device, instead returning a reference to Device ${n.id} already attached to WebGL context`,n)(),n._reused=!0,n;throw new Error(`WebGL context already attached to device ${n.id}`)}this.handle=s,this.gl=s,this.spectorJS=(0,ee.k2)({...this.props,gl:this.handle}),this.gl.device=this,this.gl._version=2,this.info=A(this.gl,this._extensions),this.limits=new j(this.gl),this.features=new G(this.gl,this._extensions,this.props._disabledFeatures),this.props._initializeFeatures&&this.features.initializeFeatures();new S(this.gl,{log:(...e)=>i.R.log(1,...e)()}).trackState(this.gl,{copyState:!1});const a=e.debugWebGL||e.debug,l=e.debugWebGL;a&&(this.gl=(0,te.l)(this.gl,{debugWebGL:a,traceWebGL:l}),i.R.warn("WebGL debug mode activated. Performance reduced.")(),e.debugWebGL&&(i.R.level=Math.max(i.R.level,1))),this.commandEncoder=new Ye(this,{id:`${this}-command-encoder`})}destroy(){this.props._reuseDevices||this._reused||delete this.gl.device}get isLost(){return this.gl.isContextLost()}getTextureByteAlignment(){return 4}createCanvasContext(e){throw new Error("WebGL only supports a single canvas")}createBuffer(e){const t=this._normalizeBufferProps(e);return new oe(this,t)}createTexture(e){return new Ee(this,e)}createExternalTexture(e){throw new Error("createExternalTexture() not implemented")}createSampler(e){return new ve(this,e)}createShader(e){return new le(this,e)}createFramebuffer(e){return new Q(this,e)}createVertexArray(e){return new tt(this,e)}createTransformFeedback(e){return new rt(this,e)}createQuerySet(e){return new st(this,e)}createRenderPipeline(e){return new Fe(this,e)}createComputePipeline(e){throw new Error("ComputePipeline not supported in WebGL")}createCommandEncoder(e={}){return new Ye(this,e)}submit(e){e||(e=this.commandEncoder.finish(),this.commandEncoder.destroy(),this.commandEncoder=this.createCommandEncoder({id:`${this.id}-default-encoder`})),e._executeCommands()}readPixelsToArrayWebGL(e,t){return ut(e,t)}readPixelsToBufferWebGL(e,t){return function(e,t){const{target:n,sourceX:r=0,sourceY:i=0,sourceFormat:o=6408,targetByteOffset:s=0}=t||{};let{sourceWidth:a,sourceHeight:l,sourceType:c}=t||{};const{framebuffer:u,deleteFramebuffer:d}=dt(e);a=a||u.width,l=l||u.height;const h=u;c=c||5121;let f=n;if(!f){const e=s+a*l*lt(o)*function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return 0}}(c);f=h.device.createBuffer({byteLength:e})}const p=e.device.createCommandEncoder();return p.copyTextureToBuffer({sourceTexture:e,width:a,height:l,origin:[r,i],destinationBuffer:f,byteOffset:s}),p.destroy(),d&&u.destroy(),f}(e,t)}setParametersWebGL(e){b(this.gl,e)}getParametersWebGL(e){return v(this.gl,e)}withParametersWebGL(e,t){return xe(this.gl,e,t)}resetWebGL(){i.R.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),b(this.gl,o)}_getDeviceSpecificTextureFormatCapabilities(e){return function(e,t,n){let r=t.create;const i=B[t.format];return void 0===i?.gl&&(r=!1),i?.x&&(r=r&&Boolean(k(e,i.x,n))),{format:t.format, // @ts-ignore create:r&&t.create, // @ts-ignore render:r&&t.render, // @ts-ignore filter:r&&t.filter, // @ts-ignore blend:r&&t.blend, // @ts-ignore store:r&&t.store}}(this.gl,e,this._extensions)}loseDevice(){let e=!1;const t=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return t&&(e=!0,t.loseContext()),this._resolveContextLost?.({reason:"destroyed",message:"Application triggered context loss"}),e}pushState(){S.get(this.gl).push()}popState(){S.get(this.gl).pop()}getGLKey(e,t){const n=Number(e);for(const e in this.gl) // @ts-ignore expect-error depends on settings if(this.gl[e]===n)return`GL.${e}`;return t?.emptyIfUnknown?"":String(e)}getGLKeys(e){const t={emptyIfUnknown:!0};return Object.entries(e).reduce((e,[n,r])=>(e[`${n}:${this.getGLKey(n,t)}`]=`${r}:${this.getGLKey(r,t)}`,e),{})}setConstantAttributeWebGL(e,t){const n=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(n).fill(null);const r=this._constants[e];switch(r&&function(e,t){if(!e||!t||e.length!==t.length||e.constructor!==t.constructor)return!1;for(let n=0;n{"use strict";n.d(t,{Mz:()=>s,OB:()=>o,yx:()=>i});var r=n(3189);function i(e){let t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);const[n,i]=e.split("x"),o=n,s=i?parseInt(i):1,a=(0,r.vE)(o),l={type:o,components:s,byteLength:a.byteLength*s,integer:a.integer,signed:a.signed,normalized:a.normalized};return t&&(l.webglOnly=!0),l}function o(e,t,n){if(!t||t>4)throw new Error(`size ${t}`);const i=t;return function(e,t,n){const i=n?(0,r.K7)(e):e;switch(i){case"unorm8":return 1===t?"unorm8":3===t?"unorm8x3-webgl":`${i}x${t}`;case"snorm8":case"uint8":case"sint8":case"uint16":case"sint16":case"unorm16":case"snorm16":case"float16":if(1===t||3===t)throw new Error(`size: ${t}`);return`${i}x${t}`;default:return 1===t?i:`${i}x${t}`}}((0,r.h1)(e),i,n)}function s(e){let t;switch(e.primitiveType){case"f32":t="float32";break;case"i32":t="sint32";break;case"u32":t="uint32";break;case"f16":return e.components<=2?"float16x2":"float16x4"}return 1===e.components?t:`${t}x${e.components}`}},4733:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0>>1,i=e[r];if(!(0>>1;ro(l,n))co(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[a]=n,r=a);else{if(!(co(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,h=null,f=3,p=!1,m=!1,g=!1,_="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function v(e){for(var t=r(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function x(e){if(g=!1,v(e),!m)if(null!==r(c))m=!0,N(w);else{var t=r(u);null!==t&&M(x,t.startTime-e)}}function w(e,n){m=!1,g&&(g=!1,y(k),k=-1),p=!0;var o=f;try{for(v(n),h=r(c);null!==h&&(!(h.expirationTime>n)||e&&!R());){var s=h.callback;if("function"==typeof s){h.callback=null,f=h.priorityLevel;var a=s(h.expirationTime<=n);n=t.unstable_now(),"function"==typeof a?h.callback=a:h===r(c)&&i(c),v(n)}else i(c);h=r(c)}if(null!==h)var l=!0;else{var d=r(u);null!==d&&M(x,d.startTime-n),l=!1}return l}finally{h=null,f=o,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,E=!1,T=null,k=-1,A=5,C=-1;function R(){return!(t.unstable_now()-Ce||125s?(e.sortIndex=o,n(u,e),null===r(c)&&e===r(u)&&(g?(y(k),k=-1):g=!0,M(x,o-s))):(e.sortIndex=a,n(c,e),m||p||(m=!0,N(w))),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},5222:()=>{},5235:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},5932:(e,t,n)=>{"use strict";n.d(t,{R:()=>y});var r=n(6106); // @ts-expect-error const i="4.1.1";function o(e,t){if(!e)throw new Error(t||"Assertion failed")}function s(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object": // @ts-expect-error t=e.logLevel||e.priority||0;break;default:return 0}return o(Number.isFinite(t)&&t>=0),t}const a=()=>{};class l{constructor({level:e=0}={}){this.userData={},this._onceCache=new Set,this._level=e}set level(e){this.setLevel(e)}get level(){return this.getLevel()}setLevel(e){return this._level=e,this}getLevel(){return this._level}warn(e,...t){return this._log("warn",0,e,t,{once:!0})}error(e,...t){return this._log("error",0,e,t)}log(e,t,...n){return this._log("log",e,t,n)}info(e,t,...n){return this._log("info",e,t,n)}once(e,t,...n){return this._log("once",e,t,n,{once:!0})}_log(e,t,n,r,i={}){const a=function(e){const{logLevel:t,message:n}=e;e.logLevel=s(t);const r=e.args?Array.from(e.args):[];for(;r.length&&r.shift()!==n;);switch(typeof t){case"string":case"function":void 0!==n&&r.unshift(n),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const i=typeof e.message;return o("string"===i||"object"===i),Object.assign(e,{args:r},e.opts)}({logLevel:t,message:n,args:this._buildArgs(t,n,r),opts:i});return this._createLogFunction(e,a,i)}_buildArgs(e,t,n){return[e,t,...n]}_createLogFunction(e,t,n){if(!this._shouldLog(t.logLevel))return a;const r=this._getOnceTag(n.tag??t.tag??t.message);if((n.once||t.once)&&void 0!==r){if(this._onceCache.has(r))return a;this._onceCache.add(r)}return this._emit(e,t)}_shouldLog(e){return this.getLevel()>=s(e)}_getOnceTag(e){if(void 0!==e)try{return"string"==typeof e?e:String(e)}catch{return}}}class c{constructor(e,t,n="sessionStorage"){this.storage=function(e){try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}var u;!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"}(u||(u={}));function d(e){return"string"!=typeof e?e:(e=e.toUpperCase(),u[e]||u.WHITE)}var h=n(7911);function f(){let e;if((0,r.B)()&&h.x.performance)e=h.x?.performance?.now?.();else if("hrtime"in h.eh){ // @ts-ignore const t=h.eh?.hrtime?.();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}const p={debug:(0,r.B)()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},m={enabled:!0,level:0};class g extends l{constructor({id:e}={id:""}){super({level:0}),this.VERSION=i,this._startTs=f(),this._deltaTs=f(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new c(`__probe-${this.id}__`,{[this.id]:m}),this.timeStamp(`${this.id} started`),function(e,t=["constructor"]){const n=Object.getPrototypeOf(e),r=Object.getOwnPropertyNames(n),i=e;for(const n of r){const r=i[n];"function"==typeof r&&(t.find(e=>n===e)||(i[n]=r.bind(e)))}}(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((f()-this._startTs).toPrecision(10))}getDelta(){return Number((f()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._updateConfiguration({enabled:e}),this}setLevel(e){return this._updateConfiguration({level:e}),this}get(e){return this._getConfiguration()[e]}set(e,t){this._updateConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e,...t){return this._log("warn",0,e,t,{method:p.warn,once:!0})}error(e,...t){return this._log("error",0,e,t,{method:p.error})}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t,...n){return this._log("log",e,t,n,{method:p.log,time:!0,once:!0})}log(e,t,...n){return this._log("log",e,t,n,{method:p.debug})}info(e,t,...n){return this._log("info",e,t,n,{method:console.info})}once(e,t,...n){return this._log("once",e,t,n,{method:p.debug||p.info,once:!0})}table(e,t,n){return t?this._log("table",e,t,n&&[n]||[],{method:console.table||a,tag:_(t)}):a}time(e,t){return this._log("time",e,t,[],{method:console.time?console.time:console.info})}timeEnd(e,t){return this._log("time",e,t,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(e,t){return this._log("time",e,t,[],{method:console.timeStamp||a})}group(e,t,n={collapsed:!1}){const r=(n.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",e,t,[],{method:r})}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._log("groupEnd",e,"",[],{method:console.groupEnd||a})}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&super._shouldLog(e)}_emit(e,t){const n=t.method;o(n),t.total=this.getTotal(),t.delta=this.getDelta(),this._deltaTs=f();const i=function(e,t,n){if("string"==typeof t){const i=n.time?function(e,t=8){const n=Math.max(t-e.length,0);return`${" ".repeat(n)}${e}`}(function(e){let t;return t=e<10?`${e.toFixed(2)}ms`:e<100?`${e.toFixed(1)}ms`:e<1e3?`${e.toFixed(0)}ms`:`${(e/1e3).toFixed(2)}s`,t}(n.total)):"";t=function(e,t,n){r.B||"string"!=typeof e||(t&&(e=`[${d(t)}m${e}`),n&&(e=`[${d(n)+10}m${e}`));return e}(t=n.time?`${e}: ${i} ${t}`:`${e}: ${t}`,n.color,n.background)}return t}(this.id,t.message,t);return n.bind(console,i,...t.args)}_getConfiguration(){ // @ts-expect-error guaranteed to be defined return this._storage.config[this.id]||this._updateConfiguration(m),this._storage.config[this.id]}_updateConfiguration(e){const t=this._storage.config[this.id]||{...m};this._storage.setConfiguration({[this.id]:{...t,...e}})}}function _(e){for(const t in e)for(const n in e[t])return n||"untitled";return"empty"}g.VERSION=i;const y=new g({id:"luma.gl"})},6049:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},6106:(e,t,n)=>{"use strict";n.d(t,{B:()=>i});var r=n(2754);function i(){return!( // @ts-expect-error "object"==typeof process&&"[object process]"===String(process)&&!process?.browser)||(0,r.b)()}},6575:(e,t,n)=>{"use strict";n.d(t,{$:()=>c,l:()=>u});var r,i=n(5932);!function(e){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.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.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.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[e.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",e[e.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",e[e.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",e[e.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",e[e.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",e[e.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",e[e.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",e[e.LINE_WEBGL=6913]="LINE_WEBGL",e[e.FILL_WEBGL=6914]="FILL_WEBGL",e[e.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",e[e.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",e[e.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",e[e.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",e[e.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",e[e.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",e[e.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",e[e.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",e[e.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",e[e.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",e[e.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",e[e.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",e[e.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",e[e.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",e[e.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",e[e.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",e[e.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",e[e.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",e[e.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",e[e.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",e[e.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",e[e.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",e[e.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",e[e.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"}(r||(r={}));var o=n(6106),s=n(8722);const a="https://unpkg.com/webgl-debug@2.0.1/index.js";function l(e){return e.luma=e.luma||{},e.luma}async function c(){(0,o.B)()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis, // @ts-expect-error Developer tools expects global to be set globalThis.global.module={},await(0,s.k)(a))}function u(e,t={}){return t.debugWebGL||t.traceWebGL?function(e,t){if(!globalThis.WebGLDebugUtils)return i.R.warn("webgl-debug not loaded")(),e;const n=l(e);if(n.debugContext)return n.debugContext;globalThis.WebGLDebugUtils.init({...r,...e});const o=globalThis.WebGLDebugUtils.makeDebugContext(e,h.bind(null,t),f.bind(null,t));for(const e in r)e in o||"number"!=typeof r[e]||(o[e]=r[e]);class s{}Object.setPrototypeOf(o,Object.getPrototypeOf(e)),Object.setPrototypeOf(s,o);const a=Object.create(s);return n.realContext=e,n.debugContext=a,a.debug=!0,a}(e,t):function(e){const t=l(e);return t.realContext?t.realContext:e}(e)}function d(e,t){t=Array.from(t).map(e=>void 0===e?"undefined":e);let n=globalThis.WebGLDebugUtils.glFunctionArgsToString(e,t);return n=`${n.slice(0,100)}${n.length>100?"...":""}`,`gl.${e}(${n})`}function h(e,t,n,r){r=Array.from(r).map(e=>void 0===e?"undefined":e);const o=`${globalThis.WebGLDebugUtils.glEnumToString(t)} in gl.${n}(${globalThis.WebGLDebugUtils.glFunctionArgsToString(n,r)})`;i.R.error(o)()}function f(e,t,n){let r="";i.R.level>=1&&(r=d(t,n),e.traceWebGL&&i.R.log(1,r)());for(const e of n)void 0===e&&(r=r||d(t,n))}},6587:(e,t,n)=>{"use strict";n.d(t,{g:()=>a});var r=n(806),i=n(7372),o=n(5932);const s={"1d":"1d","2d":"2d","2d-array":"2d",cube:"2d","cube-array":"2d","3d":"3d"};class a extends r.F{static SAMPLE=4;static STORAGE=8;static RENDER=16;static COPY_SRC=1;static COPY_DST=2;static TEXTURE=4;static RENDER_ATTACHMENT=16;dimension;baseDimension;format;width;height;depth;mipLevels;updateTimestamp;get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}constructor(e,t){if(super(e,t=a.normalizeProps(e,t),a.defaultProps),this.dimension=this.props.dimension,this.baseDimension=s[this.dimension],this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.mipLevels=this.props.mipLevels,void 0===this.props.width||void 0===this.props.height)if(e.isExternalImage(t.data)){const n=e.getExternalImageSize(t.data);this.width=n?.width||1,this.height=n?.height||1}else this.width=1,this.height=1,void 0!==this.props.width&&void 0!==this.props.height||o.R.warn(`${this} created with undefined width or height. This is deprecated. Use AsyncTexture instead.`)();this.updateTimestamp=e.incrementTimestamp()}setSampler(e){this.sampler=e instanceof i.L?e:this.device.createSampler(e)}clone(e){return this.device.createTexture({...this.props,...e})}static normalizeProps(e,t){const n={...t},{width:r,height:i}=n;return"number"==typeof r&&(n.width=Math.max(1,Math.ceil(r))),"number"==typeof i&&(n.height=Math.max(1,Math.ceil(i))),n}_initializeData(e){this.device.isExternalImage(e)?this.copyExternalImage({image:e,width:this.width,height:this.height,depth:this.depth,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1}):e&&this.copyImageData({data:e,mipLevel:0,x:0,y:0,z:0,aspect:"all"})}_normalizeCopyImageDataOptions(e){const{width:t,height:n,depth:r}=this,i={...a.defaultCopyDataOptions,width:t,height:n,depth:r,...e},o=this.device.getTextureFormatInfo(this.format);if(!e.bytesPerRow&&!o.bytesPerPixel)throw new Error(`bytesPerRow must be provided for texture format ${this.format}`);return i.bytesPerRow=e.bytesPerRow||t*(o.bytesPerPixel||4),i.rowsPerImage=e.rowsPerImage||n,i}_normalizeCopyExternalImageOptions(e){const t=this.device.getExternalImageSize(e.image),n={...a.defaultCopyExternalImageOptions,...t,...e};return n.width=Math.min(n.width,this.width-n.x),n.height=Math.min(n.height,this.height-n.y),n}static defaultProps={...r.F.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",usage:a.TEXTURE|a.RENDER_ATTACHMENT|a.COPY_DST,width:void 0,height:void 0,depth:1,mipLevels:1,samples:void 0,sampler:{},view:void 0};static defaultCopyDataOptions={data:void 0,byteOffset:0,bytesPerRow:void 0,rowsPerImage:void 0,mipLevel:0,x:0,y:0,z:0,aspect:"all"};static defaultCopyExternalImageOptions={image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1}}},6732:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(2093),i=n.n(r),o=n(2670),s=n.n(o)()(i());s.push([e.id,'.floating-button-wrapper {\n position: fixed;\n right: 24px;\n bottom: 108px;\n z-index: 100000;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 6px;\n pointer-events: none;\n}\n\n.bili-helper-floating-button {\n width: 40px;\n height: 92px;\n padding: 9px;\n border: 1px solid rgb(47, 49, 52);\n border-radius: 8px;\n background: rgb(36, 38, 40);\n color: rgb(231, 233, 235);\n box-shadow: none;\n cursor: pointer;\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n pointer-events: auto;\n user-select: none;\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",\n "Microsoft YaHei", sans-serif;\n font-size: 12px;\n font-weight: 400;\n line-height: normal;\n transition:\n transform 0.18s ease,\n background-color 0.18s ease,\n border-color 0.18s ease,\n box-shadow 0.18s ease;\n}\n\n.bili-helper-floating-button:hover {\n background: rgb(47, 49, 52);\n border-color: rgb(64, 66, 69);\n box-shadow: none;\n transform: translateY(-2px);\n}\n\n.bili-helper-floating-button:active {\n transform: translateY(0) scale(0.98);\n}\n\n.bili-helper-floating-button:focus-visible {\n outline: 2px solid #00aeec;\n outline-offset: 3px;\n}\n\n.bili-helper-floating-button__icon {\n position: relative;\n display: block;\n width: 16px;\n height: 16px;\n margin: 0 0 6px;\n color: currentColor;\n}\n\n.bili-helper-floating-button__icon::before,\n.bili-helper-floating-button__icon::after {\n content: "";\n position: absolute;\n left: 7px;\n width: 12px;\n height: 2px;\n border-radius: 999px;\n background: currentColor;\n opacity: 0.72;\n transform-origin: left center;\n}\n\n.bili-helper-floating-button__icon::before {\n left: 4px;\n top: 4px;\n width: 9px;\n height: 7px;\n border-top: 1.5px solid currentColor;\n border-bottom: 1.5px solid currentColor;\n background: transparent;\n opacity: 0.78;\n transform: skewY(-28deg);\n}\n\n.bili-helper-floating-button__icon::after {\n left: 1px;\n top: 6px;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: currentColor;\n box-shadow:\n 10px -4px 0 currentColor,\n 10px 6px 0 currentColor;\n opacity: 1;\n transform: none;\n}\n\n.bili-helper-floating-button__label {\n display: block;\n width: 20px;\n padding: 0;\n color: rgb(231, 233, 235);\n letter-spacing: 0;\n text-align: center;\n white-space: normal;\n}\n\n@media (max-width: 768px) {\n .floating-button-wrapper {\n right: 14px;\n bottom: 88px;\n }\n\n .bili-helper-floating-button {\n width: 40px;\n height: 92px;\n font-size: 12px;\n }\n\n}\n\n.bili-helper-toast-viewport {\n position: fixed;\n top: 20px;\n left: 50%;\n z-index: 100001;\n width: min(420px, calc(100vw - 32px));\n pointer-events: none;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n transform: translateX(-50%);\n}\n\n.bili-helper-toast {\n width: fit-content;\n max-width: 100%;\n min-height: 40px;\n padding: 9px 12px;\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 8px;\n background: rgba(36, 38, 40, 0.96);\n color: rgb(231, 233, 235);\n box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 10px;\n pointer-events: auto;\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",\n "Microsoft YaHei", sans-serif;\n font-size: 14px;\n line-height: 1.45;\n animation: bili-helper-toast-in 0.18s ease-out;\n}\n\n.bili-helper-toast__icon {\n width: 20px;\n height: 20px;\n border-radius: 50%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 11px;\n font-weight: 700;\n color: #fff;\n}\n\n.bili-helper-toast--success .bili-helper-toast__icon {\n background: #2fb344;\n}\n\n.bili-helper-toast--info .bili-helper-toast__icon {\n background: #00aeec;\n}\n\n.bili-helper-toast--warning .bili-helper-toast__icon {\n background: #f59f00;\n}\n\n.bili-helper-toast--error .bili-helper-toast__icon {\n background: #e03131;\n}\n\n.bili-helper-toast__content {\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.bili-helper-toast__close {\n width: 20px;\n height: 20px;\n padding: 0;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: rgba(231, 233, 235, 0.72);\n cursor: pointer;\n font: inherit;\n line-height: 20px;\n}\n\n.bili-helper-toast__close:hover {\n background: rgba(255, 255, 255, 0.1);\n color: rgb(231, 233, 235);\n}\n\n@keyframes bili-helper-toast-in {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n.brm-modal-backdrop {\n position: fixed;\n inset: 0;\n z-index: 100000;\n padding: 20px 16px;\n background: rgba(0, 0, 0, 0.45);\n display: flex;\n align-items: flex-start;\n justify-content: center;\n}\n\n.brm-modal-shell {\n position: relative;\n width: min(1200px, 100%);\n height: calc(100vh - 40px);\n max-height: 90vh;\n border: 1px solid transparent;\n border-radius: 8px;\n background: #fff;\n color: #18191c;\n box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.brm-modal-shell--about {\n width: min(720px, 100%);\n height: auto;\n max-height: calc(100vh - 40px);\n}\n\n.brm-about-header {\n min-height: 56px;\n padding: 10px 168px 10px 20px;\n border-bottom: 1px solid #f0f0f0;\n display: flex;\n align-items: center;\n}\n\n.brm-about-header span {\n color: #9499a0;\n display: block;\n font-size: 12px;\n line-height: 1.3;\n}\n\n.brm-about-header h1 {\n margin: 2px 0 0;\n color: inherit;\n font-size: 16px;\n line-height: 1.35;\n}\n\n.brm-theme-toggle {\n position: absolute;\n top: 10px;\n right: 48px;\n z-index: 1;\n height: 28px;\n padding: 0 8px;\n border: 1px solid #e3e5e7;\n border-radius: 6px;\n background: #fff;\n color: #61666d;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",\n "Microsoft YaHei", sans-serif;\n font-size: 12px;\n line-height: 1;\n transition:\n background-color 0.18s ease,\n border-color 0.18s ease,\n color 0.18s ease;\n}\n\n.brm-theme-toggle:hover {\n border-color: #00aeec;\n color: #00aeec;\n}\n\n.brm-theme-toggle:focus-visible {\n outline: 2px solid #00aeec;\n outline-offset: 2px;\n}\n\n.brm-theme-toggle__track {\n position: relative;\n width: 32px;\n height: 18px;\n border-radius: 999px;\n background: #e3e5e7;\n transition: background-color 0.18s ease;\n}\n\n.brm-theme-toggle__thumb {\n position: absolute;\n top: 2px;\n left: 2px;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background: #fff;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);\n transition:\n background-color 0.18s ease,\n transform 0.18s ease;\n}\n\n.brm-theme-toggle__text {\n min-width: 24px;\n text-align: center;\n}\n\n.brm-modal-close {\n position: absolute;\n top: 10px;\n right: 12px;\n z-index: 1;\n width: 28px;\n height: 28px;\n padding: 0;\n border: 0;\n border-radius: 6px;\n background: transparent;\n color: #9499a0;\n cursor: pointer;\n font: 18px/28px Arial, sans-serif;\n}\n\n.brm-modal-close:hover {\n background: #f1f2f3;\n color: #18191c;\n}\n\n.brm-modal-body {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n}\n\n.brm-standalone-document {\n overflow: hidden !important;\n}\n\n.brm-standalone-app {\n position: fixed;\n inset: 0;\n z-index: 100000;\n background: #f6f7f8;\n color: #18191c;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",\n "Microsoft YaHei", sans-serif;\n}\n\n.brm-standalone-topbar {\n min-height: 52px;\n padding: 0 12px 0 16px;\n border-bottom: 1px solid #dcdfe6;\n background: #fff;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.brm-standalone-heading {\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.brm-standalone-heading h1 {\n margin: 0;\n color: inherit;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 15px;\n line-height: 1.25;\n}\n\n.brm-standalone-heading span {\n color: #61666d;\n font-size: 12px;\n}\n\n.brm-standalone-actions {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.brm-standalone-theme-toggle {\n height: 28px;\n padding: 0 8px;\n border: 1px solid #e3e5e7;\n border-radius: 6px;\n background: #fff;\n color: #61666d;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n font: inherit;\n font-size: 12px;\n line-height: 1;\n transition:\n background-color 0.18s ease,\n border-color 0.18s ease,\n color 0.18s ease;\n}\n\n.brm-standalone-theme-toggle:hover {\n border-color: #00aeec;\n color: #00aeec;\n}\n\n.brm-standalone-content {\n flex: 1;\n min-height: 0;\n padding: 8px;\n overflow: hidden;\n}\n\n.brm-tab-panel {\n height: 100%;\n min-height: 0;\n overflow: hidden;\n}\n\n.brm-tab-panel[hidden] {\n display: none;\n}\n\n.brm-tab-panel--info {\n overflow: auto;\n}\n\n.brm-script-info {\n min-height: 100%;\n padding: 16px 24px 24px;\n background: #fff;\n}\n\n.brm-hero-panel {\n margin-bottom: 24px;\n padding: 24px;\n border-radius: 8px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: #fff;\n text-align: center;\n}\n\n.brm-hero-icon {\n width: 64px;\n height: 64px;\n margin: 0 auto 16px;\n border-radius: 16px;\n background: rgba(255, 255, 255, 0.2);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-weight: 800;\n letter-spacing: 0;\n}\n\n.brm-hero-panel h2 {\n margin: 0;\n color: #fff;\n font-size: 24px;\n line-height: 1.35;\n}\n\n.brm-hero-panel p {\n margin: 8px 0 0;\n color: rgba(255, 255, 255, 0.85);\n font-size: 14px;\n}\n\n.brm-version-pill {\n margin-top: 16px;\n padding: 2px 8px;\n border-radius: 4px;\n background: #fff;\n color: #764ba2;\n display: inline-flex;\n font-size: 12px;\n font-weight: 700;\n}\n\n.brm-info-grid {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 16px;\n}\n\n.brm-info-card {\n padding: 16px;\n border: 1px solid #f0f0f0;\n border-radius: 8px;\n background: #fff;\n}\n\n.brm-info-card h3 {\n margin: 0 0 16px;\n color: #18191c;\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.brm-section-mark {\n width: 18px;\n height: 18px;\n border-radius: 5px;\n background: #00aeec;\n display: inline-block;\n}\n\n.brm-section-mark--user {\n background: #00aeec;\n}\n\n.brm-section-mark--code {\n background: #2fb344;\n}\n\n.brm-section-mark--feature {\n background: #f59f00;\n}\n\n.brm-meta-list {\n margin: 0;\n}\n\n.brm-meta-list div {\n margin-bottom: 12px;\n}\n\n.brm-meta-list div:last-child {\n margin-bottom: 0;\n}\n\n.brm-meta-list dt {\n color: #9499a0;\n font-size: 14px;\n}\n\n.brm-meta-list dd {\n margin: 2px 0 0;\n color: #18191c;\n font-weight: 600;\n}\n\n.brm-tag-list {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.brm-tag {\n padding: 1px 8px;\n border: 1px solid currentColor;\n border-radius: 4px;\n background: rgba(0, 174, 236, 0.08);\n color: #00aeec;\n font-size: 12px;\n line-height: 20px;\n}\n\n.brm-tag--green {\n background: rgba(47, 179, 68, 0.08);\n color: #2fb344;\n}\n\n.brm-tag--cyan {\n background: rgba(32, 201, 151, 0.08);\n color: #12b886;\n}\n\n.brm-tag--orange {\n background: rgba(245, 159, 0, 0.08);\n color: #f08c00;\n}\n\n.brm-tag--purple {\n background: rgba(116, 82, 194, 0.08);\n color: #7048e8;\n}\n\n.brm-tag--magenta {\n background: rgba(214, 51, 132, 0.08);\n color: #d63384;\n}\n\n.brm-feature-card {\n margin-top: 16px;\n}\n\n.brm-feature-grid {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 12px 16px;\n}\n\n.brm-feature-item {\n display: flex;\n align-items: center;\n gap: 8px;\n color: #18191c;\n}\n\n.brm-feature-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #00aeec;\n}\n\n.brm-feature-dot--pink {\n background: #f06595;\n}\n\n.brm-feature-dot--green {\n background: #2fb344;\n}\n\n.brm-feature-dot--purple {\n background: #7048e8;\n}\n\n.brm-info-footer {\n margin-top: 24px;\n padding-top: 16px;\n border-top: 1px solid #f0f0f0;\n color: #9499a0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n font-size: 14px;\n}\n\n.brm-info-footer a {\n color: #61666d;\n text-decoration: none;\n}\n\n.brm-info-footer a:hover {\n color: #00aeec;\n}\n\n.brm-info-footer span {\n width: 1px;\n height: 14px;\n background: #e3e5e7;\n}\n\n.brm-info-footer p {\n margin: 0;\n}\n\n.brm-legend {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.brm-status-tag {\n max-width: 100%;\n padding: 1px 7px;\n border: 1px solid #dcdfe6;\n border-radius: 4px;\n background: #f6f7f8;\n color: #61666d;\n display: inline-flex;\n align-items: center;\n font-size: 12px;\n line-height: 20px;\n white-space: nowrap;\n}\n\n.brm-status-tag--blue {\n border-color: rgba(0, 174, 236, 0.32);\n background: rgba(0, 174, 236, 0.08);\n color: #008ac5;\n}\n\n.brm-status-tag--green {\n border-color: rgba(47, 179, 68, 0.32);\n background: rgba(47, 179, 68, 0.08);\n color: #2f9e44;\n}\n\n.brm-status-tag--gold {\n border-color: rgba(245, 159, 0, 0.34);\n background: rgba(245, 159, 0, 0.1);\n color: #e67700;\n}\n\n.brm-status-tag--magenta,\n.brm-status-tag--purple {\n border-color: rgba(214, 51, 132, 0.28);\n background: rgba(214, 51, 132, 0.08);\n color: #c2255c;\n}\n\n.brm-status-tag--red {\n border-color: rgba(224, 49, 49, 0.32);\n background: rgba(224, 49, 49, 0.08);\n color: #c92a2a;\n}\n\n.brm-button,\n.brm-icon-button {\n border: 1px solid #dcdfe6;\n border-radius: 6px;\n background: #fff;\n color: #18191c;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",\n "Microsoft YaHei", sans-serif;\n font-size: 13px;\n line-height: 1;\n transition:\n border-color 0.18s ease,\n background-color 0.18s ease,\n color 0.18s ease;\n}\n\n.brm-button {\n min-height: 28px;\n padding: 0 10px;\n}\n\n.brm-button--compact {\n min-height: 26px;\n padding: 0 9px;\n font-size: 12px;\n}\n\n.brm-button--load-action {\n width: 88px;\n flex: 0 0 88px;\n}\n\n.brm-button--primary {\n border-color: #00aeec;\n background: #00aeec;\n color: #fff;\n}\n\n.brm-button:hover:not(:disabled),\n.brm-icon-button:hover:not(:disabled) {\n border-color: #00aeec;\n color: #00aeec;\n}\n\n.brm-button--primary:hover:not(:disabled) {\n border-color: #23c9ff;\n background: #23c9ff;\n color: #fff;\n}\n\n.brm-button:disabled,\n.brm-icon-button:disabled {\n border-color: #e3e5e7;\n background: #f6f7f8;\n color: #c9ccd0;\n cursor: not-allowed;\n}\n\n.brm-button__icon {\n min-width: 12px;\n font-weight: 700;\n text-align: center;\n}\n\n.brm-icon-button {\n width: 24px;\n height: 24px;\n padding: 0;\n}\n\n.brm-graph-panel {\n border: 1px solid #dcdfe6;\n border-radius: 8px;\n background: #fff;\n color: #18191c;\n}\n\n.brm-graph-view {\n width: 100%;\n height: 100%;\n color: #18191c;\n display: flex;\n flex-direction: column;\n gap: 8px;\n overflow: hidden;\n}\n\n.brm-graph-main {\n flex: 1;\n min-height: 0;\n display: flex;\n gap: 8px;\n overflow: hidden;\n}\n\n.brm-graph-canvas {\n flex: 1;\n min-width: 0;\n min-height: 0;\n border: 1px solid #d9d9d9;\n border-radius: 8px;\n background: #1a1d26;\n overflow: hidden;\n}\n\n.brm-graph-empty {\n height: 100%;\n padding: 32px;\n color: #aeb5bf;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n text-align: center;\n}\n\n.brm-graph-empty__title {\n color: #e7e9eb;\n font-size: 15px;\n line-height: 1.4;\n}\n\n.brm-graph-empty__description {\n max-width: 360px;\n font-size: 13px;\n line-height: 1.6;\n}\n\n.brm-graph-empty--error .brm-graph-empty__title {\n color: #ffccc7;\n}\n\n.brm-graph-toolbar {\n padding: 8px;\n}\n\n.brm-toolbar-row {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px 12px;\n}\n\n.brm-toolbar-group {\n min-width: 0;\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n}\n\n.brm-toolbar-group--export,\n.brm-toolbar-group--explore {\n padding-left: 12px;\n border-left: 1px solid #e3e5e7;\n}\n\n.brm-toolbar-group--export .brm-control select {\n min-width: 112px;\n}\n\n.brm-toolbar-group--status {\n margin-left: auto;\n justify-content: flex-end;\n}\n\n.brm-control,\n.brm-checkbox-control {\n min-height: 26px;\n color: #61666d;\n display: inline-flex;\n align-items: center;\n gap: 5px;\n font-size: 12px;\n line-height: 1;\n}\n\n.brm-control select {\n height: 26px;\n padding: 0 24px 0 8px;\n border: 1px solid #dcdfe6;\n border-radius: 6px;\n background: #fff;\n color: #18191c;\n cursor: pointer;\n font: inherit;\n}\n\n.brm-control select:disabled,\n.brm-checkbox-control input:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.brm-checkbox-control input {\n width: 14px;\n height: 14px;\n margin: 0;\n accent-color: #00aeec;\n}\n\n.brm-search {\n width: 260px;\n height: 28px;\n border: 1px solid #dcdfe6;\n border-radius: 6px;\n background: #fff;\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto auto;\n align-items: center;\n overflow: hidden;\n}\n\n.brm-search:focus-within {\n border-color: #00aeec;\n}\n\n.brm-search__input {\n min-width: 0;\n height: 100%;\n padding: 0 8px;\n border: 0;\n background: transparent;\n color: inherit;\n outline: 0;\n font: inherit;\n font-size: 12px;\n}\n\n.brm-search__input::placeholder {\n color: #9499a0;\n}\n\n.brm-search__clear,\n.brm-search__submit {\n height: 100%;\n padding: 0;\n border: 0;\n background: transparent;\n color: #61666d;\n cursor: pointer;\n font: 12px/1 Arial, sans-serif;\n}\n\n.brm-search__clear {\n width: 28px;\n}\n\n.brm-search__submit {\n min-width: 44px;\n padding: 0 10px;\n border-left: 1px solid #dcdfe6;\n background: #00aeec;\n color: #fff;\n font-weight: 700;\n}\n\n.brm-graph-status,\n.brm-progress__detail,\n.brm-progress__text {\n color: #61666d;\n font-size: 12px;\n}\n\n.brm-progress-block {\n margin-top: 8px;\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 4px 8px;\n visibility: hidden;\n}\n\n.brm-progress-block--active {\n visibility: visible;\n}\n\n.brm-progress {\n height: 6px;\n border-radius: 999px;\n background: #f1f2f3;\n overflow: hidden;\n}\n\n.brm-progress__bar {\n height: 100%;\n border-radius: inherit;\n background: #00aeec;\n display: block;\n transition: width 0.18s ease;\n}\n\n.brm-progress__detail {\n grid-column: 1 / -1;\n min-height: 16px;\n line-height: 16px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-progress__text {\n min-width: 4ch;\n text-align: right;\n font-variant-numeric: tabular-nums;\n}\n\n.brm-graph-side-card {\n width: 288px;\n padding: 14px;\n flex-shrink: 0;\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n.brm-sidebar-section {\n min-width: 0;\n}\n\n.brm-sidebar-section + .brm-sidebar-section {\n margin-top: 14px;\n padding-top: 12px;\n border-top: 1px solid #f0f0f0;\n}\n\n.brm-sidebar-section__header {\n width: 100%;\n min-height: 26px;\n padding: 0;\n border: 0;\n background: transparent;\n color: #18191c;\n cursor: pointer;\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 8px;\n text-align: left;\n font: inherit;\n}\n\n.brm-sidebar-section__header:hover .brm-sidebar-section__title {\n color: #00aeec;\n}\n\n.brm-sidebar-section__chevron {\n width: 14px;\n height: 14px;\n border-radius: 4px;\n background: #f1f2f3;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.brm-sidebar-section__chevron::before {\n width: 5px;\n height: 5px;\n border-right: 1.5px solid currentColor;\n border-bottom: 1.5px solid currentColor;\n content: "";\n transform: translateY(-1px) rotate(45deg);\n transition: transform 0.18s ease;\n}\n\n.brm-sidebar-section--collapsed .brm-sidebar-section__chevron::before {\n transform: translateX(-1px) rotate(-45deg);\n}\n\n.brm-sidebar-section__title {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #18191c;\n font-size: 13px;\n font-weight: 600;\n line-height: 1.4;\n transition: color 0.18s ease;\n}\n\n.brm-sidebar-section__badge {\n min-width: 24px;\n padding: 1px 6px;\n border-radius: 999px;\n background: #f1f2f3;\n color: #61666d;\n font-size: 12px;\n line-height: 18px;\n text-align: center;\n}\n\n.brm-sidebar-section__body {\n margin-top: 10px;\n}\n\n.brm-panel-title {\n margin: 0 0 12px;\n color: inherit;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.brm-stat-grid {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 8px;\n}\n\n.brm-stat {\n padding: 8px;\n border: 1px solid #f0f0f0;\n border-radius: 6px;\n background: #fafafa;\n}\n\n.brm-stat__label {\n color: #9499a0;\n display: block;\n font-size: 12px;\n}\n\n.brm-stat__value {\n margin-top: 2px;\n color: #18191c;\n display: block;\n font-size: 20px;\n line-height: 1.2;\n}\n\n.brm-legend {\n margin-top: 12px;\n}\n\n.brm-selected-point {\n color: #61666d;\n font-size: 12px;\n line-height: 1.7;\n}\n\n.brm-selected-point__name {\n margin-bottom: 8px;\n color: #18191c;\n font-weight: 600;\n}\n\n.brm-selected-point__link {\n margin-top: 10px;\n}\n\n.brm-selected-point__link + .brm-selected-point__link {\n margin-left: 6px;\n}\n\n.brm-notable-edges {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\n.brm-notable-edges__title {\n color: #18191c;\n font-size: 13px;\n font-weight: 600;\n line-height: 1.4;\n}\n\n.brm-notable-edge-list {\n max-height: 220px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n.brm-notable-edge-item {\n width: 100%;\n min-width: 0;\n padding: 8px;\n border: 1px solid #f0f0f0;\n border-radius: 6px;\n background: #fff;\n color: #18191c;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n font: inherit;\n transition:\n border-color 0.18s ease,\n background-color 0.18s ease;\n}\n\n.brm-notable-edge-item:hover {\n border-color: rgba(0, 174, 236, 0.42);\n background: rgba(0, 174, 236, 0.05);\n}\n\n.brm-notable-edge-item__main {\n min-width: 0;\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n align-items: center;\n gap: 5px;\n}\n\n.brm-notable-edge-item__name,\n.brm-notable-edge-item__uid,\n.brm-notable-edge-item__meta {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-notable-edge-item__name {\n color: #18191c;\n font-size: 12px;\n font-weight: 600;\n}\n\n.brm-notable-edge-item__direction,\n.brm-notable-edge-item__uid,\n.brm-notable-edge-item__meta {\n color: #9499a0;\n font-size: 11px;\n}\n\n.brm-notable-edge-item__direction {\n font-weight: 700;\n}\n\n.brm-notable-edge-item__footer {\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 5px;\n}\n\n.brm-notable-edge-item__footer > .brm-status-tag {\n flex-shrink: 0;\n}\n\n.brm-path-panel {\n min-width: 0;\n}\n\n.brm-path-target {\n margin-bottom: 8px;\n color: #61666d;\n font-size: 12px;\n line-height: 1.5;\n}\n\n.brm-path-chain {\n margin-bottom: 10px;\n padding: 8px;\n border: 1px solid #f0f0f0;\n border-radius: 6px;\n background: #fafafa;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 5px;\n}\n\n.brm-path-node {\n max-width: 100%;\n padding: 2px 6px;\n border: 1px solid rgba(0, 174, 236, 0.28);\n border-radius: 4px;\n background: rgba(0, 174, 236, 0.08);\n color: #008ac5;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n}\n\n.brm-path-node:hover {\n border-color: rgba(0, 174, 236, 0.48);\n background: rgba(0, 174, 236, 0.14);\n}\n\n.brm-path-arrow {\n color: #9499a0;\n font-size: 11px;\n font-weight: 700;\n}\n\n.brm-path-steps {\n max-height: 220px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n.brm-path-step {\n min-width: 0;\n padding: 7px;\n border: 1px solid #f0f0f0;\n border-radius: 6px;\n background: #fff;\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n gap: 7px;\n}\n\n.brm-path-step__index {\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #f1f2f3;\n color: #61666d;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 11px;\n font-weight: 700;\n}\n\n.brm-path-step__main {\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.brm-path-step__names,\n.brm-path-step__evidence {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-path-step__names {\n color: #18191c;\n font-size: 12px;\n font-weight: 600;\n}\n\n.brm-path-step__evidence {\n color: #9499a0;\n font-size: 11px;\n}\n\n.brm-edge-details {\n min-width: 0;\n color: #61666d;\n display: flex;\n flex-direction: column;\n gap: 10px;\n font-size: 12px;\n}\n\n.brm-edge-details__route {\n min-width: 0;\n padding: 10px;\n border: 1px solid #f0f0f0;\n border-radius: 6px;\n background: #fafafa;\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n align-items: center;\n gap: 8px;\n}\n\n.brm-edge-details__person {\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 3px;\n}\n\n.brm-edge-details__person > span {\n color: #9499a0;\n font-size: 11px;\n line-height: 1.2;\n}\n\n.brm-edge-details__route button {\n min-width: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: #008ac5;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font: inherit;\n font-weight: 600;\n}\n\n.brm-edge-details__verb {\n padding: 4px 6px;\n border-radius: 999px;\n background: rgba(0, 174, 236, 0.1);\n color: #008ac5;\n font-size: 11px;\n font-weight: 700;\n line-height: 1;\n white-space: nowrap;\n}\n\n.brm-edge-details__uid {\n color: #9499a0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-edge-details__tags {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.brm-edge-details__meta {\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.brm-edge-details__meta div {\n min-width: 0;\n display: grid;\n grid-template-columns: 58px minmax(0, 1fr);\n gap: 8px;\n}\n\n.brm-edge-details__meta dt {\n color: #9499a0;\n}\n\n.brm-edge-details__meta dd {\n min-width: 0;\n margin: 0;\n color: #18191c;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-edge-evidence-list {\n max-height: 220px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n.brm-edge-evidence {\n min-width: 0;\n padding: 8px;\n border: 1px solid #f0f0f0;\n border-radius: 6px;\n background: #fff;\n}\n\n.brm-edge-evidence__header {\n min-width: 0;\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 8px;\n}\n\n.brm-edge-evidence__header > span:last-child,\n.brm-edge-evidence__body,\n.brm-edge-evidence__query {\n color: #9499a0;\n font-size: 11px;\n}\n\n.brm-edge-evidence__body,\n.brm-edge-evidence__query {\n margin-top: 5px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-relation-details {\n margin-top: 14px;\n padding-top: 12px;\n border-top: 1px solid #f0f0f0;\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\n.brm-relation-section {\n min-width: 0;\n}\n\n.brm-relation-section__header {\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n.brm-relation-section__header h4 {\n margin: 0;\n color: #18191c;\n font-size: 13px;\n line-height: 1.4;\n}\n\n.brm-relation-section__header span {\n min-width: 24px;\n padding: 1px 6px;\n border-radius: 999px;\n background: #f1f2f3;\n color: #61666d;\n font-size: 12px;\n text-align: center;\n}\n\n.brm-relation-empty {\n padding: 8px 10px;\n border: 1px dashed #dcdfe6;\n border-radius: 6px;\n background: #fafafa;\n color: #9499a0;\n font-size: 12px;\n line-height: 1.5;\n}\n\n.brm-debug-panel {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.brm-debug-panel__hint {\n color: #9499a0;\n font-size: 12px;\n line-height: 1.5;\n}\n\n.brm-debug-control {\n min-width: 0;\n color: #61666d;\n display: flex;\n flex-direction: column;\n gap: 6px;\n font-size: 12px;\n}\n\n.brm-debug-control__row {\n min-width: 0;\n display: grid;\n grid-template-columns: minmax(0, 1fr) 72px;\n align-items: center;\n gap: 8px;\n}\n\n.brm-debug-control__label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-debug-control__number {\n width: 72px;\n height: 24px;\n padding: 0 6px;\n border: 1px solid #dcdfe6;\n border-radius: 6px;\n background: #fff;\n color: #18191c;\n font: inherit;\n text-align: right;\n}\n\n.brm-debug-control__select {\n width: 72px;\n height: 24px;\n padding: 0 6px;\n border: 1px solid #dcdfe6;\n border-radius: 6px;\n background: #fff;\n color: #18191c;\n font: inherit;\n}\n\n.brm-debug-control__range {\n width: 100%;\n height: 18px;\n margin: 0;\n accent-color: #00aeec;\n}\n\n.brm-debug-panel__reset {\n margin-top: 2px;\n align-self: flex-start;\n}\n\n.brm-filter-panel {\n color: #61666d;\n display: flex;\n flex-direction: column;\n gap: 12px;\n font-size: 12px;\n}\n\n.brm-filter-panel__group {\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.brm-filter-panel__label {\n color: #9499a0;\n line-height: 1.4;\n}\n\n.brm-filter-source-grid {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 8px;\n}\n\n.brm-filter-check {\n min-width: 0;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n line-height: 1.4;\n}\n\n.brm-filter-check input {\n width: 14px;\n height: 14px;\n margin: 0;\n flex-shrink: 0;\n accent-color: #00aeec;\n}\n\n.brm-filter-check input:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.brm-filter-check span {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-filter-row {\n min-width: 0;\n display: grid;\n grid-template-columns: minmax(0, 1fr) 96px;\n align-items: center;\n gap: 8px;\n}\n\n.brm-filter-row > span {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-filter-row select,\n.brm-filter-row input {\n width: 96px;\n height: 26px;\n padding: 0 8px;\n border: 1px solid #dcdfe6;\n border-radius: 6px;\n background: #fff;\n color: #18191c;\n font: inherit;\n}\n\n.brm-filter-panel__meta {\n min-width: 0;\n display: grid;\n grid-template-columns: 44px minmax(0, 1fr);\n align-items: center;\n gap: 8px;\n}\n\n.brm-filter-panel__meta span {\n color: #9499a0;\n}\n\n.brm-filter-panel__meta strong {\n min-width: 0;\n color: #18191c;\n font-weight: 600;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-filter-panel__reset {\n align-self: flex-start;\n}\n\n.brm-search-results-panel {\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.brm-search-results-panel__summary {\n min-width: 0;\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 8px;\n}\n\n.brm-search-results-panel__summary span {\n min-width: 0;\n color: #61666d;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n}\n\n.brm-search-results-panel__summary button {\n padding: 0;\n border: 0;\n background: transparent;\n color: #008ac5;\n cursor: pointer;\n font: inherit;\n font-size: 12px;\n}\n\n.brm-search-result-list {\n max-height: 260px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n.brm-search-result-item {\n width: 100%;\n min-width: 0;\n padding: 7px;\n border: 1px solid #f0f0f0;\n border-radius: 6px;\n background: #fff;\n color: #18191c;\n cursor: pointer;\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n align-items: center;\n gap: 8px;\n text-align: left;\n font: inherit;\n transition:\n border-color 0.18s ease,\n background-color 0.18s ease;\n}\n\n.brm-search-result-item:hover {\n border-color: rgba(0, 174, 236, 0.42);\n background: rgba(0, 174, 236, 0.05);\n}\n\n.brm-search-result-item__main {\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.brm-search-result-item__name,\n.brm-search-result-item__meta {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-search-result-item__name {\n color: #18191c;\n font-size: 12px;\n font-weight: 600;\n}\n\n.brm-search-result-item__meta {\n color: #9499a0;\n font-size: 11px;\n}\n\n.brm-relation-list {\n max-height: 260px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n.brm-relation-item {\n width: 100%;\n min-width: 0;\n padding: 7px;\n border: 1px solid #f0f0f0;\n border-radius: 6px;\n background: #fff;\n color: #18191c;\n cursor: pointer;\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n align-items: center;\n gap: 8px;\n text-align: left;\n font: inherit;\n transition:\n border-color 0.18s ease,\n background-color 0.18s ease;\n}\n\n.brm-relation-item:hover {\n border-color: rgba(0, 174, 236, 0.42);\n background: rgba(0, 174, 236, 0.05);\n}\n\n.brm-relation-avatar {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: #f1f2f3;\n color: #61666d;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n font-size: 11px;\n font-weight: 700;\n}\n\n.brm-relation-avatar img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.brm-relation-item__main {\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.brm-relation-item__name,\n.brm-relation-item__uid {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.brm-relation-item__name {\n color: #18191c;\n font-size: 12px;\n font-weight: 600;\n}\n\n.brm-relation-item__uid {\n color: #9499a0;\n font-size: 11px;\n}\n\n.brm-relation-item > .brm-status-tag {\n grid-column: 1 / -1;\n width: fit-content;\n max-width: 100%;\n}\n\n.brm-theme-dark {\n border-color: #2f3134;\n background: #18191c;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-about-header {\n border-bottom-color: #2f3134;\n background: #242628;\n}\n\n.brm-theme-dark .brm-about-header span {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-standalone-topbar {\n border-bottom-color: #2f3134;\n background: #242628;\n}\n\n.brm-theme-dark .brm-standalone-heading span {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-theme-toggle {\n border-color: #2f3134;\n background: #242628;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-standalone-theme-toggle {\n border-color: #2f3134;\n background: #18191c;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-theme-toggle:hover,\n.brm-theme-dark .brm-standalone-theme-toggle:hover {\n border-color: #00aeec;\n color: #00aeec;\n}\n\n.brm-theme-dark .brm-theme-toggle__track,\n.brm-theme-dark .brm-standalone-theme-toggle .brm-theme-toggle__track {\n background: #00aeec;\n}\n\n.brm-theme-dark .brm-theme-toggle__thumb,\n.brm-theme-dark .brm-standalone-theme-toggle .brm-theme-toggle__thumb {\n background: #18191c;\n transform: translateX(14px);\n}\n\n.brm-theme-dark .brm-modal-close {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-modal-close:hover {\n background: #2f3134;\n color: #e7e9eb;\n}\n\n.brm-theme-dark.brm-standalone-app,\n.brm-theme-dark .brm-modal-body,\n.brm-theme-dark .brm-script-info {\n background: #18191c;\n}\n\n.brm-theme-dark .brm-hero-panel {\n background: linear-gradient(135deg, #00aeec 0%, #2468f2 100%);\n}\n\n.brm-theme-dark .brm-version-pill {\n background: rgba(24, 25, 28, 0.88);\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-info-card {\n border-color: #2f3134;\n background: #242628;\n}\n\n.brm-theme-dark .brm-info-card h3,\n.brm-theme-dark .brm-meta-list dd,\n.brm-theme-dark .brm-feature-item {\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-meta-list dt,\n.brm-theme-dark .brm-info-footer {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-info-footer {\n border-top-color: #2f3134;\n}\n\n.brm-theme-dark .brm-info-footer a {\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-info-footer a:hover {\n color: #00aeec;\n}\n\n.brm-theme-dark .brm-info-footer span {\n background: #2f3134;\n}\n\n.brm-theme-dark .brm-tag {\n background: rgba(0, 174, 236, 0.14);\n}\n\n.brm-theme-dark .brm-tag--green {\n background: rgba(47, 179, 68, 0.14);\n}\n\n.brm-theme-dark .brm-tag--cyan {\n background: rgba(32, 201, 151, 0.14);\n}\n\n.brm-theme-dark .brm-tag--orange {\n background: rgba(245, 159, 0, 0.14);\n}\n\n.brm-theme-dark .brm-tag--purple {\n background: rgba(116, 82, 194, 0.16);\n}\n\n.brm-theme-dark .brm-tag--magenta {\n background: rgba(214, 51, 132, 0.16);\n}\n\n.brm-theme-dark .brm-graph-view {\n background: #18191c;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-graph-canvas {\n border-color: #2f3134 !important;\n background: #18191c !important;\n}\n\n.brm-theme-dark .brm-toolbar-group--export,\n.brm-theme-dark .brm-toolbar-group--explore {\n border-left-color: #2f3134;\n}\n\n.brm-theme-dark .brm-graph-empty {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-graph-empty__title {\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-graph-empty--error .brm-graph-empty__title {\n color: #ffa8a8;\n}\n\n.brm-theme-dark .brm-sidebar-section + .brm-sidebar-section {\n border-top-color: #2f3134;\n}\n\n.brm-theme-dark .brm-sidebar-section__header,\n.brm-theme-dark .brm-sidebar-section__title {\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-sidebar-section__header:hover .brm-sidebar-section__title {\n color: #23c9ff;\n}\n\n.brm-theme-dark .brm-sidebar-section__chevron,\n.brm-theme-dark .brm-sidebar-section__badge {\n background: #2f3134;\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-debug-control {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-debug-control__number {\n border-color: #3a3d42;\n background: #242628;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-debug-control__select {\n border-color: #3a3d42;\n background: #242628;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-filter-panel {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-filter-panel__label {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-filter-panel__meta strong {\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-filter-row select,\n.brm-theme-dark .brm-filter-row input {\n border-color: #3a3d42;\n background: #242628;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-tab-panel--info,\n.brm-theme-dark .brm-graph-side-card {\n scrollbar-color: #4a4d52 #242628;\n}\n\n.brm-theme-dark .brm-graph-panel {\n border-color: #2f3134;\n background: #18191c;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-graph-status,\n.brm-theme-dark .brm-progress__detail,\n.brm-theme-dark .brm-progress__text,\n.brm-theme-dark .brm-stat__label,\n.brm-theme-dark .brm-selected-point {\n color: #9499a0 !important;\n}\n\n.brm-theme-dark .brm-status-tag {\n border-color: #3a3d42;\n background: #2f3134;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-status-tag--blue {\n border-color: rgba(0, 174, 236, 0.36);\n background: rgba(0, 174, 236, 0.14);\n color: #23c9ff;\n}\n\n.brm-theme-dark .brm-status-tag--green {\n border-color: rgba(47, 179, 68, 0.36);\n background: rgba(47, 179, 68, 0.14);\n color: #69db7c;\n}\n\n.brm-theme-dark .brm-status-tag--gold {\n border-color: rgba(245, 159, 0, 0.4);\n background: rgba(245, 159, 0, 0.16);\n color: #ffd43b;\n}\n\n.brm-theme-dark .brm-status-tag--magenta,\n.brm-theme-dark .brm-status-tag--purple {\n border-color: rgba(214, 51, 132, 0.36);\n background: rgba(214, 51, 132, 0.16);\n color: #faa2c1;\n}\n\n.brm-theme-dark .brm-status-tag--red {\n border-color: rgba(224, 49, 49, 0.36);\n background: rgba(224, 49, 49, 0.16);\n color: #ff8787;\n}\n\n.brm-theme-dark .brm-button,\n.brm-theme-dark .brm-icon-button,\n.brm-theme-dark .brm-search,\n.brm-theme-dark .brm-control select {\n border-color: #3a3d42;\n background: #242628;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-control,\n.brm-theme-dark .brm-checkbox-control {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-button:hover:not(:disabled),\n.brm-theme-dark .brm-icon-button:hover:not(:disabled) {\n border-color: #00aeec;\n background: #2f3134;\n color: #00aeec;\n}\n\n.brm-theme-dark .brm-button--primary,\n.brm-theme-dark .brm-button--primary:hover:not(:disabled),\n.brm-theme-dark .brm-search__submit {\n border-color: #00aeec;\n background: #00aeec;\n color: #fff;\n}\n\n.brm-theme-dark .brm-button:disabled,\n.brm-theme-dark .brm-icon-button:disabled {\n border-color: #2f3134;\n background: #242628;\n color: #61666d;\n}\n\n.brm-theme-dark .brm-search__input {\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-search__clear {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-search__submit {\n border-left-color: #00aeec;\n}\n\n.brm-theme-dark .brm-progress {\n background: #2f3134;\n}\n\n.brm-theme-dark .brm-stat {\n border-color: #2f3134;\n background: #242628;\n}\n\n.brm-theme-dark .brm-stat__value,\n.brm-theme-dark .brm-selected-point__name,\n.brm-theme-dark .brm-expanded-title,\n.brm-theme-dark .brm-notable-edges__title,\n.brm-theme-dark .brm-notable-edge-item__name,\n.brm-theme-dark .brm-edge-details__meta dd,\n.brm-theme-dark .brm-path-step__names,\n.brm-theme-dark .brm-relation-section__header h4,\n.brm-theme-dark .brm-search-result-item__name,\n.brm-theme-dark .brm-relation-item__name {\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-notable-edges,\n.brm-theme-dark .brm-path-panel,\n.brm-theme-dark .brm-relation-details {\n border-top-color: #2f3134;\n}\n\n.brm-theme-dark .brm-relation-section__header span,\n.brm-theme-dark .brm-path-step__index,\n.brm-theme-dark .brm-relation-avatar {\n background: #2f3134;\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-relation-empty,\n.brm-theme-dark .brm-edge-details__route,\n.brm-theme-dark .brm-edge-evidence,\n.brm-theme-dark .brm-search-result-item,\n.brm-theme-dark .brm-notable-edge-item,\n.brm-theme-dark .brm-path-chain,\n.brm-theme-dark .brm-path-step,\n.brm-theme-dark .brm-relation-item {\n border-color: #2f3134;\n background: #18191c;\n color: #e7e9eb;\n}\n\n.brm-theme-dark .brm-notable-edge-item:hover,\n.brm-theme-dark .brm-search-result-item:hover,\n.brm-theme-dark .brm-relation-item:hover {\n border-color: rgba(0, 174, 236, 0.48);\n background: rgba(0, 174, 236, 0.12);\n}\n\n.brm-theme-dark .brm-notable-edge-item__direction,\n.brm-theme-dark .brm-notable-edge-item__uid,\n.brm-theme-dark .brm-notable-edge-item__meta,\n.brm-theme-dark .brm-edge-details,\n.brm-theme-dark .brm-edge-details__uid,\n.brm-theme-dark .brm-edge-details__person > span,\n.brm-theme-dark .brm-edge-details__meta dt,\n.brm-theme-dark .brm-edge-evidence__header > span:last-child,\n.brm-theme-dark .brm-edge-evidence__body,\n.brm-theme-dark .brm-edge-evidence__query,\n.brm-theme-dark .brm-search-results-panel__summary span,\n.brm-theme-dark .brm-search-result-item__meta,\n.brm-theme-dark .brm-path-target,\n.brm-theme-dark .brm-path-arrow,\n.brm-theme-dark .brm-path-step__evidence,\n.brm-theme-dark .brm-relation-item__uid,\n.brm-theme-dark .brm-relation-empty {\n color: #9499a0;\n}\n\n.brm-theme-dark .brm-path-node {\n border-color: rgba(0, 174, 236, 0.36);\n background: rgba(0, 174, 236, 0.14);\n color: #23c9ff;\n}\n\n.brm-theme-dark .brm-edge-details__route button {\n color: #23c9ff;\n}\n\n.brm-theme-dark .brm-edge-details__verb {\n background: rgba(35, 201, 255, 0.14);\n color: #23c9ff;\n}\n\n.brm-theme-dark .brm-search-results-panel__summary button {\n color: #23c9ff;\n}\n\n.brm-theme-dark .brm-path-node:hover {\n border-color: rgba(0, 174, 236, 0.56);\n background: rgba(0, 174, 236, 0.2);\n}\n\n@media (max-width: 768px) {\n .brm-modal-backdrop {\n padding: 10px;\n }\n\n .brm-standalone-topbar {\n min-height: 58px;\n padding: 8px;\n align-items: flex-start;\n }\n\n .brm-standalone-heading h1 {\n max-width: 58vw;\n font-size: 14px;\n }\n\n .brm-standalone-actions {\n gap: 6px;\n }\n\n .brm-standalone-theme-toggle {\n padding: 0 6px;\n }\n\n .brm-standalone-theme-toggle .brm-theme-toggle__text {\n display: none;\n }\n\n .brm-standalone-content {\n padding: 6px;\n }\n\n .brm-modal-shell {\n height: calc(100vh - 20px);\n max-height: none;\n }\n\n .brm-theme-toggle {\n right: 46px;\n padding: 0 6px;\n }\n\n .brm-theme-toggle__text {\n display: none;\n }\n\n .brm-script-info {\n padding: 12px;\n }\n\n .brm-info-grid,\n .brm-feature-grid {\n grid-template-columns: 1fr;\n }\n}\n',""]);const a=s},6989:function(e,t,n){var r;!function(e,i){function o(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(t,n,t,i))||(i.exports=r):this.xor128=a}(0,e=n.nmd(e),n.amdD)},7308:function(e,t,n){var r;!function(e,i){function o(e){var t=this,n=function(){var e=4022871197,t=function(t){t=String(t);for(var n=0;n>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)};return t}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function a(e,t){var n=new o(e),r=t&&t.state,i=n.next;return i.int32=function(){return 4294967296*n.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,r&&("object"==typeof r&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(t,n,t,i))||(i.exports=r):this.alea=a}(0,e=n.nmd(e),n.amdD)},7372:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});var r=n(806);class i extends r.F{static defaultProps={...r.F.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"none",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1};get[Symbol.toStringTag](){return"Sampler"}constructor(e,t){super(e,t=i.normalizeProps(e,t),i.defaultProps)}static normalizeProps(e,t){return t}}},7713:function(e,t,n){var r;!function(i,o,s){var a,l=256,c=s.pow(l,6),u=s.pow(2,52),d=2*u,h=255;function f(e,t,n){var r=[],h=_(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(o)]:null==e?function(){try{var e;return a&&(e=a.randomBytes)?e=e(l):(e=new Uint8Array(l),(i.crypto||i.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=i.navigator,n=t&&t.plugins;return[+new Date,i,n,i.screen,y(o)]}}():e,3),r),f=new p(r),b=function(){for(var e=f.g(6),t=c,n=0;e=d;)e/=2,t/=2,n>>>=1;return(e+n)/t};return b.int32=function(){return 0|f.g(4)},b.quick=function(){return f.g(4)/4294967296},b.double=b,_(y(f.S),o),(t.pass||n||function(e,t,n,r){return r&&(r.S&&m(r,f),e.state=function(){return m(f,{})}),n?(s.random=e,t):e})(b,h,"global"in t?t.global:this==s,t.state)}function p(e){var t,n=e.length,r=this,i=0,o=r.i=r.j=0,s=r.S=[];for(n||(e=[n++]);i{"use strict";n.d(t,{eh:()=>i,gM:()=>o,x:()=>r});const r=globalThis,i=(globalThis.document,globalThis.process||{}),o=(globalThis.console,globalThis.navigator||{})},8049:(e,t,n)=>{"use strict";let r;function i(e){return(!r||r.byteLengtho,o:()=>i})},8074:(e,t,n)=>{"use strict";var r=n(8782);function i(e,t,n,r,i){this.mid=e,this.left=t,this.right=n,this.leftPoints=r,this.rightPoints=i,this.count=(t?t.count:0)+(n?n.count:0)+r.length}e.exports=function(e){if(!e||0===e.length)return new _(null);return new _(g(e))};var o=i.prototype;function s(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function a(e,t){var n=g(t);e.mid=n.mid,e.left=n.left,e.right=n.right,e.leftPoints=n.leftPoints,e.rightPoints=n.rightPoints,e.count=n.count}function l(e,t){var n=e.intervals([]);n.push(t),a(e,n)}function c(e,t){var n=e.intervals([]),r=n.indexOf(t);return r<0?0:(n.splice(r,1),a(e,n),1)}function u(e,t,n){for(var r=0;r=0&&e[r][1]>=t;--r){var i=n(e[r]);if(i)return i}}function h(e,t){for(var n=0;n>1],o=[],s=[],a=[];for(n=0;n3*(t+1)?l(this,e):this.left.insert(e):this.left=g([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?l(this,e):this.right.insert(e):this.right=g([e]);else{var n=r.ge(this.leftPoints,e,p),i=r.ge(this.rightPoints,e,m);this.leftPoints.splice(n,0,e),this.rightPoints.splice(i,0,e)}},o.remove=function(e){var t=this.count-this.leftPoints;if(e[1]3*(t-1)?c(this,e):2===(a=this.left.remove(e))?(this.left=null,this.count-=1,1):(1===a&&(this.count-=1),a):0;if(e[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(t-1)?c(this,e):2===(a=this.right.remove(e))?(this.right=null,this.count-=1,1):(1===a&&(this.count-=1),a):0;if(1===this.count)return this.leftPoints[0]===e?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===e){if(this.left&&this.right){for(var n=this,i=this.left;i.right;)n=i,i=i.right;if(n===this)i.right=this.right;else{var o=this.left,a=this.right;n.count-=i.count,n.right=i.left,i.left=o,i.right=a}s(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?s(this,this.left):s(this,this.right);return 1}for(o=r.ge(this.leftPoints,e,p);othis.mid){var n;if(this.right)if(n=this.right.queryPoint(e,t))return n;return d(this.rightPoints,e,t)}return h(this.leftPoints,t)},o.queryInterval=function(e,t,n){var r;if(ethis.mid&&this.right&&(r=this.right.queryInterval(e,t,n)))return r;return tthis.mid?d(this.rightPoints,e,n):h(this.leftPoints,n)};var y=_.prototype;y.insert=function(e){this.root?this.root.insert(e):this.root=new i(e[0],null,null,[e],[e])},y.remove=function(e){if(this.root){var t=this.root.remove(e);return 2===t&&(this.root=null),0!==t}return!1},y.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},y.queryInterval=function(e,t,n){if(e<=t&&this.root)return this.root.queryInterval(e,t,n)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},8143:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(9481)},8722:(e,t,n)=>{"use strict";async function r(e,t){const n=document.getElementsByTagName("head")[0];if(!n)throw new Error("loadScript");const r=document.createElement("script");return r.setAttribute("type","text/javascript"),r.setAttribute("src",e),t&&(r.id=t),new Promise((t,i)=>{r.onload=t,r.onerror=t=>i(new Error(`Unable to load script '${e}': ${t}`)),n.appendChild(r)})}n.d(t,{k:()=>r})},8782:e=>{"use strict";function t(e,t,n,r,i){for(var o=i+1;r<=i;){var s=r+i>>>1,a=e[s];(void 0!==n?n(a,t):a-t)>=0?(o=s,i=s-1):r=s+1}return o}function n(e,t,n,r,i){for(var o=i+1;r<=i;){var s=r+i>>>1,a=e[s];(void 0!==n?n(a,t):a-t)>0?(o=s,i=s-1):r=s+1}return o}function r(e,t,n,r,i){for(var o=r-1;r<=i;){var s=r+i>>>1,a=e[s];(void 0!==n?n(a,t):a-t)<0?(o=s,r=s+1):i=s-1}return o}function i(e,t,n,r,i){for(var o=r-1;r<=i;){var s=r+i>>>1,a=e[s];(void 0!==n?n(a,t):a-t)<=0?(o=s,r=s+1):i=s-1}return o}function o(e,t,n,r,i){for(;r<=i;){var o=r+i>>>1,s=e[o],a=void 0!==n?n(s,t):s-t;if(0===a)return o;a<=0?r=o+1:i=o-1}return-1}function s(e,t,n,r,i,o){return"function"==typeof n?o(e,t,n,void 0===r?0:0|r,void 0===i?e.length-1:0|i):o(e,t,void 0,void 0===n?0:0|n,void 0===r?e.length-1:0|r)}e.exports={ge:function(e,n,r,i,o){return s(e,n,r,i,o,t)},gt:function(e,t,r,i,o){return s(e,t,r,i,o,n)},lt:function(e,t,n,i,o){return s(e,t,n,i,o,r)},le:function(e,t,n,r,o){return s(e,t,n,r,o,i)},eq:function(e,t,n,r,i){return s(e,t,n,r,i,o)}}},8854:(e,t,n)=>{"use strict";n.d(t,{M:()=>a,P:()=>s});var r=n(5932),i=n(1976),o=n(4394);function s(e,t){const n={};for(const r of e.attributes){const i=l(e,t,r.name);i&&(n[r.name]=i)}return n}function a(e,t,n=16){const r=s(e,t),i=new Array(n).fill(null);for(const e of Object.values(r))i[e.location]=e;return i}function l(e,t,n){const s=function(e,t){const n=e.attributes.find(e=>e.name===t);n||r.R.warn(`shader layout attribute "${t}" not present in shader`);return n||null}(e,n),a=function(e,t){c(e);let n=function(e,t){for(const n of e)if(n.format&&n.name===t)return{attributeName:n.name,bufferName:t,stepMode:n.stepMode,vertexFormat:n.format,byteOffset:0,byteStride:n.byteStride||0};return null}(e,t);if(n)return n;if(n=function(e,t){for(const n of e){let e=n.byteStride;if("number"!=typeof n.byteStride)for(const t of n.attributes||[]){ // @ts-ignore e+=(0,o.yx)(t.format).byteLength}const r=n.attributes?.find(e=>e.attribute===t);if(r)return{attributeName:r.attribute,bufferName:n.name,stepMode:n.stepMode,vertexFormat:r.format,byteOffset:r.byteOffset, // @ts-ignore byteStride:e}}return null}(e,t),n)return n;return r.R.warn(`layout for attribute "${t}" not present in buffer layout`),null}(t,n);if(!s)return null;const l=(0,i.wH)(s.type),u=(0,o.Mz)(l),d=a?.vertexFormat||u,h=(0,o.yx)(d);return{attributeName:a?.attributeName||s.name,bufferName:a?.bufferName||s.name,location:s.location,shaderType:s.type,primitiveType:l.primitiveType,shaderComponents:l.components,vertexFormat:d,bufferDataType:h.type,bufferComponents:h.components,normalized:h.normalized,integer:l.integer,stepMode:a?.stepMode||s.stepMode||"vertex",byteOffset:a?.byteOffset||0,byteStride:a?.byteStride||0}}function c(e){for(const t of e)(t.attributes&&t.format||!t.attributes&&!t.format)&&r.R.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}},8938:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},8993:function(e,t,n){var r;!function(e,i){function o(e){var t=this;t.next=function(){var e,n,r=t.w,i=t.X,o=t.i;return t.w=r=r+1640531527|0,n=i[o+34&127],e=i[o=o+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=i[o]=n^e,t.i=o,n+(r^r>>>16)|0},function(e,t){var n,r,i,o,s,a=[],l=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,l=Math.max(l,t.length)),i=0,o=-32;o>>15,r^=r<<4,r^=r>>>13,o>=0&&(s=s+1640531527|0,i=0==(n=a[127&o]^=r+s)?i+1:0);for(i>=128&&(a[127&(t&&t.length||0)]=-1),i=127,o=512;o>0;--o)r=a[i+34&127],n=a[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,a[i]=r^n;e.w=s,e.X=a,e.i=i}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function a(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&(r.X&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(t,n,t,i))||(i.exports=r):this.xor4096=a}(0,e=n.nmd(e),n.amdD)},9263:()=>{"use strict"},9481:(e,t,n)=>{"use strict";var r=n(758),i=n(1896);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n