@loaders.gl/tiles 3.4.0-alpha.1 → 3.4.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 (88) hide show
  1. package/dist/dist.min.js +723 -259
  2. package/dist/es5/constants.js +0 -2
  3. package/dist/es5/constants.js.map +1 -1
  4. package/dist/es5/index.js.map +1 -1
  5. package/dist/es5/tileset/format-3d-tiles/tileset-3d-traverser.js +0 -2
  6. package/dist/es5/tileset/format-3d-tiles/tileset-3d-traverser.js.map +1 -1
  7. package/dist/es5/tileset/format-i3s/i3s-pending-tiles-register.js +3 -8
  8. package/dist/es5/tileset/format-i3s/i3s-pending-tiles-register.js.map +1 -1
  9. package/dist/es5/tileset/format-i3s/i3s-tile-manager.js +4 -14
  10. package/dist/es5/tileset/format-i3s/i3s-tile-manager.js.map +1 -1
  11. package/dist/es5/tileset/format-i3s/i3s-tileset-traverser.js +19 -25
  12. package/dist/es5/tileset/format-i3s/i3s-tileset-traverser.js.map +1 -1
  13. package/dist/es5/tileset/helpers/3d-tiles-options.js.map +1 -1
  14. package/dist/es5/tileset/helpers/bounding-volume.js +87 -6
  15. package/dist/es5/tileset/helpers/bounding-volume.js.map +1 -1
  16. package/dist/es5/tileset/helpers/frame-state.js +4 -14
  17. package/dist/es5/tileset/helpers/frame-state.js.map +1 -1
  18. package/dist/es5/tileset/helpers/i3s-lod.js +0 -5
  19. package/dist/es5/tileset/helpers/i3s-lod.js.map +1 -1
  20. package/dist/es5/tileset/helpers/tiles-3d-lod.js +0 -7
  21. package/dist/es5/tileset/helpers/tiles-3d-lod.js.map +1 -1
  22. package/dist/es5/tileset/helpers/transform-utils.js +0 -7
  23. package/dist/es5/tileset/helpers/transform-utils.js.map +1 -1
  24. package/dist/es5/tileset/helpers/zoom.js +0 -4
  25. package/dist/es5/tileset/helpers/zoom.js.map +1 -1
  26. package/dist/es5/tileset/tile-3d.js +98 -166
  27. package/dist/es5/tileset/tile-3d.js.map +1 -1
  28. package/dist/es5/tileset/tileset-3d.js +86 -142
  29. package/dist/es5/tileset/tileset-3d.js.map +1 -1
  30. package/dist/es5/tileset/tileset-cache.js +0 -3
  31. package/dist/es5/tileset/tileset-cache.js.map +1 -1
  32. package/dist/es5/tileset/tileset-traverser.js +12 -51
  33. package/dist/es5/tileset/tileset-traverser.js.map +1 -1
  34. package/dist/es5/utils/doubly-linked-list-node.js.map +1 -1
  35. package/dist/es5/utils/doubly-linked-list.js +3 -11
  36. package/dist/es5/utils/doubly-linked-list.js.map +1 -1
  37. package/dist/es5/utils/managed-array.js +10 -30
  38. package/dist/es5/utils/managed-array.js.map +1 -1
  39. package/dist/esm/bundle.js +0 -1
  40. package/dist/esm/bundle.js.map +1 -1
  41. package/dist/esm/constants.js +0 -5
  42. package/dist/esm/constants.js.map +1 -1
  43. package/dist/esm/index.js +0 -2
  44. package/dist/esm/index.js.map +1 -1
  45. package/dist/esm/tileset/format-3d-tiles/tileset-3d-traverser.js +0 -4
  46. package/dist/esm/tileset/format-3d-tiles/tileset-3d-traverser.js.map +1 -1
  47. package/dist/esm/tileset/format-i3s/i3s-pending-tiles-register.js +0 -2
  48. package/dist/esm/tileset/format-i3s/i3s-pending-tiles-register.js.map +1 -1
  49. package/dist/esm/tileset/format-i3s/i3s-tile-manager.js +0 -6
  50. package/dist/esm/tileset/format-i3s/i3s-tile-manager.js.map +1 -1
  51. package/dist/esm/tileset/format-i3s/i3s-tileset-traverser.js +0 -3
  52. package/dist/esm/tileset/format-i3s/i3s-tileset-traverser.js.map +1 -1
  53. package/dist/esm/tileset/helpers/3d-tiles-options.js.map +1 -1
  54. package/dist/esm/tileset/helpers/bounding-volume.js +81 -8
  55. package/dist/esm/tileset/helpers/bounding-volume.js.map +1 -1
  56. package/dist/esm/tileset/helpers/frame-state.js +3 -13
  57. package/dist/esm/tileset/helpers/frame-state.js.map +1 -1
  58. package/dist/esm/tileset/helpers/i3s-lod.js +0 -6
  59. package/dist/esm/tileset/helpers/i3s-lod.js.map +1 -1
  60. package/dist/esm/tileset/helpers/tiles-3d-lod.js +0 -8
  61. package/dist/esm/tileset/helpers/tiles-3d-lod.js.map +1 -1
  62. package/dist/esm/tileset/helpers/transform-utils.js +0 -8
  63. package/dist/esm/tileset/helpers/transform-utils.js.map +1 -1
  64. package/dist/esm/tileset/helpers/zoom.js +0 -5
  65. package/dist/esm/tileset/helpers/zoom.js.map +1 -1
  66. package/dist/esm/tileset/tile-3d.js +8 -52
  67. package/dist/esm/tileset/tile-3d.js.map +1 -1
  68. package/dist/esm/tileset/tileset-3d.js +0 -38
  69. package/dist/esm/tileset/tileset-3d.js.map +1 -1
  70. package/dist/esm/tileset/tileset-cache.js +0 -3
  71. package/dist/esm/tileset/tileset-cache.js.map +1 -1
  72. package/dist/esm/tileset/tileset-traverser.js +0 -27
  73. package/dist/esm/tileset/tileset-traverser.js.map +1 -1
  74. package/dist/esm/utils/doubly-linked-list-node.js +0 -1
  75. package/dist/esm/utils/doubly-linked-list-node.js.map +1 -1
  76. package/dist/esm/utils/doubly-linked-list.js +0 -7
  77. package/dist/esm/utils/doubly-linked-list.js.map +1 -1
  78. package/dist/esm/utils/managed-array.js +0 -12
  79. package/dist/esm/utils/managed-array.js.map +1 -1
  80. package/dist/tileset/helpers/bounding-volume.d.ts +10 -0
  81. package/dist/tileset/helpers/bounding-volume.d.ts.map +1 -1
  82. package/dist/tileset/helpers/bounding-volume.js +117 -1
  83. package/dist/tileset/tile-3d.d.ts +7 -0
  84. package/dist/tileset/tile-3d.d.ts.map +1 -1
  85. package/dist/tileset/tile-3d.js +10 -0
  86. package/package.json +5 -5
  87. package/src/tileset/helpers/bounding-volume.ts +136 -0
  88. package/src/tileset/tile-3d.ts +18 -1
package/dist/dist.min.js CHANGED
@@ -2883,8 +2883,54 @@
2883
2883
  }
2884
2884
  });
2885
2885
 
2886
+ // ../../node_modules/@babel/runtime/helpers/esm/typeof.js
2887
+ function _typeof(obj) {
2888
+ "@babel/helpers - typeof";
2889
+ return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
2890
+ return typeof obj2;
2891
+ } : function(obj2) {
2892
+ return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
2893
+ }, _typeof(obj);
2894
+ }
2895
+ var init_typeof = __esm({
2896
+ "../../node_modules/@babel/runtime/helpers/esm/typeof.js"() {
2897
+ }
2898
+ });
2899
+
2900
+ // ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
2901
+ function _toPrimitive(input, hint) {
2902
+ if (_typeof(input) !== "object" || input === null)
2903
+ return input;
2904
+ var prim = input[Symbol.toPrimitive];
2905
+ if (prim !== void 0) {
2906
+ var res = prim.call(input, hint || "default");
2907
+ if (_typeof(res) !== "object")
2908
+ return res;
2909
+ throw new TypeError("@@toPrimitive must return a primitive value.");
2910
+ }
2911
+ return (hint === "string" ? String : Number)(input);
2912
+ }
2913
+ var init_toPrimitive = __esm({
2914
+ "../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"() {
2915
+ init_typeof();
2916
+ }
2917
+ });
2918
+
2919
+ // ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
2920
+ function _toPropertyKey(arg) {
2921
+ var key = _toPrimitive(arg, "string");
2922
+ return _typeof(key) === "symbol" ? key : String(key);
2923
+ }
2924
+ var init_toPropertyKey = __esm({
2925
+ "../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"() {
2926
+ init_typeof();
2927
+ init_toPrimitive();
2928
+ }
2929
+ });
2930
+
2886
2931
  // ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
