@loaders.gl/i3s 4.2.0-alpha.5 → 4.2.0-beta.1

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 (44) hide show
  1. package/dist/arcgis-webscene-loader.d.ts +19 -2
  2. package/dist/arcgis-webscene-loader.d.ts.map +1 -1
  3. package/dist/arcgis-webscene-loader.js +3 -1
  4. package/dist/dist.dev.js +192 -144
  5. package/dist/dist.min.js +1 -1
  6. package/dist/i3s-attribute-loader.d.ts +14 -3
  7. package/dist/i3s-attribute-loader.d.ts.map +1 -1
  8. package/dist/i3s-attribute-loader.js +3 -1
  9. package/dist/i3s-building-scene-layer-loader.d.ts +15 -3
  10. package/dist/i3s-building-scene-layer-loader.d.ts.map +1 -1
  11. package/dist/i3s-building-scene-layer-loader.js +3 -1
  12. package/dist/i3s-content-loader.d.ts +18 -2
  13. package/dist/i3s-content-loader.d.ts.map +1 -1
  14. package/dist/i3s-content-loader.js +6 -1
  15. package/dist/i3s-content-worker-node.js +51 -51
  16. package/dist/i3s-content-worker-node.js.map +4 -4
  17. package/dist/i3s-content-worker.js +1722 -1702
  18. package/dist/i3s-loader.d.ts +30 -2
  19. package/dist/i3s-loader.d.ts.map +1 -1
  20. package/dist/i3s-loader.js +8 -2
  21. package/dist/i3s-node-page-loader.d.ts +17 -3
  22. package/dist/i3s-node-page-loader.d.ts.map +1 -1
  23. package/dist/i3s-node-page-loader.js +6 -1
  24. package/dist/i3s-slpk-loader.d.ts +13 -2
  25. package/dist/i3s-slpk-loader.d.ts.map +1 -1
  26. package/dist/i3s-slpk-loader.js +6 -1
  27. package/dist/index.cjs +43 -35
  28. package/dist/index.cjs.map +2 -2
  29. package/dist/lib/helpers/i3s-nodepages-tiles.d.ts.map +1 -1
  30. package/dist/lib/helpers/i3s-nodepages-tiles.js +11 -7
  31. package/dist/lib/parsers/parse-arcgis-webscene.js +1 -0
  32. package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
  33. package/dist/lib/parsers/parse-i3s-tile-content.js +3 -25
  34. package/dist/lib/parsers/parse-slpk/slpk-archieve.js +5 -3
  35. package/package.json +12 -10
  36. package/src/arcgis-webscene-loader.ts +4 -6
  37. package/src/i3s-attribute-loader.ts +4 -2
  38. package/src/i3s-building-scene-layer-loader.ts +6 -6
  39. package/src/i3s-content-loader.ts +9 -2
  40. package/src/i3s-loader.ts +11 -3
  41. package/src/i3s-node-page-loader.ts +9 -2
  42. package/src/i3s-slpk-loader.ts +9 -2
  43. package/src/lib/helpers/i3s-nodepages-tiles.ts +1 -3
  44. package/src/lib/parsers/parse-i3s-tile-content.ts +7 -30
package/dist/dist.dev.js CHANGED
@@ -45,13 +45,6 @@ var __exports__ = (() => {
45
45
  }
46
46
  });
47
47
 
48
- // (disabled):../worker-utils/src/lib/node/require-utils.node
49
- var require_require_utils = __commonJS({
50
- "(disabled):../worker-utils/src/lib/node/require-utils.node"() {
51
- "use strict";
52
- }
53
- });
54
-
55
48
  // ../../node_modules/pako/lib/utils/common.js
