easycomponentstools 1.2.4 → 1.2.5

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.
@@ -0,0 +1,936 @@
1
+ import { b as e, f as t, p as n, s as r, v as i } from "./array-utils-flat-BeGpfCVx.js";
2
+ //#region node_modules/@luma.gl/core/dist/shadertypes/texture-types/texture-format-table.js
3
+ var a = "texture-compression-bc", o = "texture-compression-astc", s = "texture-compression-etc2", c = "texture-compression-etc1-webgl", l = "texture-compression-pvrtc-webgl", u = "texture-compression-atc-webgl", d = "float32-renderable-webgl", f = "float16-renderable-webgl", p = "rgb9e5ufloat-renderable-webgl", m = "snorm8-renderable-webgl", h = "norm16-webgl", g = "norm16-renderable-webgl", _ = "snorm16-renderable-webgl", v = "float32-filterable", y = "float16-filterable-webgl", b = 3, x = 5, S = 15, C = 19, w = 31, T = 992, E = 15360;
4
+ function D(e) {
5
+ let t = j[e];
6
+ if (!t) throw Error(`Unsupported texture format ${e}`);
7
+ return t;
8
+ }
9
+ function O() {
10
+ return j;
11
+ }
12
+ var k = {
13
+ r8unorm: { webgpu: 527 },
14
+ rg8unorm: { webgpu: 527 },
15
+ "rgb8unorm-webgl": {},
16
+ rgba8unorm: { webgpu: w },
17
+ "rgba8unorm-srgb": { webgpu: S },
18
+ r8snorm: {
19
+ render: m,
20
+ webgpu: 837
21
+ },
22
+ rg8snorm: {
23
+ render: m,
24
+ webgpu: 837
25
+ },
26
+ "rgb8snorm-webgl": {},
27
+ rgba8snorm: {
28
+ render: m,
29
+ webgpu: 341
30
+ },
31
+ r8uint: { webgpu: 515 },
32
+ rg8uint: { webgpu: 515 },
33
+ rgba8uint: { webgpu: C },
34
+ r8sint: { webgpu: 515 },
35
+ rg8sint: { webgpu: 515 },
36
+ rgba8sint: { webgpu: C },
37
+ bgra8unorm: { webgpu: S },
38
+ "bgra8unorm-srgb": { webgpu: E },
39
+ r16unorm: {
40
+ f: h,
41
+ render: g,
42
+ webgpu: T
43
+ },
44
+ rg16unorm: {
45
+ f: h,
46
+ render: g,
47
+ webgpu: T
48
+ },
49
+ "rgb16unorm-webgl": {
50
+ f: h,
51
+ render: !1
52
+ },
53
+ rgba16unorm: {
54
+ f: h,
55
+ render: g,
56
+ webgpu: T
57
+ },
58
+ r16snorm: {
59
+ f: h,
60
+ render: _,
61
+ webgpu: T
62
+ },
63
+ rg16snorm: {
64
+ f: h,
65
+ render: _,
66
+ webgpu: T
67
+ },
68
+ "rgb16snorm-webgl": {
69
+ f: h,
70
+ render: !1
71
+ },
72
+ rgba16snorm: {
73
+ f: h,
74
+ render: _,
75
+ webgpu: T
76
+ },
77
+ r16uint: { webgpu: 515 },
78
+ rg16uint: { webgpu: 515 },
79
+ rgba16uint: { webgpu: C },
80
+ r16sint: { webgpu: 515 },
81
+ rg16sint: { webgpu: 515 },
82
+ rgba16sint: { webgpu: C },
83
+ r16float: {
84
+ render: f,
85
+ filter: "float16-filterable-webgl",
86
+ webgpu: 527
87
+ },
88
+ rg16float: {
89
+ render: f,
90
+ filter: y,
91
+ webgpu: 527
92
+ },
93
+ rgba16float: {
94
+ render: f,
95
+ filter: y,
96
+ webgpu: w
97
+ },
98
+ r32uint: { webgpu: C },
99
+ rg32uint: { webgpu: 16387 },
100
+ rgba32uint: { webgpu: C },
101
+ r32sint: { webgpu: C },
102
+ rg32sint: { webgpu: 16387 },
103
+ rgba32sint: { webgpu: C },
104
+ r32float: {
105
+ render: d,
106
+ filter: v,
107
+ webgpu: C
108
+ },
109
+ rg32float: {
110
+ render: !1,
111
+ filter: v,
112
+ webgpu: 16387
113
+ },
114
+ "rgb32float-webgl": {
115
+ render: d,
116
+ filter: v
117
+ },
118
+ rgba32float: {
119
+ render: d,
120
+ filter: v,
121
+ webgpu: C
122
+ },
123
+ "rgba4unorm-webgl": {
124
+ channels: "rgba",
125
+ bitsPerChannel: [
126
+ 4,
127
+ 4,
128
+ 4,
129
+ 4
130
+ ],
131
+ packed: !0
132
+ },
133
+ "rgb565unorm-webgl": {
134
+ channels: "rgb",
135
+ bitsPerChannel: [
136
+ 5,
137
+ 6,
138
+ 5,
139
+ 0
140
+ ],
141
+ packed: !0
142
+ },
143
+ "rgb5a1unorm-webgl": {
144
+ channels: "rgba",
145
+ bitsPerChannel: [
146
+ 5,
147
+ 5,
148
+ 5,
149
+ 1
150
+ ],
151
+ packed: !0
152
+ },
153
+ rgb9e5ufloat: {
154
+ channels: "rgb",
155
+ packed: !0,
156
+ render: p,
157
+ webgpu: x
158
+ },
159
+ rg11b10ufloat: {
160
+ channels: "rgb",
161
+ bitsPerChannel: [
162
+ 11,
163
+ 11,
164
+ 10,
165
+ 0
166
+ ],
167
+ packed: !0,
168
+ p: 1,
169
+ render: d,
170
+ webgpu: 517
171
+ },
172
+ rgb10a2unorm: {
173
+ channels: "rgba",
174
+ bitsPerChannel: [
175
+ 10,
176
+ 10,
177
+ 10,
178
+ 2
179
+ ],
180
+ packed: !0,
181
+ p: 1,
182
+ webgpu: 527
183
+ },
184
+ rgb10a2uint: {
185
+ channels: "rgba",
186
+ bitsPerChannel: [
187
+ 10,
188
+ 10,
189
+ 10,
190
+ 2
191
+ ],
192
+ packed: !0,
193
+ p: 1,
194
+ webgpu: 515
195
+ },
196
+ stencil8: {
197
+ attachment: "stencil",
198
+ bitsPerChannel: [
199
+ 8,
200
+ 0,
201
+ 0,
202
+ 0
203
+ ],
204
+ dataType: "uint8",
205
+ webgpu: b
206
+ },
207
+ depth16unorm: {
208
+ attachment: "depth",
209
+ bitsPerChannel: [
210
+ 16,
211
+ 0,
212
+ 0,
213
+ 0
214
+ ],
215
+ dataType: "uint16",
216
+ webgpu: b
217
+ },
218
+ depth24plus: {
219
+ attachment: "depth",
220
+ bitsPerChannel: [
221
+ 24,
222
+ 0,
223
+ 0,
224
+ 0
225
+ ],
226
+ dataType: "uint32",
227
+ webgpu: b
228
+ },
229
+ depth32float: {
230
+ attachment: "depth",
231
+ bitsPerChannel: [
232
+ 32,
233
+ 0,
234
+ 0,
235
+ 0
236
+ ],
237
+ dataType: "float32",
238
+ webgpu: b
239
+ },
240
+ "depth24plus-stencil8": {
241
+ attachment: "depth-stencil",
242
+ bitsPerChannel: [
243
+ 24,
244
+ 8,
245
+ 0,
246
+ 0
247
+ ],
248
+ packed: !0,
249
+ webgpu: b
250
+ },
251
+ "depth32float-stencil8": {
252
+ attachment: "depth-stencil",
253
+ bitsPerChannel: [
254
+ 32,
255
+ 8,
256
+ 0,
257
+ 0
258
+ ],
259
+ packed: !0,
260
+ f: "depth32float-stencil8",
261
+ webgpu: b
262
+ }
263
+ }, A = {
264
+ "bc1-rgb-unorm-webgl": { f: a },
265
+ "bc1-rgb-unorm-srgb-webgl": { f: a },
266
+ "bc1-rgba-unorm": { f: a },
267
+ "bc1-rgba-unorm-srgb": { f: a },
268
+ "bc2-rgba-unorm": { f: a },
269
+ "bc2-rgba-unorm-srgb": { f: a },
270
+ "bc3-rgba-unorm": { f: a },
271
+ "bc3-rgba-unorm-srgb": { f: a },
272
+ "bc4-r-unorm": { f: a },
273
+ "bc4-r-snorm": { f: a },
274
+ "bc5-rg-unorm": { f: a },
275
+ "bc5-rg-snorm": { f: a },
276
+ "bc6h-rgb-ufloat": { f: a },
277
+ "bc6h-rgb-float": { f: a },
278
+ "bc7-rgba-unorm": { f: a },
279
+ "bc7-rgba-unorm-srgb": { f: a },
280
+ "etc2-rgb8unorm": { f: s },
281
+ "etc2-rgb8unorm-srgb": { f: s },
282
+ "etc2-rgb8a1unorm": { f: s },
283
+ "etc2-rgb8a1unorm-srgb": { f: s },
284
+ "etc2-rgba8unorm": { f: s },
285
+ "etc2-rgba8unorm-srgb": { f: s },
286
+ "eac-r11unorm": { f: s },
287
+ "eac-r11snorm": { f: s },
288
+ "eac-rg11unorm": { f: s },
289
+ "eac-rg11snorm": { f: s },
290
+ "astc-4x4-unorm": { f: o },
291
+ "astc-4x4-unorm-srgb": { f: o },
292
+ "astc-5x4-unorm": { f: o },
293
+ "astc-5x4-unorm-srgb": { f: o },
294
+ "astc-5x5-unorm": { f: o },
295
+ "astc-5x5-unorm-srgb": { f: o },
296
+ "astc-6x5-unorm": { f: o },
297
+ "astc-6x5-unorm-srgb": { f: o },
298
+ "astc-6x6-unorm": { f: o },
299
+ "astc-6x6-unorm-srgb": { f: o },
300
+ "astc-8x5-unorm": { f: o },
301
+ "astc-8x5-unorm-srgb": { f: o },
302
+ "astc-8x6-unorm": { f: o },
303
+ "astc-8x6-unorm-srgb": { f: o },
304
+ "astc-8x8-unorm": { f: o },
305
+ "astc-8x8-unorm-srgb": { f: o },
306
+ "astc-10x5-unorm": { f: o },
307
+ "astc-10x5-unorm-srgb": { f: o },
308
+ "astc-10x6-unorm": { f: o },
309
+ "astc-10x6-unorm-srgb": { f: o },
310
+ "astc-10x8-unorm": { f: o },
311
+ "astc-10x8-unorm-srgb": { f: o },
312
+ "astc-10x10-unorm": { f: o },
313
+ "astc-10x10-unorm-srgb": { f: o },
314
+ "astc-12x10-unorm": { f: o },
315
+ "astc-12x10-unorm-srgb": { f: o },
316
+ "astc-12x12-unorm": { f: o },
317
+ "astc-12x12-unorm-srgb": { f: o },
318
+ "pvrtc-rgb4unorm-webgl": { f: l },
319
+ "pvrtc-rgba4unorm-webgl": { f: l },
320
+ "pvrtc-rgb2unorm-webgl": { f: l },
321
+ "pvrtc-rgba2unorm-webgl": { f: l },
322
+ "etc1-rbg-unorm-webgl": { f: c },
323
+ "atc-rgb-unorm-webgl": { f: u },
324
+ "atc-rgba-unorm-webgl": { f: u },
325
+ "atc-rgbai-unorm-webgl": { f: u }
326
+ }, j = {
327
+ ...k,
328
+ ...A
329
+ }, M = /^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/, N = [
330
+ "rgb",
331
+ "rgba",
332
+ "bgra"
333
+ ], P = ["depth", "stencil"], F = 5, I = [
334
+ "bc1",
335
+ "bc2",
336
+ "bc3",
337
+ "bc4",
338
+ "bc5",
339
+ "bc6",
340
+ "bc7",
341
+ "etc1",
342
+ "etc2",
343
+ "eac",
344
+ "atc",
345
+ "astc",
346
+ "pvrtc"
347
+ ], L = new class {
348
+ isColor(e) {
349
+ return N.some((t) => e.startsWith(t));
350
+ }
351
+ isDepthStencil(e) {
352
+ return P.some((t) => e.startsWith(t));
353
+ }
354
+ isCompressed(e) {
355
+ return I.some((t) => e.startsWith(t));
356
+ }
357
+ getInfo(e) {
358
+ return B(e);
359
+ }
360
+ getCapabilities(e) {
361
+ return z(e);
362
+ }
363
+ getWebGPUCapabilities(e) {
364
+ let t = D(e);
365
+ return t.webgpu === void 0 ? this.isCompressed(e) && !e.endsWith("-webgl") ? F : 0 : t.webgpu;
366
+ }
367
+ computeMemoryLayout(e) {
368
+ return R(e);
369
+ }
370
+ }();
371
+ function R({ format: e, width: t, height: n, depth: r, byteAlignment: i }) {
372
+ let { bytesPerPixel: a, bytesPerBlock: o = a, blockWidth: s = 1, blockHeight: c = 1, compressed: l = !1 } = L.getInfo(e), u = l ? Math.ceil(t / s) : t, d = l ? Math.ceil(n / c) : n, f = u * o, p = Math.ceil(f / i) * i, m = d, h = p * m * r;
373
+ return {
374
+ bytesPerPixel: a,
375
+ bytesPerRow: p,
376
+ rowsPerImage: m,
377
+ depthOrArrayLayers: r,
378
+ bytesPerImage: p * m,
379
+ byteLength: h
380
+ };
381
+ }
382
+ function z(e) {
383
+ let t = D(e), n = {
384
+ format: e,
385
+ create: t.f ?? !0,
386
+ render: t.render ?? !0,
387
+ filter: t.filter ?? !0,
388
+ blend: t.blend ?? !0,
389
+ store: t.store ?? !0
390
+ }, r = B(e), i = e.startsWith("depth") || e.startsWith("stencil"), a = r?.signed, o = r?.integer, s = r?.webgl, c = !!r?.compressed;
391
+ return n.render &&= !i && !c, n.filter &&= !i && !a && !o && !s, n;
392
+ }
393
+ function B(e) {
394
+ let t = V(e);
395
+ if (L.isCompressed(e)) {
396
+ t.channels = "rgb", t.components = 3, t.bytesPerPixel = 1, t.srgb = !1, t.compressed = !0, t.bytesPerBlock = U(e);
397
+ let n = H(e);
398
+ n && (t.blockWidth = n.blockWidth, t.blockHeight = n.blockHeight);
399
+ }
400
+ let r = t.packed ? null : M.exec(e);
401
+ if (r) {
402
+ let [, i, a, o, s, c] = r, l = `${o}${a}`, u = n.getDataTypeInfo(l), d = u.byteLength * 8, f = i?.length ?? 1, p = [
403
+ d,
404
+ f >= 2 ? d : 0,
405
+ f >= 3 ? d : 0,
406
+ f >= 4 ? d : 0
407
+ ];
408
+ t = {
409
+ format: e,
410
+ attachment: t.attachment,
411
+ dataType: u.signedType,
412
+ components: f,
413
+ channels: i,
414
+ integer: u.integer,
415
+ signed: u.signed,
416
+ normalized: u.normalized,
417
+ bitsPerChannel: p,
418
+ bytesPerPixel: u.byteLength * f,
419
+ packed: t.packed,
420
+ srgb: t.srgb
421
+ }, c === "-webgl" && (t.webgl = !0), s === "-srgb" && (t.srgb = !0);
422
+ }
423
+ return e.endsWith("-webgl") && (t.webgl = !0), e.endsWith("-srgb") && (t.srgb = !0), t;
424
+ }
425
+ function V(e) {
426
+ let t = { ...D(e) }, n = t.bytesPerPixel || 1, r = t.bitsPerChannel || [
427
+ 8,
428
+ 8,
429
+ 8,
430
+ 8
431
+ ];
432
+ return delete t.bitsPerChannel, delete t.bytesPerPixel, delete t.f, delete t.render, delete t.filter, delete t.blend, delete t.store, delete t.webgpu, {
433
+ ...t,
434
+ format: e,
435
+ attachment: t.attachment || "color",
436
+ channels: t.channels || "r",
437
+ components: t.components || t.channels?.length || 1,
438
+ bytesPerPixel: n,
439
+ bitsPerChannel: r,
440
+ dataType: t.dataType || "uint8",
441
+ srgb: t.srgb ?? !1,
442
+ packed: t.packed ?? !1,
443
+ webgl: t.webgl ?? !1,
444
+ integer: t.integer ?? !1,
445
+ signed: t.signed ?? !1,
446
+ normalized: t.normalized ?? !1,
447
+ compressed: t.compressed ?? !1
448
+ };
449
+ }
450
+ function H(e) {
451
+ let t = /.*-(\d+)x(\d+)-.*/.exec(e);
452
+ if (t) {
453
+ let [, e, n] = t;
454
+ return {
455
+ blockWidth: Number(e),
456
+ blockHeight: Number(n)
457
+ };
458
+ }
459
+ return e.startsWith("bc") || e.startsWith("etc1") || e.startsWith("etc2") || e.startsWith("eac") || e.startsWith("atc") || e.startsWith("pvrtc-rgb4") || e.startsWith("pvrtc-rgba4") ? {
460
+ blockWidth: 4,
461
+ blockHeight: 4
462
+ } : e.startsWith("pvrtc-rgb2") || e.startsWith("pvrtc-rgba2") ? {
463
+ blockWidth: 8,
464
+ blockHeight: 4
465
+ } : null;
466
+ }
467
+ function U(e) {
468
+ return e.startsWith("bc1") || e.startsWith("bc4") || e.startsWith("etc1") || e.startsWith("etc2-rgb8") || e.startsWith("etc2-rgb8a1") || e.startsWith("eac-r11") || e === "atc-rgb-unorm-webgl" ? 8 : e.startsWith("bc2") || e.startsWith("bc3") || e.startsWith("bc5") || e.startsWith("bc6h") || e.startsWith("bc7") || e.startsWith("etc2-rgba8") || e.startsWith("eac-rg11") || e.startsWith("astc") || e === "atc-rgba-unorm-webgl" || e === "atc-rgbai-unorm-webgl" ? 16 : e.startsWith("pvrtc") ? 8 : 16;
469
+ }
470
+ //#endregion
471
+ //#region node_modules/@luma.gl/core/dist/adapter/resources/sampler.js
472
+ var W = class e extends i {
473
+ static defaultProps = {
474
+ ...i.defaultProps,
475
+ type: "color-sampler",
476
+ addressModeU: "clamp-to-edge",
477
+ addressModeV: "clamp-to-edge",
478
+ addressModeW: "clamp-to-edge",
479
+ magFilter: "nearest",
480
+ minFilter: "nearest",
481
+ mipmapFilter: "none",
482
+ lodMinClamp: 0,
483
+ lodMaxClamp: 32,
484
+ compare: "less-equal",
485
+ maxAnisotropy: 1
486
+ };
487
+ get [Symbol.toStringTag]() {
488
+ return "Sampler";
489
+ }
490
+ constructor(t, n) {
491
+ n = e.normalizeProps(t, n), super(t, n, e.defaultProps);
492
+ }
493
+ static normalizeProps(e, t) {
494
+ return t;
495
+ }
496
+ }, G = {
497
+ "1d": "1d",
498
+ "2d": "2d",
499
+ "2d-array": "2d",
500
+ cube: "2d",
501
+ "cube-array": "2d",
502
+ "3d": "3d"
503
+ }, K = class t extends i {
504
+ static SAMPLE = 4;
505
+ static STORAGE = 8;
506
+ static RENDER = 16;
507
+ static COPY_SRC = 1;
508
+ static COPY_DST = 2;
509
+ static TEXTURE = 4;
510
+ static RENDER_ATTACHMENT = 16;
511
+ dimension;
512
+ baseDimension;
513
+ format;
514
+ width;
515
+ height;
516
+ depth;
517
+ mipLevels;
518
+ samples;
519
+ byteAlignment;
520
+ ready = Promise.resolve(this);
521
+ isReady = !0;
522
+ updateTimestamp;
523
+ get [Symbol.toStringTag]() {
524
+ return "Texture";
525
+ }
526
+ toString() {
527
+ return `Texture(${this.id},${this.format},${this.width}x${this.height})`;
528
+ }
529
+ constructor(n, r, i) {
530
+ if (r = t.normalizeProps(n, r), super(n, r, t.defaultProps), this.dimension = this.props.dimension, this.baseDimension = G[this.dimension], this.format = this.props.format, this.width = this.props.width, this.height = this.props.height, this.depth = this.props.depth, this.mipLevels = this.props.mipLevels, this.samples = this.props.samples || 1, this.dimension === "cube" && (this.depth = 6), this.props.width === void 0 || this.props.height === void 0) {
531
+ if (n.isExternalImage(r.data)) {
532
+ let e = n.getExternalImageSize(r.data);
533
+ this.width = e?.width || 1, this.height = e?.height || 1;
534
+ } else this.width = 1, this.height = 1, (this.props.width === void 0 || this.props.height === void 0) && e.warn(`${this} created with undefined width or height. This is deprecated. Use DynamicTexture instead.`)();
535
+ }
536
+ this.byteAlignment = i?.byteAlignment || 1, this.updateTimestamp = n.incrementTimestamp();
537
+ }
538
+ clone(e) {
539
+ return this.device.createTexture({
540
+ ...this.props,
541
+ ...e
542
+ });
543
+ }
544
+ setSampler(e) {
545
+ this.sampler = e instanceof W ? e : this.device.createSampler(e);
546
+ }
547
+ copyImageData(e) {
548
+ let { data: t, depth: n, ...r } = e;
549
+ this.writeData(t, {
550
+ ...r,
551
+ depthOrArrayLayers: r.depthOrArrayLayers ?? n
552
+ });
553
+ }
554
+ computeMemoryLayout(e = {}) {
555
+ let { width: t = this.width, height: n = this.height, depthOrArrayLayers: r = this.depth } = this._normalizeTextureReadOptions(e), { format: i, byteAlignment: a } = this;
556
+ return L.computeMemoryLayout({
557
+ format: i,
558
+ width: t,
559
+ height: n,
560
+ depth: r,
561
+ byteAlignment: a
562
+ });
563
+ }
564
+ readBuffer(e, t) {
565
+ throw Error("readBuffer not implemented");
566
+ }
567
+ readDataAsync(e) {
568
+ throw Error("readBuffer not implemented");
569
+ }
570
+ writeBuffer(e, t) {
571
+ throw Error("readBuffer not implemented");
572
+ }
573
+ writeData(e, t) {
574
+ throw Error("readBuffer not implemented");
575
+ }
576
+ readDataSyncWebGL(e) {
577
+ throw Error("readDataSyncWebGL not available");
578
+ }
579
+ generateMipmapsWebGL() {
580
+ throw Error("generateMipmapsWebGL not available");
581
+ }
582
+ static normalizeProps(e, t) {
583
+ let n = { ...t }, { width: r, height: i } = n;
584
+ return typeof r == "number" && (n.width = Math.max(1, Math.ceil(r))), typeof i == "number" && (n.height = Math.max(1, Math.ceil(i))), n;
585
+ }
586
+ _initializeData(e) {
587
+ this.device.isExternalImage(e) ? this.copyExternalImage({
588
+ image: e,
589
+ width: this.width,
590
+ height: this.height,
591
+ depth: this.depth,
592
+ mipLevel: 0,
593
+ x: 0,
594
+ y: 0,
595
+ z: 0,
596
+ aspect: "all",
597
+ colorSpace: "srgb",
598
+ premultipliedAlpha: !1,
599
+ flipY: !1
600
+ }) : e && this.copyImageData({
601
+ data: e,
602
+ mipLevel: 0,
603
+ x: 0,
604
+ y: 0,
605
+ z: 0,
606
+ aspect: "all"
607
+ });
608
+ }
609
+ _normalizeCopyImageDataOptions(e) {
610
+ let { data: t, depth: n, ...r } = e, i = this._normalizeTextureWriteOptions({
611
+ ...r,
612
+ depthOrArrayLayers: r.depthOrArrayLayers ?? n
613
+ });
614
+ return {
615
+ data: t,
616
+ depth: i.depthOrArrayLayers,
617
+ ...i
618
+ };
619
+ }
620
+ _normalizeCopyExternalImageOptions(e) {
621
+ let n = t._omitUndefined(e), r = n.mipLevel ?? 0, i = this._getMipLevelSize(r), a = this.device.getExternalImageSize(e.image), o = {
622
+ ...t.defaultCopyExternalImageOptions,
623
+ ...i,
624
+ ...a,
625
+ ...n
626
+ };
627
+ return o.width = Math.min(o.width, i.width - o.x), o.height = Math.min(o.height, i.height - o.y), o.depth = Math.min(o.depth, i.depthOrArrayLayers - o.z), o;
628
+ }
629
+ _normalizeCopyElementImageOptions(e) {
630
+ let n = t._omitUndefined(e), r = n.mipLevel ?? 0, i = this._getMipLevelSize(r), a = {
631
+ ...t.defaultCopyElementImageOptions,
632
+ ...i,
633
+ ...n
634
+ };
635
+ return a.width = Math.min(a.width, i.width - a.x), a.height = Math.min(a.height, i.height - a.y), a.depth = Math.min(a.depth, i.depthOrArrayLayers - a.z), a;
636
+ }
637
+ _normalizeTextureReadOptions(e) {
638
+ let n = t._omitUndefined(e), r = n.mipLevel ?? 0, i = this._getMipLevelSize(r), a = {
639
+ ...t.defaultTextureReadOptions,
640
+ ...i,
641
+ ...n
642
+ };
643
+ return a.width = Math.min(a.width, i.width - a.x), a.height = Math.min(a.height, i.height - a.y), a.depthOrArrayLayers = Math.min(a.depthOrArrayLayers, i.depthOrArrayLayers - a.z), a;
644
+ }
645
+ _getSupportedColorReadOptions(e) {
646
+ let t = this._normalizeTextureReadOptions(e), n = L.getInfo(this.format);
647
+ switch (this._validateColorReadAspect(t), this._validateColorReadFormat(n), this.dimension) {
648
+ case "2d":
649
+ case "cube":
650
+ case "cube-array":
651
+ case "2d-array":
652
+ case "3d": return t;
653
+ default: throw Error(`${this} color readback does not support ${this.dimension} textures`);
654
+ }
655
+ }
656
+ _validateColorReadAspect(e) {
657
+ if (e.aspect !== "all") throw Error(`${this} color readback only supports aspect 'all'`);
658
+ }
659
+ _validateColorReadFormat(e) {
660
+ if (e.compressed) throw Error(`${this} color readback does not support compressed formats (${this.format})`);
661
+ switch (e.attachment) {
662
+ case "color": return;
663
+ case "depth": throw Error(`${this} color readback does not support depth formats (${this.format})`);
664
+ case "stencil": throw Error(`${this} color readback does not support stencil formats (${this.format})`);
665
+ case "depth-stencil": throw Error(`${this} color readback does not support depth-stencil formats (${this.format})`);
666
+ default: throw Error(`${this} color readback does not support format ${this.format}`);
667
+ }
668
+ }
669
+ _normalizeTextureWriteOptions(e) {
670
+ let n = t._omitUndefined(e), r = n.mipLevel ?? 0, i = this._getMipLevelSize(r), a = {
671
+ ...t.defaultTextureWriteOptions,
672
+ ...i,
673
+ ...n
674
+ };
675
+ a.width = Math.min(a.width, i.width - a.x), a.height = Math.min(a.height, i.height - a.y), a.depthOrArrayLayers = Math.min(a.depthOrArrayLayers, i.depthOrArrayLayers - a.z);
676
+ let o = L.computeMemoryLayout({
677
+ format: this.format,
678
+ width: a.width,
679
+ height: a.height,
680
+ depth: a.depthOrArrayLayers,
681
+ byteAlignment: this.byteAlignment
682
+ }), s = o.bytesPerPixel * a.width;
683
+ if (a.bytesPerRow = n.bytesPerRow ?? o.bytesPerRow, a.rowsPerImage = n.rowsPerImage ?? a.height, a.bytesPerRow < s) throw Error(`bytesPerRow (${a.bytesPerRow}) must be at least ${s} for ${this.format}`);
684
+ if (a.rowsPerImage < a.height) throw Error(`rowsPerImage (${a.rowsPerImage}) must be at least ${a.height} for ${this.format}`);
685
+ let c = this.device.getTextureFormatInfo(this.format).bytesPerPixel;
686
+ if (c && a.bytesPerRow % c !== 0) throw Error(`bytesPerRow (${a.bytesPerRow}) must be a multiple of bytesPerPixel (${c}) for ${this.format}`);
687
+ return a;
688
+ }
689
+ _getMipLevelSize(e) {
690
+ return {
691
+ width: Math.max(1, this.width >> e),
692
+ height: this.baseDimension === "1d" ? 1 : Math.max(1, this.height >> e),
693
+ depthOrArrayLayers: this.dimension === "3d" ? Math.max(1, this.depth >> e) : this.depth
694
+ };
695
+ }
696
+ getAllocatedByteLength() {
697
+ let e = 0;
698
+ for (let t = 0; t < this.mipLevels; t++) {
699
+ let { width: n, height: r, depthOrArrayLayers: i } = this._getMipLevelSize(t);
700
+ e += L.computeMemoryLayout({
701
+ format: this.format,
702
+ width: n,
703
+ height: r,
704
+ depth: i,
705
+ byteAlignment: 1
706
+ }).byteLength;
707
+ }
708
+ return e * this.samples;
709
+ }
710
+ static _omitUndefined(e) {
711
+ return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
712
+ }
713
+ static defaultProps = {
714
+ ...i.defaultProps,
715
+ data: null,
716
+ dimension: "2d",
717
+ format: "rgba8unorm",
718
+ usage: t.SAMPLE | t.RENDER | t.COPY_DST,
719
+ width: void 0,
720
+ height: void 0,
721
+ depth: 1,
722
+ mipLevels: 1,
723
+ samples: void 0,
724
+ sampler: {},
725
+ view: void 0
726
+ };
727
+ static defaultCopyDataOptions = {
728
+ data: void 0,
729
+ byteOffset: 0,
730
+ bytesPerRow: void 0,
731
+ rowsPerImage: void 0,
732
+ width: void 0,
733
+ height: void 0,
734
+ depthOrArrayLayers: void 0,
735
+ depth: 1,
736
+ mipLevel: 0,
737
+ x: 0,
738
+ y: 0,
739
+ z: 0,
740
+ aspect: "all"
741
+ };
742
+ static defaultCopyExternalImageOptions = {
743
+ image: void 0,
744
+ sourceX: 0,
745
+ sourceY: 0,
746
+ width: void 0,
747
+ height: void 0,
748
+ depth: 1,
749
+ mipLevel: 0,
750
+ x: 0,
751
+ y: 0,
752
+ z: 0,
753
+ aspect: "all",
754
+ colorSpace: "srgb",
755
+ premultipliedAlpha: !1,
756
+ flipY: !1
757
+ };
758
+ static defaultCopyElementImageOptions = {
759
+ element: void 0,
760
+ width: void 0,
761
+ height: void 0,
762
+ sourceX: 0,
763
+ sourceY: 0,
764
+ sourceWidth: void 0,
765
+ sourceHeight: void 0,
766
+ depth: 1,
767
+ mipLevel: 0,
768
+ x: 0,
769
+ y: 0,
770
+ z: 0,
771
+ aspect: "all",
772
+ colorSpace: "srgb",
773
+ premultipliedAlpha: !1,
774
+ flipY: !1
775
+ };
776
+ static defaultTextureReadOptions = {
777
+ x: 0,
778
+ y: 0,
779
+ z: 0,
780
+ width: void 0,
781
+ height: void 0,
782
+ depthOrArrayLayers: 1,
783
+ mipLevel: 0,
784
+ aspect: "all"
785
+ };
786
+ static defaultTextureWriteOptions = {
787
+ byteOffset: 0,
788
+ bytesPerRow: void 0,
789
+ rowsPerImage: void 0,
790
+ x: 0,
791
+ y: 0,
792
+ z: 0,
793
+ width: void 0,
794
+ height: void 0,
795
+ depthOrArrayLayers: 1,
796
+ mipLevel: 0,
797
+ aspect: "all"
798
+ };
799
+ }, q = class e extends i {
800
+ get [Symbol.toStringTag]() {
801
+ return "TextureView";
802
+ }
803
+ constructor(t, n) {
804
+ super(t, n, e.defaultProps);
805
+ }
806
+ static defaultProps = {
807
+ ...i.defaultProps,
808
+ format: void 0,
809
+ dimension: void 0,
810
+ aspect: "all",
811
+ baseMipLevel: 0,
812
+ mipLevelCount: void 0,
813
+ baseArrayLayer: 0,
814
+ arrayLayerCount: void 0
815
+ };
816
+ };
817
+ //#endregion
818
+ //#region node_modules/@luma.gl/core/dist/adapter-utils/bind-groups.js
819
+ function J(t, n, r) {
820
+ let i = t.bindings.find((e) => e.name === n || `${e.name.toLocaleLowerCase()}uniforms` === n.toLocaleLowerCase());
821
+ return !i && !r?.ignoreWarnings && e.warn(`Binding ${n} not set: Not found in shader layout.`)(), i || null;
822
+ }
823
+ function Y(e, t) {
824
+ if (!t) return {};
825
+ if (Z(t)) return Object.fromEntries(Object.entries(t).map(([e, t]) => [Number(e), { ...t }]));
826
+ let n = {};
827
+ for (let [r, i] of Object.entries(t)) {
828
+ let t = J(e, r)?.group ?? 0;
829
+ n[t] ||= {}, n[t][r] = i;
830
+ }
831
+ return n;
832
+ }
833
+ function X(e) {
834
+ let t = {};
835
+ for (let n of Object.values(e)) Object.assign(t, n);
836
+ return t;
837
+ }
838
+ function Z(e) {
839
+ let t = Object.keys(e);
840
+ return t.length > 0 && t.every((e) => /^\d+$/.test(e));
841
+ }
842
+ //#endregion
843
+ //#region node_modules/@luma.gl/core/dist/adapter-utils/buffer-layout-utils.js
844
+ function Q(e) {
845
+ return e.attributes ? e.attributes.map((e) => e.attribute) : [e.name];
846
+ }
847
+ function $(e) {
848
+ return Object.fromEntries(e.attributes.map((e) => [e.name, e.location]));
849
+ }
850
+ function ee(e) {
851
+ let t = Infinity;
852
+ for (let n of e) n !== void 0 && (t = Math.min(t, n));
853
+ return t;
854
+ }
855
+ function te(n, i, a) {
856
+ ne(i);
857
+ let o = /* @__PURE__ */ new Map();
858
+ for (let e of i) {
859
+ let t = re(e);
860
+ if (e.attributes) for (let n of e.attributes) o.has(n.attribute) || o.set(n.attribute, {
861
+ bufferName: e.name,
862
+ stepMode: e.stepMode,
863
+ vertexFormat: n.format,
864
+ byteOffset: n.byteOffset,
865
+ byteStride: t
866
+ });
867
+ else e.format && !o.has(e.name) && o.set(e.name, {
868
+ bufferName: e.name,
869
+ stepMode: e.stepMode,
870
+ vertexFormat: e.format,
871
+ byteOffset: 0,
872
+ byteStride: t
873
+ });
874
+ }
875
+ return n.attributes.map((n) => {
876
+ let i = o.get(n.name);
877
+ !i && a?.warnOnMissingBufferLayout && e.warn(`layout for attribute "${n.name}" not present in buffer layout`)();
878
+ let s = r.getAttributeShaderTypeInfo(n.type), c = i?.vertexFormat || t.getCompatibleVertexFormat(s);
879
+ return {
880
+ attributeName: n.name,
881
+ bufferName: i?.bufferName || n.name,
882
+ location: n.location,
883
+ vertexFormat: c,
884
+ byteOffset: i?.byteOffset ?? 0,
885
+ byteStride: i?.byteStride ?? t.getVertexFormatInfo(c).byteLength,
886
+ stepMode: i?.stepMode || n.stepMode || (n.name.startsWith("instance") ? "instance" : "vertex")
887
+ };
888
+ }).sort((e, t) => e.location - t.location);
889
+ }
890
+ function ne(t) {
891
+ for (let n of t) (n.attributes && n.format || !n.attributes && !n.format) && e.warn(`BufferLayout ${n.name} must have either 'attributes' or 'format' field`)();
892
+ }
893
+ function re(e) {
894
+ if (typeof e.byteStride == "number") return e.byteStride;
895
+ if (e.attributes) {
896
+ let n = 0;
897
+ for (let r of e.attributes) n += t.getVertexFormatInfo(r.format).byteLength;
898
+ return n;
899
+ }
900
+ return t.getVertexFormatInfo(e.format).byteLength;
901
+ }
902
+ //#endregion
903
+ //#region node_modules/@luma.gl/core/dist/adapter-utils/get-attribute-from-layouts.js
904
+ function ie(e, t) {
905
+ let n = {}, r = te(e, t, { warnOnMissingBufferLayout: !0 });
906
+ for (let t of r) {
907
+ let r = ae(e, t);
908
+ n[t.attributeName] = r;
909
+ }
910
+ return n;
911
+ }
912
+ function ae(e, n) {
913
+ let i = oe(e, n.attributeName), a = r.getAttributeShaderTypeInfo(i.type), o = n.vertexFormat, s = t.getVertexFormatInfo(o);
914
+ return {
915
+ attributeName: n.attributeName,
916
+ bufferName: n.bufferName,
917
+ location: i.location,
918
+ shaderType: i.type,
919
+ primitiveType: a.primitiveType,
920
+ shaderComponents: a.components,
921
+ vertexFormat: o,
922
+ bufferDataType: s.type,
923
+ bufferComponents: s.components,
924
+ normalized: s.normalized,
925
+ integer: a.integer,
926
+ stepMode: n.stepMode,
927
+ byteOffset: n.byteOffset,
928
+ byteStride: n.byteStride
929
+ };
930
+ }
931
+ function oe(t, n) {
932
+ let r = t.attributes.find((e) => e.name === n);
933
+ return r || e.warn(`shader layout attribute "${n}" not present in shader`)(), r || null;
934
+ }
935
+ //#endregion
936
+ export { X as a, q as c, L as d, O as f, $ as i, K as l, Q as n, J as o, ee as r, Y as s, ie as t, W as u };