@vitessce/json 3.6.18 → 3.7.0

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.
@@ -1,15 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __typeError = (msg) => {
3
- throw TypeError(msg);
4
- };
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
8
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
9
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
- var __privateSet = (obj, member, value, setter2) => (__accessCheck(obj, member, "write to private field"), setter2 ? setter2.call(obj, value) : member.set(obj, value), value);
11
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
- var _a2, _b, _overrides, _use_suffix_request, _FetchStore_instances, merge_init_fn, _bytes, _encoder, _data, _stride, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _encoder_config, _decoder_config, _order, _inverseOrder, _shape2, _strides, _metadata, _metadata2, _c;
13
1
  import "react";
14
2
  function _mergeNamespaces(n3, m) {
15
3
  for (var i2 = 0; i2 < m.length; i2++) {
@@ -1972,11 +1960,11 @@ class ZodType {
1972
1960
  throw result.error;
1973
1961
  }
1974
1962
  safeParse(data, params) {
1975
- var _a3;
1963
+ var _a2;
1976
1964
  const ctx = {
1977
1965
  common: {
1978
1966
  issues: [],
1979
- async: (_a3 = params === null || params === void 0 ? void 0 : params.async) !== null && _a3 !== void 0 ? _a3 : false,
1967
+ async: (_a2 = params === null || params === void 0 ? void 0 : params.async) !== null && _a2 !== void 0 ? _a2 : false,
1980
1968
  contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
1981
1969
  },
1982
1970
  path: (params === null || params === void 0 ? void 0 : params.path) || [],
@@ -2318,7 +2306,7 @@ class ZodString extends ZodType {
2318
2306
  } else if (check.kind === "url") {
2319
2307
  try {
2320
2308
  new URL(input.data);
2321
- } catch (_a3) {
2309
+ } catch (_a2) {
2322
2310
  ctx = this._getOrReturnCtx(input, ctx);
2323
2311
  addIssueToContext(ctx, {
2324
2312
  validation: "url",
@@ -2440,7 +2428,7 @@ class ZodString extends ZodType {
2440
2428
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
2441
2429
  }
2442
2430
  datetime(options) {
2443
- var _a3;
2431
+ var _a2;
2444
2432
  if (typeof options === "string") {
2445
2433
  return this._addCheck({
2446
2434
  kind: "datetime",
@@ -2452,7 +2440,7 @@ class ZodString extends ZodType {
2452
2440
  return this._addCheck({
2453
2441
  kind: "datetime",
2454
2442
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
2455
- offset: (_a3 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a3 !== void 0 ? _a3 : false,
2443
+ offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false,
2456
2444
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
2457
2445
  });
2458
2446
  }
@@ -2580,11 +2568,11 @@ class ZodString extends ZodType {
2580
2568
  }
2581
2569
  }
2582
2570
  ZodString.create = (params) => {
2583
- var _a3;
2571
+ var _a2;
2584
2572
  return new ZodString({
2585
2573
  checks: [],
2586
2574
  typeName: ZodFirstPartyTypeKind.ZodString,
2587
- coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
2575
+ coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
2588
2576
  ...processCreateParams(params)
2589
2577
  });
2590
2578
  };
@@ -2985,11 +2973,11 @@ class ZodBigInt extends ZodType {
2985
2973
  }
2986
2974
  }
2987
2975
  ZodBigInt.create = (params) => {
2988
- var _a3;
2976
+ var _a2;
2989
2977
  return new ZodBigInt({
2990
2978
  checks: [],
2991
2979
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
2992
- coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
2980
+ coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
2993
2981
  ...processCreateParams(params)
2994
2982
  });
2995
2983
  };
@@ -3494,8 +3482,8 @@ class ZodObject extends ZodType {
3494
3482
  unknownKeys: "strict",
3495
3483
  ...message !== void 0 ? {
3496
3484
  errorMap: (issue, ctx) => {
3497
- var _a3, _b2, _c2, _d;
3498
- const defaultError = (_c2 = (_b2 = (_a3 = this._def).errorMap) === null || _b2 === void 0 ? void 0 : _b2.call(_a3, issue, ctx).message) !== null && _c2 !== void 0 ? _c2 : ctx.defaultError;
3485
+ var _a2, _b, _c, _d;
3486
+ const defaultError = (_c = (_b = (_a2 = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a2, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
3499
3487
  if (issue.code === "unrecognized_keys")
3500
3488
  return {
3501
3489
  message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
@@ -4905,10 +4893,10 @@ ZodReadonly.create = (type, params) => {
4905
4893
  const custom = (check, params = {}, fatal) => {
4906
4894
  if (check)
4907
4895
  return ZodAny.create().superRefine((data, ctx) => {
4908
- var _a3, _b2;
4896
+ var _a2, _b;
4909
4897
  if (!check(data)) {
4910
4898
  const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
4911
- const _fatal = (_b2 = (_a3 = p.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
4899
+ const _fatal = (_b = (_a2 = p.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
4912
4900
  const p2 = typeof p === "string" ? { message: p } : p;
4913
4901
  ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
4914
4902
  }
@@ -5497,7 +5485,7 @@ function toFinite$1(value) {
5497
5485
  return value === 0 ? value : 0;
5498
5486
  }
5499
5487
  value = toNumber(value);
5500
- if (value === INFINITY || value === -Infinity) {
5488
+ if (value === INFINITY || value === -INFINITY) {
5501
5489
  var sign2 = value < 0 ? -1 : 1;
5502
5490
  return sign2 * MAX_INTEGER;
5503
5491
  }
@@ -6432,7 +6420,12 @@ function getAugmentedNamespace(n3) {
6432
6420
  var f2 = n3.default;
6433
6421
  if (typeof f2 == "function") {
6434
6422
  var a2 = function a3() {
6435
- if (this instanceof a3) {
6423
+ var isInstance = false;
6424
+ try {
6425
+ isInstance = this instanceof a3;
6426
+ } catch {
6427
+ }
6428
+ if (isInstance) {
6436
6429
  return Reflect.construct(f2, arguments, this.constructor);
6437
6430
  }
6438
6431
  return f2.apply(this, arguments);
@@ -7148,13 +7141,12 @@ function upgradeFrom0_1_0(config3, datasetUid = null) {
7148
7141
  };
7149
7142
  const layout = [];
7150
7143
  config3.staticLayout.forEach((componentDef) => {
7151
- var _a3, _b2, _c2;
7152
7144
  let newComponentDef = {
7153
7145
  ...componentDef,
7154
7146
  coordinationScopes: {}
7155
7147
  };
7156
7148
  if (componentDef.component === "scatterplot") {
7157
- if (((_a3 = componentDef.props) == null ? void 0 : _a3.mapping) && typeof componentDef.props.mapping === "string") {
7149
+ if (componentDef.props?.mapping && typeof componentDef.props.mapping === "string") {
7158
7150
  coordinationSpace.embeddingType[componentDef.props.mapping] = componentDef.props.mapping;
7159
7151
  newComponentDef = {
7160
7152
  ...newComponentDef,
@@ -7164,7 +7156,7 @@ function upgradeFrom0_1_0(config3, datasetUid = null) {
7164
7156
  }
7165
7157
  };
7166
7158
  }
7167
- if ((_b2 = componentDef.props) == null ? void 0 : _b2.view) {
7159
+ if (componentDef.props?.view) {
7168
7160
  const newScopeValues = upgradeReplaceViewProp("embedding", componentDef.props.view, coordinationSpace);
7169
7161
  newComponentDef = {
7170
7162
  ...newComponentDef,
@@ -7176,7 +7168,7 @@ function upgradeFrom0_1_0(config3, datasetUid = null) {
7176
7168
  }
7177
7169
  }
7178
7170
  if (componentDef.component === "spatial") {
7179
- if ((_c2 = componentDef == null ? void 0 : componentDef.props) == null ? void 0 : _c2.view) {
7171
+ if (componentDef?.props?.view) {
7180
7172
  const newScopeValues = upgradeReplaceViewProp("spatial", componentDef.props.view, coordinationSpace);
7181
7173
  newComponentDef = {
7182
7174
  ...newComponentDef,
@@ -7266,7 +7258,6 @@ function upgradeFrom1_0_0(config3) {
7266
7258
  };
7267
7259
  }
7268
7260
  function upgradeFrom1_0_1(config3) {
7269
- var _a3;
7270
7261
  const layout = config3.layout.map((component) => {
7271
7262
  const newComponent = { ...component };
7272
7263
  if (newComponent.component === "layerController") {
@@ -7278,9 +7269,8 @@ function upgradeFrom1_0_1(config3) {
7278
7269
  return newComponent;
7279
7270
  });
7280
7271
  const newConfig = cloneDeep(config3);
7281
- Object.keys(((_a3 = newConfig == null ? void 0 : newConfig.coordinationSpace) == null ? void 0 : _a3.spatialRasterLayers) || {}).forEach((key) => {
7282
- var _a4, _b2;
7283
- if ((_b2 = (_a4 = newConfig.coordinationSpace) == null ? void 0 : _a4.spatialRasterLayers) == null ? void 0 : _b2[key]) {
7272
+ Object.keys(newConfig?.coordinationSpace?.spatialRasterLayers || {}).forEach((key) => {
7273
+ if (newConfig.coordinationSpace?.spatialRasterLayers?.[key]) {
7284
7274
  newConfig.coordinationSpace.spatialRasterLayers[key].forEach((layer, index2) => {
7285
7275
  if (newConfig.coordinationSpace) {
7286
7276
  newConfig.coordinationSpace.spatialRasterLayers[key][index2].type = ["bitmask", "raster"].includes(layer.type) ? layer.type : "raster";
@@ -7421,7 +7411,7 @@ function upgradeFrom1_0_10(config3) {
7421
7411
  function upgradeFrom1_0_11(config3) {
7422
7412
  const newConfig = cloneDeep(config3);
7423
7413
  const { datasets, coordinationSpace } = newConfig;
7424
- if (coordinationSpace == null ? void 0 : coordinationSpace.embeddingType) {
7414
+ if (coordinationSpace?.embeddingType) {
7425
7415
  const embeddingTypes = Object.values(coordinationSpace.embeddingType);
7426
7416
  datasets.forEach((dataset, i2) => {
7427
7417
  const { files } = dataset;
@@ -7454,7 +7444,7 @@ function upgradeFrom1_0_12(config3) {
7454
7444
  if (options && "factors" in options && Array.isArray(options.factors)) {
7455
7445
  const obsLabelsTypeScopes = [];
7456
7446
  options.factors.forEach((olt) => {
7457
- const nextScope = getNextScope(Object.keys((coordinationSpace == null ? void 0 : coordinationSpace.obsLabelsType) || {}));
7447
+ const nextScope = getNextScope(Object.keys(coordinationSpace?.obsLabelsType || {}));
7458
7448
  newCoordinationSpace.obsLabelsType = {
7459
7449
  ...newCoordinationSpace.obsLabelsType,
7460
7450
  // Need to remove the obs/ prefix.
@@ -7468,8 +7458,7 @@ function upgradeFrom1_0_12(config3) {
7468
7458
  });
7469
7459
  });
7470
7460
  function getDatasetUidForView(viewDef) {
7471
- var _a3, _b2;
7472
- if (((_a3 = viewDef.coordinationScopes) == null ? void 0 : _a3.dataset) && typeof ((_b2 = viewDef.coordinationScopes) == null ? void 0 : _b2.dataset) === "string") {
7461
+ if (viewDef.coordinationScopes?.dataset && typeof viewDef.coordinationScopes?.dataset === "string") {
7473
7462
  return newCoordinationSpace.dataset[viewDef.coordinationScopes.dataset];
7474
7463
  }
7475
7464
  if (datasets.length > 0) {
@@ -7532,8 +7521,7 @@ function upgradeFrom1_0_14(config3) {
7532
7521
  };
7533
7522
  newLayout.forEach((viewDef) => {
7534
7523
  Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
7535
- var _a3;
7536
- if ((_a3 = viewDef.props) == null ? void 0 : _a3[oldProp]) {
7524
+ if (viewDef.props?.[oldProp]) {
7537
7525
  log$6.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
7538
7526
  }
7539
7527
  });
@@ -7550,7 +7538,7 @@ function upgradeFrom1_0_15(config3) {
7550
7538
  const newLayout = layout.map((view) => {
7551
7539
  const { coordinationScopes } = view;
7552
7540
  const newCoordinationScopes = {};
7553
- if ((coordinationScopes == null ? void 0 : coordinationScopes.dataset) && Array.isArray(coordinationScopes.dataset)) {
7541
+ if (coordinationScopes?.dataset && Array.isArray(coordinationScopes.dataset)) {
7554
7542
  const coordinationScopesBy = {
7555
7543
  dataset: {}
7556
7544
  };
@@ -10245,7 +10233,6 @@ class ObsSegmentationsJsonLoader extends JsonLoader {
10245
10233
  return this.cachedResult;
10246
10234
  }
10247
10235
  async load() {
10248
- var _a3;
10249
10236
  const payload = await super.load();
10250
10237
  const channelCoordination = [{
10251
10238
  // obsType: null,
@@ -10265,7 +10252,7 @@ class ObsSegmentationsJsonLoader extends JsonLoader {
10265
10252
  // spatialTargetT: imageWrapper.getDefaultTargetT(),
10266
10253
  segmentationLayer: CL([
10267
10254
  {
10268
- fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
10255
+ fileUid: this.coordinationValues?.fileUid || null,
10269
10256
  spatialLayerOpacity: 1,
10270
10257
  spatialLayerVisible: true,
10271
10258
  segmentationChannel: CL(channelCoordination)
@@ -17810,7 +17797,6 @@ class CellsJsonAsObsSegmentationsLoader extends JsonLoader {
17810
17797
  this.schema = cellsSchema;
17811
17798
  }
17812
17799
  loadFromCache(data) {
17813
- var _a3;
17814
17800
  if (this.cachedResult) {
17815
17801
  return this.cachedResult;
17816
17802
  }
@@ -17820,7 +17806,7 @@ class CellsJsonAsObsSegmentationsLoader extends JsonLoader {
17820
17806
  this.cachedResult = null;
17821
17807
  } else {
17822
17808
  let cellPolygons;
17823
- if (!Array.isArray(cellObjs[0].poly) || !((_a3 = cellObjs[0].poly) == null ? void 0 : _a3.length)) {
17809
+ if (!Array.isArray(cellObjs[0].poly) || !cellObjs[0].poly?.length) {
17824
17810
  const radius = 50;
17825
17811
  cellPolygons = cellObjs.map((cellObj) => square(cellObj.xy[0], cellObj.xy[1], radius));
17826
17812
  } else {
@@ -23945,7 +23931,7 @@ var EXP_LIMIT = 9e15, MAX_DIGITS = 1e9, NUMERALS = "0123456789abcdef", LN10 = "2
23945
23931
  // 0 to EXP_LIMIT
23946
23932
  // The minimum exponent value, beneath which underflow to zero occurs.
23947
23933
  // JavaScript numbers: -324 (5e-324)
23948
- minE: -9e15,
23934
+ minE: -EXP_LIMIT,
23949
23935
  // -1 to -EXP_LIMIT
23950
23936
  // The maximum exponent value, above which overflow to Infinity occurs.
23951
23937
  // JavaScript numbers: 308 (1.7976931348623157e+308)
@@ -25700,7 +25686,7 @@ function config2(obj) {
25700
25686
  0,
25701
25687
  8,
25702
25688
  "toExpNeg",
25703
- -9e15,
25689
+ -EXP_LIMIT,
25704
25690
  0,
25705
25691
  "toExpPos",
25706
25692
  0,
@@ -25709,7 +25695,7 @@ function config2(obj) {
25709
25695
  0,
25710
25696
  EXP_LIMIT,
25711
25697
  "minE",
25712
- -9e15,
25698
+ -EXP_LIMIT,
25713
25699
  0,
25714
25700
  "modulo",
25715
25701
  0,
@@ -26125,15 +26111,15 @@ function requireComplex() {
26125
26111
  throw SyntaxError("Invalid Param");
26126
26112
  };
26127
26113
  function logHypot(a2, b) {
26128
- var _a3 = Math.abs(a2);
26129
- var _b2 = Math.abs(b);
26114
+ var _a2 = Math.abs(a2);
26115
+ var _b = Math.abs(b);
26130
26116
  if (a2 === 0) {
26131
- return Math.log(_b2);
26117
+ return Math.log(_b);
26132
26118
  }
26133
26119
  if (b === 0) {
26134
- return Math.log(_a3);
26120
+ return Math.log(_a2);
26135
26121
  }
26136
- if (_a3 < 3e3 && _b2 < 3e3) {
26122
+ if (_a2 < 3e3 && _b < 3e3) {
26137
26123
  return Math.log(a2 * a2 + b * b) * 0.5;
26138
26124
  }
26139
26125
  a2 = a2 / 2;
@@ -29552,7 +29538,7 @@ var createMatrix = /* @__PURE__ */ factory(name$L, dependencies$E, (_ref) => {
29552
29538
  "string, string": function stringString(format2, datatype) {
29553
29539
  return _create([], format2, datatype);
29554
29540
  },
29555
- Array: function Array2(data) {
29541
+ Array: function Array3(data) {
29556
29542
  return _create(data);
29557
29543
  },
29558
29544
  Matrix: function Matrix6(data) {
@@ -31143,7 +31129,7 @@ var createIdentity = /* @__PURE__ */ factory(name$r, dependencies$k, (_ref) => {
31143
31129
  "number | BigNumber, number | BigNumber, string": function numberBigNumberNumberBigNumberString(rows, cols, format2) {
31144
31130
  return _identity(rows, cols, format2);
31145
31131
  },
31146
- Array: function Array2(size2) {
31132
+ Array: function Array3(size2) {
31147
31133
  return _identityVector(size2);
31148
31134
  },
31149
31135
  "Array, string": function ArrayString(size2, format2) {
@@ -35674,18 +35660,18 @@ var createDot = /* @__PURE__ */ factory(name$b, dependencies$4, (_ref) => {
35674
35660
  return c;
35675
35661
  }
35676
35662
  if (!aIsColumn && bIsColumn) {
35677
- var _c2 = mul2(conj2(adata[0]), bdata[0][0]);
35663
+ var _c = mul2(conj2(adata[0]), bdata[0][0]);
35678
35664
  for (var _i = 1; _i < N2; _i++) {
35679
- _c2 = add2(_c2, mul2(conj2(adata[_i]), bdata[_i][0]));
35665
+ _c = add2(_c, mul2(conj2(adata[_i]), bdata[_i][0]));
35680
35666
  }
35681
- return _c2;
35667
+ return _c;
35682
35668
  }
35683
35669
  if (aIsColumn && !bIsColumn) {
35684
- var _c22 = mul2(conj2(adata[0][0]), bdata[0]);
35670
+ var _c2 = mul2(conj2(adata[0][0]), bdata[0]);
35685
35671
  for (var _i2 = 1; _i2 < N2; _i2++) {
35686
- _c22 = add2(_c22, mul2(conj2(adata[_i2][0]), bdata[_i2]));
35672
+ _c2 = add2(_c2, mul2(conj2(adata[_i2][0]), bdata[_i2]));
35687
35673
  }
35688
- return _c22;
35674
+ return _c2;
35689
35675
  }
35690
35676
  if (aIsColumn && bIsColumn) {
35691
35677
  var _c3 = mul2(conj2(adata[0][0]), bdata[0][0]);
@@ -35754,7 +35740,7 @@ var createLup = /* @__PURE__ */ factory(name$a, dependencies$3, (_ref) => {
35754
35740
  SparseMatrix: function SparseMatrix3(m) {
35755
35741
  return _sparseLUP(m);
35756
35742
  },
35757
- Array: function Array2(a2) {
35743
+ Array: function Array3(a2) {
35758
35744
  var m = matrix2(a2);
35759
35745
  var r2 = _denseLUP(m);
35760
35746
  return {
@@ -50176,8 +50162,8 @@ function fitBounds(options) {
50176
50162
  } = options;
50177
50163
  const [[west, south], [east, north]] = bounds2;
50178
50164
  const padding = getPaddingObject(options.padding);
50179
- const nw = lngLatToWorld([west, clamp$1(north, -85.051129, MAX_LATITUDE)]);
50180
- const se = lngLatToWorld([east, clamp$1(south, -85.051129, MAX_LATITUDE)]);
50165
+ const nw = lngLatToWorld([west, clamp$1(north, -MAX_LATITUDE, MAX_LATITUDE)]);
50166
+ const se = lngLatToWorld([east, clamp$1(south, -MAX_LATITUDE, MAX_LATITUDE)]);
50181
50167
  const size2 = [Math.max(Math.abs(se[0] - nw[0]), minExtent), Math.max(Math.abs(se[1] - nw[1]), minExtent)];
50182
50168
  const targetSize = [width - padding.left - padding.right - Math.abs(offset[0]) * 2, height - padding.top - padding.bottom - Math.abs(offset[1]) * 2];
50183
50169
  assert$7(targetSize[0] > 0 && targetSize[1] > 0);
@@ -68527,7 +68513,7 @@ function requireTinySdf() {
68527
68513
  function edt1d(grid, offset, stride, length2, f2, v, z2) {
68528
68514
  var q, k, s2, r2;
68529
68515
  v[0] = 0;
68530
- z2[0] = -1e20;
68516
+ z2[0] = -INF;
68531
68517
  z2[1] = INF;
68532
68518
  for (q = 0; q < length2; q++) f2[q] = grid[offset + q * stride];
68533
68519
  for (q = 1, k = 0, s2 = 0; q < length2; q++) {
@@ -71687,51 +71673,51 @@ const ONE6TH = 1 / 6;
71687
71673
  const OFFSET = {
71688
71674
  N: [0, HALF],
71689
71675
  E: [HALF, 0],
71690
- S: [0, -0.5],
71691
- W: [-0.5, 0],
71676
+ S: [0, -HALF],
71677
+ W: [-HALF, 0],
71692
71678
  NE: [HALF, HALF],
71693
- NW: [-0.5, HALF],
71694
- SE: [HALF, -0.5],
71695
- SW: [-0.5, -0.5]
71679
+ NW: [-HALF, HALF],
71680
+ SE: [HALF, -HALF],
71681
+ SW: [-HALF, -HALF]
71696
71682
  };
71697
71683
  const SW_TRIANGLE = [OFFSET.W, OFFSET.SW, OFFSET.S];
71698
71684
  const SE_TRIANGLE = [OFFSET.S, OFFSET.SE, OFFSET.E];
71699
71685
  const NE_TRIANGLE = [OFFSET.E, OFFSET.NE, OFFSET.N];
71700
71686
  const NW_TRIANGLE = [OFFSET.NW, OFFSET.W, OFFSET.N];
71701
- const SW_TRAPEZOID = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5]];
71702
- const SE_TRAPEZOID = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH]];
71703
- const NE_TRAPEZOID = [[HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71704
- const NW_TRAPEZOID = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71687
+ const SW_TRAPEZOID = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF]];
71688
+ const SE_TRAPEZOID = [[-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH]];
71689
+ const NE_TRAPEZOID = [[HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
71690
+ const NW_TRAPEZOID = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
71705
71691
  const S_RECTANGLE = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E];
71706
71692
  const E_RECTANGLE = [OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
71707
71693
  const N_RECTANGLE = [OFFSET.NW, OFFSET.W, OFFSET.E, OFFSET.NE];
71708
71694
  const W_RECTANGLE = [OFFSET.NW, OFFSET.SW, OFFSET.S, OFFSET.N];
71709
- const EW_RECTANGEL = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [HALF, -0.16666666666666666], [HALF, ONE6TH]];
71710
- const SN_RECTANGEL = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71695
+ const EW_RECTANGEL = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [HALF, -ONE6TH], [HALF, ONE6TH]];
71696
+ const SN_RECTANGEL = [[-ONE6TH, -HALF], [ONE6TH, -HALF], [ONE6TH, HALF], [-ONE6TH, HALF]];
71711
71697
  const SQUARE = [OFFSET.NW, OFFSET.SW, OFFSET.SE, OFFSET.NE];
71712
71698
  const SW_PENTAGON = [OFFSET.NW, OFFSET.SW, OFFSET.SE, OFFSET.E, OFFSET.N];
71713
71699
  const SE_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.NE, OFFSET.N];
71714
71700
  const NE_PENTAGON = [OFFSET.NW, OFFSET.W, OFFSET.S, OFFSET.SE, OFFSET.NE];
71715
71701
  const NW_PENTAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, OFFSET.E, OFFSET.NE];
71716
- const NW_N_PENTAGON = [OFFSET.NW, OFFSET.W, [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
71717
- const NE_E_PENTAGON = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE, OFFSET.N];
71718
- const SE_S_PENTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.E];
71719
- const SW_W_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71720
- const NW_W_PENTAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.N];
71721
- const NE_N_PENTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.E, OFFSET.NE, OFFSET.N];
71722
- const SE_E_PENTAGON = [OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71723
- const SW_S_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH]];
71724
- const S_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71725
- const E_HEXAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
71726
- const N_HEXAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE];
71727
- const W_HEXAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
71702
+ const NW_N_PENTAGON = [OFFSET.NW, OFFSET.W, [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
71703
+ const NE_E_PENTAGON = [[-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE, OFFSET.N];
71704
+ const SE_S_PENTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.E];
71705
+ const SW_W_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [ONE6TH, HALF], [-ONE6TH, HALF]];
71706
+ const NW_W_PENTAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.N];
71707
+ const NE_N_PENTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.E, OFFSET.NE, OFFSET.N];
71708
+ const SE_E_PENTAGON = [OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
71709
+ const SW_S_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH]];
71710
+ const S_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
71711
+ const E_HEXAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
71712
+ const N_HEXAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE];
71713
+ const W_HEXAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
71728
71714
  const SW_NE_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, OFFSET.E, OFFSET.NE, OFFSET.N];
71729
71715
  const NW_SE_HEXAGON = [OFFSET.NW, OFFSET.W, OFFSET.S, OFFSET.SE, OFFSET.E, OFFSET.N];
71730
- const NE_HEPTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE, OFFSET.N];
71731
- const SW_HEPTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71732
- const NW_HEPTAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
71733
- const SE_HEPTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71734
- const OCTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71716
+ const NE_HEPTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE, OFFSET.N];
71717
+ const SW_HEPTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
71718
+ const NW_HEPTAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
71719
+ const SE_HEPTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
71720
+ const OCTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
71735
71721
  const ISOLINES_CODE_OFFSET_MAP = {
71736
71722
  0: [],
71737
71723
  1: [[OFFSET.W, OFFSET.S]],
@@ -72515,7 +72501,7 @@ function requireLong() {
72515
72501
  if (value >= TWO_PWR_64_DBL)
72516
72502
  return MAX_UNSIGNED_VALUE;
72517
72503
  } else {
72518
- if (value <= -9223372036854776e3)
72504
+ if (value <= -TWO_PWR_63_DBL)
72519
72505
  return MIN_VALUE;
72520
72506
  if (value + 1 >= TWO_PWR_63_DBL)
72521
72507
  return MAX_VALUE;
@@ -74131,7 +74117,7 @@ function getOSMTileIndices(viewport, maxZ, zRange, bounds2) {
74131
74117
  if (viewport instanceof WebMercatorViewport2 && viewport.subViewports && viewport.subViewports.length > 1) {
74132
74118
  traversalParams.offset = -1;
74133
74119
  while (root2.update(traversalParams)) {
74134
- if (--traversalParams.offset < -3) {
74120
+ if (--traversalParams.offset < -MAX_MAPS) {
74135
74121
  break;
74136
74122
  }
74137
74123
  }
@@ -77021,7 +77007,7 @@ var libh3 = function(libh32) {
77021
77007
  b[h >> 2] = 0;
77022
77008
  h = h + 4 | 0;
77023
77009
  } while ((h | 0) < (j | 0));
77024
- _b2(c, g3);
77010
+ _b(c, g3);
77025
77011
  h = g3;
77026
77012
  j = b[h >> 2] | 0;
77027
77013
  h = b[h + 4 >> 2] | 0;
@@ -77055,7 +77041,7 @@ var libh3 = function(libh32) {
77055
77041
  b[h >> 2] = 0;
77056
77042
  h = h + 4 | 0;
77057
77043
  } while ((h | 0) < (j | 0));
77058
- _b2(d, g3);
77044
+ _b(d, g3);
77059
77045
  j = g3;
77060
77046
  h = b[j >> 2] | 0;
77061
77047
  j = b[j + 4 >> 2] | 0;
@@ -77147,13 +77133,13 @@ var libh3 = function(libh32) {
77147
77133
  if (k < 0) {
77148
77134
  if (!(a3 & 1)) {
77149
77135
  m = (a3 | 0) / 2 | 0;
77150
- m = _c2(d | 0, ((d | 0) < 0) << 31 >> 31 | 0, m | 0, ((m | 0) < 0) << 31 >> 31 | 0) | 0;
77136
+ m = _c(d | 0, ((d | 0) < 0) << 31 >> 31 | 0, m | 0, ((m | 0) < 0) << 31 >> 31 | 0) | 0;
77151
77137
  d = ~~(+(d | 0) - (+(m >>> 0) + 4294967296 * +(G2() | 0)) * 2);
77152
77138
  b[c >> 2] = d;
77153
77139
  break;
77154
77140
  } else {
77155
77141
  m = (a3 + 1 | 0) / 2 | 0;
77156
- m = _c2(d | 0, ((d | 0) < 0) << 31 >> 31 | 0, m | 0, ((m | 0) < 0) << 31 >> 31 | 0) | 0;
77142
+ m = _c(d | 0, ((d | 0) < 0) << 31 >> 31 | 0, m | 0, ((m | 0) < 0) << 31 >> 31 | 0) | 0;
77157
77143
  d = ~~(+(d | 0) - ((+(m >>> 0) + 4294967296 * +(G2() | 0)) * 2 + 1));
77158
77144
  b[c >> 2] = d;
77159
77145
  break;
@@ -78196,7 +78182,7 @@ var libh3 = function(libh32) {
78196
78182
  S = k;
78197
78183
  return;
78198
78184
  }
78199
- function _a3(a3, c, d, f2, g3) {
78185
+ function _a2(a3, c, d, f2, g3) {
78200
78186
  a3 = a3 | 0;
78201
78187
  c = c | 0;
78202
78188
  d = d | 0;
@@ -78242,7 +78228,7 @@ var libh3 = function(libh32) {
78242
78228
  S = S + 16 | 0;
78243
78229
  f2 = e3;
78244
78230
  Da(a3 + 4 | 0, f2);
78245
- _a3(f2, b[a3 >> 2] | 0, c, 0, d);
78231
+ _a2(f2, b[a3 >> 2] | 0, c, 0, d);
78246
78232
  S = e3;
78247
78233
  return;
78248
78234
  }
@@ -78354,12 +78340,12 @@ var libh3 = function(libh32) {
78354
78340
  }
78355
78341
  }
78356
78342
  Gc(w3, y2, f2, a3, C4);
78357
- _a3(C4, b[v2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78343
+ _a2(C4, b[v2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78358
78344
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
78359
78345
  }
78360
78346
  if ((j | 0) < (n3 | 0)) {
78361
78347
  Da(t2, v2);
78362
- _a3(v2, b[F2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78348
+ _a2(v2, b[F2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78363
78349
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
78364
78350
  }
78365
78351
  b[E2 >> 2] = b[F2 >> 2];
@@ -78619,13 +78605,13 @@ var libh3 = function(libh32) {
78619
78605
  }
78620
78606
  Gc(A3, s3, f2, a3, w3);
78621
78607
  if (!(Hc(A3, w3) | 0) ? !(Hc(s3, w3) | 0) : 0) {
78622
- _a3(w3, b[x2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78608
+ _a2(w3, b[x2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78623
78609
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
78624
78610
  }
78625
78611
  }
78626
78612
  if ((j | 0) < (l2 | 0)) {
78627
78613
  Da(q2, A3);
78628
- _a3(A3, b[z3 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78614
+ _a2(A3, b[z3 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78629
78615
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
78630
78616
  }
78631
78617
  j = j + 1 | 0;
@@ -80953,7 +80939,7 @@ var libh3 = function(libh32) {
80953
80939
  function Zb() {
80954
80940
  return 12;
80955
80941
  }
80956
- function _b2(a3, c) {
80942
+ function _b(a3, c) {
80957
80943
  a3 = a3 | 0;
80958
80944
  c = c | 0;
80959
80945
  var d = 0, e3 = 0, f2 = 0, g3 = 0, h = 0, i2 = 0, j = 0;
@@ -84994,7 +84980,7 @@ var libh3 = function(libh32) {
84994
84980
  c = a3 + c >>> 0;
84995
84981
  return (F(b2 + d + (c >>> 0 < a3 >>> 0 | 0) >>> 0 | 0), c | 0) | 0;
84996
84982
  }
84997
- function _c2(a3, b2, c, d) {
84983
+ function _c(a3, b2, c, d) {
84998
84984
  a3 = a3 | 0;
84999
84985
  b2 = b2 | 0;
85000
84986
  c = c | 0;
@@ -85167,11 +85153,11 @@ var libh3 = function(libh32) {
85167
85153
  g3 = i2 | g3 << 1;
85168
85154
  e3 = a3 << 1 | e3 >>> 31 | 0;
85169
85155
  n3 = a3 >>> 31 | c << 1 | 0;
85170
- _c2(k | 0, d | 0, e3 | 0, n3 | 0) | 0;
85156
+ _c(k | 0, d | 0, e3 | 0, n3 | 0) | 0;
85171
85157
  p2 = G2() | 0;
85172
85158
  o2 = p2 >> 31 | ((p2 | 0) < 0 ? -1 : 0) << 1;
85173
85159
  i2 = o2 & 1;
85174
- a3 = _c2(e3 | 0, n3 | 0, o2 & m | 0, (((p2 | 0) < 0 ? -1 : 0) >> 31 | ((p2 | 0) < 0 ? -1 : 0) << 1) & l2 | 0) | 0;
85160
+ a3 = _c(e3 | 0, n3 | 0, o2 & m | 0, (((p2 | 0) < 0 ? -1 : 0) >> 31 | ((p2 | 0) < 0 ? -1 : 0) << 1) & l2 | 0) | 0;
85175
85161
  c = G2() | 0;
85176
85162
  h = h - 1 | 0;
85177
85163
  } while ((h | 0) != 0);
@@ -85398,7 +85384,7 @@ var libh3 = function(libh32) {
85398
85384
  _getH3UnidirectionalEdgeBoundary: gc,
85399
85385
  _getH3UnidirectionalEdgesFromHexagon: fc,
85400
85386
  _getOriginH3IndexFromUnidirectionalEdge: bc,
85401
- _getPentagonIndexes: _b2,
85387
+ _getPentagonIndexes: _b,
85402
85388
  _getRes0Indexes: va,
85403
85389
  _h3Distance: qc,
85404
85390
  _h3GetBaseCell: Ab,
@@ -85420,7 +85406,7 @@ var libh3 = function(libh32) {
85420
85406
  _hexAreaKm2: nb,
85421
85407
  _hexAreaM2: ob,
85422
85408
  _hexRing: ea,
85423
- _i64Subtract: _c2,
85409
+ _i64Subtract: _c,
85424
85410
  _kRing: $,
85425
85411
  _kRingDistances: aa,
85426
85412
  _llvm_minnum_f64: ed,
@@ -98966,10 +98952,10 @@ var _GeojsonEquality = class _GeojsonEquality2 {
98966
98952
  constructor(opts) {
98967
98953
  this.direction = false;
98968
98954
  this.compareProperties = true;
98969
- var _a3, _b2, _c2;
98970
- this.precision = 10 ** -((_a3 = opts == null ? void 0 : opts.precision) != null ? _a3 : 17);
98971
- this.direction = (_b2 = opts == null ? void 0 : opts.direction) != null ? _b2 : false;
98972
- this.compareProperties = (_c2 = opts == null ? void 0 : opts.compareProperties) != null ? _c2 : true;
98955
+ var _a2, _b, _c;
98956
+ this.precision = 10 ** -((_a2 = opts == null ? void 0 : opts.precision) != null ? _a2 : 17);
98957
+ this.direction = (_b = opts == null ? void 0 : opts.direction) != null ? _b : false;
98958
+ this.compareProperties = (_c = opts == null ? void 0 : opts.compareProperties) != null ? _c : true;
98973
98959
  }
98974
98960
  compare(g1, g2) {
98975
98961
  if (g1.type !== g2.type) {
@@ -110682,7 +110668,7 @@ var boundsStream$1 = {
110682
110668
  boundsStream$1.lineEnd = boundsLineEnd;
110683
110669
  if (areaRingSum$1 < 0) lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);
110684
110670
  else if (deltaSum > epsilon) phi1 = 90;
110685
- else if (deltaSum < -1e-6) phi0 = -90;
110671
+ else if (deltaSum < -epsilon) phi0 = -90;
110686
110672
  range$3[0] = lambda0$1, range$3[1] = lambda1;
110687
110673
  }
110688
110674
  };
@@ -111192,7 +111178,7 @@ function merge(arrays) {
111192
111178
  }
111193
111179
  return merged;
111194
111180
  }
111195
- var clipMax = 1e9, clipMin = -1e9;
111181
+ var clipMax = 1e9, clipMin = -clipMax;
111196
111182
  function clipExtent(x02, y02, x12, y12) {
111197
111183
  function visible(x, y) {
111198
111184
  return x02 <= x && x <= x12 && y02 <= y && y <= y12;
@@ -111346,7 +111332,7 @@ function polygonContains(polygon2, point2) {
111346
111332
  }
111347
111333
  }
111348
111334
  }
111349
- return (angle2 < -1e-6 || angle2 < epsilon && sum$1 < -1e-6) ^ winding & 1;
111335
+ return (angle2 < -epsilon || angle2 < epsilon && sum$1 < -epsilon) ^ winding & 1;
111350
111336
  }
111351
111337
  var lengthSum$1 = adder(), lambda0, sinPhi0, cosPhi0;
111352
111338
  var lengthStream$1 = {
@@ -113076,16 +113062,16 @@ function requirePolygonClipping_umd() {
113076
113062
  };
113077
113063
  Tree2.prototype.keys = function() {
113078
113064
  var keys2 = [];
113079
- this.forEach(function(_a3) {
113080
- var key = _a3.key;
113065
+ this.forEach(function(_a2) {
113066
+ var key = _a2.key;
113081
113067
  return keys2.push(key);
113082
113068
  });
113083
113069
  return keys2;
113084
113070
  };
113085
113071
  Tree2.prototype.values = function() {
113086
113072
  var values2 = [];
113087
- this.forEach(function(_a3) {
113088
- var data = _a3.data;
113073
+ this.forEach(function(_a2) {
113074
+ var data = _a2.data;
113089
113075
  return values2.push(data);
113090
113076
  });
113091
113077
  return values2;
@@ -113240,7 +113226,7 @@ function requirePolygonClipping_umd() {
113240
113226
  };
113241
113227
  Tree2.prototype.update = function(key, newKey, newData) {
113242
113228
  var comparator2 = this._comparator;
113243
- var _a3 = split(key, this._root, comparator2), left = _a3.left, right = _a3.right;
113229
+ var _a2 = split(key, this._root, comparator2), left = _a2.left, right = _a2.right;
113244
113230
  if (comparator2(key, newKey) < 0) {
113245
113231
  right = insert(newKey, newData, right, comparator2);
113246
113232
  } else {
@@ -114732,8 +114718,8 @@ function requireJs$j() {
114732
114718
  if (!featureCollection2 || featureCollection2.type !== "FeatureCollection") {
114733
114719
  throw new Error("Invalid input to " + name2 + ", FeatureCollection required");
114734
114720
  }
114735
- for (var _i = 0, _a3 = featureCollection2.features; _i < _a3.length; _i++) {
114736
- var feature2 = _a3[_i];
114721
+ for (var _i = 0, _a2 = featureCollection2.features; _i < _a2.length; _i++) {
114722
+ var feature2 = _a2[_i];
114737
114723
  if (!feature2 || feature2.type !== "Feature" || !feature2.geometry) {
114738
114724
  throw new Error("Invalid input to " + name2 + ", Feature with geometry required");
114739
114725
  }
@@ -116378,24 +116364,24 @@ function requireBignumber() {
116378
116364
  if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
116379
116365
  v = obj[p];
116380
116366
  if (v && v.pop) {
116381
- intCheck2(v[0], -1e9, 0, p);
116367
+ intCheck2(v[0], -MAX2, 0, p);
116382
116368
  intCheck2(v[1], 0, MAX2, p);
116383
116369
  TO_EXP_NEG = v[0];
116384
116370
  TO_EXP_POS = v[1];
116385
116371
  } else {
116386
- intCheck2(v, -1e9, MAX2, p);
116372
+ intCheck2(v, -MAX2, MAX2, p);
116387
116373
  TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
116388
116374
  }
116389
116375
  }
116390
116376
  if (obj.hasOwnProperty(p = "RANGE")) {
116391
116377
  v = obj[p];
116392
116378
  if (v && v.pop) {
116393
- intCheck2(v[0], -1e9, -1, p);
116379
+ intCheck2(v[0], -MAX2, -1, p);
116394
116380
  intCheck2(v[1], 1, MAX2, p);
116395
116381
  MIN_EXP = v[0];
116396
116382
  MAX_EXP = v[1];
116397
116383
  } else {
116398
- intCheck2(v, -1e9, MAX2, p);
116384
+ intCheck2(v, -MAX2, MAX2, p);
116399
116385
  if (v) {
116400
116386
  MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
116401
116387
  } else {
@@ -116465,7 +116451,7 @@ function requireBignumber() {
116465
116451
  if (!BigNumber3.DEBUG) return true;
116466
116452
  var i2, n3, c = v.c, e2 = v.e, s2 = v.s;
116467
116453
  out: if ({}.toString.call(c) == "[object Array]") {
116468
- if ((s2 === 1 || s2 === -1) && e2 >= -1e9 && e2 <= MAX2 && e2 === mathfloor2(e2)) {
116454
+ if ((s2 === 1 || s2 === -1) && e2 >= -MAX2 && e2 <= MAX2 && e2 === mathfloor2(e2)) {
116469
116455
  if (c[0] === 0) {
116470
116456
  if (e2 === 0 && c.length === 1) return true;
116471
116457
  break out;
@@ -117305,7 +117291,7 @@ function requireBignumber() {
117305
117291
  return n3;
117306
117292
  };
117307
117293
  P2.shiftedBy = function(k) {
117308
- intCheck2(k, -9007199254740991, MAX_SAFE_INTEGER2);
117294
+ intCheck2(k, -MAX_SAFE_INTEGER2, MAX_SAFE_INTEGER2);
117309
117295
  return this.times("1e" + k);
117310
117296
  };
117311
117297
  P2.squareRoot = P2.sqrt = function() {
@@ -117568,26 +117554,25 @@ function requireBignumber() {
117568
117554
  var cjs$9;
117569
117555
  var hasRequiredCjs$a;
117570
117556
  function requireCjs$a() {
117571
- var _a3, _b2, _c2, _d;
117572
117557
  if (hasRequiredCjs$a) return cjs$9;
117573
117558
  hasRequiredCjs$a = 1;
117574
- var __defProp3 = Object.defineProperty;
117559
+ var __defProp2 = Object.defineProperty;
117575
117560
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
117576
117561
  var __getOwnPropNames = Object.getOwnPropertyNames;
117577
117562
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
117578
117563
  var __export = (target, all) => {
117579
117564
  for (var name2 in all)
117580
- __defProp3(target, name2, { get: all[name2], enumerable: true });
117565
+ __defProp2(target, name2, { get: all[name2], enumerable: true });
117581
117566
  };
117582
117567
  var __copyProps = (to, from, except, desc) => {
117583
117568
  if (from && typeof from === "object" || typeof from === "function") {
117584
117569
  for (let key of __getOwnPropNames(from))
117585
117570
  if (!__hasOwnProp2.call(to, key) && key !== except)
117586
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
117571
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
117587
117572
  }
117588
117573
  return to;
117589
117574
  };
117590
- var __toCommonJS = (mod2) => __copyProps(__defProp3({}, "__esModule", { value: true }), mod2);
117575
+ var __toCommonJS = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2);
117591
117576
  var src_exports = {};
117592
117577
  __export(src_exports, {
117593
117578
  SplayTreeMap: () => SplayTreeMap,
@@ -117595,10 +117580,10 @@ function requireCjs$a() {
117595
117580
  });
117596
117581
  cjs$9 = __toCommonJS(src_exports);
117597
117582
  var SplayTreeNode2 = class {
117583
+ key;
117584
+ left = null;
117585
+ right = null;
117598
117586
  constructor(key) {
117599
- __publicField(this, "key");
117600
- __publicField(this, "left", null);
117601
- __publicField(this, "right", null);
117602
117587
  this.key = key;
117603
117588
  }
117604
117589
  };
@@ -117608,9 +117593,9 @@ function requireCjs$a() {
117608
117593
  }
117609
117594
  };
117610
117595
  var SplayTreeMapNode = class _SplayTreeMapNode extends SplayTreeNode2 {
117596
+ value;
117611
117597
  constructor(key, value) {
117612
117598
  super(key);
117613
- __publicField(this, "value");
117614
117599
  this.value = value;
117615
117600
  }
117616
117601
  replaceValue(value) {
@@ -117621,11 +117606,9 @@ function requireCjs$a() {
117621
117606
  }
117622
117607
  };
117623
117608
  var SplayTree2 = class {
117624
- constructor() {
117625
- __publicField(this, "size", 0);
117626
- __publicField(this, "modificationCount", 0);
117627
- __publicField(this, "splayCount", 0);
117628
- }
117609
+ size = 0;
117610
+ modificationCount = 0;
117611
+ splayCount = 0;
117629
117612
  splay(key) {
117630
117613
  const root2 = this.root;
117631
117614
  if (root2 == null) {
@@ -117810,12 +117793,11 @@ function requireCjs$a() {
117810
117793
  }
117811
117794
  };
117812
117795
  var SplayTreeMap = class extends SplayTree2 {
117796
+ root = null;
117797
+ compare;
117798
+ validKey;
117813
117799
  constructor(compare2, isValidKey) {
117814
117800
  super();
117815
- __publicField(this, "root", null);
117816
- __publicField(this, "compare");
117817
- __publicField(this, "validKey");
117818
- __publicField(this, _a3, "[object Map]");
117819
117801
  this.compare = compare2 ?? this.defaultCompare();
117820
117802
  this.validKey = isValidKey ?? ((a2) => a2 != null && a2 != void 0);
117821
117803
  }
@@ -117981,17 +117963,17 @@ function requireCjs$a() {
117981
117963
  entries() {
117982
117964
  return this[Symbol.iterator]();
117983
117965
  }
117984
- [(_b2 = Symbol.iterator, _a3 = Symbol.toStringTag, _b2)]() {
117966
+ [Symbol.iterator]() {
117985
117967
  return new SplayTreeMapEntryIterableIterator(this.wrap());
117986
117968
  }
117969
+ [Symbol.toStringTag] = "[object Map]";
117987
117970
  };
117988
117971
  var SplayTreeSet2 = class _SplayTreeSet2 extends SplayTree2 {
117972
+ root = null;
117973
+ compare;
117974
+ validKey;
117989
117975
  constructor(compare2, isValidKey) {
117990
117976
  super();
117991
- __publicField(this, "root", null);
117992
- __publicField(this, "compare");
117993
- __publicField(this, "validKey");
117994
- __publicField(this, _c2, "[object Set]");
117995
117977
  this.compare = compare2 ?? this.defaultCompare();
117996
117978
  this.validKey = isValidKey ?? ((v) => v != null && v != void 0);
117997
117979
  }
@@ -118158,16 +118140,17 @@ function requireCjs$a() {
118158
118140
  values() {
118159
118141
  return this[Symbol.iterator]();
118160
118142
  }
118161
- [(_d = Symbol.iterator, _c2 = Symbol.toStringTag, _d)]() {
118143
+ [Symbol.iterator]() {
118162
118144
  return new SplayTreeKeyIterableIterator2(this.wrap());
118163
118145
  }
118146
+ [Symbol.toStringTag] = "[object Set]";
118164
118147
  };
118165
118148
  var SplayTreeIterableIterator2 = class {
118149
+ tree;
118150
+ path = new Array();
118151
+ modificationCount = null;
118152
+ splayCount;
118166
118153
  constructor(tree) {
118167
- __publicField(this, "tree");
118168
- __publicField(this, "path", new Array());
118169
- __publicField(this, "modificationCount", null);
118170
- __publicField(this, "splayCount");
118171
118154
  this.tree = tree;
118172
118155
  this.splayCount = tree.getSplayCount();
118173
118156
  }
@@ -118286,20 +118269,20 @@ function requireCjs$9() {
118286
118269
  if (hasRequiredCjs$9) return cjs$8;
118287
118270
  hasRequiredCjs$9 = 1;
118288
118271
  var __create = Object.create;
118289
- var __defProp3 = Object.defineProperty;
118272
+ var __defProp2 = Object.defineProperty;
118290
118273
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
118291
118274
  var __getOwnPropNames = Object.getOwnPropertyNames;
118292
118275
  var __getProtoOf = Object.getPrototypeOf;
118293
118276
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
118294
118277
  var __export = (target, all) => {
118295
118278
  for (var name2 in all)
118296
- __defProp3(target, name2, { get: all[name2], enumerable: true });
118279
+ __defProp2(target, name2, { get: all[name2], enumerable: true });
118297
118280
  };
118298
118281
  var __copyProps = (to, from, except, desc) => {
118299
118282
  if (from && typeof from === "object" || typeof from === "function") {
118300
118283
  for (let key of __getOwnPropNames(from))
118301
118284
  if (!__hasOwnProp2.call(to, key) && key !== except)
118302
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
118285
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
118303
118286
  }
118304
118287
  return to;
118305
118288
  };
@@ -118308,10 +118291,10 @@ function requireCjs$9() {
118308
118291
  // file that has been converted to a CommonJS file using a Babel-
118309
118292
  // compatible transform (i.e. "__esModule" has not been set), then set
118310
118293
  // "default" to the CommonJS "module.exports" for node compatibility.
118311
- __defProp3(target, "default", { value: mod2, enumerable: true }),
118294
+ __defProp2(target, "default", { value: mod2, enumerable: true }),
118312
118295
  mod2
118313
118296
  ));
118314
- var __toCommonJS = (mod2) => __copyProps(__defProp3({}, "__esModule", { value: true }), mod2);
118297
+ var __toCommonJS = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2);
118315
118298
  var src_exports = {};
118316
118299
  __export(src_exports, {
118317
118300
  difference: () => difference,
@@ -118431,18 +118414,11 @@ function requireCjs$9() {
118431
118414
  return { x, y };
118432
118415
  };
118433
118416
  var SweepEvent2 = class _SweepEvent2 {
118434
- // Warning: 'point' input will be modified and re-used (for performance)
118435
- constructor(point2, isLeft) {
118436
- __publicField(this, "point");
118437
- __publicField(this, "isLeft");
118438
- __publicField(this, "segment");
118439
- __publicField(this, "otherSE");
118440
- __publicField(this, "consumedBy");
118441
- if (point2.events === void 0) point2.events = [this];
118442
- else point2.events.push(this);
118443
- this.point = point2;
118444
- this.isLeft = isLeft;
118445
- }
118417
+ point;
118418
+ isLeft;
118419
+ segment;
118420
+ otherSE;
118421
+ consumedBy;
118446
118422
  // for ordering sweep events in the sweep event queue
118447
118423
  static compare(a2, b) {
118448
118424
  const ptCmp = _SweepEvent2.comparePoints(a2.point, b.point);
@@ -118459,6 +118435,13 @@ function requireCjs$9() {
118459
118435
  if (aPt.y.isGreaterThan(bPt.y)) return 1;
118460
118436
  return 0;
118461
118437
  }
118438
+ // Warning: 'point' input will be modified and re-used (for performance)
118439
+ constructor(point2, isLeft) {
118440
+ if (point2.events === void 0) point2.events = [this];
118441
+ else point2.events.push(this);
118442
+ this.point = point2;
118443
+ this.isLeft = isLeft;
118444
+ }
118462
118445
  link(other) {
118463
118446
  if (other.point === this.point) {
118464
118447
  throw new Error("Tried to link already linked events");
@@ -118537,17 +118520,10 @@ function requireCjs$9() {
118537
118520
  }
118538
118521
  };
118539
118522
  var RingOut2 = class _RingOut2 {
118540
- constructor(events2) {
118541
- __publicField(this, "events");
118542
- __publicField(this, "poly");
118543
- __publicField(this, "_isExteriorRing");
118544
- __publicField(this, "_enclosingRing");
118545
- this.events = events2;
118546
- for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
118547
- events2[i2].segment.ringOut = this;
118548
- }
118549
- this.poly = null;
118550
- }
118523
+ events;
118524
+ poly;
118525
+ _isExteriorRing;
118526
+ _enclosingRing;
118551
118527
  /* Given the segments from the sweep line pass, compute & return a series
118552
118528
  * of closed rings from all the segments marked to be part of the result */
118553
118529
  static factory(allSegments) {
@@ -118606,6 +118582,13 @@ function requireCjs$9() {
118606
118582
  }
118607
118583
  return ringsOut;
118608
118584
  }
118585
+ constructor(events2) {
118586
+ this.events = events2;
118587
+ for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
118588
+ events2[i2].segment.ringOut = this;
118589
+ }
118590
+ this.poly = null;
118591
+ }
118609
118592
  getGeom() {
118610
118593
  let prevPt = this.events[0].point;
118611
118594
  const points = [prevPt];
@@ -118644,7 +118627,6 @@ function requireCjs$9() {
118644
118627
  }
118645
118628
  /* Returns the ring that encloses this one, if any */
118646
118629
  _calcEnclosingRing() {
118647
- var _a3, _b2;
118648
118630
  let leftMostEvt = this.events[0];
118649
118631
  for (let i2 = 1, iMax = this.events.length; i2 < iMax; i2++) {
118650
118632
  const evt = this.events[i2];
@@ -118656,9 +118638,9 @@ function requireCjs$9() {
118656
118638
  if (!prevSeg) return null;
118657
118639
  if (!prevPrevSeg) return prevSeg.ringOut;
118658
118640
  if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
118659
- if (((_a3 = prevPrevSeg.ringOut) == null ? void 0 : _a3.enclosingRing()) !== prevSeg.ringOut) {
118641
+ if (prevPrevSeg.ringOut?.enclosingRing() !== prevSeg.ringOut) {
118660
118642
  return prevSeg.ringOut;
118661
- } else return (_b2 = prevSeg.ringOut) == null ? void 0 : _b2.enclosingRing();
118643
+ } else return prevSeg.ringOut?.enclosingRing();
118662
118644
  }
118663
118645
  prevSeg = prevPrevSeg.prevInResult();
118664
118646
  prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
@@ -118666,9 +118648,9 @@ function requireCjs$9() {
118666
118648
  }
118667
118649
  };
118668
118650
  var PolyOut2 = class {
118651
+ exteriorRing;
118652
+ interiorRings;
118669
118653
  constructor(exteriorRing) {
118670
- __publicField(this, "exteriorRing");
118671
- __publicField(this, "interiorRings");
118672
118654
  this.exteriorRing = exteriorRing;
118673
118655
  exteriorRing.poly = this;
118674
118656
  this.interiorRings = [];
@@ -118690,9 +118672,9 @@ function requireCjs$9() {
118690
118672
  }
118691
118673
  };
118692
118674
  var MultiPolyOut2 = class {
118675
+ rings;
118676
+ polys;
118693
118677
  constructor(rings) {
118694
- __publicField(this, "rings");
118695
- __publicField(this, "polys");
118696
118678
  this.rings = rings;
118697
118679
  this.polys = this._composePolys(rings);
118698
118680
  }
@@ -118706,7 +118688,6 @@ function requireCjs$9() {
118706
118688
  return geom;
118707
118689
  }
118708
118690
  _composePolys(rings) {
118709
- var _a3;
118710
118691
  const polys = [];
118711
118692
  for (let i2 = 0, iMax = rings.length; i2 < iMax; i2++) {
118712
118693
  const ring = rings[i2];
@@ -118714,8 +118695,8 @@ function requireCjs$9() {
118714
118695
  if (ring.isExteriorRing()) polys.push(new PolyOut2(ring));
118715
118696
  else {
118716
118697
  const enclosingRing = ring.enclosingRing();
118717
- if (!(enclosingRing == null ? void 0 : enclosingRing.poly)) polys.push(new PolyOut2(enclosingRing));
118718
- (_a3 = enclosingRing == null ? void 0 : enclosingRing.poly) == null ? void 0 : _a3.addInterior(ring);
118698
+ if (!enclosingRing?.poly) polys.push(new PolyOut2(enclosingRing));
118699
+ enclosingRing?.poly?.addInterior(ring);
118719
118700
  }
118720
118701
  }
118721
118702
  return polys;
@@ -118723,10 +118704,10 @@ function requireCjs$9() {
118723
118704
  };
118724
118705
  var import_splaytree_ts2 = requireCjs$a();
118725
118706
  var SweepLine2 = class {
118707
+ queue;
118708
+ tree;
118709
+ segments;
118726
118710
  constructor(queue, comparator2 = Segment3.compare) {
118727
- __publicField(this, "queue");
118728
- __publicField(this, "tree");
118729
- __publicField(this, "segments");
118730
118711
  this.queue = queue;
118731
118712
  this.tree = new import_splaytree_ts2.SplayTreeSet(comparator2);
118732
118713
  this.segments = [];
@@ -118835,10 +118816,8 @@ function requireCjs$9() {
118835
118816
  }
118836
118817
  };
118837
118818
  var Operation2 = class {
118838
- constructor() {
118839
- __publicField(this, "type");
118840
- __publicField(this, "numMultiPolys");
118841
- }
118819
+ type;
118820
+ numMultiPolys;
118842
118821
  run(type, geom, moreGeoms) {
118843
118822
  operation2.type = type;
118844
118823
  const multipolys = [new MultiPolyIn2(geom, true)];
@@ -118898,31 +118877,18 @@ function requireCjs$9() {
118898
118877
  var operation_default2 = operation2;
118899
118878
  var segmentId2 = 0;
118900
118879
  var Segment3 = class _Segment2 {
118901
- /* Warning: a reference to ringWindings input will be stored,
118902
- * and possibly will be later modified */
118903
- constructor(leftSE, rightSE, rings, windings) {
118904
- __publicField(this, "id");
118905
- __publicField(this, "leftSE");
118906
- __publicField(this, "rightSE");
118907
- __publicField(this, "rings");
118908
- __publicField(this, "windings");
118909
- __publicField(this, "ringOut");
118910
- __publicField(this, "consumedBy");
118911
- __publicField(this, "prev");
118912
- __publicField(this, "_prevInResult");
118913
- __publicField(this, "_beforeState");
118914
- __publicField(this, "_afterState");
118915
- __publicField(this, "_isInResult");
118916
- this.id = ++segmentId2;
118917
- this.leftSE = leftSE;
118918
- leftSE.segment = this;
118919
- leftSE.otherSE = rightSE;
118920
- this.rightSE = rightSE;
118921
- rightSE.segment = this;
118922
- rightSE.otherSE = leftSE;
118923
- this.rings = rings;
118924
- this.windings = windings;
118925
- }
118880
+ id;
118881
+ leftSE;
118882
+ rightSE;
118883
+ rings;
118884
+ windings;
118885
+ ringOut;
118886
+ consumedBy;
118887
+ prev;
118888
+ _prevInResult;
118889
+ _beforeState;
118890
+ _afterState;
118891
+ _isInResult;
118926
118892
  /* This compare() function is for ordering segments in the sweep
118927
118893
  * line tree, and does so according to the following criteria:
118928
118894
  *
@@ -118994,6 +118960,19 @@ function requireCjs$9() {
118994
118960
  if (a2.id > b.id) return 1;
118995
118961
  return 0;
118996
118962
  }
118963
+ /* Warning: a reference to ringWindings input will be stored,
118964
+ * and possibly will be later modified */
118965
+ constructor(leftSE, rightSE, rings, windings) {
118966
+ this.id = ++segmentId2;
118967
+ this.leftSE = leftSE;
118968
+ leftSE.segment = this;
118969
+ leftSE.otherSE = rightSE;
118970
+ this.rightSE = rightSE;
118971
+ rightSE.segment = this;
118972
+ rightSE.otherSE = leftSE;
118973
+ this.rings = rings;
118974
+ this.windings = windings;
118975
+ }
118997
118976
  static fromRing(pt1, pt2, ring) {
118998
118977
  let leftPt, rightPt, winding;
118999
118978
  const cmpPts = SweepEvent2.comparePoints(pt1, pt2);
@@ -119294,11 +119273,11 @@ function requireCjs$9() {
119294
119273
  }
119295
119274
  };
119296
119275
  var RingIn2 = class {
119276
+ poly;
119277
+ isExterior;
119278
+ segments;
119279
+ bbox;
119297
119280
  constructor(geomRing, poly, isExterior) {
119298
- __publicField(this, "poly");
119299
- __publicField(this, "isExterior");
119300
- __publicField(this, "segments");
119301
- __publicField(this, "bbox");
119302
119281
  if (!Array.isArray(geomRing) || geomRing.length === 0) {
119303
119282
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
119304
119283
  }
@@ -119342,11 +119321,11 @@ function requireCjs$9() {
119342
119321
  }
119343
119322
  };
119344
119323
  var PolyIn2 = class {
119324
+ multiPoly;
119325
+ exteriorRing;
119326
+ interiorRings;
119327
+ bbox;
119345
119328
  constructor(geomPoly, multiPoly) {
119346
- __publicField(this, "multiPoly");
119347
- __publicField(this, "exteriorRing");
119348
- __publicField(this, "interiorRings");
119349
- __publicField(this, "bbox");
119350
119329
  if (!Array.isArray(geomPoly)) {
119351
119330
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
119352
119331
  }
@@ -119378,10 +119357,10 @@ function requireCjs$9() {
119378
119357
  }
119379
119358
  };
119380
119359
  var MultiPolyIn2 = class {
119360
+ isSubject;
119361
+ polys;
119362
+ bbox;
119381
119363
  constructor(geom, isSubject) {
119382
- __publicField(this, "isSubject");
119383
- __publicField(this, "polys");
119384
- __publicField(this, "bbox");
119385
119364
  if (!Array.isArray(geom)) {
119386
119365
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
119387
119366
  }
@@ -120292,9 +120271,9 @@ function requireUtils$2() {
120292
120271
  }
120293
120272
  break;
120294
120273
  case "MultiPolygon":
120295
- for (var _a3 = 0; _a3 < geometry2.coordinates.length; _a3++) {
120296
- for (var b = 0; b < geometry2.coordinates[_a3].length; b++) {
120297
- handles = handles.concat(getEditHandlesForCoordinates(geometry2.coordinates[_a3][b], [_a3, b], featureIndex, editHandleType));
120274
+ for (var _a2 = 0; _a2 < geometry2.coordinates.length; _a2++) {
120275
+ for (var b = 0; b < geometry2.coordinates[_a2].length; b++) {
120276
+ handles = handles.concat(getEditHandlesForCoordinates(geometry2.coordinates[_a2][b], [_a2, b], featureIndex, editHandleType));
120298
120277
  handles = handles.slice(0, -1);
120299
120278
  }
120300
120279
  }
@@ -121414,21 +121393,21 @@ function requireCjs$6() {
121414
121393
  if (hasRequiredCjs$6) return cjs$6;
121415
121394
  hasRequiredCjs$6 = 1;
121416
121395
  Object.defineProperty(cjs$6, "__esModule", { value: true });
121417
- var __defProp3 = Object.defineProperty;
121396
+ var __defProp2 = Object.defineProperty;
121418
121397
  var __defProps2 = Object.defineProperties;
121419
121398
  var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
121420
121399
  var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
121421
121400
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
121422
121401
  var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
121423
- var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
121402
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
121424
121403
  var __spreadValues2 = (a2, b) => {
121425
121404
  for (var prop in b || (b = {}))
121426
121405
  if (__hasOwnProp2.call(b, prop))
121427
- __defNormalProp3(a2, prop, b[prop]);
121406
+ __defNormalProp2(a2, prop, b[prop]);
121428
121407
  if (__getOwnPropSymbols2)
121429
121408
  for (var prop of __getOwnPropSymbols2(b)) {
121430
121409
  if (__propIsEnum2.call(b, prop))
121431
- __defNormalProp3(a2, prop, b[prop]);
121410
+ __defNormalProp2(a2, prop, b[prop]);
121432
121411
  }
121433
121412
  return a2;
121434
121413
  };
@@ -124454,9 +124433,9 @@ function requireExtrudeMode() {
124454
124433
  size2 = coordinates2[a2][b].length;
124455
124434
  }
124456
124435
  } else {
124457
- var _positionIndexes2 = _slicedToArray(positionIndexes, 1), _b2 = _positionIndexes2[0];
124458
- if (coordinates2.length && coordinates2[_b2].length) {
124459
- size2 = coordinates2[_b2].length;
124436
+ var _positionIndexes2 = _slicedToArray(positionIndexes, 1), _b = _positionIndexes2[0];
124437
+ if (coordinates2.length && coordinates2[_b].length) {
124438
+ size2 = coordinates2[_b].length;
124460
124439
  }
124461
124440
  }
124462
124441
  }
@@ -124525,9 +124504,9 @@ function requireExtrudeMode() {
124525
124504
  p1 = coordinates2[a2][b][c];
124526
124505
  }
124527
124506
  } else {
124528
- var _positionIndexes4 = _slicedToArray(positionIndexes, 2), _b2 = _positionIndexes4[0], _c2 = _positionIndexes4[1];
124507
+ var _positionIndexes4 = _slicedToArray(positionIndexes, 2), _b2 = _positionIndexes4[0], _c = _positionIndexes4[1];
124529
124508
  if (coordinates2.length && coordinates2[_b2].length) {
124530
- p1 = coordinates2[_b2][_c2];
124509
+ p1 = coordinates2[_b2][_c];
124531
124510
  }
124532
124511
  }
124533
124512
  }
@@ -135236,7 +135215,7 @@ class SelectionLayer extends CompositeLayer {
135236
135215
  obsLayers.forEach((obsLayer) => {
135237
135216
  const { getObsCoords, obsQuadTree, obsIndex, onSelect: layerOnSelect } = obsLayer;
135238
135217
  const pickingInfos = [];
135239
- obsQuadTree == null ? void 0 : obsQuadTree.visit((node2, x02, y02, x12, y12) => {
135218
+ obsQuadTree?.visit((node2, x02, y02, x12, y12) => {
135240
135219
  const nodePoints = [[[x02, y02], [x12, y02], [x12, y12], [x02, y12], [x02, y02]]];
135241
135220
  const nodePolygon = polygon(nodePoints);
135242
135221
  const nodePolygonContainsSelectedPolygon = booleanContains(nodePolygon, selectedPolygon);
@@ -135340,6 +135319,8 @@ const PIXELATED_TEXTURE_PARAMETERS = {
135340
135319
  [GL$1.TEXTURE_WRAP_T]: GL$1.CLAMP_TO_EDGE
135341
135320
  };
135342
135321
  const GLSL_COLORMAPS = [
135322
+ // NOTE: the ordering of these is important,
135323
+ // as the shader code in bitmask-layer-beta-shaders hardcodes their indices.
135343
135324
  "plasma",
135344
135325
  "viridis",
135345
135326
  "jet",
@@ -135821,13 +135802,12 @@ class HeatmapBitmapLayer extends BitmapLayer$1 {
135821
135802
  });
135822
135803
  }
135823
135804
  updateState(args) {
135824
- var _a3;
135825
135805
  super.updateState(args);
135826
135806
  this.loadTexture(this.props.image);
135827
135807
  const { props, oldProps } = args;
135828
135808
  if (props.colormap !== oldProps.colormap) {
135829
135809
  const { gl } = this.context;
135830
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
135810
+ this.state.model?.delete();
135831
135811
  this.state.model = this._getModel(gl);
135832
135812
  this.getAttributeManager().invalidateAll();
135833
135813
  }
@@ -136197,12 +136177,11 @@ class PaddedExpressionHeatmapBitmapLayer extends BitmapLayer$1 {
136197
136177
  });
136198
136178
  }
136199
136179
  updateState(args) {
136200
- var _a3;
136201
136180
  super.updateState(args);
136202
136181
  const { props, oldProps } = args;
136203
136182
  if (props.colormap !== oldProps.colormap) {
136204
136183
  const { gl } = this.context;
136205
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
136184
+ this.state.model?.delete();
136206
136185
  this.state.model = this._getModel(gl);
136207
136186
  this.getAttributeManager().invalidateAll();
136208
136187
  }
@@ -136316,21 +136295,20 @@ class ScaledExpressionExtension extends LayerExtension {
136316
136295
  };
136317
136296
  }
136318
136297
  updateState({ props, oldProps }) {
136319
- var _a3, _b2, _c2, _d;
136320
136298
  if (props.colormap !== oldProps.colormap) {
136321
136299
  const { gl } = this.context;
136322
136300
  if (this.state.model) {
136323
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
136301
+ this.state.model?.delete();
136324
136302
  this.state.model = this._getModel(gl);
136325
136303
  } else {
136326
136304
  if (this.state.models) {
136327
- (_b2 = this.state.models) == null ? void 0 : _b2.forEach((model) => model == null ? void 0 : model.delete());
136305
+ this.state.models?.forEach((model) => model?.delete());
136328
136306
  }
136329
136307
  if (this.state.topModel) {
136330
- (_c2 = this.state.topModel) == null ? void 0 : _c2.delete();
136308
+ this.state.topModel?.delete();
136331
136309
  }
136332
136310
  if (this.state.sideModel) {
136333
- (_d = this.state.sideModel) == null ? void 0 : _d.delete();
136311
+ this.state.sideModel?.delete();
136334
136312
  }
136335
136313
  if (this._getModels) {
136336
136314
  this.setState(this._getModels(this.context.gl));
@@ -136371,10 +136349,10 @@ class ScaledExpressionExtension extends LayerExtension {
136371
136349
  uColorScaleRange: [colorScaleLo, colorScaleHi],
136372
136350
  uIsExpressionMode: isExpressionMode
136373
136351
  };
136374
- model == null ? void 0 : model.setUniforms(uniforms);
136375
- models == null ? void 0 : models.forEach((m) => m.setUniforms(uniforms));
136376
- topModel == null ? void 0 : topModel.setUniforms(uniforms);
136377
- sideModel == null ? void 0 : sideModel.setUniforms(uniforms);
136352
+ model?.setUniforms(uniforms);
136353
+ models?.forEach((m) => m.setUniforms(uniforms));
136354
+ topModel?.setUniforms(uniforms);
136355
+ sideModel?.setUniforms(uniforms);
136378
136356
  }
136379
136357
  }
136380
136358
  ScaledExpressionExtension.extensionName = "ScaledExpressionExtension";
@@ -137113,22 +137091,22 @@ async function getDecoder(fileDirectory) {
137113
137091
  const Decoder = await importFn();
137114
137092
  return new Decoder(fileDirectory);
137115
137093
  }
137116
- addDecoder([void 0, 1], () => import("./raw-DTPVJ1o9.js").then((m) => m.default));
137117
- addDecoder(5, () => import("./lzw-CiXrXL8r.js").then((m) => m.default));
137094
+ addDecoder([void 0, 1], () => import("./raw-M4MNiZFn.js").then((m) => m.default));
137095
+ addDecoder(5, () => import("./lzw-Cbro5Fik.js").then((m) => m.default));
137118
137096
  addDecoder(6, () => {
137119
137097
  throw new Error("old style JPEG compression is not supported.");
137120
137098
  });
137121
- addDecoder(7, () => import("./jpeg-uLYxf0zU.js").then((m) => m.default));
137122
- addDecoder([8, 32946], () => import("./deflate-Dwj2TkFo.js").then((m) => m.default));
137123
- addDecoder(32773, () => import("./packbits-jRtcxRzM.js").then((m) => m.default));
137099
+ addDecoder(7, () => import("./jpeg-DBVO_XI5.js").then((m) => m.default));
137100
+ addDecoder([8, 32946], () => import("./deflate-489pvTIA.js").then((m) => m.default));
137101
+ addDecoder(32773, () => import("./packbits-DgDDmRs8.js").then((m) => m.default));
137124
137102
  addDecoder(
137125
137103
  34887,
137126
- () => import("./lerc-DgruiVGI.js").then(async (m) => {
137104
+ () => import("./lerc-BF7rOe-8.js").then(async (m) => {
137127
137105
  await m.zstd.init();
137128
137106
  return m;
137129
137107
  }).then((m) => m.default)
137130
137108
  );
137131
- addDecoder(50001, () => import("./webimage-CXJ7hRD-.js").then((m) => m.default));
137109
+ addDecoder(50001, () => import("./webimage-Cb33bXFe.js").then((m) => m.default));
137132
137110
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
137133
137111
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
137134
137112
  }
@@ -145317,9 +145295,8 @@ function isText(node2) {
145317
145295
  return node2.nodeType === 3;
145318
145296
  }
145319
145297
  function xmlToJson(xmlNode, options) {
145320
- var _a3;
145321
145298
  if (isText(xmlNode)) {
145322
- return ((_a3 = xmlNode.nodeValue) == null ? void 0 : _a3.trim()) ?? "";
145299
+ return xmlNode.nodeValue?.trim() ?? "";
145323
145300
  }
145324
145301
  if (xmlNode.childNodes.length === 0 && (!xmlNode.attributes || xmlNode.attributes.length === 0)) {
145325
145302
  return "";
@@ -145633,14 +145610,13 @@ class TiffPixelSource {
145633
145610
  return this._readRasters(image2, { window: window2, width, height, signal });
145634
145611
  }
145635
145612
  async _readRasters(image2, props) {
145636
- var _a3;
145637
145613
  const interleave = isInterleaved$2(this.shape);
145638
145614
  const raster = await image2.readRasters({
145639
145615
  interleave,
145640
145616
  ...props,
145641
145617
  pool: this.pool
145642
145618
  });
145643
- if ((_a3 = props == null ? void 0 : props.signal) == null ? void 0 : _a3.aborted) {
145619
+ if (props?.signal?.aborted) {
145644
145620
  throw SIGNAL_ABORTED;
145645
145621
  }
145646
145622
  const data = interleave ? raster : raster[0];
@@ -145913,10 +145889,10 @@ function getIndexer(labels) {
145913
145889
  return selection;
145914
145890
  };
145915
145891
  }
145916
- var __defProp2 = Object.defineProperty;
145917
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
145918
- var __publicField2 = (obj, key, value) => {
145919
- __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
145892
+ var __defProp = Object.defineProperty;
145893
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
145894
+ var __publicField = (obj, key, value) => {
145895
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
145920
145896
  return value;
145921
145897
  };
145922
145898
  const DTYPE_LOOKUP = {
@@ -145938,8 +145914,8 @@ class ZarrPixelSource {
145938
145914
  constructor(data, labels, tileSize) {
145939
145915
  this.labels = labels;
145940
145916
  this.tileSize = tileSize;
145941
- __publicField2(this, "_data");
145942
- __publicField2(this, "_indexer");
145917
+ __publicField(this, "_data");
145918
+ __publicField(this, "_indexer");
145943
145919
  this._indexer = getIndexer(labels);
145944
145920
  this._data = data;
145945
145921
  }
@@ -147509,8 +147485,7 @@ const defaultProps$4$1 = {
147509
147485
  };
147510
147486
  const AdditiveColormapExtension = class extends LayerExtension {
147511
147487
  getShaders() {
147512
- var _a3;
147513
- const name2 = ((_a3 = this == null ? void 0 : this.props) == null ? void 0 : _a3.colormap) || defaultProps$4$1.colormap.value;
147488
+ const name2 = this?.props?.colormap || defaultProps$4$1.colormap.value;
147514
147489
  const apply_cmap = cmaps[name2];
147515
147490
  if (!apply_cmap) {
147516
147491
  throw Error(`No colormap named ${name2} found in registry`);
@@ -147528,7 +147503,6 @@ const AdditiveColormapExtension = class extends LayerExtension {
147528
147503
  }
147529
147504
  }
147530
147505
  draw() {
147531
- var _a3;
147532
147506
  const {
147533
147507
  useTransparentColor = defaultProps$4$1.useTransparentColor.value,
147534
147508
  opacity = defaultProps$4$1.opacity.value
@@ -147537,7 +147511,7 @@ const AdditiveColormapExtension = class extends LayerExtension {
147537
147511
  opacity,
147538
147512
  useTransparentColor
147539
147513
  };
147540
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
147514
+ this.state.model?.setUniforms(uniforms);
147541
147515
  }
147542
147516
  };
147543
147517
  AdditiveColormapExtension.extensionName = "AdditiveColormapExtension";
@@ -147631,7 +147605,6 @@ const ColorPaletteExtension = class extends LayerExtension {
147631
147605
  };
147632
147606
  }
147633
147607
  draw() {
147634
- var _a3;
147635
147608
  const {
147636
147609
  colors,
147637
147610
  channelsVisible,
@@ -147649,7 +147622,7 @@ const ColorPaletteExtension = class extends LayerExtension {
147649
147622
  transparentColor: (transparentColor || [0, 0, 0]).map((i2) => i2 / 255),
147650
147623
  useTransparentColor: Boolean(useTransparentColor)
147651
147624
  };
147652
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
147625
+ this.state.model?.setUniforms(uniforms);
147653
147626
  }
147654
147627
  };
147655
147628
  ColorPaletteExtension.extensionName = "ColorPaletteExtension";
@@ -147798,7 +147771,6 @@ const LensExtension = class extends LayerExtension {
147798
147771
  this.setState({ onMouseMove, unprojectLensBounds: [0, 0, 0, 0] });
147799
147772
  }
147800
147773
  draw() {
147801
- var _a3;
147802
147774
  const { unprojectLensBounds = [0, 0, 0, 0] } = this.state;
147803
147775
  const {
147804
147776
  bounds: bounds2,
@@ -147832,15 +147804,14 @@ const LensExtension = class extends LayerExtension {
147832
147804
  lensBorderRadius,
147833
147805
  colors: paddedColors
147834
147806
  };
147835
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
147807
+ this.state.model?.setUniforms(uniforms);
147836
147808
  }
147837
147809
  finalizeState() {
147838
- var _a3, _b2, _c2;
147839
147810
  if (this.context.deck) {
147840
147811
  this.context.deck.eventManager.off({
147841
- pointermove: (_a3 = this.state) == null ? void 0 : _a3.onMouseMove,
147842
- pointerleave: (_b2 = this.state) == null ? void 0 : _b2.onMouseMove,
147843
- wheel: (_c2 = this.state) == null ? void 0 : _c2.onMouseMove
147812
+ pointermove: this.state?.onMouseMove,
147813
+ pointerleave: this.state?.onMouseMove,
147814
+ wheel: this.state?.onMouseMove
147844
147815
  });
147845
147816
  }
147846
147817
  }
@@ -147867,8 +147838,7 @@ const BaseExtension$1 = class BaseExtension extends LayerExtension {
147867
147838
  this.opts = this.opts || {};
147868
147839
  }
147869
147840
  getShaders() {
147870
- var _a3;
147871
- const name2 = ((_a3 = this == null ? void 0 : this.props) == null ? void 0 : _a3.colormap) || defaultProps$1$2.colormap.value;
147841
+ const name2 = this?.props?.colormap || defaultProps$1$2.colormap.value;
147872
147842
  const apply_cmap = cmaps[name2];
147873
147843
  return {
147874
147844
  ...super.getShaders(),
@@ -147976,7 +147946,6 @@ const BaseExtension2 = class extends LayerExtension {
147976
147946
  this.opts = this.opts || {};
147977
147947
  }
147978
147948
  draw() {
147979
- var _a3;
147980
147949
  const { colors, channelsVisible } = this.props;
147981
147950
  const paddedColors = padColors({
147982
147951
  channelsVisible: channelsVisible || this.selections.map(() => true),
@@ -147985,7 +147954,7 @@ const BaseExtension2 = class extends LayerExtension {
147985
147954
  const uniforms = {
147986
147955
  colors: paddedColors
147987
147956
  };
147988
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
147957
+ this.state.model?.setUniforms(uniforms);
147989
147958
  }
147990
147959
  };
147991
147960
  BaseExtension2.extensionName = "BaseExtension";
@@ -148124,9 +148093,8 @@ function padContrastLimits({
148124
148093
  return paddedContrastLimits;
148125
148094
  }
148126
148095
  function getPhysicalSizeScalingMatrix(loader) {
148127
- var _a3;
148128
- const { x, y, z: z2 } = ((_a3 = loader == null ? void 0 : loader.meta) == null ? void 0 : _a3.physicalSizes) ?? {};
148129
- if ((x == null ? void 0 : x.size) && (y == null ? void 0 : y.size) && (z2 == null ? void 0 : z2.size)) {
148096
+ const { x, y, z: z2 } = loader?.meta?.physicalSizes ?? {};
148097
+ if (x?.size && y?.size && z2?.size) {
148130
148098
  const min2 = Math.min(z2.size, x.size, y.size);
148131
148099
  const ratio = [x.size / min2, y.size / min2, z2.size / min2];
148132
148100
  return new Matrix4().scale(ratio);
@@ -148353,11 +148321,11 @@ const XRLayer = class extends Layer {
148353
148321
  }
148354
148322
  _isHookDefinedByExtensions(hookName) {
148355
148323
  const { extensions } = this.props;
148356
- return extensions == null ? void 0 : extensions.some((e2) => {
148324
+ return extensions?.some((e2) => {
148357
148325
  const shaders = e2.getShaders();
148358
148326
  const { inject: inject2 = {}, modules = [] } = shaders;
148359
148327
  const definesInjection = inject2[hookName];
148360
- const moduleDefinesInjection = modules.some((m) => m == null ? void 0 : m.inject[hookName]);
148328
+ const moduleDefinesInjection = modules.some((m) => m?.inject[hookName]);
148361
148329
  return definesInjection || moduleDefinesInjection;
148362
148330
  });
148363
148331
  }
@@ -148406,7 +148374,6 @@ const XRLayer = class extends Layer {
148406
148374
  * and loading any textures that need be loading.
148407
148375
  */
148408
148376
  updateState({ props, oldProps, changeFlags, ...rest }) {
148409
- var _a3, _b2;
148410
148377
  super.updateState({ props, oldProps, changeFlags, ...rest });
148411
148378
  if (changeFlags.extensionsChanged || props.interpolation !== oldProps.interpolation) {
148412
148379
  const { gl } = this.context;
@@ -148416,7 +148383,7 @@ const XRLayer = class extends Layer {
148416
148383
  this.setState({ model: this._getModel(gl) });
148417
148384
  this.getAttributeManager().invalidateAll();
148418
148385
  }
148419
- if (props.channelData !== oldProps.channelData && ((_a3 = props.channelData) == null ? void 0 : _a3.data) !== ((_b2 = oldProps.channelData) == null ? void 0 : _b2.data) || props.interpolation !== oldProps.interpolation) {
148386
+ if (props.channelData !== oldProps.channelData && props.channelData?.data !== oldProps.channelData?.data || props.interpolation !== oldProps.interpolation) {
148420
148387
  this.loadChannelTextures(props.channelData);
148421
148388
  }
148422
148389
  const attributeManager = this.getAttributeManager();
@@ -148515,7 +148482,6 @@ const XRLayer = class extends Layer {
148515
148482
  * This function creates textures from the data
148516
148483
  */
148517
148484
  dataToTexture(data, width, height) {
148518
- var _a3;
148519
148485
  const { interpolation } = this.props;
148520
148486
  const attrs = getRenderingAttrs$1(
148521
148487
  this.props.dtype,
@@ -148525,7 +148491,7 @@ const XRLayer = class extends Layer {
148525
148491
  return new Texture2D(this.context.gl, {
148526
148492
  width,
148527
148493
  height,
148528
- data: ((_a3 = attrs.cast) == null ? void 0 : _a3.call(attrs, data)) ?? data,
148494
+ data: attrs.cast?.(data) ?? data,
148529
148495
  // we don't want or need mimaps
148530
148496
  mipmaps: false,
148531
148497
  parameters: {
@@ -148784,11 +148750,10 @@ const ImageLayer = class extends CompositeLayer {
148784
148750
  const getRaster = (selection) => loader.getRaster({ selection, signal });
148785
148751
  const dataPromises = selections.map(getRaster);
148786
148752
  Promise.all(dataPromises).then((rasters) => {
148787
- var _a3, _b2;
148788
148753
  const raster = {
148789
148754
  data: rasters.map((d) => d.data),
148790
- width: (_a3 = rasters[0]) == null ? void 0 : _a3.width,
148791
- height: (_b2 = rasters[0]) == null ? void 0 : _b2.height
148755
+ width: rasters[0]?.width,
148756
+ height: rasters[0]?.height
148792
148757
  };
148793
148758
  if (isInterleaved$2(loader.shape)) {
148794
148759
  raster.data = raster.data[0];
@@ -149509,13 +149474,13 @@ const XR3DLayer = class extends Layer {
149509
149474
  }
149510
149475
  _isHookDefinedByExtensions(hookName) {
149511
149476
  const { extensions } = this.props;
149512
- return extensions == null ? void 0 : extensions.some((e2) => {
149477
+ return extensions?.some((e2) => {
149513
149478
  const shaders = e2.getShaders();
149514
149479
  if (shaders) {
149515
149480
  const { inject: inject2 = {}, modules = [] } = shaders;
149516
149481
  const definesInjection = inject2[hookName];
149517
149482
  const moduleDefinesInjection = modules.some(
149518
- (m) => m.inject && (m == null ? void 0 : m.inject[hookName])
149483
+ (m) => m.inject && m?.inject[hookName]
149519
149484
  );
149520
149485
  return definesInjection || moduleDefinesInjection;
149521
149486
  }
@@ -149560,7 +149525,6 @@ const XR3DLayer = class extends Layer {
149560
149525
  * and loading any textures that need be loading.
149561
149526
  */
149562
149527
  updateState({ props, oldProps, changeFlags }) {
149563
- var _a3, _b2;
149564
149528
  if (changeFlags.extensionsChanged || props.colormap !== oldProps.colormap || props.renderingMode !== oldProps.renderingMode || props.clippingPlanes.length !== oldProps.clippingPlanes.length) {
149565
149529
  const { gl } = this.context;
149566
149530
  if (this.state.model) {
@@ -149568,7 +149532,7 @@ const XR3DLayer = class extends Layer {
149568
149532
  }
149569
149533
  this.setState({ model: this._getModel(gl) });
149570
149534
  }
149571
- if (props.channelData && ((_a3 = props == null ? void 0 : props.channelData) == null ? void 0 : _a3.data) !== ((_b2 = oldProps == null ? void 0 : oldProps.channelData) == null ? void 0 : _b2.data)) {
149535
+ if (props.channelData && props?.channelData?.data !== oldProps?.channelData?.data) {
149572
149536
  this.loadTexture(props.channelData);
149573
149537
  }
149574
149538
  }
@@ -149689,13 +149653,12 @@ const XR3DLayer = class extends Layer {
149689
149653
  * This function creates textures from the data
149690
149654
  */
149691
149655
  dataToTexture(data, width, height, depth) {
149692
- var _a3;
149693
149656
  const attrs = getRenderingAttrs();
149694
149657
  const texture = new Texture3D(this.context.gl, {
149695
149658
  width,
149696
149659
  height,
149697
149660
  depth,
149698
- data: ((_a3 = attrs.cast) == null ? void 0 : _a3.call(attrs, data)) ?? data,
149661
+ data: attrs.cast?.(data) ?? data,
149699
149662
  // ? Seems to be a luma.gl bug. Looks like Texture2D is wrong or this is but these are flipped somewhere.
149700
149663
  format: attrs.dataFormat,
149701
149664
  dataFormat: attrs.format,
@@ -149868,15 +149831,14 @@ const VolumeLayer = class extends CompositeLayer {
149868
149831
  loader[resolution]
149869
149832
  );
149870
149833
  Promise.all(volumePromises).then((volumes) => {
149871
- var _a3, _b2, _c2;
149872
149834
  if (onViewportLoad) {
149873
149835
  onViewportLoad(volumes);
149874
149836
  }
149875
149837
  const volume = {
149876
149838
  data: volumes.map((d) => d.data),
149877
- width: (_a3 = volumes[0]) == null ? void 0 : _a3.width,
149878
- height: (_b2 = volumes[0]) == null ? void 0 : _b2.height,
149879
- depth: (_c2 = volumes[0]) == null ? void 0 : _c2.depth
149839
+ width: volumes[0]?.width,
149840
+ height: volumes[0]?.height,
149841
+ depth: volumes[0]?.depth
149880
149842
  };
149881
149843
  this.setState({
149882
149844
  ...volume,
@@ -150200,7 +150162,7 @@ uniform float channelOpacities[7];
150200
150162
  uniform bool channelIsStaticColorMode[7]; // TODO: should this be a single float?
150201
150163
  uniform bool channelIsSetColorMode[7]; // TODO: should this be a single float?
150202
150164
 
150203
- // TODO: can array of tuples/vec2 be used?
150165
+ uniform int channelColormapFuncIndices[7];
150204
150166
  uniform float channelColormapRangeStarts[7];
150205
150167
  uniform float channelColormapRangeEnds[7];
150206
150168
 
@@ -150266,7 +150228,30 @@ vec3 sampleAndGetData(sampler2D dataTex, vec2 coord, bool isFilled, float stroke
150266
150228
  return vec3(clampedSampledData * float(isOn), sampledData, float(isEdge));
150267
150229
  }
150268
150230
 
150269
- vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
150231
+ vec3 colormapFunc(float clampedScaledExpressionValue, int colormapIndex) {
150232
+ // Map indices of GLSL_COLORMAPS array to their function calls.
150233
+ // GLSL_COLORMAPS is defined in ./constants.js and needs to stay manually synced.
150234
+ // 0: 'plasma',
150235
+ // 1: 'viridis',
150236
+ // 2: 'jet',
150237
+ // 3: 'greys',
150238
+
150239
+ if (colormapIndex <= 0) {
150240
+ // This should also match -1, to account for a failed Array.indexOf lookup.
150241
+ return plasma(clampedScaledExpressionValue).rgb;
150242
+ }
150243
+ if (colormapIndex == 1) {
150244
+ return viridis(clampedScaledExpressionValue).rgb;
150245
+ }
150246
+ if (colormapIndex == 2) {
150247
+ return jet(clampedScaledExpressionValue).rgb;
150248
+ }
150249
+ if (colormapIndex == 3) {
150250
+ return greys(clampedScaledExpressionValue).rgb;
150251
+ }
150252
+ }
150253
+
150254
+ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, int colormapFuncIndex, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
150270
150255
  float clampedSampledDataAndIsOn = sampledDataAndIsEdge.x;
150271
150256
  float sampledData = sampledDataAndIsEdge.y;
150272
150257
  float isEdge = sampledDataAndIsEdge.z;
@@ -150310,7 +150295,7 @@ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channel
150310
150295
  }
150311
150296
 
150312
150297
 
150313
- vec4 sampledColor = (1. - (float(isStaticColorMode) + float(isSetColorMode))) * vec4(COLORMAP_FUNC(clamp(scaledExpressionValue, 0.0, 1.0)).rgb, channelOpacity) + float(isStaticColorMode) * vec4(channelColor.rgb, channelOpacity) + float(isSetColorMode) * vec4(setColor, channelOpacity);
150298
+ vec4 sampledColor = (1. - (float(isStaticColorMode) + float(isSetColorMode))) * vec4(colormapFunc(clamp(scaledExpressionValue, 0.0, 1.0), colormapFuncIndex).rgb, channelOpacity) + float(isStaticColorMode) * vec4(channelColor.rgb, channelOpacity) + float(isSetColorMode) * vec4(setColor, channelOpacity);
150314
150299
  // Only return a color if the data is non-zero.
150315
150300
 
150316
150301
  return clampedSampledDataAndIsOn * isEdge * sampledColor;
@@ -150326,15 +150311,15 @@ void main() {
150326
150311
  vec3 dat4 = sampleAndGetData(channel4, vTexCoord, channelsFilled[4], channelStrokeWidths[4], channelsVisible[4]);
150327
150312
  vec3 dat5 = sampleAndGetData(channel5, vTexCoord, channelsFilled[5], channelStrokeWidths[5], channelsVisible[5]);
150328
150313
  vec3 dat6 = sampleAndGetData(channel6, vTexCoord, channelsFilled[6], channelStrokeWidths[6], channelsVisible[6]);
150329
-
150330
- vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
150331
- vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
150332
- vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
150333
- vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
150334
- vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
150335
- vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
150336
- vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
150337
-
150314
+
150315
+ vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapFuncIndices[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
150316
+ vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapFuncIndices[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
150317
+ vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapFuncIndices[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
150318
+ vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapFuncIndices[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
150319
+ vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapFuncIndices[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
150320
+ vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapFuncIndices[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
150321
+ vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapFuncIndices[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
150322
+
150338
150323
  // If all of the channels are "empty", then discard this pixel so that it is not considered during picking.
150339
150324
  float emptyDat = 0.;
150340
150325
  if(dat0.x == emptyDat && dat1.x == emptyDat && dat2.x == emptyDat && dat3.x == emptyDat && dat4.x == emptyDat && dat5.x == emptyDat && dat6.x == emptyDat) {
@@ -150373,12 +150358,11 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
150373
150358
  let totalValuesLength = 0;
150374
150359
  let totalColorsLength = 0;
150375
150360
  channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
150376
- var _a3, _b2, _c2, _d;
150377
150361
  if (isSetColorMode) {
150378
- totalColorsLength += (((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.setColors) == null ? void 0 : _b2.length) ?? 0) * 3;
150379
- totalValuesLength += ((_c2 = setColorValues[channelIndex]) == null ? void 0 : _c2.obsIndex) ? max$1(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
150362
+ totalColorsLength += (setColorValues[channelIndex]?.setColors?.length ?? 0) * 3;
150363
+ totalValuesLength += setColorValues[channelIndex]?.obsIndex ? max$1(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
150380
150364
  } else {
150381
- totalValuesLength += multiMatrixObsIndex[channelIndex] ? max$1(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : ((_d = multiFeatureValues[channelIndex]) == null ? void 0 : _d.length) ?? 0;
150365
+ totalValuesLength += multiMatrixObsIndex[channelIndex] ? max$1(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : multiFeatureValues[channelIndex]?.length ?? 0;
150382
150366
  }
150383
150367
  });
150384
150368
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
@@ -150420,8 +150404,8 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
150420
150404
  }
150421
150405
  indicesOffsets.push(indexOffset);
150422
150406
  colorsOffsets.push(colorOffset);
150423
- indexOffset += (obsIndex == null ? void 0 : obsIndex.length) || 0;
150424
- colorOffset += (setColors == null ? void 0 : setColors.length) || 0;
150407
+ indexOffset += obsIndex?.length || 0;
150408
+ colorOffset += setColors?.length || 0;
150425
150409
  } else {
150426
150410
  const featureArr = multiFeatureValues[channelIndex] ?? [];
150427
150411
  const normalizedFeatureArr = normalize(featureArr);
@@ -150490,14 +150474,10 @@ const defaultProps$1 = {
150490
150474
  class BitmaskLayer2 extends XRLayer {
150491
150475
  // eslint-disable-next-line class-methods-use-this
150492
150476
  getShaders() {
150493
- const { colormap } = this.props;
150494
150477
  return {
150495
150478
  fs,
150496
150479
  vs,
150497
- modules: [project32, picking],
150498
- defines: {
150499
- [COLORMAP_SHADER_PLACEHOLDER]: GLSL_COLORMAPS.includes(colormap) ? colormap : GLSL_COLORMAP_DEFAULT
150500
- }
150480
+ modules: [project32, picking]
150501
150481
  };
150502
150482
  }
150503
150483
  /**
@@ -150556,8 +150536,6 @@ class BitmaskLayer2 extends XRLayer {
150556
150536
  channelOpacities,
150557
150537
  channelColors,
150558
150538
  channelsVisible,
150559
- // TODO: use `channelFeatureValueColormaps` in shader,
150560
- // figure out how to call multiple GLSL colormap functions
150561
150539
  channelFeatureValueColormaps,
150562
150540
  channelFeatureValueColormapRanges,
150563
150541
  channelIsStaticColorMode,
@@ -150618,14 +150596,20 @@ class BitmaskLayer2 extends XRLayer {
150618
150596
  // There are six texture entries on the shaders
150619
150597
  MAX_CHANNELS - channelStrokeWidths.length
150620
150598
  ),
150599
+ channelColormapFuncIndices: padWithDefault(
150600
+ channelFeatureValueColormaps.map((d) => GLSL_COLORMAPS.indexOf(d)),
150601
+ 0,
150602
+ // There are six texture entries on the shaders
150603
+ MAX_CHANNELS - channelFeatureValueColormaps.length
150604
+ ),
150621
150605
  channelColormapRangeStarts: padWithDefault(
150622
- channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[0]) || 0),
150606
+ channelFeatureValueColormapRanges.map((r2) => r2?.[0] || 0),
150623
150607
  0,
150624
150608
  // There are six texture entries on the shaders
150625
150609
  MAX_CHANNELS - channelFeatureValueColormapRanges.length
150626
150610
  ),
150627
150611
  channelColormapRangeEnds: padWithDefault(
150628
- channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[1]) || 1),
150612
+ channelFeatureValueColormapRanges.map((r2) => r2?.[1] || 1),
150629
150613
  1,
150630
150614
  // There are six texture entries on the shaders
150631
150615
  MAX_CHANNELS - channelFeatureValueColormapRanges.length
@@ -150891,24 +150875,24 @@ function clone(configObject) {
150891
150875
  if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
150892
150876
  v = obj[p];
150893
150877
  if (v && v.pop) {
150894
- intCheck(v[0], -1e9, 0, p);
150878
+ intCheck(v[0], -MAX, 0, p);
150895
150879
  intCheck(v[1], 0, MAX, p);
150896
150880
  TO_EXP_NEG = v[0];
150897
150881
  TO_EXP_POS = v[1];
150898
150882
  } else {
150899
- intCheck(v, -1e9, MAX, p);
150883
+ intCheck(v, -MAX, MAX, p);
150900
150884
  TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
150901
150885
  }
150902
150886
  }
150903
150887
  if (obj.hasOwnProperty(p = "RANGE")) {
150904
150888
  v = obj[p];
150905
150889
  if (v && v.pop) {
150906
- intCheck(v[0], -1e9, -1, p);
150890
+ intCheck(v[0], -MAX, -1, p);
150907
150891
  intCheck(v[1], 1, MAX, p);
150908
150892
  MIN_EXP = v[0];
150909
150893
  MAX_EXP = v[1];
150910
150894
  } else {
150911
- intCheck(v, -1e9, MAX, p);
150895
+ intCheck(v, -MAX, MAX, p);
150912
150896
  if (v) {
150913
150897
  MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
150914
150898
  } else {
@@ -150978,7 +150962,7 @@ function clone(configObject) {
150978
150962
  if (!BigNumber2.DEBUG) return true;
150979
150963
  var i2, n3, c = v.c, e2 = v.e, s2 = v.s;
150980
150964
  out: if ({}.toString.call(c) == "[object Array]") {
150981
- if ((s2 === 1 || s2 === -1) && e2 >= -1e9 && e2 <= MAX && e2 === mathfloor(e2)) {
150965
+ if ((s2 === 1 || s2 === -1) && e2 >= -MAX && e2 <= MAX && e2 === mathfloor(e2)) {
150982
150966
  if (c[0] === 0) {
150983
150967
  if (e2 === 0 && c.length === 1) return true;
150984
150968
  break out;
@@ -151818,7 +151802,7 @@ function clone(configObject) {
151818
151802
  return n3;
151819
151803
  };
151820
151804
  P2.shiftedBy = function(k) {
151821
- intCheck(k, -9007199254740991, MAX_SAFE_INTEGER);
151805
+ intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
151822
151806
  return this.times("1e" + k);
151823
151807
  };
151824
151808
  P2.squareRoot = P2.sqrt = function() {
@@ -152068,10 +152052,10 @@ function toFixedPoint(str, e2, z2) {
152068
152052
  }
152069
152053
  var BigNumber = clone();
152070
152054
  var SplayTreeNode = class {
152055
+ key;
152056
+ left = null;
152057
+ right = null;
152071
152058
  constructor(key) {
152072
- __publicField(this, "key");
152073
- __publicField(this, "left", null);
152074
- __publicField(this, "right", null);
152075
152059
  this.key = key;
152076
152060
  }
152077
152061
  };
@@ -152081,11 +152065,9 @@ var SplayTreeSetNode = class extends SplayTreeNode {
152081
152065
  }
152082
152066
  };
152083
152067
  var SplayTree = class {
152084
- constructor() {
152085
- __publicField(this, "size", 0);
152086
- __publicField(this, "modificationCount", 0);
152087
- __publicField(this, "splayCount", 0);
152088
- }
152068
+ size = 0;
152069
+ modificationCount = 0;
152070
+ splayCount = 0;
152089
152071
  splay(key) {
152090
152072
  const root2 = this.root;
152091
152073
  if (root2 == null) {
@@ -152270,12 +152252,11 @@ var SplayTree = class {
152270
152252
  }
152271
152253
  };
152272
152254
  var SplayTreeSet = class _SplayTreeSet extends SplayTree {
152255
+ root = null;
152256
+ compare;
152257
+ validKey;
152273
152258
  constructor(compare2, isValidKey) {
152274
152259
  super();
152275
- __publicField(this, "root", null);
152276
- __publicField(this, "compare");
152277
- __publicField(this, "validKey");
152278
- __publicField(this, _a2, "[object Set]");
152279
152260
  this.compare = compare2 ?? this.defaultCompare();
152280
152261
  this.validKey = isValidKey ?? ((v) => v != null && v != void 0);
152281
152262
  }
@@ -152442,16 +152423,17 @@ var SplayTreeSet = class _SplayTreeSet extends SplayTree {
152442
152423
  values() {
152443
152424
  return this[Symbol.iterator]();
152444
152425
  }
152445
- [(_b = Symbol.iterator, _a2 = Symbol.toStringTag, _b)]() {
152426
+ [Symbol.iterator]() {
152446
152427
  return new SplayTreeKeyIterableIterator(this.wrap());
152447
152428
  }
152429
+ [Symbol.toStringTag] = "[object Set]";
152448
152430
  };
152449
152431
  var SplayTreeIterableIterator = class {
152432
+ tree;
152433
+ path = new Array();
152434
+ modificationCount = null;
152435
+ splayCount;
152450
152436
  constructor(tree) {
152451
- __publicField(this, "tree");
152452
- __publicField(this, "path", new Array());
152453
- __publicField(this, "modificationCount", null);
152454
- __publicField(this, "splayCount");
152455
152437
  this.tree = tree;
152456
152438
  this.splayCount = tree.getSplayCount();
152457
152439
  }
@@ -152628,18 +152610,11 @@ var intersection = (pt1, v12, pt2, v2) => {
152628
152610
  return { x, y };
152629
152611
  };
152630
152612
  var SweepEvent = class _SweepEvent {
152631
- // Warning: 'point' input will be modified and re-used (for performance)
152632
- constructor(point2, isLeft) {
152633
- __publicField(this, "point");
152634
- __publicField(this, "isLeft");
152635
- __publicField(this, "segment");
152636
- __publicField(this, "otherSE");
152637
- __publicField(this, "consumedBy");
152638
- if (point2.events === void 0) point2.events = [this];
152639
- else point2.events.push(this);
152640
- this.point = point2;
152641
- this.isLeft = isLeft;
152642
- }
152613
+ point;
152614
+ isLeft;
152615
+ segment;
152616
+ otherSE;
152617
+ consumedBy;
152643
152618
  // for ordering sweep events in the sweep event queue
152644
152619
  static compare(a2, b) {
152645
152620
  const ptCmp = _SweepEvent.comparePoints(a2.point, b.point);
@@ -152656,6 +152631,13 @@ var SweepEvent = class _SweepEvent {
152656
152631
  if (aPt.y.isGreaterThan(bPt.y)) return 1;
152657
152632
  return 0;
152658
152633
  }
152634
+ // Warning: 'point' input will be modified and re-used (for performance)
152635
+ constructor(point2, isLeft) {
152636
+ if (point2.events === void 0) point2.events = [this];
152637
+ else point2.events.push(this);
152638
+ this.point = point2;
152639
+ this.isLeft = isLeft;
152640
+ }
152659
152641
  link(other) {
152660
152642
  if (other.point === this.point) {
152661
152643
  throw new Error("Tried to link already linked events");
@@ -152734,17 +152716,10 @@ var SweepEvent = class _SweepEvent {
152734
152716
  }
152735
152717
  };
152736
152718
  var RingOut = class _RingOut {
152737
- constructor(events2) {
152738
- __publicField(this, "events");
152739
- __publicField(this, "poly");
152740
- __publicField(this, "_isExteriorRing");
152741
- __publicField(this, "_enclosingRing");
152742
- this.events = events2;
152743
- for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
152744
- events2[i2].segment.ringOut = this;
152745
- }
152746
- this.poly = null;
152747
- }
152719
+ events;
152720
+ poly;
152721
+ _isExteriorRing;
152722
+ _enclosingRing;
152748
152723
  /* Given the segments from the sweep line pass, compute & return a series
152749
152724
  * of closed rings from all the segments marked to be part of the result */
152750
152725
  static factory(allSegments) {
@@ -152803,6 +152778,13 @@ var RingOut = class _RingOut {
152803
152778
  }
152804
152779
  return ringsOut;
152805
152780
  }
152781
+ constructor(events2) {
152782
+ this.events = events2;
152783
+ for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
152784
+ events2[i2].segment.ringOut = this;
152785
+ }
152786
+ this.poly = null;
152787
+ }
152806
152788
  getGeom() {
152807
152789
  let prevPt = this.events[0].point;
152808
152790
  const points = [prevPt];
@@ -152841,7 +152823,6 @@ var RingOut = class _RingOut {
152841
152823
  }
152842
152824
  /* Returns the ring that encloses this one, if any */
152843
152825
  _calcEnclosingRing() {
152844
- var _a3, _b2;
152845
152826
  let leftMostEvt = this.events[0];
152846
152827
  for (let i2 = 1, iMax = this.events.length; i2 < iMax; i2++) {
152847
152828
  const evt = this.events[i2];
@@ -152853,9 +152834,9 @@ var RingOut = class _RingOut {
152853
152834
  if (!prevSeg) return null;
152854
152835
  if (!prevPrevSeg) return prevSeg.ringOut;
152855
152836
  if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
152856
- if (((_a3 = prevPrevSeg.ringOut) == null ? void 0 : _a3.enclosingRing()) !== prevSeg.ringOut) {
152837
+ if (prevPrevSeg.ringOut?.enclosingRing() !== prevSeg.ringOut) {
152857
152838
  return prevSeg.ringOut;
152858
- } else return (_b2 = prevSeg.ringOut) == null ? void 0 : _b2.enclosingRing();
152839
+ } else return prevSeg.ringOut?.enclosingRing();
152859
152840
  }
152860
152841
  prevSeg = prevPrevSeg.prevInResult();
152861
152842
  prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
@@ -152863,9 +152844,9 @@ var RingOut = class _RingOut {
152863
152844
  }
152864
152845
  };
152865
152846
  var PolyOut = class {
152847
+ exteriorRing;
152848
+ interiorRings;
152866
152849
  constructor(exteriorRing) {
152867
- __publicField(this, "exteriorRing");
152868
- __publicField(this, "interiorRings");
152869
152850
  this.exteriorRing = exteriorRing;
152870
152851
  exteriorRing.poly = this;
152871
152852
  this.interiorRings = [];
@@ -152887,9 +152868,9 @@ var PolyOut = class {
152887
152868
  }
152888
152869
  };
152889
152870
  var MultiPolyOut = class {
152871
+ rings;
152872
+ polys;
152890
152873
  constructor(rings) {
152891
- __publicField(this, "rings");
152892
- __publicField(this, "polys");
152893
152874
  this.rings = rings;
152894
152875
  this.polys = this._composePolys(rings);
152895
152876
  }
@@ -152903,7 +152884,6 @@ var MultiPolyOut = class {
152903
152884
  return geom;
152904
152885
  }
152905
152886
  _composePolys(rings) {
152906
- var _a3;
152907
152887
  const polys = [];
152908
152888
  for (let i2 = 0, iMax = rings.length; i2 < iMax; i2++) {
152909
152889
  const ring = rings[i2];
@@ -152911,18 +152891,18 @@ var MultiPolyOut = class {
152911
152891
  if (ring.isExteriorRing()) polys.push(new PolyOut(ring));
152912
152892
  else {
152913
152893
  const enclosingRing = ring.enclosingRing();
152914
- if (!(enclosingRing == null ? void 0 : enclosingRing.poly)) polys.push(new PolyOut(enclosingRing));
152915
- (_a3 = enclosingRing == null ? void 0 : enclosingRing.poly) == null ? void 0 : _a3.addInterior(ring);
152894
+ if (!enclosingRing?.poly) polys.push(new PolyOut(enclosingRing));
152895
+ enclosingRing?.poly?.addInterior(ring);
152916
152896
  }
152917
152897
  }
152918
152898
  return polys;
152919
152899
  }
152920
152900
  };
152921
152901
  var SweepLine = class {
152902
+ queue;
152903
+ tree;
152904
+ segments;
152922
152905
  constructor(queue, comparator2 = Segment2.compare) {
152923
- __publicField(this, "queue");
152924
- __publicField(this, "tree");
152925
- __publicField(this, "segments");
152926
152906
  this.queue = queue;
152927
152907
  this.tree = new SplayTreeSet(comparator2);
152928
152908
  this.segments = [];
@@ -153031,10 +153011,8 @@ var SweepLine = class {
153031
153011
  }
153032
153012
  };
153033
153013
  var Operation = class {
153034
- constructor() {
153035
- __publicField(this, "type");
153036
- __publicField(this, "numMultiPolys");
153037
- }
153014
+ type;
153015
+ numMultiPolys;
153038
153016
  run(type, geom, moreGeoms) {
153039
153017
  operation.type = type;
153040
153018
  const multipolys = [new MultiPolyIn(geom, true)];
@@ -153094,31 +153072,18 @@ var operation = new Operation();
153094
153072
  var operation_default = operation;
153095
153073
  var segmentId = 0;
153096
153074
  var Segment2 = class _Segment {
153097
- /* Warning: a reference to ringWindings input will be stored,
153098
- * and possibly will be later modified */
153099
- constructor(leftSE, rightSE, rings, windings) {
153100
- __publicField(this, "id");
153101
- __publicField(this, "leftSE");
153102
- __publicField(this, "rightSE");
153103
- __publicField(this, "rings");
153104
- __publicField(this, "windings");
153105
- __publicField(this, "ringOut");
153106
- __publicField(this, "consumedBy");
153107
- __publicField(this, "prev");
153108
- __publicField(this, "_prevInResult");
153109
- __publicField(this, "_beforeState");
153110
- __publicField(this, "_afterState");
153111
- __publicField(this, "_isInResult");
153112
- this.id = ++segmentId;
153113
- this.leftSE = leftSE;
153114
- leftSE.segment = this;
153115
- leftSE.otherSE = rightSE;
153116
- this.rightSE = rightSE;
153117
- rightSE.segment = this;
153118
- rightSE.otherSE = leftSE;
153119
- this.rings = rings;
153120
- this.windings = windings;
153121
- }
153075
+ id;
153076
+ leftSE;
153077
+ rightSE;
153078
+ rings;
153079
+ windings;
153080
+ ringOut;
153081
+ consumedBy;
153082
+ prev;
153083
+ _prevInResult;
153084
+ _beforeState;
153085
+ _afterState;
153086
+ _isInResult;
153122
153087
  /* This compare() function is for ordering segments in the sweep
153123
153088
  * line tree, and does so according to the following criteria:
153124
153089
  *
@@ -153190,6 +153155,19 @@ var Segment2 = class _Segment {
153190
153155
  if (a2.id > b.id) return 1;
153191
153156
  return 0;
153192
153157
  }
153158
+ /* Warning: a reference to ringWindings input will be stored,
153159
+ * and possibly will be later modified */
153160
+ constructor(leftSE, rightSE, rings, windings) {
153161
+ this.id = ++segmentId;
153162
+ this.leftSE = leftSE;
153163
+ leftSE.segment = this;
153164
+ leftSE.otherSE = rightSE;
153165
+ this.rightSE = rightSE;
153166
+ rightSE.segment = this;
153167
+ rightSE.otherSE = leftSE;
153168
+ this.rings = rings;
153169
+ this.windings = windings;
153170
+ }
153193
153171
  static fromRing(pt1, pt2, ring) {
153194
153172
  let leftPt, rightPt, winding;
153195
153173
  const cmpPts = SweepEvent.comparePoints(pt1, pt2);
@@ -153490,11 +153468,11 @@ var Segment2 = class _Segment {
153490
153468
  }
153491
153469
  };
153492
153470
  var RingIn = class {
153471
+ poly;
153472
+ isExterior;
153473
+ segments;
153474
+ bbox;
153493
153475
  constructor(geomRing, poly, isExterior) {
153494
- __publicField(this, "poly");
153495
- __publicField(this, "isExterior");
153496
- __publicField(this, "segments");
153497
- __publicField(this, "bbox");
153498
153476
  if (!Array.isArray(geomRing) || geomRing.length === 0) {
153499
153477
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
153500
153478
  }
@@ -153538,11 +153516,11 @@ var RingIn = class {
153538
153516
  }
153539
153517
  };
153540
153518
  var PolyIn = class {
153519
+ multiPoly;
153520
+ exteriorRing;
153521
+ interiorRings;
153522
+ bbox;
153541
153523
  constructor(geomPoly, multiPoly) {
153542
- __publicField(this, "multiPoly");
153543
- __publicField(this, "exteriorRing");
153544
- __publicField(this, "interiorRings");
153545
- __publicField(this, "bbox");
153546
153524
  if (!Array.isArray(geomPoly)) {
153547
153525
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
153548
153526
  }
@@ -153574,10 +153552,10 @@ var PolyIn = class {
153574
153552
  }
153575
153553
  };
153576
153554
  var MultiPolyIn = class {
153555
+ isSubject;
153556
+ polys;
153557
+ bbox;
153577
153558
  constructor(geom, isSubject) {
153578
- __publicField(this, "isSubject");
153579
- __publicField(this, "polys");
153580
- __publicField(this, "bbox");
153581
153559
  if (!Array.isArray(geom)) {
153582
153560
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
153583
153561
  }
@@ -153739,17 +153717,17 @@ function getMaxAreaPolygon(levelToUse) {
153739
153717
  return [maxAreaValue, maxAreaPolygon];
153740
153718
  }
153741
153719
  function getMaxAreaPolygonAndLevel(contourPolygons) {
153742
- const l2 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 2)) ?? [];
153720
+ const l2 = contourPolygons?.filter((d) => d.contour.i === 2) ?? [];
153743
153721
  const [l2area, l2polygon] = getMaxAreaPolygon(l2);
153744
153722
  if (Math.log10(l2area) >= MIN_AREA_THRESHOLD) {
153745
153723
  return [l2area, l2polygon, 2];
153746
153724
  }
153747
- const l1 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 1)) ?? [];
153725
+ const l1 = contourPolygons?.filter((d) => d.contour.i === 1) ?? [];
153748
153726
  const [l1area, l1polygon] = getMaxAreaPolygon(l1);
153749
153727
  if (Math.log10(l1area) >= MIN_AREA_THRESHOLD) {
153750
153728
  return [l1area, l1polygon, 1];
153751
153729
  }
153752
- const l0 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 0)) ?? [];
153730
+ const l0 = contourPolygons?.filter((d) => d.contour.i === 0) ?? [];
153753
153731
  const [l0area, l0polygon] = getMaxAreaPolygon(l0);
153754
153732
  return [l0area, l0polygon, 0];
153755
153733
  }
@@ -153765,7 +153743,7 @@ class ContourLayerWithText extends ContourLayer {
153765
153743
  if (!circleInfo) {
153766
153744
  return lineAndTextLayers;
153767
153745
  }
153768
- const obsSetName = obsSetPath == null ? void 0 : obsSetPath.at(-1);
153746
+ const obsSetName = obsSetPath?.at(-1);
153769
153747
  const [maxAreaValue, maxAreaPolygon, levelI] = getMaxAreaPolygonAndLevel(contourPolygons);
153770
153748
  const { center, steps, polygon: circlePolygon } = circleInfo;
153771
153749
  if (maxAreaValue > 0 && maxAreaPolygon) {
@@ -153901,24 +153879,17 @@ function isRgb(loader, channels2) {
153901
153879
  }
153902
153880
  function getMetaWithTransformMatrices(imageMeta, imageLoaders) {
153903
153881
  const sources = imageLoaders.map((loader) => getSourceFromLoader(loader));
153904
- if (imageMeta.map((meta) => {
153905
- var _a3, _b2, _c2, _d, _e, _f;
153906
- return ((_b2 = (_a3 = meta == null ? void 0 : meta.metadata) == null ? void 0 : _a3.transform) == null ? void 0 : _b2.matrix) || ((_d = (_c2 = meta == null ? void 0 : meta.metadata) == null ? void 0 : _c2.transform) == null ? void 0 : _d.scale) || ((_f = (_e = meta == null ? void 0 : meta.metadata) == null ? void 0 : _e.transform) == null ? void 0 : _f.translate);
153907
- }).some(Boolean) || sources.every((source) => {
153908
- var _a3, _b2, _c2, _d;
153909
- return !((_b2 = (_a3 = source.meta) == null ? void 0 : _a3.physicalSizes) == null ? void 0 : _b2.x) || !((_d = (_c2 = source.meta) == null ? void 0 : _c2.physicalSizes) == null ? void 0 : _d.y);
153910
- })) {
153882
+ if (imageMeta.map((meta) => meta?.metadata?.transform?.matrix || meta?.metadata?.transform?.scale || meta?.metadata?.transform?.translate).some(Boolean) || sources.every((source) => !source.meta?.physicalSizes?.x || !source.meta?.physicalSizes?.y)) {
153911
153883
  return imageMeta;
153912
153884
  }
153913
153885
  const minPhysicalSize = sources.reduce((acc, source) => {
153914
- var _a3, _b2, _c2, _d, _e, _f, _g, _h, _i;
153915
- const hasZPhyscialSize = (_c2 = (_b2 = (_a3 = source.meta) == null ? void 0 : _a3.physicalSizes) == null ? void 0 : _b2.z) == null ? void 0 : _c2.size;
153886
+ const hasZPhyscialSize = source.meta?.physicalSizes?.z?.size;
153916
153887
  const sizes = [
153917
- unit(`${(_d = source.meta) == null ? void 0 : _d.physicalSizes.x.size} ${(_e = source.meta) == null ? void 0 : _e.physicalSizes.x.unit}`.replace("µ", "u")),
153918
- unit(`${(_f = source.meta) == null ? void 0 : _f.physicalSizes.y.size} ${(_g = source.meta) == null ? void 0 : _g.physicalSizes.y.unit}`.replace("µ", "u"))
153888
+ unit(`${source.meta?.physicalSizes.x.size} ${source.meta?.physicalSizes.x.unit}`.replace("µ", "u")),
153889
+ unit(`${source.meta?.physicalSizes.y.size} ${source.meta?.physicalSizes.y.unit}`.replace("µ", "u"))
153919
153890
  ];
153920
153891
  if (hasZPhyscialSize) {
153921
- sizes.push(unit(`${(_h = source.meta) == null ? void 0 : _h.physicalSizes.z.size} ${(_i = source.meta) == null ? void 0 : _i.physicalSizes.z.unit}`.replace("µ", "u")));
153892
+ sizes.push(unit(`${source.meta?.physicalSizes.z.size} ${source.meta?.physicalSizes.z.unit}`.replace("µ", "u")));
153922
153893
  }
153923
153894
  acc[0] = acc[0] === void 0 || compare$1(sizes[0], acc[0]) === -1 ? sizes[0] : acc[0];
153924
153895
  acc[1] = acc[1] === void 0 || compare$1(sizes[1], acc[1]) === -1 ? sizes[1] : acc[1];
@@ -153926,15 +153897,14 @@ function getMetaWithTransformMatrices(imageMeta, imageLoaders) {
153926
153897
  return acc;
153927
153898
  }, []);
153928
153899
  const imageMetaWithTransform = imageMeta.map((meta, j) => {
153929
- var _a3, _b2, _c2, _d, _e, _f, _g, _h, _i;
153930
153900
  const source = sources[j];
153931
- const hasZPhyscialSize = (_c2 = (_b2 = (_a3 = source.meta) == null ? void 0 : _a3.physicalSizes) == null ? void 0 : _b2.z) == null ? void 0 : _c2.size;
153901
+ const hasZPhyscialSize = source.meta?.physicalSizes?.z?.size;
153932
153902
  const sizes = [
153933
- unit(`${(_d = source.meta) == null ? void 0 : _d.physicalSizes.x.size} ${(_e = source.meta) == null ? void 0 : _e.physicalSizes.x.unit}`.replace("µ", "u")),
153934
- unit(`${(_f = source.meta) == null ? void 0 : _f.physicalSizes.y.size} ${(_g = source.meta) == null ? void 0 : _g.physicalSizes.y.unit}`.replace("µ", "u"))
153903
+ unit(`${source.meta?.physicalSizes.x.size} ${source.meta?.physicalSizes.x.unit}`.replace("µ", "u")),
153904
+ unit(`${source.meta?.physicalSizes.y.size} ${source.meta?.physicalSizes.y.unit}`.replace("µ", "u"))
153935
153905
  ];
153936
153906
  if (hasZPhyscialSize) {
153937
- sizes.push(unit(`${(_h = source.meta) == null ? void 0 : _h.physicalSizes.z.size} ${(_i = source.meta) == null ? void 0 : _i.physicalSizes.z.unit}`.replace("µ", "u")));
153907
+ sizes.push(unit(`${source.meta?.physicalSizes.z.size} ${source.meta?.physicalSizes.z.unit}`.replace("µ", "u")));
153938
153908
  }
153939
153909
  const scale2 = sizes.map((i2, k) => divide(i2, minPhysicalSize[k]));
153940
153910
  if (!sizes[0].equals(sizes[1])) {
@@ -154025,41 +153995,35 @@ async function initializeRasterLayersAndChannels(rasterLayers, rasterRenderLayer
154025
153995
  if (!rasterRenderLayers) {
154026
153996
  const layerIndex = Math.floor(rasterLayers.length / 2);
154027
153997
  const loader = nextImageLoaders[layerIndex];
154028
- const autoImageLayerDefPromise = initializeLayerChannels(loader).then((channels2) => {
154029
- var _a3, _b2, _c2, _d, _e;
154030
- return Promise.resolve({
154031
- type: ((_b2 = (_a3 = nextImageMetaAndLayers[layerIndex]) == null ? void 0 : _a3.metadata) == null ? void 0 : _b2.isBitmask) ? "bitmask" : "raster",
154032
- index: layerIndex,
154033
- ...DEFAULT_RASTER_LAYER_PROPS,
154034
- channels: channels2.map((channel, j) => ({
154035
- ...channel,
154036
- ...nextImageMetaAndLayers[layerIndex].channels ? nextImageMetaAndLayers[layerIndex].channels[j] : []
154037
- })),
154038
- modelMatrix: (_e = (_d = (_c2 = nextImageMetaAndLayers[layerIndex]) == null ? void 0 : _c2.metadata) == null ? void 0 : _d.transform) == null ? void 0 : _e.matrix,
154039
- transparentColor: layerIndex > 0 ? [0, 0, 0] : null
154040
- });
154041
- });
153998
+ const autoImageLayerDefPromise = initializeLayerChannels(loader).then((channels2) => Promise.resolve({
153999
+ type: nextImageMetaAndLayers[layerIndex]?.metadata?.isBitmask ? "bitmask" : "raster",
154000
+ index: layerIndex,
154001
+ ...DEFAULT_RASTER_LAYER_PROPS,
154002
+ channels: channels2.map((channel, j) => ({
154003
+ ...channel,
154004
+ ...nextImageMetaAndLayers[layerIndex].channels ? nextImageMetaAndLayers[layerIndex].channels[j] : []
154005
+ })),
154006
+ modelMatrix: nextImageMetaAndLayers[layerIndex]?.metadata?.transform?.matrix,
154007
+ transparentColor: layerIndex > 0 ? [0, 0, 0] : null
154008
+ }));
154042
154009
  autoImageLayerDefPromises.push(autoImageLayerDefPromise);
154043
154010
  } else {
154044
154011
  const globalIndicesOfRenderLayers = rasterRenderLayers.map((imageName) => rasterLayers.findIndex((image2) => image2.name === imageName));
154045
154012
  for (let i2 = 0; i2 < globalIndicesOfRenderLayers.length; i2++) {
154046
154013
  const layerIndex = globalIndicesOfRenderLayers[i2];
154047
154014
  const loader = nextImageLoaders[layerIndex];
154048
- const autoImageLayerDefPromise = initializeLayerChannels(loader).then((channels2) => {
154049
- var _a3, _b2, _c2, _d, _e;
154050
- return Promise.resolve({
154051
- type: ((_b2 = (_a3 = nextImageMetaAndLayers[layerIndex]) == null ? void 0 : _a3.metadata) == null ? void 0 : _b2.isBitmask) ? "bitmask" : "raster",
154052
- index: layerIndex,
154053
- ...DEFAULT_RASTER_LAYER_PROPS,
154054
- channels: channels2.map((channel, j) => ({
154055
- ...channel,
154056
- ...nextImageMetaAndLayers[layerIndex].channels ? nextImageMetaAndLayers[layerIndex].channels[j] : []
154057
- })),
154058
- domainType: "Min/Max",
154059
- modelMatrix: (_e = (_d = (_c2 = nextImageMetaAndLayers[layerIndex]) == null ? void 0 : _c2.metadata) == null ? void 0 : _d.transform) == null ? void 0 : _e.matrix,
154060
- transparentColor: i2 > 0 ? [0, 0, 0] : null
154061
- });
154062
- });
154015
+ const autoImageLayerDefPromise = initializeLayerChannels(loader).then((channels2) => Promise.resolve({
154016
+ type: nextImageMetaAndLayers[layerIndex]?.metadata?.isBitmask ? "bitmask" : "raster",
154017
+ index: layerIndex,
154018
+ ...DEFAULT_RASTER_LAYER_PROPS,
154019
+ channels: channels2.map((channel, j) => ({
154020
+ ...channel,
154021
+ ...nextImageMetaAndLayers[layerIndex].channels ? nextImageMetaAndLayers[layerIndex].channels[j] : []
154022
+ })),
154023
+ domainType: "Min/Max",
154024
+ modelMatrix: nextImageMetaAndLayers[layerIndex]?.metadata?.transform?.matrix,
154025
+ transparentColor: i2 > 0 ? [0, 0, 0] : null
154026
+ }));
154063
154027
  autoImageLayerDefPromises.push(autoImageLayerDefPromise);
154064
154028
  }
154065
154029
  }
@@ -154257,72 +154221,68 @@ async function fetch_suffix(url, suffix_length, init, use_suffix_request) {
154257
154221
  return fetch_range(url, length2 - suffix_length, length2, init);
154258
154222
  }
154259
154223
  class FetchStore {
154224
+ #overrides;
154225
+ #use_suffix_request;
154260
154226
  constructor(url, options = {}) {
154261
- __privateAdd(this, _FetchStore_instances);
154262
- __privateAdd(this, _overrides);
154263
- __privateAdd(this, _use_suffix_request);
154264
154227
  this.url = url;
154265
- __privateSet(this, _overrides, options.overrides ?? {});
154266
- __privateSet(this, _use_suffix_request, options.useSuffixRequest ?? false);
154228
+ this.#overrides = options.overrides ?? {};
154229
+ this.#use_suffix_request = options.useSuffixRequest ?? false;
154230
+ }
154231
+ #merge_init(overrides) {
154232
+ return merge_init(this.#overrides, overrides);
154267
154233
  }
154268
154234
  async get(key, options = {}) {
154269
154235
  let href = resolve(this.url, key).href;
154270
- let response = await fetch(href, __privateMethod(this, _FetchStore_instances, merge_init_fn).call(this, options));
154236
+ let response = await fetch(href, this.#merge_init(options));
154271
154237
  return handle_response(response);
154272
154238
  }
154273
154239
  async getRange(key, range2, options = {}) {
154274
154240
  let url = resolve(this.url, key);
154275
- let init = __privateMethod(this, _FetchStore_instances, merge_init_fn).call(this, options);
154241
+ let init = this.#merge_init(options);
154276
154242
  let response;
154277
154243
  if ("suffixLength" in range2) {
154278
- response = await fetch_suffix(url, range2.suffixLength, init, __privateGet(this, _use_suffix_request));
154244
+ response = await fetch_suffix(url, range2.suffixLength, init, this.#use_suffix_request);
154279
154245
  } else {
154280
154246
  response = await fetch_range(url, range2.offset, range2.length, init);
154281
154247
  }
154282
154248
  return handle_response(response);
154283
154249
  }
154284
154250
  }
154285
- _overrides = new WeakMap();
154286
- _use_suffix_request = new WeakMap();
154287
- _FetchStore_instances = new WeakSet();
154288
- merge_init_fn = function(overrides) {
154289
- return merge_init(__privateGet(this, _overrides), overrides);
154290
- };
154291
154251
  class BoolArray {
154252
+ #bytes;
154292
154253
  constructor(x, byteOffset, length2) {
154293
- __privateAdd(this, _bytes);
154294
154254
  if (typeof x === "number") {
154295
- __privateSet(this, _bytes, new Uint8Array(x));
154255
+ this.#bytes = new Uint8Array(x);
154296
154256
  } else if (x instanceof ArrayBuffer) {
154297
- __privateSet(this, _bytes, new Uint8Array(x, byteOffset, length2));
154257
+ this.#bytes = new Uint8Array(x, byteOffset, length2);
154298
154258
  } else {
154299
- __privateSet(this, _bytes, new Uint8Array(Array.from(x, (v) => v ? 1 : 0)));
154259
+ this.#bytes = new Uint8Array(Array.from(x, (v) => v ? 1 : 0));
154300
154260
  }
154301
154261
  }
154302
154262
  get BYTES_PER_ELEMENT() {
154303
154263
  return 1;
154304
154264
  }
154305
154265
  get byteOffset() {
154306
- return __privateGet(this, _bytes).byteOffset;
154266
+ return this.#bytes.byteOffset;
154307
154267
  }
154308
154268
  get byteLength() {
154309
- return __privateGet(this, _bytes).byteLength;
154269
+ return this.#bytes.byteLength;
154310
154270
  }
154311
154271
  get buffer() {
154312
- return __privateGet(this, _bytes).buffer;
154272
+ return this.#bytes.buffer;
154313
154273
  }
154314
154274
  get length() {
154315
- return __privateGet(this, _bytes).length;
154275
+ return this.#bytes.length;
154316
154276
  }
154317
154277
  get(idx) {
154318
- let value = __privateGet(this, _bytes)[idx];
154278
+ let value = this.#bytes[idx];
154319
154279
  return typeof value === "number" ? value !== 0 : value;
154320
154280
  }
154321
154281
  set(idx, value) {
154322
- __privateGet(this, _bytes)[idx] = value ? 1 : 0;
154282
+ this.#bytes[idx] = value ? 1 : 0;
154323
154283
  }
154324
154284
  fill(value) {
154325
- __privateGet(this, _bytes).fill(value ? 1 : 0);
154285
+ this.#bytes.fill(value ? 1 : 0);
154326
154286
  }
154327
154287
  *[Symbol.iterator]() {
154328
154288
  for (let i2 = 0; i2 < this.length; i2++) {
@@ -154330,12 +154290,11 @@ class BoolArray {
154330
154290
  }
154331
154291
  }
154332
154292
  }
154333
- _bytes = new WeakMap();
154334
154293
  class ByteStringArray {
154294
+ #encoder;
154335
154295
  constructor(chars, x, byteOffset, length2) {
154336
- __privateAdd(this, _encoder);
154337
154296
  this.chars = chars;
154338
- __privateSet(this, _encoder, new TextEncoder());
154297
+ this.#encoder = new TextEncoder();
154339
154298
  if (typeof x === "number") {
154340
154299
  this._data = new Uint8Array(x * chars);
154341
154300
  } else if (x instanceof ArrayBuffer) {
@@ -154372,10 +154331,10 @@ class ByteStringArray {
154372
154331
  set(idx, value) {
154373
154332
  const view = new Uint8Array(this.buffer, this.byteOffset + this.chars * idx, this.chars);
154374
154333
  view.fill(0);
154375
- view.set(__privateGet(this, _encoder).encode(value));
154334
+ view.set(this.#encoder.encode(value));
154376
154335
  }
154377
154336
  fill(value) {
154378
- const encoded = __privateGet(this, _encoder).encode(value);
154337
+ const encoded = this.#encoder.encode(value);
154379
154338
  for (let i2 = 0; i2 < this.length; i2++) {
154380
154339
  this._data.set(encoded, i2 * this.chars);
154381
154340
  }
@@ -154386,54 +154345,53 @@ class ByteStringArray {
154386
154345
  }
154387
154346
  }
154388
154347
  }
154389
- _encoder = new WeakMap();
154390
- const _UnicodeStringArray = class _UnicodeStringArray {
154348
+ class UnicodeStringArray {
154349
+ #data;
154391
154350
  constructor(chars, x, byteOffset, length2) {
154392
- __privateAdd(this, _data);
154393
154351
  this.chars = chars;
154394
154352
  if (typeof x === "number") {
154395
- __privateSet(this, _data, new Int32Array(x * chars));
154353
+ this.#data = new Int32Array(x * chars);
154396
154354
  } else if (x instanceof ArrayBuffer) {
154397
154355
  if (length2)
154398
154356
  length2 *= chars;
154399
- __privateSet(this, _data, new Int32Array(x, byteOffset, length2));
154357
+ this.#data = new Int32Array(x, byteOffset, length2);
154400
154358
  } else {
154401
154359
  const values2 = x;
154402
- const d = new _UnicodeStringArray(chars, 1);
154403
- __privateSet(this, _data, new Int32Array(function* () {
154360
+ const d = new UnicodeStringArray(chars, 1);
154361
+ this.#data = new Int32Array(function* () {
154404
154362
  for (let str of values2) {
154405
154363
  d.set(0, str);
154406
- yield* __privateGet(d, _data);
154364
+ yield* d.#data;
154407
154365
  }
154408
- }()));
154366
+ }());
154409
154367
  }
154410
154368
  }
154411
154369
  get BYTES_PER_ELEMENT() {
154412
- return __privateGet(this, _data).BYTES_PER_ELEMENT * this.chars;
154370
+ return this.#data.BYTES_PER_ELEMENT * this.chars;
154413
154371
  }
154414
154372
  get byteLength() {
154415
- return __privateGet(this, _data).byteLength;
154373
+ return this.#data.byteLength;
154416
154374
  }
154417
154375
  get byteOffset() {
154418
- return __privateGet(this, _data).byteOffset;
154376
+ return this.#data.byteOffset;
154419
154377
  }
154420
154378
  get buffer() {
154421
- return __privateGet(this, _data).buffer;
154379
+ return this.#data.buffer;
154422
154380
  }
154423
154381
  get length() {
154424
- return __privateGet(this, _data).length / this.chars;
154382
+ return this.#data.length / this.chars;
154425
154383
  }
154426
154384
  get(idx) {
154427
154385
  const offset = this.chars * idx;
154428
154386
  let result = "";
154429
154387
  for (let i2 = 0; i2 < this.chars; i2++) {
154430
- result += String.fromCodePoint(__privateGet(this, _data)[offset + i2]);
154388
+ result += String.fromCodePoint(this.#data[offset + i2]);
154431
154389
  }
154432
154390
  return result.replace(/\u0000/g, "");
154433
154391
  }
154434
154392
  set(idx, value) {
154435
154393
  const offset = this.chars * idx;
154436
- const view = __privateGet(this, _data).subarray(offset, offset + this.chars);
154394
+ const view = this.#data.subarray(offset, offset + this.chars);
154437
154395
  view.fill(0);
154438
154396
  for (let i2 = 0; i2 < this.chars; i2++) {
154439
154397
  view[i2] = value.codePointAt(i2) ?? 0;
@@ -154441,9 +154399,9 @@ const _UnicodeStringArray = class _UnicodeStringArray {
154441
154399
  }
154442
154400
  fill(value) {
154443
154401
  this.set(0, value);
154444
- let encoded = __privateGet(this, _data).subarray(0, this.chars);
154402
+ let encoded = this.#data.subarray(0, this.chars);
154445
154403
  for (let i2 = 1; i2 < this.length; i2++) {
154446
- __privateGet(this, _data).set(encoded, i2 * this.chars);
154404
+ this.#data.set(encoded, i2 * this.chars);
154447
154405
  }
154448
154406
  }
154449
154407
  *[Symbol.iterator]() {
@@ -154451,9 +154409,7 @@ const _UnicodeStringArray = class _UnicodeStringArray {
154451
154409
  yield this.get(i2);
154452
154410
  }
154453
154411
  }
154454
- };
154455
- _data = new WeakMap();
154456
- let UnicodeStringArray = _UnicodeStringArray;
154412
+ }
154457
154413
  function json_decode_object(bytes) {
154458
154414
  const str = new TextDecoder().decode(bytes);
154459
154415
  return JSON.parse(str);
@@ -154512,11 +154468,11 @@ function get_strides(shape, order) {
154512
154468
  }
154513
154469
  function create_chunk_key_encoder({ name: name2, configuration }) {
154514
154470
  if (name2 === "default") {
154515
- const separator = (configuration == null ? void 0 : configuration.separator) ?? "/";
154471
+ const separator = configuration?.separator ?? "/";
154516
154472
  return (chunk_coords) => ["c", ...chunk_coords].join(separator);
154517
154473
  }
154518
154474
  if (name2 === "v2") {
154519
- const separator = (configuration == null ? void 0 : configuration.separator) ?? ".";
154475
+ const separator = configuration?.separator ?? ".";
154520
154476
  return (chunk_coords) => chunk_coords.join(separator) || "0";
154521
154477
  }
154522
154478
  throw new Error(`Unknown chunk key encoding: ${name2}`);
@@ -154612,7 +154568,7 @@ function is_dtype(dtype, query) {
154612
154568
  return !is_string && !is_bigint && !is_boolean && !is_object;
154613
154569
  }
154614
154570
  function is_sharding_codec(codec) {
154615
- return (codec == null ? void 0 : codec.name) === "sharding_indexed";
154571
+ return codec?.name === "sharding_indexed";
154616
154572
  }
154617
154573
  function ensure_correct_scalar(metadata) {
154618
154574
  if ((metadata.data_type === "uint64" || metadata.data_type === "int64") && metadata.fill_value != null) {
@@ -154638,7 +154594,7 @@ async function decompress(data, { format: format2, signal }) {
154638
154594
  const buffer2 = await decompressedResponse.arrayBuffer();
154639
154595
  return buffer2;
154640
154596
  } catch {
154641
- signal == null ? void 0 : signal.throwIfAborted();
154597
+ signal?.throwIfAborted();
154642
154598
  throw new Error(`Failed to decode ${format2}`);
154643
154599
  }
154644
154600
  }
@@ -154678,48 +154634,42 @@ function bytes_per_element(TypedArray2) {
154678
154634
  }
154679
154635
  return 4;
154680
154636
  }
154681
- const _BytesCodec = class _BytesCodec {
154637
+ class BytesCodec {
154682
154638
  constructor(configuration, meta) {
154683
- __privateAdd(this, _stride);
154684
- __privateAdd(this, _TypedArray);
154685
- __privateAdd(this, _BYTES_PER_ELEMENT);
154686
- __privateAdd(this, _shape);
154687
- __privateAdd(this, _endian);
154688
154639
  this.kind = "array_to_bytes";
154689
- __privateSet(this, _endian, configuration == null ? void 0 : configuration.endian);
154690
- __privateSet(this, _TypedArray, get_ctr(meta.data_type));
154691
- __privateSet(this, _shape, meta.shape);
154692
- __privateSet(this, _stride, get_strides(meta.shape, "C"));
154693
- const sample = new (__privateGet(this, _TypedArray))(0);
154694
- __privateSet(this, _BYTES_PER_ELEMENT, sample.BYTES_PER_ELEMENT);
154695
- }
154640
+ this.#endian = configuration?.endian;
154641
+ this.#TypedArray = get_ctr(meta.data_type);
154642
+ this.#shape = meta.shape;
154643
+ this.#stride = get_strides(meta.shape, "C");
154644
+ const sample = new this.#TypedArray(0);
154645
+ this.#BYTES_PER_ELEMENT = sample.BYTES_PER_ELEMENT;
154646
+ }
154647
+ #stride;
154648
+ #TypedArray;
154649
+ #BYTES_PER_ELEMENT;
154650
+ #shape;
154651
+ #endian;
154696
154652
  static fromConfig(configuration, meta) {
154697
- return new _BytesCodec(configuration, meta);
154653
+ return new BytesCodec(configuration, meta);
154698
154654
  }
154699
154655
  encode(arr) {
154700
154656
  let bytes = new Uint8Array(arr.data.buffer);
154701
- if (LITTLE_ENDIAN_OS && __privateGet(this, _endian) === "big") {
154702
- byteswap_inplace(bytes, bytes_per_element(__privateGet(this, _TypedArray)));
154657
+ if (LITTLE_ENDIAN_OS && this.#endian === "big") {
154658
+ byteswap_inplace(bytes, bytes_per_element(this.#TypedArray));
154703
154659
  }
154704
154660
  return bytes;
154705
154661
  }
154706
154662
  decode(bytes) {
154707
- if (LITTLE_ENDIAN_OS && __privateGet(this, _endian) === "big") {
154708
- byteswap_inplace(bytes, bytes_per_element(__privateGet(this, _TypedArray)));
154663
+ if (LITTLE_ENDIAN_OS && this.#endian === "big") {
154664
+ byteswap_inplace(bytes, bytes_per_element(this.#TypedArray));
154709
154665
  }
154710
154666
  return {
154711
- data: new (__privateGet(this, _TypedArray))(bytes.buffer, bytes.byteOffset, bytes.byteLength / __privateGet(this, _BYTES_PER_ELEMENT)),
154712
- shape: __privateGet(this, _shape),
154713
- stride: __privateGet(this, _stride)
154667
+ data: new this.#TypedArray(bytes.buffer, bytes.byteOffset, bytes.byteLength / this.#BYTES_PER_ELEMENT),
154668
+ shape: this.#shape,
154669
+ stride: this.#stride
154714
154670
  };
154715
154671
  }
154716
- };
154717
- _stride = new WeakMap();
154718
- _TypedArray = new WeakMap();
154719
- _BYTES_PER_ELEMENT = new WeakMap();
154720
- _shape = new WeakMap();
154721
- _endian = new WeakMap();
154722
- let BytesCodec = _BytesCodec;
154672
+ }
154723
154673
  class Crc32cCodec {
154724
154674
  constructor() {
154725
154675
  this.kind = "bytes_to_bytes";
@@ -154741,7 +154691,7 @@ class GzipCodec {
154741
154691
  static fromConfig(_) {
154742
154692
  return new GzipCodec();
154743
154693
  }
154744
- encode(_bytes2) {
154694
+ encode(_bytes) {
154745
154695
  throw new Error("Gzip encoding is not enabled by default. Please register a custom codec with `numcodecs/gzip`.");
154746
154696
  }
154747
154697
  async decode(bytes) {
@@ -154761,10 +154711,8 @@ function sort_keys_replacer(_key, value) {
154761
154711
  return sorted;
154762
154712
  }, {}) : value;
154763
154713
  }
154764
- const _JsonCodec = class _JsonCodec {
154714
+ class JsonCodec {
154765
154715
  constructor(configuration = {}) {
154766
- __privateAdd(this, _encoder_config);
154767
- __privateAdd(this, _decoder_config);
154768
154716
  this.kind = "array_to_bytes";
154769
154717
  this.configuration = configuration;
154770
154718
  const { encoding = "utf-8", skipkeys = false, ensure_ascii = true, check_circular = true, allow_nan = true, sort_keys = true, indent, strict = true } = configuration;
@@ -154776,7 +154724,7 @@ const _JsonCodec = class _JsonCodec {
154776
154724
  separators = [", ", ": "];
154777
154725
  }
154778
154726
  }
154779
- __privateSet(this, _encoder_config, {
154727
+ this.#encoder_config = {
154780
154728
  encoding,
154781
154729
  skipkeys,
154782
154730
  ensure_ascii,
@@ -154785,14 +154733,16 @@ const _JsonCodec = class _JsonCodec {
154785
154733
  indent,
154786
154734
  separators,
154787
154735
  sort_keys
154788
- });
154789
- __privateSet(this, _decoder_config, { strict });
154736
+ };
154737
+ this.#decoder_config = { strict };
154790
154738
  }
154739
+ #encoder_config;
154740
+ #decoder_config;
154791
154741
  static fromConfig(configuration) {
154792
- return new _JsonCodec(configuration);
154742
+ return new JsonCodec(configuration);
154793
154743
  }
154794
154744
  encode(buf) {
154795
- const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = __privateGet(this, _encoder_config);
154745
+ const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = this.#encoder_config;
154796
154746
  assert$1(encoding === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
154797
154747
  const replacer_functions = [];
154798
154748
  assert$1(check_circular, "JsonCodec does not yet support skipping the check for circular references during encoding.");
@@ -154826,7 +154776,7 @@ const _JsonCodec = class _JsonCodec {
154826
154776
  return new TextEncoder().encode(json_str);
154827
154777
  }
154828
154778
  decode(bytes) {
154829
- const { strict } = __privateGet(this, _decoder_config);
154779
+ const { strict } = this.#decoder_config;
154830
154780
  assert$1(strict, "JsonCodec does not yet support non-strict decoding.");
154831
154781
  const items = json_decode_object(bytes);
154832
154782
  const shape = items.pop();
@@ -154836,10 +154786,7 @@ const _JsonCodec = class _JsonCodec {
154836
154786
  const data = items;
154837
154787
  return { data, shape, stride };
154838
154788
  }
154839
- };
154840
- _encoder_config = new WeakMap();
154841
- _decoder_config = new WeakMap();
154842
- let JsonCodec = _JsonCodec;
154789
+ }
154843
154790
  function proxy(arr) {
154844
154791
  if (arr instanceof BoolArray || arr instanceof ByteStringArray || arr instanceof UnicodeStringArray) {
154845
154792
  const arrp = new Proxy(arr, {
@@ -154908,10 +154855,8 @@ function matches_order(chunk, target) {
154908
154855
  assert$1(source.length === target.length, "Orders must match");
154909
154856
  return source.every((dim, i2) => dim === target[i2]);
154910
154857
  }
154911
- const _TransposeCodec = class _TransposeCodec {
154858
+ class TransposeCodec {
154912
154859
  constructor(configuration, meta) {
154913
- __privateAdd(this, _order);
154914
- __privateAdd(this, _inverseOrder);
154915
154860
  this.kind = "array_to_array";
154916
154861
  let value = configuration.order ?? "C";
154917
154862
  let rank2 = meta.shape.length;
@@ -154934,39 +154879,38 @@ const _TransposeCodec = class _TransposeCodec {
154934
154879
  inverseOrder[x] = i2;
154935
154880
  });
154936
154881
  }
154937
- __privateSet(this, _order, order);
154938
- __privateSet(this, _inverseOrder, inverseOrder);
154882
+ this.#order = order;
154883
+ this.#inverseOrder = inverseOrder;
154939
154884
  }
154885
+ #order;
154886
+ #inverseOrder;
154940
154887
  static fromConfig(configuration, meta) {
154941
- return new _TransposeCodec(configuration, meta);
154888
+ return new TransposeCodec(configuration, meta);
154942
154889
  }
154943
154890
  encode(arr) {
154944
- if (matches_order(arr, __privateGet(this, _inverseOrder))) {
154891
+ if (matches_order(arr, this.#inverseOrder)) {
154945
154892
  return arr;
154946
154893
  }
154947
- return convert_array_order(arr, __privateGet(this, _inverseOrder));
154894
+ return convert_array_order(arr, this.#inverseOrder);
154948
154895
  }
154949
154896
  decode(arr) {
154950
154897
  return {
154951
154898
  data: arr.data,
154952
154899
  shape: arr.shape,
154953
- stride: get_strides(arr.shape, __privateGet(this, _order))
154900
+ stride: get_strides(arr.shape, this.#order)
154954
154901
  };
154955
154902
  }
154956
- };
154957
- _order = new WeakMap();
154958
- _inverseOrder = new WeakMap();
154959
- let TransposeCodec = _TransposeCodec;
154960
- const _VLenUTF8 = class _VLenUTF8 {
154903
+ }
154904
+ class VLenUTF8 {
154961
154905
  constructor(shape) {
154962
- __privateAdd(this, _shape2);
154963
- __privateAdd(this, _strides);
154964
154906
  this.kind = "array_to_bytes";
154965
- __privateSet(this, _shape2, shape);
154966
- __privateSet(this, _strides, get_strides(shape, "C"));
154907
+ this.#shape = shape;
154908
+ this.#strides = get_strides(shape, "C");
154967
154909
  }
154910
+ #shape;
154911
+ #strides;
154968
154912
  static fromConfig(_, meta) {
154969
- return new _VLenUTF8(meta.shape);
154913
+ return new VLenUTF8(meta.shape);
154970
154914
  }
154971
154915
  encode(_chunk) {
154972
154916
  throw new Error("Method not implemented.");
@@ -154982,12 +154926,9 @@ const _VLenUTF8 = class _VLenUTF8 {
154982
154926
  data[i2] = decoder.decode(bytes.buffer.slice(pos, pos + item_length));
154983
154927
  pos += item_length;
154984
154928
  }
154985
- return { data, shape: __privateGet(this, _shape2), stride: __privateGet(this, _strides) };
154929
+ return { data, shape: this.#shape, stride: this.#strides };
154986
154930
  }
154987
- };
154988
- _shape2 = new WeakMap();
154989
- _strides = new WeakMap();
154990
- let VLenUTF8 = _VLenUTF8;
154931
+ }
154991
154932
  class ZlibCodec {
154992
154933
  constructor() {
154993
154934
  this.kind = "bytes_to_bytes";
@@ -154995,7 +154936,7 @@ class ZlibCodec {
154995
154936
  static fromConfig(_) {
154996
154937
  return new ZlibCodec();
154997
154938
  }
154998
- encode(_bytes2) {
154939
+ encode(_bytes) {
154999
154940
  throw new Error("Zlib encoding is not enabled by default. Please register a codec with `numcodecs/zlib`.");
155000
154941
  }
155001
154942
  async decode(bytes) {
@@ -155004,7 +154945,7 @@ class ZlibCodec {
155004
154945
  }
155005
154946
  }
155006
154947
  function create_default_registry() {
155007
- return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-B8fjEpk7.js").then((m) => m.default)).set("lz4", () => import("./lz4-C9lm_i9S.js").then((m) => m.default)).set("zstd", () => import("./zstd-y75FARxZ.js").then((m) => m.default)).set("gzip", () => GzipCodec).set("zlib", () => ZlibCodec).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec).set("bitround", () => BitroundCodec);
154948
+ return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-DvQQ1ST0.js").then((m) => m.default)).set("lz4", () => import("./lz4-BIbM36RN.js").then((m) => m.default)).set("zstd", () => import("./zstd-CO575QiM.js").then((m) => m.default)).set("gzip", () => GzipCodec).set("zlib", () => ZlibCodec).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec).set("bitround", () => BitroundCodec);
155008
154949
  }
155009
154950
  const registry = create_default_registry();
155010
154951
  function create_codec_pipeline(chunk_metadata) {
@@ -155038,8 +154979,7 @@ function create_codec_pipeline(chunk_metadata) {
155038
154979
  }
155039
154980
  async function load_codecs(chunk_meta) {
155040
154981
  let promises = chunk_meta.codecs.map(async (meta) => {
155041
- var _a3;
155042
- let Codec = await ((_a3 = registry.get(meta.name)) == null ? void 0 : _a3());
154982
+ let Codec = await registry.get(meta.name)?.();
155043
154983
  assert$1(Codec, `Unknown codec: ${meta.name}`);
155044
154984
  return { Codec, meta };
155045
154985
  });
@@ -155138,19 +155078,17 @@ function root(store) {
155138
155078
  class Group extends Location {
155139
155079
  constructor(store, path, metadata) {
155140
155080
  super(store, path);
155141
- __privateAdd(this, _metadata);
155142
155081
  this.kind = "group";
155143
- __privateSet(this, _metadata, metadata);
155082
+ this.#metadata = metadata;
155144
155083
  }
155084
+ #metadata;
155145
155085
  get attrs() {
155146
- return __privateGet(this, _metadata).attributes;
155086
+ return this.#metadata.attributes;
155147
155087
  }
155148
155088
  }
155149
- _metadata = new WeakMap();
155150
155089
  function get_array_order(codecs) {
155151
- var _a3;
155152
155090
  const maybe_transpose_codec = codecs.find((c) => c.name === "transpose");
155153
- return ((_a3 = maybe_transpose_codec == null ? void 0 : maybe_transpose_codec.configuration) == null ? void 0 : _a3.order) ?? "C";
155091
+ return maybe_transpose_codec?.configuration?.order ?? "C";
155154
155092
  }
155155
155093
  const CONTEXT_MARKER = Symbol("zarrita.context");
155156
155094
  function get_context(obj) {
@@ -155200,28 +155138,28 @@ function create_context(location, metadata) {
155200
155138
  }
155201
155139
  };
155202
155140
  }
155203
- let Array$1 = (_c = class extends (_a = Location, _a) {
155141
+ let Array$1 = class Array2 extends (_a = Location, _a) {
155204
155142
  constructor(store, path, metadata) {
155205
155143
  super(store, path);
155206
- __privateAdd(this, _metadata2);
155207
155144
  this.kind = "array";
155208
- __privateSet(this, _metadata2, {
155145
+ this.#metadata = {
155209
155146
  ...metadata,
155210
155147
  fill_value: ensure_correct_scalar(metadata)
155211
- });
155148
+ };
155212
155149
  this[CONTEXT_MARKER] = create_context(this, metadata);
155213
155150
  }
155151
+ #metadata;
155214
155152
  get attrs() {
155215
- return __privateGet(this, _metadata2).attributes;
155153
+ return this.#metadata.attributes;
155216
155154
  }
155217
155155
  get shape() {
155218
- return __privateGet(this, _metadata2).shape;
155156
+ return this.#metadata.shape;
155219
155157
  }
155220
155158
  get chunks() {
155221
155159
  return this[CONTEXT_MARKER].chunk_shape;
155222
155160
  }
155223
155161
  get dtype() {
155224
- return __privateGet(this, _metadata2).data_type;
155162
+ return this.#metadata.data_type;
155225
155163
  }
155226
155164
  async getChunk(chunk_coords, options) {
155227
155165
  let context = this[CONTEXT_MARKER];
@@ -155258,7 +155196,7 @@ let Array$1 = (_c = class extends (_a = Location, _a) {
155258
155196
  is(query) {
155259
155197
  return is_dtype(this.dtype, query);
155260
155198
  }
155261
- }, _metadata2 = new WeakMap(), _c);
155199
+ };
155262
155200
  function* range(start, stop, step = 1) {
155263
155201
  if (stop === void 0) {
155264
155202
  stop = start;
@@ -155472,7 +155410,6 @@ function unwrap(arr, idx) {
155472
155410
  return "get" in arr ? arr.get(idx) : arr[idx];
155473
155411
  }
155474
155412
  async function get$1(arr, selection, opts, setter2) {
155475
- var _a3;
155476
155413
  let context = get_context(arr);
155477
155414
  let indexer = new BasicIndexer({
155478
155415
  selection,
@@ -155480,7 +155417,7 @@ async function get$1(arr, selection, opts, setter2) {
155480
155417
  chunk_shape: arr.chunks
155481
155418
  });
155482
155419
  let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a2, b) => a2 * b, 1)), indexer.shape, context.get_strides(indexer.shape));
155483
- let queue = ((_a3 = opts.create_queue) == null ? void 0 : _a3.call(opts)) ?? create_queue();
155420
+ let queue = opts.create_queue?.() ?? create_queue();
155484
155421
  for (const { chunk_coords, mapping } of indexer) {
155485
155422
  queue.add(async () => {
155486
155423
  let { data, shape, stride } = await arr.getChunk(chunk_coords, opts.opts);
@@ -155785,11 +155722,10 @@ class RelaxedFetchStore extends FetchStore {
155785
155722
  // custom error handling function or additional options
155786
155723
  // to the zarrita FetchStore so that a subclass is not required.
155787
155724
  async get(key, options = {}) {
155788
- var _a3;
155789
155725
  try {
155790
155726
  return await super.get(key, options);
155791
155727
  } catch (e2) {
155792
- if (((_a3 = e2 == null ? void 0 : e2.message) == null ? void 0 : _a3.startsWith("Unexpected response status 403")) && true) {
155728
+ if (e2?.message?.startsWith("Unexpected response status 403") && true) {
155793
155729
  return void 0;
155794
155730
  }
155795
155731
  throw e2;
@@ -155799,7 +155735,7 @@ class RelaxedFetchStore extends FetchStore {
155799
155735
  function zarrOpenRoot(url, fileType, opts) {
155800
155736
  let store;
155801
155737
  {
155802
- store = new RelaxedFetchStore(url, { overrides: opts == null ? void 0 : opts.requestInit });
155738
+ store = new RelaxedFetchStore(url, { overrides: opts?.requestInit });
155803
155739
  }
155804
155740
  return root(store);
155805
155741
  }
@@ -155955,21 +155891,21 @@ async function initLoader(imageData) {
155955
155891
  }
155956
155892
  case "ome-tiff": {
155957
155893
  let loader;
155958
- if (metadata == null ? void 0 : metadata.omeTiffOffsetsUrl) {
155894
+ if (metadata?.omeTiffOffsetsUrl) {
155959
155895
  try {
155960
155896
  const res = await fetch(metadata.omeTiffOffsetsUrl, requestInit2 || {});
155961
155897
  if (!res.ok) throw new Error(`Offsets not found: ${res.status} from ${res.url}`);
155962
155898
  const offsets = await res.json();
155963
155899
  loader = await loadOmeTiff(url, {
155964
155900
  offsets,
155965
- headers: requestInit2 == null ? void 0 : requestInit2.headers
155901
+ headers: requestInit2?.headers
155966
155902
  });
155967
155903
  } catch (err2) {
155968
155904
  log$6.error("Error loading OME-TIFF offsets:", err2);
155969
155905
  throw err2;
155970
155906
  }
155971
155907
  } else {
155972
- loader = await loadOmeTiff(url, { headers: requestInit2 == null ? void 0 : requestInit2.headers });
155908
+ loader = await loadOmeTiff(url, { headers: requestInit2?.headers });
155973
155909
  }
155974
155910
  const { Pixels: { Channels } } = loader.metadata;
155975
155911
  const channels2 = Array.isArray(Channels) ? Channels.map((channel, i2) => channel.Name || `Channel ${i2}`) : [Channels.Name || `Channel ${0}`];
@@ -156057,20 +155993,18 @@ class RasterLoader extends JsonLoader {
156057
155993
  }
156058
155994
  class RasterJsonAsImageLoader extends RasterLoader {
156059
155995
  async load() {
156060
- var _a3;
156061
155996
  const loaderResult = await super.load();
156062
155997
  const { data = {}, url: urls, coordinationValues } = loaderResult;
156063
155998
  const { loaders: allLoaders = [], meta: allMeta = [] } = data;
156064
155999
  const loaders = [];
156065
156000
  const meta = [];
156066
156001
  allMeta.forEach((layer, i2) => {
156067
- var _a4;
156068
- if (!((_a4 = layer == null ? void 0 : layer.metadata) == null ? void 0 : _a4.isBitmask)) {
156002
+ if (!layer?.metadata?.isBitmask) {
156069
156003
  loaders.push(allLoaders[i2]);
156070
156004
  meta.push(allMeta[i2]);
156071
156005
  }
156072
156006
  });
156073
- if (!(coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer)) {
156007
+ if (!coordinationValues?.spatialImageLayer) {
156074
156008
  log$6.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsImageLoader. This may be an indicator that the image could not be loaded.");
156075
156009
  }
156076
156010
  return new LoaderResult(
@@ -156080,7 +156014,7 @@ class RasterJsonAsImageLoader extends RasterLoader {
156080
156014
  urls,
156081
156015
  {
156082
156016
  // Filter coordinationValues, keeping only non-bitmask layers.
156083
- spatialImageLayer: (_a3 = coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer) == null ? void 0 : _a3.filter((l2) => l2.type !== "bitmask").map((layer) => ({
156017
+ spatialImageLayer: coordinationValues?.spatialImageLayer?.filter((l2) => l2.type !== "bitmask").map((layer) => ({
156084
156018
  ...layer,
156085
156019
  index: meta.findIndex((metaItem) => metaItem.name === allMeta[layer.index].name)
156086
156020
  }))
@@ -156090,20 +156024,18 @@ class RasterJsonAsImageLoader extends RasterLoader {
156090
156024
  }
156091
156025
  class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
156092
156026
  async load() {
156093
- var _a3;
156094
156027
  const loaderResult = await super.load();
156095
156028
  const { data = {}, url: urls, coordinationValues } = loaderResult;
156096
156029
  const { loaders: allLoaders = [], meta: allMeta = [] } = data;
156097
156030
  const loaders = [];
156098
156031
  const meta = [];
156099
156032
  allMeta.forEach((layer, i2) => {
156100
- var _a4;
156101
- if ((_a4 = layer == null ? void 0 : layer.metadata) == null ? void 0 : _a4.isBitmask) {
156033
+ if (layer?.metadata?.isBitmask) {
156102
156034
  loaders.push(allLoaders[i2]);
156103
156035
  meta.push(allMeta[i2]);
156104
156036
  }
156105
156037
  });
156106
- if (!(coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer)) {
156038
+ if (!coordinationValues?.spatialImageLayer) {
156107
156039
  log$6.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsObsSegmentationsLoader. This may be an indicator that the image could not be loaded.");
156108
156040
  }
156109
156041
  return new LoaderResult(
@@ -156114,7 +156046,7 @@ class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
156114
156046
  urls,
156115
156047
  {
156116
156048
  // Filter coordinationValues, keeping only bitmask layers.
156117
- spatialSegmentationLayer: (_a3 = coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer) == null ? void 0 : _a3.filter((l2) => l2.type === "bitmask").map((layer) => ({
156049
+ spatialSegmentationLayer: coordinationValues?.spatialImageLayer?.filter((l2) => l2.type === "bitmask").map((layer) => ({
156118
156050
  ...layer,
156119
156051
  index: meta.findIndex((metaItem) => metaItem.name === allMeta[layer.index].name)
156120
156052
  }))