@luma.gl/core 9.1.0-alpha.17 → 9.1.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,7 +45,7 @@ export class Luma {
45
45
  VERSION =
46
46
  // Version detection using build plugin
47
47
  // @ts-expect-error no-undef
48
- typeof "9.1.0-alpha.17" !== 'undefined' ? "9.1.0-alpha.17" : 'running from source';
48
+ typeof "9.1.0-alpha.18" !== 'undefined' ? "9.1.0-alpha.18" : 'running from source';
49
49
  spector;
50
50
  preregisteredAdapters = new Map();
51
51
  constructor() {
@@ -13,13 +13,13 @@ export type RenderPassProps = ResourceProps & {
13
13
  /** Control viewport, scissor rect, blend constant and stencil ref */
14
14
  parameters?: RenderPassParameters;
15
15
  /** Clear value for color attachment, or false to preserve the previous value */
16
- clearColor?: NumberArray4 | TypedArray | boolean;
17
- /** Experimental: Clear color values for multiple color attachments. Must specify typed arrays */
16
+ clearColor?: NumberArray4 | TypedArray | false;
17
+ /** Experimental: Clear color values for multiple color attachments. Must specify typed arrays. props.clearColor will be ignored. */
18
18
  clearColors?: (TypedArray | false)[];
19
- /** Clear value for depth attachment (true === `1`), or false to preserve the previous value */
20
- clearDepth?: number | boolean;
21
- /** Clear value for stencil attachment (true === `0`), or false to preserve the previous value */
22
- clearStencil?: number | boolean;
19
+ /** Clear value for depth attachment (true === `1`), or false to preserve the previous value. Must be between 0.0 (near) and 1.0 (far), inclusive. */
20
+ clearDepth?: number | false;
21
+ /** Clear value for stencil attachment (true === `0`), or false to preserve the previous value. Converted to the type and number of LSBs as the number of bits in the stencil aspect */
22
+ clearStencil?: number | false;
23
23
  /** Indicates that the depth component is read only. */
24
24
  depthReadOnly?: boolean;
25
25
  /** Indicates that the stencil component is read only. */
@@ -44,6 +44,12 @@ export type RenderPassProps = ResourceProps & {
44
44
  * - a couple of mutable parameters ()
45
45
  */
46
46
  export declare abstract class RenderPass extends Resource<RenderPassProps> {
47
+ /** TODO - should be [0, 0, 0, 0], update once deck.gl tests run clean */
48
+ static defaultClearColor: [number, number, number, number];
49
+ /** Depth 1.0 represents the far plance */
50
+ static defaultClearDepth: number;
51
+ /** Clears all stencil bits */
52
+ static defaultClearStencil: number;
47
53
  /** Default properties for RenderPass */
48
54
  static defaultProps: Required<RenderPassProps>;
49
55
  get [Symbol.toStringTag](): string;
@@ -1 +1 @@
1
- {"version":3,"file":"render-pass.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/render-pass.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,KAAK,EAAC,oBAAoB,EAAC,+BAA4B;AAE9D,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,EAAC,WAAW,EAAC,yBAAsB;AAC1C,OAAO,EAAC,QAAQ,EAAC,uBAAoB;AAErC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,yGAAyG;IACzG,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,qEAAqE;IACrE,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAIlC,gFAAgF;IAChF,UAAU,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,OAAO,CAAC;IACjD,iGAAiG;IACjG,WAAW,CAAC,EAAE,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,CAAC;IACrC,+FAA+F;IAC/F,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,iGAAiG;IACjG,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAEhC,uDAAuD;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,gD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E,0CAA0C;IAC1C,MAAM,CAAC,iBAAiB,SAAK;IAC7B,8BAA8B;IAC9B,MAAM,CAAC,mBAAmB,SAAK;IAE/B,wCAAwC;IACxC,OAAgB,YAAY,EAAE,QAAQ,CAAC,eAAe,CAAC,CAgBrD;IAEF,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAE1C;gBAEW,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe;IAKlD,gDAAgD;IAChD,QAAQ,CAAC,GAAG,IAAI,IAAI;IAEpB,wGAAwG;IACxG,QAAQ,CAAC,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG,IAAI;IAI9D,gIAAgI;IAChI,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACtD,2FAA2F;IAC3F,QAAQ,CAAC,iBAAiB,IAAI,IAAI;IAElC,kEAAkE;IAClE,QAAQ,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACjD,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,IAAI,IAAI;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAErD,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,eAAe;CAMzF"}
@@ -12,15 +12,21 @@ import { Resource } from "./resource.js";
12
12
  * - a couple of mutable parameters ()
13
13
  */
14
14
  export class RenderPass extends Resource {
15
+ /** TODO - should be [0, 0, 0, 0], update once deck.gl tests run clean */
16
+ static defaultClearColor = [0, 0, 0, 1];
17
+ /** Depth 1.0 represents the far plance */
18
+ static defaultClearDepth = 1;
19
+ /** Clears all stencil bits */
20
+ static defaultClearStencil = 0;
15
21
  /** Default properties for RenderPass */
16
22
  static defaultProps = {
17
23
  ...Resource.defaultProps,
18
24
  framebuffer: null,
19
25
  parameters: undefined,
20
- clearColor: false,
26
+ clearColor: RenderPass.defaultClearColor,
21
27
  clearColors: undefined,
22
- clearDepth: false,
23
- clearStencil: false,
28
+ clearDepth: RenderPass.defaultClearDepth,
29
+ clearStencil: RenderPass.defaultClearStencil,
24
30
  depthReadOnly: false,
25
31
  stencilReadOnly: false,
26
32
  discard: false,
@@ -38,8 +44,8 @@ export class RenderPass extends Resource {
38
44
  }
39
45
  static normalizeProps(device, props) {
40
46
  // Intended to override e.g. set default clear values to true
41
- const overrideProps = device.props._resourceDefaults?.renderPass;
42
- const newProps = { ...overrideProps, ...props };
47
+ const overriddenDefaultProps = device.props._resourceDefaults?.renderPass;
48
+ const newProps = { ...overriddenDefaultProps, ...props };
43
49
  return newProps;
44
50
  }
45
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sampler.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/sampler.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,EAAC,eAAe,EAAC,+BAA4B;AACpD,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AAEnD,gCAAgC;AAChC,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG,QAAQ,GAAG,eAAe,CAAC;AAE9E,6BAA6B;AAC7B,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG;IACzC,iGAAiG;IACjG,IAAI,CAAC,EAAE,eAAe,GAAG,oBAAoB,CAAC;IAC9C,yCAAyC;IACzC,YAAY,CAAC,EAAE,eAAe,GAAG,QAAQ,GAAG,eAAe,CAAC;IAC5D,yCAAyC;IACzC,YAAY,CAAC,EAAE,eAAe,GAAG,QAAQ,GAAG,eAAe,CAAC;IAC5D,yCAAyC;IACzC,YAAY,CAAC,EAAE,eAAe,GAAG,QAAQ,GAAG,eAAe,CAAC;IAE5D,uFAAuF;IACvF,SAAS,CAAC,EAAE,SAA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(device, props) {
29
- const overrideProps = device?.props?._resourceDefaults?.sampler || {};
30
- const newProps = { ...props, ...overrideProps };
29
+ const overriddenDefaultProps = device?.props?._resourceDefaults?.sampler || {};
30
+ const newProps = { ...props, ...overriddenDefaultProps };
31
31
  return newProps;
32
32
  }
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"texture.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/texture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,KAAK,EAAC,UAAU,EAAC,uBAAoB;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAC,gDAA6C;AACxE,OAAO,KAAK,EAAC,WAAW,EAAE,gBAAgB,EAAC,0BAAuB;AAClE,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,EAAC,OAAO,EAAE,YAAY,EAAC,qBAAkB;AAEhD;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAChC,KAAK,GACL,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,GACL,MAAM,GACN,MAAM,CAAC;AAEX,kCAAkC;AAClC,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IAEf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,SAAS,GACT,gBAAgB,GAChB,gBAAgB,GAChB,UAAU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M,EAAE,KAAK,EAAE,YAAY,GAAG,YAAY;CAmBnF"}
@@ -212,9 +212,9 @@ export class Texture extends Resource {
212
212
  static normalizeProps(device, props) {
213
213
  const newProps = { ...props };
214
214
  // Allow device to override props (e.g. props.mipmaps)
215
- const overrideProps = device?.props?._resourceDefaults?.texture || {};
215
+ const overriddenDefaultProps = device?.props?._resourceDefaults?.texture || {};
216
216
  // TODO - Type issue with props.data circumvented with Object.assign
217
- Object.assign(newProps, overrideProps);
217
+ Object.assign(newProps, overriddenDefaultProps);
218
218
  // Ensure we have integer coordinates
219
219
  const { width, height } = newProps;
220
220
  if (typeof width === 'number') {
@@ -0,0 +1,11 @@
1
+ import type { BufferLayout } from "../adapter/types/buffer-layout.js";
2
+ /** BufferLayoutHelper is a helper class that should not be used directly by applications */
3
+ export declare class BufferLayoutHelper {
4
+ bufferLayouts: BufferLayout[];
5
+ constructor(bufferLayouts: BufferLayout[]);
6
+ getBufferLayout(name: string): BufferLayout | null;
7
+ /** Get attribute names from a BufferLayout */
8
+ getAttributeNamesForBuffer(bufferLayout: BufferLayout): string[];
9
+ mergeBufferLayouts(bufferLayouts1: BufferLayout[], bufferLayouts2: BufferLayout[]): BufferLayout[];
10
+ }
11
+ //# sourceMappingURL=buffer-layout-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer-layout-helper.d.ts","sourceRoot":"","sources":["../../src/adapter-utils/buffer-layout-helper.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAC,0CAAuC;AAEjE,4FAA4F;AAC5F,qBAAa,kBAAkB;IAC7B,aAAa,EAAE,YAAY,EAAE,CAAC;gBAElB,aAAa,EAAE,YAAY,EAAE;IAIzC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAIlD,8CAA8C;IAC9C,0BAA0B,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,EAAE;IAMhE,kBAAkB,CAChB,cAAc,EAAE,YAAY,EAAE,EAC9B,cAAc,EAAE,YAAY,EAAE,GAC7B,YAAY,EAAE;CAYlB"}
@@ -0,0 +1,32 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ /** BufferLayoutHelper is a helper class that should not be used directly by applications */
5
+ export class BufferLayoutHelper {
6
+ bufferLayouts;
7
+ constructor(bufferLayouts) {
8
+ this.bufferLayouts = bufferLayouts;
9
+ }
10
+ getBufferLayout(name) {
11
+ return this.bufferLayouts.find(layout => layout.name === name) || null;
12
+ }
13
+ /** Get attribute names from a BufferLayout */
14
+ getAttributeNamesForBuffer(bufferLayout) {
15
+ return bufferLayout.attributes
16
+ ? bufferLayout.attributes?.map(layout => layout.attribute)
17
+ : [bufferLayout.name];
18
+ }
19
+ mergeBufferLayouts(bufferLayouts1, bufferLayouts2) {
20
+ const mergedLayouts = [...bufferLayouts1];
21
+ for (const attribute of bufferLayouts2) {
22
+ const index = mergedLayouts.findIndex(attribute2 => attribute2.name === attribute.name);
23
+ if (index < 0) {
24
+ mergedLayouts.push(attribute);
25
+ }
26
+ else {
27
+ mergedLayouts[index] = attribute;
28
+ }
29
+ }
30
+ return mergedLayouts;
31
+ }
32
+ }
package/dist/dist.dev.js CHANGED
@@ -57,6 +57,7 @@ var __exports__ = (() => {
57
57
  UniformBufferLayout: () => UniformBufferLayout,
58
58
  UniformStore: () => UniformStore,
59
59
  VertexArray: () => VertexArray,
60
+ _BufferLayoutHelper: () => BufferLayoutHelper,
60
61
  decodeShaderAttributeType: () => decodeShaderAttributeType,
61
62
  decodeShaderUniformType: () => decodeShaderUniformType,
62
63
  decodeTextureFormat: () => decodeTextureFormat,
@@ -1957,8 +1958,8 @@ var __exports__ = (() => {
1957
1958
  /** Ensure we have integer coordinates */
1958
1959
  static normalizeProps(device, props) {
1959
1960
  const newProps = { ...props };
1960
- const overrideProps = device?.props?._resourceDefaults?.texture || {};
1961
- Object.assign(newProps, overrideProps);
1961
+ const overriddenDefaultProps = device?.props?._resourceDefaults?.texture || {};
1962
+ Object.assign(newProps, overriddenDefaultProps);
1962
1963
  const { width, height } = newProps;
1963
1964
  if (typeof width === "number") {
1964
1965
  newProps.width = Math.max(1, Math.ceil(width));
@@ -2230,8 +2231,8 @@ ${htmlLog}
2230
2231
  super(device, props, _Sampler.defaultProps);
2231
2232
  }
2232
2233
  static normalizeProps(device, props) {
2233
- const overrideProps = device?.props?._resourceDefaults?.sampler || {};
2234
- const newProps = { ...props, ...overrideProps };
2234
+ const overriddenDefaultProps = device?.props?._resourceDefaults?.sampler || {};
2235
+ const newProps = { ...props, ...overriddenDefaultProps };
2235
2236
  return newProps;
2236
2237
  }
2237
2238
  };
@@ -2444,21 +2445,27 @@ ${htmlLog}
2444
2445
  super(device, props, _RenderPass.defaultProps);
2445
2446
  }
2446
2447
  static normalizeProps(device, props) {
2447
- const overrideProps = device.props._resourceDefaults?.renderPass;
2448
- const newProps = { ...overrideProps, ...props };
2448
+ const overriddenDefaultProps = device.props._resourceDefaults?.renderPass;
2449
+ const newProps = { ...overriddenDefaultProps, ...props };
2449
2450
  return newProps;
2450
2451
  }
2451
2452
  };
2452
2453
  var RenderPass = _RenderPass;
2454
+ /** TODO - should be [0, 0, 0, 0], update once deck.gl tests run clean */
2455
+ __publicField(RenderPass, "defaultClearColor", [0, 0, 0, 1]);
2456
+ /** Depth 1.0 represents the far plance */
2457
+ __publicField(RenderPass, "defaultClearDepth", 1);
2458
+ /** Clears all stencil bits */
2459
+ __publicField(RenderPass, "defaultClearStencil", 0);
2453
2460
  /** Default properties for RenderPass */
2454
2461
  __publicField(RenderPass, "defaultProps", {
2455
2462
  ...Resource.defaultProps,
2456
2463
  framebuffer: null,
2457
2464
  parameters: void 0,
2458
- clearColor: false,
2465
+ clearColor: _RenderPass.defaultClearColor,
2459
2466
  clearColors: void 0,
2460
- clearDepth: false,
2461
- clearStencil: false,
2467
+ clearDepth: _RenderPass.defaultClearDepth,
2468
+ clearStencil: _RenderPass.defaultClearStencil,
2462
2469
  depthReadOnly: false,
2463
2470
  stencilReadOnly: false,
2464
2471
  discard: false,
@@ -3220,6 +3227,33 @@ ${htmlLog}
3220
3227
  }
3221
3228
  return `${dataType}x${components}`;
3222
3229
  }
3230
+
3231
+ // src/adapter-utils/buffer-layout-helper.ts
3232
+ var BufferLayoutHelper = class {
3233
+ bufferLayouts;
3234
+ constructor(bufferLayouts) {
3235
+ this.bufferLayouts = bufferLayouts;
3236
+ }
3237
+ getBufferLayout(name2) {
3238
+ return this.bufferLayouts.find((layout) => layout.name === name2) || null;
3239
+ }
3240
+ /** Get attribute names from a BufferLayout */
3241
+ getAttributeNamesForBuffer(bufferLayout) {
3242
+ return bufferLayout.attributes ? bufferLayout.attributes?.map((layout) => layout.attribute) : [bufferLayout.name];
3243
+ }
3244
+ mergeBufferLayouts(bufferLayouts1, bufferLayouts2) {
3245
+ const mergedLayouts = [...bufferLayouts1];
3246
+ for (const attribute of bufferLayouts2) {
3247
+ const index = mergedLayouts.findIndex((attribute2) => attribute2.name === attribute.name);
3248
+ if (index < 0) {
3249
+ mergedLayouts.push(attribute);
3250
+ } else {
3251
+ mergedLayouts[index] = attribute;
3252
+ }
3253
+ }
3254
+ return mergedLayouts;
3255
+ }
3256
+ };
3223
3257
  return __toCommonJS(bundle_exports);
3224
3258
  })();
3225
3259
  return __exports__;
package/dist/dist.min.js CHANGED
@@ -4,15 +4,15 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['luma'] = factory();
6
6
  else root['luma'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var te=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var vt=Object.prototype.hasOwnProperty;var Et=(r,e,t)=>e in r?te(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Pt=(r,e)=>{for(var t in e)te(r,t,{get:e[t],enumerable:!0})},_t=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of At(e))!vt.call(r,s)&&s!==t&&te(r,s,{get:()=>e[s],enumerable:!(n=St(e,s))||n.enumerable});return r};var Ct=r=>_t(te({},"__esModule",{value:!0}),r);var a=(r,e,t)=>(Et(r,typeof e!="symbol"?e+"":e,t),t);var gr={};Pt(gr,{Adapter:()=>me,Buffer:()=>m,CanvasContext:()=>H,CommandBuffer:()=>q,CommandEncoder:()=>Z,ComputePass:()=>X,ComputePipeline:()=>Y,Device:()=>E,DeviceFeatures:()=>de,DeviceLimits:()=>le,ExternalTexture:()=>k,Framebuffer:()=>W,QuerySet:()=>ee,RenderPass:()=>j,RenderPipeline:()=>O,Resource:()=>c,Sampler:()=>V,Shader:()=>G,Texture:()=>h,TextureView:()=>z,TransformFeedback:()=>Q,UniformBlock:()=>I,UniformBufferLayout:()=>R,UniformStore:()=>xe,VertexArray:()=>J,decodeShaderAttributeType:()=>ge,decodeShaderUniformType:()=>be,decodeTextureFormat:()=>ot,decodeVertexFormat:()=>K,getAttributeInfosFromLayouts:()=>ze,getDataTypeFromTypedArray:()=>Oe,getScratchArray:()=>gt,getTypedArrayFromDataType:()=>wt,getVertexFormatFromAttribute:()=>Tt,log:()=>f,luma:()=>at});var re=globalThis,Lt=globalThis.document||{},ne=globalThis.process||{},Mt=globalThis.console,yr=globalThis.navigator||{};function je(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let e=typeof navigator<"u"&&navigator.userAgent,t=r||e;return Boolean(t&&t.indexOf("Electron")>=0)}function y(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||je()}var Te="4.0.7";function D(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var A=class{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=D(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(D()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var P=class{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(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let t of Object.values(this.stats))e(t)}getTable(){let 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(t=>this._getOrCreate(t))}_getOrCreate(e){let{name:t,type:n}=e,s=this.stats[t];return s||(e instanceof A?s=e:s=new A(t,n),this.stats[t]=s),s}};var Se=class{stats=new Map;getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new P({id:e})),this.stats.get(e)}},se=new Se;function Rt(r){try{let e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}var oe=class{constructor(e,t,n="sessionStorage"){this.storage=Rt(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){let t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function Ye(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function Xe(r,e=8){let t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var ie;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ie||(ie={}));var It=10;function Ze(r){return typeof r!="string"?r:(r=r.toUpperCase(),ie[r]||ie.WHITE)}function qe(r,e,t){return!y&&typeof r=="string"&&(e&&(r=`\x1B[${Ze(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${Ze(t)+It}m${r}\x1B[49m`)),r}function Ke(r,e=["constructor"]){let t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),s=r;for(let o of n){let i=s[o];typeof i=="function"&&(e.find(u=>o===u)||(s[o]=i.bind(r)))}}function $(r,e){if(!r)throw new Error(e||"Assertion failed")}function v(){let r;if(y()&&re.performance)r=re?.performance?.now?.();else if("hrtime"in ne){let e=ne?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var _={debug:y()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Dt={enabled:!0,level:0};function C(){}var Je={},Qe={once:!0},T=class{constructor({id:e}={id:""}){this.VERSION=Te,this._startTs=v(),this._deltaTs=v(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new oe(`__probe-${this.id}__`,Dt),this.timeStamp(`${this.id} started`),Ke(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((v()-this._startTs).toPrecision(10))}getDelta(){return Number((v()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[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){return this._getLogFunction(0,e,_.warn,arguments,Qe)}error(e){return this._getLogFunction(0,e,_.error,arguments)}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){return this._getLogFunction(e,t,_.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,_.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,_.debug||_.info,arguments,Qe)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||C,n&&[n],{tag:Ft(t)}):C}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||C)}group(e,t,n={collapsed:!1}){let s=et({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return s.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||C)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=tt(e)}_getLogFunction(e,t,n,s,o){if(this._shouldLog(e)){o=et({logLevel:e,message:t,args:s,opts:o}),n=n||o.method,$(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=v();let i=o.tag||o.message;if(o.once&&i)if(!Je[i])Je[i]=v();else return C;return t=$t(this.id,o.message,o),n.bind(console,t,...o.args)}return C}};T.VERSION=Te;function tt(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return $(Number.isFinite(e)&&e>=0),e}function et(r){let{logLevel:e,message:t}=r;r.logLevel=tt(e);let n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break;default:}typeof r.message=="function"&&(r.message=r.message());let s=typeof r.message;return $(s==="string"||s==="object"),Object.assign(r,{args:n},r.opts)}function $t(r,e,t){if(typeof e=="string"){let n=t.time?Xe(Ye(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=qe(e,t.color,t.background)}return e}function Ft(r){for(let e in r)for(let t in r[e])return t||"untitled";return"empty"}globalThis.probe={};var en=new T({id:"@probe.gl/log"});var f=new T({id:"luma.gl"});var Ae={};function L(r="id"){Ae[r]=Ae[r]||1;let e=Ae[r]++;return`${r}-${e}`}var c=class{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=Nt(t,n);let s=this.props.id!=="undefined"?this.props.id:L(this[Symbol.toStringTag]);this.props.id=s,this.id=s,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}toString(){return`${this[Symbol.toStringTag]||this.constructor.name}(${this.id})`}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(let e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get(`${t}s Active`).decrementCount()}trackAllocatedMemory(e,t=this[Symbol.toStringTag]){let 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]){let 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(){let 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()}};a(c,"defaultProps",{id:"undefined",handle:void 0,userData:void 0});function Nt(r,e){let t={...e};for(let n in r)r[n]!==void 0&&(t[n]=r[n]);return t}var F=class extends c{get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(e,t){let n={...t};(t.usage||0)&F.INDEX&&!t.indexType&&(t.data instanceof Uint32Array?n.indexType="uint32":t.data instanceof Uint16Array&&(n.indexType="uint16")),delete n.data,super(e,n,F.defaultProps),this.usage=n.usage||0,this.indexType=n.indexType,this.updateTimestamp=e.incrementTimestamp()}clone(e){return this.device.createBuffer({...this.props,...e})}readSyncWebGL(e,t){throw new Error("not implemented")}debugData=new ArrayBuffer(0);_setDebugData(e,t,n){let s=ArrayBuffer.isView(e)?e.buffer:e,o=Math.min(e?e.byteLength:n,F.DEBUG_DATA_MAX_LENGTH);s===null?this.debugData=new ArrayBuffer(o):t===0&&n===s.byteLength?this.debugData=s.slice(0,o):this.debugData=s.slice(t,t+o)}},m=F;a(m,"defaultProps",{...c.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1}),a(m,"MAP_READ",1),a(m,"MAP_WRITE",2),a(m,"COPY_SRC",4),a(m,"COPY_DST",8),a(m,"INDEX",16),a(m,"VERTEX",32),a(m,"UNIFORM",64),a(m,"STORAGE",128),a(m,"INDIRECT",256),a(m,"QUERY_RESOLVE",512),a(m,"DEBUG_DATA_MAX_LENGTH",32);function ae(r){let e=rt[r],t=Ut(e),n=r.includes("norm"),s=!n&&!r.startsWith("float"),o=r.startsWith("s");return{dataType:rt[r],byteLength:t,integer:s,signed:o,normalized:n}}function Ut(r){return Ht[r]}var rt={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},Ht={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};var p="texture-compression-bc",d="texture-compression-astc",x="texture-compression-etc2",zt="texture-compression-etc1-webgl",ce="texture-compression-pvrtc-webgl",ve="texture-compression-atc-webgl",ue="float32-renderable-webgl",Ee="float16-renderable-webgl",kt="rgb9e5ufloat_renderable-webgl",Pe="snorm8-renderable-webgl",N="norm16-renderable-webgl",_e="snorm16-renderable-webgl",fe="float32-filterable",nt="float16-filterable-webgl",st={r8unorm:{bpp:1,c:1},r8snorm:{bpp:1,c:1,render:Pe},r8uint:{bpp:1,c:1},r8sint:{bpp:1,c:1},rg8unorm:{bpp:2,c:2},rg8snorm:{bpp:2,c:2,render:Pe},rg8uint:{bpp:2,c:2},rg8sint:{bpp:2,c:2},r16uint:{bpp:2,c:1},r16sint:{bpp:2,c:1},r16float:{bpp:2,c:1,render:Ee,filter:"float16-filterable-webgl"},"r16unorm-webgl":{b:2,c:1,f:N},"r16snorm-webgl":{b:2,c:1,f:_e},"rgba4unorm-webgl":{channels:"rgba",bpp:2,bitsPerChannel:[4,4,4,4],packed:!0},"rgb565unorm-webgl":{channels:"rgb",bpp:2,bitsPerChannel:[5,6,5,0],packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bpp:2,bitsPerChannel:[5,5,5,1],packed:!0},"rgb8unorm-webgl":{bpp:3,c:3,wgpu:!1},"rgb8snorm-webgl":{bpp:3,c:3,wgpu:!1},rgba8unorm:{c:2,bpp:4,bitsPerChannel:[8,8,8,8]},"rgba8unorm-srgb":{c:4,bpp:4,bitsPerChannel:[8,8,8,8]},rgba8snorm:{bpp:4,c:4,bitsPerChannel:[8,8,8,8],render:Pe},rgba8uint:{c:4,bpp:4,bitsPerChannel:[8,8,8,8]},rgba8sint:{c:4,bpp:4,bitsPerChannel:[8,8,8,8]},bgra8unorm:{bpp:4,c:4},"bgra8unorm-srgb":{bpp:4,c:4},rg16uint:{c:1,bpp:4},rg16sint:{c:2,bpp:4},rg16float:{c:2,bpp:4,render:Ee,filter:nt},"rg16unorm-webgl":{b:2,c:2,render:N},"rg16snorm-webgl":{b:2,c:2,render:_e},r32uint:{c:1,bpp:4},r32sint:{c:1,bpp:4},r32float:{c:1,bpp:4,render:ue,filter:fe},rgb9e5ufloat:{channels:"rgb",packed:!0,c:3,bpp:4,p:1,render:kt},rg11b10ufloat:{channels:"rgb",c:3,bpp:4,bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:ue},rgb10a2unorm:{channels:"rgba",c:4,bpp:4,bitsPerChannel:[10,10,10,2],packed:!0,p:1},"rgb10a2uint-webgl":{channels:"rgba",c:4,bpp:4,bitsPerChannel:[10,10,10,2],packed:!0,p:1,wgpu:!1},"rgb16unorm-webgl":{b:2,c:3,f:N},"rgb16snorm-webgl":{b:2,c:3,f:N},rg32uint:{bpp:8,c:2,bitsPerChannel:[32,32,0,0]},rg32sint:{bpp:8,c:2,bitsPerChannel:[32,32,0,0]},rg32float:{bpp:8,c:2,bitsPerChannel:[32,32,0,0],render:!1,filter:fe},rgba16uint:{bpp:8,c:4},rgba16sint:{bpp:8,c:4},rgba16float:{bpp:8,c:4,render:Ee,filter:nt},"rgba16unorm-webgl":{b:2,c:4,render:N},"rgba16snorm-webgl":{b:2,c:4,render:_e},"rgb32float-webgl":{render:ue,filter:fe},rgba32uint:{bpp:16,c:4},rgba32sint:{bpp:16,c:4},rgba32float:{bpp:16,c:4,render:ue,filter:fe},stencil8:{attachment:"stencil",c:1,bpp:1,components:1,bitsPerChannel:[8,0,0,0],dataType:"uint8"},depth16unorm:{attachment:"depth",c:1,bpp:2,components:1,bitsPerChannel:[16,0,0,0],dataType:"uint16"},depth24plus:{attachment:"depth",c:1,bpp:3,components:1,bitsPerChannel:[24,0,0,0],dataType:"uint32"},depth32float:{attachment:"depth",c:1,bpp:4,components:1,bitsPerChannel:[32,0,0,0],dataType:"float32"},"depth24plus-stencil8":{attachment:"depth-stencil",bpp:4,c:2,p:1,components:2,bitsPerChannel:[24,8,0,0],packed:!0},"depth32float-stencil8":{attachment:"depth-stencil",components:2,c:2,bpp:5,bitsPerChannel:[32,8,0,0],packed:!0},"bc1-rgb-unorm-webgl":{f:p},"bc1-rgb-unorm-srgb-webgl":{f:p},"bc1-rgba-unorm":{f:p},"bc1-rgba-unorm-srgb":{f:p},"bc2-rgba-unorm":{f:p},"bc2-rgba-unorm-srgb":{f:p},"bc3-rgba-unorm":{f:p},"bc3-rgba-unorm-srgb":{f:p},"bc4-r-unorm":{f:p},"bc4-r-snorm":{f:p},"bc5-rg-unorm":{f:p},"bc5-rg-snorm":{f:p},"bc6h-rgb-ufloat":{f:p},"bc6h-rgb-float":{f:p},"bc7-rgba-unorm":{f:p},"bc7-rgba-unorm-srgb":{f:p},"etc2-rgb8unorm":{f:x},"etc2-rgb8unorm-srgb":{f:x},"etc2-rgb8a1unorm":{f:x},"etc2-rgb8a1unorm-srgb":{f:x},"etc2-rgba8unorm":{f:x},"etc2-rgba8unorm-srgb":{f:x},"eac-r11unorm":{f:x},"eac-r11snorm":{f:x},"eac-rg11unorm":{f:x},"eac-rg11snorm":{f:x},"astc-4x4-unorm":{f:d},"astc-4x4-unorm-srgb":{f:d},"astc-5x4-unorm":{f:d},"astc-5x4-unorm-srgb":{f:d},"astc-5x5-unorm":{f:d},"astc-5x5-unorm-srgb":{f:d},"astc-6x5-unorm":{f:d},"astc-6x5-unorm-srgb":{f:d},"astc-6x6-unorm":{f:d},"astc-6x6-unorm-srgb":{f:d},"astc-8x5-unorm":{f:d},"astc-8x5-unorm-srgb":{f:d},"astc-8x6-unorm":{f:d},"astc-8x6-unorm-srgb":{f:d},"astc-8x8-unorm":{f:d},"astc-8x8-unorm-srgb":{f:d},"astc-10x5-unorm":{f:d},"astc-10x5-unorm-srgb":{f:d},"astc-10x6-unorm":{f:d},"astc-10x6-unorm-srgb":{f:d},"astc-10x8-unorm":{f:d},"astc-10x8-unorm-srgb":{f:d},"astc-10x10-unorm":{f:d},"astc-10x10-unorm-srgb":{f:d},"astc-12x10-unorm":{f:d},"astc-12x10-unorm-srgb":{f:d},"astc-12x12-unorm":{f:d},"astc-12x12-unorm-srgb":{f:d},"pvrtc-rgb4unorm-webgl":{f:ce},"pvrtc-rgba4unorm-webgl":{f:ce},"pvrtc-rbg2unorm-webgl":{f:ce},"pvrtc-rgba2unorm-webgl":{f:ce},"etc1-rbg-unorm-webgl":{f:zt},"atc-rgb-unorm-webgl":{f:ve},"atc-rgba-unorm-webgl":{f:ve},"atc-rgbai-unorm-webgl":{f:ve}};var Gt=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],Vt=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;function Ce(r){return Gt.some(e=>r.startsWith(e))}function ot(r){if(Ce(r))return Wt(r);let e=Vt.exec(r);if(!e)return Ot(r);let[,t,n,s,o,i]=e,u=`${s}${n}`,l=ae(u),b=l.byteLength*8,g=t.length,S=[b,g>=2?b:0,g>=3?b:0,g>=4?b:0],we={format:r,channels:t,components:g,bitsPerChannel:S,bytesPerPixel:l.byteLength*t.length,dataType:l.dataType,integer:l.integer,signed:l.signed,normalized:l.normalized};return i==="-webgl"&&(we.webgl=!0),o==="-srgb"&&(we.srgb=!0),we}function Wt(r){let e={channels:"rgb",components:3,bytesPerPixel:1,srgb:!1,compressed:!0},t=jt(r);return t&&(e.blockWidth=t.blockWidth,e.blockHeight=t.blockHeight),e}function Ot(r){let e=st[r];if(!e)throw new Error(`Unknown format ${r}`);let t={...e,channels:e.channels||"",components:e.components||e.channels?.length||1,bytesPerPixel:e.bytesPerPixel||1,srgb:!1};return e.packed&&(t.packed=e.packed),t}function jt(r){let t=/.*-(\d+)x(\d+)-.*/.exec(r);if(t){let[,n,s]=t;return{blockWidth:Number(n),blockHeight:Number(s)}}return null}var le=class{},de=class{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)}},Le=class{get[Symbol.toStringTag](){return"Device"}constructor(e){this.props={...Le.defaultProps,...e},this.id=this.props.id||L(this[Symbol.toStringTag].toLowerCase())}id;props;userData={};statsManager=se;timestamp=0;_lumaData={};isTextureFormatCompressed(e){return Ce(e)}loseDevice(){return!1}error(e){this.props.onError(e)}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}createCommandEncoder(e={}){throw new Error("not implemented")}incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(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")}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t={...e};return(e.usage||0)&m.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?t.indexType="uint32":e.data instanceof Uint16Array?t.indexType="uint16":f.warn("indices buffer content must be of integer type")()),t}},E=Le;a(E,"defaultProps",{id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,onError:e=>f.error(e.message),_requestMaxLimits:!0,_factoryDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_resourceDefaults:{},webgl:{},debug:f.get("debug")||void 0,debugShaders:f.get("debug-shaders")||void 0,debugFramebuffers:Boolean(f.get("debug-framebuffers")),debugWebGL:Boolean(f.get("debug-webgl")),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_handle:void 0});var Yt=y()&&typeof document<"u",Xt=()=>Yt&&document.readyState==="complete",Zt="set luma.log.level=1 (or higher) to trace rendering",it="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",M=class{stats=se;log=f;VERSION="9.1.0-alpha.17";spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw f.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),f.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");f.error("This version of luma.gl has already been initialized")()}f.log(1,`${this.VERSION} - ${Zt}`)(),globalThis.luma=this}registerAdapters(e){for(let t of e)this.preregisteredAdapters.set(t.type,t)}getSupportedAdapters(e=[]){let t=this.getAdapterMap(e);return Array.from(t).map(([,n])=>n).filter(n=>n.isSupported?.()).map(n=>n.type)}getBestAvailableAdapter(e=[]){let t=this.getAdapterMap(e);return t.get("webgpu")?.isSupported?.()?"webgpu":t.get("webgl")?.isSupported?.()?"webgl":null}setDefaultDeviceProps(e){Object.assign(M.defaultProps,e)}async createDevice(e={}){e={...M.defaultProps,...e},e.waitForPageLoad&&await M.pageLoaded;let t=this.getAdapterMap(e.adapters),n=e.type||"";n==="best-available"&&(n=this.getBestAvailableAdapter(e.adapters)||n);let i=await(this.getAdapterMap(e.adapters)||t).get(n)?.create?.(e);if(i)return i;throw new Error(it)}async attachDevice(e){let t=this.getAdapterMap(e.adapters),n="";e.handle instanceof WebGL2RenderingContext&&(n="webgl"),e.createCanvasContext&&await M.pageLoaded,e.handle===null&&(n="unknown");let o=await t.get(n)?.attach?.(null);if(o)return o;throw new Error(it)}enforceWebGL2(e=!0,t=[]){let s=this.getAdapterMap(t).get("webgl");s||f.warn("enforceWebGL2: webgl adapter not found")(),s?.enforceWebGL2?.(e)}getAdapterMap(e=[]){let t=new Map(this.preregisteredAdapters);for(let n of e)t.set(n.type,n);return t}registerDevices(e){f.warn("luma.registerDevices() is deprecated, use luma.registerAdapters() instead");for(let t of e){let n=t.adapter;n&&this.preregisteredAdapters.set(n.type,n)}}},U=M;a(U,"defaultProps",{...E.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0}),a(U,"pageLoaded",qt().then(()=>{f.probe(2,"DOM is loaded")()}));var at=new U;function qt(){return Xt()||typeof window>"u"?Promise.resolve():new Promise(r=>{window.addEventListener("load",()=>r())})}var me=class{};var Me=class{id;props;canvas;htmlCanvas;offscreenCanvas;type;width=1;height=1;resizeObserver;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};constructor(e){if(this.props={...Me.defaultProps,...e},e=this.props,!y()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=Jt(e.canvas):this.canvas=e.canvas;else{let t=Qt(e),n=Kt(e?.container||null);n.insertBefore(t,n.firstChild),this.canvas=t,e?.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(t=>{for(let n of t)n.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":let e=this.getDevicePixelRatio(),t=this.canvas;return t.parentElement?[t.clientWidth*e,t.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){let[e,t]=this.getPixelSize();return e/t}cssToDeviceRatio(){try{let[e]=this.getDrawingBufferSize(),{clientWidth:t}=this._canvasSizeInfo;return t?e/t:1}catch{return 1}}cssToDevicePixels(e,t=!0){let n=this.cssToDeviceRatio(),[s,o]=this.getDrawingBufferSize();return er(e,n,s,o,t)}setDevicePixelRatio(e,t={}){if(!this.htmlCanvas)return;let n="width"in t?t.width:this.htmlCanvas.clientWidth,s="height"in t?t.height:this.htmlCanvas.clientHeight;(!n||!s)&&(f.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,n=this.htmlCanvas.width||1,s=this.htmlCanvas.height||1);let o=this._canvasSizeInfo;if(o.clientWidth!==n||o.clientHeight!==s||o.devicePixelRatio!==e){let i=e,u=Math.floor(n*i),l=Math.floor(s*i);if(this.htmlCanvas.width=u,this.htmlCanvas.height=l,this.device.gl){let[g,S]=this.getDrawingBufferSize();(g!==u||S!==l)&&(i=Math.min(g/n,S/s),this.htmlCanvas.width=Math.floor(n*i),this.htmlCanvas.height=Math.floor(s*i),f.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=n,this._canvasSizeInfo.clientHeight=s,this._canvasSizeInfo.devicePixelRatio=e}}}getDrawingBufferSize(){let e=this.device.gl;if(!e)throw new Error("canvas size");return[e.drawingBufferWidth,e.drawingBufferHeight]}_setAutoCreatedCanvasId(e){this.htmlCanvas?.id==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}},H=Me;a(H,"defaultProps",{canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb"});function Kt(r){if(typeof r=="string"){let e=document.getElementById(r);if(!e)throw new Error(`${r} is not an HTML element`);return e}else if(r)return r;return document.body}function Jt(r){let e=document.getElementById(r);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function Qt(r){let{width:e,height:t}=r,n=document.createElement("canvas");return n.id="lumagl-auto-created-canvas",n.width=e||1,n.height=t||1,n.style.width=Number.isFinite(e)?`${e}px`:"100%",n.style.height=Number.isFinite(t)?`${t}px`:"100%",n}function er(r,e,t,n,s){let o=r,i=ct(o[0],e,t),u=ut(o[1],e,n,s),l=ct(o[0]+1,e,t),b=l===t-1?l:l-1;l=ut(o[1]+1,e,n,s);let g;return s?(l=l===0?l:l+1,g=u,u=l):g=l===n-1?l:l-1,{x:i,y:u,width:Math.max(b-i+1,1),height:Math.max(g-u+1,1)}}function ct(r,e,t){return Math.min(Math.round(r*e),t-1)}function ut(r,e,t,n){return n?Math.max(0,t-1-Math.round(r*e)):Math.min(Math.round(r*e),t-1)}var w=class extends c{get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}dimension;format;width;height;depth;mipLevels;updateTimestamp;constructor(e,t){if(t=w.normalizeProps(e,t),super(e,t,w.defaultProps),this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.props.width===void 0||this.props.height===void 0){let n=w.getTextureDataSize(this.props.data);this.width=n?.width||1,this.height=n?.height||1}this.props.mipmaps&&this.props.mipLevels===void 0&&(this.props.mipLevels="pyramid"),this.mipLevels=this.props.mipLevels==="pyramid"?w.getMipLevelCount(this.width,this.height):this.props.mipLevels||1,this.updateTimestamp=e.incrementTimestamp()}clone(e){return this.device.createTexture({...this.props,...e})}static isExternalImage(e){return typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement||typeof VideoFrame<"u"&&e instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}static getExternalImageSize(e){if(typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height};if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};if(typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if(typeof VideoFrame<"u"&&e instanceof VideoFrame)return{width:e.displayWidth,height:e.displayHeight};throw new Error("Unknown image type")}static isTextureLevelData(e){let t=e?.data;return ArrayBuffer.isView(t)}static getTextureDataSize(e){if(!e||ArrayBuffer.isView(e))return null;if(Array.isArray(e))return w.getTextureDataSize(e[0]);if(w.isExternalImage(e))return w.getExternalImageSize(e);if(e&&typeof e=="object"&&e.constructor===Object){let n=Object.values(e)[0];return{width:n.width,height:n.height}}throw new Error("texture size deduction failed")}static normalizeTextureData(e,t){let n;return ArrayBuffer.isView(e)?n=[{data:e,width:t.width,height:t.height}]:Array.isArray(e)?n=e:n=[e],n}static getMipLevelCount(e,t){return Math.floor(Math.log2(Math.max(e,t)))+1}static getCubeFaceDepth(e){switch(e){case"+X":return 0;case"-X":return 1;case"+Y":return 2;case"-Y":return 3;case"+Z":return 4;case"-Z":return 5;default:throw new Error(e)}}static normalizeProps(e,t){let n={...t},s=e?.props?._resourceDefaults?.texture||{};Object.assign(n,s);let{width:o,height:i}=n;return typeof o=="number"&&(n.width=Math.max(1,Math.ceil(o))),typeof i=="number"&&(n.height=Math.max(1,Math.ceil(i))),n}},h=w;a(h,"COPY_SRC",1),a(h,"COPY_DST",2),a(h,"TEXTURE",4),a(h,"STORAGE",8),a(h,"RENDER_ATTACHMENT",16),a(h,"CubeFaces",["+X","-X","+Y","-Y","+Z","-Z"]),a(h,"defaultProps",{...c.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!1,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,sampler:{},view:void 0,flipY:void 0}),a(h,"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});var Be=class extends c{get[Symbol.toStringTag](){return"TextureView"}constructor(e,t){super(e,t,Be.defaultProps)}},z=Be;a(z,"defaultProps",{...c.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});var Re=class extends c{get[Symbol.toStringTag](){return"ExternalTexture"}constructor(e,t){super(e,t,Re.defaultProps)}},k=Re;a(k,"defaultProps",{...c.defaultProps,source:void 0,colorSpace:"srgb"});function lt(r,e,t){let n="",s=e.split(/\r?\n/),o=r.slice().sort((i,u)=>i.lineNum-u.lineNum);switch(t?.showSourceCode||"no"){case"all":let i=0;for(let u=1;u<=s.length;u++)for(n+=dt(s[u-1],u,t);o.length>i&&o[i].lineNum===u;){let l=o[i++];n+=ft(l,s,l.lineNum,{...t,inlineSource:!1})}return n;case"issues":case"no":for(let u of r)n+=ft(u,s,u.lineNum,{inlineSource:t?.showSourceCode!=="no"});return n}}function ft(r,e,t,n){if(n?.inlineSource){let o=tr(e,t),i=r.linePos>0?`${" ".repeat(r.linePos+5)}^^^
7
+ "use strict";var __exports__=(()=>{var re=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var vt=Object.getOwnPropertyNames;var Et=Object.prototype.hasOwnProperty;var Ct=(r,e,t)=>e in r?re(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Pt=(r,e)=>{for(var t in e)re(r,t,{get:e[t],enumerable:!0})},_t=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of vt(e))!Et.call(r,s)&&s!==t&&re(r,s,{get:()=>e[s],enumerable:!(n=At(e,s))||n.enumerable});return r};var Lt=r=>_t(re({},"__esModule",{value:!0}),r);var a=(r,e,t)=>(Ct(r,typeof e!="symbol"?e+"":e,t),t);var br={};Pt(br,{Adapter:()=>he,Buffer:()=>m,CanvasContext:()=>k,CommandBuffer:()=>K,CommandEncoder:()=>q,ComputePass:()=>Z,ComputePipeline:()=>X,Device:()=>C,DeviceFeatures:()=>me,DeviceLimits:()=>de,ExternalTexture:()=>V,Framebuffer:()=>j,QuerySet:()=>te,RenderPass:()=>T,RenderPipeline:()=>Y,Resource:()=>c,Sampler:()=>O,Shader:()=>W,Texture:()=>h,TextureView:()=>G,TransformFeedback:()=>ee,UniformBlock:()=>$,UniformBufferLayout:()=>D,UniformStore:()=>xe,VertexArray:()=>Q,_BufferLayoutHelper:()=>we,decodeShaderAttributeType:()=>ge,decodeShaderUniformType:()=>be,decodeTextureFormat:()=>it,decodeVertexFormat:()=>J,getAttributeInfosFromLayouts:()=>ke,getDataTypeFromTypedArray:()=>je,getScratchArray:()=>bt,getTypedArrayFromDataType:()=>St,getVertexFormatFromAttribute:()=>Tt,log:()=>f,luma:()=>ct});var ne=globalThis,Bt=globalThis.document||{},se=globalThis.process||{},Mt=globalThis.console,xr=globalThis.navigator||{};function Ye(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let e=typeof navigator<"u"&&navigator.userAgent,t=r||e;return Boolean(t&&t.indexOf("Electron")>=0)}function y(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Ye()}var Te="4.0.7";function F(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var v=class{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=F(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(F()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var _=class{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(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let t of Object.values(this.stats))e(t)}getTable(){let 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(t=>this._getOrCreate(t))}_getOrCreate(e){let{name:t,type:n}=e,s=this.stats[t];return s||(e instanceof v?s=e:s=new v(t,n),this.stats[t]=s),s}};var Ae=class{stats=new Map;getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new _({id:e})),this.stats.get(e)}},oe=new Ae;function It(r){try{let e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}var ie=class{constructor(e,t,n="sessionStorage"){this.storage=It(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){let t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function Xe(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function Ze(r,e=8){let t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var ae;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ae||(ae={}));var Dt=10;function qe(r){return typeof r!="string"?r:(r=r.toUpperCase(),ae[r]||ae.WHITE)}function Ke(r,e,t){return!y&&typeof r=="string"&&(e&&(r=`\x1B[${qe(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${qe(t)+Dt}m${r}\x1B[49m`)),r}function Je(r,e=["constructor"]){let t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),s=r;for(let o of n){let i=s[o];typeof i=="function"&&(e.find(u=>o===u)||(s[o]=i.bind(r)))}}function N(r,e){if(!r)throw new Error(e||"Assertion failed")}function E(){let r;if(y()&&ne.performance)r=ne?.performance?.now?.();else if("hrtime"in se){let e=se?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var L={debug:y()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},$t={enabled:!0,level:0};function B(){}var Qe={},et={once:!0},S=class{constructor({id:e}={id:""}){this.VERSION=Te,this._startTs=E(),this._deltaTs=E(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new ie(`__probe-${this.id}__`,$t),this.timeStamp(`${this.id} started`),Je(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((E()-this._startTs).toPrecision(10))}getDelta(){return Number((E()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[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){return this._getLogFunction(0,e,L.warn,arguments,et)}error(e){return this._getLogFunction(0,e,L.error,arguments)}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){return this._getLogFunction(e,t,L.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,L.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,L.debug||L.info,arguments,et)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||B,n&&[n],{tag:Nt(t)}):B}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||B)}group(e,t,n={collapsed:!1}){let s=tt({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return s.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||B)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=rt(e)}_getLogFunction(e,t,n,s,o){if(this._shouldLog(e)){o=tt({logLevel:e,message:t,args:s,opts:o}),n=n||o.method,N(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=E();let i=o.tag||o.message;if(o.once&&i)if(!Qe[i])Qe[i]=E();else return B;return t=Ft(this.id,o.message,o),n.bind(console,t,...o.args)}return B}};S.VERSION=Te;function rt(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return N(Number.isFinite(e)&&e>=0),e}function tt(r){let{logLevel:e,message:t}=r;r.logLevel=rt(e);let n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break;default:}typeof r.message=="function"&&(r.message=r.message());let s=typeof r.message;return N(s==="string"||s==="object"),Object.assign(r,{args:n},r.opts)}function Ft(r,e,t){if(typeof e=="string"){let n=t.time?Ze(Xe(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=Ke(e,t.color,t.background)}return e}function Nt(r){for(let e in r)for(let t in r[e])return t||"untitled";return"empty"}globalThis.probe={};var tn=new S({id:"@probe.gl/log"});var f=new S({id:"luma.gl"});var ve={};function M(r="id"){ve[r]=ve[r]||1;let e=ve[r]++;return`${r}-${e}`}var c=class{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=Ut(t,n);let s=this.props.id!=="undefined"?this.props.id:M(this[Symbol.toStringTag]);this.props.id=s,this.id=s,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}toString(){return`${this[Symbol.toStringTag]||this.constructor.name}(${this.id})`}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(let e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get(`${t}s Active`).decrementCount()}trackAllocatedMemory(e,t=this[Symbol.toStringTag]){let 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]){let 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(){let 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()}};a(c,"defaultProps",{id:"undefined",handle:void 0,userData:void 0});function Ut(r,e){let t={...e};for(let n in r)r[n]!==void 0&&(t[n]=r[n]);return t}var U=class extends c{get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(e,t){let n={...t};(t.usage||0)&U.INDEX&&!t.indexType&&(t.data instanceof Uint32Array?n.indexType="uint32":t.data instanceof Uint16Array&&(n.indexType="uint16")),delete n.data,super(e,n,U.defaultProps),this.usage=n.usage||0,this.indexType=n.indexType,this.updateTimestamp=e.incrementTimestamp()}clone(e){return this.device.createBuffer({...this.props,...e})}readSyncWebGL(e,t){throw new Error("not implemented")}debugData=new ArrayBuffer(0);_setDebugData(e,t,n){let s=ArrayBuffer.isView(e)?e.buffer:e,o=Math.min(e?e.byteLength:n,U.DEBUG_DATA_MAX_LENGTH);s===null?this.debugData=new ArrayBuffer(o):t===0&&n===s.byteLength?this.debugData=s.slice(0,o):this.debugData=s.slice(t,t+o)}},m=U;a(m,"defaultProps",{...c.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1}),a(m,"MAP_READ",1),a(m,"MAP_WRITE",2),a(m,"COPY_SRC",4),a(m,"COPY_DST",8),a(m,"INDEX",16),a(m,"VERTEX",32),a(m,"UNIFORM",64),a(m,"STORAGE",128),a(m,"INDIRECT",256),a(m,"QUERY_RESOLVE",512),a(m,"DEBUG_DATA_MAX_LENGTH",32);function ce(r){let e=nt[r],t=Ht(e),n=r.includes("norm"),s=!n&&!r.startsWith("float"),o=r.startsWith("s");return{dataType:nt[r],byteLength:t,integer:s,signed:o,normalized:n}}function Ht(r){return zt[r]}var nt={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},zt={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};var p="texture-compression-bc",d="texture-compression-astc",x="texture-compression-etc2",kt="texture-compression-etc1-webgl",ue="texture-compression-pvrtc-webgl",Ee="texture-compression-atc-webgl",fe="float32-renderable-webgl",Ce="float16-renderable-webgl",Gt="rgb9e5ufloat_renderable-webgl",Pe="snorm8-renderable-webgl",H="norm16-renderable-webgl",_e="snorm16-renderable-webgl",le="float32-filterable",st="float16-filterable-webgl",ot={r8unorm:{bpp:1,c:1},r8snorm:{bpp:1,c:1,render:Pe},r8uint:{bpp:1,c:1},r8sint:{bpp:1,c:1},rg8unorm:{bpp:2,c:2},rg8snorm:{bpp:2,c:2,render:Pe},rg8uint:{bpp:2,c:2},rg8sint:{bpp:2,c:2},r16uint:{bpp:2,c:1},r16sint:{bpp:2,c:1},r16float:{bpp:2,c:1,render:Ce,filter:"float16-filterable-webgl"},"r16unorm-webgl":{b:2,c:1,f:H},"r16snorm-webgl":{b:2,c:1,f:_e},"rgba4unorm-webgl":{channels:"rgba",bpp:2,bitsPerChannel:[4,4,4,4],packed:!0},"rgb565unorm-webgl":{channels:"rgb",bpp:2,bitsPerChannel:[5,6,5,0],packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bpp:2,bitsPerChannel:[5,5,5,1],packed:!0},"rgb8unorm-webgl":{bpp:3,c:3,wgpu:!1},"rgb8snorm-webgl":{bpp:3,c:3,wgpu:!1},rgba8unorm:{c:2,bpp:4,bitsPerChannel:[8,8,8,8]},"rgba8unorm-srgb":{c:4,bpp:4,bitsPerChannel:[8,8,8,8]},rgba8snorm:{bpp:4,c:4,bitsPerChannel:[8,8,8,8],render:Pe},rgba8uint:{c:4,bpp:4,bitsPerChannel:[8,8,8,8]},rgba8sint:{c:4,bpp:4,bitsPerChannel:[8,8,8,8]},bgra8unorm:{bpp:4,c:4},"bgra8unorm-srgb":{bpp:4,c:4},rg16uint:{c:1,bpp:4},rg16sint:{c:2,bpp:4},rg16float:{c:2,bpp:4,render:Ce,filter:st},"rg16unorm-webgl":{b:2,c:2,render:H},"rg16snorm-webgl":{b:2,c:2,render:_e},r32uint:{c:1,bpp:4},r32sint:{c:1,bpp:4},r32float:{c:1,bpp:4,render:fe,filter:le},rgb9e5ufloat:{channels:"rgb",packed:!0,c:3,bpp:4,p:1,render:Gt},rg11b10ufloat:{channels:"rgb",c:3,bpp:4,bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:fe},rgb10a2unorm:{channels:"rgba",c:4,bpp:4,bitsPerChannel:[10,10,10,2],packed:!0,p:1},"rgb10a2uint-webgl":{channels:"rgba",c:4,bpp:4,bitsPerChannel:[10,10,10,2],packed:!0,p:1,wgpu:!1},"rgb16unorm-webgl":{b:2,c:3,f:H},"rgb16snorm-webgl":{b:2,c:3,f:H},rg32uint:{bpp:8,c:2,bitsPerChannel:[32,32,0,0]},rg32sint:{bpp:8,c:2,bitsPerChannel:[32,32,0,0]},rg32float:{bpp:8,c:2,bitsPerChannel:[32,32,0,0],render:!1,filter:le},rgba16uint:{bpp:8,c:4},rgba16sint:{bpp:8,c:4},rgba16float:{bpp:8,c:4,render:Ce,filter:st},"rgba16unorm-webgl":{b:2,c:4,render:H},"rgba16snorm-webgl":{b:2,c:4,render:_e},"rgb32float-webgl":{render:fe,filter:le},rgba32uint:{bpp:16,c:4},rgba32sint:{bpp:16,c:4},rgba32float:{bpp:16,c:4,render:fe,filter:le},stencil8:{attachment:"stencil",c:1,bpp:1,components:1,bitsPerChannel:[8,0,0,0],dataType:"uint8"},depth16unorm:{attachment:"depth",c:1,bpp:2,components:1,bitsPerChannel:[16,0,0,0],dataType:"uint16"},depth24plus:{attachment:"depth",c:1,bpp:3,components:1,bitsPerChannel:[24,0,0,0],dataType:"uint32"},depth32float:{attachment:"depth",c:1,bpp:4,components:1,bitsPerChannel:[32,0,0,0],dataType:"float32"},"depth24plus-stencil8":{attachment:"depth-stencil",bpp:4,c:2,p:1,components:2,bitsPerChannel:[24,8,0,0],packed:!0},"depth32float-stencil8":{attachment:"depth-stencil",components:2,c:2,bpp:5,bitsPerChannel:[32,8,0,0],packed:!0},"bc1-rgb-unorm-webgl":{f:p},"bc1-rgb-unorm-srgb-webgl":{f:p},"bc1-rgba-unorm":{f:p},"bc1-rgba-unorm-srgb":{f:p},"bc2-rgba-unorm":{f:p},"bc2-rgba-unorm-srgb":{f:p},"bc3-rgba-unorm":{f:p},"bc3-rgba-unorm-srgb":{f:p},"bc4-r-unorm":{f:p},"bc4-r-snorm":{f:p},"bc5-rg-unorm":{f:p},"bc5-rg-snorm":{f:p},"bc6h-rgb-ufloat":{f:p},"bc6h-rgb-float":{f:p},"bc7-rgba-unorm":{f:p},"bc7-rgba-unorm-srgb":{f:p},"etc2-rgb8unorm":{f:x},"etc2-rgb8unorm-srgb":{f:x},"etc2-rgb8a1unorm":{f:x},"etc2-rgb8a1unorm-srgb":{f:x},"etc2-rgba8unorm":{f:x},"etc2-rgba8unorm-srgb":{f:x},"eac-r11unorm":{f:x},"eac-r11snorm":{f:x},"eac-rg11unorm":{f:x},"eac-rg11snorm":{f:x},"astc-4x4-unorm":{f:d},"astc-4x4-unorm-srgb":{f:d},"astc-5x4-unorm":{f:d},"astc-5x4-unorm-srgb":{f:d},"astc-5x5-unorm":{f:d},"astc-5x5-unorm-srgb":{f:d},"astc-6x5-unorm":{f:d},"astc-6x5-unorm-srgb":{f:d},"astc-6x6-unorm":{f:d},"astc-6x6-unorm-srgb":{f:d},"astc-8x5-unorm":{f:d},"astc-8x5-unorm-srgb":{f:d},"astc-8x6-unorm":{f:d},"astc-8x6-unorm-srgb":{f:d},"astc-8x8-unorm":{f:d},"astc-8x8-unorm-srgb":{f:d},"astc-10x5-unorm":{f:d},"astc-10x5-unorm-srgb":{f:d},"astc-10x6-unorm":{f:d},"astc-10x6-unorm-srgb":{f:d},"astc-10x8-unorm":{f:d},"astc-10x8-unorm-srgb":{f:d},"astc-10x10-unorm":{f:d},"astc-10x10-unorm-srgb":{f:d},"astc-12x10-unorm":{f:d},"astc-12x10-unorm-srgb":{f:d},"astc-12x12-unorm":{f:d},"astc-12x12-unorm-srgb":{f:d},"pvrtc-rgb4unorm-webgl":{f:ue},"pvrtc-rgba4unorm-webgl":{f:ue},"pvrtc-rbg2unorm-webgl":{f:ue},"pvrtc-rgba2unorm-webgl":{f:ue},"etc1-rbg-unorm-webgl":{f:kt},"atc-rgb-unorm-webgl":{f:Ee},"atc-rgba-unorm-webgl":{f:Ee},"atc-rgbai-unorm-webgl":{f:Ee}};var Vt=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],Wt=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;function Le(r){return Vt.some(e=>r.startsWith(e))}function it(r){if(Le(r))return Ot(r);let e=Wt.exec(r);if(!e)return jt(r);let[,t,n,s,o,i]=e,u=`${s}${n}`,l=ce(u),b=l.byteLength*8,g=t.length,A=[b,g>=2?b:0,g>=3?b:0,g>=4?b:0],Se={format:r,channels:t,components:g,bitsPerChannel:A,bytesPerPixel:l.byteLength*t.length,dataType:l.dataType,integer:l.integer,signed:l.signed,normalized:l.normalized};return i==="-webgl"&&(Se.webgl=!0),o==="-srgb"&&(Se.srgb=!0),Se}function Ot(r){let e={channels:"rgb",components:3,bytesPerPixel:1,srgb:!1,compressed:!0},t=Yt(r);return t&&(e.blockWidth=t.blockWidth,e.blockHeight=t.blockHeight),e}function jt(r){let e=ot[r];if(!e)throw new Error(`Unknown format ${r}`);let t={...e,channels:e.channels||"",components:e.components||e.channels?.length||1,bytesPerPixel:e.bytesPerPixel||1,srgb:!1};return e.packed&&(t.packed=e.packed),t}function Yt(r){let t=/.*-(\d+)x(\d+)-.*/.exec(r);if(t){let[,n,s]=t;return{blockWidth:Number(n),blockHeight:Number(s)}}return null}var de=class{},me=class{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)}},Be=class{get[Symbol.toStringTag](){return"Device"}constructor(e){this.props={...Be.defaultProps,...e},this.id=this.props.id||M(this[Symbol.toStringTag].toLowerCase())}id;props;userData={};statsManager=oe;timestamp=0;_lumaData={};isTextureFormatCompressed(e){return Le(e)}loseDevice(){return!1}error(e){this.props.onError(e)}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}createCommandEncoder(e={}){throw new Error("not implemented")}incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(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")}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t={...e};return(e.usage||0)&m.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?t.indexType="uint32":e.data instanceof Uint16Array?t.indexType="uint16":f.warn("indices buffer content must be of integer type")()),t}},C=Be;a(C,"defaultProps",{id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,onError:e=>f.error(e.message),_requestMaxLimits:!0,_factoryDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_resourceDefaults:{},webgl:{},debug:f.get("debug")||void 0,debugShaders:f.get("debug-shaders")||void 0,debugFramebuffers:Boolean(f.get("debug-framebuffers")),debugWebGL:Boolean(f.get("debug-webgl")),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_handle:void 0});var Xt=y()&&typeof document<"u",Zt=()=>Xt&&document.readyState==="complete",qt="set luma.log.level=1 (or higher) to trace rendering",at="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",R=class{stats=oe;log=f;VERSION="9.1.0-alpha.18";spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw f.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),f.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");f.error("This version of luma.gl has already been initialized")()}f.log(1,`${this.VERSION} - ${qt}`)(),globalThis.luma=this}registerAdapters(e){for(let t of e)this.preregisteredAdapters.set(t.type,t)}getSupportedAdapters(e=[]){let t=this.getAdapterMap(e);return Array.from(t).map(([,n])=>n).filter(n=>n.isSupported?.()).map(n=>n.type)}getBestAvailableAdapter(e=[]){let t=this.getAdapterMap(e);return t.get("webgpu")?.isSupported?.()?"webgpu":t.get("webgl")?.isSupported?.()?"webgl":null}setDefaultDeviceProps(e){Object.assign(R.defaultProps,e)}async createDevice(e={}){e={...R.defaultProps,...e},e.waitForPageLoad&&await R.pageLoaded;let t=this.getAdapterMap(e.adapters),n=e.type||"";n==="best-available"&&(n=this.getBestAvailableAdapter(e.adapters)||n);let i=await(this.getAdapterMap(e.adapters)||t).get(n)?.create?.(e);if(i)return i;throw new Error(at)}async attachDevice(e){let t=this.getAdapterMap(e.adapters),n="";e.handle instanceof WebGL2RenderingContext&&(n="webgl"),e.createCanvasContext&&await R.pageLoaded,e.handle===null&&(n="unknown");let o=await t.get(n)?.attach?.(null);if(o)return o;throw new Error(at)}enforceWebGL2(e=!0,t=[]){let s=this.getAdapterMap(t).get("webgl");s||f.warn("enforceWebGL2: webgl adapter not found")(),s?.enforceWebGL2?.(e)}getAdapterMap(e=[]){let t=new Map(this.preregisteredAdapters);for(let n of e)t.set(n.type,n);return t}registerDevices(e){f.warn("luma.registerDevices() is deprecated, use luma.registerAdapters() instead");for(let t of e){let n=t.adapter;n&&this.preregisteredAdapters.set(n.type,n)}}},z=R;a(z,"defaultProps",{...C.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0}),a(z,"pageLoaded",Kt().then(()=>{f.probe(2,"DOM is loaded")()}));var ct=new z;function Kt(){return Zt()||typeof window>"u"?Promise.resolve():new Promise(r=>{window.addEventListener("load",()=>r())})}var he=class{};var Me=class{id;props;canvas;htmlCanvas;offscreenCanvas;type;width=1;height=1;resizeObserver;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};constructor(e){if(this.props={...Me.defaultProps,...e},e=this.props,!y()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=Qt(e.canvas):this.canvas=e.canvas;else{let t=er(e),n=Jt(e?.container||null);n.insertBefore(t,n.firstChild),this.canvas=t,e?.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(t=>{for(let n of t)n.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":let e=this.getDevicePixelRatio(),t=this.canvas;return t.parentElement?[t.clientWidth*e,t.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){let[e,t]=this.getPixelSize();return e/t}cssToDeviceRatio(){try{let[e]=this.getDrawingBufferSize(),{clientWidth:t}=this._canvasSizeInfo;return t?e/t:1}catch{return 1}}cssToDevicePixels(e,t=!0){let n=this.cssToDeviceRatio(),[s,o]=this.getDrawingBufferSize();return tr(e,n,s,o,t)}setDevicePixelRatio(e,t={}){if(!this.htmlCanvas)return;let n="width"in t?t.width:this.htmlCanvas.clientWidth,s="height"in t?t.height:this.htmlCanvas.clientHeight;(!n||!s)&&(f.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,n=this.htmlCanvas.width||1,s=this.htmlCanvas.height||1);let o=this._canvasSizeInfo;if(o.clientWidth!==n||o.clientHeight!==s||o.devicePixelRatio!==e){let i=e,u=Math.floor(n*i),l=Math.floor(s*i);if(this.htmlCanvas.width=u,this.htmlCanvas.height=l,this.device.gl){let[g,A]=this.getDrawingBufferSize();(g!==u||A!==l)&&(i=Math.min(g/n,A/s),this.htmlCanvas.width=Math.floor(n*i),this.htmlCanvas.height=Math.floor(s*i),f.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=n,this._canvasSizeInfo.clientHeight=s,this._canvasSizeInfo.devicePixelRatio=e}}}getDrawingBufferSize(){let e=this.device.gl;if(!e)throw new Error("canvas size");return[e.drawingBufferWidth,e.drawingBufferHeight]}_setAutoCreatedCanvasId(e){this.htmlCanvas?.id==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}},k=Me;a(k,"defaultProps",{canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb"});function Jt(r){if(typeof r=="string"){let e=document.getElementById(r);if(!e)throw new Error(`${r} is not an HTML element`);return e}else if(r)return r;return document.body}function Qt(r){let e=document.getElementById(r);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function er(r){let{width:e,height:t}=r,n=document.createElement("canvas");return n.id="lumagl-auto-created-canvas",n.width=e||1,n.height=t||1,n.style.width=Number.isFinite(e)?`${e}px`:"100%",n.style.height=Number.isFinite(t)?`${t}px`:"100%",n}function tr(r,e,t,n,s){let o=r,i=ut(o[0],e,t),u=ft(o[1],e,n,s),l=ut(o[0]+1,e,t),b=l===t-1?l:l-1;l=ft(o[1]+1,e,n,s);let g;return s?(l=l===0?l:l+1,g=u,u=l):g=l===n-1?l:l-1,{x:i,y:u,width:Math.max(b-i+1,1),height:Math.max(g-u+1,1)}}function ut(r,e,t){return Math.min(Math.round(r*e),t-1)}function ft(r,e,t,n){return n?Math.max(0,t-1-Math.round(r*e)):Math.min(Math.round(r*e),t-1)}var w=class extends c{get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}dimension;format;width;height;depth;mipLevels;updateTimestamp;constructor(e,t){if(t=w.normalizeProps(e,t),super(e,t,w.defaultProps),this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.props.width===void 0||this.props.height===void 0){let n=w.getTextureDataSize(this.props.data);this.width=n?.width||1,this.height=n?.height||1}this.props.mipmaps&&this.props.mipLevels===void 0&&(this.props.mipLevels="pyramid"),this.mipLevels=this.props.mipLevels==="pyramid"?w.getMipLevelCount(this.width,this.height):this.props.mipLevels||1,this.updateTimestamp=e.incrementTimestamp()}clone(e){return this.device.createTexture({...this.props,...e})}static isExternalImage(e){return typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement||typeof VideoFrame<"u"&&e instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}static getExternalImageSize(e){if(typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height};if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};if(typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if(typeof VideoFrame<"u"&&e instanceof VideoFrame)return{width:e.displayWidth,height:e.displayHeight};throw new Error("Unknown image type")}static isTextureLevelData(e){let t=e?.data;return ArrayBuffer.isView(t)}static getTextureDataSize(e){if(!e||ArrayBuffer.isView(e))return null;if(Array.isArray(e))return w.getTextureDataSize(e[0]);if(w.isExternalImage(e))return w.getExternalImageSize(e);if(e&&typeof e=="object"&&e.constructor===Object){let n=Object.values(e)[0];return{width:n.width,height:n.height}}throw new Error("texture size deduction failed")}static normalizeTextureData(e,t){let n;return ArrayBuffer.isView(e)?n=[{data:e,width:t.width,height:t.height}]:Array.isArray(e)?n=e:n=[e],n}static getMipLevelCount(e,t){return Math.floor(Math.log2(Math.max(e,t)))+1}static getCubeFaceDepth(e){switch(e){case"+X":return 0;case"-X":return 1;case"+Y":return 2;case"-Y":return 3;case"+Z":return 4;case"-Z":return 5;default:throw new Error(e)}}static normalizeProps(e,t){let n={...t},s=e?.props?._resourceDefaults?.texture||{};Object.assign(n,s);let{width:o,height:i}=n;return typeof o=="number"&&(n.width=Math.max(1,Math.ceil(o))),typeof i=="number"&&(n.height=Math.max(1,Math.ceil(i))),n}},h=w;a(h,"COPY_SRC",1),a(h,"COPY_DST",2),a(h,"TEXTURE",4),a(h,"STORAGE",8),a(h,"RENDER_ATTACHMENT",16),a(h,"CubeFaces",["+X","-X","+Y","-Y","+Z","-Z"]),a(h,"defaultProps",{...c.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!1,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,sampler:{},view:void 0,flipY:void 0}),a(h,"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});var Re=class extends c{get[Symbol.toStringTag](){return"TextureView"}constructor(e,t){super(e,t,Re.defaultProps)}},G=Re;a(G,"defaultProps",{...c.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});var Ie=class extends c{get[Symbol.toStringTag](){return"ExternalTexture"}constructor(e,t){super(e,t,Ie.defaultProps)}},V=Ie;a(V,"defaultProps",{...c.defaultProps,source:void 0,colorSpace:"srgb"});function dt(r,e,t){let n="",s=e.split(/\r?\n/),o=r.slice().sort((i,u)=>i.lineNum-u.lineNum);switch(t?.showSourceCode||"no"){case"all":let i=0;for(let u=1;u<=s.length;u++)for(n+=mt(s[u-1],u,t);o.length>i&&o[i].lineNum===u;){let l=o[i++];n+=lt(l,s,l.lineNum,{...t,inlineSource:!1})}return n;case"issues":case"no":for(let u of r)n+=lt(u,s,u.lineNum,{inlineSource:t?.showSourceCode!=="no"});return n}}function lt(r,e,t,n){if(n?.inlineSource){let o=rr(e,t),i=r.linePos>0?`${" ".repeat(r.linePos+5)}^^^
8
8
  `:"";return`
9
9
  ${o}${i}${r.type.toUpperCase()}: ${r.message}
10
10
 
11
- `}let s=r.type==="error"?"red":"#8B4000";return n?.html?`<div class='luma-compiler-log-error' style="color:${s};"><b> ${r.type.toUpperCase()}: ${r.message}</b></div>`:`${r.type.toUpperCase()}: ${r.message}`}function tr(r,e,t){let n="";for(let s=e-2;s<=e;s++){let o=r[s-1];o!==void 0&&(n+=dt(o,e,t))}return n}function dt(r,e,t){let n=t?.html?nr(r):r;return`${rr(String(e),4)}: ${n}${t?.html?"<br/>":`
12
- `}`}function rr(r,e){let t="";for(let n=r.length;n<e;++n)t+=" ";return t+r}function nr(r){return r.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}var Ie=class extends c{get[Symbol.toStringTag](){return"Shader"}stage;source;compilationStatus="pending";constructor(e,t){t={...t,debugShaders:t.debugShaders||e.props.debugShaders||"errors"},super(e,{id:sr(t),...t},Ie.defaultProps),this.stage=this.props.stage,this.source=this.props.source}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(){let e=this.props.debugShaders;switch(e){case"never":return;case"errors":if(this.compilationStatus==="success")return;break;case"warnings":case"always":break}let t=await this.getCompilationInfo();e==="warnings"&&t?.length===0||this._displayShaderLog(t)}_displayShaderLog(e){if(typeof document>"u"||!document?.createElement)return;let t=mt(this.source),n=`${this.stage} ${t}`,s=lt(e,this.source,{showSourceCode:"all",html:!0}),o=this.getTranslatedSource();o&&(s+=`<br /><br /><h1>Translated Source</h1><br /><br /><code style="user-select:text;"><pre>${o}</pre></code>`);let i=document.createElement("Button");i.innerHTML=`
11
+ `}let s=r.type==="error"?"red":"#8B4000";return n?.html?`<div class='luma-compiler-log-error' style="color:${s};"><b> ${r.type.toUpperCase()}: ${r.message}</b></div>`:`${r.type.toUpperCase()}: ${r.message}`}function rr(r,e,t){let n="";for(let s=e-2;s<=e;s++){let o=r[s-1];o!==void 0&&(n+=mt(o,e,t))}return n}function mt(r,e,t){let n=t?.html?sr(r):r;return`${nr(String(e),4)}: ${n}${t?.html?"<br/>":`
12
+ `}`}function nr(r,e){let t="";for(let n=r.length;n<e;++n)t+=" ";return t+r}function sr(r){return r.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}var De=class extends c{get[Symbol.toStringTag](){return"Shader"}stage;source;compilationStatus="pending";constructor(e,t){t={...t,debugShaders:t.debugShaders||e.props.debugShaders||"errors"},super(e,{id:or(t),...t},De.defaultProps),this.stage=this.props.stage,this.source=this.props.source}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(){let e=this.props.debugShaders;switch(e){case"never":return;case"errors":if(this.compilationStatus==="success")return;break;case"warnings":case"always":break}let t=await this.getCompilationInfo();e==="warnings"&&t?.length===0||this._displayShaderLog(t)}_displayShaderLog(e){if(typeof document>"u"||!document?.createElement)return;let t=ht(this.source),n=`${this.stage} ${t}`,s=dt(e,this.source,{showSourceCode:"all",html:!0}),o=this.getTranslatedSource();o&&(s+=`<br /><br /><h1>Translated Source</h1><br /><br /><code style="user-select:text;"><pre>${o}</pre></code>`);let i=document.createElement("Button");i.innerHTML=`
13
13
  <h1>Shader Compilation Error in ${n}</h1><br /><br />
14
14
  <code style="user-select:text;"><pre>
15
15
  ${s}
16
- </pre></code>`,i.style.top="10px",i.style.left="10px",i.style.position="absolute",i.style.zIndex="9999",i.style.width="100%",i.style.textAlign="left",document.body.appendChild(i),document.getElementsByClassName("luma-compiler-log-error")[0]?.scrollIntoView(),i.onclick=()=>{let l=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(l)}}},G=Ie;a(G,"defaultProps",{...c.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});function sr(r){return mt(r.source)||r.id||L(`unnamed ${r.stage}-shader`)}function mt(r,e="unnamed"){let n=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(r);return n?n[1]:e}var he=class extends c{get[Symbol.toStringTag](){return"Sampler"}constructor(e,t){t=he.normalizeProps(e,t),super(e,t,he.defaultProps)}static normalizeProps(e,t){let n=e?.props?._resourceDefaults?.sampler||{};return{...t,...n}}},V=he;a(V,"defaultProps",{...c.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});var De=class extends c{get[Symbol.toStringTag](){return"Framebuffer"}width;height;constructor(e,t={}){super(e,t,De.defaultProps),this.width=this.props.width,this.height=this.props.height}clone(e){let t=this.colorAttachments.map(s=>s.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){let[n,s]=Array.isArray(e)?e:[e.width,e.height];t=t||s!==this.height||n!==this.width,this.width=n,this.height=s}t&&(f.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map((t,n)=>{if(typeof t=="string"){let s=this.createColorTexture(t,n);return this.attachResource(s),s.view}return t instanceof h?t.view:t});let e=this.props.depthStencilAttachment;if(e)if(typeof e=="string"){let t=this.createDepthStencilTexture(e);this.attachResource(t),this.depthStencilAttachment=t.view}else e instanceof h?this.depthStencilAttachment=e.view:this.depthStencilAttachment=e}createColorTexture(e,t){return this.device.createTexture({id:`${this.id}-color-attachment-${t}`,usage:h.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:h.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(e,t){for(let n=0;n<this.colorAttachments.length;++n)if(this.colorAttachments[n]){let s=this.colorAttachments[n].texture.clone({width:e,height:t});this.destroyAttachedResource(this.colorAttachments[n]),this.colorAttachments[n]=s.view,this.attachResource(s.view)}if(this.depthStencilAttachment){let n=this.depthStencilAttachment.texture.clone({width:e,height:t});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=n.view,this.attachResource(n)}this.updateAttachments()}},W=De;a(W,"defaultProps",{...c.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var $e=class extends c{get[Symbol.toStringTag](){return"RenderPipeline"}shaderLayout;bufferLayout;linkStatus="pending";hash="";constructor(e,t){super(e,t,$e.defaultProps),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}setUniformsWebGL(e){throw new Error("Use uniform blocks")}},O=$e;a(O,"defaultProps",{...c.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},bindings:{},uniforms:{}});var pe=class extends c{get[Symbol.toStringTag](){return"RenderPass"}constructor(e,t){t=pe.normalizeProps(e,t),super(e,t,pe.defaultProps)}static normalizeProps(e,t){return{...e.props._resourceDefaults?.renderPass,...t}}},j=pe;a(j,"defaultProps",{...c.defaultProps,framebuffer:null,parameters:void 0,clearColor:!1,clearColors:void 0,clearDepth:!1,clearStencil:!1,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var Fe=class extends c{get[Symbol.toStringTag](){return"ComputePipeline"}hash="";shaderLayout;constructor(e,t){super(e,t,Fe.defaultProps),this.shaderLayout=t.shaderLayout}},Y=Fe;a(Y,"defaultProps",{...c.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});var Ne=class extends c{get[Symbol.toStringTag](){return"ComputePass"}constructor(e,t){super(e,t,Ne.defaultProps)}},X=Ne;a(X,"defaultProps",{...c.defaultProps,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var Ue=class extends c{get[Symbol.toStringTag](){return"CommandEncoder"}constructor(e,t){super(e,t,Ue.defaultProps)}},Z=Ue;a(Z,"defaultProps",{...c.defaultProps,measureExecutionTime:void 0});var He=class extends c{get[Symbol.toStringTag](){return"CommandBuffer"}constructor(e,t){super(e,t,He.defaultProps)}},q=He;a(q,"defaultProps",{...c.defaultProps});function ge(r){let[e,t]=ir[r],n=e==="i32"||e==="u32",s=e!=="u32",o=ar[e]*t,i=or(e,t);return{dataType:e,components:t,defaultVertexFormat:i,byteLength:o,integer:n,signed:s}}function or(r,e){let t;switch(r){case"f32":t="float32";break;case"i32":t="sint32";break;case"u32":t="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return e===1?t:`${t}x${e}`}var ir={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},ar={f32:4,f16:2,i32:4,u32:4};function K(r){let e;r.endsWith("-webgl")&&(r.replace("-webgl",""),e=!0);let[t,n]=r.split("x"),s=t,o=n?parseInt(n):1,i=ae(s),u={type:s,components:o,byteLength:i.byteLength*o,integer:i.integer,signed:i.signed,normalized:i.normalized};return e&&(u.webglOnly=!0),u}function ze(r,e){let t={};for(let n of r.attributes){let s=cr(r,e,n.name);s&&(t[n.name]=s)}return t}function ht(r,e,t=16){let n=ze(r,e),s=new Array(t).fill(null);for(let o of Object.values(n))s[o.location]=o;return s}function cr(r,e,t){let n=ur(r,t),s=fr(e,t);if(!n)return null;let o=ge(n.type),i=s?.vertexFormat||o.defaultVertexFormat,u=K(i);return{attributeName:s?.attributeName||n.name,bufferName:s?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:i,bufferDataType:u.type,bufferComponents:u.components,normalized:u.normalized,integer:o.integer,stepMode:s?.stepMode||n.stepMode||"vertex",byteOffset:s?.byteOffset||0,byteStride:s?.byteStride||0}}function ur(r,e){let t=r.attributes.find(n=>n.name===e);return t||f.warn(`shader layout attribute "${e}" not present in shader`),t||null}function fr(r,e){lr(r);let t=dr(r,e);return t||(t=mr(r,e),t)?t:(f.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function lr(r){for(let e of r)(e.attributes&&e.format||!e.attributes&&!e.format)&&f.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function dr(r,e){for(let t of r)if(t.format&&t.name===e)return{attributeName:t.name,bufferName:e,stepMode:t.stepMode,vertexFormat:t.format,byteOffset:0,byteStride:t.byteStride||0};return null}function mr(r,e){for(let t of r){let n=t.byteStride;if(typeof t.byteStride!="number")for(let o of t.attributes||[]){let i=K(o.format);n+=i.byteLength}let s=t.attributes?.find(o=>o.attribute===e);if(s)return{attributeName:s.attribute,bufferName:t.name,stepMode:t.stepMode,vertexFormat:s.format,byteOffset:s.byteOffset,byteStride:n}}return null}var ke=class extends c{get[Symbol.toStringTag](){return"VertexArray"}maxVertexAttributes;attributeInfos;indexBuffer=null;attributes;constructor(e,t){super(e,t,ke.defaultProps),this.maxVertexAttributes=e.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null);let{shaderLayout:n,bufferLayout:s}=t.renderPipeline||{};if(!n||!s)throw new Error("VertexArray");this.attributeInfos=ht(n,s,this.maxVertexAttributes)}setConstantWebGL(e,t){throw new Error("constant attributes not supported")}},J=ke;a(J,"defaultProps",{...c.defaultProps,renderPipeline:null});var Ge=class extends c{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,t){super(e,t,Ge.defaultProps)}},Q=Ge;a(Q,"defaultProps",{...c.defaultProps,layout:void 0,buffers:{}});var Ve=class extends c{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,t){super(e,t,Ve.defaultProps)}},ee=Ve;a(ee,"defaultProps",{...c.defaultProps,type:void 0,count:void 0});var hr={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function be(r){return hr[r]}function pt(r,e){switch(e){case 1:return r;case 2:return r+r%2;default:return r+(4-r%4)%4}}var ye;function We(r){return(!ye||ye.byteLength<r)&&(ye=new ArrayBuffer(r)),ye}function gt(r,e){let t=We(r.BYTES_PER_ELEMENT*e);return new r(t,0,e)}function pr(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function B(r){return Array.isArray(r)?r.length===0||typeof r[0]=="number":pr(r)}var bt=1024,R=class{layout={};byteLength;constructor(e){let t=0;for(let[s,o]of Object.entries(e)){let i=be(o),{type:u,components:l}=i;t=pt(t,l);let b=t;t+=l,this.layout[s]={type:u,size:l,offset:b}}t+=(4-t%4)%4;let n=t*4;this.byteLength=Math.max(n,bt)}getData(e){let t=Math.max(this.byteLength,bt),n=We(t),s={i32:new Int32Array(n),u32:new Uint32Array(n),f32:new Float32Array(n),f16:new Uint16Array(n)};for(let[o,i]of Object.entries(e)){let u=this.layout[o];if(!u){f.warn(`Supplied uniform value ${o} not present in uniform block layout`)();continue}let{type:l,size:b,offset:g}=u,S=s[l];if(b===1){if(typeof i!="number"&&typeof i!="boolean"){f.warn(`Supplied value for single component uniform ${o} is not a number: ${i}`)();continue}S[g]=Number(i)}else{if(!B(i)){f.warn(`Supplied value for multi component / array uniform ${o} is not a numeric array: ${i}`)();continue}S.set(i,g)}}return new Uint8Array(n)}has(e){return Boolean(this.layout[e])}get(e){return this.layout[e]}};function yt(r,e,t=16){if(r!==e)return!1;let n=r,s=e;if(!B(n))return!1;if(B(s)&&n.length===s.length){for(let o=0;o<n.length;++o)if(s[o]!==n[o])return!1}return!0}function xt(r){return B(r)?r.slice():r}var I=class{name;uniforms={};modifiedUniforms={};modified=!0;bindingLayout={};needsRedraw="initialized";constructor(e){if(this.name=e?.name||"unnamed",e?.name&&e?.shaderLayout){let t=e?.shaderLayout.bindings?.find(s=>s.type==="uniform"&&s.name===e?.name);if(!t)throw new Error(e?.name);let n=t;for(let s of n.uniforms||[])this.bindingLayout[s.name]=s}}setUniforms(e){for(let[t,n]of Object.entries(e))this._setUniform(t,n),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${t}=${n}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,t){yt(this.uniforms[e],t)||(this.uniforms[e]=xt(t),this.modifiedUniforms[e]=!0,this.modified=!0)}};var xe=class{uniformBlocks=new Map;uniformBufferLayouts=new Map;uniformBuffers=new Map;constructor(e){for(let[t,n]of Object.entries(e)){let s=t,o=new R(n.uniformTypes||{});this.uniformBufferLayouts.set(s,o);let i=new I({name:t});i.setUniforms(n.defaultUniforms||{}),this.uniformBlocks.set(s,i)}}destroy(){for(let e of this.uniformBuffers.values())e.destroy()}setUniforms(e){for(let[t,n]of Object.entries(e))this.uniformBlocks.get(t)?.setUniforms(n);this.updateUniformBuffers()}getUniformBufferByteLength(e){return this.uniformBufferLayouts.get(e)?.byteLength||0}getUniformBufferData(e){let t=this.uniformBlocks.get(e)?.getAllUniforms()||{};return this.uniformBufferLayouts.get(e)?.getData(t)}createUniformBuffer(e,t,n){n&&this.setUniforms(n);let s=this.getUniformBufferByteLength(t),o=e.createBuffer({usage:m.UNIFORM|m.COPY_DST,byteLength:s}),i=this.getUniformBufferData(t);return o.write(i),o}getManagedUniformBuffer(e,t){if(!this.uniformBuffers.get(t)){let n=this.getUniformBufferByteLength(t),s=e.createBuffer({usage:m.UNIFORM|m.COPY_DST,byteLength:n});this.uniformBuffers.set(t,s)}return this.uniformBuffers.get(t)}updateUniformBuffers(){let e=!1;for(let t of this.uniformBlocks.keys()){let n=this.updateUniformBuffer(t);e||=n}return e&&f.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){let t=this.uniformBlocks.get(e),n=this.uniformBuffers.get(e),s=!1;if(n&&t?.needsRedraw){s||=t.needsRedraw;let o=this.getUniformBufferData(e);n=this.uniformBuffers.get(e),n?.write(o);let i=this.uniformBlocks.get(e)?.getAllUniforms();f.log(4,`Writing to uniform buffer ${String(e)}`,o,i)()}return s}};function Oe(r){let e=ArrayBuffer.isView(r)?r.constructor:r;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function wt(r){switch(r){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(r)}}function Tt(r,e,t){if(!e||e>4)throw new Error(`size ${e}`);let n=e,s=Oe(r);if(s==="uint8"&&t&&n===1)return"unorm8-webgl";if(s==="uint8"&&t&&n===3)return"unorm8x3-webgl";if(s==="uint8"||s==="sint8"){if(n===1||n===3)throw new Error(`size: ${e}`);return t&&(s=s.replace("int","norm")),`${s}x${n}`}if(s==="uint16"||s==="sint16"){if(n===1||n===3)throw new Error(`size: ${e}`);return t&&(s=s.replace("int","norm")),`${s}x${n}`}return n===1?s:`${s}x${n}`}return Ct(gr);})();
16
+ </pre></code>`,i.style.top="10px",i.style.left="10px",i.style.position="absolute",i.style.zIndex="9999",i.style.width="100%",i.style.textAlign="left",document.body.appendChild(i),document.getElementsByClassName("luma-compiler-log-error")[0]?.scrollIntoView(),i.onclick=()=>{let l=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(l)}}},W=De;a(W,"defaultProps",{...c.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});function or(r){return ht(r.source)||r.id||M(`unnamed ${r.stage}-shader`)}function ht(r,e="unnamed"){let n=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(r);return n?n[1]:e}var pe=class extends c{get[Symbol.toStringTag](){return"Sampler"}constructor(e,t){t=pe.normalizeProps(e,t),super(e,t,pe.defaultProps)}static normalizeProps(e,t){let n=e?.props?._resourceDefaults?.sampler||{};return{...t,...n}}},O=pe;a(O,"defaultProps",{...c.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});var $e=class extends c{get[Symbol.toStringTag](){return"Framebuffer"}width;height;constructor(e,t={}){super(e,t,$e.defaultProps),this.width=this.props.width,this.height=this.props.height}clone(e){let t=this.colorAttachments.map(s=>s.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){let[n,s]=Array.isArray(e)?e:[e.width,e.height];t=t||s!==this.height||n!==this.width,this.width=n,this.height=s}t&&(f.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map((t,n)=>{if(typeof t=="string"){let s=this.createColorTexture(t,n);return this.attachResource(s),s.view}return t instanceof h?t.view:t});let e=this.props.depthStencilAttachment;if(e)if(typeof e=="string"){let t=this.createDepthStencilTexture(e);this.attachResource(t),this.depthStencilAttachment=t.view}else e instanceof h?this.depthStencilAttachment=e.view:this.depthStencilAttachment=e}createColorTexture(e,t){return this.device.createTexture({id:`${this.id}-color-attachment-${t}`,usage:h.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:h.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(e,t){for(let n=0;n<this.colorAttachments.length;++n)if(this.colorAttachments[n]){let s=this.colorAttachments[n].texture.clone({width:e,height:t});this.destroyAttachedResource(this.colorAttachments[n]),this.colorAttachments[n]=s.view,this.attachResource(s.view)}if(this.depthStencilAttachment){let n=this.depthStencilAttachment.texture.clone({width:e,height:t});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=n.view,this.attachResource(n)}this.updateAttachments()}},j=$e;a(j,"defaultProps",{...c.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var Fe=class extends c{get[Symbol.toStringTag](){return"RenderPipeline"}shaderLayout;bufferLayout;linkStatus="pending";hash="";constructor(e,t){super(e,t,Fe.defaultProps),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}setUniformsWebGL(e){throw new Error("Use uniform blocks")}},Y=Fe;a(Y,"defaultProps",{...c.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},bindings:{},uniforms:{}});var P=class extends c{get[Symbol.toStringTag](){return"RenderPass"}constructor(e,t){t=P.normalizeProps(e,t),super(e,t,P.defaultProps)}static normalizeProps(e,t){return{...e.props._resourceDefaults?.renderPass,...t}}},T=P;a(T,"defaultClearColor",[0,0,0,1]),a(T,"defaultClearDepth",1),a(T,"defaultClearStencil",0),a(T,"defaultProps",{...c.defaultProps,framebuffer:null,parameters:void 0,clearColor:P.defaultClearColor,clearColors:void 0,clearDepth:P.defaultClearDepth,clearStencil:P.defaultClearStencil,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var Ne=class extends c{get[Symbol.toStringTag](){return"ComputePipeline"}hash="";shaderLayout;constructor(e,t){super(e,t,Ne.defaultProps),this.shaderLayout=t.shaderLayout}},X=Ne;a(X,"defaultProps",{...c.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});var Ue=class extends c{get[Symbol.toStringTag](){return"ComputePass"}constructor(e,t){super(e,t,Ue.defaultProps)}},Z=Ue;a(Z,"defaultProps",{...c.defaultProps,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var He=class extends c{get[Symbol.toStringTag](){return"CommandEncoder"}constructor(e,t){super(e,t,He.defaultProps)}},q=He;a(q,"defaultProps",{...c.defaultProps,measureExecutionTime:void 0});var ze=class extends c{get[Symbol.toStringTag](){return"CommandBuffer"}constructor(e,t){super(e,t,ze.defaultProps)}},K=ze;a(K,"defaultProps",{...c.defaultProps});function ge(r){let[e,t]=ar[r],n=e==="i32"||e==="u32",s=e!=="u32",o=cr[e]*t,i=ir(e,t);return{dataType:e,components:t,defaultVertexFormat:i,byteLength:o,integer:n,signed:s}}function ir(r,e){let t;switch(r){case"f32":t="float32";break;case"i32":t="sint32";break;case"u32":t="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return e===1?t:`${t}x${e}`}var ar={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},cr={f32:4,f16:2,i32:4,u32:4};function J(r){let e;r.endsWith("-webgl")&&(r.replace("-webgl",""),e=!0);let[t,n]=r.split("x"),s=t,o=n?parseInt(n):1,i=ce(s),u={type:s,components:o,byteLength:i.byteLength*o,integer:i.integer,signed:i.signed,normalized:i.normalized};return e&&(u.webglOnly=!0),u}function ke(r,e){let t={};for(let n of r.attributes){let s=ur(r,e,n.name);s&&(t[n.name]=s)}return t}function pt(r,e,t=16){let n=ke(r,e),s=new Array(t).fill(null);for(let o of Object.values(n))s[o.location]=o;return s}function ur(r,e,t){let n=fr(r,t),s=lr(e,t);if(!n)return null;let o=ge(n.type),i=s?.vertexFormat||o.defaultVertexFormat,u=J(i);return{attributeName:s?.attributeName||n.name,bufferName:s?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:i,bufferDataType:u.type,bufferComponents:u.components,normalized:u.normalized,integer:o.integer,stepMode:s?.stepMode||n.stepMode||"vertex",byteOffset:s?.byteOffset||0,byteStride:s?.byteStride||0}}function fr(r,e){let t=r.attributes.find(n=>n.name===e);return t||f.warn(`shader layout attribute "${e}" not present in shader`),t||null}function lr(r,e){dr(r);let t=mr(r,e);return t||(t=hr(r,e),t)?t:(f.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function dr(r){for(let e of r)(e.attributes&&e.format||!e.attributes&&!e.format)&&f.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function mr(r,e){for(let t of r)if(t.format&&t.name===e)return{attributeName:t.name,bufferName:e,stepMode:t.stepMode,vertexFormat:t.format,byteOffset:0,byteStride:t.byteStride||0};return null}function hr(r,e){for(let t of r){let n=t.byteStride;if(typeof t.byteStride!="number")for(let o of t.attributes||[]){let i=J(o.format);n+=i.byteLength}let s=t.attributes?.find(o=>o.attribute===e);if(s)return{attributeName:s.attribute,bufferName:t.name,stepMode:t.stepMode,vertexFormat:s.format,byteOffset:s.byteOffset,byteStride:n}}return null}var Ge=class extends c{get[Symbol.toStringTag](){return"VertexArray"}maxVertexAttributes;attributeInfos;indexBuffer=null;attributes;constructor(e,t){super(e,t,Ge.defaultProps),this.maxVertexAttributes=e.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null);let{shaderLayout:n,bufferLayout:s}=t.renderPipeline||{};if(!n||!s)throw new Error("VertexArray");this.attributeInfos=pt(n,s,this.maxVertexAttributes)}setConstantWebGL(e,t){throw new Error("constant attributes not supported")}},Q=Ge;a(Q,"defaultProps",{...c.defaultProps,renderPipeline:null});var Ve=class extends c{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,t){super(e,t,Ve.defaultProps)}},ee=Ve;a(ee,"defaultProps",{...c.defaultProps,layout:void 0,buffers:{}});var We=class extends c{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,t){super(e,t,We.defaultProps)}},te=We;a(te,"defaultProps",{...c.defaultProps,type:void 0,count:void 0});var pr={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function be(r){return pr[r]}function gt(r,e){switch(e){case 1:return r;case 2:return r+r%2;default:return r+(4-r%4)%4}}var ye;function Oe(r){return(!ye||ye.byteLength<r)&&(ye=new ArrayBuffer(r)),ye}function bt(r,e){let t=Oe(r.BYTES_PER_ELEMENT*e);return new r(t,0,e)}function gr(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function I(r){return Array.isArray(r)?r.length===0||typeof r[0]=="number":gr(r)}var yt=1024,D=class{layout={};byteLength;constructor(e){let t=0;for(let[s,o]of Object.entries(e)){let i=be(o),{type:u,components:l}=i;t=gt(t,l);let b=t;t+=l,this.layout[s]={type:u,size:l,offset:b}}t+=(4-t%4)%4;let n=t*4;this.byteLength=Math.max(n,yt)}getData(e){let t=Math.max(this.byteLength,yt),n=Oe(t),s={i32:new Int32Array(n),u32:new Uint32Array(n),f32:new Float32Array(n),f16:new Uint16Array(n)};for(let[o,i]of Object.entries(e)){let u=this.layout[o];if(!u){f.warn(`Supplied uniform value ${o} not present in uniform block layout`)();continue}let{type:l,size:b,offset:g}=u,A=s[l];if(b===1){if(typeof i!="number"&&typeof i!="boolean"){f.warn(`Supplied value for single component uniform ${o} is not a number: ${i}`)();continue}A[g]=Number(i)}else{if(!I(i)){f.warn(`Supplied value for multi component / array uniform ${o} is not a numeric array: ${i}`)();continue}A.set(i,g)}}return new Uint8Array(n)}has(e){return Boolean(this.layout[e])}get(e){return this.layout[e]}};function xt(r,e,t=16){if(r!==e)return!1;let n=r,s=e;if(!I(n))return!1;if(I(s)&&n.length===s.length){for(let o=0;o<n.length;++o)if(s[o]!==n[o])return!1}return!0}function wt(r){return I(r)?r.slice():r}var $=class{name;uniforms={};modifiedUniforms={};modified=!0;bindingLayout={};needsRedraw="initialized";constructor(e){if(this.name=e?.name||"unnamed",e?.name&&e?.shaderLayout){let t=e?.shaderLayout.bindings?.find(s=>s.type==="uniform"&&s.name===e?.name);if(!t)throw new Error(e?.name);let n=t;for(let s of n.uniforms||[])this.bindingLayout[s.name]=s}}setUniforms(e){for(let[t,n]of Object.entries(e))this._setUniform(t,n),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${t}=${n}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,t){xt(this.uniforms[e],t)||(this.uniforms[e]=wt(t),this.modifiedUniforms[e]=!0,this.modified=!0)}};var xe=class{uniformBlocks=new Map;uniformBufferLayouts=new Map;uniformBuffers=new Map;constructor(e){for(let[t,n]of Object.entries(e)){let s=t,o=new D(n.uniformTypes||{});this.uniformBufferLayouts.set(s,o);let i=new $({name:t});i.setUniforms(n.defaultUniforms||{}),this.uniformBlocks.set(s,i)}}destroy(){for(let e of this.uniformBuffers.values())e.destroy()}setUniforms(e){for(let[t,n]of Object.entries(e))this.uniformBlocks.get(t)?.setUniforms(n);this.updateUniformBuffers()}getUniformBufferByteLength(e){return this.uniformBufferLayouts.get(e)?.byteLength||0}getUniformBufferData(e){let t=this.uniformBlocks.get(e)?.getAllUniforms()||{};return this.uniformBufferLayouts.get(e)?.getData(t)}createUniformBuffer(e,t,n){n&&this.setUniforms(n);let s=this.getUniformBufferByteLength(t),o=e.createBuffer({usage:m.UNIFORM|m.COPY_DST,byteLength:s}),i=this.getUniformBufferData(t);return o.write(i),o}getManagedUniformBuffer(e,t){if(!this.uniformBuffers.get(t)){let n=this.getUniformBufferByteLength(t),s=e.createBuffer({usage:m.UNIFORM|m.COPY_DST,byteLength:n});this.uniformBuffers.set(t,s)}return this.uniformBuffers.get(t)}updateUniformBuffers(){let e=!1;for(let t of this.uniformBlocks.keys()){let n=this.updateUniformBuffer(t);e||=n}return e&&f.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){let t=this.uniformBlocks.get(e),n=this.uniformBuffers.get(e),s=!1;if(n&&t?.needsRedraw){s||=t.needsRedraw;let o=this.getUniformBufferData(e);n=this.uniformBuffers.get(e),n?.write(o);let i=this.uniformBlocks.get(e)?.getAllUniforms();f.log(4,`Writing to uniform buffer ${String(e)}`,o,i)()}return s}};function je(r){let e=ArrayBuffer.isView(r)?r.constructor:r;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function St(r){switch(r){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(r)}}function Tt(r,e,t){if(!e||e>4)throw new Error(`size ${e}`);let n=e,s=je(r);if(s==="uint8"&&t&&n===1)return"unorm8-webgl";if(s==="uint8"&&t&&n===3)return"unorm8x3-webgl";if(s==="uint8"||s==="sint8"){if(n===1||n===3)throw new Error(`size: ${e}`);return t&&(s=s.replace("int","norm")),`${s}x${n}`}if(s==="uint16"||s==="sint16"){if(n===1||n===3)throw new Error(`size: ${e}`);return t&&(s=s.replace("int","norm")),`${s}x${n}`}return n===1?s:`${s}x${n}`}var we=class{bufferLayouts;constructor(e){this.bufferLayouts=e}getBufferLayout(e){return this.bufferLayouts.find(t=>t.name===e)||null}getAttributeNamesForBuffer(e){return e.attributes?e.attributes?.map(t=>t.attribute):[e.name]}mergeBufferLayouts(e,t){let n=[...e];for(let s of t){let o=n.findIndex(i=>i.name===s.name);o<0?n.push(s):n[o]=s}return n}};return Lt(br);})();
17
17
  return __exports__;
18
18
  });