@loaders.gl/scene 5.0.0-beta.7 → 5.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/dist.dev.js +989 -211
  2. package/dist/dist.min.js +18 -18
  3. package/dist/draco/lib/draco-parser.cjs +8 -5
  4. package/dist/draco/lib/draco-parser.cjs.map +2 -2
  5. package/dist/draco/lib/draco-parser.d.ts +2 -1
  6. package/dist/draco/lib/draco-parser.d.ts.map +1 -1
  7. package/dist/draco/lib/draco-parser.js +6 -3
  8. package/dist/draco/lib/draco-parser.js.map +1 -1
  9. package/dist/draco/lib/parse-draco.cjs +2 -1
  10. package/dist/draco/lib/parse-draco.cjs.map +2 -2
  11. package/dist/draco/lib/parse-draco.d.ts.map +1 -1
  12. package/dist/draco/lib/parse-draco.js +2 -1
  13. package/dist/draco/lib/parse-draco.js.map +1 -1
  14. package/dist/draco/lib/utils/version.cjs +1 -1
  15. package/dist/draco/lib/utils/version.js +1 -1
  16. package/dist/draco-worker-node.js +933 -152
  17. package/dist/draco-worker-node.js.map +4 -4
  18. package/dist/draco-worker.js +830 -56
  19. package/dist/draco-worker.js.map +4 -4
  20. package/dist/draco-writer-worker-node.cjs +773 -186
  21. package/dist/draco-writer-worker-node.cjs.map +4 -4
  22. package/dist/draco-writer-worker.js +630 -46
  23. package/dist/draco-writer-worker.js.map +4 -4
  24. package/dist/gltf/lib/parsers/parse-gltf.cjs +8 -7
  25. package/dist/gltf/lib/parsers/parse-gltf.cjs.map +3 -3
  26. package/dist/gltf/lib/parsers/parse-gltf.d.ts.map +1 -1
  27. package/dist/gltf/lib/parsers/parse-gltf.js +3 -1
  28. package/dist/gltf/lib/parsers/parse-gltf.js.map +1 -1
  29. package/dist/gltf/lib/utils/version.cjs +1 -1
  30. package/dist/gltf/lib/utils/version.js +1 -1
  31. package/dist/mtl-loader-types.cjs +1 -1
  32. package/dist/obj/mtl-loader-types.cjs +1 -1
  33. package/dist/obj/mtl-loader-types.js +1 -1
  34. package/dist/obj/obj-loader-types.cjs +1 -1
  35. package/dist/obj/obj-loader-types.js +1 -1
  36. package/dist/obj/obj-writer.cjs +1 -1
  37. package/dist/obj/obj-writer.js +1 -1
  38. package/dist/obj-loader-types.cjs +1 -1
  39. package/dist/obj-worker.js +37 -1
  40. package/dist/obj-writer.cjs +1 -1
  41. package/dist/stl-loader-types.cjs +1 -1
  42. package/dist/stl-loader-types.js +1 -1
  43. package/dist/usd/usd-loader-types.cjs +1 -1
  44. package/dist/usd/usd-loader-types.js +1 -1
  45. package/dist/usd-loader-types.cjs +1 -1
  46. package/package.json +6 -6
  47. package/src/draco/lib/draco-parser.ts +6 -3
  48. package/src/draco/lib/parse-draco.ts +2 -1
  49. package/src/gltf/lib/parsers/parse-gltf.ts +2 -1
package/dist/dist.dev.js CHANGED
@@ -2319,6 +2319,12 @@ var __exports__ = (() => {
2319
2319
  }
2320
2320
  });
2321
2321
 
2322
+ // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-helpers.js
2323
+ var init_indexed_arrow_helpers = __esm({
2324
+ "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-helpers.js"() {
2325
+ }
2326
+ });
2327
+
2322
2328
  // ../../node_modules/tslib/tslib.es6.mjs
2323
2329
  function __rest(s, e) {
2324
2330
  var t = {};
@@ -10121,8 +10127,8 @@ return true;`);
10121
10127
  static startFooter(builder) {
10122
10128
  builder.startObject(5);
10123
10129
  }
10124
- static addVersion(builder, version) {
10125
- builder.addFieldInt16(0, version, MetadataVersion.V1);
10130
+ static addVersion(builder, version2) {
10131
+ builder.addFieldInt16(0, version2, MetadataVersion.V1);
10126
10132
  }
10127
10133
  static addSchema(builder, schemaOffset) {
10128
10134
  builder.addFieldOffset(1, schemaOffset, 0);
@@ -10368,9 +10374,9 @@ return true;`);
10368
10374
  get numDictionaries() {
10369
10375
  return this._dictionaryBatches.length;
10370
10376
  }
10371
- constructor(schema, version = MetadataVersion.V5, recordBatches, dictionaryBatches) {
10377
+ constructor(schema, version2 = MetadataVersion.V5, recordBatches, dictionaryBatches) {
10372
10378
  this.schema = schema;
10373
- this.version = version;
10379
+ this.version = version2;
10374
10380
  recordBatches && (this._recordBatches = recordBatches);
10375
10381
  dictionaryBatches && (this._dictionaryBatches = dictionaryBatches);
10376
10382
  }
@@ -10498,8 +10504,8 @@ return true;`);
10498
10504
  static startMessage(builder) {
10499
10505
  builder.startObject(5);
10500
10506
  }
10501
- static addVersion(builder, version) {
10502
- builder.addFieldInt16(0, version, MetadataVersion.V1);
10507
+ static addVersion(builder, version2) {
10508
+ builder.addFieldInt16(0, version2, MetadataVersion.V1);
10503
10509
  }
10504
10510
  static addHeaderType(builder, headerType) {
10505
10511
  builder.addFieldInt8(1, headerType, MessageHeader.NONE);
@@ -10533,9 +10539,9 @@ return true;`);
10533
10539
  static finishSizePrefixedMessageBuffer(builder, offset) {
10534
10540
  builder.finish(offset, void 0, true);
10535
10541
  }
10536
- static createMessage(builder, version, headerType, headerOffset, bodyLength, customMetadataOffset) {
10542
+ static createMessage(builder, version2, headerType, headerOffset, bodyLength, customMetadataOffset) {
10537
10543
  _Message.startMessage(builder);
10538
- _Message.addVersion(builder, version);
10544
+ _Message.addVersion(builder, version2);
10539
10545
  _Message.addHeaderType(builder, headerType);
10540
10546
  _Message.addHeader(builder, headerOffset);
10541
10547
  _Message.addBodyLength(builder, bodyLength);
@@ -10907,16 +10913,16 @@ return true;`);
10907
10913
  throw new Error(`Unrecognized Message type: { name: ${MessageHeader[type]}, type: ${type} }`);
10908
10914
  });
10909
10915
  }
10910
- function decodeSchema(_schema, dictionaries = /* @__PURE__ */ new Map(), version = MetadataVersion.V5) {
10916
+ function decodeSchema(_schema, dictionaries = /* @__PURE__ */ new Map(), version2 = MetadataVersion.V5) {
10911
10917
  const fields = decodeSchemaFields(_schema, dictionaries);
10912
- return new Schema2(fields, decodeCustomMetadata(_schema), dictionaries, version);
10918
+ return new Schema2(fields, decodeCustomMetadata(_schema), dictionaries, version2);
10913
10919
  }
10914
- function decodeRecordBatch(batch, version = MetadataVersion.V5) {
10915
- const recordBatch = new RecordBatch2(batch.length(), decodeFieldNodes(batch), decodeBuffers(batch, version), decodeBodyCompression(batch.compression()), decodeVariadicBufferCounts(batch));
10920
+ function decodeRecordBatch(batch, version2 = MetadataVersion.V5) {
10921
+ const recordBatch = new RecordBatch2(batch.length(), decodeFieldNodes(batch), decodeBuffers(batch, version2), decodeBodyCompression(batch.compression()), decodeVariadicBufferCounts(batch));
10916
10922
  return recordBatch;
10917
10923
  }
10918
- function decodeDictionaryBatch(batch, version = MetadataVersion.V5) {
10919
- return new DictionaryBatch2(RecordBatch2.decode(batch.data(), version), batch.id(), batch.isDelta());
10924
+ function decodeDictionaryBatch(batch, version2 = MetadataVersion.V5) {
10925
+ return new DictionaryBatch2(RecordBatch2.decode(batch.data(), version2), batch.id(), batch.isDelta());
10920
10926
  }
10921
10927
  function decodeBufferRegion(b) {
10922
10928
  return new BufferRegion(b.offset(), b.length());
@@ -10933,11 +10939,11 @@ return true;`);
10933
10939
  }
10934
10940
  return nodes;
10935
10941
  }
10936
- function decodeBuffers(batch, version) {
10942
+ function decodeBuffers(batch, version2) {
10937
10943
  const bufferRegions = [];
10938
10944
  for (let b, i = -1, j = -1, n = batch.buffersLength(); ++i < n; ) {
10939
10945
  if (b = batch.buffers(i)) {
10940
- if (version < MetadataVersion.V4) {
10946
+ if (version2 < MetadataVersion.V4) {
10941
10947
  b.bb_pos += 8 * (i + 1);
10942
10948
  }
10943
10949
  bufferRegions[++j] = BufferRegion.decode(b);
@@ -11262,10 +11268,10 @@ return true;`);
11262
11268
  buf = new ByteBuffer3(toUint8Array(buf));
11263
11269
  const _message = Message.getRootAsMessage(buf);
11264
11270
  const bodyLength = _message.bodyLength();
11265
- const version = _message.version();
11271
+ const version2 = _message.version();
11266
11272
  const headerType = _message.headerType();
11267
11273
  const metadata3 = decodeMessageCustomMetadata(_message);
11268
- const message = new _Message(bodyLength, version, headerType, void 0, metadata3);
11274
+ const message = new _Message(bodyLength, version2, headerType, void 0, metadata3);
11269
11275
  message._createHeader = decodeMessageHeader(_message, headerType);
11270
11276
  return message;
11271
11277
  }
@@ -11342,8 +11348,8 @@ return true;`);
11342
11348
  isDictionaryBatch() {
11343
11349
  return this.headerType === MessageHeader.DictionaryBatch;
11344
11350
  }
11345
- constructor(bodyLength, version, headerType, header, metadata3) {
11346
- this._version = version;
11351
+ constructor(bodyLength, version2, headerType, header, metadata3) {
11352
+ this._version = version2;
11347
11353
  this._headerType = headerType;
11348
11354
  this.body = new Uint8Array(0);
11349
11355
  this._compression = header === null || header === void 0 ? void 0 : header.compression;
@@ -17219,6 +17225,12 @@ return true;`);
17219
17225
  }
17220
17226
  });
17221
17227
 
17228
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-schema-utils.js
17229
+ var init_arrow_schema_utils = __esm({
17230
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-schema-utils.js"() {
17231
+ }
17232
+ });
17233
+
17222
17234
  // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js
17223
17235
  function getArrowVariadicBuffers(data) {
17224
17236
  return data.variadicBuffers ?? [];
@@ -17322,27 +17334,43 @@ return true;`);
17322
17334
  }
17323
17335
  });
17324
17336
 
17337
+ // ../../node_modules/@math.gl/arrow/dist/arrow/take-arrow-rows.js
17338
+ var init_take_arrow_rows = __esm({
17339
+ "../../node_modules/@math.gl/arrow/dist/arrow/take-arrow-rows.js"() {
17340
+ init_arrow_data();
17341
+ init_split_arrow_buffers();
17342
+ }
17343
+ });
17344
+
17325
17345
  // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js
17326
17346
  var init_indexed_arrow_vector = __esm({
17327
17347
  "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js"() {
17348
+ init_indexed_arrow_helpers();
17328
17349
  }
17329
17350
  });
17330
17351
 
17331
17352
  // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js
17332
17353
  var init_indexed_arrow_table = __esm({
17333
17354
  "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js"() {
17355
+ init_indexed_arrow_helpers();
17356
+ init_arrow_schema_utils();
17357
+ init_take_arrow_rows();
17358
+ init_indexed_arrow_vector();
17334
17359
  }
17335
17360
  });
17336
17361
 
17337
17362
  // ../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js
17338
17363
  var init_mapped_arrow_table = __esm({
17339
17364
  "../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js"() {
17365
+ init_indexed_arrow_helpers();
17366
+ init_indexed_arrow_table();
17340
17367
  }
17341
17368
  });
17342
17369
 
17343
17370
  // ../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js
17344
17371
  var init_rename_arrow_columns = __esm({
17345
17372
  "../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js"() {
17373
+ init_arrow_schema_utils();
17346
17374
  }
17347
17375
  });
17348
17376
 
@@ -17396,15 +17424,23 @@ return true;`);
17396
17424
  }
17397
17425
  });
17398
17426
 
17427
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js
17428
+ var init_arrow_column_utils = __esm({
17429
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js"() {
17430
+ }
17431
+ });
17432
+
17399
17433
  // ../../node_modules/@math.gl/arrow/dist/arrow/index.js
17400
17434
  var init_arrow = __esm({
17401
17435
  "../../node_modules/@math.gl/arrow/dist/arrow/index.js"() {
17402
17436
  init_indexed_arrow_table();
17403
17437
  init_indexed_arrow_vector();
17404
17438
  init_mapped_arrow_table();
17439
+ init_arrow_schema_utils();
17405
17440
  init_rename_arrow_columns();
17406
17441
  init_split_arrow_buffers();
17407
17442
  init_arrow_table_transport();
17443
+ init_arrow_column_utils();
17408
17444
  }
17409
17445
  });
17410
17446
 
@@ -17512,6 +17548,738 @@ return true;`);
17512
17548
  }
17513
17549
  });
17514
17550
 
