@loaders.gl/tiles-3d 5.0.0-beta.10 → 5.0.0-beta.11

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 (154) hide show
  1. package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
  2. package/dist/3d-tiles/dist.dev.js +169 -581
  3. package/dist/3d-tiles/dist.min.js +16 -16
  4. package/dist/3d-tiles/index.cjs +115 -390
  5. package/dist/3d-tiles/index.cjs.map +3 -3
  6. package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.d.ts +1 -2
  7. package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.d.ts.map +1 -1
  8. package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.js +3 -4
  9. package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
  10. package/dist/3d-tiles/lib/classes/helpers/tile-component-types.d.ts +4 -0
  11. package/dist/3d-tiles/lib/classes/helpers/tile-component-types.d.ts.map +1 -0
  12. package/dist/3d-tiles/lib/classes/helpers/tile-component-types.js +36 -0
  13. package/dist/3d-tiles/lib/classes/helpers/tile-component-types.js.map +1 -0
  14. package/dist/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.d.ts.map +1 -1
  15. package/dist/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.js +3 -4
  16. package/dist/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
  17. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts +1 -1
  18. package/dist/3d-tiles/lib/classes/tile-3d-feature-table.d.ts +9 -5
  19. package/dist/3d-tiles/lib/classes/tile-3d-feature-table.d.ts.map +1 -1
  20. package/dist/3d-tiles/lib/classes/tile-3d-feature-table.js +15 -12
  21. package/dist/3d-tiles/lib/classes/tile-3d-feature-table.js.map +1 -1
  22. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.d.ts +0 -1
  23. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.d.ts.map +1 -1
  24. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.js +2 -4
  25. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
  26. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.d.ts +1 -2
  27. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.d.ts.map +1 -1
  28. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.js +7 -7
  29. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
  30. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.d.ts.map +1 -1
  31. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.js +0 -2
  32. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
  33. package/dist/3d-tiles/lib/parsers/parse-3d-tile-batched-model.d.ts.map +1 -1
  34. package/dist/3d-tiles/lib/parsers/parse-3d-tile-batched-model.js +1 -2
  35. package/dist/3d-tiles/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
  36. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js +13 -13
  37. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  38. package/dist/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.d.ts.map +1 -1
  39. package/dist/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.js +22 -23
  40. package/dist/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
  41. package/dist/3d-tiles/lib/utils/version.js +1 -1
  42. package/dist/3d-tiles/types.d.ts +7 -3
  43. package/dist/3d-tiles/types.d.ts.map +1 -1
  44. package/dist/3d-tiles-archive-writer.cjs +1 -1
  45. package/dist/copc/copc-loader.d.ts.map +1 -1
  46. package/dist/copc/copc-loader.js +10 -7
  47. package/dist/copc/copc-loader.js.map +1 -1
  48. package/dist/copc/copc-writer.d.ts +5 -4
  49. package/dist/copc/copc-writer.d.ts.map +1 -1
  50. package/dist/copc/copc-writer.js +1 -1
  51. package/dist/copc/copc-writer.js.map +1 -1
  52. package/dist/copc/index.cjs +809 -124
  53. package/dist/copc/index.cjs.map +3 -3
  54. package/dist/dist.dev.js +45 -77
  55. package/dist/dist.min.js +10 -10
  56. package/dist/i3s/arcgis-webscene-loader.js +1 -1
  57. package/dist/i3s/dist.dev.js +11915 -12119
  58. package/dist/i3s/dist.min.js +25 -25
  59. package/dist/i3s/i3s-attribute-loader.js +1 -1
  60. package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
  61. package/dist/i3s/i3s-content-loader.js +1 -1
  62. package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
  63. package/dist/i3s/i3s-loader.js +1 -1
  64. package/dist/i3s/i3s-mesh-attributes.d.ts +2 -2
  65. package/dist/i3s/i3s-mesh-attributes.d.ts.map +1 -1
  66. package/dist/i3s/i3s-mesh-attributes.js +6 -11
  67. package/dist/i3s/i3s-mesh-attributes.js.map +1 -1
  68. package/dist/i3s/i3s-mesh-writer.js +2 -3
  69. package/dist/i3s/i3s-mesh-writer.js.map +1 -1
  70. package/dist/i3s/i3s-node-page-loader.js +1 -1
  71. package/dist/i3s/i3s-slpk-loader.js +1 -1
  72. package/dist/i3s/i3s-slpk-writer.js +1 -1
  73. package/dist/i3s/index.cjs +314 -442
  74. package/dist/i3s/index.cjs.map +3 -3
  75. package/dist/i3s/lib/parsers/constants.d.ts +0 -3
  76. package/dist/i3s/lib/parsers/constants.d.ts.map +1 -1
  77. package/dist/i3s/lib/parsers/constants.js +0 -8
  78. package/dist/i3s/lib/parsers/constants.js.map +1 -1
  79. package/dist/i3s/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
  80. package/dist/i3s/lib/parsers/parse-i3s-tile-content.js +1 -2
  81. package/dist/i3s/lib/parsers/parse-i3s-tile-content.js.map +1 -1
  82. package/dist/i3s/types.d.ts +0 -1
  83. package/dist/i3s/types.d.ts.map +1 -1
  84. package/dist/i3s-content-worker-node.js +11 -11
  85. package/dist/i3s-content-worker-node.js.map +4 -4
  86. package/dist/i3s-content-worker.js +485 -879
  87. package/dist/i3s-lepcc-worker-node.js +2 -2
  88. package/dist/i3s-lepcc-worker.js +2 -2
  89. package/dist/i3s-mesh-writer.cjs +87 -206
  90. package/dist/i3s-mesh-writer.cjs.map +3 -3
  91. package/dist/i3s-slpk-writer.cjs +1 -1
  92. package/dist/index.cjs +44 -41
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/point-cloud-tile-loader-types.js +1 -1
  95. package/dist/point-cloud-tile-loader.cjs +17 -28
  96. package/dist/point-cloud-tile-loader.cjs.map +1 -1
  97. package/dist/point-cloud-tile-source.cjs +16 -27
  98. package/dist/point-cloud-tile-source.cjs.map +1 -1
  99. package/dist/point-cloud-tile-source.js +2 -2
  100. package/dist/point-cloud-tile-source.js.map +1 -1
  101. package/dist/potree/dist.dev.js +985 -139
  102. package/dist/potree/dist.min.js +28 -28
  103. package/dist/potree/index.cjs +813 -140
  104. package/dist/potree/index.cjs.map +3 -3
  105. package/dist/potree/lib/potree-node-source.d.ts.map +1 -1
  106. package/dist/potree/lib/potree-node-source.js +2 -14
  107. package/dist/potree/lib/potree-node-source.js.map +1 -1
  108. package/dist/potree/parsers/parse-potree-bin.js +3 -3
  109. package/dist/potree/parsers/parse-potree-bin.js.map +1 -1
  110. package/dist/potree/potree-bin-loader.js +1 -1
  111. package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
  112. package/dist/potree/potree-loader-types.js +1 -1
  113. package/dist/potree/potree-writer.d.ts +3 -3
  114. package/dist/potree/potree-writer.d.ts.map +1 -1
  115. package/dist/potree/potree-writer.js +2 -2
  116. package/dist/potree/potree-writer.js.map +1 -1
  117. package/dist/potree/potree2-source.d.ts +1 -1
  118. package/dist/potree/potree2-source.d.ts.map +1 -1
  119. package/dist/potree/potree2-source.js +6 -3
  120. package/dist/potree/potree2-source.js.map +1 -1
  121. package/dist/potree-loader.cjs +817 -153
  122. package/dist/potree-loader.cjs.map +3 -3
  123. package/dist/tileset-3d/helpers/frame-state.d.ts +2 -1
  124. package/dist/tileset-3d/helpers/frame-state.d.ts.map +1 -1
  125. package/dist/tileset-3d/helpers/frame-state.js +41 -15
  126. package/dist/tileset-3d/helpers/frame-state.js.map +1 -1
  127. package/dist/types.d.ts +15 -0
  128. package/dist/types.d.ts.map +1 -1
  129. package/package.json +13 -13
  130. package/src/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.ts +3 -4
  131. package/src/3d-tiles/lib/classes/helpers/tile-component-types.ts +39 -0
  132. package/src/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.ts +3 -4
  133. package/src/3d-tiles/lib/classes/tile-3d-feature-table.ts +38 -14
  134. package/src/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.ts +2 -5
  135. package/src/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.ts +10 -10
  136. package/src/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.ts +0 -2
  137. package/src/3d-tiles/lib/parsers/parse-3d-tile-batched-model.ts +1 -2
  138. package/src/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.ts +19 -19
  139. package/src/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.ts +22 -23
  140. package/src/3d-tiles/types.ts +4 -3
  141. package/src/copc/copc-loader.ts +8 -8
  142. package/src/copc/copc-writer.ts +6 -5
  143. package/src/i3s/i3s-mesh-attributes.ts +9 -17
  144. package/src/i3s/i3s-mesh-writer.ts +4 -3
  145. package/src/i3s/lib/parsers/constants.ts +0 -9
  146. package/src/i3s/lib/parsers/parse-i3s-tile-content.ts +1 -2
  147. package/src/i3s/types.ts +0 -1
  148. package/src/point-cloud-tile-source.ts +2 -2
  149. package/src/potree/lib/potree-node-source.ts +2 -15
  150. package/src/potree/parsers/parse-potree-bin.ts +3 -3
  151. package/src/potree/potree-writer.ts +6 -11
  152. package/src/potree/potree2-source.ts +6 -3
  153. package/src/tileset-3d/helpers/frame-state.ts +43 -15
  154. package/src/types.ts +15 -0
