@vitessce/spatial-utils 3.5.6 → 3.5.8

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.
@@ -22,7 +22,7 @@ var __privateSet = (obj, member, value, setter2) => {
22
22
  setter2 ? setter2.call(obj, value) : member.set(obj, value);
23
23
  return value;
24
24
  };
25
- var _bytes, _encoder, _data, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _encoder_config, _decoder_config, _shape2, _strides2, _metadata, _metadata2, _a2, _b;
25
+ var _bytes, _encoder, _data, _stride, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _encoder_config, _decoder_config, _order, _inverseOrder, _shape2, _strides, _metadata, _metadata2, _a2, _b;
26
26
  import "react";
27
27
  function _mergeNamespaces(n3, m) {
28
28
  for (var i2 = 0; i2 < m.length; i2++) {
@@ -137,7 +137,7 @@ var reTrimStart = /^\s+/;
137
137
  function baseTrim(string) {
138
138
  return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
139
139
  }
140
- function isObject$5(value) {
140
+ function isObject$6(value) {
141
141
  var type2 = typeof value;
142
142
  return value != null && (type2 == "object" || type2 == "function");
143
143
  }
@@ -153,9 +153,9 @@ function toNumber$1(value) {
153
153
  if (isSymbol$1(value)) {
154
154
  return NAN$1;
155
155
  }
156
- if (isObject$5(value)) {
156
+ if (isObject$6(value)) {
157
157
  var other = typeof value.valueOf == "function" ? value.valueOf() : value;
158
- value = isObject$5(other) ? other + "" : other;
158
+ value = isObject$6(other) ? other + "" : other;
159
159
  }
160
160
  if (typeof value != "string") {
161
161
  return value === 0 ? value : +value;
@@ -177,8 +177,8 @@ function toFinite(value) {
177
177
  return value === value ? value : 0;
178
178
  }
179
179
  var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
180
- function isFunction$3(value) {
181
- if (!isObject$5(value)) {
180
+ function isFunction$4(value) {
181
+ if (!isObject$6(value)) {
182
182
  return false;
183
183
  }
184
184
  var tag2 = baseGetTag(value);
@@ -217,10 +217,10 @@ var reIsNative = RegExp(
217
217
  "^" + funcToString.call(hasOwnProperty$a).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
218
218
  );
219
219
  function baseIsNative(value) {
220
- if (!isObject$5(value) || isMasked(value)) {
220
+ if (!isObject$6(value) || isMasked(value)) {
221
221
  return false;
222
222
  }
223
- var pattern = isFunction$3(value) ? reIsNative : reIsHostCtor;
223
+ var pattern = isFunction$4(value) ? reIsNative : reIsHostCtor;
224
224
  return pattern.test(toSource(value));
225
225
  }
226
226
  function getValue$1(object2, key) {
@@ -247,10 +247,10 @@ function isLength(value) {
247
247
  return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
248
248
  }
249
249
  function isArrayLike(value) {
250
- return value != null && isLength(value.length) && !isFunction$3(value);
250
+ return value != null && isLength(value.length) && !isFunction$4(value);
251
251
  }
252
252
  function isIterateeCall(value, index2, object2) {
253
- if (!isObject$5(object2)) {
253
+ if (!isObject$6(object2)) {
254
254
  return false;
255
255
  }
256
256
  var type2 = typeof index2;
@@ -888,7 +888,7 @@ function createRange(fromRight) {
888
888
  }
889
889
  var range$5 = createRange();
890
890
  const range$6 = range$5;
891
- function assert$c(condition, message) {
891
+ function assert$d(condition, message) {
892
892
  if (!condition) {
893
893
  throw new Error("math.gl assertion ".concat(message));
894
894
  }
@@ -905,7 +905,7 @@ const config$2 = {
905
905
  };
906
906
  function configure(options) {
907
907
  for (const key in options) {
908
- assert$c(key in config$2);
908
+ assert$d(key in config$2);
909
909
  config$2[key] = options[key];
910
910
  }
911
911
  return config$2;
@@ -1355,11 +1355,11 @@ class Vector extends MathArray {
1355
1355
  return this.distanceSquared(vector);
1356
1356
  }
1357
1357
  getComponent(i2) {
1358
- assert$c(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
1358
+ assert$d(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
1359
1359
  return checkNumber(this[i2]);
1360
1360
  }
1361
1361
  setComponent(i2, value) {
1362
- assert$c(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
1362
+ assert$d(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
1363
1363
  this[i2] = value;
1364
1364
  return this.check();
1365
1365
  }
@@ -4544,7 +4544,7 @@ const esm$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
4544
4544
  _SphericalCoordinates: SphericalCoordinates,
4545
4545
  acos: acos$2,
4546
4546
  asin: asin$2,
4547
- assert: assert$c,
4547
+ assert: assert$d,
4548
4548
  atan: atan$2,
4549
4549
  clamp: clamp$2,
4550
4550
  clone: clone$8,
@@ -4597,7 +4597,7 @@ var DEFAULT_CONFIG = {
4597
4597
  // null = randomly seed
4598
4598
  randomSeed: null
4599
4599
  };
4600
- function isNumber$1(x2) {
4600
+ function isNumber$2(x2) {
4601
4601
  return typeof x2 === "number";
4602
4602
  }
4603
4603
  function isBigNumber(x2) {
@@ -4652,7 +4652,7 @@ function isResultSet(x2) {
4652
4652
  function isHelp(x2) {
4653
4653
  return x2 && x2.constructor.prototype.isHelp === true || false;
4654
4654
  }
4655
- function isFunction$2(x2) {
4655
+ function isFunction$3(x2) {
4656
4656
  return typeof x2 === "function";
4657
4657
  }
4658
4658
  function isDate$1(x2) {
@@ -4661,13 +4661,13 @@ function isDate$1(x2) {
4661
4661
  function isRegExp(x2) {
4662
4662
  return x2 instanceof RegExp;
4663
4663
  }
4664
- function isObject$4(x2) {
4664
+ function isObject$5(x2) {
4665
4665
  return !!(x2 && typeof x2 === "object" && x2.constructor === Object && !isComplex(x2) && !isFraction(x2));
4666
4666
  }
4667
4667
  function isNull(x2) {
4668
4668
  return x2 === null;
4669
4669
  }
4670
- function isUndefined(x2) {
4670
+ function isUndefined$1(x2) {
4671
4671
  return x2 === void 0;
4672
4672
  }
4673
4673
  function isAccessorNode(x2) {
@@ -5751,9 +5751,9 @@ function format$3(value, options) {
5751
5751
  if (options.notation) {
5752
5752
  notation = options.notation;
5753
5753
  }
5754
- if (isNumber$1(options)) {
5754
+ if (isNumber$2(options)) {
5755
5755
  precision = options;
5756
- } else if (isNumber$1(options.precision)) {
5756
+ } else if (isNumber$2(options.precision)) {
5757
5757
  precision = options.precision;
5758
5758
  }
5759
5759
  if (options.wordSize) {
@@ -5821,7 +5821,7 @@ function toEngineering$1(value, precision) {
5821
5821
  var e2 = rounded.exponent;
5822
5822
  var c = rounded.coefficients;
5823
5823
  var newExp = e2 % 3 === 0 ? e2 : e2 < 0 ? e2 - 3 - e2 % 3 : e2 - e2 % 3;
5824
- if (isNumber$1(precision)) {
5824
+ if (isNumber$2(precision)) {
5825
5825
  while (precision > c.length || e2 - newExp + 1 > c.length) {
5826
5826
  c.push(0);
5827
5827
  }
@@ -5838,7 +5838,7 @@ function toEngineering$1(value, precision) {
5838
5838
  expDiff--;
5839
5839
  }
5840
5840
  var decimals = c.slice(decimalIdx).join("");
5841
- var decimalVal = isNumber$1(precision) && decimals.length || decimals.match(/[1-9]/) ? "." + decimals : "";
5841
+ var decimalVal = isNumber$2(precision) && decimals.length || decimals.match(/[1-9]/) ? "." + decimals : "";
5842
5842
  var str = c.slice(0, decimalIdx).join("") + decimalVal + "e" + (e2 >= 0 ? "+" : "") + newExp.toString();
5843
5843
  return rounded.sign + str;
5844
5844
  }
@@ -6221,7 +6221,7 @@ function validate$1(array, size2) {
6221
6221
  }
6222
6222
  }
6223
6223
  function validateIndex(index2, length2) {
6224
- if (!isNumber$1(index2) || !isInteger(index2)) {
6224
+ if (!isNumber$2(index2) || !isInteger(index2)) {
6225
6225
  throw new TypeError("Index must be an integer (value: " + index2 + ")");
6226
6226
  }
6227
6227
  if (index2 < 0 || typeof length2 === "number" && index2 >= length2) {
@@ -6236,7 +6236,7 @@ function resize(array, size2, defaultValue2) {
6236
6236
  throw new Error("Resizing to scalar is not supported");
6237
6237
  }
6238
6238
  size2.forEach(function(value) {
6239
- if (!isNumber$1(value) || !isInteger(value) || value < 0) {
6239
+ if (!isNumber$2(value) || !isInteger(value) || value < 0) {
6240
6240
  throw new TypeError("Invalid size, must contain positive integers (size: " + format$1(size2) + ")");
6241
6241
  }
6242
6242
  });
@@ -6532,7 +6532,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$Q, function crea
6532
6532
  typed2.types = [
6533
6533
  {
6534
6534
  name: "number",
6535
- test: isNumber$1
6535
+ test: isNumber$2
6536
6536
  },
6537
6537
  {
6538
6538
  name: "Complex",
@@ -6596,7 +6596,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$Q, function crea
6596
6596
  },
6597
6597
  {
6598
6598
  name: "function",
6599
- test: isFunction$2
6599
+ test: isFunction$3
6600
6600
  },
6601
6601
  {
6602
6602
  name: "Date",
@@ -6612,7 +6612,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$Q, function crea
6612
6612
  },
6613
6613
  {
6614
6614
  name: "undefined",
6615
- test: isUndefined
6615
+ test: isUndefined$1
6616
6616
  },
6617
6617
  {
6618
6618
  name: "AccessorNode",
@@ -6680,7 +6680,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$Q, function crea
6680
6680
  },
6681
6681
  {
6682
6682
  name: "Object",
6683
- test: isObject$4
6683
+ test: isObject$5
6684
6684
  }
6685
6685
  // order 'Object' last, it matches on other classes too
6686
6686
  ];
@@ -9003,7 +9003,7 @@ function clone$6(obj) {
9003
9003
  Decimal2.floor = floor$1;
9004
9004
  Decimal2.hypot = hypot;
9005
9005
  Decimal2.ln = ln;
9006
- Decimal2.log = log$5;
9006
+ Decimal2.log = log$6;
9007
9007
  Decimal2.log10 = log10;
9008
9008
  Decimal2.log2 = log2$1;
9009
9009
  Decimal2.max = max$2;
@@ -9068,7 +9068,7 @@ function isDecimalInstance(obj) {
9068
9068
  function ln(x2) {
9069
9069
  return new this(x2).ln();
9070
9070
  }
9071
- function log$5(x2, y2) {
9071
+ function log$6(x2, y2) {
9072
9072
  return new this(x2).log(y2);
9073
9073
  }
9074
9074
  function log2$1(x2) {
@@ -10252,7 +10252,7 @@ var createComplexClass = /* @__PURE__ */ factory(name$V, dependencies$O, () => {
10252
10252
  var re = this.re;
10253
10253
  var strRe = format$3(this.re, options);
10254
10254
  var strIm = format$3(this.im, options);
10255
- var precision = isNumber$1(options) ? options : options ? options.precision : null;
10255
+ var precision = isNumber$2(options) ? options : options ? options.precision : null;
10256
10256
  if (precision !== null) {
10257
10257
  var epsilon3 = Math.pow(10, -precision);
10258
10258
  if (Math.abs(re / im) < epsilon3) {
@@ -10302,11 +10302,11 @@ var createComplexClass = /* @__PURE__ */ factory(name$V, dependencies$O, () => {
10302
10302
  case 2: {
10303
10303
  var r2 = arguments[0];
10304
10304
  var phi = arguments[1];
10305
- if (isNumber$1(r2)) {
10305
+ if (isNumber$2(r2)) {
10306
10306
  if (isUnit(phi) && phi.hasBase("ANGLE")) {
10307
10307
  phi = phi.toNumber("rad");
10308
10308
  }
10309
- if (isNumber$1(phi)) {
10309
+ if (isNumber$2(phi)) {
10310
10310
  return new Complex$1({
10311
10311
  r: r2,
10312
10312
  phi
@@ -11439,7 +11439,7 @@ var createDenseMatrixClass = /* @__PURE__ */ factory(name$S, dependencies$L, (_r
11439
11439
  if (isBigNumber(k)) {
11440
11440
  k = k.toNumber();
11441
11441
  }
11442
- if (!isNumber$1(k) || !isInteger(k)) {
11442
+ if (!isNumber$2(k) || !isInteger(k)) {
11443
11443
  throw new TypeError("The parameter k must be an integer number");
11444
11444
  }
11445
11445
  } else {
@@ -11471,7 +11471,7 @@ var createDenseMatrixClass = /* @__PURE__ */ factory(name$S, dependencies$L, (_r
11471
11471
  if (isBigNumber(s2)) {
11472
11472
  s2 = s2.toNumber();
11473
11473
  }
11474
- if (!isNumber$1(s2) || !isInteger(s2) || s2 < 1) {
11474
+ if (!isNumber$2(s2) || !isInteger(s2) || s2 < 1) {
11475
11475
  throw new Error("Size values must be positive integers");
11476
11476
  }
11477
11477
  return s2;
@@ -11480,7 +11480,7 @@ var createDenseMatrixClass = /* @__PURE__ */ factory(name$S, dependencies$L, (_r
11480
11480
  if (isBigNumber(k)) {
11481
11481
  k = k.toNumber();
11482
11482
  }
11483
- if (!isNumber$1(k) || !isInteger(k)) {
11483
+ if (!isNumber$2(k) || !isInteger(k)) {
11484
11484
  throw new TypeError("The parameter k must be an integer number");
11485
11485
  }
11486
11486
  } else {
@@ -11531,7 +11531,7 @@ var createDenseMatrixClass = /* @__PURE__ */ factory(name$S, dependencies$L, (_r
11531
11531
  return new DenseMatrix2(json);
11532
11532
  };
11533
11533
  DenseMatrix2.prototype.swapRows = function(i2, j) {
11534
- if (!isNumber$1(i2) || !isInteger(i2) || !isNumber$1(j) || !isInteger(j)) {
11534
+ if (!isNumber$2(i2) || !isInteger(i2) || !isNumber$2(j) || !isInteger(j)) {
11535
11535
  throw new Error("Row index must be positive integers");
11536
11536
  }
11537
11537
  if (this._size.length !== 2) {
@@ -12017,7 +12017,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
12017
12017
  throw new Error("Only two dimensions matrix are supported");
12018
12018
  }
12019
12019
  sizeArray.forEach(function(value) {
12020
- if (!isNumber$1(value) || !isInteger(value) || value < 0) {
12020
+ if (!isNumber$2(value) || !isInteger(value) || value < 0) {
12021
12021
  throw new TypeError("Invalid size, must contain positive integers (size: " + format$1(sizeArray) + ")");
12022
12022
  }
12023
12023
  });
@@ -12098,7 +12098,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
12098
12098
  throw new Error("Sparse matrices can only be reshaped in two dimensions");
12099
12099
  }
12100
12100
  sizes.forEach(function(value) {
12101
- if (!isNumber$1(value) || !isInteger(value) || value <= -2 || value === 0) {
12101
+ if (!isNumber$2(value) || !isInteger(value) || value <= -2 || value === 0) {
12102
12102
  throw new TypeError("Invalid size, must contain positive integers or -1 (size: " + format$1(sizes) + ")");
12103
12103
  }
12104
12104
  });
@@ -12321,7 +12321,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
12321
12321
  if (isBigNumber(k)) {
12322
12322
  k = k.toNumber();
12323
12323
  }
12324
- if (!isNumber$1(k) || !isInteger(k)) {
12324
+ if (!isNumber$2(k) || !isInteger(k)) {
12325
12325
  throw new TypeError("The parameter k must be an integer number");
12326
12326
  }
12327
12327
  } else {
@@ -12370,7 +12370,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
12370
12370
  if (isBigNumber(s2)) {
12371
12371
  s2 = s2.toNumber();
12372
12372
  }
12373
- if (!isNumber$1(s2) || !isInteger(s2) || s2 < 1) {
12373
+ if (!isNumber$2(s2) || !isInteger(s2) || s2 < 1) {
12374
12374
  throw new Error("Size values must be positive integers");
12375
12375
  }
12376
12376
  return s2;
@@ -12379,7 +12379,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
12379
12379
  if (isBigNumber(k)) {
12380
12380
  k = k.toNumber();
12381
12381
  }
12382
- if (!isNumber$1(k) || !isInteger(k)) {
12382
+ if (!isNumber$2(k) || !isInteger(k)) {
12383
12383
  throw new TypeError("The parameter k must be an integer number");
12384
12384
  }
12385
12385
  } else {
@@ -12440,7 +12440,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
12440
12440
  });
12441
12441
  };
12442
12442
  SparseMatrix2.prototype.swapRows = function(i2, j) {
12443
- if (!isNumber$1(i2) || !isInteger(i2) || !isNumber$1(j) || !isInteger(j)) {
12443
+ if (!isNumber$2(i2) || !isInteger(i2) || !isNumber$2(j) || !isInteger(j)) {
12444
12444
  throw new Error("Row index must be positive integers");
12445
12445
  }
12446
12446
  if (this._size.length !== 2) {
@@ -19995,6 +19995,258 @@ var pluralizeExports = pluralize.exports;
19995
19995
  const plur = /* @__PURE__ */ getDefaultExportFromCjs(pluralizeExports);
19996
19996
  plur.addPluralRule("glomerulus", "glomeruli");
19997
19997
  plur.addPluralRule("interstitium", "interstitia");
19998
+ var loglevel = { exports: {} };
19999
+ (function(module2) {
20000
+ (function(root2, definition) {
20001
+ if (module2.exports) {
20002
+ module2.exports = definition();
20003
+ } else {
20004
+ root2.log = definition();
20005
+ }
20006
+ })(commonjsGlobal, function() {
20007
+ var noop2 = function() {
20008
+ };
20009
+ var undefinedType = "undefined";
20010
+ var isIE = typeof window !== undefinedType && typeof window.navigator !== undefinedType && /Trident\/|MSIE /.test(window.navigator.userAgent);
20011
+ var logMethods = [
20012
+ "trace",
20013
+ "debug",
20014
+ "info",
20015
+ "warn",
20016
+ "error"
20017
+ ];
20018
+ var _loggersByName = {};
20019
+ var defaultLogger = null;
20020
+ function bindMethod(obj, methodName) {
20021
+ var method = obj[methodName];
20022
+ if (typeof method.bind === "function") {
20023
+ return method.bind(obj);
20024
+ } else {
20025
+ try {
20026
+ return Function.prototype.bind.call(method, obj);
20027
+ } catch (e2) {
20028
+ return function() {
20029
+ return Function.prototype.apply.apply(method, [obj, arguments]);
20030
+ };
20031
+ }
20032
+ }
20033
+ }
20034
+ function traceForIE() {
20035
+ if (console.log) {
20036
+ if (console.log.apply) {
20037
+ console.log.apply(console, arguments);
20038
+ } else {
20039
+ Function.prototype.apply.apply(console.log, [console, arguments]);
20040
+ }
20041
+ }
20042
+ if (console.trace)
20043
+ console.trace();
20044
+ }
20045
+ function realMethod(methodName) {
20046
+ if (methodName === "debug") {
20047
+ methodName = "log";
20048
+ }
20049
+ if (typeof console === undefinedType) {
20050
+ return false;
20051
+ } else if (methodName === "trace" && isIE) {
20052
+ return traceForIE;
20053
+ } else if (console[methodName] !== void 0) {
20054
+ return bindMethod(console, methodName);
20055
+ } else if (console.log !== void 0) {
20056
+ return bindMethod(console, "log");
20057
+ } else {
20058
+ return noop2;
20059
+ }
20060
+ }
20061
+ function replaceLoggingMethods() {
20062
+ var level = this.getLevel();
20063
+ for (var i2 = 0; i2 < logMethods.length; i2++) {
20064
+ var methodName = logMethods[i2];
20065
+ this[methodName] = i2 < level ? noop2 : this.methodFactory(methodName, level, this.name);
20066
+ }
20067
+ this.log = this.debug;
20068
+ if (typeof console === undefinedType && level < this.levels.SILENT) {
20069
+ return "No console available for logging";
20070
+ }
20071
+ }
20072
+ function enableLoggingWhenConsoleArrives(methodName) {
20073
+ return function() {
20074
+ if (typeof console !== undefinedType) {
20075
+ replaceLoggingMethods.call(this);
20076
+ this[methodName].apply(this, arguments);
20077
+ }
20078
+ };
20079
+ }
20080
+ function defaultMethodFactory(methodName, _level, _loggerName) {
20081
+ return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
20082
+ }
20083
+ function Logger(name2, factory2) {
20084
+ var self2 = this;
20085
+ var inheritedLevel;
20086
+ var defaultLevel;
20087
+ var userLevel;
20088
+ var storageKey = "loglevel";
20089
+ if (typeof name2 === "string") {
20090
+ storageKey += ":" + name2;
20091
+ } else if (typeof name2 === "symbol") {
20092
+ storageKey = void 0;
20093
+ }
20094
+ function persistLevelIfPossible(levelNum) {
20095
+ var levelName = (logMethods[levelNum] || "silent").toUpperCase();
20096
+ if (typeof window === undefinedType || !storageKey)
20097
+ return;
20098
+ try {
20099
+ window.localStorage[storageKey] = levelName;
20100
+ return;
20101
+ } catch (ignore) {
20102
+ }
20103
+ try {
20104
+ window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
20105
+ } catch (ignore) {
20106
+ }
20107
+ }
20108
+ function getPersistedLevel() {
20109
+ var storedLevel;
20110
+ if (typeof window === undefinedType || !storageKey)
20111
+ return;
20112
+ try {
20113
+ storedLevel = window.localStorage[storageKey];
20114
+ } catch (ignore) {
20115
+ }
20116
+ if (typeof storedLevel === undefinedType) {
20117
+ try {
20118
+ var cookie = window.document.cookie;
20119
+ var cookieName = encodeURIComponent(storageKey);
20120
+ var location = cookie.indexOf(cookieName + "=");
20121
+ if (location !== -1) {
20122
+ storedLevel = /^([^;]+)/.exec(
20123
+ cookie.slice(location + cookieName.length + 1)
20124
+ )[1];
20125
+ }
20126
+ } catch (ignore) {
20127
+ }
20128
+ }
20129
+ if (self2.levels[storedLevel] === void 0) {
20130
+ storedLevel = void 0;
20131
+ }
20132
+ return storedLevel;
20133
+ }
20134
+ function clearPersistedLevel() {
20135
+ if (typeof window === undefinedType || !storageKey)
20136
+ return;
20137
+ try {
20138
+ window.localStorage.removeItem(storageKey);
20139
+ } catch (ignore) {
20140
+ }
20141
+ try {
20142
+ window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
20143
+ } catch (ignore) {
20144
+ }
20145
+ }
20146
+ function normalizeLevel(input) {
20147
+ var level = input;
20148
+ if (typeof level === "string" && self2.levels[level.toUpperCase()] !== void 0) {
20149
+ level = self2.levels[level.toUpperCase()];
20150
+ }
20151
+ if (typeof level === "number" && level >= 0 && level <= self2.levels.SILENT) {
20152
+ return level;
20153
+ } else {
20154
+ throw new TypeError("log.setLevel() called with invalid level: " + input);
20155
+ }
20156
+ }
20157
+ self2.name = name2;
20158
+ self2.levels = {
20159
+ "TRACE": 0,
20160
+ "DEBUG": 1,
20161
+ "INFO": 2,
20162
+ "WARN": 3,
20163
+ "ERROR": 4,
20164
+ "SILENT": 5
20165
+ };
20166
+ self2.methodFactory = factory2 || defaultMethodFactory;
20167
+ self2.getLevel = function() {
20168
+ if (userLevel != null) {
20169
+ return userLevel;
20170
+ } else if (defaultLevel != null) {
20171
+ return defaultLevel;
20172
+ } else {
20173
+ return inheritedLevel;
20174
+ }
20175
+ };
20176
+ self2.setLevel = function(level, persist) {
20177
+ userLevel = normalizeLevel(level);
20178
+ if (persist !== false) {
20179
+ persistLevelIfPossible(userLevel);
20180
+ }
20181
+ return replaceLoggingMethods.call(self2);
20182
+ };
20183
+ self2.setDefaultLevel = function(level) {
20184
+ defaultLevel = normalizeLevel(level);
20185
+ if (!getPersistedLevel()) {
20186
+ self2.setLevel(level, false);
20187
+ }
20188
+ };
20189
+ self2.resetLevel = function() {
20190
+ userLevel = null;
20191
+ clearPersistedLevel();
20192
+ replaceLoggingMethods.call(self2);
20193
+ };
20194
+ self2.enableAll = function(persist) {
20195
+ self2.setLevel(self2.levels.TRACE, persist);
20196
+ };
20197
+ self2.disableAll = function(persist) {
20198
+ self2.setLevel(self2.levels.SILENT, persist);
20199
+ };
20200
+ self2.rebuild = function() {
20201
+ if (defaultLogger !== self2) {
20202
+ inheritedLevel = normalizeLevel(defaultLogger.getLevel());
20203
+ }
20204
+ replaceLoggingMethods.call(self2);
20205
+ if (defaultLogger === self2) {
20206
+ for (var childName in _loggersByName) {
20207
+ _loggersByName[childName].rebuild();
20208
+ }
20209
+ }
20210
+ };
20211
+ inheritedLevel = normalizeLevel(
20212
+ defaultLogger ? defaultLogger.getLevel() : "WARN"
20213
+ );
20214
+ var initialLevel = getPersistedLevel();
20215
+ if (initialLevel != null) {
20216
+ userLevel = normalizeLevel(initialLevel);
20217
+ }
20218
+ replaceLoggingMethods.call(self2);
20219
+ }
20220
+ defaultLogger = new Logger();
20221
+ defaultLogger.getLogger = function getLogger(name2) {
20222
+ if (typeof name2 !== "symbol" && typeof name2 !== "string" || name2 === "") {
20223
+ throw new TypeError("You must supply a name when creating a logger.");
20224
+ }
20225
+ var logger = _loggersByName[name2];
20226
+ if (!logger) {
20227
+ logger = _loggersByName[name2] = new Logger(
20228
+ name2,
20229
+ defaultLogger.methodFactory
20230
+ );
20231
+ }
20232
+ return logger;
20233
+ };
20234
+ var _log = typeof window !== undefinedType ? window.log : void 0;
20235
+ defaultLogger.noConflict = function() {
20236
+ if (typeof window !== undefinedType && window.log === defaultLogger) {
20237
+ window.log = _log;
20238
+ }
20239
+ return defaultLogger;
20240
+ };
20241
+ defaultLogger.getLoggers = function getLoggers2() {
20242
+ return _loggersByName;
20243
+ };
20244
+ defaultLogger["default"] = defaultLogger;
20245
+ return defaultLogger;
20246
+ });
20247
+ })(loglevel);
20248
+ var loglevelExports = loglevel.exports;
20249
+ const log$5 = /* @__PURE__ */ getDefaultExportFromCjs(loglevelExports);
19998
20250
  const VIEWER_PALETTE = [
19999
20251
  [0, 0, 255],
20000
20252
  [0, 255, 0],
@@ -20005,7 +20257,7 @@ const VIEWER_PALETTE = [
20005
20257
  [255, 128, 0],
20006
20258
  [255, 0, 0]
20007
20259
  ];
20008
- function assert$b(condition, message) {
20260
+ function assert$c(condition, message) {
20009
20261
  if (!condition) {
20010
20262
  throw new Error(message || "loader assertion failed.");
20011
20263
  }
@@ -20014,7 +20266,7 @@ const isBrowser$3 = Boolean(typeof process !== "object" || String(process) !== "
20014
20266
  const matches$1 = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
20015
20267
  matches$1 && parseFloat(matches$1[1]) || 0;
20016
20268
  const VERSION$b = "3.2.10";
20017
- function assert$a(condition, message) {
20269
+ function assert$b(condition, message) {
20018
20270
  if (!condition) {
20019
20271
  throw new Error(message || "loaders.gl assertion failed.");
20020
20272
  }
@@ -20056,12 +20308,12 @@ class WorkerJob {
20056
20308
  });
20057
20309
  }
20058
20310
  done(value) {
20059
- assert$a(this.isRunning);
20311
+ assert$b(this.isRunning);
20060
20312
  this.isRunning = false;
20061
20313
  this._resolve(value);
20062
20314
  }
20063
20315
  error(error2) {
20064
- assert$a(this.isRunning);
20316
+ assert$b(this.isRunning);
20065
20317
  this.isRunning = false;
20066
20318
  this._reject(error2);
20067
20319
  }
@@ -20070,7 +20322,7 @@ let Worker$1 = class Worker2 {
20070
20322
  };
20071
20323
  const workerURLCache = /* @__PURE__ */ new Map();
20072
20324
  function getLoadableWorkerURL(props) {
20073
- assert$a(props.source && !props.url || !props.source && props.url);
20325
+ assert$b(props.source && !props.url || !props.source && props.url);
20074
20326
  let workerURL = workerURLCache.get(props.source || props.url);
20075
20327
  if (!workerURL) {
20076
20328
  if (props.url) {
@@ -20082,7 +20334,7 @@ function getLoadableWorkerURL(props) {
20082
20334
  workerURLCache.set(props.source, workerURL);
20083
20335
  }
20084
20336
  }
20085
- assert$a(workerURL);
20337
+ assert$b(workerURL);
20086
20338
  return workerURL;
20087
20339
  }
20088
20340
  function getLoadableWorkerURLFromURL(url) {
@@ -20156,7 +20408,7 @@ class WorkerThread {
20156
20408
  source,
20157
20409
  url
20158
20410
  } = props;
20159
- assert$a(source || url);
20411
+ assert$b(source || url);
20160
20412
  this.name = name2;
20161
20413
  this.source = source;
20162
20414
  this.url = url;
@@ -20441,11 +20693,11 @@ function getWorkerURL(worker, options = {}) {
20441
20693
  const versionTag = version2 ? "@".concat(version2) : "";
20442
20694
  url = "https://unpkg.com/@loaders.gl/".concat(worker.module).concat(versionTag, "/dist/").concat(workerFile);
20443
20695
  }
20444
- assert$a(url);
20696
+ assert$b(url);
20445
20697
  return url;
20446
20698
  }
20447
20699
  function validateWorkerVersion(worker, coreVersion = VERSION$b) {
20448
- assert$a(worker, "no worker provided");
20700
+ assert$b(worker, "no worker provided");
20449
20701
  const workerVersion = worker.version;
20450
20702
  if (!coreVersion || !workerVersion) {
20451
20703
  return false;
@@ -20473,7 +20725,7 @@ function getLibraryUrl(library, moduleName, options) {
20473
20725
  return "modules/".concat(moduleName, "/dist/libs/").concat(library);
20474
20726
  }
20475
20727
  if (options.CDN) {
20476
- assert$a(options.CDN.startsWith("http"));
20728
+ assert$b(options.CDN.startsWith("http"));
20477
20729
  return "".concat(options.CDN, "/").concat(moduleName, "@").concat(VERSION$a, "/dist/libs/").concat(library);
20478
20730
  }
20479
20731
  if (isWorker) {
@@ -20686,8 +20938,8 @@ function sliceArrayBuffer(arrayBuffer2, byteOffset, byteLength) {
20686
20938
  return arrayCopy.buffer;
20687
20939
  }
20688
20940
  function padToNBytes(byteLength, padding) {
20689
- assert$b(byteLength >= 0);
20690
- assert$b(padding > 0);
20941
+ assert$c(byteLength >= 0);
20942
+ assert$c(padding > 0);
20691
20943
  return byteLength + (padding - 1) & ~(padding - 1);
20692
20944
  }
20693
20945
  function copyToArray(source, target, targetOffset) {
@@ -21034,16 +21286,16 @@ function dirname(url) {
21034
21286
  return slashIndex >= 0 ? url.substr(0, slashIndex) : "";
21035
21287
  }
21036
21288
  const isBoolean = (x2) => typeof x2 === "boolean";
21037
- const isFunction$1 = (x2) => typeof x2 === "function";
21038
- const isObject$3 = (x2) => x2 !== null && typeof x2 === "object";
21039
- const isPureObject = (x2) => isObject$3(x2) && x2.constructor === {}.constructor;
21289
+ const isFunction$2 = (x2) => typeof x2 === "function";
21290
+ const isObject$4 = (x2) => x2 !== null && typeof x2 === "object";
21291
+ const isPureObject = (x2) => isObject$4(x2) && x2.constructor === {}.constructor;
21040
21292
  const isIterable = (x2) => x2 && typeof x2[Symbol.iterator] === "function";
21041
21293
  const isAsyncIterable$1 = (x2) => x2 && typeof x2[Symbol.asyncIterator] === "function";
21042
21294
  const isResponse = (x2) => typeof Response !== "undefined" && x2 instanceof Response || x2 && x2.arrayBuffer && x2.text && x2.json;
21043
21295
  const isBlob = (x2) => typeof Blob !== "undefined" && x2 instanceof Blob;
21044
21296
  const isBuffer$1 = (x2) => x2 && typeof x2 === "object" && x2.isBuffer;
21045
- const isReadableDOMStream = (x2) => typeof ReadableStream !== "undefined" && x2 instanceof ReadableStream || isObject$3(x2) && isFunction$1(x2.tee) && isFunction$1(x2.cancel) && isFunction$1(x2.getReader);
21046
- const isReadableNodeStream = (x2) => isObject$3(x2) && isFunction$1(x2.read) && isFunction$1(x2.pipe) && isBoolean(x2.readable);
21297
+ const isReadableDOMStream = (x2) => typeof ReadableStream !== "undefined" && x2 instanceof ReadableStream || isObject$4(x2) && isFunction$2(x2.tee) && isFunction$2(x2.cancel) && isFunction$2(x2.getReader);
21298
+ const isReadableNodeStream = (x2) => isObject$4(x2) && isFunction$2(x2.read) && isFunction$2(x2.pipe) && isBoolean(x2.readable);
21047
21299
  const isReadableStream = (x2) => isReadableDOMStream(x2) || isReadableNodeStream(x2);
21048
21300
  const DATA_URL_PATTERN = /^data:([-\w.]+\/[-\w.+]+)(;|,)/;
21049
21301
  const MIME_TYPE_PATTERN = /^([-\w.]+\/[-\w.+]+)/;
@@ -21385,7 +21637,7 @@ function autobind(obj) {
21385
21637
  }
21386
21638
  }
21387
21639
  }
21388
- function assert$9(condition, message) {
21640
+ function assert$a(condition, message) {
21389
21641
  if (!condition) {
21390
21642
  throw new Error(message || "Assertion failed");
21391
21643
  }
@@ -21498,7 +21750,7 @@ class Log {
21498
21750
  }
21499
21751
  }
21500
21752
  assert(condition, message) {
21501
- assert$9(condition, message);
21753
+ assert$a(condition, message);
21502
21754
  }
21503
21755
  warn(message) {
21504
21756
  return this._getLogFunction(0, message, originalConsole.warn, arguments, ONCE);
@@ -21617,7 +21869,7 @@ class Log {
21617
21869
  opts
21618
21870
  });
21619
21871
  method = method || opts.method;
21620
- assert$9(method);
21872
+ assert$a(method);
21621
21873
  opts.total = this.getTotal();
21622
21874
  opts.delta = this.getDelta();
21623
21875
  this._deltaTs = getHiResTimestamp();
@@ -21651,7 +21903,7 @@ function normalizeLogLevel(logLevel) {
21651
21903
  default:
21652
21904
  return 0;
21653
21905
  }
21654
- assert$9(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
21906
+ assert$a(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
21655
21907
  return resolvedLevel;
21656
21908
  }
21657
21909
  function normalizeArguments(opts) {
@@ -21679,7 +21931,7 @@ function normalizeArguments(opts) {
21679
21931
  opts.message = opts.message();
21680
21932
  }
21681
21933
  const messageType = typeof opts.message;
21682
- assert$9(messageType === "string" || messageType === "object");
21934
+ assert$a(messageType === "string" || messageType === "object");
21683
21935
  return Object.assign(opts, {
21684
21936
  args
21685
21937
  }, opts.opts);
@@ -21843,7 +22095,7 @@ function getFetchFunction(options, context) {
21843
22095
  if (typeof fetchOptions.fetch === "function") {
21844
22096
  return fetchOptions.fetch;
21845
22097
  }
21846
- if (isObject$3(fetchOptions.fetch)) {
22098
+ if (isObject$4(fetchOptions.fetch)) {
21847
22099
  return (url) => fetchFile(url, fetchOptions);
21848
22100
  }
21849
22101
  if (context !== null && context !== void 0 && context.fetch) {
@@ -21864,7 +22116,7 @@ function validateOptionsObject(options, id, defaultOptions, deprecatedOptions, l
21864
22116
  const loaderName = id || "Top level";
21865
22117
  const prefix = id ? "".concat(id, ".") : "";
21866
22118
  for (const key in options) {
21867
- const isSubOptions = !id && isObject$3(options[key]);
22119
+ const isSubOptions = !id && isObject$4(options[key]);
21868
22120
  const isBaseUriOption = key === "baseUri" && !id;
21869
22121
  const isWorkerUrlOption = key === "workerUrl" && id;
21870
22122
  if (!(key in defaultOptions) && !isBaseUriOption && !isWorkerUrlOption) {
@@ -21940,8 +22192,8 @@ function isLoaderObject(loader) {
21940
22192
  }
21941
22193
  function normalizeLoader(loader) {
21942
22194
  var _loader2, _loader3;
21943
- assert$b(loader, "null loader");
21944
- assert$b(isLoaderObject(loader), "invalid loader");
22195
+ assert$c(loader, "null loader");
22196
+ assert$c(isLoaderObject(loader), "invalid loader");
21945
22197
  let options;
21946
22198
  if (Array.isArray(loader)) {
21947
22199
  options = loader[1];
@@ -22340,7 +22592,7 @@ function getLoadersFromContext(loaders, context) {
22340
22592
  return candidateLoaders && candidateLoaders.length ? candidateLoaders : null;
22341
22593
  }
22342
22594
  async function parse$3(data, loaders, options, context) {
22343
- assert$a(!context || typeof context === "object");
22595
+ assert$b(!context || typeof context === "object");
22344
22596
  if (loaders && !Array.isArray(loaders) && !isLoaderObject(loaders)) {
22345
22597
  context = void 0;
22346
22598
  options = loaders;
@@ -22402,7 +22654,7 @@ async function parseWithLoader(loader, data, options, context) {
22402
22654
  if (loader.parse) {
22403
22655
  return await loader.parse(data, options, context, loader);
22404
22656
  }
22405
- assert$a(!loader.parseSync);
22657
+ assert$b(!loader.parseSync);
22406
22658
  throw new Error("".concat(loader.id, " loader - no parser found and worker is disabled"));
22407
22659
  }
22408
22660
  async function load(url, loaders, options, context) {
@@ -22678,7 +22930,7 @@ async function parseToNodeImage(arrayBuffer2, options) {
22678
22930
  mimeType
22679
22931
  } = getBinaryImageMetadata(arrayBuffer2) || {};
22680
22932
  const _parseImageNode2 = globalThis._parseImageNode;
22681
- assert$b(_parseImageNode2);
22933
+ assert$c(_parseImageNode2);
22682
22934
  return await _parseImageNode2(arrayBuffer2, mimeType);
22683
22935
  }
22684
22936
  async function parseImage(arrayBuffer2, options, context) {
@@ -22701,7 +22953,7 @@ async function parseImage(arrayBuffer2, options, context) {
22701
22953
  image = await parseToNodeImage(arrayBuffer2);
22702
22954
  break;
22703
22955
  default:
22704
- assert$b(false);
22956
+ assert$c(false);
22705
22957
  }
22706
22958
  if (imageType === "data") {
22707
22959
  image = getImageData(image);
@@ -22924,7 +23176,7 @@ const deckGlobal = globalThis.deck;
22924
23176
  const log$2 = new Log({
22925
23177
  id: "luma.gl"
22926
23178
  });
22927
- function assert$8(condition, message) {
23179
+ function assert$9(condition, message) {
22928
23180
  if (!condition) {
22929
23181
  throw new Error(message || "luma.gl: assertion failed.");
22930
23182
  }
@@ -22950,11 +23202,11 @@ function getWebGL2Context(gl) {
22950
23202
  return isWebGL2$1(gl) ? gl : null;
22951
23203
  }
22952
23204
  function assertWebGLContext(gl) {
22953
- assert$8(isWebGL(gl), ERR_CONTEXT);
23205
+ assert$9(isWebGL(gl), ERR_CONTEXT);
22954
23206
  return gl;
22955
23207
  }
22956
23208
  function assertWebGL2Context(gl) {
22957
- assert$8(isWebGL2$1(gl), ERR_WEBGL2);
23209
+ assert$9(isWebGL2$1(gl), ERR_WEBGL2);
22958
23210
  return gl;
22959
23211
  }
22960
23212
  const glErrorShadow = {};
@@ -23320,7 +23572,7 @@ const WEBGL2_CONTEXT_POLYFILLS = {
23320
23572
  suffix: "OES"
23321
23573
  },
23322
23574
  createVertexArray: () => {
23323
- assert$8(false, ERR_VAO_NOT_SUPPORTED);
23575
+ assert$9(false, ERR_VAO_NOT_SUPPORTED);
23324
23576
  },
23325
23577
  deleteVertexArray: () => {
23326
23578
  },
@@ -23333,7 +23585,7 @@ const WEBGL2_CONTEXT_POLYFILLS = {
23333
23585
  suffix: "ANGLE"
23334
23586
  },
23335
23587
  vertexAttribDivisor(location, divisor) {
23336
- assert$8(divisor === 0, "WebGL instanced rendering not supported");
23588
+ assert$9(divisor === 0, "WebGL instanced rendering not supported");
23337
23589
  },
23338
23590
  drawElementsInstanced: () => {
23339
23591
  },
@@ -23345,7 +23597,7 @@ const WEBGL2_CONTEXT_POLYFILLS = {
23345
23597
  suffix: "WEBGL"
23346
23598
  },
23347
23599
  drawBuffers: () => {
23348
- assert$8(false);
23600
+ assert$9(false);
23349
23601
  }
23350
23602
  },
23351
23603
  [EXT_disjoint_timer_query]: {
@@ -23353,13 +23605,13 @@ const WEBGL2_CONTEXT_POLYFILLS = {
23353
23605
  suffix: "EXT"
23354
23606
  },
23355
23607
  createQuery: () => {
23356
- assert$8(false);
23608
+ assert$9(false);
23357
23609
  },
23358
23610
  deleteQuery: () => {
23359
- assert$8(false);
23611
+ assert$9(false);
23360
23612
  },
23361
23613
  beginQuery: () => {
23362
- assert$8(false);
23614
+ assert$9(false);
23363
23615
  },
23364
23616
  endQuery: () => {
23365
23617
  },
@@ -23492,7 +23744,7 @@ function polyfillExtension(gl, _ref2) {
23492
23744
  target2
23493
23745
  } = _ref2;
23494
23746
  const defaults = WEBGL2_CONTEXT_POLYFILLS[extension];
23495
- assert$8(defaults);
23747
+ assert$9(defaults);
23496
23748
  const {
23497
23749
  meta: meta2 = {}
23498
23750
  } = defaults;
@@ -23961,7 +24213,7 @@ class GLState {
23961
24213
  this.stateStack.push({});
23962
24214
  }
23963
24215
  pop() {
23964
- assert$8(this.stateStack.length > 0);
24216
+ assert$9(this.stateStack.length > 0);
23965
24217
  const oldValues = this.stateStack[this.stateStack.length - 1];
23966
24218
  setParameters(this.gl, oldValues);
23967
24219
  this.stateStack.pop();
@@ -23971,7 +24223,7 @@ class GLState {
23971
24223
  let oldValue;
23972
24224
  const oldValues = this.stateStack.length > 0 && this.stateStack[this.stateStack.length - 1];
23973
24225
  for (const key in values) {
23974
- assert$8(key !== void 0);
24226
+ assert$9(key !== void 0);
23975
24227
  const value = values[key];
23976
24228
  const cached = this.cache[key];
23977
24229
  if (!deepArrayEqual(value, cached)) {
@@ -23995,7 +24247,7 @@ function trackContextState(gl) {
23995
24247
  enable: enable2 = true,
23996
24248
  copyState
23997
24249
  } = options;
23998
- assert$8(copyState !== void 0);
24250
+ assert$9(copyState !== void 0);
23999
24251
  if (!gl.state) {
24000
24252
  const {
24001
24253
  polyfillContext: polyfillContext2
@@ -24026,11 +24278,11 @@ function pushContextState(gl) {
24026
24278
  gl.state.push();
24027
24279
  }
24028
24280
  function popContextState(gl) {
24029
- assert$8(gl.state);
24281
+ assert$9(gl.state);
24030
24282
  gl.state.pop();
24031
24283
  }
24032
24284
  function setParameters(gl, values) {
24033
- assert$8(isWebGL(gl), "setParameters requires a WebGL context");
24285
+ assert$9(isWebGL(gl), "setParameters requires a WebGL context");
24034
24286
  if (isObjectEmpty$1(values)) {
24035
24287
  return;
24036
24288
  }
@@ -24161,7 +24413,7 @@ const CONTEXT_DEFAULTS = {
24161
24413
  };
24162
24414
  function createGLContext() {
24163
24415
  let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
24164
- assert$8(isBrowser, "createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils");
24416
+ assert$9(isBrowser, "createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils");
24165
24417
  options = Object.assign({}, CONTEXT_DEFAULTS, options);
24166
24418
  const {
24167
24419
  width,
@@ -24396,7 +24648,7 @@ function requestAnimationFrame$1(callback) {
24396
24648
  function cancelAnimationFrame(timerId) {
24397
24649
  return typeof window !== "undefined" && window.cancelAnimationFrame ? window.cancelAnimationFrame(timerId) : clearTimeout(timerId);
24398
24650
  }
24399
- function assert$7(condition, message) {
24651
+ function assert$8(condition, message) {
24400
24652
  if (!condition) {
24401
24653
  throw new Error(message || "luma.gl: assertion failed.");
24402
24654
  }
@@ -24411,7 +24663,7 @@ function getKeyValue(gl, name2) {
24411
24663
  }
24412
24664
  name2 = name2.replace(/^.*\./, "");
24413
24665
  const value = gl[name2];
24414
- assert$7(value !== void 0, "Accessing undefined constant GL.".concat(name2));
24666
+ assert$8(value !== void 0, "Accessing undefined constant GL.".concat(name2));
24415
24667
  return value;
24416
24668
  }
24417
24669
  function getKey(gl, value) {
@@ -24431,7 +24683,7 @@ function uid() {
24431
24683
  return "".concat(id, "-").concat(count2);
24432
24684
  }
24433
24685
  function isPowerOfTwo(n3) {
24434
- assert$7(typeof n3 === "number", "Input must be a number");
24686
+ assert$8(typeof n3 === "number", "Input must be a number");
24435
24687
  return n3 && (n3 & n3 - 1) === 0;
24436
24688
  }
24437
24689
  function isObjectEmpty(obj) {
@@ -24523,7 +24775,7 @@ let Resource$1 = class Resource {
24523
24775
  getParameter(pname) {
24524
24776
  let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
24525
24777
  pname = getKeyValue(this.gl, pname);
24526
- assert$7(pname);
24778
+ assert$8(pname);
24527
24779
  const parameters = this.constructor.PARAMETERS || {};
24528
24780
  const parameter = parameters[pname];
24529
24781
  if (parameter) {
@@ -24563,7 +24815,7 @@ let Resource$1 = class Resource {
24563
24815
  }
24564
24816
  setParameter(pname, value) {
24565
24817
  pname = getKeyValue(this.gl, pname);
24566
- assert$7(pname);
24818
+ assert$8(pname);
24567
24819
  const parameters = this.constructor.PARAMETERS || {};
24568
24820
  const parameter = parameters[pname];
24569
24821
  if (parameter) {
@@ -24793,7 +25045,7 @@ class Accessor {
24793
25045
  return ArrayType.BYTES_PER_ELEMENT;
24794
25046
  }
24795
25047
  static getBytesPerVertex(accessor) {
24796
- assert$7(accessor.size);
25048
+ assert$8(accessor.size);
24797
25049
  const ArrayType = getTypedArrayFromGLType(accessor.type || 5126);
24798
25050
  return ArrayType.BYTES_PER_ELEMENT * accessor.size;
24799
25051
  }
@@ -24966,7 +25218,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
24966
25218
  srcOffset = 0
24967
25219
  } = props;
24968
25220
  const byteLength = props.byteLength || props.length;
24969
- assert$7(data);
25221
+ assert$8(data);
24970
25222
  const target = this.gl.webgl2 ? 36663 : this.target;
24971
25223
  this.gl.bindBuffer(target, this.handle);
24972
25224
  if (srcOffset !== 0 || byteLength !== void 0) {
@@ -25023,7 +25275,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
25023
25275
  }
25024
25276
  const copyElementCount = Math.min(sourceAvailableElementCount, dstAvailableElementCount);
25025
25277
  length2 = length2 || copyElementCount;
25026
- assert$7(length2 <= copyElementCount);
25278
+ assert$8(length2 <= copyElementCount);
25027
25279
  dstData = dstData || new ArrayType(dstElementCount);
25028
25280
  this.gl.bindBuffer(36662, this.handle);
25029
25281
  this.gl.getBufferSubData(36662, srcByteOffset, dstData, dstOffset, length2);
@@ -25041,7 +25293,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
25041
25293
  if (size2 !== void 0) {
25042
25294
  this.gl.bindBufferRange(target, index2, this.handle, offset, size2);
25043
25295
  } else {
25044
- assert$7(offset === 0);
25296
+ assert$8(offset === 0);
25045
25297
  this.gl.bindBufferBase(target, index2, this.handle);
25046
25298
  }
25047
25299
  } else {
@@ -25083,7 +25335,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
25083
25335
  _setData(data) {
25084
25336
  let offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
25085
25337
  let byteLength = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : data.byteLength + offset;
25086
- assert$7(ArrayBuffer.isView(data));
25338
+ assert$8(ArrayBuffer.isView(data));
25087
25339
  this._trackDeallocatedMemory();
25088
25340
  const target = this._getTarget();
25089
25341
  this.gl.bindBuffer(target, this.handle);
@@ -25094,7 +25346,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
25094
25346
  this.bytesUsed = byteLength;
25095
25347
  this._trackAllocatedMemory(byteLength);
25096
25348
  const type2 = getGLTypeFromTypedArray(data);
25097
- assert$7(type2);
25349
+ assert$8(type2);
25098
25350
  this.setAccessor(new Accessor(this.accessor, {
25099
25351
  type: type2
25100
25352
  }));
@@ -25102,7 +25354,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
25102
25354
  }
25103
25355
  _setByteLength(byteLength) {
25104
25356
  let usage = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.usage;
25105
- assert$7(byteLength >= 0);
25357
+ assert$8(byteLength >= 0);
25106
25358
  this._trackDeallocatedMemory();
25107
25359
  let data = byteLength;
25108
25360
  if (byteLength === 0) {
@@ -25534,7 +25786,7 @@ class Texture extends Resource$1 {
25534
25786
  }
25535
25787
  break;
25536
25788
  default:
25537
- assert$7(false, "Unknown image data type");
25789
+ assert$8(false, "Unknown image data type");
25538
25790
  }
25539
25791
  });
25540
25792
  if (dataType === "compressed") {
@@ -25582,7 +25834,7 @@ class Texture extends Resource$1 {
25582
25834
  width,
25583
25835
  height
25584
25836
  }));
25585
- assert$7(this.depth === 0, "texSubImage not supported for 3D textures");
25837
+ assert$8(this.depth === 0, "texSubImage not supported for 3D textures");
25586
25838
  if (!data) {
25587
25839
  data = pixels;
25588
25840
  }
@@ -25756,9 +26008,9 @@ class Texture extends Resource$1 {
25756
26008
  height
25757
26009
  };
25758
26010
  }
25759
- assert$7(size2, "Could not deduced texture size");
25760
- assert$7(width === void 0 || size2.width === width, "Deduced texture width does not match supplied width");
25761
- assert$7(height === void 0 || size2.height === height, "Deduced texture height does not match supplied height");
26011
+ assert$8(size2, "Could not deduced texture size");
26012
+ assert$8(width === void 0 || size2.width === width, "Deduced texture width does not match supplied width");
26013
+ assert$8(height === void 0 || size2.height === height, "Deduced texture height does not match supplied height");
25762
26014
  return size2;
25763
26015
  }
25764
26016
  _createHandle() {
@@ -25791,7 +26043,7 @@ class Texture extends Resource$1 {
25791
26043
  break;
25792
26044
  case 4096:
25793
26045
  case 4097:
25794
- assert$7(false);
26046
+ assert$8(false);
25795
26047
  break;
25796
26048
  default:
25797
26049
  this.gl.texParameteri(this.target, pname, param);
@@ -25841,7 +26093,7 @@ class Texture extends Resource$1 {
25841
26093
  }
25842
26094
  let pathPrefix = "";
25843
26095
  function loadImage$1(url, opts) {
25844
- assert$7(typeof url === "string");
26096
+ assert$8(typeof url === "string");
25845
26097
  url = pathPrefix + url;
25846
26098
  return new Promise((resolve, reject) => {
25847
26099
  try {
@@ -26251,7 +26503,7 @@ class Renderbuffer extends Resource$1 {
26251
26503
  height = 1,
26252
26504
  samples = 0
26253
26505
  } = _ref2;
26254
- assert$7(format2, "Needs format");
26506
+ assert$8(format2, "Needs format");
26255
26507
  this._trackDeallocatedMemory();
26256
26508
  this.gl.bindRenderbuffer(36161, this.handle);
26257
26509
  if (samples !== 0 && isWebGL2$1(this.gl)) {
@@ -26341,7 +26593,7 @@ function clear(gl) {
26341
26593
  parameters.clearStencil = depth;
26342
26594
  }
26343
26595
  }
26344
- assert$7(clearFlags !== 0, ERR_ARGUMENTS);
26596
+ assert$8(clearFlags !== 0, ERR_ARGUMENTS);
26345
26597
  withParameters(gl, parameters, () => {
26346
26598
  gl.clear(clearFlags);
26347
26599
  });
@@ -26382,7 +26634,7 @@ function clearBuffer(gl) {
26382
26634
  gl.clearBufferfi(GL_DEPTH_STENCIL, 0, depth, stencil);
26383
26635
  break;
26384
26636
  default:
26385
- assert$7(false, ERR_ARGUMENTS);
26637
+ assert$8(false, ERR_ARGUMENTS);
26386
26638
  }
26387
26639
  });
26388
26640
  }
@@ -26402,7 +26654,7 @@ function glFormatToComponents(format2) {
26402
26654
  case 34836:
26403
26655
  return 4;
26404
26656
  default:
26405
- assert$7(false);
26657
+ assert$8(false);
26406
26658
  return 0;
26407
26659
  }
26408
26660
  }
@@ -26417,7 +26669,7 @@ function glTypeToBytes(type2) {
26417
26669
  case 5126:
26418
26670
  return 4;
26419
26671
  default:
26420
- assert$7(false);
26672
+ assert$8(false);
26421
26673
  return 0;
26422
26674
  }
26423
26675
  }
@@ -26439,7 +26691,7 @@ function readPixelsToArray(source) {
26439
26691
  framebuffer,
26440
26692
  deleteFramebuffer
26441
26693
  } = getFramebuffer$1(source);
26442
- assert$7(framebuffer);
26694
+ assert$8(framebuffer);
26443
26695
  const {
26444
26696
  gl,
26445
26697
  handle,
@@ -26450,7 +26702,7 @@ function readPixelsToArray(source) {
26450
26702
  if (sourceAttachment === 36064 && handle === null) {
26451
26703
  sourceAttachment = 1028;
26452
26704
  }
26453
- assert$7(attachments[sourceAttachment]);
26705
+ assert$8(attachments[sourceAttachment]);
26454
26706
  sourceType = sourceType || attachments[sourceAttachment].type;
26455
26707
  target = getPixelArray(target, sourceType, sourceFormat, sourceWidth, sourceHeight);
26456
26708
  sourceType = sourceType || getGLTypeFromTypedArray(target);
@@ -26477,7 +26729,7 @@ function readPixelsToBuffer(source, _ref) {
26477
26729
  framebuffer,
26478
26730
  deleteFramebuffer
26479
26731
  } = getFramebuffer$1(source);
26480
- assert$7(framebuffer);
26732
+ assert$8(framebuffer);
26481
26733
  sourceWidth = sourceWidth || framebuffer.width;
26482
26734
  sourceHeight = sourceHeight || framebuffer.height;
26483
26735
  const gl2 = assertWebGL2Context(framebuffer.gl);
@@ -26566,7 +26818,7 @@ function copyToTexture(source, target) {
26566
26818
  framebuffer,
26567
26819
  deleteFramebuffer
26568
26820
  } = getFramebuffer$1(source);
26569
- assert$7(framebuffer);
26821
+ assert$8(framebuffer);
26570
26822
  const {
26571
26823
  gl,
26572
26824
  handle
@@ -26576,7 +26828,7 @@ function copyToTexture(source, target) {
26576
26828
  targetY = targetY || 0;
26577
26829
  targetZ = targetZ || 0;
26578
26830
  const prevHandle = gl.bindFramebuffer(36160, handle);
26579
- assert$7(target);
26831
+ assert$8(target);
26580
26832
  let texture = null;
26581
26833
  if (target instanceof Texture) {
26582
26834
  texture = target;
@@ -26731,7 +26983,7 @@ function isFeatureSupported(gl, cap) {
26731
26983
  }
26732
26984
  function queryFeature(gl, cap) {
26733
26985
  const feature2 = WEBGL_FEATURES$1[cap];
26734
- assert$7(feature2, cap);
26986
+ assert$8(feature2, cap);
26735
26987
  let isSupported;
26736
26988
  const featureDefinition = isWebGL2$1(gl) ? feature2[1] || feature2[0] : feature2[0];
26737
26989
  if (typeof featureDefinition === "function") {
@@ -26746,7 +26998,7 @@ function queryFeature(gl, cap) {
26746
26998
  } else if (typeof featureDefinition === "boolean") {
26747
26999
  isSupported = featureDefinition;
26748
27000
  } else {
26749
- assert$7(false);
27001
+ assert$8(false);
26750
27002
  }
26751
27003
  return isSupported;
26752
27004
  }
@@ -26823,7 +27075,7 @@ class Framebuffer extends Resource$1 {
26823
27075
  readBuffer = void 0,
26824
27076
  drawBuffers = void 0
26825
27077
  } = _ref;
26826
- assert$7(width >= 0 && height >= 0, "Width and height need to be integers");
27078
+ assert$8(width >= 0 && height >= 0, "Width and height need to be integers");
26827
27079
  this.width = width;
26828
27080
  this.height = height;
26829
27081
  if (attachments) {
@@ -26887,7 +27139,7 @@ class Framebuffer extends Resource$1 {
26887
27139
  height
26888
27140
  } = options;
26889
27141
  if (this.handle === null) {
26890
- assert$7(width === void 0 && height === void 0);
27142
+ assert$8(width === void 0 && height === void 0);
26891
27143
  this.width = this.gl.drawingBufferWidth;
26892
27144
  this.height = this.gl.drawingBufferHeight;
26893
27145
  return this;
@@ -26925,7 +27177,7 @@ class Framebuffer extends Resource$1 {
26925
27177
  Object.assign(newAttachments, attachments);
26926
27178
  const prevHandle = this.gl.bindFramebuffer(36160, this.handle);
26927
27179
  for (const key in newAttachments) {
26928
- assert$7(key !== void 0, "Misspelled framebuffer binding point?");
27180
+ assert$8(key !== void 0, "Misspelled framebuffer binding point?");
26929
27181
  const attachment = Number(key);
26930
27182
  const descriptor = newAttachments[attachment];
26931
27183
  let object2 = descriptor;
@@ -27161,7 +27413,7 @@ class Framebuffer extends Resource$1 {
27161
27413
  });
27162
27414
  this.ownResources.push(defaultAttachments[36096]);
27163
27415
  } else if (stencil) {
27164
- assert$7(false);
27416
+ assert$8(false);
27165
27417
  }
27166
27418
  return defaultAttachments;
27167
27419
  }
@@ -27213,7 +27465,7 @@ class Framebuffer extends Resource$1 {
27213
27465
  gl.framebufferTexture2D(36160, attachment, 3553, texture.handle, level);
27214
27466
  break;
27215
27467
  default:
27216
- assert$7(false, "Illegal texture type");
27468
+ assert$8(false, "Illegal texture type");
27217
27469
  }
27218
27470
  gl.bindTexture(texture.target, null);
27219
27471
  this.attachments[attachment] = texture;
@@ -27223,7 +27475,7 @@ class Framebuffer extends Resource$1 {
27223
27475
  if (gl2) {
27224
27476
  gl2.readBuffer(readBuffer);
27225
27477
  } else {
27226
- assert$7(readBuffer === 36064 || readBuffer === 1029, ERR_MULTIPLE_RENDERTARGETS);
27478
+ assert$8(readBuffer === 36064 || readBuffer === 1029, ERR_MULTIPLE_RENDERTARGETS);
27227
27479
  }
27228
27480
  this.readBuffer = readBuffer;
27229
27481
  }
@@ -27239,7 +27491,7 @@ class Framebuffer extends Resource$1 {
27239
27491
  if (ext) {
27240
27492
  ext.drawBuffersWEBGL(drawBuffers);
27241
27493
  } else {
27242
- assert$7(drawBuffers.length === 1 && (drawBuffers[0] === 36064 || drawBuffers[0] === 1029), ERR_MULTIPLE_RENDERTARGETS);
27494
+ assert$8(drawBuffers.length === 1 && (drawBuffers[0] === 36064 || drawBuffers[0] === 1029), ERR_MULTIPLE_RENDERTARGETS);
27243
27495
  }
27244
27496
  }
27245
27497
  this.drawBuffers = drawBuffers;
@@ -27284,7 +27536,7 @@ function _getFrameBufferStatus(status) {
27284
27536
  const FRAMEBUFFER_ATTACHMENT_PARAMETERS = [36049, 36048, 33296, 33298, 33299, 33300, 33301, 33302, 33303];
27285
27537
  Framebuffer.ATTACHMENT_PARAMETERS = FRAMEBUFFER_ATTACHMENT_PARAMETERS;
27286
27538
  function cloneTextureFrom(refTexture, overrides) {
27287
- assert$7(refTexture instanceof Texture2D || refTexture instanceof TextureCube || refTexture instanceof Texture3D);
27539
+ assert$8(refTexture instanceof Texture2D || refTexture instanceof TextureCube || refTexture instanceof Texture3D);
27288
27540
  const TextureType = refTexture.constructor;
27289
27541
  const {
27290
27542
  gl,
@@ -27433,13 +27685,13 @@ class Shader extends Resource$1 {
27433
27685
  case 35632:
27434
27686
  return "fragment-shader";
27435
27687
  default:
27436
- assert$7(false);
27688
+ assert$8(false);
27437
27689
  return "unknown";
27438
27690
  }
27439
27691
  }
27440
27692
  constructor(gl, props) {
27441
27693
  assertWebGLContext(gl);
27442
- assert$7(typeof props.source === "string", ERR_SOURCE);
27694
+ assert$8(typeof props.source === "string", ERR_SOURCE);
27443
27695
  const id = getShaderName$1(props.source, null) || props.id || uid("unnamed ".concat(Shader.getTypeName(props.shaderType)));
27444
27696
  super(gl, {
27445
27697
  id
@@ -27727,7 +27979,7 @@ function getArraySetter(functionName, toArray, size2, uniformSetter) {
27727
27979
  cacheLength = length2;
27728
27980
  update = true;
27729
27981
  } else {
27730
- assert$7(cacheLength === length2, "Uniform length cannot change.");
27982
+ assert$8(cacheLength === length2, "Uniform length cannot change.");
27731
27983
  for (let i2 = 0; i2 < length2; ++i2) {
27732
27984
  if (arrayValue[i2] !== cache2[i2]) {
27733
27985
  update = true;
@@ -27828,7 +28080,7 @@ function getPrimitiveDrawMode(drawMode) {
27828
28080
  case GL_TRIANGLE_FAN:
27829
28081
  return GL_TRIANGLES;
27830
28082
  default:
27831
- assert$7(false);
28083
+ assert$8(false);
27832
28084
  return 0;
27833
28085
  }
27834
28086
  }
@@ -28017,8 +28269,8 @@ class Program extends Resource$1 {
28017
28269
  id: "".concat(props.id, "-fs"),
28018
28270
  source: fs2
28019
28271
  }) : fs2;
28020
- assert$7(this.vs instanceof VertexShader);
28021
- assert$7(this.fs instanceof FragmentShader);
28272
+ assert$8(this.vs instanceof VertexShader);
28273
+ assert$8(this.fs instanceof FragmentShader);
28022
28274
  this.uniforms = {};
28023
28275
  this._textureUniforms = {};
28024
28276
  if (varyings && varyings.length > 0) {
@@ -28072,7 +28324,7 @@ class Program extends Resource$1 {
28072
28324
  const message = "mode=".concat(getKey(this.gl, drawMode), " verts=").concat(vertexCount, " ") + "instances=".concat(instanceCount, " indexType=").concat(getKey(this.gl, indexType), " ") + "isInstanced=".concat(isInstanced, " isIndexed=").concat(isIndexed, " ") + "Framebuffer=".concat(fb);
28073
28325
  log$2.log(logPriority, message)();
28074
28326
  }
28075
- assert$7(vertexArray);
28327
+ assert$8(vertexArray);
28076
28328
  this.gl.useProgram(this.handle);
28077
28329
  if (!this._areTexturesRenderable() || vertexCount === 0 || isInstanced && instanceCount === 0) {
28078
28330
  return false;
@@ -28285,7 +28537,7 @@ class Query extends Resource$1 {
28285
28537
  supported = supported && hasTimerQuery;
28286
28538
  break;
28287
28539
  default:
28288
- assert$7(false);
28540
+ assert$8(false);
28289
28541
  }
28290
28542
  }
28291
28543
  return supported;
@@ -28602,7 +28854,7 @@ class VertexArrayObject extends Resource$1 {
28602
28854
  VertexArrayObject._setConstantUintArray(gl, location, array);
28603
28855
  break;
28604
28856
  default:
28605
- assert$7(false);
28857
+ assert$8(false);
28606
28858
  }
28607
28859
  }
28608
28860
  constructor(gl) {
@@ -28637,7 +28889,7 @@ class VertexArrayObject extends Resource$1 {
28637
28889
  }
28638
28890
  setElementBuffer() {
28639
28891
  let elementBuffer = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
28640
- assert$7(!elementBuffer || elementBuffer.target === 34963, ERR_ELEMENTS);
28892
+ assert$8(!elementBuffer || elementBuffer.target === 34963, ERR_ELEMENTS);
28641
28893
  this.bind(() => {
28642
28894
  this.gl.bindBuffer(34963, elementBuffer ? elementBuffer.handle : null);
28643
28895
  });
@@ -28664,7 +28916,7 @@ class VertexArrayObject extends Resource$1 {
28664
28916
  this.bind(() => {
28665
28917
  gl.bindBuffer(34962, buffer2.handle);
28666
28918
  if (integer) {
28667
- assert$7(isWebGL2$1(gl));
28919
+ assert$8(isWebGL2$1(gl));
28668
28920
  gl2.vertexAttribIPointer(location, size2, type2, stride, offset);
28669
28921
  } else {
28670
28922
  gl.vertexAttribPointer(location, size2, type2, normalized, stride, offset);
@@ -28738,11 +28990,11 @@ class VertexArrayObject extends Resource$1 {
28738
28990
  gl.vertexAttrib4fv(location, array);
28739
28991
  break;
28740
28992
  default:
28741
- assert$7(false);
28993
+ assert$8(false);
28742
28994
  }
28743
28995
  }
28744
28996
  static _setConstantIntArray(gl, location, array) {
28745
- assert$7(isWebGL2$1(gl));
28997
+ assert$8(isWebGL2$1(gl));
28746
28998
  switch (array.length) {
28747
28999
  case 1:
28748
29000
  gl.vertexAttribI1iv(location, array);
@@ -28757,11 +29009,11 @@ class VertexArrayObject extends Resource$1 {
28757
29009
  gl.vertexAttribI4iv(location, array);
28758
29010
  break;
28759
29011
  default:
28760
- assert$7(false);
29012
+ assert$8(false);
28761
29013
  }
28762
29014
  }
28763
29015
  static _setConstantUintArray(gl, location, array) {
28764
- assert$7(isWebGL2$1(gl));
29016
+ assert$8(isWebGL2$1(gl));
28765
29017
  switch (array.length) {
28766
29018
  case 1:
28767
29019
  gl.vertexAttribI1uiv(location, array);
@@ -28776,7 +29028,7 @@ class VertexArrayObject extends Resource$1 {
28776
29028
  gl.vertexAttribI4uiv(location, array);
28777
29029
  break;
28778
29030
  default:
28779
- assert$7(false);
29031
+ assert$8(false);
28780
29032
  }
28781
29033
  }
28782
29034
  _createHandle() {
@@ -28794,7 +29046,7 @@ class VertexArrayObject extends Resource$1 {
28794
29046
  let {
28795
29047
  location
28796
29048
  } = _ref;
28797
- assert$7(Number.isFinite(location));
29049
+ assert$8(Number.isFinite(location));
28798
29050
  return this.bind(() => {
28799
29051
  switch (pname) {
28800
29052
  case 34373:
@@ -28998,7 +29250,7 @@ class VertexArray {
28998
29250
  size: size2,
28999
29251
  type: type2
29000
29252
  } = accessor;
29001
- assert$7(Number.isFinite(size2) && Number.isFinite(type2));
29253
+ assert$8(Number.isFinite(size2) && Number.isFinite(type2));
29002
29254
  return {
29003
29255
  location,
29004
29256
  accessor
@@ -29174,7 +29426,7 @@ function getDebugTableForUniforms(_ref) {
29174
29426
  uniforms,
29175
29427
  undefinedOnly = false
29176
29428
  } = _ref;
29177
- assert$7(program);
29429
+ assert$8(program);
29178
29430
  const SHADER_MODULE_UNIFORM_REGEXP = ".*_.*";
29179
29431
  const PROJECT_MODULE_UNIFORM_REGEXP = ".*Matrix";
29180
29432
  const uniformLocations = program._uniformSetters;
@@ -29461,7 +29713,7 @@ class AnimationLoop {
29461
29713
  this._setDisplay(null);
29462
29714
  }
29463
29715
  setNeedsRedraw(reason) {
29464
- assert$7(typeof reason === "string");
29716
+ assert$8(typeof reason === "string");
29465
29717
  this.needsRedraw = this.needsRedraw || reason;
29466
29718
  return this;
29467
29719
  }
@@ -29810,7 +30062,7 @@ class AnimationLoop {
29810
30062
  }
29811
30063
  const VERTEX_SHADER$1 = "vs";
29812
30064
  const FRAGMENT_SHADER$1 = "fs";
29813
- function assert$6(condition, message) {
30065
+ function assert$7(condition, message) {
29814
30066
  if (!condition) {
29815
30067
  throw new Error(message || "shadertools: assertion failed.");
29816
30068
  }
@@ -29887,7 +30139,7 @@ class ShaderModule {
29887
30139
  vertexShader: vertexShader2,
29888
30140
  fragmentShader: fragmentShader2
29889
30141
  } = _ref;
29890
- assert$6(typeof name2 === "string");
30142
+ assert$7(typeof name2 === "string");
29891
30143
  this.name = name2;
29892
30144
  this.vs = vs2 || vertexShader2;
29893
30145
  this.fs = fs2 || fragmentShader2;
@@ -29910,7 +30162,7 @@ class ShaderModule {
29910
30162
  moduleSource = this.fs || "";
29911
30163
  break;
29912
30164
  default:
29913
- assert$6(false);
30165
+ assert$7(false);
29914
30166
  }
29915
30167
  return "#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi, "_"), "\n").concat(moduleSource, "// END MODULE_").concat(this.name, "\n\n");
29916
30168
  }
@@ -29957,7 +30209,7 @@ class ShaderModule {
29957
30209
  const propDef = propTypes[key];
29958
30210
  if (key in opts && !propDef.private) {
29959
30211
  if (propDef.validate) {
29960
- assert$6(propDef.validate(opts[key], propDef), "".concat(this.name, ": invalid ").concat(key));
30212
+ assert$7(propDef.validate(opts[key], propDef), "".concat(this.name, ": invalid ").concat(key));
29961
30213
  }
29962
30214
  uniforms[key] = opts[key];
29963
30215
  } else {
@@ -30041,8 +30293,8 @@ function instantiateModules(modules, seen) {
30041
30293
  if (module2 instanceof ShaderModule) {
30042
30294
  return module2;
30043
30295
  }
30044
- assert$6(typeof module2 !== "string", "Shader module use by name is deprecated. Import shader module '".concat(module2, "' and use it directly."));
30045
- assert$6(module2.name, "shader module has no name");
30296
+ assert$7(typeof module2 !== "string", "Shader module use by name is deprecated. Import shader module '".concat(module2, "' and use it directly."));
30297
+ assert$7(module2.name, "shader module has no name");
30046
30298
  module2 = new ShaderModule(module2);
30047
30299
  module2.dependencies = instantiateModules(module2.dependencies);
30048
30300
  return module2;
@@ -30106,7 +30358,7 @@ const compiledGlslExtensions = {};
30106
30358
  function canCompileGLGSExtension(gl, cap) {
30107
30359
  let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
30108
30360
  const feature2 = WEBGL_FEATURES[cap];
30109
- assert$6(feature2, cap);
30361
+ assert$7(feature2, cap);
30110
30362
  if (!isOldIE(opts)) {
30111
30363
  return true;
30112
30364
  }
@@ -30126,10 +30378,10 @@ function canCompileGLGSExtension(gl, cap) {
30126
30378
  }
30127
30379
  function getFeature(gl, cap) {
30128
30380
  const feature2 = WEBGL_FEATURES[cap];
30129
- assert$6(feature2, cap);
30381
+ assert$7(feature2, cap);
30130
30382
  const extensionName = isWebGL2(gl) ? feature2[1] || feature2[0] : feature2[0];
30131
30383
  const value = typeof extensionName === "string" ? Boolean(gl.getExtension(extensionName)) : extensionName;
30132
- assert$6(value === false || value === true);
30384
+ assert$7(value === false || value === true);
30133
30385
  return value;
30134
30386
  }
30135
30387
  function hasFeatures(gl, features) {
@@ -30231,7 +30483,7 @@ function injectShader(source, type2, inject2) {
30231
30483
  }
30232
30484
  function combineInjects(injects) {
30233
30485
  const result = {};
30234
- assert$6(Array.isArray(injects) && injects.length > 1);
30486
+ assert$7(Array.isArray(injects) && injects.length > 1);
30235
30487
  injects.forEach((inject2) => {
30236
30488
  for (const key in inject2) {
30237
30489
  result[key] = result[key] ? "".concat(result[key], "\n").concat(inject2[key]) : inject2[key];
@@ -30328,7 +30580,7 @@ function assembleShader(gl, _ref) {
30328
30580
  prologue = true,
30329
30581
  log: log3
30330
30582
  } = _ref;
30331
- assert$6(typeof source === "string", "shader source must be a string");
30583
+ assert$7(typeof source === "string", "shader source must be a string");
30332
30584
  const isVertex = type2 === VERTEX_SHADER$1;
30333
30585
  const sourceLines = source.split("\n");
30334
30586
  let glslVersion = 100;
@@ -30545,7 +30797,7 @@ function typeToChannelSuffix(type2) {
30545
30797
  case "vec4":
30546
30798
  return "xyzw";
30547
30799
  default:
30548
- assert$6(false);
30800
+ assert$7(false);
30549
30801
  return null;
30550
30802
  }
30551
30803
  }
@@ -30560,7 +30812,7 @@ function typeToChannelCount(type2) {
30560
30812
  case "vec4":
30561
30813
  return 4;
30562
30814
  default:
30563
- assert$6(false);
30815
+ assert$7(false);
30564
30816
  return null;
30565
30817
  }
30566
30818
  }
@@ -30575,7 +30827,7 @@ function convertToVec4(variable, type2) {
30575
30827
  case "vec4":
30576
30828
  return variable;
30577
30829
  default:
30578
- assert$6(false);
30830
+ assert$7(false);
30579
30831
  return null;
30580
30832
  }
30581
30833
  }
@@ -31050,7 +31302,7 @@ function getBuffersFromGeometry(gl, geometry2, options) {
31050
31302
  }
31051
31303
  if (indices) {
31052
31304
  const data = indices.value || indices;
31053
- assert$7(data instanceof Uint16Array || data instanceof Uint32Array, 'attribute array for "indices" must be of integer type');
31305
+ assert$8(data instanceof Uint16Array || data instanceof Uint32Array, 'attribute array for "indices" must be of integer type');
31054
31306
  const accessor = {
31055
31307
  size: 1,
31056
31308
  isIndexed: indices.isIndexed === void 0 ? true : indices.isIndexed
@@ -31092,7 +31344,7 @@ function inferAttributeAccessor(attributeName, attribute) {
31092
31344
  attribute.size = attribute.size || 2;
31093
31345
  break;
31094
31346
  }
31095
- assert$7(Number.isFinite(attribute.size), "attribute ".concat(attributeName, " needs size"));
31347
+ assert$8(Number.isFinite(attribute.size), "attribute ".concat(attributeName, " needs size"));
31096
31348
  }
31097
31349
  const LOG_DRAW_PRIORITY = 2;
31098
31350
  const LOG_DRAW_TIMEOUT = 1e4;
@@ -31106,7 +31358,7 @@ class Model {
31106
31358
  const {
31107
31359
  id = uid("model")
31108
31360
  } = props;
31109
- assert$7(isWebGL(gl));
31361
+ assert$8(isWebGL(gl));
31110
31362
  this.id = id;
31111
31363
  this.gl = gl;
31112
31364
  this.id = props.id || uid("Model");
@@ -31158,7 +31410,7 @@ class Model {
31158
31410
  this.isInstanced = props.isInstanced || props.instanced || props.instanceCount > 0;
31159
31411
  this._setModelProps(props);
31160
31412
  this.geometry = {};
31161
- assert$7(this.drawMode !== void 0 && Number.isFinite(this.vertexCount), ERR_MODEL_PARAMS);
31413
+ assert$8(this.drawMode !== void 0 && Number.isFinite(this.vertexCount), ERR_MODEL_PARAMS);
31162
31414
  }
31163
31415
  setProps(props) {
31164
31416
  this._setModelProps(props);
@@ -31224,12 +31476,12 @@ class Model {
31224
31476
  return this;
31225
31477
  }
31226
31478
  setVertexCount(vertexCount) {
31227
- assert$7(Number.isFinite(vertexCount));
31479
+ assert$8(Number.isFinite(vertexCount));
31228
31480
  this.vertexCount = vertexCount;
31229
31481
  return this;
31230
31482
  }
31231
31483
  setInstanceCount(instanceCount) {
31232
- assert$7(Number.isFinite(instanceCount));
31484
+ assert$8(Number.isFinite(instanceCount));
31233
31485
  this.instanceCount = instanceCount;
31234
31486
  return this;
31235
31487
  }
@@ -31426,7 +31678,7 @@ class Model {
31426
31678
  this._programManagerState = this.programManager.stateHash;
31427
31679
  this._managedProgram = true;
31428
31680
  }
31429
- assert$7(program instanceof Program, "Model needs a program");
31681
+ assert$8(program instanceof Program, "Model needs a program");
31430
31682
  this._programDirty = false;
31431
31683
  if (program === this.program) {
31432
31684
  return;
@@ -31454,7 +31706,7 @@ class Model {
31454
31706
  }
31455
31707
  _setAnimationProps(animationProps) {
31456
31708
  if (this.animated) {
31457
- assert$7(animationProps, "Model.draw(): animated uniforms but no animationProps");
31709
+ assert$8(animationProps, "Model.draw(): animated uniforms but no animationProps");
31458
31710
  }
31459
31711
  }
31460
31712
  _setFeedbackBuffers() {
@@ -31612,7 +31864,7 @@ class BufferTransform {
31612
31864
  this._setupBuffers(props);
31613
31865
  this.varyings = props.varyings || Object.keys(this.bindings[this.currentIndex].feedbackBuffers);
31614
31866
  if (this.varyings.length > 0) {
31615
- assert$7(isWebGL2$1(this.gl));
31867
+ assert$8(isWebGL2$1(this.gl));
31616
31868
  }
31617
31869
  }
31618
31870
  _getFeedbackBuffers(props) {
@@ -31712,7 +31964,7 @@ class BufferTransform {
31712
31964
  const dstName = this.feedbackMap[srcName];
31713
31965
  sourceBuffers[srcName] = opts.feedbackBuffers[dstName];
31714
31966
  feedbackBuffers[dstName] = opts.sourceBuffers[srcName];
31715
- assert$7(feedbackBuffers[dstName] instanceof Buffer$1);
31967
+ assert$8(feedbackBuffers[dstName] instanceof Buffer$1);
31716
31968
  }
31717
31969
  return {
31718
31970
  sourceBuffers,
@@ -31769,7 +32021,7 @@ function updateForTextures(_ref) {
31769
32021
  }
31770
32022
  });
31771
32023
  if (targetTextureVarying) {
31772
- assert$7(targetTexture);
32024
+ assert$8(targetTexture);
31773
32025
  const sizeName = "".concat(SIZE_UNIFORM_PREFIX).concat(targetTextureVarying);
31774
32026
  const uniformDeclaration = "uniform vec2 ".concat(sizeName, ";\n");
31775
32027
  const posInstructions = " vec2 ".concat(VS_POS_VARIABLE, " = transform_getPos(").concat(sizeName, ");\n gl_Position = vec4(").concat(VS_POS_VARIABLE, ", 0, 1.);\n");
@@ -32240,7 +32492,7 @@ class Transform {
32240
32492
  for (const resourceTransform of resourceTransforms) {
32241
32493
  swapped = swapped || resourceTransform.swap();
32242
32494
  }
32243
- assert$7(swapped, "Nothing to swap");
32495
+ assert$8(swapped, "Nothing to swap");
32244
32496
  }
32245
32497
  getBuffer() {
32246
32498
  let varyingName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
@@ -32304,7 +32556,7 @@ class Transform {
32304
32556
  if (canCreateTextureTransform(props)) {
32305
32557
  this.textureTransform = new TextureTransform(gl, props);
32306
32558
  }
32307
- assert$7(this.bufferTransform || this.textureTransform, "must provide source/feedback buffers or source/target textures");
32559
+ assert$8(this.bufferTransform || this.textureTransform, "must provide source/feedback buffers or source/target textures");
32308
32560
  }
32309
32561
  _updateDrawOptions(opts) {
32310
32562
  let updatedOpts = Object.assign({}, opts);
@@ -32383,12 +32635,12 @@ class Geometry {
32383
32635
  attribute = ArrayBuffer.isView(attribute) ? {
32384
32636
  value: attribute
32385
32637
  } : attribute;
32386
- assert$7(ArrayBuffer.isView(attribute.value), "".concat(this._print(attributeName), ": must be typed array or object with value as typed array"));
32638
+ assert$8(ArrayBuffer.isView(attribute.value), "".concat(this._print(attributeName), ": must be typed array or object with value as typed array"));
32387
32639
  if ((attributeName === "POSITION" || attributeName === "positions") && !attribute.size) {
32388
32640
  attribute.size = 3;
32389
32641
  }
32390
32642
  if (attributeName === "indices") {
32391
- assert$7(!this.indices);
32643
+ assert$8(!this.indices);
32392
32644
  this.indices = attribute;
32393
32645
  } else {
32394
32646
  this.attributes[attributeName] = attribute;
@@ -32416,7 +32668,7 @@ class Geometry {
32416
32668
  vertexCount = Math.min(vertexCount, value.length / size2);
32417
32669
  }
32418
32670
  }
32419
- assert$7(Number.isFinite(vertexCount));
32671
+ assert$8(Number.isFinite(vertexCount));
32420
32672
  return vertexCount;
32421
32673
  }
32422
32674
  }
@@ -33199,7 +33451,7 @@ const esm$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
33199
33451
  TransformFeedback,
33200
33452
  TruncatedConeGeometry,
33201
33453
  VertexShader,
33202
- assert: assert$7,
33454
+ assert: assert$8,
33203
33455
  clear,
33204
33456
  cloneTextureFrom,
33205
33457
  copyToTexture,
@@ -33526,7 +33778,7 @@ function ieLog2(x2) {
33526
33778
  return Math.log(x2) * Math.LOG2E;
33527
33779
  }
33528
33780
  const log2 = Math.log2 || ieLog2;
33529
- function assert$5(condition, message) {
33781
+ function assert$6(condition, message) {
33530
33782
  if (!condition) {
33531
33783
  throw new Error(message || "@math.gl/web-mercator: assertion failed.");
33532
33784
  }
@@ -33547,8 +33799,8 @@ function scaleToZoom(scale2) {
33547
33799
  }
33548
33800
  function lngLatToWorld(lngLat) {
33549
33801
  const [lng, lat] = lngLat;
33550
- assert$5(Number.isFinite(lng));
33551
- assert$5(Number.isFinite(lat) && lat >= -90 && lat <= 90, "invalid latitude");
33802
+ assert$6(Number.isFinite(lng));
33803
+ assert$6(Number.isFinite(lat) && lat >= -90 && lat <= 90, "invalid latitude");
33552
33804
  const lambda22 = lng * DEGREES_TO_RADIANS$6;
33553
33805
  const phi2 = lat * DEGREES_TO_RADIANS$6;
33554
33806
  const x2 = TILE_SIZE$6 * (lambda22 + PI) / (2 * PI);
@@ -33565,7 +33817,7 @@ function getMeterZoom(options) {
33565
33817
  const {
33566
33818
  latitude
33567
33819
  } = options;
33568
- assert$5(Number.isFinite(latitude));
33820
+ assert$6(Number.isFinite(latitude));
33569
33821
  const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS$6);
33570
33822
  return scaleToZoom(EARTH_CIRCUMFERENCE$1 * latCosine) - 9;
33571
33823
  }
@@ -33579,7 +33831,7 @@ function getDistanceScales$1(options) {
33579
33831
  longitude,
33580
33832
  highPrecision = false
33581
33833
  } = options;
33582
- assert$5(Number.isFinite(latitude) && Number.isFinite(longitude));
33834
+ assert$6(Number.isFinite(latitude) && Number.isFinite(longitude));
33583
33835
  const worldSize = TILE_SIZE$6;
33584
33836
  const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS$6);
33585
33837
  const unitsPerDegreeX = worldSize / 360;
@@ -33695,12 +33947,12 @@ function fovyToAltitude(fovy) {
33695
33947
  }
33696
33948
  function worldToPixels(xyz, pixelProjectionMatrix) {
33697
33949
  const [x2, y2, z = 0] = xyz;
33698
- assert$5(Number.isFinite(x2) && Number.isFinite(y2) && Number.isFinite(z));
33950
+ assert$6(Number.isFinite(x2) && Number.isFinite(y2) && Number.isFinite(z));
33699
33951
  return transformVector$1(pixelProjectionMatrix, [x2, y2, z, 1]);
33700
33952
  }
33701
33953
  function pixelsToWorld(xyz, pixelUnprojectionMatrix, targetZ = 0) {
33702
33954
  const [x2, y2, z] = xyz;
33703
- assert$5(Number.isFinite(x2) && Number.isFinite(y2), "invalid pixel coordinate");
33955
+ assert$6(Number.isFinite(x2) && Number.isFinite(y2), "invalid pixel coordinate");
33704
33956
  if (Number.isFinite(z)) {
33705
33957
  const coord = transformVector$1(pixelUnprojectionMatrix, [x2, y2, z, 1]);
33706
33958
  return coord;
@@ -33727,7 +33979,7 @@ function fitBounds(options) {
33727
33979
  const se = lngLatToWorld([east, clamp(south, -MAX_LATITUDE, MAX_LATITUDE)]);
33728
33980
  const size2 = [Math.max(Math.abs(se[0] - nw[0]), minExtent), Math.max(Math.abs(se[1] - nw[1]), minExtent)];
33729
33981
  const targetSize = [width - padding.left - padding.right - Math.abs(offset[0]) * 2, height - padding.top - padding.bottom - Math.abs(offset[1]) * 2];
33730
- assert$5(targetSize[0] > 0 && targetSize[1] > 0);
33982
+ assert$6(targetSize[0] > 0 && targetSize[1] > 0);
33731
33983
  const scaleX2 = targetSize[0] / size2[0];
33732
33984
  const scaleY2 = targetSize[1] / size2[1];
33733
33985
  const offsetX = (padding.right - padding.left) / 2 / scaleX2;
@@ -33735,7 +33987,7 @@ function fitBounds(options) {
33735
33987
  const center2 = [(se[0] + nw[0]) / 2 + offsetX, (se[1] + nw[1]) / 2 + offsetY];
33736
33988
  const centerLngLat = worldToLngLat(center2);
33737
33989
  const zoom = Math.min(maxZoom, log2(Math.abs(Math.min(scaleX2, scaleY2))));
33738
- assert$5(Number.isFinite(zoom));
33990
+ assert$6(Number.isFinite(zoom));
33739
33991
  return {
33740
33992
  longitude: centerLngLat[0],
33741
33993
  latitude: centerLngLat[1],
@@ -33751,7 +34003,7 @@ function getPaddingObject(padding = 0) {
33751
34003
  right: padding
33752
34004
  };
33753
34005
  }
33754
- assert$5(Number.isFinite(padding.top) && Number.isFinite(padding.bottom) && Number.isFinite(padding.left) && Number.isFinite(padding.right));
34006
+ assert$6(Number.isFinite(padding.top) && Number.isFinite(padding.bottom) && Number.isFinite(padding.left) && Number.isFinite(padding.right));
33755
34007
  return padding;
33756
34008
  }
33757
34009
  const DEGREES_TO_RADIANS$5 = Math.PI / 180;
@@ -36584,7 +36836,7 @@ function parsePosition(value) {
36584
36836
  function getPosition$1(position, extent2) {
36585
36837
  return position.relative ? Math.round(position.position * extent2) : position.position;
36586
36838
  }
36587
- function assert$4(condition, message) {
36839
+ function assert$5(condition, message) {
36588
36840
  if (!condition) {
36589
36841
  throw new Error(message || "deck.gl: assertion failed.");
36590
36842
  }
@@ -36608,7 +36860,7 @@ class View {
36608
36860
  padding = null,
36609
36861
  viewportInstance
36610
36862
  } = props || {};
36611
- assert$4(!viewportInstance || viewportInstance instanceof Viewport);
36863
+ assert$5(!viewportInstance || viewportInstance instanceof Viewport);
36612
36864
  this.viewportInstance = viewportInstance;
36613
36865
  this.id = id || this.constructor.displayName || "view";
36614
36866
  this.props = {
@@ -36982,7 +37234,7 @@ class TransitionInterpolator {
36982
37234
  }
36983
37235
  this._requiredProps.forEach((propName) => {
36984
37236
  const value = props[propName];
36985
- assert$4(Number.isFinite(value) || Array.isArray(value), "".concat(propName, " is required for transition"));
37237
+ assert$5(Number.isFinite(value) || Array.isArray(value), "".concat(propName, " is required for transition"));
36986
37238
  });
36987
37239
  }
36988
37240
  }
@@ -37231,9 +37483,9 @@ class Controller {
37231
37483
  updateTransition() {
37232
37484
  this.transitionManager.updateTransition();
37233
37485
  }
37234
- toggleEvents(eventNames2, enabled) {
37486
+ toggleEvents(eventNames, enabled) {
37235
37487
  if (this.eventManager) {
37236
- eventNames2.forEach((eventName) => {
37488
+ eventNames.forEach((eventName) => {
37237
37489
  if (this._events[eventName] !== enabled) {
37238
37490
  this._events[eventName] = enabled;
37239
37491
  if (enabled) {
@@ -37727,9 +37979,9 @@ class MapState extends ViewState {
37727
37979
  startZoom,
37728
37980
  normalize: normalize2 = true
37729
37981
  } = options;
37730
- assert$4(Number.isFinite(longitude));
37731
- assert$4(Number.isFinite(latitude));
37732
- assert$4(Number.isFinite(zoom));
37982
+ assert$5(Number.isFinite(longitude));
37983
+ assert$5(Number.isFinite(latitude));
37984
+ assert$5(Number.isFinite(zoom));
37733
37985
  super({
37734
37986
  width,
37735
37987
  height,
@@ -40684,18 +40936,18 @@ var hammer$1 = { exports: {} };
40684
40936
  emit: function(input) {
40685
40937
  var self2 = this;
40686
40938
  var state = this.state;
40687
- function emit2(event) {
40939
+ function emit(event) {
40688
40940
  self2.manager.emit(event, input);
40689
40941
  }
40690
40942
  if (state < STATE_ENDED) {
40691
- emit2(self2.options.event + stateStr(state));
40943
+ emit(self2.options.event + stateStr(state));
40692
40944
  }
40693
- emit2(self2.options.event);
40945
+ emit(self2.options.event);
40694
40946
  if (input.additionalEvent) {
40695
- emit2(input.additionalEvent);
40947
+ emit(input.additionalEvent);
40696
40948
  }
40697
40949
  if (state >= STATE_ENDED) {
40698
- emit2(self2.options.event + stateStr(state));
40950
+ emit(self2.options.event + stateStr(state));
40699
40951
  }
40700
40952
  },
40701
40953
  /**
@@ -42055,7 +42307,7 @@ class EventRegistrar {
42055
42307
  isEmpty() {
42056
42308
  return !this._active;
42057
42309
  }
42058
- add(type2, handler, options, once3 = false, passive = false) {
42310
+ add(type2, handler, options, once = false, passive = false) {
42059
42311
  const { handlers, handlersByElement } = this;
42060
42312
  let opts = DEFAULT_OPTIONS$2;
42061
42313
  if (typeof options === "string" || options && options.addEventListener) {
@@ -42074,7 +42326,7 @@ class EventRegistrar {
42074
42326
  srcElement: opts.srcElement,
42075
42327
  priority: opts.priority
42076
42328
  };
42077
- if (once3) {
42329
+ if (once) {
42078
42330
  entry.once = true;
42079
42331
  }
42080
42332
  if (passive) {
@@ -42122,7 +42374,7 @@ class EventRegistrar {
42122
42374
  };
42123
42375
  const entriesToRemove = [];
42124
42376
  for (let i2 = 0; i2 < entries.length; i2++) {
42125
- const { type: type2, handler, once: once3 } = entries[i2];
42377
+ const { type: type2, handler, once } = entries[i2];
42126
42378
  handler({
42127
42379
  ...event,
42128
42380
  // @ts-ignore
@@ -42130,7 +42382,7 @@ class EventRegistrar {
42130
42382
  stopPropagation,
42131
42383
  stopImmediatePropagation
42132
42384
  });
42133
- if (once3) {
42385
+ if (once) {
42134
42386
  entriesToRemove.push(entries[i2]);
42135
42387
  }
42136
42388
  if (immediatePropagationStopped) {
@@ -42311,11 +42563,11 @@ class EventManager {
42311
42563
  /**
42312
42564
  * Process the event registration for a single event + handler.
42313
42565
  */
42314
- _addEventHandler(event, handler, opts, once3, passive) {
42566
+ _addEventHandler(event, handler, opts, once, passive) {
42315
42567
  if (typeof event !== "string") {
42316
42568
  opts = handler;
42317
42569
  for (const eventName in event) {
42318
- this._addEventHandler(eventName, event[eventName], opts, once3, passive);
42570
+ this._addEventHandler(eventName, event[eventName], opts, once, passive);
42319
42571
  }
42320
42572
  return;
42321
42573
  }
@@ -42330,7 +42582,7 @@ class EventManager {
42330
42582
  manager.on(eventAlias, eventRegistrar.handleEvent);
42331
42583
  }
42332
42584
  }
42333
- eventRegistrar.add(event, handler, opts, once3, passive);
42585
+ eventRegistrar.add(event, handler, opts, once, passive);
42334
42586
  if (!eventRegistrar.isEmpty()) {
42335
42587
  this._toggleRecognizer(eventRegistrar.recognizerName, true);
42336
42588
  }
@@ -42656,11 +42908,11 @@ class Deck {
42656
42908
  return this.viewManager !== null;
42657
42909
  }
42658
42910
  getViews() {
42659
- assert$4(this.viewManager);
42911
+ assert$5(this.viewManager);
42660
42912
  return this.viewManager.views;
42661
42913
  }
42662
42914
  getViewports(rect) {
42663
- assert$4(this.viewManager);
42915
+ assert$5(this.viewManager);
42664
42916
  return this.viewManager.getViewports(rect);
42665
42917
  }
42666
42918
  pickObject(opts) {
@@ -42689,7 +42941,7 @@ class Deck {
42689
42941
  }
42690
42942
  }
42691
42943
  _pick(method, statKey, opts) {
42692
- assert$4(this.deckPicker);
42944
+ assert$5(this.deckPicker);
42693
42945
  const {
42694
42946
  stats
42695
42947
  } = this;
@@ -42710,7 +42962,7 @@ class Deck {
42710
42962
  let canvas = props.canvas;
42711
42963
  if (typeof canvas === "string") {
42712
42964
  canvas = document.getElementById(canvas);
42713
- assert$4(canvas);
42965
+ assert$5(canvas);
42714
42966
  }
42715
42967
  if (!canvas) {
42716
42968
  canvas = document.createElement("canvas");
@@ -43949,7 +44201,7 @@ class Attribute extends DataColumn {
43949
44201
  };
43950
44202
  }
43951
44203
  const binaryValue = buffer2;
43952
- assert$4(ArrayBuffer.isView(binaryValue.value), "invalid ".concat(settings.accessor));
44204
+ assert$5(ArrayBuffer.isView(binaryValue.value), "invalid ".concat(settings.accessor));
43953
44205
  const needsNormalize = Boolean(binaryValue.size) && binaryValue.size !== this.size;
43954
44206
  state.binaryAccessor = getAccessorFromBuffer(binaryValue.value, {
43955
44207
  size: binaryValue.size || this.size,
@@ -44003,7 +44255,7 @@ class Attribute extends DataColumn {
44003
44255
  transform: transform2
44004
44256
  } = settings;
44005
44257
  const accessorFunc = state.binaryAccessor || (typeof accessor === "function" ? accessor : props[accessor]);
44006
- assert$4(typeof accessorFunc === "function", 'accessor "'.concat(accessor, '" is not a function'));
44258
+ assert$5(typeof accessorFunc === "function", 'accessor "'.concat(accessor, '" is not a function'));
44007
44259
  let i2 = attribute.getVertexOffset(startRow);
44008
44260
  const {
44009
44261
  iterable,
@@ -45051,7 +45303,7 @@ function getPropTypes(props) {
45051
45303
  const ERR_NOT_OBJECT = "count(): argument not an object";
45052
45304
  const ERR_NOT_CONTAINER = "count(): argument not a container";
45053
45305
  function count(container) {
45054
- if (!isObject$2(container)) {
45306
+ if (!isObject$3(container)) {
45055
45307
  throw new Error(ERR_NOT_OBJECT);
45056
45308
  }
45057
45309
  if (typeof container.count === "function") {
@@ -45071,7 +45323,7 @@ function count(container) {
45071
45323
  function isPlainObject(value) {
45072
45324
  return value !== null && typeof value === "object" && value.constructor === Object;
45073
45325
  }
45074
- function isObject$2(value) {
45326
+ function isObject$3(value) {
45075
45327
  return value !== null && typeof value === "object";
45076
45328
  }
45077
45329
  function mergeShaders(target, source) {
@@ -45955,7 +46207,7 @@ class Layer extends Component {
45955
46207
  return "".concat(className, "({id: '").concat(this.props.id, "'})");
45956
46208
  }
45957
46209
  project(xyz) {
45958
- assert$4(this.internalState);
46210
+ assert$5(this.internalState);
45959
46211
  const viewport = this.internalState.viewport || this.context.viewport;
45960
46212
  const worldPosition = getWorldPosition(xyz, {
45961
46213
  viewport,
@@ -45967,12 +46219,12 @@ class Layer extends Component {
45967
46219
  return xyz.length === 2 ? [x2, y2] : [x2, y2, z];
45968
46220
  }
45969
46221
  unproject(xy) {
45970
- assert$4(this.internalState);
46222
+ assert$5(this.internalState);
45971
46223
  const viewport = this.internalState.viewport || this.context.viewport;
45972
46224
  return viewport.unproject(xy);
45973
46225
  }
45974
46226
  projectPosition(xyz, params) {
45975
- assert$4(this.internalState);
46227
+ assert$5(this.internalState);
45976
46228
  const viewport = this.internalState.viewport || this.context.viewport;
45977
46229
  return projectPosition(xyz, {
45978
46230
  viewport,
@@ -46057,7 +46309,7 @@ class Layer extends Component {
46057
46309
  return target;
46058
46310
  }
46059
46311
  decodePickingColor(color) {
46060
- assert$4(color instanceof Uint8Array);
46312
+ assert$5(color instanceof Uint8Array);
46061
46313
  const [i1, i2, i3] = color;
46062
46314
  const index2 = i1 + i2 * 256 + i3 * 65536 - 1;
46063
46315
  return index2;
@@ -46353,8 +46605,8 @@ class Layer extends Component {
46353
46605
  });
46354
46606
  }
46355
46607
  _initialize() {
46356
- assert$4(!this.internalState);
46357
- assert$4(Number.isFinite(this.props.coordinateSystem));
46608
+ assert$5(!this.internalState);
46609
+ assert$5(Number.isFinite(this.props.coordinateSystem));
46358
46610
  debug(TRACE_INITIALIZE, this);
46359
46611
  const attributeManager = this._getAttributeManager();
46360
46612
  if (attributeManager) {
@@ -47489,7 +47741,7 @@ class Tesselator {
47489
47741
  this.buffers = buffers;
47490
47742
  this.normalize = normalize2;
47491
47743
  if (geometryBuffer) {
47492
- assert$4(data.startIndices);
47744
+ assert$5(data.startIndices);
47493
47745
  this.getGeometry = this.getGeometryFromBuffer(geometryBuffer);
47494
47746
  if (!normalize2) {
47495
47747
  buffers.positions = geometryBuffer;
@@ -47670,7 +47922,7 @@ const esm$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
47670
47922
  _flatten: flatten,
47671
47923
  _memoize: memoize$1,
47672
47924
  _mergeShaders: mergeShaders,
47673
- assert: assert$4,
47925
+ assert: assert$5,
47674
47926
  createIterable,
47675
47927
  fp64LowPart,
47676
47928
  gouraudLighting,
@@ -55593,7 +55845,7 @@ class Plane {
55593
55845
  this.fromNormalDistance(normal, distance2);
55594
55846
  }
55595
55847
  fromNormalDistance(normal, distance2) {
55596
- assert$c(Number.isFinite(distance2));
55848
+ assert$d(Number.isFinite(distance2));
55597
55849
  this.normal.from(normal).normalize();
55598
55850
  this.distance = distance2;
55599
55851
  return this;
@@ -55607,7 +55859,7 @@ class Plane {
55607
55859
  }
55608
55860
  fromCoefficients(a2, b, c, d) {
55609
55861
  this.normal.set(a2, b, c);
55610
- assert$c(equals$3(this.normal.len(), 1));
55862
+ assert$d(equals$3(this.normal.len(), 1));
55611
55863
  this.distance = d;
55612
55864
  return this;
55613
55865
  }
@@ -55681,7 +55933,7 @@ class CullingVolume {
55681
55933
  return intersect2;
55682
55934
  }
55683
55935
  computeVisibilityWithPlaneMask(boundingVolume, parentPlaneMask) {
55684
- assert$c(Number.isFinite(parentPlaneMask), "parentPlaneMask is required.");
55936
+ assert$d(Number.isFinite(parentPlaneMask), "parentPlaneMask is required.");
55685
55937
  if (parentPlaneMask === CullingVolume.MASK_OUTSIDE || parentPlaneMask === CullingVolume.MASK_INSIDE) {
55686
55938
  return parentPlaneMask;
55687
55939
  }
@@ -69173,17 +69425,17 @@ class ScenegraphNode {
69173
69425
  return null;
69174
69426
  }
69175
69427
  setPosition(position) {
69176
- assert$7(position.length === 3, "setPosition requires vector argument");
69428
+ assert$8(position.length === 3, "setPosition requires vector argument");
69177
69429
  this.position = position;
69178
69430
  return this;
69179
69431
  }
69180
69432
  setRotation(rotation2) {
69181
- assert$7(rotation2.length === 3, "setRotation requires vector argument");
69433
+ assert$8(rotation2.length === 3, "setRotation requires vector argument");
69182
69434
  this.rotation = rotation2;
69183
69435
  return this;
69184
69436
  }
69185
69437
  setScale(scale2) {
69186
- assert$7(scale2.length === 3, "setScale requires vector argument");
69438
+ assert$8(scale2.length === 3, "setScale requires vector argument");
69187
69439
  this.scale = scale2;
69188
69440
  return this;
69189
69441
  }
@@ -69246,7 +69498,7 @@ class ScenegraphNode {
69246
69498
  return this;
69247
69499
  }
69248
69500
  getCoordinateUniforms(viewMatrix2, modelMatrix2) {
69249
- assert$7(viewMatrix2);
69501
+ assert$8(viewMatrix2);
69250
69502
  modelMatrix2 = modelMatrix2 || this.matrix;
69251
69503
  const worldMatrix = new Matrix4(viewMatrix2).multiplyRight(modelMatrix2);
69252
69504
  const worldInverse = worldMatrix.invert();
@@ -69483,7 +69735,7 @@ function interpolate$1(time, _ref2, target, path) {
69483
69735
  log$2.warn("Bad animation path ".concat(path))();
69484
69736
  }
69485
69737
  }
69486
- assert$7(target[path].length === output[previousIndex].length);
69738
+ assert$8(target[path].length === output[previousIndex].length);
69487
69739
  const previousTime = input[previousIndex];
69488
69740
  const nextTime = input[nextIndex];
69489
69741
  switch (interpolation) {
@@ -70416,7 +70668,7 @@ const BasisLoader = {
70416
70668
  ...BasisWorkerLoader,
70417
70669
  parse: parseBasis
70418
70670
  };
70419
- function assert$3(condition, message) {
70671
+ function assert$4(condition, message) {
70420
70672
  if (!condition) {
70421
70673
  throw new Error(message || "assert failed: gltf");
70422
70674
  }
@@ -70434,10 +70686,10 @@ function resolveUrl(url, options) {
70434
70686
  }
70435
70687
  function getTypedArrayForBufferView(json, buffers, bufferViewIndex) {
70436
70688
  const bufferView = json.bufferViews[bufferViewIndex];
70437
- assert$3(bufferView);
70689
+ assert$4(bufferView);
70438
70690
  const bufferIndex = bufferView.buffer;
70439
70691
  const binChunk = buffers[bufferIndex];
70440
- assert$3(binChunk);
70692
+ assert$4(binChunk);
70441
70693
  const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
70442
70694
  return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
70443
70695
  }
@@ -70486,7 +70738,7 @@ function getAccessorArrayTypeAndLength(accessor, bufferView) {
70486
70738
  const bytesPerComponent = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE[accessor.componentType];
70487
70739
  const length2 = accessor.count * components;
70488
70740
  const byteLength = accessor.count * components * bytesPerComponent;
70489
- assert$3(byteLength >= 0 && byteLength <= bufferView.byteLength);
70741
+ assert$4(byteLength >= 0 && byteLength <= bufferView.byteLength);
70490
70742
  return {
70491
70743
  ArrayType,
70492
70744
  length: length2,
@@ -70595,7 +70847,7 @@ class GLTFScenegraph {
70595
70847
  bufferView = this.getBufferView(bufferView);
70596
70848
  const bufferIndex = bufferView.buffer;
70597
70849
  const binChunk = this.gltf.buffers[bufferIndex];
70598
- assert$3(binChunk);
70850
+ assert$4(binChunk);
70599
70851
  const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
70600
70852
  return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
70601
70853
  }
@@ -70645,14 +70897,14 @@ class GLTFScenegraph {
70645
70897
  return extension;
70646
70898
  }
70647
70899
  addExtension(extensionName, extensionData = {}) {
70648
- assert$3(extensionData);
70900
+ assert$4(extensionData);
70649
70901
  this.json.extensions = this.json.extensions || {};
70650
70902
  this.json.extensions[extensionName] = extensionData;
70651
70903
  this.registerUsedExtension(extensionName);
70652
70904
  return extensionData;
70653
70905
  }
70654
70906
  addRequiredExtension(extensionName, extensionData = {}) {
70655
- assert$3(extensionData);
70907
+ assert$4(extensionData);
70656
70908
  this.addExtension(extensionName, extensionData);
70657
70909
  this.registerRequiredExtension(extensionName);
70658
70910
  return extensionData;
@@ -70760,7 +71012,7 @@ class GLTFScenegraph {
70760
71012
  }
70761
71013
  addBufferView(buffer2) {
70762
71014
  const byteLength = buffer2.byteLength;
70763
- assert$3(Number.isFinite(byteLength));
71015
+ assert$4(Number.isFinite(byteLength));
70764
71016
  this.sourceBuffers = this.sourceBuffers || [];
70765
71017
  this.sourceBuffers.push(buffer2);
70766
71018
  const glTFBufferView = {
@@ -71115,7 +71367,7 @@ function getMeshBoundingBox(attributes) {
71115
71367
  }
71116
71368
  return [[minX, minY, minZ], [maxX, maxY, maxZ]];
71117
71369
  }
71118
- function assert$2(condition, message) {
71370
+ function assert$3(condition, message) {
71119
71371
  if (!condition) {
71120
71372
  throw new Error(message || "loader assertion failed.");
71121
71373
  }
@@ -71124,7 +71376,7 @@ class Schema {
71124
71376
  constructor(fields, metadata) {
71125
71377
  _defineProperty$e(this, "fields", void 0);
71126
71378
  _defineProperty$e(this, "metadata", void 0);
71127
- assert$2(Array.isArray(fields));
71379
+ assert$3(Array.isArray(fields));
71128
71380
  checkNames(fields);
71129
71381
  this.fields = fields;
71130
71382
  this.metadata = metadata || /* @__PURE__ */ new Map();
@@ -72114,7 +72366,7 @@ async function encode$2(gltfData) {
72114
72366
  } = gltfScenegraph;
72115
72367
  if (json.lights) {
72116
72368
  const extension = gltfScenegraph.addExtension(KHR_LIGHTS_PUNCTUAL);
72117
- assert$3(!extension.lights);
72369
+ assert$4(!extension.lights);
72118
72370
  extension.lights = json.lights;
72119
72371
  delete json.lights;
72120
72372
  }
@@ -72532,7 +72784,7 @@ class GLTFPostProcessor {
72532
72784
  images = [],
72533
72785
  baseUri = ""
72534
72786
  } = gltf;
72535
- assert$3(json);
72787
+ assert$4(json);
72536
72788
  this.baseUri = baseUri;
72537
72789
  this.json = json;
72538
72790
  this.buffers = buffers;
@@ -72858,18 +73110,18 @@ function parseGLBSync(glb, arrayBuffer2, byteOffset = 0, options = {}) {
72858
73110
  }
72859
73111
  }
72860
73112
  function parseGLBV1(glb, dataView, byteOffset) {
72861
- assert$b(glb.header.byteLength > GLB_FILE_HEADER_SIZE + GLB_CHUNK_HEADER_SIZE);
73113
+ assert$c(glb.header.byteLength > GLB_FILE_HEADER_SIZE + GLB_CHUNK_HEADER_SIZE);
72862
73114
  const contentLength = dataView.getUint32(byteOffset + 0, LE);
72863
73115
  const contentFormat = dataView.getUint32(byteOffset + 4, LE);
72864
73116
  byteOffset += GLB_CHUNK_HEADER_SIZE;
72865
- assert$b(contentFormat === GLB_V1_CONTENT_FORMAT_JSON);
73117
+ assert$c(contentFormat === GLB_V1_CONTENT_FORMAT_JSON);
72866
73118
  parseJSONChunk(glb, dataView, byteOffset, contentLength);
72867
73119
  byteOffset += contentLength;
72868
73120
  byteOffset += parseBINChunk(glb, dataView, byteOffset, glb.header.byteLength);
72869
73121
  return byteOffset;
72870
73122
  }
72871
73123
  function parseGLBV2(glb, dataView, byteOffset, options) {
72872
- assert$b(glb.header.byteLength > GLB_FILE_HEADER_SIZE + GLB_CHUNK_HEADER_SIZE);
73124
+ assert$c(glb.header.byteLength > GLB_FILE_HEADER_SIZE + GLB_CHUNK_HEADER_SIZE);
72873
73125
  parseGLBChunksSync(glb, dataView, byteOffset, options);
72874
73126
  return byteOffset + glb.header.byteLength;
72875
73127
  }
@@ -72949,11 +73201,11 @@ function parseGLTFContainerSync(gltf, data, byteOffset, options) {
72949
73201
  } else if (data instanceof ArrayBuffer) {
72950
73202
  const glb = {};
72951
73203
  byteOffset = parseGLBSync(glb, data, byteOffset, options.glb);
72952
- assert$3(glb.type === "glTF", "Invalid GLB magic string ".concat(glb.type));
73204
+ assert$4(glb.type === "glTF", "Invalid GLB magic string ".concat(glb.type));
72953
73205
  gltf._glb = glb;
72954
73206
  gltf.json = glb.json;
72955
73207
  } else {
72956
- assert$3(false, "GLTF: must be ArrayBuffer or string");
73208
+ assert$4(false, "GLTF: must be ArrayBuffer or string");
72957
73209
  }
72958
73210
  const buffers = gltf.json.buffers || [];
72959
73211
  gltf.buffers = new Array(buffers.length).fill(null);
@@ -72979,7 +73231,7 @@ async function loadBuffers(gltf, options, context) {
72979
73231
  const {
72980
73232
  fetch: fetch2
72981
73233
  } = context;
72982
- assert$3(fetch2);
73234
+ assert$4(fetch2);
72983
73235
  const uri2 = resolveUrl(buffer2.uri, options);
72984
73236
  const response = await (context === null || context === void 0 ? void 0 : (_context$fetch = context.fetch) === null || _context$fetch === void 0 ? void 0 : _context$fetch.call(context, uri2));
72985
73237
  const arrayBuffer2 = await (response === null || response === void 0 ? void 0 : (_response$arrayBuffer = response.arrayBuffer) === null || _response$arrayBuffer === void 0 ? void 0 : _response$arrayBuffer.call(response));
@@ -73032,7 +73284,7 @@ async function loadImage(gltf, image, index2, options, context) {
73032
73284
  const array = getTypedArrayForBufferView(gltf.json, gltf.buffers, image.bufferView);
73033
73285
  arrayBuffer2 = sliceArrayBuffer(array.buffer, array.byteOffset, array.byteLength);
73034
73286
  }
73035
- assert$3(arrayBuffer2, "glTF image has no data");
73287
+ assert$4(arrayBuffer2, "glTF image has no data");
73036
73288
  let parsedImage = await parse2(arrayBuffer2, [ImageLoader, BasisLoader], {
73037
73289
  mimeType: image.mimeType,
73038
73290
  basis: options.basis || {
@@ -73719,7 +73971,7 @@ const scratchVector2 = new Vector3();
73719
73971
  const scratchVector3 = new Vector3();
73720
73972
  function localFrameToFixedFrame(ellipsoid, firstAxis, secondAxis, thirdAxis, cartesianOrigin, result) {
73721
73973
  const thirdAxisInferred = VECTOR_PRODUCT_LOCAL_FRAME[firstAxis] && VECTOR_PRODUCT_LOCAL_FRAME[firstAxis][secondAxis];
73722
- assert$c(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
73974
+ assert$d(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
73723
73975
  let firstAxisVector;
73724
73976
  let secondAxisVector;
73725
73977
  let thirdAxisVector;
@@ -73795,9 +74047,9 @@ class Ellipsoid {
73795
74047
  _defineProperty$e(this, "maximumRadius", void 0);
73796
74048
  _defineProperty$e(this, "centerToleranceSquared", _MathUtils.EPSILON1);
73797
74049
  _defineProperty$e(this, "squaredXOverSquaredZ", void 0);
73798
- assert$c(x2 >= 0);
73799
- assert$c(y2 >= 0);
73800
- assert$c(z >= 0);
74050
+ assert$d(x2 >= 0);
74051
+ assert$d(y2 >= 0);
74052
+ assert$d(z >= 0);
73801
74053
  this.radii = new Vector3(x2, y2, z);
73802
74054
  this.radiiSquared = new Vector3(x2 * x2, y2 * y2, z * z);
73803
74055
  this.radiiToTheFourth = new Vector3(x2 * x2 * x2 * x2, y2 * y2 * y2 * y2, z * z * z * z);
@@ -73881,8 +74133,8 @@ class Ellipsoid {
73881
74133
  return scratchPosition$1.from(position).scale(this.radii).to(result);
73882
74134
  }
73883
74135
  getSurfaceNormalIntersectionWithZAxis(position, buffer2 = 0, result = [0, 0, 0]) {
73884
- assert$c(equals$3(this.radii.x, this.radii.y, _MathUtils.EPSILON15));
73885
- assert$c(this.radii.z > 0);
74136
+ assert$d(equals$3(this.radii.x, this.radii.y, _MathUtils.EPSILON15));
74137
+ assert$d(this.radii.z > 0);
73886
74138
  scratchPosition$1.from(position);
73887
74139
  const z = scratchPosition$1.z * (1 - this.squaredXOverSquaredZ);
73888
74140
  if (Math.abs(z) >= this.radii.z - buffer2) {
@@ -74022,8 +74274,8 @@ class TilesetCache {
74022
74274
  }
74023
74275
  }
74024
74276
  function calculateTransformProps(tileHeader, tile) {
74025
- assert$b(tileHeader);
74026
- assert$b(tile);
74277
+ assert$c(tileHeader);
74278
+ assert$c(tile);
74027
74279
  const {
74028
74280
  rtcCenter,
74029
74281
  gltfUpAxis
@@ -74257,7 +74509,7 @@ const scratchScale = new Vector3();
74257
74509
  const scratchNorthWest = new Vector3();
74258
74510
  const scratchSouthEast = new Vector3();
74259
74511
  function createBoundingVolume(boundingVolumeHeader, transform2, result) {
74260
- assert$b(boundingVolumeHeader, "3D Tile: boundingVolume must be defined");
74512
+ assert$c(boundingVolumeHeader, "3D Tile: boundingVolume must be defined");
74261
74513
  if (boundingVolumeHeader.box) {
74262
74514
  return createBox(boundingVolumeHeader.box, transform2, result);
74263
74515
  }
@@ -74433,11 +74685,11 @@ class ManagedArray {
74433
74685
  return this._array;
74434
74686
  }
74435
74687
  get(index2) {
74436
- assert$b(index2 < this._array.length);
74688
+ assert$c(index2 < this._array.length);
74437
74689
  return this._array[index2];
74438
74690
  }
74439
74691
  set(index2, element) {
74440
- assert$b(index2 >= 0);
74692
+ assert$c(index2 >= 0);
74441
74693
  if (index2 >= this.length) {
74442
74694
  this.length = index2 + 1;
74443
74695
  }
@@ -74471,13 +74723,13 @@ class ManagedArray {
74471
74723
  return element;
74472
74724
  }
74473
74725
  reserve(length2) {
74474
- assert$b(length2 >= 0);
74726
+ assert$c(length2 >= 0);
74475
74727
  if (length2 > this._array.length) {
74476
74728
  this._array.length = length2;
74477
74729
  }
74478
74730
  }
74479
74731
  resize(length2) {
74480
- assert$b(length2 >= 0);
74732
+ assert$c(length2 >= 0);
74481
74733
  this.length = length2;
74482
74734
  }
74483
74735
  trim(length2) {
@@ -75425,7 +75677,7 @@ class Tileset3D {
75425
75677
  _defineProperty$e(this, "_emptyTiles", void 0);
75426
75678
  _defineProperty$e(this, "frameStateData", void 0);
75427
75679
  _defineProperty$e(this, "maximumMemoryUsage", void 0);
75428
- assert$b(json);
75680
+ assert$c(json);
75429
75681
  this.options = {
75430
75682
  ...DEFAULT_PROPS,
75431
75683
  ...options
@@ -75716,7 +75968,7 @@ class Tileset3D {
75716
75968
  }
75717
75969
  calculateViewPropsTiles3D() {
75718
75970
  const root2 = this.root;
75719
- assert$b(root2);
75971
+ assert$c(root2);
75720
75972
  const {
75721
75973
  center: center2
75722
75974
  } = root2.boundingVolume;
@@ -75935,7 +76187,7 @@ const TILE3D_TYPE = {
75935
76187
  GLTF: "glTF"
75936
76188
  };
75937
76189
  function getStringFromArrayBuffer(arrayBuffer2, byteOffset, byteLength) {
75938
- assert$b(arrayBuffer2 instanceof ArrayBuffer);
76190
+ assert$c(arrayBuffer2 instanceof ArrayBuffer);
75939
76191
  const textDecoder = new TextDecoder("utf8");
75940
76192
  const typedArray = new Uint8Array(arrayBuffer2, byteOffset, byteLength);
75941
76193
  const string = textDecoder.decode(typedArray);
@@ -76036,7 +76288,7 @@ class GLType {
76036
76288
  return new ArrayType(buffer2, byteOffset, length2);
76037
76289
  }
76038
76290
  }
76039
- function assert$1(condition, message) {
76291
+ function assert$2(condition, message) {
76040
76292
  if (!condition) {
76041
76293
  throw new Error("math.gl assertion failed. ".concat(message));
76042
76294
  }
@@ -76061,7 +76313,7 @@ function signNotZero(value) {
76061
76313
  return value < 0 ? -1 : 1;
76062
76314
  }
76063
76315
  function octDecodeInRange(x2, y2, rangeMax, result) {
76064
- assert$1(result);
76316
+ assert$2(result);
76065
76317
  if (x2 < 0 || x2 > rangeMax || y2 < 0 || y2 > rangeMax) {
76066
76318
  throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(rangeMax));
76067
76319
  }
@@ -76221,7 +76473,7 @@ function createTypedArrayFromAccessor(tile3DAccessor, buffer2, byteOffset, lengt
76221
76473
  const {
76222
76474
  componentType
76223
76475
  } = tile3DAccessor;
76224
- assert$b(tile3DAccessor.componentType);
76476
+ assert$c(tile3DAccessor.componentType);
76225
76477
  const type2 = typeof componentType === "string" ? GLType.fromName(componentType) : componentType;
76226
76478
  const size2 = COMPONENTS_PER_ATTRIBUTE[tile3DAccessor.type];
76227
76479
  const unpacker = UNPACKER[tile3DAccessor.type];
@@ -76424,7 +76676,7 @@ class Tile3DBatchTableParser {
76424
76676
  _defineProperty$e(this, "_properties", void 0);
76425
76677
  _defineProperty$e(this, "_binaryProperties", void 0);
76426
76678
  _defineProperty$e(this, "_hierarchy", void 0);
76427
- assert$b(featureCount >= 0);
76679
+ assert$c(featureCount >= 0);
76428
76680
  this.json = json || {};
76429
76681
  this.binary = binary;
76430
76682
  this.featureCount = featureCount;
@@ -76448,7 +76700,7 @@ class Tile3DBatchTableParser {
76448
76700
  }
76449
76701
  isClass(batchId, className) {
76450
76702
  this._checkBatchId(batchId);
76451
- assert$b(typeof className === "string", className);
76703
+ assert$c(typeof className === "string", className);
76452
76704
  if (this._hierarchy) {
76453
76705
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
76454
76706
  const classId = hierarchy.classIds[instanceIndex];
@@ -76460,7 +76712,7 @@ class Tile3DBatchTableParser {
76460
76712
  return false;
76461
76713
  }
76462
76714
  isExactClass(batchId, className) {
76463
- assert$b(typeof className === "string", className);
76715
+ assert$c(typeof className === "string", className);
76464
76716
  return this.getExactClassName(batchId) === className;
76465
76717
  }
76466
76718
  getExactClassName(batchId) {
@@ -76474,7 +76726,7 @@ class Tile3DBatchTableParser {
76474
76726
  }
76475
76727
  hasProperty(batchId, name2) {
76476
76728
  this._checkBatchId(batchId);
76477
- assert$b(typeof name2 === "string", name2);
76729
+ assert$c(typeof name2 === "string", name2);
76478
76730
  return defined(this._properties[name2]) || this._hasPropertyInHierarchy(batchId, name2);
76479
76731
  }
76480
76732
  getPropertyNames(batchId, results) {
@@ -76490,7 +76742,7 @@ class Tile3DBatchTableParser {
76490
76742
  }
76491
76743
  getProperty(batchId, name2) {
76492
76744
  this._checkBatchId(batchId);
76493
- assert$b(typeof name2 === "string", name2);
76745
+ assert$c(typeof name2 === "string", name2);
76494
76746
  if (this._binaryProperties) {
76495
76747
  const binaryProperty = this._binaryProperties[name2];
76496
76748
  if (defined(binaryProperty)) {
@@ -76512,7 +76764,7 @@ class Tile3DBatchTableParser {
76512
76764
  setProperty(batchId, name2, value) {
76513
76765
  const featureCount = this.featureCount;
76514
76766
  this._checkBatchId(batchId);
76515
- assert$b(typeof name2 === "string", name2);
76767
+ assert$c(typeof name2 === "string", name2);
76516
76768
  if (this._binaryProperties) {
76517
76769
  const binaryProperty = this._binaryProperties[name2];
76518
76770
  if (binaryProperty) {
@@ -76559,8 +76811,8 @@ class Tile3DBatchTableParser {
76559
76811
  _initializeBinaryProperty(name2, property) {
76560
76812
  if ("byteOffset" in property) {
76561
76813
  const tile3DAccessor = property;
76562
- assert$b(this.binary, "Property ".concat(name2, " requires a batch table binary."));
76563
- assert$b(tile3DAccessor.type, "Property ".concat(name2, " requires a type."));
76814
+ assert$c(this.binary, "Property ".concat(name2, " requires a batch table binary."));
76815
+ assert$c(tile3DAccessor.type, "Property ".concat(name2, " requires a type."));
76564
76816
  const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
76565
76817
  return {
76566
76818
  typedArray: accessor.values,
@@ -76617,7 +76869,7 @@ class Tile3DBatchTableParser {
76617
76869
  const indexInClass = hierarchy.classIndexes[instanceIndex];
76618
76870
  const propertyValues = instanceClass.instances[name2];
76619
76871
  if (defined(propertyValues)) {
76620
- assert$b(instanceIndex === batchId, 'Inherited property "'.concat(name2, '" is read-only.'));
76872
+ assert$c(instanceIndex === batchId, 'Inherited property "'.concat(name2, '" is read-only.'));
76621
76873
  if (defined(propertyValues.typedArray)) {
76622
76874
  this._setBinaryProperty(propertyValues, indexInClass, value);
76623
76875
  } else {
@@ -81752,7 +82004,7 @@ function point(coordinates2, properties, options) {
81752
82004
  if (coordinates2.length < 2) {
81753
82005
  throw new Error("coordinates must be at least 2 numbers long");
81754
82006
  }
81755
- if (!isNumber(coordinates2[0]) || !isNumber(coordinates2[1])) {
82007
+ if (!isNumber$1(coordinates2[0]) || !isNumber$1(coordinates2[1])) {
81756
82008
  throw new Error("coordinates must contain numbers");
81757
82009
  }
81758
82010
  var geom = {
@@ -81953,10 +82205,10 @@ function convertArea(area2, originalUnit, finalUnit) {
81953
82205
  }
81954
82206
  return area2 / startFactor * finalFactor;
81955
82207
  }
81956
- function isNumber(num) {
82208
+ function isNumber$1(num) {
81957
82209
  return !isNaN(num) && num !== null && !Array.isArray(num);
81958
82210
  }
81959
- function isObject$1(input) {
82211
+ function isObject$2(input) {
81960
82212
  return !!input && input.constructor === Object;
81961
82213
  }
81962
82214
  function validateBBox(bbox2) {
@@ -81970,7 +82222,7 @@ function validateBBox(bbox2) {
81970
82222
  throw new Error("bbox must be an Array of 4 or 6 numbers");
81971
82223
  }
81972
82224
  bbox2.forEach(function(num) {
81973
- if (!isNumber(num)) {
82225
+ if (!isNumber$1(num)) {
81974
82226
  throw new Error("bbox must only contain numbers");
81975
82227
  }
81976
82228
  });
@@ -81996,8 +82248,8 @@ const es$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
81996
82248
  featureCollection: featureCollection$1,
81997
82249
  geometry,
81998
82250
  geometryCollection,
81999
- isNumber,
82000
- isObject: isObject$1,
82251
+ isNumber: isNumber$1,
82252
+ isObject: isObject$2,
82001
82253
  lengthToDegrees,
82002
82254
  lengthToRadians,
82003
82255
  lineString,
@@ -82439,7 +82691,7 @@ function lineReduce$1(geojson, callback, initialValue) {
82439
82691
  }
82440
82692
  function findSegment$1(geojson, options) {
82441
82693
  options = options || {};
82442
- if (!isObject$1(options))
82694
+ if (!isObject$2(options))
82443
82695
  throw new Error("options is invalid");
82444
82696
  var featureIndex = options.featureIndex || 0;
82445
82697
  var multiFeatureIndex = options.multiFeatureIndex || 0;
@@ -82531,7 +82783,7 @@ function findSegment$1(geojson, options) {
82531
82783
  }
82532
82784
  function findPoint$1(geojson, options) {
82533
82785
  options = options || {};
82534
- if (!isObject$1(options))
82786
+ if (!isObject$2(options))
82535
82787
  throw new Error("options is invalid");
82536
82788
  var featureIndex = options.featureIndex || 0;
82537
82789
  var multiFeatureIndex = options.multiFeatureIndex || 0;
@@ -82675,7 +82927,7 @@ function getCoords$1(coords) {
82675
82927
  throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array");
82676
82928
  }
82677
82929
  function containsNumber$1(coordinates2) {
82678
- if (coordinates2.length > 1 && isNumber(coordinates2[0]) && isNumber(coordinates2[1])) {
82930
+ if (coordinates2.length > 1 && isNumber$1(coordinates2[0]) && isNumber$1(coordinates2[1])) {
82679
82931
  return true;
82680
82932
  }
82681
82933
  if (Array.isArray(coordinates2[0]) && coordinates2[0].length) {
@@ -85731,7 +85983,7 @@ var hasSymbols2 = typeof Symbol === "function" && typeof Symbol("foo") === "symb
85731
85983
  var toStr$1 = Object.prototype.toString;
85732
85984
  var concat = Array.prototype.concat;
85733
85985
  var defineDataProperty2 = defineDataProperty$1;
85734
- var isFunction = function(fn) {
85986
+ var isFunction$1 = function(fn) {
85735
85987
  return typeof fn === "function" && toStr$1.call(fn) === "[object Function]";
85736
85988
  };
85737
85989
  var supportsDescriptors$2 = hasPropertyDescriptors_1();
@@ -85741,7 +85993,7 @@ var defineProperty$1 = function(object2, name2, value, predicate) {
85741
85993
  if (object2[name2] === value) {
85742
85994
  return;
85743
85995
  }
85744
- } else if (!isFunction(predicate) || !predicate()) {
85996
+ } else if (!isFunction$1(predicate) || !predicate()) {
85745
85997
  return;
85746
85998
  }
85747
85999
  }
@@ -86125,7 +86377,7 @@ function lineOverlap(line1, line2, options) {
86125
86377
  options = {};
86126
86378
  }
86127
86379
  options = options || {};
86128
- if (!isObject$1(options))
86380
+ if (!isObject$2(options))
86129
86381
  throw new Error("options is invalid");
86130
86382
  var tolerance = options.tolerance || 0;
86131
86383
  var features = [];
@@ -86685,19 +86937,19 @@ var jsts_min = { exports: {} };
86685
86937
  }, Object.defineProperties(w2, O);
86686
86938
  var T = function(t2, e3) {
86687
86939
  return t2.interfaces_ && t2.interfaces_().indexOf(e3) > -1;
86688
- }, R2 = function() {
86940
+ }, R = function() {
86689
86941
  }, P2 = { LOG_10: { configurable: true } };
86690
- R2.prototype.interfaces_ = function() {
86942
+ R.prototype.interfaces_ = function() {
86691
86943
  return [];
86692
- }, R2.prototype.getClass = function() {
86693
- return R2;
86694
- }, R2.log10 = function(t2) {
86944
+ }, R.prototype.getClass = function() {
86945
+ return R;
86946
+ }, R.log10 = function(t2) {
86695
86947
  var e3 = Math.log(t2);
86696
- return v.isInfinite(e3) ? e3 : v.isNaN(e3) ? e3 : e3 / R2.LOG_10;
86697
- }, R2.min = function(t2, e3, n4, i3) {
86948
+ return v.isInfinite(e3) ? e3 : v.isNaN(e3) ? e3 : e3 / R.LOG_10;
86949
+ }, R.min = function(t2, e3, n4, i3) {
86698
86950
  var r3 = t2;
86699
86951
  return e3 < r3 && (r3 = e3), n4 < r3 && (r3 = n4), i3 < r3 && (r3 = i3), r3;
86700
- }, R2.clamp = function() {
86952
+ }, R.clamp = function() {
86701
86953
  if ("number" == typeof arguments[2] && "number" == typeof arguments[0] && "number" == typeof arguments[1]) {
86702
86954
  var t2 = arguments[0], e3 = arguments[1], n4 = arguments[2];
86703
86955
  return t2 < e3 ? e3 : t2 > n4 ? n4 : t2;
@@ -86706,9 +86958,9 @@ var jsts_min = { exports: {} };
86706
86958
  var i3 = arguments[0], r3 = arguments[1], o3 = arguments[2];
86707
86959
  return i3 < r3 ? r3 : i3 > o3 ? o3 : i3;
86708
86960
  }
86709
- }, R2.wrap = function(t2, e3) {
86961
+ }, R.wrap = function(t2, e3) {
86710
86962
  return t2 < 0 ? e3 - -t2 % e3 : t2 % e3;
86711
- }, R2.max = function() {
86963
+ }, R.max = function() {
86712
86964
  if (3 === arguments.length) {
86713
86965
  var t2 = arguments[0], e3 = arguments[1], n4 = arguments[2], i3 = t2;
86714
86966
  return e3 > i3 && (i3 = e3), n4 > i3 && (i3 = n4), i3;
@@ -86717,11 +86969,11 @@ var jsts_min = { exports: {} };
86717
86969
  var r3 = arguments[0], o3 = arguments[1], s3 = arguments[2], a3 = arguments[3], u2 = r3;
86718
86970
  return o3 > u2 && (u2 = o3), s3 > u2 && (u2 = s3), a3 > u2 && (u2 = a3), u2;
86719
86971
  }
86720
- }, R2.average = function(t2, e3) {
86972
+ }, R.average = function(t2, e3) {
86721
86973
  return (t2 + e3) / 2;
86722
86974
  }, P2.LOG_10.get = function() {
86723
86975
  return Math.log(10);
86724
- }, Object.defineProperties(R2, P2);
86976
+ }, Object.defineProperties(R, P2);
86725
86977
  var D2 = function(t2) {
86726
86978
  this.str = t2;
86727
86979
  };
@@ -87876,7 +88128,7 @@ var jsts_min = { exports: {} };
87876
88128
  }
87877
88129
  } else
87878
88130
  r3 = true;
87879
- return r3 ? R2.min(at.distancePointLine(t2, n4, i3), at.distancePointLine(e3, n4, i3), at.distancePointLine(n4, t2, e3), at.distancePointLine(i3, t2, e3)) : 0;
88131
+ return r3 ? R.min(at.distancePointLine(t2, n4, i3), at.distancePointLine(e3, n4, i3), at.distancePointLine(n4, t2, e3), at.distancePointLine(i3, t2, e3)) : 0;
87880
88132
  }, at.isPointInRing = function(t2, e3) {
87881
88133
  return at.locatePointInRing(t2, e3) !== w2.EXTERIOR;
87882
88134
  }, at.computeLength = function(t2) {
@@ -88466,8 +88718,8 @@ var jsts_min = { exports: {} };
88466
88718
  (null === e3 || e3.compareTo(t2[n4]) > 0) && (e3 = t2[n4]);
88467
88719
  return e3;
88468
88720
  }, Lt.extract = function(t2, e3, n4) {
88469
- e3 = R2.clamp(e3, 0, t2.length);
88470
- var i3 = (n4 = R2.clamp(n4, -1, t2.length)) - e3 + 1;
88721
+ e3 = R.clamp(e3, 0, t2.length);
88722
+ var i3 = (n4 = R.clamp(n4, -1, t2.length)) - e3 + 1;
88471
88723
  n4 < 0 && (i3 = 0), e3 >= t2.length && (i3 = 0), n4 < e3 && (i3 = 0);
88472
88724
  var r3 = new Array(i3).fill(null);
88473
88725
  if (0 === i3)
@@ -94212,7 +94464,7 @@ var jsts_min = { exports: {} };
94212
94464
  return f3.getResultGeometry(c2);
94213
94465
  }
94214
94466
  }, di.precisionScaleFactor = function(t2, e3, n4) {
94215
- var i3 = t2.getEnvelopeInternal(), r3 = R2.max(Math.abs(i3.getMaxX()), Math.abs(i3.getMaxY()), Math.abs(i3.getMinX()), Math.abs(i3.getMinY())) + 2 * (e3 > 0 ? e3 : 0), o3 = n4 - Math.trunc(Math.log(r3) / Math.log(10) + 1);
94467
+ var i3 = t2.getEnvelopeInternal(), r3 = R.max(Math.abs(i3.getMaxX()), Math.abs(i3.getMaxY()), Math.abs(i3.getMinX()), Math.abs(i3.getMinY())) + 2 * (e3 > 0 ? e3 : 0), o3 = n4 - Math.trunc(Math.log(r3) / Math.log(10) + 1);
94216
94468
  return Math.pow(10, o3);
94217
94469
  }, yi.CAP_ROUND.get = function() {
94218
94470
  return Cn.CAP_ROUND;
@@ -101603,372 +101855,216 @@ var layerMouseEvent = {};
101603
101855
  exports2["default"] = LayerMouseEvent;
101604
101856
  })(layerMouseEvent);
101605
101857
  var nebulaLayer = {};
101606
- var events = { exports: {} };
101607
- var R = typeof Reflect === "object" ? Reflect : null;
101608
- var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
101609
- return Function.prototype.apply.call(target, receiver, args);
101610
- };
101611
- var ReflectOwnKeys;
101612
- if (R && typeof R.ownKeys === "function") {
101613
- ReflectOwnKeys = R.ownKeys;
101614
- } else if (Object.getOwnPropertySymbols) {
101615
- ReflectOwnKeys = function ReflectOwnKeys2(target) {
101616
- return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
101617
- };
101618
- } else {
101619
- ReflectOwnKeys = function ReflectOwnKeys2(target) {
101620
- return Object.getOwnPropertyNames(target);
101621
- };
101622
- }
101623
- function ProcessEmitWarning(warning) {
101624
- if (console && console.warn)
101625
- console.warn(warning);
101626
- }
101627
- var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
101628
- return value !== value;
101629
- };
101630
101858
  function EventEmitter() {
101631
- EventEmitter.init.call(this);
101859
+ this._events = this._events || {};
101860
+ this._maxListeners = this._maxListeners || void 0;
101632
101861
  }
101633
- events.exports = EventEmitter;
101634
- events.exports.once = once2;
101862
+ var events = EventEmitter;
101635
101863
  EventEmitter.EventEmitter = EventEmitter;
101636
101864
  EventEmitter.prototype._events = void 0;
101637
- EventEmitter.prototype._eventsCount = 0;
101638
101865
  EventEmitter.prototype._maxListeners = void 0;
101639
- var defaultMaxListeners = 10;
101640
- function checkListener(listener) {
101641
- if (typeof listener !== "function") {
101642
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
101643
- }
101644
- }
101645
- Object.defineProperty(EventEmitter, "defaultMaxListeners", {
101646
- enumerable: true,
101647
- get: function() {
101648
- return defaultMaxListeners;
101649
- },
101650
- set: function(arg) {
101651
- if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
101652
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
101653
- }
101654
- defaultMaxListeners = arg;
101655
- }
101656
- });
101657
- EventEmitter.init = function() {
101658
- if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
101659
- this._events = /* @__PURE__ */ Object.create(null);
101660
- this._eventsCount = 0;
101661
- }
101662
- this._maxListeners = this._maxListeners || void 0;
101663
- };
101664
- EventEmitter.prototype.setMaxListeners = function setMaxListeners(n3) {
101665
- if (typeof n3 !== "number" || n3 < 0 || NumberIsNaN(n3)) {
101666
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n3 + ".");
101667
- }
101866
+ EventEmitter.defaultMaxListeners = 10;
101867
+ EventEmitter.prototype.setMaxListeners = function(n3) {
101868
+ if (!isNumber(n3) || n3 < 0 || isNaN(n3))
101869
+ throw TypeError("n must be a positive number");
101668
101870
  this._maxListeners = n3;
101669
101871
  return this;
101670
101872
  };
101671
- function _getMaxListeners(that) {
101672
- if (that._maxListeners === void 0)
101673
- return EventEmitter.defaultMaxListeners;
101674
- return that._maxListeners;
101675
- }
101676
- EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
101677
- return _getMaxListeners(this);
101678
- };
101679
- EventEmitter.prototype.emit = function emit(type2) {
101680
- var args = [];
101681
- for (var i2 = 1; i2 < arguments.length; i2++)
101682
- args.push(arguments[i2]);
101683
- var doError = type2 === "error";
101684
- var events2 = this._events;
101685
- if (events2 !== void 0)
101686
- doError = doError && events2.error === void 0;
101687
- else if (!doError)
101688
- return false;
101689
- if (doError) {
101690
- var er;
101691
- if (args.length > 0)
101692
- er = args[0];
101693
- if (er instanceof Error) {
101694
- throw er;
101695
- }
101696
- var err2 = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
101697
- err2.context = er;
101698
- throw err2;
101699
- }
101700
- var handler = events2[type2];
101701
- if (handler === void 0)
101873
+ EventEmitter.prototype.emit = function(type2) {
101874
+ var er, handler, len2, args, i2, listeners;
101875
+ if (!this._events)
101876
+ this._events = {};
101877
+ if (type2 === "error") {
101878
+ if (!this._events.error || isObject$1(this._events.error) && !this._events.error.length) {
101879
+ er = arguments[1];
101880
+ if (er instanceof Error) {
101881
+ throw er;
101882
+ } else {
101883
+ var err2 = new Error('Uncaught, unspecified "error" event. (' + er + ")");
101884
+ err2.context = er;
101885
+ throw err2;
101886
+ }
101887
+ }
101888
+ }
101889
+ handler = this._events[type2];
101890
+ if (isUndefined(handler))
101702
101891
  return false;
101703
- if (typeof handler === "function") {
101704
- ReflectApply(handler, this, args);
101705
- } else {
101706
- var len2 = handler.length;
101707
- var listeners2 = arrayClone(handler, len2);
101708
- for (var i2 = 0; i2 < len2; ++i2)
101709
- ReflectApply(listeners2[i2], this, args);
101892
+ if (isFunction(handler)) {
101893
+ switch (arguments.length) {
101894
+ case 1:
101895
+ handler.call(this);
101896
+ break;
101897
+ case 2:
101898
+ handler.call(this, arguments[1]);
101899
+ break;
101900
+ case 3:
101901
+ handler.call(this, arguments[1], arguments[2]);
101902
+ break;
101903
+ default:
101904
+ args = Array.prototype.slice.call(arguments, 1);
101905
+ handler.apply(this, args);
101906
+ }
101907
+ } else if (isObject$1(handler)) {
101908
+ args = Array.prototype.slice.call(arguments, 1);
101909
+ listeners = handler.slice();
101910
+ len2 = listeners.length;
101911
+ for (i2 = 0; i2 < len2; i2++)
101912
+ listeners[i2].apply(this, args);
101710
101913
  }
101711
101914
  return true;
101712
101915
  };
101713
- function _addListener(target, type2, listener, prepend) {
101916
+ EventEmitter.prototype.addListener = function(type2, listener) {
101714
101917
  var m;
101715
- var events2;
101716
- var existing;
101717
- checkListener(listener);
101718
- events2 = target._events;
101719
- if (events2 === void 0) {
101720
- events2 = target._events = /* @__PURE__ */ Object.create(null);
101721
- target._eventsCount = 0;
101722
- } else {
101723
- if (events2.newListener !== void 0) {
101724
- target.emit(
101725
- "newListener",
101726
- type2,
101727
- listener.listener ? listener.listener : listener
101728
- );
101729
- events2 = target._events;
101730
- }
101731
- existing = events2[type2];
101732
- }
101733
- if (existing === void 0) {
101734
- existing = events2[type2] = listener;
101735
- ++target._eventsCount;
101736
- } else {
101737
- if (typeof existing === "function") {
101738
- existing = events2[type2] = prepend ? [listener, existing] : [existing, listener];
101739
- } else if (prepend) {
101740
- existing.unshift(listener);
101918
+ if (!isFunction(listener))
101919
+ throw TypeError("listener must be a function");
101920
+ if (!this._events)
101921
+ this._events = {};
101922
+ if (this._events.newListener)
101923
+ this.emit(
101924
+ "newListener",
101925
+ type2,
101926
+ isFunction(listener.listener) ? listener.listener : listener
101927
+ );
101928
+ if (!this._events[type2])
101929
+ this._events[type2] = listener;
101930
+ else if (isObject$1(this._events[type2]))
101931
+ this._events[type2].push(listener);
101932
+ else
101933
+ this._events[type2] = [this._events[type2], listener];
101934
+ if (isObject$1(this._events[type2]) && !this._events[type2].warned) {
101935
+ if (!isUndefined(this._maxListeners)) {
101936
+ m = this._maxListeners;
101741
101937
  } else {
101742
- existing.push(listener);
101938
+ m = EventEmitter.defaultMaxListeners;
101743
101939
  }
101744
- m = _getMaxListeners(target);
101745
- if (m > 0 && existing.length > m && !existing.warned) {
101746
- existing.warned = true;
101747
- var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type2) + " listeners added. Use emitter.setMaxListeners() to increase limit");
101748
- w2.name = "MaxListenersExceededWarning";
101749
- w2.emitter = target;
101750
- w2.type = type2;
101751
- w2.count = existing.length;
101752
- ProcessEmitWarning(w2);
101940
+ if (m && m > 0 && this._events[type2].length > m) {
101941
+ this._events[type2].warned = true;
101942
+ console.error(
101943
+ "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",
101944
+ this._events[type2].length
101945
+ );
101946
+ if (typeof console.trace === "function") {
101947
+ console.trace();
101948
+ }
101753
101949
  }
101754
101950
  }
101755
- return target;
101756
- }
101757
- EventEmitter.prototype.addListener = function addListener(type2, listener) {
101758
- return _addListener(this, type2, listener, false);
101759
- };
101760
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
101761
- EventEmitter.prototype.prependListener = function prependListener(type2, listener) {
101762
- return _addListener(this, type2, listener, true);
101763
- };
101764
- function onceWrapper() {
101765
- if (!this.fired) {
101766
- this.target.removeListener(this.type, this.wrapFn);
101767
- this.fired = true;
101768
- if (arguments.length === 0)
101769
- return this.listener.call(this.target);
101770
- return this.listener.apply(this.target, arguments);
101771
- }
101772
- }
101773
- function _onceWrap(target, type2, listener) {
101774
- var state = { fired: false, wrapFn: void 0, target, type: type2, listener };
101775
- var wrapped = onceWrapper.bind(state);
101776
- wrapped.listener = listener;
101777
- state.wrapFn = wrapped;
101778
- return wrapped;
101779
- }
101780
- EventEmitter.prototype.once = function once(type2, listener) {
101781
- checkListener(listener);
101782
- this.on(type2, _onceWrap(this, type2, listener));
101783
101951
  return this;
101784
101952
  };
101785
- EventEmitter.prototype.prependOnceListener = function prependOnceListener(type2, listener) {
101786
- checkListener(listener);
101787
- this.prependListener(type2, _onceWrap(this, type2, listener));
101953
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
101954
+ EventEmitter.prototype.once = function(type2, listener) {
101955
+ if (!isFunction(listener))
101956
+ throw TypeError("listener must be a function");
101957
+ var fired = false;
101958
+ function g2() {
101959
+ this.removeListener(type2, g2);
101960
+ if (!fired) {
101961
+ fired = true;
101962
+ listener.apply(this, arguments);
101963
+ }
101964
+ }
101965
+ g2.listener = listener;
101966
+ this.on(type2, g2);
101788
101967
  return this;
101789
101968
  };
101790
- EventEmitter.prototype.removeListener = function removeListener(type2, listener) {
101791
- var list, events2, position, i2, originalListener;
101792
- checkListener(listener);
101793
- events2 = this._events;
101794
- if (events2 === void 0)
101795
- return this;
101796
- list = events2[type2];
101797
- if (list === void 0)
101969
+ EventEmitter.prototype.removeListener = function(type2, listener) {
101970
+ var list, position, length2, i2;
101971
+ if (!isFunction(listener))
101972
+ throw TypeError("listener must be a function");
101973
+ if (!this._events || !this._events[type2])
101798
101974
  return this;
101799
- if (list === listener || list.listener === listener) {
101800
- if (--this._eventsCount === 0)
101801
- this._events = /* @__PURE__ */ Object.create(null);
101802
- else {
101803
- delete events2[type2];
101804
- if (events2.removeListener)
101805
- this.emit("removeListener", type2, list.listener || listener);
101806
- }
101807
- } else if (typeof list !== "function") {
101808
- position = -1;
101809
- for (i2 = list.length - 1; i2 >= 0; i2--) {
101810
- if (list[i2] === listener || list[i2].listener === listener) {
101811
- originalListener = list[i2].listener;
101975
+ list = this._events[type2];
101976
+ length2 = list.length;
101977
+ position = -1;
101978
+ if (list === listener || isFunction(list.listener) && list.listener === listener) {
101979
+ delete this._events[type2];
101980
+ if (this._events.removeListener)
101981
+ this.emit("removeListener", type2, listener);
101982
+ } else if (isObject$1(list)) {
101983
+ for (i2 = length2; i2-- > 0; ) {
101984
+ if (list[i2] === listener || list[i2].listener && list[i2].listener === listener) {
101812
101985
  position = i2;
101813
101986
  break;
101814
101987
  }
101815
101988
  }
101816
101989
  if (position < 0)
101817
101990
  return this;
101818
- if (position === 0)
101819
- list.shift();
101820
- else {
101821
- spliceOne(list, position);
101991
+ if (list.length === 1) {
101992
+ list.length = 0;
101993
+ delete this._events[type2];
101994
+ } else {
101995
+ list.splice(position, 1);
101822
101996
  }
101823
- if (list.length === 1)
101824
- events2[type2] = list[0];
101825
- if (events2.removeListener !== void 0)
101826
- this.emit("removeListener", type2, originalListener || listener);
101997
+ if (this._events.removeListener)
101998
+ this.emit("removeListener", type2, listener);
101827
101999
  }
101828
102000
  return this;
101829
102001
  };
101830
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
101831
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(type2) {
101832
- var listeners2, events2, i2;
101833
- events2 = this._events;
101834
- if (events2 === void 0)
102002
+ EventEmitter.prototype.removeAllListeners = function(type2) {
102003
+ var key, listeners;
102004
+ if (!this._events)
101835
102005
  return this;
101836
- if (events2.removeListener === void 0) {
101837
- if (arguments.length === 0) {
101838
- this._events = /* @__PURE__ */ Object.create(null);
101839
- this._eventsCount = 0;
101840
- } else if (events2[type2] !== void 0) {
101841
- if (--this._eventsCount === 0)
101842
- this._events = /* @__PURE__ */ Object.create(null);
101843
- else
101844
- delete events2[type2];
101845
- }
102006
+ if (!this._events.removeListener) {
102007
+ if (arguments.length === 0)
102008
+ this._events = {};
102009
+ else if (this._events[type2])
102010
+ delete this._events[type2];
101846
102011
  return this;
101847
102012
  }
101848
102013
  if (arguments.length === 0) {
101849
- var keys3 = Object.keys(events2);
101850
- var key;
101851
- for (i2 = 0; i2 < keys3.length; ++i2) {
101852
- key = keys3[i2];
102014
+ for (key in this._events) {
101853
102015
  if (key === "removeListener")
101854
102016
  continue;
101855
102017
  this.removeAllListeners(key);
101856
102018
  }
101857
102019
  this.removeAllListeners("removeListener");
101858
- this._events = /* @__PURE__ */ Object.create(null);
101859
- this._eventsCount = 0;
102020
+ this._events = {};
101860
102021
  return this;
101861
102022
  }
101862
- listeners2 = events2[type2];
101863
- if (typeof listeners2 === "function") {
101864
- this.removeListener(type2, listeners2);
101865
- } else if (listeners2 !== void 0) {
101866
- for (i2 = listeners2.length - 1; i2 >= 0; i2--) {
101867
- this.removeListener(type2, listeners2[i2]);
101868
- }
102023
+ listeners = this._events[type2];
102024
+ if (isFunction(listeners)) {
102025
+ this.removeListener(type2, listeners);
102026
+ } else if (listeners) {
102027
+ while (listeners.length)
102028
+ this.removeListener(type2, listeners[listeners.length - 1]);
101869
102029
  }
102030
+ delete this._events[type2];
101870
102031
  return this;
101871
102032
  };
101872
- function _listeners(target, type2, unwrap2) {
101873
- var events2 = target._events;
101874
- if (events2 === void 0)
101875
- return [];
101876
- var evlistener = events2[type2];
101877
- if (evlistener === void 0)
101878
- return [];
101879
- if (typeof evlistener === "function")
101880
- return unwrap2 ? [evlistener.listener || evlistener] : [evlistener];
101881
- return unwrap2 ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
101882
- }
101883
- EventEmitter.prototype.listeners = function listeners(type2) {
101884
- return _listeners(this, type2, true);
101885
- };
101886
- EventEmitter.prototype.rawListeners = function rawListeners(type2) {
101887
- return _listeners(this, type2, false);
101888
- };
101889
- EventEmitter.listenerCount = function(emitter, type2) {
101890
- if (typeof emitter.listenerCount === "function") {
101891
- return emitter.listenerCount(type2);
101892
- } else {
101893
- return listenerCount.call(emitter, type2);
101894
- }
102033
+ EventEmitter.prototype.listeners = function(type2) {
102034
+ var ret;
102035
+ if (!this._events || !this._events[type2])
102036
+ ret = [];
102037
+ else if (isFunction(this._events[type2]))
102038
+ ret = [this._events[type2]];
102039
+ else
102040
+ ret = this._events[type2].slice();
102041
+ return ret;
101895
102042
  };
101896
- EventEmitter.prototype.listenerCount = listenerCount;
101897
- function listenerCount(type2) {
101898
- var events2 = this._events;
101899
- if (events2 !== void 0) {
101900
- var evlistener = events2[type2];
101901
- if (typeof evlistener === "function") {
102043
+ EventEmitter.prototype.listenerCount = function(type2) {
102044
+ if (this._events) {
102045
+ var evlistener = this._events[type2];
102046
+ if (isFunction(evlistener))
101902
102047
  return 1;
101903
- } else if (evlistener !== void 0) {
102048
+ else if (evlistener)
101904
102049
  return evlistener.length;
101905
- }
101906
102050
  }
101907
102051
  return 0;
101908
- }
101909
- EventEmitter.prototype.eventNames = function eventNames() {
101910
- return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
101911
102052
  };
101912
- function arrayClone(arr, n3) {
101913
- var copy2 = new Array(n3);
101914
- for (var i2 = 0; i2 < n3; ++i2)
101915
- copy2[i2] = arr[i2];
101916
- return copy2;
101917
- }
101918
- function spliceOne(list, index2) {
101919
- for (; index2 + 1 < list.length; index2++)
101920
- list[index2] = list[index2 + 1];
101921
- list.pop();
102053
+ EventEmitter.listenerCount = function(emitter, type2) {
102054
+ return emitter.listenerCount(type2);
102055
+ };
102056
+ function isFunction(arg) {
102057
+ return typeof arg === "function";
101922
102058
  }
101923
- function unwrapListeners(arr) {
101924
- var ret = new Array(arr.length);
101925
- for (var i2 = 0; i2 < ret.length; ++i2) {
101926
- ret[i2] = arr[i2].listener || arr[i2];
101927
- }
101928
- return ret;
102059
+ function isNumber(arg) {
102060
+ return typeof arg === "number";
101929
102061
  }
101930
- function once2(emitter, name2) {
101931
- return new Promise(function(resolve, reject) {
101932
- function errorListener(err2) {
101933
- emitter.removeListener(name2, resolver);
101934
- reject(err2);
101935
- }
101936
- function resolver() {
101937
- if (typeof emitter.removeListener === "function") {
101938
- emitter.removeListener("error", errorListener);
101939
- }
101940
- resolve([].slice.call(arguments));
101941
- }
101942
- eventTargetAgnosticAddListener(emitter, name2, resolver, { once: true });
101943
- if (name2 !== "error") {
101944
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
101945
- }
101946
- });
102062
+ function isObject$1(arg) {
102063
+ return typeof arg === "object" && arg !== null;
101947
102064
  }
101948
- function addErrorHandlerIfEventEmitter(emitter, handler, flags3) {
101949
- if (typeof emitter.on === "function") {
101950
- eventTargetAgnosticAddListener(emitter, "error", handler, flags3);
101951
- }
102065
+ function isUndefined(arg) {
102066
+ return arg === void 0;
101952
102067
  }
101953
- function eventTargetAgnosticAddListener(emitter, name2, listener, flags3) {
101954
- if (typeof emitter.on === "function") {
101955
- if (flags3.once) {
101956
- emitter.once(name2, listener);
101957
- } else {
101958
- emitter.on(name2, listener);
101959
- }
101960
- } else if (typeof emitter.addEventListener === "function") {
101961
- emitter.addEventListener(name2, function wrapListener(arg) {
101962
- if (flags3.once) {
101963
- emitter.removeEventListener(name2, wrapListener);
101964
- }
101965
- listener(arg);
101966
- });
101967
- } else {
101968
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
101969
- }
101970
- }
101971
- var eventsExports = events.exports;
101972
102068
  var getRandomValues = typeof crypto != "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != "undefined" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto);
101973
102069
  var rnds8 = new Uint8Array(16);
101974
102070
  function rng() {
@@ -102334,7 +102430,7 @@ const require$$1$3 = /* @__PURE__ */ getAugmentedNamespace(esmBrowser);
102334
102430
  value: true
102335
102431
  });
102336
102432
  exports2["default"] = void 0;
102337
- var _events = _interopRequireDefault2(eventsExports);
102433
+ var _events = _interopRequireDefault2(events);
102338
102434
  var _uuid = _interopRequireDefault2(require$$1$3);
102339
102435
  function _interopRequireDefault2(obj) {
102340
102436
  return obj && obj.__esModule ? obj : { "default": obj };
@@ -102818,7 +102914,7 @@ function rhumbDistance$2(from, to, options) {
102818
102914
  }
102819
102915
  function calculateRhumbDistance(origin, destination2, radius) {
102820
102916
  radius = radius === void 0 ? helpers_1$9.earthRadius : Number(radius);
102821
- var R2 = radius;
102917
+ var R = radius;
102822
102918
  var phi12 = origin[1] * Math.PI / 180;
102823
102919
  var phi2 = destination2[1] * Math.PI / 180;
102824
102920
  var DeltaPhi = phi2 - phi12;
@@ -102829,7 +102925,7 @@ function calculateRhumbDistance(origin, destination2, radius) {
102829
102925
  var DeltaPsi = Math.log(Math.tan(phi2 / 2 + Math.PI / 4) / Math.tan(phi12 / 2 + Math.PI / 4));
102830
102926
  var q = Math.abs(DeltaPsi) > 1e-11 ? DeltaPhi / DeltaPsi : Math.cos(phi12);
102831
102927
  var delta = Math.sqrt(DeltaPhi * DeltaPhi + q * q * DeltaLambda * DeltaLambda);
102832
- var dist = delta * R2;
102928
+ var dist = delta * R;
102833
102929
  return dist;
102834
102930
  }
102835
102931
  js$e.default = rhumbDistance$2;
@@ -117338,7 +117434,7 @@ var document_1 = doccy;
117338
117434
  value: true
117339
117435
  });
117340
117436
  exports2["default"] = void 0;
117341
- var _events = eventsExports;
117437
+ var _events = events;
117342
117438
  var _document = _interopRequireDefault2(document_1);
117343
117439
  var _core = require$$2$2;
117344
117440
  var _deckDrawer = _interopRequireDefault2(deckDrawer);
@@ -119259,16 +119355,16 @@ function addDecoder(cases, importFn) {
119259
119355
  }
119260
119356
  cases.forEach((c) => registry$2.set(c, importFn));
119261
119357
  }
119262
- addDecoder([void 0, 1], () => import("./raw-50921dfc.js").then((m) => m.default));
119263
- addDecoder(5, () => import("./lzw-04aab5f2.js").then((m) => m.default));
119358
+ addDecoder([void 0, 1], () => import("./raw-ee86fdce.js").then((m) => m.default));
119359
+ addDecoder(5, () => import("./lzw-3c031ccf.js").then((m) => m.default));
119264
119360
  addDecoder(6, () => {
119265
119361
  throw new Error("old style JPEG compression is not supported.");
119266
119362
  });
119267
- addDecoder(7, () => import("./jpeg-defa9e7c.js").then((m) => m.default));
119268
- addDecoder([8, 32946], () => import("./deflate-72995733.js").then((m) => m.default));
119269
- addDecoder(32773, () => import("./packbits-3b8eecdb.js").then((m) => m.default));
119270
- addDecoder(34887, () => import("./lerc-016c6bf9.js").then((m) => m.default));
119271
- addDecoder(50001, () => import("./webimage-98d89993.js").then((m) => m.default));
119363
+ addDecoder(7, () => import("./jpeg-8fc6d0e2.js").then((m) => m.default));
119364
+ addDecoder([8, 32946], () => import("./deflate-a18aa092.js").then((m) => m.default));
119365
+ addDecoder(32773, () => import("./packbits-184fd0f9.js").then((m) => m.default));
119366
+ addDecoder(34887, () => import("./lerc-bbd3647a.js").then((m) => m.default));
119367
+ addDecoder(50001, () => import("./webimage-b6c0ac98.js").then((m) => m.default));
119272
119368
  function decodeRowAcc(row, stride) {
119273
119369
  let length2 = row.length - stride;
119274
119370
  let offset = 0;
@@ -123095,16 +123191,16 @@ createCommonjsModule(function(module2) {
123095
123191
  if (!new Events().__proto__)
123096
123192
  prefix = false;
123097
123193
  }
123098
- function EE(fn, context, once3) {
123194
+ function EE(fn, context, once) {
123099
123195
  this.fn = fn;
123100
123196
  this.context = context;
123101
- this.once = once3 || false;
123197
+ this.once = once || false;
123102
123198
  }
123103
- function addListener2(emitter, event, fn, context, once3) {
123199
+ function addListener(emitter, event, fn, context, once) {
123104
123200
  if (typeof fn !== "function") {
123105
123201
  throw new TypeError("The listener must be a function");
123106
123202
  }
123107
- var listener = new EE(fn, context || emitter, once3), evt = prefix ? prefix + event : event;
123203
+ var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
123108
123204
  if (!emitter._events[evt])
123109
123205
  emitter._events[evt] = listener, emitter._eventsCount++;
123110
123206
  else if (!emitter._events[evt].fn)
@@ -123123,7 +123219,7 @@ createCommonjsModule(function(module2) {
123123
123219
  this._events = new Events();
123124
123220
  this._eventsCount = 0;
123125
123221
  }
123126
- EventEmitter2.prototype.eventNames = function eventNames2() {
123222
+ EventEmitter2.prototype.eventNames = function eventNames() {
123127
123223
  var names = [], events2, name2;
123128
123224
  if (this._eventsCount === 0)
123129
123225
  return names;
@@ -123136,7 +123232,7 @@ createCommonjsModule(function(module2) {
123136
123232
  }
123137
123233
  return names;
123138
123234
  };
123139
- EventEmitter2.prototype.listeners = function listeners2(event) {
123235
+ EventEmitter2.prototype.listeners = function listeners(event) {
123140
123236
  var evt = prefix ? prefix + event : event, handlers = this._events[evt];
123141
123237
  if (!handlers)
123142
123238
  return [];
@@ -123147,76 +123243,76 @@ createCommonjsModule(function(module2) {
123147
123243
  }
123148
123244
  return ee;
123149
123245
  };
123150
- EventEmitter2.prototype.listenerCount = function listenerCount2(event) {
123151
- var evt = prefix ? prefix + event : event, listeners2 = this._events[evt];
123152
- if (!listeners2)
123246
+ EventEmitter2.prototype.listenerCount = function listenerCount(event) {
123247
+ var evt = prefix ? prefix + event : event, listeners = this._events[evt];
123248
+ if (!listeners)
123153
123249
  return 0;
123154
- if (listeners2.fn)
123250
+ if (listeners.fn)
123155
123251
  return 1;
123156
- return listeners2.length;
123252
+ return listeners.length;
123157
123253
  };
123158
- EventEmitter2.prototype.emit = function emit2(event, a1, a2, a3, a4, a5) {
123254
+ EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
123159
123255
  var evt = prefix ? prefix + event : event;
123160
123256
  if (!this._events[evt])
123161
123257
  return false;
123162
- var listeners2 = this._events[evt], len2 = arguments.length, args, i2;
123163
- if (listeners2.fn) {
123164
- if (listeners2.once)
123165
- this.removeListener(event, listeners2.fn, void 0, true);
123258
+ var listeners = this._events[evt], len2 = arguments.length, args, i2;
123259
+ if (listeners.fn) {
123260
+ if (listeners.once)
123261
+ this.removeListener(event, listeners.fn, void 0, true);
123166
123262
  switch (len2) {
123167
123263
  case 1:
123168
- return listeners2.fn.call(listeners2.context), true;
123264
+ return listeners.fn.call(listeners.context), true;
123169
123265
  case 2:
123170
- return listeners2.fn.call(listeners2.context, a1), true;
123266
+ return listeners.fn.call(listeners.context, a1), true;
123171
123267
  case 3:
123172
- return listeners2.fn.call(listeners2.context, a1, a2), true;
123268
+ return listeners.fn.call(listeners.context, a1, a2), true;
123173
123269
  case 4:
123174
- return listeners2.fn.call(listeners2.context, a1, a2, a3), true;
123270
+ return listeners.fn.call(listeners.context, a1, a2, a3), true;
123175
123271
  case 5:
123176
- return listeners2.fn.call(listeners2.context, a1, a2, a3, a4), true;
123272
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
123177
123273
  case 6:
123178
- return listeners2.fn.call(listeners2.context, a1, a2, a3, a4, a5), true;
123274
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
123179
123275
  }
123180
123276
  for (i2 = 1, args = new Array(len2 - 1); i2 < len2; i2++) {
123181
123277
  args[i2 - 1] = arguments[i2];
123182
123278
  }
123183
- listeners2.fn.apply(listeners2.context, args);
123279
+ listeners.fn.apply(listeners.context, args);
123184
123280
  } else {
123185
- var length2 = listeners2.length, j;
123281
+ var length2 = listeners.length, j;
123186
123282
  for (i2 = 0; i2 < length2; i2++) {
123187
- if (listeners2[i2].once)
123188
- this.removeListener(event, listeners2[i2].fn, void 0, true);
123283
+ if (listeners[i2].once)
123284
+ this.removeListener(event, listeners[i2].fn, void 0, true);
123189
123285
  switch (len2) {
123190
123286
  case 1:
123191
- listeners2[i2].fn.call(listeners2[i2].context);
123287
+ listeners[i2].fn.call(listeners[i2].context);
123192
123288
  break;
123193
123289
  case 2:
123194
- listeners2[i2].fn.call(listeners2[i2].context, a1);
123290
+ listeners[i2].fn.call(listeners[i2].context, a1);
123195
123291
  break;
123196
123292
  case 3:
123197
- listeners2[i2].fn.call(listeners2[i2].context, a1, a2);
123293
+ listeners[i2].fn.call(listeners[i2].context, a1, a2);
123198
123294
  break;
123199
123295
  case 4:
123200
- listeners2[i2].fn.call(listeners2[i2].context, a1, a2, a3);
123296
+ listeners[i2].fn.call(listeners[i2].context, a1, a2, a3);
123201
123297
  break;
123202
123298
  default:
123203
123299
  if (!args)
123204
123300
  for (j = 1, args = new Array(len2 - 1); j < len2; j++) {
123205
123301
  args[j - 1] = arguments[j];
123206
123302
  }
123207
- listeners2[i2].fn.apply(listeners2[i2].context, args);
123303
+ listeners[i2].fn.apply(listeners[i2].context, args);
123208
123304
  }
123209
123305
  }
123210
123306
  }
123211
123307
  return true;
123212
123308
  };
123213
123309
  EventEmitter2.prototype.on = function on(event, fn, context) {
123214
- return addListener2(this, event, fn, context, false);
123310
+ return addListener(this, event, fn, context, false);
123215
123311
  };
123216
- EventEmitter2.prototype.once = function once3(event, fn, context) {
123217
- return addListener2(this, event, fn, context, true);
123312
+ EventEmitter2.prototype.once = function once(event, fn, context) {
123313
+ return addListener(this, event, fn, context, true);
123218
123314
  };
123219
- EventEmitter2.prototype.removeListener = function removeListener2(event, fn, context, once3) {
123315
+ EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) {
123220
123316
  var evt = prefix ? prefix + event : event;
123221
123317
  if (!this._events[evt])
123222
123318
  return this;
@@ -123224,15 +123320,15 @@ createCommonjsModule(function(module2) {
123224
123320
  clearEvent(this, evt);
123225
123321
  return this;
123226
123322
  }
123227
- var listeners2 = this._events[evt];
123228
- if (listeners2.fn) {
123229
- if (listeners2.fn === fn && (!once3 || listeners2.once) && (!context || listeners2.context === context)) {
123323
+ var listeners = this._events[evt];
123324
+ if (listeners.fn) {
123325
+ if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
123230
123326
  clearEvent(this, evt);
123231
123327
  }
123232
123328
  } else {
123233
- for (var i2 = 0, events2 = [], length2 = listeners2.length; i2 < length2; i2++) {
123234
- if (listeners2[i2].fn !== fn || once3 && !listeners2[i2].once || context && listeners2[i2].context !== context) {
123235
- events2.push(listeners2[i2]);
123329
+ for (var i2 = 0, events2 = [], length2 = listeners.length; i2 < length2; i2++) {
123330
+ if (listeners[i2].fn !== fn || once && !listeners[i2].once || context && listeners[i2].context !== context) {
123331
+ events2.push(listeners[i2]);
123236
123332
  }
123237
123333
  }
123238
123334
  if (events2.length)
@@ -123242,7 +123338,7 @@ createCommonjsModule(function(module2) {
123242
123338
  }
123243
123339
  return this;
123244
123340
  };
123245
- EventEmitter2.prototype.removeAllListeners = function removeAllListeners2(event) {
123341
+ EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) {
123246
123342
  var evt;
123247
123343
  if (event) {
123248
123344
  evt = prefix ? prefix + event : event;
@@ -127725,7 +127821,7 @@ var blosc_codec = function() {
127725
127821
  b += Ga[z[a2++]];
127726
127822
  return b;
127727
127823
  }
127728
- var Q2 = {}, R2 = {}, S = {};
127824
+ var Q2 = {}, R = {}, S = {};
127729
127825
  function Ha(a2) {
127730
127826
  if (void 0 === a2)
127731
127827
  return "_unknown";
@@ -127770,8 +127866,8 @@ var blosc_codec = function() {
127770
127866
  });
127771
127867
  var e2 = Array(a2.length), g2 = [], k = 0;
127772
127868
  a2.forEach(function(h, l2) {
127773
- R2.hasOwnProperty(h) ? e2[l2] = R2[h] : (g2.push(h), Q2.hasOwnProperty(h) || (Q2[h] = []), Q2[h].push(function() {
127774
- e2[l2] = R2[h];
127869
+ R.hasOwnProperty(h) ? e2[l2] = R[h] : (g2.push(h), Q2.hasOwnProperty(h) || (Q2[h] = []), Q2[h].push(function() {
127870
+ e2[l2] = R[h];
127775
127871
  ++k;
127776
127872
  k === g2.length && c(e2);
127777
127873
  }));
@@ -127784,12 +127880,12 @@ var blosc_codec = function() {
127784
127880
  throw new TypeError("registerType registeredInstance requires argPackAdvance");
127785
127881
  var d = b.name;
127786
127882
  a2 || T('type "' + d + '" must have a positive integer typeid pointer');
127787
- if (R2.hasOwnProperty(a2)) {
127883
+ if (R.hasOwnProperty(a2)) {
127788
127884
  if (c.U)
127789
127885
  return;
127790
127886
  T("Cannot register type '" + d + "' twice");
127791
127887
  }
127792
- R2[a2] = b;
127888
+ R[a2] = b;
127793
127889
  delete S[a2];
127794
127890
  Q2.hasOwnProperty(a2) && (b = Q2[a2], delete Q2[a2], b.forEach(function(e2) {
127795
127891
  e2();
@@ -127902,7 +127998,7 @@ var blosc_codec = function() {
127902
127998
  }
127903
127999
  function eb(a2, b) {
127904
128000
  function c(g2) {
127905
- e2[g2] || R2[g2] || (S[g2] ? S[g2].forEach(c) : (d.push(g2), e2[g2] = true));
128001
+ e2[g2] || R[g2] || (S[g2] ? S[g2].forEach(c) : (d.push(g2), e2[g2] = true));
127906
128002
  }
127907
128003
  var d = [], e2 = {};
127908
128004
  b.forEach(c);
@@ -128190,7 +128286,7 @@ var blosc_codec = function() {
128190
128286
  }, n: Qa, x: function(a2) {
128191
128287
  4 < a2 && (V[a2].P += 1);
128192
128288
  }, C: function(a2, b) {
128193
- var c = R2[a2];
128289
+ var c = R[a2];
128194
128290
  void 0 === c && T("_emval_take_value has unknown type " + cb(a2));
128195
128291
  a2 = c.readValueFromPointer(b);
128196
128292
  return Ra(a2);
@@ -133193,10 +133289,10 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
133193
133289
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
133194
133290
  const colorTexHeight = Math.max(2, Math.ceil(totalColorsLength / texSize));
133195
133291
  if (valueTexHeight > texSize) {
133196
- console.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
133292
+ log$5.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
133197
133293
  }
133198
133294
  if (colorTexHeight > texSize) {
133199
- console.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
133295
+ log$5.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
133200
133296
  }
133201
133297
  const totalData = new Uint8Array(texSize * valueTexHeight);
133202
133298
  const totalColors = new Uint8Array(texSize * colorTexHeight);
@@ -133994,7 +134090,7 @@ function normalizeCoordinateTransformations(coordinateTransformations, datasets)
133994
134090
  if (type2 === "sequence") {
133995
134091
  return normalizeCoordinateTransformations(transform2.transformations, datasets);
133996
134092
  }
133997
- console.warn(`Coordinate transformation type "${type2}" is not supported.`);
134093
+ log$5.warn(`Coordinate transformation type "${type2}" is not supported.`);
133998
134094
  }
133999
134095
  return transform2;
134000
134096
  });
@@ -134039,11 +134135,9 @@ class BoolArray {
134039
134135
  get byteLength() {
134040
134136
  return __privateGet(this, _bytes).byteLength;
134041
134137
  }
134042
- /** @type {ArrayBuffer} */
134043
134138
  get buffer() {
134044
134139
  return __privateGet(this, _bytes).buffer;
134045
134140
  }
134046
- /** @type {number} */
134047
134141
  get length() {
134048
134142
  return __privateGet(this, _bytes).length;
134049
134143
  }
@@ -134094,11 +134188,9 @@ class ByteStringArray {
134094
134188
  get byteLength() {
134095
134189
  return this._data.byteLength;
134096
134190
  }
134097
- /** @type {ArrayBuffer} */
134098
134191
  get buffer() {
134099
134192
  return this._data.buffer;
134100
134193
  }
134101
- /** @type {number} */
134102
134194
  get length() {
134103
134195
  return this.byteLength / this.BYTES_PER_ELEMENT;
134104
134196
  }
@@ -134155,11 +134247,9 @@ const _UnicodeStringArray = class {
134155
134247
  get byteOffset() {
134156
134248
  return __privateGet(this, _data).byteOffset;
134157
134249
  }
134158
- /** @type {ArrayBuffer} */
134159
134250
  get buffer() {
134160
134251
  return __privateGet(this, _data).buffer;
134161
134252
  }
134162
- /** @type {number} */
134163
134253
  get length() {
134164
134254
  return __privateGet(this, _data).length / this.chars;
134165
134255
  }
@@ -134210,53 +134300,43 @@ function byteswap_inplace(view, bytes_per_element2) {
134210
134300
  }
134211
134301
  }
134212
134302
  }
134213
- const CONSTRUCTORS = {
134214
- int8: Int8Array,
134215
- int16: Int16Array,
134216
- int32: Int32Array,
134217
- int64: globalThis.BigInt64Array,
134218
- uint8: Uint8Array,
134219
- uint16: Uint16Array,
134220
- uint32: Uint32Array,
134221
- uint64: globalThis.BigUint64Array,
134222
- float32: Float32Array,
134223
- float64: Float64Array,
134224
- bool: BoolArray
134225
- };
134226
- const V2_STRING_REGEX = /v2:([US])(\d+)/;
134227
134303
  function get_ctr(data_type) {
134228
134304
  if (data_type === "v2:object") {
134229
134305
  return globalThis.Array;
134230
134306
  }
134231
- let match = data_type.match(V2_STRING_REGEX);
134307
+ let match = data_type.match(/v2:([US])(\d+)/);
134232
134308
  if (match) {
134233
134309
  let [, kind, chars] = match;
134234
134310
  return (kind === "U" ? UnicodeStringArray : ByteStringArray).bind(null, Number(chars));
134235
134311
  }
134236
- let ctr = CONSTRUCTORS[data_type];
134237
- if (!ctr) {
134238
- throw new Error(`Unknown or unsupported data_type: ${data_type}`);
134239
- }
134312
+ let ctr = {
134313
+ int8: Int8Array,
134314
+ int16: Int16Array,
134315
+ int32: Int32Array,
134316
+ int64: globalThis.BigInt64Array,
134317
+ uint8: Uint8Array,
134318
+ uint16: Uint16Array,
134319
+ uint32: Uint32Array,
134320
+ uint64: globalThis.BigUint64Array,
134321
+ float16: globalThis.Float16Array,
134322
+ float32: Float32Array,
134323
+ float64: Float64Array,
134324
+ bool: BoolArray
134325
+ }[data_type];
134326
+ assert$1(ctr, `Unknown or unsupported data_type: ${data_type}`);
134240
134327
  return ctr;
134241
134328
  }
134242
134329
  function get_strides(shape, order) {
134243
- return (order === "C" ? row_major_stride : col_major_stride)(shape);
134244
- }
134245
- function row_major_stride(shape) {
134246
- const ndim = shape.length;
134247
- const stride = globalThis.Array(ndim);
134248
- for (let i2 = ndim - 1, step = 1; i2 >= 0; i2--) {
134249
- stride[i2] = step;
134250
- step *= shape[i2];
134330
+ const rank2 = shape.length;
134331
+ if (typeof order === "string") {
134332
+ order = order === "C" ? Array.from({ length: rank2 }, (_, i2) => i2) : Array.from({ length: rank2 }, (_, i2) => rank2 - 1 - i2);
134251
134333
  }
134252
- return stride;
134253
- }
134254
- function col_major_stride(shape) {
134255
- const ndim = shape.length;
134256
- const stride = globalThis.Array(ndim);
134257
- for (let i2 = 0, step = 1; i2 < ndim; i2++) {
134258
- stride[i2] = step;
134259
- step *= shape[i2];
134334
+ assert$1(rank2 === order.length, "Order length must match the number of dimensions.");
134335
+ let step = 1;
134336
+ let stride = new Array(rank2);
134337
+ for (let i2 = order.length - 1; i2 >= 0; i2--) {
134338
+ stride[order[i2]] = step;
134339
+ step *= shape[order[i2]];
134260
134340
  }
134261
134341
  return stride;
134262
134342
  }
@@ -134271,20 +134351,12 @@ function create_chunk_key_encoder({ name: name2, configuration }) {
134271
134351
  }
134272
134352
  throw new Error(`Unknown chunk key encoding: ${name2}`);
134273
134353
  }
134274
- function get_array_order(codecs) {
134275
- var _a3;
134276
- const maybe_transpose_codec = codecs.find((c) => c.name === "transpose");
134277
- return ((_a3 = maybe_transpose_codec == null ? void 0 : maybe_transpose_codec.configuration) == null ? void 0 : _a3.order) === "F" ? "F" : "C";
134278
- }
134279
- const endian_regex = /^([<|>])(.*)$/;
134280
134354
  function coerce_dtype(dtype) {
134281
134355
  if (dtype === "|O") {
134282
134356
  return { data_type: "v2:object" };
134283
134357
  }
134284
- let match = dtype.match(endian_regex);
134285
- if (!match) {
134286
- throw new Error(`Invalid dtype: ${dtype}`);
134287
- }
134358
+ let match = dtype.match(/^([<|>])(.*)$/);
134359
+ assert$1(match, `Invalid dtype: ${dtype}`);
134288
134360
  let [, endian, rest] = match;
134289
134361
  let data_type = {
134290
134362
  b1: "bool",
@@ -134296,12 +134368,11 @@ function coerce_dtype(dtype) {
134296
134368
  u4: "uint32",
134297
134369
  i8: "int64",
134298
134370
  u8: "uint64",
134371
+ f2: "float16",
134299
134372
  f4: "float32",
134300
134373
  f8: "float64"
134301
134374
  }[rest] ?? (rest.startsWith("S") || rest.startsWith("U") ? `v2:${rest}` : void 0);
134302
- if (!data_type) {
134303
- throw new Error(`Unsupported or unknown dtype: ${dtype}`);
134304
- }
134375
+ assert$1(data_type, `Unsupported or unknown dtype: ${dtype}`);
134305
134376
  if (endian === "|") {
134306
134377
  return { data_type };
134307
134378
  }
@@ -134379,6 +134450,40 @@ function ensure_correct_scalar(metadata) {
134379
134450
  }
134380
134451
  return metadata.fill_value;
134381
134452
  }
134453
+ function rethrow_unless(error2, ...errors) {
134454
+ if (!errors.some((ErrorClass) => error2 instanceof ErrorClass)) {
134455
+ throw error2;
134456
+ }
134457
+ }
134458
+ function assert$1(expression, msg = "") {
134459
+ if (!expression) {
134460
+ throw new Error(msg);
134461
+ }
134462
+ }
134463
+ class BitroundCodec {
134464
+ constructor(configuration, _meta2) {
134465
+ __publicField(this, "kind", "array_to_array");
134466
+ assert$1(configuration.keepbits >= 0, "keepbits must be zero or positive");
134467
+ }
134468
+ static fromConfig(configuration, meta2) {
134469
+ return new BitroundCodec(configuration, meta2);
134470
+ }
134471
+ /**
134472
+ * Encode a chunk of data with bit-rounding.
134473
+ * @param _arr - The chunk to encode
134474
+ */
134475
+ encode(_arr) {
134476
+ throw new Error("`BitroundCodec.encode` is not implemented. Please open an issue at https://github.com/manzt/zarrita.js/issues.");
134477
+ }
134478
+ /**
134479
+ * Decode a chunk of data (no-op).
134480
+ * @param arr - The chunk to decode
134481
+ * @returns The decoded chunk
134482
+ */
134483
+ decode(arr) {
134484
+ return arr;
134485
+ }
134486
+ }
134382
134487
  const LITTLE_ENDIAN_OS = system_is_little_endian();
134383
134488
  function system_is_little_endian() {
134384
134489
  const a2 = new Uint32Array([305419896]);
@@ -134394,7 +134499,7 @@ function bytes_per_element(TypedArray2) {
134394
134499
  const _BytesCodec = class {
134395
134500
  constructor(configuration, meta2) {
134396
134501
  __publicField(this, "kind", "array_to_bytes");
134397
- __privateAdd(this, _strides, void 0);
134502
+ __privateAdd(this, _stride, void 0);
134398
134503
  __privateAdd(this, _TypedArray, void 0);
134399
134504
  __privateAdd(this, _BYTES_PER_ELEMENT, void 0);
134400
134505
  __privateAdd(this, _shape, void 0);
@@ -134402,7 +134507,7 @@ const _BytesCodec = class {
134402
134507
  __privateSet(this, _endian, configuration == null ? void 0 : configuration.endian);
134403
134508
  __privateSet(this, _TypedArray, get_ctr(meta2.data_type));
134404
134509
  __privateSet(this, _shape, meta2.shape);
134405
- __privateSet(this, _strides, get_strides(meta2.shape, get_array_order(meta2.codecs)));
134510
+ __privateSet(this, _stride, get_strides(meta2.shape, "C"));
134406
134511
  const sample = new (__privateGet(this, _TypedArray))(0);
134407
134512
  __privateSet(this, _BYTES_PER_ELEMENT, sample.BYTES_PER_ELEMENT);
134408
134513
  }
@@ -134423,12 +134528,12 @@ const _BytesCodec = class {
134423
134528
  return {
134424
134529
  data: new (__privateGet(this, _TypedArray))(bytes.buffer, bytes.byteOffset, bytes.byteLength / __privateGet(this, _BYTES_PER_ELEMENT)),
134425
134530
  shape: __privateGet(this, _shape),
134426
- stride: __privateGet(this, _strides)
134531
+ stride: __privateGet(this, _stride)
134427
134532
  };
134428
134533
  }
134429
134534
  };
134430
134535
  let BytesCodec = _BytesCodec;
134431
- _strides = new WeakMap();
134536
+ _stride = new WeakMap();
134432
134537
  _TypedArray = new WeakMap();
134433
134538
  _BYTES_PER_ELEMENT = new WeakMap();
134434
134539
  _shape = new WeakMap();
@@ -134448,15 +134553,9 @@ class Crc32cCodec {
134448
134553
  }
134449
134554
  }
134450
134555
  function throw_on_nan_replacer(_key, value) {
134451
- if (Number.isNaN(value)) {
134452
- throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");
134453
- }
134454
- if (value === Number.POSITIVE_INFINITY) {
134455
- throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");
134456
- }
134457
- if (value === Number.NEGATIVE_INFINITY) {
134458
- throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
134459
- }
134556
+ assert$1(!Number.isNaN(value), "JsonCodec allow_nan is false but NaN was encountered during encoding.");
134557
+ assert$1(value !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding.");
134558
+ assert$1(value !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
134460
134559
  return value;
134461
134560
  }
134462
134561
  function sort_keys_replacer(_key, value) {
@@ -134498,13 +134597,9 @@ const _JsonCodec = class {
134498
134597
  }
134499
134598
  encode(buf) {
134500
134599
  const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = __privateGet(this, _encoder_config);
134501
- if (encoding !== "utf-8") {
134502
- throw new Error("JsonCodec does not yet support non-utf-8 encoding.");
134503
- }
134600
+ assert$1(encoding === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
134504
134601
  const replacer_functions = [];
134505
- if (!check_circular) {
134506
- throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");
134507
- }
134602
+ assert$1(check_circular, "JsonCodec does not yet support skipping the check for circular references during encoding.");
134508
134603
  if (!allow_nan) {
134509
134604
  replacer_functions.push(throw_on_nan_replacer);
134510
134605
  }
@@ -134536,15 +134631,11 @@ const _JsonCodec = class {
134536
134631
  }
134537
134632
  decode(bytes) {
134538
134633
  const { strict } = __privateGet(this, _decoder_config);
134539
- if (!strict) {
134540
- throw new Error("JsonCodec does not yet support non-strict decoding.");
134541
- }
134634
+ assert$1(strict, "JsonCodec does not yet support non-strict decoding.");
134542
134635
  const items = json_decode_object(bytes);
134543
134636
  const shape = items.pop();
134544
134637
  items.pop();
134545
- if (!shape) {
134546
- throw new Error("0D not implemented for JsonCodec.");
134547
- }
134638
+ assert$1(shape, "0D not implemented for JsonCodec.");
134548
134639
  const stride = get_strides(shape, "C");
134549
134640
  const data = items;
134550
134641
  return { data, shape, stride };
@@ -134611,39 +134702,72 @@ function convert_array_order(src, target) {
134611
134702
  }
134612
134703
  return out;
134613
134704
  }
134614
- function get_order(arr) {
134615
- if (!arr.stride)
134616
- return "C";
134617
- let row_major_strides = get_strides(arr.shape, "C");
134618
- return arr.stride.every((s2, i2) => s2 === row_major_strides[i2]) ? "C" : "F";
134705
+ function get_order(chunk) {
134706
+ let rank2 = chunk.shape.length;
134707
+ assert$1(rank2 === chunk.stride.length, "Shape and stride must have the same length.");
134708
+ return chunk.stride.map((s2, i2) => ({ stride: s2, index: i2 })).sort((a2, b) => b.stride - a2.stride).map((entry) => entry.index);
134619
134709
  }
134620
- class TransposeCodec {
134621
- constructor(configuration) {
134622
- __publicField(this, "configuration");
134710
+ function matches_order(chunk, target) {
134711
+ let source = get_order(chunk);
134712
+ assert$1(source.length === target.length, "Orders must match");
134713
+ return source.every((dim, i2) => dim === target[i2]);
134714
+ }
134715
+ const _TransposeCodec = class {
134716
+ constructor(configuration, meta2) {
134623
134717
  __publicField(this, "kind", "array_to_array");
134624
- this.configuration = configuration;
134718
+ __privateAdd(this, _order, void 0);
134719
+ __privateAdd(this, _inverseOrder, void 0);
134720
+ let value = configuration.order ?? "C";
134721
+ let rank2 = meta2.shape.length;
134722
+ let order = new Array(rank2);
134723
+ let inverseOrder = new Array(rank2);
134724
+ if (value === "C") {
134725
+ for (let i2 = 0; i2 < rank2; ++i2) {
134726
+ order[i2] = i2;
134727
+ inverseOrder[i2] = i2;
134728
+ }
134729
+ } else if (value === "F") {
134730
+ for (let i2 = 0; i2 < rank2; ++i2) {
134731
+ order[i2] = rank2 - i2 - 1;
134732
+ inverseOrder[i2] = rank2 - i2 - 1;
134733
+ }
134734
+ } else {
134735
+ order = value;
134736
+ order.forEach((x2, i2) => {
134737
+ assert$1(inverseOrder[x2] === void 0, `Invalid permutation: ${JSON.stringify(value)}`);
134738
+ inverseOrder[x2] = i2;
134739
+ });
134740
+ }
134741
+ __privateSet(this, _order, order);
134742
+ __privateSet(this, _inverseOrder, inverseOrder);
134625
134743
  }
134626
- static fromConfig(configuration) {
134627
- return new TransposeCodec(configuration);
134744
+ static fromConfig(configuration, meta2) {
134745
+ return new _TransposeCodec(configuration, meta2);
134628
134746
  }
134629
134747
  encode(arr) {
134630
- var _a3, _b2;
134631
- if (get_order(arr) === ((_a3 = this.configuration) == null ? void 0 : _a3.order)) {
134748
+ if (matches_order(arr, __privateGet(this, _inverseOrder))) {
134632
134749
  return arr;
134633
134750
  }
134634
- return convert_array_order(arr, ((_b2 = this.configuration) == null ? void 0 : _b2.order) ?? "C");
134751
+ return convert_array_order(arr, __privateGet(this, _inverseOrder));
134635
134752
  }
134636
134753
  decode(arr) {
134637
- return arr;
134754
+ return {
134755
+ data: arr.data,
134756
+ shape: arr.shape,
134757
+ stride: get_strides(arr.shape, __privateGet(this, _order))
134758
+ };
134638
134759
  }
134639
- }
134760
+ };
134761
+ let TransposeCodec = _TransposeCodec;
134762
+ _order = new WeakMap();
134763
+ _inverseOrder = new WeakMap();
134640
134764
  const _VLenUTF8 = class {
134641
134765
  constructor(shape) {
134642
134766
  __publicField(this, "kind", "array_to_bytes");
134643
134767
  __privateAdd(this, _shape2, void 0);
134644
- __privateAdd(this, _strides2, void 0);
134768
+ __privateAdd(this, _strides, void 0);
134645
134769
  __privateSet(this, _shape2, shape);
134646
- __privateSet(this, _strides2, get_strides(shape, "C"));
134770
+ __privateSet(this, _strides, get_strides(shape, "C"));
134647
134771
  }
134648
134772
  static fromConfig(_, meta2) {
134649
134773
  return new _VLenUTF8(meta2.shape);
@@ -134662,14 +134786,14 @@ const _VLenUTF8 = class {
134662
134786
  data[i2] = decoder.decode(bytes.buffer.slice(pos, pos + item_length));
134663
134787
  pos += item_length;
134664
134788
  }
134665
- return { data, shape: __privateGet(this, _shape2), stride: __privateGet(this, _strides2) };
134789
+ return { data, shape: __privateGet(this, _shape2), stride: __privateGet(this, _strides) };
134666
134790
  }
134667
134791
  };
134668
134792
  let VLenUTF8 = _VLenUTF8;
134669
134793
  _shape2 = new WeakMap();
134670
- _strides2 = new WeakMap();
134794
+ _strides = new WeakMap();
134671
134795
  function create_default_registry() {
134672
- return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-537fd004.js").then((m) => m.default)).set("gzip", () => import("./gzip-6a24f0fe.js").then((m) => m.default)).set("lz4", () => import("./lz4-bbd18009.js").then((m) => m.default)).set("zlib", () => import("./zlib-175cd38d.js").then((m) => m.default)).set("zstd", () => import("./zstd-ec5a40b8.js").then((m) => m.default)).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec);
134796
+ return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-537fd004.js").then((m) => m.default)).set("gzip", () => import("./gzip-6a24f0fe.js").then((m) => m.default)).set("lz4", () => import("./lz4-bbd18009.js").then((m) => m.default)).set("zlib", () => import("./zlib-175cd38d.js").then((m) => m.default)).set("zstd", () => import("./zstd-561fda0e.js").then((m) => m.default)).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec).set("bitround", () => BitroundCodec);
134673
134797
  }
134674
134798
  const registry = create_default_registry();
134675
134799
  function create_codec_pipeline(chunk_metadata) {
@@ -134705,9 +134829,7 @@ async function load_codecs(chunk_meta) {
134705
134829
  let promises = chunk_meta.codecs.map(async (meta2) => {
134706
134830
  var _a3;
134707
134831
  let Codec = await ((_a3 = registry.get(meta2.name)) == null ? void 0 : _a3());
134708
- if (!Codec) {
134709
- throw new Error(`Unknown codec: ${meta2.name}`);
134710
- }
134832
+ assert$1(Codec, `Unknown codec: ${meta2.name}`);
134711
134833
  return { Codec, meta: meta2 };
134712
134834
  });
134713
134835
  let array_to_array = [];
@@ -134727,9 +134849,7 @@ async function load_codecs(chunk_meta) {
134727
134849
  }
134728
134850
  }
134729
134851
  if (!array_to_bytes) {
134730
- if (!is_typed_array_like_meta(chunk_meta)) {
134731
- throw new Error(`Cannot encode ${chunk_meta.data_type} to bytes without a codec`);
134732
- }
134852
+ assert$1(is_typed_array_like_meta(chunk_meta), `Cannot encode ${chunk_meta.data_type} to bytes without a codec`);
134733
134853
  array_to_bytes = BytesCodec.fromConfig({ endian: "little" }, chunk_meta);
134734
134854
  }
134735
134855
  return { array_to_array, array_to_bytes, bytes_to_bytes };
@@ -134739,9 +134859,7 @@ function is_typed_array_like_meta(meta2) {
134739
134859
  }
134740
134860
  const MAX_BIG_UINT = 18446744073709551615n;
134741
134861
  function create_sharded_chunk_getter(location, shard_shape, encode_shard_key, sharding_config) {
134742
- if (location.store.getRange === void 0) {
134743
- throw new Error("Store does not support range requests");
134744
- }
134862
+ assert$1(location.store.getRange, "Store does not support range requests");
134745
134863
  let get_range = location.store.getRange.bind(location.store);
134746
134864
  let index_shape = shard_shape.map((d, i2) => d / sharding_config.chunk_shape[i2]);
134747
134865
  let index_codec = create_codec_pipeline({
@@ -134804,6 +134922,11 @@ class Group extends Location {
134804
134922
  }
134805
134923
  }
134806
134924
  _metadata = new WeakMap();
134925
+ function get_array_order(codecs) {
134926
+ var _a3;
134927
+ const maybe_transpose_codec = codecs.find((c) => c.name === "transpose");
134928
+ return ((_a3 = maybe_transpose_codec == null ? void 0 : maybe_transpose_codec.configuration) == null ? void 0 : _a3.order) ?? "C";
134929
+ }
134807
134930
  const CONTEXT_MARKER = Symbol("zarrita.context");
134808
134931
  function get_context(obj) {
134809
134932
  return obj[CONTEXT_MARKER];
@@ -134826,8 +134949,8 @@ function create_context(location, metadata) {
134826
134949
  shape: configuration.chunk_shape,
134827
134950
  codecs: configuration.codecs
134828
134951
  }),
134829
- get_strides(shape, order) {
134830
- return get_strides(shape, order ?? native_order2);
134952
+ get_strides(shape) {
134953
+ return get_strides(shape, native_order2);
134831
134954
  },
134832
134955
  get_chunk_bytes: create_sharded_chunk_getter(location, metadata.chunk_grid.configuration.chunk_shape, shared_context.encode_chunk_key, configuration)
134833
134956
  };
@@ -134842,8 +134965,8 @@ function create_context(location, metadata) {
134842
134965
  shape: metadata.chunk_grid.configuration.chunk_shape,
134843
134966
  codecs: metadata.codecs
134844
134967
  }),
134845
- get_strides(shape, order) {
134846
- return get_strides(shape, order ?? native_order);
134968
+ get_strides(shape) {
134969
+ return get_strides(shape, native_order);
134847
134970
  },
134848
134971
  async get_chunk_bytes(chunk_coords, options) {
134849
134972
  let chunk_key = shared_context.encode_chunk_key(chunk_coords);
@@ -134946,9 +135069,8 @@ async function open_v2(location, options = {}) {
134946
135069
  if (options.kind === "group")
134947
135070
  return open_group_v2(loc, attrs);
134948
135071
  return open_array_v2(loc, attrs).catch((err2) => {
134949
- if (err2 instanceof NodeNotFoundError)
134950
- return open_group_v2(loc, attrs);
134951
- throw err2;
135072
+ rethrow_unless(err2, NodeNotFoundError);
135073
+ return open_group_v2(loc, attrs);
134952
135074
  });
134953
135075
  }
134954
135076
  async function open_array_v2(location, attrs) {
@@ -135006,10 +135128,8 @@ async function open(location, options = {}) {
135006
135128
  let open_primary = version_max === "v2" ? open.v2 : open.v3;
135007
135129
  let open_secondary = version_max === "v2" ? open.v3 : open.v2;
135008
135130
  return open_primary(location, options).catch((err2) => {
135009
- if (err2 instanceof NodeNotFoundError) {
135010
- return open_secondary(location, options);
135011
- }
135012
- throw err2;
135131
+ rethrow_unless(err2, NodeNotFoundError);
135132
+ return open_secondary(location, options);
135013
135133
  });
135014
135134
  }
135015
135135
  open.v2 = open_v2;
@@ -135247,7 +135367,7 @@ async function get$1(arr, selection, opts, setter2) {
135247
135367
  shape: arr.shape,
135248
135368
  chunk_shape: arr.chunks
135249
135369
  });
135250
- let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a2, b) => a2 * b, 1)), indexer.shape, context.get_strides(indexer.shape, opts.order));
135370
+ let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a2, b) => a2 * b, 1)), indexer.shape, context.get_strides(indexer.shape));
135251
135371
  let queue = ((_a3 = opts.create_queue) == null ? void 0 : _a3.call(opts)) ?? create_queue();
135252
135372
  for (const { chunk_coords, mapping } of indexer) {
135253
135373
  queue.add(async () => {