17551
+ // ../../node_modules/probe.gl/dist/env/lib/globals.js
17552
+ var window_2, document_2, process_, console_, navigator_;
17553
+ var init_globals2 = __esm({
17554
+ "../../node_modules/probe.gl/dist/env/lib/globals.js"() {
17555
+ window_2 = globalThis;
17556
+ document_2 = globalThis.document || {};
17557
+ process_ = globalThis.process || {};
17558
+ console_ = globalThis.console;
17559
+ navigator_ = globalThis.navigator || {};
17560
+ }
17561
+ });
17562
+
17563
+ // ../../node_modules/probe.gl/dist/env/lib/is-electron.js
17564
+ function isElectron(mockUserAgent) {
17565
+ if (typeof window !== "undefined" && window.process?.type === "renderer") {
17566
+ return true;
17567
+ }
17568
+ if (typeof process !== "undefined" && Boolean(process.versions?.["electron"])) {
17569
+ return true;
17570
+ }
17571
+ const realUserAgent = typeof navigator !== "undefined" && navigator.userAgent;
17572
+ const userAgent = mockUserAgent || realUserAgent;
17573
+ return Boolean(userAgent && userAgent.indexOf("Electron") >= 0);
17574
+ }
17575
+ var init_is_electron = __esm({
17576
+ "../../node_modules/probe.gl/dist/env/lib/is-electron.js"() {
17577
+ }
17578
+ });
17579
+
17580
+ // ../../node_modules/probe.gl/dist/env/lib/is-browser.js
17581
+ function isBrowser2() {
17582
+ const isNode = (
17583
+ // @ts-expect-error
17584
+ typeof process === "object" && String(process) === "[object process]" && !process?.browser
17585
+ );
17586
+ return !isNode || isElectron();
17587
+ }
17588
+ var init_is_browser = __esm({
17589
+ "../../node_modules/probe.gl/dist/env/lib/is-browser.js"() {
17590
+ init_is_electron();
17591
+ }
17592
+ });
17593
+
17594
+ // ../../node_modules/probe.gl/dist/env/lib/get-browser.js
17595
+ var init_get_browser = __esm({
17596
+ "../../node_modules/probe.gl/dist/env/lib/get-browser.js"() {
17597
+ init_is_browser();
17598
+ init_is_electron();
17599
+ init_globals2();
17600
+ }
17601
+ });
17602
+
17603
+ // ../../node_modules/probe.gl/dist/env/utils/assert.js
17604
+ var init_assert2 = __esm({
17605
+ "../../node_modules/probe.gl/dist/env/utils/assert.js"() {
17606
+ }
17607
+ });
17608
+
17609
+ // ../../node_modules/probe.gl/dist/env/index.js
17610
+ var VERSION2;
17611
+ var init_env = __esm({
17612
+ "../../node_modules/probe.gl/dist/env/index.js"() {
17613
+ init_globals2();
17614
+ init_is_browser();
17615
+ init_get_browser();
17616
+ init_is_electron();
17617
+ init_assert2();
17618
+ VERSION2 = true ? "5.0.0" : "untranspiled source";
17619
+ }
17620
+ });
17621
+
17622
+ // ../../node_modules/probe.gl/dist/log/utils/assert.js
17623
+ function assert3(condition, message) {
17624
+ if (!condition) {
17625
+ throw new Error(message || "Assertion failed");
17626
+ }
17627
+ }
17628
+ var init_assert3 = __esm({
17629
+ "../../node_modules/probe.gl/dist/log/utils/assert.js"() {
17630
+ }
17631
+ });
17632
+
17633
+ // ../../node_modules/probe.gl/dist/log/loggers/log-utils.js
17634
+ function normalizeLogLevel(logLevel) {
17635
+ if (!logLevel) {
17636
+ return 0;
17637
+ }
17638
+ let resolvedLevel;
17639
+ switch (typeof logLevel) {
17640
+ case "number":
17641
+ resolvedLevel = logLevel;
17642
+ break;
17643
+ case "object":
17644
+ resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
17645
+ break;
17646
+ default:
17647
+ return 0;
17648
+ }
17649
+ assert3(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
17650
+ return resolvedLevel;
17651
+ }
17652
+ function normalizeArguments(opts) {
17653
+ const { logLevel, message } = opts;
17654
+ opts.logLevel = normalizeLogLevel(logLevel);
17655
+ const args = opts.args ? Array.from(opts.args) : [];
17656
+ while (args.length && args.shift() !== message) {
17657
+ }
17658
+ switch (typeof logLevel) {
17659
+ case "string":
17660
+ case "function":
17661
+ if (message !== void 0) {
17662
+ args.unshift(message);
17663
+ }
17664
+ opts.message = logLevel;
17665
+ break;
17666
+ case "object":
17667
+ Object.assign(opts, logLevel);
17668
+ break;
17669
+ default:
17670
+ }
17671
+ if (typeof opts.message === "function") {
17672
+ opts.message = opts.message();
17673
+ }
17674
+ const messageType = typeof opts.message;
17675
+ assert3(messageType === "string" || messageType === "object");
17676
+ return Object.assign(opts, { args }, opts.opts);
17677
+ }
17678
+ var init_log_utils = __esm({
17679
+ "../../node_modules/probe.gl/dist/log/loggers/log-utils.js"() {
17680
+ init_assert3();
17681
+ }
17682
+ });
17683
+
17684
+ // ../../node_modules/probe.gl/dist/log/loggers/base-log.js
17685
+ var noop, BaseLog;
17686
+ var init_base_log = __esm({
17687
+ "../../node_modules/probe.gl/dist/log/loggers/base-log.js"() {
17688
+ init_log_utils();
17689
+ noop = () => {
17690
+ };
17691
+ BaseLog = class {
17692
+ constructor({ level = 0 } = {}) {
17693
+ this.userData = {};
17694
+ this._onceCache = /* @__PURE__ */ new Set();
17695
+ this._level = level;
17696
+ }
17697
+ set level(newLevel) {
17698
+ this.setLevel(newLevel);
17699
+ }
17700
+ get level() {
17701
+ return this.getLevel();
17702
+ }
17703
+ setLevel(level) {
17704
+ this._level = level;
17705
+ return this;
17706
+ }
17707
+ getLevel() {
17708
+ return this._level;
17709
+ }
17710
+ // Unconditional logging
17711
+ warn(message, ...args) {
17712
+ return this._log("warn", 0, message, args, { once: true });
17713
+ }
17714
+ error(message, ...args) {
17715
+ return this._log("error", 0, message, args);
17716
+ }
17717
+ // Conditional logging
17718
+ log(logLevel, message, ...args) {
17719
+ return this._log("log", logLevel, message, args);
17720
+ }
17721
+ info(logLevel, message, ...args) {
17722
+ return this._log("info", logLevel, message, args);
17723
+ }
17724
+ once(logLevel, message, ...args) {
17725
+ return this._log("once", logLevel, message, args, { once: true });
17726
+ }
17727
+ _log(type, logLevel, message, args, options = {}) {
17728
+ const normalized = normalizeArguments({
17729
+ logLevel,
17730
+ message,
17731
+ args: this._buildArgs(logLevel, message, args),
17732
+ opts: options
17733
+ });
17734
+ return this._createLogFunction(type, normalized, options);
17735
+ }
17736
+ _buildArgs(logLevel, message, args) {
17737
+ return [logLevel, message, ...args];
17738
+ }
17739
+ _createLogFunction(type, normalized, options) {
17740
+ if (!this._shouldLog(normalized.logLevel)) {
17741
+ return noop;
17742
+ }
17743
+ const tag = this._getOnceTag(options.tag ?? normalized.tag ?? normalized.message);
17744
+ if ((options.once || normalized.once) && tag !== void 0) {
17745
+ if (this._onceCache.has(tag)) {
17746
+ return noop;
17747
+ }
17748
+ this._onceCache.add(tag);
17749
+ }
17750
+ return this._emit(type, normalized);
17751
+ }
17752
+ _shouldLog(logLevel) {
17753
+ return this.getLevel() >= normalizeLogLevel(logLevel);
17754
+ }
17755
+ _getOnceTag(tag) {
17756
+ if (tag === void 0) {
17757
+ return void 0;
17758
+ }
17759
+ try {
17760
+ return typeof tag === "string" ? tag : String(tag);
17761
+ } catch {
17762
+ return void 0;
17763
+ }
17764
+ }
17765
+ };
17766
+ }
17767
+ });
17768
+
17769
+ // ../../node_modules/probe.gl/dist/log/utils/local-storage.js
17770
+ function getStorage(type) {
17771
+ try {
17772
+ const storage = window[type];
17773
+ const x = "__storage_test__";
17774
+ storage.setItem(x, x);
17775
+ storage.removeItem(x);
17776
+ return storage;
17777
+ } catch (e) {
17778
+ return null;
17779
+ }
17780
+ }
17781
+ var LocalStorage;
17782
+ var init_local_storage = __esm({
17783
+ "../../node_modules/probe.gl/dist/log/utils/local-storage.js"() {
17784
+ LocalStorage = class {
17785
+ constructor(id, defaultConfig, type = "sessionStorage") {
17786
+ this.storage = getStorage(type);
17787
+ this.id = id;
17788
+ this.config = defaultConfig;
17789
+ this._loadConfiguration();
17790
+ }
17791
+ getConfiguration() {
17792
+ return this.config;
17793
+ }
17794
+ setConfiguration(configuration) {
17795
+ Object.assign(this.config, configuration);
17796
+ if (this.storage) {
17797
+ const serialized = JSON.stringify(this.config);
17798
+ this.storage.setItem(this.id, serialized);
17799
+ }
17800
+ }
17801
+ // Get config from persistent store, if available
17802
+ _loadConfiguration() {
17803
+ let configuration = {};
17804
+ if (this.storage) {
17805
+ const serializedConfiguration = this.storage.getItem(this.id);
17806
+ configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
17807
+ }
17808
+ Object.assign(this.config, configuration);
17809
+ return this;
17810
+ }
17811
+ };
17812
+ }
17813
+ });
17814
+
17815
+ // ../../node_modules/probe.gl/dist/log/utils/formatters.js
17816
+ function formatTime(ms) {
17817
+ let formatted;
17818
+ if (ms < 10) {
17819
+ formatted = `${ms.toFixed(2)}ms`;
17820
+ } else if (ms < 100) {
17821
+ formatted = `${ms.toFixed(1)}ms`;
17822
+ } else if (ms < 1e3) {
17823
+ formatted = `${ms.toFixed(0)}ms`;
17824
+ } else {
17825
+ formatted = `${(ms / 1e3).toFixed(2)}s`;
17826
+ }
17827
+ return formatted;
17828
+ }
17829
+ function leftPad(string, length4 = 8) {
17830
+ const padLength = Math.max(length4 - string.length, 0);
17831
+ return `${" ".repeat(padLength)}${string}`;
17832
+ }
17833
+ var init_formatters = __esm({
17834
+ "../../node_modules/probe.gl/dist/log/utils/formatters.js"() {
17835
+ }
17836
+ });
17837
+
17838
+ // ../../node_modules/probe.gl/dist/log/utils/color.js
17839
+ function getColor(color) {
17840
+ if (typeof color !== "string") {
17841
+ return color;
17842
+ }
17843
+ color = color.toUpperCase();
17844
+ return COLOR[color] || COLOR.WHITE;
17845
+ }
17846
+ function addColor(string, color, background) {
17847
+ if (!isBrowser2 && typeof string === "string") {
17848
+ if (color) {
17849
+ const colorCode = getColor(color);
17850
+ string = `\x1B[${colorCode}m${string}\x1B[39m`;
17851
+ }
17852
+ if (background) {
17853
+ const colorCode = getColor(background);
17854
+ string = `\x1B[${colorCode + BACKGROUND_INCREMENT}m${string}\x1B[49m`;
17855
+ }
17856
+ }
17857
+ return string;
17858
+ }
17859
+ var COLOR, BACKGROUND_INCREMENT;
17860
+ var init_color = __esm({
17861
+ "../../node_modules/probe.gl/dist/log/utils/color.js"() {
17862
+ init_env();
17863
+ (function(COLOR2) {
17864
+ COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
17865
+ COLOR2[COLOR2["RED"] = 31] = "RED";
17866
+ COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
17867
+ COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
17868
+ COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
17869
+ COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
17870
+ COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
17871
+ COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
17872
+ COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
17873
+ COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
17874
+ COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
17875
+ COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
17876
+ COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
17877
+ COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
17878
+ COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
17879
+ COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
17880
+ })(COLOR || (COLOR = {}));
17881
+ BACKGROUND_INCREMENT = 10;
17882
+ }
17883
+ });
17884
+
17885
+ // ../../node_modules/probe.gl/dist/log/utils/autobind.js
17886
+ function autobind(obj, predefined = ["constructor"]) {
17887
+ const proto = Object.getPrototypeOf(obj);
17888
+ const propNames = Object.getOwnPropertyNames(proto);
17889
+ const object = obj;
17890
+ for (const key of propNames) {
17891
+ const value = object[key];
17892
+ if (typeof value === "function") {
17893
+ if (!predefined.find((name22) => key === name22)) {
17894
+ object[key] = value.bind(obj);
17895
+ }
17896
+ }
17897
+ }
17898
+ }
17899
+ var init_autobind = __esm({
17900
+ "../../node_modules/probe.gl/dist/log/utils/autobind.js"() {
17901
+ }
17902
+ });
17903
+
17904
+ // ../../node_modules/probe.gl/dist/log/probe.js
17905
+ var Probe, probe;
17906
+ var init_probe = __esm({
17907
+ "../../node_modules/probe.gl/dist/log/probe.js"() {
17908
+ init_env();
17909
+ Probe = class {
17910
+ getHighResolutionTimer() {
17911
+ let timestamp;
17912
+ if (isBrowser2() && window_2.performance) {
17913
+ timestamp = window_2?.performance?.now?.();
17914
+ } else if ("hrtime" in process_) {
17915
+ const timeParts = process_?.hrtime?.();
17916
+ timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
17917
+ } else {
17918
+ timestamp = Date.now();
17919
+ }
17920
+ return timestamp;
17921
+ }
17922
+ getMemoryUsageMB() {
17923
+ const performance2 = window_2?.performance;
17924
+ const usedJSHeapSize = performance2?.memory?.usedJSHeapSize;
17925
+ if (usedJSHeapSize === void 0 || usedJSHeapSize === null) {
17926
+ return null;
17927
+ }
17928
+ return Math.trunc(usedJSHeapSize / 1024 / 1024);
17929
+ }
17930
+ };
17931
+ probe = new Probe();
17932
+ globalThis.Probe = Probe;
17933
+ globalThis.probe = probe;
17934
+ }
17935
+ });
17936
+
17937
+ // ../../node_modules/probe.gl/dist/log/loggers/probe-log.js
17938
+ function decorateMessage(id, message, opts) {
17939
+ if (typeof message === "string") {
17940
+ const time = opts.time ? leftPad(formatTime(opts.total)) : "";
17941
+ message = opts.time ? `${id}: ${time} ${message}` : `${id}: ${message}`;
17942
+ message = addColor(message, opts.color, opts.background);
17943
+ }
17944
+ return message;
17945
+ }
17946
+ function getTableHeader(table) {
17947
+ for (const key in table) {
17948
+ for (const title in table[key]) {
17949
+ return title || "untitled";
17950
+ }
17951
+ }
17952
+ return "empty";
17953
+ }
17954
+ var originalConsole, DEFAULT_LOG_CONFIGURATION, ProbeLog;
17955
+ var init_probe_log = __esm({
17956
+ "../../node_modules/probe.gl/dist/log/loggers/probe-log.js"() {
17957
+ init_env();
17958
+ init_base_log();
17959
+ init_local_storage();
17960
+ init_formatters();
17961
+ init_color();
17962
+ init_autobind();
17963
+ init_assert3();
17964
+ init_probe();
17965
+ init_log_utils();
17966
+ init_log_utils();
17967
+ originalConsole = {
17968
+ debug: isBrowser2() ? console.debug || console.log : console.log,
17969
+ log: console.log,
17970
+ info: console.info,
17971
+ warn: console.warn,
17972
+ error: console.error
17973
+ };
17974
+ DEFAULT_LOG_CONFIGURATION = {
17975
+ enabled: true,
17976
+ level: 0
17977
+ };
17978
+ ProbeLog = class extends BaseLog {
17979
+ constructor({ id } = { id: "" }) {
17980
+ super({ level: 0 });
17981
+ this.VERSION = VERSION2;
17982
+ this._startTs = probe.getHighResolutionTimer();
17983
+ this._deltaTs = probe.getHighResolutionTimer();
17984
+ this.userData = {};
17985
+ this.LOG_THROTTLE_TIMEOUT = 0;
17986
+ this.id = id;
17987
+ this.userData = {};
17988
+ this._storage = new LocalStorage(`__probe-${this.id}__`, { [this.id]: DEFAULT_LOG_CONFIGURATION });
17989
+ this.timeStamp(`${this.id} started`);
17990
+ autobind(this);
17991
+ Object.seal(this);
17992
+ }
17993
+ isEnabled() {
17994
+ return this._getConfiguration().enabled;
17995
+ }
17996
+ getLevel() {
17997
+ return this._getConfiguration().level;
17998
+ }
17999
+ /** @return milliseconds, with fractions */
18000
+ getTotal() {
18001
+ return Number((probe.getHighResolutionTimer() - this._startTs).toPrecision(10));
18002
+ }
18003
+ /** @return milliseconds, with fractions */
18004
+ getDelta() {
18005
+ return Number((probe.getHighResolutionTimer() - this._deltaTs).toPrecision(10));
18006
+ }
18007
+ /** @deprecated use logLevel */
18008
+ set priority(newPriority) {
18009
+ this.level = newPriority;
18010
+ }
18011
+ /** @deprecated use logLevel */
18012
+ get priority() {
18013
+ return this.level;
18014
+ }
18015
+ /** @deprecated use logLevel */
18016
+ getPriority() {
18017
+ return this.level;
18018
+ }
18019
+ // Configure
18020
+ enable(enabled = true) {
18021
+ this._updateConfiguration({ enabled });
18022
+ return this;
18023
+ }
18024
+ setLevel(level) {
18025
+ this._updateConfiguration({ level });
18026
+ return this;
18027
+ }
18028
+ /** return the current status of the setting */
18029
+ get(setting) {
18030
+ return this._getConfiguration()[setting];
18031
+ }
18032
+ // update the status of the setting
18033
+ set(setting, value) {
18034
+ this._updateConfiguration({ [setting]: value });
18035
+ }
18036
+ /** Logs the current settings as a table */
18037
+ settings() {
18038
+ if (console.table) {
18039
+ console.table(this._storage.config);
18040
+ } else {
18041
+ console.log(this._storage.config);
18042
+ }
18043
+ }
18044
+ // Unconditional logging
18045
+ assert(condition, message) {
18046
+ if (!condition) {
18047
+ throw new Error(message || "Assertion failed");
18048
+ }
18049
+ }
18050
+ warn(message, ...args) {
18051
+ return this._log("warn", 0, message, args, {
18052
+ method: originalConsole.warn,
18053
+ once: true
18054
+ });
18055
+ }
18056
+ error(message, ...args) {
18057
+ return this._log("error", 0, message, args, {
18058
+ method: originalConsole.error
18059
+ });
18060
+ }
18061
+ /** Print a deprecation warning */
18062
+ deprecated(oldUsage, newUsage) {
18063
+ return this.warn(`\`${oldUsage}\` is deprecated and will be removed in a later version. Use \`${newUsage}\` instead`);
18064
+ }
18065
+ /** Print a removal warning */
18066
+ removed(oldUsage, newUsage) {
18067
+ return this.error(`\`${oldUsage}\` has been removed. Use \`${newUsage}\` instead`);
18068
+ }
18069
+ probe(logLevel, message, ...args) {
18070
+ const memoryUsageMB = probe.getMemoryUsageMB();
18071
+ if (memoryUsageMB !== null) {
18072
+ const memoryUsagePrefix = `${memoryUsageMB}MB `;
18073
+ if (typeof message === "function") {
18074
+ message = () => `${memoryUsagePrefix}${message()}`;
18075
+ } else if (typeof message === "string") {
18076
+ message = `${memoryUsagePrefix}${message}`;
18077
+ }
18078
+ }
18079
+ return this._log("log", logLevel, message, args, {
18080
+ method: originalConsole.log,
18081
+ time: true,
18082
+ once: true
18083
+ });
18084
+ }
18085
+ log(logLevel, message, ...args) {
18086
+ return this._log("log", logLevel, message, args, {
18087
+ method: originalConsole.debug
18088
+ });
18089
+ }
18090
+ info(logLevel, message, ...args) {
18091
+ return this._log("info", logLevel, message, args, { method: console.info });
18092
+ }
18093
+ once(logLevel, message, ...args) {
18094
+ return this._log("once", logLevel, message, args, {
18095
+ method: originalConsole.debug || originalConsole.info,
18096
+ once: true
18097
+ });
18098
+ }
18099
+ /** Logs an object as a table */
18100
+ table(logLevel, table, columns) {
18101
+ if (table) {
18102
+ return this._log("table", logLevel, table, columns && [columns] || [], {
18103
+ method: console.table || noop,
18104
+ tag: getTableHeader(table)
18105
+ });
18106
+ }
18107
+ return noop;
18108
+ }
18109
+ time(logLevel, message) {
18110
+ return this._log("time", logLevel, message, [], {
18111
+ method: console.time ? console.time : console.info
18112
+ });
18113
+ }
18114
+ timeEnd(logLevel, message) {
18115
+ return this._log("time", logLevel, message, [], {
18116
+ method: console.timeEnd ? console.timeEnd : console.info
18117
+ });
18118
+ }
18119
+ timeStamp(logLevel, message) {
18120
+ return this._log("time", logLevel, message, [], {
18121
+ method: console.timeStamp || noop
18122
+ });
18123
+ }
18124
+ group(logLevel, message, opts = { collapsed: false }) {
18125
+ const method = (opts.collapsed ? console.groupCollapsed : console.group) || console.info;
18126
+ return this._log("group", logLevel, message, [], { method });
18127
+ }
18128
+ groupCollapsed(logLevel, message, opts = {}) {
18129
+ return this.group(logLevel, message, Object.assign({}, opts, { collapsed: true }));
18130
+ }
18131
+ groupEnd(logLevel) {
18132
+ return this._log("groupEnd", logLevel, "", [], {
18133
+ method: console.groupEnd || noop
18134
+ });
18135
+ }
18136
+ // EXPERIMENTAL
18137
+ withGroup(logLevel, message, func) {
18138
+ this.group(logLevel, message)();
18139
+ try {
18140
+ func();
18141
+ } finally {
18142
+ this.groupEnd(logLevel)();
18143
+ }
18144
+ }
18145
+ trace() {
18146
+ if (console.trace) {
18147
+ console.trace();
18148
+ }
18149
+ }
18150
+ _shouldLog(logLevel) {
18151
+ return this.isEnabled() && super._shouldLog(logLevel);
18152
+ }
18153
+ _emit(_type, normalized) {
18154
+ const method = normalized.method;
18155
+ assert3(method);
18156
+ normalized.total = this.getTotal();
18157
+ normalized.delta = this.getDelta();
18158
+ this._deltaTs = probe.getHighResolutionTimer();
18159
+ const message = decorateMessage(this.id, normalized.message, normalized);
18160
+ return method.bind(console, message, ...normalized.args);
18161
+ }
18162
+ _getConfiguration() {
18163
+ if (!this._storage.config[this.id]) {
18164
+ this._updateConfiguration(DEFAULT_LOG_CONFIGURATION);
18165
+ }
18166
+ return this._storage.config[this.id];
18167
+ }
18168
+ _updateConfiguration(configuration) {
18169
+ const currentConfiguration = this._storage.config[this.id] || {
18170
+ ...DEFAULT_LOG_CONFIGURATION
18171
+ };
18172
+ this._storage.setConfiguration({
18173
+ [this.id]: { ...currentConfiguration, ...configuration }
18174
+ });
18175
+ }
18176
+ };
18177
+ ProbeLog.VERSION = VERSION2;
18178
+ }
18179
+ });
18180
+
18181
+ // ../../node_modules/probe.gl/dist/log/loggers/console-log.js
18182
+ var init_console_log = __esm({
18183
+ "../../node_modules/probe.gl/dist/log/loggers/console-log.js"() {
18184
+ init_base_log();
18185
+ }
18186
+ });
18187
+
18188
+ // ../../node_modules/probe.gl/dist/log/loggers/memory-log.js
18189
+ var init_memory_log = __esm({
18190
+ "../../node_modules/probe.gl/dist/log/loggers/memory-log.js"() {
18191
+ init_base_log();
18192
+ }
18193
+ });
18194
+
18195
+ // ../../node_modules/probe.gl/dist/log/deprecated/hi-res-timestamp.js
18196
+ var init_hi_res_timestamp = __esm({
18197
+ "../../node_modules/probe.gl/dist/log/deprecated/hi-res-timestamp.js"() {
18198
+ init_probe();
18199
+ }
18200
+ });
18201
+
18202
+ // ../../node_modules/probe.gl/dist/log/init.js
18203
+ var init_init = __esm({
18204
+ "../../node_modules/probe.gl/dist/log/init.js"() {
18205
+ init_probe();
18206
+ if (!globalThis.probe) {
18207
+ globalThis.probe = probe;
18208
+ }
18209
+ }
18210
+ });
18211
+
18212
+ // ../../node_modules/probe.gl/dist/log/index.js
18213
+ var log;
18214
+ var init_log = __esm({
18215
+ "../../node_modules/probe.gl/dist/log/index.js"() {
18216
+ init_probe_log();
18217
+ init_probe();
18218
+ init_probe_log();
18219
+ init_console_log();
18220
+ init_base_log();
18221
+ init_memory_log();
18222
+ init_color();
18223
+ init_color();
18224
+ init_formatters();
18225
+ init_autobind();
18226
+ init_local_storage();
18227
+ init_hi_res_timestamp();
18228
+ init_init();
18229
+ log = new ProbeLog({ id: "@probe.gl/log" });
18230
+ }
18231
+ });
18232
+
18233
+ // ../core/src/loader-utils/lib/log-utils/log.ts
18234
+ function createLog() {
18235
+ const log3 = new ProbeLog({ id: "loaders.gl" });
18236
+ globalThis.loaders ||= {};
18237
+ globalThis.loaders.log = log3;
18238
+ globalThis.loaders.version = version;
18239
+ globalThis.probe ||= {};
18240
+ globalThis.probe.loaders = log3;
18241
+ return log3;
18242
+ }
18243
+ function ignoreMessage() {
18244
+ }
18245
+ function getLoaderLog(options) {
18246
+ const logger = options?.core?.log !== void 0 ? options.core.log : options?.log;
18247
+ return logger === null ? nullLog : logger || log2;
18248
+ }
18249
+ var VERSION3, version, log2, NullLog, nullLog;
18250
+ var init_log2 = __esm({
18251
+ "../core/src/loader-utils/lib/log-utils/log.ts"() {
18252
+ "use strict";
18253
+ init_log();
18254
+ VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
18255
+ version = VERSION3[0] >= "0" && VERSION3[0] <= "9" ? `v${VERSION3}` : "";
18256
+ log2 = createLog();
18257
+ NullLog = class {
18258
+ /** Discards debug messages. */
18259
+ log() {
18260
+ return ignoreMessage;
18261
+ }
18262
+ /** Discards informational messages. */
18263
+ info() {
18264
+ return ignoreMessage;
18265
+ }
18266
+ /** Discards messages marked to be emitted once. */
18267
+ once() {
18268
+ return ignoreMessage;
18269
+ }
18270
+ /** Discards warnings. */
18271
+ warn() {
18272
+ return ignoreMessage;
18273
+ }
18274
+ /** Discards errors. */
18275
+ error() {
18276
+ return ignoreMessage;
18277
+ }
18278
+ };
18279
+ nullLog = new NullLog();
18280
+ }
18281
+ });
18282
+
17515
18283
  // ../core/src/loader-utils/lib/javascript-utils/is-type.ts
17516
18284
  var isSharedArrayBuffer;
17517
18285
  var init_is_type = __esm({
@@ -17594,35 +18362,35 @@ return true;`);
17594
18362
 
17595
18363
  // ../core/src/worker-utils/lib/env-utils/version.ts
17596
18364
  function getVersion() {
17597
- const version = typeof __VERSION__ === "undefined" ? NPM_TAG : __VERSION__;
18365
+ const version2 = typeof __VERSION__ === "undefined" ? NPM_TAG : __VERSION__;
17598
18366
  globalThis._loadersgl_ = globalThis._loadersgl_ || {};
17599
- globalThis._loadersgl_.version ||= version;
17600
- return version;
18367
+ globalThis._loadersgl_.version ||= version2;
18368
+ return version2;
17601
18369
  }
17602
- var VERSION2;
18370
+ var VERSION4;
17603
18371
  var init_version = __esm({
17604
18372
  "../core/src/worker-utils/lib/env-utils/version.ts"() {
17605
18373
  "use strict";
17606
18374
  init_npm_tag();
17607
- VERSION2 = getVersion();
18375
+ VERSION4 = getVersion();
17608
18376
  }
17609
18377
  });
17610
18378
 
17611
18379
  // ../core/src/worker-utils/lib/env-utils/assert.ts
17612
- function assert2(condition, message) {
18380
+ function assert4(condition, message) {
17613
18381
  if (!condition) {
17614
18382
  throw new Error(message || "loaders.gl assertion failed.");
17615
18383
  }
17616
18384
  }
17617
- var init_assert2 = __esm({
18385
+ var init_assert4 = __esm({
17618
18386
  "../core/src/worker-utils/lib/env-utils/assert.ts"() {
17619
18387
  "use strict";
17620
18388
  }
17621
18389
  });
17622
18390
 
17623
18391
  // ../core/src/worker-utils/lib/env-utils/globals.ts
17624
- var globals2, self_2, window_2, global_2, document_2, isBrowser2, isWorker, isMobile, matches2, nodeVersion2;
17625
- var init_globals2 = __esm({
18392
+ var globals2, self_2, window_3, global_3, document_3, isBrowser3, isWorker, isMobile2, matches2, nodeVersion2;
18393
+ var init_globals3 = __esm({
17626
18394
  "../core/src/worker-utils/lib/env-utils/globals.ts"() {
17627
18395
  "use strict";
17628
18396
  globals2 = {
@@ -17632,13 +18400,13 @@ return true;`);
17632
18400
  document: typeof document !== "undefined" && document
17633
18401
  };
17634
18402
  self_2 = globals2.self || globals2.window || globals2.global || {};
17635
- window_2 = globals2.window || globals2.self || globals2.global || {};
17636
- global_2 = globals2.global || globals2.self || globals2.window || {};
17637
- document_2 = globals2.document || {};
17638
- isBrowser2 = // @ts-ignore process.browser
18403
+ window_3 = globals2.window || globals2.self || globals2.global || {};
18404
+ global_3 = globals2.global || globals2.self || globals2.window || {};
18405
+ document_3 = globals2.document || {};
18406
+ isBrowser3 = // @ts-ignore process.browser
17639
18407
  typeof process !== "object" || String(process) !== "[object process]" || process.browser;
17640
18408
  isWorker = typeof importScripts === "function";
17641
- isMobile = typeof window !== "undefined" && typeof window.orientation !== "undefined";
18409
+ isMobile2 = typeof window !== "undefined" && typeof window.orientation !== "undefined";
17642
18410
  matches2 = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
17643
18411
  nodeVersion2 = matches2 && parseFloat(matches2[1]) || 0;
17644
18412
  }
