@loaders.gl/i3s 3.3.0-alpha.1 → 3.3.0-alpha.10

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 (124) hide show
  1. package/dist/dist.min.js +1215 -1478
  2. package/dist/es5/arcgis-webscene-loader.js +2 -8
  3. package/dist/es5/arcgis-webscene-loader.js.map +1 -1
  4. package/dist/es5/bundle.js +0 -1
  5. package/dist/es5/bundle.js.map +1 -1
  6. package/dist/es5/i3s-attribute-loader.js +19 -59
  7. package/dist/es5/i3s-attribute-loader.js.map +1 -1
  8. package/dist/es5/i3s-building-scene-layer-loader.js +1 -10
  9. package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
  10. package/dist/es5/i3s-content-loader.js +18 -18
  11. package/dist/es5/i3s-content-loader.js.map +1 -1
  12. package/dist/es5/i3s-loader.js +48 -80
  13. package/dist/es5/i3s-loader.js.map +1 -1
  14. package/dist/es5/i3s-node-page-loader.js +1 -12
  15. package/dist/es5/i3s-node-page-loader.js.map +1 -1
  16. package/dist/es5/index.js +12 -18
  17. package/dist/es5/index.js.map +1 -1
  18. package/dist/es5/lib/helpers/i3s-nodepages-tiles.js +18 -78
  19. package/dist/es5/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
  20. package/dist/es5/lib/parsers/constants.js +3 -19
  21. package/dist/es5/lib/parsers/constants.js.map +1 -1
  22. package/dist/es5/lib/parsers/parse-arcgis-webscene.js +128 -30
  23. package/dist/es5/lib/parsers/parse-arcgis-webscene.js.map +1 -1
  24. package/dist/es5/lib/parsers/parse-i3s-attribute.js +1 -23
  25. package/dist/es5/lib/parsers/parse-i3s-attribute.js.map +1 -1
  26. package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js +8 -25
  27. package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -1
  28. package/dist/es5/lib/parsers/parse-i3s-tile-content.js +90 -199
  29. package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
  30. package/dist/es5/lib/parsers/parse-i3s.js +6 -37
  31. package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
  32. package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js +0 -7
  33. package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -1
  34. package/dist/es5/lib/utils/customizeColors.js +164 -0
  35. package/dist/es5/lib/utils/customizeColors.js.map +1 -0
  36. package/dist/es5/lib/utils/url-utils.js +3 -8
  37. package/dist/es5/lib/utils/url-utils.js.map +1 -1
  38. package/dist/es5/types.js +0 -3
  39. package/dist/es5/types.js.map +1 -1
  40. package/dist/es5/workers/i3s-content-nodejs-worker.js +7 -0
  41. package/dist/es5/workers/i3s-content-nodejs-worker.js.map +1 -0
  42. package/dist/es5/workers/i3s-content-worker.js +0 -2
  43. package/dist/es5/workers/i3s-content-worker.js.map +1 -1
  44. package/dist/esm/arcgis-webscene-loader.js +3 -1
  45. package/dist/esm/arcgis-webscene-loader.js.map +1 -1
  46. package/dist/esm/bundle.js +1 -1
  47. package/dist/esm/bundle.js.map +1 -1
  48. package/dist/esm/i3s-attribute-loader.js +9 -26
  49. package/dist/esm/i3s-attribute-loader.js.map +1 -1
  50. package/dist/esm/i3s-building-scene-layer-loader.js +2 -3
  51. package/dist/esm/i3s-building-scene-layer-loader.js.map +1 -1
  52. package/dist/esm/i3s-content-loader.js +13 -6
  53. package/dist/esm/i3s-content-loader.js.map +1 -1
  54. package/dist/esm/i3s-loader.js +16 -24
  55. package/dist/esm/i3s-loader.js.map +1 -1
  56. package/dist/esm/i3s-node-page-loader.js +1 -2
  57. package/dist/esm/i3s-node-page-loader.js.map +1 -1
  58. package/dist/esm/index.js.map +1 -1
  59. package/dist/esm/lib/helpers/i3s-nodepages-tiles.js +2 -45
  60. package/dist/esm/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
  61. package/dist/esm/lib/parsers/constants.js +2 -11
  62. package/dist/esm/lib/parsers/constants.js.map +1 -1
  63. package/dist/esm/lib/parsers/parse-arcgis-webscene.js +50 -11
  64. package/dist/esm/lib/parsers/parse-arcgis-webscene.js.map +1 -1
  65. package/dist/esm/lib/parsers/parse-i3s-attribute.js +1 -8
  66. package/dist/esm/lib/parsers/parse-i3s-attribute.js.map +1 -1
  67. package/dist/esm/lib/parsers/parse-i3s-building-scene-layer.js +1 -4
  68. package/dist/esm/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -1
  69. package/dist/esm/lib/parsers/parse-i3s-tile-content.js +60 -104
  70. package/dist/esm/lib/parsers/parse-i3s-tile-content.js.map +1 -1
  71. package/dist/esm/lib/parsers/parse-i3s.js +16 -18
  72. package/dist/esm/lib/parsers/parse-i3s.js.map +1 -1
  73. package/dist/esm/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -1
  74. package/dist/esm/lib/utils/customizeColors.js +96 -0
  75. package/dist/esm/lib/utils/customizeColors.js.map +1 -0
  76. package/dist/esm/lib/utils/url-utils.js +5 -5
  77. package/dist/esm/lib/utils/url-utils.js.map +1 -1
  78. package/dist/esm/types.js +0 -3
  79. package/dist/esm/types.js.map +1 -1
  80. package/dist/esm/workers/i3s-content-nodejs-worker.js +5 -0
  81. package/dist/esm/workers/i3s-content-nodejs-worker.js.map +1 -0
  82. package/dist/esm/workers/i3s-content-worker.js.map +1 -1
  83. package/dist/i3s-attribute-loader.d.ts +6 -0
  84. package/dist/i3s-attribute-loader.d.ts.map +1 -1
  85. package/dist/i3s-attribute-loader.js +2 -1
  86. package/dist/i3s-content-loader.d.ts.map +1 -1
  87. package/dist/i3s-content-loader.js +9 -4
  88. package/dist/i3s-content-nodejs-worker.js +201 -0
  89. package/dist/i3s-content-nodejs-worker.js.map +7 -0
  90. package/dist/i3s-content-worker.js +672 -1045
  91. package/dist/i3s-loader.d.ts +5 -0
  92. package/dist/i3s-loader.d.ts.map +1 -1
  93. package/dist/i3s-loader.js +12 -10
  94. package/dist/index.d.ts +1 -1
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/lib/parsers/constants.js +1 -1
  97. package/dist/lib/parsers/parse-arcgis-webscene.d.ts.map +1 -1
  98. package/dist/lib/parsers/parse-arcgis-webscene.js +49 -7
  99. package/dist/lib/parsers/parse-i3s-tile-content.d.ts +2 -2
  100. package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
  101. package/dist/lib/parsers/parse-i3s-tile-content.js +38 -33
  102. package/dist/lib/parsers/parse-i3s.d.ts +1 -1
  103. package/dist/lib/parsers/parse-i3s.d.ts.map +1 -1
  104. package/dist/lib/parsers/parse-i3s.js +1 -1
  105. package/dist/lib/utils/customizeColors.d.ts +14 -0
  106. package/dist/lib/utils/customizeColors.d.ts.map +1 -0
  107. package/dist/lib/utils/customizeColors.js +89 -0
  108. package/dist/types.d.ts +265 -85
  109. package/dist/types.d.ts.map +1 -1
  110. package/dist/workers/i3s-content-nodejs-worker.d.ts +2 -0
  111. package/dist/workers/i3s-content-nodejs-worker.d.ts.map +1 -0
  112. package/dist/workers/i3s-content-nodejs-worker.js +6 -0
  113. package/package.json +12 -12
  114. package/src/i3s-attribute-loader.ts +1 -1
  115. package/src/i3s-content-loader.ts +19 -6
  116. package/src/i3s-loader.ts +22 -13
  117. package/src/index.ts +8 -1
  118. package/src/lib/parsers/constants.ts +1 -1
  119. package/src/lib/parsers/parse-arcgis-webscene.ts +57 -7
  120. package/src/lib/parsers/parse-i3s-tile-content.ts +56 -43
  121. package/src/lib/parsers/parse-i3s.ts +1 -1
  122. package/src/lib/utils/customizeColors.ts +129 -0
  123. package/src/types.ts +198 -3
  124. package/src/workers/i3s-content-nodejs-worker.ts +5 -0
package/dist/dist.min.js CHANGED
@@ -17,16 +17,16 @@
17
17
  for (var name in all)
18
18
  __defProp(target, name, { get: all[name], enumerable: true });
19
19
  };
20
- var __reExport = (target, module2, desc) => {
21
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
22
- for (let key of __getOwnPropNames(module2))
20
+ var __reExport = (target, module, desc) => {
21
+ if (module && typeof module === "object" || typeof module === "function") {
22
+ for (let key of __getOwnPropNames(module))
23
23
  if (!__hasOwnProp.call(target, key) && key !== "default")
24
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
24
+ __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
25
25
  }
26
26
  return target;
27
27
  };
28
- var __toModule = (module2) => {
29
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
28
+ var __toModule = (module) => {
29
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
30
30
  };
31
31
 
32
32
  // ../loader-utils/src/lib/env-utils/assert.ts
@@ -262,7 +262,7 @@
262
262
  this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
263
263
  }
264
264
  static isSupported() {
265
- return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== void 0;
265
+ return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== "undefined" && !isBrowser2;
266
266
  }
267
267
  destroy() {
268
268
  this.onMessage = NOOP;
@@ -832,6 +832,30 @@
832
832
  }
833
833
  });
834
834
 
835
+ // ../loader-utils/src/json-loader.ts
836
+ function parseTextSync(text) {
837
+ return JSON.parse(text);
838
+ }
839
+ var VERSION3, JSONLoader;
840
+ var init_json_loader = __esm({
841
+ "../loader-utils/src/json-loader.ts"() {
842
+ VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
843
+ JSONLoader = {
844
+ name: "JSON",
845
+ id: "json",
846
+ module: "json",
847
+ version: VERSION3,
848
+ extensions: ["json", "geojson"],
849
+ mimeTypes: ["application/json"],
850
+ category: "json",
851
+ text: true,
852
+ parseTextSync,
853
+ parse: async (arrayBuffer) => parseTextSync(new TextDecoder().decode(arrayBuffer)),
854
+ options: {}
855
+ };
856
+ }
857
+ });
858
+
835
859
  // ../loader-utils/src/lib/path-utils/path.ts
836
860
  var path_exports = {};
837
861
  __export(path_exports, {
@@ -874,6 +898,7 @@
874
898
  init_array_buffer_utils();
875
899
  init_async_iteration();
876
900
  init_file_aliases();
901
+ init_json_loader();
877
902
  init_path();
878
903
  }
879
904
  });
@@ -1076,7 +1101,7 @@
1076
1101
  }
1077
1102
  });
1078
1103
 
1079
- // ../../node_modules/probe.gl/dist/esm/env/is-electron.js
1104
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
1080
1105
  function isElectron(mockUserAgent) {
1081
1106
  if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
1082
1107
  return true;
@@ -1092,25 +1117,25 @@
1092
1117
  return false;
1093
1118
  }
1094
1119
  var init_is_electron = __esm({
1095
- "../../node_modules/probe.gl/dist/esm/env/is-electron.js"() {
1120
+ "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
1096
1121
  }
1097
1122
  });
1098
1123
 
1099
- // ../../node_modules/probe.gl/dist/esm/env/is-browser.js
1124
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
1100
1125
  function isBrowser3() {
1101
1126
  const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
1102
1127
  return !isNode || isElectron();
1103
1128
  }
1104
1129
  var init_is_browser = __esm({
1105
- "../../node_modules/probe.gl/dist/esm/env/is-browser.js"() {
1130
+ "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
1106
1131
  init_is_electron();
1107
1132
  }
1108
1133
  });
1109
1134
 
1110
- // ../../node_modules/probe.gl/dist/esm/env/globals.js
1111
- var globals3, self_3, window_3, global_3, document_3, process_;
1135
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
1136
+ var globals3, self_3, window_3, document_3, process_;
1112
1137
  var init_globals3 = __esm({
1113
- "../../node_modules/probe.gl/dist/esm/env/globals.js"() {
1138
+ "../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
1114
1139
  globals3 = {
1115
1140
  self: typeof self !== "undefined" && self,
1116
1141
  window: typeof window !== "undefined" && window,
@@ -1120,24 +1145,31 @@
1120
1145
  };
1121
1146
  self_3 = globals3.self || globals3.window || globals3.global;
1122
1147
  window_3 = globals3.window || globals3.self || globals3.global;
1123
- global_3 = globals3.global || globals3.self || globals3.window;
1124
1148
  document_3 = globals3.document || {};
1125
1149
  process_ = globals3.process || {};
1126
1150
  }
1127
1151
  });
1128
1152
 
1129
- // ../../node_modules/probe.gl/dist/esm/utils/globals.js
1130
- var VERSION3, isBrowser4;
1153
+ // ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
1154
+ var VERSION4, isBrowser4;
1131
1155
  var init_globals4 = __esm({
1132
- "../../node_modules/probe.gl/dist/esm/utils/globals.js"() {
1156
+ "../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
1133
1157
  init_is_browser();
1134
- init_globals3();
1135
- VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
1158
+ VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
1136
1159
  isBrowser4 = isBrowser3();
1137
1160
  }
1138
1161
  });
1139
1162
 