56
49
  var require_common = __commonJS({
57
50
  "../../node_modules/pako/lib/utils/common.js"(exports) {
@@ -505,7 +498,7 @@ var __exports__ = (() => {
505
498
  var elems = desc.stat_desc.elems;
506
499
  var n2, m;
507
500
  var max_code = -1;
508
- var node2;
501
+ var node;
509
502
  s2.heap_len = 0;
510
503
  s2.heap_max = HEAP_SIZE;
511
504
  for (n2 = 0; n2 < elems; n2++) {
@@ -517,19 +510,19 @@ var __exports__ = (() => {
517
510
  }
518
511
  }
519
512
  while (s2.heap_len < 2) {
520
- node2 = s2.heap[++s2.heap_len] = max_code < 2 ? ++max_code : 0;
521
- tree[node2 * 2] = 1;
522
- s2.depth[node2] = 0;
513
+ node = s2.heap[++s2.heap_len] = max_code < 2 ? ++max_code : 0;
514
+ tree[node * 2] = 1;
515
+ s2.depth[node] = 0;
523
516
  s2.opt_len--;
524
517
  if (has_stree) {
525
- s2.static_len -= stree[node2 * 2 + 1];
518
+ s2.static_len -= stree[node * 2 + 1];
526
519
  }
527
520
  }
528
521
  desc.max_code = max_code;
529
522
  for (n2 = s2.heap_len >> 1; n2 >= 1; n2--) {
530
523
  pqdownheap(s2, tree, n2);
531
524
  }
532
- node2 = elems;
525
+ node = elems;
533
526
  do {
534
527
  n2 = s2.heap[
535
528
  1
@@ -551,13 +544,13 @@ var __exports__ = (() => {
551
544
  ];
552
545
  s2.heap[--s2.heap_max] = n2;
553
546
  s2.heap[--s2.heap_max] = m;
554
- tree[node2 * 2] = tree[n2 * 2] + tree[m * 2];
555
- s2.depth[node2] = (s2.depth[n2] >= s2.depth[m] ? s2.depth[n2] : s2.depth[m]) + 1;
556
- tree[n2 * 2 + 1] = tree[m * 2 + 1] = node2;
547
+ tree[node * 2] = tree[n2 * 2] + tree[m * 2];
548
+ s2.depth[node] = (s2.depth[n2] >= s2.depth[m] ? s2.depth[n2] : s2.depth[m]) + 1;
549
+ tree[n2 * 2 + 1] = tree[m * 2 + 1] = node;
557
550
  s2.heap[
558
551
  1
559
552
  /*SMALLEST*/
560
- ] = node2++;
553
+ ] = node++;
561
554
  pqdownheap(
562
555
  s2,
563
556
  tree,
@@ -4342,6 +4335,63 @@ var __exports__ = (() => {
4342
4335
  var matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
4343
4336
  var nodeVersion = matches && parseFloat(matches[1]) || 0;
4344
4337
 
4338
+ // ../../node_modules/@babel/runtime/helpers/esm/typeof.js
4339
+ function _typeof(obj) {
4340
+ "@babel/helpers - typeof";
4341
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
4342
+ return typeof obj2;
4343
+ } : function(obj2) {
4344
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
4345
+ }, _typeof(obj);
4346
+ }
4347
+
4348
+ // ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
4349
+ function _toPrimitive(input, hint) {
4350
+ if (_typeof(input) !== "object" || input === null)
4351
+ return input;
4352
+ var prim = input[Symbol.toPrimitive];
4353
+ if (prim !== void 0) {
4354
+ var res = prim.call(input, hint || "default");
4355
+ if (_typeof(res) !== "object")
4356
+ return res;
4357
+ throw new TypeError("@@toPrimitive must return a primitive value.");
4358
+ }
4359
+ return (hint === "string" ? String : Number)(input);
4360
+ }
4361
+
4362
+ // ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
4363
+ function _toPropertyKey(arg) {
4364
+ var key = _toPrimitive(arg, "string");
4365
+ return _typeof(key) === "symbol" ? key : String(key);
4366
+ }
4367
+
4368
+ // ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
4369
+ function _defineProperty(obj, key, value) {
4370
+ key = _toPropertyKey(key);
4371
+ if (key in obj) {
4372
+ Object.defineProperty(obj, key, {
4373
+ value,
4374
+ enumerable: true,
4375
+ configurable: true,
4376
+ writable: true
4377
+ });
4378
+ } else {
4379
+ obj[key] = value;
4380
+ }
4381
+ return obj;
4382
+ }
4383
+
4384
+ // ../loader-utils/src/lib/module-utils/js-module-utils.ts
4385
+ function registerJSModules(modules) {
4386
+ globalThis.loaders ||= {};
4387
+ globalThis.loaders.modules ||= {};
4388
+ Object.assign(globalThis.loaders.modules, modules);
4389
+ }
4390
+ function getJSModuleOrNull(name) {
4391
+ const module = globalThis.loaders?.modules?.[name];
4392
+ return module || null;
4393
+ }
4394
+
4345
4395
  // ../worker-utils/src/lib/env-utils/version.ts
4346
4396
  var NPM_TAG = "latest";
4347
4397
  function getVersion() {
@@ -4388,7 +4438,6 @@ var __exports__ = (() => {
4388
4438
  var nodeVersion2 = matches2 && parseFloat(matches2[1]) || 0;
4389
4439
 
4390
4440
  // ../worker-utils/src/lib/library-utils/library-utils.ts
4391
- var node = __toESM(require_require_utils(), 1);
4392
4441
  var loadLibraryPromises = {};
4393
4442
  async function loadLibrary(libraryUrl, moduleName = null, options = {}, libraryName = null) {
4394
4443
  if (moduleName) {
@@ -4425,7 +4474,8 @@ var __exports__ = (() => {
4425
4474
  }
4426
4475
  if (!isBrowser2) {
4427
4476
  try {
4428
- return node && void 0 && await (void 0)(libraryUrl);
4477
+ const { requireFromFile } = globalThis.loaders || {};
4478
+ return await requireFromFile?.(libraryUrl);
4429
4479
  } catch (error) {
4430
4480
  console.error(error);
4431
4481
  return null;
@@ -4439,7 +4489,8 @@ var __exports__ = (() => {
4439
4489
  }
4440
4490
  function loadLibraryFromString(scriptSource, id) {
4441
4491
  if (!isBrowser2) {
4442
- return void 0 && (void 0)(scriptSource, id);
4492
+ const { requireFromString } = globalThis.loaders || {};
4493
+ return requireFromString?.(scriptSource, id);
4443
4494
  }
4444
4495
  if (isWorker) {
4445
4496
  eval.call(globalThis, scriptSource);
@@ -4456,18 +4507,20 @@ var __exports__ = (() => {
4456
4507
  return null;
4457
4508
  }
4458
4509
  async function loadAsArrayBuffer(url) {
4459
- if (isBrowser2 || !void 0 || url.startsWith("http")) {
4510
+ const { readFileAsArrayBuffer } = globalThis.loaders || {};
4511
+ if (isBrowser2 || !readFileAsArrayBuffer || url.startsWith("http")) {
4460
4512
  const response = await fetch(url);
4461
4513
  return await response.arrayBuffer();
4462
4514
  }
4463
- return await (void 0)(url);
4515
+ return await readFileAsArrayBuffer(url);
4464
4516
  }
4465
4517
  async function loadAsText(url) {
4466
- if (isBrowser2 || !void 0 || url.startsWith("http")) {
4518
+ const { readFileAsText } = globalThis.loaders || {};
4519
+ if (isBrowser2 || !readFileAsText || url.startsWith("http")) {
4467
4520
  const response = await fetch(url);
4468
4521
  return await response.text();
4469
4522
  }
4470
- return await (void 0)(url);
4523
+ return await readFileAsText(url);
4471
4524
  }
4472
4525
 
4473
4526
  // ../loader-utils/src/lib/binary-utils/array-buffer-utils.ts
@@ -4511,52 +4564,6 @@ var __exports__ = (() => {
4511
4564
  return concatenateArrayBuffers(...arrayBuffers);
4512
4565
  }
4513
4566
 
4514
- // ../../node_modules/@babel/runtime/helpers/esm/typeof.js
4515
- function _typeof(obj) {
4516
- "@babel/helpers - typeof";
4517
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
4518
- return typeof obj2;
4519
- } : function(obj2) {
4520
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
4521
- }, _typeof(obj);
4522
- }
4523
-
4524
- // ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
4525
- function _toPrimitive(input, hint) {
4526
- if (_typeof(input) !== "object" || input === null)
4527
- return input;
4528
- var prim = input[Symbol.toPrimitive];
4529
- if (prim !== void 0) {
4530
- var res = prim.call(input, hint || "default");
4531
- if (_typeof(res) !== "object")
4532
- return res;
4533
- throw new TypeError("@@toPrimitive must return a primitive value.");
4534
- }
4535
- return (hint === "string" ? String : Number)(input);
4536
- }
4537
-
4538
- // ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
4539
- function _toPropertyKey(arg) {
4540
- var key = _toPrimitive(arg, "string");
4541
- return _typeof(key) === "symbol" ? key : String(key);
4542
- }
4543
-
4544
- // ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
4545
- function _defineProperty(obj, key, value) {
4546
- key = _toPropertyKey(key);
4547
- if (key in obj) {
4548
- Object.defineProperty(obj, key, {
4549
- value,
4550
- enumerable: true,
4551
- configurable: true,
4552
- writable: true
4553
- });
4554
- } else {
4555
- obj[key] = value;
4556
- }
4557
- return obj;
4558
- }
4559
-
4560
4567
  // ../loader-utils/src/lib/node/buffer.browser.ts
4561
4568
  function toArrayBuffer(buffer) {
4562
4569
  return buffer;
@@ -4600,10 +4607,11 @@ var __exports__ = (() => {
4600
4607
  // ../loader-utils/src/lib/files/node-file-facade.ts
4601
4608
  var NOT_IMPLEMENTED = new Error("Not implemented");
4602
4609
  var NodeFileFacade = class {
4610
+ handle;
4611
+ size = 0;
4612
+ bigsize = 0n;
4613
+ url = "";
4603
4614
  constructor(url, flags, mode) {
4604
- this.size = 0;
4605
- this.bigsize = 0n;
4606
- this.url = "";
4607
4615
  if (globalThis.loaders?.NodeFile) {
4608
4616
  return new globalThis.loaders.NodeFile(url, flags, mode);
4609
4617
  }
@@ -4644,6 +4652,8 @@ var __exports__ = (() => {
4644
4652
 
4645
4653
  // ../loader-utils/src/lib/file-provider/file-handle-file.ts
4646
4654
  var FileHandleFile = class {
4655
+ /** The FileHandle from which data is provided */
4656
+ file;
4647
4657
  /** Create a new FileHandleFile */
4648
4658
  constructor(path, append = false) {
4649
4659
  this.file = new NodeFileFacade(path, append ? "a+" : "r");
@@ -4743,6 +4753,8 @@ var __exports__ = (() => {
4743
4753
  return Number(bigint);
4744
4754
  };
4745
4755
  var DataViewFile = class {
4756
+ /** The DataView from which data is provided */
4757
+ file;
4746
4758
  constructor(file) {
4747
4759
  this.file = file;
4748
4760
  }
@@ -9690,6 +9702,8 @@ var __exports__ = (() => {
9690
9702
  // imagebitmap: {} - passes (platform dependent) parameters to ImageBitmap constructor
9691
9703
  };
9692
9704
  var ImageLoader = {
9705
+ dataType: null,
9706
+ batchType: null,
9693
9707
  id: "image",
9694
9708
  module: "images",
9695
9709
  name: "Images",
@@ -9707,6 +9721,8 @@ var __exports__ = (() => {
9707
9721
 
9708
9722
  // ../draco/src/draco-loader.ts
9709
9723
  var DracoLoader = {
9724
+ dataType: null,
9725
+ batchType: null,
9710
9726
  name: "Draco",
9711
9727
  id: "draco",
9712
9728
  module: "draco",
@@ -9861,10 +9877,17 @@ var __exports__ = (() => {
9861
9877
  4: Uint16Array,
9862
9878
  5: Int32Array,
9863
9879
  6: Uint32Array,
9880
+ // 7: BigInt64Array,
9881
+ // 8: BigUint64Array,
9864
9882
  9: Float32Array
9883
+ // 10: Float64Array
9884
+ // 11: BOOL - What array type do we use for this?
9865
9885
  };
9866
9886
  var INDEX_ITEM_SIZE = 4;
9867
9887
  var DracoParser = class {
9888
+ draco;
9889
+ decoder;
9890
+ metadataQuerier;
9868
9891
  // draco - the draco decoder, either import `draco3d` or load dynamically
9869
9892
  constructor(draco) {
9870
9893
  this.draco = draco;
@@ -10031,14 +10054,17 @@ var __exports__ = (() => {
10031
10054
  for (const loaderAttribute of Object.values(loaderData.attributes)) {
10032
10055
  const attributeName = this._deduceAttributeName(loaderAttribute, options);
10033
10056
  loaderAttribute.name = attributeName;
10034
- const { value, size } = this._getAttributeValues(dracoGeometry, loaderAttribute);
10035
- attributes[attributeName] = {
10036
- value,
10037
- size,
10038
- byteOffset: loaderAttribute.byte_offset,
10039
- byteStride: loaderAttribute.byte_stride,
10040
- normalized: loaderAttribute.normalized
10041
- };
10057
+ const values = this._getAttributeValues(dracoGeometry, loaderAttribute);
10058
+ if (values) {
10059
+ const { value, size } = values;
10060
+ attributes[attributeName] = {
10061
+ value,
10062
+ size,
10063
+ byteOffset: loaderAttribute.byte_offset,
10064
+ byteStride: loaderAttribute.byte_stride,
10065
+ normalized: loaderAttribute.normalized
10066
+ };
10067
+ }
10042
10068
  }
10043
10069
  return attributes;
10044
10070
  }
@@ -10080,6 +10106,10 @@ var __exports__ = (() => {
10080
10106
  */
10081
10107
  _getAttributeValues(dracoGeometry, attribute) {
10082
10108
  const TypedArrayCtor = DRACO_DATA_TYPE_TO_TYPED_ARRAY_MAP[attribute.data_type];
10109
+ if (!TypedArrayCtor) {
10110
+ console.warn(`DRACO: Unsupported attribute type ${attribute.data_type}`);
10111
+ return null;
10112
+ }
10083
10113
  const numComponents = attribute.num_components;
10084
10114
  const numPoints = dracoGeometry.num_points();
10085
10115
  const numValues = numPoints * numComponents;
@@ -10310,11 +10340,11 @@ var __exports__ = (() => {
10310
10340
  async function loadDracoDecoderModule(options) {
10311
10341
  const modules = options.modules || {};
10312
10342
  if (modules.draco3d) {
10313
- loadDecoderPromise = loadDecoderPromise || modules.draco3d.createDecoderModule({}).then((draco) => {
10343
+ loadDecoderPromise ||= modules.draco3d.createDecoderModule({}).then((draco) => {
10314
10344
  return { draco };
10315
10345
  });
10316
10346
  } else {
10317
- loadDecoderPromise = loadDecoderPromise || loadDracoDecoder(options);
10347
+ loadDecoderPromise ||= loadDracoDecoder(options);
10318
10348
  }
10319
10349
  return await loadDecoderPromise;
10320
10350
  }
@@ -10395,11 +10425,12 @@ var __exports__ = (() => {
10395
10425
  };
10396
10426
  var loadBasisTranscoderPromise;
10397
10427
  async function loadBasisTranscoderModule(options) {
10398
- const modules = options.modules || {};
10399
- if (modules.basis) {
10400
- return modules.basis;
10428
+ registerJSModules(options.modules);
10429
+ const basis = getJSModuleOrNull("basis");
10430
+ if (basis) {
10431
+ return basis;
10401
10432
  }
10402
- loadBasisTranscoderPromise = loadBasisTranscoderPromise || loadBasisTranscoder(options);
10433
+ loadBasisTranscoderPromise ||= loadBasisTranscoder(options);
10403
10434
  return await loadBasisTranscoderPromise;
10404
10435
  }
10405
10436
  async function loadBasisTranscoder(options) {
@@ -11065,6 +11096,8 @@ var __exports__ = (() => {
11065
11096
 
11066
11097
  // ../textures/src/basis-loader.ts
11067
11098
  var BasisWorkerLoader = {
11099
+ dataType: null,
11100
+ batchType: null,
11068
11101
  name: "Basis",
11069
11102
  id: "basis",
11070
11103
  module: "textures",
@@ -11077,12 +11110,9 @@ var __exports__ = (() => {
11077
11110
  options: {
11078
11111
  basis: {
11079
11112
  format: "auto",
11080
- // gl context doesn't exist on a worker thread
11081
11113
  libraryPath: "libs/",
11082
11114
  containerFormat: "auto",
11083
- // 'basis' || 'ktx2' || 'auto'
11084
11115
  module: "transcoder"
11085
- // 'transcoder' || 'encoder'
11086
11116
  }
11087
11117
  }
11088
11118
  };
@@ -11383,6 +11413,8 @@ var __exports__ = (() => {
11383
11413
 
11384
11414
  // ../textures/src/compressed-texture-loader.ts
11385
11415
  var CompressedTextureWorkerLoader = {
11416
+ dataType: null,
11417
+ batchType: null,
11386
11418
  name: "Texture Containers",
11387
11419
  id: "compressed-texture",
11388
11420
  module: "textures",
@@ -11492,11 +11524,7 @@ var __exports__ = (() => {
11492
11524
  texture: null
11493
11525
  };
11494
11526
  if (tileOptions.textureUrl) {
11495
- const url = getUrlWithToken(
11496
- getInternalPathFromUrl(tileOptions.textureUrl),
11497
- // @ts-expect-error options is not properly typed
11498
- options?.i3s?.token
11499
- );
11527
+ const url = getUrlWithToken(tileOptions.textureUrl, options?.i3s?.token);
11500
11528
  const loader = getLoaderForTextureFormat(tileOptions.textureFormat);
11501
11529
  const fetchFunc = context?.fetch || fetch;
11502
11530
  const response = await fetchFunc(url);
@@ -11534,18 +11562,6 @@ var __exports__ = (() => {
11534
11562
  }
11535
11563
  return await parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options);
11536
11564
  }
11537
- function getInternalPathFromUrl(url) {
11538
- const slpkUrlParts = url.split(".slpk");
11539
- let filename;
11540
- if (slpkUrlParts.length === 1) {
11541
- filename = url;
11542
- } else if (slpkUrlParts.length === 2) {
11543
- filename = slpkUrlParts[1].slice(1);
11544
- } else {
11545
- filename = url;
11546
- }
11547
- return filename;
11548
- }
11549
11565
  async function parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options) {
11550
11566
  const contentByteLength = arrayBuffer.byteLength;
11551
11567
  let attributes;
@@ -11673,11 +11689,11 @@ var __exports__ = (() => {
11673
11689
  for (const { property, type } of options.store.defaultGeometrySchema.header) {
11674
11690
  const TypedArrayTypeHeader = getConstructorForDataFormat(type);
11675
11691
  switch (property) {
11676
- case "vertexCount" /* vertexCount */:
11692
+ case "vertexCount" /* vertexCount */.toString():
11677
11693
  vertexCount = new TypedArrayTypeHeader(arrayBuffer, 0, 4)[0];
11678
11694
  byteOffset += sizeOf(type);
11679
11695
  break;
11680
- case "featureCount" /* featureCount */:
11696
+ case "featureCount" /* featureCount */.toString():
11681
11697
  featureCount = new TypedArrayTypeHeader(arrayBuffer, 4, 4)[0];
11682
11698
  byteOffset += sizeOf(type);
11683
11699
  break;
@@ -11877,6 +11893,8 @@ var __exports__ = (() => {
11877
11893
  // src/i3s-content-loader.ts
11878
11894
  var VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
11879
11895
  var I3SContentLoader = {
11896
+ dataType: null,
11897
+ batchType: null,
11880
11898
  name: "I3S Content (Indexed Scene Layers)",
11881
11899
  id: "i3s-content",
11882
11900
  module: "i3s",
@@ -12364,6 +12382,8 @@ var __exports__ = (() => {
12364
12382
  // src/i3s-node-page-loader.ts
12365
12383
  var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
12366
12384
  var I3SNodePageLoader = {
12385
+ dataType: null,
12386
+ batchType: null,
12367
12387
  name: "I3S Node Page",
12368
12388
  id: "i3s-node-page",
12369
12389
  module: "i3s",
@@ -12381,6 +12401,16 @@ var __exports__ = (() => {
12381
12401
 
12382
12402
  // src/lib/helpers/i3s-nodepages-tiles.ts
12383
12403
  var I3SNodePagesTiles = class {
12404
+ tileset;
12405
+ nodePages = [];
12406
+ pendingNodePages = [];
12407
+ nodesPerPage;
12408
+ options;
12409
+ lodSelectionMetricType;
12410
+ textureDefinitionsSelectedFormats = [];
12411
+ nodesInNodePages;
12412
+ url;
12413
+ textureLoaderOptions = {};
12384
12414
  /**
12385
12415
  * @constructs
12386
12416
  * Create a I3SNodePagesTiles instance.
@@ -12389,10 +12419,6 @@ var __exports__ = (() => {
12389
12419
  * @param options - i3s loader options
12390
12420
  */
12391
12421
  constructor(tileset, url = "", options) {
12392
- this.nodePages = [];
12393
- this.pendingNodePages = [];
12394
- this.textureDefinitionsSelectedFormats = [];
12395
- this.textureLoaderOptions = {};
12396
12422
  this.tileset = { ...tileset };
12397
12423
  this.url = url;
12398
12424
  this.nodesPerPage = tileset.nodePages?.nodesPerPage || 64;
@@ -12409,7 +12435,7 @@ var __exports__ = (() => {
12409
12435
  const pageIndex = Math.floor(id / this.nodesPerPage);
12410
12436
  if (!this.nodePages[pageIndex] && !this.pendingNodePages[pageIndex]) {
12411
12437
  const nodePageUrl = getUrlWithToken(
12412
- this.url.indexOf(".slpk") !== -1 ? `nodepages/${pageIndex}` : `${this.url}/nodepages/${pageIndex}`,
12438
+ `${this.url}/nodepages/${pageIndex}`,
12413
12439
  // @ts-expect-error this.options is not properly typed
12414
12440
  this.options.i3s?.token
12415
12441
  );
@@ -12433,10 +12459,10 @@ var __exports__ = (() => {
12433
12459
  */
12434
12460
  // eslint-disable-next-line complexity, max-statements
12435
12461
  async formTileFromNodePages(id) {
12436
- const node2 = await this.getNodeById(id);
12462
+ const node = await this.getNodeById(id);
12437
12463
  const children = [];
12438
12464
  const childNodesPromises = [];
12439
- for (const child of node2.children || []) {
12465
+ for (const child of node.children || []) {
12440
12466
  childNodesPromises.push(this.getNodeById(child));
12441
12467
  }
12442
12468
  const childNodes = await Promise.all(childNodesPromises);
@@ -12452,29 +12478,29 @@ var __exports__ = (() => {
12452
12478
  let textureFormat = "jpg";
12453
12479
  let attributeUrls = [];
12454
12480
  let isDracoGeometry = false;
12455
- if (node2 && node2.mesh) {
12456
- const { url, isDracoGeometry: isDracoGeometryResult } = node2.mesh.geometry && this.getContentUrl(node2.mesh.geometry) || { isDracoGeometry: false };
12481
+ if (node && node.mesh) {
12482
+ const { url, isDracoGeometry: isDracoGeometryResult } = node.mesh.geometry && this.getContentUrl(node.mesh.geometry) || { isDracoGeometry: false };
12457
12483
  contentUrl = url;
12458
12484
  isDracoGeometry = isDracoGeometryResult;
12459
- const { textureData, materialDefinition: nodeMaterialDefinition } = this.getInformationFromMaterial(node2.mesh.material);
12485
+ const { textureData, materialDefinition: nodeMaterialDefinition } = this.getInformationFromMaterial(node.mesh.material);
12460
12486
  materialDefinition = nodeMaterialDefinition;
12461
12487
  textureFormat = textureData.format || textureFormat;
12462
12488
  if (textureData.name) {
12463
- textureUrl = `${this.url}/nodes/${node2.mesh.material.resource}/textures/${textureData.name}`;
12489
+ textureUrl = `${this.url}/nodes/${node.mesh.material.resource}/textures/${textureData.name}`;
12464
12490
  }
12465
12491
  if (this.tileset.attributeStorageInfo) {
12466
12492
  attributeUrls = generateTilesetAttributeUrls(
12467
12493
  this.tileset,
12468
12494
  this.url,
12469
- node2.mesh.attribute.resource
12495
+ node.mesh.attribute.resource
12470
12496
  );
12471
12497
  }
12472
12498
  }
12473
- const lodSelection = this.getLodSelection(node2);
12499
+ const lodSelection = this.getLodSelection(node);
12474
12500
  return normalizeTileNonUrlData({
12475
12501
  id: id.toString(),
12476
12502
  lodSelection,
12477
- obb: node2.obb,
12503
+ obb: node.obb,
12478
12504
  contentUrl,
12479
12505
  textureUrl,
12480
12506
  attributeUrls,
@@ -12522,19 +12548,19 @@ var __exports__ = (() => {
12522
12548
  * @param node - a node from nodepage
12523
12549
  * @returns- Array of LodSelection
12524
12550
  */
12525
- getLodSelection(node2) {
12551
+ getLodSelection(node) {
12526
12552
  const lodSelection = [];
12527
12553
  if (this.lodSelectionMetricType === "maxScreenThresholdSQ") {
12528
12554
  lodSelection.push({
12529
12555
  metricType: "maxScreenThreshold",
12530
12556
  // @ts-ignore
12531
- maxError: Math.sqrt(node2.lodThreshold / (Math.PI * 0.25))
12557
+ maxError: Math.sqrt(node.lodThreshold / (Math.PI * 0.25))
12532
12558
  });
12533
12559
  }
12534
12560
  lodSelection.push({
12535
12561
  metricType: this.lodSelectionMetricType,
12536
12562
  // @ts-ignore
12537
- maxError: node2.lodThreshold
12563
+ maxError: node.lodThreshold
12538
12564
  });
12539
12565
  return lodSelection;
12540
12566
  }
@@ -12712,10 +12738,13 @@ var __exports__ = (() => {
12712
12738
  // src/i3s-loader.ts
12713
12739
  var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
12714
12740
  var TILESET_REGEX = /layers\/[0-9]+$/;
12741
+ var LOCAL_SLPK_REGEX = /\.slpk$/;
12715
12742
  var TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
12716
12743
  var SLPK_HEX = "504b0304";
12717
12744
  var POINT_CLOUD = "PointCloud";
12718
12745
  var I3SLoader = {
12746
+ dataType: null,
12747
+ batchType: null,
12719
12748
  name: "I3S (Indexed Scene Layers)",
12720
12749
  id: "i3s",
12721
12750
  module: "i3s",
@@ -12749,7 +12778,7 @@ var __exports__ = (() => {
12749
12778
  const urlWithoutParams = getUrlWithoutParams(url);
12750
12779
  let isTileset;
12751
12780
  if (options.i3s.isTileset === "auto") {
12752
- isTileset = TILESET_REGEX.test(urlWithoutParams);
12781
+ isTileset = TILESET_REGEX.test(urlWithoutParams) || LOCAL_SLPK_REGEX.test(urlWithoutParams);
12753
12782
  } else {
12754
12783
  isTileset = options.i3s.isTileset;
12755
12784
  }
@@ -13810,9 +13839,10 @@ var __exports__ = (() => {
13810
13839
 
13811
13840
  // ../crypto/src/lib/md5-hash.ts
13812
13841
  var MD5Hash = class extends Hash {
13842
+ name = "md5";
13843
+ options;
13813
13844
  constructor(options = {}) {
13814
13845
  super();
13815
- this.name = "md5";
13816
13846
  this.options = options;
13817
13847
  }
13818
13848
  /**
@@ -13838,7 +13868,8 @@ var __exports__ = (() => {
13838
13868
  this.decompressBatches = this.decompressBatches.bind(this);
13839
13869
  }
13840
13870
  /** Preloads any dynamic libraries. May enable sync functions */
13841
- async preload() {
13871
+ async preload(modules = {}) {
13872
+ registerJSModules(modules);
13842
13873
  return;
13843
13874
  }
13844
13875
  /** Asynchronously compress data */
@@ -13885,13 +13916,14 @@ var __exports__ = (() => {
13885
13916
  var import_pako = __toESM(require_pako(), 1);
13886
13917
  var import_zlib = __toESM(require_zlib(), 1);
13887
13918
  var DeflateCompression = class extends Compression {
13919
+ name = "deflate";
13920
+ extensions = [];
13921
+ contentEncodings = ["deflate"];
13922
+ isSupported = true;
13923
+ options;
13924
+ _chunks = [];
13888
13925
  constructor(options = {}) {
13889
13926
  super(options);
13890
- this.name = "deflate";
13891
- this.extensions = [];
13892
- this.contentEncodings = ["deflate"];
13893
- this.isSupported = true;
13894
- this._chunks = [];
13895
13927
  this.options = options;
13896
13928
  }
13897
13929
  async compress(input) {
@@ -13998,12 +14030,12 @@ var __exports__ = (() => {
13998
14030
 
13999
14031
  // ../compression/src/lib/gzip-compression.ts
14000
14032
  var GZipCompression = class extends DeflateCompression {
14033
+ name = "gzip";
14034
+ extensions = ["gz", "gzip"];
14035
+ contentEncodings = ["gzip", "x-gzip"];
14036
+ isSupported = true;
14001
14037
  constructor(options) {
14002
14038
  super({ ...options, deflate: { ...options?.gzip, gzip: true } });
14003
- this.name = "gzip";
14004
- this.extensions = ["gz", "gzip"];
14005
- this.contentEncodings = ["gzip", "x-gzip"];
14006
- this.isSupported = true;
14007
14039
  }
14008
14040
  };
14009
14041
 
@@ -14019,14 +14051,15 @@ var __exports__ = (() => {
14019
14051
  }
14020
14052
  };
14021
14053
  var ZipFileSystem = class {
14054
+ /** FileProvider instance promise */
14055
+ fileProvider = null;
14056
+ fileName;
14057
+ archive = null;
14022
14058
  /**
14023
14059
  * Constructor
14024
14060
  * @param file - instance of FileProvider or file path string
14025
14061
  */
14026
14062
  constructor(file) {
14027
- /** FileProvider instance promise */
14028
- this.fileProvider = null;
14029
- this.archive = null;
14030
14063
  if (typeof file === "string") {
14031
14064
  this.fileName = file;
14032
14065
  if (!isBrowser) {
@@ -14078,6 +14111,9 @@ var __exports__ = (() => {
14078
14111
  * @returns - Response with file data
14079
14112
  */
14080
14113
  async fetch(filename) {
14114
+ if (this.fileName && filename.indexOf(this.fileName) === 0) {
14115
+ filename = filename.substring(this.fileName.length + 1);
14116
+ }
14081
14117
  let uncompressedFile;
14082
14118
  if (this.archive) {
14083
14119
  uncompressedFile = await this.archive.getFile(filename, "http");
@@ -14135,6 +14171,8 @@ var __exports__ = (() => {
14135
14171
 
14136
14172
  // ../zip/src/filesystems/IndexedArchive.ts
14137
14173
  var IndexedArchive = class {
14174
+ fileProvider;
14175
+ fileName;
14138
14176
  /**
14139
14177
  * Constructor
14140
14178
  * @param fileProvider - instance of a binary data reader
@@ -14224,6 +14262,11 @@ var __exports__ = (() => {
14224
14262
  }
14225
14263
  ];
14226
14264
  var SLPKArchive = class extends IndexedArchive {
14265
+ // Maps hex-encoded md5 filename hashes to bigint offsets into the archive
14266
+ hashTable;
14267
+ _textEncoder = new TextEncoder();
14268
+ _textDecoder = new TextDecoder();
14269
+ _md5Hash = new MD5Hash();
14227
14270
  /**
14228
14271
  * Constructor
14229
14272
  * @param fileProvider - instance of a binary data reader
@@ -14232,9 +14275,6 @@ var __exports__ = (() => {
14232
14275
  */
14233
14276
  constructor(fileProvider, hashTable, fileName) {
14234
14277
  super(fileProvider, hashTable, fileName);
14235
- this._textEncoder = new TextEncoder();
14236
- this._textDecoder = new TextDecoder();
14237
- this._md5Hash = new MD5Hash();
14238
14278
  this.hashTable = hashTable;
14239
14279
  }
14240
14280
  /**
@@ -14355,6 +14395,8 @@ var __exports__ = (() => {
14355
14395
  // src/i3s-slpk-loader.ts
14356
14396
  var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
14357
14397
  var SLPKLoader = {
14398
+ dataType: null,
14399
+ batchType: null,
14358
14400
  name: "I3S SLPK (Scene Layer Package)",
14359
14401
  id: "slpk",
14360
14402
  module: "i3s",
@@ -14437,6 +14479,8 @@ var __exports__ = (() => {
14437
14479
  var EMPTY_VALUE = "";
14438
14480
  var REJECTED_STATUS = "rejected";
14439
14481
  var I3SAttributeLoader = {
14482
+ dataType: null,
14483
+ batchType: null,
14440
14484
  name: "I3S Attribute",
14441
14485
  id: "i3s-attribute",
14442
14486
  module: "i3s",
@@ -14569,6 +14613,8 @@ var __exports__ = (() => {
14569
14613
  // src/i3s-building-scene-layer-loader.ts
14570
14614
  var VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
14571
14615
  var I3SBuildingSceneLayerLoader = {
14616
+ dataType: null,
14617
+ batchType: null,
14572
14618
  name: "I3S Building Scene Layer",
14573
14619
  id: "i3s-building-scene-layer",
14574
14620
  module: "i3s",
@@ -14658,6 +14704,8 @@ var __exports__ = (() => {
14658
14704
  // src/arcgis-webscene-loader.ts
14659
14705
  var VERSION11 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
14660
14706
  var ArcGISWebSceneLoader = {
14707
+ dataType: null,
14708
+ batchType: null,
14661
14709
  name: "ArcGIS Web Scene Loader",
14662
14710
  id: "arcgis-web-scene",
14663
14711
  module: "i3s",