@@ -17656,28 +18424,28 @@ return true;`);
17656
18424
  function getVersion2() {
17657
18425
  return typeof __VERSION__ === "undefined" ? NPM_TAG2 : __VERSION__;
17658
18426
  }
17659
- var VERSION3;
18427
+ var VERSION5;
17660
18428
  var init_version2 = __esm({
17661
18429
  "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/env-utils/version.js"() {
17662
18430
  init_npm_tag2();
17663
- VERSION3 = getVersion2();
18431
+ VERSION5 = getVersion2();
17664
18432
  }
17665
18433
  });
17666
18434
 
17667
18435
  // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/env-utils/assert.js
17668
- function assert3(condition, message) {
18436
+ function assert5(condition, message) {
17669
18437
  if (!condition) {
17670
18438
  throw new Error(message || "loaders.gl assertion failed.");
17671
18439
  }
17672
18440
  }
17673
- var init_assert3 = __esm({
18441
+ var init_assert5 = __esm({
17674
18442
  "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/env-utils/assert.js"() {
17675
18443
  }
17676
18444
  });
17677
18445
 
17678
18446
  // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/env-utils/globals.js
17679
- var globals3, self_3, window_3, global_3, document_3, isBrowser3, isMobile2, matches3, nodeVersion3;
17680
- var init_globals3 = __esm({
18447
+ var globals3, self_3, window_4, global_4, document_4, isBrowser4, isMobile3, matches3, nodeVersion3;
18448
+ var init_globals4 = __esm({
17681
18449
  "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/env-utils/globals.js"() {
17682
18450
  globals3 = {
17683
18451
  self: typeof self !== "undefined" && self,
@@ -17686,12 +18454,12 @@ return true;`);
17686
18454
  document: typeof document !== "undefined" && document