1140
- // ../../node_modules/probe.gl/dist/esm/utils/local-storage.js
1163
+ // ../../node_modules/@probe.gl/env/dist/esm/index.js
1164
+ var init_esm = __esm({
1165
+ "../../node_modules/@probe.gl/env/dist/esm/index.js"() {
1166
+ init_globals4();
1167
+ init_globals3();
1168
+ init_is_browser();
1169
+ }
1170
+ });
1171
+
1172
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
1141
1173
  function getStorage(type) {
1142
1174
  try {
1143
1175
  const storage = window[type];
@@ -1151,9 +1183,15 @@
1151
1183
  }
1152
1184
  var LocalStorage;
1153
1185
  var init_local_storage = __esm({
1154
- "../../node_modules/probe.gl/dist/esm/utils/local-storage.js"() {
1186
+ "../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
1187
+ init_defineProperty();
1155
1188
  LocalStorage = class {
1156
- constructor(id, defaultSettings, type = "sessionStorage") {
1189
+ constructor(id) {
1190
+ let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1191
+ let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
1192
+ _defineProperty(this, "storage", void 0);
1193
+ _defineProperty(this, "id", void 0);
1194
+ _defineProperty(this, "config", {});
1157
1195
  this.storage = getStorage(type);
1158
1196
  this.id = id;
1159
1197
  this.config = {};
@@ -1188,7 +1226,7 @@
1188
1226
  }
1189
1227
  });
1190
1228
 
1191
- // ../../node_modules/probe.gl/dist/esm/utils/formatters.js
1229
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
1192
1230
  function formatTime(ms) {
1193
1231
  let formatted;
1194
1232
  if (ms < 10) {
@@ -1202,11 +1240,13 @@
1202
1240
  }
1203
1241
  return formatted;
1204
1242
  }
1205
- function leftPad(string, length4 = 8) {
1243
+ function leftPad(string) {
1244
+ let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
1206
1245
  const padLength = Math.max(length4 - string.length, 0);
1207
1246
  return "".concat(" ".repeat(padLength)).concat(string);
1208
1247
  }
1209
- function formatImage(image, message, scale5, maxWidth = 600) {
1248
+ function formatImage(image, message, scale5) {
1249
+ let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
1210
1250
  const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
1211
1251
  if (image.width > maxWidth) {
1212
1252
  scale5 = Math.min(scale5, maxWidth / image.width);
@@ -1217,16 +1257,16 @@
1217
1257
  return ["".concat(message, " %c+"), style];
1218
1258
  }
1219
1259
  var init_formatters = __esm({
1220
- "../../node_modules/probe.gl/dist/esm/utils/formatters.js"() {
1260
+ "../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
1221
1261
  }
1222
1262
  });
1223
1263
 
1224
- // ../../node_modules/probe.gl/dist/esm/utils/color.js
1264
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
1225
1265
  function getColor(color) {
1226
1266
  return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
1227
1267
  }
1228
1268
  function addColor(string, color, background) {
1229
- if (!isBrowser4 && typeof string === "string") {
1269
+ if (!isBrowser3 && typeof string === "string") {
1230
1270
  if (color) {
1231
1271
  color = getColor(color);
1232
1272
  string = "[".concat(color, "m").concat(string, "");
@@ -1240,31 +1280,32 @@
1240
1280
  }
1241
1281
  var COLOR;
1242
1282
  var init_color = __esm({
1243
- "../../node_modules/probe.gl/dist/esm/utils/color.js"() {
1244
- init_globals4();
1245
- COLOR = {
1246
- BLACK: 30,
1247
- RED: 31,
1248
- GREEN: 32,
1249
- YELLOW: 33,
1250
- BLUE: 34,
1251
- MAGENTA: 35,
1252
- CYAN: 36,
1253
- WHITE: 37,
1254
- BRIGHT_BLACK: 90,
1255
- BRIGHT_RED: 91,
1256
- BRIGHT_GREEN: 92,
1257
- BRIGHT_YELLOW: 93,
1258
- BRIGHT_BLUE: 94,
1259
- BRIGHT_MAGENTA: 95,
1260
- BRIGHT_CYAN: 96,
1261
- BRIGHT_WHITE: 97
1262
- };
1283
+ "../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
1284
+ init_esm();
1285
+ (function(COLOR2) {
1286
+ COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
1287
+ COLOR2[COLOR2["RED"] = 31] = "RED";
1288
+ COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
1289
+ COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
1290
+ COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
1291
+ COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
1292
+ COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
1293
+ COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
1294
+ COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
1295
+ COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
1296
+ COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
1297
+ COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
1298
+ COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
1299
+ COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
1300
+ COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
1301
+ COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
1302
+ })(COLOR || (COLOR = {}));
1263
1303
  }
1264
1304
  });
1265
1305
 
1266
- // ../../node_modules/probe.gl/dist/esm/utils/autobind.js
1267
- function autobind(obj, predefined = ["constructor"]) {
1306
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
1307
+ function autobind(obj) {
1308
+ let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
1268
1309
  const proto = Object.getPrototypeOf(obj);
1269
1310
  const propNames = Object.getOwnPropertyNames(proto);
1270
1311
  for (const key of propNames) {
@@ -1276,28 +1317,30 @@
1276
1317
  }
1277
1318
  }
1278
1319
  var init_autobind = __esm({
1279
- "../../node_modules/probe.gl/dist/esm/utils/autobind.js"() {
1320
+ "../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
1280
1321
  }
1281
1322
  });
1282
1323
 
1283
- // ../../node_modules/probe.gl/dist/esm/utils/assert.js
1324
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
1284
1325
  function assert3(condition, message) {
1285
1326
  if (!condition) {
1286
1327
  throw new Error(message || "Assertion failed");
1287
1328
  }
1288
1329
  }
1289
1330
  var init_assert3 = __esm({
1290
- "../../node_modules/probe.gl/dist/esm/utils/assert.js"() {
1331
+ "../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
1291
1332
  }
1292
1333
  });
1293
1334
 
1294
- // ../../node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js
1335
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
1295
1336
  function getHiResTimestamp() {
1296
1337
  let timestamp;
1297
- if (isBrowser4 && window_3.performance) {
1298
- timestamp = window_3.performance.now();
1299
- } else if (process_.hrtime) {
1300
- const timeParts = process_.hrtime();
1338
+ if (isBrowser3 && "performance" in window_3) {
1339
+ var _window$performance, _window$performance$n;
1340
+ 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);
1341
+ } else if ("hrtime" in process_) {
1342
+ var _process$hrtime;
1343
+ const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
1301
1344
  timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
1302
1345
  } else {
1303
1346
  timestamp = Date.now();
@@ -1305,21 +1348,19 @@
1305
1348
  return timestamp;
1306
1349
  }
1307
1350
  var init_hi_res_timestamp = __esm({
1308
- "../../node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js"() {
1309
- init_globals4();
1351
+ "../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
1352
+ init_esm();
1310
1353
  }
1311
1354
  });
1312
1355
 
1313
- // ../../node_modules/probe.gl/dist/esm/lib/log.js
1314
- function noop() {
1315
- }
1316
- function getTableHeader(table) {
1317
- for (const key in table) {
1318
- for (const title in table[key]) {
1319
- return title || "untitled";
1320
- }
1356
+ // (disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image
1357
+ var init_node_asciify_image = __esm({
1358
+ "(disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image"() {
1321
1359
  }
1322
- return "empty";
1360
+ });
1361
+
1362
+ // ../../node_modules/@probe.gl/log/dist/esm/log.js
1363
+ function noop() {
1323
1364
  }
1324
1365
  function normalizeLogLevel(logLevel) {
1325
1366
  if (!logLevel) {
@@ -1348,7 +1389,6 @@
1348
1389
  const args = opts.args ? Array.from(opts.args) : [];
1349
1390
  while (args.length && args.shift() !== message) {
1350
1391
  }
1351
- opts.args = args;
1352
1392
  switch (typeof logLevel) {
1353
1393
  case "string":
1354
1394
  case "function":
@@ -1367,7 +1407,9 @@
1367
1407
  }
1368
1408
  const messageType = typeof opts.message;
1369
1409
  assert3(messageType === "string" || messageType === "object");
1370
- return Object.assign(opts, opts.opts);
1410
+ return Object.assign(opts, {
1411
+ args
1412
+ }, opts.opts);
1371
1413
  }
1372
1414
  function decorateMessage(id, message, opts) {
1373
1415
  if (typeof message === "string") {
@@ -1377,29 +1419,25 @@
1377
1419
  }
1378
1420
  return message;
1379
1421
  }
1380
- function logImageInNode({
1381
- image,
1382
- message = "",
1383
- scale: scale5 = 1
1384
- }) {
1385
- let asciify = null;
1386
- try {
1387
- asciify = module.require("asciify-image");
1388
- } catch (error) {
1389
- }
1390
- if (asciify) {
1391
- return () => asciify(image, {
1392
- fit: "box",
1393
- width: "".concat(Math.round(80 * scale5), "%")
1394
- }).then((data) => console.log(data));
1395
- }
1422
+ function logImageInNode(_ref2) {
1423
+ let {
1424
+ image,
1425
+ message = "",
1426
+ scale: scale5 = 1
1427
+ } = _ref2;
1428
+ asciify.nodeAsciifyImage({
1429
+ image,
1430
+ message,
1431
+ scale: scale5
1432
+ });
1396
1433
  return noop;
1397
1434
  }
1398
- function logImageInBrowser({
1399
- image,
1400
- message = "",
1401
- scale: scale5 = 1
1402
- }) {
1435
+ function logImageInBrowser(_ref3) {
1436
+ let {
1437
+ image,
1438
+ message = "",
1439
+ scale: scale5 = 1
1440
+ } = _ref3;
1403
1441
  if (typeof image === "string") {
1404
1442
  const img = new Image();
1405
1443
  img.onload = () => {
@@ -1422,18 +1460,28 @@
1422
1460
  }
1423
1461
  return noop;
1424
1462
  }
1463
+ function getTableHeader(table) {
1464
+ for (const key in table) {
1465
+ for (const title in table[key]) {
1466
+ return title || "untitled";
1467
+ }
1468
+ }
1469
+ return "empty";
1470
+ }
1425
1471
  var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
1426
1472
  var init_log = __esm({
1427
- "../../node_modules/probe.gl/dist/esm/lib/log.js"() {
1428
- init_globals4();
1473
+ "../../node_modules/@probe.gl/log/dist/esm/log.js"() {
1474
+ init_defineProperty();
1475
+ init_esm();
1429
1476
  init_local_storage();
1430
1477
  init_formatters();
1431
1478
  init_color();
1432
1479
  init_autobind();
1433
1480
  init_assert3();
1434
1481
  init_hi_res_timestamp();
1482
+ init_node_asciify_image();
1435
1483
  originalConsole = {
1436
- debug: isBrowser4 ? console.debug || console.log : console.log,
1484
+ debug: isBrowser3 ? console.debug || console.log : console.log,
1437
1485
  log: console.log,
1438
1486
  info: console.info,
1439
1487
  warn: console.warn,
@@ -1448,16 +1496,20 @@
1448
1496
  once: true
1449
1497
  };
1450
1498
  Log = class {
1451
- constructor({
1452
- id
1453
- } = {
1454
- id: ""
1455
- }) {
1499
+ constructor() {
1500
+ let {
1501
+ id
1502
+ } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
1503
+ id: ""
1504
+ };
1505
+ _defineProperty(this, "id", void 0);
1506
+ _defineProperty(this, "VERSION", VERSION4);
1507
+ _defineProperty(this, "_startTs", getHiResTimestamp());
1508
+ _defineProperty(this, "_deltaTs", getHiResTimestamp());
1509
+ _defineProperty(this, "_storage", void 0);
1510
+ _defineProperty(this, "userData", {});
1511
+ _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
1456
1512
  this.id = id;
1457
- this.VERSION = VERSION3;
1458
- this._startTs = getHiResTimestamp();
1459
- this._deltaTs = getHiResTimestamp();
1460
- this.LOG_THROTTLE_TIMEOUT = 0;
1461
1513
  this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
1462
1514
  this.userData = {};
1463
1515
  this.timeStamp("".concat(this.id, " started"));
@@ -1491,7 +1543,8 @@
1491
1543
  getPriority() {
1492
1544
  return this.level;
1493
1545
  }
1494
- enable(enabled = true) {
1546
+ enable() {
1547
+ let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
1495
1548
  this._storage.updateConfiguration({
1496
1549
  enabled
1497
1550
  });
@@ -1503,6 +1556,21 @@
1503
1556
  });
1504
1557
  return this;
1505
1558
  }
1559
+ get(setting) {
1560
+ return this._storage.config[setting];
1561
+ }
1562
+ set(setting, value) {
1563
+ this._storage.updateConfiguration({
1564
+ [setting]: value
1565
+ });
1566
+ }
1567
+ settings() {
1568
+ if (console.table) {
1569
+ console.table(this._storage.config);
1570
+ } else {
1571
+ console.log(this._storage.config);
1572
+ }
1573
+ }
1506
1574
  assert(condition, message) {
1507
1575
  assert3(condition, message);
1508
1576
  }
@@ -1531,6 +1599,9 @@
1531
1599
  return this._getLogFunction(logLevel, message, console.info, arguments);
1532
1600
  }
1533
1601
  once(logLevel, message) {
1602
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1603
+ args[_key - 2] = arguments[_key];
1604
+ }
1534
1605
  return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
1535
1606
  }
1536
1607
  table(logLevel, table, columns) {
@@ -1541,17 +1612,18 @@
1541
1612
  }
1542
1613
  return noop;
1543
1614
  }
1544
- image({
1545
- logLevel,
1546
- priority,
1547
- image,
1548
- message = "",
1549
- scale: scale5 = 1
1550
- }) {
1615
+ image(_ref) {
1616
+ let {
1617
+ logLevel,
1618
+ priority,
1619
+ image,
1620
+ message = "",
1621
+ scale: scale5 = 1
1622
+ } = _ref;
1551
1623
  if (!this._shouldLog(logLevel || priority)) {
1552
1624
  return noop;
1553
1625
  }
1554
- return isBrowser4 ? logImageInBrowser({
1626
+ return isBrowser3 ? logImageInBrowser({
1555
1627
  image,
1556
1628
  message,
1557
1629
  scale: scale5
@@ -1561,21 +1633,6 @@
1561
1633
  scale: scale5
1562
1634
  });
1563
1635
  }
1564
- settings() {
1565
- if (console.table) {
1566
- console.table(this._storage.config);
1567
- } else {
1568
- console.log(this._storage.config);
1569
- }
1570
- }
1571
- get(setting) {
1572
- return this._storage.config[setting];
1573
- }
1574
- set(setting, value) {
1575
- this._storage.updateConfiguration({
1576
- [setting]: value
1577
- });
1578
- }
1579
1636
  time(logLevel, message) {
1580
1637
  return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
1581
1638
  }
@@ -1585,10 +1642,11 @@
1585
1642
  timeStamp(logLevel, message) {
1586
1643
  return this._getLogFunction(logLevel, message, console.timeStamp || noop);
1587
1644
  }
1588
- group(logLevel, message, opts = {
1589
- collapsed: false
1590
- }) {
1591
- opts = normalizeArguments({
1645
+ group(logLevel, message) {
1646
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
1647
+ collapsed: false
1648
+ };
1649
+ const options = normalizeArguments({
1592
1650
  logLevel,
1593
1651
  message,
1594
1652
  opts
@@ -1596,10 +1654,11 @@
1596
1654
  const {
1597
1655
  collapsed
1598
1656
  } = opts;
1599
- opts.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
1600
- return this._getLogFunction(opts);
1657
+ options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
1658
+ return this._getLogFunction(options);
1601
1659
  }
1602
- groupCollapsed(logLevel, message, opts = {}) {
1660
+ groupCollapsed(logLevel, message) {
1661
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1603
1662
  return this.group(logLevel, message, Object.assign({}, opts, {
1604
1663
  collapsed: true
1605
1664
  }));
@@ -1623,7 +1682,7 @@
1623
1682
  _shouldLog(logLevel) {
1624
1683
  return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
1625
1684
  }
1626
- _getLogFunction(logLevel, message, method, args = [], opts) {
1685
+ _getLogFunction(logLevel, message, method, args, opts) {
1627
1686
  if (this._shouldLog(logLevel)) {
1628
1687
  opts = normalizeArguments({
1629
1688
  logLevel,
@@ -1650,48 +1709,18 @@
1650
1709
  return noop;
1651
1710
  }
1652
1711
  };
1653
- Log.VERSION = VERSION3;
1654
- }
1655
- });
1656
-
1657
- // ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
1658
- var init_hi_res_timestamp2 = __esm({
1659
- "../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
1660
- }
1661
- });
1662
-
1663
- // ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js
1664
- var init_stat = __esm({
1665
- "../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
1666
- init_hi_res_timestamp2();
1667
- }
1668
- });
1669
-
1670
- // ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js
1671
- var init_stats = __esm({
1672
- "../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
1673
- init_stat();
1674
- }
1675
- });
1676
-
1677
- // ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js
1678
- var init_esm = __esm({
1679
- "../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js"() {
1680
- init_stats();
1681
- init_stat();
1682
- init_hi_res_timestamp2();
1712
+ _defineProperty(Log, "VERSION", VERSION4);
1683
1713
  }
1684
1714
  });
1685
1715
 
1686
- // ../../node_modules/probe.gl/dist/esm/index.js
1716
+ // ../../node_modules/@probe.gl/log/dist/esm/index.js
1687
1717
  var esm_default;
1688
1718
  var init_esm2 = __esm({
1689
- "../../node_modules/probe.gl/dist/esm/index.js"() {
1719
+ "../../node_modules/@probe.gl/log/dist/esm/index.js"() {
1690
1720
  init_log();
1691
1721
  init_log();
1692
- init_esm();
1693
1722
  esm_default = new Log({
1694
- id: "probe.gl"
1723
+ id: "@probe.gl/log"
1695
1724
  });
1696
1725
  }
1697
1726
  });
@@ -1954,658 +1983,35 @@
1954
1983
  }
1955
1984
  });
1956
1985
 
1957
- // ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
1958
- function isElectron2(mockUserAgent) {
1959
- if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
1960
- return true;
1961
- }
1962
- if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions.electron)) {
1963
- return true;
1964
- }
1965
- const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
1966
- const userAgent = mockUserAgent || realUserAgent;
1967
- if (userAgent && userAgent.indexOf("Electron") >= 0) {
1968
- return true;
1969
- }
1970
- return false;
1971
- }
1972
- var init_is_electron2 = __esm({
1973
- "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
1986
+ // ../core/src/lib/utils/log.ts
1987
+ var log;
1988
+ var init_log2 = __esm({
1989
+ "../core/src/lib/utils/log.ts"() {
1990
+ init_esm2();
1991
+ log = new Log({ id: "loaders.gl" });
1974
1992
  }
1975
1993
  });
1976
1994
 
1977
- // ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
1978
- function isBrowser5() {
1979
- const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
1980
- return !isNode || isElectron2();
1981
- }
1982
- var init_is_browser2 = __esm({
1983
- "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
1984
- init_is_electron2();
1995
+ // ../core/src/lib/api/select-loader.ts
1996
+ async function selectLoader(data, loaders = [], options, context) {
1997
+ if (!validHTTPResponse(data)) {
1998
+ return null;
1985
1999
  }
1986
- });
1987
-
1988
- // ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
1989
- var globals4, self_4, window_4, document_4, process_2;
1990
- var init_globals5 = __esm({
1991
- "../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
1992
- globals4 = {
1993
- self: typeof self !== "undefined" && self,
1994
- window: typeof window !== "undefined" && window,
1995
- global: typeof global !== "undefined" && global,
1996
- document: typeof document !== "undefined" && document,
1997
- process: typeof process === "object" && process
1998
- };
1999
- self_4 = globals4.self || globals4.window || globals4.global;
2000
- window_4 = globals4.window || globals4.self || globals4.global;
2001
- document_4 = globals4.document || {};
2002
- process_2 = globals4.process || {};
2000
+ let loader = selectLoaderSync(data, loaders, { ...options, nothrow: true }, context);
2001
+ if (loader) {
2002
+ return loader;
2003
2003
  }
2004
- });
2005
-
2006
- // ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
2007
- var VERSION4, isBrowser6;
2008
- var init_globals6 = __esm({
2009
- "../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
2010
- init_is_browser2();
2011
- VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
2012
- isBrowser6 = isBrowser5();
2004
+ if (isBlob(data)) {
2005
+ data = await data.slice(0, 10).arrayBuffer();
2006
+ loader = selectLoaderSync(data, loaders, options, context);
2013
2007
  }
2014
- });
2015
-
2016
- // ../../node_modules/@probe.gl/env/dist/esm/index.js
2017
- var init_esm3 = __esm({
2018
- "../../node_modules/@probe.gl/env/dist/esm/index.js"() {
2019
- init_globals6();
2020
- init_globals5();
2021
- init_is_browser2();
2008
+ if (!loader && !options?.nothrow) {
2009
+ throw new Error(getNoValidLoaderMessage(data));
2022
2010
  }
2023
- });
2024
-
2025
- // ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
2026
- function getStorage2(type) {
2027
- try {
2028
- const storage = window[type];
2029
- const x = "__storage_test__";
2030
- storage.setItem(x, x);
2031
- storage.removeItem(x);
2032
- return storage;
2033
- } catch (e2) {
2034
- return null;
2035
- }
2036
- }
2037
- var LocalStorage2;
2038
- var init_local_storage2 = __esm({
2039
- "../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
2040
- init_defineProperty();
2041
- LocalStorage2 = class {
2042
- constructor(id) {
2043
- let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2044
- let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
2045
- _defineProperty(this, "storage", void 0);
2046
- _defineProperty(this, "id", void 0);
2047
- _defineProperty(this, "config", {});
2048
- this.storage = getStorage2(type);
2049
- this.id = id;
2050
- this.config = {};
2051
- Object.assign(this.config, defaultSettings);
2052
- this._loadConfiguration();
2053
- }
2054
- getConfiguration() {
2055
- return this.config;
2056
- }
2057
- setConfiguration(configuration) {
2058
- this.config = {};
2059
- return this.updateConfiguration(configuration);
2060
- }
2061
- updateConfiguration(configuration) {
2062
- Object.assign(this.config, configuration);
2063
- if (this.storage) {
2064
- const serialized = JSON.stringify(this.config);
2065
- this.storage.setItem(this.id, serialized);
2066
- }
2067
- return this;
2068
- }
2069
- _loadConfiguration() {
2070
- let configuration = {};
2071
- if (this.storage) {
2072
- const serializedConfiguration = this.storage.getItem(this.id);
2073
- configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
2074
- }
2075
- Object.assign(this.config, configuration);
2076
- return this;
2077
- }
2078
- };
2079
- }
2080
- });
2081
-
2082
- // ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
2083
- function formatTime2(ms) {
2084
- let formatted;
2085
- if (ms < 10) {
2086
- formatted = "".concat(ms.toFixed(2), "ms");
2087
- } else if (ms < 100) {
2088
- formatted = "".concat(ms.toFixed(1), "ms");
2089
- } else if (ms < 1e3) {
2090
- formatted = "".concat(ms.toFixed(0), "ms");
2091
- } else {
2092
- formatted = "".concat((ms / 1e3).toFixed(2), "s");
2093
- }
2094
- return formatted;
2095
- }
2096
- function leftPad2(string) {
2097
- let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
2098
- const padLength = Math.max(length4 - string.length, 0);
2099
- return "".concat(" ".repeat(padLength)).concat(string);
2100
- }
2101
- function formatImage2(image, message, scale5) {
2102
- let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
2103
- const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
2104
- if (image.width > maxWidth) {
2105
- scale5 = Math.min(scale5, maxWidth / image.width);
2106
- }
2107
- const width = image.width * scale5;
2108
- const height = image.height * scale5;
2109
- const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
2110
- return ["".concat(message, " %c+"), style];
2111
- }
2112
- var init_formatters2 = __esm({
2113
- "../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
2114
- }
2115
- });
2116
-
2117
- // ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
2118
- function getColor2(color) {
2119
- return typeof color === "string" ? COLOR2[color.toUpperCase()] || COLOR2.WHITE : color;
2120
- }
2121
- function addColor2(string, color, background) {
2122
- if (!isBrowser5 && typeof string === "string") {
2123
- if (color) {
2124
- color = getColor2(color);
2125
- string = "[".concat(color, "m").concat(string, "");
2126
- }
2127
- if (background) {
2128
- color = getColor2(background);
2129
- string = "[".concat(background + 10, "m").concat(string, "");
2130
- }
2131
- }
2132
- return string;
2133
- }
2134
- var COLOR2;
2135
- var init_color2 = __esm({
2136
- "../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
2137
- init_esm3();
2138
- (function(COLOR3) {
2139
- COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
2140
- COLOR3[COLOR3["RED"] = 31] = "RED";
2141
- COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
2142
- COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
2143
- COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
2144
- COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
2145
- COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
2146
- COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
2147
- COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
2148
- COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
2149
- COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
2150
- COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
2151
- COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
2152
- COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
2153
- COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
2154
- COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
2155
- })(COLOR2 || (COLOR2 = {}));
2156
- }
2157
- });
2158
-
2159
- // ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
2160
- function autobind2(obj) {
2161
- let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
2162
- const proto = Object.getPrototypeOf(obj);
2163
- const propNames = Object.getOwnPropertyNames(proto);
2164
- for (const key of propNames) {
2165
- if (typeof obj[key] === "function") {
2166
- if (!predefined.find((name) => key === name)) {
2167
- obj[key] = obj[key].bind(obj);
2168
- }
2169
- }
2170
- }
2171
- }
2172
- var init_autobind2 = __esm({
2173
- "../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
2174
- }
2175
- });
2176
-
2177
- // ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
2178
- function assert4(condition, message) {
2179
- if (!condition) {
2180
- throw new Error(message || "Assertion failed");
2181
- }
2182
- }
2183
- var init_assert4 = __esm({
2184
- "../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
2185
- }
2186
- });
2187
-
2188
- // ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
2189
- function getHiResTimestamp3() {
2190
- let timestamp;
2191
- if (isBrowser5 && "performance" in window_4) {
2192
- var _window$performance, _window$performance$n;
2193
- timestamp = window_4 === null || window_4 === void 0 ? void 0 : (_window$performance = window_4.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);
2194
- } else if ("hrtime" in process_2) {
2195
- var _process$hrtime;
2196
- const timeParts = process_2 === null || process_2 === void 0 ? void 0 : (_process$hrtime = process_2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_2);
2197
- timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
2198
- } else {
2199
- timestamp = Date.now();
2200
- }
2201
- return timestamp;
2202
- }
2203
- var init_hi_res_timestamp3 = __esm({
2204
- "../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
2205
- init_esm3();
2206
- }
2207
- });
2208
-
2209
- // ../../node_modules/@probe.gl/log/dist/esm/log.js
2210
- function noop2() {
2211
- }
2212
- function normalizeLogLevel2(logLevel) {
2213
- if (!logLevel) {
2214
- return 0;
2215
- }
2216
- let resolvedLevel;
2217
- switch (typeof logLevel) {
2218
- case "number":
2219
- resolvedLevel = logLevel;
2220
- break;
2221
- case "object":
2222
- resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
2223
- break;
2224
- default:
2225
- return 0;
2226
- }
2227
- assert4(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
2228
- return resolvedLevel;
2229
- }
2230
- function normalizeArguments2(opts) {
2231
- const {
2232
- logLevel,
2233
- message
2234
- } = opts;
2235
- opts.logLevel = normalizeLogLevel2(logLevel);
2236
- const args = opts.args ? Array.from(opts.args) : [];
2237
- while (args.length && args.shift() !== message) {
2238
- }
2239
- switch (typeof logLevel) {
2240
- case "string":
2241
- case "function":
2242
- if (message !== void 0) {
2243
- args.unshift(message);
2244
- }
2245
- opts.message = logLevel;
2246
- break;
2247
- case "object":
2248
- Object.assign(opts, logLevel);
2249
- break;
2250
- default:
2251
- }
2252
- if (typeof opts.message === "function") {
2253
- opts.message = opts.message();
2254
- }
2255
- const messageType = typeof opts.message;
2256
- assert4(messageType === "string" || messageType === "object");
2257
- return Object.assign(opts, {
2258
- args
2259
- }, opts.opts);
2260
- }
2261
- function decorateMessage2(id, message, opts) {
2262
- if (typeof message === "string") {
2263
- const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
2264
- message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
2265
- message = addColor2(message, opts.color, opts.background);
2266
- }
2267
- return message;
2268
- }
2269
- function logImageInNode2(_ref2) {
2270
- let {
2271
- image,
2272
- message = "",
2273
- scale: scale5 = 1
2274
- } = _ref2;
2275
- let asciify = null;
2276
- try {
2277
- asciify = module.require("asciify-image");
2278
- } catch (error) {
2279
- }
2280
- if (asciify) {
2281
- return () => asciify(image, {
2282
- fit: "box",
2283
- width: "".concat(Math.round(80 * scale5), "%")
2284
- }).then((data) => console.log(data));
2285
- }
2286
- return noop2;
2287
- }
2288
- function logImageInBrowser2(_ref3) {
2289
- let {
2290
- image,
2291
- message = "",
2292
- scale: scale5 = 1
2293
- } = _ref3;
2294
- if (typeof image === "string") {
2295
- const img = new Image();
2296
- img.onload = () => {
2297
- const args = formatImage2(img, message, scale5);
2298
- console.log(...args);
2299
- };
2300
- img.src = image;
2301
- return noop2;
2302
- }
2303
- const element = image.nodeName || "";
2304
- if (element.toLowerCase() === "img") {
2305
- console.log(...formatImage2(image, message, scale5));
2306
- return noop2;
2307
- }
2308
- if (element.toLowerCase() === "canvas") {
2309
- const img = new Image();
2310
- img.onload = () => console.log(...formatImage2(img, message, scale5));
2311
- img.src = image.toDataURL();
2312
- return noop2;
2313
- }
2314
- return noop2;
2315
- }
2316
- function getTableHeader2(table) {
2317
- for (const key in table) {
2318
- for (const title in table[key]) {
2319
- return title || "untitled";
2320
- }
2321
- }
2322
- return "empty";
2323
- }
2324
- var originalConsole2, DEFAULT_SETTINGS2, cache2, ONCE2, Log2;
2325
- var init_log2 = __esm({
2326
- "../../node_modules/@probe.gl/log/dist/esm/log.js"() {
2327
- init_defineProperty();
2328
- init_esm3();
2329
- init_local_storage2();
2330
- init_formatters2();
2331
- init_color2();
2332
- init_autobind2();
2333
- init_assert4();
2334
- init_hi_res_timestamp3();
2335
- originalConsole2 = {
2336
- debug: isBrowser5 ? console.debug || console.log : console.log,
2337
- log: console.log,
2338
- info: console.info,
2339
- warn: console.warn,
2340
- error: console.error
2341
- };
2342
- DEFAULT_SETTINGS2 = {
2343
- enabled: true,
2344
- level: 0
2345
- };
2346
- cache2 = {};
2347
- ONCE2 = {
2348
- once: true
2349
- };
2350
- Log2 = class {
2351
- constructor() {
2352
- let {
2353
- id
2354
- } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
2355
- id: ""
2356
- };
2357
- _defineProperty(this, "id", void 0);
2358
- _defineProperty(this, "VERSION", VERSION4);
2359
- _defineProperty(this, "_startTs", getHiResTimestamp3());
2360
- _defineProperty(this, "_deltaTs", getHiResTimestamp3());
2361
- _defineProperty(this, "_storage", void 0);
2362
- _defineProperty(this, "userData", {});
2363
- _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
2364
- this.id = id;
2365
- this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS2);
2366
- this.userData = {};
2367
- this.timeStamp("".concat(this.id, " started"));
2368
- autobind2(this);
2369
- Object.seal(this);
2370
- }
2371
- set level(newLevel) {
2372
- this.setLevel(newLevel);
2373
- }
2374
- get level() {
2375
- return this.getLevel();
2376
- }
2377
- isEnabled() {
2378
- return this._storage.config.enabled;
2379
- }
2380
- getLevel() {
2381
- return this._storage.config.level;
2382
- }
2383
- getTotal() {
2384
- return Number((getHiResTimestamp3() - this._startTs).toPrecision(10));
2385
- }
2386
- getDelta() {
2387
- return Number((getHiResTimestamp3() - this._deltaTs).toPrecision(10));
2388
- }
2389
- set priority(newPriority) {
2390
- this.level = newPriority;
2391
- }
2392
- get priority() {
2393
- return this.level;
2394
- }
2395
- getPriority() {
2396
- return this.level;
2397
- }
2398
- enable() {
2399
- let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
2400
- this._storage.updateConfiguration({
2401
- enabled
2402
- });
2403
- return this;
2404
- }
2405
- setLevel(level) {
2406
- this._storage.updateConfiguration({
2407
- level
2408
- });
2409
- return this;
2410
- }
2411
- get(setting) {
2412
- return this._storage.config[setting];
2413
- }
2414
- set(setting, value) {
2415
- this._storage.updateConfiguration({
2416
- [setting]: value
2417
- });
2418
- }
2419
- settings() {
2420
- if (console.table) {
2421
- console.table(this._storage.config);
2422
- } else {
2423
- console.log(this._storage.config);
2424
- }
2425
- }
2426
- assert(condition, message) {
2427
- assert4(condition, message);
2428
- }
2429
- warn(message) {
2430
- return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
2431
- }
2432
- error(message) {
2433
- return this._getLogFunction(0, message, originalConsole2.error, arguments);
2434
- }
2435
- deprecated(oldUsage, newUsage) {
2436
- return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
2437
- }
2438
- removed(oldUsage, newUsage) {
2439
- return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
2440
- }
2441
- probe(logLevel, message) {
2442
- return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
2443
- time: true,
2444
- once: true
2445
- });
2446
- }
2447
- log(logLevel, message) {
2448
- return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
2449
- }
2450
- info(logLevel, message) {
2451
- return this._getLogFunction(logLevel, message, console.info, arguments);
2452
- }
2453
- once(logLevel, message) {
2454
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
2455
- args[_key - 2] = arguments[_key];
2456
- }
2457
- return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
2458
- }
2459
- table(logLevel, table, columns) {
2460
- if (table) {
2461
- return this._getLogFunction(logLevel, table, console.table || noop2, columns && [columns], {
2462
- tag: getTableHeader2(table)
2463
- });
2464
- }
2465
- return noop2;
2466
- }
2467
- image(_ref) {
2468
- let {
2469
- logLevel,
2470
- priority,
2471
- image,
2472
- message = "",
2473
- scale: scale5 = 1
2474
- } = _ref;
2475
- if (!this._shouldLog(logLevel || priority)) {
2476
- return noop2;
2477
- }
2478
- return isBrowser5 ? logImageInBrowser2({
2479
- image,
2480
- message,
2481
- scale: scale5
2482
- }) : logImageInNode2({
2483
- image,
2484
- message,
2485
- scale: scale5
2486
- });
2487
- }
2488
- time(logLevel, message) {
2489
- return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
2490
- }
2491
- timeEnd(logLevel, message) {
2492
- return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
2493
- }
2494
- timeStamp(logLevel, message) {
2495
- return this._getLogFunction(logLevel, message, console.timeStamp || noop2);
2496
- }
2497
- group(logLevel, message) {
2498
- let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
2499
- collapsed: false
2500
- };
2501
- const options = normalizeArguments2({
2502
- logLevel,
2503
- message,
2504
- opts
2505
- });
2506
- const {
2507
- collapsed
2508
- } = opts;
2509
- options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
2510
- return this._getLogFunction(options);
2511
- }
2512
- groupCollapsed(logLevel, message) {
2513
- let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2514
- return this.group(logLevel, message, Object.assign({}, opts, {
2515
- collapsed: true
2516
- }));
2517
- }
2518
- groupEnd(logLevel) {
2519
- return this._getLogFunction(logLevel, "", console.groupEnd || noop2);
2520
- }
2521
- withGroup(logLevel, message, func) {
2522
- this.group(logLevel, message)();
2523
- try {
2524
- func();
2525
- } finally {
2526
- this.groupEnd(logLevel)();
2527
- }
2528
- }
2529
- trace() {
2530
- if (console.trace) {
2531
- console.trace();
2532
- }
2533
- }
2534
- _shouldLog(logLevel) {
2535
- return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
2536
- }
2537
- _getLogFunction(logLevel, message, method, args, opts) {
2538
- if (this._shouldLog(logLevel)) {
2539
- opts = normalizeArguments2({
2540
- logLevel,
2541
- message,
2542
- args,
2543
- opts
2544
- });
2545
- method = method || opts.method;
2546
- assert4(method);
2547
- opts.total = this.getTotal();
2548
- opts.delta = this.getDelta();
2549
- this._deltaTs = getHiResTimestamp3();
2550
- const tag = opts.tag || opts.message;
2551
- if (opts.once) {
2552
- if (!cache2[tag]) {
2553
- cache2[tag] = getHiResTimestamp3();
2554
- } else {
2555
- return noop2;
2556
- }
2557
- }
2558
- message = decorateMessage2(this.id, opts.message, opts);
2559
- return method.bind(console, message, ...opts.args);
2560
- }
2561
- return noop2;
2562
- }
2563
- };
2564
- _defineProperty(Log2, "VERSION", VERSION4);
2565
- }
2566
- });
2567
-
2568
- // ../../node_modules/@probe.gl/log/dist/esm/index.js
2569
- var esm_default2;
2570
- var init_esm4 = __esm({
2571
- "../../node_modules/@probe.gl/log/dist/esm/index.js"() {
2572
- init_log2();
2573
- init_log2();
2574
- esm_default2 = new Log2({
2575
- id: "@probe.gl/log"
2576
- });
2577
- }
2578
- });
2579
-
2580
- // ../core/src/lib/utils/log.ts
2581
- var log;
2582
- var init_log3 = __esm({
2583
- "../core/src/lib/utils/log.ts"() {
2584
- init_esm4();
2585
- log = new Log2({ id: "loaders.gl" });
2586
- }
2587
- });
2588
-
2589
- // ../core/src/lib/api/select-loader.ts
2590
- async function selectLoader(data, loaders = [], options, context) {
2591
- if (!validHTTPResponse(data)) {
2592
- return null;
2593
- }
2594
- let loader = selectLoaderSync(data, loaders, { ...options, nothrow: true }, context);
2595
- if (loader) {
2596
- return loader;
2597
- }
2598
- if (isBlob(data)) {
2599
- data = await data.slice(0, 10).arrayBuffer();
2600
- loader = selectLoaderSync(data, loaders, options, context);
2601
- }
2602
- if (!loader && !options?.nothrow) {
2603
- throw new Error(getNoValidLoaderMessage(data));
2604
- }
2605
- return loader;
2606
- }
2607
- function selectLoaderSync(data, loaders = [], options, context) {
2608
- if (!validHTTPResponse(data)) {
2011
+ return loader;
2012
+ }
2013
+ function selectLoaderSync(data, loaders = [], options, context) {
2014
+ if (!validHTTPResponse(data)) {
2609
2015
  return null;
2610
2016
  }
2611
2017
  if (loaders && !Array.isArray(loaders)) {
@@ -2771,7 +2177,7 @@
2771
2177
  "../core/src/lib/api/select-loader.ts"() {
2772
2178
  init_src2();
2773
2179
  init_normalize_loader();
2774
- init_log3();
2180
+ init_log2();
2775
2181
  init_resource_utils();
2776
2182
  init_register_loaders();
2777
2183
  init_is_type();
@@ -3088,26 +2494,24 @@
3088
2494
  "../core/src/index.ts"() {
3089
2495
  init_parse();
3090
2496
  init_load();
2497
+ init_src2();
3091
2498
  }
3092
2499
  });
3093
2500
 
3094
2501
  // ../../node_modules/@math.gl/core/dist/esm/lib/assert.js
3095
- function assert5(condition, message) {
2502
+ function assert4(condition, message) {
3096
2503
  if (!condition) {
3097
2504
  throw new Error("math.gl assertion ".concat(message));
3098
2505
  }
3099
2506
  }
3100
- var init_assert5 = __esm({
2507
+ var init_assert4 = __esm({
3101
2508
  "../../node_modules/@math.gl/core/dist/esm/lib/assert.js"() {
3102
2509
  }
3103
2510
  });
3104
2511
 
3105
2512
  // ../../node_modules/@math.gl/core/dist/esm/lib/common.js
3106
- function round(value) {
3107
- return Math.round(value / config.EPSILON) * config.EPSILON;
3108
- }
3109
2513
  function formatValue(value, {
3110
- precision = config.precision || 4
2514
+ precision = config.precision
3111
2515
  } = {}) {
3112
2516
  value = round(value);
3113
2517
  return "".concat(parseFloat(value.toPrecision(precision)));
@@ -3115,19 +2519,6 @@
3115
2519
  function isArray(value) {
3116
2520
  return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);
3117
2521
  }
3118
- function duplicateArray(array) {
3119
- return array.clone ? array.clone() : new Array(array.length);
3120
- }
3121
- function map(value, func, result) {
3122
- if (isArray(value)) {
3123
- result = result || duplicateArray(value);
3124
- for (let i2 = 0; i2 < result.length && i2 < value.length; ++i2) {
3125
- result[i2] = func(value[i2], i2, result);
3126
- }
3127
- return result;
3128
- }
3129
- return func(value);
3130
- }
3131
2522
  function toRadians(degrees2) {
3132
2523
  return radians(degrees2);
3133
2524
  }
@@ -3166,26 +2557,44 @@
3166
2557
  if (b && b.equals) {
3167
2558
  return b.equals(a2);
3168
2559
  }
3169
- if (Number.isFinite(a2) && Number.isFinite(b)) {
2560
+ if (typeof a2 === "number" && typeof b === "number") {
3170
2561
  return Math.abs(a2 - b) <= config.EPSILON * Math.max(1, Math.abs(a2), Math.abs(b));
3171
2562
  }
3172
- return false;
3173
- } finally {
3174
- config.EPSILON = oldEpsilon;
2563
+ return false;
2564
+ } finally {
2565
+ config.EPSILON = oldEpsilon;
2566
+ }
2567
+ }
2568
+ function round(value) {
2569
+ return Math.round(value / config.EPSILON) * config.EPSILON;
2570
+ }
2571
+ function duplicateArray(array) {
2572
+ return array.clone ? array.clone() : new Array(array.length);
2573
+ }
2574
+ function map(value, func, result) {
2575
+ if (isArray(value)) {
2576
+ const array = value;
2577
+ result = result || duplicateArray(array);
2578
+ for (let i2 = 0; i2 < result.length && i2 < array.length; ++i2) {
2579
+ result[i2] = func(value[i2], i2, result);
2580
+ }
2581
+ return result;
3175
2582
  }
2583
+ return func(value);
3176
2584
  }
3177
2585
  var RADIANS_TO_DEGREES, DEGREES_TO_RADIANS, config;
3178
2586
  var init_common = __esm({
3179
2587
  "../../node_modules/@math.gl/core/dist/esm/lib/common.js"() {
3180
2588
  RADIANS_TO_DEGREES = 1 / Math.PI * 180;
3181
2589
  DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
3182
- config = {};
3183
- config.EPSILON = 1e-12;
3184
- config.debug = false;
3185
- config.precision = 4;
3186
- config.printTypes = false;
3187
- config.printDegrees = false;
3188
- config.printRowMajor = true;
2590
+ config = {
2591
+ EPSILON: 1e-12,
2592
+ debug: false,
2593
+ precision: 4,
2594
+ printTypes: false,
2595
+ printDegrees: false,
2596
+ printRowMajor: true
2597
+ };
3189
2598
  }
3190
2599
  });
3191
2600
 
@@ -3215,24 +2624,25 @@
3215
2624
  var init_math_array = __esm({
3216
2625
  "../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js"() {
3217
2626
  init_common();
3218
- init_assert5();
3219
2627
  MathArray = class extends _extendableBuiltin(Array) {
3220
- get ELEMENTS() {
3221
- assert5(false);
3222
- return 0;
3223
- }
3224
2628
  clone() {
3225
2629
  return new this.constructor().copy(this);
3226
2630
  }
3227
- from(arrayOrObject) {
3228
- return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
3229
- }
3230
2631
  fromArray(array, offset = 0) {
3231
2632
  for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
3232
2633
  this[i2] = array[i2 + offset];
3233
2634
  }
3234
2635
  return this.check();
3235
2636
  }
2637
+ toArray(targetArray = [], offset = 0) {
2638
+ for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
2639
+ targetArray[offset + i2] = this[i2];
2640
+ }
2641
+ return targetArray;
2642
+ }
2643
+ from(arrayOrObject) {
2644
+ return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
2645
+ }
3236
2646
  to(arrayOrObject) {
3237
2647
  if (arrayOrObject === this) {
3238
2648
  return this;
@@ -3242,12 +2652,6 @@
3242
2652
  toTarget(target) {
3243
2653
  return target ? this.to(target) : this;
3244
2654
  }
3245
- toArray(array = [], offset = 0) {
3246
- for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
3247
- array[offset + i2] = this[i2];
3248
- }
3249
- return array;
3250
- }
3251
2655
  toFloat32Array() {
3252
2656
  return new Float32Array(this);
3253
2657
  }
@@ -3291,9 +2695,7 @@
3291
2695
  }
3292
2696
  lerp(a2, b, t2) {
3293
2697
  if (t2 === void 0) {
3294
- t2 = b;
3295
- b = a2;
3296
- a2 = this;
2698
+ return this.lerp(this, a2, b);
3297
2699
  }
3298
2700
  for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
3299
2701
  const ai = a2[i2];
@@ -3336,14 +2738,36 @@
3336
2738
  return this.check();
3337
2739
  }
3338
2740
  scale(scale5) {
3339
- if (Array.isArray(scale5)) {
3340
- return this.multiply(scale5);
2741
+ if (typeof scale5 === "number") {
2742
+ for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
2743
+ this[i2] *= scale5;
2744
+ }
2745
+ } else {
2746
+ for (let i2 = 0; i2 < this.ELEMENTS && i2 < scale5.length; ++i2) {
2747
+ this[i2] *= scale5[i2];
2748
+ }
3341
2749
  }
2750
+ return this.check();
2751
+ }
2752
+ multiplyByScalar(scalar) {
3342
2753
  for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
3343
- this[i2] *= scale5;
2754
+ this[i2] *= scalar;
3344
2755
  }
3345
2756
  return this.check();
3346
2757
  }
2758
+ check() {
2759
+ if (config.debug && !this.validate()) {
2760
+ throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
2761
+ }
2762
+ return this;
2763
+ }
2764
+ validate() {
2765
+ let valid = this.length === this.ELEMENTS;
2766
+ for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
2767
+ valid = valid && Number.isFinite(this[i2]);
2768
+ }
2769
+ return valid;
2770
+ }
3347
2771
  sub(a2) {
3348
2772
  return this.subtract(a2);
3349
2773
  }
@@ -3369,7 +2793,7 @@
3369
2793
  return this.check();
3370
2794
  }
3371
2795
  divideScalar(a2) {
3372
- return this.scale(1 / a2);
2796
+ return this.multiplyByScalar(1 / a2);
3373
2797
  }
3374
2798
  clampScalar(min, max) {
3375
2799
  for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
@@ -3377,25 +2801,9 @@
3377
2801
  }
3378
2802
  return this.check();
3379
2803
  }
3380
- multiplyByScalar(scalar) {
3381
- return this.scale(scalar);
3382
- }
3383
2804
  get elements() {
3384
2805
  return this;
3385
2806
  }
3386
- check() {
3387
- if (config.debug && !this.validate()) {
3388
- throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
3389
- }
3390
- return this;
3391
- }
3392
- validate() {
3393
- let valid = this.length === this.ELEMENTS;
3394
- for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
3395
- valid = valid && Number.isFinite(this[i2]);
3396
- }
3397
- return valid;
3398
- }
3399
2807
  };
3400
2808
  }
3401
2809
  });
@@ -3424,17 +2832,9 @@
3424
2832
  }
3425
2833
  return v;
3426
2834
  }
3427
- function deprecated(method, version) {
3428
- if (!map2[method]) {
3429
- map2[method] = true;
3430
- console.warn("".concat(method, " has been removed in version ").concat(version, ", see upgrade guide for more information"));
3431
- }
3432
- }
3433
- var map2;
3434
2835
  var init_validators = __esm({
3435
2836
  "../../node_modules/@math.gl/core/dist/esm/lib/validators.js"() {
3436
2837
  init_common();
3437
- map2 = {};
3438
2838
  }
3439
2839
  });
3440
2840
 
@@ -3444,16 +2844,8 @@
3444
2844
  "../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js"() {
3445
2845
  init_math_array();
3446
2846
  init_validators();
3447
- init_assert5();
2847
+ init_assert4();
3448
2848
  Vector = class extends MathArray {
3449
- get ELEMENTS() {
3450
- assert5(false);
3451
- return 0;
3452
- }
3453
- copy(vector) {
3454
- assert5(false);
3455
- return this;
3456
- }
3457
2849
  get x() {
3458
2850
  return this[0];
3459
2851
  }
@@ -3535,11 +2927,11 @@
3535
2927
  return this.distanceSquared(vector);
3536
2928
  }
3537
2929
  getComponent(i2) {
3538
- assert5(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
2930
+ assert4(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
3539
2931
  return checkNumber(this[i2]);
3540
2932
  }
3541
2933
  setComponent(i2, value) {
3542
- assert5(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
2934
+ assert4(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
3543
2935
  this[i2] = value;
3544
2936
  return this.check();
3545
2937
  }
@@ -3658,6 +3050,15 @@
3658
3050
  out[2] = a2[2];
3659
3051
  return out;
3660
3052
  }
3053
+ function vec4_transformMat2(out, a2, m) {
3054
+ const x = a2[0];
3055
+ const y = a2[1];
3056
+ out[0] = m[0] * x + m[2] * y;
3057
+ out[1] = m[1] * x + m[3] * y;
3058
+ out[2] = a2[2];
3059
+ out[3] = a2[3];
3060
+ return out;
3061
+ }
3661
3062
  function vec4_transformMat3(out, a2, m) {
3662
3063
  const x = a2[0];
3663
3064
  const y = a2[1];
@@ -3832,7 +3233,7 @@
3832
3233
  });
3833
3234
 
3834
3235
  // ../../node_modules/@math.gl/core/dist/esm/classes/vector3.js
3835
- var ORIGIN, constants, Vector3;
3236
+ var ORIGIN, ZERO, Vector3;
3836
3237
  var init_vector3 = __esm({
3837
3238
  "../../node_modules/@math.gl/core/dist/esm/classes/vector3.js"() {
3838
3239
  init_vector();
@@ -3841,10 +3242,13 @@
3841
3242
  init_vec3();
3842
3243
  init_gl_matrix_extras();
3843
3244
  ORIGIN = [0, 0, 0];
3844
- constants = {};
3845
3245
  Vector3 = class extends Vector {
3846
3246
  static get ZERO() {
3847
- return constants.ZERO = constants.ZERO || Object.freeze(new Vector3(0, 0, 0, 0));
3247
+ if (!ZERO) {
3248
+ ZERO = new Vector3(0, 0, 0);
3249
+ Object.freeze(ZERO);
3250
+ }
3251
+ return ZERO;
3848
3252
  }
3849
3253
  constructor(x = 0, y = 0, z = 0) {
3850
3254
  super(-0, -0, -0);
@@ -3954,6 +3358,113 @@
3954
3358
  }
3955
3359
  });
3956
3360
 
3361
+ // ../../node_modules/@math.gl/core/dist/esm/classes/vector4.js
3362
+ var ZERO2, Vector4;
3363
+ var init_vector4 = __esm({
3364
+ "../../node_modules/@math.gl/core/dist/esm/classes/vector4.js"() {
3365
+ init_vector();
3366
+ init_common();
3367
+ init_validators();
3368
+ init_vec3();
3369
+ init_gl_matrix_extras();
3370
+ Vector4 = class extends Vector {
3371
+ static get ZERO() {
3372
+ if (!ZERO2) {
3373
+ ZERO2 = new Vector4(0, 0, 0, 0);
3374
+ Object.freeze(ZERO2);
3375
+ }
3376
+ return ZERO2;
3377
+ }
3378
+ constructor(x = 0, y = 0, z = 0, w = 0) {
3379
+ super(-0, -0, -0, -0);
3380
+ if (isArray(x) && arguments.length === 1) {
3381
+ this.copy(x);
3382
+ } else {
3383
+ if (config.debug) {
3384
+ checkNumber(x);
3385
+ checkNumber(y);
3386
+ checkNumber(z);
3387
+ checkNumber(w);
3388
+ }
3389
+ this[0] = x;
3390
+ this[1] = y;
3391
+ this[2] = z;
3392
+ this[3] = w;
3393
+ }
3394
+ }
3395
+ set(x, y, z, w) {
3396
+ this[0] = x;
3397
+ this[1] = y;
3398
+ this[2] = z;
3399
+ this[3] = w;
3400
+ return this.check();
3401
+ }
3402
+ copy(array) {
3403
+ this[0] = array[0];
3404
+ this[1] = array[1];
3405
+ this[2] = array[2];
3406
+ this[3] = array[3];
3407
+ return this.check();
3408
+ }
3409
+ fromObject(object) {
3410
+ if (config.debug) {
3411
+ checkNumber(object.x);
3412
+ checkNumber(object.y);
3413
+ checkNumber(object.z);
3414
+ checkNumber(object.w);
3415
+ }
3416
+ this[0] = object.x;
3417
+ this[1] = object.y;
3418
+ this[2] = object.z;
3419
+ this[3] = object.w;
3420
+ return this;
3421
+ }
3422
+ toObject(object) {
3423
+ object.x = this[0];
3424
+ object.y = this[1];
3425
+ object.z = this[2];
3426
+ object.w = this[3];
3427
+ return object;
3428
+ }
3429
+ get ELEMENTS() {
3430
+ return 4;
3431
+ }
3432
+ get z() {
3433
+ return this[2];
3434
+ }
3435
+ set z(value) {
3436
+ this[2] = checkNumber(value);
3437
+ }
3438
+ get w() {
3439
+ return this[3];
3440
+ }
3441
+ set w(value) {
3442
+ this[3] = checkNumber(value);
3443
+ }
3444
+ transform(matrix4) {
3445
+ transformMat42(this, this, matrix4);
3446
+ return this.check();
3447
+ }
3448
+ transformByMatrix3(matrix3) {
3449
+ vec4_transformMat3(this, this, matrix3);
3450
+ return this.check();
3451
+ }
3452
+ transformByMatrix2(matrix2) {
3453
+ vec4_transformMat2(this, this, matrix2);
3454
+ return this.check();
3455
+ }
3456
+ transformByQuaternion(quaternion) {
3457
+ transformQuat(this, this, quaternion);
3458
+ return this.check();
3459
+ }
3460
+ applyMatrix4(m) {
3461
+ m.transform(this, this);
3462
+ return this;
3463
+ }
3464
+ };
3465
+ }
3466
+ });
3467
+
3957
3468
  // ../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js
3958
3469
  var Matrix;
3959
3470
  var init_matrix = __esm({
@@ -3961,16 +3472,7 @@
3961
3472
  init_math_array();
3962
3473
  init_validators();
3963
3474
  init_common();
3964
- init_assert5();
3965
3475
  Matrix = class extends MathArray {
3966
- get ELEMENTS() {
3967
- assert5(false);
3968
- return 0;
3969
- }
3970
- get RANK() {
3971
- assert5(false);
3972
- return 0;
3973
- }
3974
3476
  toString() {
3975
3477
  let string = "[";
3976
3478
  if (config.printRowMajor) {
@@ -4173,7 +3675,21 @@
4173
3675
  });
4174
3676
 
4175
3677
  // ../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js
4176
- var IDENTITY, ZERO, INDICES, constants2, Matrix3;
3678
+ function getZeroMatrix() {
3679
+ if (!ZERO_MATRIX3) {
3680
+ ZERO_MATRIX3 = new Matrix3([0, 0, 0, 0, 0, 0, 0, 0, 0]);
3681
+ Object.freeze(ZERO_MATRIX3);
3682
+ }
3683
+ return ZERO_MATRIX3;
3684
+ }
3685
+ function getIdentityMatrix() {
3686
+ if (!IDENTITY_MATRIX3) {
3687
+ IDENTITY_MATRIX3 = new Matrix3();
3688
+ Object.freeze(IDENTITY_MATRIX3);
3689
+ }
3690
+ return IDENTITY_MATRIX3;
3691
+ }
3692
+ var INDICES, IDENTITY_MATRIX, Matrix3, ZERO_MATRIX3, IDENTITY_MATRIX3;
4177
3693
  var init_matrix3 = __esm({
4178
3694
  "../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js"() {
4179
3695
  init_matrix();
@@ -4182,28 +3698,24 @@
4182
3698
  init_mat3();
4183
3699
  init_vec2();
4184
3700
  init_vec3();
4185
- IDENTITY = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
4186
- ZERO = Object.freeze([0, 0, 0, 0, 0, 0, 0, 0, 0]);
4187
- INDICES = Object.freeze({
4188
- COL0ROW0: 0,
4189
- COL0ROW1: 1,
4190
- COL0ROW2: 2,
4191
- COL1ROW0: 3,
4192
- COL1ROW1: 4,
4193
- COL1ROW2: 5,
4194
- COL2ROW0: 6,
4195
- COL2ROW1: 7,
4196
- COL2ROW2: 8
4197
- });
4198
- constants2 = {};
3701
+ (function(INDICES3) {
3702
+ INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
3703
+ INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
3704
+ INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
3705
+ INDICES3[INDICES3["COL1ROW0"] = 3] = "COL1ROW0";
3706
+ INDICES3[INDICES3["COL1ROW1"] = 4] = "COL1ROW1";
3707
+ INDICES3[INDICES3["COL1ROW2"] = 5] = "COL1ROW2";
3708
+ INDICES3[INDICES3["COL2ROW0"] = 6] = "COL2ROW0";
3709
+ INDICES3[INDICES3["COL2ROW1"] = 7] = "COL2ROW1";
3710
+ INDICES3[INDICES3["COL2ROW2"] = 8] = "COL2ROW2";
3711
+ })(INDICES || (INDICES = {}));
3712
+ IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
4199
3713
  Matrix3 = class extends Matrix {
4200
3714
  static get IDENTITY() {
4201
- constants2.IDENTITY = constants2.IDENTITY || Object.freeze(new Matrix3(IDENTITY));
4202
- return constants2.IDENTITY;
3715
+ return getIdentityMatrix();
4203
3716
  }
4204
3717
  static get ZERO() {
4205
- constants2.ZERO = constants2.ZERO || Object.freeze(new Matrix3(ZERO));
4206
- return constants2.ZERO;
3718
+ return getZeroMatrix();
4207
3719
  }
4208
3720
  get ELEMENTS() {
4209
3721
  return 9;
@@ -4214,10 +3726,12 @@
4214
3726
  get INDICES() {
4215
3727
  return INDICES;
4216
3728
  }
4217
- constructor(array) {
3729
+ constructor(array, ...args) {
4218
3730
  super(-0, -0, -0, -0, -0, -0, -0, -0, -0);
4219
3731
  if (arguments.length === 1 && Array.isArray(array)) {
4220
3732
  this.copy(array);
3733
+ } else if (args.length > 0) {
3734
+ this.copy([array, ...args]);
4221
3735
  } else {
4222
3736
  this.identity();
4223
3737
  }
@@ -4234,6 +3748,16 @@
4234
3748
  this[8] = array[8];
4235
3749
  return this.check();
4236
3750
  }
3751
+ identity() {
3752
+ return this.copy(IDENTITY_MATRIX);
3753
+ }
3754
+ fromObject(object) {
3755
+ return this.check();
3756
+ }
3757
+ fromQuaternion(q) {
3758
+ fromQuat(this, q);
3759
+ return this.check();
3760
+ }
4237
3761
  set(m00, m10, m20, m01, m11, m21, m02, m12, m22) {
4238
3762
  this[0] = m00;
4239
3763
  this[1] = m10;
@@ -4261,13 +3785,6 @@
4261
3785
  determinant() {
4262
3786
  return determinant(this);
4263
3787
  }
4264
- identity() {
4265
- return this.copy(IDENTITY);
4266
- }
4267
- fromQuaternion(q) {
4268
- fromQuat(this, q);
4269
- return this.check();
4270
- }
4271
3788
  transpose() {
4272
3789
  transpose(this, this);
4273
3790
  return this.check();
@@ -4292,7 +3809,7 @@
4292
3809
  if (Array.isArray(factor)) {
4293
3810
  scale(this, this, factor);
4294
3811
  } else {
4295
- scale(this, this, [factor, factor, factor]);
3812
+ scale(this, this, [factor, factor]);
4296
3813
  }
4297
3814
  return this.check();
4298
3815
  }
@@ -4301,32 +3818,30 @@
4301
3818
  return this.check();
4302
3819
  }
4303
3820
  transform(vector, result) {
3821
+ let out;
4304
3822
  switch (vector.length) {
4305
3823
  case 2:
4306
- result = transformMat3(result || [-0, -0], vector, this);
3824
+ out = transformMat3(result || [-0, -0], vector, this);
4307
3825
  break;
4308
3826
  case 3:
4309
- result = transformMat32(result || [-0, -0, -0], vector, this);
3827
+ out = transformMat32(result || [-0, -0, -0], vector, this);
4310
3828
  break;
4311
3829
  case 4:
4312
- result = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);
3830
+ out = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);
4313
3831
  break;
4314
3832
  default:
4315
3833
  throw new Error("Illegal vector");
4316
3834
  }
4317
- checkVector(result, vector.length);
4318
- return result;
3835
+ checkVector(out, vector.length);
3836
+ return out;
4319
3837
  }
4320
3838
  transformVector(vector, result) {
4321
- deprecated("Matrix3.transformVector");
4322
3839
  return this.transform(vector, result);
4323
3840
  }
4324
3841
  transformVector2(vector, result) {
4325
- deprecated("Matrix3.transformVector");
4326
3842
  return this.transform(vector, result);
4327
3843
  }
4328
3844
  transformVector3(vector, result) {
4329
- deprecated("Matrix3.transformVector");
4330
3845
  return this.transform(vector, result);
4331
3846
  }
4332
3847
  };
@@ -4770,7 +4285,7 @@
4770
4285
  out[15] = 0;
4771
4286
  return out;
4772
4287
  }
4773
- function perspective(out, fovy, aspect, near, far) {
4288
+ function perspectiveNO(out, fovy, aspect, near, far) {
4774
4289
  var f2 = 1 / Math.tan(fovy / 2), nf;
4775
4290
  out[0] = f2 / aspect;
4776
4291
  out[1] = 0;
@@ -4796,7 +4311,7 @@
4796
4311
  }
4797
4312
  return out;
4798
4313
  }
4799
- function ortho(out, left, right, bottom, top, near, far) {
4314
+ function orthoNO(out, left, right, bottom, top, near, far) {
4800
4315
  var lr = 1 / (left - right);
4801
4316
  var bt = 1 / (bottom - top);
4802
4317
  var nf = 1 / (near - far);
@@ -4885,9 +4400,12 @@
4885
4400
  out[15] = 1;
4886
4401
  return out;
4887
4402
  }
4403
+ var perspective, ortho;
4888
4404
  var init_mat4 = __esm({
4889
4405
  "../../node_modules/gl-matrix/esm/mat4.js"() {
4890
4406
  init_common2();
4407
+ perspective = perspectiveNO;
4408
+ ortho = orthoNO;
4891
4409
  }
4892
4410
  });
4893
4411
 
@@ -5017,48 +4535,90 @@
5017
4535
  });
5018
4536
 
5019
4537
  // ../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js
5020
- var IDENTITY2, ZERO2, INDICES2, constants3, Matrix4;
4538
+ function getZeroMatrix2() {
4539
+ if (!ZERO3) {
4540
+ ZERO3 = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
4541
+ Object.freeze(ZERO3);
4542
+ }
4543
+ return ZERO3;
4544
+ }
4545
+ function getIdentityMatrix2() {
4546
+ if (!IDENTITY) {
4547
+ IDENTITY = new Matrix4();
4548
+ Object.freeze(IDENTITY);
4549
+ }
4550
+ return IDENTITY;
4551
+ }
4552
+ function checkRadians(possiblyDegrees) {
4553
+ if (possiblyDegrees > Math.PI * 2) {
4554
+ throw Error("expected radians");
4555
+ }
4556
+ }
4557
+ function computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {
4558
+ const column0Row0 = 2 * near / (right - left);
4559
+ const column1Row1 = 2 * near / (top - bottom);
4560
+ const column2Row0 = (right + left) / (right - left);
4561
+ const column2Row1 = (top + bottom) / (top - bottom);
4562
+ const column2Row2 = -1;
4563
+ const column2Row3 = -1;
4564
+ const column3Row2 = -2 * near;
4565
+ result[0] = column0Row0;
4566
+ result[1] = 0;
4567
+ result[2] = 0;
4568
+ result[3] = 0;
4569
+ result[4] = 0;
4570
+ result[5] = column1Row1;
4571
+ result[6] = 0;
4572
+ result[7] = 0;
4573
+ result[8] = column2Row0;
4574
+ result[9] = column2Row1;
4575
+ result[10] = column2Row2;
4576
+ result[11] = column2Row3;
4577
+ result[12] = 0;
4578
+ result[13] = 0;
4579
+ result[14] = column3Row2;
4580
+ result[15] = 0;
4581
+ return result;
4582
+ }
4583
+ var INDICES2, DEFAULT_FOVY, DEFAULT_ASPECT, DEFAULT_NEAR, DEFAULT_FAR, IDENTITY_MATRIX2, Matrix4, ZERO3, IDENTITY;
5021
4584
  var init_matrix4 = __esm({
5022
4585
  "../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js"() {
5023
- init_validators();
5024
4586
  init_matrix();
4587
+ init_validators();
5025
4588
  init_gl_matrix_extras();
5026
4589
  init_mat4();
5027
4590
  init_vec2();
5028
4591
  init_vec3();
5029
4592
  init_vec4();
5030
- IDENTITY2 = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
5031
- ZERO2 = Object.freeze([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
5032
- INDICES2 = Object.freeze({
5033
- COL0ROW0: 0,
5034
- COL0ROW1: 1,
5035
- COL0ROW2: 2,
5036
- COL0ROW3: 3,
5037
- COL1ROW0: 4,
5038
- COL1ROW1: 5,
5039
- COL1ROW2: 6,
5040
- COL1ROW3: 7,
5041
- COL2ROW0: 8,
5042
- COL2ROW1: 9,
5043
- COL2ROW2: 10,
5044
- COL2ROW3: 11,
5045
- COL3ROW0: 12,
5046
- COL3ROW1: 13,
5047
- COL3ROW2: 14,
5048
- COL3ROW3: 15
5049
- });
5050
- constants3 = {};
4593
+ (function(INDICES3) {
4594
+ INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
4595
+ INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
4596
+ INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
4597
+ INDICES3[INDICES3["COL0ROW3"] = 3] = "COL0ROW3";
4598
+ INDICES3[INDICES3["COL1ROW0"] = 4] = "COL1ROW0";
4599
+ INDICES3[INDICES3["COL1ROW1"] = 5] = "COL1ROW1";
4600
+ INDICES3[INDICES3["COL1ROW2"] = 6] = "COL1ROW2";
4601
+ INDICES3[INDICES3["COL1ROW3"] = 7] = "COL1ROW3";
4602
+ INDICES3[INDICES3["COL2ROW0"] = 8] = "COL2ROW0";
4603
+ INDICES3[INDICES3["COL2ROW1"] = 9] = "COL2ROW1";
4604
+ INDICES3[INDICES3["COL2ROW2"] = 10] = "COL2ROW2";
4605
+ INDICES3[INDICES3["COL2ROW3"] = 11] = "COL2ROW3";
4606
+ INDICES3[INDICES3["COL3ROW0"] = 12] = "COL3ROW0";
4607
+ INDICES3[INDICES3["COL3ROW1"] = 13] = "COL3ROW1";
4608
+ INDICES3[INDICES3["COL3ROW2"] = 14] = "COL3ROW2";
4609
+ INDICES3[INDICES3["COL3ROW3"] = 15] = "COL3ROW3";
4610
+ })(INDICES2 || (INDICES2 = {}));
4611
+ DEFAULT_FOVY = 45 * Math.PI / 180;
4612
+ DEFAULT_ASPECT = 1;
4613
+ DEFAULT_NEAR = 0.1;
4614
+ DEFAULT_FAR = 500;
4615
+ IDENTITY_MATRIX2 = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
5051
4616
  Matrix4 = class extends Matrix {
5052
4617
  static get IDENTITY() {
5053
- constants3.IDENTITY = constants3.IDENTITY || Object.freeze(new Matrix4(IDENTITY2));
5054
- return constants3.IDENTITY;
4618
+ return getIdentityMatrix2();
5055
4619
  }
5056
4620
  static get ZERO() {
5057
- constants3.ZERO = constants3.ZERO || Object.freeze(new Matrix4(ZERO2));
5058
- return constants3.ZERO;
5059
- }
5060
- get INDICES() {
5061
- return INDICES2;
4621
+ return getZeroMatrix2();
5062
4622
  }
5063
4623
  get ELEMENTS() {
5064
4624
  return 16;
@@ -5066,6 +4626,9 @@
5066
4626
  get RANK() {
5067
4627
  return 4;
5068
4628
  }
4629
+ get INDICES() {
4630
+ return INDICES2;
4631
+ }
5069
4632
  constructor(array) {
5070
4633
  super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);
5071
4634
  if (arguments.length === 1 && Array.isArray(array)) {
@@ -5151,91 +4714,65 @@
5151
4714
  return result;
5152
4715
  }
5153
4716
  identity() {
5154
- return this.copy(IDENTITY2);
4717
+ return this.copy(IDENTITY_MATRIX2);
5155
4718
  }
5156
- fromQuaternion(q) {
5157
- fromQuat2(this, q);
4719
+ fromObject(object) {
5158
4720
  return this.check();
5159
4721
  }
5160
- frustum({
5161
- left,
5162
- right,
5163
- bottom,
5164
- top,
5165
- near,
5166
- far
5167
- }) {
4722
+ fromQuaternion(quaternion) {
4723
+ fromQuat2(this, quaternion);
4724
+ return this.check();
4725
+ }
4726
+ frustum(view) {
4727
+ const {
4728
+ left,
4729
+ right,
4730
+ bottom,
4731
+ top,
4732
+ near = DEFAULT_NEAR,
4733
+ far = DEFAULT_FAR
4734
+ } = view;
5168
4735
  if (far === Infinity) {
5169
- Matrix4._computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);
4736
+ computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);
5170
4737
  } else {
5171
4738
  frustum(this, left, right, bottom, top, near, far);
5172
4739
  }
5173
4740
  return this.check();
5174
4741
  }
5175
- static _computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {
5176
- const column0Row0 = 2 * near / (right - left);
5177
- const column1Row1 = 2 * near / (top - bottom);
5178
- const column2Row0 = (right + left) / (right - left);
5179
- const column2Row1 = (top + bottom) / (top - bottom);
5180
- const column2Row2 = -1;
5181
- const column2Row3 = -1;
5182
- const column3Row2 = -2 * near;
5183
- result[0] = column0Row0;
5184
- result[1] = 0;
5185
- result[2] = 0;
5186
- result[3] = 0;
5187
- result[4] = 0;
5188
- result[5] = column1Row1;
5189
- result[6] = 0;
5190
- result[7] = 0;
5191
- result[8] = column2Row0;
5192
- result[9] = column2Row1;
5193
- result[10] = column2Row2;
5194
- result[11] = column2Row3;
5195
- result[12] = 0;
5196
- result[13] = 0;
5197
- result[14] = column3Row2;
5198
- result[15] = 0;
5199
- return result;
5200
- }
5201
- lookAt(eye, center, up) {
5202
- if (arguments.length === 1) {
5203
- ({
5204
- eye,
5205
- center,
5206
- up
5207
- } = eye);
5208
- }
5209
- center = center || [0, 0, 0];
5210
- up = up || [0, 1, 0];
4742
+ lookAt(view) {
4743
+ const {
4744
+ eye,
4745
+ center = [0, 0, 0],
4746
+ up = [0, 1, 0]
4747
+ } = view;
5211
4748
  lookAt(this, eye, center, up);
5212
4749
  return this.check();
5213
4750
  }
5214
- ortho({
5215
- left,
5216
- right,
5217
- bottom,
5218
- top,
5219
- near = 0.1,
5220
- far = 500
5221
- }) {
4751
+ ortho(view) {
4752
+ const {
4753
+ left,
4754
+ right,
4755
+ bottom,
4756
+ top,
4757
+ near = DEFAULT_NEAR,
4758
+ far = DEFAULT_FAR
4759
+ } = view;
5222
4760
  ortho(this, left, right, bottom, top, near, far);
5223
4761
  return this.check();
5224
4762
  }
5225
- orthographic({
5226
- fovy = 45 * Math.PI / 180,
5227
- aspect = 1,
5228
- focalDistance = 1,
5229
- near = 0.1,
5230
- far = 500
5231
- }) {
5232
- if (fovy > Math.PI * 2) {
5233
- throw Error("radians");
5234
- }
4763
+ orthographic(view) {
4764
+ const {
4765
+ fovy = DEFAULT_FOVY,
4766
+ aspect = DEFAULT_ASPECT,
4767
+ focalDistance = 1,
4768
+ near = DEFAULT_NEAR,
4769
+ far = DEFAULT_FAR
4770
+ } = view;
4771
+ checkRadians(fovy);
5235
4772
  const halfY = fovy / 2;
5236
4773
  const top = focalDistance * Math.tan(halfY);
5237
4774
  const right = top * aspect;
5238
- return new Matrix4().ortho({
4775
+ return this.ortho({
5239
4776
  left: -right,
5240
4777
  right,
5241
4778
  bottom: -top,
@@ -5244,17 +4781,14 @@
5244
4781
  far
5245
4782
  });
5246
4783
  }
5247
- perspective({
5248
- fovy = void 0,
5249
- fov = 45 * Math.PI / 180,
5250
- aspect = 1,
5251
- near = 0.1,
5252
- far = 500
5253
- } = {}) {
5254
- fovy = fovy || fov;
5255
- if (fovy > Math.PI * 2) {
5256
- throw Error("radians");
5257
- }
4784
+ perspective(view) {
4785
+ const {
4786
+ fovy = 45 * Math.PI / 180,
4787
+ aspect = 1,
4788
+ near = 0.1,
4789
+ far = 500
4790
+ } = view;
4791
+ checkRadians(fovy);
5258
4792
  perspective(this, fovy, aspect, near, far);
5259
4793
  return this.check();
5260
4794
  }
@@ -5273,8 +4807,10 @@
5273
4807
  result[2] = this[14];
5274
4808
  return result;
5275
4809
  }
5276
- getRotation(result = [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0], scaleResult = null) {
5277
- const scale5 = this.getScale(scaleResult || [-0, -0, -0]);
4810
+ getRotation(result, scaleResult) {
4811
+ result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
4812
+ scaleResult = scaleResult || [-0, -0, -0];
4813
+ const scale5 = this.getScale(scaleResult);
5278
4814
  const inverseScale0 = 1 / scale5[0];
5279
4815
  const inverseScale1 = 1 / scale5[1];
5280
4816
  const inverseScale2 = 1 / scale5[2];
@@ -5296,8 +4832,10 @@
5296
4832
  result[15] = 1;
5297
4833
  return result;
5298
4834
  }
5299
- getRotationMatrix3(result = [-0, -0, -0, -0, -0, -0, -0, -0, -0], scaleResult = null) {
5300
- const scale5 = this.getScale(scaleResult || [-0, -0, -0]);
4835
+ getRotationMatrix3(result, scaleResult) {
4836
+ result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];
4837
+ scaleResult = scaleResult || [-0, -0, -0];
4838
+ const scale5 = this.getScale(scaleResult);
5301
4839
  const inverseScale0 = 1 / scale5[0];
5302
4840
  const inverseScale1 = 1 / scale5[1];
5303
4841
  const inverseScale2 = 1 / scale5[2];
@@ -5340,23 +4878,19 @@
5340
4878
  rotateZ2(this, this, radians2);
5341
4879
  return this.check();
5342
4880
  }
5343
- rotateXYZ([rx, ry, rz]) {
5344
- return this.rotateX(rx).rotateY(ry).rotateZ(rz);
4881
+ rotateXYZ(angleXYZ) {
4882
+ return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);
5345
4883
  }
5346
4884
  rotateAxis(radians2, axis) {
5347
4885
  rotate2(this, this, radians2, axis);
5348
4886
  return this.check();
5349
4887
  }
5350
4888
  scale(factor) {
5351
- if (Array.isArray(factor)) {
5352
- scale2(this, this, factor);
5353
- } else {
5354
- scale2(this, this, [factor, factor, factor]);
5355
- }
4889
+ scale2(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);
5356
4890
  return this.check();
5357
4891
  }
5358
- translate(vec) {
5359
- translate2(this, this, vec);
4892
+ translate(vector) {
4893
+ translate2(this, this, vector);
5360
4894
  return this.check();
5361
4895
  }
5362
4896
  transform(vector, result) {
@@ -5371,51 +4905,50 @@
5371
4905
  const {
5372
4906
  length: length4
5373
4907
  } = vector;
4908
+ let out;
5374
4909
  switch (length4) {
5375
4910
  case 2:
5376
- result = transformMat4(result || [-0, -0], vector, this);
4911
+ out = transformMat4(result || [-0, -0], vector, this);
5377
4912
  break;
5378
4913
  case 3:
5379
- result = transformMat42(result || [-0, -0, -0], vector, this);
4914
+ out = transformMat42(result || [-0, -0, -0], vector, this);
5380
4915
  break;
5381
4916
  default:
5382
4917
  throw new Error("Illegal vector");
5383
4918
  }
5384
- checkVector(result, vector.length);
5385
- return result;
4919
+ checkVector(out, vector.length);
4920
+ return out;
5386
4921
  }
5387
4922
  transformAsVector(vector, result) {
4923
+ let out;
5388
4924
  switch (vector.length) {
5389
4925
  case 2:
5390
- result = vec2_transformMat4AsVector(result || [-0, -0], vector, this);
4926
+ out = vec2_transformMat4AsVector(result || [-0, -0], vector, this);
5391
4927
  break;
5392
4928
  case 3:
5393
- result = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);
4929
+ out = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);
5394
4930
  break;
5395
4931
  default:
5396
4932
  throw new Error("Illegal vector");
5397
4933
  }
5398
- checkVector(result, vector.length);
5399
- return result;
5400
- }
5401
- makeRotationX(radians2) {
5402
- return this.identity().rotateX(radians2);
5403
- }
5404
- makeTranslation(x, y, z) {
5405
- return this.identity().translate([x, y, z]);
4934
+ checkVector(out, vector.length);
4935
+ return out;
5406
4936
  }
5407
4937
  transformPoint(vector, result) {
5408
- deprecated("Matrix4.transformPoint", "3.0");
5409
4938
  return this.transformAsPoint(vector, result);
5410
4939
  }
5411
4940
  transformVector(vector, result) {
5412
- deprecated("Matrix4.transformVector", "3.0");
5413
4941
  return this.transformAsPoint(vector, result);
5414
4942
  }
5415
4943
  transformDirection(vector, result) {
5416
- deprecated("Matrix4.transformDirection", "3.0");
5417
4944
  return this.transformAsVector(vector, result);
5418
4945
  }
4946
+ makeRotationX(radians2) {
4947
+ return this.identity().rotateX(radians2);
4948
+ }
4949
+ makeTranslation(x, y, z) {
4950
+ return this.identity().translate([x, y, z]);
4951
+ }
5419
4952
  };
5420
4953
  }
5421
4954
  });
@@ -5642,7 +5175,7 @@
5642
5175
  "../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js"() {
5643
5176
  init_math_array();
5644
5177
  init_validators();
5645
- init_assert5();
5178
+ init_vector4();
5646
5179
  init_quat();
5647
5180
  init_vec4();
5648
5181
  IDENTITY_QUATERNION = [0, 0, 0, 1];
@@ -5669,18 +5202,25 @@
5669
5202
  this[3] = w;
5670
5203
  return this.check();
5671
5204
  }
5205
+ fromObject(object) {
5206
+ this[0] = object.x;
5207
+ this[1] = object.y;
5208
+ this[2] = object.z;
5209
+ this[3] = object.w;
5210
+ return this.check();
5211
+ }
5672
5212
  fromMatrix3(m) {
5673
5213
  fromMat3(this, m);
5674
5214
  return this.check();
5675
5215
  }
5676
- identity() {
5677
- identity2(this);
5678
- return this.check();
5679
- }
5680
5216
  fromAxisRotation(axis, rad) {
5681
5217
  setAxisAngle(this, axis, rad);
5682
5218
  return this.check();
5683
5219
  }
5220
+ identity() {
5221
+ identity2(this);
5222
+ return this.check();
5223
+ }
5684
5224
  setAxisAngle(axis, rad) {
5685
5225
  return this.fromAxisRotation(axis, rad);
5686
5226
  }
@@ -5717,20 +5257,14 @@
5717
5257
  lengthSquared() {
5718
5258
  return squaredLength2(this);
5719
5259
  }
5720
- dot(a2, b) {
5721
- if (b !== void 0) {
5722
- throw new Error("Quaternion.dot only takes one argument");
5723
- }
5260
+ dot(a2) {
5724
5261
  return dot3(this, a2);
5725
5262
  }
5726
5263
  rotationTo(vectorA, vectorB) {
5727
5264
  rotationTo(this, vectorA, vectorB);
5728
5265
  return this.check();
5729
5266
  }
5730
- add(a2, b) {
5731
- if (b !== void 0) {
5732
- throw new Error("Quaternion.add only takes one argument");
5733
- }
5267
+ add(a2) {
5734
5268
  add2(this, this, a2);
5735
5269
  return this.check();
5736
5270
  }
@@ -5747,16 +5281,17 @@
5747
5281
  return this.check();
5748
5282
  }
5749
5283
  lerp(a2, b, t2) {
5284
+ if (t2 === void 0) {
5285
+ return this.lerp(this, a2, b);
5286
+ }
5750
5287
  lerp2(this, a2, b, t2);
5751
5288
  return this.check();
5752
5289
  }
5753
- multiplyRight(a2, b) {
5754
- assert5(!b);
5290
+ multiplyRight(a2) {
5755
5291
  multiply3(this, this, a2);
5756
5292
  return this.check();
5757
5293
  }
5758
- multiplyLeft(a2, b) {
5759
- assert5(!b);
5294
+ multiplyLeft(a2) {
5760
5295
  multiply3(this, a2, this);
5761
5296
  return this.check();
5762
5297
  }
@@ -5788,25 +5323,32 @@
5788
5323
  scale4(this, this, b);
5789
5324
  return this.check();
5790
5325
  }
5791
- slerp(start, target, ratio) {
5326
+ slerp(arg0, arg1, arg2) {
5327
+ let start;
5328
+ let target;
5329
+ let ratio;
5792
5330
  switch (arguments.length) {
5793
5331
  case 1:
5794
5332
  ({
5795
5333
  start = IDENTITY_QUATERNION,
5796
5334
  target,
5797
5335
  ratio
5798
- } = arguments[0]);
5336
+ } = arg0);
5799
5337
  break;
5800
5338
  case 2:
5801
- [target, ratio] = arguments;
5802
5339
  start = this;
5340
+ target = arg0;
5341
+ ratio = arg1;
5803
5342
  break;
5804
5343
  default:
5344
+ start = arg0;
5345
+ target = arg1;
5346
+ ratio = arg2;
5805
5347
  }
5806
5348
  slerp(this, start, target, ratio);
5807
5349
  return this.check();
5808
5350
  }
5809
- transformVector4(vector, result = vector) {
5351
+ transformVector4(vector, result = new Vector4()) {
5810
5352
  transformQuat2(result, vector, this);
5811
5353
  return checkVector(result, 4);
5812
5354
  }
@@ -5816,11 +5358,11 @@
5816
5358
  setFromAxisAngle(axis, rad) {
5817
5359
  return this.setAxisAngle(axis, rad);
5818
5360
  }
5819
- premultiply(a2, b) {
5820
- return this.multiplyLeft(a2, b);
5361
+ premultiply(a2) {
5362
+ return this.multiplyLeft(a2);
5821
5363
  }
5822
- multiply(a2, b) {
5823
- return this.multiplyRight(a2, b);
5364
+ multiply(a2) {
5365
+ return this.multiplyRight(a2);
5824
5366
  }
5825
5367
  };
5826
5368
  }
@@ -5860,26 +5402,15 @@
5860
5402
  });
5861
5403
 
5862
5404
  // ../../node_modules/@math.gl/core/dist/esm/index.js
5863
- var globals5, global_5;
5864
- var init_esm5 = __esm({
5405
+ var init_esm3 = __esm({
5865
5406
  "../../node_modules/@math.gl/core/dist/esm/index.js"() {
5866
- init_common();
5867
5407
  init_vector3();
5868
5408
  init_matrix3();
5869
5409
  init_matrix4();
5870
5410
  init_quaternion();
5871
- init_common();
5872
5411
  init_math_utils();
5873
- init_assert5();
5874
- globals5 = {
5875
- self: typeof self !== "undefined" && self,
5876
- window: typeof window !== "undefined" && window,
5877
- global: typeof global !== "undefined" && global
5878
- };
5879
- global_5 = globals5.global || globals5.self || globals5.window;
5880
- global_5.mathgl = {
5881
- config
5882
- };
5412
+ init_assert4();
5413
+ init_common();
5883
5414
  }
5884
5415
  });
5885
5416
 
@@ -5902,65 +5433,67 @@
5902
5433
  });
5903
5434
 
5904
5435
  // ../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js
5905
- function fromCartographic(cartographic, result, map3 = noop3) {
5906
- if (isArray(cartographic)) {
5907
- result[0] = map3(cartographic[0]);
5908
- result[1] = map3(cartographic[1]);
5909
- result[2] = cartographic[2];
5910
- } else if ("longitude" in cartographic) {
5911
- result[0] = map3(cartographic.longitude);
5912
- result[1] = map3(cartographic.latitude);
5436
+ function identity3(x) {
5437
+ return x;
5438
+ }
5439
+ function fromCartographic(cartographic, result = [], map2 = identity3) {
5440
+ if ("longitude" in cartographic) {
5441
+ result[0] = map2(cartographic.longitude);
5442
+ result[1] = map2(cartographic.latitude);
5913
5443
  result[2] = cartographic.height;
5914
- } else {
5915
- result[0] = map3(cartographic.x);
5916
- result[1] = map3(cartographic.y);
5444
+ } else if ("x" in cartographic) {
5445
+ result[0] = map2(cartographic.x);
5446
+ result[1] = map2(cartographic.y);
5917
5447
  result[2] = cartographic.z;
5448
+ } else {
5449
+ result[0] = map2(cartographic[0]);
5450
+ result[1] = map2(cartographic[1]);
5451
+ result[2] = cartographic[2];
5918
5452
  }
5919
5453
  return result;
5920
5454
  }
5921
- function fromCartographicToRadians(cartographic, vector = scratchVector) {
5922
- return fromCartographic(cartographic, vector, config._cartographicRadians ? noop3 : toRadians);
5455
+ function fromCartographicToRadians(cartographic, vector = []) {
5456
+ return fromCartographic(cartographic, vector, config._cartographicRadians ? identity3 : toRadians);
5923
5457
  }
5924
- function toCartographic(vector, cartographic, map3 = noop3) {
5925
- if (isArray(cartographic)) {
5926
- cartographic[0] = map3(vector[0]);
5927
- cartographic[1] = map3(vector[1]);
5928
- cartographic[2] = vector[2];
5929
- } else if ("longitude" in cartographic) {
5930
- cartographic.longitude = map3(vector[0]);
5931
- cartographic.latitude = map3(vector[1]);
5458
+ function toCartographic(vector, cartographic, map2 = identity3) {
5459
+ if ("longitude" in cartographic) {
5460
+ cartographic.longitude = map2(vector[0]);
5461
+ cartographic.latitude = map2(vector[1]);
5932
5462
  cartographic.height = vector[2];
5933
- } else {
5934
- cartographic.x = map3(vector[0]);
5935
- cartographic.y = map3(vector[1]);
5463
+ } else if ("x" in cartographic) {
5464
+ cartographic.x = map2(vector[0]);
5465
+ cartographic.y = map2(vector[1]);
5936
5466
  cartographic.z = vector[2];
5467
+ } else {
5468
+ cartographic[0] = map2(vector[0]);
5469
+ cartographic[1] = map2(vector[1]);
5470
+ cartographic[2] = vector[2];
5937
5471
  }
5938
5472
  return cartographic;
5939
5473
  }
5940
5474
  function toCartographicFromRadians(vector, cartographic) {
5941
- return toCartographic(vector, cartographic, config._cartographicRadians ? noop3 : toDegrees);
5475
+ return toCartographic(vector, cartographic, config._cartographicRadians ? identity3 : toDegrees);
5942
5476
  }
5943
- var noop3, scratchVector;
5477
+ var scratchVector;
5944
5478
  var init_type_utils = __esm({
5945
5479
  "../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js"() {
5946
- init_esm5();
5480
+ init_esm3();
5947
5481
  init_constants();
5948
- noop3 = (x) => x;
5949
5482
  scratchVector = new Vector3();
5950
5483
  }
5951
5484
  });
5952
5485
 
5953
5486
  // ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js
5954
- function scaleToGeodeticSurface(cartesian, ellipsoid, result = new Vector3()) {
5487
+ function scaleToGeodeticSurface(cartesian, ellipsoid, result = []) {
5955
5488
  const {
5956
5489
  oneOverRadii,
5957
5490
  oneOverRadiiSquared,
5958
5491
  centerToleranceSquared
5959
5492
  } = ellipsoid;
5960
5493
  scratchVector2.from(cartesian);
5961
- const positionX = cartesian.x;
5962
- const positionY = cartesian.y;
5963
- const positionZ = cartesian.z;
5494
+ const positionX = scratchVector2.x;
5495
+ const positionY = scratchVector2.y;
5496
+ const positionZ = scratchVector2.z;
5964
5497
  const oneOverRadiiX = oneOverRadii.x;
5965
5498
  const oneOverRadiiY = oneOverRadii.y;
5966
5499
  const oneOverRadiiZ = oneOverRadii.z;
@@ -5982,7 +5515,7 @@
5982
5515
  const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
5983
5516
  const gradient = scaleToGeodeticSurfaceGradient;
5984
5517
  gradient.set(intersection.x * oneOverRadiiSquaredX * 2, intersection.y * oneOverRadiiSquaredY * 2, intersection.z * oneOverRadiiSquaredZ * 2);
5985
- let lambda = (1 - ratio) * cartesian.len() / (0.5 * gradient.len());
5518
+ let lambda = (1 - ratio) * scratchVector2.len() / (0.5 * gradient.len());
5986
5519
  let correction = 0;
5987
5520
  let xMultiplier;
5988
5521
  let yMultiplier;
@@ -6009,7 +5542,7 @@
6009
5542
  var scratchVector2, scaleToGeodeticSurfaceIntersection, scaleToGeodeticSurfaceGradient;
6010
5543
  var init_scale_to_geodetic_surface = __esm({
6011
5544
  "../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js"() {
6012
- init_esm5();
5545
+ init_esm3();
6013
5546
  scratchVector2 = new Vector3();
6014
5547
  scaleToGeodeticSurfaceIntersection = new Vector3();
6015
5548
  scaleToGeodeticSurfaceGradient = new Vector3();
@@ -6019,7 +5552,7 @@
6019
5552
  // ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/ellipsoid-transform.js
6020
5553
  function localFrameToFixedFrame(ellipsoid, firstAxis, secondAxis, thirdAxis, cartesianOrigin, result) {
6021
5554
  const thirdAxisInferred = VECTOR_PRODUCT_LOCAL_FRAME[firstAxis] && VECTOR_PRODUCT_LOCAL_FRAME[firstAxis][secondAxis];
6022
- assert5(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
5555
+ assert4(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
6023
5556
  let firstAxisVector;
6024
5557
  let secondAxisVector;
6025
5558
  let thirdAxisVector;
@@ -6081,7 +5614,7 @@
6081
5614
  var EPSILON14, scratchOrigin, VECTOR_PRODUCT_LOCAL_FRAME, degeneratePositionLocalFrame, scratchAxisVectors, scratchVector1, scratchVector22, scratchVector3;
6082
5615
  var init_ellipsoid_transform = __esm({
6083
5616
  "../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/ellipsoid-transform.js"() {
6084
- init_esm5();
5617
+ init_esm3();
6085
5618
  EPSILON14 = 1e-14;
6086
5619
  scratchOrigin = new Vector3();
6087
5620
  VECTOR_PRODUCT_LOCAL_FRAME = {
@@ -6145,10 +5678,11 @@
6145
5678
  });
6146
5679
 
6147
5680
  // ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js
6148
- var scratchVector4, scratchNormal, scratchK, scratchPosition, scratchHeight, scratchCartesian, wgs84, Ellipsoid;
5681
+ var scratchVector4, scratchNormal, scratchK, scratchPosition, scratchHeight, scratchCartesian, Ellipsoid;
6149
5682
  var init_ellipsoid = __esm({
6150
5683
  "../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js"() {
6151
- init_esm5();
5684
+ init_defineProperty();
5685
+ init_esm3();
6152
5686
  init_vec3();
6153
5687
  init_constants();
6154
5688
  init_type_utils();
@@ -6161,14 +5695,19 @@
6161
5695
  scratchHeight = new Vector3();
6162
5696
  scratchCartesian = new Vector3();
6163
5697
  Ellipsoid = class {
6164
- static get WGS84() {
6165
- wgs84 = wgs84 || new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z);
6166
- return wgs84;
6167
- }
6168
5698
  constructor(x = 0, y = 0, z = 0) {
6169
- assert5(x >= 0);
6170
- assert5(y >= 0);
6171
- assert5(z >= 0);
5699
+ _defineProperty(this, "radii", void 0);
5700
+ _defineProperty(this, "radiiSquared", void 0);
5701
+ _defineProperty(this, "radiiToTheFourth", void 0);
5702
+ _defineProperty(this, "oneOverRadii", void 0);
5703
+ _defineProperty(this, "oneOverRadiiSquared", void 0);
5704
+ _defineProperty(this, "minimumRadius", void 0);
5705
+ _defineProperty(this, "maximumRadius", void 0);
5706
+ _defineProperty(this, "centerToleranceSquared", math_utils_default.EPSILON1);
5707
+ _defineProperty(this, "squaredXOverSquaredZ", void 0);
5708
+ assert4(x >= 0);
5709
+ assert4(y >= 0);
5710
+ assert4(z >= 0);
6172
5711
  this.radii = new Vector3(x, y, z);
6173
5712
  this.radiiSquared = new Vector3(x * x, y * y, z * z);
6174
5713
  this.radiiToTheFourth = new Vector3(x * x * x * x, y * y * y * y, z * z * z * z);
@@ -6176,7 +5715,6 @@
6176
5715
  this.oneOverRadiiSquared = new Vector3(x === 0 ? 0 : 1 / (x * x), y === 0 ? 0 : 1 / (y * y), z === 0 ? 0 : 1 / (z * z));
6177
5716
  this.minimumRadius = Math.min(x, y, z);
6178
5717
  this.maximumRadius = Math.max(x, y, z);
6179
- this.centerToleranceSquared = math_utils_default.EPSILON1;
6180
5718
  if (this.radiiSquared.z !== 0) {
6181
5719
  this.squaredXOverSquaredZ = this.radiiSquared.x / this.radiiSquared.z;
6182
5720
  }
@@ -6253,8 +5791,8 @@
6253
5791
  return scratchPosition.from(position).scale(this.radii).to(result);
6254
5792
  }
6255
5793
  getSurfaceNormalIntersectionWithZAxis(position, buffer = 0, result = [0, 0, 0]) {
6256
- assert5(equals(this.radii.x, this.radii.y, math_utils_default.EPSILON15));
6257
- assert5(this.radii.z > 0);
5794
+ assert4(equals(this.radii.x, this.radii.y, math_utils_default.EPSILON15));
5795
+ assert4(this.radii.z > 0);
6258
5796
  scratchPosition.from(position);
6259
5797
  const z = scratchPosition.z * (1 - this.squaredXOverSquaredZ);
6260
5798
  if (Math.abs(z) >= this.radii.z - buffer) {
@@ -6263,11 +5801,12 @@
6263
5801
  return scratchPosition.set(0, 0, z).to(result);
6264
5802
  }
6265
5803
  };
5804
+ _defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
6266
5805
  }
6267
5806
  });
6268
5807
 
6269
5808
  // ../../node_modules/@math.gl/geospatial/dist/esm/index.js
6270
- var init_esm6 = __esm({
5809
+ var init_esm4 = __esm({
6271
5810
  "../../node_modules/@math.gl/geospatial/dist/esm/index.js"() {
6272
5811
  init_ellipsoid();
6273
5812
  init_type_utils();
@@ -6702,6 +6241,7 @@
6702
6241
  var DEFAULT_DRACO_OPTIONS, DracoLoader;
6703
6242
  var init_draco_loader = __esm({
6704
6243
  "../draco/src/draco-loader.ts"() {
6244
+ init_src();
6705
6245
  init_version3();
6706
6246
  DEFAULT_DRACO_OPTIONS = {
6707
6247
  draco: {
@@ -6713,7 +6253,7 @@
6713
6253
  };
6714
6254
  DracoLoader = {
6715
6255
  name: "Draco",
6716
- id: "draco",
6256
+ id: isBrowser2 ? "draco" : "draco-nodejs",
6717
6257
  module: "draco",
6718
6258
  shapes: ["mesh"],
6719
6259
  version: VERSION6,
@@ -6759,12 +6299,12 @@
6759
6299
  });
6760
6300
 
6761
6301
  // ../schema/src/lib/utils/assert.ts
6762
- function assert6(condition, message) {
6302
+ function assert5(condition, message) {
6763
6303
  if (!condition) {
6764
6304
  throw new Error(message || "loader assertion failed.");
6765
6305
  }
6766
6306
  }
6767
- var init_assert6 = __esm({
6307
+ var init_assert5 = __esm({
6768
6308
  "../schema/src/lib/utils/assert.ts"() {
6769
6309
  }
6770
6310
  });
@@ -6785,10 +6325,10 @@
6785
6325
  var Schema;
6786
6326
  var init_schema = __esm({
6787
6327
  "../schema/src/lib/schema/impl/schema.ts"() {
6788
- init_assert6();
6328
+ init_assert5();
6789
6329
  Schema = class {
6790
6330
  constructor(fields, metadata) {
6791
- assert6(Array.isArray(fields));
6331
+ assert5(Array.isArray(fields));
6792
6332
  checkNames(fields);
6793
6333
  this.fields = fields;
6794
6334
  this.metadata = metadata || new Map();
@@ -7734,15 +7274,17 @@
7734
7274
  });
7735
7275
  });
7736
7276
  }
7737
- var DRACO_VERSION, DRACO_JS_DECODER_URL, DRACO_WASM_WRAPPER_URL, DRACO_WASM_DECODER_URL, DRACO_ENCODER_URL, loadDecoderPromise;
7277
+ var DRACO_DECODER_VERSION, DRACO_ENCODER_VERSION, STATIC_DECODER_URL, DRACO_JS_DECODER_URL, DRACO_WASM_WRAPPER_URL, DRACO_WASM_DECODER_URL, DRACO_ENCODER_URL, loadDecoderPromise;
7738
7278
  var init_draco_module_loader = __esm({
7739
7279
  "../draco/src/lib/draco-module-loader.ts"() {
7740
7280
  init_src();
7741
- DRACO_VERSION = "1.4.1";
7742
- DRACO_JS_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_VERSION}/draco_decoder.js`;
7743
- DRACO_WASM_WRAPPER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_VERSION}/draco_wasm_wrapper.js`;
7744
- DRACO_WASM_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_VERSION}/draco_decoder.wasm`;
7745
- DRACO_ENCODER_URL = `https://raw.githubusercontent.com/google/draco/${DRACO_VERSION}/javascript/draco_encoder.js`;
7281
+ DRACO_DECODER_VERSION = "1.5.5";
7282
+ DRACO_ENCODER_VERSION = "1.4.1";
7283
+ STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
7284
+ DRACO_JS_DECODER_URL = `${STATIC_DECODER_URL}/draco_decoder.js`;
7285
+ DRACO_WASM_WRAPPER_URL = `${STATIC_DECODER_URL}/draco_wasm_wrapper.js`;
7286
+ DRACO_WASM_DECODER_URL = `${STATIC_DECODER_URL}/draco_decoder.wasm`;
7287
+ DRACO_ENCODER_URL = `https://raw.githubusercontent.com/google/draco/${DRACO_ENCODER_VERSION}/javascript/draco_encoder.js`;
7746
7288
  }
7747
7289
  });
7748
7290
 
@@ -7802,8 +7344,8 @@
7802
7344
  options.wasmBinary = wasmBinary;
7803
7345
  }
7804
7346
  return new Promise((resolve) => {
7805
- BasisModule(options).then((module2) => {
7806
- const { BasisFile, initializeBasis } = module2;
7347
+ BasisModule(options).then((module) => {
7348
+ const { BasisFile, initializeBasis } = module;
7807
7349
  initializeBasis();
7808
7350
  resolve({ BasisFile });
7809
7351
  });
@@ -7833,8 +7375,8 @@
7833
7375
  options.wasmBinary = wasmBinary;
7834
7376
  }
7835
7377
  return new Promise((resolve) => {
7836
- BasisEncoderModule(options).then((module2) => {
7837
- const { BasisFile, KTX2File, initializeBasis, BasisEncoder } = module2;
7378
+ BasisEncoderModule(options).then((module) => {
7379
+ const { BasisFile, KTX2File, initializeBasis, BasisEncoder } = module;
7838
7380
  initializeBasis();
7839
7381
  resolve({ BasisFile, KTX2File, BasisEncoder });
7840
7382
  });
@@ -8406,11 +7948,12 @@
8406
7948
  var BasisWorkerLoader, BasisLoader;
8407
7949
  var init_basis_loader = __esm({
8408
7950
  "../textures/src/basis-loader.ts"() {
7951
+ init_src();
8409
7952
  init_version4();
8410
7953
  init_parse_basis();
8411
7954
  BasisWorkerLoader = {
8412
7955
  name: "Basis",
8413
- id: "basis",
7956
+ id: isBrowser2 ? "basis" : "basis-nodejs",
8414
7957
  module: "textures",
8415
7958
  version: VERSION7,
8416
7959
  worker: true,
@@ -8854,10 +8397,10 @@
8854
8397
  });
8855
8398
 
8856
8399
  // ../../node_modules/@luma.gl/constants/dist/esm/index.js
8857
- var esm_default3;
8858
- var init_esm7 = __esm({
8400
+ var esm_default2;
8401
+ var init_esm5 = __esm({
8859
8402
  "../../node_modules/@luma.gl/constants/dist/esm/index.js"() {
8860
- esm_default3 = {
8403
+ esm_default2 = {
8861
8404
  DEPTH_BUFFER_BIT: 256,
8862
8405
  STENCIL_BUFFER_BIT: 1024,
8863
8406
  COLOR_BUFFER_BIT: 16384,
@@ -9515,14 +9058,14 @@
9515
9058
  var GL_TYPE_MAP, STRING_ATTRIBUTE_TYPE, OBJECT_ID_ATTRIBUTE_TYPE, FLOAT_64_TYPE, INT_16_ATTRIBUTE_TYPE, COORDINATE_SYSTEM;
9516
9059
  var init_constants2 = __esm({
9517
9060
  "src/lib/parsers/constants.ts"() {
9518
- init_esm7();
9061
+ init_esm5();
9519
9062
  init_types();
9520
9063
  GL_TYPE_MAP = {
9521
- UInt8: esm_default3.UNSIGNED_BYTE,
9522
- UInt16: esm_default3.UNSIGNED_INT,
9523
- Float32: esm_default3.FLOAT,
9524
- UInt32: esm_default3.UNSIGNED_INT,
9525
- UInt64: esm_default3.DOUBLE
9064
+ UInt8: esm_default2.UNSIGNED_BYTE,
9065
+ UInt16: esm_default2.UNSIGNED_SHORT,
9066
+ Float32: esm_default2.FLOAT,
9067
+ UInt32: esm_default2.UNSIGNED_INT,
9068
+ UInt64: esm_default2.DOUBLE
9526
9069
  };
9527
9070
  STRING_ATTRIBUTE_TYPE = "String";
9528
9071
  OBJECT_ID_ATTRIBUTE_TYPE = "Oid32";
@@ -9538,6 +9081,249 @@
9538
9081
  }
9539
9082
  });
9540
9083
 
9084
+ // src/lib/parsers/parse-i3s-attribute.ts
9085
+ async function parseI3STileAttribute(arrayBuffer, options) {
9086
+ const { attributeName, attributeType } = options;
9087
+ if (!attributeName) {
9088
+ return {};
9089
+ }
9090
+ return {
9091
+ [attributeName]: attributeType ? parseAttribute(attributeType, arrayBuffer) : null
9092
+ };
9093
+ }
9094
+ function parseAttribute(attributeType, arrayBuffer) {
9095
+ switch (attributeType) {
9096
+ case STRING_ATTRIBUTE_TYPE:
9097
+ return parseStringsAttribute(arrayBuffer);
9098
+ case OBJECT_ID_ATTRIBUTE_TYPE:
9099
+ return parseShortNumberAttribute(arrayBuffer);
9100
+ case FLOAT_64_TYPE:
9101
+ return parseFloatAttribute(arrayBuffer);
9102
+ case INT_16_ATTRIBUTE_TYPE:
9103
+ return parseInt16ShortNumberAttribute(arrayBuffer);
9104
+ default:
9105
+ return parseShortNumberAttribute(arrayBuffer);
9106
+ }
9107
+ }
9108
+ function parseShortNumberAttribute(arrayBuffer) {
9109
+ const countOffset = 4;
9110
+ return new Uint32Array(arrayBuffer, countOffset);
9111
+ }
9112
+ function parseInt16ShortNumberAttribute(arrayBuffer) {
9113
+ const countOffset = 4;
9114
+ return new Int16Array(arrayBuffer, countOffset);
9115
+ }
9116
+ function parseFloatAttribute(arrayBuffer) {
9117
+ const countOffset = 8;
9118
+ return new Float64Array(arrayBuffer, countOffset);
9119
+ }
9120
+ function parseStringsAttribute(arrayBuffer) {
9121
+ const stringsCountOffset = 0;
9122
+ const dataOffset = 8;
9123
+ const bytesPerStringSize = 4;
9124
+ const stringsArray = [];
9125
+ try {
9126
+ const stringsCount = new DataView(arrayBuffer, stringsCountOffset, bytesPerStringSize).getUint32(stringsCountOffset, true);
9127
+ const stringSizes = new Uint32Array(arrayBuffer, dataOffset, stringsCount);
9128
+ let stringOffset = dataOffset + stringsCount * bytesPerStringSize;
9129
+ for (const stringByteSize of stringSizes) {
9130
+ const textDecoder = new TextDecoder("utf-8");
9131
+ const stringAttribute = new Uint8Array(arrayBuffer, stringOffset, stringByteSize);
9132
+ stringsArray.push(textDecoder.decode(stringAttribute));
9133
+ stringOffset += stringByteSize;
9134
+ }
9135
+ } catch (error) {
9136
+ console.error("Parse string attribute error: ", error.message);
9137
+ }
9138
+ return stringsArray;
9139
+ }
9140
+ var init_parse_i3s_attribute = __esm({
9141
+ "src/lib/parsers/parse-i3s-attribute.ts"() {
9142
+ init_constants2();
9143
+ }
9144
+ });
9145
+
9146
+ // src/i3s-attribute-loader.ts
9147
+ async function parse3(data, options) {
9148
+ data = parseI3STileAttribute(data, options);
9149
+ return data;
9150
+ }
9151
+ async function loadFeatureAttributes(tile, featureId, options = {}) {
9152
+ const { attributeStorageInfo, attributeUrls, tilesetFields } = getAttributesData(tile);
9153
+ if (!attributeStorageInfo || !attributeUrls || featureId < 0) {
9154
+ return null;
9155
+ }
9156
+ let attributes = [];
9157
+ const attributeLoadPromises = [];
9158
+ for (let index = 0; index < attributeStorageInfo.length; index++) {
9159
+ const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);
9160
+ const attributeName = attributeStorageInfo[index].name;
9161
+ const attributeType = getAttributeValueType(attributeStorageInfo[index]);
9162
+ const loadOptions = { ...options, attributeName, attributeType };
9163
+ const promise = load(url, I3SAttributeLoader, loadOptions);
9164
+ attributeLoadPromises.push(promise);
9165
+ }
9166
+ try {
9167
+ attributes = await Promise.allSettled(attributeLoadPromises);
9168
+ } catch (error) {
9169
+ }
9170
+ if (!attributes.length) {
9171
+ return null;
9172
+ }
9173
+ return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);
9174
+ }
9175
+ function getAttributesData(tile) {
9176
+ const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;
9177
+ const attributeUrls = tile.header?.attributeUrls;
9178
+ const tilesetFields = tile.tileset?.tileset?.fields || [];
9179
+ return { attributeStorageInfo, attributeUrls, tilesetFields };
9180
+ }
9181
+ function getAttributeValueType(attribute) {
9182
+ if (attribute.hasOwnProperty("objectIds")) {
9183
+ return "Oid32";
9184
+ } else if (attribute.hasOwnProperty("attributeValues")) {
9185
+ return attribute.attributeValues.valueType;
9186
+ }
9187
+ return "";
9188
+ }
9189
+ function getFeatureIdsAttributeName(attributeStorageInfo) {
9190
+ const objectIdsAttribute = attributeStorageInfo.find((attribute) => attribute.name.includes("OBJECTID"));
9191
+ return objectIdsAttribute?.name;
9192
+ }
9193
+ function generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {
9194
+ const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);
9195
+ const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);
9196
+ if (!objectIds) {
9197
+ return null;
9198
+ }
9199
+ const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);
9200
+ if (attributeIndex < 0) {
9201
+ return null;
9202
+ }
9203
+ return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);
9204
+ }
9205
+ function getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {
9206
+ const attributesObject = {};
9207
+ for (let index = 0; index < attributeStorageInfo.length; index++) {
9208
+ const attributeName = attributeStorageInfo[index].name;
9209
+ const codedValues = getAttributeCodedValues(attributeName, tilesetFields);
9210
+ const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);
9211
+ attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);
9212
+ }
9213
+ return attributesObject;
9214
+ }
9215
+ function getAttributeCodedValues(attributeName, tilesetFields) {
9216
+ const attributeField = tilesetFields.find((field) => field.name === attributeName || field.alias === attributeName);
9217
+ return attributeField?.domain?.codedValues || [];
9218
+ }
9219
+ function getAttributeByIndexAndAttributeName(attributes, index, attributesName) {
9220
+ const attributeObject = attributes[index];
9221
+ if (attributeObject.status === REJECTED_STATUS) {
9222
+ return null;
9223
+ }
9224
+ return attributeObject.value[attributesName];
9225
+ }
9226
+ function formatAttributeValue(attribute, featureIdIndex, codedValues) {
9227
+ let value = EMPTY_VALUE;
9228
+ if (attribute && featureIdIndex in attribute) {
9229
+ value = String(attribute[featureIdIndex]).replace(/\u0000|NaN/g, "").trim();
9230
+ }
9231
+ if (codedValues.length) {
9232
+ const codeValue = codedValues.find((codedValue) => codedValue.code === Number(value));
9233
+ value = codeValue?.name || EMPTY_VALUE;
9234
+ }
9235
+ return value;
9236
+ }
9237
+ var VERSION9, EMPTY_VALUE, REJECTED_STATUS, I3SAttributeLoader;
9238
+ var init_i3s_attribute_loader = __esm({
9239
+ "src/i3s-attribute-loader.ts"() {
9240
+ init_src3();
9241
+ init_parse_i3s_attribute();
9242
+ init_url_utils();
9243
+ VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
9244
+ EMPTY_VALUE = "";
9245
+ REJECTED_STATUS = "rejected";
9246
+ I3SAttributeLoader = {
9247
+ name: "I3S Attribute",
9248
+ id: "i3s-attribute",
9249
+ module: "i3s",
9250
+ version: VERSION9,
9251
+ mimeTypes: ["application/binary"],
9252
+ parse: parse3,
9253
+ extensions: ["bin"],
9254
+ options: {},
9255
+ binary: true
9256
+ };
9257
+ }
9258
+ });
9259
+
9260
+ // src/lib/utils/customizeColors.ts
9261
+ async function customizeColors(colors, featureIds, tileOptions, tilesetOptions, options) {
9262
+ if (!options?.i3s?.colorsByAttribute) {
9263
+ return colors;
9264
+ }
9265
+ const colorizeAttributeField = tilesetOptions.fields.find(({ name }) => name === options?.i3s?.colorsByAttribute?.attributeName);
9266
+ if (!colorizeAttributeField || !["esriFieldTypeDouble", "esriFieldTypeInteger", "esriFieldTypeSmallInteger"].includes(colorizeAttributeField.type)) {
9267
+ return colors;
9268
+ }
9269
+ const colorizeAttributeData = await loadFeatureAttributeData(colorizeAttributeField.name, tileOptions, tilesetOptions, options);
9270
+ if (!colorizeAttributeData) {
9271
+ return colors;
9272
+ }
9273
+ const objectIdField = tilesetOptions.fields.find(({ type }) => type === "esriFieldTypeOID");
9274
+ if (!objectIdField) {
9275
+ return colors;
9276
+ }
9277
+ const objectIdAttributeData = await loadFeatureAttributeData(objectIdField.name, tileOptions, tilesetOptions, options);
9278
+ if (!objectIdAttributeData) {
9279
+ return colors;
9280
+ }
9281
+ const attributeValuesMap = {};
9282
+ for (let i2 = 0; i2 < objectIdAttributeData[objectIdField.name].length; i2++) {
9283
+ attributeValuesMap[objectIdAttributeData[objectIdField.name][i2]] = calculateColorForAttribute(colorizeAttributeData[colorizeAttributeField.name][i2], options);
9284
+ }
9285
+ for (let i2 = 0; i2 < featureIds.value.length; i2++) {
9286
+ const color = attributeValuesMap[featureIds.value[i2]];
9287
+ if (!color) {
9288
+ continue;
9289
+ }
9290
+ colors.value.set(color, i2 * 4);
9291
+ }
9292
+ return colors;
9293
+ }
9294
+ function calculateColorForAttribute(attributeValue, options) {
9295
+ if (!options?.i3s?.colorsByAttribute) {
9296
+ return [255, 255, 255, 255];
9297
+ }
9298
+ const { minValue, maxValue, minColor, maxColor } = options.i3s.colorsByAttribute;
9299
+ const rate = (attributeValue - minValue) / (maxValue - minValue);
9300
+ const color = [255, 255, 255, 255];
9301
+ for (let i2 = 0; i2 < minColor.length; i2++) {
9302
+ color[i2] = Math.round((maxColor[i2] - minColor[i2]) * rate + minColor[i2]);
9303
+ }
9304
+ return color;
9305
+ }
9306
+ async function loadFeatureAttributeData(attributeName, { attributeUrls }, { attributeStorageInfo }, options) {
9307
+ const attributeIndex = attributeStorageInfo.findIndex(({ name }) => attributeName === name);
9308
+ if (attributeIndex === -1) {
9309
+ return null;
9310
+ }
9311
+ const objectIdAttributeUrl = getUrlWithToken(attributeUrls[attributeIndex], options?.i3s?.token);
9312
+ const attributeType = getAttributeValueType(attributeStorageInfo[attributeIndex]);
9313
+ const objectIdAttributeData = await load(objectIdAttributeUrl, I3SAttributeLoader, {
9314
+ attributeName,
9315
+ attributeType
9316
+ });
9317
+ return objectIdAttributeData;
9318
+ }
9319
+ var init_customizeColors = __esm({
9320
+ "src/lib/utils/customizeColors.ts"() {
9321
+ init_src3();
9322
+ init_i3s_attribute_loader();
9323
+ init_url_utils();
9324
+ }
9325
+ });
9326
+
9541
9327
  // src/lib/parsers/parse-i3s-tile-content.ts
9542
9328
  function getLoaderForTextureFormat(textureFormat) {
9543
9329
  switch (textureFormat) {
@@ -9552,29 +9338,36 @@
9552
9338
  return ImageLoader;
9553
9339
  }
9554
9340
  }
9555
- async function parseI3STileContent(arrayBuffer, tile, tileset, options, context) {
9556
- tile.content = tile.content || {};
9557
- tile.content.featureIds = tile.content.featureIds || null;
9558
- tile.content.attributes = {};
9559
- if (tile.textureUrl) {
9560
- const url = getUrlWithToken(tile.textureUrl, options?.i3s?.token);
9561
- const loader = getLoaderForTextureFormat(tile.textureFormat);
9341
+ async function parseI3STileContent(arrayBuffer, tileOptions, tilesetOptions, options, context) {
9342
+ const content = {
9343
+ attributes: {},
9344
+ indices: null,
9345
+ featureIds: [],
9346
+ vertexCount: 0,
9347
+ modelMatrix: new Matrix4(),
9348
+ coordinateSystem: 0,
9349
+ byteLength: 0,
9350
+ texture: null
9351
+ };
9352
+ if (tileOptions.textureUrl) {
9353
+ const url = getUrlWithToken(tileOptions.textureUrl, options?.i3s?.token);
9354
+ const loader = getLoaderForTextureFormat(tileOptions.textureFormat);
9562
9355
  const response = await fetch(url, options?.fetch);
9563
9356
  const arrayBuffer2 = await response.arrayBuffer();
9564
9357
  if (options?.i3s.decodeTextures) {
9565
9358
  if (loader === ImageLoader) {
9566
- const options2 = { ...tile.textureLoaderOptions, image: { type: "data" } };
9359
+ const options2 = { ...tileOptions.textureLoaderOptions, image: { type: "data" } };
9567
9360
  try {
9568
- tile.content.texture = await context.parse(arrayBuffer2, options2);
9361
+ content.texture = await context.parse(arrayBuffer2, options2);
9569
9362
  } catch (e2) {
9570
- tile.content.texture = await parse(arrayBuffer2, loader, options2);
9363
+ content.texture = await parse(arrayBuffer2, loader, options2);
9571
9364
  }
9572
9365
  } else if (loader === CompressedTextureLoader || loader === BasisLoader) {
9573
- let texture = await load(arrayBuffer2, loader, tile.textureLoaderOptions);
9366
+ let texture = await load(arrayBuffer2, loader, tileOptions.textureLoaderOptions);
9574
9367
  if (loader === BasisLoader) {
9575
9368
  texture = texture[0];
9576
9369
  }
9577
- tile.content.texture = {
9370
+ content.texture = {
9578
9371
  compressed: true,
9579
9372
  mipmaps: false,
9580
9373
  width: texture[0].width,
@@ -9583,27 +9376,23 @@
9583
9376
  };
9584
9377
  }
9585
9378
  } else {
9586
- tile.content.texture = arrayBuffer2;
9379
+ content.texture = arrayBuffer2;
9587
9380
  }
9588
9381
  }
9589
- tile.content.material = makePbrMaterial(tile.materialDefinition, tile.content.texture);
9590
- if (tile.content.material) {
9591
- tile.content.texture = null;
9382
+ content.material = makePbrMaterial(tileOptions.materialDefinition, content.texture);
9383
+ if (content.material) {
9384
+ content.texture = null;
9592
9385
  }
9593
- return await parseI3SNodeGeometry(arrayBuffer, tile, tileset, options);
9386
+ return await parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options);
9594
9387
  }
9595
- async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
9596
- if (!tile.content) {
9597
- return tile;
9598
- }
9599
- const content = tile.content;
9388
+ async function parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options) {
9600
9389
  const contentByteLength = arrayBuffer.byteLength;
9601
9390
  let attributes;
9602
9391
  let vertexCount;
9603
9392
  let byteOffset = 0;
9604
9393
  let featureCount = 0;
9605
9394
  let indices;
9606
- if (tile.isDracoGeometry) {
9395
+ if (tileOptions.isDracoGeometry) {
9607
9396
  const decompressedGeometry = await parse(arrayBuffer, DracoLoader2, {
9608
9397
  draco: {
9609
9398
  attributeNameEntry: I3S_ATTRIBUTE_TYPE
@@ -9638,8 +9427,8 @@
9638
9427
  ordering: attributesOrder,
9639
9428
  featureAttributes,
9640
9429
  featureAttributeOrder
9641
- } = tileset.store.defaultGeometrySchema;
9642
- const headers = parseHeaders(tileset, arrayBuffer);
9430
+ } = tilesetOptions.store.defaultGeometrySchema;
9431
+ const headers = parseHeaders(arrayBuffer, tilesetOptions);
9643
9432
  byteOffset = headers.byteOffset;
9644
9433
  vertexCount = headers.vertexCount;
9645
9434
  featureCount = headers.featureCount;
@@ -9649,23 +9438,24 @@
9649
9438
  attributes = concatAttributes(normalizedVertexAttributes, normalizedFeatureAttributes);
9650
9439
  }
9651
9440
  if (!options?.i3s?.coordinateSystem || options.i3s.coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS) {
9652
- const enuMatrix = parsePositions(attributes.position, tile);
9441
+ const enuMatrix = parsePositions(attributes.position, tileOptions);
9653
9442
  content.modelMatrix = enuMatrix.invert();
9654
9443
  content.coordinateSystem = COORDINATE_SYSTEM.METER_OFFSETS;
9655
9444
  } else {
9656
9445
  content.modelMatrix = getModelMatrix(attributes.position);
9657
9446
  content.coordinateSystem = COORDINATE_SYSTEM.LNGLAT_OFFSETS;
9658
9447
  }
9448
+ attributes.color = await customizeColors(attributes.color, attributes.id, tileOptions, tilesetOptions, options);
9659
9449
  content.attributes = {
9660
9450
  positions: attributes.position,
9661
9451
  normals: attributes.normal,
9662
9452
  colors: normalizeAttribute(attributes.color),
9663
9453
  texCoords: attributes.uv0,
9664
- uvRegions: normalizeAttribute(attributes.uvRegion)
9454
+ uvRegions: normalizeAttribute(attributes.uvRegion || attributes.region)
9665
9455
  };
9666
9456
  content.indices = indices || null;
9667
9457
  if (attributes.id && attributes.id.value) {
9668
- tile.content.featureIds = attributes.id.value;
9458
+ content.featureIds = attributes.id.value;
9669
9459
  }
9670
9460
  for (const attributeIndex in content.attributes) {
9671
9461
  if (!content.attributes[attributeIndex]) {
@@ -9674,7 +9464,7 @@
9674
9464
  }
9675
9465
  content.vertexCount = vertexCount;
9676
9466
  content.byteLength = contentByteLength;
9677
- return tile;
9467
+ return content;
9678
9468
  }
9679
9469
  function updateAttributesMetadata(attributes, decompressedGeometry) {
9680
9470
  for (const key in decompressedGeometry.loaderData.attributes) {
@@ -9701,11 +9491,11 @@
9701
9491
  attribute.normalized = true;
9702
9492
  return attribute;
9703
9493
  }
9704
- function parseHeaders(tileset, arrayBuffer) {
9494
+ function parseHeaders(arrayBuffer, options) {
9705
9495
  let byteOffset = 0;
9706
9496
  let vertexCount = 0;
9707
9497
  let featureCount = 0;
9708
- for (const { property, type } of tileset.store.defaultGeometrySchema.header) {
9498
+ for (const { property, type } of options.store.defaultGeometrySchema.header) {
9709
9499
  const TypedArrayTypeHeader = getConstructorForDataFormat(type);
9710
9500
  switch (property) {
9711
9501
  case HeaderAttributeProperty.vertexCount:
@@ -9775,8 +9565,8 @@
9775
9565
  }
9776
9566
  return new Uint32Array(values);
9777
9567
  }
9778
- function parsePositions(attribute, tile) {
9779
- const mbs = tile.mbs;
9568
+ function parsePositions(attribute, options) {
9569
+ const mbs = options.mbs;
9780
9570
  const value = attribute.value;
9781
9571
  const metadata = attribute.metadata;
9782
9572
  const enuMatrix = new Matrix4();
@@ -9910,38 +9700,44 @@
9910
9700
  var init_parse_i3s_tile_content = __esm({
9911
9701
  "src/lib/parsers/parse-i3s-tile-content.ts"() {
9912
9702
  init_src3();
9913
- init_esm5();
9914
- init_esm6();
9703
+ init_esm3();
9704
+ init_esm4();
9915
9705
  init_src4();
9916
9706
  init_src6();
9917
9707
  init_src7();
9918
9708
  init_types();
9919
9709
  init_url_utils();
9920
9710
  init_constants2();
9711
+ init_customizeColors();
9921
9712
  scratchVector5 = new Vector3([0, 0, 0]);
9922
9713
  I3S_ATTRIBUTE_TYPE = "i3s-attribute-type";
9923
9714
  }
9924
9715
  });
9925
9716
 
9926
9717
  // src/i3s-content-loader.ts
9927
- async function parse3(data, options, context) {
9928
- const { tile, tileset } = options?.i3s || {};
9929
- await parseI3STileContent(data, tile, tileset, options, context);
9930
- return tile.content;
9718
+ async function parse4(data, options, context) {
9719
+ const { tile, _tileOptions, tileset, _tilesetOptions } = options?.i3s || {};
9720
+ const tileOptions = _tileOptions || tile;
9721
+ const tilesetOptions = _tilesetOptions || tileset;
9722
+ if (!tileOptions || !tilesetOptions) {
9723
+ return null;
9724
+ }
9725
+ return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
9931
9726
  }
9932
- var VERSION9, I3SContentLoader;
9727
+ var VERSION10, I3SContentLoader;
9933
9728
  var init_i3s_content_loader = __esm({
9934
9729
  "src/i3s-content-loader.ts"() {
9730
+ init_src();
9935
9731
  init_parse_i3s_tile_content();
9936
- VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
9732
+ VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
9937
9733
  I3SContentLoader = {
9938
9734
  name: "I3S Content (Indexed Scene Layers)",
9939
- id: "i3s-content",
9735
+ id: isBrowser2 ? "i3s-content" : "i3s-content-nodejs",
9940
9736
  module: "i3s",
9941
9737
  worker: true,
9942
- version: VERSION9,
9738
+ version: VERSION10,
9943
9739
  mimeTypes: ["application/octet-stream"],
9944
- parse: parse3,
9740
+ parse: parse4,
9945
9741
  extensions: ["bin"],
9946
9742
  options: {
9947
9743
  "i3s-content": {}
@@ -9954,11 +9750,11 @@
9954
9750
  var INTERSECTION;
9955
9751
  var init_constants3 = __esm({
9956
9752
  "../../node_modules/@math.gl/culling/dist/esm/constants.js"() {
9957
- INTERSECTION = Object.freeze({
9753
+ INTERSECTION = {
9958
9754
  OUTSIDE: -1,
9959
9755
  INTERSECTING: 0,
9960
9756
  INSIDE: 1
9961
- });
9757
+ };
9962
9758
  }
9963
9759
  });
9964
9760
 
@@ -9966,7 +9762,8 @@
9966
9762
  var scratchVector6, scratchNormal2;
9967
9763
  var init_axis_aligned_bounding_box = __esm({
9968
9764
  "../../node_modules/@math.gl/culling/dist/esm/lib/bounding-volumes/axis-aligned-bounding-box.js"() {
9969
- init_esm5();
9765
+ init_defineProperty();
9766
+ init_esm3();
9970
9767
  init_constants3();
9971
9768
  scratchVector6 = new Vector3();
9972
9769
  scratchNormal2 = new Vector3();
@@ -9977,13 +9774,16 @@
9977
9774
  var scratchVector7, scratchVector23, BoundingSphere;
9978
9775
  var init_bounding_sphere = __esm({
9979
9776
  "../../node_modules/@math.gl/culling/dist/esm/lib/bounding-volumes/bounding-sphere.js"() {
9980
- init_esm5();
9777
+ init_defineProperty();
9778
+ init_esm3();
9981
9779
  init_mat4();
9982
9780
  init_constants3();
9983
9781
  scratchVector7 = new Vector3();
9984
9782
  scratchVector23 = new Vector3();
9985
9783
  BoundingSphere = class {
9986
9784
  constructor(center = [0, 0, 0], radius = 0) {
9785
+ _defineProperty(this, "center", void 0);
9786
+ _defineProperty(this, "radius", void 0);
9987
9787
  this.radius = -0;
9988
9788
  this.center = new Vector3();
9989
9789
  this.fromCenterRadius(center, radius);
@@ -10025,8 +9825,8 @@
10025
9825
  return this;
10026
9826
  }
10027
9827
  expand(point) {
10028
- point = scratchVector7.from(point);
10029
- const radius = point.subtract(this.center).magnitude();
9828
+ const scratchPoint = scratchVector7.from(point);
9829
+ const radius = scratchPoint.subtract(this.center).magnitude();
10030
9830
  if (radius > this.radius) {
10031
9831
  this.radius = radius;
10032
9832
  }
@@ -10039,12 +9839,13 @@
10039
9839
  return this;
10040
9840
  }
10041
9841
  distanceSquaredTo(point) {
10042
- point = scratchVector7.from(point);
10043
- const delta = point.subtract(this.center);
10044
- return delta.lengthSquared() - this.radius * this.radius;
9842
+ const d = this.distanceTo(point);
9843
+ return d * d;
10045
9844
  }
10046
9845
  distanceTo(point) {
10047
- return Math.sqrt(this.distanceSquaredTo(point));
9846
+ const scratchPoint = scratchVector7.from(point);
9847
+ const delta = scratchPoint.subtract(this.center);
9848
+ return Math.max(0, delta.len() - this.radius);
10048
9849
  }
10049
9850
  intersectPlane(plane) {
10050
9851
  const center = this.center;
@@ -10067,7 +9868,8 @@
10067
9868
  var scratchVector32, scratchOffset, scratchVectorU, scratchVectorV, scratchVectorW, scratchCorner, scratchToCenter, MATRIX3, OrientedBoundingBox;
10068
9869
  var init_oriented_bounding_box = __esm({
10069
9870
  "../../node_modules/@math.gl/culling/dist/esm/lib/bounding-volumes/oriented-bounding-box.js"() {
10070
- init_esm5();
9871
+ init_defineProperty();
9872
+ init_esm3();
10071
9873
  init_bounding_sphere();
10072
9874
  init_constants3();
10073
9875
  scratchVector32 = new Vector3();
@@ -10090,6 +9892,8 @@
10090
9892
  };
10091
9893
  OrientedBoundingBox = class {
10092
9894
  constructor(center = [0, 0, 0], halfAxes = [0, 0, 0, 0, 0, 0, 0, 0, 0]) {
9895
+ _defineProperty(this, "center", void 0);
9896
+ _defineProperty(this, "halfAxes", void 0);
10093
9897
  this.center = new Vector3().from(center);
10094
9898
  this.halfAxes = new Matrix3(halfAxes);
10095
9899
  }
@@ -10261,17 +10065,20 @@
10261
10065
  var scratchPosition2, scratchNormal3, Plane;
10262
10066
  var init_plane = __esm({
10263
10067
  "../../node_modules/@math.gl/culling/dist/esm/lib/plane.js"() {
10264
- init_esm5();
10068
+ init_defineProperty();
10069
+ init_esm3();
10265
10070
  scratchPosition2 = new Vector3();
10266
10071
  scratchNormal3 = new Vector3();
10267
10072
  Plane = class {
10268
10073
  constructor(normal = [0, 0, 1], distance = 0) {
10074
+ _defineProperty(this, "normal", void 0);
10075
+ _defineProperty(this, "distance", void 0);
10269
10076
  this.normal = new Vector3();
10270
10077
  this.distance = -0;
10271
10078
  this.fromNormalDistance(normal, distance);
10272
10079
  }
10273
10080
  fromNormalDistance(normal, distance) {
10274
- assert5(Number.isFinite(distance));
10081
+ assert4(Number.isFinite(distance));
10275
10082
  this.normal.from(normal).normalize();
10276
10083
  this.distance = distance;
10277
10084
  return this;
@@ -10285,11 +10092,11 @@
10285
10092
  }
10286
10093
  fromCoefficients(a2, b, c2, d) {
10287
10094
  this.normal.set(a2, b, c2);
10288
- assert5(equals(this.normal.len(), 1));
10095
+ assert4(equals(this.normal.len(), 1));
10289
10096
  this.distance = d;
10290
10097
  return this;
10291
10098
  }
10292
- clone(plane) {
10099
+ clone() {
10293
10100
  return new Plane(this.normal, this.distance);
10294
10101
  }
10295
10102
  equals(right) {
@@ -10314,16 +10121,88 @@
10314
10121
  });
10315
10122
 
10316
10123
  // ../../node_modules/@math.gl/culling/dist/esm/lib/culling-volume.js
10317
- var faces, scratchPlaneCenter, scratchPlaneNormal, scratchPlane;
10124
+ var faces, scratchPlaneCenter, scratchPlaneNormal, scratchPlane, CullingVolume;
10318
10125
  var init_culling_volume = __esm({
10319
10126
  "../../node_modules/@math.gl/culling/dist/esm/lib/culling-volume.js"() {
10320
- init_esm5();
10127
+ init_defineProperty();
10128
+ init_esm3();
10321
10129
  init_constants3();
10322
10130
  init_plane();
10323
10131
  faces = [new Vector3([1, 0, 0]), new Vector3([0, 1, 0]), new Vector3([0, 0, 1])];
10324
10132
  scratchPlaneCenter = new Vector3();
10325
10133
  scratchPlaneNormal = new Vector3();
10326
10134
  scratchPlane = new Plane(new Vector3(1, 0, 0), 0);
10135
+ CullingVolume = class {
10136
+ constructor(planes = []) {
10137
+ _defineProperty(this, "planes", void 0);
10138
+ this.planes = planes;
10139
+ }
10140
+ fromBoundingSphere(boundingSphere) {
10141
+ this.planes.length = 2 * faces.length;
10142
+ const center = boundingSphere.center;
10143
+ const radius = boundingSphere.radius;
10144
+ let planeIndex = 0;
10145
+ for (const faceNormal of faces) {
10146
+ let plane0 = this.planes[planeIndex];
10147
+ let plane1 = this.planes[planeIndex + 1];
10148
+ if (!plane0) {
10149
+ plane0 = this.planes[planeIndex] = new Plane();
10150
+ }
10151
+ if (!plane1) {
10152
+ plane1 = this.planes[planeIndex + 1] = new Plane();
10153
+ }
10154
+ const plane0Center = scratchPlaneCenter.copy(faceNormal).scale(-radius).add(center);
10155
+ const plane0Distance = -faceNormal.dot(plane0Center);
10156
+ plane0.fromPointNormal(plane0Center, faceNormal);
10157
+ const plane1Center = scratchPlaneCenter.copy(faceNormal).scale(radius).add(center);
10158
+ const negatedFaceNormal = scratchPlaneNormal.copy(faceNormal).negate();
10159
+ const plane1Distance = -negatedFaceNormal.dot(plane1Center);
10160
+ plane1.fromPointNormal(plane1Center, negatedFaceNormal);
10161
+ planeIndex += 2;
10162
+ }
10163
+ return this;
10164
+ }
10165
+ computeVisibility(boundingVolume) {
10166
+ let intersect = INTERSECTION.INSIDE;
10167
+ for (const plane of this.planes) {
10168
+ const result = boundingVolume.intersectPlane(plane);
10169
+ switch (result) {
10170
+ case INTERSECTION.OUTSIDE:
10171
+ return INTERSECTION.OUTSIDE;
10172
+ case INTERSECTION.INTERSECTING:
10173
+ intersect = INTERSECTION.INTERSECTING;
10174
+ break;
10175
+ default:
10176
+ }
10177
+ }
10178
+ return intersect;
10179
+ }
10180
+ computeVisibilityWithPlaneMask(boundingVolume, parentPlaneMask) {
10181
+ assert4(Number.isFinite(parentPlaneMask), "parentPlaneMask is required.");
10182
+ if (parentPlaneMask === CullingVolume.MASK_OUTSIDE || parentPlaneMask === CullingVolume.MASK_INSIDE) {
10183
+ return parentPlaneMask;
10184
+ }
10185
+ let mask = CullingVolume.MASK_INSIDE;
10186
+ const planes = this.planes;
10187
+ for (let k = 0; k < this.planes.length; ++k) {
10188
+ const flag = k < 31 ? 1 << k : 0;
10189
+ if (k < 31 && (parentPlaneMask & flag) === 0) {
10190
+ continue;
10191
+ }
10192
+ const plane = planes[k];
10193
+ const result = boundingVolume.intersectPlane(plane);
10194
+ if (result === INTERSECTION.OUTSIDE) {
10195
+ return CullingVolume.MASK_OUTSIDE;
10196
+ } else if (result === INTERSECTION.INTERSECTING) {
10197
+ mask |= flag;
10198
+ }
10199
+ }
10200
+ return mask;
10201
+ }
10202
+ };
10203
+ _defineProperty(CullingVolume, "MASK_OUTSIDE", 4294967295);
10204
+ _defineProperty(CullingVolume, "MASK_INSIDE", 0);
10205
+ _defineProperty(CullingVolume, "MASK_INDETERMINATE", 2147483647);
10327
10206
  }
10328
10207
  });
10329
10208
 
@@ -10331,7 +10210,8 @@
10331
10210
  var scratchPlaneUpVector, scratchPlaneRightVector, scratchPlaneNearCenter, scratchPlaneFarCenter, scratchPlaneNormal2;
10332
10211
  var init_perspective_off_center_frustum = __esm({
10333
10212
  "../../node_modules/@math.gl/culling/dist/esm/lib/perspective-off-center-frustum.js"() {
10334
- init_esm5();
10213
+ init_defineProperty();
10214
+ init_esm3();
10335
10215
  init_culling_volume();
10336
10216
  init_plane();
10337
10217
  scratchPlaneUpVector = new Vector3();
@@ -10345,6 +10225,7 @@
10345
10225
  // ../../node_modules/@math.gl/culling/dist/esm/lib/perspective-frustum.js
10346
10226
  var init_perspective_frustum = __esm({
10347
10227
  "../../node_modules/@math.gl/culling/dist/esm/lib/perspective-frustum.js"() {
10228
+ init_defineProperty();
10348
10229
  init_perspective_off_center_frustum();
10349
10230
  }
10350
10231
  });
@@ -10353,7 +10234,7 @@
10353
10234
  var fromPointsXMin, fromPointsYMin, fromPointsZMin, fromPointsXMax, fromPointsYMax, fromPointsZMax, fromPointsCurrentPos, fromPointsScratch, fromPointsRitterCenter, fromPointsMinBoxPt, fromPointsMaxBoxPt, fromPointsNaiveCenterScratch, volumeConstant;
10354
10235
  var init_bounding_sphere_from_points = __esm({
10355
10236
  "../../node_modules/@math.gl/culling/dist/esm/lib/algorithms/bounding-sphere-from-points.js"() {
10356
- init_esm5();
10237
+ init_esm3();
10357
10238
  init_bounding_sphere();
10358
10239
  fromPointsXMin = new Vector3();
10359
10240
  fromPointsYMin = new Vector3();
@@ -10375,7 +10256,7 @@
10375
10256
  var scratchMatrix, scratchUnitary, scratchDiagonal, jMatrix, jMatrixTranspose;
10376
10257
  var init_compute_eigen_decomposition = __esm({
10377
10258
  "../../node_modules/@math.gl/culling/dist/esm/lib/algorithms/compute-eigen-decomposition.js"() {
10378
- init_esm5();
10259
+ init_esm3();
10379
10260
  scratchMatrix = new Matrix3();
10380
10261
  scratchUnitary = new Matrix3();
10381
10262
  scratchDiagonal = new Matrix3();
@@ -10388,7 +10269,7 @@
10388
10269
  var scratchVector24, scratchVector33, scratchVector42, scratchVector52, scratchVector62, scratchCovarianceResult, scratchEigenResult;
10389
10270
  var init_bounding_box_from_points = __esm({
10390
10271
  "../../node_modules/@math.gl/culling/dist/esm/lib/algorithms/bounding-box-from-points.js"() {
10391
- init_esm5();
10272
+ init_esm3();
10392
10273
  init_compute_eigen_decomposition();
10393
10274
  init_oriented_bounding_box();
10394
10275
  init_axis_aligned_bounding_box();
@@ -10406,7 +10287,7 @@
10406
10287
  });
10407
10288
 
10408
10289
  // ../../node_modules/@math.gl/culling/dist/esm/index.js
10409
- var init_esm8 = __esm({
10290
+ var init_esm6 = __esm({
10410
10291
  "../../node_modules/@math.gl/culling/dist/esm/index.js"() {
10411
10292
  init_constants3();
10412
10293
  init_axis_aligned_bounding_box();
@@ -10419,8 +10300,6 @@
10419
10300
  init_bounding_sphere_from_points();
10420
10301
  init_bounding_box_from_points();
10421
10302
  init_compute_eigen_decomposition();
10422
- init_constants3();
10423
- init_constants3();
10424
10303
  }
10425
10304
  });
10426
10305
 
@@ -10456,21 +10335,21 @@
10456
10335
  async function parseNodePage(data) {
10457
10336
  return JSON.parse(new TextDecoder().decode(data));
10458
10337
  }
10459
- async function parse4(data) {
10338
+ async function parse5(data) {
10460
10339
  data = parseNodePage(data);
10461
10340
  return data;
10462
10341
  }
10463
- var VERSION10, I3SNodePageLoader;
10342
+ var VERSION11, I3SNodePageLoader;
10464
10343
  var init_i3s_node_page_loader = __esm({
10465
10344
  "src/i3s-node-page-loader.ts"() {
10466
- VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
10345
+ VERSION11 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
10467
10346
  I3SNodePageLoader = {
10468
10347
  name: "I3S Node Page",
10469
10348
  id: "i3s-node-page",
10470
10349
  module: "i3s",
10471
- version: VERSION10,
10350
+ version: VERSION11,
10472
10351
  mimeTypes: ["application/json"],
10473
- parse: parse4,
10352
+ parse: parse5,
10474
10353
  extensions: ["json"],
10475
10354
  options: {}
10476
10355
  };
@@ -10658,7 +10537,7 @@
10658
10537
  });
10659
10538
 
10660
10539
  // src/lib/parsers/parse-i3s.ts
10661
- function normalizeTileData(tile, options, context) {
10540
+ function normalizeTileData(tile, context) {
10662
10541
  const url = context.url || "";
10663
10542
  let contentUrl;
10664
10543
  if (tile.geometryData) {
@@ -10732,8 +10611,8 @@
10732
10611
  }
10733
10612
  var init_parse_i3s = __esm({
10734
10613
  "src/lib/parsers/parse-i3s.ts"() {
10735
- init_esm8();
10736
10614
  init_esm6();
10615
+ init_esm4();
10737
10616
  init_src3();
10738
10617
  init_src8();
10739
10618
  init_i3s_nodepages_tiles();
@@ -10742,7 +10621,7 @@
10742
10621
  });
10743
10622
 
10744
10623
  // src/i3s-loader.ts
10745
- async function parseI3S(data, options, context) {
10624
+ async function parseI3S(data, options = {}, context) {
10746
10625
  const url = context.url;
10747
10626
  options.i3s = options.i3s || {};
10748
10627
  const magicNumber = getMagicNumber(data);
@@ -10764,11 +10643,7 @@
10764
10643
  if (isTileset) {
10765
10644
  data = await parseTileset(data, options, context);
10766
10645
  } else if (isTileHeader) {
10767
- data = await parseTile(data, options, context);
10768
- if (options.i3s.loadContent) {
10769
- options.i3s.tile = data;
10770
- await load(data.contentUrl, I3SLoader, options);
10771
- }
10646
+ data = await parseTile(data, context);
10772
10647
  } else {
10773
10648
  data = await parseTileContent(data, options);
10774
10649
  }
@@ -10779,13 +10654,16 @@
10779
10654
  }
10780
10655
  async function parseTileset(data, options, context) {
10781
10656
  const tilesetJson = JSON.parse(new TextDecoder().decode(data));
10657
+ if (tilesetJson?.layerType === POINT_CLOUD) {
10658
+ throw new Error("Point Cloud layers currently are not supported by I3SLoader");
10659
+ }
10782
10660
  tilesetJson.loader = I3SLoader;
10783
10661
  await normalizeTilesetData(tilesetJson, options, context);
10784
10662
  return tilesetJson;
10785
10663
  }
10786
- async function parseTile(data, options, context) {
10664
+ async function parseTile(data, context) {
10787
10665
  data = JSON.parse(new TextDecoder().decode(data));
10788
- return normalizeTileData(data, options, context);
10666
+ return normalizeTileData(data, context);
10789
10667
  }
10790
10668
  function getMagicNumber(data) {
10791
10669
  if (data instanceof ArrayBuffer) {
@@ -10793,219 +10671,46 @@
10793
10671
  }
10794
10672
  return null;
10795
10673
  }
10796
- var VERSION11, TILESET_REGEX, TILE_HEADER_REGEX, SLPK_HEX, I3SLoader;
10674
+ var VERSION12, TILESET_REGEX, TILE_HEADER_REGEX, SLPK_HEX, POINT_CLOUD, I3SLoader;
10797
10675
  var init_i3s_loader = __esm({
10798
10676
  "src/i3s-loader.ts"() {
10799
10677
  init_src3();
10800
10678
  init_i3s_content_loader();
10801
10679
  init_parse_i3s();
10802
10680
  init_constants2();
10803
- VERSION11 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
10681
+ VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
10804
10682
  TILESET_REGEX = /layers\/[0-9]+$/;
10805
10683
  TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
10806
10684
  SLPK_HEX = "504b0304";
10685
+ POINT_CLOUD = "PointCloud";
10807
10686
  I3SLoader = {
10808
10687
  name: "I3S (Indexed Scene Layers)",
10809
10688
  id: "i3s",
10810
10689
  module: "i3s",
10811
- version: VERSION11,
10690
+ version: VERSION12,
10812
10691
  mimeTypes: ["application/octet-stream"],
10813
10692
  parse: parseI3S,
10814
10693
  extensions: ["bin"],
10815
10694
  options: {
10816
10695
  i3s: {
10817
- loadContent: true,
10818
10696
  token: null,
10819
10697
  isTileset: "auto",
10820
10698
  isTileHeader: "auto",
10821
10699
  tile: null,
10822
10700
  tileset: null,
10701
+ _tileOptions: null,
10702
+ _tilesetOptions: null,
10823
10703
  useDracoGeometry: true,
10824
10704
  useCompressedTextures: true,
10825
10705
  decodeTextures: true,
10826
- coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS
10706
+ coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS,
10707
+ colorsByAttribute: null
10827
10708
  }
10828
10709
  }
10829
10710
  };
10830
10711
  }
10831
10712
  });
10832
10713
 
10833
- // src/lib/parsers/parse-i3s-attribute.ts
10834
- async function parseI3STileAttribute(arrayBuffer, options) {
10835
- const { attributeName, attributeType } = options;
10836
- if (!attributeName) {
10837
- return {};
10838
- }
10839
- return {
10840
- [attributeName]: attributeType ? parseAttribute(attributeType, arrayBuffer) : null
10841
- };
10842
- }
10843
- function parseAttribute(attributeType, arrayBuffer) {
10844
- switch (attributeType) {
10845
- case STRING_ATTRIBUTE_TYPE:
10846
- return parseStringsAttribute(arrayBuffer);
10847
- case OBJECT_ID_ATTRIBUTE_TYPE:
10848
- return parseShortNumberAttribute(arrayBuffer);
10849
- case FLOAT_64_TYPE:
10850
- return parseFloatAttribute(arrayBuffer);
10851
- case INT_16_ATTRIBUTE_TYPE:
10852
- return parseInt16ShortNumberAttribute(arrayBuffer);
10853
- default:
10854
- return parseShortNumberAttribute(arrayBuffer);
10855
- }
10856
- }
10857
- function parseShortNumberAttribute(arrayBuffer) {
10858
- const countOffset = 4;
10859
- return new Uint32Array(arrayBuffer, countOffset);
10860
- }
10861
- function parseInt16ShortNumberAttribute(arrayBuffer) {
10862
- const countOffset = 4;
10863
- return new Int16Array(arrayBuffer, countOffset);
10864
- }
10865
- function parseFloatAttribute(arrayBuffer) {
10866
- const countOffset = 8;
10867
- return new Float64Array(arrayBuffer, countOffset);
10868
- }
10869
- function parseStringsAttribute(arrayBuffer) {
10870
- const stringsCountOffset = 0;
10871
- const dataOffset = 8;
10872
- const bytesPerStringSize = 4;
10873
- const stringsArray = [];
10874
- try {
10875
- const stringsCount = new DataView(arrayBuffer, stringsCountOffset, bytesPerStringSize).getUint32(stringsCountOffset, true);
10876
- const stringSizes = new Uint32Array(arrayBuffer, dataOffset, stringsCount);
10877
- let stringOffset = dataOffset + stringsCount * bytesPerStringSize;
10878
- for (const stringByteSize of stringSizes) {
10879
- const textDecoder = new TextDecoder("utf-8");
10880
- const stringAttribute = new Uint8Array(arrayBuffer, stringOffset, stringByteSize);
10881
- stringsArray.push(textDecoder.decode(stringAttribute));
10882
- stringOffset += stringByteSize;
10883
- }
10884
- } catch (error) {
10885
- console.error("Parse string attribute error: ", error.message);
10886
- }
10887
- return stringsArray;
10888
- }
10889
- var init_parse_i3s_attribute = __esm({
10890
- "src/lib/parsers/parse-i3s-attribute.ts"() {
10891
- init_constants2();
10892
- }
10893
- });
10894
-
10895
- // src/i3s-attribute-loader.ts
10896
- async function parse5(data, options) {
10897
- data = parseI3STileAttribute(data, options);
10898
- return data;
10899
- }
10900
- async function loadFeatureAttributes(tile, featureId, options = {}) {
10901
- const { attributeStorageInfo, attributeUrls, tilesetFields } = getAttributesData(tile);
10902
- if (!attributeStorageInfo || !attributeUrls || featureId < 0) {
10903
- return null;
10904
- }
10905
- let attributes = [];
10906
- const attributeLoadPromises = [];
10907
- for (let index = 0; index < attributeStorageInfo.length; index++) {
10908
- const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);
10909
- const attributeName = attributeStorageInfo[index].name;
10910
- const attributeType = getAttributeValueType(attributeStorageInfo[index]);
10911
- const loadOptions = { ...options, attributeName, attributeType };
10912
- const promise = load(url, I3SAttributeLoader, loadOptions);
10913
- attributeLoadPromises.push(promise);
10914
- }
10915
- try {
10916
- attributes = await Promise.allSettled(attributeLoadPromises);
10917
- } catch (error) {
10918
- }
10919
- if (!attributes.length) {
10920
- return null;
10921
- }
10922
- return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);
10923
- }
10924
- function getAttributesData(tile) {
10925
- const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;
10926
- const attributeUrls = tile.header?.attributeUrls;
10927
- const tilesetFields = tile.tileset?.tileset?.fields || [];
10928
- return { attributeStorageInfo, attributeUrls, tilesetFields };
10929
- }
10930
- function getAttributeValueType(attribute) {
10931
- if (attribute.hasOwnProperty("objectIds")) {
10932
- return "Oid32";
10933
- } else if (attribute.hasOwnProperty("attributeValues")) {
10934
- return attribute.attributeValues.valueType;
10935
- }
10936
- return "";
10937
- }
10938
- function getFeatureIdsAttributeName(attributeStorageInfo) {
10939
- const objectIdsAttribute = attributeStorageInfo.find((attribute) => attribute.name.includes("OBJECTID"));
10940
- return objectIdsAttribute?.name;
10941
- }
10942
- function generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {
10943
- const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);
10944
- const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);
10945
- if (!objectIds) {
10946
- return null;
10947
- }
10948
- const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);
10949
- if (attributeIndex < 0) {
10950
- return null;
10951
- }
10952
- return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);
10953
- }
10954
- function getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {
10955
- const attributesObject = {};
10956
- for (let index = 0; index < attributeStorageInfo.length; index++) {
10957
- const attributeName = attributeStorageInfo[index].name;
10958
- const codedValues = getAttributeCodedValues(attributeName, tilesetFields);
10959
- const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);
10960
- attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);
10961
- }
10962
- return attributesObject;
10963
- }
10964
- function getAttributeCodedValues(attributeName, tilesetFields) {
10965
- const attributeField = tilesetFields.find((field) => field.name === attributeName || field.alias === attributeName);
10966
- return attributeField?.domain?.codedValues || [];
10967
- }
10968
- function getAttributeByIndexAndAttributeName(attributes, index, attributesName) {
10969
- const attributeObject = attributes[index];
10970
- if (attributeObject.status === REJECTED_STATUS) {
10971
- return null;
10972
- }
10973
- return attributeObject.value[attributesName];
10974
- }
10975
- function formatAttributeValue(attribute, featureIdIndex, codedValues) {
10976
- let value = EMPTY_VALUE;
10977
- if (attribute && featureIdIndex in attribute) {
10978
- value = String(attribute[featureIdIndex]).replace(/\u0000|NaN/g, "").trim();
10979
- }
10980
- if (codedValues.length) {
10981
- const codeValue = codedValues.find((codedValue) => codedValue.code === Number(value));
10982
- value = codeValue?.name || EMPTY_VALUE;
10983
- }
10984
- return value;
10985
- }
10986
- var VERSION12, EMPTY_VALUE, REJECTED_STATUS, I3SAttributeLoader;
10987
- var init_i3s_attribute_loader = __esm({
10988
- "src/i3s-attribute-loader.ts"() {
10989
- init_src3();
10990
- init_parse_i3s_attribute();
10991
- init_url_utils();
10992
- VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
10993
- EMPTY_VALUE = "";
10994
- REJECTED_STATUS = "rejected";
10995
- I3SAttributeLoader = {
10996
- name: "I3S Attribute",
10997
- id: "i3s-attribute",
10998
- module: "i3s",
10999
- version: VERSION12,
11000
- mimeTypes: ["application/binary"],
11001
- parse: parse5,
11002
- extensions: ["bin"],
11003
- options: {},
11004
- binary: true
11005
- };
11006
- }
11007
- });
11008
-
11009
10714
  // src/lib/parsers/parse-i3s-building-scene-layer.ts
11010
10715
  async function parseBuildingSceneLayer(data, url) {
11011
10716
  const layer0 = JSON.parse(new TextDecoder().decode(data));
@@ -11072,35 +10777,67 @@
11072
10777
  async function parseWebscene(data) {
11073
10778
  const layer0 = JSON.parse(new TextDecoder().decode(data));
11074
10779
  const { operationalLayers } = layer0;
10780
+ const { layers, unsupportedLayers } = await parseOperationalLayers(operationalLayers, true);
10781
+ if (!layers.length) {
10782
+ throw new Error(NO_AVAILABLE_SUPPORTED_LAYERS_ERROR);
10783
+ }
11075
10784
  return {
11076
10785
  header: layer0,
11077
- layers: parseOperationalLayers(operationalLayers)
10786
+ layers,
10787
+ unsupportedLayers
11078
10788
  };
11079
10789
  }
11080
- function parseOperationalLayers(layersList) {
11081
- let layers = [];
10790
+ async function parseOperationalLayers(layersList, needToCheckCRS) {
10791
+ const layers = [];
10792
+ let unsupportedLayers = [];
11082
10793
  for (let index = 0; index < layersList.length; index++) {
11083
10794
  const layer = layersList[index];
11084
- if (SUPPORTED_LAYERS_TYPES.includes(layer.layerType)) {
10795
+ const isLayerSupported = SUPPORTED_LAYERS_TYPES.includes(layer.layerType);
10796
+ if (isLayerSupported) {
10797
+ if (needToCheckCRS && layer.layerType !== GROUP_LAYER) {
10798
+ await checkSupportedIndexCRS(layer);
10799
+ needToCheckCRS = false;
10800
+ }
11085
10801
  layers.push(layer);
10802
+ } else {
10803
+ unsupportedLayers.push(layer);
11086
10804
  }
11087
10805
  if (layer.layers?.length) {
11088
- layers = [...layers, ...parseOperationalLayers(layer.layers)];
10806
+ const { layers: childLayers, unsupportedLayers: childUnsupportedLayers } = await parseOperationalLayers(layer.layers, needToCheckCRS);
10807
+ layer.layers = childLayers;
10808
+ unsupportedLayers = [...unsupportedLayers, ...childUnsupportedLayers];
11089
10809
  }
11090
10810
  }
11091
- return layers;
10811
+ return { layers, unsupportedLayers };
10812
+ }
10813
+ async function checkSupportedIndexCRS(layer) {
10814
+ try {
10815
+ const layerJson = await load(layer.url, JSONLoader);
10816
+ const wkid = layerJson?.spatialReference?.wkid;
10817
+ if (wkid !== SUPPORTED_WKID) {
10818
+ throw new Error(NOT_SUPPORTED_CRS_ERROR);
10819
+ }
10820
+ } catch (error) {
10821
+ throw error;
10822
+ }
11092
10823
  }
11093
- var ARCGIS_SCENE_SERVER_LAYER_TYPE, BUILDING_SCENE_LAYER, INTEGRATED_MESH_LAYER, SUPPORTED_LAYERS_TYPES;
10824
+ var SUPPORTED_WKID, ARCGIS_SCENE_SERVER_LAYER_TYPE, BUILDING_SCENE_LAYER, INTEGRATED_MESH_LAYER, GROUP_LAYER, SUPPORTED_LAYERS_TYPES, NO_AVAILABLE_SUPPORTED_LAYERS_ERROR, NOT_SUPPORTED_CRS_ERROR;
11094
10825
  var init_parse_arcgis_webscene = __esm({
11095
10826
  "src/lib/parsers/parse-arcgis-webscene.ts"() {
10827
+ init_src3();
10828
+ SUPPORTED_WKID = 4326;
11096
10829
  ARCGIS_SCENE_SERVER_LAYER_TYPE = "ArcGISSceneServiceLayer";
11097
10830
  BUILDING_SCENE_LAYER = "BuildingSceneLayer";
11098
10831
  INTEGRATED_MESH_LAYER = "IntegratedMeshLayer";
10832
+ GROUP_LAYER = "GroupLayer";
11099
10833
  SUPPORTED_LAYERS_TYPES = [
11100
10834
  ARCGIS_SCENE_SERVER_LAYER_TYPE,
11101
10835
  INTEGRATED_MESH_LAYER,
11102
- BUILDING_SCENE_LAYER
10836
+ BUILDING_SCENE_LAYER,
10837
+ GROUP_LAYER
11103
10838
  ];
10839
+ NO_AVAILABLE_SUPPORTED_LAYERS_ERROR = "NO_AVAILABLE_SUPPORTED_LAYERS_ERROR";
10840
+ NOT_SUPPORTED_CRS_ERROR = "NOT_SUPPORTED_CRS_ERROR";
11104
10841
  }
11105
10842
  });
11106
10843
 
@@ -11150,10 +10887,10 @@
11150
10887
 
11151
10888
  // src/bundle.ts
11152
10889
  var require_bundle = __commonJS({
11153
- "src/bundle.ts"(exports, module2) {
10890
+ "src/bundle.ts"(exports, module) {
11154
10891
  var moduleExports = (init_src9(), src_exports);
11155
10892
  globalThis.loaders = globalThis.loaders || {};
11156
- module2.exports = Object.assign(globalThis.loaders, moduleExports);
10893
+ module.exports = Object.assign(globalThis.loaders, moduleExports);
11157
10894
  }
11158
10895
  });
11159
10896
  require_bundle();