@loaders.gl/tile-converter 3.3.0-alpha.1 → 3.3.0-alpha.2

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 (67) hide show
  1. package/dist/3d-tiles-attributes-worker.js +3 -3
  2. package/dist/3d-tiles-attributes-worker.js.map +1 -1
  3. package/dist/converter.min.js +10 -10
  4. package/dist/dist.min.js +791 -554
  5. package/dist/es5/3d-tiles-attributes-worker.js +1 -1
  6. package/dist/es5/i3s-attributes-worker.js +1 -1
  7. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +15 -4
  8. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  9. package/dist/es5/i3s-converter/helpers/feature-attributes.js +60 -0
  10. package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -0
  11. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +39 -7
  12. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  13. package/dist/es5/i3s-converter/helpers/geometry-converter.js +161 -49
  14. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  15. package/dist/es5/i3s-converter/helpers/node-pages.js +102 -46
  16. package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -1
  17. package/dist/es5/i3s-converter/i3s-converter.js +235 -141
  18. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  19. package/dist/es5/lib/utils/write-queue.js +66 -28
  20. package/dist/es5/lib/utils/write-queue.js.map +1 -1
  21. package/dist/es5/pgm-loader.js +1 -1
  22. package/dist/esm/3d-tiles-attributes-worker.js +1 -1
  23. package/dist/esm/i3s-attributes-worker.js +1 -1
  24. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +15 -4
  25. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  26. package/dist/esm/i3s-converter/helpers/feature-attributes.js +34 -0
  27. package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -0
  28. package/dist/esm/i3s-converter/helpers/geometry-attributes.js +23 -7
  29. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  30. package/dist/esm/i3s-converter/helpers/geometry-converter.js +132 -30
  31. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  32. package/dist/esm/i3s-converter/helpers/node-pages.js +3 -3
  33. package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -1
  34. package/dist/esm/i3s-converter/i3s-converter.js +32 -42
  35. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  36. package/dist/esm/lib/utils/write-queue.js +10 -0
  37. package/dist/esm/lib/utils/write-queue.js.map +1 -1
  38. package/dist/esm/pgm-loader.js +1 -1
  39. package/dist/i3s-attributes-worker.js +3 -3
  40. package/dist/i3s-attributes-worker.js.map +2 -2
  41. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
  42. package/dist/i3s-converter/helpers/batch-ids-extensions.js +12 -1
  43. package/dist/i3s-converter/helpers/feature-attributes.d.ts +24 -0
  44. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -0
  45. package/dist/i3s-converter/helpers/feature-attributes.js +55 -0
  46. package/dist/i3s-converter/helpers/geometry-attributes.js +26 -7
  47. package/dist/i3s-converter/helpers/geometry-converter.d.ts +9 -2
  48. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  49. package/dist/i3s-converter/helpers/geometry-converter.js +124 -33
  50. package/dist/i3s-converter/helpers/node-pages.js +3 -3
  51. package/dist/i3s-converter/i3s-converter.d.ts +7 -14
  52. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  53. package/dist/i3s-converter/i3s-converter.js +56 -50
  54. package/dist/i3s-converter/types.d.ts +0 -48
  55. package/dist/i3s-converter/types.d.ts.map +1 -1
  56. package/dist/lib/utils/write-queue.d.ts +1 -0
  57. package/dist/lib/utils/write-queue.d.ts.map +1 -1
  58. package/dist/lib/utils/write-queue.js +13 -0
  59. package/package.json +15 -15
  60. package/src/i3s-converter/helpers/batch-ids-extensions.ts +22 -5
  61. package/src/i3s-converter/helpers/feature-attributes.ts +65 -0
  62. package/src/i3s-converter/helpers/geometry-attributes.ts +30 -7
  63. package/src/i3s-converter/helpers/geometry-converter.ts +161 -37
  64. package/src/i3s-converter/helpers/node-pages.ts +3 -3
  65. package/src/i3s-converter/i3s-converter.ts +41 -51
  66. package/src/i3s-converter/types.ts +0 -51
  67. package/src/lib/utils/write-queue.ts +12 -0
package/dist/dist.min.js CHANGED
@@ -10,8 +10,8 @@ var __commonJS = (cb, mod) => function __require() {
10
10
  };
11
11
  var __export = (target, all) => {
12
12
  __markAsModule(target);
13
- for (var name9 in all)
14
- __defProp(target, name9, { get: all[name9], enumerable: true });
13
+ for (var name10 in all)
14
+ __defProp(target, name10, { get: all[name10], enumerable: true });
15
15
  };