17687
18455
  };
17688
18456
  self_3 = globals3.self || globals3.window || globals3.global || {};
17689
- window_3 = globals3.window || globals3.self || globals3.global || {};
17690
- global_3 = globals3.global || globals3.self || globals3.window || {};
17691
- document_3 = globals3.document || {};
17692
- isBrowser3 = // @ts-ignore process.browser
18457
+ window_4 = globals3.window || globals3.self || globals3.global || {};
18458
+ global_4 = globals3.global || globals3.self || globals3.window || {};
18459
+ document_4 = globals3.document || {};
18460
+ isBrowser4 = // @ts-ignore process.browser
17693
18461
  typeof process !== "object" || String(process) !== "[object process]" || process.browser;
17694
- isMobile2 = typeof window !== "undefined" && typeof window.orientation !== "undefined";
18462
+ isMobile3 = typeof window !== "undefined" && typeof window.orientation !== "undefined";
17695
18463
  matches3 = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
17696
18464
  nodeVersion3 = matches3 && parseFloat(matches3[1]) || 0;
17697
18465
  }
@@ -17842,7 +18610,7 @@ return true;`);
17842
18610
 
17843
18611
  // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js
17844
18612
  function getLoadableWorkerURL(props) {
17845
- assert3(props.source && !props.url || !props.source && props.url);
18613
+ assert5(props.source && !props.url || !props.source && props.url);
17846
18614
  if (props.url && props.workerType === "module") {
17847
18615
  const baseUrl = globalThis.document?.baseURI ?? globalThis.location?.href;
17848
18616
  if (!baseUrl)
@@ -17865,7 +18633,7 @@ return true;`);
17865
18633
  workerURLCache.set(props.source, workerURL);
17866
18634
  }
17867
18635
  }
17868
- assert3(workerURL);
18636
+ assert5(workerURL);
17869
18637
  return workerURL;
17870
18638
  }
17871
18639
  function getLoadableWorkerURLFromURL(url) {
@@ -17890,7 +18658,7 @@ return true;`);
17890
18658
  var workerURLCache;
17891
18659
  var init_get_loadable_worker_url = __esm({
17892
18660
  "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js"() {
17893
- init_assert3();
18661
+ init_assert5();
17894
18662
  workerURLCache = /* @__PURE__ */ new Map();
17895
18663
  }
17896
18664
  });
@@ -17988,8 +18756,8 @@ return true;`);
17988
18756
  var init_worker_thread = __esm({
17989
18757
  "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-farm/worker-thread.js"() {
17990
18758
  init_worker_threads_browser();
17991
- init_globals3();
17992
- init_assert3();
18759
+ init_globals4();
18760
+ init_assert5();
17993
18761
  init_get_loadable_worker_url();
17994
18762
  init_get_transfer_list();
17995
18763
  NOOP = () => {
@@ -17997,14 +18765,14 @@ return true;`);
17997
18765
  WorkerThread = class {
17998
18766
  /** Checks if workers are supported on this platform */
17999
18767
  static isSupported() {
18000
- return typeof Worker !== "undefined" && isBrowser3 || typeof NodeWorker !== "undefined" && !isBrowser3;
18768
+ return typeof Worker !== "undefined" && isBrowser4 || typeof NodeWorker !== "undefined" && !isBrowser4;
18001
18769
  }
18002
18770
  constructor(props) {
18003
18771
  this.terminated = false;
18004
18772
  this.createdAt = performance.now();
18005
18773
  this._loadableURL = "";
18006
18774
  const { name: name22, source, url, getUrl, loadWorker } = props;
18007
- assert3(source || url || getUrl || loadWorker);
18775
+ assert5(source || url || getUrl || loadWorker);
18008
18776
  this.name = name22;
18009
18777
  this.source = source;
18010
18778
  this.url = url;
@@ -18014,7 +18782,7 @@ return true;`);
18014
18782
  this.onMessage = NOOP;
18015
18783
  this.onError = (error) => console.log(error);
18016
18784
  const startedAt = performance.now();
18017
- this.worker = isBrowser3 ? this._createBrowserWorker() : this._createNodeWorker();
18785
+ this.worker = isBrowser4 ? this._createBrowserWorker() : this._createNodeWorker();
18018
18786
  this.creationTimeMs = performance.now() - startedAt;
18019
18787
  }
18020
18788
  /**
@@ -18033,13 +18801,13 @@ return true;`);
18033
18801
  }
18034
18802
  /** Keeps this worker from preventing Node.js process exit while idle. */
18035
18803
  unref() {
18036
- if (!isBrowser3 && typeof this.worker.unref === "function") {
18804
+ if (!isBrowser4 && typeof this.worker.unref === "function") {
18037
18805
  this.worker.unref();
18038
18806
  }
18039
18807
  }
18040
18808
  /** Keeps this worker alive while it is actively processing a job. */
18041
18809
  ref() {
18042
- if (!isBrowser3 && typeof this.worker.ref === "function") {
18810
+ if (!isBrowser4 && typeof this.worker.ref === "function") {
18043
18811
  this.worker.ref();
18044
18812
  }
18045
18813
  }
@@ -18178,7 +18946,7 @@ return true;`);
18178
18946
  var WorkerPool;
18179
18947
  var init_worker_pool = __esm({
18180
18948
  "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-farm/worker-pool.js"() {
18181
- init_globals3();
18949
+ init_globals4();
18182
18950
  init_worker_thread();
18183
18951
  init_worker_job();
18184
18952
  WorkerPool = class {
@@ -18702,7 +19470,7 @@ return true;`);
18702
19470
  return null;
18703
19471
  }
18704
19472
  _getMaxConcurrency() {
18705
- return isMobile2 ? this.maxMobileConcurrency : this.maxConcurrency;
19473
+ return isMobile3 ? this.maxMobileConcurrency : this.maxConcurrency;
18706
19474
  }
18707
19475
  };
18708
19476
  }
@@ -18910,15 +19678,15 @@ return true;`);
18910
19678
 
18911
19679
  // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/get-worker-url.js
18912
19680
  function getWorkerName(worker) {
18913
- const warning = worker.version !== VERSION3 ? ` (worker-utils@${VERSION3})` : "";
19681
+ const warning = worker.version !== VERSION5 ? ` (worker-utils@${VERSION5})` : "";
18914
19682
  return `${worker.name}@${worker.version}${warning}`;
18915
19683
  }
18916
19684
  function getCustomWorkerURL(worker, options = {}) {
18917
- const workerFile = isBrowser3 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
19685
+ const workerFile = isBrowser4 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
18918
19686
  let url = getConfiguredWorkerURL(worker, options);
18919
19687
  const workerType = options._workerType || options?.core?._workerType;
18920
19688
  if (!url && workerType === "test") {
18921
- if (isBrowser3) {
19689
+ if (isBrowser4) {
18922
19690
  url = `modules/${worker.module}/dist/${workerFile}`;
18923
19691
  } else {
18924
19692
  const workerSourceDirectory = worker.module === "tasks" && worker.workerNode?.startsWith("worker-utils/") ? "worker-utils/workers" : "workers";
@@ -18936,16 +19704,16 @@ return true;`);
18936
19704
  const customWorkerUrl = getCustomWorkerURL(worker, options);
18937
19705
  const descriptorWorkerUrl = typeof worker.worker === "string" ? worker.worker : null;
18938
19706
  const url = customWorkerUrl || descriptorWorkerUrl || getDefaultWorkerURL(worker, true);
18939
- assert3(url);
19707
+ assert5(url);
18940
19708
  return url;
18941
19709
  }