2887
2932
  function _defineProperty(obj, key, value) {
2933
+ key = _toPropertyKey(key);
2888
2934
  if (key in obj) {
2889
2935
  Object.defineProperty(obj, key, {
2890
2936
  value,
@@ -2899,6 +2945,7 @@
2899
2945
  }
2900
2946
  var init_defineProperty = __esm({
2901
2947
  "../../node_modules/@babel/runtime/helpers/esm/defineProperty.js"() {
2948
+ init_toPropertyKey();
2902
2949
  }
2903
2950
  });
2904
2951
 
@@ -3347,7 +3394,7 @@
3347
3394
  }
3348
3395
  });
3349
3396
 
3350
- // ../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
3397
+ // node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js
3351
3398
  function getHiResTimestamp() {
3352
3399
  let timestamp;
3353
3400
  if (typeof window !== "undefined" && window.performance) {
@@ -3361,14 +3408,14 @@
3361
3408
  return timestamp;
3362
3409
  }
3363
3410
  var init_hi_res_timestamp = __esm({
3364
- "../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
3411
+ "node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js"() {
3365
3412
  }
3366
3413
  });
3367
3414
 
3368
- // ../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js
3415
+ // node_modules/@probe.gl/stats/dist/lib/stat.js
3369
3416
  var Stat;
3370
3417
  var init_stat = __esm({
3371
- "../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
3418
+ "node_modules/@probe.gl/stats/dist/lib/stat.js"() {
3372
3419
  init_defineProperty();
3373
3420
  init_hi_res_timestamp();
3374
3421
  Stat = class {
@@ -3376,12 +3423,12 @@
3376
3423
  _defineProperty(this, "name", void 0);
3377
3424
  _defineProperty(this, "type", void 0);
3378
3425
  _defineProperty(this, "sampleSize", 1);
3379
- _defineProperty(this, "time", void 0);
3380
- _defineProperty(this, "count", void 0);
3381
- _defineProperty(this, "samples", void 0);
3382
- _defineProperty(this, "lastTiming", void 0);
3383
- _defineProperty(this, "lastSampleTime", void 0);
3384
- _defineProperty(this, "lastSampleCount", void 0);
3426
+ _defineProperty(this, "time", 0);
3427
+ _defineProperty(this, "count", 0);
3428
+ _defineProperty(this, "samples", 0);
3429
+ _defineProperty(this, "lastTiming", 0);
3430
+ _defineProperty(this, "lastSampleTime", 0);
3431
+ _defineProperty(this, "lastSampleCount", 0);
3385
3432
  _defineProperty(this, "_count", 0);
3386
3433
  _defineProperty(this, "_time", 0);
3387
3434
  _defineProperty(this, "_samples", 0);
@@ -3391,6 +3438,20 @@
3391
3438
  this.type = type;
3392
3439
  this.reset();
3393
3440
  }
3441
+ reset() {
3442
+ this.time = 0;
3443
+ this.count = 0;
3444
+ this.samples = 0;
3445
+ this.lastTiming = 0;
3446
+ this.lastSampleTime = 0;
3447
+ this.lastSampleCount = 0;
3448
+ this._count = 0;
3449
+ this._time = 0;
3450
+ this._samples = 0;
3451
+ this._startTime = 0;
3452
+ this._timerPending = false;
3453
+ return this;
3454
+ }
3394
3455
  setSampleSize(samples) {
3395
3456
  this.sampleSize = samples;
3396
3457
  return this;
@@ -3454,20 +3515,6 @@
3454
3515
  getHz() {
3455
3516
  return this.time > 0 ? this.samples / (this.time / 1e3) : 0;
3456
3517
  }
3457
- reset() {
3458
- this.time = 0;
3459
- this.count = 0;
3460
- this.samples = 0;
3461
- this.lastTiming = 0;
3462
- this.lastSampleTime = 0;
3463
- this.lastSampleCount = 0;
3464
- this._count = 0;
3465
- this._time = 0;
3466
- this._samples = 0;
3467
- this._startTime = 0;
3468
- this._timerPending = false;
3469
- return this;
3470
- }
3471
3518
  _checkSampling() {
3472
3519
  if (this._samples === this.sampleSize) {
3473
3520
  this.lastSampleTime = this._time;
@@ -3484,10 +3531,10 @@
3484
3531
  }
3485
3532
  });
3486
3533
 
3487
- // ../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js
3534
+ // node_modules/@probe.gl/stats/dist/lib/stats.js
3488
3535
  var Stats;
3489
3536
  var init_stats = __esm({
3490
- "../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
3537
+ "node_modules/@probe.gl/stats/dist/lib/stats.js"() {
3491
3538
  init_defineProperty();
3492
3539
  init_stat();
3493
3540
  Stats = class {
@@ -3510,14 +3557,14 @@
3510
3557
  return Object.keys(this.stats).length;
3511
3558
  }
3512
3559
  reset() {
3513
- for (const key in this.stats) {
3514
- this.stats[key].reset();
3560
+ for (const stat of Object.values(this.stats)) {
3561
+ stat.reset();
3515
3562
  }
3516
3563
  return this;
3517
3564
  }
3518
3565
  forEach(fn) {
3519
- for (const key in this.stats) {
3520
- fn(this.stats[key]);
3566
+ for (const stat of Object.values(this.stats)) {
3567
+ fn(stat);
3521
3568
  }
3522
3569
  }
3523
3570
  getTable() {
@@ -3551,15 +3598,15 @@
3551
3598
  this.stats[name] = new Stat(name, type);
3552
3599
  }
3553
3600
  }
3554
- return this.stats[name];
3601
+ return this.stats[name] || null;
3555
3602
  }
3556
3603
  };
3557
3604
  }
3558
3605
  });
3559
3606
 
3560
- // ../../node_modules/@probe.gl/stats/dist/esm/index.js
3561
- var init_esm3 = __esm({
3562
- "../../node_modules/@probe.gl/stats/dist/esm/index.js"() {
3607
+ // node_modules/@probe.gl/stats/dist/index.js
3608
+ var init_dist = __esm({
3609
+ "node_modules/@probe.gl/stats/dist/index.js"() {
3563
3610
  init_stats();
3564
3611
  init_stat();
3565
3612
  init_hi_res_timestamp();
@@ -3655,8 +3702,8 @@
3655
3702
  };
3656
3703
  this.name = jobName;
3657
3704
  this.workerThread = workerThread;
3658
- this.result = new Promise((resolve, reject) => {
3659
- this._resolve = resolve;
3705
+ this.result = new Promise((resolve2, reject) => {
3706
+ this._resolve = resolve2;
3660
3707
  this._reject = reject;
3661
3708
  });
3662
3709
  }
@@ -4160,46 +4207,7 @@
4160
4207
  }
4161
4208
  });
4162
4209
 
4163
- // ../loader-utils/src/lib/binary-utils/buffer-utils.ts
4164
- function isBuffer(value) {
4165
- return value && typeof value === "object" && value.isBuffer;
4166
- }
4167
- function bufferToArrayBuffer(buffer) {
4168
- if (isBuffer(buffer)) {
4169
- const typedArray = new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.length);
4170
- return typedArray.slice().buffer;
4171
- }
4172
- return buffer;
4173
- }
4174
- var init_buffer_utils = __esm({
4175
- "../loader-utils/src/lib/binary-utils/buffer-utils.ts"() {
4176
- }
4177
- });
4178
-
4179
4210
  // ../loader-utils/src/lib/binary-utils/array-buffer-utils.ts
4180
- function toArrayBuffer(data) {
4181
- if (isBuffer(data)) {
4182
- return bufferToArrayBuffer(data);
4183
- }
4184
- if (data instanceof ArrayBuffer) {
4185
- return data;
4186
- }
4187
- if (ArrayBuffer.isView(data)) {
4188
- if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
4189
- return data.buffer;
4190
- }
4191
- return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
4192
- }
4193
- if (typeof data === "string") {
4194
- const text = data;
4195
- const uint8Array = new TextEncoder().encode(text);
4196
- return uint8Array.buffer;
4197
- }
4198
- if (data && typeof data === "object" && data._toArrayBuffer) {
4199
- return data._toArrayBuffer();
4200
- }
4201
- throw new Error("toArrayBuffer");
4202
- }
4203
4211
  function compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) {
4204
4212
  byteLength = byteLength || arrayBuffer1.byteLength;
4205
4213
  if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) {
@@ -4227,7 +4235,6 @@
4227
4235
  }
4228
4236
  var init_array_buffer_utils = __esm({
4229
4237
  "../loader-utils/src/lib/binary-utils/array-buffer-utils.ts"() {
4230
- init_buffer_utils();
4231
4238
  }
4232
4239
  });
4233
4240
 
@@ -4245,11 +4252,230 @@
4245
4252
  }
4246
4253
  });
4247
4254
 
