@loaders.gl/tile-converter 3.2.7 → 3.3.0-alpha.3

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 (77) 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-cli.js +30 -7
  4. package/dist/converter.min.js +1 -1
  5. package/dist/dist.min.js +1105 -621
  6. package/dist/es5/3d-tiles-attributes-worker.js +1 -1
  7. package/dist/es5/3d-tiles-attributes-worker.js.map +1 -1
  8. package/dist/es5/converter-cli.js +42 -12
  9. package/dist/es5/converter-cli.js.map +1 -1
  10. package/dist/es5/i3s-attributes-worker.js +1 -1
  11. package/dist/es5/i3s-attributes-worker.js.map +1 -1
  12. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +146 -0
  13. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
  14. package/dist/es5/i3s-converter/helpers/feature-attributes.js +60 -0
  15. package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -0
  16. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +39 -7
  17. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  18. package/dist/es5/i3s-converter/helpers/geometry-converter.js +177 -59
  19. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  20. package/dist/es5/i3s-converter/helpers/gltf-attributes.js +15 -1
  21. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  22. package/dist/es5/i3s-converter/i3s-converter.js +50 -51
  23. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  24. package/dist/es5/lib/utils/write-queue.js +3 -5
  25. package/dist/es5/lib/utils/write-queue.js.map +1 -1
  26. package/dist/es5/pgm-loader.js +1 -1
  27. package/dist/es5/pgm-loader.js.map +1 -1
  28. package/dist/esm/3d-tiles-attributes-worker.js +1 -1
  29. package/dist/esm/3d-tiles-attributes-worker.js.map +1 -1
  30. package/dist/esm/converter-cli.js +37 -7
  31. package/dist/esm/converter-cli.js.map +1 -1
  32. package/dist/esm/i3s-attributes-worker.js +1 -1
  33. package/dist/esm/i3s-attributes-worker.js.map +1 -1
  34. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +128 -0
  35. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
  36. package/dist/esm/i3s-converter/helpers/feature-attributes.js +34 -0
  37. package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -0
  38. package/dist/esm/i3s-converter/helpers/geometry-attributes.js +23 -7
  39. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  40. package/dist/esm/i3s-converter/helpers/geometry-converter.js +145 -38
  41. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  42. package/dist/esm/i3s-converter/helpers/gltf-attributes.js +15 -1
  43. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  44. package/dist/esm/i3s-converter/i3s-converter.js +21 -27
  45. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  46. package/dist/esm/lib/utils/write-queue.js +3 -5
  47. package/dist/esm/lib/utils/write-queue.js.map +1 -1
  48. package/dist/esm/pgm-loader.js +1 -1
  49. package/dist/esm/pgm-loader.js.map +1 -1
  50. package/dist/i3s-attributes-worker.js +3 -3
  51. package/dist/i3s-attributes-worker.js.map +3 -3
  52. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +12 -0
  53. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -0
  54. package/dist/i3s-converter/helpers/batch-ids-extensions.js +138 -0
  55. package/dist/i3s-converter/helpers/feature-attributes.d.ts +24 -0
  56. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -0
  57. package/dist/i3s-converter/helpers/feature-attributes.js +55 -0
  58. package/dist/i3s-converter/helpers/geometry-attributes.js +26 -7
  59. package/dist/i3s-converter/helpers/geometry-converter.d.ts +9 -2
  60. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  61. package/dist/i3s-converter/helpers/geometry-converter.js +140 -44
  62. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -1
  63. package/dist/i3s-converter/helpers/gltf-attributes.js +13 -0
  64. package/dist/i3s-converter/i3s-converter.d.ts +7 -14
  65. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  66. package/dist/i3s-converter/i3s-converter.js +44 -35
  67. package/dist/lib/utils/write-queue.d.ts.map +1 -1
  68. package/dist/lib/utils/write-queue.js +3 -4
  69. package/package.json +15 -15
  70. package/src/converter-cli.ts +33 -7
  71. package/src/i3s-converter/helpers/batch-ids-extensions.ts +199 -0
  72. package/src/i3s-converter/helpers/feature-attributes.ts +65 -0
  73. package/src/i3s-converter/helpers/geometry-attributes.ts +30 -7
  74. package/src/i3s-converter/helpers/geometry-converter.ts +187 -48
  75. package/src/i3s-converter/helpers/gltf-attributes.ts +15 -0
  76. package/src/i3s-converter/i3s-converter.ts +38 -41
  77. package/src/lib/utils/write-queue.ts +7 -5
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 name8 in all)
14
- __defProp(target, name8, { get: all[name8], 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(name8, 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 = name8;
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(name8) {
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: name8,
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 name8 = stat2.name, type = stat2.type;
363
- if (!this.stats[name8]) {
362
+ var name10 = stat2.name, type = stat2.type;
363
+ if (!this.stats[name10]) {
364
364
  if (stat2 instanceof _stat.default) {
365
- this.stats[name8] = stat2;
365
+ this.stats[name10] = stat2;
366
366
  } else {
367
- this.stats[name8] = new _stat.default(name8, type);
367
+ this.stats[name10] = new _stat.default(name10, type);
368
368
  }
369
369
  }
370
- return this.stats[name8];
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(name8) {
939
- return key === name8;
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(name8, type) {
1501
+ function Stat2(name10, type) {
1502
1502
  (0, _classCallCheck2.default)(this, Stat2);
1503
- this.name = name8;
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(name8) {
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: name8,
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 name8 = stat2.name, type = stat2.type;
1716
- if (!this.stats[name8]) {
1715
+ var name10 = stat2.name, type = stat2.type;
1716
+ if (!this.stats[name10]) {
1717
1717
  if (stat2 instanceof _stat.default) {
1718
- this.stats[name8] = stat2;
1718
+ this.stats[name10] = stat2;
1719
1719
  } else {
1720
- this.stats[name8] = new _stat.default(name8, type);
1720
+ this.stats[name10] = new _stat.default(name10, type);
1721
1721
  }
1722
1722
  }
1723
- return this.stats[name8];
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(name8) {
2591
- return key === name8;
2590
+ if (!predefined.find(function(name10) {
2591
+ return key === name10;
2592
2592
  })) {
2593
2593
  obj[key] = obj[key].bind(obj);
2594
2594
  }
@@ -5259,15 +5259,15 @@ var require_vector3 = __commonJS({
5259
5259
  }
5260
5260
  var ORIGIN = [0, 0, 0];
5261
5261
  var constants = {};
5262
- var Vector320 = function(_Vector) {
5263
- (0, _inherits2.default)(Vector321, _Vector);
5264
- var _super = _createSuper(Vector321);
5265
- function Vector321() {
5262
+ var Vector321 = function(_Vector) {
5263
+ (0, _inherits2.default)(Vector322, _Vector);
5264
+ var _super = _createSuper(Vector322);
5265
+ function Vector322() {
5266
5266
  var _this;
5267
5267
  var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
5268
5268
  var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
5269
5269
  var z = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
5270
- (0, _classCallCheck2.default)(this, Vector321);
5270
+ (0, _classCallCheck2.default)(this, Vector322);
5271
5271
  _this = _super.call(this, -0, -0, -0);
5272
5272
  if (arguments.length === 1 && (0, _common.isArray)(x)) {
5273
5273
  _this.copy(x);
@@ -5283,7 +5283,7 @@ var require_vector3 = __commonJS({
5283
5283
  }
5284
5284
  return _this;
5285
5285
  }
5286
- (0, _createClass2.default)(Vector321, [{
5286
+ (0, _createClass2.default)(Vector322, [{
5287
5287
  key: "set",
5288
5288
  value: function set(x, y, z) {
5289
5289
  this[0] = x;
@@ -5403,12 +5403,12 @@ var require_vector3 = __commonJS({
5403
5403
  }], [{
5404
5404
  key: "ZERO",
5405
5405
  get: function get() {
5406
- return constants.ZERO = constants.ZERO || Object.freeze(new Vector321(0, 0, 0, 0));
5406
+ return constants.ZERO = constants.ZERO || Object.freeze(new Vector322(0, 0, 0, 0));
5407
5407
  }
5408
5408
  }]);
5409
- return Vector321;
5409
+ return Vector322;
5410
5410
  }(_vector.default);
5411
- exports.default = Vector320;
5411
+ exports.default = Vector321;
5412
5412
  }
5413
5413
  });
5414
5414
 
@@ -6349,12 +6349,12 @@ var require_matrix3 = __commonJS({
6349
6349
  COL2ROW2: 8
6350
6350
  });
6351
6351
  var constants = {};
6352
- var Matrix34 = function(_Matrix) {
6353
- (0, _inherits2.default)(Matrix35, _Matrix);
6354
- var _super = _createSuper(Matrix35);
6355
- function Matrix35(array) {
6352
+ var Matrix35 = function(_Matrix) {
6353
+ (0, _inherits2.default)(Matrix36, _Matrix);
6354
+ var _super = _createSuper(Matrix36);
6355
+ function Matrix36(array) {
6356
6356
  var _this;
6357
- (0, _classCallCheck2.default)(this, Matrix35);
6357
+ (0, _classCallCheck2.default)(this, Matrix36);
6358
6358
  _this = _super.call(this, -0, -0, -0, -0, -0, -0, -0, -0, -0);
6359
6359
  if (arguments.length === 1 && Array.isArray(array)) {
6360
6360
  _this.copy(array);
@@ -6363,7 +6363,7 @@ var require_matrix3 = __commonJS({
6363
6363
  }
6364
6364
  return _this;
6365
6365
  }
6366
- (0, _createClass2.default)(Matrix35, [{
6366
+ (0, _createClass2.default)(Matrix36, [{
6367
6367
  key: "ELEMENTS",
6368
6368
  get: function get() {
6369
6369
  return 9;
@@ -6522,19 +6522,19 @@ var require_matrix3 = __commonJS({
6522
6522
  }], [{
6523
6523
  key: "IDENTITY",
6524
6524
  get: function get() {
6525
- constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix35(IDENTITY));
6525
+ constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix36(IDENTITY));
6526
6526
  return constants.IDENTITY;
6527
6527
  }
6528
6528
  }, {
6529
6529
  key: "ZERO",
6530
6530
  get: function get() {
6531
- constants.ZERO = constants.ZERO || Object.freeze(new Matrix35(ZERO));
6531
+ constants.ZERO = constants.ZERO || Object.freeze(new Matrix36(ZERO));
6532
6532
  return constants.ZERO;
6533
6533
  }
6534
6534
  }]);
6535
- return Matrix35;
6535
+ return Matrix36;
6536
6536
  }(_matrix.default);
6537
- exports.default = Matrix34;
6537
+ exports.default = Matrix35;
6538
6538
  }
6539
6539
  });
6540
6540
 
@@ -10788,7 +10788,7 @@ var require_type_utils = __commonJS({
10788
10788
  var noop = function noop2(x) {
10789
10789
  return x;
10790
10790
  };
10791
- var scratchVector7 = new _core.Vector3();
10791
+ var scratchVector8 = new _core.Vector3();
10792
10792
  function fromCartographic(cartographic, result) {
10793
10793
  var map = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : noop;
10794
10794
  if ((0, _core.isArray)(cartographic)) {
@@ -10807,11 +10807,11 @@ var require_type_utils = __commonJS({
10807
10807
  return result;
10808
10808
  }
10809
10809
  function fromCartographicToRadians(cartographic) {
10810
- var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scratchVector7;
10810
+ var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scratchVector8;
10811
10811
  return fromCartographic(cartographic, vector, _core.config._cartographicRadians ? noop : _core.toRadians);
10812
10812
  }
10813
10813
  function fromCartographicToDegrees(cartographic) {
10814
- var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scratchVector7;
10814
+ var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scratchVector8;
10815
10815
  return fromCartographic(cartographic, vector, _core.config._cartographicRadians ? _core.toDegrees : noop);
10816
10816
  }
10817
10817
  function toCartographic(vector, cartographic) {
@@ -10841,7 +10841,7 @@ var require_type_utils = __commonJS({
10841
10841
  if (!vector) {
10842
10842
  return false;
10843
10843
  }
10844
- scratchVector7.from(vector);
10844
+ scratchVector8.from(vector);
10845
10845
  var oneOverRadiiSquared = _constants.WGS84_CONSTANTS.oneOverRadiiSquared, centerToleranceSquared = _constants.WGS84_CONSTANTS.centerToleranceSquared;
10846
10846
  var x2 = vector[0] * vector[0] * oneOverRadiiSquared[0];
10847
10847
  var y2 = vector[1] * vector[1] * oneOverRadiiSquared[1];
@@ -10900,13 +10900,13 @@ var require_scale_to_geodetic_surface = __commonJS({
10900
10900
  }
10901
10901
  return newObj;
10902
10902
  }
10903
- var scratchVector7 = new _core.Vector3();
10903
+ var scratchVector8 = new _core.Vector3();
10904
10904
  var scaleToGeodeticSurfaceIntersection = new _core.Vector3();
10905
10905
  var scaleToGeodeticSurfaceGradient = new _core.Vector3();
10906
10906
  function scaleToGeodeticSurface(cartesian, ellipsoid) {
10907
10907
  var result = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : new _core.Vector3();
10908
10908
  var oneOverRadii = ellipsoid.oneOverRadii, oneOverRadiiSquared = ellipsoid.oneOverRadiiSquared, centerToleranceSquared = ellipsoid.centerToleranceSquared;
10909
- scratchVector7.from(cartesian);
10909
+ scratchVector8.from(cartesian);
10910
10910
  var positionX = cartesian.x;
10911
10911
  var positionY = cartesian.y;
10912
10912
  var positionZ = cartesian.z;
@@ -10953,7 +10953,7 @@ var require_scale_to_geodetic_surface = __commonJS({
10953
10953
  var derivative = -2 * denominator;
10954
10954
  correction = func / derivative;
10955
10955
  } while (Math.abs(func) > _core._MathUtils.EPSILON12);
10956
- return scratchVector7.scale([xMultiplier, yMultiplier, zMultiplier]).to(result);
10956
+ return scratchVector8.scale([xMultiplier, yMultiplier, zMultiplier]).to(result);
10957
10957
  }
10958
10958
  }
10959
10959
  });
@@ -11139,7 +11139,7 @@ var require_ellipsoid = __commonJS({
11139
11139
  }
11140
11140
  return newObj;
11141
11141
  }
11142
- var scratchVector7 = new _core.Vector3();
11142
+ var scratchVector8 = new _core.Vector3();
11143
11143
  var scratchNormal2 = new _core.Vector3();
11144
11144
  var scratchK = new _core.Vector3();
11145
11145
  var scratchPosition3 = new _core.Vector3();
@@ -11226,7 +11226,7 @@ var require_ellipsoid = __commonJS({
11226
11226
  key: "geocentricSurfaceNormal",
11227
11227
  value: function geocentricSurfaceNormal(cartesian) {
11228
11228
  var result = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0, 0];
11229
- return scratchVector7.from(cartesian).normalize().to(result);
11229
+ return scratchVector8.from(cartesian).normalize().to(result);
11230
11230
  }
11231
11231
  }, {
11232
11232
  key: "geodeticSurfaceNormalCartographic",
@@ -11236,14 +11236,14 @@ var require_ellipsoid = __commonJS({
11236
11236
  var longitude = cartographicVectorRadians[0];
11237
11237
  var latitude = cartographicVectorRadians[1];
11238
11238
  var cosLatitude = Math.cos(latitude);
11239
- scratchVector7.set(cosLatitude * Math.cos(longitude), cosLatitude * Math.sin(longitude), Math.sin(latitude)).normalize();
11240
- return scratchVector7.to(result);
11239
+ scratchVector8.set(cosLatitude * Math.cos(longitude), cosLatitude * Math.sin(longitude), Math.sin(latitude)).normalize();
11240
+ return scratchVector8.to(result);
11241
11241
  }
11242
11242
  }, {
11243
11243
  key: "geodeticSurfaceNormal",
11244
11244
  value: function geodeticSurfaceNormal(cartesian) {
11245
11245
  var result = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0, 0];
11246
- return scratchVector7.from(cartesian).scale(this.oneOverRadiiSquared).normalize().to(result);
11246
+ return scratchVector8.from(cartesian).scale(this.oneOverRadiiSquared).normalize().to(result);
11247
11247
  }
11248
11248
  }, {
11249
11249
  key: "scaleToGeodeticSurface",
@@ -11356,7 +11356,7 @@ var require_axis_aligned_bounding_box = __commonJS({
11356
11356
  var _createClass2 = _interopRequireDefault(require_createClass());
11357
11357
  var _core = require_es56();
11358
11358
  var _constants = require_constants2();
11359
- var scratchVector7 = new _core.Vector3();
11359
+ var scratchVector8 = new _core.Vector3();
11360
11360
  var scratchNormal2 = new _core.Vector3();
11361
11361
  var AxisAlignedBoundingBox = function() {
11362
11362
  function AxisAlignedBoundingBox2() {
@@ -11364,7 +11364,7 @@ var require_axis_aligned_bounding_box = __commonJS({
11364
11364
  var maximum = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0, 0];
11365
11365
  var center = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
11366
11366
  (0, _classCallCheck2.default)(this, AxisAlignedBoundingBox2);
11367
- center = center || scratchVector7.copy(minimum).add(maximum).scale(0.5);
11367
+ center = center || scratchVector8.copy(minimum).add(maximum).scale(0.5);
11368
11368
  this.center = new _core.Vector3(center);
11369
11369
  this.halfDiagonal = new _core.Vector3(maximum).subtract(this.center);
11370
11370
  this.minimum = new _core.Vector3(minimum);
@@ -11412,7 +11412,7 @@ var require_axis_aligned_bounding_box = __commonJS({
11412
11412
  }, {
11413
11413
  key: "distanceSquaredTo",
11414
11414
  value: function distanceSquaredTo(point) {
11415
- var offset = scratchVector7.from(point).subtract(this.center);
11415
+ var offset = scratchVector8.from(point).subtract(this.center);
11416
11416
  var halfDiagonal = this.halfDiagonal;
11417
11417
  var distanceSquared = 0;
11418
11418
  var d;
@@ -11490,7 +11490,7 @@ var require_bounding_sphere = __commonJS({
11490
11490
  }
11491
11491
  return newObj;
11492
11492
  }
11493
- var scratchVector7 = new _core.Vector3();
11493
+ var scratchVector8 = new _core.Vector3();
11494
11494
  var scratchVector23 = new _core.Vector3();
11495
11495
  var BoundingSphere5 = function() {
11496
11496
  function BoundingSphere6() {
@@ -11511,7 +11511,7 @@ var require_bounding_sphere = __commonJS({
11511
11511
  }, {
11512
11512
  key: "fromCornerPoints",
11513
11513
  value: function fromCornerPoints(corner, oppositeCorner) {
11514
- oppositeCorner = scratchVector7.from(oppositeCorner);
11514
+ oppositeCorner = scratchVector8.from(oppositeCorner);
11515
11515
  this.center = new _core.Vector3().from(corner).add(oppositeCorner).scale(0.5);
11516
11516
  this.radius = this.center.distance(oppositeCorner);
11517
11517
  return this;
@@ -11533,7 +11533,7 @@ var require_bounding_sphere = __commonJS({
11533
11533
  var leftRadius = this.radius;
11534
11534
  var rightCenter = boundingSphere.center;
11535
11535
  var rightRadius = boundingSphere.radius;
11536
- var toRightCenter = scratchVector7.copy(rightCenter).subtract(leftCenter);
11536
+ var toRightCenter = scratchVector8.copy(rightCenter).subtract(leftCenter);
11537
11537
  var centerSeparation = toRightCenter.magnitude();
11538
11538
  if (leftRadius >= centerSeparation + rightRadius) {
11539
11539
  return this.clone();
@@ -11550,7 +11550,7 @@ var require_bounding_sphere = __commonJS({
11550
11550
  }, {
11551
11551
  key: "expand",
11552
11552
  value: function expand(point) {
11553
- point = scratchVector7.from(point);
11553
+ point = scratchVector8.from(point);
11554
11554
  var radius = point.subtract(this.center).magnitude();
11555
11555
  if (radius > this.radius) {
11556
11556
  this.radius = radius;
@@ -11561,14 +11561,14 @@ var require_bounding_sphere = __commonJS({
11561
11561
  key: "transform",
11562
11562
  value: function transform9(_transform) {
11563
11563
  this.center.transform(_transform);
11564
- var scale = mat4.getScaling(scratchVector7, _transform);
11564
+ var scale = mat4.getScaling(scratchVector8, _transform);
11565
11565
  this.radius = Math.max(scale[0], Math.max(scale[1], scale[2])) * this.radius;
11566
11566
  return this;
11567
11567
  }
11568
11568
  }, {
11569
11569
  key: "distanceSquaredTo",
11570
11570
  value: function distanceSquaredTo(point) {
11571
- point = scratchVector7.from(point);
11571
+ point = scratchVector8.from(point);
11572
11572
  var delta = point.subtract(this.center);
11573
11573
  return delta.lengthSquared() - this.radius * this.radius;
11574
11574
  }
@@ -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(name8, 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 = name8;
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 name8 = file.name;
14934
- if (name8 === void 0) {
14935
- name8 = file;
14933
+ let name10 = file.name;
14934
+ if (name10 === void 0) {
14935
+ name10 = file;
14936
14936
  useStat = true;
14937
14937
  }
14938
- const filename2 = dir + "/" + name8;
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((name8) => results[name8]);
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 = (name8) => (handler) => {
15819
+ const eventMethod = (name10) => (handler) => {
15820
15820
  if (!handler) {
15821
15821
  return new Promise((resolve, reject2) => {
15822
- once2(name8, (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(name8);
15830
- on(name8, 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(name8) {
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[name8]) {
16075
- resultArgs.forEach((x) => console[name8](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 name8 = asyncFn.name || "anonymous";
16632
- var error = new Error('Callback function "' + name8 + '" 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 name8 = fn.name || "Function wrapped with `once`";
21904
- f.onceError = name8 + " 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(name8, value) {
23223
- return 'The value "' + value + '" is invalid for option "' + name8 + '"';
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(name8, 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(name8, " argument")) {
23235
- msg = `The ${name8} ${determiner} ${oneOf(expected, "type")}`;
23234
+ if (endsWith(name10, " argument")) {
23235
+ msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
23236
23236
  } else {
23237
- const type = includes(name8, ".") ? "property" : "argument";
23238
- msg = `The "${name8}" ${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(name8) {
23245
- return "The " + name8 + " 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(name8) {
23249
- return "Cannot call " + name8 + " 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 name8 = isDuplex ? duplexKey : "highWaterMark";
23276
- throw new ERR_INVALID_OPT_VALUE(name8, 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(name8) {
26363
+ var ZipArchiveEntry = module2.exports = function(name10) {
26364
26364
  if (!(this instanceof ZipArchiveEntry)) {
26365
- return new ZipArchiveEntry(name8);
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 (name8) {
26383
- this.setName(name8);
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(name8, prependSlash = false) {
26481
- name8 = normalizePath(name8, 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
- name8 = `/${name8}`;
26483
+ name10 = `/${name10}`;
26484
26484
  }
26485
- if (Buffer.byteLength(name8) !== name8.length) {
26485
+ if (Buffer.byteLength(name10) !== name10.length) {
26486
26486
  this.getGeneralPurposeBit().useUTF8ForNames(true);
26487
26487
  }
26488
- this.name = name8;
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(name8, value) {
26935
- return 'The value "' + value + '" is invalid for option "' + name8 + '"';
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(name8, 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(name8, " argument")) {
26947
- msg = `The ${name8} ${determiner} ${oneOf(expected, "type")}`;
26946
+ if (endsWith(name10, " argument")) {
26947
+ msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
26948
26948
  } else {
26949
- const type = includes(name8, ".") ? "property" : "argument";
26950
- msg = `The "${name8}" ${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(name8) {
26957
- return "The " + name8 + " 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(name8) {
26961
- return "Cannot call " + name8 + " 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 name8 = isDuplex ? duplexKey : "highWaterMark";
26988
- throw new ERR_INVALID_OPT_VALUE(name8, 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(name8, value) {
30077
- return 'The value "' + value + '" is invalid for option "' + name8 + '"';
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(name8, 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(name8, " argument")) {
30089
- msg = `The ${name8} ${determiner} ${oneOf(expected, "type")}`;
30088
+ if (endsWith(name10, " argument")) {
30089
+ msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
30090
30090
  } else {
30091
- const type = includes(name8, ".") ? "property" : "argument";
30092
- msg = `The "${name8}" ${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(name8) {
30099
- return "The " + name8 + " 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(name8) {
30103
- return "Cannot call " + name8 + " 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 name8 = isDuplex ? duplexKey : "highWaterMark";
30130
- throw new ERR_INVALID_OPT_VALUE(name8, 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
  }
@@ -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 name8 = 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
- name8 = Buffer.from(name8);
32812
+ name10 = Buffer.from(name10);
32813
32813
  comment = Buffer.from(comment);
32814
32814
  }
32815
- this.write(zipUtil.getShortBytes(name8.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(name8);
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 name8 = 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
- name8 = Buffer.from(name8);
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(name8.length));
32869
+ this.write(zipUtil.getShortBytes(name10.length));
32870
32870
  this.write(zipUtil.getShortBytes(extra.length));
32871
- this.write(name8);
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(name8, value) {
33449
- return 'The value "' + value + '" is invalid for option "' + name8 + '"';
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(name8, 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(name8, " argument")) {
33461
- msg = `The ${name8} ${determiner} ${oneOf(expected, "type")}`;
33460
+ if (endsWith(name10, " argument")) {
33461
+ msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
33462
33462
  } else {
33463
- const type = includes(name8, ".") ? "property" : "argument";
33464
- msg = `The "${name8}" ${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(name8) {
33471
- return "The " + name8 + " 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(name8) {
33475
- return "Cannot call " + name8 + " 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 name8 = isDuplex ? duplexKey : "highWaterMark";
33502
- throw new ERR_INVALID_OPT_VALUE(name8, 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 name8 = opts.name;
36329
+ var name10 = opts.name;
36330
36330
  var prefix = "";
36331
- if (opts.typeflag === 5 && name8[name8.length - 1] !== "/")
36332
- name8 += "/";
36333
- if (Buffer.byteLength(name8) !== name8.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(name8) > 100) {
36336
- var i = name8.indexOf("/");
36335
+ while (Buffer.byteLength(name10) > 100) {
36336
+ var i = name10.indexOf("/");
36337
36337
  if (i === -1)
36338
36338
  return null;
36339
- prefix += prefix ? "/" + name8.slice(0, i) : name8.slice(0, i);
36340
- name8 = name8.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(name8) > 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(name8);
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 name8 = 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
- name8 = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name8;
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 && name8 && name8[name8.length - 1] === "/")
36396
+ if (typeflag === 0 && name10 && name10[name10.length - 1] === "/")
36397
36397
  typeflag = 5;
36398
36398
  return {
36399
- name: name8,
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(name8, value) {
36823
- return 'The value "' + value + '" is invalid for option "' + name8 + '"';
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(name8, 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(name8, " argument")) {
36835
- msg = `The ${name8} ${determiner} ${oneOf(expected, "type")}`;
36834
+ if (endsWith(name10, " argument")) {
36835
+ msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
36836
36836
  } else {
36837
- const type = includes(name8, ".") ? "property" : "argument";
36838
- msg = `The "${name8}" ${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(name8) {
36845
- return "The " + name8 + " 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(name8) {
36849
- return "Cannot call " + name8 + " 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 name8 = isDuplex ? duplexKey : "highWaterMark";
36876
- throw new ERR_INVALID_OPT_VALUE(name8, 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(name8, 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 '" + name8 + "'. 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(name8) {
40718
- this.name = name8 || "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(name8, listener) {
40767
- this._listeners[name8].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(name8, arg) {
40775
- if (this._listeners[name8]) {
40776
- for (var i = 0; i < this._listeners[name8].length; i++) {
40777
- this._listeners[name8][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(name8, data, options) {
41487
- this.name = name8;
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(name8, 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
- name8 = forceTrailingSlash(name8);
46136
+ name10 = forceTrailingSlash(name10);
46137
46137
  }
46138
- if (o.createFolders && (parent = parentFolder(name8))) {
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(name8, data);
46157
+ zipObjectContent = new NodejsStreamInputAdapter(name10, data);
46158
46158
  } else {
46159
- zipObjectContent = utils.prepareContent(name8, 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(name8, zipObjectContent, o);
46162
- this.files[name8] = 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(name8, createFolders) {
46177
+ var folderAdd = function(name10, createFolders) {
46178
46178
  createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
46179
- name8 = forceTrailingSlash(name8);
46180
- if (!this.files[name8]) {
46181
- fileAdd.call(this, name8, 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[name8];
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(name8, data, o) {
46214
+ file: function(name10, data, o) {
46215
46215
  if (arguments.length === 1) {
46216
- if (isRegExp(name8)) {
46217
- var regexp = name8;
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 + name8];
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
- name8 = this.root + name8;
46231
- fileAdd.call(this, name8, 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 name8 = this.root + arg;
46245
- var newFolder = folderAdd.call(this, name8);
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(name8) {
46251
- name8 = this.root + name8;
46252
- var file = this.files[name8];
46250
+ remove: function(name10) {
46251
+ name10 = this.root + name10;
46252
+ var file = this.files[name10];
46253
46253
  if (!file) {
46254
- if (name8.slice(-1) !== "/") {
46255
- name8 += "/";
46254
+ if (name10.slice(-1) !== "/") {
46255
+ name10 += "/";
46256
46256
  }
46257
- file = this.files[name8];
46257
+ file = this.files[name10];
46258
46258
  }
46259
46259
  if (file && !file.dir) {
46260
- delete this.files[name8];
46260
+ delete this.files[name10];
46261
46261
  } else {
46262
46262
  var kids = this.filter(function(relativePath, file2) {
46263
- return file2.name.slice(0, name8.length) === name8;
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 name8 in this) {
47307
- if (name8.charAt(0) === "t" && hasOwn.call(this, name8) && !isNaN(+name8.slice(1))) {
47308
- this[name8] = 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(name8) {
48379
- var ext = original_getExtension.call(this, name8);
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 (name8 !== "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(name8) {
49845
- if (!this.stats.has(name8)) {
49846
- this.stats.set(name8, new _probe.Stats({
49847
- id: name8
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(name8);
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, name8) {
50243
- if (typeof name8 !== "string") {
50244
- return name8;
50242
+ function getKeyValue(gl, name10) {
50243
+ if (typeof name10 !== "string") {
50244
+ return name10;
50245
50245
  }
50246
- var number = Number(name8);
50246
+ var number = Number(name10);
50247
50247
  if (!isNaN(number)) {
50248
50248
  return number;
50249
50249
  }
50250
- name8 = name8.replace(/^.*\./, "");
50251
- var value = gl[name8];
50252
- (0, _utils.assert)(value !== void 0, "Accessing undefined constant GL.".concat(name8));
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 name8 = 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(name8, "s Created")).incrementCount();
50621
- stats.get("".concat(name8, "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 name8 = this.constructor.name;
50626
+ var name10 = this.constructor.name;
50627
50627
  var stats = _init.lumaStats.get("Resource Counts");
50628
- stats.get("".concat(name8, "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 name8 = 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(name8, " 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 name8 = 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(name8, " 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 name8 = shaderName || (0, _getShaderName.default)(src) || "(unnamed)";
54399
- var shaderDescription = "".concat((0, _getShaderTypeName.default)(shaderType), " shader ").concat(name8);
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(name8) {
54798
- if (name8[name8.length - 1] !== "]") {
54797
+ function parseUniformName(name10) {
54798
+ if (name10[name10.length - 1] !== "]") {
54799
54799
  return {
54800
- name: name8,
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 = name8.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(name8));
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], name8 = _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: name8
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), name8 = _gl$getActiveAttrib.name, type = _gl$getActiveAttrib.type, size = _gl$getActiveAttrib.size;
55142
- var location = gl.getAttribLocation(program.handle, name8);
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, name8, 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), name8 = _gl$getTransformFeedb.name, type = _gl$getTransformFeedb.type, size = _gl$getTransformFeedb.size;
55161
- this._addVarying(location, name8, 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, name8, 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, name8, accessor);
55175
+ this._inferProperties(location, name10, accessor);
55176
55176
  var attributeInfo = {
55177
55177
  location,
55178
- name: name8,
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, name8, accessor) {
55188
- if (/instance/i.test(name8)) {
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, name8, 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: name8,
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), name8 = _parseUniformName.name;
55593
- var location = gl.getUniformLocation(this.handle, name8);
55594
- this._uniformSetters[name8] = (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(name8, "[").concat(l, "]"));
55598
- this._uniformSetters["".concat(name8, "[").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, name8 = _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(name8 || 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 name8 = 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(name8) + locationOffset,
56771
- name: name8
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(name8, 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(name8, " (").concat(typeAndName.name, ")") : name8;
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 name8 = _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 name8 === "string");
58412
- this.name = name8;
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(name8) {
58624
- return moduleMap[name8];
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 name8 = match[3];
59238
+ var name10 = match[3];
59239
59239
  if (hash) {
59240
- if (name8 === "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 name8 = hook.replace(/\(.+/, "");
59382
- result[stage][name8] = 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 name8 = definition.split(";")[0];
59416
+ var name10 = definition.split(";")[0];
59417
59417
  return {
59418
59418
  qualifier,
59419
59419
  type,
59420
- name: name8
59420
+ name: name10
59421
59421
  };
59422
59422
  }
59423
59423
  function getPassthroughFS() {
@@ -60808,15 +60808,15 @@ var require_vector32 = __commonJS({
60808
60808
  }
60809
60809
  var ORIGIN = [0, 0, 0];
60810
60810
  var constants = {};
60811
- var Vector320 = function(_Vector) {
60812
- (0, _inherits2.default)(Vector321, _Vector);
60813
- var _super = _createSuper(Vector321);
60814
- function Vector321() {
60811
+ var Vector321 = function(_Vector) {
60812
+ (0, _inherits2.default)(Vector322, _Vector);
60813
+ var _super = _createSuper(Vector322);
60814
+ function Vector322() {
60815
60815
  var _this;
60816
60816
  var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
60817
60817
  var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
60818
60818
  var z = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
60819
- (0, _classCallCheck2.default)(this, Vector321);
60819
+ (0, _classCallCheck2.default)(this, Vector322);
60820
60820
  _this = _super.call(this, -0, -0, -0);
60821
60821
  if (arguments.length === 1 && (0, _common.isArray)(x)) {
60822
60822
  _this.copy(x);
@@ -60832,7 +60832,7 @@ var require_vector32 = __commonJS({
60832
60832
  }
60833
60833
  return _this;
60834
60834
  }
60835
- (0, _createClass2.default)(Vector321, [{
60835
+ (0, _createClass2.default)(Vector322, [{
60836
60836
  key: "set",
60837
60837
  value: function set(x, y, z) {
60838
60838
  this[0] = x;
@@ -60952,12 +60952,12 @@ var require_vector32 = __commonJS({
60952
60952
  }], [{
60953
60953
  key: "ZERO",
60954
60954
  get: function get() {
60955
- return constants.ZERO = constants.ZERO || Object.freeze(new Vector321(0, 0, 0, 0));
60955
+ return constants.ZERO = constants.ZERO || Object.freeze(new Vector322(0, 0, 0, 0));
60956
60956
  }
60957
60957
  }]);
60958
- return Vector321;
60958
+ return Vector322;
60959
60959
  }(_vector.default);
60960
- exports.default = Vector320;
60960
+ exports.default = Vector321;
60961
60961
  }
60962
60962
  });
60963
60963
 
@@ -61408,12 +61408,12 @@ var require_matrix32 = __commonJS({
61408
61408
  COL2ROW2: 8
61409
61409
  });
61410
61410
  var constants = {};
61411
- var Matrix34 = function(_Matrix) {
61412
- (0, _inherits2.default)(Matrix35, _Matrix);
61413
- var _super = _createSuper(Matrix35);
61414
- function Matrix35(array) {
61411
+ var Matrix35 = function(_Matrix) {
61412
+ (0, _inherits2.default)(Matrix36, _Matrix);
61413
+ var _super = _createSuper(Matrix36);
61414
+ function Matrix36(array) {
61415
61415
  var _this;
61416
- (0, _classCallCheck2.default)(this, Matrix35);
61416
+ (0, _classCallCheck2.default)(this, Matrix36);
61417
61417
  _this = _super.call(this, -0, -0, -0, -0, -0, -0, -0, -0, -0);
61418
61418
  if (arguments.length === 1 && Array.isArray(array)) {
61419
61419
  _this.copy(array);
@@ -61422,7 +61422,7 @@ var require_matrix32 = __commonJS({
61422
61422
  }
61423
61423
  return _this;
61424
61424
  }
61425
- (0, _createClass2.default)(Matrix35, [{
61425
+ (0, _createClass2.default)(Matrix36, [{
61426
61426
  key: "ELEMENTS",
61427
61427
  get: function get() {
61428
61428
  return 9;
@@ -61581,19 +61581,19 @@ var require_matrix32 = __commonJS({
61581
61581
  }], [{
61582
61582
  key: "IDENTITY",
61583
61583
  get: function get() {
61584
- constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix35(IDENTITY));
61584
+ constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix36(IDENTITY));
61585
61585
  return constants.IDENTITY;
61586
61586
  }
61587
61587
  }, {
61588
61588
  key: "ZERO",
61589
61589
  get: function get() {
61590
- constants.ZERO = constants.ZERO || Object.freeze(new Matrix35(ZERO));
61590
+ constants.ZERO = constants.ZERO || Object.freeze(new Matrix36(ZERO));
61591
61591
  return constants.ZERO;
61592
61592
  }
61593
61593
  }]);
61594
- return Matrix35;
61594
+ return Matrix36;
61595
61595
  }(_matrix.default);
61596
- exports.default = Matrix34;
61596
+ exports.default = Matrix35;
61597
61597
  }
61598
61598
  });
61599
61599
 
@@ -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 name8 = module3.name;
65335
+ var name10 = module3.name;
65336
65336
  modules[count++] = module3;
65337
- seen[name8] = 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 name8 in geometry.attributes) {
65410
- var attribute = geometry.attributes[name8];
65411
- var remappedName = mapAttributeName(name8, options);
65412
- if (name8 === "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(name8, 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(name8, 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[name8] || name8;
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 name8 in attributes) {
65652
- var attribute = attributes[name8];
65653
- normalizedAttributes[name8] = 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 name8 in this.geometryBuffers) {
65836
- var buffer = this.geometryBuffers[name8][0] || this.geometryBuffers[name8];
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 name8 in this.resources) {
66088
- this.resources[name8].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(name8, opts) {
66204
+ value: function _createNewBuffer(name10, opts) {
66205
66205
  var buffer = new _webgl.Buffer(this.gl, opts);
66206
- if (this.resources[name8]) {
66207
- this.resources[name8].delete();
66206
+ if (this.resources[name10]) {
66207
+ this.resources[name10].delete();
66208
66208
  }
66209
- this.resources[name8] = 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, name8 = attributeData.name;
66331
- if (name8 && textureMap[name8]) {
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(name8), 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(name8, " = transform_getInput(").concat(samplerName, ", ").concat(sizeName, ").").concat(channels, ";\n");
66336
- samplerTextureMap[samplerName] = name8;
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 name8 in sourceTextures) {
66607
- sourceTextures[name8].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
  }, {
@@ -68750,15 +68750,15 @@ var require_vector33 = __commonJS({
68750
68750
  }
68751
68751
  var ORIGIN = [0, 0, 0];
68752
68752
  var constants = {};
68753
- var Vector320 = function(_Vector) {
68754
- (0, _inherits2.default)(Vector321, _Vector);
68755
- var _super = _createSuper(Vector321);
68756
- function Vector321() {
68753
+ var Vector321 = function(_Vector) {
68754
+ (0, _inherits2.default)(Vector322, _Vector);
68755
+ var _super = _createSuper(Vector322);
68756
+ function Vector322() {
68757
68757
  var _this;
68758
68758
  var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
68759
68759
  var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
68760
68760
  var z = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
68761
- (0, _classCallCheck2.default)(this, Vector321);
68761
+ (0, _classCallCheck2.default)(this, Vector322);
68762
68762
  _this = _super.call(this, -0, -0, -0);
68763
68763
  if (arguments.length === 1 && (0, _common.isArray)(x)) {
68764
68764
  _this.copy(x);
@@ -68774,7 +68774,7 @@ var require_vector33 = __commonJS({
68774
68774
  }
68775
68775
  return _this;
68776
68776
  }
68777
- (0, _createClass2.default)(Vector321, [{
68777
+ (0, _createClass2.default)(Vector322, [{
68778
68778
  key: "set",
68779
68779
  value: function set(x, y, z) {
68780
68780
  this[0] = x;
@@ -68894,12 +68894,12 @@ var require_vector33 = __commonJS({
68894
68894
  }], [{
68895
68895
  key: "ZERO",
68896
68896
  get: function get() {
68897
- return constants.ZERO = constants.ZERO || Object.freeze(new Vector321(0, 0, 0, 0));
68897
+ return constants.ZERO = constants.ZERO || Object.freeze(new Vector322(0, 0, 0, 0));
68898
68898
  }
68899
68899
  }]);
68900
- return Vector321;
68900
+ return Vector322;
68901
68901
  }(_vector.default);
68902
- exports.default = Vector320;
68902
+ exports.default = Vector321;
68903
68903
  }
68904
68904
  });
68905
68905
 
@@ -69350,12 +69350,12 @@ var require_matrix33 = __commonJS({
69350
69350
  COL2ROW2: 8
69351
69351
  });
69352
69352
  var constants = {};
69353
- var Matrix34 = function(_Matrix) {
69354
- (0, _inherits2.default)(Matrix35, _Matrix);
69355
- var _super = _createSuper(Matrix35);
69356
- function Matrix35(array) {
69353
+ var Matrix35 = function(_Matrix) {
69354
+ (0, _inherits2.default)(Matrix36, _Matrix);
69355
+ var _super = _createSuper(Matrix36);
69356
+ function Matrix36(array) {
69357
69357
  var _this;
69358
- (0, _classCallCheck2.default)(this, Matrix35);
69358
+ (0, _classCallCheck2.default)(this, Matrix36);
69359
69359
  _this = _super.call(this, -0, -0, -0, -0, -0, -0, -0, -0, -0);
69360
69360
  if (arguments.length === 1 && Array.isArray(array)) {
69361
69361
  _this.copy(array);
@@ -69364,7 +69364,7 @@ var require_matrix33 = __commonJS({
69364
69364
  }
69365
69365
  return _this;
69366
69366
  }
69367
- (0, _createClass2.default)(Matrix35, [{
69367
+ (0, _createClass2.default)(Matrix36, [{
69368
69368
  key: "ELEMENTS",
69369
69369
  get: function get() {
69370
69370
  return 9;
@@ -69523,19 +69523,19 @@ var require_matrix33 = __commonJS({
69523
69523
  }], [{
69524
69524
  key: "IDENTITY",
69525
69525
  get: function get() {
69526
- constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix35(IDENTITY));
69526
+ constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix36(IDENTITY));
69527
69527
  return constants.IDENTITY;
69528
69528
  }
69529
69529
  }, {
69530
69530
  key: "ZERO",
69531
69531
  get: function get() {
69532
- constants.ZERO = constants.ZERO || Object.freeze(new Matrix35(ZERO));
69532
+ constants.ZERO = constants.ZERO || Object.freeze(new Matrix36(ZERO));
69533
69533
  return constants.ZERO;
69534
69534
  }
69535
69535
  }]);
69536
- return Matrix35;
69536
+ return Matrix36;
69537
69537
  }(_matrix.default);
69538
- exports.default = Matrix34;
69538
+ exports.default = Matrix35;
69539
69539
  }
69540
69540
  });
69541
69541
 
@@ -73431,7 +73431,7 @@ var matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.e
73431
73431
  var nodeVersion = matches && parseFloat(matches[1]) || 0;
73432
73432
 
73433
73433
  // ../worker-utils/src/lib/env-utils/version.ts
73434
- var DEFAULT_VERSION = "latest";
73434
+ var DEFAULT_VERSION = "beta";
73435
73435
  var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
73436
73436
  if (typeof __VERSION__ === "undefined") {
73437
73437
  console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
@@ -73596,9 +73596,9 @@ var WorkerThread = class {
73596
73596
  constructor(props) {
73597
73597
  this.terminated = false;
73598
73598
  this._loadableURL = "";
73599
- const { name: name8, source, url } = props;
73599
+ const { name: name10, source, url } = props;
73600
73600
  assert3(source || url);
73601
- this.name = name8;
73601
+ this.name = name10;
73602
73602
  this.source = source;
73603
73603
  this.url = url;
73604
73604
  this.onMessage = NOOP;
@@ -73606,7 +73606,7 @@ var WorkerThread = class {
73606
73606
  this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
73607
73607
  }
73608
73608
  static isSupported() {
73609
- 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;
73610
73610
  }
73611
73611
  destroy() {
73612
73612
  this.onMessage = NOOP;
@@ -73715,9 +73715,9 @@ var WorkerPool = class {
73715
73715
  this.onDebug = props.onDebug;
73716
73716
  }
73717
73717
  }
73718
- async startJob(name8, 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)) {
73719
73719
  const startPromise = new Promise((onStart) => {
73720
- this.jobQueue.push({ name: name8, onMessage: onMessage3, onError, onStart });
73720
+ this.jobQueue.push({ name: name10, onMessage: onMessage3, onError, onStart });
73721
73721
  return this;
73722
73722
  });
73723
73723
  this._startQueuedJob();
@@ -73768,8 +73768,8 @@ var WorkerPool = class {
73768
73768
  }
73769
73769
  if (this.count < this._getMaxConcurrency()) {
73770
73770
  this.count++;
73771
- const name8 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
73772
- return new WorkerThread({ name: name8, 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 });
73773
73773
  }
73774
73774
  return null;
73775
73775
  }
@@ -73814,16 +73814,16 @@ var WorkerFarm = class {
73814
73814
  }
73815
73815
  }
73816
73816
  getWorkerPool(options) {
73817
- const { name: name8, source, url } = options;
73818
- let workerPool = this.workerPools.get(name8);
73817
+ const { name: name10, source, url } = options;
73818
+ let workerPool = this.workerPools.get(name10);
73819
73819
  if (!workerPool) {
73820
73820
  workerPool = new WorkerPool({
73821
- name: name8,
73821
+ name: name10,
73822
73822
  source,
73823
73823
  url
73824
73824
  });
73825
73825
  workerPool.setProps(this._getWorkerPoolProps());
73826
- this.workerPools.set(name8, workerPool);
73826
+ this.workerPools.set(name10, workerPool);
73827
73827
  }
73828
73828
  return workerPool;
73829
73829
  }
@@ -73838,7 +73838,7 @@ var WorkerFarm = class {
73838
73838
  };
73839
73839
 
73840
73840
  // ../worker-utils/src/lib/worker-api/get-worker-url.ts
73841
- var NPM_TAG = "latest";
73841
+ var NPM_TAG = "beta";
73842
73842
  var VERSION2 = typeof VERSION !== "undefined" ? VERSION : NPM_TAG;
73843
73843
  function getWorkerName(worker) {
73844
73844
  const warning = worker.version !== VERSION2 ? ` (worker-utils@${VERSION2})` : "";
@@ -73868,10 +73868,10 @@ function getWorkerURL(worker, options = {}) {
73868
73868
 
73869
73869
  // ../worker-utils/src/lib/worker-api/process-on-worker.ts
73870
73870
  async function processOnWorker(worker, data, options = {}, context = {}) {
73871
- const name8 = getWorkerName(worker);
73871
+ const name10 = getWorkerName(worker);
73872
73872
  const workerFarm = WorkerFarm.getWorkerFarm(options);
73873
73873
  const { source } = options;
73874
- const workerPoolProps = { name: name8, source };
73874
+ const workerPoolProps = { name: name10, source };
73875
73875
  if (!source) {
73876
73876
  workerPoolProps.url = getWorkerURL(worker, options);
73877
73877
  }
@@ -73960,7 +73960,7 @@ function requireFromString(code, filename2 = "", options) {
73960
73960
  }
73961
73961
 
73962
73962
  // ../worker-utils/src/lib/library-utils/library-utils.ts
73963
- var LATEST = "latest";
73963
+ var LATEST = "beta";
73964
73964
  var VERSION3 = typeof VERSION !== "undefined" ? VERSION : LATEST;
73965
73965
  var loadLibraryPromises = {};
73966
73966
  async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
@@ -74159,10 +74159,10 @@ function canParseWithWorker(loader, options) {
74159
74159
  return loader.worker && options?.worker;
74160
74160
  }
74161
74161
  async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
74162
- const name8 = loader.id;
74162
+ const name10 = loader.id;
74163
74163
  const url = getWorkerURL(loader, options);
74164
74164
  const workerFarm = WorkerFarm.getWorkerFarm(options);
74165
- const workerPool = workerFarm.getWorkerPool({ name: name8, url });
74165
+ const workerPool = workerFarm.getWorkerPool({ name: name10, url });
74166
74166
  options = JSON.parse(JSON.stringify(options));
74167
74167
  context = JSON.parse(JSON.stringify(context || {}));
74168
74168
  const job = await workerPool.startJob("process-on-worker", onMessage2.bind(null, parseOnMainThread));
@@ -76460,6 +76460,12 @@ var TileHeader = class {
76460
76460
  get contentFailed() {
76461
76461
  return this.contentState === TILE_CONTENT_STATE.FAILED;
76462
76462
  }
76463
+ get distanceToCamera() {
76464
+ return this._distanceToCamera;
76465
+ }
76466
+ get screenSpaceError() {
76467
+ return this._screenSpaceError;
76468
+ }
76463
76469
  getScreenSpaceError(frameState, useParentLodMetric) {
76464
76470
  switch (this.tileset.type) {
76465
76471
  case TILESET_TYPE.I3S:
@@ -76701,8 +76707,17 @@ var TileHeader = class {
76701
76707
  case "i3s":
76702
76708
  return {
76703
76709
  ...this.tileset.options.i3s,
76704
- tile: this.header,
76705
- 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
+ },
76706
76721
  isTileHeader: false
76707
76722
  };
76708
76723
  case "3d-tiles":
@@ -76882,8 +76897,7 @@ var I3STilesetTraverser = class extends TilesetTraverser {
76882
76897
  ...tileset.loadOptions,
76883
76898
  i3s: {
76884
76899
  ...tileset.loadOptions.i3s,
76885
- isTileHeader: true,
76886
- loadContent: false
76900
+ isTileHeader: true
76887
76901
  }
76888
76902
  };
76889
76903
  return await load(nodeUrl, loader, options);
@@ -77462,7 +77476,7 @@ var DEFAULT_DRACO_OPTIONS = {
77462
77476
  };
77463
77477
  var DracoLoader = {
77464
77478
  name: "Draco",
77465
- id: "draco",
77479
+ id: isBrowser2 ? "draco" : "draco-nodejs",
77466
77480
  module: "draco",
77467
77481
  shapes: ["mesh"],
77468
77482
  version: VERSION5,
@@ -77532,8 +77546,8 @@ var Schema = class {
77532
77546
  }
77533
77547
  select(...columnNames) {
77534
77548
  const nameMap = Object.create(null);
77535
- for (const name8 of columnNames) {
77536
- nameMap[name8] = true;
77549
+ for (const name10 of columnNames) {
77550
+ nameMap[name10] = true;
77537
77551
  }
77538
77552
  const selectedFields = this.fields.filter((field) => nameMap[field.name]);
77539
77553
  return new Schema(selectedFields, this.metadata);
@@ -77578,8 +77592,8 @@ function mergeMaps(m1, m2) {
77578
77592
 
77579
77593
  // ../schema/src/lib/schema/impl/field.ts
77580
77594
  var Field = class {
77581
- constructor(name8, type, nullable = false, metadata = new Map()) {
77582
- this.name = name8;
77595
+ constructor(name10, type, nullable = false, metadata = new Map()) {
77596
+ this.name = name10;
77583
77597
  this.type = type;
77584
77598
  this.nullable = nullable;
77585
77599
  this.metadata = metadata;
@@ -78501,8 +78515,8 @@ var GLType = class {
78501
78515
  }
78502
78516
  throw new Error(ERR_TYPE_CONVERSION);
78503
78517
  }
78504
- static fromName(name8) {
78505
- const glType = NAME_TO_GL_TYPE[name8];
78518
+ static fromName(name10) {
78519
+ const glType = NAME_TO_GL_TYPE[name10];
78506
78520
  if (!glType) {
78507
78521
  throw new Error(ERR_TYPE_CONVERSION);
78508
78522
  }
@@ -79014,10 +79028,10 @@ var Tile3DBatchTableParser = class {
79014
79028
  }
79015
79029
  return void 0;
79016
79030
  }
79017
- hasProperty(batchId, name8) {
79031
+ hasProperty(batchId, name10) {
79018
79032
  this._checkBatchId(batchId);
79019
- assert2(typeof name8 === "string", name8);
79020
- return defined5(this._properties[name8]) || this._hasPropertyInHierarchy(batchId, name8);
79033
+ assert2(typeof name10 === "string", name10);
79034
+ return defined5(this._properties[name10]) || this._hasPropertyInHierarchy(batchId, name10);
79021
79035
  }
79022
79036
  getPropertyNames(batchId, results) {
79023
79037
  this._checkBatchId(batchId);
@@ -79030,47 +79044,47 @@ var Tile3DBatchTableParser = class {
79030
79044
  }
79031
79045
  return results;
79032
79046
  }
79033
- getProperty(batchId, name8) {
79047
+ getProperty(batchId, name10) {
79034
79048
  this._checkBatchId(batchId);
79035
- assert2(typeof name8 === "string", name8);
79049
+ assert2(typeof name10 === "string", name10);
79036
79050
  if (this._binaryProperties) {
79037
- const binaryProperty = this._binaryProperties[name8];
79051
+ const binaryProperty = this._binaryProperties[name10];
79038
79052
  if (defined5(binaryProperty)) {
79039
79053
  return this._getBinaryProperty(binaryProperty, batchId);
79040
79054
  }
79041
79055
  }
79042
- const propertyValues = this._properties[name8];
79056
+ const propertyValues = this._properties[name10];
79043
79057
  if (defined5(propertyValues)) {
79044
79058
  return clone(propertyValues[batchId], true);
79045
79059
  }
79046
79060
  if (this._hierarchy) {
79047
- const hierarchyProperty = this._getHierarchyProperty(batchId, name8);
79061
+ const hierarchyProperty = this._getHierarchyProperty(batchId, name10);
79048
79062
  if (defined5(hierarchyProperty)) {
79049
79063
  return hierarchyProperty;
79050
79064
  }
79051
79065
  }
79052
79066
  return void 0;
79053
79067
  }
79054
- setProperty(batchId, name8, value) {
79068
+ setProperty(batchId, name10, value) {
79055
79069
  const featureCount = this.featureCount;
79056
79070
  this._checkBatchId(batchId);
79057
- assert2(typeof name8 === "string", name8);
79071
+ assert2(typeof name10 === "string", name10);
79058
79072
  if (this._binaryProperties) {
79059
- const binaryProperty = this._binaryProperties[name8];
79073
+ const binaryProperty = this._binaryProperties[name10];
79060
79074
  if (binaryProperty) {
79061
79075
  this._setBinaryProperty(binaryProperty, batchId, value);
79062
79076
  return;
79063
79077
  }
79064
79078
  }
79065
79079
  if (this._hierarchy) {
79066
- if (this._setHierarchyProperty(this, batchId, name8, value)) {
79080
+ if (this._setHierarchyProperty(this, batchId, name10, value)) {
79067
79081
  return;
79068
79082
  }
79069
79083
  }
79070
- let propertyValues = this._properties[name8];
79084
+ let propertyValues = this._properties[name10];
79071
79085
  if (!defined5(propertyValues)) {
79072
- this._properties[name8] = new Array(featureCount);
79073
- propertyValues = this._properties[name8];
79086
+ this._properties[name10] = new Array(featureCount);
79087
+ propertyValues = this._properties[name10];
79074
79088
  }
79075
79089
  propertyValues[batchId] = clone(value, true);
79076
79090
  }
@@ -79088,21 +79102,21 @@ var Tile3DBatchTableParser = class {
79088
79102
  }
79089
79103
  _initializeBinaryProperties() {
79090
79104
  let binaryProperties = null;
79091
- for (const name8 in this._properties) {
79092
- const property = this._properties[name8];
79093
- const binaryProperty = this._initializeBinaryProperty(name8, property);
79105
+ for (const name10 in this._properties) {
79106
+ const property = this._properties[name10];
79107
+ const binaryProperty = this._initializeBinaryProperty(name10, property);
79094
79108
  if (binaryProperty) {
79095
79109
  binaryProperties = binaryProperties || {};
79096
- binaryProperties[name8] = binaryProperty;
79110
+ binaryProperties[name10] = binaryProperty;
79097
79111
  }
79098
79112
  }
79099
79113
  return binaryProperties;
79100
79114
  }
79101
- _initializeBinaryProperty(name8, property) {
79115
+ _initializeBinaryProperty(name10, property) {
79102
79116
  if ("byteOffset" in property) {
79103
79117
  const tile3DAccessor = property;
79104
- assert2(this.binary, `Property ${name8} requires a batch table binary.`);
79105
- assert2(tile3DAccessor.type, `Property ${name8} requires a type.`);
79118
+ assert2(this.binary, `Property ${name10} requires a batch table binary.`);
79119
+ assert2(tile3DAccessor.type, `Property ${name10} requires a type.`);
79106
79120
  const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
79107
79121
  return {
79108
79122
  typedArray: accessor.values,
@@ -79113,14 +79127,14 @@ var Tile3DBatchTableParser = class {
79113
79127
  }
79114
79128
  return null;
79115
79129
  }
79116
- _hasPropertyInHierarchy(batchId, name8) {
79130
+ _hasPropertyInHierarchy(batchId, name10) {
79117
79131
  if (!this._hierarchy) {
79118
79132
  return false;
79119
79133
  }
79120
79134
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
79121
79135
  const classId = hierarchy.classIds[instanceIndex];
79122
79136
  const instances = hierarchy.classes[classId].instances;
79123
- return defined5(instances[name8]);
79137
+ return defined5(instances[name10]);
79124
79138
  });
79125
79139
  return defined5(result);
79126
79140
  }
@@ -79128,21 +79142,21 @@ var Tile3DBatchTableParser = class {
79128
79142
  traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
79129
79143
  const classId = hierarchy.classIds[instanceIndex];
79130
79144
  const instances = hierarchy.classes[classId].instances;
79131
- for (const name8 in instances) {
79132
- if (instances.hasOwnProperty(name8)) {
79133
- if (results.indexOf(name8) === -1) {
79134
- results.push(name8);
79145
+ for (const name10 in instances) {
79146
+ if (instances.hasOwnProperty(name10)) {
79147
+ if (results.indexOf(name10) === -1) {
79148
+ results.push(name10);
79135
79149
  }
79136
79150
  }
79137
79151
  }
79138
79152
  });
79139
79153
  }
79140
- _getHierarchyProperty(batchId, name8) {
79154
+ _getHierarchyProperty(batchId, name10) {
79141
79155
  return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
79142
79156
  const classId = hierarchy.classIds[instanceIndex];
79143
79157
  const instanceClass = hierarchy.classes[classId];
79144
79158
  const indexInClass = hierarchy.classIndexes[instanceIndex];
79145
- const propertyValues = instanceClass.instances[name8];
79159
+ const propertyValues = instanceClass.instances[name10];
79146
79160
  if (defined5(propertyValues)) {
79147
79161
  if (defined5(propertyValues.typedArray)) {
79148
79162
  return this._getBinaryProperty(propertyValues, indexInClass);
@@ -79152,14 +79166,14 @@ var Tile3DBatchTableParser = class {
79152
79166
  return null;
79153
79167
  });
79154
79168
  }
79155
- _setHierarchyProperty(batchTable, batchId, name8, value) {
79169
+ _setHierarchyProperty(batchTable, batchId, name10, value) {
79156
79170
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
79157
79171
  const classId = hierarchy.classIds[instanceIndex];
79158
79172
  const instanceClass = hierarchy.classes[classId];
79159
79173
  const indexInClass = hierarchy.classIndexes[instanceIndex];
79160
- const propertyValues = instanceClass.instances[name8];
79174
+ const propertyValues = instanceClass.instances[name10];
79161
79175
  if (defined5(propertyValues)) {
79162
- assert2(instanceIndex === batchId, `Inherited property "${name8}" is read-only.`);
79176
+ assert2(instanceIndex === batchId, `Inherited property "${name10}" is read-only.`);
79163
79177
  if (defined5(propertyValues.typedArray)) {
79164
79178
  this._setBinaryProperty(propertyValues, indexInClass, value);
79165
79179
  } else {
@@ -79560,7 +79574,7 @@ async function loadDraco(tile, dracoData, options, context) {
79560
79574
  var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
79561
79575
 
79562
79576
  // ../textures/src/lib/utils/version.ts
79563
- var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
79577
+ var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
79564
79578
 
79565
79579
  // ../textures/src/lib/parsers/basis-module-loader.ts
79566
79580
  var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
@@ -80059,7 +80073,7 @@ function selectSupportedBasisFormat() {
80059
80073
  // ../textures/src/basis-loader.ts
80060
80074
  var BasisWorkerLoader = {
80061
80075
  name: "Basis",
80062
- id: "basis",
80076
+ id: isBrowser2 ? "basis" : "basis-nodejs",
80063
80077
  module: "textures",
80064
80078
  version: VERSION7,
80065
80079
  worker: true,
@@ -81008,12 +81022,12 @@ var GLTFScenegraph = class {
81008
81022
  return extras[key];
81009
81023
  }
81010
81024
  getExtension(extensionName) {
81011
- const isExtension = this.getUsedExtensions().find((name8) => name8 === extensionName);
81025
+ const isExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
81012
81026
  const extensions = this.json.extensions || {};
81013
81027
  return isExtension ? extensions[extensionName] || true : null;
81014
81028
  }
81015
81029
  getRequiredExtension(extensionName) {
81016
- const isRequired = this.getRequiredExtensions().find((name8) => name8 === extensionName);
81030
+ const isRequired = this.getRequiredExtensions().find((name10) => name10 === extensionName);
81017
81031
  return isRequired ? this.getExtension(extensionName) : null;
81018
81032
  }
81019
81033
  getRequiredExtensions() {
@@ -81645,11 +81659,11 @@ __export(KHR_draco_mesh_compression_exports, {
81645
81659
  // ../gltf/src/lib/gltf-utils/gltf-attribute-utils.ts
81646
81660
  function getGLTFAccessors(attributes) {
81647
81661
  const accessors = {};
81648
- for (const name8 in attributes) {
81649
- const attribute = attributes[name8];
81650
- if (name8 !== "indices") {
81662
+ for (const name10 in attributes) {
81663
+ const attribute = attributes[name10];
81664
+ if (name10 !== "indices") {
81651
81665
  const glTFAccessor = getGLTFAccessor(attribute);
81652
- accessors[name8] = glTFAccessor;
81666
+ accessors[name10] = glTFAccessor;
81653
81667
  }
81654
81668
  }
81655
81669
  return accessors;
@@ -81791,16 +81805,192 @@ function* makeMeshPrimitiveIterator(scenegraph) {
81791
81805
  }
81792
81806
  }
81793
81807
 
81808
+ // ../gltf/src/lib/extensions/KHR_texture_transform.ts
81809
+ var KHR_texture_transform_exports = {};
81810
+ __export(KHR_texture_transform_exports, {
81811
+ decode: () => decode4,
81812
+ name: () => name5
81813
+ });
81814
+ var import_core15 = __toModule(require_es56());
81815
+
81816
+ // ../gltf/src/lib/gltf-utils/gltf-constants.ts
81817
+ var COMPONENTS = {
81818
+ SCALAR: 1,
81819
+ VEC2: 2,
81820
+ VEC3: 3,
81821
+ VEC4: 4,
81822
+ MAT2: 4,
81823
+ MAT3: 9,
81824
+ MAT4: 16
81825
+ };
81826
+ var BYTES = {
81827
+ 5120: 1,
81828
+ 5121: 1,
81829
+ 5122: 2,
81830
+ 5123: 2,
81831
+ 5125: 4,
81832
+ 5126: 4
81833
+ };
81834
+
81835
+ // ../gltf/src/lib/extensions/KHR_texture_transform.ts
81836
+ var EXT_MESHOPT_TRANSFORM = "KHR_texture_transform";
81837
+ var name5 = EXT_MESHOPT_TRANSFORM;
81838
+ var scratchVector4 = new import_core15.Vector3();
81839
+ var scratchRotationMatrix = new import_core15.Matrix3();
81840
+ var scratchScaleMatrix = new import_core15.Matrix3();
81841
+ async function decode4(gltfData, options) {
81842
+ const gltfScenegraph = new GLTFScenegraph(gltfData);
81843
+ const extension = gltfScenegraph.getExtension(EXT_MESHOPT_TRANSFORM);
81844
+ if (!extension) {
81845
+ return;
81846
+ }
81847
+ const materials = gltfData.json.materials || [];
81848
+ for (let i = 0; i < materials.length; i++) {
81849
+ transformTexCoords(i, gltfData);
81850
+ }
81851
+ }
81852
+ function transformTexCoords(materialIndex, gltfData) {
81853
+ const processedTexCoords = [];
81854
+ const material = gltfData.json.materials?.[materialIndex];
81855
+ const baseColorTexture = material?.pbrMetallicRoughness?.baseColorTexture;
81856
+ if (baseColorTexture) {
81857
+ transformPrimitives(gltfData, materialIndex, baseColorTexture, processedTexCoords);
81858
+ }
81859
+ const emisiveTexture = material?.emissiveTexture;
81860
+ if (emisiveTexture) {
81861
+ transformPrimitives(gltfData, materialIndex, emisiveTexture, processedTexCoords);
81862
+ }
81863
+ const normalTexture = material?.normalTexture;
81864
+ if (normalTexture) {
81865
+ transformPrimitives(gltfData, materialIndex, normalTexture, processedTexCoords);
81866
+ }
81867
+ const occlusionTexture = material?.occlusionTexture;
81868
+ if (occlusionTexture) {
81869
+ transformPrimitives(gltfData, materialIndex, occlusionTexture, processedTexCoords);
81870
+ }
81871
+ const metallicRoughnessTexture = material?.pbrMetallicRoughness?.metallicRoughnessTexture;
81872
+ if (metallicRoughnessTexture) {
81873
+ transformPrimitives(gltfData, materialIndex, metallicRoughnessTexture, processedTexCoords);
81874
+ }
81875
+ }
81876
+ function transformPrimitives(gltfData, materialIndex, texture, processedTexCoords) {
81877
+ const transformParameters = getTransformParameters(texture, processedTexCoords);
81878
+ if (!transformParameters) {
81879
+ return;
81880
+ }
81881
+ const meshes = gltfData.json.meshes || [];
81882
+ for (const mesh of meshes) {
81883
+ for (const primitive of mesh.primitives) {
81884
+ const material = primitive.material;
81885
+ if (Number.isFinite(material) && materialIndex === material) {
81886
+ transformPrimitive(gltfData, primitive, transformParameters);
81887
+ }
81888
+ }
81889
+ }
81890
+ }
81891
+ function getTransformParameters(texture, processedTexCoords) {
81892
+ const textureInfo = texture.extensions?.[EXT_MESHOPT_TRANSFORM];
81893
+ const { texCoord: originalTexCoord = 0 } = texture;
81894
+ const { texCoord = originalTexCoord } = textureInfo;
81895
+ const isProcessed = processedTexCoords.findIndex(([original, newTexCoord]) => original === originalTexCoord && newTexCoord === texCoord) !== -1;
81896
+ if (!isProcessed) {
81897
+ const matrix = makeTransformationMatrix(textureInfo);
81898
+ if (originalTexCoord !== texCoord) {
81899
+ texture.texCoord = texCoord;
81900
+ }
81901
+ processedTexCoords.push([originalTexCoord, texCoord]);
81902
+ return { originalTexCoord, texCoord, matrix };
81903
+ }
81904
+ return null;
81905
+ }
81906
+ function transformPrimitive(gltfData, primitive, transformParameters) {
81907
+ const { originalTexCoord, texCoord, matrix } = transformParameters;
81908
+ const texCoordAccessor = primitive.attributes[`TEXCOORD_${originalTexCoord}`];
81909
+ if (Number.isFinite(texCoordAccessor)) {
81910
+ const accessor = gltfData.json.accessors?.[texCoordAccessor];
81911
+ if (accessor && accessor.bufferView) {
81912
+ const bufferView = gltfData.json.bufferViews?.[accessor.bufferView];
81913
+ if (bufferView) {
81914
+ const { arrayBuffer, byteOffset: bufferByteOffset } = gltfData.buffers[bufferView.buffer];
81915
+ const byteOffset = (bufferByteOffset || 0) + (accessor.byteOffset || 0) + (bufferView.byteOffset || 0);
81916
+ const { ArrayType, length } = getAccessorArrayTypeAndLength(accessor, bufferView);
81917
+ const bytes = BYTES[accessor.componentType];
81918
+ const components = COMPONENTS[accessor.type];
81919
+ const elementAddressScale = bufferView.byteStride || bytes * components;
81920
+ const result = new Float32Array(length);
81921
+ for (let i = 0; i < accessor.count; i++) {
81922
+ const uv = new ArrayType(arrayBuffer, byteOffset + i * elementAddressScale, 2);
81923
+ scratchVector4.set(uv[0], uv[1], 1);
81924
+ scratchVector4.transformByMatrix3(matrix);
81925
+ result.set([scratchVector4[0], scratchVector4[1]], i * components);
81926
+ }
81927
+ if (originalTexCoord === texCoord) {
81928
+ updateGltf(accessor, bufferView, gltfData.buffers, result);
81929
+ } else {
81930
+ createAttribute(texCoord, accessor, primitive, gltfData, result);
81931
+ }
81932
+ }
81933
+ }
81934
+ }
81935
+ }
81936
+ function updateGltf(accessor, bufferView, buffers, newTexCoordArray) {
81937
+ accessor.componentType = 5126;
81938
+ buffers.push({
81939
+ arrayBuffer: newTexCoordArray.buffer,
81940
+ byteOffset: 0,
81941
+ byteLength: newTexCoordArray.buffer.byteLength
81942
+ });
81943
+ bufferView.buffer = buffers.length - 1;
81944
+ bufferView.byteLength = newTexCoordArray.buffer.byteLength;
81945
+ bufferView.byteOffset = 0;
81946
+ delete bufferView.byteStride;
81947
+ }
81948
+ function createAttribute(newTexCoord, originalAccessor, primitive, gltfData, newTexCoordArray) {
81949
+ gltfData.buffers.push({
81950
+ arrayBuffer: newTexCoordArray.buffer,
81951
+ byteOffset: 0,
81952
+ byteLength: newTexCoordArray.buffer.byteLength
81953
+ });
81954
+ const bufferViews = gltfData.json.bufferViews;
81955
+ if (!bufferViews) {
81956
+ return;
81957
+ }
81958
+ bufferViews.push({
81959
+ buffer: gltfData.buffers.length - 1,
81960
+ byteLength: newTexCoordArray.buffer.byteLength,
81961
+ byteOffset: 0
81962
+ });
81963
+ const accessors = gltfData.json.accessors;
81964
+ if (!accessors) {
81965
+ return;
81966
+ }
81967
+ accessors.push({
81968
+ bufferView: bufferViews?.length - 1,
81969
+ byteOffset: 0,
81970
+ componentType: 5126,
81971
+ count: originalAccessor.count,
81972
+ type: "VEC2"
81973
+ });
81974
+ primitive.attributes[`TEXCOORD_${newTexCoord}`] = accessors.length - 1;
81975
+ }
81976
+ function makeTransformationMatrix(extensionData) {
81977
+ const { offset = [0, 0], rotation = 0, scale = [1, 1] } = extensionData;
81978
+ const translationMatirx = new import_core15.Matrix3().set(1, 0, 0, 0, 1, 0, offset[0], offset[1], 1);
81979
+ const rotationMatirx = scratchRotationMatrix.set(Math.cos(rotation), Math.sin(rotation), 0, -Math.sin(rotation), Math.cos(rotation), 0, 0, 0, 1);
81980
+ const scaleMatrix = scratchScaleMatrix.set(scale[0], 0, 0, 0, scale[1], 0, 0, 0, 1);
81981
+ return translationMatirx.multiplyRight(rotationMatirx).multiplyRight(scaleMatrix);
81982
+ }
81983
+
81794
81984
  // ../gltf/src/lib/extensions/deprecated/KHR_lights_punctual.ts
81795
81985
  var KHR_lights_punctual_exports = {};
81796
81986
  __export(KHR_lights_punctual_exports, {
81797
- decode: () => decode4,
81987
+ decode: () => decode5,
81798
81988
  encode: () => encode3,
81799
- name: () => name5
81989
+ name: () => name6
81800
81990
  });
81801
81991
  var KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
81802
- var name5 = KHR_LIGHTS_PUNCTUAL;
81803
- async function decode4(gltfData) {
81992
+ var name6 = KHR_LIGHTS_PUNCTUAL;
81993
+ async function decode5(gltfData) {
81804
81994
  const gltfScenegraph = new GLTFScenegraph(gltfData);
81805
81995
  const { json } = gltfScenegraph;
81806
81996
  const extension = gltfScenegraph.getExtension(KHR_LIGHTS_PUNCTUAL);
@@ -81837,13 +82027,13 @@ async function encode3(gltfData) {
81837
82027
  // ../gltf/src/lib/extensions/deprecated/KHR_materials_unlit.ts
81838
82028
  var KHR_materials_unlit_exports = {};
81839
82029
  __export(KHR_materials_unlit_exports, {
81840
- decode: () => decode5,
82030
+ decode: () => decode6,
81841
82031
  encode: () => encode4,
81842
- name: () => name6
82032
+ name: () => name7
81843
82033
  });
81844
82034
  var KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
81845
- var name6 = KHR_MATERIALS_UNLIT;
81846
- async function decode5(gltfData) {
82035
+ var name7 = KHR_MATERIALS_UNLIT;
82036
+ async function decode6(gltfData) {
81847
82037
  const gltfScenegraph = new GLTFScenegraph(gltfData);
81848
82038
  const { json } = gltfScenegraph;
81849
82039
  gltfScenegraph.removeExtension(KHR_MATERIALS_UNLIT);
@@ -81872,13 +82062,13 @@ function encode4(gltfData) {
81872
82062
  // ../gltf/src/lib/extensions/deprecated/KHR_techniques_webgl.ts
81873
82063
  var KHR_techniques_webgl_exports = {};
81874
82064
  __export(KHR_techniques_webgl_exports, {
81875
- decode: () => decode6,
82065
+ decode: () => decode7,
81876
82066
  encode: () => encode5,
81877
- name: () => name7
82067
+ name: () => name8
81878
82068
  });
81879
82069
  var KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
81880
- var name7 = KHR_TECHNIQUES_WEBGL;
81881
- async function decode6(gltfData) {
82070
+ var name8 = KHR_TECHNIQUES_WEBGL;
82071
+ async function decode7(gltfData) {
81882
82072
  const gltfScenegraph = new GLTFScenegraph(gltfData);
81883
82073
  const { json } = gltfScenegraph;
81884
82074
  const extension = gltfScenegraph.getExtension(KHR_TECHNIQUES_WEBGL);
@@ -81931,6 +82121,85 @@ function resolveValues(technique, gltfScenegraph) {
81931
82121
  return values;
81932
82122
  }
81933
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
+
81934
82203
  // ../gltf/src/lib/api/gltf-extensions.ts
81935
82204
  var EXTENSIONS2 = [
81936
82205
  EXT_meshopt_compression_exports,
@@ -81939,7 +82208,9 @@ var EXTENSIONS2 = [
81939
82208
  KHR_draco_mesh_compression_exports,
81940
82209
  KHR_lights_punctual_exports,
81941
82210
  KHR_materials_unlit_exports,
81942
- KHR_techniques_webgl_exports
82211
+ KHR_techniques_webgl_exports,
82212
+ KHR_texture_transform_exports,
82213
+ EXT_feature_metadata_exports
81943
82214
  ];
81944
82215
  function preprocessExtensions(gltf, options = {}, context) {
81945
82216
  const extensions = EXTENSIONS2.filter((extension) => useExtension(extension.name, options));
@@ -82172,7 +82443,7 @@ function normalizeGLTFV1(gltf, options = {}) {
82172
82443
  }
82173
82444
 
82174
82445
  // ../gltf/src/lib/api/post-process-gltf.ts
82175
- var COMPONENTS = {
82446
+ var COMPONENTS2 = {
82176
82447
  SCALAR: 1,
82177
82448
  VEC2: 2,
82178
82449
  VEC3: 3,
@@ -82181,7 +82452,7 @@ var COMPONENTS = {
82181
82452
  MAT3: 9,
82182
82453
  MAT4: 16
82183
82454
  };
82184
- var BYTES = {
82455
+ var BYTES2 = {
82185
82456
  5120: 1,
82186
82457
  5121: 1,
82187
82458
  5122: 2,
@@ -82211,10 +82482,10 @@ var DEFAULT_SAMPLER = {
82211
82482
  [GL_SAMPLER.TEXTURE_WRAP_T]: GL_SAMPLER.REPEAT
82212
82483
  };
82213
82484
  function getBytesFromComponentType(componentType) {
82214
- return BYTES[componentType];
82485
+ return BYTES2[componentType];
82215
82486
  }
82216
82487
  function getSizeFromAccessorType(type) {
82217
- return COMPONENTS[type];
82488
+ return COMPONENTS2[type];
82218
82489
  }
82219
82490
  var GLTFPostProcessor = class {
82220
82491
  constructor() {
@@ -82912,7 +83183,7 @@ function parseBatchedModel(tile, arrayBuffer, byteOffset, options, context) {
82912
83183
  }
82913
83184
 
82914
83185
  // ../3d-tiles/src/lib/parsers/parse-3d-tile-instanced-model.ts
82915
- var import_core15 = __toModule(require_es56());
83186
+ var import_core16 = __toModule(require_es56());
82916
83187
  var import_geospatial7 = __toModule(require_es57());
82917
83188
  async function parseInstancedModel3DTile(tile, arrayBuffer, byteOffset, options, context) {
82918
83189
  byteOffset = parseInstancedModel(tile, arrayBuffer, byteOffset, options, context);
@@ -82957,19 +83228,19 @@ function extractInstancedAttributes(tile, featureTable, batchTable, instancesLen
82957
83228
  forwardAxis: [1, 0, 0]
82958
83229
  };
82959
83230
  const instances = collectionOptions.instances;
82960
- const instancePosition = new import_core15.Vector3();
82961
- const instanceNormalRight = new import_core15.Vector3();
82962
- const instanceNormalUp = new import_core15.Vector3();
82963
- const instanceNormalForward = new import_core15.Vector3();
82964
- const instanceRotation = new import_core15.Matrix3();
82965
- const instanceQuaternion = new import_core15.Quaternion();
82966
- const instanceScale = new import_core15.Vector3();
83231
+ const instancePosition = new import_core16.Vector3();
83232
+ const instanceNormalRight = new import_core16.Vector3();
83233
+ const instanceNormalUp = new import_core16.Vector3();
83234
+ const instanceNormalForward = new import_core16.Vector3();
83235
+ const instanceRotation = new import_core16.Matrix3();
83236
+ const instanceQuaternion = new import_core16.Quaternion();
83237
+ const instanceScale = new import_core16.Vector3();
82967
83238
  const instanceTranslationRotationScale = {};
82968
- const instanceTransform = new import_core15.Matrix4();
83239
+ const instanceTransform = new import_core16.Matrix4();
82969
83240
  const scratch1 = [];
82970
83241
  const scratch2 = [];
82971
- const scratchVector1 = new import_core15.Vector3();
82972
- const scratchVector23 = new import_core15.Vector3();
83242
+ const scratchVector1 = new import_core16.Vector3();
83243
+ const scratchVector23 = new import_core16.Vector3();
82973
83244
  for (let i = 0; i < instancesLength; i++) {
82974
83245
  let position;
82975
83246
  if (featureTable.hasProperty("POSITION")) {
@@ -83039,7 +83310,7 @@ function extractInstancedAttributes(tile, featureTable, batchTable, instancesLen
83039
83310
  if (batchId === void 0) {
83040
83311
  batchId = i;
83041
83312
  }
83042
- const rotationMatrix = new import_core15.Matrix4().fromQuaternion(instanceTranslationRotationScale.rotation);
83313
+ const rotationMatrix = new import_core16.Matrix4().fromQuaternion(instanceTranslationRotationScale.rotation);
83043
83314
  instanceTransform.identity();
83044
83315
  instanceTransform.translate(instanceTranslationRotationScale.translation);
83045
83316
  instanceTransform.multiplyRight(rotationMatrix);
@@ -83129,8 +83400,8 @@ async function parse3DTilesSubtree(data) {
83129
83400
  }
83130
83401
  return subtree;
83131
83402
  }
83132
- async function getExplicitBitstream(subtree, name8, internalBinaryBuffer) {
83133
- const bufferViewIndex = subtree[name8].bufferView;
83403
+ async function getExplicitBitstream(subtree, name10, internalBinaryBuffer) {
83404
+ const bufferViewIndex = subtree[name10].bufferView;
83134
83405
  const bufferView = subtree.bufferViews[bufferViewIndex];
83135
83406
  const buffer = subtree.buffers[bufferView.buffer];
83136
83407
  if (buffer.uri) {
@@ -84089,7 +84360,7 @@ async function getTotalFilesSize(dirPath) {
84089
84360
  }
84090
84361
 
84091
84362
  // src/i3s-converter/helpers/geometry-converter.ts
84092
- var import_core21 = __toModule(require_es56());
84363
+ var import_core22 = __toModule(require_es56());
84093
84364
  var import_geospatial9 = __toModule(require_es57());
84094
84365
  var import_md5 = __toModule(require_md52());
84095
84366
 
@@ -84119,30 +84390,42 @@ function generateAttributes(attributes) {
84119
84390
  function calculateFaceRangesAndFeaturesCount(featureIndices) {
84120
84391
  let rangeIndex = 1;
84121
84392
  let featureIndex = 1;
84122
- let currentFeatureId = featureIndices[0];
84393
+ let currentFeatureId = getFrequentValue(featureIndices.slice(0, VALUES_PER_VERTEX));
84123
84394
  const faceRangeList = [];
84124
84395
  const featureIds = [];
84125
84396
  const uniqueFeatureIds = [currentFeatureId];
84126
84397
  faceRangeList[0] = 0;
84127
84398
  featureIds[0] = currentFeatureId;
84128
- for (let index = 1; index < featureIndices.length; index++) {
84129
- 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) {
84130
84402
  faceRangeList[rangeIndex] = index / VALUES_PER_VERTEX - 1;
84131
84403
  faceRangeList[rangeIndex + 1] = index / VALUES_PER_VERTEX;
84132
- featureIds[featureIndex] = featureIndices[index];
84133
- if (!uniqueFeatureIds.includes(featureIndices[index])) {
84134
- uniqueFeatureIds.push(featureIndices[index]);
84404
+ featureIds[featureIndex] = newFeatureId;
84405
+ if (!uniqueFeatureIds.includes(newFeatureId)) {
84406
+ uniqueFeatureIds.push(newFeatureId);
84135
84407
  }
84136
84408
  rangeIndex += 2;
84137
84409
  featureIndex += 1;
84138
84410
  }
84139
- currentFeatureId = featureIndices[index];
84411
+ currentFeatureId = newFeatureId;
84140
84412
  }
84141
84413
  faceRangeList[rangeIndex] = featureIndices.length / VALUES_PER_VERTEX - 1;
84142
84414
  const faceRange = new Uint32Array(faceRangeList);
84143
84415
  const featureCount = uniqueFeatureIds.length;
84144
84416
  return { faceRange, featureCount, featureIds };
84145
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
+ }
84146
84429
  function makeAttributeObjects(attributes) {
84147
84430
  const {
84148
84431
  featureIds,
@@ -84242,7 +84525,7 @@ function groupAttributesAndRangesByFeatureId(unifiedObjects, featureCount) {
84242
84525
  }
84243
84526
 
84244
84527
  // src/i3s-converter/helpers/coordinate-converter.ts
84245
- var import_core20 = __toModule(require_es56());
84528
+ var import_core21 = __toModule(require_es56());
84246
84529
  var import_geospatial8 = __toModule(require_es57());
84247
84530
  var import_culling5 = __toModule(require_es58());
84248
84531
  function createBoundingVolumes(tile, geoidHeightModel) {
@@ -84250,16 +84533,16 @@ function createBoundingVolumes(tile, geoidHeightModel) {
84250
84533
  let halfSize;
84251
84534
  let quaternion;
84252
84535
  const boundingVolume = tile.boundingVolume;
84253
- const cartographicCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(boundingVolume.center, new import_core20.Vector3());
84536
+ const cartographicCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(boundingVolume.center, new import_core21.Vector3());
84254
84537
  cartographicCenter[2] = cartographicCenter[2] - geoidHeightModel.getHeight(cartographicCenter[1], cartographicCenter[0]);
84255
84538
  if (boundingVolume instanceof import_culling5.OrientedBoundingBox) {
84256
84539
  halfSize = boundingVolume.halfSize;
84257
- radius = new import_core20.Vector3(halfSize[0], halfSize[1], halfSize[2]).len();
84540
+ radius = new import_core21.Vector3(halfSize[0], halfSize[1], halfSize[2]).len();
84258
84541
  quaternion = boundingVolume.quaternion;
84259
84542
  } else {
84260
84543
  radius = tile.boundingVolume.radius;
84261
84544
  halfSize = [radius, radius, radius];
84262
- quaternion = new import_core20.Quaternion().fromMatrix3(new import_core20.Matrix3([halfSize[0], 0, 0, 0, halfSize[1], 0, 0, 0, halfSize[2]])).normalize();
84545
+ quaternion = new import_core21.Quaternion().fromMatrix3(new import_core21.Matrix3([halfSize[0], 0, 0, 0, halfSize[1], 0, 0, 0, halfSize[2]])).normalize();
84263
84546
  }
84264
84547
  return {
84265
84548
  mbs: [cartographicCenter[0], cartographicCenter[1], cartographicCenter[2], radius],
@@ -84274,8 +84557,8 @@ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel)
84274
84557
  const positionVectors = convertPositionsToVectors(cartesianPositions);
84275
84558
  const geometryObb = (0, import_culling5.makeOrientedBoundingBoxFromPoints)(positionVectors);
84276
84559
  const geometryMbs = (0, import_culling5.makeBoundingSphereFromPoints)(positionVectors);
84277
- let mbsCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new import_core20.Vector3());
84278
- let obbCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new import_core20.Vector3());
84560
+ let mbsCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new import_core21.Vector3());
84561
+ let obbCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new import_core21.Vector3());
84279
84562
  mbsCenter[2] = mbsCenter[2] - geoidHeightModel.getHeight(mbsCenter[1], mbsCenter[0]);
84280
84563
  obbCenter[2] = obbCenter[2] - geoidHeightModel.getHeight(obbCenter[1], obbCenter[0]);
84281
84564
  return {
@@ -84290,7 +84573,7 @@ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel)
84290
84573
  function convertPositionsToVectors(positions) {
84291
84574
  const result = [];
84292
84575
  for (let i = 0; i < positions.length; i += 3) {
84293
- const positionVector = new import_core20.Vector3([positions[i], positions[i + 1], positions[i + 2]]);
84576
+ const positionVector = new import_core21.Vector3([positions[i], positions[i + 1], positions[i + 2]]);
84294
84577
  result.push(positionVector);
84295
84578
  }
84296
84579
  return result;
@@ -84304,8 +84587,8 @@ function convertBoundingVolumeToI3SFullExtent(boundingVolume) {
84304
84587
  }
84305
84588
  const center = sphere.center;
84306
84589
  const radius = sphere.radius;
84307
- const vertexMax = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new import_core20.Vector3(center[0] + radius, center[1] + radius, center[2] + radius), new import_core20.Vector3());
84308
- const vertexMin = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new import_core20.Vector3(center[0] - radius, center[1] - radius, center[2] - radius), new import_core20.Vector3());
84590
+ const vertexMax = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new import_core21.Vector3(center[0] + radius, center[1] + radius, center[2] + radius), new import_core21.Vector3());
84591
+ const vertexMin = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new import_core21.Vector3(center[0] - radius, center[1] - radius, center[2] - radius), new import_core21.Vector3());
84309
84592
  return {
84310
84593
  xmin: vertexMin[0],
84311
84594
  xmax: vertexMax[0],
@@ -84317,8 +84600,8 @@ function convertBoundingVolumeToI3SFullExtent(boundingVolume) {
84317
84600
  }
84318
84601
  function createObbFromMbs(mbs) {
84319
84602
  const radius = mbs[3];
84320
- const center = new import_core20.Vector3(mbs[0], mbs[1], mbs[2]);
84321
- const halfAxex = new import_core20.Matrix3([radius, 0, 0, 0, radius, 0, 0, 0, radius]);
84603
+ const center = new import_core21.Vector3(mbs[0], mbs[1], mbs[2]);
84604
+ const halfAxex = new import_core21.Matrix3([radius, 0, 0, 0, radius, 0, 0, 0, radius]);
84322
84605
  return new import_culling5.OrientedBoundingBox(center, halfAxex);
84323
84606
  }
84324
84607
 
@@ -84335,12 +84618,24 @@ function getB3DMAttributesWithoutBufferView(attributes) {
84335
84618
  function prepareDataForAttributesConversion(tileContent) {
84336
84619
  const gltfMaterials = tileContent.gltf?.materials?.map((material) => ({ id: material.id }));
84337
84620
  let nodes = tileContent.gltf?.scene?.nodes || tileContent.gltf?.scenes?.[0]?.nodes || tileContent.gltf?.nodes || [];
84621
+ const images = tileContent.gltf?.images?.map((imageObject) => {
84622
+ const data = imageObject?.image?.compressed ? null : imageObject?.image?.data.subarray();
84623
+ return {
84624
+ data,
84625
+ compressed: Boolean(imageObject?.image?.compressed),
84626
+ height: imageObject.image.height,
84627
+ width: imageObject.image.width,
84628
+ components: imageObject.image.components,
84629
+ mimeType: imageObject.mimeType
84630
+ };
84631
+ }) || [];
84338
84632
  const prepearedNodes = nodes.map((node2) => {
84339
84633
  if (!node2.mesh) {
84340
84634
  return node2;
84341
84635
  }
84342
84636
  return {
84343
84637
  ...node2,
84638
+ images,
84344
84639
  mesh: {
84345
84640
  ...node2.mesh,
84346
84641
  primitives: node2.mesh?.primitives.map((primitive) => ({
@@ -84364,6 +84659,130 @@ function prepareDataForAttributesConversion(tileContent) {
84364
84659
  };
84365
84660
  }
84366
84661
 
84662
+ // src/i3s-converter/helpers/batch-ids-extensions.ts
84663
+ var EXT_MESH_FEATURES = "EXT_mesh_features";
84664
+ var EXT_FEATURE_METADATA2 = "EXT_feature_metadata";
84665
+ function handleBatchIdsExtensions(attributes, primitive, images) {
84666
+ const extensions = primitive?.extensions;
84667
+ if (!extensions) {
84668
+ return [];
84669
+ }
84670
+ for (const [extensionName, extensionData] of Object.entries(extensions || {})) {
84671
+ switch (extensionName) {
84672
+ case EXT_FEATURE_METADATA2:
84673
+ return handleExtFeatureMetadataExtension(attributes, extensionData, images);
84674
+ case EXT_MESH_FEATURES:
84675
+ console.warn("EXT_mesh_features extension is not supported yet");
84676
+ return [];
84677
+ default:
84678
+ return [];
84679
+ }
84680
+ }
84681
+ return [];
84682
+ }
84683
+ function handleExtFeatureMetadataExtension(attributes, extFeatureMetadata, images) {
84684
+ const featureIdAttribute = extFeatureMetadata?.featureIdAttributes?.[0];
84685
+ if (featureIdAttribute?.featureIds?.attribute) {
84686
+ const batchIdsAttribute = attributes[featureIdAttribute.featureIds.attribute];
84687
+ return batchIdsAttribute.value;
84688
+ }
84689
+ if (featureIdAttribute?.featureIds?.hasOwnProperty("constant") && featureIdAttribute?.featureIds?.hasOwnProperty("divisor")) {
84690
+ const featuresCount = attributes?.POSITIONS?.value.length / 3 || 0;
84691
+ return generateImplicitFeatureIds(featuresCount, featureIdAttribute.featureIds.constant, featureIdAttribute.featureIds.divisor);
84692
+ }
84693
+ const featureIdTexture = extFeatureMetadata?.featureIdTextures && extFeatureMetadata?.featureIdTextures[0];
84694
+ if (featureIdTexture) {
84695
+ const textureAttributeIndex = featureIdTexture?.featureIds?.texture?.texCoord || 0;
84696
+ const textCoordAttribute = `TEXCOORD_${textureAttributeIndex}`;
84697
+ const textureCoordinates = attributes[textCoordAttribute].value;
84698
+ return generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, images);
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
+ }
84705
+ return [];
84706
+ }
84707
+ function generateImplicitFeatureIds(featuresCount, constant = 0, divisor = 0) {
84708
+ let featureIds = [];
84709
+ if (divisor > 0) {
84710
+ let currentValue = constant;
84711
+ let devisorCounter = divisor;
84712
+ for (let index = 0; index < featuresCount; index++) {
84713
+ featureIds.push(currentValue);
84714
+ devisorCounter -= 1;
84715
+ if (devisorCounter === 0) {
84716
+ currentValue++;
84717
+ devisorCounter = divisor;
84718
+ }
84719
+ }
84720
+ } else {
84721
+ featureIds = Array(featuresCount).fill(constant, 0, featuresCount);
84722
+ }
84723
+ return featureIds;
84724
+ }
84725
+ function generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, images) {
84726
+ const CHANNELS_MAP = {
84727
+ r: 0,
84728
+ g: 1,
84729
+ b: 2,
84730
+ a: 3
84731
+ };
84732
+ const textureIndex = featureIdTexture?.featureIds?.texture?.index;
84733
+ const featureChannel = featureIdTexture?.featureIds?.channels;
84734
+ if (!featureChannel || textureIndex === void 0) {
84735
+ return [];
84736
+ }
84737
+ const image = images[textureIndex];
84738
+ const batchIds = [];
84739
+ const channels = CHANNELS_MAP[featureChannel];
84740
+ if (!image.compressed) {
84741
+ for (let index = 0; index < textureCoordinates.length; index += 2) {
84742
+ const u = textureCoordinates[index];
84743
+ const v = textureCoordinates[index + 1];
84744
+ const tx = Math.min(emod(u) * image.width | 0, image.width - 1);
84745
+ const ty = Math.min(emod(v) * image.height | 0, image.height - 1);
84746
+ const offset = (ty * image.width + tx) * image.components + channels;
84747
+ const batchId = new Uint8Array(image.data)[offset];
84748
+ batchIds.push(batchId);
84749
+ }
84750
+ } else {
84751
+ console.warn(`Can't get batch Ids from ${image.mimeType} compressed texture`);
84752
+ }
84753
+ return batchIds;
84754
+ }
84755
+ function emod(n) {
84756
+ return (n % 1 + 1) % 1;
84757
+ }
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
+
84367
84786
  // src/i3s-converter/helpers/geometry-converter.ts
84368
84787
  var DEFAULT_ROUGHNESS_FACTOR = 1;
84369
84788
  var DEFAULT_METALLIC_FACTOR = 1;
@@ -84375,8 +84794,10 @@ var SHORT_INT_TYPE = "Int32";
84375
84794
  var DOUBLE_TYPE = "Float64";
84376
84795
  var OBJECT_ID_TYPE = "Oid32";
84377
84796
  var BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ["CUSTOM_ATTRIBUTE_2", "_BATCHID", "BATCHID"];
84378
- var scratchVector4 = new import_core21.Vector3();
84379
- async function convertB3dmToI3sGeometry(tileContent, nodeId, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, geoidHeightModel, workerSource) {
84797
+ var EXT_FEATURE_METADATA3 = "EXT_feature_metadata";
84798
+ var EXT_MESH_FEATURES2 = "EXT_mesh_features";
84799
+ var scratchVector5 = new import_core22.Vector3();
84800
+ async function convertB3dmToI3sGeometry(tileContent, nodeId, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, geoidHeightModel, workerSource) {
84380
84801
  const useCartesianPositions = generateBoundingVolumes;
84381
84802
  const materialAndTextureList = convertMaterials(tileContent.gltf?.materials);
84382
84803
  const dataForAttributesConversion = prepareDataForAttributesConversion(tileContent);
@@ -84412,6 +84833,7 @@ async function convertB3dmToI3sGeometry(tileContent, nodeId, featuresHashArray,
84412
84833
  tileContent,
84413
84834
  nodeId: nodesCounter,
84414
84835
  featuresHashArray,
84836
+ propertyTable,
84415
84837
  attributeStorageInfo,
84416
84838
  draco,
84417
84839
  workerSource
@@ -84430,10 +84852,10 @@ function _generateBoundingVolumesFromGeometry(convertedAttributesMap, geoidHeigh
84430
84852
  const cartographicOrigin = boundingVolumes.obb.center;
84431
84853
  for (let index = 0; index < attributes.positions.length; index += VALUES_PER_VERTEX2) {
84432
84854
  const vertex = attributes.positions.subarray(index, index + VALUES_PER_VERTEX2);
84433
- import_geospatial9.Ellipsoid.WGS84.cartesianToCartographic(Array.from(vertex), scratchVector4);
84434
- scratchVector4[2] = scratchVector4[2] - geoidHeightModel.getHeight(scratchVector4[1], scratchVector4[0]);
84435
- scratchVector4 = scratchVector4.subtract(cartographicOrigin);
84436
- attributes.positions.set(scratchVector4, index);
84855
+ import_geospatial9.Ellipsoid.WGS84.cartesianToCartographic(Array.from(vertex), scratchVector5);
84856
+ scratchVector5[2] = scratchVector5[2] - geoidHeightModel.getHeight(scratchVector5[1], scratchVector5[0]);
84857
+ scratchVector5 = scratchVector5.subtract(cartographicOrigin);
84858
+ attributes.positions.set(scratchVector5, index);
84437
84859
  }
84438
84860
  }
84439
84861
  }
@@ -84444,6 +84866,7 @@ async function _makeNodeResources({
84444
84866
  tileContent,
84445
84867
  nodeId,
84446
84868
  featuresHashArray,
84869
+ propertyTable,
84447
84870
  attributeStorageInfo,
84448
84871
  draco,
84449
84872
  workerSource
@@ -84466,7 +84889,10 @@ async function _makeNodeResources({
84466
84889
  featureIds,
84467
84890
  faceRange
84468
84891
  }, workerSource.draco) : null;
84469
- const attributes = convertBatchTableToAttributeBuffers(tileContent.batchTableJson, featureIds, attributeStorageInfo);
84892
+ let attributes = [];
84893
+ if (attributeStorageInfo && propertyTable) {
84894
+ attributes = convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo);
84895
+ }
84470
84896
  return {
84471
84897
  geometry: fileBuffer,
84472
84898
  compressedGeometry,
@@ -84510,7 +84936,7 @@ async function convertAttributes(attributesData, useCartesianPositions) {
84510
84936
  }
84511
84937
  return attributesMap;
84512
84938
  }
84513
- function convertNodes(nodes, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core21.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
84939
+ function convertNodes(nodes, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core22.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
84514
84940
  if (nodes) {
84515
84941
  for (const node2 of nodes) {
84516
84942
  convertNode(node2, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix);
@@ -84534,15 +84960,16 @@ function getCompositeTransformationMatrix(node2, matrix) {
84534
84960
  }
84535
84961
  return transformationMatrix;
84536
84962
  }
84537
- function convertNode(node2, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core21.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
84963
+ function convertNode(node2, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core22.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
84538
84964
  const transformationMatrix = getCompositeTransformationMatrix(node2, matrix);
84539
84965
  const mesh = node2.mesh;
84966
+ const images = node2.images;
84540
84967
  if (mesh) {
84541
- convertMesh(mesh, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
84968
+ convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
84542
84969
  }
84543
84970
  convertNodes(node2.children || [], cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
84544
84971
  }
84545
- function convertMesh(mesh, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions = false, matrix = new import_core21.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
84972
+ function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions = false, matrix = new import_core22.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
84546
84973
  for (const primitive of mesh.primitives) {
84547
84974
  let outputAttributes = null;
84548
84975
  if (primitive.material) {
@@ -84576,7 +85003,7 @@ function convertMesh(mesh, cartographicOrigin, cartesianModelMatrix, attributesM
84576
85003
  outputAttributes.texCoords = concatenateTypedArrays(outputAttributes.texCoords, flattenTexCoords(attributes.TEXCOORD_0 && attributes.TEXCOORD_0.value, primitive.indices?.value));
84577
85004
  outputAttributes.colors = concatenateTypedArrays(outputAttributes.colors, flattenColors(attributes.COLOR_0, primitive.indices?.value));
84578
85005
  outputAttributes.featureIndicesGroups = outputAttributes.featureIndicesGroups || [];
84579
- outputAttributes.featureIndicesGroups.push(flattenBatchIds(getBatchIdsByAttributeName(attributes), primitive.indices?.value));
85006
+ outputAttributes.featureIndicesGroups.push(flattenBatchIds(getBatchIds(attributes, primitive, images), primitive.indices?.value));
84580
85007
  }
84581
85008
  }
84582
85009
  function transformVertexArray(args) {
@@ -84588,7 +85015,7 @@ function transformVertexArray(args) {
84588
85015
  for (let i = 0; i < indices.length; i++) {
84589
85016
  const coordIndex = indices[i] * VALUES_PER_VERTEX2;
84590
85017
  const vertex = vertices.subarray(coordIndex, coordIndex + VALUES_PER_VERTEX2);
84591
- let vertexVector = new import_core21.Vector3(Array.from(vertex));
85018
+ let vertexVector = new import_core22.Vector3(Array.from(vertex));
84592
85019
  vertexVector = attributeSpecificTransformation(vertexVector, args);
84593
85020
  newVertices[i * VALUES_PER_VERTEX2] = vertexVector.x;
84594
85021
  newVertices[i * VALUES_PER_VERTEX2 + 1] = vertexVector.y;
@@ -84661,16 +85088,18 @@ function flattenBatchIds(batchedIds, indices) {
84661
85088
  }
84662
85089
  return newBatchIds;
84663
85090
  }
84664
- function getBatchIdsByAttributeName(attributes) {
84665
- let batchIds = [];
85091
+ function getBatchIds(attributes, primitive, images) {
85092
+ const batchIds = handleBatchIdsExtensions(attributes, primitive, images);
85093
+ if (batchIds.length) {
85094
+ return batchIds;
85095
+ }
84666
85096
  for (let index = 0; index < BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES.length; index++) {
84667
85097
  const possibleBatchIdAttributeName = BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES[index];
84668
85098
  if (attributes[possibleBatchIdAttributeName] && attributes[possibleBatchIdAttributeName].value) {
84669
- batchIds = attributes[possibleBatchIdAttributeName].value;
84670
- break;
85099
+ return attributes[possibleBatchIdAttributeName].value;
84671
85100
  }
84672
85101
  }
84673
- return batchIds;
85102
+ return [];
84674
85103
  }
84675
85104
  function convertMaterials(sourceMaterials = []) {
84676
85105
  const result = [];
@@ -84763,10 +85192,10 @@ function convertGLTFMaterialToI3sSharedResources(gltfMaterial, nodeId) {
84763
85192
  }
84764
85193
  function extractSharedResourcesMaterialInfo(baseColorFactor, metallicFactor = 1) {
84765
85194
  const matDielectricColorComponent = 0.04 / 255;
84766
- const black = new import_core21.Vector4(0, 0, 0, 1);
84767
- const unitVector = new import_core21.Vector4(1, 1, 1, 1);
84768
- const dielectricSpecular = new import_core21.Vector4(matDielectricColorComponent, matDielectricColorComponent, matDielectricColorComponent, 0);
84769
- const baseColorVector = new import_core21.Vector4(baseColorFactor);
85195
+ const black = new import_core22.Vector4(0, 0, 0, 1);
85196
+ const unitVector = new import_core22.Vector4(1, 1, 1, 1);
85197
+ const dielectricSpecular = new import_core22.Vector4(matDielectricColorComponent, matDielectricColorComponent, matDielectricColorComponent, 0);
85198
+ const baseColorVector = new import_core22.Vector4(baseColorFactor);
84770
85199
  const firstOperand = unitVector.subtract(dielectricSpecular).multiply(baseColorVector);
84771
85200
  const diffuse = firstOperand.lerp(firstOperand, black, metallicFactor);
84772
85201
  dielectricSpecular[3] = 1;
@@ -84840,37 +85269,40 @@ function replaceIndicesByUnique(indicesArray, featureMap) {
84840
85269
  indicesArray[index] = featureMap[indicesArray[index]];
84841
85270
  }
84842
85271
  }
84843
- function convertBatchTableToAttributeBuffers(batchTable, featureIds, attributeStorageInfo) {
85272
+ function convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo) {
84844
85273
  const attributeBuffers = [];
84845
- if (batchTable) {
84846
- const batchTableWithFeatureIds = {
84847
- OBJECTID: featureIds,
84848
- ...batchTable
84849
- };
84850
- for (const key in batchTableWithFeatureIds) {
84851
- const type = getAttributeType(key, attributeStorageInfo);
84852
- let attributeBuffer = null;
84853
- switch (type) {
84854
- case OBJECT_ID_TYPE:
84855
- case SHORT_INT_TYPE:
84856
- attributeBuffer = generateShortIntegerAttributeBuffer(batchTableWithFeatureIds[key]);
84857
- break;
84858
- case DOUBLE_TYPE:
84859
- attributeBuffer = generateDoubleAttributeBuffer(batchTableWithFeatureIds[key]);
84860
- break;
84861
- case STRING_TYPE:
84862
- attributeBuffer = generateStringAttributeBuffer(batchTableWithFeatureIds[key]);
84863
- break;
84864
- default:
84865
- attributeBuffer = generateStringAttributeBuffer(batchTableWithFeatureIds[key]);
84866
- }
84867
- if (attributeBuffer) {
84868
- attributeBuffers.push(attributeBuffer);
84869
- }
84870
- }
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);
84871
85285
  }
84872
85286
  return attributeBuffers;
84873
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
+ }
84874
85306
  function getAttributeType(key, attributeStorageInfo) {
84875
85307
  const attribute = attributeStorageInfo.find((attr) => attr.name === key);
84876
85308
  return attribute.attributeValues.valueType;
@@ -84955,6 +85387,59 @@ function generateFeatureIndexAttribute(featureIndex, faceRange) {
84955
85387
  }
84956
85388
  return orderedFeatureIndices;
84957
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
+ }
84958
85443
 
84959
85444
  // src/i3s-converter/helpers/create-scene-server-path.ts
84960
85445
  var import_json_map_transform2 = __toModule(require_json_map_transform());
@@ -85583,7 +86068,7 @@ function transfromTextureDefinitions(textureDefinitionInfos, thisObject, origina
85583
86068
  // src/i3s-converter/helpers/node-debug.ts
85584
86069
  var import_culling6 = __toModule(require_es58());
85585
86070
  var import_engine = __toModule(require_es515());
85586
- var import_core23 = __toModule(require_es56());
86071
+ var import_core24 = __toModule(require_es56());
85587
86072
  var import_geospatial10 = __toModule(require_es57());
85588
86073
  function validateNodeBoundingVolumes(node2) {
85589
86074
  if (!node2?.parentNode?.obb || !node2?.parentNode?.mbs) {
@@ -85628,7 +86113,7 @@ function getTileObbVertices(node2) {
85628
86113
  const obbCenterCartesian = import_geospatial10.Ellipsoid.WGS84.cartographicToCartesian(node2.obb.center);
85629
86114
  let vertices = [];
85630
86115
  for (let i = 0; i < positions.length; i += 3) {
85631
- const positionsVector = new import_core23.Vector3(positions[i] *= halfSize[0], positions[i + 1] *= halfSize[1], positions[i + 2] *= halfSize[2]);
86116
+ const positionsVector = new import_core24.Vector3(positions[i] *= halfSize[0], positions[i + 1] *= halfSize[1], positions[i + 2] *= halfSize[2]);
85632
86117
  const rotatedPositions = positionsVector.transformByQuaternion(node2.obb.quaternion).add(obbCenterCartesian);
85633
86118
  vertices = vertices.concat(rotatedPositions);
85634
86119
  }
@@ -85716,7 +86201,7 @@ var WriteQueue = class extends Queue {
85716
86201
  archiveKeys.push(archiveKey);
85717
86202
  promises.push(writePromise);
85718
86203
  }
85719
- const writeResults = await Promise.all(promises);
86204
+ const writeResults = await Promise.allSettled(promises);
85720
86205
  this.updateFileMap(archiveKeys, writeResults);
85721
86206
  }
85722
86207
  this.writePromise = null;
@@ -85724,10 +86209,9 @@ var WriteQueue = class extends Queue {
85724
86209
  updateFileMap(archiveKeys, writeResults) {
85725
86210
  for (let i = 0; i < archiveKeys.length; i++) {
85726
86211
  const archiveKey = archiveKeys[i];
85727
- if (!archiveKey) {
85728
- continue;
86212
+ if (archiveKey && "value" in writeResults[i]) {
86213
+ this.fileMap[archiveKey] = writeResults[i].value;
85729
86214
  }
85730
- this.fileMap[archiveKey] = writeResults[i];
85731
86215
  }
85732
86216
  }
85733
86217
  };
@@ -86040,11 +86524,11 @@ var I3SConverter = class {
86040
86524
  await this._updateTilesetOptions();
86041
86525
  await this.sourceTileset._loadTile(sourceTile);
86042
86526
  let boundingVolumes = createBoundingVolumes(sourceTile, this.geoidHeightModel);
86043
- const batchTable = sourceTile?.content?.batchTableJson;
86044
- if (batchTable) {
86045
- this._convertAttributeStorageInfo(sourceTile.content);
86527
+ const propertyTable = getPropertyTable(sourceTile);
86528
+ if (propertyTable && !this.layers0?.attributeStorageInfo?.length) {
86529
+ this._convertPropertyTableToNodeAttributes(propertyTable);
86046
86530
  }
86047
- const resourcesData = await this._convertResources(sourceTile);
86531
+ const resourcesData = await this._convertResources(sourceTile, propertyTable);
86048
86532
  const nodes = [];
86049
86533
  const nodesInPage = [];
86050
86534
  const emptyResources = {
@@ -86088,17 +86572,11 @@ var I3SConverter = class {
86088
86572
  });
86089
86573
  return nodes;
86090
86574
  }
86091
- _convertAttributeStorageInfo(sourceTileContent) {
86092
- const batchTable = sourceTileContent && sourceTileContent.batchTableJson;
86093
- if (batchTable && !this.layers0?.attributeStorageInfo?.length) {
86094
- this._convertBatchTableInfoToNodeAttributes(batchTable);
86095
- }
86096
- }
86097
- async _convertResources(sourceTile) {
86575
+ async _convertResources(sourceTile, propertyTable) {
86098
86576
  if (!this.isContentSupported(sourceTile)) {
86099
86577
  return null;
86100
86578
  }
86101
- 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);
86102
86580
  return resourcesData;
86103
86581
  }
86104
86582
  _createNodeInNodePages(maxScreenThresholdSQ, boundingVolumes, sourceTile, parentId, resources) {
@@ -86250,7 +86728,9 @@ var I3SConverter = class {
86250
86728
  await this.writeTextureFile(textureData, "0", format, childPath, slpkChildPath);
86251
86729
  if (this.generateTextures) {
86252
86730
  formats2.push({ name: "1", format: "ktx2" });
86253
- const ktx2TextureData = encode(texture.image, KTX2BasisWriterWorker, {
86731
+ const copyArrayBuffer2 = texture.image.data.subarray();
86732
+ const arrayToEncode = new Uint8Array(copyArrayBuffer2);
86733
+ const ktx2TextureData = encode({ ...texture.image, data: arrayToEncode }, KTX2BasisWriterWorker, {
86254
86734
  ...KTX2BasisWriterWorker.options,
86255
86735
  source: this.workerSource.ktx2,
86256
86736
  reuseWorkers: true,
@@ -86275,16 +86755,16 @@ var I3SConverter = class {
86275
86755
  }
86276
86756
  }
86277
86757
  }
86278
- async writeTextureFile(textureData, name8, format, childPath, slpkChildPath) {
86758
+ async writeTextureFile(textureData, name10, format, childPath, slpkChildPath) {
86279
86759
  if (this.options.slpk) {
86280
86760
  const slpkTexturePath = (0, import_path7.join)(childPath, "textures");
86281
86761
  const compress = false;
86282
86762
  await this.writeQueue.enqueue({
86283
- archiveKey: `${slpkChildPath}/textures/${name8}.${format}`,
86284
- writePromise: writeFileForSlpk(slpkTexturePath, textureData, `${name8}.${format}`, compress)
86763
+ archiveKey: `${slpkChildPath}/textures/${name10}.${format}`,
86764
+ writePromise: writeFileForSlpk(slpkTexturePath, textureData, `${name10}.${format}`, compress)
86285
86765
  });
86286
86766
  } else {
86287
- const texturePath = (0, import_path7.join)(childPath, `textures/${name8}/`);
86767
+ const texturePath = (0, import_path7.join)(childPath, `textures/${name10}/`);
86288
86768
  await this.writeQueue.enqueue({
86289
86769
  writePromise: writeFile3(texturePath, textureData, `index.${format}`)
86290
86770
  });
@@ -86399,19 +86879,19 @@ var I3SConverter = class {
86399
86879
  alias: key
86400
86880
  };
86401
86881
  }
86402
- _convertBatchTableInfoToNodeAttributes(batchTable) {
86882
+ _convertPropertyTableToNodeAttributes(propertyTable) {
86403
86883
  let attributeIndex = 0;
86404
- const batchTableWithObjectId = {
86884
+ const propertyTableWithObjectId = {
86405
86885
  OBJECTID: [0],
86406
- ...batchTable
86886
+ ...propertyTable
86407
86887
  };
86408
- for (const key in batchTableWithObjectId) {
86409
- const firstAttribute = batchTableWithObjectId[key][0];
86888
+ for (const key in propertyTableWithObjectId) {
86889
+ const firstAttribute = propertyTableWithObjectId[key][0];
86410
86890
  const attributeType = this.getAttributeType(key, firstAttribute);
86411
86891
  const storageAttribute = this._createdStorageAttribute(attributeIndex, key, attributeType);
86412
86892
  const fieldAttributeType = this._getFieldAttributeType(attributeType);
86413
86893
  const fieldAttribute = this._createFieldAttribute(key, fieldAttributeType);
86414
- const popupInfo = this._createPopupInfo(batchTableWithObjectId);
86894
+ const popupInfo = this._createPopupInfo(propertyTableWithObjectId);
86415
86895
  this.layers0.attributeStorageInfo.push(storageAttribute);
86416
86896
  this.layers0.fields.push(fieldAttribute);
86417
86897
  this.layers0.popupInfo = popupInfo;
@@ -86433,13 +86913,13 @@ var I3SConverter = class {
86433
86913
  return "esriFieldTypeString";
86434
86914
  }
86435
86915
  }
86436
- _createPopupInfo(batchTable) {
86916
+ _createPopupInfo(propertyTable) {
86437
86917
  const title = "{OBJECTID}";
86438
86918
  const mediaInfos = [];
86439
86919
  const fieldInfos = [];
86440
86920
  const popupElements = [];
86441
86921
  const expressionInfos = [];
86442
- for (const key in batchTable) {
86922
+ for (const key in propertyTable) {
86443
86923
  fieldInfos.push({
86444
86924
  fieldName: key,
86445
86925
  visible: true,
@@ -86539,7 +87019,7 @@ var import_process3 = __toModule(require("process"));
86539
87019
  var import_json_map_transform8 = __toModule(require_json_map_transform());
86540
87020
 
86541
87021
  // ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
86542
- var import_core26 = __toModule(require_es56());
87022
+ var import_core27 = __toModule(require_es56());
86543
87023
  var import_geospatial11 = __toModule(require_es57());
86544
87024
 
86545
87025
  // ../i3s/src/types.ts
@@ -86642,7 +87122,7 @@ var COORDINATE_SYSTEM;
86642
87122
  })(COORDINATE_SYSTEM || (COORDINATE_SYSTEM = {}));
86643
87123
 
86644
87124
  // ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
86645
- var scratchVector5 = new import_core26.Vector3([0, 0, 0]);
87125
+ var scratchVector6 = new import_core27.Vector3([0, 0, 0]);
86646
87126
  function getLoaderForTextureFormat(textureFormat) {
86647
87127
  switch (textureFormat) {
86648
87128
  case "ktx-etc2":
@@ -86657,29 +87137,36 @@ function getLoaderForTextureFormat(textureFormat) {
86657
87137
  }
86658
87138
  }
86659
87139
  var I3S_ATTRIBUTE_TYPE = "i3s-attribute-type";
86660
- async function parseI3STileContent(arrayBuffer, tile, tileset, options, context) {
86661
- tile.content = tile.content || {};
86662
- tile.content.featureIds = tile.content.featureIds || null;
86663
- tile.content.attributes = {};
86664
- if (tile.textureUrl) {
86665
- const url = getUrlWithToken(tile.textureUrl, options?.i3s?.token);
86666
- const loader = getLoaderForTextureFormat(tile.textureFormat);
87140
+ async function parseI3STileContent(arrayBuffer, tileOptions, tilesetOptions, options, context) {
87141
+ const content = {
87142
+ attributes: {},
87143
+ indices: null,
87144
+ featureIds: [],
87145
+ vertexCount: 0,
87146
+ modelMatrix: new import_core27.Matrix4(),
87147
+ coordinateSystem: 0,
87148
+ byteLength: 0,
87149
+ texture: null
87150
+ };
87151
+ if (tileOptions.textureUrl) {
87152
+ const url = getUrlWithToken(tileOptions.textureUrl, options?.i3s?.token);
87153
+ const loader = getLoaderForTextureFormat(tileOptions.textureFormat);
86667
87154
  const response = await fetch(url, options?.fetch);
86668
87155
  const arrayBuffer2 = await response.arrayBuffer();
86669
87156
  if (options?.i3s.decodeTextures) {
86670
87157
  if (loader === ImageLoader) {
86671
- const options2 = { ...tile.textureLoaderOptions, image: { type: "data" } };
87158
+ const options2 = { ...tileOptions.textureLoaderOptions, image: { type: "data" } };
86672
87159
  try {
86673
- tile.content.texture = await context.parse(arrayBuffer2, options2);
87160
+ content.texture = await context.parse(arrayBuffer2, options2);
86674
87161
  } catch (e) {
86675
- tile.content.texture = await parse(arrayBuffer2, loader, options2);
87162
+ content.texture = await parse(arrayBuffer2, loader, options2);
86676
87163
  }
86677
87164
  } else if (loader === CompressedTextureLoader || loader === BasisLoader) {
86678
- let texture = await load(arrayBuffer2, loader, tile.textureLoaderOptions);
87165
+ let texture = await load(arrayBuffer2, loader, tileOptions.textureLoaderOptions);
86679
87166
  if (loader === BasisLoader) {
86680
87167
  texture = texture[0];
86681
87168
  }
86682
- tile.content.texture = {
87169
+ content.texture = {
86683
87170
  compressed: true,
86684
87171
  mipmaps: false,
86685
87172
  width: texture[0].width,
@@ -86688,27 +87175,23 @@ async function parseI3STileContent(arrayBuffer, tile, tileset, options, context)
86688
87175
  };
86689
87176
  }
86690
87177
  } else {
86691
- tile.content.texture = arrayBuffer2;
87178
+ content.texture = arrayBuffer2;
86692
87179
  }
86693
87180
  }
86694
- tile.content.material = makePbrMaterial(tile.materialDefinition, tile.content.texture);
86695
- if (tile.content.material) {
86696
- tile.content.texture = null;
87181
+ content.material = makePbrMaterial(tileOptions.materialDefinition, content.texture);
87182
+ if (content.material) {
87183
+ content.texture = null;
86697
87184
  }
86698
- return await parseI3SNodeGeometry(arrayBuffer, tile, tileset, options);
87185
+ return await parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options);
86699
87186
  }
86700
- async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
86701
- if (!tile.content) {
86702
- return tile;
86703
- }
86704
- const content = tile.content;
87187
+ async function parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options) {
86705
87188
  const contentByteLength = arrayBuffer.byteLength;
86706
87189
  let attributes;
86707
87190
  let vertexCount;
86708
87191
  let byteOffset = 0;
86709
87192
  let featureCount = 0;
86710
87193
  let indices;
86711
- if (tile.isDracoGeometry) {
87194
+ if (tileOptions.isDracoGeometry) {
86712
87195
  const decompressedGeometry = await parse(arrayBuffer, DracoLoader2, {
86713
87196
  draco: {
86714
87197
  attributeNameEntry: I3S_ATTRIBUTE_TYPE
@@ -86743,8 +87226,8 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
86743
87226
  ordering: attributesOrder,
86744
87227
  featureAttributes,
86745
87228
  featureAttributeOrder
86746
- } = tileset.store.defaultGeometrySchema;
86747
- const headers = parseHeaders(tileset, arrayBuffer);
87229
+ } = tilesetOptions.store.defaultGeometrySchema;
87230
+ const headers = parseHeaders(arrayBuffer, tilesetOptions);
86748
87231
  byteOffset = headers.byteOffset;
86749
87232
  vertexCount = headers.vertexCount;
86750
87233
  featureCount = headers.featureCount;
@@ -86754,7 +87237,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
86754
87237
  attributes = concatAttributes(normalizedVertexAttributes, normalizedFeatureAttributes);
86755
87238
  }
86756
87239
  if (!options?.i3s?.coordinateSystem || options.i3s.coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS) {
86757
- const enuMatrix = parsePositions2(attributes.position, tile);
87240
+ const enuMatrix = parsePositions2(attributes.position, tileOptions);
86758
87241
  content.modelMatrix = enuMatrix.invert();
86759
87242
  content.coordinateSystem = COORDINATE_SYSTEM.METER_OFFSETS;
86760
87243
  } else {
@@ -86770,7 +87253,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
86770
87253
  };
86771
87254
  content.indices = indices || null;
86772
87255
  if (attributes.id && attributes.id.value) {
86773
- tile.content.featureIds = attributes.id.value;
87256
+ content.featureIds = attributes.id.value;
86774
87257
  }
86775
87258
  for (const attributeIndex in content.attributes) {
86776
87259
  if (!content.attributes[attributeIndex]) {
@@ -86779,7 +87262,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
86779
87262
  }
86780
87263
  content.vertexCount = vertexCount;
86781
87264
  content.byteLength = contentByteLength;
86782
- return tile;
87265
+ return content;
86783
87266
  }
86784
87267
  function updateAttributesMetadata(attributes, decompressedGeometry) {
86785
87268
  for (const key in decompressedGeometry.loaderData.attributes) {
@@ -86806,11 +87289,11 @@ function normalizeAttribute(attribute) {
86806
87289
  attribute.normalized = true;
86807
87290
  return attribute;
86808
87291
  }
86809
- function parseHeaders(tileset, arrayBuffer) {
87292
+ function parseHeaders(arrayBuffer, options) {
86810
87293
  let byteOffset = 0;
86811
87294
  let vertexCount = 0;
86812
87295
  let featureCount = 0;
86813
- for (const { property, type } of tileset.store.defaultGeometrySchema.header) {
87296
+ for (const { property, type } of options.store.defaultGeometrySchema.header) {
86814
87297
  const TypedArrayTypeHeader = getConstructorForDataFormat(type);
86815
87298
  switch (property) {
86816
87299
  case HeaderAttributeProperty.vertexCount:
@@ -86880,13 +87363,13 @@ function parseUint64Values(buffer, elementsCount, attributeSize) {
86880
87363
  }
86881
87364
  return new Uint32Array(values);
86882
87365
  }
86883
- function parsePositions2(attribute, tile) {
86884
- const mbs = tile.mbs;
87366
+ function parsePositions2(attribute, options) {
87367
+ const mbs = options.mbs;
86885
87368
  const value = attribute.value;
86886
87369
  const metadata = attribute.metadata;
86887
- const enuMatrix = new import_core26.Matrix4();
86888
- const cartographicOrigin = new import_core26.Vector3(mbs[0], mbs[1], mbs[2]);
86889
- const cartesianOrigin = new import_core26.Vector3();
87370
+ const enuMatrix = new import_core27.Matrix4();
87371
+ const cartographicOrigin = new import_core27.Vector3(mbs[0], mbs[1], mbs[2]);
87372
+ const cartesianOrigin = new import_core27.Vector3();
86890
87373
  import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(cartographicOrigin, cartesianOrigin);
86891
87374
  import_geospatial11.Ellipsoid.WGS84.eastNorthUpToFixedFrame(cartesianOrigin, enuMatrix);
86892
87375
  attribute.value = offsetsToCartesians(value, metadata, cartographicOrigin);
@@ -86902,10 +87385,10 @@ function offsetsToCartesians(vertices, metadata = {}, cartographicOrigin) {
86902
87385
  positions[i + 2] = vertices[i + 2] + cartographicOrigin.z;
86903
87386
  }
86904
87387
  for (let i = 0; i < positions.length; i += 3) {
86905
- import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(i, i + 3), scratchVector5);
86906
- positions[i] = scratchVector5.x;
86907
- positions[i + 1] = scratchVector5.y;
86908
- positions[i + 2] = scratchVector5.z;
87388
+ import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(i, i + 3), scratchVector6);
87389
+ positions[i] = scratchVector6.x;
87390
+ positions[i + 1] = scratchVector6.y;
87391
+ positions[i + 2] = scratchVector6.z;
86909
87392
  }
86910
87393
  return positions;
86911
87394
  }
@@ -86913,7 +87396,7 @@ function getModelMatrix(positions) {
86913
87396
  const metadata = positions.metadata;
86914
87397
  const scaleX = metadata?.["i3s-scale_x"]?.double || 1;
86915
87398
  const scaleY = metadata?.["i3s-scale_y"]?.double || 1;
86916
- const modelMatrix = new import_core26.Matrix4();
87399
+ const modelMatrix = new import_core27.Matrix4();
86917
87400
  modelMatrix[0] = scaleX;
86918
87401
  modelMatrix[5] = scaleY;
86919
87402
  return modelMatrix;
@@ -87013,10 +87496,10 @@ function getFeatureIdsFromFeatureIndexMetadata(featureIndex) {
87013
87496
  }
87014
87497
 
87015
87498
  // ../i3s/src/i3s-content-loader.ts
87016
- var VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
87499
+ var VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
87017
87500
  var I3SContentLoader = {
87018
87501
  name: "I3S Content (Indexed Scene Layers)",
87019
- id: "i3s-content",
87502
+ id: isBrowser2 ? "i3s-content" : "i3s-content-nodejs",
87020
87503
  module: "i3s",
87021
87504
  worker: true,
87022
87505
  version: VERSION12,
@@ -87028,9 +87511,13 @@ var I3SContentLoader = {
87028
87511
  }
87029
87512
  };
87030
87513
  async function parse6(data, options, context) {
87031
- const { tile, tileset } = options?.i3s || {};
87032
- await parseI3STileContent(data, tile, tileset, options, context);
87033
- return tile.content;
87514
+ const { tile, _tileOptions, tileset, _tilesetOptions } = options?.i3s || {};
87515
+ const tileOptions = _tileOptions || tile;
87516
+ const tilesetOptions = _tilesetOptions || tileset;
87517
+ if (!tileOptions || !tilesetOptions) {
87518
+ return null;
87519
+ }
87520
+ return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
87034
87521
  }
87035
87522
 
87036
87523
  // ../i3s/src/lib/parsers/parse-i3s.ts
@@ -87228,7 +87715,7 @@ var I3SNodePagesTiles = class {
87228
87715
  };
87229
87716
 
87230
87717
  // ../i3s/src/lib/parsers/parse-i3s.ts
87231
- function normalizeTileData2(tile, options, context) {
87718
+ function normalizeTileData2(tile, context) {
87232
87719
  const url = context.url || "";
87233
87720
  let contentUrl;
87234
87721
  if (tile.geometryData) {
@@ -87316,12 +87803,13 @@ var I3SLoader = {
87316
87803
  extensions: ["bin"],
87317
87804
  options: {
87318
87805
  i3s: {
87319
- loadContent: true,
87320
87806
  token: null,
87321
87807
  isTileset: "auto",
87322
87808
  isTileHeader: "auto",
87323
87809
  tile: null,
87324
87810
  tileset: null,
87811
+ _tileOptions: null,
87812
+ _tilesetOptions: null,
87325
87813
  useDracoGeometry: true,
87326
87814
  useCompressedTextures: true,
87327
87815
  decodeTextures: true,
@@ -87329,7 +87817,7 @@ var I3SLoader = {
87329
87817
  }
87330
87818
  }
87331
87819
  };
87332
- async function parseI3S(data, options, context) {
87820
+ async function parseI3S(data, options = {}, context) {
87333
87821
  const url = context.url;
87334
87822
  options.i3s = options.i3s || {};
87335
87823
  const magicNumber = getMagicNumber(data);
@@ -87351,11 +87839,7 @@ async function parseI3S(data, options, context) {
87351
87839
  if (isTileset) {
87352
87840
  data = await parseTileset2(data, options, context);
87353
87841
  } else if (isTileHeader) {
87354
- data = await parseTile2(data, options, context);
87355
- if (options.i3s.loadContent) {
87356
- options.i3s.tile = data;
87357
- await load(data.contentUrl, I3SLoader, options);
87358
- }
87842
+ data = await parseTile2(data, context);
87359
87843
  } else {
87360
87844
  data = await parseTileContent(data, options);
87361
87845
  }
@@ -87370,9 +87854,9 @@ async function parseTileset2(data, options, context) {
87370
87854
  await normalizeTilesetData(tilesetJson, options, context);
87371
87855
  return tilesetJson;
87372
87856
  }
87373
- async function parseTile2(data, options, context) {
87857
+ async function parseTile2(data, context) {
87374
87858
  data = JSON.parse(new TextDecoder().decode(data));
87375
- return normalizeTileData2(data, options, context);
87859
+ return normalizeTileData2(data, context);
87376
87860
  }
87377
87861
  function getMagicNumber(data) {
87378
87862
  if (data instanceof ArrayBuffer) {
@@ -87457,7 +87941,7 @@ async function parse8(data, options) {
87457
87941
  }
87458
87942
 
87459
87943
  // src/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.ts
87460
- var import_core30 = __toModule(require_es56());
87944
+ var import_core31 = __toModule(require_es56());
87461
87945
  var import_geospatial13 = __toModule(require_es57());
87462
87946
  var import_culling8 = __toModule(require_es58());
87463
87947
  function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
@@ -87466,7 +87950,7 @@ function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
87466
87950
  i3SObb.center[1],
87467
87951
  i3SObb.center[2] + geoidHeightModel.getHeight(i3SObb.center[1], i3SObb.center[0])
87468
87952
  ];
87469
- const cartesianCenter = import_geospatial13.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new import_core30.Vector3());
87953
+ const cartesianCenter = import_geospatial13.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new import_core31.Vector3());
87470
87954
  const tiles3DObb = new import_culling8.OrientedBoundingBox().fromCenterHalfSizeQuaternion(cartesianCenter, i3SObb.halfSize, i3SObb.quaternion);
87471
87955
  return [...tiles3DObb.center, ...tiles3DObb.halfAxes.toArray()];
87472
87956
  }
@@ -87510,7 +87994,7 @@ var TILESET = () => ({
87510
87994
  });
87511
87995
 
87512
87996
  // src/3d-tiles-converter/helpers/b3dm-converter.ts
87513
- var import_core32 = __toModule(require_es56());
87997
+ var import_core33 = __toModule(require_es56());
87514
87998
  var import_geospatial14 = __toModule(require_es57());
87515
87999
 
87516
88000
  // src/3d-tiles-converter/helpers/texture-atlas.ts
@@ -87545,8 +88029,8 @@ function normalizeRegions(regions) {
87545
88029
  }
87546
88030
 
87547
88031
  // src/3d-tiles-converter/helpers/b3dm-converter.ts
87548
- var Z_UP_TO_Y_UP_MATRIX = new import_core32.Matrix4([1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
87549
- var scratchVector6 = new import_core32.Vector3();
88032
+ var Z_UP_TO_Y_UP_MATRIX = new import_core33.Matrix4([1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
88033
+ var scratchVector7 = new import_core33.Vector3();
87550
88034
  var B3dmConverter = class {
87551
88035
  async convert(i3sAttributesData, featureAttributes = null) {
87552
88036
  const gltf = await this.buildGltf(i3sAttributesData);
@@ -87615,16 +88099,16 @@ var B3dmConverter = class {
87615
88099
  const newPositionsValue = new Float32Array(positionsValue.length);
87616
88100
  for (let index = 0; index < positionsValue.length; index += 3) {
87617
88101
  const vertex = positionsValue.subarray(index, index + 3);
87618
- const cartesianOriginVector = new import_core32.Vector3(cartesianOrigin);
87619
- let vertexVector = new import_core32.Vector3(Array.from(vertex)).transform(modelMatrix).add(cartographicOrigin);
87620
- import_geospatial14.Ellipsoid.WGS84.cartographicToCartesian(vertexVector, scratchVector6);
87621
- vertexVector = scratchVector6.subtract(cartesianOriginVector);
88102
+ const cartesianOriginVector = new import_core33.Vector3(cartesianOrigin);
88103
+ let vertexVector = new import_core33.Vector3(Array.from(vertex)).transform(modelMatrix).add(cartographicOrigin);
88104
+ import_geospatial14.Ellipsoid.WGS84.cartographicToCartesian(vertexVector, scratchVector7);
88105
+ vertexVector = scratchVector7.subtract(cartesianOriginVector);
87622
88106
  newPositionsValue.set(vertexVector, index);
87623
88107
  }
87624
88108
  return newPositionsValue;
87625
88109
  }
87626
88110
  _generateTransformMatrix(cartesianOrigin) {
87627
- const translateOriginMatrix = new import_core32.Matrix4().translate(cartesianOrigin);
88111
+ const translateOriginMatrix = new import_core33.Matrix4().translate(cartesianOrigin);
87628
88112
  const result = translateOriginMatrix.multiplyLeft(Z_UP_TO_Y_UP_MATRIX);
87629
88113
  return result;
87630
88114
  }