18942
19710
  function getDefaultWorkerURL(worker, warn = false) {
18943
- const workerFile = isBrowser3 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
18944
- let version = worker.version;
18945
- if (version === "latest") {
18946
- version = NPM_TAG2;
19711
+ const workerFile = isBrowser4 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
19712
+ let version2 = worker.version;
19713
+ if (version2 === "latest") {
19714
+ version2 = NPM_TAG2;
18947
19715
  }
18948
- const versionTag = version ? `@${version}` : "";
19716
+ const versionTag = version2 ? `@${version2}` : "";
18949
19717
  const packageName = worker.packageName || `@loaders.gl/${worker.module}`;
18950
19718
  const url = `https://unpkg.com/${packageName}${versionTag}/dist/${workerFile}`;
18951
19719
  if (warn) {
@@ -18967,8 +19735,8 @@ return true;`);
18967
19735
  var warnedWorkerVersionFallbacks;
18968
19736
  var init_get_worker_url = __esm({
18969
19737
  "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/get-worker-url.js"() {
18970
- init_assert3();
18971
- init_globals3();
19738
+ init_assert5();
19739
+ init_globals4();
18972
19740
  init_version2();
18973
19741
  init_npm_tag2();
18974
19742
  warnedWorkerVersionFallbacks = /* @__PURE__ */ new Set();
@@ -18983,7 +19751,7 @@ return true;`);
18983
19751
  sharedMemory: false,
18984
19752
  crossOriginIsolated: isolated
18985
19753
  };
18986
- if (isBrowser3 && isolated !== true) {
19754
+ if (isBrowser4 && isolated !== true) {
18987
19755
  capabilities.sharedMemoryUnavailableReason = "cross-origin-isolation";
18988
19756
  } else if (typeof SharedArrayBuffer === "undefined" || typeof Atomics === "undefined" || typeof structuredClone !== "function") {
18989
19757
  capabilities.sharedMemoryUnavailableReason = "unsupported";
@@ -19024,7 +19792,7 @@ return true;`);
19024
19792
  var init_shared_state = __esm({
19025
19793
  "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/shared-state.js"() {
19026
19794
  init_worker_thread();
19027
- init_globals3();
19795
+ init_globals4();
19028
19796
  SharedWorkerState = class {
19029
19797
  constructor(buffer) {
19030
19798
  if (typeof SharedArrayBuffer === "undefined" || !(buffer instanceof SharedArrayBuffer) || buffer.byteLength !== 16)
@@ -19336,7 +20104,7 @@ return true;`);
19336
20104
  if (customWorkerUrl) {
19337
20105
  return { name: name22, url: customWorkerUrl, workerType: options.workerType };
19338
20106
  }
19339
- if (isBrowser3 && worker.loadWorker) {
20107
+ if (isBrowser4 && worker.loadWorker) {
19340
20108
  return {
19341
20109
  name: name22,
19342
20110
  workerType: options.workerType,
@@ -19409,7 +20177,7 @@ return true;`);
19409
20177
  init_get_worker_url();
19410
20178
  init_get_transfer_list();
19411
20179
  init_shared_state();
19412
- init_globals3();
20180
+ init_globals4();
19413
20181
  init_get_input_byte_length();
19414
20182
  init_validate_output_ownership();
19415
20183
  }
@@ -20716,11 +21484,11 @@ return true;`);
20716
21484
 
20717
21485
  // ../core/src/worker-utils/lib/worker-api/get-worker-url.ts
20718
21486
  function getCustomWorkerURL2(worker, options = {}) {
20719
- const workerFile = isBrowser2 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
21487
+ const workerFile = isBrowser3 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
20720
21488
  let url = getConfiguredWorkerURL2(worker, options);
20721
21489
  const workerType = options._workerType || options?.core?._workerType;
20722
21490
  if (!url && workerType === "test") {
20723
- if (isBrowser2) {
21491
+ if (isBrowser3) {
20724
21492
  url = `modules/${worker.module}/dist/${workerFile}`;
20725
21493
  } else {
20726
21494
  const workerSourceDirectory = worker.module === "core" && worker.workerNode?.startsWith("worker-utils/") ? "worker-utils/workers" : "workers";
@@ -20738,16 +21506,16 @@ return true;`);
20738
21506
  const customWorkerUrl = getCustomWorkerURL2(worker, options);
20739
21507
  const descriptorWorkerUrl = typeof worker.worker === "string" ? worker.worker : null;
20740
21508
  const url = customWorkerUrl || descriptorWorkerUrl || getDefaultWorkerURL2(worker, true);
20741
- assert2(url);
21509
+ assert4(url);
20742
21510
  return url;
20743
21511
  }
20744
21512
  function getDefaultWorkerURL2(worker, warn = false) {
20745
- const workerFile = isBrowser2 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
20746
- let version = worker.version;
20747
- if (version === "latest") {
20748
- version = NPM_TAG;
21513
+ const workerFile = isBrowser3 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
21514
+ let version2 = worker.version;
21515
+ if (version2 === "latest") {
21516
+ version2 = NPM_TAG;
20749
21517
  }
20750
- const versionTag = version ? `@${version}` : "";
21518
+ const versionTag = version2 ? `@${version2}` : "";
20751
21519
  const url = `https://unpkg.com/@loaders.gl/${worker.module}${versionTag}/dist/${workerFile}`;
20752
21520
  if (warn) {
20753
21521
  warnIfUsingNpmTagFallback2(worker, url);
@@ -20763,16 +21531,17 @@ return true;`);
20763
21531
  return;
20764
21532
  }
20765
21533
  warnedWorkerVersionFallbacks2.add(workerId);
20766
- console.warn(
21534
+ log2.warn(
20767
21535
  `loaders.gl: ${worker.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${url} from CDN.`
20768
- );
21536
+ )();
20769
21537
  }
20770
21538
  var warnedWorkerVersionFallbacks2;
20771
21539
  var init_get_worker_url2 = __esm({
20772
21540
  "../core/src/worker-utils/lib/worker-api/get-worker-url.ts"() {
20773
21541
  "use strict";
20774
- init_assert2();
20775
- init_globals2();
21542
+ init_log2();
21543
+ init_assert4();
21544
+ init_globals3();
20776
21545
  init_npm_tag();
20777
21546
  warnedWorkerVersionFallbacks2 = /* @__PURE__ */ new Set();
20778
21547
  }
@@ -20846,7 +21615,7 @@ return true;`);
20846
21615
 
20847
21616
  // ../core/src/worker-utils/lib/worker-api/process-on-worker.ts
20848
21617
  function canProcessOnWorker2(worker, options = {}) {
20849
- const supported = isBrowser2 ? typeof Worker !== "undefined" : Boolean(options._nodeWorkers);
21618
+ const supported = isBrowser3 ? typeof Worker !== "undefined" : Boolean(options._nodeWorkers);
20850
21619
  return Boolean(
20851
21620
  supported && options.worker && (worker.worker || worker.loadWorker || getConfiguredWorkerURL2(worker, options))
20852
21621
  );
@@ -20873,7 +21642,7 @@ return true;`);
20873
21642
  throw new Error(
20874
21643
  "Inline legacy worker source is unsupported; use a TaskRunner worker URL or factory"
20875
21644
  );
20876
- const create2 = !getCustomWorkerURL2(worker, options) && isBrowser2 ? worker.loadWorker : void 0;
21645
+ const create2 = !getCustomWorkerURL2(worker, options) && isBrowser3 ? worker.loadWorker : void 0;
20877
21646
  const url = getWorkerURL2(worker, options);
20878
21647
  return {
20879
21648
  id: `${worker.module}:${worker.id}`,
@@ -20904,7 +21673,7 @@ return true;`);
20904
21673
  if (!state) {
20905
21674
  state = {
20906
21675
  runner: new TaskRunner({
20907
- maxConcurrency: isMobile ? options.maxMobileConcurrency ?? 1 : options.maxConcurrency ?? 3
21676
+ maxConcurrency: isMobile2 ? options.maxMobileConcurrency ?? 1 : options.maxConcurrency ?? 3
20908
21677
  }),
20909
21678
  requests: 0
20910
21679
  };
@@ -21036,7 +21805,7 @@ return true;`);
21036
21805
  init_get_worker_url2();
21037
21806
  init_task_runtime2();
21038
21807
  init_get_transfer_list2();
21039
- init_globals2();
21808
+ init_globals3();
21040
21809
  runners = /* @__PURE__ */ new WeakMap();
21041
21810
  activeRunners = /* @__PURE__ */ new Set();
21042
21811
  moduleWorkerUrls = /* @__PURE__ */ new Map();
@@ -21095,15 +21864,15 @@ return true;`);
21095
21864
  if (!options.useLocalLibraries && library.startsWith("http")) {
21096
21865
  return library;
21097
21866
  }
21098
- if (!isBrowser2) {
21867
+ if (!isBrowser3) {
21099
21868
  return `modules/${moduleName}/dist/libs/${libraryName}`;
21100
21869
  }
21101
21870
  if (options.CDN) {
21102
21871
  if (typeof options.CDN !== "string") {
21103
21872
  throw new Error("loadLibrary: options.CDN must be a string or null");
21104
21873
  }
21105
- assert2(options.CDN.startsWith("http"));
21106
- return `${options.CDN}/${moduleName}@${VERSION2}/dist/libs/${libraryName}`;
21874
+ assert4(options.CDN.startsWith("http"));
21875
+ return `${options.CDN}/${moduleName}@${VERSION4}/dist/libs/${libraryName}`;
21107
21876
  }
21108
21877
  if (isWorker) {
21109
21878
  return libraryName.endsWith(".mjs") ? `./libs/${libraryName}` : `../src/libs/${libraryName}`;
@@ -21114,7 +21883,7 @@ return true;`);
21114
21883
  if (libraryUrl.endsWith("wasm")) {
21115
21884
  return await loadAsArrayBuffer(libraryUrl);
21116
21885
  }
21117
- if (!isBrowser2) {
21886
+ if (!isBrowser3) {
21118
21887
  const { requireFromFile } = globalThis.loaders || {};
21119
21888
  try {
21120
21889
  const result = await requireFromFile?.(libraryUrl);
@@ -21129,7 +21898,7 @@ return true;`);
21129
21898
  } catch {
21130
21899
  }
21131
21900
  }
21132
- console.error(error);
21901
+ log2.error(String(error))();
21133
21902
  return null;
21134
21903
  }
21135
21904
  }
@@ -21166,7 +21935,7 @@ return true;`);
21166
21935
  }
21167
21936
  async function loadAsArrayBuffer(url) {
21168
21937
  const { readFileAsArrayBuffer } = globalThis.loaders || {};
21169
- if (isBrowser2 || !readFileAsArrayBuffer || url.startsWith("http")) {
21938
+ if (isBrowser3 || !readFileAsArrayBuffer || url.startsWith("http")) {
21170
21939
  const response = await fetch(url);
21171
21940
  return await response.arrayBuffer();
21172
21941
  }
@@ -21181,7 +21950,7 @@ return true;`);
21181
21950
  }
21182
21951
  async function loadAsText(url) {
21183
21952
  const { readFileAsText } = globalThis.loaders || {};
21184
- if (isBrowser2 || !readFileAsText || url.startsWith("http")) {
21953
+ if (isBrowser3 || !readFileAsText || url.startsWith("http")) {
21185
21954
  const response = await fetch(url);
21186
21955
  return await response.text();
21187
21956
  }
@@ -21198,8 +21967,9 @@ return true;`);
21198
21967
  var init_library_utils = __esm({
21199
21968
  "../core/src/worker-utils/lib/library-utils/library-utils.ts"() {
21200
21969
  "use strict";
21201
- init_globals2();
21202
- init_assert2();
21970
+ init_log2();
21971
+ init_globals3();
21972
+ init_assert4();
21203
21973
  init_version();
21204
21974
  loadLibraryPromises = {};
21205
21975
  }
@@ -21209,7 +21979,7 @@ return true;`);
21209
21979
  var init_worker_utils2 = __esm({
21210
21980
  "../core/src/worker-utils/index.ts"() {
21211
21981
  "use strict";
21212
- init_globals2();
21982
+ init_globals3();
21213
21983
  init_process_on_worker2();
21214
21984
  init_library_utils();
21215
21985
  }
@@ -21826,12 +22596,12 @@ return true;`);
21826
22596
  });
21827
22597
 
21828
22598
  // ../../node_modules/@math.gl/core/dist/lib/assert.js
21829
- function assert4(condition, message) {
22599
+ function assert6(condition, message) {
21830
22600
  if (!condition) {
21831
22601
  throw new Error(`math.gl assertion ${message}`);
21832
22602
  }
21833
22603
  }
21834
- var init_assert4 = __esm({
22604
+ var init_assert6 = __esm({
21835
22605
  "../../node_modules/@math.gl/core/dist/lib/assert.js"() {
21836
22606
  }
21837
22607
  });
@@ -21842,7 +22612,7 @@ return true;`);
21842
22612
  "../../node_modules/@math.gl/core/dist/classes/base/vector.js"() {
21843
22613
  init_math_array();
21844
22614
  init_validators2();
21845
- init_assert4();
22615
+ init_assert6();
21846
22616
  Vector2 = class extends MathArray {
21847
22617
  // ACCESSORS
21848
22618
  get x() {
@@ -21943,11 +22713,11 @@ return true;`);
21943
22713
  return this.distanceSquared(vector);
21944
22714
  }
21945
22715
  getComponent(i) {
21946
- assert4(i >= 0 && i < this.ELEMENTS, "index is out of range");
22716
+ assert6(i >= 0 && i < this.ELEMENTS, "index is out of range");
21947
22717
  return checkNumber(this[i]);
21948
22718
  }
21949
22719
  setComponent(i, value) {
21950
- assert4(i >= 0 && i < this.ELEMENTS, "index is out of range");
22720
+ assert6(i >= 0 && i < this.ELEMENTS, "index is out of range");
21951
22721
  this[i] = value;
21952
22722
  return this.check();
21953
22723
  }
@@ -24547,6 +25317,7 @@ return true;`);
24547
25317
  init_loader_types();
24548
25318
  init_assert();
24549
25319
  init_globals();
25320
+ init_log2();
24550
25321
  init_initialize_wasm_module();
24551
25322
  init_js_module_utils();
24552
25323
  init_js_module_utils();
@@ -26296,18 +27067,18 @@ return true;`);
26296
27067
  function testOBJFile(text) {
26297
27068
  return text[0] === "v";
26298
27069
  }
26299
- var VERSION4, OBJLoader, OBJWorkerLoader;
27070
+ var VERSION6, OBJLoader, OBJWorkerLoader;
26300
27071
  var init_obj_loader_types = __esm({
26301
27072
  "src/obj/obj-loader-types.ts"() {
26302
27073
  "use strict";
26303
27074
  init_obj_format();
26304
27075
  init_arrow_worker_transport();
26305
- VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
27076
+ VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
26306
27077
  OBJLoader = {
26307
27078
  ...OBJFormat,
26308
27079
  dataType: null,
26309
27080
  batchType: null,
26310
- version: VERSION4,
27081
+ version: VERSION6,
26311
27082
  worker: true,
26312
27083
  /** Enables the stateful input/output batch protocol on the built-in worker. */
26313
27084
  workerInBatches: true,
@@ -26454,17 +27225,17 @@ return true;`);
26454
27225
  const { MTLLoaderWithParser: MTLLoaderWithParser2 } = await Promise.resolve().then(() => (init_mtl_loader2(), mtl_loader_exports));
26455
27226
  return MTLLoaderWithParser2;
26456
27227
  }
26457
- var VERSION5, MTLLoader, MTLWorkerLoader;
27228
+ var VERSION7, MTLLoader, MTLWorkerLoader;
26458
27229
  var init_mtl_loader_types = __esm({
26459
27230
  "src/obj/mtl-loader-types.ts"() {
26460
27231
  "use strict";
26461
27232
  init_mtl_format();
26462
- VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
27233
+ VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
26463
27234
  MTLLoader = {
26464
27235
  ...MTLFormat,
26465
27236
  dataType: null,
26466
27237
  batchType: null,
26467
- version: VERSION5,
27238
+ version: VERSION7,
26468
27239
  worker: true,
26469
27240
  text: true,
26470
27241
  testText: (text) => text.includes("newmtl"),
@@ -26478,11 +27249,11 @@ return true;`);
26478
27249
  });
26479
27250
 
26480
27251
  // src/gltf/lib/utils/version.ts
26481
- var VERSION7;
27252
+ var VERSION9;
26482
27253
  var init_version3 = __esm({
26483
27254
  "src/gltf/lib/utils/version.ts"() {
26484
27255
  "use strict";
26485
- VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
27256
+ VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
26486
27257
  }
26487
27258
  });
26488
27259
 
@@ -26721,11 +27492,11 @@ return true;`);
26721
27492
  });
26722
27493
 
26723
27494
  // ../images/src/lib/utils/version.ts
26724
- var VERSION8;
27495
+ var VERSION10;
26725
27496
  var init_version4 = __esm({
26726
27497
  "../images/src/lib/utils/version.ts"() {
26727
27498
  "use strict";
26728
- VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
27499
+ VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
26729
27500
  }
26730
27501
  });
26731
27502
 
@@ -26819,13 +27590,13 @@ return true;`);
26819
27590
  imageBitmapSource = getBlob(arrayBuffer, url);
26820
27591
  }
26821
27592
  const imageBitmapOptions = options && options.imagebitmap;
26822
- return await safeCreateImageBitmap(imageBitmapSource, imageBitmapOptions);
27593
+ return await safeCreateImageBitmap(imageBitmapSource, imageBitmapOptions, getLoaderLog(options));
26823
27594
  }
26824
27595
  async function parseBlobToImageBitmap(blob, options) {
26825
27596
  const imageBitmapOptions = options && options.imagebitmap;
26826
- return await safeCreateImageBitmap(blob, imageBitmapOptions);
27597
+ return await safeCreateImageBitmap(blob, imageBitmapOptions, getLoaderLog(options));
26827
27598
  }
26828
- async function safeCreateImageBitmap(imageBitmapSource, imageBitmapOptions = null) {
27599
+ async function safeCreateImageBitmap(imageBitmapSource, imageBitmapOptions = null, loaderLog = getLoaderLog()) {
26829
27600
  if (isEmptyObject(imageBitmapOptions) || !imagebitmapOptionsSupported) {
26830
27601
  imageBitmapOptions = null;
26831
27602
  }
@@ -26833,7 +27604,7 @@ return true;`);
26833
27604
  try {
26834
27605
  return await createImageBitmap(imageBitmapSource, imageBitmapOptions);
26835
27606
  } catch (error) {
26836
- console.warn(error);
27607
+ loaderLog.warn(String(error))();
26837
27608
  imagebitmapOptionsSupported = false;
26838
27609
  }
26839
27610
  }
@@ -26854,6 +27625,7 @@ return true;`);
26854
27625
  var init_parse_to_image_bitmap = __esm({
26855
27626
  "../images/src/lib/parsers/parse-to-image-bitmap.ts"() {
26856
27627
  "use strict";
27628
+ init_loader_utils();
26857
27629
  init_svg_utils();
26858
27630
  init_parse_to_image();
26859
27631
  imagebitmapOptionsSupported = true;
@@ -26963,7 +27735,7 @@ return true;`);
26963
27735
  dataType: null,
26964
27736
  batchType: null,
26965
27737
  ...ImageBitmapFormat,
26966
- version: VERSION8,
27738
+ version: VERSION10,
26967
27739
  options: DEFAULT_IMAGE_BITMAP_LOADER_OPTIONS,
26968
27740
  preload: preload4
26969
27741
  };
@@ -28045,7 +28817,7 @@ return true;`);
28045
28817
  name: "Basis",
28046
28818
  id: "basis",
28047
28819
  module: "images",
28048
- version: VERSION8,
28820
+ version: VERSION10,
28049
28821
  worker: true,
28050
28822
  /** Published CommonJS bundle for Node.js workers. */
28051
28823
  workerNode: "basis-worker-node.cjs",
@@ -28078,12 +28850,12 @@ return true;`);
28078
28850
  });