4255
+ // ../loader-utils/node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js
4256
+ function getHiResTimestamp2() {
4257
+ let timestamp;
4258
+ if (typeof window !== "undefined" && window.performance) {
4259
+ timestamp = window.performance.now();
4260
+ } else if (typeof process !== "undefined" && process.hrtime) {
4261
+ const timeParts = process.hrtime();
4262
+ timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
4263
+ } else {
4264
+ timestamp = Date.now();
4265
+ }
4266
+ return timestamp;
4267
+ }
4268
+ var init_hi_res_timestamp2 = __esm({
4269
+ "../loader-utils/node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js"() {
4270
+ }
4271
+ });
4272
+
4273
+ // ../loader-utils/node_modules/@probe.gl/stats/dist/lib/stat.js
4274
+ var Stat2;
4275
+ var init_stat2 = __esm({
4276
+ "../loader-utils/node_modules/@probe.gl/stats/dist/lib/stat.js"() {
4277
+ init_defineProperty();
4278
+ init_hi_res_timestamp2();
4279
+ Stat2 = class {
4280
+ constructor(name, type) {
4281
+ _defineProperty(this, "name", void 0);
4282
+ _defineProperty(this, "type", void 0);
4283
+ _defineProperty(this, "sampleSize", 1);
4284
+ _defineProperty(this, "time", 0);
4285
+ _defineProperty(this, "count", 0);
4286
+ _defineProperty(this, "samples", 0);
4287
+ _defineProperty(this, "lastTiming", 0);
4288
+ _defineProperty(this, "lastSampleTime", 0);
4289
+ _defineProperty(this, "lastSampleCount", 0);
4290
+ _defineProperty(this, "_count", 0);
4291
+ _defineProperty(this, "_time", 0);
4292
+ _defineProperty(this, "_samples", 0);
4293
+ _defineProperty(this, "_startTime", 0);
4294
+ _defineProperty(this, "_timerPending", false);
4295
+ this.name = name;
4296
+ this.type = type;
4297
+ this.reset();
4298
+ }
4299
+ reset() {
4300
+ this.time = 0;
4301
+ this.count = 0;
4302
+ this.samples = 0;
4303
+ this.lastTiming = 0;
4304
+ this.lastSampleTime = 0;
4305
+ this.lastSampleCount = 0;
4306
+ this._count = 0;
4307
+ this._time = 0;
4308
+ this._samples = 0;
4309
+ this._startTime = 0;
4310
+ this._timerPending = false;
4311
+ return this;
4312
+ }
4313
+ setSampleSize(samples) {
4314
+ this.sampleSize = samples;
4315
+ return this;
4316
+ }
4317
+ incrementCount() {
4318
+ this.addCount(1);
4319
+ return this;
4320
+ }
4321
+ decrementCount() {
4322
+ this.subtractCount(1);
4323
+ return this;
4324
+ }
4325
+ addCount(value) {
4326
+ this._count += value;
4327
+ this._samples++;
4328
+ this._checkSampling();
4329
+ return this;
4330
+ }
4331
+ subtractCount(value) {
4332
+ this._count -= value;
4333
+ this._samples++;
4334
+ this._checkSampling();
4335
+ return this;
4336
+ }
4337
+ addTime(time) {
4338
+ this._time += time;
4339
+ this.lastTiming = time;
4340
+ this._samples++;
4341
+ this._checkSampling();
4342
+ return this;
4343
+ }
4344
+ timeStart() {
4345
+ this._startTime = getHiResTimestamp2();
4346
+ this._timerPending = true;
4347
+ return this;
4348
+ }
4349
+ timeEnd() {
4350
+ if (!this._timerPending) {
4351
+ return this;
4352
+ }
4353
+ this.addTime(getHiResTimestamp2() - this._startTime);
4354
+ this._timerPending = false;
4355
+ this._checkSampling();
4356
+ return this;
4357
+ }
4358
+ getSampleAverageCount() {
4359
+ return this.sampleSize > 0 ? this.lastSampleCount / this.sampleSize : 0;
4360
+ }
4361
+ getSampleAverageTime() {
4362
+ return this.sampleSize > 0 ? this.lastSampleTime / this.sampleSize : 0;
4363
+ }
4364
+ getSampleHz() {
4365
+ return this.lastSampleTime > 0 ? this.sampleSize / (this.lastSampleTime / 1e3) : 0;
4366
+ }
4367
+ getAverageCount() {
4368
+ return this.samples > 0 ? this.count / this.samples : 0;
4369
+ }
4370
+ getAverageTime() {
4371
+ return this.samples > 0 ? this.time / this.samples : 0;
4372
+ }
4373
+ getHz() {
4374
+ return this.time > 0 ? this.samples / (this.time / 1e3) : 0;
4375
+ }
4376
+ _checkSampling() {
4377
+ if (this._samples === this.sampleSize) {
4378
+ this.lastSampleTime = this._time;
4379
+ this.lastSampleCount = this._count;
4380
+ this.count += this._count;
4381
+ this.time += this._time;
4382
+ this.samples += this._samples;
4383
+ this._time = 0;
4384
+ this._count = 0;
4385
+ this._samples = 0;
4386
+ }
4387
+ }
4388
+ };
4389
+ }
4390
+ });
4391
+
4392
+ // ../loader-utils/node_modules/@probe.gl/stats/dist/lib/stats.js
4393
+ var Stats2;
4394
+ var init_stats2 = __esm({
4395
+ "../loader-utils/node_modules/@probe.gl/stats/dist/lib/stats.js"() {
4396
+ init_defineProperty();
4397
+ init_stat2();
4398
+ Stats2 = class {
4399
+ constructor(options) {
4400
+ _defineProperty(this, "id", void 0);
4401
+ _defineProperty(this, "stats", {});
4402
+ this.id = options.id;
4403
+ this.stats = {};
4404
+ this._initializeStats(options.stats);
4405
+ Object.seal(this);
4406
+ }
4407
+ get(name) {
4408
+ let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "count";
4409
+ return this._getOrCreate({
4410
+ name,
4411
+ type
4412
+ });
4413
+ }
4414
+ get size() {
4415
+ return Object.keys(this.stats).length;
4416
+ }
4417
+ reset() {
4418
+ for (const stat of Object.values(this.stats)) {
4419
+ stat.reset();
4420
+ }
4421
+ return this;
4422
+ }
4423
+ forEach(fn) {
4424
+ for (const stat of Object.values(this.stats)) {
4425
+ fn(stat);
4426
+ }
4427
+ }
4428
+ getTable() {
4429
+ const table = {};
4430
+ this.forEach((stat) => {
4431
+ table[stat.name] = {
4432
+ time: stat.time || 0,
4433
+ count: stat.count || 0,
4434
+ average: stat.getAverageTime() || 0,
4435
+ hz: stat.getHz() || 0
4436
+ };
4437
+ });
4438
+ return table;
4439
+ }
4440
+ _initializeStats() {
4441
+ let stats = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
4442
+ stats.forEach((stat) => this._getOrCreate(stat));
4443
+ }
4444
+ _getOrCreate(stat) {
4445
+ if (!stat || !stat.name) {
4446
+ return null;
4447
+ }
4448
+ const {
4449
+ name,
4450
+ type
4451
+ } = stat;
4452
+ if (!this.stats[name]) {
4453
+ if (stat instanceof Stat2) {
4454
+ this.stats[name] = stat;
4455
+ } else {
4456
+ this.stats[name] = new Stat2(name, type);
4457
+ }
4458
+ }
4459
+ return this.stats[name] || null;
4460
+ }
4461
+ };
4462
+ }
4463
+ });
4464
+
4465
+ // ../loader-utils/node_modules/@probe.gl/stats/dist/index.js
4466
+ var init_dist2 = __esm({
4467
+ "../loader-utils/node_modules/@probe.gl/stats/dist/index.js"() {
4468
+ init_stats2();
4469
+ init_stat2();
4470
+ init_hi_res_timestamp2();
4471
+ }
4472
+ });
4473
+
4248
4474
  // ../loader-utils/src/lib/request-utils/request-scheduler.ts
4249
4475
  var STAT_QUEUED_REQUESTS, STAT_ACTIVE_REQUESTS, STAT_CANCELLED_REQUESTS, STAT_QUEUED_REQUESTS_EVER, STAT_ACTIVE_REQUESTS_EVER, DEFAULT_PROPS2, RequestScheduler;