@@ -762,7 +762,7 @@
762
762
  "../core/src/loader-utils/lib/log-utils/log.ts"() {
763
763
  "use strict";
764
764
  init_log();
765
- VERSION2 = true ? "5.0.0-beta.10" : "latest";
765
+ VERSION2 = true ? "5.0.0-beta.11" : "latest";
766
766
  version = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
767
767
  log2 = createLog();
768
768
  NullLog = class {
@@ -844,7 +844,7 @@
844
844
 
845
845
  // ../core/src/worker-utils/lib/env-utils/version.ts
846
846
  function getVersion() {
847
- const version2 = false ? NPM_TAG : "5.0.0-beta.10";
847
+ const version2 = false ? NPM_TAG : "5.0.0-beta.11";
848
848
  globalThis._loadersgl_ = globalThis._loadersgl_ || {};
849
849
  globalThis._loadersgl_.version ||= version2;
850
850
  return version2;
@@ -4183,7 +4183,7 @@
4183
4183
  }
4184
4184
  return IDENTITY_MATRIX3;
4185
4185
  }
4186
- var INDICES, IDENTITY_MATRIX, Matrix3, ZERO_MATRIX3, IDENTITY_MATRIX3;
4186
+ var IDENTITY_MATRIX, Matrix3, ZERO_MATRIX3, IDENTITY_MATRIX3;
4187
4187
  var init_matrix3 = __esm({
4188
4188
  "../../node_modules/@math.gl/core/dist/classes/matrix3.js"() {
4189
4189
  init_matrix();
@@ -4192,17 +4192,6 @@
4192
4192
  init_mat3();
4193
4193
  init_vec2();
4194
4194
  init_vec3();
4195
- (function(INDICES3) {
4196
- INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
4197
- INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
4198
- INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
4199
- INDICES3[INDICES3["COL1ROW0"] = 3] = "COL1ROW0";
4200
- INDICES3[INDICES3["COL1ROW1"] = 4] = "COL1ROW1";
4201
- INDICES3[INDICES3["COL1ROW2"] = 5] = "COL1ROW2";
4202
- INDICES3[INDICES3["COL2ROW0"] = 6] = "COL2ROW0";
4203
- INDICES3[INDICES3["COL2ROW1"] = 7] = "COL2ROW1";
4204
- INDICES3[INDICES3["COL2ROW2"] = 8] = "COL2ROW2";
4205
- })(INDICES || (INDICES = {}));
4206
4195
  IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
4207
4196
  Matrix3 = class extends Matrix {
4208
4197
  static get IDENTITY() {
@@ -4217,9 +4206,6 @@
4217
4206
  get RANK() {
4218
4207
  return 3;
4219
4208
  }
4220
- get INDICES() {
4221
- return INDICES;
4222
- }
4223
4209
  constructor(array2) {
4224
4210
  super(-0, -0, -0, -0, -0, -0, -0, -0, -0);
4225
4211
  if (arguments.length === 1 && Array.isArray(array2)) {
@@ -5138,7 +5124,7 @@
5138
5124
  result[15] = 0;
5139
5125
  return result;
5140
5126
  }
5141
- var INDICES2, DEFAULT_FOVY, DEFAULT_ASPECT, DEFAULT_NEAR, DEFAULT_FAR, IDENTITY_MATRIX2, Matrix4, ZERO2, IDENTITY;
5127
+ var DEFAULT_FOVY, DEFAULT_ASPECT, DEFAULT_NEAR, DEFAULT_FAR, IDENTITY_MATRIX2, Matrix4, ZERO2, IDENTITY;
5142
5128
  var init_matrix4 = __esm({
5143
5129
  "../../node_modules/@math.gl/core/dist/classes/matrix4.js"() {
5144
5130
  init_matrix();
@@ -5149,24 +5135,6 @@
5149
5135
  init_vec2();
5150
5136
  init_vec3();
5151
5137
  init_vec4();
5152
- (function(INDICES3) {
5153
- INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
5154
- INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
5155
- INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
5156
- INDICES3[INDICES3["COL0ROW3"] = 3] = "COL0ROW3";
5157
- INDICES3[INDICES3["COL1ROW0"] = 4] = "COL1ROW0";
5158
- INDICES3[INDICES3["COL1ROW1"] = 5] = "COL1ROW1";
5159
- INDICES3[INDICES3["COL1ROW2"] = 6] = "COL1ROW2";
5160
- INDICES3[INDICES3["COL1ROW3"] = 7] = "COL1ROW3";
5161
- INDICES3[INDICES3["COL2ROW0"] = 8] = "COL2ROW0";
5162
- INDICES3[INDICES3["COL2ROW1"] = 9] = "COL2ROW1";
5163
- INDICES3[INDICES3["COL2ROW2"] = 10] = "COL2ROW2";
5164
- INDICES3[INDICES3["COL2ROW3"] = 11] = "COL2ROW3";
5165
- INDICES3[INDICES3["COL3ROW0"] = 12] = "COL3ROW0";
5166
- INDICES3[INDICES3["COL3ROW1"] = 13] = "COL3ROW1";
5167
- INDICES3[INDICES3["COL3ROW2"] = 14] = "COL3ROW2";
5168
- INDICES3[INDICES3["COL3ROW3"] = 15] = "COL3ROW3";
5169
- })(INDICES2 || (INDICES2 = {}));
5170
5138
  DEFAULT_FOVY = 45 * Math.PI / 180;
5171
5139
  DEFAULT_ASPECT = 1;
5172
5140
  DEFAULT_NEAR = 0.1;
@@ -5185,9 +5153,6 @@
5185
5153
  get RANK() {
5186
5154
  return 4;
5187
5155
  }
5188
- get INDICES() {
5189
- return INDICES2;
5190
- }
5191
5156
  constructor(array2) {
5192
5157
  super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);
5193
5158
  if (arguments.length === 1 && Array.isArray(array2)) {
@@ -8529,53 +8494,6 @@
8529
8494
  }
8530
8495
  });
8531
8496
 
8532
- // ../../node_modules/@math.gl/geometry/dist/utils/constants.js
8533
- var GL_PRIMITIVE_MODE, GL_TYPE, GL;
8534
- var init_constants2 = __esm({
8535
- "../../node_modules/@math.gl/geometry/dist/utils/constants.js"() {
8536
- GL_PRIMITIVE_MODE = {
8537
- POINTS: 0,
8538
- LINES: 1,
8539
- LINE_LOOP: 2,
8540
- LINE_STRIP: 3,
8541
- TRIANGLES: 4,
8542
- TRIANGLE_STRIP: 5,
8543
- TRIANGLE_FAN: 6
8544
- };
8545
- GL_TYPE = {
8546
- BYTE: 5120,
8547
- UNSIGNED_BYTE: 5121,
8548
- SHORT: 5122,
8549
- UNSIGNED_SHORT: 5123,
8550
- INT: 5124,
8551
- UNSIGNED_INT: 5125,
8552
- FLOAT: 5126,
8553
- DOUBLE: 5130,
8554
- UNSIGNED_SHORT_4_4_4_4: 32819,
8555
- UNSIGNED_SHORT_5_5_5_1: 32820,
8556
- UNSIGNED_SHORT_5_6_5: 33635
8557
- };
8558
- GL = {
8559
- ...GL_PRIMITIVE_MODE,
8560
- ...GL_TYPE
8561
- };
8562
- }
8563
- });
8564
-
8565
- // ../../node_modules/@math.gl/geometry/dist/utils/index.js
8566
- var init_utils = __esm({
8567
- "../../node_modules/@math.gl/geometry/dist/utils/index.js"() {
8568
- init_constants2();
8569
- }
8570
- });
8571
-
8572
- // ../../node_modules/@math.gl/geometry/dist/index.js
8573
- var init_dist3 = __esm({
8574
- "../../node_modules/@math.gl/geometry/dist/index.js"() {
8575
- init_utils();
8576
- }
8577
- });
8578
-
8579
8497
  // ../../node_modules/@math.gl/geospatial/dist/globe.js
8580
8498
  var init_globe = __esm({
8581
8499
  "../../node_modules/@math.gl/geospatial/dist/globe.js"() {
@@ -9308,7 +9226,7 @@
9308
9226
 
9309
9227
  // ../../node_modules/@math.gl/geospatial/dist/projection/experimental/common/constants.js
9310
9228
  var EPSLN, HALF_PI, FORTPI, TWO_PI2, SPI, D2R, R2D, SEC_TO_RAD;
9311
- var init_constants3 = __esm({
9229
+ var init_constants2 = __esm({
9312
9230
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/common/constants.js"() {
9313
9231
  EPSLN = 1e-10;
9314
9232
  HALF_PI = Math.PI / 2;
@@ -9339,7 +9257,7 @@
9339
9257
  }
9340
9258
  var init_adjust_lon = __esm({
9341
9259
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/common/adjust_lon.js"() {
9342
- init_constants3();
9260
+ init_constants2();
9343
9261
  init_sign();
9344
9262
  }
9345
9263
  });
@@ -9536,7 +9454,7 @@
9536
9454
  var init_pj_inv_mlfn = __esm({
9537
9455
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/common/pj_inv_mlfn.js"() {
9538
9456
  init_pj_mlfn();
9539
- init_constants3();
9457
+ init_constants2();
9540
9458
  MAX_ITER = 20;
9541
9459
  }
9542
9460
  });
@@ -9661,7 +9579,7 @@
9661
9579
  init_pj_mlfn();
9662
9580
  init_pj_inv_mlfn();
9663
9581
  init_adjust_lon();
9664
- init_constants3();
9582
+ init_constants2();
9665
9583
  init_sign();
9666
9584
  }
9667
9585
  });
@@ -10084,7 +10002,7 @@
10084
10002
  }
10085
10003
  var init_phi2z = __esm({
10086
10004
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/common/phi2z.js"() {
10087
- init_constants3();
10005
+ init_constants2();
10088
10006
  }
10089
10007
  });
10090
10008
 
@@ -10242,7 +10160,7 @@
10242
10160
  var init_stere = __esm({
10243
10161
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/kernels/stere.js"() {
10244
10162
  init_inverse_spherical_latitude();
10245
- init_constants3();
10163
+ init_constants2();
10246
10164
  init_sign();
10247
10165
  init_msfnz();
10248
10166
  init_tsfnz();
@@ -10279,7 +10197,7 @@
10279
10197
  });
10280
10198
 
10281
10199
  // ../../node_modules/@math.gl/geospatial/dist/index.js
10282
- var init_dist4 = __esm({
10200
+ var init_dist3 = __esm({
10283
10201
  "../../node_modules/@math.gl/geospatial/dist/index.js"() {
10284
10202
  init_ellipsoid2();
10285
10203
  init_globe();
@@ -10510,7 +10428,7 @@
10510
10428
  var init_version2 = __esm({
10511
10429
  "../images/src/lib/utils/version.ts"() {
10512
10430
  "use strict";
10513
- VERSION4 = true ? "5.0.0-beta.10" : "latest";
10431
+ VERSION4 = true ? "5.0.0-beta.11" : "latest";
10514
10432
  }
10515
10433
  });
10516
10434
 
@@ -12533,6 +12451,72 @@
12533
12451
  }
12534
12452
  });
12535
12453
 
12454
+ // ../core/src/schema-utils/lib/schema/data-type.ts
12455
+ function getDataTypeFromValue(value2, defaultNumberType = "float32") {
12456
+ if (value2 instanceof Date) {
12457
+ return "date-millisecond";
12458
+ }
12459
+ if (typeof value2 === "number") {
12460
+ return defaultNumberType;
12461
+ }
12462
+ if (typeof value2 === "boolean") {
12463
+ return "bool";
12464
+ }
12465
+ if (typeof value2 === "string") {
12466
+ return "utf8";
12467
+ }
12468
+ if (value2 === null || value2 === "undefined") {
12469
+ return "null";
12470
+ }
12471
+ return "null";
12472
+ }
12473
+ function getDataTypeFromArray(array2) {
12474
+ let type = getDataTypeFromTypedArray(array2);
12475
+ if (type !== "null") {
12476
+ return { type, nullable: false };
12477
+ }
12478
+ if (array2.length > 0) {
12479
+ type = getDataTypeFromValue(array2[0]);
12480
+ return { type, nullable: true };
12481
+ }
12482
+ return { type: "null", nullable: true };
12483
+ }
12484
+ function getDataTypeFromTypedArray(array2) {
12485
+ if (typeof Float16Array !== "undefined" && array2 instanceof Float16Array) {
12486
+ return "float16";
12487
+ }
12488
+ switch (array2.constructor) {
12489
+ case Int8Array:
12490
+ return "int8";
12491
+ case Uint8Array:
12492
+ case Uint8ClampedArray:
12493
+ return "uint8";
12494
+ case Int16Array:
12495
+ return "int16";
12496
+ case Uint16Array:
12497
+ return "uint16";
12498
+ case Int32Array:
12499
+ return "int32";
12500
+ case Uint32Array:
12501
+ return "uint32";
12502
+ case BigInt64Array:
12503
+ return "int64";
12504
+ case BigUint64Array:
12505
+ return "uint64";
12506
+ case Float32Array:
12507
+ return "float32";
12508
+ case Float64Array:
12509
+ return "float64";
12510
+ default:
12511
+ return "null";
12512
+ }
12513
+ }
12514
+ var init_data_type = __esm({
12515
+ "../core/src/schema-utils/lib/schema/data-type.ts"() {
12516
+ "use strict";
12517
+ }
12518
+ });
12519
+
12536
12520
  // ../../node_modules/tslib/tslib.es6.mjs
12537
12521
  function __rest(s, e) {
12538
12522
  var t = {};
@@ -13283,7 +13267,7 @@
13283
13267
 
13284
13268
  // ../../node_modules/flatbuffers/mjs/constants.js
13285
13269
  var SIZEOF_SHORT, SIZEOF_INT, FILE_IDENTIFIER_LENGTH, SIZE_PREFIX_LENGTH;
13286
- var init_constants4 = __esm({
13270
+ var init_constants3 = __esm({
13287
13271
  "../../node_modules/flatbuffers/mjs/constants.js"() {
13288
13272
  SIZEOF_SHORT = 2;
13289
13273
  SIZEOF_INT = 4;
@@ -13294,7 +13278,7 @@
13294
13278
 
13295
13279
  // ../../node_modules/flatbuffers/mjs/utils.js
13296
13280
  var int32, float32, float64, isLittleEndian;
13297
- var init_utils2 = __esm({
13281
+ var init_utils = __esm({
13298
13282
  "../../node_modules/flatbuffers/mjs/utils.js"() {
13299
13283
  int32 = new Int32Array(2);
13300
13284
  float32 = new Float32Array(int32.buffer);
@@ -13318,9 +13302,9 @@
13318
13302
  var ByteBuffer;
13319
13303
  var init_byte_buffer = __esm({
13320
13304
  "../../node_modules/flatbuffers/mjs/byte-buffer.js"() {
13321
- init_constants4();
13305
+ init_constants3();
13322
13306
  init_encoding();
13323
- init_utils2();
13307
+ init_utils();
13324
13308
  ByteBuffer = class _ByteBuffer {
13325
13309
  /**
13326
13310
  * Create a new ByteBuffer with a given array of bytes (`Uint8Array`)
@@ -13571,7 +13555,7 @@
13571
13555
  var init_builder = __esm({
13572
13556
  "../../node_modules/flatbuffers/mjs/builder.js"() {
13573
13557
  init_byte_buffer();
13574
- init_constants4();
13558
+ init_constants3();
13575
13559
  Builder = class _Builder {
13576
13560
  /**
13577
13561
  * Create a FlatBufferBuilder.
@@ -14073,8 +14057,8 @@
14073
14057
  // ../../node_modules/flatbuffers/mjs/flatbuffers.js
14074
14058
  var init_flatbuffers = __esm({
14075
14059
  "../../node_modules/flatbuffers/mjs/flatbuffers.js"() {
14076
- init_constants4();
14077
- init_utils2();
14060
+ init_constants3();
14061
+ init_utils();
14078
14062
  init_builder();
14079
14063
  init_byte_buffer();
14080
14064
  init_encoding();
@@ -25193,7 +25177,7 @@ return true;`);
25193
25177
 
25194
25178
  // ../../node_modules/apache-arrow/ipc/compression/constants.mjs
25195
25179
  var LENGTH_NO_COMPRESSED_DATA, COMPRESS_LENGTH_PREFIX;
25196
- var init_constants5 = __esm({
25180
+ var init_constants4 = __esm({
25197
25181
  "../../node_modules/apache-arrow/ipc/compression/constants.mjs"() {
25198
25182
  LENGTH_NO_COMPRESSED_DATA = -1;
25199
25183
  COMPRESS_LENGTH_PREFIX = 8;
@@ -25278,7 +25262,7 @@ return true;`);
25278
25262
  init_registry();
25279
25263
  init_bigint();
25280
25264
  init_flatbuffers();
25281
- init_constants5();
25265
+ init_constants4();
25282
25266
  RecordBatchReader = class _RecordBatchReader extends ReadableInterop {
25283
25267
  constructor(impl) {
25284
25268
  super();
@@ -26446,7 +26430,7 @@ return true;`);
26446
26430
  init_compat();
26447
26431
  init_compression_type();
26448
26432
  init_registry();
26449
- init_constants5();
26433
+ init_constants4();
26450
26434
  init_flatbuffers();
26451
26435
  RecordBatchWriter = class extends ReadableInterop {
26452
26436
  /** @nocollapse */
@@ -27433,504 +27417,10 @@ return true;`);
27433
27417
  }
27434
27418
  });
27435
27419
 
27436
- // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-helpers.js
27437
- var init_indexed_arrow_helpers = __esm({
27438
- "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-helpers.js"() {
27439
- }
27440
- });
27441
-
27442
- // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-schema-utils.js
27443
- var init_arrow_schema_utils = __esm({
27444
- "../../node_modules/@math.gl/arrow/dist/arrow/arrow-schema-utils.js"() {
27445
- }
27446
- });
27447
-
27448
- // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js
27449
- function getArrowVariadicBuffers(data) {
27450
- return data.variadicBuffers ?? [];
27451
- }
27452
- function createArrowData(type, offset2, length4, nullCount, buffers, children2, dictionary, variadicBuffers) {
27453
- return Reflect.construct(Data, [
27454
- type,
27455
- offset2,
27456
- length4,
27457
- nullCount,
27458
- buffers,
27459
- children2,
27460
- dictionary,
27461
- variadicBuffers
27462
- ]);
27463
- }
27464
- var init_arrow_data = __esm({
27465
- "../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js"() {
27466
- init_Arrow_dom();
27467
- }
27468
- });
27469
-
27470
- // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-record-batch.js
27471
- function getRecordBatchMetadata(batch) {
27472
- return batch.metadata;
27473
- }
27474
- function createRecordBatchWithMetadata(schema, data, metadata) {
27475
- if ("metadata" in RecordBatch3.prototype) {
27476
- const MetadataRecordBatch = RecordBatch3;
27477
- return Object.assign(new MetadataRecordBatch(schema, data, metadata), { data });
27478
- }
27479
- const batch = Object.assign(new RecordBatch3(schema, data), { data });
27480
- return metadata === void 0 ? batch : Object.assign(batch, { metadata });
27481
- }
27482
- var init_arrow_record_batch = __esm({
27483
- "../../node_modules/@math.gl/arrow/dist/arrow/arrow-record-batch.js"() {
27484
- init_Arrow_dom();
27485
- }
27486
- });
27487
-
27488
- // ../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js
27489
- function splitArrowBuffers(input, options = {}) {
27490
- const retainedBuffers = /* @__PURE__ */ new Set();
27491
- const visited = /* @__PURE__ */ new Set();
27492
- for (const retained of options.retain ?? []) {
27493
- const chunks = isArrowTable2(retained) ? retained.batches.map((batch) => batch.data) : isArrowVector2(retained) ? retained.data : [isArrowRecordBatch2(retained) ? retained.data : retained];
27494
- for (const data of chunks)
27495
- collectArrowBuffers(data, retainedBuffers, visited);
27496
- }
27497
- const context = { ...options, copies: /* @__PURE__ */ new WeakMap(), retainedBuffers };
27498
- if (isArrowTable2(input)) {
27499
- return splitArrowTableBuffersInternal(input, context);
27500
- }
27501
- if (isArrowRecordBatch2(input)) {
27502
- return splitArrowRecordBatchBuffers(input, context);
27503
- }
27504
- if (isArrowVector2(input)) {
27505
- return splitArrowVectorBuffers(input, context);
27506
- }
27507
- return splitArrowDataBuffers(input, context);
27508
- }
27509
- function isArrowTable2(input) {
27510
- return "batches" in input;
27511
- }
27512
- function isArrowRecordBatch2(input) {
27513
- return "schema" in input && "data" in input && !Array.isArray(input.data);
27514
- }
27515
- function isArrowVector2(input) {
27516
- return "data" in input && Array.isArray(input.data);
27517
- }
27518
- function splitArrowTableBuffersInternal(arrowTable, options) {
27519
- const recordBatches = arrowTable.batches.map((recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options));
27520
- return new Table(arrowTable.schema, recordBatches);
27521
- }
27522
- function splitArrowRecordBatchBuffers(recordBatch, options) {
27523
- const data = splitArrowDataBuffers(recordBatch.data, options);
27524
- return createRecordBatchWithMetadata(recordBatch.schema, data, getRecordBatchMetadata(recordBatch));
27525
- }
27526
- function splitArrowDataBuffers(data, options) {
27527
- const children2 = data.children.map((childData) => splitArrowDataBuffers(childData, options));
27528
- const dictionary = data.dictionary ? splitArrowVectorBuffers(data.dictionary, options) : void 0;
27529
- const buffers = {
27530
- [BufferType.OFFSET]: splitArrowBuffer(data.buffers[BufferType.OFFSET], options),
27531
- [BufferType.DATA]: splitArrowBuffer(data.buffers[BufferType.DATA], options),
27532
- [BufferType.VALIDITY]: splitArrowBuffer(data.buffers[BufferType.VALIDITY], options),
27533
- [BufferType.TYPE]: splitArrowBuffer(data.buffers[BufferType.TYPE], options)
27534
- };
27535
- return createArrowData(
27536
- data.type,
27537
- data.offset,
27538
- data.length,
27539
- // @ts-expect-error _nullCount is protected. Reuse it to preserve lazy null-count state.
27540
- data._nullCount,
27541
- buffers,
27542
- children2,
27543
- dictionary,
27544
- getArrowVariadicBuffers(data).map((buffer) => splitArrowBuffer(buffer, options))
27545
- );
27546
- }
27547
- function splitArrowVectorBuffers(vector, options) {
27548
- return new Vector2(vector.data.map((data) => splitArrowDataBuffers(data, options)));
27549
- }
27550
- function collectArrowBuffers(data, buffers, visited) {
27551
- if (visited.has(data))
27552
- return;
27553
- visited.add(data);
27554
- for (const view of [...Object.values(data.buffers), ...getArrowVariadicBuffers(data)]) {
27555
- if (isArrowTypedArray(view))
27556
- buffers.add(view.buffer);
27557
- }
27558
- for (const child2 of data.children)
27559
- collectArrowBuffers(child2, buffers, visited);
27560
- for (const chunk of data.dictionary?.data ?? [])
27561
- collectArrowBuffers(chunk, buffers, visited);
27562
- }
27563
- function splitArrowBuffer(array2, options) {
27564
- if (!isArrowTypedArray(array2)) {
27565
- return array2;
27566
- }
27567
- const sliced = array2.byteOffset !== 0 || array2.byteLength !== array2.buffer.byteLength;
27568
- if (!options.retainedBuffers.has(array2.buffer) && options.copy !== "all" && (options.copy === "none" || !sliced)) {
27569
- return array2;
27570
- }
27571
- let copy2 = options.copies.get(array2);
27572
- if (!copy2) {
27573
- copy2 = array2 instanceof Uint8Array ? new Uint8Array(array2) : array2.slice();
27574
- options.copies.set(array2, copy2);
27575
- }
27576
- return copy2;
27577
- }
27578
- function isArrowTypedArray(value2) {
27579
- return ArrayBuffer.isView(value2) && !(value2 instanceof DataView);
27580
- }
27581
- var init_split_arrow_buffers = __esm({
27582
- "../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js"() {
27583
- init_Arrow_dom();
27584
- init_arrow_record_batch();
27585
- init_arrow_data();
27586
- }
27587
- });
27588
-
27589
- // ../../node_modules/@math.gl/arrow/dist/arrow/take-arrow-rows.js
27590
- var init_take_arrow_rows = __esm({
27591
- "../../node_modules/@math.gl/arrow/dist/arrow/take-arrow-rows.js"() {
27592
- init_arrow_data();
27593
- init_split_arrow_buffers();
27594
- }
27595
- });
27596
-
27597
- // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js
27598
- var init_indexed_arrow_vector = __esm({
27599
- "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js"() {
27600
- init_indexed_arrow_helpers();
27601
- }
27602
- });
27603
-
27604
- // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js
27605
- var init_indexed_arrow_table = __esm({
27606
- "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js"() {
27607
- init_indexed_arrow_helpers();
27608
- init_arrow_schema_utils();
27609
- init_take_arrow_rows();
27610
- init_indexed_arrow_vector();
27611
- }
27612
- });
27613
-
27614
- // ../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js
27615
- var init_mapped_arrow_table = __esm({
27616
- "../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js"() {
27617
- init_indexed_arrow_helpers();
27618
- init_indexed_arrow_table();
27619
- }
27620
- });
27621
-
27622
- // ../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js
27623
- var init_rename_arrow_columns = __esm({
27624
- "../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js"() {
27625
- init_arrow_schema_utils();
27626
- }
27627
- });
27628
-
27629
- // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js
27630
- function dehydrateArrowTable(arrowTable, options) {
27631
- const splitTable = splitArrowBuffers(arrowTable, options);
27632
- return {
27633
- transport: "arrow-js",
27634
- version: 1,
27635
- schema: tableToIPC(new Table(splitTable.schema, [])),
27636
- metadataVersion: splitTable.schema.metadataVersion,
27637
- batches: splitTable.batches.map((batch) => {
27638
- const metadata = getRecordBatchMetadata(batch);
27639
- return {
27640
- ...dehydrateArrowData(batch.data),
27641
- ...metadata !== void 0 ? { metadata: [...metadata] } : {}
27642
- };
27643
- })
27644
- };
27645
- }
27646
- function hydrateArrowTable(table) {
27647
- if (table.transport !== "arrow-js" || table.version !== 1) {
27648
- throw new Error("Unsupported Arrow column-buffer transport protocol.");
27649
- }
27650
- const decodedSchema = tableFromIPC(table.schema).schema;
27651
- const schema = new Schema2(decodedSchema.fields, decodedSchema.metadata, decodedSchema.dictionaries, table.metadataVersion);
27652
- const type = new Struct(schema.fields);
27653
- const batches = table.batches.map((payload) => {
27654
- const data = hydrateArrowData(payload, type);
27655
- return createRecordBatchWithMetadata(schema, data, payload.metadata && new Map(payload.metadata));
27656
- });
27657
- return new Table(schema, batches);
27658
- }
27659
- function dehydrateArrowData(data) {
27660
- return {
27661
- offset: data.offset,
27662
- length: data.length,
27663
- nullCount: data.nullCount,
27664
- buffers: {
27665
- [BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
27666
- [BufferType.DATA]: data.buffers[BufferType.DATA],
27667
- [BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
27668
- [BufferType.TYPE]: data.buffers[BufferType.TYPE]
27669
- },
27670
- children: data.children.map((child2) => dehydrateArrowData(child2)),
27671
- variadicBuffers: getArrowVariadicBuffers(data),
27672
- dictionary: data.dictionary?.data.map((chunk) => dehydrateArrowData(chunk))
27673
- };
27674
- }
27675
- function hydrateArrowData(data, type) {
27676
- const children2 = data.children.map((child2, index) => hydrateArrowData(child2, type.children[index].type));
27677
- const dictionary = data.dictionary && DataType.isDictionary(type) ? new Vector2(data.dictionary.map((chunk) => hydrateArrowData(chunk, type.dictionary))) : void 0;
27678
- return createArrowData(type, data.offset, data.length, data.nullCount, data.buffers, children2, dictionary, data.variadicBuffers);
27679
- }
27680
- function dehydrateArrowRecordBatch(batch, options) {
27681
- return dehydrateArrowTable(new Table(batch.schema, [batch]), options);
27682
- }
27683
- function hydrateArrowRecordBatch(payload) {
27684
- if (payload.batches.length !== 1) {
27685
- throw new Error("Arrow record batch transport requires exactly one batch.");
27686
- }
27687
- return hydrateArrowTable(payload).batches[0];
27688
- }
27689
- var init_arrow_table_transport = __esm({
27690
- "../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js"() {
27691
- init_Arrow_dom();
27692
- init_arrow_record_batch();
27693
- init_arrow_data();
27694
- init_split_arrow_buffers();
27695
- }
27696
- });
27697
-
27698
- // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js
27699
- var init_arrow_column_utils = __esm({
27700
- "../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js"() {
27701
- }
27702
- });
27703
-
27704
- // ../../node_modules/@math.gl/arrow/dist/arrow/index.js
27705
- var init_arrow = __esm({
27706
- "../../node_modules/@math.gl/arrow/dist/arrow/index.js"() {
27707
- init_indexed_arrow_table();
27708
- init_indexed_arrow_vector();
27709
- init_mapped_arrow_table();
27710
- init_arrow_schema_utils();
27711
- init_rename_arrow_columns();
27712
- init_split_arrow_buffers();
27713
- init_arrow_table_transport();
27714
- init_arrow_column_utils();
27715
- init_take_arrow_rows();
27716
- init_arrow_record_batch();
27717
- }
27718
- });
27719
-
27720
- // ../../node_modules/@math.gl/arrow/dist/index.js
27721
- var init_dist5 = __esm({
27722
- "../../node_modules/@math.gl/arrow/dist/index.js"() {
27723
- init_arrow();
27724
- }
27725
- });
27726
-
27727
- // ../core/src/arrow-worker-transport.ts
27728
- function deserializeArrowWorkerTable(result) {
27729
- if (isArrowWorkerEnvelope(result)) {
27730
- return { ...result.metadata, shape: "arrow-table", data: hydrateWorkerTable(result) };
27731
- }
27732
- if (isLegacyArrowWorkerEnvelope(result)) {
27733
- const { arrowBatchMetadata: _snapshots, data: _columns, ...metadata } = result;
27734
- return { ...metadata, data: hydrateWorkerTable(result) };
27735
- }
27736
- throw new Error("Workers require Arrow column transport");
27737
- }
27738
- function serializeNativeArrowWorkerResult(result, options = { copy: "all" }) {
27739
- const batch = result instanceof RecordBatch3;
27740
- if (!batch && !(result instanceof Table)) {
27741
- throw new Error("Workers require Arrow table output");
27742
- }
27743
- return {
27744
- transport: batch ? "arrow-record-batch" : "arrow-table-columns",
27745
- columns: batch ? { data: dehydrateArrowRecordBatch(result, options) } : serializeWorkerColumns(result, options)
27746
- };
27747
- }
27748
- function deserializeNativeArrowWorkerResult(result) {
27749
- const payload = result;
27750
- if (payload?.transport !== "arrow-table-columns" && payload?.transport !== "arrow-record-batch" || !hasArrowWorkerColumns(payload.columns)) {
27751
- throw new Error("Workers require Arrow column transport");
27752
- }
27753
- if (payload.transport === "arrow-record-batch" && !payload.columns.arrowBatchMetadata) {
27754
- return hydrateArrowRecordBatch(payload.columns.data);
27755
- }
27756
- const data = hydrateWorkerTable(payload.columns);
27757
- return payload.transport === "arrow-record-batch" ? data.batches[0] : data;
27758
- }
27759
- function serializeArrowWorkerResult(result, options) {
27760
- const workerOptions = options;
27761
- const bufferCopyMode = workerOptions?.core?.workerTransferBufferCopy ?? workerOptions?.workerTransferBufferCopy;
27762
- if (result instanceof Table || result instanceof RecordBatch3) {
27763
- return serializeNativeArrowWorkerResult(result, { copy: bufferCopyMode ?? "all" });
27764
- }
27765
- if (!isArrowTableWrapper(result)) {
27766
- return result;
27767
- }
27768
- const { data, shape: _shape, ...metadata } = result;
27769
- return {
27770
- transport: "arrow-column-envelope",
27771
- metadata: structuredClone(metadata),
27772
- ...serializeWorkerColumns(data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
27773
- };
27774
- }
27775
- function deserializeArrowWorkerResult(result) {
27776
- const transport = result?.transport;
27777
- if (transport === "arrow-table-columns" || transport === "arrow-record-batch") {
27778
- return deserializeNativeArrowWorkerResult(result);
27779
- }
27780
- return isArrowWorkerEnvelope(result) || isLegacyArrowWorkerEnvelope(result) ? deserializeArrowWorkerTable(result) : result;
27781
- }
27782
- function isArrowTableWrapper(value2) {
27783
- const table = value2;
27784
- return Boolean(
27785
- table && table.shape === "arrow-table" && table.data && typeof table.data === "object" && "batches" in table.data
27786
- );
27787
- }
27788
- function hasArrowWorkerColumns(value2) {
27789
- const columns = value2;
27790
- return columns?.data?.transport === "arrow-js" && Array.isArray(columns.data.batches);
27791
- }
27792
- function isArrowWorkerEnvelope(value2) {
27793
- return value2?.transport === "arrow-column-envelope" && hasArrowWorkerColumns(value2);
27794
- }
27795
- function isLegacyArrowWorkerEnvelope(value2) {
27796
- return value2?.shape === "arrow-table" && hasArrowWorkerColumns(value2);
27797
- }
27798
- function serializeWorkerColumns(table, options) {
27799
- return {
27800
- arrowBatchMetadata: snapshotBatchMetadata(table),
27801
- data: dehydrateWorkerTable(table, options)
27802
- };
27803
- }
27804
- function dehydrateWorkerTable(table, options) {
27805
- const payload = dehydrateArrowTable(table, options);
27806
- if (table.numCols === 0) {
27807
- for (const [index, batch] of table.batches.entries()) {
27808
- payload.batches[index].length = batch.numRows;
27809
- }
27810
- }
27811
- return payload;
27812
- }
27813
- function snapshotBatchMetadata(table) {
27814
- return table.batches.map((batch) => ({
27815
- schema: tableToIPC(new Table(batch.schema, [])),
27816
- metadata: Array.from(batch.metadata)
27817
- }));
27818
- }
27819
- function hydrateWorkerTable(result) {
27820
- const { arrowBatchMetadata, data } = result;
27821
- const table = hydrateArrowTable(data);
27822
- const batches = table.batches.map((batch, index) => {
27823
- const snapshot = arrowBatchMetadata?.[index];
27824
- const restored = snapshot ? new RecordBatch3(
27825
- tableFromIPC(snapshot.schema).schema,
27826
- batch.data,
27827
- new Map(snapshot.metadata)
27828
- ) : batch;
27829
- const rowCount = data.batches[index].length;
27830
- if (restored.numCols === 0 && restored.numRows !== rowCount) {
27831
- Object.defineProperty(restored, "data", {
27832
- value: new Data(new Struct([]), 0, rowCount, 0, void 0, [])
27833
- });
27834
- }
27835
- return restored;
27836
- });
27837
- return new Table(table.schema, batches);
27838
- }
27839
- var init_arrow_worker_transport = __esm({
27840
- "../core/src/arrow-worker-transport.ts"() {
27841
- "use strict";
27842
- init_Arrow_dom();
27843
- init_dist5();
27844
- }
27845
- });
27846
-
27847
- // ../core/src/schema-utils/lib/schema/data-type.ts
27848
- function getDataTypeFromValue(value2, defaultNumberType = "float32") {
27849
- if (value2 instanceof Date) {
27850
- return "date-millisecond";
27851
- }
27852
- if (typeof value2 === "number") {
27853
- return defaultNumberType;
27854
- }
27855
- if (typeof value2 === "boolean") {
27856
- return "bool";
27857
- }
27858
- if (typeof value2 === "string") {
27859
- return "utf8";
27860
- }
27861
- if (value2 === null || value2 === "undefined") {
27862
- return "null";
27863
- }
27864
- return "null";
27865
- }
27866
- function getDataTypeFromArray(array2) {
27867
- let type = getDataTypeFromTypedArray(array2);
27868
- if (type !== "null") {
27869
- return { type, nullable: false };
27870
- }
27871
- if (array2.length > 0) {
27872
- type = getDataTypeFromValue(array2[0]);
27873
- return { type, nullable: true };
27874
- }
27875
- return { type: "null", nullable: true };
27876
- }
27877
- function getDataTypeFromTypedArray(array2) {
27878
- if (typeof Float16Array !== "undefined" && array2 instanceof Float16Array) {
27879
- return "float16";
27880
- }
27881
- switch (array2.constructor) {
27882
- case Int8Array:
27883
- return "int8";
27884
- case Uint8Array:
27885
- case Uint8ClampedArray:
27886
- return "uint8";
27887
- case Int16Array:
27888
- return "int16";
27889
- case Uint16Array:
27890
- return "uint16";
27891
- case Int32Array:
27892
- return "int32";
27893
- case Uint32Array:
27894
- return "uint32";
27895
- case BigInt64Array:
27896
- return "int64";
27897
- case BigUint64Array:
27898
- return "uint64";
27899
- case Float32Array:
27900
- return "float32";
27901
- case Float64Array:
27902
- return "float64";
27903
- default:
27904
- return "null";
27905
- }
27906
- }
27907
- var init_data_type = __esm({
27908
- "../core/src/schema-utils/lib/schema/data-type.ts"() {
27909
- "use strict";
27910
- }
27911
- });
27912
-
27913
27420
  // ../core/src/schema-utils/lib/schema/convert-arrow-schema.ts
27914
- function serializeArrowSchema(arrowSchema) {
27915
- return {
27916
- fields: arrowSchema.fields.map((arrowField) => serializeArrowField(arrowField)),
27917
- metadata: serializeArrowMetadata(arrowSchema.metadata)
27918
- };
27919
- }
27920
- function serializeArrowMetadata(arrowMetadata) {
27921
- return Object.fromEntries(arrowMetadata);
27922
- }
27923
27421
  function deserializeArrowMetadata(metadata) {
27924
27422
  return metadata ? new Map(Object.entries(metadata)) : /* @__PURE__ */ new Map();
27925
27423
  }
27926
- function serializeArrowField(field) {
27927
- return {
27928
- name: field.name,
27929
- type: serializeArrowType(field.type),
27930
- nullable: field.nullable,
27931
- metadata: serializeArrowMetadata(field.metadata)
27932
- };
27933
- }
27934
27424
  function deserializeArrowField(field, options) {
27935
27425
  return new Field2(
27936
27426
  field.name,
@@ -27939,193 +27429,6 @@ return true;`);
27939
27429
  deserializeArrowMetadata(field.metadata)
27940
27430
  );
27941
27431
  }
27942
- function serializeArrowType(arrowType) {
27943
- if (isArrowViewType(arrowType, "BinaryView")) {
27944
- return "binary-view";
27945
- }
27946
- if (isArrowViewType(arrowType, "Utf8View")) {
27947
- return "utf8-view";
27948
- }
27949
- if (isOptionalArrowType(arrowType, "LargeList")) {
27950
- const largeListType = arrowType;
27951
- return {
27952
- type: "large-list",
27953
- children: [serializeArrowField(largeListType.valueField)]
27954
- };
27955
- }
27956
- switch (arrowType.constructor) {
27957
- case Null2:
27958
- return "null";
27959
- case Binary2:
27960
- return "binary";
27961
- case FixedSizeBinary2:
27962
- return {
27963
- type: "fixed-size-binary",
27964
- byteWidth: arrowType.byteWidth
27965
- };
27966
- case Bool2:
27967
- return "bool";
27968
- case Int_:
27969
- const intType = arrowType;
27970
- return `${intType.isSigned ? "" : "u"}int${intType.bitWidth}`;
27971
- case Int8:
27972
- return "int8";
27973
- case Int16:
27974
- return "int16";
27975
- case Int32:
27976
- return "int32";
27977
- case Int64:
27978
- return "int64";
27979
- case Uint8:
27980
- return "uint8";
27981
- case Uint16:
27982
- return "uint16";
27983
- case Uint32:
27984
- return "uint32";
27985
- case Uint64:
27986
- return "uint64";
27987
- case Float:
27988
- const precision = arrowType.precision;
27989
- switch (precision) {
27990
- case Precision.HALF:
27991
- return "float16";
27992
- case Precision.SINGLE:
27993
- return "float32";
27994
- case Precision.DOUBLE:
27995
- return "float64";
27996
- default:
27997
- return "float16";
27998
- }
27999
- case Float16:
28000
- return "float16";
28001
- case Float32:
28002
- return "float32";
28003
- case Float64:
28004
- return "float64";
28005
- case Utf82:
28006
- return "utf8";
28007
- case Decimal2:
28008
- const decimal = arrowType;
28009
- return {
28010
- type: "decimal",
28011
- bitWidth: decimal.bitWidth,
28012
- precision: decimal.precision,
28013
- scale: decimal.scale
28014
- };
28015
- case Date_:
28016
- const dateUnit = arrowType.unit;
28017
- return dateUnit === DateUnit.DAY ? "date-day" : "date-millisecond";
28018
- case DateDay:
28019
- return "date-day";
28020
- case DateMillisecond:
28021
- return "date-millisecond";
28022
- case Time_:
28023
- const timeUnit = arrowType.unit;
28024
- switch (timeUnit) {
28025
- case TimeUnit.SECOND:
28026
- return "time-second";
28027
- case TimeUnit.MILLISECOND:
28028
- return "time-millisecond";
28029
- case TimeUnit.MICROSECOND:
28030
- return "time-microsecond";
28031
- case TimeUnit.NANOSECOND:
28032
- return "time-nanosecond";
28033
- default:
28034
- return "time-second";
28035
- }
28036
- case TimeMillisecond:
28037
- return "time-millisecond";
28038
- case TimeSecond:
28039
- return "time-second";
28040
- case TimeMicrosecond:
28041
- return "time-microsecond";
28042
- case TimeNanosecond:
28043
- return "time-nanosecond";
28044
- case Timestamp_:
28045
- const timeStampUnit = arrowType.unit;
28046
- switch (timeStampUnit) {
28047
- case TimeUnit.SECOND:
28048
- return "timestamp-second";
28049
- case TimeUnit.MILLISECOND:
28050
- return "timestamp-millisecond";
28051
- case TimeUnit.MICROSECOND:
28052
- return "timestamp-microsecond";
28053
- case TimeUnit.NANOSECOND:
28054
- return "timestamp-nanosecond";
28055
- default:
28056
- return "timestamp-second";
28057
- }
28058
- case TimestampSecond:
28059
- return "timestamp-second";
28060
- case TimestampMillisecond:
28061
- return "timestamp-millisecond";
28062
- case TimestampMicrosecond:
28063
- return "timestamp-microsecond";
28064
- case TimestampNanosecond:
28065
- return "timestamp-nanosecond";
28066
- case Interval_:
28067
- const intervalUnit = arrowType.unit;
28068
- switch (intervalUnit) {
28069
- case IntervalUnit.DAY_TIME:
28070
- return "interval-daytime";
28071
- case IntervalUnit.YEAR_MONTH:
28072
- return "interval-yearmonth";
28073
- default:
28074
- return "interval-daytime";
28075
- }
28076
- case IntervalDayTime:
28077
- return "interval-daytime";
28078
- case IntervalYearMonth:
28079
- return "interval-yearmonth";
28080
- case Map_:
28081
- const mapType = arrowType;
28082
- return {
28083
- type: "map",
28084
- keysSorted: mapType.keysSorted,
28085
- children: mapType.children.map((arrowField) => serializeArrowField(arrowField))
28086
- };
28087
- case List2:
28088
- const listType = arrowType;
28089
- const listField = listType.valueField;
28090
- return {
28091
- type: "list",
28092
- children: [serializeArrowField(listField)]
28093
- };
28094
- case FixedSizeList2:
28095
- const fixedSizeList = arrowType;
28096
- return {
28097
- type: "fixed-size-list",
28098
- listSize: fixedSizeList.listSize,
28099
- children: [serializeArrowField(fixedSizeList.children[0])]
28100
- };
28101
- case Struct:
28102
- const structType = arrowType;
28103
- return {
28104
- type: "struct",
28105
- children: structType.children.map((arrowField) => serializeArrowField(arrowField))
28106
- };
28107
- case SparseUnion:
28108
- case DenseUnion:
28109
- const unionType = arrowType;
28110
- return {
28111
- type: unionType instanceof DenseUnion ? "dense-union" : "sparse-union",
28112
- typeIds: unionType.typeIds,
28113
- children: unionType.children.map((arrowField) => serializeArrowField(arrowField)),
28114
- typeIdToChildIndex: { ...unionType.typeIdToChildIndex }
28115
- };
28116
- case Dictionary:
28117
- const dictionaryType = arrowType;
28118
- return {
28119
- type: "dictionary",
28120
- id: dictionaryType.id,
28121
- indices: serializeArrowDictionaryKeyType(dictionaryType.indices),
28122
- dictionary: serializeArrowType(dictionaryType.dictionary),
28123
- isOrdered: dictionaryType.isOrdered
28124
- };
28125
- default:
28126
- throw new Error(`arrow type not supported: ${arrowType.constructor.name}`);
28127
- }
28128
- }
28129
27432
  function deserializeArrowType(dataType, options) {
28130
27433
  if (typeof dataType === "object") {
28131
27434
  switch (dataType.type) {
@@ -28248,19 +27551,6 @@ return true;`);
28248
27551
  function getOptionalArrowConstructor(typeName) {
28249
27552
  return Arrow_dom_exports[typeName];
28250
27553
  }
28251
- function isArrowViewType(arrowType, viewTypeName) {
28252
- const constructor = getOptionalArrowConstructor(viewTypeName);
28253
- if (constructor && arrowType instanceof constructor) {
28254
- return true;
28255
- }
28256
- const guards = DataType;
28257
- const guard = viewTypeName === "BinaryView" ? guards.isBinaryView : guards.isUtf8View;
28258
- return Boolean(guard?.(arrowType));
28259
- }
28260
- function isOptionalArrowType(arrowType, typeName) {
28261
- const constructor = getOptionalArrowConstructor(typeName);
28262
- return Boolean(constructor && arrowType instanceof constructor);
28263
- }
28264
27554
  function makeVariableWidthArrowType(viewTypeName, fallbackType, options) {
28265
27555
  const viewTypeMode = options?.viewTypes || "never";
28266
27556
  if (viewTypeMode === "never") {
@@ -28286,34 +27576,6 @@ return true;`);
28286
27576
  }
28287
27577
  return new constructor();
28288
27578
  }
28289
- function serializeArrowDictionaryKeyType(arrowType) {
28290
- if (arrowType instanceof Int_) {
28291
- const prefix = arrowType.isSigned ? "int" : "uint";
28292
- const keyType = `${prefix}${arrowType.bitWidth}`;
28293
- if (isSchemaDictionaryKeyType(keyType)) {
28294
- return keyType;
28295
- }
28296
- }
28297
- switch (arrowType.constructor) {
28298
- case Int8:
28299
- return "int8";
28300
- case Int16:
28301
- return "int16";
28302
- case Int32:
28303
- return "int32";
28304
- case Uint8:
28305
- return "uint8";
28306
- case Uint16:
28307
- return "uint16";
28308
- case Uint32:
28309
- return "uint32";
28310
- default:
28311
- throw new Error(`arrow dictionary index type not supported: ${arrowType.constructor.name}`);
28312
- }
28313
- }
28314
- function isSchemaDictionaryKeyType(keyType) {
28315
- return ["int8", "int16", "int32", "uint8", "uint16", "uint32"].includes(keyType);
28316
- }
28317
27579
  function deserializeArrowDictionaryKeyType(keyType) {
28318
27580
  switch (keyType) {
28319
27581
  case "int8":
@@ -28518,7 +27780,7 @@ return true;`);
28518
27780
  });
28519
27781
 
28520
27782
  // ../core/src/schema-utils/lib/mesh/convert-mesh-to-table.ts
28521
- function convertMeshToArrowTableWrapper(mesh, batchSize) {
27783
+ function convertMeshToArrowTable(mesh) {
28522
27784
  return makeMeshArrowTable(mesh.attributes, {
28523
27785
  schema: mesh.schema,
28524
27786
  topology: mesh.topology,
@@ -28539,22 +27801,14 @@ return true;`);
28539
27801
  fields.push(
28540
27802
  getAttributeArrowField(options.schema, attributeName, column, attribute.componentType)
28541
27803
  );
28542
- if (attributeName === "POSITION" && options.indices?.value?.length) {
27804
+ if (attributeName === attributeNames[0] && options.indices?.value?.length) {
28543
27805
  const indicesField = indexedMeshArrowSchema.fields.find((field) => field.name === "indices");
28544
27806
  columns.indices = getIndicesVector(options.indices.value, column.length, indicesField.type);
28545
27807
  fields.push(indicesField);
28546
27808
  }
28547
27809
  }
28548
27810
  const arrowSchema = new Schema2(fields, getMeshArrowMetadata(options));
28549
- const table = columns[attributeNames[0]]?.length === 0 ? new Table(arrowSchema) : new Table(arrowSchema, columns);
28550
- const schema = serializeArrowSchema(table.schema);
28551
- return {
28552
- shape: "arrow-table",
28553
- schema,
28554
- data: table,
28555
- topology: options.topology || "point-list",
28556
- indices: options.indices
28557
- };
27811
+ return columns[attributeNames[0]]?.length === 0 ? new Table(arrowSchema) : new Table(arrowSchema, columns);
28558
27812
  }
28559
27813
  function getAttributeArrowVector(value2, size, componentType) {
28560
27814
  if (componentType === "float16") {
@@ -28725,12 +27979,373 @@ return true;`);
28725
27979
  }
28726
27980
  });
28727
27981
 
27982
+ // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-helpers.js
27983
+ var init_indexed_arrow_helpers = __esm({
27984
+ "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-helpers.js"() {
27985
+ }
27986
+ });
27987
+
27988
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-schema-utils.js
27989
+ var init_arrow_schema_utils = __esm({
27990
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-schema-utils.js"() {
27991
+ }
27992
+ });
27993
+
27994
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js
27995
+ function getArrowVariadicBuffers(data) {
27996
+ return data.variadicBuffers ?? [];
27997
+ }
27998
+ function createArrowData(type, offset2, length4, nullCount, buffers, children2, dictionary, variadicBuffers) {
27999
+ return Reflect.construct(Data, [
28000
+ type,
28001
+ offset2,
28002
+ length4,
28003
+ nullCount,
28004
+ buffers,
28005
+ children2,
28006
+ dictionary,
28007
+ variadicBuffers
28008
+ ]);
28009
+ }
28010
+ var init_arrow_data = __esm({
28011
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js"() {
28012
+ init_Arrow_dom();
28013
+ }
28014
+ });
28015
+
28016
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-record-batch.js
28017
+ function getRecordBatchMetadata(batch) {
28018
+ return batch.metadata;
28019
+ }
28020
+ function createRecordBatchWithMetadata(schema, data, metadata) {
28021
+ if ("metadata" in RecordBatch3.prototype) {
28022
+ const MetadataRecordBatch = RecordBatch3;
28023
+ return Object.assign(new MetadataRecordBatch(schema, data, metadata), { data });
28024
+ }
28025
+ const batch = Object.assign(new RecordBatch3(schema, data), { data });
28026
+ return metadata === void 0 ? batch : Object.assign(batch, { metadata });
28027
+ }
28028
+ var init_arrow_record_batch = __esm({
28029
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-record-batch.js"() {
28030
+ init_Arrow_dom();
28031
+ }
28032
+ });
28033
+
28034
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js
28035
+ function isArrowTable2(value2) {
28036
+ const table = value2;
28037
+ return Boolean(table && Number.isInteger(table.numRows) && Array.isArray(table.batches) && Array.isArray(table.schema?.fields) && typeof table.get === "function" && typeof table.getChild === "function");
28038
+ }
28039
+ function isArrowRecordBatch2(value2) {
28040
+ const batch = value2;
28041
+ return Boolean(batch && Number.isInteger(batch.numRows) && Array.isArray(batch.schema?.fields) && Array.isArray(batch.data?.children) && typeof batch.get === "function" && typeof batch.getChild === "function");
28042
+ }
28043
+ var init_arrow_column_utils = __esm({
28044
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js"() {
28045
+ }
28046
+ });
28047
+
28048
+ // ../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js
28049
+ function splitArrowBuffers(input, options = {}) {
28050
+ const retainedBuffers = /* @__PURE__ */ new Set();
28051
+ const visited = /* @__PURE__ */ new Set();
28052
+ for (const retained of options.retain ?? []) {
28053
+ const chunks = isArrowTable2(retained) ? retained.batches.map((batch) => batch.data) : isArrowVector2(retained) ? retained.data : [isArrowRecordBatch2(retained) ? retained.data : retained];
28054
+ for (const data of chunks)
28055
+ collectArrowBuffers(data, retainedBuffers, visited);
28056
+ }
28057
+ const context = { ...options, copies: /* @__PURE__ */ new WeakMap(), retainedBuffers };
28058
+ if (isArrowTable2(input)) {
28059
+ return splitArrowTableBuffersInternal(input, context);
28060
+ }
28061
+ if (isArrowRecordBatch2(input)) {
28062
+ return splitArrowRecordBatchBuffers(input, context);
28063
+ }
28064
+ if (isArrowVector2(input)) {
28065
+ return splitArrowVectorBuffers(input, context);
28066
+ }
28067
+ return splitArrowDataBuffers(input, context);
28068
+ }
28069
+ function isArrowVector2(input) {
28070
+ return "data" in input && Array.isArray(input.data);
28071
+ }
28072
+ function splitArrowTableBuffersInternal(arrowTable, options) {
28073
+ const recordBatches = arrowTable.batches.map((recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options));
28074
+ return new Table(arrowTable.schema, recordBatches);
28075
+ }
28076
+ function splitArrowRecordBatchBuffers(recordBatch, options) {
28077
+ const data = splitArrowDataBuffers(recordBatch.data, options);
28078
+ return createRecordBatchWithMetadata(recordBatch.schema, data, getRecordBatchMetadata(recordBatch));
28079
+ }
28080
+ function splitArrowDataBuffers(data, options) {
28081
+ const children2 = data.children.map((childData) => splitArrowDataBuffers(childData, options));
28082
+ const dictionary = data.dictionary ? splitArrowVectorBuffers(data.dictionary, options) : void 0;
28083
+ const buffers = {
28084
+ [BufferType.OFFSET]: splitArrowBuffer(data.buffers[BufferType.OFFSET], options),
28085
+ [BufferType.DATA]: splitArrowBuffer(data.buffers[BufferType.DATA], options),
28086
+ [BufferType.VALIDITY]: splitArrowBuffer(data.buffers[BufferType.VALIDITY], options),
28087
+ [BufferType.TYPE]: splitArrowBuffer(data.buffers[BufferType.TYPE], options)
28088
+ };
28089
+ return createArrowData(
28090
+ data.type,
28091
+ data.offset,
28092
+ data.length,
28093
+ // @ts-expect-error _nullCount is protected. Reuse it to preserve lazy null-count state.
28094
+ data._nullCount,
28095
+ buffers,
28096
+ children2,
28097
+ dictionary,
28098
+ getArrowVariadicBuffers(data).map((buffer) => splitArrowBuffer(buffer, options))
28099
+ );
28100
+ }
28101
+ function splitArrowVectorBuffers(vector, options) {
28102
+ return new Vector2(vector.data.map((data) => splitArrowDataBuffers(data, options)));
28103
+ }
28104
+ function collectArrowBuffers(data, buffers, visited) {
28105
+ if (visited.has(data))
28106
+ return;
28107
+ visited.add(data);
28108
+ for (const view of [...Object.values(data.buffers), ...getArrowVariadicBuffers(data)]) {
28109
+ if (isArrowTypedArray(view))
28110
+ buffers.add(view.buffer);
28111
+ }
28112
+ for (const child2 of data.children)
28113
+ collectArrowBuffers(child2, buffers, visited);
28114
+ for (const chunk of data.dictionary?.data ?? [])
28115
+ collectArrowBuffers(chunk, buffers, visited);
28116
+ }
28117
+ function splitArrowBuffer(array2, options) {
28118
+ if (!isArrowTypedArray(array2)) {
28119
+ return array2;
28120
+ }
28121
+ const sliced = array2.byteOffset !== 0 || array2.byteLength !== array2.buffer.byteLength;
28122
+ if (!options.retainedBuffers.has(array2.buffer) && options.copy !== "all" && (options.copy === "none" || !sliced)) {
28123
+ return array2;
28124
+ }
28125
+ let copy2 = options.copies.get(array2);
28126
+ if (!copy2) {
28127
+ copy2 = array2 instanceof Uint8Array ? new Uint8Array(array2) : array2.slice();
28128
+ options.copies.set(array2, copy2);
28129
+ }
28130
+ return copy2;
28131
+ }
28132
+ function isArrowTypedArray(value2) {
28133
+ return ArrayBuffer.isView(value2) && !(value2 instanceof DataView);
28134
+ }
28135
+ var init_split_arrow_buffers = __esm({
28136
+ "../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js"() {
28137
+ init_Arrow_dom();
28138
+ init_arrow_record_batch();
28139
+ init_arrow_data();
28140
+ init_arrow_column_utils();
28141
+ }
28142
+ });
28143
+
28144
+ // ../../node_modules/@math.gl/arrow/dist/arrow/take-arrow-rows.js
28145
+ var init_take_arrow_rows = __esm({
28146
+ "../../node_modules/@math.gl/arrow/dist/arrow/take-arrow-rows.js"() {
28147
+ init_arrow_data();
28148
+ init_split_arrow_buffers();
28149
+ }
28150
+ });
28151
+
28152
+ // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js
28153
+ var init_indexed_arrow_vector = __esm({
28154
+ "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js"() {
28155
+ init_indexed_arrow_helpers();
28156
+ }
28157
+ });
28158
+
28159
+ // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js
28160
+ var init_indexed_arrow_table = __esm({
28161
+ "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js"() {
28162
+ init_indexed_arrow_helpers();
28163
+ init_arrow_schema_utils();
28164
+ init_take_arrow_rows();
28165
+ init_indexed_arrow_vector();
28166
+ }
28167
+ });
28168
+
28169
+ // ../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js
28170
+ var init_mapped_arrow_table = __esm({
28171
+ "../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js"() {
28172
+ init_indexed_arrow_helpers();
28173
+ init_indexed_arrow_table();
28174
+ }
28175
+ });
28176
+
28177
+ // ../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js
28178
+ var init_rename_arrow_columns = __esm({
28179
+ "../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js"() {
28180
+ init_arrow_schema_utils();
28181
+ }
28182
+ });
28183
+
28184
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js
28185
+ function dehydrateArrowTable(arrowTable, options) {
28186
+ const splitTable = splitArrowBuffers(arrowTable, options);
28187
+ return {
28188
+ transport: "arrow-js",
28189
+ version: 1,
28190
+ schema: tableToIPC(new Table(splitTable.schema, [])),
28191
+ metadataVersion: splitTable.schema.metadataVersion,
28192
+ batches: splitTable.batches.map((batch) => {
28193
+ const metadata = getRecordBatchMetadata(batch);
28194
+ return {
28195
+ ...dehydrateArrowData(batch.data),
28196
+ ...metadata !== void 0 ? { metadata: [...metadata] } : {}
28197
+ };
28198
+ })
28199
+ };
28200
+ }
28201
+ function hydrateArrowTable(table) {
28202
+ if (table.transport !== "arrow-js" || table.version !== 1) {
28203
+ throw new Error("Unsupported Arrow column-buffer transport protocol.");
28204
+ }
28205
+ const decodedSchema = tableFromIPC(table.schema).schema;
28206
+ const schema = new Schema2(decodedSchema.fields, decodedSchema.metadata, decodedSchema.dictionaries, table.metadataVersion);
28207
+ const type = new Struct(schema.fields);
28208
+ const batches = table.batches.map((payload) => {
28209
+ const data = hydrateArrowData(payload, type);
28210
+ return createRecordBatchWithMetadata(schema, data, payload.metadata && new Map(payload.metadata));
28211
+ });
28212
+ return new Table(schema, batches);
28213
+ }
28214
+ function dehydrateArrowData(data) {
28215
+ return {
28216
+ offset: data.offset,
28217
+ length: data.length,
28218
+ nullCount: data.nullCount,
28219
+ buffers: {
28220
+ [BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
28221
+ [BufferType.DATA]: data.buffers[BufferType.DATA],
28222
+ [BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
28223
+ [BufferType.TYPE]: data.buffers[BufferType.TYPE]
28224
+ },
28225
+ children: data.children.map((child2) => dehydrateArrowData(child2)),
28226
+ variadicBuffers: getArrowVariadicBuffers(data),
28227
+ dictionary: data.dictionary?.data.map((chunk) => dehydrateArrowData(chunk))
28228
+ };
28229
+ }
28230
+ function hydrateArrowData(data, type) {
28231
+ const children2 = data.children.map((child2, index) => hydrateArrowData(child2, type.children[index].type));
28232
+ const dictionary = data.dictionary && DataType.isDictionary(type) ? new Vector2(data.dictionary.map((chunk) => hydrateArrowData(chunk, type.dictionary))) : void 0;
28233
+ return createArrowData(type, data.offset, data.length, data.nullCount, data.buffers, children2, dictionary, data.variadicBuffers);
28234
+ }
28235
+ function dehydrateArrowRecordBatch(batch, options) {
28236
+ return dehydrateArrowTable(new Table(batch.schema, [batch]), options);
28237
+ }
28238
+ function hydrateArrowRecordBatch(payload) {
28239
+ if (payload.batches.length !== 1) {
28240
+ throw new Error("Arrow record batch transport requires exactly one batch.");
28241
+ }
28242
+ return hydrateArrowTable(payload).batches[0];
28243
+ }
28244
+ var init_arrow_table_transport = __esm({
28245
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js"() {
28246
+ init_Arrow_dom();
28247
+ init_arrow_record_batch();
28248
+ init_arrow_data();
28249
+ init_split_arrow_buffers();
28250
+ }
28251
+ });
28252
+
28253
+ // ../../node_modules/@math.gl/arrow/dist/arrow/index.js
28254
+ var init_arrow = __esm({
28255
+ "../../node_modules/@math.gl/arrow/dist/arrow/index.js"() {
28256
+ init_indexed_arrow_table();
28257
+ init_indexed_arrow_vector();
28258
+ init_mapped_arrow_table();
28259
+ init_arrow_schema_utils();
28260
+ init_rename_arrow_columns();
28261
+ init_split_arrow_buffers();
28262
+ init_arrow_table_transport();
28263
+ init_arrow_column_utils();
28264
+ init_take_arrow_rows();
28265
+ init_arrow_record_batch();
28266
+ }
28267
+ });
28268
+
28269
+ // ../../node_modules/@math.gl/arrow/dist/index.js
28270
+ var init_dist4 = __esm({
28271
+ "../../node_modules/@math.gl/arrow/dist/index.js"() {
28272
+ init_arrow();
28273
+ }
28274
+ });
28275
+
28276
+ // ../core/src/arrow-worker-transport.ts
28277
+ function serializeNativeArrowWorkerResult(result, options = { copy: "all" }) {
28278
+ const batch = result instanceof RecordBatch3;
28279
+ if (!batch && !(result instanceof Table)) {
28280
+ throw new Error("Workers require Arrow table output");
28281
+ }
28282
+ return {
28283
+ transport: batch ? "arrow-record-batch" : "arrow-table-columns",
28284
+ columns: batch ? { data: dehydrateArrowRecordBatch(result, options) } : serializeWorkerColumns(result, options)
28285
+ };
28286
+ }
28287
+ function deserializeNativeArrowWorkerResult(result) {
28288
+ const payload = result;
28289
+ if (payload?.transport !== "arrow-table-columns" && payload?.transport !== "arrow-record-batch" || !hasArrowWorkerColumns(payload.columns)) {
28290
+ throw new Error("Workers require Arrow column transport");
28291
+ }
28292
+ if (payload.transport === "arrow-record-batch" && !payload.columns.arrowBatchMetadata) {
28293
+ return hydrateArrowRecordBatch(payload.columns.data);
28294
+ }
28295
+ const data = hydrateWorkerTable(payload.columns);
28296
+ return payload.transport === "arrow-record-batch" ? data.batches[0] : data;
28297
+ }
28298
+ function serializeArrowWorkerResult(result, options) {
28299
+ const workerOptions = options;
28300
+ const copy2 = workerOptions?.core?.workerTransferBufferCopy ?? workerOptions?.workerTransferBufferCopy;
28301
+ return result instanceof Table || result instanceof RecordBatch3 ? serializeNativeArrowWorkerResult(result, { copy: copy2 ?? "all" }) : result;
28302
+ }
28303
+ function deserializeArrowWorkerResult(result) {
28304
+ const transport = result?.transport;
28305
+ return transport === "arrow-table-columns" || transport === "arrow-record-batch" ? deserializeNativeArrowWorkerResult(result) : result;
28306
+ }
28307
+ function hasArrowWorkerColumns(value2) {
28308
+ const columns = value2;
28309
+ return columns?.data?.transport === "arrow-js" && Array.isArray(columns.data.batches);
28310
+ }
28311
+ function serializeWorkerColumns(table, options) {
28312
+ return {
28313
+ arrowBatchMetadata: snapshotBatchMetadata(table),
28314
+ data: dehydrateArrowTable(table, options)
28315
+ };
28316
+ }
28317
+ function snapshotBatchMetadata(table) {
28318
+ return table.batches.map((batch) => ({
28319
+ schema: tableToIPC(new Table(batch.schema, []))
28320
+ }));
28321
+ }
28322
+ function hydrateWorkerTable(result) {
28323
+ const { arrowBatchMetadata, data } = result;
28324
+ const table = hydrateArrowTable(data);
28325
+ const batches = table.batches.map((batch, index) => {
28326
+ const snapshot = arrowBatchMetadata?.[index];
28327
+ return snapshot ? createRecordBatchWithMetadata(
28328
+ tableFromIPC(snapshot.schema).schema,
28329
+ batch.data,
28330
+ snapshot.metadata ? new Map(snapshot.metadata) : getRecordBatchMetadata(batch)
28331
+ ) : batch;
28332
+ });
28333
+ return new Table(table.schema, batches);
28334
+ }
28335
+ var init_arrow_worker_transport = __esm({
28336
+ "../core/src/arrow-worker-transport.ts"() {
28337
+ "use strict";
28338
+ init_Arrow_dom();
28339
+ init_dist4();
28340
+ }
28341
+ });
28342
+
28728
28343
  // ../scene/src/draco/lib/utils/version.ts
28729
28344
  var VERSION5;
28730
28345
  var init_version3 = __esm({
28731
28346
  "../scene/src/draco/lib/utils/version.ts"() {
28732
28347
  "use strict";
28733
- VERSION5 = true ? "5.0.0-beta.10" : "latest";
28348
+ VERSION5 = true ? "5.0.0-beta.11" : "latest";
28734
28349
  }
28735
28350
  });
28736
28351
 
@@ -29655,7 +29270,7 @@ return true;`);
29655
29270
  const mesh = dracoParser.parseSync(arrayBuffer, options?.draco);
29656
29271
  reportProgress?.({ phase: "decode", completed: 1, total: 1, unit: "tasks" });
29657
29272
  if (options?.draco?.shape === "arrow") {
29658
- return convertMeshToArrowTableWrapper(mesh).data;
29273
+ return convertMeshToArrowTable(mesh);
29659
29274
  }
29660
29275
  return mesh;
29661
29276
  } finally {
@@ -32410,7 +32025,7 @@ return true;`);
32410
32025
  init_tsfnz();
32411
32026
  init_adjust_lon();
32412
32027
  init_phi2z();
32413
- init_constants3();
32028
+ init_constants2();
32414
32029
  }
32415
32030
  });
32416
32031
 
@@ -32502,7 +32117,7 @@ return true;`);
32502
32117
  }
32503
32118
  var init_iqsfnz = __esm({
32504
32119
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/common/iqsfnz.js"() {
32505
- init_constants3();
32120
+ init_constants2();
32506
32121
  }
32507
32122
  });
32508
32123
 
@@ -32613,7 +32228,7 @@ return true;`);
32613
32228
  init_qsfnz();
32614
32229
  init_adjust_lon();
32615
32230
  init_iqsfnz();
32616
- init_constants3();
32231
+ init_constants2();
32617
32232
  }
32618
32233
  });
32619
32234
 
@@ -32650,7 +32265,7 @@ return true;`);
32650
32265
  }
32651
32266
  var init_adjust_lat = __esm({
32652
32267
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/common/adjust_lat.js"() {
32653
- init_constants3();
32268
+ init_constants2();
32654
32269
  init_sign();
32655
32270
  }
32656
32271
  });
@@ -32755,7 +32370,7 @@ return true;`);
32755
32370
  init_msfnz();
32756
32371
  init_adjust_lon();
32757
32372
  init_adjust_lat();
32758
- init_constants3();
32373
+ init_constants2();
32759
32374
  }
32760
32375
  });
32761
32376
 
@@ -33082,7 +32697,7 @@ return true;`);
33082
32697
  var S_POLE, N_POLE, EQUIT, OBLIQ;
33083
32698
  var init_laea = __esm({
33084
32699
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/kernels/laea.js"() {
33085
- init_constants3();
32700
+ init_constants2();
33086
32701
  init_qsfnz();
33087
32702
  init_adjust_lon();
33088
32703
  init_authalic_latitude();
@@ -33178,7 +32793,7 @@ return true;`);
33178
32793
  var init_gauss = __esm({
33179
32794
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/kernels/gauss.js"() {
33180
32795
  init_srat();
33181
- init_constants3();
32796
+ init_constants2();
33182
32797
  MAX_ITER2 = 20;
33183
32798
  }
33184
32799
  });
@@ -33536,7 +33151,7 @@ return true;`);
33536
33151
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/kernels/aeqd.js"() {
33537
33152
  init_inverse_spherical_latitude();
33538
33153
  init_adjust_lon();
33539
- init_constants3();
33154
+ init_constants2();
33540
33155
  init_meridian_distance();
33541
33156
  init_vincenty();
33542
33157
  }
@@ -33716,7 +33331,7 @@ return true;`);
33716
33331
  init_spherical_rendering_domain();
33717
33332
  init_rendering_bounds();
33718
33333
  init_tsfnz();
33719
- init_constants3();
33334
+ init_constants2();
33720
33335
  }
33721
33336
  });
33722
33337
 
@@ -33875,7 +33490,7 @@ return true;`);
33875
33490
  init_pj_enfn();
33876
33491
  init_pj_inv_mlfn();
33877
33492
  init_pj_mlfn();
33878
- init_constants3();
33493
+ init_constants2();
33879
33494
  EPS10 = 1e-10;
33880
33495
  }
33881
33496
  });
@@ -34022,7 +33637,7 @@ return true;`);
34022
33637
  init_gN();
34023
33638
  init_adjust_lon();
34024
33639
  init_adjust_lat();
34025
- init_constants3();
33640
+ init_constants2();
34026
33641
  }
34027
33642
  });
34028
33643
 
@@ -34231,7 +33846,7 @@ return true;`);
34231
33846
  init_pj_enfn();
34232
33847
  init_pj_mlfn();
34233
33848
  init_pj_inv_mlfn();
34234
- init_constants3();
33849
+ init_constants2();
34235
33850
  init_asinz();
34236
33851
  MAX_ITER3 = 20;
34237
33852
  }
@@ -34917,7 +34532,7 @@ return true;`);
34917
34532
  init_ellipsoidal_gnomonic();
34918
34533
  init_adjust_lon();
34919
34534
  init_asinz();
34920
- init_constants3();
34535
+ init_constants2();
34921
34536
  }
34922
34537
  });
34923
34538
 
@@ -34948,7 +34563,7 @@ return true;`);
34948
34563
  }
34949
34564
  var init_fL = __esm({
34950
34565
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/common/fL.js"() {
34951
- init_constants3();
34566
+ init_constants2();
34952
34567
  }
34953
34568
  });
34954
34569
 
@@ -34989,7 +34604,7 @@ return true;`);
34989
34604
  }
34990
34605
  var init_latiso = __esm({
34991
34606
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/common/latiso.js"() {
34992
- init_constants3();
34607
+ init_constants2();
34993
34608
  }
34994
34609
  });
34995
34610
 
@@ -35549,7 +35164,7 @@ return true;`);
35549
35164
  }
35550
35165
  var init_nzmg = __esm({
35551
35166
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/kernels/nzmg.js"() {
35552
- init_constants3();
35167
+ init_constants2();
35553
35168
  }
35554
35169
  });
35555
35170
 
@@ -35810,7 +35425,7 @@ return true;`);
35810
35425
  init_tsfnz();
35811
35426
  init_adjust_lon();
35812
35427
  init_phi2z();
35813
- init_constants3();
35428
+ init_constants2();
35814
35429
  TOL = 1e-7;
35815
35430
  }
35816
35431
  });
@@ -36096,7 +35711,7 @@ return true;`);
36096
35711
  var init_poly = __esm({
36097
35712
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/kernels/poly.js"() {
36098
35713
  init_adjust_lon();
36099
- init_constants3();
35714
+ init_constants2();
36100
35715
  init_gN();
36101
35716
  init_meridian_distance();
36102
35717
  MAX_ITER4 = 20;
@@ -36378,7 +35993,7 @@ return true;`);
36378
35993
  var FACE_ENUM, AREA_ENUM;
36379
35994
  var init_qsc = __esm({
36380
35995
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/kernels/qsc.js"() {
36381
- init_constants3();
35996
+ init_constants2();
36382
35997
  FACE_ENUM = {
36383
35998
  FRONT: 1,
36384
35999
  RIGHT: 2,
@@ -36549,7 +36164,7 @@ return true;`);
36549
36164
  var COEFS_X, COEFS_Y, FXC, FYC, C1, RC1, NODES, poly3_val, poly3_der;
36550
36165
  var init_robin = __esm({
36551
36166
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/kernels/robin.js"() {
36552
- init_constants3();
36167
+ init_constants2();
36553
36168
  init_adjust_lon();
36554
36169
  COEFS_X = [
36555
36170
  [1, 22199e-21, -715515e-10, 31103e-10],
@@ -36881,7 +36496,7 @@ return true;`);
36881
36496
  var mode;
36882
36497
  var init_tpers = __esm({
36883
36498
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/kernels/tpers.js"() {
36884
- init_constants3();
36499
+ init_constants2();
36885
36500
  init_hypot();
36886
36501
  mode = {
36887
36502
  N_POLE: 0,
@@ -37033,7 +36648,7 @@ return true;`);
37033
36648
  var init_vandg = __esm({
37034
36649
  "../../node_modules/@math.gl/geospatial/dist/projection/experimental/kernels/vandg.js"() {
37035
36650
  init_adjust_lon();
37036
- init_constants3();
36651
+ init_constants2();
37037
36652
  init_asinz();
37038
36653
  }
37039
36654
  });
@@ -39558,7 +39173,7 @@ return true;`);
39558
39173
  "src/spatial/spatial-coordinate-transformer.ts"() {
39559
39174
  "use strict";
39560
39175
  init_dist2();
39561
- init_dist4();
39176
+ init_dist3();
39562
39177
  init_bulk();
39563
39178
  init_spatial_resource_registry();
39564
39179
  init_normalize_crs_identifier();
@@ -39953,7 +39568,7 @@ return true;`);
39953
39568
  "src/spatial/i3s-spatial-transformer.ts"() {
39954
39569
  "use strict";
39955
39570
  init_dist2();
39956
- init_dist4();
39571
+ init_dist3();
39957
39572
  init_spatial_coordinate_transformer();
39958
39573
  init_spatial_types();
39959
39574
  init_i3s_elevation();
@@ -40588,18 +40203,10 @@ return true;`);
40588
40203
  throw new Error(`parse i3s tile content: unknown size of data: ${dataType}`);
40589
40204
  }
40590
40205
  }
40591
- var GL_TYPE_MAP, COORDINATE_SYSTEM;
40592
- var init_constants6 = __esm({
40206
+ var COORDINATE_SYSTEM;
40207
+ var init_constants5 = __esm({
40593
40208
  "src/i3s/lib/parsers/constants.ts"() {
40594
40209
  "use strict";
40595
- init_dist3();
40596
- GL_TYPE_MAP = {
40597
- UInt8: GL.UNSIGNED_BYTE,
40598
- UInt16: GL.UNSIGNED_SHORT,
40599
- Float32: GL.FLOAT,
40600
- UInt32: GL.UNSIGNED_INT,
40601
- UInt64: GL.DOUBLE
40602
- };
40603
40210
  COORDINATE_SYSTEM = {
40604
40211
  /**
40605
40212
  * `LNGLAT` if rendering into a geospatial viewport, `CARTESIAN` otherwise.
@@ -41096,7 +40703,6 @@ return true;`);
41096
40703
  }
41097
40704
  attributes[attribute] = {
41098
40705
  value: value2,
41099
- type: GL_TYPE_MAP[valueType],
41100
40706
  size: valuesPerElement
41101
40707
  };
41102
40708
  switch (attribute) {
@@ -41342,15 +40948,15 @@ return true;`);
41342
40948
  init_loader_utils();
41343
40949
  init_schema3();
41344
40950
  init_dist2();
41345
- init_dist4();
41346
- init_dist4();
40951
+ init_dist3();
40952
+ init_dist3();
41347
40953
  init_loader_utils();
41348
40954
  init_src();
41349
40955
  init_src2();
41350
40956
  init_src();
41351
40957
  init_index();
41352
40958
  init_url_utils();
41353
- init_constants6();
40959
+ init_constants5();
41354
40960
  scratchVector4 = new Vector3([0, 0, 0]);
41355
40961
  I3S_ATTRIBUTE_TYPE = "i3s-attribute-type";
41356
40962
  }
@@ -41406,7 +41012,7 @@ return true;`);
41406
41012
  var init_i3s_loader_options = __esm({
41407
41013
  "src/i3s/i3s-loader-options.ts"() {
41408
41014
  "use strict";
41409
- init_constants6();
41015
+ init_constants5();
41410
41016
  I3S_LOADER_OPTIONS = {
41411
41017
  token: void 0,
41412
41018
  isTileset: "auto",
@@ -41433,7 +41039,7 @@ return true;`);
41433
41039
  "use strict";
41434
41040
  init_i3s_format();
41435
41041
  init_i3s_loader_options();
41436
- VERSION6 = true ? "5.0.0-beta.10" : "latest";
41042
+ VERSION6 = true ? "5.0.0-beta.11" : "latest";
41437
41043
  I3SContentLoader = {
41438
41044
  ...I3SContentFormat,
41439
41045
  dataType: null,