28079
28851
 
28080
28852
  // src/gltf/lib/utils/assert.ts
28081
- function assert5(condition, message) {
28853
+ function assert7(condition, message) {
28082
28854
  if (!condition) {
28083
28855
  throw new Error(message || "assert failed: gltf");
28084
28856
  }
28085
28857
  }
28086
- var init_assert5 = __esm({
28858
+ var init_assert7 = __esm({
28087
28859
  "src/gltf/lib/utils/assert.ts"() {
28088
28860
  "use strict";
28089
28861
  }
@@ -28102,8 +28874,8 @@ return true;`);
28102
28874
  function parseGLBSync(glb, arrayBuffer, byteOffset = 0, options = {}) {
28103
28875
  const dataView = new DataView(arrayBuffer);
28104
28876
  const type = getMagicString2(dataView, byteOffset + 0);
28105
- const version = dataView.getUint32(byteOffset + 4, LITTLE_ENDIAN2);
28106
- const byteLength = version === 3 ? getSafeUint64(dataView, byteOffset + 8, "GLB byte length") : dataView.getUint32(byteOffset + 8, LITTLE_ENDIAN2);
28877
+ const version2 = dataView.getUint32(byteOffset + 4, LITTLE_ENDIAN2);
28878
+ const byteLength = version2 === 3 ? getSafeUint64(dataView, byteOffset + 8, "GLB byte length") : dataView.getUint32(byteOffset + 8, LITTLE_ENDIAN2);
28107
28879
  Object.assign(glb, {
28108
28880
  // Put less important stuff in a header, to avoid clutter
28109
28881
  header: {
@@ -28113,7 +28885,7 @@ return true;`);
28113
28885
  hasBinChunk: false
28114
28886
  },
28115
28887
  type,
28116
- version,
28888
+ version: version2,
28117
28889
  json: {},
28118
28890
  jsonChunkIndex: -1,
28119
28891
  binChunks: []
@@ -28345,7 +29117,7 @@ return true;`);
28345
29117
  const bytesPerComponent = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE[accessor.componentType];
28346
29118
  const length4 = accessor.count * components;
28347
29119
  const byteLength = accessor.count * components * bytesPerComponent;
28348
- assert5(byteLength >= 0 && byteLength <= bufferView.byteLength);
29120
+ assert7(byteLength >= 0 && byteLength <= bufferView.byteLength);
28349
29121
  const componentByteSize = BYTES[accessor.componentType];
28350
29122
  const numberOfComponentsInElement = COMPONENTS[accessor.type];
28351
29123
  return { ArrayType, length: length4, byteLength, componentByteSize, numberOfComponentsInElement };
@@ -28354,7 +29126,7 @@ return true;`);
28354
29126
  var init_gltf_utils = __esm({
28355
29127
  "src/gltf/lib/gltf-utils/gltf-utils.ts"() {
28356
29128
  "use strict";
28357
- init_assert5();
29129
+ init_assert7();
28358
29130
  init_gltf_constants();
28359
29131
  TYPES = ["SCALAR", "VEC2", "VEC3", "VEC4"];
28360
29132
  ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT = [
@@ -28415,13 +29187,13 @@ return true;`);
28415
29187
  // src/gltf/lib/gltf-utils/get-typed-array.ts
28416
29188
  function getTypedArrayForBufferView(json, buffers, bufferViewIndex) {
28417
29189
  const bufferView = typeof bufferViewIndex === "number" ? json.bufferViews[bufferViewIndex] : bufferViewIndex;
28418
- assert5(bufferView);
29190
+ assert7(bufferView);
28419
29191
  const bufferIndex = bufferView.buffer;
28420
29192
  const binChunk = buffers[bufferIndex];
28421
- assert5(binChunk);
28422
- assert5((bufferView.byteOffset || 0) >= 0 && bufferView.byteLength >= 0);
28423
- assert5((bufferView.byteOffset || 0) + bufferView.byteLength <= binChunk.byteLength);
28424
- assert5(
29193
+ assert7(binChunk);
29194
+ assert7((bufferView.byteOffset || 0) >= 0 && bufferView.byteLength >= 0);
29195
+ assert7((bufferView.byteOffset || 0) + bufferView.byteLength <= binChunk.byteLength);
29196
+ assert7(
28425
29197
  binChunk.byteOffset >= 0 && binChunk.byteOffset + binChunk.byteLength <= binChunk.arrayBuffer.byteLength
28426
29198
  );
28427
29199
  const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
@@ -28436,7 +29208,7 @@ return true;`);
28436
29208
  if (!gltfAccessor) {
28437
29209
  throw new Error(`No gltf accessor ${JSON.stringify(accessor)}`);
28438
29210
  }
28439
- assert5(Number.isSafeInteger(gltfAccessor.count) && gltfAccessor.count >= 0);
29211
+ assert7(Number.isSafeInteger(gltfAccessor.count) && gltfAccessor.count >= 0);
28440
29212
  const { ArrayType, length: length4, numberOfComponentsInElement } = getAccessorArrayTypeAndLength(
28441
29213
  gltfAccessor,
28442
29214
  { byteLength: Infinity }
@@ -28444,7 +29216,7 @@ return true;`);
28444
29216
  const decodedValue = gltfAccessor.value;
28445
29217
  let result;
28446
29218
  if (ArrayBuffer.isView(decodedValue)) {
28447
- assert5(decodedValue.length === length4);
29219
+ assert7(decodedValue.length === length4);
28448
29220
  result = decodedValue;
28449
29221
  } else if (gltfAccessor.bufferView === void 0) {
28450
29222
  result = new ArrayType(length4);
@@ -28457,8 +29229,8 @@ return true;`);
28457
29229
  new Uint8Array(copiedValue.buffer).set(
28458
29230
  new Uint8Array(result.buffer, result.byteOffset, result.byteLength)
28459
29231
  );
28460
- assert5(sparse.count >= 0 && sparse.count <= gltfAccessor.count);
28461
- assert5([5121, 5123, 5125].includes(sparse.indices.componentType));
29232
+ assert7(sparse.count >= 0 && sparse.count <= gltfAccessor.count);
29233
+ assert7([5121, 5123, 5125].includes(sparse.indices.componentType));
28462
29234
  const indices = readAccessorValues(json, buffers, {
28463
29235
  bufferView: sparse.indices.bufferView,
28464
29236
  byteOffset: sparse.indices.byteOffset,
@@ -28479,7 +29251,7 @@ return true;`);
28479
29251
  const valueBytes = new Uint8Array(values.buffer, values.byteOffset, values.byteLength);
28480
29252
  for (let sparseIndex = 0; sparseIndex < sparse.count; sparseIndex++) {
28481
29253
  const index = Number(indices[sparseIndex]);
28482
- assert5(index > previousIndex && index < gltfAccessor.count);
29254
+ assert7(index > previousIndex && index < gltfAccessor.count);
28483
29255
  copiedBytes.set(
28484
29256
  valueBytes.subarray(sparseIndex * elementByteLength, (sparseIndex + 1) * elementByteLength),
28485
29257
  index * elementByteLength
@@ -28494,14 +29266,14 @@ return true;`);
28494
29266
  throw new Error(`No gltf buffer view for accessor ${bufferView}`);
28495
29267
  }
28496
29268
  const externalBuffer = buffers[bufferView.buffer];
28497
- assert5(externalBuffer);
29269
+ assert7(externalBuffer);
28498
29270
  const { arrayBuffer, byteOffset: bufferByteOffset } = externalBuffer;
28499
- assert5((bufferView.byteOffset || 0) >= 0 && bufferView.byteLength >= 0);
28500
- assert5((bufferView.byteOffset || 0) + bufferView.byteLength <= externalBuffer.byteLength);
28501
- assert5(
29271
+ assert7((bufferView.byteOffset || 0) >= 0 && bufferView.byteLength >= 0);
29272
+ assert7((bufferView.byteOffset || 0) + bufferView.byteLength <= externalBuffer.byteLength);
29273
+ assert7(
28502
29274
  bufferByteOffset >= 0 && bufferByteOffset + externalBuffer.byteLength <= arrayBuffer.byteLength
28503
29275
  );
28504
- assert5((gltfAccessor.byteOffset || 0) >= 0);
29276
+ assert7((gltfAccessor.byteOffset || 0) >= 0);
28505
29277
  const byteOffset = (bufferByteOffset || 0) + (gltfAccessor.byteOffset || 0) + (bufferView.byteOffset || 0);
28506
29278
  const { ArrayType, length: length4, componentByteSize, numberOfComponentsInElement } = getAccessorArrayTypeAndLength(gltfAccessor, bufferView);
28507
29279
  const elementByteSize = componentByteSize * numberOfComponentsInElement;
@@ -28510,15 +29282,15 @@ return true;`);
28510
29282
  const packedElementByteSize = matrixColumns > 1 ? matrixColumns * matrixColumnByteSize : elementByteSize;
28511
29283
  const elementStride = bufferView.byteStride ?? packedElementByteSize;
28512
29284
  const lastElementByteSize = matrixColumns > 1 ? (matrixColumns - 1) * matrixColumnByteSize + matrixColumns * componentByteSize : elementByteSize;
28513
- assert5(elementStride >= packedElementByteSize);
28514
- assert5(
29285
+ assert7(elementStride >= packedElementByteSize);
29286
+ assert7(
28515
29287
  (gltfAccessor.byteOffset || 0) + (gltfAccessor.count === 0 ? 0 : (gltfAccessor.count - 1) * elementStride + lastElementByteSize) <= bufferView.byteLength
28516
29288
  );
28517
29289
  if (gltfAccessor.count === 0) return new ArrayType(0);
28518
29290
  if (matrixColumns > 1 && matrixColumnByteSize !== matrixColumns * componentByteSize) {
28519
29291
  const elementStride2 = bufferView.byteStride ?? matrixColumns * matrixColumnByteSize;
28520
29292
  const lastElementSize = (matrixColumns - 1) * matrixColumnByteSize + matrixColumns * componentByteSize;
28521
- assert5(
29293
+ assert7(
28522
29294
  (gltfAccessor.byteOffset || 0) + (gltfAccessor.count - 1) * elementStride2 + lastElementSize <= bufferView.byteLength
28523
29295
  );
28524
29296
  const result2 = new ArrayType(length4);
@@ -28568,7 +29340,7 @@ return true;`);
28568
29340
  var init_get_typed_array = __esm({
28569
29341
  "src/gltf/lib/gltf-utils/get-typed-array.ts"() {
28570
29342
  "use strict";
28571
- init_assert5();
29343
+ init_assert7();
28572
29344
  init_loader_utils();
28573
29345
  init_gltf_utils();
28574
29346
  }
@@ -28584,23 +29356,23 @@ return true;`);
28584
29356
  matches4.push(fileIndex);
28585
29357
  }
28586
29358
  }
28587
- assert5(matches4.length <= 1, `glTF package file reference ${reference} is ambiguous.`);
29359
+ assert7(matches4.length <= 1, `glTF package file reference ${reference} is ambiguous.`);
28588
29360
  return matches4[0] ?? -1;
28589
29361
  }
28590
29362
  async function resolveGLTFFile(gltf, fileReference, options, context) {
28591
29363
  const files = gltf.json.files || [];
28592
29364
  const fileIndex = typeof fileReference === "number" ? fileReference : findGLTFFileIndex(gltf, fileReference);
28593
- assert5(Number.isInteger(fileIndex) && fileIndex >= 0 && fileIndex < files.length);
29365
+ assert7(Number.isInteger(fileIndex) && fileIndex >= 0 && fileIndex < files.length);
28594
29366
  gltf.files = gltf.files || new Array(files.length).fill(null);
28595
29367
  const loadedFile = gltf.files[fileIndex];
28596
29368
  if (loadedFile) {
28597
29369
  return loadedFile;
28598
29370
  }
28599
29371
  const file = files[fileIndex];
28600
- assert5(file.mimeType, `glTF file ${fileIndex} must define mimeType.`);
29372
+ assert7(file.mimeType, `glTF file ${fileIndex} must define mimeType.`);
28601
29373
  const hasUri = file.uri !== void 0;
28602
29374
  const hasBufferView = file.bufferView !== void 0;
28603
- assert5(
29375
+ assert7(
28604
29376
  hasUri !== hasBufferView,
28605
29377
  `glTF file ${fileIndex} must define exactly one of uri or bufferView.`
28606
29378
  );
@@ -28608,7 +29380,7 @@ return true;`);
28608
29380
  if (file.uri !== void 0) {
28609
29381
  const url = resolveUrl(file.uri, options, context);
28610
29382
  const response = await context.fetch(url);
28611
- assert5(response?.ok, `Failed to fetch glTF file ${file.uri}: HTTP ${response?.status}.`);
29383
+ assert7(response?.ok, `Failed to fetch glTF file ${file.uri}: HTTP ${response?.status}.`);
28612
29384
  const arrayBuffer = await response.arrayBuffer();
28613
29385
  resolvedFile = {
28614
29386
  arrayBuffer,
@@ -28636,7 +29408,7 @@ return true;`);
28636
29408
  "use strict";
28637
29409
  init_get_typed_array();
28638
29410
  init_resolve_url();
28639
- init_assert5();
29411
+ init_assert7();
28640
29412
  }
28641
29413
  });
28642
29414
 
@@ -28685,7 +29457,7 @@ return true;`);
28685
29457
  "use strict";
28686
29458
  init_src();
28687
29459
  init_loader_utils();
28688
- init_assert5();
29460
+ init_assert7();
28689
29461
  init_gltf_utils();
28690
29462
  init_get_typed_array();
28691
29463
  GLTFScenegraph = class {
@@ -28857,7 +29629,7 @@ return true;`);
28857
29629
  * Add to standard GLTF top level extension object, mark as used
28858
29630
  */
28859
29631
  addExtension(extensionName, extensionData = {}) {
28860
- assert5(extensionData);
29632
+ assert7(extensionData);
28861
29633
  this.json.extensions = this.json.extensions || {};
28862
29634
  this.json.extensions[extensionName] = extensionData;
28863
29635
  this.registerUsedExtension(extensionName);
@@ -28867,7 +29639,7 @@ return true;`);
28867
29639
  * Standard GLTF top level extension object, mark as used and required
28868
29640
  */
28869
29641
  addRequiredExtension(extensionName, extensionData = {}) {
28870
- assert5(extensionData);
29642
+ assert7(extensionData);
28871
29643
  this.addExtension(extensionName, extensionData);
28872
29644
  this.registerRequiredExtension(extensionName);
28873
29645
  return extensionData;
@@ -29007,7 +29779,7 @@ return true;`);
29007
29779
  */
29008
29780
  addBufferView(buffer, bufferIndex = 0, byteOffset = this.byteLength) {
29009
29781
  const byteLength = buffer.byteLength;
29010
- assert5(Number.isFinite(byteLength));
29782
+ assert7(Number.isFinite(byteLength));
29011
29783
  this.sourceBuffers = this.sourceBuffers || [];
29012
29784
  this.sourceBuffers.push(buffer);
29013
29785
  const glTFBufferView = {
@@ -29127,14 +29899,14 @@ return true;`);
29127
29899
  }
29128
29900
  for (const bufferView of this.json.bufferViews || []) {
29129
29901
  const bufferOffset = bufferOffsets[bufferView.buffer];
29130
- assert5(bufferOffset !== void 0);
29902
+ assert7(bufferOffset !== void 0);
29131
29903
  bufferView.byteOffset = bufferOffset + (bufferView.byteOffset || 0);
29132
29904
  bufferView.buffer = 0;
29133
29905
  for (const name22 of ["EXT_meshopt_compression", "KHR_meshopt_compression"]) {
29134
29906
  const extension = bufferView.extensions?.[name22];
29135
29907
  if (extension) {
29136
29908
  const extensionOffset = bufferOffsets[extension.buffer];
29137
- assert5(extensionOffset !== void 0);
29909
+ assert7(extensionOffset !== void 0);
29138
29910
  extension.byteOffset = extensionOffset + (extension.byteOffset || 0);
29139
29911
  extension.buffer = 0;
29140
29912
  }
@@ -32540,11 +33312,11 @@ return true;`);
32540
33312
  });
32541
33313
 
32542
33314
  // src/draco/lib/utils/version.ts
32543
- var VERSION9;
33315
+ var VERSION11;
32544
33316
  var init_version5 = __esm({
32545
33317
  "src/draco/lib/utils/version.ts"() {
32546
33318
  "use strict";
32547
- VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
33319
+ VERSION11 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
32548
33320
  }
32549
33321
  });
32550
33322
 
@@ -32584,7 +33356,7 @@ return true;`);
32584
33356
 
32585
33357
  // src/draco/lib/draco-library-loader.ts
32586
33358
  async function loadLibrary2(libraryUrl, moduleName = null, options = {}, libraryName = null, moduleLibraryName = null) {
32587
- if (isBrowser2 && options.useLocalLibraries && !options.CDN && libraryName && options.modules?.[libraryName] === void 0) {
33359
+ if (isBrowser3 && options.useLocalLibraries && !options.CDN && libraryName && options.modules?.[libraryName] === void 0) {
32588
33360
  const directory = isWorker ? "./libs" : `modules/${moduleName}/dist/libs`;
32589
33361
  options = {
32590
33362
  ...options,
@@ -32735,7 +33507,7 @@ return true;`);
32735
33507
  "draco_decoder.mjs"
32736
33508
  );
32737
33509
  } catch (error) {
32738
- if (isBrowser2 || options.useLocalLibraries) {
33510
+ if (isBrowser3 || options.useLocalLibraries) {
32739
33511
  throw error;
32740
33512
  }
32741
33513
  decoderLibrary2 = await loadLibrary2(
@@ -32754,7 +33526,7 @@ return true;`);
32754
33526
  try {
32755
33527
  [decoderLibrary, wasmBinary] = await loadDecoderWasmAssets(options, profile);
32756
33528
  } catch (error) {
32757
- if (isBrowser2 || options.useLocalLibraries) {
33529
+ if (isBrowser3 || options.useLocalLibraries) {
32758
33530
  throw error;
32759
33531
  }
32760
33532
  [decoderLibrary, wasmBinary] = await loadDecoderWasmAssets(
@@ -32790,7 +33562,7 @@ return true;`);
32790
33562
  try {
32791
33563
  [encoderLibrary, wasmBinary] = await loadEncoderWasmAssets(options);
32792
33564
  } catch (error) {
32793
- if (isBrowser2 || options.useLocalLibraries) {
33565
+ if (isBrowser3 || options.useLocalLibraries) {
32794
33566
  throw error;
32795
33567
  }
32796
33568
  [encoderLibrary, wasmBinary] = await loadEncoderWasmAssets({
@@ -33038,6 +33810,7 @@ return true;`);
33038
33810
  var init_draco_parser = __esm({
33039
33811
  "src/draco/lib/draco-parser.ts"() {
33040
33812
  "use strict";
33813
+ init_loader_utils();
33041
33814
  init_schema_utils();
33042
33815
  init_get_draco_schema();
33043
33816
  DRACO_TO_GLTF_ATTRIBUTE_NAME_MAP = {
@@ -33062,15 +33835,17 @@ return true;`);
33062
33835
  UINT16_INDEX_ITEM_SIZE = 2;
33063
33836
  UINT32_INDEX_ITEM_SIZE = 4;
33064
33837
  DracoParser = class {
33065
- draco;
33066
- decoder;
33067
- metadataQuerier;
33068
33838
  // draco - the draco decoder, either import `draco3d` or load dynamically
33069
- constructor(draco) {
33839
+ constructor(draco, logger = getLoaderLog()) {
33840
+ this.logger = logger;
33070
33841
  this.draco = draco;
33071
33842
  this.decoder = new this.draco.Decoder();
33072
33843
  this.metadataQuerier = new this.draco.MetadataQuerier();
33073
33844
  }
33845
+ logger;
33846
+ draco;
33847
+ decoder;
33848
+ metadataQuerier;
33074
33849
  /**
33075
33850
  * Destroy draco resources
33076
33851
  */
@@ -33332,7 +34107,7 @@ return true;`);
33332
34107
  _getAttributeValues(dracoGeometry, attribute) {
33333
34108
  const TypedArrayCtor = DRACO_DATA_TYPE_TO_TYPED_ARRAY_MAP[attribute.data_type];
33334
34109
  if (!TypedArrayCtor) {
33335
- console.warn(`DRACO: Unsupported attribute type ${attribute.data_type}`);
34110
+ this.logger.warn(`DRACO: Unsupported attribute type ${attribute.data_type}`)();
33336
34111
  return null;
33337
34112
  }
33338
34113
  const numComponents = attribute.num_components;
@@ -33526,7 +34301,7 @@ return true;`);
33526
34301
  reportProgress2?.({ phase: "decode", completed: 0, total: 1, unit: "tasks" });
33527
34302
  const { draco } = await loadDecoderModule();
33528
34303
  (options?.signal || context?.signal)?.throwIfAborted();
33529
- const dracoParser = new DracoParser(draco);
34304
+ const dracoParser = new DracoParser(draco, getLoaderLog(options));
33530
34305
  try {
33531
34306
  const mesh = dracoParser.parseSync(arrayBuffer, options?.draco);
33532
34307
  reportProgress2?.({ phase: "decode", completed: 1, total: 1, unit: "tasks" });
@@ -33541,6 +34316,7 @@ return true;`);
33541
34316
  var init_parse_draco = __esm({
33542
34317
  "src/draco/lib/parse-draco.ts"() {
33543
34318
  "use strict";
34319
+ init_loader_utils();
33544
34320
  init_schema_utils();
33545
34321
  init_draco_parser();
33546
34322
  }
@@ -33697,7 +34473,7 @@ return true;`);
33697
34473
  batchType: null,
33698
34474
  ...DracoFormat,
33699
34475
  // shapes: ['mesh'],
33700
- version: VERSION9,
34476
+ version: VERSION11,
33701
34477
  worker: true,
33702
34478
  /** Node test workers live with the Draco implementation. */
33703
34479
  workerSourceNode: "draco/workers/draco-worker-node.ts",
@@ -34162,7 +34938,7 @@ return true;`);
34162
34938
  const { json } = gltfScenegraph;
34163
34939
  if (json.lights) {
34164
34940
  const extension = gltfScenegraph.addExtension(KHR_LIGHTS_PUNCTUAL);
34165
- assert5(!extension.lights);
34941
+ assert7(!extension.lights);
34166
34942
  extension.lights = json.lights;
34167
34943
  delete json.lights;
34168
34944
  }
@@ -34178,7 +34954,7 @@ return true;`);
34178
34954
  var init_KHR_lights_punctual = __esm({
34179
34955
  "src/gltf/lib/extensions/deprecated/KHR_lights_punctual.ts"() {
34180
34956
  "use strict";
34181
- init_assert5();
34957
+ init_assert7();
34182
34958
  init_gltf_iterator();
34183
34959
  init_gltf_scenegraph();
34184
34960
  KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
@@ -36865,7 +37641,7 @@ return true;`);
36865
37641
  parseGLTFContainerSync(gltf, arrayBufferOrString, byteOffset, options);
36866
37642
  const finishNormalization = normalizeGLTFV1WithDeferredBuffers(gltf, {
36867
37643
  normalize: options?.gltf?.normalize,
36868
- log: options?.core?.log
37644
+ log: getLoaderLog(options)
36869
37645
  });
36870
37646
  await preprocessExtensions(gltf, options, context);
36871
37647
  if (options?.gltf?.loadBuffers && gltf.json.buffers) {
@@ -36897,13 +37673,13 @@ return true;`);
36897
37673
  } else if (data instanceof ArrayBuffer) {
36898
37674
  const glb = {};
36899
37675
  byteOffset = parseGLBSync(glb, data, byteOffset, options.glb);
36900
- assert5(glb.type === "glTF", `Invalid GLB magic string ${glb.type}`);
37676
+ assert7(glb.type === "glTF", `Invalid GLB magic string ${glb.type}`);
36901
37677
  gltf._glb = glb;
36902
37678
  gltf.json = glb.json;
36903
37679
  } else if (data && typeof data === "object") {
36904
37680
  gltf.json = data;
36905
37681
  } else {
36906
- assert5(false, "GLTF: must be ArrayBuffer, string, or parsed JSON object");
37682
+ assert7(false, "GLTF: must be ArrayBuffer, string, or parsed JSON object");
36907
37683
  }
36908
37684
  const buffers = gltf.json.buffers || [];
36909
37685
  const bufferDefinitions = Array.isArray(buffers) ? buffers : [];
@@ -36916,17 +37692,17 @@ return true;`);
36916
37692
  if (buffer.chunk === void 0) {
36917
37693
  continue;
36918
37694
  }
36919
- assert5(gltf._glb.version === 3, "glTF buffer.chunk requires a GLB v3 container.");
36920
- assert5(
37695
+ assert7(gltf._glb.version === 3, "glTF buffer.chunk requires a GLB v3 container.");
37696
+ assert7(
36921
37697
  buffer.uri === void 0,
36922
37698
  `glTF buffer ${bufferIndex} cannot define both uri and chunk.`
36923
37699
  );
36924
37700
  const binChunk = binChunks.find((chunk) => chunk.chunkIndex === buffer.chunk);
36925
- assert5(
37701
+ assert7(
36926
37702
  binChunk,
36927
37703
  `glTF buffer ${bufferIndex} references missing GLB BIN chunk ${buffer.chunk}.`
36928
37704
  );
36929
- assert5(
37705
+ assert7(
36930
37706
  buffer.byteLength <= binChunk.byteLength,
36931
37707
  `glTF buffer ${bufferIndex} is larger than GLB BIN chunk ${buffer.chunk}.`
36932
37708
  );
@@ -36950,7 +37726,7 @@ return true;`);
36950
37726
  }
36951
37727
  if (gltf._glb.version === 3) {
36952
37728
  for (const bufferIndex of uriLessBufferIndices) {
36953
- assert5(
37729
+ assert7(
36954
37730
  gltf.buffers[bufferIndex],
36955
37731
  `glTF buffer ${bufferIndex} without a uri must define a valid GLB v3 chunk.`
36956
37732
  );
@@ -36959,7 +37735,7 @@ return true;`);
36959
37735
  }
36960
37736
  if (!gltf._glb) {
36961
37737
  const chunkBufferIndex = bufferDefinitions.findIndex((buffer) => buffer.chunk !== void 0);
36962
- assert5(chunkBufferIndex === -1, `glTF buffer ${chunkBufferIndex} uses chunk outside a GLB.`);
37738
+ assert7(chunkBufferIndex === -1, `glTF buffer ${chunkBufferIndex} uses chunk outside a GLB.`);
36963
37739
  }
36964
37740
  const images = gltf.json.images || [];
36965
37741
  gltf.images = new Array(images.length).fill({});
@@ -36973,7 +37749,7 @@ return true;`);
36973
37749
  const referencedIndices = /* @__PURE__ */ new Set();
36974
37750
  for (const node of gltf.json.nodes || []) {
36975
37751
  if (node.externalAsset !== void 0) {
36976
- assert5(
37752
+ assert7(
36977
37753
  node.externalAsset >= 0 && node.externalAsset < externalAssets.length,
36978
37754
  `glTF node references missing external asset ${node.externalAsset}.`
36979
37755
  );
@@ -36990,13 +37766,13 @@ return true;`);
36990
37766
  if (!externalAsset) {
36991
37767
  throw new Error(`Missing glTF external asset ${externalAssetIndex}.`);
36992
37768
  }
36993
- assert5(
37769
+ assert7(
36994
37770
  Number.isInteger(externalAsset.file) && externalAsset.file >= 0 && externalAsset.file < (gltf.json.files?.length || 0),
36995
37771
  `glTF external asset ${externalAssetIndex} references missing file ${externalAsset.file}.`
36996
37772
  );
36997
37773
  const file = await resolveGLTFFile(gltf, externalAsset.file, options, context);
36998
37774
  const assetKey = file.url;
36999
- assert5(
37775
+ assert7(
37000
37776
  !assetKey || !state.ancestors.has(assetKey),
37001
37777
  `glTF external asset cycle detected at ${assetKey}.`
37002
37778
  );
@@ -37052,7 +37828,7 @@ return true;`);
37052
37828
  }
37053
37829
  const reference = url.startsWith(packageUrlPrefix) ? url.slice(packageUrlPrefix.length) : url;
37054
37830
  const fileIndex = findGLTFFileIndex(parent, reference);
37055
- assert5(fileIndex >= 0, `glTF package does not contain file ${reference}.`);
37831
+ assert7(fileIndex >= 0, `glTF package does not contain file ${reference}.`);
37056
37832
  const resolvedFile = await resolveGLTFFile(parent, fileIndex, options, context);
37057
37833
  const data = sliceArrayBuffer(
37058
37834
  resolvedFile.arrayBuffer,
@@ -37089,7 +37865,7 @@ return true;`);
37089
37865
  const buffer = buffers[i];
37090
37866
  if (buffer.uri) {
37091
37867
  const { fetch: fetch2 } = context;
37092
- assert5(fetch2);
37868
+ assert7(fetch2);
37093
37869
  const uri = resolveUrl(buffer.uri, options, context);
37094
37870
  const response = await context?.fetch?.(uri);
37095
37871
  const arrayBuffer = await response?.arrayBuffer?.();
@@ -37145,7 +37921,7 @@ return true;`);
37145
37921
  const array = getTypedArrayForBufferView(gltf.json, gltf.buffers, image.bufferView);
37146
37922
  arrayBuffer = sliceArrayBuffer(array.buffer, array.byteOffset, array.byteLength);
37147
37923
  }
37148
- assert5(arrayBuffer, "glTF image has no data");
37924
+ assert7(arrayBuffer, "glTF image has no data");
37149
37925
  const gltfOptions = getGLTFImageOptions(options, image.mimeType);
37150
37926
  const ddsLoader = getDDSLoader(context);
37151
37927
  const ddsSelected = Boolean(
@@ -37160,7 +37936,7 @@ return true;`);
37160
37936
  options,
37161
37937
  context
37162
37938
  );
37163
- assert5(levels.length > 0, "MSFT_texture_dds parser returned no texture levels");
37939
+ assert7(levels.length > 0, "MSFT_texture_dds parser returned no texture levels");
37164
37940
  gltf.images = gltf.images || [];
37165
37941
  gltf.images[index] = {
37166
37942
  compressed: true,
@@ -37195,9 +37971,10 @@ return true;`);
37195
37971
  "src/gltf/lib/parsers/parse-gltf.ts"() {
37196
37972
  "use strict";
37197
37973
  init_loader_utils();
37974
+ init_loader_utils();
37198
37975
  init_src();
37199
37976
  init_src();
37200
- init_assert5();
37977
+ init_assert7();
37201
37978
  init_parse_glb();
37202
37979
  init_resolve_url();
37203
37980
  init_resolve_gltf_file();
@@ -37259,7 +38036,7 @@ return true;`);
37259
38036
  dataType: null,
37260
38037
  batchType: null,
37261
38038
  ...GLTFFormat,
37262
- version: VERSION7,
38039
+ version: VERSION9,
37263
38040
  preload: preload7,
37264
38041
  options: {
37265
38042
  gltf: {
@@ -37381,7 +38158,7 @@ return true;`);
37381
38158
  quantization: { ...preset.quantization, ...options.quantization }
37382
38159
  };
37383
38160
  }
37384
- var GLTF_TO_DRACO_ATTRIBUTE_NAME_MAP, noop, DracoBuilder;
38161
+ var GLTF_TO_DRACO_ATTRIBUTE_NAME_MAP, noop2, DracoBuilder;
37385
38162
  var init_draco_builder = __esm({
37386
38163
  "src/draco/lib/draco-builder.ts"() {
37387
38164
  "use strict";
@@ -37391,14 +38168,14 @@ return true;`);
37391
38168
  COLOR_0: "COLOR",
37392
38169
  TEXCOORD_0: "TEX_COORD"
37393
38170
  };
37394
- noop = () => {
38171
+ noop2 = () => {
37395
38172
  };
37396
38173
  DracoBuilder = class {
37397
38174
  draco;
37398
38175
  dracoEncoder;
37399
38176
  dracoMeshBuilder;
37400
38177
  dracoMetadataBuilder;
37401
- log = noop;
38178
+ log = noop2;
37402
38179
  // draco - the draco decoder, either import `draco3d` or load dynamically
37403
38180
  constructor(draco) {
37404
38181
  this.draco = draco;
@@ -37432,7 +38209,7 @@ return true;`);
37432
38209
  /** Shared implementation for ordinary encoding and report-producing encoding. */
37433
38210
  _encodeSync(mesh, options, trackEncodedProperties) {
37434
38211
  options = applyDracoEncodingPreset(options);
37435
- this.log = options.log || noop;
38212
+ this.log = options.log || noop2;
37436
38213
  return options.pointcloud ? this._encodePointCloud(mesh, options, trackEncodedProperties) : this._encodeMesh(mesh, options, trackEncodedProperties);
37437
38214
  }
37438
38215
  // PRIVATE
@@ -38044,7 +38821,7 @@ return true;`);
38044
38821
  id: "draco-writer",
38045
38822
  name: "Draco compressed geometry writer",
38046
38823
  module: "scene",
38047
- version: VERSION9,
38824
+ version: VERSION11,
38048
38825
  worker: true,
38049
38826
  workerNode: "draco-writer-worker-node.cjs",
38050
38827
  /** Node test workers live with the Draco implementation. */
@@ -38056,7 +38833,7 @@ return true;`);
38056
38833
  DracoWriter = {
38057
38834
  ...DracoFormat,
38058
38835
  name: "DRACO",
38059
- version: VERSION9,
38836
+ version: VERSION11,
38060
38837
  options: {
38061
38838
  draco: DEFAULT_DRACO_WRITER_OPTIONS
38062
38839
  },
@@ -38134,7 +38911,7 @@ return true;`);
38134
38911
  dataType: null,
38135
38912
  batchType: null,
38136
38913
  ...GLBFormat,
38137
- version: VERSION7,
38914
+ version: VERSION9,
38138
38915
  preload: preload8,
38139
38916
  options: {
38140
38917
  glb: {
@@ -39795,11 +40572,11 @@ Actual: ${this.attribValue}`
39795
40572
  if (element.name !== "materialx") {
39796
40573
  throw new Error("MaterialX: expected a materialx root element.");
39797
40574
  }
39798
- const version = element.attributes.version;
39799
- if (!version || !/^1\.\d+$/.test(version)) {
40575
+ const version2 = element.attributes.version;
40576
+ if (!version2 || !/^1\.\d+$/.test(version2)) {
39800
40577
  throw new Error("MaterialX: expected a MaterialX 1.x version.");
39801
40578
  }
39802
- return { version, root: parseElement(element, 0) };
40579
+ return { version: version2, root: parseElement(element, 0) };
39803
40580
  }
39804
40581
  function parseElement(element, depth) {
39805
40582
  return {
@@ -39964,16 +40741,16 @@ Actual: ${this.attribValue}`
39964
40741
  const { STLLoaderWithParser: STLLoaderWithParser2 } = await Promise.resolve().then(() => (init_stl_loader(), stl_loader_exports));
39965
40742
  return STLLoaderWithParser2;
39966
40743
  }
39967
- var VERSION10, STLLoader;
40744
+ var VERSION12, STLLoader;
39968
40745
  var init_stl_loader_types = __esm({
39969
40746
  "src/stl-loader-types.ts"() {
39970
40747
  "use strict";
39971
- VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
40748
+ VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
39972
40749
  STLLoader = {
39973
40750
  name: "STL",
39974
40751
  id: "stl",
39975
40752
  module: "scene",
39976
- version: VERSION10,
40753
+ version: VERSION12,
39977
40754
  extensions: ["stl"],
39978
40755
  mimeTypes: ["model/stl"],
39979
40756
  binary: true,
@@ -40022,6 +40799,7 @@ Actual: ${this.attribValue}`
40022
40799
  concatenateArrayBuffersAsync: () => import_core4.concatenateArrayBuffersAsync,
40023
40800
  coreApi: () => import_core4.coreApi,
40024
40801
  createDataSource: () => import_core4.createDataSource,
40802
+ createDataSourceSync: () => import_core4.createDataSourceSync,
40025
40803
  document: () => import_core4.document,
40026
40804
  encode: () => import_core4.encode,
40027
40805
  encodeInBatches: () => import_core4.encodeInBatches,
@@ -40085,12 +40863,12 @@ Actual: ${this.attribValue}`
40085
40863
  // src/obj/obj-writer.ts
40086
40864
  init_schema_utils();
40087
40865
  init_obj_format();
40088
- var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
40866
+ var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
40089
40867
  var OBJWriter = {
40090
40868
  ...OBJFormat,
40091
40869
  dataType: null,
40092
40870
  batchType: null,
40093
- version: VERSION6,
40871
+ version: VERSION8,
40094
40872
  options: {
40095
40873
  obj: {}
40096
40874
  },
@@ -40233,15 +41011,15 @@ Actual: ${this.attribValue}`
40233
41011
  var LE = true;
40234
41012
  function encodeGLBSync(glb, dataView, byteOffset = 0, options = {}) {
40235
41013
  const magic = MAGIC_glTF2;
40236
- const version = options.version ?? ("version" in glb ? glb.version : 2);
41014
+ const version2 = options.version ?? ("version" in glb ? glb.version : 2);
40237
41015
  const json = glb.json ?? {};
40238
- if (version === 3) return encodeGLBV3(glb, dataView, byteOffset, magic, json);
40239
- if (version !== 2) throw new Error(`Unsupported GLB writer version ${version}.`);
41016
+ if (version2 === 3) return encodeGLBV3(glb, dataView, byteOffset, magic, json);
41017
+ if (version2 !== 2) throw new Error(`Unsupported GLB writer version ${version2}.`);
40240
41018
  const binary = "binChunks" in glb ? glb.binary ? new Uint8Array(glb.binary) : glb.binChunks?.[0] && getChunkBytes(glb.binChunks[0]) : glb.buffers?.[0] && getChunkBytes(glb.buffers[0]);
40241
41019
  const byteOffsetStart = byteOffset;
40242
41020
  if (dataView) {
40243
41021
  dataView.setUint32(byteOffset + 0, magic, LE);
40244
- dataView.setUint32(byteOffset + 4, version, LE);
41022
+ dataView.setUint32(byteOffset + 4, version2, LE);
40245
41023
  dataView.setUint32(byteOffset + 8, 0, LE);
40246
41024
  }
40247
41025
  const byteOffsetFileLength = byteOffset + 8;
@@ -40536,7 +41314,7 @@ Actual: ${this.attribValue}`
40536
41314
  dataType: null,
40537
41315
  batchType: null,
40538
41316
  ...GLTFFormat,
40539
- version: VERSION7,
41317
+ version: VERSION9,
40540
41318
  options: {
40541
41319
  gltf: {}
40542
41320
  },
@@ -40573,7 +41351,7 @@ Actual: ${this.attribValue}`
40573
41351
  init_gltf_format();
40574
41352
  var GLBWriter = {
40575
41353
  ...GLBFormat,
40576
- version: VERSION7,
41354
+ version: VERSION9,
40577
41355
  options: {
40578
41356
  glb: {}
40579
41357
  },