4250
4476
  var init_request_scheduler = __esm({
4251
4477
  "../loader-utils/src/lib/request-utils/request-scheduler.ts"() {
4252
- init_esm3();
4478
+ init_dist2();
4253
4479
  STAT_QUEUED_REQUESTS = "Queued Requests";
4254
4480
  STAT_ACTIVE_REQUESTS = "Active Requests";
4255
4481
  STAT_CANCELLED_REQUESTS = "Cancelled Requests";
@@ -4267,7 +4493,7 @@
4267
4493
  this.requestMap = new Map();
4268
4494
  this.deferredUpdate = null;
4269
4495
  this.props = { ...DEFAULT_PROPS2, ...props };
4270
- this.stats = new Stats({ id: this.props.id });
4496
+ this.stats = new Stats2({ id: this.props.id });
4271
4497
  this.stats.get(STAT_QUEUED_REQUESTS);
4272
4498
  this.stats.get(STAT_ACTIVE_REQUESTS);
4273
4499
  this.stats.get(STAT_CANCELLED_REQUESTS);
@@ -4283,8 +4509,8 @@
4283
4509
  return this.requestMap.get(handle);
4284
4510
  }
4285
4511
  const request = { handle, priority: 0, getPriority };
4286
- const promise = new Promise((resolve) => {
4287
- request.resolve = resolve;
4512
+ const promise = new Promise((resolve2) => {
4513
+ request.resolve = resolve2;
4288
4514
  return request;
4289
4515
  });
4290
4516
  this.requestQueue.push(request);
@@ -4293,7 +4519,7 @@
4293
4519
  return promise;
4294
4520
  }
4295
4521
  _issueRequest(request) {
4296
- const { handle, resolve } = request;
4522
+ const { handle, resolve: resolve2 } = request;
4297
4523
  let isDone = false;
4298
4524
  const done = () => {
4299
4525
  if (!isDone) {
@@ -4304,7 +4530,7 @@
4304
4530
  }
4305
4531
  };
4306
4532
  this.activeRequestCount++;
4307
- return resolve ? resolve({ done }) : Promise.resolve({ done });
4533
+ return resolve2 ? resolve2({ done }) : Promise.resolve({ done });
4308
4534
  }
4309
4535
  _issueNewRequests() {
4310
4536
  if (!this.deferredUpdate) {
@@ -4370,19 +4596,75 @@
4370
4596
  }
4371
4597
  });
4372
4598
 
4599
+ // ../loader-utils/src/lib/node/buffer.browser.ts
4600
+ function toArrayBuffer(buffer) {
4601
+ return buffer;
4602
+ }
4603
+ var init_buffer_browser = __esm({
4604
+ "../loader-utils/src/lib/node/buffer.browser.ts"() {
4605
+ }
4606
+ });
4607
+
4608
+ // ../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts
4609
+ function isBuffer(value) {
4610
+ return value && typeof value === "object" && value.isBuffer;
4611
+ }
4612
+ function toArrayBuffer2(data) {
4613
+ if (isBuffer(data)) {
4614
+ return toArrayBuffer(data);
4615
+ }
4616
+ if (data instanceof ArrayBuffer) {
4617
+ return data;
4618
+ }
4619
+ if (ArrayBuffer.isView(data)) {
4620
+ if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
4621
+ return data.buffer;
4622
+ }
4623
+ return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
4624
+ }
4625
+ if (typeof data === "string") {
4626
+ const text = data;
4627
+ const uint8Array = new TextEncoder().encode(text);
4628
+ return uint8Array.buffer;
4629
+ }
4630
+ if (data && typeof data === "object" && data._toArrayBuffer) {
4631
+ return data._toArrayBuffer();
4632
+ }
4633
+ throw new Error("toArrayBuffer");
4634
+ }
4635
+ var init_memory_conversion_utils = __esm({
4636
+ "../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts"() {
4637
+ init_buffer_browser();
4638
+ }
4639
+ });
4640
+
4641
+ // ../loader-utils/src/lib/path-utils/get-cwd.ts
4642
+ function getCWD() {
4643
+ if (typeof process !== "undefined" && typeof process.cwd !== "undefined") {
4644
+ return process.cwd();
4645
+ }
4646
+ const pathname = window.location?.pathname;
4647
+ return pathname?.slice(0, pathname.lastIndexOf("/") + 1) || "";
4648
+ }
4649
+ var init_get_cwd = __esm({
4650
+ "../loader-utils/src/lib/path-utils/get-cwd.ts"() {
4651
+ }
4652
+ });
4653
+
4373
4654
  // ../loader-utils/src/lib/path-utils/path.ts
4374
4655
  var path_exports = {};
4375
4656
  __export(path_exports, {
4376
4657
  dirname: () => dirname,
4377
4658
  filename: () => filename,
4378
- join: () => join
4659
+ join: () => join,
4660
+ resolve: () => resolve
4379
4661
  });
4380
4662
  function filename(url) {
4381
- const slashIndex = url && url.lastIndexOf("/");
4663
+ const slashIndex = url ? url.lastIndexOf("/") : -1;
4382
4664
  return slashIndex >= 0 ? url.substr(slashIndex + 1) : "";
4383
4665
  }
4384
4666
  function dirname(url) {
4385
- const slashIndex = url && url.lastIndexOf("/");
4667
+ const slashIndex = url ? url.lastIndexOf("/") : -1;
4386
4668
  return slashIndex >= 0 ? url.substr(0, slashIndex) : "";
4387
4669
  }
4388
4670
  function join(...parts) {
@@ -4398,8 +4680,112 @@
4398
4680
  });
4399
4681
  return parts.join(separator);
4400
4682
  }
4683
+ function resolve(...components) {
4684
+ const paths = [];
4685
+ for (let _i = 0; _i < components.length; _i++) {
4686
+ paths[_i] = components[_i];
4687
+ }
4688
+ let resolvedPath = "";
4689
+ let resolvedAbsolute = false;
4690
+ let cwd;
4691
+ for (let i = paths.length - 1; i >= -1 && !resolvedAbsolute; i--) {
4692
+ let path;
4693
+ if (i >= 0) {
4694
+ path = paths[i];
4695
+ } else {
4696
+ if (cwd === void 0) {
4697
+ cwd = getCWD();
4698
+ }
4699
+ path = cwd;
4700
+ }
4701
+ if (path.length === 0) {
4702
+ continue;
4703
+ }
4704
+ resolvedPath = `${path}/${resolvedPath}`;
4705
+ resolvedAbsolute = path.charCodeAt(0) === SLASH;
4706
+ }
4707
+ resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
4708
+ if (resolvedAbsolute) {
4709
+ return `/${resolvedPath}`;
4710
+ } else if (resolvedPath.length > 0) {
4711
+ return resolvedPath;
4712
+ }
4713
+ return ".";
4714
+ }
4715
+ function normalizeStringPosix(path, allowAboveRoot) {
4716
+ let res = "";
4717
+ let lastSlash = -1;
4718
+ let dots = 0;
4719
+ let code;
4720
+ let isAboveRoot = false;
4721
+ for (let i = 0; i <= path.length; ++i) {
4722
+ if (i < path.length) {
4723
+ code = path.charCodeAt(i);
4724
+ } else if (code === SLASH) {
4725
+ break;
4726
+ } else {
4727
+ code = SLASH;
4728
+ }
4729
+ if (code === SLASH) {
4730
+ if (lastSlash === i - 1 || dots === 1) {
4731
+ } else if (lastSlash !== i - 1 && dots === 2) {
4732
+ if (res.length < 2 || !isAboveRoot || res.charCodeAt(res.length - 1) !== DOT || res.charCodeAt(res.length - 2) !== DOT) {
4733
+ if (res.length > 2) {
4734
+ const start = res.length - 1;
4735
+ let j = start;
4736
+ for (; j >= 0; --j) {
4737
+ if (res.charCodeAt(j) === SLASH) {
4738
+ break;
4739
+ }
4740
+ }
4741
+ if (j !== start) {
4742
+ res = j === -1 ? "" : res.slice(0, j);
4743
+ lastSlash = i;
4744
+ dots = 0;
4745
+ isAboveRoot = false;
4746
+ continue;
4747
+ }
4748
+ } else if (res.length === 2 || res.length === 1) {
4749
+ res = "";
4750
+ lastSlash = i;
4751
+ dots = 0;
4752
+ isAboveRoot = false;
4753
+ continue;
4754
+ }
4755
+ }
4756
+ if (allowAboveRoot) {
4757
+ if (res.length > 0) {
4758
+ res += "/..";
4759
+ } else {
4760
+ res = "..";
4761
+ }
4762
+ isAboveRoot = true;
4763
+ }
4764
+ } else {
4765
+ const slice = path.slice(lastSlash + 1, i);
4766
+ if (res.length > 0) {
4767
+ res += `/${slice}`;
4768
+ } else {
4769
+ res = slice;
4770
+ }
4771
+ isAboveRoot = false;
4772
+ }
4773
+ lastSlash = i;
4774
+ dots = 0;
4775
+ } else if (code === DOT && dots !== -1) {
4776
+ ++dots;
4777
+ } else {
4778
+ dots = -1;
4779
+ }
4780
+ }
4781
+ return res;
4782
+ }
4783
+ var SLASH, DOT;
4401
4784
  var init_path = __esm({
4402
4785
  "../loader-utils/src/lib/path-utils/path.ts"() {
4786
+ init_get_cwd();
4787
+ SLASH = 47;
4788
+ DOT = 46;
4403
4789
  }
4404
4790
  });
4405
4791
 
@@ -4413,6 +4799,7 @@
4413
4799
  init_async_iteration();
4414
4800
  init_request_scheduler();
4415
4801
  init_file_aliases();
4802
+ init_memory_conversion_utils();
4416
4803
  init_path();
4417
4804
  }
4418
4805
  });
@@ -4446,55 +4833,55 @@
4446
4833
  return this._length;
4447
4834
  }
4448
4835
  add(item) {
4449
- const node = new DoublyLinkedListNode(item, this.tail, null);
4836
+ const node2 = new DoublyLinkedListNode(item, this.tail, null);
4450
4837
  if (this.tail) {
4451
- this.tail.next = node;
4452
- this.tail = node;
4838
+ this.tail.next = node2;
4839
+ this.tail = node2;
4453
4840
  } else {
4454
- this.head = node;
4455
- this.tail = node;
4841
+ this.head = node2;
4842
+ this.tail = node2;
4456
4843
  }
4457
4844
  ++this._length;
4458
- return node;
4845
+ return node2;
4459
4846
  }