16
16
  var __reExport = (target, module2, desc) => {
17
17
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
@@ -130,7 +130,7 @@ var require_stat = __commonJS({
130
130
  var _defineProperty2 = _interopRequireDefault(require_defineProperty());
131
131
  var _hiResTimestamp = _interopRequireDefault(require_hi_res_timestamp());
132
132
  var Stat = function() {
133
- function Stat2(name9, type) {
133
+ function Stat2(name10, type) {
134
134
  (0, _classCallCheck2.default)(this, Stat2);
135
135
  (0, _defineProperty2.default)(this, "name", void 0);
136
136
  (0, _defineProperty2.default)(this, "type", void 0);
@@ -146,7 +146,7 @@ var require_stat = __commonJS({
146
146
  (0, _defineProperty2.default)(this, "_samples", 0);
147
147
  (0, _defineProperty2.default)(this, "_startTime", 0);
148
148
  (0, _defineProperty2.default)(this, "_timerPending", false);
149
- this.name = name9;
149
+ this.name = name10;
150
150
  this.type = type;
151
151
  this.reset();
152
152
  }
@@ -303,10 +303,10 @@ var require_stats = __commonJS({
303
303
  }
304
304
  (0, _createClass2.default)(Stats4, [{
305
305
  key: "get",
306
- value: function get(name9) {
306
+ value: function get(name10) {
307
307
  var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "count";
308
308
  return this._getOrCreate({
309
- name: name9,
309
+ name: name10,
310
310
  type
311
311
  });
312
312
  }
@@ -359,15 +359,15 @@ var require_stats = __commonJS({
359
359
  if (!stat2 || !stat2.name) {
360
360
  return null;
361
361
  }
362
- var name9 = stat2.name, type = stat2.type;
363
- if (!this.stats[name9]) {
362
+ var name10 = stat2.name, type = stat2.type;
363
+ if (!this.stats[name10]) {
364
364
  if (stat2 instanceof _stat.default) {
365
- this.stats[name9] = stat2;
365
+ this.stats[name10] = stat2;
366
366
  } else {
367
- this.stats[name9] = new _stat.default(name9, type);
367
+ this.stats[name10] = new _stat.default(name10, type);
368
368
  }
369
369
  }
370
- return this.stats[name9];
370
+ return this.stats[name10];
371
371
  }
372
372
  }]);
373
373
  return Stats4;
@@ -935,8 +935,8 @@ var require_autobind = __commonJS({
935
935
  var _loop = function _loop2() {
936
936
  var key = _step.value;
937
937
  if (typeof obj[key] === "function") {
938
- if (!predefined.find(function(name9) {
939
- return key === name9;
938
+ if (!predefined.find(function(name10) {
939
+ return key === name10;
940
940
  })) {
941
941
  obj[key] = obj[key].bind(obj);
942
942
  }
@@ -1498,9 +1498,9 @@ var require_stat2 = __commonJS({
1498
1498
  var _createClass2 = _interopRequireDefault(require_createClass());
1499
1499
  var _hiResTimestamp = _interopRequireDefault(require_hi_res_timestamp3());
1500
1500
  var Stat = function() {
1501
- function Stat2(name9, type) {
1501
+ function Stat2(name10, type) {
1502
1502
  (0, _classCallCheck2.default)(this, Stat2);
1503
- this.name = name9;
1503
+ this.name = name10;
1504
1504
  this.type = type;
1505
1505
  this.sampleSize = 1;
1506
1506
  this.reset();
@@ -1656,10 +1656,10 @@ var require_stats2 = __commonJS({
1656
1656
  }
1657
1657
  (0, _createClass2.default)(Stats4, [{
1658
1658
  key: "get",
1659
- value: function get(name9) {
1659
+ value: function get(name10) {
1660
1660
  var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "count";
1661
1661
  return this._getOrCreate({
1662
- name: name9,
1662
+ name: name10,
1663
1663
  type
1664
1664
  });
1665
1665
  }
@@ -1712,15 +1712,15 @@ var require_stats2 = __commonJS({
1712
1712
  if (!stat2 || !stat2.name) {
1713
1713
  return null;
1714
1714
  }
1715
- var name9 = stat2.name, type = stat2.type;
1716
- if (!this.stats[name9]) {
1715
+ var name10 = stat2.name, type = stat2.type;
1716
+ if (!this.stats[name10]) {
1717
1717
  if (stat2 instanceof _stat.default) {
1718
- this.stats[name9] = stat2;
1718
+ this.stats[name10] = stat2;
1719
1719
  } else {
1720
- this.stats[name9] = new _stat.default(name9, type);
1720
+ this.stats[name10] = new _stat.default(name10, type);
1721
1721
  }
1722
1722
  }
1723
- return this.stats[name9];
1723
+ return this.stats[name10];
1724
1724
  }
1725
1725
  }]);
1726
1726
  return Stats4;
@@ -2587,8 +2587,8 @@ var require_autobind2 = __commonJS({
2587
2587
  var _loop = function _loop2() {
2588
2588
  var key = _step.value;
2589
2589
  if (typeof obj[key] === "function") {
2590
- if (!predefined.find(function(name9) {
2591
- return key === name9;
2590
+ if (!predefined.find(function(name10) {
2591
+ return key === name10;
2592
2592
  })) {
2593
2593
  obj[key] = obj[key].bind(obj);
2594
2594
  }
@@ -13480,7 +13480,7 @@ var require_v35 = __commonJS({
13480
13480
  exports.DNS = DNS;
13481
13481
  var URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
13482
13482
  exports.URL = URL2;
13483
- function _default(name9, version2, hashfunc) {
13483
+ function _default(name10, version2, hashfunc) {
13484
13484
  function generateUUID(value, namespace, buf, offset) {
13485
13485
  if (typeof value === "string") {
13486
13486
  value = stringToBytes(value);
@@ -13507,7 +13507,7 @@ var require_v35 = __commonJS({
13507
13507
  return (0, _stringify.default)(bytes);
13508
13508
  }
13509
13509
  try {
13510
- generateUUID.name = name9;
13510
+ generateUUID.name = name10;
13511
13511
  } catch (err) {
13512
13512
  }
13513
13513
  generateUUID.DNS = DNS;
@@ -14930,12 +14930,12 @@ var require_readdir_glob = __commonJS({
14930
14930
  async function* exploreWalkAsync(dir, path2, followSyslinks, useStat, shouldSkip, strict) {
14931
14931
  let files = await readdir2(path2 + dir, strict);
14932
14932
  for (const file of files) {
14933
- let name9 = file.name;
14934
- if (name9 === void 0) {
14935
- name9 = file;
14933
+ let name10 = file.name;
14934
+ if (name10 === void 0) {
14935
+ name10 = file;
14936
14936
  useStat = true;
14937
14937
  }
14938
- const filename2 = dir + "/" + name9;
14938
+ const filename2 = dir + "/" + name10;
14939
14939
  const relative = filename2.slice(1);
14940
14940
  const absolute = path2 + "/" + relative;
14941
14941
  let stats = null;
@@ -15617,7 +15617,7 @@ var require_async = __commonJS({
15617
15617
  newTasks[key] = params.concat(newTask);
15618
15618
  }
15619
15619
  function newTask(results, taskCb) {
15620
- var newArgs = params.map((name9) => results[name9]);
15620
+ var newArgs = params.map((name10) => results[name10]);
15621
15621
  newArgs.push(taskCb);
15622
15622
  wrapAsync(taskFn)(...newArgs);
15623
15623
  }
@@ -15816,18 +15816,18 @@ var require_async = __commonJS({
15816
15816
  }
15817
15817
  return false;
15818
15818
  }
15819
- const eventMethod = (name9) => (handler) => {
15819
+ const eventMethod = (name10) => (handler) => {
15820
15820
  if (!handler) {
15821
15821
  return new Promise((resolve, reject2) => {
15822
- once2(name9, (err, data) => {
15822
+ once2(name10, (err, data) => {
15823
15823
  if (err)
15824
15824
  return reject2(err);
15825
15825
  resolve(data);
15826
15826
  });
15827
15827
  });
15828
15828
  }
15829
- off(name9);
15830
- on(name9, handler);
15829
+ off(name10);
15830
+ on(name10, handler);
15831
15831
  };
15832
15832
  var isProcessing = false;
15833
15833
  var q = {
@@ -16064,15 +16064,15 @@ var require_async = __commonJS({
16064
16064
  return _createTester((bool) => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback);
16065
16065
  }
16066
16066
  var detectSeries$1 = awaitify(detectSeries, 3);
16067
- function consoleFunc(name9) {
16067
+ function consoleFunc(name10) {
16068
16068
  return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => {
16069
16069
  if (typeof console === "object") {
16070
16070
  if (err) {
16071
16071
  if (console.error) {
16072
16072
  console.error(err);
16073
16073
  }
16074
- } else if (console[name9]) {
16075
- resultArgs.forEach((x) => console[name9](x));
16074
+ } else if (console[name10]) {
16075
+ resultArgs.forEach((x) => console[name10](x));
16076
16076
  }
16077
16077
  }
16078
16078
  });
@@ -16628,8 +16628,8 @@ var require_async = __commonJS({
16628
16628
  var timedOut = false;
16629
16629
  var timer;
16630
16630
  function timeoutCallback() {
16631
- var name9 = asyncFn.name || "anonymous";
16632
- var error = new Error('Callback function "' + name9 + '" timed out.');
16631
+ var name10 = asyncFn.name || "anonymous";
16632
+ var error = new Error('Callback function "' + name10 + '" timed out.');
16633
16633
  error.code = "ETIMEDOUT";
16634
16634
  if (info) {
16635
16635
  error.info = info;
@@ -21900,8 +21900,8 @@ var require_once = __commonJS({
21900
21900
  f.called = true;
21901
21901
  return f.value = fn.apply(this, arguments);
21902
21902
  };
21903
- var name9 = fn.name || "Function wrapped with `once`";
21904
- f.onceError = name9 + " shouldn't be called more than once";
21903
+ var name10 = fn.name || "Function wrapped with `once`";
21904
+ f.onceError = name10 + " shouldn't be called more than once";
21905
21905
  f.called = false;
21906
21906
  return f;
21907
21907
  }
@@ -23219,10 +23219,10 @@ var require_errors = __commonJS({
23219
23219
  return str.indexOf(search, start) !== -1;
23220
23220
  }
23221
23221
  }
23222
- createErrorType("ERR_INVALID_OPT_VALUE", function(name9, value) {
23223
- return 'The value "' + value + '" is invalid for option "' + name9 + '"';
23222
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name10, value) {
23223
+ return 'The value "' + value + '" is invalid for option "' + name10 + '"';
23224
23224
  }, TypeError);
23225
- createErrorType("ERR_INVALID_ARG_TYPE", function(name9, expected, actual) {
23225
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name10, expected, actual) {
23226
23226
  let determiner;
23227
23227
  if (typeof expected === "string" && startsWith(expected, "not ")) {
23228
23228
  determiner = "must not be";
@@ -23231,22 +23231,22 @@ var require_errors = __commonJS({
23231
23231
  determiner = "must be";
23232
23232
  }
23233
23233
  let msg;
23234
- if (endsWith(name9, " argument")) {
23235
- msg = `The ${name9} ${determiner} ${oneOf(expected, "type")}`;
23234
+ if (endsWith(name10, " argument")) {
23235
+ msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
23236
23236
  } else {
23237
- const type = includes(name9, ".") ? "property" : "argument";
23238
- msg = `The "${name9}" ${type} ${determiner} ${oneOf(expected, "type")}`;
23237
+ const type = includes(name10, ".") ? "property" : "argument";
23238
+ msg = `The "${name10}" ${type} ${determiner} ${oneOf(expected, "type")}`;
23239
23239
  }
23240
23240
  msg += `. Received type ${typeof actual}`;
23241
23241
  return msg;
23242
23242
  }, TypeError);
23243
23243
  createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
23244
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name9) {
23245
- return "The " + name9 + " method is not implemented";
23244
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name10) {
23245
+ return "The " + name10 + " method is not implemented";
23246
23246
  });
23247
23247
  createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
23248
- createErrorType("ERR_STREAM_DESTROYED", function(name9) {
23249
- return "Cannot call " + name9 + " after a stream was destroyed";
23248
+ createErrorType("ERR_STREAM_DESTROYED", function(name10) {
23249
+ return "Cannot call " + name10 + " after a stream was destroyed";
23250
23250
  });
23251
23251
  createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
23252
23252
  createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
@@ -23272,8 +23272,8 @@ var require_state = __commonJS({
23272
23272
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
23273
23273
  if (hwm != null) {
23274
23274
  if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
23275
- var name9 = isDuplex ? duplexKey : "highWaterMark";
23276
- throw new ERR_INVALID_OPT_VALUE(name9, hwm);
23275
+ var name10 = isDuplex ? duplexKey : "highWaterMark";
23276
+ throw new ERR_INVALID_OPT_VALUE(name10, hwm);
23277
23277
  }
23278
23278
  return Math.floor(hwm);
23279
23279
  }
@@ -26360,9 +26360,9 @@ var require_zip_archive_entry = __commonJS({
26360
26360
  var UnixStat = require_unix_stat();
26361
26361
  var constants = require_constants3();
26362
26362
  var zipUtil = require_util2();
26363
- var ZipArchiveEntry = module2.exports = function(name9) {
26363
+ var ZipArchiveEntry = module2.exports = function(name10) {
26364
26364
  if (!(this instanceof ZipArchiveEntry)) {
26365
- return new ZipArchiveEntry(name9);
26365
+ return new ZipArchiveEntry(name10);
26366
26366
  }
26367
26367
  ArchiveEntry.call(this);
26368
26368
  this.platform = constants.PLATFORM_FAT;
@@ -26379,8 +26379,8 @@ var require_zip_archive_entry = __commonJS({
26379
26379
  this.exattr = 0;
26380
26380
  this.inattr = 0;
26381
26381
  this.comment = null;
26382
- if (name9) {
26383
- this.setName(name9);
26382
+ if (name10) {
26383
+ this.setName(name10);
26384
26384
  }
26385
26385
  };
26386
26386
  inherits(ZipArchiveEntry, ArchiveEntry);
@@ -26477,15 +26477,15 @@ var require_zip_archive_entry = __commonJS({
26477
26477
  }
26478
26478
  this.method = method;
26479
26479
  };
26480
- ZipArchiveEntry.prototype.setName = function(name9, prependSlash = false) {
26481
- name9 = normalizePath(name9, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, "");
26480
+ ZipArchiveEntry.prototype.setName = function(name10, prependSlash = false) {
26481
+ name10 = normalizePath(name10, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, "");
26482
26482
  if (prependSlash) {
26483
- name9 = `/${name9}`;
26483
+ name10 = `/${name10}`;
26484
26484
  }
26485
- if (Buffer.byteLength(name9) !== name9.length) {
26485
+ if (Buffer.byteLength(name10) !== name10.length) {
26486
26486
  this.getGeneralPurposeBit().useUTF8ForNames(true);
26487
26487
  }
26488
- this.name = name9;
26488
+ this.name = name10;
26489
26489
  };
26490
26490
  ZipArchiveEntry.prototype.setPlatform = function(platform) {
26491
26491
  this.platform = platform;
@@ -26931,10 +26931,10 @@ var require_errors2 = __commonJS({
26931
26931
  return str.indexOf(search, start) !== -1;
26932
26932
  }
26933
26933
  }
26934
- createErrorType("ERR_INVALID_OPT_VALUE", function(name9, value) {
26935
- return 'The value "' + value + '" is invalid for option "' + name9 + '"';
26934
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name10, value) {
26935
+ return 'The value "' + value + '" is invalid for option "' + name10 + '"';
26936
26936
  }, TypeError);
26937
- createErrorType("ERR_INVALID_ARG_TYPE", function(name9, expected, actual) {
26937
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name10, expected, actual) {
26938
26938
  let determiner;
26939
26939
  if (typeof expected === "string" && startsWith(expected, "not ")) {
26940
26940
  determiner = "must not be";
@@ -26943,22 +26943,22 @@ var require_errors2 = __commonJS({
26943
26943
  determiner = "must be";
26944
26944
  }
26945
26945
  let msg;
26946
- if (endsWith(name9, " argument")) {
26947
- msg = `The ${name9} ${determiner} ${oneOf(expected, "type")}`;
26946
+ if (endsWith(name10, " argument")) {
26947
+ msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
26948
26948
  } else {
26949
- const type = includes(name9, ".") ? "property" : "argument";
26950
- msg = `The "${name9}" ${type} ${determiner} ${oneOf(expected, "type")}`;
26949
+ const type = includes(name10, ".") ? "property" : "argument";
26950
+ msg = `The "${name10}" ${type} ${determiner} ${oneOf(expected, "type")}`;
26951
26951
  }
26952
26952
  msg += `. Received type ${typeof actual}`;
26953
26953
  return msg;
26954
26954
  }, TypeError);
26955
26955
  createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
26956
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name9) {
26957
- return "The " + name9 + " method is not implemented";
26956
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name10) {
26957
+ return "The " + name10 + " method is not implemented";
26958
26958
  });
26959
26959
  createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
26960
- createErrorType("ERR_STREAM_DESTROYED", function(name9) {
26961
- return "Cannot call " + name9 + " after a stream was destroyed";
26960
+ createErrorType("ERR_STREAM_DESTROYED", function(name10) {
26961
+ return "Cannot call " + name10 + " after a stream was destroyed";
26962
26962
  });
26963
26963
  createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
26964
26964
  createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
@@ -26984,8 +26984,8 @@ var require_state2 = __commonJS({
26984
26984
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
26985
26985
  if (hwm != null) {
26986
26986
  if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
26987
- var name9 = isDuplex ? duplexKey : "highWaterMark";
26988
- throw new ERR_INVALID_OPT_VALUE(name9, hwm);
26987
+ var name10 = isDuplex ? duplexKey : "highWaterMark";
26988
+ throw new ERR_INVALID_OPT_VALUE(name10, hwm);
26989
26989
  }
26990
26990
  return Math.floor(hwm);
26991
26991
  }
@@ -30073,10 +30073,10 @@ var require_errors3 = __commonJS({
30073
30073
  return str.indexOf(search, start) !== -1;
30074
30074
  }
30075
30075
  }
30076
- createErrorType("ERR_INVALID_OPT_VALUE", function(name9, value) {
30077
- return 'The value "' + value + '" is invalid for option "' + name9 + '"';
30076
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name10, value) {
30077
+ return 'The value "' + value + '" is invalid for option "' + name10 + '"';
30078
30078
  }, TypeError);
30079
- createErrorType("ERR_INVALID_ARG_TYPE", function(name9, expected, actual) {
30079
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name10, expected, actual) {
30080
30080
  let determiner;
30081
30081
  if (typeof expected === "string" && startsWith(expected, "not ")) {
30082
30082
  determiner = "must not be";
@@ -30085,22 +30085,22 @@ var require_errors3 = __commonJS({
30085
30085
  determiner = "must be";
30086
30086
  }
30087
30087
  let msg;
30088
- if (endsWith(name9, " argument")) {
30089
- msg = `The ${name9} ${determiner} ${oneOf(expected, "type")}`;
30088
+ if (endsWith(name10, " argument")) {
30089
+ msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
30090
30090
  } else {
30091
- const type = includes(name9, ".") ? "property" : "argument";
30092
- msg = `The "${name9}" ${type} ${determiner} ${oneOf(expected, "type")}`;
30091
+ const type = includes(name10, ".") ? "property" : "argument";
30092
+ msg = `The "${name10}" ${type} ${determiner} ${oneOf(expected, "type")}`;
30093
30093
  }
30094
30094
  msg += `. Received type ${typeof actual}`;
30095
30095
  return msg;
30096
30096
  }, TypeError);
30097
30097
  createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
30098
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name9) {
30099
- return "The " + name9 + " method is not implemented";
30098
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name10) {
30099
+ return "The " + name10 + " method is not implemented";
30100
30100
  });
30101
30101
  createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
30102
- createErrorType("ERR_STREAM_DESTROYED", function(name9) {
30103
- return "Cannot call " + name9 + " after a stream was destroyed";
30102
+ createErrorType("ERR_STREAM_DESTROYED", function(name10) {
30103
+ return "Cannot call " + name10 + " after a stream was destroyed";
30104
30104
  });
30105
30105
  createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
30106
30106
  createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
@@ -30126,8 +30126,8 @@ var require_state3 = __commonJS({
30126
30126
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
30127
30127
  if (hwm != null) {
30128
30128
  if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
30129
- var name9 = isDuplex ? duplexKey : "highWaterMark";
30130
- throw new ERR_INVALID_OPT_VALUE(name9, hwm);
30129
+ var name10 = isDuplex ? duplexKey : "highWaterMark";
30130
+ throw new ERR_INVALID_OPT_VALUE(name10, hwm);
30131
30131
  }
30132
30132
  return Math.floor(hwm);
30133
30133
  }
@@ -32723,22 +32723,22 @@ var require_zip_archive_output_stream = __commonJS({
32723
32723
  };
32724
32724
  ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) {
32725
32725
  var deflate = ae.getMethod() === constants.METHOD_DEFLATED;
32726
- var process4 = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream();
32726
+ var process5 = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream();
32727
32727
  var error = null;
32728
32728
  function handleStuff() {
32729
- var digest = process4.digest().readUInt32BE(0);
32729
+ var digest = process5.digest().readUInt32BE(0);
32730
32730
  ae.setCrc(digest);
32731
- ae.setSize(process4.size());
32732
- ae.setCompressedSize(process4.size(true));
32731
+ ae.setSize(process5.size());
32732
+ ae.setCompressedSize(process5.size(true));
32733
32733
  this._afterAppend(ae);
32734
32734
  callback(error, ae);
32735
32735
  }
32736
- process4.once("end", handleStuff.bind(this));
32737
- process4.once("error", function(err) {
32736
+ process5.once("end", handleStuff.bind(this));
32737
+ process5.once("error", function(err) {
32738
32738
  error = err;
32739
32739
  });
32740
- process4.pipe(this, { end: false });
32741
- return process4;
32740
+ process5.pipe(this, { end: false });
32741
+ return process5;
32742
32742
  };
32743
32743
  ZipArchiveOutputStream.prototype._writeCentralDirectoryEnd = function() {
32744
32744
  var records = this._entries.length;
@@ -32805,14 +32805,14 @@ var require_zip_archive_output_stream = __commonJS({
32805
32805
  this.write(zipUtil.getLongBytes(ae.getCrc()));
32806
32806
  this.write(zipUtil.getLongBytes(compressedSize));
32807
32807
  this.write(zipUtil.getLongBytes(size));
32808
- var name9 = ae.getName();
32808
+ var name10 = ae.getName();
32809
32809
  var comment = ae.getComment();
32810
32810
  var extra = ae.getCentralDirectoryExtra();
32811
32811
  if (gpb.usesUTF8ForNames()) {
32812
- name9 = Buffer.from(name9);
32812
+ name10 = Buffer.from(name10);
32813
32813
  comment = Buffer.from(comment);
32814
32814
  }
32815
- this.write(zipUtil.getShortBytes(name9.length));
32815
+ this.write(zipUtil.getShortBytes(name10.length));
32816
32816
  this.write(zipUtil.getShortBytes(extra.length));
32817
32817
  this.write(zipUtil.getShortBytes(comment.length));
32818
32818
  this.write(constants.SHORT_ZERO);
@@ -32823,7 +32823,7 @@ var require_zip_archive_output_stream = __commonJS({
32823
32823
  } else {
32824
32824
  this.write(zipUtil.getLongBytes(offsets.file));
32825
32825
  }
32826
- this.write(name9);
32826
+ this.write(name10);
32827
32827
  this.write(extra);
32828
32828
  this.write(comment);
32829
32829
  };
@@ -32841,14 +32841,14 @@ var require_zip_archive_output_stream = __commonJS({
32841
32841
  ZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) {
32842
32842
  var gpb = ae.getGeneralPurposeBit();
32843
32843
  var method = ae.getMethod();
32844
- var name9 = ae.getName();
32844
+ var name10 = ae.getName();
32845
32845
  var extra = ae.getLocalFileDataExtra();
32846
32846
  if (ae.isZip64()) {
32847
32847
  gpb.useDataDescriptor(true);
32848
32848
  ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64);
32849
32849
  }
32850
32850
  if (gpb.usesUTF8ForNames()) {
32851
- name9 = Buffer.from(name9);
32851
+ name10 = Buffer.from(name10);
32852
32852
  }
32853
32853
  ae._offsets.file = this.offset;
32854
32854
  this.write(zipUtil.getLongBytes(constants.SIG_LFH));
@@ -32866,9 +32866,9 @@ var require_zip_archive_output_stream = __commonJS({
32866
32866
  this.write(zipUtil.getLongBytes(ae.getCompressedSize()));
32867
32867
  this.write(zipUtil.getLongBytes(ae.getSize()));
32868
32868
  }
32869
- this.write(zipUtil.getShortBytes(name9.length));
32869
+ this.write(zipUtil.getShortBytes(name10.length));
32870
32870
  this.write(zipUtil.getShortBytes(extra.length));
32871
- this.write(name9);
32871
+ this.write(name10);
32872
32872
  this.write(extra);
32873
32873
  ae._offsets.contents = this.offset;
32874
32874
  };
@@ -33445,10 +33445,10 @@ var require_errors4 = __commonJS({
33445
33445
  return str.indexOf(search, start) !== -1;
33446
33446
  }
33447
33447
  }
33448
- createErrorType("ERR_INVALID_OPT_VALUE", function(name9, value) {
33449
- return 'The value "' + value + '" is invalid for option "' + name9 + '"';
33448
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name10, value) {
33449
+ return 'The value "' + value + '" is invalid for option "' + name10 + '"';
33450
33450
  }, TypeError);
33451
- createErrorType("ERR_INVALID_ARG_TYPE", function(name9, expected, actual) {
33451
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name10, expected, actual) {
33452
33452
  let determiner;
33453
33453
  if (typeof expected === "string" && startsWith(expected, "not ")) {
33454
33454
  determiner = "must not be";
@@ -33457,22 +33457,22 @@ var require_errors4 = __commonJS({
33457
33457
  determiner = "must be";
33458
33458
  }
33459
33459
  let msg;
33460
- if (endsWith(name9, " argument")) {
33461
- msg = `The ${name9} ${determiner} ${oneOf(expected, "type")}`;
33460
+ if (endsWith(name10, " argument")) {
33461
+ msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
33462
33462
  } else {
33463
- const type = includes(name9, ".") ? "property" : "argument";
33464
- msg = `The "${name9}" ${type} ${determiner} ${oneOf(expected, "type")}`;
33463
+ const type = includes(name10, ".") ? "property" : "argument";
33464
+ msg = `The "${name10}" ${type} ${determiner} ${oneOf(expected, "type")}`;
33465
33465
  }
33466
33466
  msg += `. Received type ${typeof actual}`;
33467
33467
  return msg;
33468
33468
  }, TypeError);
33469
33469
  createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
33470
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name9) {
33471
- return "The " + name9 + " method is not implemented";
33470
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name10) {
33471
+ return "The " + name10 + " method is not implemented";
33472
33472
  });
33473
33473
  createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
33474
- createErrorType("ERR_STREAM_DESTROYED", function(name9) {
33475
- return "Cannot call " + name9 + " after a stream was destroyed";
33474
+ createErrorType("ERR_STREAM_DESTROYED", function(name10) {
33475
+ return "Cannot call " + name10 + " after a stream was destroyed";
33476
33476
  });
33477
33477
  createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
33478
33478
  createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
@@ -33498,8 +33498,8 @@ var require_state4 = __commonJS({
33498
33498
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
33499
33499
  if (hwm != null) {
33500
33500
  if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
33501
- var name9 = isDuplex ? duplexKey : "highWaterMark";
33502
- throw new ERR_INVALID_OPT_VALUE(name9, hwm);
33501
+ var name10 = isDuplex ? duplexKey : "highWaterMark";
33502
+ throw new ERR_INVALID_OPT_VALUE(name10, hwm);
33503
33503
  }
33504
33504
  return Math.floor(hwm);
33505
33505
  }
@@ -36326,24 +36326,24 @@ var require_headers = __commonJS({
36326
36326
  };
36327
36327
  exports.encode = function(opts) {
36328
36328
  var buf = alloc(512);
36329
- var name9 = opts.name;
36329
+ var name10 = opts.name;
36330
36330
  var prefix = "";
36331
- if (opts.typeflag === 5 && name9[name9.length - 1] !== "/")
36332
- name9 += "/";
36333
- if (Buffer.byteLength(name9) !== name9.length)
36331
+ if (opts.typeflag === 5 && name10[name10.length - 1] !== "/")
36332
+ name10 += "/";
36333
+ if (Buffer.byteLength(name10) !== name10.length)
36334
36334
  return null;
36335
- while (Buffer.byteLength(name9) > 100) {
36336
- var i = name9.indexOf("/");
36335
+ while (Buffer.byteLength(name10) > 100) {
36336
+ var i = name10.indexOf("/");
36337
36337
  if (i === -1)
36338
36338
  return null;
36339
- prefix += prefix ? "/" + name9.slice(0, i) : name9.slice(0, i);
36340
- name9 = name9.slice(i + 1);
36339
+ prefix += prefix ? "/" + name10.slice(0, i) : name10.slice(0, i);
36340
+ name10 = name10.slice(i + 1);
36341
36341
  }
36342
- if (Buffer.byteLength(name9) > 100 || Buffer.byteLength(prefix) > 155)
36342
+ if (Buffer.byteLength(name10) > 100 || Buffer.byteLength(prefix) > 155)
36343
36343
  return null;
36344
36344
  if (opts.linkname && Buffer.byteLength(opts.linkname) > 100)
36345
36345
  return null;
36346
- buf.write(name9);
36346
+ buf.write(name10);
36347
36347
  buf.write(encodeOct(opts.mode & MASK, 6), 100);
36348
36348
  buf.write(encodeOct(opts.uid, 6), 108);
36349
36349
  buf.write(encodeOct(opts.gid, 6), 116);
@@ -36367,7 +36367,7 @@ var require_headers = __commonJS({
36367
36367
  };
36368
36368
  exports.decode = function(buf, filenameEncoding, allowUnknownFormat) {
36369
36369
  var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET;
36370
- var name9 = decodeStr(buf, 0, 100, filenameEncoding);
36370
+ var name10 = decodeStr(buf, 0, 100, filenameEncoding);
36371
36371
  var mode = decodeOct(buf, 100, 8);
36372
36372
  var uid = decodeOct(buf, 108, 8);
36373
36373
  var gid = decodeOct(buf, 116, 8);
@@ -36386,17 +36386,17 @@ var require_headers = __commonJS({
36386
36386
  throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");
36387
36387
  if (USTAR_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0) {
36388
36388
  if (buf[345])
36389
- name9 = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name9;
36389
+ name10 = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name10;
36390
36390
  } else if (GNU_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0 && GNU_VER.compare(buf, VERSION_OFFSET, VERSION_OFFSET + 2) === 0) {
36391
36391
  } else {
36392
36392
  if (!allowUnknownFormat) {
36393
36393
  throw new Error("Invalid tar header: unknown format.");
36394
36394
  }
36395
36395
  }
36396
- if (typeflag === 0 && name9 && name9[name9.length - 1] === "/")
36396
+ if (typeflag === 0 && name10 && name10[name10.length - 1] === "/")
36397
36397
  typeflag = 5;
36398
36398
  return {
36399
- name: name9,
36399
+ name: name10,
36400
36400
  mode,
36401
36401
  uid,
36402
36402
  gid,
@@ -36819,10 +36819,10 @@ var require_errors5 = __commonJS({
36819
36819
  return str.indexOf(search, start) !== -1;
36820
36820
  }
36821
36821
  }
36822
- createErrorType("ERR_INVALID_OPT_VALUE", function(name9, value) {
36823
- return 'The value "' + value + '" is invalid for option "' + name9 + '"';
36822
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name10, value) {
36823
+ return 'The value "' + value + '" is invalid for option "' + name10 + '"';
36824
36824
  }, TypeError);
36825
- createErrorType("ERR_INVALID_ARG_TYPE", function(name9, expected, actual) {
36825
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name10, expected, actual) {
36826
36826
  let determiner;
36827
36827
  if (typeof expected === "string" && startsWith(expected, "not ")) {
36828
36828
  determiner = "must not be";
@@ -36831,22 +36831,22 @@ var require_errors5 = __commonJS({
36831
36831
  determiner = "must be";
36832
36832
  }
36833
36833
  let msg;
36834
- if (endsWith(name9, " argument")) {
36835
- msg = `The ${name9} ${determiner} ${oneOf(expected, "type")}`;
36834
+ if (endsWith(name10, " argument")) {
36835
+ msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
36836
36836
  } else {
36837
- const type = includes(name9, ".") ? "property" : "argument";
36838
- msg = `The "${name9}" ${type} ${determiner} ${oneOf(expected, "type")}`;
36837
+ const type = includes(name10, ".") ? "property" : "argument";
36838
+ msg = `The "${name10}" ${type} ${determiner} ${oneOf(expected, "type")}`;
36839
36839
  }
36840
36840
  msg += `. Received type ${typeof actual}`;
36841
36841
  return msg;
36842
36842
  }, TypeError);
36843
36843
  createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
36844
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name9) {
36845
- return "The " + name9 + " method is not implemented";
36844
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name10) {
36845
+ return "The " + name10 + " method is not implemented";
36846
36846
  });
36847
36847
  createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
36848
- createErrorType("ERR_STREAM_DESTROYED", function(name9) {
36849
- return "Cannot call " + name9 + " after a stream was destroyed";
36848
+ createErrorType("ERR_STREAM_DESTROYED", function(name10) {
36849
+ return "Cannot call " + name10 + " after a stream was destroyed";
36850
36850
  });
36851
36851
  createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
36852
36852
  createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
@@ -36872,8 +36872,8 @@ var require_state5 = __commonJS({
36872
36872
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
36873
36873
  if (hwm != null) {
36874
36874
  if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
36875
- var name9 = isDuplex ? duplexKey : "highWaterMark";
36876
- throw new ERR_INVALID_OPT_VALUE(name9, hwm);
36875
+ var name10 = isDuplex ? duplexKey : "highWaterMark";
36876
+ throw new ERR_INVALID_OPT_VALUE(name10, hwm);
36877
36877
  }
36878
36878
  return Math.floor(hwm);
36879
36879
  }
@@ -40670,7 +40670,7 @@ var require_utils = __commonJS({
40670
40670
  }
40671
40671
  return result;
40672
40672
  };
40673
- exports.prepareContent = function(name9, inputData, isBinary, isOptimizedBinaryString, isBase64) {
40673
+ exports.prepareContent = function(name10, inputData, isBinary, isOptimizedBinaryString, isBase64) {
40674
40674
  var promise = external.Promise.resolve(inputData).then(function(data) {
40675
40675
  var isBlob2 = support.blob && (data instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data)) !== -1);
40676
40676
  if (isBlob2 && typeof FileReader !== "undefined") {
@@ -40691,7 +40691,7 @@ var require_utils = __commonJS({
40691
40691
  return promise.then(function(data) {
40692
40692
  var dataType = exports.getTypeOf(data);
40693
40693
  if (!dataType) {
40694
- return external.Promise.reject(new Error("Can't read the data of '" + name9 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
40694
+ return external.Promise.reject(new Error("Can't read the data of '" + name10 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
40695
40695
  }
40696
40696
  if (dataType === "arraybuffer") {
40697
40697
  data = exports.transformTo("uint8array", data);
@@ -40714,8 +40714,8 @@ var require_utils = __commonJS({
40714
40714
  var require_GenericWorker = __commonJS({
40715
40715
  "../../node_modules/jszip/lib/stream/GenericWorker.js"(exports, module2) {
40716
40716
  "use strict";
40717
- function GenericWorker(name9) {
40718
- this.name = name9 || "default";
40717
+ function GenericWorker(name10) {
40718
+ this.name = name10 || "default";
40719
40719
  this.streamInfo = {};
40720
40720
  this.generatedError = null;
40721
40721
  this.extraStreamInfo = {};
@@ -40763,18 +40763,18 @@ var require_GenericWorker = __commonJS({
40763
40763
  }
40764
40764
  return true;
40765
40765
  },
40766
- on: function(name9, listener) {
40767
- this._listeners[name9].push(listener);
40766
+ on: function(name10, listener) {
40767
+ this._listeners[name10].push(listener);
40768
40768
  return this;
40769
40769
  },
40770
40770
  cleanUp: function() {
40771
40771
  this.streamInfo = this.generatedError = this.extraStreamInfo = null;
40772
40772
  this._listeners = [];
40773
40773
  },
40774
- emit: function(name9, arg) {
40775
- if (this._listeners[name9]) {
40776
- for (var i = 0; i < this._listeners[name9].length; i++) {
40777
- this._listeners[name9][i].call(this, arg);
40774
+ emit: function(name10, arg) {
40775
+ if (this._listeners[name10]) {
40776
+ for (var i = 0; i < this._listeners[name10].length; i++) {
40777
+ this._listeners[name10][i].call(this, arg);
40778
40778
  }
40779
40779
  }
40780
40780
  },
@@ -41483,8 +41483,8 @@ var require_zipObject = __commonJS({
41483
41483
  var utf8 = require_utf8();
41484
41484
  var CompressedObject = require_compressedObject();
41485
41485
  var GenericWorker = require_GenericWorker();
41486
- var ZipObject = function(name9, data, options) {
41487
- this.name = name9;
41486
+ var ZipObject = function(name10, data, options) {
41487
+ this.name = name10;
41488
41488
  this.dir = options.dir;
41489
41489
  this.date = options.date;
41490
41490
  this.comment = options.comment;
@@ -46116,7 +46116,7 @@ var require_object = __commonJS({
46116
46116
  var generate = require_generate();
46117
46117
  var nodejsUtils = require_nodejsUtils();
46118
46118
  var NodejsStreamInputAdapter = require_NodejsStreamInputAdapter();
46119
- var fileAdd = function(name9, data, originalOptions) {
46119
+ var fileAdd = function(name10, data, originalOptions) {
46120
46120
  var dataType = utils.getTypeOf(data), parent;
46121
46121
  var o = utils.extend(originalOptions || {}, defaults);
46122
46122
  o.date = o.date || new Date();
@@ -46133,9 +46133,9 @@ var require_object = __commonJS({
46133
46133
  o.dir = true;
46134
46134
  }
46135
46135
  if (o.dir) {
46136
- name9 = forceTrailingSlash(name9);
46136
+ name10 = forceTrailingSlash(name10);
46137
46137
  }
46138
- if (o.createFolders && (parent = parentFolder(name9))) {
46138
+ if (o.createFolders && (parent = parentFolder(name10))) {
46139
46139
  folderAdd.call(this, parent, true);
46140
46140
  }
46141
46141
  var isUnicodeString = dataType === "string" && o.binary === false && o.base64 === false;
@@ -46154,12 +46154,12 @@ var require_object = __commonJS({
46154
46154
  if (data instanceof CompressedObject || data instanceof GenericWorker) {
46155
46155
  zipObjectContent = data;
46156
46156
  } else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {
46157
- zipObjectContent = new NodejsStreamInputAdapter(name9, data);
46157
+ zipObjectContent = new NodejsStreamInputAdapter(name10, data);
46158
46158
  } else {
46159
- zipObjectContent = utils.prepareContent(name9, data, o.binary, o.optimizedBinaryString, o.base64);
46159
+ zipObjectContent = utils.prepareContent(name10, data, o.binary, o.optimizedBinaryString, o.base64);
46160
46160
  }
46161
- var object = new ZipObject(name9, zipObjectContent, o);
46162
- this.files[name9] = object;
46161
+ var object = new ZipObject(name10, zipObjectContent, o);
46162
+ this.files[name10] = object;
46163
46163
  };
46164
46164
  var parentFolder = function(path2) {
46165
46165
  if (path2.slice(-1) === "/") {
@@ -46174,16 +46174,16 @@ var require_object = __commonJS({
46174
46174
  }
46175
46175
  return path2;
46176
46176
  };
46177
- var folderAdd = function(name9, createFolders) {
46177
+ var folderAdd = function(name10, createFolders) {
46178
46178
  createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
46179
- name9 = forceTrailingSlash(name9);
46180
- if (!this.files[name9]) {
46181
- fileAdd.call(this, name9, null, {
46179
+ name10 = forceTrailingSlash(name10);
46180
+ if (!this.files[name10]) {
46181
+ fileAdd.call(this, name10, null, {
46182
46182
  dir: true,
46183
46183
  createFolders
46184
46184
  });
46185
46185
  }
46186
- return this.files[name9];
46186
+ return this.files[name10];
46187
46187
  };
46188
46188
  function isRegExp(object) {
46189
46189
  return Object.prototype.toString.call(object) === "[object RegExp]";
@@ -46211,15 +46211,15 @@ var require_object = __commonJS({
46211
46211
  });
46212
46212
  return result;
46213
46213
  },
46214
- file: function(name9, data, o) {
46214
+ file: function(name10, data, o) {
46215
46215
  if (arguments.length === 1) {
46216
- if (isRegExp(name9)) {
46217
- var regexp = name9;
46216
+ if (isRegExp(name10)) {
46217
+ var regexp = name10;
46218
46218
  return this.filter(function(relativePath, file) {
46219
46219
  return !file.dir && regexp.test(relativePath);
46220
46220
  });
46221
46221
  } else {
46222
- var obj = this.files[this.root + name9];
46222
+ var obj = this.files[this.root + name10];
46223
46223
  if (obj && !obj.dir) {
46224
46224
  return obj;
46225
46225
  } else {
@@ -46227,8 +46227,8 @@ var require_object = __commonJS({
46227
46227
  }
46228
46228
  }
46229
46229
  } else {
46230
- name9 = this.root + name9;
46231
- fileAdd.call(this, name9, data, o);
46230
+ name10 = this.root + name10;
46231
+ fileAdd.call(this, name10, data, o);
46232
46232
  }
46233
46233
  return this;
46234
46234
  },
@@ -46241,26 +46241,26 @@ var require_object = __commonJS({
46241
46241
  return file.dir && arg.test(relativePath);
46242
46242
  });
46243
46243
  }
46244
- var name9 = this.root + arg;
46245
- var newFolder = folderAdd.call(this, name9);
46244
+ var name10 = this.root + arg;
46245
+ var newFolder = folderAdd.call(this, name10);
46246
46246
  var ret = this.clone();
46247
46247
  ret.root = newFolder.name;
46248
46248
  return ret;
46249
46249
  },
46250
- remove: function(name9) {
46251
- name9 = this.root + name9;
46252
- var file = this.files[name9];
46250
+ remove: function(name10) {
46251
+ name10 = this.root + name10;
46252
+ var file = this.files[name10];
46253
46253
  if (!file) {
46254
- if (name9.slice(-1) !== "/") {
46255
- name9 += "/";
46254
+ if (name10.slice(-1) !== "/") {
46255
+ name10 += "/";
46256
46256
  }
46257
- file = this.files[name9];
46257
+ file = this.files[name10];
46258
46258
  }
46259
46259
  if (file && !file.dir) {
46260
- delete this.files[name9];
46260
+ delete this.files[name10];
46261
46261
  } else {
46262
46262
  var kids = this.filter(function(relativePath, file2) {
46263
- return file2.name.slice(0, name9.length) === name9;
46263
+ return file2.name.slice(0, name10.length) === name10;
46264
46264
  });
46265
46265
  for (var i = 0; i < kids.length; i++) {
46266
46266
  delete this.files[kids[i].name];
@@ -47303,9 +47303,9 @@ var require_runtime = __commonJS({
47303
47303
  this.arg = undefined2;
47304
47304
  this.tryEntries.forEach(resetTryEntry);
47305
47305
  if (!skipTempReset) {
47306
- for (var name9 in this) {
47307
- if (name9.charAt(0) === "t" && hasOwn.call(this, name9) && !isNaN(+name9.slice(1))) {
47308
- this[name9] = undefined2;
47306
+ for (var name10 in this) {
47307
+ if (name10.charAt(0) === "t" && hasOwn.call(this, name10) && !isNaN(+name10.slice(1))) {
47308
+ this[name10] = undefined2;
47309
47309
  }
47310
47310
  }
47311
47311
  }
@@ -48375,12 +48375,12 @@ var require_polyfill_vertex_array_object = __commonJS({
48375
48375
  return list;
48376
48376
  };
48377
48377
  var original_getExtension = gl.getExtension;
48378
- gl.getExtension = function getExtension(name9) {
48379
- var ext = original_getExtension.call(this, name9);
48378
+ gl.getExtension = function getExtension(name10) {
48379
+ var ext = original_getExtension.call(this, name10);
48380
48380
  if (ext) {
48381
48381
  return ext;
48382
48382
  }
48383
- if (name9 !== "OES_vertex_array_object") {
48383
+ if (name10 !== "OES_vertex_array_object") {
48384
48384
  return null;
48385
48385
  }
48386
48386
  if (!gl.__OESVertexArrayObject) {
@@ -49841,13 +49841,13 @@ var require_init3 = __commonJS({
49841
49841
  }
49842
49842
  (0, _createClass2.default)(StatsManager2, [{
49843
49843
  key: "get",
49844
- value: function get(name9) {
49845
- if (!this.stats.has(name9)) {
49846
- this.stats.set(name9, new _probe.Stats({
49847
- id: name9
49844
+ value: function get(name10) {
49845
+ if (!this.stats.has(name10)) {
49846
+ this.stats.set(name10, new _probe.Stats({
49847
+ id: name10
49848
49848
  }));
49849
49849
  }
49850
- return this.stats.get(name9);
49850
+ return this.stats.get(name10);
49851
49851
  }
49852
49852
  }]);
49853
49853
  return StatsManager2;
@@ -50239,17 +50239,17 @@ var require_constants_to_keys = __commonJS({
50239
50239
  exports.getKey = getKey;
50240
50240
  exports.getKeyType = getKeyType;
50241
50241
  var _utils = require_utils4();
50242
- function getKeyValue(gl, name9) {
50243
- if (typeof name9 !== "string") {
50244
- return name9;
50242
+ function getKeyValue(gl, name10) {
50243
+ if (typeof name10 !== "string") {
50244
+ return name10;
50245
50245
  }
50246
- var number = Number(name9);
50246
+ var number = Number(name10);
50247
50247
  if (!isNaN(number)) {
50248
50248
  return number;
50249
50249
  }
50250
- name9 = name9.replace(/^.*\./, "");
50251
- var value = gl[name9];
50252
- (0, _utils.assert)(value !== void 0, "Accessing undefined constant GL.".concat(name9));
50250
+ name10 = name10.replace(/^.*\./, "");
50251
+ var value = gl[name10];
50252
+ (0, _utils.assert)(value !== void 0, "Accessing undefined constant GL.".concat(name10));
50253
50253
  return value;
50254
50254
  }
50255
50255
  function getKey(gl, value) {
@@ -50614,35 +50614,35 @@ var require_resource = __commonJS({
50614
50614
  }, {
50615
50615
  key: "_addStats",
50616
50616
  value: function _addStats() {
50617
- var name9 = this.constructor.name;
50617
+ var name10 = this.constructor.name;
50618
50618
  var stats = _init.lumaStats.get("Resource Counts");
50619
50619
  stats.get("Resources Created").incrementCount();
50620
- stats.get("".concat(name9, "s Created")).incrementCount();
50621
- stats.get("".concat(name9, "s Active")).incrementCount();
50620
+ stats.get("".concat(name10, "s Created")).incrementCount();
50621
+ stats.get("".concat(name10, "s Active")).incrementCount();
50622
50622
  }
50623
50623
  }, {
50624
50624
  key: "_removeStats",
50625
50625
  value: function _removeStats() {
50626
- var name9 = this.constructor.name;
50626
+ var name10 = this.constructor.name;
50627
50627
  var stats = _init.lumaStats.get("Resource Counts");
50628
- stats.get("".concat(name9, "s Active")).decrementCount();
50628
+ stats.get("".concat(name10, "s Active")).decrementCount();
50629
50629
  }
50630
50630
  }, {
50631
50631
  key: "_trackAllocatedMemory",
50632
50632
  value: function _trackAllocatedMemory(bytes) {
50633
- var name9 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.constructor.name;
50633
+ var name10 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.constructor.name;
50634
50634
  var stats = _init.lumaStats.get("Memory Usage");
50635
50635
  stats.get("GPU Memory").addCount(bytes);
50636
- stats.get("".concat(name9, " Memory")).addCount(bytes);
50636
+ stats.get("".concat(name10, " Memory")).addCount(bytes);
50637
50637
  this.byteLength = bytes;
50638
50638
  }
50639
50639
  }, {
50640
50640
  key: "_trackDeallocatedMemory",
50641
50641
  value: function _trackDeallocatedMemory() {
50642
- var name9 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.constructor.name;
50642
+ var name10 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.constructor.name;
50643
50643
  var stats = _init.lumaStats.get("Memory Usage");
50644
50644
  stats.get("GPU Memory").subtractCount(this.byteLength);
50645
- stats.get("".concat(name9, " Memory")).subtractCount(this.byteLength);
50645
+ stats.get("".concat(name10, " Memory")).subtractCount(this.byteLength);
50646
50646
  this.byteLength = 0;
50647
50647
  }
50648
50648
  }, {
@@ -54395,8 +54395,8 @@ var require_format_glsl_error = __commonJS({
54395
54395
  var errorStrings = errLog.split(/\r?\n/);
54396
54396
  var errors = {};
54397
54397
  var warnings = {};
54398
- var name9 = shaderName || (0, _getShaderName.default)(src) || "(unnamed)";
54399
- var shaderDescription = "".concat((0, _getShaderTypeName.default)(shaderType), " shader ").concat(name9);
54398
+ var name10 = shaderName || (0, _getShaderName.default)(src) || "(unnamed)";
54399
+ var shaderDescription = "".concat((0, _getShaderTypeName.default)(shaderType), " shader ").concat(name10);
54400
54400
  for (var i = 0; i < errorStrings.length; i++) {
54401
54401
  var errorString = errorStrings[i];
54402
54402
  if (errorString.length <= 1) {
@@ -54794,18 +54794,18 @@ var require_uniforms = __commonJS({
54794
54794
  }
54795
54795
  return setter().bind(null, gl, location);
54796
54796
  }
54797
- function parseUniformName(name9) {
54798
- if (name9[name9.length - 1] !== "]") {
54797
+ function parseUniformName(name10) {
54798
+ if (name10[name10.length - 1] !== "]") {
54799
54799
  return {
54800
- name: name9,
54800
+ name: name10,
54801
54801
  length: 1,
54802
54802
  isArray: false
54803
54803
  };
54804
54804
  }
54805
54805
  var UNIFORM_NAME_REGEXP = /([^[]*)(\[[0-9]+\])?/;
54806
- var matches3 = name9.match(UNIFORM_NAME_REGEXP);
54806
+ var matches3 = name10.match(UNIFORM_NAME_REGEXP);
54807
54807
  if (!matches3 || matches3.length < 2) {
54808
- throw new Error("Failed to parse GLSL uniform name ".concat(name9));
54808
+ throw new Error("Failed to parse GLSL uniform name ".concat(name10));
54809
54809
  }
54810
54810
  return {
54811
54811
  name: matches3[1],
@@ -55050,11 +55050,11 @@ var require_attribute_utils = __commonJS({
55050
55050
  default:
55051
55051
  }
55052
55052
  for (var glType in COMPOSITE_GL_TYPES) {
55053
- var _COMPOSITE_GL_TYPES$g = (0, _slicedToArray2.default)(COMPOSITE_GL_TYPES[glType], 3), compType = _COMPOSITE_GL_TYPES$g[0], compComponents = _COMPOSITE_GL_TYPES$g[1], name9 = _COMPOSITE_GL_TYPES$g[2];
55053
+ var _COMPOSITE_GL_TYPES$g = (0, _slicedToArray2.default)(COMPOSITE_GL_TYPES[glType], 3), compType = _COMPOSITE_GL_TYPES$g[0], compComponents = _COMPOSITE_GL_TYPES$g[1], name10 = _COMPOSITE_GL_TYPES$g[2];
55054
55054
  if (compType === type && compComponents === components) {
55055
55055
  return {
55056
55056
  glType,
55057
- name: name9
55057
+ name: name10
55058
55058
  };
55059
55059
  }
55060
55060
  }
@@ -55138,10 +55138,10 @@ var require_program_configuration = __commonJS({
55138
55138
  var gl = program.gl;
55139
55139
  var count = gl.getProgramParameter(program.handle, 35721);
55140
55140
  for (var index = 0; index < count; index++) {
55141
- var _gl$getActiveAttrib = gl.getActiveAttrib(program.handle, index), name9 = _gl$getActiveAttrib.name, type = _gl$getActiveAttrib.type, size = _gl$getActiveAttrib.size;
55142
- var location = gl.getAttribLocation(program.handle, name9);
55141
+ var _gl$getActiveAttrib = gl.getActiveAttrib(program.handle, index), name10 = _gl$getActiveAttrib.name, type = _gl$getActiveAttrib.type, size = _gl$getActiveAttrib.size;
55142
+ var location = gl.getAttribLocation(program.handle, name10);
55143
55143
  if (location >= 0) {
55144
- this._addAttribute(location, name9, type, size);
55144
+ this._addAttribute(location, name10, type, size);
55145
55145
  }
55146
55146
  }
55147
55147
  this.attributeInfos.sort(function(a, b) {
@@ -55157,8 +55157,8 @@ var require_program_configuration = __commonJS({
55157
55157
  }
55158
55158
  var count = gl.getProgramParameter(program.handle, 35971);
55159
55159
  for (var location = 0; location < count; location++) {
55160
- var _gl$getTransformFeedb = gl.getTransformFeedbackVarying(program.handle, location), name9 = _gl$getTransformFeedb.name, type = _gl$getTransformFeedb.type, size = _gl$getTransformFeedb.size;
55161
- this._addVarying(location, name9, type, size);
55160
+ var _gl$getTransformFeedb = gl.getTransformFeedbackVarying(program.handle, location), name10 = _gl$getTransformFeedb.name, type = _gl$getTransformFeedb.type, size = _gl$getTransformFeedb.size;
55161
+ this._addVarying(location, name10, type, size);
55162
55162
  }
55163
55163
  this.varyingInfos.sort(function(a, b) {
55164
55164
  return a.location - b.location;
@@ -55166,16 +55166,16 @@ var require_program_configuration = __commonJS({
55166
55166
  }
55167
55167
  }, {
55168
55168
  key: "_addAttribute",
55169
- value: function _addAttribute(location, name9, compositeType, size) {
55169
+ value: function _addAttribute(location, name10, compositeType, size) {
55170
55170
  var _decomposeCompositeGL = (0, _attributeUtils.decomposeCompositeGLType)(compositeType), type = _decomposeCompositeGL.type, components = _decomposeCompositeGL.components;
55171
55171
  var accessor = {
55172
55172
  type,
55173
55173
  size: size * components
55174
55174
  };
55175
- this._inferProperties(location, name9, accessor);
55175
+ this._inferProperties(location, name10, accessor);
55176
55176
  var attributeInfo = {
55177
55177
  location,
55178
- name: name9,
55178
+ name: name10,
55179
55179
  accessor: new _accessor.default(accessor)
55180
55180
  };
55181
55181
  this.attributeInfos.push(attributeInfo);
@@ -55184,14 +55184,14 @@ var require_program_configuration = __commonJS({
55184
55184
  }
55185
55185
  }, {
55186
55186
  key: "_inferProperties",
55187
- value: function _inferProperties(location, name9, accessor) {
55188
- if (/instance/i.test(name9)) {
55187
+ value: function _inferProperties(location, name10, accessor) {
55188
+ if (/instance/i.test(name10)) {
55189
55189
  accessor.divisor = 1;
55190
55190
  }
55191
55191
  }
55192
55192
  }, {
55193
55193
  key: "_addVarying",
55194
- value: function _addVarying(location, name9, compositeType, size) {
55194
+ value: function _addVarying(location, name10, compositeType, size) {
55195
55195
  var _decomposeCompositeGL2 = (0, _attributeUtils.decomposeCompositeGLType)(compositeType), type = _decomposeCompositeGL2.type, components = _decomposeCompositeGL2.components;
55196
55196
  var accessor = new _accessor.default({
55197
55197
  type,
@@ -55199,7 +55199,7 @@ var require_program_configuration = __commonJS({
55199
55199
  });
55200
55200
  var varying = {
55201
55201
  location,
55202
- name: name9,
55202
+ name: name10,
55203
55203
  accessor
55204
55204
  };
55205
55205
  this.varyingInfos.push(varying);
@@ -55589,13 +55589,13 @@ var require_program = __commonJS({
55589
55589
  this._uniformCount = this._getParameter(35718);
55590
55590
  for (var i = 0; i < this._uniformCount; i++) {
55591
55591
  var info = this.gl.getActiveUniform(this.handle, i);
55592
- var _parseUniformName = (0, _uniforms.parseUniformName)(info.name), name9 = _parseUniformName.name;
55593
- var location = gl.getUniformLocation(this.handle, name9);
55594
- this._uniformSetters[name9] = (0, _uniforms.getUniformSetter)(gl, location, info);
55592
+ var _parseUniformName = (0, _uniforms.parseUniformName)(info.name), name10 = _parseUniformName.name;
55593
+ var location = gl.getUniformLocation(this.handle, name10);
55594
+ this._uniformSetters[name10] = (0, _uniforms.getUniformSetter)(gl, location, info);
55595
55595
  if (info.size > 1) {
55596
55596
  for (var l = 0; l < info.size; l++) {
55597
- location = gl.getUniformLocation(this.handle, "".concat(name9, "[").concat(l, "]"));
55598
- this._uniformSetters["".concat(name9, "[").concat(l, "]")] = (0, _uniforms.getUniformSetter)(gl, location, info);
55597
+ location = gl.getUniformLocation(this.handle, "".concat(name10, "[").concat(l, "]"));
55598
+ this._uniformSetters["".concat(name10, "[").concat(l, "]")] = (0, _uniforms.getUniformSetter)(gl, location, info);
55599
55599
  }
55600
55600
  }
55601
55601
  }
@@ -56727,7 +56727,7 @@ var require_vertex_array = __commonJS({
56727
56727
  location: -1,
56728
56728
  accessor: null
56729
56729
  };
56730
- var _this$_getAttributeIn = this._getAttributeIndex(locationOrName), location = _this$_getAttributeIn.location, name9 = _this$_getAttributeIn.name;
56730
+ var _this$_getAttributeIn = this._getAttributeIndex(locationOrName), location = _this$_getAttributeIn.location, name10 = _this$_getAttributeIn.name;
56731
56731
  if (!Number.isFinite(location) || location < 0) {
56732
56732
  this.unused[locationOrName] = value;
56733
56733
  _gltools.log.once(3, function() {
@@ -56735,7 +56735,7 @@ var require_vertex_array = __commonJS({
56735
56735
  })();
56736
56736
  return INVALID_RESULT;
56737
56737
  }
56738
- var accessInfo = this._getAttributeInfo(name9 || location);
56738
+ var accessInfo = this._getAttributeInfo(name10 || location);
56739
56739
  if (!accessInfo) {
56740
56740
  return INVALID_RESULT;
56741
56741
  }
@@ -56763,12 +56763,12 @@ var require_vertex_array = __commonJS({
56763
56763
  };
56764
56764
  }
56765
56765
  var multiLocation = MULTI_LOCATION_ATTRIBUTE_REGEXP.exec(locationOrName);
56766
- var name9 = multiLocation ? multiLocation[1] : locationOrName;
56766
+ var name10 = multiLocation ? multiLocation[1] : locationOrName;
56767
56767
  var locationOffset = multiLocation ? Number(multiLocation[2]) : 0;
56768
56768
  if (this.configuration) {
56769
56769
  return {
56770
- location: this.configuration.getAttributeLocation(name9) + locationOffset,
56771
- name: name9
56770
+ location: this.configuration.getAttributeLocation(name10) + locationOffset,
56771
+ name: name10
56772
56772
  };
56773
56773
  }
56774
56774
  return {
@@ -57274,10 +57274,10 @@ var require_debug_vertex_array = __commonJS({
57274
57274
  isInteger
57275
57275
  }), " (constant)")), (0, _defineProperty2.default)(_ref4, "Format ", "".concat(size, "x").concat(type, " (constant)")), _ref4;
57276
57276
  }
57277
- function getGLSLDeclaration(name9, accessor) {
57277
+ function getGLSLDeclaration(name10, accessor) {
57278
57278
  var type = accessor.type, size = accessor.size;
57279
57279
  var typeAndName = (0, _attributeUtils.getCompositeGLType)(type, size);
57280
- return typeAndName ? "".concat(name9, " (").concat(typeAndName.name, ")") : name9;
57280
+ return typeAndName ? "".concat(name10, " (").concat(typeAndName.name, ")") : name10;
57281
57281
  }
57282
57282
  }
57283
57283
  });
@@ -58406,10 +58406,10 @@ var require_shader_module = __commonJS({
58406
58406
  var FRAGMENT_SHADER = "fs";
58407
58407
  var ShaderModule = function() {
58408
58408
  function ShaderModule2(_ref) {
58409
- var name9 = _ref.name, vs = _ref.vs, fs5 = _ref.fs, _ref$dependencies = _ref.dependencies, dependencies = _ref$dependencies === void 0 ? [] : _ref$dependencies, uniforms = _ref.uniforms, getUniforms = _ref.getUniforms, _ref$deprecations = _ref.deprecations, deprecations = _ref$deprecations === void 0 ? [] : _ref$deprecations, _ref$defines = _ref.defines, defines = _ref$defines === void 0 ? {} : _ref$defines, _ref$inject = _ref.inject, inject = _ref$inject === void 0 ? {} : _ref$inject, vertexShader = _ref.vertexShader, fragmentShader = _ref.fragmentShader;
58409
+ var name10 = _ref.name, vs = _ref.vs, fs5 = _ref.fs, _ref$dependencies = _ref.dependencies, dependencies = _ref$dependencies === void 0 ? [] : _ref$dependencies, uniforms = _ref.uniforms, getUniforms = _ref.getUniforms, _ref$deprecations = _ref.deprecations, deprecations = _ref$deprecations === void 0 ? [] : _ref$deprecations, _ref$defines = _ref.defines, defines = _ref$defines === void 0 ? {} : _ref$defines, _ref$inject = _ref.inject, inject = _ref$inject === void 0 ? {} : _ref$inject, vertexShader = _ref.vertexShader, fragmentShader = _ref.fragmentShader;
58410
58410
  (0, _classCallCheck2.default)(this, ShaderModule2);
58411
- (0, _utils.assert)(typeof name9 === "string");
58412
- this.name = name9;
58411
+ (0, _utils.assert)(typeof name10 === "string");
58412
+ this.name = name10;
58413
58413
  this.vs = vs || vertexShader;
58414
58414
  this.fs = fs5 || fragmentShader;
58415
58415
  this.getModuleUniforms = getUniforms;
@@ -58620,8 +58620,8 @@ var require_resolve_modules = __commonJS({
58620
58620
  });
58621
58621
  return Object.keys(moduleDepth).sort(function(a, b) {
58622
58622
  return moduleDepth[b] - moduleDepth[a];
58623
- }).map(function(name9) {
58624
- return moduleMap[name9];
58623
+ }).map(function(name10) {
58624
+ return moduleMap[name10];
58625
58625
  });
58626
58626
  }
58627
58627
  function getDependencyGraph(_ref) {
@@ -59235,9 +59235,9 @@ var require_assemble_shaders = __commonJS({
59235
59235
  var match = key.match(/^(v|f)s:(#)?([\w-]+)$/);
59236
59236
  if (match) {
59237
59237
  var hash = match[2];
59238
- var name9 = match[3];
59238
+ var name10 = match[3];
59239
59239
  if (hash) {
59240
- if (name9 === "decl") {
59240
+ if (name10 === "decl") {
59241
59241
  declInjections[key] = [injection];
59242
59242
  } else {
59243
59243
  mainInjections[key] = [injection];
@@ -59378,8 +59378,8 @@ var require_assemble_shaders = __commonJS({
59378
59378
  }
59379
59379
  hook = hook.trim();
59380
59380
  var _hook$split = hook.split(":"), _hook$split2 = (0, _slicedToArray2.default)(_hook$split, 2), stage = _hook$split2[0], signature = _hook$split2[1];
59381
- var name9 = hook.replace(/\(.+/, "");
59382
- result[stage][name9] = Object.assign(opts, {
59381
+ var name10 = hook.replace(/\(.+/, "");
59382
+ result[stage][name10] = Object.assign(opts, {
59383
59383
  signature
59384
59384
  });
59385
59385
  });
@@ -59413,11 +59413,11 @@ var require_shader_utils = __commonJS({
59413
59413
  if (!qualifiers.includes(qualifier) || !type || !definition) {
59414
59414
  return null;
59415
59415
  }
59416
- var name9 = definition.split(";")[0];
59416
+ var name10 = definition.split(";")[0];
59417
59417
  return {
59418
59418
  qualifier,
59419
59419
  type,
59420
- name: name9
59420
+ name: name10
59421
59421
  };
59422
59422
  }
59423
59423
  function getPassthroughFS() {
@@ -65332,9 +65332,9 @@ var require_program_manager = __commonJS({
65332
65332
  var count = 0;
65333
65333
  for (var i = 0, len = this._defaultModules.length; i < len; ++i) {
65334
65334
  var module3 = this._defaultModules[i];
65335
- var name9 = module3.name;
65335
+ var name10 = module3.name;
65336
65336
  modules[count++] = module3;
65337
- seen[name9] = true;
65337
+ seen[name10] = true;
65338
65338
  }
65339
65339
  for (var _i = 0, _len = appModules.length; _i < _len; ++_i) {
65340
65340
  var _module = appModules[_i];
@@ -65406,10 +65406,10 @@ var require_model_utils = __commonJS({
65406
65406
  function getBuffersFromGeometry(gl, geometry, options) {
65407
65407
  var buffers = {};
65408
65408
  var indices = geometry.indices;
65409
- for (var name9 in geometry.attributes) {
65410
- var attribute = geometry.attributes[name9];
65411
- var remappedName = mapAttributeName(name9, options);
65412
- if (name9 === "indices") {
65409
+ for (var name10 in geometry.attributes) {
65410
+ var attribute = geometry.attributes[name10];
65411
+ var remappedName = mapAttributeName(name10, options);
65412
+ if (name10 === "indices") {
65413
65413
  indices = attribute;
65414
65414
  } else if (attribute.constant) {
65415
65415
  buffers[remappedName] = attribute.value;
@@ -65418,7 +65418,7 @@ var require_model_utils = __commonJS({
65418
65418
  var accessor = _objectSpread({}, attribute);
65419
65419
  delete accessor.value;
65420
65420
  buffers[remappedName] = [new _webgl.Buffer(gl, typedArray), accessor];
65421
- inferAttributeAccessor(name9, accessor);
65421
+ inferAttributeAccessor(name10, accessor);
65422
65422
  }
65423
65423
  }
65424
65424
  if (indices) {
@@ -65435,9 +65435,9 @@ var require_model_utils = __commonJS({
65435
65435
  }
65436
65436
  return buffers;
65437
65437
  }
65438
- function mapAttributeName(name9, options) {
65438
+ function mapAttributeName(name10, options) {
65439
65439
  var _ref = options || {}, _ref$attributeMap = _ref.attributeMap, attributeMap = _ref$attributeMap === void 0 ? GLTF_TO_LUMA_ATTRIBUTE_MAP : _ref$attributeMap;
65440
- return attributeMap && attributeMap[name9] || name9;
65440
+ return attributeMap && attributeMap[name10] || name10;
65441
65441
  }
65442
65442
  function inferAttributeAccessor(attributeName, attribute) {
65443
65443
  var category;
@@ -65648,9 +65648,9 @@ var require_model = __commonJS({
65648
65648
  return this;
65649
65649
  }
65650
65650
  var normalizedAttributes = {};
65651
- for (var name9 in attributes) {
65652
- var attribute = attributes[name9];
65653
- normalizedAttributes[name9] = attribute.getValue ? attribute.getValue() : attribute;
65651
+ for (var name10 in attributes) {
65652
+ var attribute = attributes[name10];
65653
+ normalizedAttributes[name10] = attribute.getValue ? attribute.getValue() : attribute;
65654
65654
  }
65655
65655
  this.vertexArray.setAttributes(normalizedAttributes);
65656
65656
  return this;
@@ -65832,8 +65832,8 @@ var require_model = __commonJS({
65832
65832
  }, {
65833
65833
  key: "_deleteGeometryBuffers",
65834
65834
  value: function _deleteGeometryBuffers() {
65835
- for (var name9 in this.geometryBuffers) {
65836
- var buffer = this.geometryBuffers[name9][0] || this.geometryBuffers[name9];
65835
+ for (var name10 in this.geometryBuffers) {
65836
+ var buffer = this.geometryBuffers[name10][0] || this.geometryBuffers[name10];
65837
65837
  if (buffer instanceof _webgl.Buffer) {
65838
65838
  buffer.delete();
65839
65839
  }
@@ -66084,8 +66084,8 @@ var require_buffer_transform = __commonJS({
66084
66084
  }, {
66085
66085
  key: "delete",
66086
66086
  value: function _delete() {
66087
- for (var name9 in this.resources) {
66088
- this.resources[name9].delete();
66087
+ for (var name10 in this.resources) {
66088
+ this.resources[name10].delete();
66089
66089
  }
66090
66090
  }
66091
66091
  }, {
@@ -66201,12 +66201,12 @@ var require_buffer_transform = __commonJS({
66201
66201
  }
66202
66202
  }, {
66203
66203
  key: "_createNewBuffer",
66204
- value: function _createNewBuffer(name9, opts) {
66204
+ value: function _createNewBuffer(name10, opts) {
66205
66205
  var buffer = new _webgl.Buffer(this.gl, opts);
66206
- if (this.resources[name9]) {
66207
- this.resources[name9].delete();
66206
+ if (this.resources[name10]) {
66207
+ this.resources[name10].delete();
66208
66208
  }
66209
- this.resources[name9] = buffer;
66209
+ this.resources[name10] = buffer;
66210
66210
  return buffer;
66211
66211
  }
66212
66212
  }, {
@@ -66327,13 +66327,13 @@ var require_transform_shader_utils = __commonJS({
66327
66327
  if (!attributeData) {
66328
66328
  return null;
66329
66329
  }
66330
- var type = attributeData.type, name9 = attributeData.name;
66331
- if (name9 && textureMap[name9]) {
66330
+ var type = attributeData.type, name10 = attributeData.name;
66331
+ if (name10 && textureMap[name10]) {
66332
66332
  var updatedLine = "// ".concat(line, " => Replaced by Transform with a sampler");
66333
- var _getSamplerDecleratio = getSamplerDeclerations(name9), samplerName = _getSamplerDecleratio.samplerName, sizeName = _getSamplerDecleratio.sizeName, uniformDeclerations = _getSamplerDecleratio.uniformDeclerations;
66333
+ var _getSamplerDecleratio = getSamplerDeclerations(name10), samplerName = _getSamplerDecleratio.samplerName, sizeName = _getSamplerDecleratio.sizeName, uniformDeclerations = _getSamplerDecleratio.uniformDeclerations;
66334
66334
  var channels = (0, _shadertools.typeToChannelSuffix)(type);
66335
- var sampleInstruction = " ".concat(type, " ").concat(name9, " = transform_getInput(").concat(samplerName, ", ").concat(sizeName, ").").concat(channels, ";\n");
66336
- samplerTextureMap[samplerName] = name9;
66335
+ var sampleInstruction = " ".concat(type, " ").concat(name10, " = transform_getInput(").concat(samplerName, ", ").concat(sizeName, ").").concat(channels, ";\n");
66336
+ samplerTextureMap[samplerName] = name10;
66337
66337
  var inject = {
66338
66338
  "vs:#decl": uniformDeclerations,
66339
66339
  "vs:#main-start": sampleInstruction
@@ -66603,8 +66603,8 @@ var require_texture_transform = __commonJS({
66603
66603
  value: function _setSourceTextureParameters() {
66604
66604
  var index = this.currentIndex;
66605
66605
  var sourceTextures = this.bindings[index].sourceTextures;
66606
- for (var name9 in sourceTextures) {
66607
- sourceTextures[name9].setParameters(SRC_TEX_PARAMETER_OVERRIDES);
66606
+ for (var name10 in sourceTextures) {
66607
+ sourceTextures[name10].setParameters(SRC_TEX_PARAMETER_OVERRIDES);
66608
66608
  }
66609
66609
  }
66610
66610
  }, {
@@ -73572,6 +73572,22 @@ function isTransferable(object) {
73572
73572
  }
73573
73573
  return false;
73574
73574
  }
73575
+ function getTransferListForWriter(object) {
73576
+ if (object === null) {
73577
+ return {};
73578
+ }
73579
+ const clone2 = Object.assign({}, object);
73580
+ Object.keys(clone2).forEach((key) => {
73581
+ if (typeof object[key] === "object" && !ArrayBuffer.isView(object[key])) {
73582
+ clone2[key] = getTransferListForWriter(object[key]);
73583
+ } else if (typeof clone2[key] === "function" || clone2[key] instanceof RegExp) {
73584
+ clone2[key] = {};
73585
+ } else {
73586
+ clone2[key] = object[key];
73587
+ }
73588
+ });
73589
+ return clone2;
73590
+ }
73575
73591
 
73576
73592
  // ../worker-utils/src/lib/worker-farm/worker-thread.ts
73577
73593
  var NOOP = () => {
@@ -73580,9 +73596,9 @@ var WorkerThread = class {
73580
73596
  constructor(props) {
73581
73597
  this.terminated = false;
73582
73598
  this._loadableURL = "";
73583
- const { name: name9, source, url } = props;
73599
+ const { name: name10, source, url } = props;
73584
73600
  assert3(source || url);
73585
- this.name = name9;
73601
+ this.name = name10;
73586
73602
  this.source = source;
73587
73603
  this.url = url;
73588
73604
  this.onMessage = NOOP;
@@ -73590,7 +73606,7 @@ var WorkerThread = class {
73590
73606
  this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
73591
73607
  }
73592
73608
  static isSupported() {
73593
- return typeof Worker !== "undefined" && isBrowser2 || typeof worker_threads_exports.Worker !== void 0;
73609
+ return typeof Worker !== "undefined" && isBrowser2 || typeof worker_threads_exports.Worker !== "undefined" && !isBrowser2;
73594
73610
  }
73595
73611
  destroy() {
73596
73612
  this.onMessage = NOOP;
@@ -73699,9 +73715,9 @@ var WorkerPool = class {
73699
73715
  this.onDebug = props.onDebug;
73700
73716
  }
73701
73717
  }
73702
- async startJob(name9, onMessage3 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
73718
+ async startJob(name10, onMessage3 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
73703
73719
  const startPromise = new Promise((onStart) => {
73704
- this.jobQueue.push({ name: name9, onMessage: onMessage3, onError, onStart });
73720
+ this.jobQueue.push({ name: name10, onMessage: onMessage3, onError, onStart });
73705
73721
  return this;
73706
73722
  });
73707
73723
  this._startQueuedJob();
@@ -73752,8 +73768,8 @@ var WorkerPool = class {
73752
73768
  }
73753
73769
  if (this.count < this._getMaxConcurrency()) {
73754
73770
  this.count++;
73755
- const name9 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
73756
- return new WorkerThread({ name: name9, source: this.source, url: this.url });
73771
+ const name10 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
73772
+ return new WorkerThread({ name: name10, source: this.source, url: this.url });
73757
73773
  }
73758
73774
  return null;
73759
73775
  }
@@ -73798,16 +73814,16 @@ var WorkerFarm = class {
73798
73814
  }
73799
73815
  }
73800
73816
  getWorkerPool(options) {
73801
- const { name: name9, source, url } = options;
73802
- let workerPool = this.workerPools.get(name9);
73817
+ const { name: name10, source, url } = options;
73818
+ let workerPool = this.workerPools.get(name10);
73803
73819
  if (!workerPool) {
73804
73820
  workerPool = new WorkerPool({
73805
- name: name9,
73821
+ name: name10,
73806
73822
  source,
73807
73823
  url
73808
73824
  });
73809
73825
  workerPool.setProps(this._getWorkerPoolProps());
73810
- this.workerPools.set(name9, workerPool);
73826
+ this.workerPools.set(name10, workerPool);
73811
73827
  }
73812
73828
  return workerPool;
73813
73829
  }
@@ -73821,27 +73837,6 @@ var WorkerFarm = class {
73821
73837
  }
73822
73838
  };
73823
73839
 
73824
- // ../worker-utils/src/lib/worker-utils/remove-nontransferable-options.ts
73825
- function removeNontransferableOptions(object) {
73826
- return JSON.parse(stringifyJSON(object));
73827
- }
73828
- function stringifyJSON(v) {
73829
- const cache = new Set();
73830
- return JSON.stringify(v, (key, value) => {
73831
- if (typeof value === "object" && value !== null) {
73832
- if (cache.has(value)) {
73833
- try {
73834
- return JSON.parse(JSON.stringify(value));
73835
- } catch (err) {
73836
- return void 0;
73837
- }
73838
- }
73839
- cache.add(value);
73840
- }
73841
- return value;
73842
- });
73843
- }
73844
-
73845
73840
  // ../worker-utils/src/lib/worker-api/get-worker-url.ts
73846
73841
  var NPM_TAG = "beta";
73847
73842
  var VERSION2 = typeof VERSION !== "undefined" ? VERSION : NPM_TAG;
@@ -73873,17 +73868,17 @@ function getWorkerURL(worker, options = {}) {
73873
73868
 
73874
73869
  // ../worker-utils/src/lib/worker-api/process-on-worker.ts
73875
73870
  async function processOnWorker(worker, data, options = {}, context = {}) {
73876
- const name9 = getWorkerName(worker);
73871
+ const name10 = getWorkerName(worker);
73877
73872
  const workerFarm = WorkerFarm.getWorkerFarm(options);
73878
73873
  const { source } = options;
73879
- const workerPoolProps = { name: name9, source };
73874
+ const workerPoolProps = { name: name10, source };
73880
73875
  if (!source) {
73881
73876
  workerPoolProps.url = getWorkerURL(worker, options);
73882
73877
  }
73883
73878
  const workerPool = workerFarm.getWorkerPool(workerPoolProps);
73884
73879
  const jobName = options.jobName || worker.name;
73885
73880
  const job = await workerPool.startJob(jobName, onMessage.bind(null, context));
73886
- const transferableOptions = removeNontransferableOptions(options);
73881
+ const transferableOptions = getTransferListForWriter(options);
73887
73882
  job.postMessage("process", { input: data, options: transferableOptions });
73888
73883
  const result = await job.result;
73889
73884
  return result.result;
@@ -74164,10 +74159,10 @@ function canParseWithWorker(loader, options) {
74164
74159
  return loader.worker && options?.worker;
74165
74160
  }
74166
74161
  async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
74167
- const name9 = loader.id;
74162
+ const name10 = loader.id;
74168
74163
  const url = getWorkerURL(loader, options);
74169
74164
  const workerFarm = WorkerFarm.getWorkerFarm(options);
74170
- const workerPool = workerFarm.getWorkerPool({ name: name9, url });
74165
+ const workerPool = workerFarm.getWorkerPool({ name: name10, url });
74171
74166
  options = JSON.parse(JSON.stringify(options));
74172
74167
  context = JSON.parse(JSON.stringify(context || {}));
74173
74168
  const job = await workerPool.startJob("process-on-worker", onMessage2.bind(null, parseOnMainThread));
@@ -75721,14 +75716,13 @@ var cullingVolume = new import_culling.CullingVolume([
75721
75716
  function getFrameState(viewport, frameNumber) {
75722
75717
  const { cameraDirection, cameraUp, height } = viewport;
75723
75718
  const { metersPerUnit } = viewport.distanceScales;
75724
- const viewportCenterCartographic = viewport.unprojectPosition(viewport.center);
75725
- const viewportCenterCartesian = import_geospatial2.Ellipsoid.WGS84.cartographicToCartesian(viewportCenterCartographic, new import_core2.Vector3());
75719
+ const viewportCenterCartesian = worldToCartesian(viewport, viewport.center);
75726
75720
  const enuToFixedTransform = import_geospatial2.Ellipsoid.WGS84.eastNorthUpToFixedFrame(viewportCenterCartesian);
75727
75721
  const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);
75728
75722
  const cameraPositionCartesian2 = import_geospatial2.Ellipsoid.WGS84.cartographicToCartesian(cameraPositionCartographic, new import_core2.Vector3());
75729
75723
  const cameraDirectionCartesian = new import_core2.Vector3(enuToFixedTransform.transformAsVector(new import_core2.Vector3(cameraDirection).scale(metersPerUnit))).normalize();
75730
75724
  const cameraUpCartesian = new import_core2.Vector3(enuToFixedTransform.transformAsVector(new import_core2.Vector3(cameraUp).scale(metersPerUnit))).normalize();
75731
- commonSpacePlanesToWGS84(viewport, viewportCenterCartesian);
75725
+ commonSpacePlanesToWGS84(viewport);
75732
75726
  const ViewportClass = viewport.constructor;
75733
75727
  const { longitude, latitude, width, bearing, zoom } = viewport;
75734
75728
  const topDownViewport = new ViewportClass({
@@ -75778,18 +75772,32 @@ function limitSelectedTiles(tiles, frameState, maximumTilesSelected) {
75778
75772
  }
75779
75773
  return [selectedTiles, unselectedTiles];
75780
75774
  }
75781
- function commonSpacePlanesToWGS84(viewport, viewportCenterCartesian) {
75775
+ function commonSpacePlanesToWGS84(viewport) {
75782
75776
  const frustumPlanes = viewport.getFrustumPlanes();
75777
+ const nearCenterCommon = closestPointOnPlane(frustumPlanes.near, viewport.cameraPosition);
75778
+ const nearCenterCartesian = worldToCartesian(viewport, nearCenterCommon);
75779
+ const cameraCartesian = worldToCartesian(viewport, viewport.cameraPosition, scratchPosition);
75783
75780
  let i = 0;
75781
+ cullingVolume.planes[i++].fromPointNormal(nearCenterCartesian, scratchVector.copy(nearCenterCartesian).subtract(cameraCartesian));
75784
75782
  for (const dir in frustumPlanes) {
75783
+ if (dir === "near") {
75784
+ continue;
75785
+ }
75785
75786
  const plane = frustumPlanes[dir];
75786
- const distanceToCenter = plane.normal.dot(viewport.center);
75787
- scratchPosition.copy(plane.normal).scale(plane.distance - distanceToCenter).add(viewport.center);
75788
- const cartographicPos = viewport.unprojectPosition(scratchPosition);
75789
- const cartesianPos = import_geospatial2.Ellipsoid.WGS84.cartographicToCartesian(cartographicPos, new import_core2.Vector3());
75790
- cullingVolume.planes[i++].fromPointNormal(cartesianPos, scratchVector.copy(viewportCenterCartesian).subtract(cartesianPos));
75787
+ const posCommon = closestPointOnPlane(plane, nearCenterCommon, scratchPosition);
75788
+ const cartesianPos = worldToCartesian(viewport, posCommon, scratchPosition);
75789
+ cullingVolume.planes[i++].fromPointNormal(cartesianPos, scratchVector.copy(nearCenterCartesian).subtract(cartesianPos));
75791
75790
  }
75792
75791
  }
75792
+ function closestPointOnPlane(plane, refPoint, out = new import_core2.Vector3()) {
75793
+ const distanceToRef = plane.normal.dot(refPoint);
75794
+ out.copy(plane.normal).scale(plane.distance - distanceToRef).add(refPoint);
75795
+ return out;
75796
+ }
75797
+ function worldToCartesian(viewport, point, out = new import_core2.Vector3()) {
75798
+ const cartographicPos = viewport.unprojectPosition(point);
75799
+ return import_geospatial2.Ellipsoid.WGS84.cartographicToCartesian(cartographicPos, out);
75800
+ }
75793
75801
 
75794
75802
  // ../tiles/src/tileset/helpers/zoom.ts
75795
75803
  var import_core3 = __toModule(require_es56());
@@ -76156,7 +76164,7 @@ var TilesetTraverser = class {
76156
76164
  this.requestedTiles = {};
76157
76165
  this.emptyTiles = {};
76158
76166
  }
76159
- get traversalFinished() {
76167
+ traversalFinished(frameState) {
76160
76168
  return true;
76161
76169
  }
76162
76170
  traverse(root, frameState, options) {
@@ -76207,7 +76215,7 @@ var TilesetTraverser = class {
76207
76215
  tile._shouldRefine = shouldRefine && parentRefines;
76208
76216
  }
76209
76217
  const newTime = new Date().getTime();
76210
- if (this.traversalFinished || newTime - this.lastUpdate > this.updateDebounceTime) {
76218
+ if (this.traversalFinished(frameState) || newTime - this.lastUpdate > this.updateDebounceTime) {
76211
76219
  this.lastUpdate = newTime;
76212
76220
  this.options.onTraversalEnd(frameState);
76213
76221
  }
@@ -76699,8 +76707,17 @@ var TileHeader = class {
76699
76707
  case "i3s":
76700
76708
  return {
76701
76709
  ...this.tileset.options.i3s,
76702
- tile: this.header,
76703
- tileset: this.tileset.tileset,
76710
+ _tileOptions: {
76711
+ textureUrl: this.header.textureUrl,
76712
+ textureFormat: this.header.textureFormat,
76713
+ textureLoaderOptions: this.header.textureLoaderOptions,
76714
+ materialDefinition: this.header.materialDefinition,
76715
+ isDracoGeometry: this.header.isDracoGeometry,
76716
+ mbs: this.header.mbs
76717
+ },
76718
+ _tilesetOptions: {
76719
+ store: this.tileset.tileset.store
76720
+ },
76704
76721
  isTileHeader: false
76705
76722
  };
76706
76723
  case "3d-tiles":
@@ -76750,21 +76767,27 @@ var Tileset3DTraverser = class extends TilesetTraverser {
76750
76767
  }
76751
76768
  };
76752
76769
 
76753
- // ../tiles/src/tileset/traversers/i3s-frame-counter.ts
76770
+ // ../tiles/src/tileset/traversers/i3s-pending-tiles-register.ts
76754
76771
  var I3SPendingTilesRegister = class {
76755
76772
  constructor() {
76756
76773
  this.frameNumberMap = new Map();
76757
76774
  }
76758
- register(frameNumber) {
76759
- const oldCount = this.frameNumberMap.get(frameNumber) || 0;
76760
- this.frameNumberMap.set(frameNumber, oldCount + 1);
76775
+ register(viewportId, frameNumber) {
76776
+ const viewportMap = this.frameNumberMap.get(viewportId) || new Map();
76777
+ const oldCount = viewportMap.get(frameNumber) || 0;
76778
+ viewportMap.set(frameNumber, oldCount + 1);
76779
+ this.frameNumberMap.set(viewportId, viewportMap);
76761
76780
  }
76762
- deregister(frameNumber) {
76763
- const oldCount = this.frameNumberMap.get(frameNumber) || 1;
76764
- this.frameNumberMap.set(frameNumber, oldCount - 1);
76781
+ deregister(viewportId, frameNumber) {
76782
+ const viewportMap = this.frameNumberMap.get(viewportId);
76783
+ if (!viewportMap) {
76784
+ return;
76785
+ }
76786
+ const oldCount = viewportMap.get(frameNumber) || 1;
76787
+ viewportMap.set(frameNumber, oldCount - 1);
76765
76788
  }
76766
- isZero(frameNumber) {
76767
- const count = this.frameNumberMap.get(frameNumber) || 0;
76789
+ isZero(viewportId, frameNumber) {
76790
+ const count = this.frameNumberMap.get(viewportId)?.get(frameNumber) || 0;
76768
76791
  return count === 0;
76769
76792
  }
76770
76793
  };
@@ -76782,41 +76805,58 @@ var I3STileManager = class {
76782
76805
  }
76783
76806
  add(request, key, callback, frameState) {
76784
76807
  if (!this._statusMap[key]) {
76785
- const { frameNumber } = frameState;
76808
+ const {
76809
+ frameNumber,
76810
+ viewport: { id }
76811
+ } = frameState;
76786
76812
  this._statusMap[key] = { request, callback, key, frameState, status: STATUS.REQUESTED };
76787
- this.pendingTilesRegister.register(frameNumber);
76813
+ this.pendingTilesRegister.register(id, frameNumber);
76788
76814
  request().then((data) => {
76789
76815
  this._statusMap[key].status = STATUS.COMPLETED;
76790
- const { frameNumber: actualFrameNumber } = this._statusMap[key].frameState;
76791
- this.pendingTilesRegister.deregister(actualFrameNumber);
76816
+ const {
76817
+ frameNumber: actualFrameNumber,
76818
+ viewport: { id: id2 }
76819
+ } = this._statusMap[key].frameState;
76820
+ this.pendingTilesRegister.deregister(id2, actualFrameNumber);
76792
76821
  this._statusMap[key].callback(data, frameState);
76793
76822
  }).catch((error) => {
76794
76823
  this._statusMap[key].status = STATUS.ERROR;
76795
- const { frameNumber: actualFrameNumber } = this._statusMap[key].frameState;
76796
- this.pendingTilesRegister.deregister(actualFrameNumber);
76824
+ const {
76825
+ frameNumber: actualFrameNumber,
76826
+ viewport: { id: id2 }
76827
+ } = this._statusMap[key].frameState;
76828
+ this.pendingTilesRegister.deregister(id2, actualFrameNumber);
76797
76829
  callback(error);
76798
76830
  });
76799
76831
  }
76800
76832
  }
76801
76833
  update(key, frameState) {
76802
76834
  if (this._statusMap[key]) {
76803
- this.pendingTilesRegister.deregister(this._statusMap[key].frameState.frameNumber);
76804
- this.pendingTilesRegister.register(frameState.frameNumber);
76835
+ const {
76836
+ frameNumber,
76837
+ viewport: { id }
76838
+ } = this._statusMap[key].frameState;
76839
+ this.pendingTilesRegister.deregister(id, frameNumber);
76840
+ const {
76841
+ frameNumber: newFrameNumber,
76842
+ viewport: { id: newViewportId }
76843
+ } = frameState;
76844
+ this.pendingTilesRegister.register(newViewportId, newFrameNumber);
76805
76845
  this._statusMap[key].frameState = frameState;
76806
76846
  }
76807
76847
  }
76808
76848
  find(key) {
76809
76849
  return this._statusMap[key];
76810
76850
  }
76811
- hasPendingTiles(frameNumber) {
76812
- return !this.pendingTilesRegister.isZero(frameNumber);
76851
+ hasPendingTiles(viewportId, frameNumber) {
76852
+ return !this.pendingTilesRegister.isZero(viewportId, frameNumber);
76813
76853
  }
76814
76854
  };
76815
76855
 
76816
76856
  // ../tiles/src/tileset/traversers/i3s-tileset-traverser.ts
76817
76857
  var I3STilesetTraverser = class extends TilesetTraverser {
76818
- get traversalFinished() {
76819
- return !this._tileManager.hasPendingTiles(this._frameNumber || 0);
76858
+ traversalFinished(frameState) {
76859
+ return !this._tileManager.hasPendingTiles(frameState.viewport.id, this._frameNumber || 0);
76820
76860
  }
76821
76861
  constructor(options) {
76822
76862
  super(options);
@@ -76857,8 +76897,7 @@ var I3STilesetTraverser = class extends TilesetTraverser {
76857
76897
  ...tileset.loadOptions,
76858
76898
  i3s: {
76859
76899
  ...tileset.loadOptions.i3s,
76860
- isTileHeader: true,
76861
- loadContent: false
76900
+ isTileHeader: true
76862
76901
  }
76863
76902
  };
76864
76903
  return await load(nodeUrl, loader, options);
@@ -76868,7 +76907,7 @@ var I3STilesetTraverser = class extends TilesetTraverser {
76868
76907
  tile.children.push(childTile);
76869
76908
  const frameState = this._tileManager.find(childTile.id).frameState;
76870
76909
  this.updateTile(childTile, frameState);
76871
- if (this._frameNumber === frameState.frameNumber && (this.traversalFinished || new Date().getTime() - this.lastUpdate > this.updateDebounceTime)) {
76910
+ if (this._frameNumber === frameState.frameNumber && (this.traversalFinished(frameState) || new Date().getTime() - this.lastUpdate > this.updateDebounceTime)) {
76872
76911
  this.executeTraversal(childTile, frameState);
76873
76912
  }
76874
76913
  }
@@ -77005,7 +77044,9 @@ var Tileset3D = class {
77005
77044
  } else {
77006
77045
  this.lastUpdatedVieports = viewports;
77007
77046
  }
77008
- this.doUpdate(viewports);
77047
+ if (viewports) {
77048
+ this.doUpdate(viewports);
77049
+ }
77009
77050
  });
77010
77051
  }
77011
77052
  async selectTiles(viewports = null) {
@@ -77016,7 +77057,9 @@ var Tileset3D = class {
77016
77057
  if (!this.updatePromise) {
77017
77058
  this.updatePromise = new Promise((resolve) => {
77018
77059
  setTimeout(() => {
77019
- this.doUpdate(this.lastUpdatedVieports);
77060
+ if (this.lastUpdatedVieports) {
77061
+ this.doUpdate(this.lastUpdatedVieports);
77062
+ }
77020
77063
  resolve(this._frameNumber);
77021
77064
  this.updatePromise = null;
77022
77065
  }, this.options.debounceTime);
@@ -77024,21 +77067,19 @@ var Tileset3D = class {
77024
77067
  }
77025
77068
  return this.updatePromise;
77026
77069
  }
77027
- doUpdate(viewports = null) {
77070
+ doUpdate(viewports) {
77028
77071
  if ("loadTiles" in this.options && !this.options.loadTiles) {
77029
77072
  return;
77030
77073
  }
77031
77074
  if (this.traverseCounter > 0) {
77032
77075
  return;
77033
77076
  }
77034
- if (!(viewports instanceof Array)) {
77035
- viewports = [viewports];
77036
- }
77077
+ const preparedViewports = viewports instanceof Array ? viewports : [viewports];
77037
77078
  this._cache.reset();
77038
77079
  this._frameNumber++;
77039
- this.traverseCounter = viewports.length;
77080
+ this.traverseCounter = preparedViewports.length;
77040
77081
  const viewportsToTraverse = [];
77041
- for (const viewport of viewports) {
77082
+ for (const viewport of preparedViewports) {
77042
77083
  const id = viewport.id;
77043
77084
  if (this._needTraverse(id)) {
77044
77085
  viewportsToTraverse.push(id);
@@ -77046,7 +77087,7 @@ var Tileset3D = class {
77046
77087
  this.traverseCounter--;
77047
77088
  }
77048
77089
  }
77049
- for (const viewport of viewports) {
77090
+ for (const viewport of preparedViewports) {
77050
77091
  const id = viewport.id;
77051
77092
  if (!this.roots[id]) {
77052
77093
  this.roots[id] = this._initializeTileHeaders(this.tileset, null);
@@ -77435,7 +77476,7 @@ var DEFAULT_DRACO_OPTIONS = {
77435
77476
  };
77436
77477
  var DracoLoader = {
77437
77478
  name: "Draco",
77438
- id: "draco",
77479
+ id: isBrowser2 ? "draco" : "draco-nodejs",
77439
77480
  module: "draco",
77440
77481
  shapes: ["mesh"],
77441
77482
  version: VERSION5,
@@ -77505,8 +77546,8 @@ var Schema = class {
77505
77546
  }
77506
77547
  select(...columnNames) {
77507
77548
  const nameMap = Object.create(null);
77508
- for (const name9 of columnNames) {
77509
- nameMap[name9] = true;
77549
+ for (const name10 of columnNames) {
77550
+ nameMap[name10] = true;
77510
77551
  }
77511
77552
  const selectedFields = this.fields.filter((field) => nameMap[field.name]);
77512
77553
  return new Schema(selectedFields, this.metadata);
@@ -77551,8 +77592,8 @@ function mergeMaps(m1, m2) {
77551
77592
 
77552
77593
  // ../schema/src/lib/schema/impl/field.ts
77553
77594
  var Field = class {
77554
- constructor(name9, type, nullable = false, metadata = new Map()) {
77555
- this.name = name9;
77595
+ constructor(name10, type, nullable = false, metadata = new Map()) {
77596
+ this.name = name10;
77556
77597
  this.type = type;
77557
77598
  this.nullable = nullable;
77558
77599
  this.metadata = metadata;
@@ -78474,8 +78515,8 @@ var GLType = class {
78474
78515
  }
78475
78516
  throw new Error(ERR_TYPE_CONVERSION);
78476
78517
  }
78477
- static fromName(name9) {
78478
- const glType = NAME_TO_GL_TYPE[name9];
78518
+ static fromName(name10) {
78519
+ const glType = NAME_TO_GL_TYPE[name10];
78479
78520
  if (!glType) {
78480
78521
  throw new Error(ERR_TYPE_CONVERSION);
78481
78522
  }
@@ -78987,10 +79028,10 @@ var Tile3DBatchTableParser = class {
78987
79028
  }
78988
79029
  return void 0;
78989
79030
  }
78990
- hasProperty(batchId, name9) {
79031
+ hasProperty(batchId, name10) {
78991
79032
  this._checkBatchId(batchId);
78992
- assert2(typeof name9 === "string", name9);
78993
- return defined5(this._properties[name9]) || this._hasPropertyInHierarchy(batchId, name9);
79033
+ assert2(typeof name10 === "string", name10);
79034
+ return defined5(this._properties[name10]) || this._hasPropertyInHierarchy(batchId, name10);
78994
79035
  }
78995
79036
  getPropertyNames(batchId, results) {
78996
79037
  this._checkBatchId(batchId);
@@ -79003,47 +79044,47 @@ var Tile3DBatchTableParser = class {
79003
79044
  }
79004
79045
  return results;
79005
79046
  }
79006
- getProperty(batchId, name9) {
79047
+ getProperty(batchId, name10) {
79007
79048
  this._checkBatchId(batchId);
79008
- assert2(typeof name9 === "string", name9);
79049
+ assert2(typeof name10 === "string", name10);
79009
79050
  if (this._binaryProperties) {
79010
- const binaryProperty = this._binaryProperties[name9];
79051
+ const binaryProperty = this._binaryProperties[name10];
79011
79052
  if (defined5(binaryProperty)) {
79012
79053
  return this._getBinaryProperty(binaryProperty, batchId);
79013
79054
  }
79014
79055
  }
79015
- const propertyValues = this._properties[name9];
79056
+ const propertyValues = this._properties[name10];
79016
79057
  if (defined5(propertyValues)) {
79017
79058
  return clone(propertyValues[batchId], true);
79018
79059
  }
79019
79060
  if (this._hierarchy) {
79020
- const hierarchyProperty = this._getHierarchyProperty(batchId, name9);
79061
+ const hierarchyProperty = this._getHierarchyProperty(batchId, name10);
79021
79062
  if (defined5(hierarchyProperty)) {
79022
79063
  return hierarchyProperty;
79023
79064
  }
79024
79065
  }
79025
79066
  return void 0;
79026
79067
  }
79027
- setProperty(batchId, name9, value) {
79068
+ setProperty(batchId, name10, value) {
79028
79069
  const featureCount = this.featureCount;
79029
79070
  this._checkBatchId(batchId);
79030
- assert2(typeof name9 === "string", name9);
79071
+ assert2(typeof name10 === "string", name10);
79031
79072
  if (this._binaryProperties) {
79032
- const binaryProperty = this._binaryProperties[name9];
79073
+ const binaryProperty = this._binaryProperties[name10];
79033
79074
  if (binaryProperty) {
79034
79075
  this._setBinaryProperty(binaryProperty, batchId, value);
79035
79076
  return;
79036
79077
  }
79037
79078
  }
79038
79079
  if (this._hierarchy) {
79039
- if (this._setHierarchyProperty(this, batchId, name9, value)) {
79080
+ if (this._setHierarchyProperty(this, batchId, name10, value)) {
79040
79081
  return;
79041
79082
  }
79042
79083
  }
79043
- let propertyValues = this._properties[name9];
79084
+ let propertyValues = this._properties[name10];
79044
79085
  if (!defined5(propertyValues)) {
79045
- this._properties[name9] = new Array(featureCount);
79046
- propertyValues = this._properties[name9];
79086
+ this._properties[name10] = new Array(featureCount);
79087
+ propertyValues = this._properties[name10];
79047
79088
  }
79048
79089
  propertyValues[batchId] = clone(value, true);
79049
79090
  }
@@ -79061,21 +79102,21 @@ var Tile3DBatchTableParser = class {
79061
79102
  }
79062
79103
  _initializeBinaryProperties() {
79063
79104
  let binaryProperties = null;
79064
- for (const name9 in this._properties) {
79065
- const property = this._properties[name9];
79066
- const binaryProperty = this._initializeBinaryProperty(name9, property);
79105
+ for (const name10 in this._properties) {
79106
+ const property = this._properties[name10];
79107
+ const binaryProperty = this._initializeBinaryProperty(name10, property);
79067
79108
  if (binaryProperty) {
79068
79109
  binaryProperties = binaryProperties || {};
79069
- binaryProperties[name9] = binaryProperty;
79110
+ binaryProperties[name10] = binaryProperty;
79070
79111
  }
79071
79112
  }
79072
79113
  return binaryProperties;
79073
79114
  }
79074
- _initializeBinaryProperty(name9, property) {
79115
+ _initializeBinaryProperty(name10, property) {
79075
79116
  if ("byteOffset" in property) {
79076
79117
  const tile3DAccessor = property;
79077
- assert2(this.binary, `Property ${name9} requires a batch table binary.`);
79078
- assert2(tile3DAccessor.type, `Property ${name9} requires a type.`);
79118
+ assert2(this.binary, `Property ${name10} requires a batch table binary.`);
79119
+ assert2(tile3DAccessor.type, `Property ${name10} requires a type.`);
79079
79120
  const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
79080
79121
  return {
79081
79122
  typedArray: accessor.values,
@@ -79086,14 +79127,14 @@ var Tile3DBatchTableParser = class {
79086
79127
  }
79087
79128
  return null;
79088
79129
  }
79089
- _hasPropertyInHierarchy(batchId, name9) {
79130
+ _hasPropertyInHierarchy(batchId, name10) {
79090
79131
  if (!this._hierarchy) {
79091
79132
  return false;
79092
79133
  }
79093
79134
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
79094
79135
  const classId = hierarchy.classIds[instanceIndex];
79095
79136
  const instances = hierarchy.classes[classId].instances;
79096
- return defined5(instances[name9]);
79137
+ return defined5(instances[name10]);
79097
79138
  });
79098
79139
  return defined5(result);
79099
79140
  }
@@ -79101,21 +79142,21 @@ var Tile3DBatchTableParser = class {
79101
79142
  traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
79102
79143
  const classId = hierarchy.classIds[instanceIndex];
79103
79144
  const instances = hierarchy.classes[classId].instances;
79104
- for (const name9 in instances) {
79105
- if (instances.hasOwnProperty(name9)) {
79106
- if (results.indexOf(name9) === -1) {
79107
- results.push(name9);
79145
+ for (const name10 in instances) {
79146
+ if (instances.hasOwnProperty(name10)) {
79147
+ if (results.indexOf(name10) === -1) {
79148
+ results.push(name10);
79108
79149
  }
79109
79150
  }
79110
79151
  }
79111
79152
  });
79112
79153
  }
79113
- _getHierarchyProperty(batchId, name9) {
79154
+ _getHierarchyProperty(batchId, name10) {
79114
79155
  return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
79115
79156
  const classId = hierarchy.classIds[instanceIndex];
79116
79157
  const instanceClass = hierarchy.classes[classId];
79117
79158
  const indexInClass = hierarchy.classIndexes[instanceIndex];
79118
- const propertyValues = instanceClass.instances[name9];
79159
+ const propertyValues = instanceClass.instances[name10];
79119
79160
  if (defined5(propertyValues)) {
79120
79161
  if (defined5(propertyValues.typedArray)) {
79121
79162
  return this._getBinaryProperty(propertyValues, indexInClass);
@@ -79125,14 +79166,14 @@ var Tile3DBatchTableParser = class {
79125
79166
  return null;
79126
79167
  });
79127
79168
  }
79128
- _setHierarchyProperty(batchTable, batchId, name9, value) {
79169
+ _setHierarchyProperty(batchTable, batchId, name10, value) {
79129
79170
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
79130
79171
  const classId = hierarchy.classIds[instanceIndex];
79131
79172
  const instanceClass = hierarchy.classes[classId];
79132
79173
  const indexInClass = hierarchy.classIndexes[instanceIndex];
79133
- const propertyValues = instanceClass.instances[name9];
79174
+ const propertyValues = instanceClass.instances[name10];
79134
79175
  if (defined5(propertyValues)) {
79135
- assert2(instanceIndex === batchId, `Inherited property "${name9}" is read-only.`);
79176
+ assert2(instanceIndex === batchId, `Inherited property "${name10}" is read-only.`);
79136
79177
  if (defined5(propertyValues.typedArray)) {
79137
79178
  this._setBinaryProperty(propertyValues, indexInClass, value);
79138
79179
  } else {
@@ -80032,7 +80073,7 @@ function selectSupportedBasisFormat() {
80032
80073
  // ../textures/src/basis-loader.ts
80033
80074
  var BasisWorkerLoader = {
80034
80075
  name: "Basis",
80035
- id: "basis",
80076
+ id: isBrowser2 ? "basis" : "basis-nodejs",
80036
80077
  module: "textures",
80037
80078
  version: VERSION7,
80038
80079
  worker: true,
@@ -80981,12 +81022,12 @@ var GLTFScenegraph = class {
80981
81022
  return extras[key];
80982
81023
  }
80983
81024
  getExtension(extensionName) {
80984
- const isExtension = this.getUsedExtensions().find((name9) => name9 === extensionName);
81025
+ const isExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
80985
81026
  const extensions = this.json.extensions || {};
80986
81027
  return isExtension ? extensions[extensionName] || true : null;
80987
81028
  }
80988
81029
  getRequiredExtension(extensionName) {
80989
- const isRequired = this.getRequiredExtensions().find((name9) => name9 === extensionName);
81030
+ const isRequired = this.getRequiredExtensions().find((name10) => name10 === extensionName);
80990
81031
  return isRequired ? this.getExtension(extensionName) : null;
80991
81032
  }
80992
81033
  getRequiredExtensions() {
@@ -81618,11 +81659,11 @@ __export(KHR_draco_mesh_compression_exports, {
81618
81659
  // ../gltf/src/lib/gltf-utils/gltf-attribute-utils.ts
81619
81660
  function getGLTFAccessors(attributes) {
81620
81661
  const accessors = {};
81621
- for (const name9 in attributes) {
81622
- const attribute = attributes[name9];
81623
- if (name9 !== "indices") {
81662
+ for (const name10 in attributes) {
81663
+ const attribute = attributes[name10];
81664
+ if (name10 !== "indices") {
81624
81665
  const glTFAccessor = getGLTFAccessor(attribute);
81625
- accessors[name9] = glTFAccessor;
81666
+ accessors[name10] = glTFAccessor;
81626
81667
  }
81627
81668
  }
81628
81669
  return accessors;
@@ -82080,6 +82121,85 @@ function resolveValues(technique, gltfScenegraph) {
82080
82121
  return values;
82081
82122
  }
82082
82123
 
82124
+ // ../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts
82125
+ var EXT_feature_metadata_exports = {};
82126
+ __export(EXT_feature_metadata_exports, {
82127
+ decode: () => decode8,
82128
+ name: () => name9
82129
+ });
82130
+ var EXT_FEATURE_METADATA = "EXT_feature_metadata";
82131
+ var name9 = EXT_FEATURE_METADATA;
82132
+ async function decode8(gltfData) {
82133
+ const scenegraph = new GLTFScenegraph(gltfData);
82134
+ decodeExtFeatureMetadata(scenegraph);
82135
+ }
82136
+ function decodeExtFeatureMetadata(scenegraph) {
82137
+ const extension = scenegraph.getExtension(EXT_FEATURE_METADATA);
82138
+ const schemaClasses = extension?.schema?.classes;
82139
+ const featureTables = extension?.featureTables;
82140
+ const featureTextures = extension?.featureTextures;
82141
+ if (featureTextures) {
82142
+ console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');
82143
+ }
82144
+ if (schemaClasses && featureTables) {
82145
+ for (const schemaName in schemaClasses) {
82146
+ const schemaClass = schemaClasses[schemaName];
82147
+ const featureTable = findFeatureTableByName(featureTables, schemaName);
82148
+ if (featureTable) {
82149
+ handleFeatureTableProperties(scenegraph, featureTable, schemaClass);
82150
+ }
82151
+ }
82152
+ }
82153
+ }
82154
+ function handleFeatureTableProperties(scenegraph, featureTable, schemaClass) {
82155
+ for (const propertyName in schemaClass.properties) {
82156
+ const schemaProperty = schemaClass.properties[propertyName];
82157
+ const featureTableProperty = featureTable?.properties?.[propertyName];
82158
+ const numberOfFeatures = featureTable.count;
82159
+ if (featureTableProperty) {
82160
+ const data = getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty);
82161
+ featureTableProperty.data = data;
82162
+ }
82163
+ }
82164
+ }
82165
+ function getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
82166
+ const bufferView = featureTableProperty.bufferView;
82167
+ let data = scenegraph.getTypedArrayForBufferView(bufferView);
82168
+ switch (schemaProperty.type) {
82169
+ case "STRING": {
82170
+ const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView;
82171
+ const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);
82172
+ data = getStringAttributes(data, offsetsData, numberOfFeatures);
82173
+ break;
82174
+ }
82175
+ default:
82176
+ }
82177
+ return data;
82178
+ }
82179
+ function findFeatureTableByName(featureTables, schemaClassName) {
82180
+ for (const featureTableName in featureTables) {
82181
+ const featureTable = featureTables[featureTableName];
82182
+ if (featureTable.class === schemaClassName) {
82183
+ return featureTable;
82184
+ }
82185
+ }
82186
+ return null;
82187
+ }
82188
+ function getStringAttributes(data, offsetsData, stringsCount) {
82189
+ const stringsArray = [];
82190
+ const textDecoder = new TextDecoder("utf8");
82191
+ let stringOffset = 0;
82192
+ const bytesPerStringSize = 4;
82193
+ for (let index = 0; index < stringsCount; index++) {
82194
+ const stringByteSize = offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];
82195
+ const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);
82196
+ const stringAttribute = textDecoder.decode(stringData);
82197
+ stringsArray.push(stringAttribute);
82198
+ stringOffset += stringByteSize;
82199
+ }
82200
+ return stringsArray;
82201
+ }
82202
+
82083
82203
  // ../gltf/src/lib/api/gltf-extensions.ts
82084
82204
  var EXTENSIONS2 = [
82085
82205
  EXT_meshopt_compression_exports,
@@ -82089,7 +82209,8 @@ var EXTENSIONS2 = [
82089
82209
  KHR_lights_punctual_exports,
82090
82210
  KHR_materials_unlit_exports,
82091
82211
  KHR_techniques_webgl_exports,
82092
- KHR_texture_transform_exports
82212
+ KHR_texture_transform_exports,
82213
+ EXT_feature_metadata_exports
82093
82214
  ];
82094
82215
  function preprocessExtensions(gltf, options = {}, context) {
82095
82216
  const extensions = EXTENSIONS2.filter((extension) => useExtension(extension.name, options));
@@ -83279,8 +83400,8 @@ async function parse3DTilesSubtree(data) {
83279
83400
  }
83280
83401
  return subtree;
83281
83402
  }
83282
- async function getExplicitBitstream(subtree, name9, internalBinaryBuffer) {
83283
- const bufferViewIndex = subtree[name9].bufferView;
83403
+ async function getExplicitBitstream(subtree, name10, internalBinaryBuffer) {
83404
+ const bufferViewIndex = subtree[name10].bufferView;
83284
83405
  const bufferView = subtree.bufferViews[bufferViewIndex];
83285
83406
  const buffer = subtree.buffers[bufferView.buffer];
83286
83407
  if (buffer.uri) {
@@ -83940,7 +84061,7 @@ var stringify = import_dist.default.stringify;
83940
84061
  var parse5 = import_dist.default.parse;
83941
84062
 
83942
84063
  // src/i3s-converter/i3s-converter.ts
83943
- var import_process = __toModule(require("process"));
84064
+ var import_process2 = __toModule(require("process"));
83944
84065
  var import_json_map_transform6 = __toModule(require_json_map_transform());
83945
84066
  var import_md52 = __toModule(require_md52());
83946
84067
 
@@ -84055,14 +84176,14 @@ var NodePages = class {
84055
84176
  for (const [index, nodePage] of this.nodePages.entries()) {
84056
84177
  const nodePageStr = JSON.stringify(nodePage);
84057
84178
  const slpkPath = (0, import_path2.join)(layers0Path, "nodepages");
84058
- writeQueue.enqueue({
84179
+ await writeQueue.enqueue({
84059
84180
  archiveKey: `nodePages/${index.toString()}.json.gz`,
84060
84181
  writePromise: this.writeFile(slpkPath, nodePageStr, `${index.toString()}.json`)
84061
84182
  });
84062
84183
  }
84063
84184
  const metadata = (0, import_json_map_transform.default)({ nodeCount: this.nodesCounter }, METADATA());
84064
84185
  const compress = false;
84065
- writeQueue.enqueue({
84186
+ await writeQueue.enqueue({
84066
84187
  archiveKey: "metadata.json",
84067
84188
  writePromise: this.writeFile(layers0Path, JSON.stringify(metadata), "metadata.json", compress)
84068
84189
  });
@@ -84070,7 +84191,7 @@ var NodePages = class {
84070
84191
  for (const [index, nodePage] of this.nodePages.entries()) {
84071
84192
  const nodePageStr = JSON.stringify(nodePage);
84072
84193
  const nodePagePath = (0, import_path2.join)(layers0Path, "nodepages", index.toString());
84073
- writeQueue.enqueue({ writePromise: this.writeFile(nodePagePath, nodePageStr) });
84194
+ await writeQueue.enqueue({ writePromise: this.writeFile(nodePagePath, nodePageStr) });
84074
84195
  }
84075
84196
  }
84076
84197
  }
@@ -84269,30 +84390,42 @@ function generateAttributes(attributes) {
84269
84390
  function calculateFaceRangesAndFeaturesCount(featureIndices) {
84270
84391
  let rangeIndex = 1;
84271
84392
  let featureIndex = 1;
84272
- let currentFeatureId = featureIndices[0];
84393
+ let currentFeatureId = getFrequentValue(featureIndices.slice(0, VALUES_PER_VERTEX));
84273
84394
  const faceRangeList = [];
84274
84395
  const featureIds = [];
84275
84396
  const uniqueFeatureIds = [currentFeatureId];
84276
84397
  faceRangeList[0] = 0;
84277
84398
  featureIds[0] = currentFeatureId;
84278
- for (let index = 1; index < featureIndices.length; index++) {
84279
- if (currentFeatureId !== featureIndices[index]) {
84399
+ for (let index = VALUES_PER_VERTEX; index < featureIndices.length; index += VALUES_PER_VERTEX) {
84400
+ const newFeatureId = getFrequentValue(featureIndices.slice(index, index + VALUES_PER_VERTEX));
84401
+ if (currentFeatureId !== newFeatureId) {
84280
84402
  faceRangeList[rangeIndex] = index / VALUES_PER_VERTEX - 1;
84281
84403
  faceRangeList[rangeIndex + 1] = index / VALUES_PER_VERTEX;
84282
- featureIds[featureIndex] = featureIndices[index];
84283
- if (!uniqueFeatureIds.includes(featureIndices[index])) {
84284
- uniqueFeatureIds.push(featureIndices[index]);
84404
+ featureIds[featureIndex] = newFeatureId;
84405
+ if (!uniqueFeatureIds.includes(newFeatureId)) {
84406
+ uniqueFeatureIds.push(newFeatureId);
84285
84407
  }
84286
84408
  rangeIndex += 2;
84287
84409
  featureIndex += 1;
84288
84410
  }
84289
- currentFeatureId = featureIndices[index];
84411
+ currentFeatureId = newFeatureId;
84290
84412
  }
84291
84413
  faceRangeList[rangeIndex] = featureIndices.length / VALUES_PER_VERTEX - 1;
84292
84414
  const faceRange = new Uint32Array(faceRangeList);
84293
84415
  const featureCount = uniqueFeatureIds.length;
84294
84416
  return { faceRange, featureCount, featureIds };
84295
84417
  }
84418
+ function getFrequentValue(values) {
84419
+ const map = {};
84420
+ let mostFrequentValue = values[0];
84421
+ let maxCount = 1;
84422
+ for (const value of values) {
84423
+ map[value] = (map[value] || 0) + 1;
84424
+ maxCount = maxCount > map[value] ? maxCount : map[value];
84425
+ mostFrequentValue = maxCount > map[value] ? mostFrequentValue : value;
84426
+ }
84427
+ return mostFrequentValue;
84428
+ }
84296
84429
  function makeAttributeObjects(attributes) {
84297
84430
  const {
84298
84431
  featureIds,
@@ -84528,7 +84661,7 @@ function prepareDataForAttributesConversion(tileContent) {
84528
84661
 
84529
84662
  // src/i3s-converter/helpers/batch-ids-extensions.ts
84530
84663
  var EXT_MESH_FEATURES = "EXT_mesh_features";
84531
- var EXT_FEATURE_METADATA = "EXT_feature_metadata";
84664
+ var EXT_FEATURE_METADATA2 = "EXT_feature_metadata";
84532
84665
  function handleBatchIdsExtensions(attributes, primitive, images) {
84533
84666
  const extensions = primitive?.extensions;
84534
84667
  if (!extensions) {
@@ -84536,7 +84669,7 @@ function handleBatchIdsExtensions(attributes, primitive, images) {
84536
84669
  }
84537
84670
  for (const [extensionName, extensionData] of Object.entries(extensions || {})) {
84538
84671
  switch (extensionName) {
84539
- case EXT_FEATURE_METADATA:
84672
+ case EXT_FEATURE_METADATA2:
84540
84673
  return handleExtFeatureMetadataExtension(attributes, extensionData, images);
84541
84674
  case EXT_MESH_FEATURES:
84542
84675
  console.warn("EXT_mesh_features extension is not supported yet");
@@ -84559,9 +84692,16 @@ function handleExtFeatureMetadataExtension(attributes, extFeatureMetadata, image
84559
84692
  }
84560
84693
  const featureIdTexture = extFeatureMetadata?.featureIdTextures && extFeatureMetadata?.featureIdTextures[0];
84561
84694
  if (featureIdTexture) {
84562
- const textureCoordinates = attributes.TEXCOORD_0.value;
84695
+ const textureAttributeIndex = featureIdTexture?.featureIds?.texture?.texCoord || 0;
84696
+ const textCoordAttribute = `TEXCOORD_${textureAttributeIndex}`;
84697
+ const textureCoordinates = attributes[textCoordAttribute].value;
84563
84698
  return generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, images);
84564
84699
  }
84700
+ const featureTexture = extFeatureMetadata?.featureTextures && extFeatureMetadata?.featureTextures[0];
84701
+ if (featureTexture) {
84702
+ console.warn("EXT_feature_metadata doesn't yet support featureTextures in primitive");
84703
+ return [];
84704
+ }
84565
84705
  return [];
84566
84706
  }
84567
84707
  function generateImplicitFeatureIds(featuresCount, constant = 0, divisor = 0) {
@@ -84616,6 +84756,33 @@ function emod(n) {
84616
84756
  return (n % 1 + 1) % 1;
84617
84757
  }
84618
84758
 
84759
+ // src/i3s-converter/helpers/feature-attributes.ts
84760
+ function flattenPropertyTableByFeatureIds(featureIds, propertyTable) {
84761
+ const resultPropertyTable = {};
84762
+ for (const propertyName in propertyTable) {
84763
+ const properties = propertyTable[propertyName];
84764
+ resultPropertyTable[propertyName] = getPropertiesByFeatureIds(properties, featureIds);
84765
+ }
84766
+ return resultPropertyTable;
84767
+ }
84768
+ function getPropertiesByFeatureIds(properties, featureIds) {
84769
+ const resultProperties = [];
84770
+ for (const featureId of featureIds) {
84771
+ const property = properties[featureId] || null;
84772
+ resultProperties.push(property);
84773
+ }
84774
+ return resultProperties;
84775
+ }
84776
+ function checkPropertiesLength(featureIds, propertyTable) {
84777
+ let needFlatten = false;
84778
+ for (const attribute of Object.values(propertyTable)) {
84779
+ if (featureIds.length !== attribute.length) {
84780
+ needFlatten = true;
84781
+ }
84782
+ }
84783
+ return needFlatten;
84784
+ }
84785
+
84619
84786
  // src/i3s-converter/helpers/geometry-converter.ts
84620
84787
  var DEFAULT_ROUGHNESS_FACTOR = 1;
84621
84788
  var DEFAULT_METALLIC_FACTOR = 1;
@@ -84627,8 +84794,10 @@ var SHORT_INT_TYPE = "Int32";
84627
84794
  var DOUBLE_TYPE = "Float64";
84628
84795
  var OBJECT_ID_TYPE = "Oid32";
84629
84796
  var BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ["CUSTOM_ATTRIBUTE_2", "_BATCHID", "BATCHID"];
84797
+ var EXT_FEATURE_METADATA3 = "EXT_feature_metadata";
84798
+ var EXT_MESH_FEATURES2 = "EXT_mesh_features";
84630
84799
  var scratchVector5 = new import_core22.Vector3();
84631
- async function convertB3dmToI3sGeometry(tileContent, nodeId, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, geoidHeightModel, workerSource) {
84800
+ async function convertB3dmToI3sGeometry(tileContent, nodeId, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, geoidHeightModel, workerSource) {
84632
84801
  const useCartesianPositions = generateBoundingVolumes;
84633
84802
  const materialAndTextureList = convertMaterials(tileContent.gltf?.materials);
84634
84803
  const dataForAttributesConversion = prepareDataForAttributesConversion(tileContent);
@@ -84664,6 +84833,7 @@ async function convertB3dmToI3sGeometry(tileContent, nodeId, featuresHashArray,
84664
84833
  tileContent,
84665
84834
  nodeId: nodesCounter,
84666
84835
  featuresHashArray,
84836
+ propertyTable,
84667
84837
  attributeStorageInfo,
84668
84838
  draco,
84669
84839
  workerSource
@@ -84696,6 +84866,7 @@ async function _makeNodeResources({
84696
84866
  tileContent,
84697
84867
  nodeId,
84698
84868
  featuresHashArray,
84869
+ propertyTable,
84699
84870
  attributeStorageInfo,
84700
84871
  draco,
84701
84872
  workerSource
@@ -84718,7 +84889,10 @@ async function _makeNodeResources({
84718
84889
  featureIds,
84719
84890
  faceRange
84720
84891
  }, workerSource.draco) : null;
84721
- const attributes = convertBatchTableToAttributeBuffers(tileContent.batchTableJson, featureIds, attributeStorageInfo);
84892
+ let attributes = [];
84893
+ if (attributeStorageInfo && propertyTable) {
84894
+ attributes = convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo);
84895
+ }
84722
84896
  return {
84723
84897
  geometry: fileBuffer,
84724
84898
  compressedGeometry,
@@ -85095,37 +85269,40 @@ function replaceIndicesByUnique(indicesArray, featureMap) {
85095
85269
  indicesArray[index] = featureMap[indicesArray[index]];
85096
85270
  }
85097
85271
  }
85098
- function convertBatchTableToAttributeBuffers(batchTable, featureIds, attributeStorageInfo) {
85272
+ function convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo) {
85099
85273
  const attributeBuffers = [];
85100
- if (batchTable) {
85101
- const batchTableWithFeatureIds = {
85102
- OBJECTID: featureIds,
85103
- ...batchTable
85104
- };
85105
- for (const key in batchTableWithFeatureIds) {
85106
- const type = getAttributeType(key, attributeStorageInfo);
85107
- let attributeBuffer = null;
85108
- switch (type) {
85109
- case OBJECT_ID_TYPE:
85110
- case SHORT_INT_TYPE:
85111
- attributeBuffer = generateShortIntegerAttributeBuffer(batchTableWithFeatureIds[key]);
85112
- break;
85113
- case DOUBLE_TYPE:
85114
- attributeBuffer = generateDoubleAttributeBuffer(batchTableWithFeatureIds[key]);
85115
- break;
85116
- case STRING_TYPE:
85117
- attributeBuffer = generateStringAttributeBuffer(batchTableWithFeatureIds[key]);
85118
- break;
85119
- default:
85120
- attributeBuffer = generateStringAttributeBuffer(batchTableWithFeatureIds[key]);
85121
- }
85122
- if (attributeBuffer) {
85123
- attributeBuffers.push(attributeBuffer);
85124
- }
85125
- }
85274
+ const needFlattenPropertyTable = checkPropertiesLength(featureIds, propertyTable);
85275
+ const properties = needFlattenPropertyTable ? flattenPropertyTableByFeatureIds(featureIds, propertyTable) : propertyTable;
85276
+ const propertyTableWithObjectIds = {
85277
+ OBJECTID: featureIds,
85278
+ ...properties
85279
+ };
85280
+ for (const propertyName in propertyTableWithObjectIds) {
85281
+ const type = getAttributeType(propertyName, attributeStorageInfo);
85282
+ const value = propertyTableWithObjectIds[propertyName];
85283
+ const attributeBuffer = generateAttributeBuffer(type, value);
85284
+ attributeBuffers.push(attributeBuffer);
85126
85285
  }
85127
85286
  return attributeBuffers;
85128
85287
  }
85288
+ function generateAttributeBuffer(type, value) {
85289
+ let attributeBuffer;
85290
+ switch (type) {
85291
+ case OBJECT_ID_TYPE:
85292
+ case SHORT_INT_TYPE:
85293
+ attributeBuffer = generateShortIntegerAttributeBuffer(value);
85294
+ break;
85295
+ case DOUBLE_TYPE:
85296
+ attributeBuffer = generateDoubleAttributeBuffer(value);
85297
+ break;
85298
+ case STRING_TYPE:
85299
+ attributeBuffer = generateStringAttributeBuffer(value);
85300
+ break;
85301
+ default:
85302
+ attributeBuffer = generateStringAttributeBuffer(value);
85303
+ }
85304
+ return attributeBuffer;
85305
+ }
85129
85306
  function getAttributeType(key, attributeStorageInfo) {
85130
85307
  const attribute = attributeStorageInfo.find((attr) => attr.name === key);
85131
85308
  return attribute.attributeValues.valueType;
@@ -85210,6 +85387,59 @@ function generateFeatureIndexAttribute(featureIndex, faceRange) {
85210
85387
  }
85211
85388
  return orderedFeatureIndices;
85212
85389
  }
85390
+ function getPropertyTable(sourceTile) {
85391
+ const batchTableJson = sourceTile?.content?.batchTableJson;
85392
+ if (batchTableJson) {
85393
+ return batchTableJson;
85394
+ }
85395
+ const { extensionName, extension } = getPropertyTableExtension(sourceTile);
85396
+ switch (extensionName) {
85397
+ case EXT_MESH_FEATURES2: {
85398
+ console.warn("The I3S converter does not yet support the EXT_mesh_features extension");
85399
+ return null;
85400
+ }
85401
+ case EXT_FEATURE_METADATA3: {
85402
+ return getPropertyTableFromExtFeatureMetadata(extension);
85403
+ }
85404
+ default:
85405
+ return null;
85406
+ }
85407
+ }
85408
+ function getPropertyTableExtension(sourceTile) {
85409
+ const extensionsWithPropertyTables = [EXT_FEATURE_METADATA3, EXT_MESH_FEATURES2];
85410
+ const extensionsUsed = sourceTile?.content?.gltf?.extensionsUsed;
85411
+ if (!extensionsUsed) {
85412
+ return { extensionName: null, extension: null };
85413
+ }
85414
+ let extensionName = "";
85415
+ for (const extensionItem of sourceTile?.content?.gltf?.extensionsUsed) {
85416
+ if (extensionsWithPropertyTables.includes(extensionItem)) {
85417
+ extensionName = extensionItem;
85418
+ break;
85419
+ }
85420
+ }
85421
+ const extension = sourceTile?.content?.gltf?.extensions?.[extensionName];
85422
+ return { extensionName, extension };
85423
+ }
85424
+ function getPropertyTableFromExtFeatureMetadata(extension) {
85425
+ if (extension?.featureTextures) {
85426
+ console.warn("The I3S converter does not yet support the EXT_feature_metadata feature textures");
85427
+ return null;
85428
+ }
85429
+ if (extension?.featureTables) {
85430
+ const firstFeatureTableName = Object.keys(extension.featureTables)?.[0];
85431
+ if (firstFeatureTableName) {
85432
+ const featureTable = extension?.featureTables[firstFeatureTableName];
85433
+ const propertyTable = {};
85434
+ for (const propertyName in featureTable.properties) {
85435
+ propertyTable[propertyName] = featureTable.properties[propertyName].data;
85436
+ }
85437
+ return propertyTable;
85438
+ }
85439
+ }
85440
+ console.warn("The I3S converter couldn't handle EXT_feature_metadata extension");
85441
+ return null;
85442
+ }
85213
85443
 
85214
85444
  // src/i3s-converter/helpers/create-scene-server-path.ts
85215
85445
  var import_json_map_transform2 = __toModule(require_json_map_transform());
@@ -85920,6 +86150,8 @@ var Queue = class extends Array {
85920
86150
  };
85921
86151
 
85922
86152
  // src/lib/utils/write-queue.ts
86153
+ var import_process = __toModule(require("process"));
86154
+ var MEMORY_LIMIT = 4 * 1024 * 1024 * 1024;
85923
86155
  var WriteQueue = class extends Queue {
85924
86156
  constructor(listeningInterval = 2e3, writeConcurrency = 400) {
85925
86157
  super();
@@ -85928,6 +86160,12 @@ var WriteQueue = class extends Queue {
85928
86160
  this.listeningInterval = listeningInterval;
85929
86161
  this.writeConcurrency = writeConcurrency;
85930
86162
  }
86163
+ async enqueue(val) {
86164
+ super.enqueue(val);
86165
+ if (import_process.default.memoryUsage().rss > MEMORY_LIMIT) {
86166
+ await this.startWrite();
86167
+ }
86168
+ }
85931
86169
  startListening() {
85932
86170
  this.intervalId = setInterval(this.startWrite.bind(this), this.listeningInterval);
85933
86171
  }
@@ -85994,7 +86232,7 @@ var I3SAttributesWorker = {
85994
86232
  var BROWSER_ERROR_MESSAGE = "Tile converter does not work in browser, only in node js environment";
85995
86233
 
85996
86234
  // src/i3s-converter/i3s-converter.ts
85997
- var ION_DEFAULT_TOKEN = import_process.default.env?.IonToken || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ";
86235
+ var ION_DEFAULT_TOKEN = import_process2.default.env?.IonToken || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ";
85998
86236
  var HARDCODED_NODES_PER_PAGE = 64;
85999
86237
  var _3D_TILES = "3DTILES";
86000
86238
  var _3D_OBJECT_LAYER_TYPE = "3DObject";
@@ -86036,7 +86274,7 @@ var I3SConverter = class {
86036
86274
  console.log(BROWSER_ERROR_MESSAGE);
86037
86275
  return BROWSER_ERROR_MESSAGE;
86038
86276
  }
86039
- this.conversionStartTime = import_process.default.hrtime();
86277
+ this.conversionStartTime = import_process2.default.hrtime();
86040
86278
  const {
86041
86279
  tilesetName,
86042
86280
  slpk,
@@ -86168,12 +86406,12 @@ var I3SConverter = class {
86168
86406
  const [child] = await this._createNode(root0, sourceRootTile, parentId, 0);
86169
86407
  const childPath = (0, import_path7.join)(this.layers0Path, "nodes", child.path);
86170
86408
  if (this.options.slpk) {
86171
- this.writeQueue.enqueue({
86409
+ await this.writeQueue.enqueue({
86172
86410
  archiveKey: "nodes/1/3dNodeIndexDocument.json.gz",
86173
86411
  writePromise: writeFileForSlpk(childPath, JSON.stringify(child), "3dNodeIndexDocument.json")
86174
86412
  });
86175
86413
  } else {
86176
- this.writeQueue.enqueue({ writePromise: writeFile3(childPath, JSON.stringify(child)) });
86414
+ await this.writeQueue.enqueue({ writePromise: writeFile3(childPath, JSON.stringify(child)) });
86177
86415
  }
86178
86416
  } else {
86179
86417
  await this._addChildrenWithNeighborsAndWriteFile({
@@ -86187,24 +86425,24 @@ var I3SConverter = class {
86187
86425
  }
86188
86426
  async _writeLayers0() {
86189
86427
  if (this.options.slpk) {
86190
- this.writeQueue.enqueue({
86428
+ await this.writeQueue.enqueue({
86191
86429
  archiveKey: "3dSceneLayer.json.gz",
86192
86430
  writePromise: writeFileForSlpk(this.layers0Path, JSON.stringify(this.layers0), "3dSceneLayer.json")
86193
86431
  });
86194
86432
  } else {
86195
- this.writeQueue.enqueue({
86433
+ await this.writeQueue.enqueue({
86196
86434
  writePromise: writeFile3(this.layers0Path, JSON.stringify(this.layers0))
86197
86435
  });
86198
86436
  }
86199
86437
  }
86200
86438
  async _writeNodeIndexDocument(root0, nodePath, rootPath) {
86201
86439
  if (this.options.slpk) {
86202
- this.writeQueue.enqueue({
86440
+ await this.writeQueue.enqueue({
86203
86441
  archiveKey: `nodes/${nodePath}/3dNodeIndexDocument.json.gz`,
86204
86442
  writePromise: writeFileForSlpk(rootPath, JSON.stringify(root0), "3dNodeIndexDocument.json")
86205
86443
  });
86206
86444
  } else {
86207
- this.writeQueue.enqueue({ writePromise: writeFile3(rootPath, JSON.stringify(root0)) });
86445
+ await this.writeQueue.enqueue({ writePromise: writeFile3(rootPath, JSON.stringify(root0)) });
86208
86446
  }
86209
86447
  }
86210
86448
  async _createSlpk(tilesetPath) {
@@ -86286,11 +86524,11 @@ var I3SConverter = class {
86286
86524
  await this._updateTilesetOptions();
86287
86525
  await this.sourceTileset._loadTile(sourceTile);
86288
86526
  let boundingVolumes = createBoundingVolumes(sourceTile, this.geoidHeightModel);
86289
- const batchTable = sourceTile?.content?.batchTableJson;
86290
- if (batchTable) {
86291
- this._convertAttributeStorageInfo(sourceTile.content);
86527
+ const propertyTable = getPropertyTable(sourceTile);
86528
+ if (propertyTable && !this.layers0?.attributeStorageInfo?.length) {
86529
+ this._convertPropertyTableToNodeAttributes(propertyTable);
86292
86530
  }
86293
- const resourcesData = await this._convertResources(sourceTile);
86531
+ const resourcesData = await this._convertResources(sourceTile, propertyTable);
86294
86532
  const nodes = [];
86295
86533
  const nodesInPage = [];
86296
86534
  const emptyResources = {
@@ -86334,17 +86572,11 @@ var I3SConverter = class {
86334
86572
  });
86335
86573
  return nodes;
86336
86574
  }
86337
- _convertAttributeStorageInfo(sourceTileContent) {
86338
- const batchTable = sourceTileContent && sourceTileContent.batchTableJson;
86339
- if (batchTable && !this.layers0?.attributeStorageInfo?.length) {
86340
- this._convertBatchTableInfoToNodeAttributes(batchTable);
86341
- }
86342
- }
86343
- async _convertResources(sourceTile) {
86575
+ async _convertResources(sourceTile, propertyTable) {
86344
86576
  if (!this.isContentSupported(sourceTile)) {
86345
86577
  return null;
86346
86578
  }
86347
- const resourcesData = await convertB3dmToI3sGeometry(sourceTile.content, Number(this.nodePages.nodesCounter), this.featuresHashArray, this.layers0?.attributeStorageInfo, this.options.draco, this.generateBoundingVolumes, this.geoidHeightModel, this.workerSource);
86579
+ const resourcesData = await convertB3dmToI3sGeometry(sourceTile.content, Number(this.nodePages.nodesCounter), propertyTable, this.featuresHashArray, this.layers0?.attributeStorageInfo, this.options.draco, this.generateBoundingVolumes, this.geoidHeightModel, this.workerSource);
86348
86580
  return resourcesData;
86349
86581
  }
86350
86582
  _createNodeInNodePages(maxScreenThresholdSQ, boundingVolumes, sourceTile, parentId, resources) {
@@ -86441,26 +86673,26 @@ var I3SConverter = class {
86441
86673
  async _writeGeometries(geometryBuffer, compressedGeometry, childPath, slpkChildPath) {
86442
86674
  if (this.options.slpk) {
86443
86675
  const slpkGeometryPath = (0, import_path7.join)(childPath, "geometries");
86444
- this.writeQueue.enqueue({
86676
+ await this.writeQueue.enqueue({
86445
86677
  archiveKey: `${slpkChildPath}/geometries/0.bin.gz`,
86446
86678
  writePromise: writeFileForSlpk(slpkGeometryPath, geometryBuffer, "0.bin")
86447
86679
  });
86448
86680
  } else {
86449
86681
  const geometryPath = (0, import_path7.join)(childPath, "geometries/0/");
86450
- this.writeQueue.enqueue({
86682
+ await this.writeQueue.enqueue({
86451
86683
  writePromise: writeFile3(geometryPath, geometryBuffer, "index.bin")
86452
86684
  });
86453
86685
  }
86454
86686
  if (this.options.draco) {
86455
86687
  if (this.options.slpk) {
86456
86688
  const slpkCompressedGeometryPath = (0, import_path7.join)(childPath, "geometries");
86457
- this.writeQueue.enqueue({
86689
+ await this.writeQueue.enqueue({
86458
86690
  archiveKey: `${slpkChildPath}/geometries/1.bin.gz`,
86459
86691
  writePromise: writeFileForSlpk(slpkCompressedGeometryPath, compressedGeometry, "1.bin")
86460
86692
  });
86461
86693
  } else {
86462
86694
  const compressedGeometryPath = (0, import_path7.join)(childPath, "geometries/1/");
86463
- this.writeQueue.enqueue({
86695
+ await this.writeQueue.enqueue({
86464
86696
  writePromise: writeFile3(compressedGeometryPath, compressedGeometry, "index.bin")
86465
86697
  });
86466
86698
  }
@@ -86475,13 +86707,13 @@ var I3SConverter = class {
86475
86707
  const sharedDataStr = JSON.stringify(sharedData);
86476
86708
  if (this.options.slpk) {
86477
86709
  const slpkSharedPath = (0, import_path7.join)(childPath, "shared");
86478
- this.writeQueue.enqueue({
86710
+ await this.writeQueue.enqueue({
86479
86711
  archiveKey: `${slpkChildPath}/shared/sharedResource.json.gz`,
86480
86712
  writePromise: writeFileForSlpk(slpkSharedPath, sharedDataStr, "sharedResource.json")
86481
86713
  });
86482
86714
  } else {
86483
86715
  const sharedPath = (0, import_path7.join)(childPath, "shared/");
86484
- this.writeQueue.enqueue({ writePromise: writeFile3(sharedPath, sharedDataStr) });
86716
+ await this.writeQueue.enqueue({ writePromise: writeFile3(sharedPath, sharedDataStr) });
86485
86717
  }
86486
86718
  }
86487
86719
  async _writeTexture(texture, childPath, slpkChildPath) {
@@ -86523,17 +86755,17 @@ var I3SConverter = class {
86523
86755
  }
86524
86756
  }
86525
86757
  }
86526
- async writeTextureFile(textureData, name9, format, childPath, slpkChildPath) {
86758
+ async writeTextureFile(textureData, name10, format, childPath, slpkChildPath) {
86527
86759
  if (this.options.slpk) {
86528
86760
  const slpkTexturePath = (0, import_path7.join)(childPath, "textures");
86529
86761
  const compress = false;
86530
- this.writeQueue.enqueue({
86531
- archiveKey: `${slpkChildPath}/textures/${name9}.${format}`,
86532
- writePromise: writeFileForSlpk(slpkTexturePath, textureData, `${name9}.${format}`, compress)
86762
+ await this.writeQueue.enqueue({
86763
+ archiveKey: `${slpkChildPath}/textures/${name10}.${format}`,
86764
+ writePromise: writeFileForSlpk(slpkTexturePath, textureData, `${name10}.${format}`, compress)
86533
86765
  });
86534
86766
  } else {
86535
- const texturePath = (0, import_path7.join)(childPath, `textures/${name9}/`);
86536
- this.writeQueue.enqueue({
86767
+ const texturePath = (0, import_path7.join)(childPath, `textures/${name10}/`);
86768
+ await this.writeQueue.enqueue({
86537
86769
  writePromise: writeFile3(texturePath, textureData, `index.${format}`)
86538
86770
  });
86539
86771
  }
@@ -86545,13 +86777,13 @@ var I3SConverter = class {
86545
86777
  const fileBuffer = new Uint8Array(attributes[index]);
86546
86778
  if (this.options.slpk) {
86547
86779
  const slpkAttributesPath = (0, import_path7.join)(childPath, "attributes", folderName);
86548
- this.writeQueue.enqueue({
86780
+ await this.writeQueue.enqueue({
86549
86781
  archiveKey: `${slpkChildPath}/attributes/${folderName}.bin.gz`,
86550
86782
  writePromise: writeFileForSlpk(slpkAttributesPath, fileBuffer, "0.bin")
86551
86783
  });
86552
86784
  } else {
86553
86785
  const attributesPath = (0, import_path7.join)(childPath, `attributes/${folderName}/0`);
86554
- this.writeQueue.enqueue({
86786
+ await this.writeQueue.enqueue({
86555
86787
  writePromise: writeFile3(attributesPath, fileBuffer, "index.bin")
86556
86788
  });
86557
86789
  }
@@ -86647,19 +86879,19 @@ var I3SConverter = class {
86647
86879
  alias: key
86648
86880
  };
86649
86881
  }
86650
- _convertBatchTableInfoToNodeAttributes(batchTable) {
86882
+ _convertPropertyTableToNodeAttributes(propertyTable) {
86651
86883
  let attributeIndex = 0;
86652
- const batchTableWithObjectId = {
86884
+ const propertyTableWithObjectId = {
86653
86885
  OBJECTID: [0],
86654
- ...batchTable
86886
+ ...propertyTable
86655
86887
  };
86656
- for (const key in batchTableWithObjectId) {
86657
- const firstAttribute = batchTableWithObjectId[key][0];
86888
+ for (const key in propertyTableWithObjectId) {
86889
+ const firstAttribute = propertyTableWithObjectId[key][0];
86658
86890
  const attributeType = this.getAttributeType(key, firstAttribute);
86659
86891
  const storageAttribute = this._createdStorageAttribute(attributeIndex, key, attributeType);
86660
86892
  const fieldAttributeType = this._getFieldAttributeType(attributeType);
86661
86893
  const fieldAttribute = this._createFieldAttribute(key, fieldAttributeType);
86662
- const popupInfo = this._createPopupInfo(batchTableWithObjectId);
86894
+ const popupInfo = this._createPopupInfo(propertyTableWithObjectId);
86663
86895
  this.layers0.attributeStorageInfo.push(storageAttribute);
86664
86896
  this.layers0.fields.push(fieldAttribute);
86665
86897
  this.layers0.popupInfo = popupInfo;
@@ -86681,13 +86913,13 @@ var I3SConverter = class {
86681
86913
  return "esriFieldTypeString";
86682
86914
  }
86683
86915
  }
86684
- _createPopupInfo(batchTable) {
86916
+ _createPopupInfo(propertyTable) {
86685
86917
  const title = "{OBJECTID}";
86686
86918
  const mediaInfos = [];
86687
86919
  const fieldInfos = [];
86688
86920
  const popupElements = [];
86689
86921
  const expressionInfos = [];
86690
- for (const key in batchTable) {
86922
+ for (const key in propertyTable) {
86691
86923
  fieldInfos.push({
86692
86924
  fieldName: key,
86693
86925
  visible: true,
@@ -86711,7 +86943,7 @@ var I3SConverter = class {
86711
86943
  const { tilesCount, tilesWithAddRefineCount } = this.refinementCounter;
86712
86944
  const addRefinementPercentage = tilesWithAddRefineCount ? tilesWithAddRefineCount / tilesCount * 100 : 0;
86713
86945
  const filesSize = await calculateFilesSize(params);
86714
- const diff = import_process.default.hrtime(this.conversionStartTime);
86946
+ const diff = import_process2.default.hrtime(this.conversionStartTime);
86715
86947
  const conversionTime = timeConverter(diff);
86716
86948
  console.log(`------------------------------------------------`);
86717
86949
  console.log(`Finishing conversion of ${_3D_TILES}`);
@@ -86729,15 +86961,15 @@ var I3SConverter = class {
86729
86961
  "cesium-ion": { accessToken: this.options.token || ION_DEFAULT_TOKEN }
86730
86962
  };
86731
86963
  const preloadOptions = await this.Loader.preload(this.options.inputUrl, options);
86732
- this.refreshTokenTime = import_process.default.hrtime();
86964
+ this.refreshTokenTime = import_process2.default.hrtime();
86733
86965
  return { ...options, ...preloadOptions };
86734
86966
  }
86735
86967
  async _updateTilesetOptions() {
86736
- const diff = import_process.default.hrtime(this.refreshTokenTime);
86968
+ const diff = import_process2.default.hrtime(this.refreshTokenTime);
86737
86969
  if (diff[0] < REFRESH_TOKEN_TIMEOUT) {
86738
86970
  return;
86739
86971
  }
86740
- this.refreshTokenTime = import_process.default.hrtime();
86972
+ this.refreshTokenTime = import_process2.default.hrtime();
86741
86973
  const preloadOptions = await this._fetchPreloadOptions();
86742
86974
  this.sourceTileset.options = { ...this.sourceTileset.options, ...preloadOptions };
86743
86975
  if (preloadOptions.headers) {
@@ -86783,7 +87015,7 @@ var I3SConverter = class {
86783
87015
 
86784
87016
  // src/3d-tiles-converter/3d-tiles-converter.ts
86785
87017
  var import_path8 = __toModule(require("path"));
86786
- var import_process2 = __toModule(require("process"));
87018
+ var import_process3 = __toModule(require("process"));
86787
87019
  var import_json_map_transform8 = __toModule(require_json_map_transform());
86788
87020
 
86789
87021
  // ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
@@ -86905,29 +87137,37 @@ function getLoaderForTextureFormat(textureFormat) {
86905
87137
  }
86906
87138
  }
86907
87139
  var I3S_ATTRIBUTE_TYPE = "i3s-attribute-type";
86908
- async function parseI3STileContent(arrayBuffer, tile, tileset, options, context) {
86909
- tile.content = tile.content || {};
86910
- tile.content.featureIds = tile.content.featureIds || null;
86911
- tile.content.attributes = {};
86912
- if (tile.textureUrl) {
86913
- const url = getUrlWithToken(tile.textureUrl, options?.i3s?.token);
86914
- const loader = getLoaderForTextureFormat(tile.textureFormat);
87140
+ var defaultContent = {
87141
+ attributes: {},
87142
+ indices: null,
87143
+ featureIds: [],
87144
+ vertexCount: 0,
87145
+ modelMatrix: new import_core27.Matrix4(),
87146
+ coordinateSystem: 0,
87147
+ byteLength: 0,
87148
+ texture: null
87149
+ };
87150
+ async function parseI3STileContent(arrayBuffer, tileOptions, tilesetOptions, options, context) {
87151
+ const content = defaultContent;
87152
+ if (tileOptions.textureUrl) {
87153
+ const url = getUrlWithToken(tileOptions.textureUrl, options?.i3s?.token);
87154
+ const loader = getLoaderForTextureFormat(tileOptions.textureFormat);
86915
87155
  const response = await fetch(url, options?.fetch);
86916
87156
  const arrayBuffer2 = await response.arrayBuffer();
86917
87157
  if (options?.i3s.decodeTextures) {
86918
87158
  if (loader === ImageLoader) {
86919
- const options2 = { ...tile.textureLoaderOptions, image: { type: "data" } };
87159
+ const options2 = { ...tileOptions.textureLoaderOptions, image: { type: "data" } };
86920
87160
  try {
86921
- tile.content.texture = await context.parse(arrayBuffer2, options2);
87161
+ content.texture = await context.parse(arrayBuffer2, options2);
86922
87162
  } catch (e) {
86923
- tile.content.texture = await parse(arrayBuffer2, loader, options2);
87163
+ content.texture = await parse(arrayBuffer2, loader, options2);
86924
87164
  }
86925
87165
  } else if (loader === CompressedTextureLoader || loader === BasisLoader) {
86926
- let texture = await load(arrayBuffer2, loader, tile.textureLoaderOptions);
87166
+ let texture = await load(arrayBuffer2, loader, tileOptions.textureLoaderOptions);
86927
87167
  if (loader === BasisLoader) {
86928
87168
  texture = texture[0];
86929
87169
  }
86930
- tile.content.texture = {
87170
+ content.texture = {
86931
87171
  compressed: true,
86932
87172
  mipmaps: false,
86933
87173
  width: texture[0].width,
@@ -86936,27 +87176,23 @@ async function parseI3STileContent(arrayBuffer, tile, tileset, options, context)
86936
87176
  };
86937
87177
  }
86938
87178
  } else {
86939
- tile.content.texture = arrayBuffer2;
87179
+ content.texture = arrayBuffer2;
86940
87180
  }
86941
87181
  }
86942
- tile.content.material = makePbrMaterial(tile.materialDefinition, tile.content.texture);
86943
- if (tile.content.material) {
86944
- tile.content.texture = null;
87182
+ content.material = makePbrMaterial(tileOptions.materialDefinition, content.texture);
87183
+ if (content.material) {
87184
+ content.texture = null;
86945
87185
  }
86946
- return await parseI3SNodeGeometry(arrayBuffer, tile, tileset, options);
87186
+ return await parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options);
86947
87187
  }
86948
- async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
86949
- if (!tile.content) {
86950
- return tile;
86951
- }
86952
- const content = tile.content;
87188
+ async function parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options) {
86953
87189
  const contentByteLength = arrayBuffer.byteLength;
86954
87190
  let attributes;
86955
87191
  let vertexCount;
86956
87192
  let byteOffset = 0;
86957
87193
  let featureCount = 0;
86958
87194
  let indices;
86959
- if (tile.isDracoGeometry) {
87195
+ if (tileOptions.isDracoGeometry) {
86960
87196
  const decompressedGeometry = await parse(arrayBuffer, DracoLoader2, {
86961
87197
  draco: {
86962
87198
  attributeNameEntry: I3S_ATTRIBUTE_TYPE
@@ -86991,8 +87227,8 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
86991
87227
  ordering: attributesOrder,
86992
87228
  featureAttributes,
86993
87229
  featureAttributeOrder
86994
- } = tileset.store.defaultGeometrySchema;
86995
- const headers = parseHeaders(tileset, arrayBuffer);
87230
+ } = tilesetOptions.store.defaultGeometrySchema;
87231
+ const headers = parseHeaders(arrayBuffer, tilesetOptions);
86996
87232
  byteOffset = headers.byteOffset;
86997
87233
  vertexCount = headers.vertexCount;
86998
87234
  featureCount = headers.featureCount;
@@ -87002,7 +87238,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
87002
87238
  attributes = concatAttributes(normalizedVertexAttributes, normalizedFeatureAttributes);
87003
87239
  }
87004
87240
  if (!options?.i3s?.coordinateSystem || options.i3s.coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS) {
87005
- const enuMatrix = parsePositions2(attributes.position, tile);
87241
+ const enuMatrix = parsePositions2(attributes.position, tileOptions);
87006
87242
  content.modelMatrix = enuMatrix.invert();
87007
87243
  content.coordinateSystem = COORDINATE_SYSTEM.METER_OFFSETS;
87008
87244
  } else {
@@ -87018,7 +87254,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
87018
87254
  };
87019
87255
  content.indices = indices || null;
87020
87256
  if (attributes.id && attributes.id.value) {
87021
- tile.content.featureIds = attributes.id.value;
87257
+ content.featureIds = attributes.id.value;
87022
87258
  }
87023
87259
  for (const attributeIndex in content.attributes) {
87024
87260
  if (!content.attributes[attributeIndex]) {
@@ -87027,7 +87263,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
87027
87263
  }
87028
87264
  content.vertexCount = vertexCount;
87029
87265
  content.byteLength = contentByteLength;
87030
- return tile;
87266
+ return content;
87031
87267
  }
87032
87268
  function updateAttributesMetadata(attributes, decompressedGeometry) {
87033
87269
  for (const key in decompressedGeometry.loaderData.attributes) {
@@ -87054,11 +87290,11 @@ function normalizeAttribute(attribute) {
87054
87290
  attribute.normalized = true;
87055
87291
  return attribute;
87056
87292
  }
87057
- function parseHeaders(tileset, arrayBuffer) {
87293
+ function parseHeaders(arrayBuffer, options) {
87058
87294
  let byteOffset = 0;
87059
87295
  let vertexCount = 0;
87060
87296
  let featureCount = 0;
87061
- for (const { property, type } of tileset.store.defaultGeometrySchema.header) {
87297
+ for (const { property, type } of options.store.defaultGeometrySchema.header) {
87062
87298
  const TypedArrayTypeHeader = getConstructorForDataFormat(type);
87063
87299
  switch (property) {
87064
87300
  case HeaderAttributeProperty.vertexCount:
@@ -87128,8 +87364,8 @@ function parseUint64Values(buffer, elementsCount, attributeSize) {
87128
87364
  }
87129
87365
  return new Uint32Array(values);
87130
87366
  }
87131
- function parsePositions2(attribute, tile) {
87132
- const mbs = tile.mbs;
87367
+ function parsePositions2(attribute, options) {
87368
+ const mbs = options.mbs;
87133
87369
  const value = attribute.value;
87134
87370
  const metadata = attribute.metadata;
87135
87371
  const enuMatrix = new import_core27.Matrix4();
@@ -87276,9 +87512,13 @@ var I3SContentLoader = {
87276
87512
  }
87277
87513
  };
87278
87514
  async function parse6(data, options, context) {
87279
- const { tile, tileset } = options?.i3s || {};
87280
- await parseI3STileContent(data, tile, tileset, options, context);
87281
- return tile.content;
87515
+ const { tile, _tileOptions, tileset, _tilesetOptions } = options?.i3s || {};
87516
+ const tileOptions = _tileOptions || tile;
87517
+ const tilesetOptions = _tilesetOptions || tileset;
87518
+ if (!tileOptions || !tilesetOptions) {
87519
+ return null;
87520
+ }
87521
+ return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
87282
87522
  }
87283
87523
 
87284
87524
  // ../i3s/src/lib/parsers/parse-i3s.ts
@@ -87476,7 +87716,7 @@ var I3SNodePagesTiles = class {
87476
87716
  };
87477
87717
 
87478
87718
  // ../i3s/src/lib/parsers/parse-i3s.ts
87479
- function normalizeTileData2(tile, options, context) {
87719
+ function normalizeTileData2(tile, context) {
87480
87720
  const url = context.url || "";
87481
87721
  let contentUrl;
87482
87722
  if (tile.geometryData) {
@@ -87564,12 +87804,13 @@ var I3SLoader = {
87564
87804
  extensions: ["bin"],
87565
87805
  options: {
87566
87806
  i3s: {
87567
- loadContent: true,
87568
87807
  token: null,
87569
87808
  isTileset: "auto",
87570
87809
  isTileHeader: "auto",
87571
87810
  tile: null,
87572
87811
  tileset: null,
87812
+ _tileOptions: null,
87813
+ _tilesetOptions: null,
87573
87814
  useDracoGeometry: true,
87574
87815
  useCompressedTextures: true,
87575
87816
  decodeTextures: true,
@@ -87577,7 +87818,7 @@ var I3SLoader = {
87577
87818
  }
87578
87819
  }
87579
87820
  };
87580
- async function parseI3S(data, options, context) {
87821
+ async function parseI3S(data, options = {}, context) {
87581
87822
  const url = context.url;
87582
87823
  options.i3s = options.i3s || {};
87583
87824
  const magicNumber = getMagicNumber(data);
@@ -87599,11 +87840,7 @@ async function parseI3S(data, options, context) {
87599
87840
  if (isTileset) {
87600
87841
  data = await parseTileset2(data, options, context);
87601
87842
  } else if (isTileHeader) {
87602
- data = await parseTile2(data, options, context);
87603
- if (options.i3s.loadContent) {
87604
- options.i3s.tile = data;
87605
- await load(data.contentUrl, I3SLoader, options);
87606
- }
87843
+ data = await parseTile2(data, context);
87607
87844
  } else {
87608
87845
  data = await parseTileContent(data, options);
87609
87846
  }
@@ -87618,9 +87855,9 @@ async function parseTileset2(data, options, context) {
87618
87855
  await normalizeTilesetData(tilesetJson, options, context);
87619
87856
  return tilesetJson;
87620
87857
  }
87621
- async function parseTile2(data, options, context) {
87858
+ async function parseTile2(data, context) {
87622
87859
  data = JSON.parse(new TextDecoder().decode(data));
87623
- return normalizeTileData2(data, options, context);
87860
+ return normalizeTileData2(data, context);
87624
87861
  }
87625
87862
  function getMagicNumber(data) {
87626
87863
  if (data instanceof ArrayBuffer) {
@@ -88013,7 +88250,7 @@ var Tiles3DConverter = class {
88013
88250
  return BROWSER_ERROR_MESSAGE;
88014
88251
  }
88015
88252
  const { inputUrl, outputPath, tilesetName, maxDepth, egmFilePath } = options;
88016
- this.conversionStartTime = import_process2.default.hrtime();
88253
+ this.conversionStartTime = import_process3.default.hrtime();
88017
88254
  this.options = { maxDepth };
88018
88255
  console.log("Loading egm file...");
88019
88256
  this.geoidHeightModel = await load(egmFilePath, PGMLoader);
@@ -88163,7 +88400,7 @@ var Tiles3DConverter = class {
88163
88400
  }
88164
88401
  async _finishConversion(params) {
88165
88402
  const filesSize = await calculateFilesSize(params);
88166
- const diff = import_process2.default.hrtime(this.conversionStartTime);
88403
+ const diff = import_process3.default.hrtime(this.conversionStartTime);
88167
88404
  const conversionTime = timeConverter(diff);
88168
88405
  console.log(`------------------------------------------------`);
88169
88406
  console.log(`Finish conversion of ${I3S}`);