4460
- remove(node) {
4461
- if (!node) {
4847
+ remove(node2) {
4848
+ if (!node2) {
4462
4849
  return;
4463
4850
  }
4464
- if (node.previous && node.next) {
4465
- node.previous.next = node.next;
4466
- node.next.previous = node.previous;
4467
- } else if (node.previous) {
4468
- node.previous.next = null;
4469
- this.tail = node.previous;
4470
- } else if (node.next) {
4471
- node.next.previous = null;
4472
- this.head = node.next;
4851
+ if (node2.previous && node2.next) {
4852
+ node2.previous.next = node2.next;
4853
+ node2.next.previous = node2.previous;
4854
+ } else if (node2.previous) {
4855
+ node2.previous.next = null;
4856
+ this.tail = node2.previous;
4857
+ } else if (node2.next) {
4858
+ node2.next.previous = null;
4859
+ this.head = node2.next;
4473
4860
  } else {
4474
4861
  this.head = null;
4475
4862
  this.tail = null;
4476
4863
  }
4477
- node.next = null;
4478
- node.previous = null;
4864
+ node2.next = null;
4865
+ node2.previous = null;
4479
4866
  --this._length;
4480
4867
  }
4481
- splice(node, nextNode) {
4482
- if (node === nextNode) {
4868
+ splice(node2, nextNode) {
4869
+ if (node2 === nextNode) {
4483
4870
  return;
4484
4871
  }
4485
4872
  this.remove(nextNode);
4486
- this._insert(node, nextNode);
4873
+ this._insert(node2, nextNode);
4487
4874
  }
4488
- _insert(node, nextNode) {
4489
- const oldNodeNext = node.next;
4490
- node.next = nextNode;
4491
- if (this.tail === node) {
4875
+ _insert(node2, nextNode) {
4876
+ const oldNodeNext = node2.next;
4877
+ node2.next = nextNode;
4878
+ if (this.tail === node2) {
4492
4879
  this.tail = nextNode;
4493
4880
  } else {
4494
4881
  oldNodeNext.previous = nextNode;
4495
4882
  }
4496
4883
  nextNode.next = oldNodeNext;
4497
- nextNode.previous = node;
4884
+ nextNode.previous = node2;
4498
4885
  ++this._length;
4499
4886
  }
4500
4887
  };
@@ -4519,9 +4906,9 @@
4519
4906
  this._list.splice(this._list.tail, this._sentinel);
4520
4907
  }
4521
4908
  touch(tile) {
4522
- const node = tile._cacheNode;
4523
- if (defined(node)) {
4524
- this._list.splice(this._sentinel, node);
4909
+ const node2 = tile._cacheNode;
4910
+ if (defined(node2)) {
4911
+ this._list.splice(this._sentinel, node2);
4525
4912
  }
4526
4913
  }
4527
4914
  add(tileset, tile, addCallback) {
@@ -4533,11 +4920,11 @@
4533
4920
  }
4534
4921
  }
4535
4922
  unloadTile(tileset, tile, unloadCallback) {
4536
- const node = tile._cacheNode;
4537
- if (!defined(node)) {
4923
+ const node2 = tile._cacheNode;
4924
+ if (!defined(node2)) {
4538
4925
  return;
4539
4926
  }
4540
- this._list.remove(node);
4927
+ this._list.remove(node2);
4541
4928
  tile._cacheNode = void 0;
4542
4929
  if (unloadCallback) {
4543
4930
  unloadCallback(tileset, tile);
@@ -4549,10 +4936,10 @@
4549
4936
  const list = this._list;
4550
4937
  const maximumMemoryUsageInBytes = tileset.maximumMemoryUsage * 1024 * 1024;
4551
4938
  const sentinel = this._sentinel;
4552
- let node = list.head;
4553
- while (node !== sentinel && (tileset.gpuMemoryUsageInBytes > maximumMemoryUsageInBytes || trimTiles)) {
4554
- const tile = node.item;
4555
- node = node.next;
4939
+ let node2 = list.head;
4940
+ while (node2 !== sentinel && (tileset.gpuMemoryUsageInBytes > maximumMemoryUsageInBytes || trimTiles)) {
4941
+ const tile = node2.item;
4942
+ node2 = node2.next;
4556
4943
  this.unloadTile(tileset, tile, unloadCallback);
4557
4944
  }
4558
4945
  }
@@ -4692,8 +5079,8 @@
4692
5079
  return this;
4693
5080
  }
4694
5081
  expand(point) {
4695
- const scratchPoint = scratchVector6.from(point);
4696
- const radius = scratchPoint.subtract(this.center).magnitude();
5082
+ const scratchPoint2 = scratchVector6.from(point);
5083
+ const radius = scratchPoint2.subtract(this.center).magnitude();
4697
5084
  if (radius > this.radius) {
4698
5085
  this.radius = radius;
4699
5086
  }
@@ -4710,8 +5097,8 @@
4710
5097
  return d * d;
4711
5098
  }
4712
5099
  distanceTo(point) {
4713
- const scratchPoint = scratchVector6.from(point);
4714
- const delta = scratchPoint.subtract(this.center);
5100
+ const scratchPoint2 = scratchVector6.from(point);
5101
+ const delta = scratchPoint2.subtract(this.center);
4715
5102
  return Math.max(0, delta.len() - this.radius);
4716
5103
  }
4717
5104
  intersectPlane(plane) {
@@ -5154,7 +5541,7 @@
5154
5541
  });
5155
5542
 
5156
5543
  // ../../node_modules/@math.gl/culling/dist/esm/index.js
5157
- var init_esm4 = __esm({
5544
+ var init_esm3 = __esm({
5158
5545
  "../../node_modules/@math.gl/culling/dist/esm/index.js"() {
5159
5546
  init_constants2();
5160
5547
  init_axis_aligned_bounding_box();
@@ -5260,7 +5647,7 @@
5260
5647
  var init_frame_state = __esm({
5261
5648
  "src/tileset/helpers/frame-state.ts"() {
5262
5649
  init_esm();
5263
- init_esm4();
5650
+ init_esm3();
5264
5651
  init_esm2();
5265
5652
  scratchVector7 = new Vector3();
5266
5653
  scratchPosition3 = new Vector3();
@@ -5313,7 +5700,7 @@
5313
5700
  var init_zoom = __esm({
5314
5701
  "src/tileset/helpers/zoom.ts"() {
5315
5702
  init_esm();
5316
- init_esm4();
5703
+ init_esm3();
5317
5704
  init_esm2();
5318
5705
  WGS84_RADIUS_X2 = 6378137;
5319
5706
  WGS84_RADIUS_Y2 = 6378137;
@@ -5473,9 +5860,9 @@
5473
5860
  }
5474
5861
  if (resource instanceof Blob) {
5475
5862
  const blobSlice = resource.slice(0, 5);
5476
- return await new Promise((resolve) => {
5863
+ return await new Promise((resolve2) => {
5477
5864
  const reader = new FileReader();
5478
- reader.onload = (event) => resolve(event?.target?.result);
5865
+ reader.onload = (event) => resolve2(event?.target?.result);
5479
5866
  reader.readAsDataURL(blobSlice);
5480
5867
  });
5481
5868
  }
@@ -5520,12 +5907,12 @@
5520
5907
  }
5521
5908
  });
5522
5909
 
5523
- // ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
5910
+ // ../core/node_modules/@probe.gl/env/dist/lib/is-electron.js
5524
5911
  function isElectron(mockUserAgent) {
5525
5912
  if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
5526
5913
  return true;
5527
5914
  }
5528
- if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions.electron)) {
5915
+ if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions["electron"])) {
5529
5916
  return true;
5530
5917
  }
5531
5918
  const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
@@ -5536,59 +5923,54 @@
5536
5923
  return false;
5537
5924
  }
5538
5925
  var init_is_electron = __esm({
5539
- "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
5926
+ "../core/node_modules/@probe.gl/env/dist/lib/is-electron.js"() {
5540
5927
  }
5541
5928
  });
5542
5929
 
5543
- // ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
5930
+ // ../core/node_modules/@probe.gl/env/dist/lib/is-browser.js
5544
5931
  function isBrowser3() {
5545
5932
  const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
5546
5933
  return !isNode || isElectron();
5547
5934
  }
5548
5935
  var init_is_browser = __esm({
5549
- "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
5936
+ "../core/node_modules/@probe.gl/env/dist/lib/is-browser.js"() {
5550
5937
  init_is_electron();
5551
5938
  }
5552
5939
  });
5553
5940
 
5554
- // ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
5555
- var globals3, self_3, window_3, document_3, process_;
5941
+ // ../core/node_modules/@probe.gl/env/dist/lib/globals.js
5942
+ var self2, window2, document2, process2, console2, navigator2;
5556
5943
  var init_globals3 = __esm({
5557
- "../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
5558
- globals3 = {
5559
- self: typeof self !== "undefined" && self,
5560
- window: typeof window !== "undefined" && window,
5561
- global: typeof global !== "undefined" && global,
5562
- document: typeof document !== "undefined" && document,
5563
- process: typeof process === "object" && process
5564
- };
5565
- self_3 = globals3.self || globals3.window || globals3.global;
5566
- window_3 = globals3.window || globals3.self || globals3.global;
5567
- document_3 = globals3.document || {};
5568
- process_ = globals3.process || {};
5944
+ "../core/node_modules/@probe.gl/env/dist/lib/globals.js"() {
5945
+ self2 = globalThis.self || globalThis.window || globalThis.global;
5946
+ window2 = globalThis.window || globalThis.self || globalThis.global;
5947
+ document2 = globalThis.document || {};
5948
+ process2 = globalThis.process || {};
5949
+ console2 = globalThis.console;
5950
+ navigator2 = globalThis.navigator || {};
5569
5951
  }
5570
5952
  });
5571
5953
 
5572
- // ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
5954
+ // ../core/node_modules/@probe.gl/env/dist/utils/globals.js
5573
5955
  var VERSION2, isBrowser4;
5574
5956
  var init_globals4 = __esm({
5575
- "../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
5957
+ "../core/node_modules/@probe.gl/env/dist/utils/globals.js"() {
5576
5958
  init_is_browser();
5577
5959
  VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
5578
5960
  isBrowser4 = isBrowser3();
5579
5961
  }
5580
5962
  });
5581
5963
 
5582
- // ../../node_modules/@probe.gl/env/dist/esm/index.js
5583
- var init_esm5 = __esm({
5584
- "../../node_modules/@probe.gl/env/dist/esm/index.js"() {
5964
+ // ../core/node_modules/@probe.gl/env/dist/index.js
5965
+ var init_dist3 = __esm({
5966
+ "../core/node_modules/@probe.gl/env/dist/index.js"() {
5585
5967
  init_globals4();
5586
5968
  init_globals3();
5587
5969
  init_is_browser();
5588
5970
  }
5589
5971
  });
5590
5972
 
5591
- // ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
5973
+ // ../core/node_modules/@probe.gl/log/dist/utils/local-storage.js
5592
5974
  function getStorage(type) {
5593
5975
  try {
5594
5976
  const storage = window[type];
@@ -5602,35 +5984,28 @@
5602
5984
  }
5603
5985
  var LocalStorage;
5604
5986
  var init_local_storage = __esm({
5605
- "../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
5987
+ "../core/node_modules/@probe.gl/log/dist/utils/local-storage.js"() {
5606
5988
  init_defineProperty();
5607
5989
  LocalStorage = class {
5608
- constructor(id) {
5609
- let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5990
+ constructor(id, defaultConfig) {
5610
5991
  let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
5611
5992
  _defineProperty(this, "storage", void 0);
5612
5993
  _defineProperty(this, "id", void 0);
5613
- _defineProperty(this, "config", {});
5994
+ _defineProperty(this, "config", void 0);
5614
5995
  this.storage = getStorage(type);
5615
5996
  this.id = id;
5616
- this.config = {};
5617
- Object.assign(this.config, defaultSettings);
5997
+ this.config = defaultConfig;
5618
5998
  this._loadConfiguration();
5619
5999
  }
5620
6000
  getConfiguration() {
5621
6001
  return this.config;
5622
6002
  }
5623
6003
  setConfiguration(configuration) {
5624
- this.config = {};
5625
- return this.updateConfiguration(configuration);
5626
- }
5627
- updateConfiguration(configuration) {
5628
6004
  Object.assign(this.config, configuration);
5629
6005
  if (this.storage) {
5630
6006
  const serialized = JSON.stringify(this.config);
5631
6007
  this.storage.setItem(this.id, serialized);
5632
6008
  }
5633
- return this;
5634
6009
  }
5635
6010
  _loadConfiguration() {
5636
6011
  let configuration = {};
@@ -5645,7 +6020,7 @@
5645
6020
  }
5646
6021
  });
5647
6022
 
5648
- // ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
6023
+ // ../core/node_modules/@probe.gl/log/dist/utils/formatters.js
5649
6024
  function formatTime(ms) {
5650
6025
  let formatted;
5651
6026
  if (ms < 10) {
@@ -5676,31 +6051,35 @@
5676
6051
  return ["".concat(message, " %c+"), style];
5677
6052
  }
5678
6053
  var init_formatters = __esm({
5679
- "../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
6054
+ "../core/node_modules/@probe.gl/log/dist/utils/formatters.js"() {
5680
6055
  }
5681
6056
  });
5682
6057
 
5683
- // ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
6058
+ // ../core/node_modules/@probe.gl/log/dist/utils/color.js
5684
6059
  function getColor(color) {
5685
- return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
6060
+ if (typeof color !== "string") {
6061
+ return color;
6062
+ }
6063
+ color = color.toUpperCase();
6064
+ return COLOR[color] || COLOR.WHITE;
5686
6065
  }
5687
6066
  function addColor(string, color, background) {
5688
6067
  if (!isBrowser3 && typeof string === "string") {
5689
6068
  if (color) {
5690
- color = getColor(color);
5691
- string = "[".concat(color, "m").concat(string, "");
6069
+ const colorCode = getColor(color);
6070
+ string = "[".concat(colorCode, "m").concat(string, "");
5692
6071
  }
5693
6072
  if (background) {
5694
- color = getColor(background);
5695
- string = "[".concat(background + 10, "m").concat(string, "");
6073
+ const colorCode = getColor(background);
6074
+ string = "[".concat(colorCode + BACKGROUND_INCREMENT, "m").concat(string, "");
5696
6075
  }
5697
6076
  }
5698
6077
  return string;
5699
6078
  }
5700
- var COLOR;
6079
+ var COLOR, BACKGROUND_INCREMENT;
5701
6080
  var init_color = __esm({
5702
- "../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
5703
- init_esm5();
6081
+ "../core/node_modules/@probe.gl/log/dist/utils/color.js"() {
6082
+ init_dist3();
5704
6083
  (function(COLOR2) {
5705
6084
  COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
5706
6085
  COLOR2[COLOR2["RED"] = 31] = "RED";
@@ -5719,66 +6098,63 @@
5719
6098
  COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
5720
6099
  COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
5721
6100
  })(COLOR || (COLOR = {}));
6101
+ BACKGROUND_INCREMENT = 10;
5722
6102
  }
5723
6103
  });
5724
6104
 
5725
- // ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
6105
+ // ../core/node_modules/@probe.gl/log/dist/utils/autobind.js
5726
6106
  function autobind(obj) {
5727
6107
  let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
5728
6108
  const proto = Object.getPrototypeOf(obj);
5729
6109
  const propNames = Object.getOwnPropertyNames(proto);
6110
+ const object = obj;
5730
6111
  for (const key of propNames) {
5731
- if (typeof obj[key] === "function") {
6112
+ const value = object[key];
6113
+ if (typeof value === "function") {
5732
6114
  if (!predefined.find((name) => key === name)) {
5733
- obj[key] = obj[key].bind(obj);
6115
+ object[key] = value.bind(obj);
5734
6116
  }
5735
6117
  }
5736
6118
  }
5737
6119
  }
5738
6120
  var init_autobind = __esm({
5739
- "../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
6121
+ "../core/node_modules/@probe.gl/log/dist/utils/autobind.js"() {
5740
6122
  }
5741
6123
  });
5742
6124
 
5743
- // ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
6125
+ // ../core/node_modules/@probe.gl/log/dist/utils/assert.js
5744
6126
  function assert4(condition, message) {
5745
6127
  if (!condition) {
5746
6128
  throw new Error(message || "Assertion failed");
5747
6129
  }
5748
6130
  }
5749
6131
  var init_assert4 = __esm({
5750
- "../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
6132
+ "../core/node_modules/@probe.gl/log/dist/utils/assert.js"() {
5751
6133
  }
5752
6134
  });
5753
6135
 
5754
- // ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
5755
- function getHiResTimestamp2() {
6136
+ // ../core/node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
6137
+ function getHiResTimestamp3() {
5756
6138
  let timestamp;
5757
- if (isBrowser3 && "performance" in window_3) {
6139
+ if (isBrowser3() && window2.performance) {
5758
6140
  var _window$performance, _window$performance$n;
5759
- timestamp = window_3 === null || window_3 === void 0 ? void 0 : (_window$performance = window_3.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
5760
- } else if ("hrtime" in process_) {
6141
+ timestamp = window2 === null || window2 === void 0 ? void 0 : (_window$performance = window2.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
6142
+ } else if ("hrtime" in process2) {
5761
6143
  var _process$hrtime;
5762
- const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
6144
+ const timeParts = process2 === null || process2 === void 0 ? void 0 : (_process$hrtime = process2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process2);
5763
6145
  timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
5764
6146
  } else {
5765
6147
  timestamp = Date.now();
5766
6148
  }
5767
6149
  return timestamp;
5768
6150
  }
5769
- var init_hi_res_timestamp2 = __esm({
5770
- "../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
5771
- init_esm5();
5772
- }
5773
- });
5774
-
5775
- // (disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image
5776
- var init_node_asciify_image = __esm({
5777
- "(disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image"() {
6151
+ var init_hi_res_timestamp3 = __esm({
6152
+ "../core/node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js"() {
6153
+ init_dist3();
5778
6154
  }
5779
6155
  });
5780
6156
 
5781
- // ../../node_modules/@probe.gl/log/dist/esm/log.js
6157
+ // ../core/node_modules/@probe.gl/log/dist/log.js
5782
6158
  function noop() {
5783
6159
  }
5784
6160
  function normalizeLogLevel(logLevel) {
@@ -5844,11 +6220,7 @@
5844
6220
  message = "",
5845
6221
  scale: scale5 = 1
5846
6222
  } = _ref2;
5847
- asciify.nodeAsciifyImage({
5848
- image,
5849
- message,
5850
- scale: scale5
5851
- });
6223
+ console.warn("removed");
5852
6224
  return noop;
5853
6225
  }
5854
6226
  function logImageInBrowser(_ref3) {
@@ -5887,26 +6259,25 @@
5887
6259
  }
5888
6260
  return "empty";
5889
6261
  }
5890
- var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
6262
+ var originalConsole, DEFAULT_LOG_CONFIGURATION, cache, ONCE, Log;
5891
6263
  var init_log = __esm({
5892
- "../../node_modules/@probe.gl/log/dist/esm/log.js"() {
6264
+ "../core/node_modules/@probe.gl/log/dist/log.js"() {
5893
6265
  init_defineProperty();
5894
- init_esm5();
6266
+ init_dist3();
5895
6267
  init_local_storage();
5896
6268
  init_formatters();
5897
6269
  init_color();
5898
6270
  init_autobind();
5899
6271
  init_assert4();
5900
- init_hi_res_timestamp2();
5901
- init_node_asciify_image();
6272
+ init_hi_res_timestamp3();
5902
6273
  originalConsole = {
5903
- debug: isBrowser3 ? console.debug || console.log : console.log,
6274
+ debug: isBrowser3() ? console.debug || console.log : console.log,
5904
6275
  log: console.log,
5905
6276
  info: console.info,
5906
6277
  warn: console.warn,
5907
6278
  error: console.error
5908
6279
  };
5909
- DEFAULT_SETTINGS = {
6280
+ DEFAULT_LOG_CONFIGURATION = {
5910
6281
  enabled: true,
5911
6282
  level: 0
5912
6283
  };
@@ -5923,14 +6294,14 @@
5923
6294
  };
5924
6295
  _defineProperty(this, "id", void 0);
5925
6296
  _defineProperty(this, "VERSION", VERSION2);
5926
- _defineProperty(this, "_startTs", getHiResTimestamp2());
5927
- _defineProperty(this, "_deltaTs", getHiResTimestamp2());
6297
+ _defineProperty(this, "_startTs", getHiResTimestamp3());
6298
+ _defineProperty(this, "_deltaTs", getHiResTimestamp3());
5928
6299
  _defineProperty(this, "_storage", void 0);
5929
6300
  _defineProperty(this, "userData", {});
5930
6301
  _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
5931
6302
  this.id = id;
5932
- this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
5933
6303
  this.userData = {};
6304
+ this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_LOG_CONFIGURATION);
5934
6305
  this.timeStamp("".concat(this.id, " started"));
5935
6306
  autobind(this);
5936
6307
  Object.seal(this);
@@ -5948,10 +6319,10 @@
5948
6319
  return this._storage.config.level;
5949
6320
  }
5950
6321
  getTotal() {
5951
- return Number((getHiResTimestamp2() - this._startTs).toPrecision(10));
6322
+ return Number((getHiResTimestamp3() - this._startTs).toPrecision(10));
5952
6323
  }
5953
6324
  getDelta() {
5954
- return Number((getHiResTimestamp2() - this._deltaTs).toPrecision(10));
6325
+ return Number((getHiResTimestamp3() - this._deltaTs).toPrecision(10));
5955
6326
  }
5956
6327
  set priority(newPriority) {
5957
6328
  this.level = newPriority;
@@ -5964,13 +6335,13 @@
5964
6335
  }
5965
6336
  enable() {
5966
6337
  let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
5967
- this._storage.updateConfiguration({
6338
+ this._storage.setConfiguration({
5968
6339
  enabled
5969
6340
  });
5970
6341
  return this;
5971
6342
  }
5972
6343
  setLevel(level) {
5973
- this._storage.updateConfiguration({
6344
+ this._storage.setConfiguration({
5974
6345
  level
5975
6346
  });
5976
6347
  return this;
@@ -5979,7 +6350,7 @@
5979
6350
  return this._storage.config[setting];
5980
6351
  }
5981
6352
  set(setting, value) {
5982
- this._storage.updateConfiguration({
6353
+ this._storage.setConfiguration({
5983
6354
  [setting]: value
5984
6355
  });
5985
6356
  }
@@ -6018,9 +6389,6 @@
6018
6389
  return this._getLogFunction(logLevel, message, console.info, arguments);
6019
6390
  }
6020
6391
  once(logLevel, message) {
6021
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
6022
- args[_key - 2] = arguments[_key];
6023
- }
6024
6392
  return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
6025
6393
  }
6026
6394
  table(logLevel, table, columns) {
@@ -6042,7 +6410,7 @@
6042
6410
  if (!this._shouldLog(logLevel || priority)) {
6043
6411
  return noop;
6044
6412
  }
6045
- return isBrowser3 ? logImageInBrowser({
6413
+ return isBrowser3() ? logImageInBrowser({
6046
6414
  image,
6047
6415
  message,
6048
6416
  scale: scale5
@@ -6113,11 +6481,11 @@
6113
6481
  assert4(method);
6114
6482
  opts.total = this.getTotal();
6115
6483
  opts.delta = this.getDelta();
6116
- this._deltaTs = getHiResTimestamp2();
6484
+ this._deltaTs = getHiResTimestamp3();
6117
6485
  const tag = opts.tag || opts.message;
6118
- if (opts.once) {
6486
+ if (opts.once && tag) {
6119
6487
  if (!cache[tag]) {
6120
- cache[tag] = getHiResTimestamp2();
6488
+ cache[tag] = getHiResTimestamp3();
6121
6489
  } else {
6122
6490
  return noop;
6123
6491
  }
@@ -6132,13 +6500,13 @@
6132
6500
  }
6133
6501
  });
6134
6502
 
6135
- // ../../node_modules/@probe.gl/log/dist/esm/index.js
6136
- var esm_default;
6137
- var init_esm6 = __esm({
6138
- "../../node_modules/@probe.gl/log/dist/esm/index.js"() {
6503
+ // ../core/node_modules/@probe.gl/log/dist/index.js
6504
+ var dist_default;
6505
+ var init_dist4 = __esm({
6506
+ "../core/node_modules/@probe.gl/log/dist/index.js"() {
6139
6507
  init_log();
6140
6508
  init_log();
6141
- esm_default = new Log({
6509
+ dist_default = new Log({
6142
6510
  id: "@probe.gl/log"
6143
6511
  });
6144
6512
  }
@@ -6148,7 +6516,7 @@
6148
6516
  var probeLog, NullLog, ConsoleLog;
6149
6517
  var init_loggers = __esm({
6150
6518
  "../core/src/lib/loader-utils/loggers.ts"() {
6151
- init_esm6();
6519
+ init_dist4();
6152
6520
  probeLog = new Log({ id: "loaders.gl" });
6153
6521
  NullLog = class {
6154
6522
  log() {
@@ -6246,20 +6614,6 @@
6246
6614
  validateOptions(options, loaders);
6247
6615
  return normalizeOptionsInternal(loader, options, url);
6248
6616
  }
6249
- function getFetchFunction(options, context) {
6250
- const globalOptions = getGlobalLoaderOptions();
6251
- const fetchOptions = options || globalOptions;
6252
- if (typeof fetchOptions.fetch === "function") {
6253
- return fetchOptions.fetch;
6254
- }
6255
- if (isObject(fetchOptions.fetch)) {
6256
- return (url) => fetchFile(url, fetchOptions);
6257
- }
6258
- if (context?.fetch) {
6259
- return context?.fetch;
6260
- }
6261
- return fetchFile;
6262
- }
6263
6617
  function validateOptions(options, loaders) {
6264
6618
  validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
6265
6619
  for (const loader of loaders) {
@@ -6338,7 +6692,6 @@
6338
6692
  var init_option_utils = __esm({
6339
6693
  "../core/src/lib/loader-utils/option-utils.ts"() {
6340
6694
  init_is_type();
6341
- init_fetch_file();
6342
6695
  init_loggers();
6343
6696
  init_option_defaults();
6344
6697
  getGlobalLoaderOptions = () => {
@@ -6406,7 +6759,7 @@
6406
6759
  var log;
6407
6760
  var init_log2 = __esm({
6408
6761
  "../core/src/lib/utils/log.ts"() {
6409
- init_esm6();
6762
+ init_dist4();
6410
6763
  log = new Log({ id: "loaders.gl" });
6411
6764
  }
6412
6765
  });
@@ -6679,7 +7032,7 @@
6679
7032
  if (done) {
6680
7033
  return;
6681
7034
  }
6682
- yield toArrayBuffer(value);
7035
+ yield toArrayBuffer2(value);
6683
7036
  }
6684
7037
  } catch (error) {
6685
7038
  reader.releaseLock();
@@ -6687,7 +7040,7 @@
6687
7040
  }
6688
7041
  async function* makeNodeStreamIterator(stream, options) {
6689
7042
  for await (const chunk of stream) {
6690
- yield toArrayBuffer(chunk);
7043
+ yield toArrayBuffer2(chunk);
6691
7044
  }
6692
7045
  }
6693
7046
  var init_make_stream_iterator = __esm({
@@ -6788,6 +7141,29 @@
6788
7141
  }
6789
7142
  });
6790
7143
 
7144
+ // ../core/src/lib/loader-utils/get-fetch-function.ts
7145
+ function getFetchFunction(options, context) {
7146
+ const globalOptions = getGlobalLoaderOptions();
7147
+ const fetchOptions = options || globalOptions;
7148
+ if (typeof fetchOptions.fetch === "function") {
7149
+ return fetchOptions.fetch;
7150
+ }
7151
+ if (isObject(fetchOptions.fetch)) {
7152
+ return (url) => fetchFile(url, fetchOptions);
7153
+ }
7154
+ if (context?.fetch) {
7155
+ return context?.fetch;
7156
+ }
7157
+ return fetchFile;
7158
+ }
7159
+ var init_get_fetch_function = __esm({
7160
+ "../core/src/lib/loader-utils/get-fetch-function.ts"() {
7161
+ init_is_type();
7162
+ init_fetch_file();
7163
+ init_option_utils();
7164
+ }
7165
+ });
7166
+
6791
7167
  // ../core/src/lib/loader-utils/loader-context.ts
6792
7168
  function getLoaderContext(context, options, previousContext = null) {
6793
7169
  if (previousContext) {
@@ -6818,7 +7194,7 @@
6818
7194
  }
6819
7195
  var init_loader_context = __esm({
6820
7196
  "../core/src/lib/loader-utils/loader-context.ts"() {
6821
- init_option_utils();
7197
+ init_get_fetch_function();
6822
7198
  }
6823
7199
  });
6824
7200
 
@@ -6903,7 +7279,7 @@
6903
7279
  "../core/src/lib/api/load.ts"() {
6904
7280
  init_is_type();
6905
7281
  init_normalize_loader();
6906
- init_option_utils();
7282
+ init_get_fetch_function();
6907
7283
  init_parse();
6908
7284
  }
6909
7285
  });
@@ -6975,6 +7351,22 @@
6975
7351
  }
6976
7352
  throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box");
6977
7353
  }
7354
+ function getCartographicBounds(boundingVolumeHeader, boundingVolume) {
7355
+ if (boundingVolumeHeader.box) {
7356
+ return orientedBoundingBoxToCartographicBounds(boundingVolume);
7357
+ }
7358
+ if (boundingVolumeHeader.region) {
7359
+ const [west, south, east, north, minHeight, maxHeight] = boundingVolumeHeader.region;
7360
+ return [
7361
+ [degrees(west), degrees(south), minHeight],
7362
+ [degrees(east), degrees(north), maxHeight]
7363
+ ];
7364
+ }
7365
+ if (boundingVolumeHeader.sphere) {
7366
+ return boundingSphereToCartographicBounds(boundingVolume);
7367
+ }
7368
+ throw new Error("Unkown boundingVolume type");
7369
+ }
6978
7370
  function createBox(box, transform, result) {
6979
7371
  const center = new Vector3(box[0], box[1], box[2]);
6980
7372
  transform.transform(center, center);
@@ -7030,13 +7422,79 @@
7030
7422
  }
7031
7423
  return new BoundingSphere(center, radius);
7032
7424
  }
7033
- var scratchScale, scratchNorthWest, scratchSouthEast;
7425
+ function orientedBoundingBoxToCartographicBounds(boundingVolume) {
7426
+ const result = emptyCartographicBounds();
7427
+ const { halfAxes } = boundingVolume;
7428
+ const xAxis = new Vector3(halfAxes.getColumn(0));
7429
+ const yAxis = new Vector3(halfAxes.getColumn(1));
7430
+ const zAxis = new Vector3(halfAxes.getColumn(2));
7431
+ for (let x = 0; x < 2; x++) {
7432
+ for (let y = 0; y < 2; y++) {
7433
+ for (let z = 0; z < 2; z++) {
7434
+ scratchPoint.copy(boundingVolume.center);
7435
+ scratchPoint.add(xAxis);
7436
+ scratchPoint.add(yAxis);
7437
+ scratchPoint.add(zAxis);
7438
+ addToCartographicBounds(result, scratchPoint);
7439
+ zAxis.negate();
7440
+ }
7441
+ yAxis.negate();
7442
+ }
7443
+ xAxis.negate();
7444
+ }
7445
+ return result;
7446
+ }
7447
+ function boundingSphereToCartographicBounds(boundingVolume) {
7448
+ const result = emptyCartographicBounds();
7449
+ const { center, radius } = boundingVolume;
7450
+ const point = Ellipsoid.WGS84.scaleToGeodeticSurface(center, scratchPoint);
7451
+ let zAxis;
7452
+ if (point) {
7453
+ zAxis = Ellipsoid.WGS84.geodeticSurfaceNormal(point);
7454
+ } else {
7455
+ zAxis = new Vector3(0, 0, 1);
7456
+ }
7457
+ let xAxis = new Vector3(zAxis[2], -zAxis[1], 0);
7458
+ if (xAxis.len() > 0) {
7459
+ xAxis.normalize();
7460
+ } else {
7461
+ xAxis = new Vector3(0, 1, 0);
7462
+ }
7463
+ const yAxis = xAxis.clone().cross(zAxis);
7464
+ for (const axis of [xAxis, yAxis, zAxis]) {
7465
+ scratchScale.copy(axis).scale(radius);
7466
+ for (let dir = 0; dir < 2; dir++) {
7467
+ scratchPoint.copy(center);
7468
+ scratchPoint.add(scratchScale);
7469
+ addToCartographicBounds(result, scratchPoint);
7470
+ scratchScale.negate();
7471
+ }
7472
+ }
7473
+ return result;
7474
+ }
7475
+ function emptyCartographicBounds() {
7476
+ return [
7477
+ [Infinity, Infinity, Infinity],
7478
+ [-Infinity, -Infinity, -Infinity]
7479
+ ];
7480
+ }
7481
+ function addToCartographicBounds(target, cartesian) {
7482
+ Ellipsoid.WGS84.cartesianToCartographic(cartesian, scratchPoint);
7483
+ target[0][0] = Math.min(target[0][0], scratchPoint[0]);
7484
+ target[0][1] = Math.min(target[0][1], scratchPoint[1]);
7485
+ target[0][2] = Math.min(target[0][2], scratchPoint[2]);
7486
+ target[1][0] = Math.max(target[1][0], scratchPoint[0]);
7487
+ target[1][1] = Math.max(target[1][1], scratchPoint[1]);
7488
+ target[1][2] = Math.max(target[1][2], scratchPoint[2]);
7489
+ }
7490
+ var scratchPoint, scratchScale, scratchNorthWest, scratchSouthEast;
7034
7491
  var init_bounding_volume = __esm({
7035
7492
  "src/tileset/helpers/bounding-volume.ts"() {
7036
7493
  init_esm();
7037
- init_esm4();
7494
+ init_esm3();
7038
7495
  init_esm2();
7039
7496
  init_src2();
7497
+ scratchPoint = new Vector3();
7040
7498
  scratchScale = new Vector3();
7041
7499
  scratchNorthWest = new Vector3();
7042
7500
  scratchSouthEast = new Vector3();
@@ -7480,7 +7938,7 @@
7480
7938
  var init_tile_3d = __esm({
7481
7939
  "src/tileset/tile-3d.ts"() {
7482
7940
  init_esm();
7483
- init_esm4();
7941
+ init_esm3();
7484
7942
  init_src3();
7485
7943
  init_constants3();
7486
7944
  init_bounding_volume();
@@ -7587,6 +8045,12 @@
7587
8045
  get screenSpaceError() {
7588
8046
  return this._screenSpaceError;
7589
8047
  }
8048
+ get boundingBox() {
8049
+ if (!this._boundingBox) {
8050
+ this._boundingBox = getCartographicBounds(this.header.boundingVolume, this.boundingVolume);
8051
+ }
8052
+ return this._boundingBox;
8053
+ }
7590
8054
  getScreenSpaceError(frameState, useParentLodMetric) {
7591
8055
  switch (this.tileset.type) {
7592
8056
  case TILESET_TYPE.I3S:
@@ -8087,7 +8551,7 @@
8087
8551
  "src/tileset/tileset-3d.ts"() {
8088
8552
  init_esm();
8089
8553
  init_esm2();
8090
- init_esm3();
8554
+ init_dist();
8091
8555
  init_src2();
8092
8556
  init_tileset_cache();
8093
8557
  init_transform_utils();
@@ -8240,12 +8704,12 @@
8240
8704
  this.lastUpdatedVieports = viewports;
8241
8705
  }
8242
8706
  if (!this.updatePromise) {
8243
- this.updatePromise = new Promise((resolve) => {
8707
+ this.updatePromise = new Promise((resolve2) => {
8244
8708
  setTimeout(() => {
8245
8709
  if (this.lastUpdatedVieports) {
8246
8710
  this.doUpdate(this.lastUpdatedVieports);
8247
8711
  }
8248
- resolve(this._frameNumber);
8712
+ resolve2(this._frameNumber);
8249
8713
  this.updatePromise = null;
8250
8714
  }, this.options.debounceTime);
8251
8715
  });