@vitessce/json 3.3.5 → 3.3.7

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.
@@ -26,7 +26,7 @@ var __privateMethod = (obj, member, method) => {
26
26
  __accessCheck(obj, member, "access private method");
27
27
  return method;
28
28
  };
29
- var _bytes, _encoder, _encode_buffer, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _shape2, _strides2, _metadata, _metadata2, _a2, _b, _overrides, _use_suffix_request, _merge_init, merge_init_fn;
29
+ var _bytes, _encoder, _data, _encode_buffer, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _shape2, _strides2, _encoder_config, _decoder_config, _metadata, _metadata2, _a2, _b, _overrides, _use_suffix_request, _merge_init, merge_init_fn, _overrides2;
30
30
  import { DataSourceFetchError, AbstractTwoStepLoader, AbstractLoaderError, LoaderResult, LoaderValidationError } from "@vitessce/vit-s";
31
31
  import "react";
32
32
  function _mergeNamespaces(n3, m) {
@@ -94,11 +94,14 @@ const DataType$2 = {
94
94
  GENOMIC_PROFILES: "genomic-profiles",
95
95
  OBS_SPOTS: "obsSpots",
96
96
  OBS_POINTS: "obsPoints",
97
- OBS_LOCATIONS: "obsLocations"
97
+ OBS_LOCATIONS: "obsLocations",
98
+ SAMPLE_SETS: "sampleSets",
99
+ SAMPLE_EDGES: "sampleEdges"
98
100
  };
99
101
  const FileType$1 = {
100
102
  // Joint file types
101
103
  ANNDATA_ZARR: "anndata.zarr",
104
+ ANNDATA_ZARR_ZIP: "anndata.zarr.zip",
102
105
  SPATIALDATA_ZARR: "spatialdata.zarr",
103
106
  // Atomic file types
104
107
  OBS_EMBEDDING_CSV: "obsEmbedding.csv",
@@ -111,6 +114,7 @@ const FileType$1 = {
111
114
  OBS_SEGMENTATIONS_JSON: "obsSegmentations.json",
112
115
  OBS_SETS_CSV: "obsSets.csv",
113
116
  OBS_SETS_JSON: "obsSets.json",
117
+ SAMPLE_SETS_CSV: "sampleSets.csv",
114
118
  // OME-Zarr
115
119
  IMAGE_OME_ZARR: "image.ome-zarr",
116
120
  OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
@@ -125,6 +129,19 @@ const FileType$1 = {
125
129
  OBS_SEGMENTATIONS_ANNDATA_ZARR: "obsSegmentations.anndata.zarr",
126
130
  OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
127
131
  FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
132
+ SAMPLE_EDGES_ANNDATA_ZARR: "sampleEdges.anndata.zarr",
133
+ // AnnData - zipped
134
+ OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: "obsFeatureMatrix.anndata.zarr.zip",
135
+ OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: "obsFeatureColumns.anndata.zarr.zip",
136
+ OBS_SETS_ANNDATA_ZARR_ZIP: "obsSets.anndata.zarr.zip",
137
+ OBS_EMBEDDING_ANNDATA_ZARR_ZIP: "obsEmbedding.anndata.zarr.zip",
138
+ OBS_SPOTS_ANNDATA_ZARR_ZIP: "obsSpots.anndata.zarr.zip",
139
+ OBS_POINTS_ANNDATA_ZARR_ZIP: "obsPoints.anndata.zarr.zip",
140
+ OBS_LOCATIONS_ANNDATA_ZARR_ZIP: "obsLocations.anndata.zarr.zip",
141
+ OBS_SEGMENTATIONS_ANNDATA_ZARR_ZIP: "obsSegmentations.anndata.zarr.zip",
142
+ OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
143
+ FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
144
+ SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
128
145
  // SpatialData
129
146
  IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
130
147
  LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
@@ -132,6 +149,7 @@ const FileType$1 = {
132
149
  OBS_FEATURE_MATRIX_SPATIALDATA_ZARR: "obsFeatureMatrix.spatialdata.zarr",
133
150
  OBS_SETS_SPATIALDATA_ZARR: "obsSets.spatialdata.zarr",
134
151
  OBS_SPOTS_SPATIALDATA_ZARR: "obsSpots.spatialdata.zarr",
152
+ FEATURE_LABELS_SPATIALDATA_ZARR: "featureLabels.spatialdata.zarr",
135
153
  // TODO:
136
154
  // OBS_POINTS_SPATIALDATA_ZARR: 'obsPoints.spatialdata.zarr',
137
155
  // OBS_LOCATIONS_SPATIALDATA_ZARR: 'obsLocations.spatialdata.zarr',
@@ -288,7 +306,10 @@ const CoordinationType$1 = {
288
306
  LEGEND_VISIBLE: "legendVisible",
289
307
  SPATIAL_CHANNEL_LABELS_VISIBLE: "spatialChannelLabelsVisible",
290
308
  SPATIAL_CHANNEL_LABELS_ORIENTATION: "spatialChannelLabelsOrientation",
291
- SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize"
309
+ SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize",
310
+ // Multi-sample / comparative
311
+ SAMPLE_TYPE: "sampleType",
312
+ SAMPLE_SET_SELECTION: "sampleSetSelection"
292
313
  };
293
314
  var util$4;
294
315
  (function(util2) {
@@ -8779,6 +8800,17 @@ z.object({
8779
8800
  scoreColumn: z.string().optional()
8780
8801
  }))
8781
8802
  });
8803
+ z.object({
8804
+ sampleIndex: z.string(),
8805
+ sampleSets: z.array(z.object({
8806
+ name: z.string(),
8807
+ column: z.union([
8808
+ z.string(),
8809
+ z.array(z.string())
8810
+ ]),
8811
+ scoreColumn: z.string().optional()
8812
+ }))
8813
+ });
8782
8814
  z.object({
8783
8815
  obsLabels: z.union([
8784
8816
  annDataObsLabels,
@@ -17437,7 +17469,7 @@ function assert$c(condition, message) {
17437
17469
  }
17438
17470
  const RADIANS_TO_DEGREES$2 = 1 / Math.PI * 180;
17439
17471
  const DEGREES_TO_RADIANS$7 = 1 / 180 * Math.PI;
17440
- const config$2 = {
17472
+ const config$3 = {
17441
17473
  EPSILON: 1e-12,
17442
17474
  debug: false,
17443
17475
  precision: 4,
@@ -17447,13 +17479,13 @@ const config$2 = {
17447
17479
  };
17448
17480
  function configure(options) {
17449
17481
  for (const key in options) {
17450
- assert$c(key in config$2);
17451
- config$2[key] = options[key];
17482
+ assert$c(key in config$3);
17483
+ config$3[key] = options[key];
17452
17484
  }
17453
- return config$2;
17485
+ return config$3;
17454
17486
  }
17455
17487
  function formatValue$1(value, {
17456
- precision = config$2.precision
17488
+ precision = config$3.precision
17457
17489
  } = {}) {
17458
17490
  value = round$2(value);
17459
17491
  return "".concat(parseFloat(value.toPrecision(precision)));
@@ -17504,9 +17536,9 @@ function lerp$6(a2, b, t2) {
17504
17536
  return t2 * b + (1 - t2) * a2;
17505
17537
  }
17506
17538
  function equals$3(a2, b, epsilon3) {
17507
- const oldEpsilon = config$2.EPSILON;
17539
+ const oldEpsilon = config$3.EPSILON;
17508
17540
  if (epsilon3) {
17509
- config$2.EPSILON = epsilon3;
17541
+ config$3.EPSILON = epsilon3;
17510
17542
  }
17511
17543
  try {
17512
17544
  if (a2 === b) {
@@ -17530,11 +17562,11 @@ function equals$3(a2, b, epsilon3) {
17530
17562
  return b.equals(a2);
17531
17563
  }
17532
17564
  if (typeof a2 === "number" && typeof b === "number") {
17533
- return Math.abs(a2 - b) <= config$2.EPSILON * Math.max(1, Math.abs(a2), Math.abs(b));
17565
+ return Math.abs(a2 - b) <= config$3.EPSILON * Math.max(1, Math.abs(a2), Math.abs(b));
17534
17566
  }
17535
17567
  return false;
17536
17568
  } finally {
17537
- config$2.EPSILON = oldEpsilon;
17569
+ config$3.EPSILON = oldEpsilon;
17538
17570
  }
17539
17571
  }
17540
17572
  function exactEquals(a2, b) {
@@ -17563,18 +17595,18 @@ function exactEquals(a2, b) {
17563
17595
  return false;
17564
17596
  }
17565
17597
  function withEpsilon(epsilon3, func) {
17566
- const oldPrecision = config$2.EPSILON;
17567
- config$2.EPSILON = epsilon3;
17598
+ const oldPrecision = config$3.EPSILON;
17599
+ config$3.EPSILON = epsilon3;
17568
17600
  let value;
17569
17601
  try {
17570
17602
  value = func();
17571
17603
  } finally {
17572
- config$2.EPSILON = oldPrecision;
17604
+ config$3.EPSILON = oldPrecision;
17573
17605
  }
17574
17606
  return value;
17575
17607
  }
17576
17608
  function round$2(value) {
17577
- return Math.round(value / config$2.EPSILON) * config$2.EPSILON;
17609
+ return Math.round(value / config$3.EPSILON) * config$3.EPSILON;
17578
17610
  }
17579
17611
  function duplicateArray(array) {
17580
17612
  return array.clone ? array.clone() : new Array(array.length);
@@ -17643,7 +17675,7 @@ class MathArray extends _extendableBuiltin(Array) {
17643
17675
  return new Float32Array(this);
17644
17676
  }
17645
17677
  toString() {
17646
- return this.formatString(config$2);
17678
+ return this.formatString(config$3);
17647
17679
  }
17648
17680
  formatString(opts2) {
17649
17681
  let string = "";
@@ -17743,7 +17775,7 @@ class MathArray extends _extendableBuiltin(Array) {
17743
17775
  return this.check();
17744
17776
  }
17745
17777
  check() {
17746
- if (config$2.debug && !this.validate()) {
17778
+ if (config$3.debug && !this.validate()) {
17747
17779
  throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
17748
17780
  }
17749
17781
  return this;
@@ -17810,7 +17842,7 @@ function checkNumber(value) {
17810
17842
  return value;
17811
17843
  }
17812
17844
  function checkVector(v, length2, callerName = "") {
17813
- if (config$2.debug && !validateVector(v, length2)) {
17845
+ if (config$3.debug && !validateVector(v, length2)) {
17814
17846
  throw new Error("math.gl: ".concat(callerName, " some fields set to invalid numbers'"));
17815
17847
  }
17816
17848
  return v;
@@ -18068,7 +18100,7 @@ class Vector2 extends Vector {
18068
18100
  if (isArray$3(x2) && arguments.length === 1) {
18069
18101
  this.copy(x2);
18070
18102
  } else {
18071
- if (config$2.debug) {
18103
+ if (config$3.debug) {
18072
18104
  checkNumber(x2);
18073
18105
  checkNumber(y2);
18074
18106
  }
@@ -18087,7 +18119,7 @@ class Vector2 extends Vector {
18087
18119
  return this.check();
18088
18120
  }
18089
18121
  fromObject(object2) {
18090
- if (config$2.debug) {
18122
+ if (config$3.debug) {
18091
18123
  checkNumber(object2.x);
18092
18124
  checkNumber(object2.y);
18093
18125
  }
@@ -18340,7 +18372,7 @@ class Vector3 extends Vector {
18340
18372
  if (arguments.length === 1 && isArray$3(x2)) {
18341
18373
  this.copy(x2);
18342
18374
  } else {
18343
- if (config$2.debug) {
18375
+ if (config$3.debug) {
18344
18376
  checkNumber(x2);
18345
18377
  checkNumber(y2);
18346
18378
  checkNumber(z2);
@@ -18363,7 +18395,7 @@ class Vector3 extends Vector {
18363
18395
  return this.check();
18364
18396
  }
18365
18397
  fromObject(object2) {
18366
- if (config$2.debug) {
18398
+ if (config$3.debug) {
18367
18399
  checkNumber(object2.x);
18368
18400
  checkNumber(object2.y);
18369
18401
  checkNumber(object2.z);
@@ -18454,7 +18486,7 @@ class Vector4 extends Vector {
18454
18486
  if (isArray$3(x2) && arguments.length === 1) {
18455
18487
  this.copy(x2);
18456
18488
  } else {
18457
- if (config$2.debug) {
18489
+ if (config$3.debug) {
18458
18490
  checkNumber(x2);
18459
18491
  checkNumber(y2);
18460
18492
  checkNumber(z2);
@@ -18481,7 +18513,7 @@ class Vector4 extends Vector {
18481
18513
  return this.check();
18482
18514
  }
18483
18515
  fromObject(object2) {
18484
- if (config$2.debug) {
18516
+ if (config$3.debug) {
18485
18517
  checkNumber(object2.x);
18486
18518
  checkNumber(object2.y);
18487
18519
  checkNumber(object2.z);
@@ -18539,7 +18571,7 @@ class Vector4 extends Vector {
18539
18571
  let Matrix$1 = class Matrix extends MathArray {
18540
18572
  toString() {
18541
18573
  let string = "[";
18542
- if (config$2.printRowMajor) {
18574
+ if (config$3.printRowMajor) {
18543
18575
  string += "row-major:";
18544
18576
  for (let row = 0; row < this.RANK; ++row) {
18545
18577
  for (let col = 0; col < this.RANK; ++col) {
@@ -20415,7 +20447,7 @@ class SphericalCoordinates {
20415
20447
  this.check();
20416
20448
  }
20417
20449
  toString() {
20418
- return this.formatString(config$2);
20450
+ return this.formatString(config$3);
20419
20451
  }
20420
20452
  formatString({
20421
20453
  printTypes = false
@@ -21065,7 +21097,7 @@ const esm$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
21065
21097
  atan: atan$2,
21066
21098
  clamp: clamp$2,
21067
21099
  clone: clone$8,
21068
- config: config$2,
21100
+ config: config$3,
21069
21101
  configure,
21070
21102
  cos: cos$2,
21071
21103
  degrees: degrees$1,
@@ -21214,7 +21246,7 @@ function isFunctionNode(x2) {
21214
21246
  function isIndexNode(x2) {
21215
21247
  return x2 && x2.isIndexNode === true && x2.constructor.prototype.isNode === true || false;
21216
21248
  }
21217
- function isNode(x2) {
21249
+ function isNode$1(x2) {
21218
21250
  return x2 && x2.isNode === true && x2.constructor.prototype.isNode === true || false;
21219
21251
  }
21220
21252
  function isObjectNode(x2) {
@@ -21262,7 +21294,7 @@ function typeOf(x2) {
21262
21294
  return "Range";
21263
21295
  if (isResultSet(x2))
21264
21296
  return "ResultSet";
21265
- if (isNode(x2))
21297
+ if (isNode$1(x2))
21266
21298
  return x2.type;
21267
21299
  if (isChain(x2))
21268
21300
  return "Chain";
@@ -21364,13 +21396,13 @@ function pickShallow(object2, properties) {
21364
21396
  }
21365
21397
  var MATRIX_OPTIONS = ["Matrix", "Array"];
21366
21398
  var NUMBER_OPTIONS = ["number", "BigNumber", "Fraction"];
21367
- var config$1 = function config(options) {
21399
+ var config$2 = function config(options) {
21368
21400
  if (options) {
21369
21401
  throw new Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n import { create, all } from 'mathjs';\n const mathjs = create(all);\n mathjs.config({ number: 'BigNumber' });\n");
21370
21402
  }
21371
21403
  return Object.freeze(DEFAULT_CONFIG);
21372
21404
  };
21373
- _extends(config$1, DEFAULT_CONFIG, {
21405
+ _extends(config$2, DEFAULT_CONFIG, {
21374
21406
  MATRIX_OPTIONS,
21375
21407
  NUMBER_OPTIONS
21376
21408
  });
@@ -23136,7 +23168,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$Q, function crea
23136
23168
  },
23137
23169
  {
23138
23170
  name: "Node",
23139
- test: isNode
23171
+ test: isNode$1
23140
23172
  },
23141
23173
  {
23142
23174
  name: "ObjectNode",
@@ -25313,7 +25345,7 @@ function ceil$2(x2) {
25313
25345
  function clamp$1(x2, min2, max2) {
25314
25346
  return new this(x2).clamp(min2, max2);
25315
25347
  }
25316
- function config2(obj) {
25348
+ function config$1(obj) {
25317
25349
  if (!obj || typeof obj !== "object")
25318
25350
  throw Error(decimalError + "Object expected");
25319
25351
  var i2, p, v, useDefaults = obj.defaults === true, ps = [
@@ -25465,7 +25497,7 @@ function clone$6(obj) {
25465
25497
  Decimal2.ROUND_HALF_CEIL = 7;
25466
25498
  Decimal2.ROUND_HALF_FLOOR = 8;
25467
25499
  Decimal2.EUCLID = 9;
25468
- Decimal2.config = Decimal2.set = config2;
25500
+ Decimal2.config = Decimal2.set = config$1;
25469
25501
  Decimal2.clone = clone$6;
25470
25502
  Decimal2.isDecimal = isDecimalInstance;
25471
25503
  Decimal2.abs = abs$2;
@@ -35872,7 +35904,7 @@ const node = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
35872
35904
  const require$$0$6 = /* @__PURE__ */ getAugmentedNamespace(node);
35873
35905
  var Complex = /* @__PURE__ */ createComplexClass({});
35874
35906
  var BigNumber = /* @__PURE__ */ createBigNumberClass({
35875
- config: config$1
35907
+ config: config$2
35876
35908
  });
35877
35909
  var Matrix2 = /* @__PURE__ */ createMatrixClass({});
35878
35910
  var Fraction = /* @__PURE__ */ createFractionClass({});
@@ -35889,7 +35921,7 @@ var isNumeric = /* @__PURE__ */ createIsNumeric({
35889
35921
  typed
35890
35922
  });
35891
35923
  var equalScalar = /* @__PURE__ */ createEqualScalar({
35892
- config: config$1,
35924
+ config: config$2,
35893
35925
  typed
35894
35926
  });
35895
35927
  var number = /* @__PURE__ */ createNumber({
@@ -35932,18 +35964,18 @@ var identity$3 = /* @__PURE__ */ createIdentity({
35932
35964
  BigNumber,
35933
35965
  DenseMatrix,
35934
35966
  SparseMatrix,
35935
- config: config$1,
35967
+ config: config$2,
35936
35968
  matrix,
35937
35969
  typed
35938
35970
  });
35939
35971
  var size = /* @__PURE__ */ createSize({
35940
35972
  matrix,
35941
- config: config$1,
35973
+ config: config$2,
35942
35974
  typed
35943
35975
  });
35944
35976
  var zeros = /* @__PURE__ */ createZeros({
35945
35977
  BigNumber,
35946
- config: config$1,
35978
+ config: config$2,
35947
35979
  matrix,
35948
35980
  typed
35949
35981
  });
@@ -35959,20 +35991,20 @@ var compare = /* @__PURE__ */ createCompare({
35959
35991
  BigNumber,
35960
35992
  DenseMatrix,
35961
35993
  Fraction,
35962
- config: config$1,
35994
+ config: config$2,
35963
35995
  equalScalar,
35964
35996
  matrix,
35965
35997
  typed
35966
35998
  });
35967
35999
  var smaller$1 = /* @__PURE__ */ createSmaller({
35968
36000
  DenseMatrix,
35969
- config: config$1,
36001
+ config: config$2,
35970
36002
  matrix,
35971
36003
  typed
35972
36004
  });
35973
36005
  var larger = /* @__PURE__ */ createLarger({
35974
36006
  DenseMatrix,
35975
- config: config$1,
36007
+ config: config$2,
35976
36008
  matrix,
35977
36009
  typed
35978
36010
  });
@@ -35988,7 +36020,7 @@ var dot$1 = /* @__PURE__ */ createDot({
35988
36020
  typed
35989
36021
  });
35990
36022
  var floor = /* @__PURE__ */ createFloor({
35991
- config: config$1,
36023
+ config: config$2,
35992
36024
  equalScalar,
35993
36025
  matrix,
35994
36026
  round,
@@ -36004,7 +36036,7 @@ var multiply = /* @__PURE__ */ createMultiply({
36004
36036
  });
36005
36037
  var pow$1 = /* @__PURE__ */ createPow({
36006
36038
  Complex,
36007
- config: config$1,
36039
+ config: config$2,
36008
36040
  fraction,
36009
36041
  identity: identity$3,
36010
36042
  matrix,
@@ -36036,7 +36068,7 @@ var equal$1 = /* @__PURE__ */ createEqual({
36036
36068
  typed
36037
36069
  });
36038
36070
  var ceil$1 = /* @__PURE__ */ createCeil({
36039
- config: config$1,
36071
+ config: config$2,
36040
36072
  equalScalar,
36041
36073
  matrix,
36042
36074
  round,
@@ -36106,7 +36138,7 @@ var Unit = /* @__PURE__ */ createUnitClass({
36106
36138
  Fraction,
36107
36139
  abs: abs$1,
36108
36140
  addScalar,
36109
- config: config$1,
36141
+ config: config$2,
36110
36142
  divideScalar,
36111
36143
  equal: equal$1,
36112
36144
  fix,
@@ -37195,7 +37227,7 @@ const isPureObject = (x2) => isObject$2(x2) && x2.constructor === {}.constructor
37195
37227
  const isIterable = (x2) => x2 && typeof x2[Symbol.iterator] === "function";
37196
37228
  const isAsyncIterable$1 = (x2) => x2 && typeof x2[Symbol.asyncIterator] === "function";
37197
37229
  const isResponse = (x2) => typeof Response !== "undefined" && x2 instanceof Response || x2 && x2.arrayBuffer && x2.text && x2.json;
37198
- const isBlob = (x2) => typeof Blob !== "undefined" && x2 instanceof Blob;
37230
+ const isBlob$1 = (x2) => typeof Blob !== "undefined" && x2 instanceof Blob;
37199
37231
  const isBuffer$1 = (x2) => x2 && typeof x2 === "object" && x2.isBuffer;
37200
37232
  const isReadableDOMStream = (x2) => typeof ReadableStream !== "undefined" && x2 instanceof ReadableStream || isObject$2(x2) && isFunction$1(x2.tee) && isFunction$1(x2.cancel) && isFunction$1(x2.getReader);
37201
37233
  const isReadableNodeStream = (x2) => isObject$2(x2) && isFunction$1(x2.read) && isFunction$1(x2.pipe) && isBoolean(x2.readable);
@@ -37226,7 +37258,7 @@ function getResourceUrlAndType(resource) {
37226
37258
  type: parseMIMEType(contentTypeHeader) || parseMIMETypeFromURL(url)
37227
37259
  };
37228
37260
  }
37229
- if (isBlob(resource)) {
37261
+ if (isBlob$1(resource)) {
37230
37262
  return {
37231
37263
  url: stripQueryString(resource.name || ""),
37232
37264
  type: resource.type || ""
@@ -37247,7 +37279,7 @@ function getResourceContentLength(resource) {
37247
37279
  if (isResponse(resource)) {
37248
37280
  return resource.headers["content-length"] || -1;
37249
37281
  }
37250
- if (isBlob(resource)) {
37282
+ if (isBlob$1(resource)) {
37251
37283
  return resource.size;
37252
37284
  }
37253
37285
  if (typeof resource === "string") {
@@ -38150,7 +38182,7 @@ async function selectLoader(data, loaders = [], options, context) {
38150
38182
  if (loader) {
38151
38183
  return loader;
38152
38184
  }
38153
- if (isBlob(data)) {
38185
+ if (isBlob$1(data)) {
38154
38186
  data = await data.slice(0, 10).arrayBuffer();
38155
38187
  loader = selectLoaderSync(data, loaders, options, context);
38156
38188
  }
@@ -38404,7 +38436,7 @@ function makeIterator(data, options) {
38404
38436
  if (data instanceof ArrayBuffer) {
38405
38437
  return makeArrayBufferIterator(data, options);
38406
38438
  }
38407
- if (isBlob(data)) {
38439
+ if (isBlob$1(data)) {
38408
38440
  return makeBlobIterator(data, options);
38409
38441
  }
38410
38442
  if (isReadableStream(data)) {
@@ -38451,7 +38483,7 @@ async function getArrayBufferOrStringFromData(data, loader, options) {
38451
38483
  if (typeof data === "string" || isArrayBuffer) {
38452
38484
  return getArrayBufferOrStringFromDataSync(data, loader);
38453
38485
  }
38454
- if (isBlob(data)) {
38486
+ if (isBlob$1(data)) {
38455
38487
  data = await makeResponse(data);
38456
38488
  }
38457
38489
  if (isResponse(data)) {
@@ -38570,7 +38602,7 @@ async function load(url, loaders, options, context) {
38570
38602
  if (typeof url === "string") {
38571
38603
  data = await fetch2(url);
38572
38604
  }
38573
- if (isBlob(url)) {
38605
+ if (isBlob$1(url)) {
38574
38606
  data = await fetch2(url);
38575
38607
  }
38576
38608
  return await parse$4(data, loaders, options);
@@ -89734,7 +89766,7 @@ function fromCartographic(cartographic, result = [], map2 = identity$2) {
89734
89766
  return result;
89735
89767
  }
89736
89768
  function fromCartographicToRadians(cartographic, vector = []) {
89737
- return fromCartographic(cartographic, vector, config$2._cartographicRadians ? identity$2 : toRadians);
89769
+ return fromCartographic(cartographic, vector, config$3._cartographicRadians ? identity$2 : toRadians);
89738
89770
  }
89739
89771
  function toCartographic(vector, cartographic, map2 = identity$2) {
89740
89772
  if ("longitude" in cartographic) {
@@ -89753,7 +89785,7 @@ function toCartographic(vector, cartographic, map2 = identity$2) {
89753
89785
  return cartographic;
89754
89786
  }
89755
89787
  function toCartographicFromRadians(vector, cartographic) {
89756
- return toCartographic(vector, cartographic, config$2._cartographicRadians ? identity$2 : toDegrees);
89788
+ return toCartographic(vector, cartographic, config$3._cartographicRadians ? identity$2 : toDegrees);
89757
89789
  }
89758
89790
  const scratchVector$4 = new Vector3();
89759
89791
  const scaleToGeodeticSurfaceIntersection = new Vector3();
@@ -101924,14 +101956,14 @@ var jsts_min = { exports: {} };
101924
101956
  return 1e-15;
101925
101957
  }, Object.defineProperties(q, B2);
101926
101958
  var V = function() {
101927
- }, U = { X: { configurable: true }, Y: { configurable: true }, Z: { configurable: true }, M: { configurable: true } };
101928
- U.X.get = function() {
101959
+ }, U2 = { X: { configurable: true }, Y: { configurable: true }, Z: { configurable: true }, M: { configurable: true } };
101960
+ U2.X.get = function() {
101929
101961
  return 0;
101930
- }, U.Y.get = function() {
101962
+ }, U2.Y.get = function() {
101931
101963
  return 1;
101932
- }, U.Z.get = function() {
101964
+ }, U2.Z.get = function() {
101933
101965
  return 2;
101934
- }, U.M.get = function() {
101966
+ }, U2.M.get = function() {
101935
101967
  return 3;
101936
101968
  }, V.prototype.setOrdinate = function(t3, e3, n4) {
101937
101969
  }, V.prototype.size = function() {
@@ -101949,7 +101981,7 @@ var jsts_min = { exports: {} };
101949
101981
  return [x2];
101950
101982
  }, V.prototype.getClass = function() {
101951
101983
  return V;
101952
- }, Object.defineProperties(V, U);
101984
+ }, Object.defineProperties(V, U2);
101953
101985
  var z2 = function() {
101954
101986
  }, X = function(t3) {
101955
101987
  function e3() {
@@ -134719,16 +134751,16 @@ async function getDecoder(fileDirectory) {
134719
134751
  const Decoder = await importFn();
134720
134752
  return new Decoder(fileDirectory);
134721
134753
  }
134722
- addDecoder([void 0, 1], () => import("./raw-5c61ad08.js").then((m) => m.default));
134723
- addDecoder(5, () => import("./lzw-95e1c960.js").then((m) => m.default));
134754
+ addDecoder([void 0, 1], () => import("./raw-39052bbe.js").then((m) => m.default));
134755
+ addDecoder(5, () => import("./lzw-38f62818.js").then((m) => m.default));
134724
134756
  addDecoder(6, () => {
134725
134757
  throw new Error("old style JPEG compression is not supported.");
134726
134758
  });
134727
- addDecoder(7, () => import("./jpeg-ce1ae43d.js").then((m) => m.default));
134728
- addDecoder([8, 32946], () => import("./deflate-dab09517.js").then((m) => m.default));
134729
- addDecoder(32773, () => import("./packbits-fc3d8a5d.js").then((m) => m.default));
134730
- addDecoder(34887, () => import("./lerc-0726fca8.js").then((m) => m.default));
134731
- addDecoder(50001, () => import("./webimage-1320968a.js").then((m) => m.default));
134759
+ addDecoder(7, () => import("./jpeg-c70dfc1d.js").then((m) => m.default));
134760
+ addDecoder([8, 32946], () => import("./deflate-9e66c317.js").then((m) => m.default));
134761
+ addDecoder(32773, () => import("./packbits-f244b534.js").then((m) => m.default));
134762
+ addDecoder(34887, () => import("./lerc-0367bd56.js").then((m) => m.default));
134763
+ addDecoder(50001, () => import("./webimage-722d15fb.js").then((m) => m.default));
134732
134764
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
134733
134765
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
134734
134766
  }
@@ -139733,14 +139765,14 @@ const makeTable = () => {
139733
139765
  return table;
139734
139766
  };
139735
139767
  const crcTable = new Uint32Array(makeTable());
139736
- const crc32 = (crc, buf, len2, pos) => {
139768
+ const crc32 = (crc2, buf, len2, pos) => {
139737
139769
  const t2 = crcTable;
139738
139770
  const end = pos + len2;
139739
- crc ^= -1;
139771
+ crc2 ^= -1;
139740
139772
  for (let i2 = pos; i2 < end; i2++) {
139741
- crc = crc >>> 8 ^ t2[(crc ^ buf[i2]) & 255];
139773
+ crc2 = crc2 >>> 8 ^ t2[(crc2 ^ buf[i2]) & 255];
139742
139774
  }
139743
- return crc ^ -1;
139775
+ return crc2 ^ -1;
139744
139776
  };
139745
139777
  var crc32_1 = crc32;
139746
139778
  var messages = {
@@ -141942,7 +141974,7 @@ const updatewindow = (strm, src2, end, copy2) => {
141942
141974
  }
141943
141975
  return 0;
141944
141976
  };
141945
- const inflate = (strm, flush) => {
141977
+ const inflate$1 = (strm, flush) => {
141946
141978
  let state;
141947
141979
  let input, output;
141948
141980
  let next3;
@@ -142899,7 +142931,7 @@ var inflateReset2_1 = inflateReset2;
142899
142931
  var inflateResetKeep_1 = inflateResetKeep;
142900
142932
  var inflateInit_1 = inflateInit;
142901
142933
  var inflateInit2_1 = inflateInit2;
142902
- var inflate_2 = inflate;
142934
+ var inflate_2 = inflate$1;
142903
142935
  var inflateEnd_1 = inflateEnd;
142904
142936
  var inflateGetHeader_1 = inflateGetHeader;
142905
142937
  var inflateSetDictionary_1 = inflateSetDictionary;
@@ -143081,22 +143113,22 @@ Inflate.prototype.onEnd = function(status) {
143081
143113
  this.err = status;
143082
143114
  this.msg = this.strm.msg;
143083
143115
  };
143084
- function inflate$1(input, options) {
143116
+ function inflate$1$1(input, options) {
143085
143117
  const inflator = new Inflate(options);
143086
143118
  inflator.push(input);
143087
143119
  if (inflator.err)
143088
143120
  throw inflator.msg || messages[inflator.err];
143089
143121
  return inflator.result;
143090
143122
  }
143091
- function inflateRaw(input, options) {
143123
+ function inflateRaw$1(input, options) {
143092
143124
  options = options || {};
143093
143125
  options.raw = true;
143094
- return inflate$1(input, options);
143126
+ return inflate$1$1(input, options);
143095
143127
  }
143096
143128
  var Inflate_1 = Inflate;
143097
- var inflate_2$1 = inflate$1;
143098
- var inflateRaw_1 = inflateRaw;
143099
- var ungzip = inflate$1;
143129
+ var inflate_2$1 = inflate$1$1;
143130
+ var inflateRaw_1 = inflateRaw$1;
143131
+ var ungzip = inflate$1$1;
143100
143132
  var constants$2 = constants;
143101
143133
  var inflate_1$1 = {
143102
143134
  Inflate: Inflate_1,
@@ -143106,14 +143138,14 @@ var inflate_1$1 = {
143106
143138
  constants: constants$2
143107
143139
  };
143108
143140
  const { Deflate: Deflate$1, deflate: deflate$2, deflateRaw: deflateRaw$1, gzip: gzip$1 } = deflate_1$1;
143109
- const { Inflate: Inflate$1, inflate: inflate$2, inflateRaw: inflateRaw$1, ungzip: ungzip$1 } = inflate_1$1;
143141
+ const { Inflate: Inflate$1, inflate: inflate$2, inflateRaw: inflateRaw$1$1, ungzip: ungzip$1 } = inflate_1$1;
143110
143142
  var Deflate_1$1 = Deflate$1;
143111
143143
  var deflate_1$2 = deflate$2;
143112
143144
  var deflateRaw_1$1 = deflateRaw$1;
143113
143145
  var gzip_1$1 = gzip$1;
143114
143146
  var Inflate_1$1 = Inflate$1;
143115
143147
  var inflate_1$2 = inflate$2;
143116
- var inflateRaw_1$1 = inflateRaw$1;
143148
+ var inflateRaw_1$1 = inflateRaw$1$1;
143117
143149
  var ungzip_1 = ungzip$1;
143118
143150
  var constants_1 = constants;
143119
143151
  var pako = {
@@ -143499,7 +143531,7 @@ var blosc_codec = function() {
143499
143531
  if (h.length !== d.length)
143500
143532
  throw new La("Mismatched type converter count");
143501
143533
  for (var l2 = 0; l2 < d.length; ++l2)
143502
- U(d[l2], h[l2]);
143534
+ U2(d[l2], h[l2]);
143503
143535
  }
143504
143536
  var d = [];
143505
143537
  d.forEach(function(h) {
@@ -143515,7 +143547,7 @@ var blosc_codec = function() {
143515
143547
  });
143516
143548
  0 === g2.length && c(e2);
143517
143549
  }
143518
- function U(a2, b, c) {
143550
+ function U2(a2, b, c) {
143519
143551
  c = c || {};
143520
143552
  if (!("argPackAdvance" in b))
143521
143553
  throw new TypeError("registerType registeredInstance requires argPackAdvance");
@@ -143710,7 +143742,7 @@ var blosc_codec = function() {
143710
143742
  }, z: function(a2, b, c, d, e2) {
143711
143743
  var g2 = Fa(c);
143712
143744
  b = P2(b);
143713
- U(a2, { name: b, fromWireType: function(k) {
143745
+ U2(a2, { name: b, fromWireType: function(k) {
143714
143746
  return !!k;
143715
143747
  }, toWireType: function(k, h) {
143716
143748
  return h ? d : e2;
@@ -143727,7 +143759,7 @@ var blosc_codec = function() {
143727
143759
  }, M: null });
143728
143760
  }, y: function(a2, b) {
143729
143761
  b = P2(b);
143730
- U(a2, { name: b, fromWireType: function(c) {
143762
+ U2(a2, { name: b, fromWireType: function(c) {
143731
143763
  var d = V[c].value;
143732
143764
  Qa(c);
143733
143765
  return d;
@@ -143737,7 +143769,7 @@ var blosc_codec = function() {
143737
143769
  }, h: function(a2, b, c) {
143738
143770
  c = Fa(c);
143739
143771
  b = P2(b);
143740
- U(a2, { name: b, fromWireType: function(d) {
143772
+ U2(a2, { name: b, fromWireType: function(d) {
143741
143773
  return d;
143742
143774
  }, toWireType: function(d, e2) {
143743
143775
  if ("number" !== typeof e2 && "boolean" !== typeof e2)
@@ -143805,7 +143837,7 @@ var blosc_codec = function() {
143805
143837
  };
143806
143838
  }
143807
143839
  var l2 = -1 != b.indexOf("unsigned");
143808
- U(a2, { name: b, fromWireType: g2, toWireType: function(n3, p) {
143840
+ U2(a2, { name: b, fromWireType: g2, toWireType: function(n3, p) {
143809
143841
  if ("number" !== typeof p && "boolean" !== typeof p)
143810
143842
  throw new TypeError('Cannot convert "' + Ta(p) + '" to ' + this.name);
143811
143843
  if (p < d || p > e2)
@@ -143824,11 +143856,11 @@ var blosc_codec = function() {
143824
143856
  }
143825
143857
  var e2 = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array][b];
143826
143858
  c = P2(c);
143827
- U(a2, { name: c, fromWireType: d, argPackAdvance: 8, readValueFromPointer: d }, { U: true });
143859
+ U2(a2, { name: c, fromWireType: d, argPackAdvance: 8, readValueFromPointer: d }, { U: true });
143828
143860
  }, i: function(a2, b) {
143829
143861
  b = P2(b);
143830
143862
  var c = "std::string" === b;
143831
- U(a2, { name: b, fromWireType: function(d) {
143863
+ U2(a2, { name: b, fromWireType: function(d) {
143832
143864
  var e2 = G2[d >> 2];
143833
143865
  if (c)
143834
143866
  for (var g2 = d + 4, k = 0; k <= e2; ++k) {
@@ -143895,7 +143927,7 @@ var blosc_codec = function() {
143895
143927
  4 === b && (d = na, e2 = oa, g2 = pa, k = function() {
143896
143928
  return G2;
143897
143929
  }, h = 2);
143898
- U(a2, { name: c, fromWireType: function(l2) {
143930
+ U2(a2, { name: c, fromWireType: function(l2) {
143899
143931
  for (var n3 = G2[l2 >> 2], p = k(), q, x2 = l2 + 4, B2 = 0; B2 <= n3; ++B2) {
143900
143932
  var m = l2 + 4 + B2 * b;
143901
143933
  if (B2 == n3 || 0 == p[m >> h])
@@ -143915,7 +143947,7 @@ var blosc_codec = function() {
143915
143947
  } });
143916
143948
  }, A: function(a2, b) {
143917
143949
  b = P2(b);
143918
- U(a2, {
143950
+ U2(a2, {
143919
143951
  aa: true,
143920
143952
  name: b,
143921
143953
  argPackAdvance: 0,
@@ -149692,14 +149724,14 @@ function coordinateTransformationsToMatrix(coordinateTransformations, axes) {
149692
149724
  return mat;
149693
149725
  }
149694
149726
  class NodeNotFoundError extends Error {
149695
- constructor(msg) {
149696
- super(msg);
149727
+ constructor(context, options = {}) {
149728
+ super(`Node not found: ${context}`, options);
149697
149729
  this.name = "NodeNotFoundError";
149698
149730
  }
149699
149731
  }
149700
149732
  class KeyError extends Error {
149701
- constructor(msg) {
149702
- super(msg);
149733
+ constructor(path) {
149734
+ super(`Missing key: ${path}`);
149703
149735
  this.name = "KeyError";
149704
149736
  }
149705
149737
  }
@@ -149810,56 +149842,56 @@ class ByteStringArray {
149810
149842
  _encoder = new WeakMap();
149811
149843
  const _UnicodeStringArray = class {
149812
149844
  constructor(chars, x2, byteOffset, length2) {
149813
- __publicField(this, "_data");
149845
+ __privateAdd(this, _data, void 0);
149814
149846
  __publicField(this, "chars");
149815
149847
  __privateAdd(this, _encode_buffer, void 0);
149816
149848
  this.chars = chars;
149817
149849
  if (typeof x2 === "number") {
149818
- this._data = new Int32Array(x2 * chars);
149850
+ __privateSet(this, _data, new Int32Array(x2 * chars));
149819
149851
  } else if (x2 instanceof ArrayBuffer) {
149820
149852
  if (length2)
149821
149853
  length2 *= chars;
149822
- this._data = new Int32Array(x2, byteOffset, length2);
149854
+ __privateSet(this, _data, new Int32Array(x2, byteOffset, length2));
149823
149855
  } else {
149824
149856
  const values2 = x2;
149825
149857
  const d = new _UnicodeStringArray(chars, 1);
149826
- this._data = new Int32Array(function* () {
149858
+ __privateSet(this, _data, new Int32Array(function* () {
149827
149859
  for (let str of values2) {
149828
149860
  d.set(0, str);
149829
- yield* d._data;
149861
+ yield* __privateGet(d, _data);
149830
149862
  }
149831
- }());
149863
+ }()));
149832
149864
  }
149833
149865
  __privateSet(this, _encode_buffer, new Int32Array(chars));
149834
149866
  }
149835
149867
  get BYTES_PER_ELEMENT() {
149836
- return this._data.BYTES_PER_ELEMENT * this.chars;
149868
+ return __privateGet(this, _data).BYTES_PER_ELEMENT * this.chars;
149837
149869
  }
149838
149870
  get byteLength() {
149839
- return this._data.byteLength;
149871
+ return __privateGet(this, _data).byteLength;
149840
149872
  }
149841
149873
  get byteOffset() {
149842
- return this._data.byteOffset;
149874
+ return __privateGet(this, _data).byteOffset;
149843
149875
  }
149844
149876
  /** @type {ArrayBuffer} */
149845
149877
  get buffer() {
149846
- return this._data.buffer;
149878
+ return __privateGet(this, _data).buffer;
149847
149879
  }
149848
149880
  /** @type {number} */
149849
149881
  get length() {
149850
- return this._data.length / this.chars;
149882
+ return __privateGet(this, _data).length / this.chars;
149851
149883
  }
149852
149884
  get(idx) {
149853
149885
  const offset = this.chars * idx;
149854
149886
  let result = "";
149855
149887
  for (let i2 = 0; i2 < this.chars; i2++) {
149856
- result += String.fromCodePoint(this._data[offset + i2]);
149888
+ result += String.fromCodePoint(__privateGet(this, _data)[offset + i2]);
149857
149889
  }
149858
149890
  return result.replace(/\u0000/g, "");
149859
149891
  }
149860
149892
  set(idx, value) {
149861
149893
  const offset = this.chars * idx;
149862
- const view = this._data.subarray(offset, offset + this.chars);
149894
+ const view = __privateGet(this, _data).subarray(offset, offset + this.chars);
149863
149895
  view.fill(0);
149864
149896
  for (let i2 = 0; i2 < this.chars; i2++) {
149865
149897
  view[i2] = value.codePointAt(i2) ?? 0;
@@ -149867,9 +149899,9 @@ const _UnicodeStringArray = class {
149867
149899
  }
149868
149900
  fill(value) {
149869
149901
  this.set(0, value);
149870
- let encoded = this._data.subarray(0, this.chars);
149902
+ let encoded = __privateGet(this, _data).subarray(0, this.chars);
149871
149903
  for (let i2 = 1; i2 < this.length; i2++) {
149872
- this._data.set(encoded, i2 * this.chars);
149904
+ __privateGet(this, _data).set(encoded, i2 * this.chars);
149873
149905
  }
149874
149906
  }
149875
149907
  *[Symbol.iterator]() {
@@ -149879,6 +149911,7 @@ const _UnicodeStringArray = class {
149879
149911
  }
149880
149912
  };
149881
149913
  let UnicodeStringArray = _UnicodeStringArray;
149914
+ _data = new WeakMap();
149882
149915
  _encode_buffer = new WeakMap();
149883
149916
  function json_decode_object(bytes) {
149884
149917
  const str = new TextDecoder().decode(bytes);
@@ -150244,8 +150277,115 @@ const _VLenUTF8 = class {
150244
150277
  let VLenUTF8 = _VLenUTF8;
150245
150278
  _shape2 = new WeakMap();
150246
150279
  _strides2 = new WeakMap();
150280
+ function throw_on_nan_replacer(_key, value) {
150281
+ if (value !== value) {
150282
+ throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");
150283
+ }
150284
+ if (value === Infinity) {
150285
+ throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");
150286
+ }
150287
+ if (value === -Infinity) {
150288
+ throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
150289
+ }
150290
+ return value;
150291
+ }
150292
+ function sort_keys_replacer(_key, value) {
150293
+ return value instanceof Object && !(value instanceof Array) ? Object.keys(value).sort().reduce((sorted, key) => {
150294
+ sorted[key] = value[key];
150295
+ return sorted;
150296
+ }, {}) : value;
150297
+ }
150298
+ const _JsonCodec = class {
150299
+ constructor(configuration) {
150300
+ __publicField(this, "configuration");
150301
+ __publicField(this, "kind", "array_to_bytes");
150302
+ __privateAdd(this, _encoder_config, void 0);
150303
+ __privateAdd(this, _decoder_config, void 0);
150304
+ this.configuration = configuration;
150305
+ const { encoding = "utf-8", skipkeys = false, ensure_ascii = true, check_circular = true, allow_nan = true, sort_keys = true, indent, strict = true } = configuration;
150306
+ let separators = configuration.separators;
150307
+ if (!separators) {
150308
+ if (!indent) {
150309
+ separators = [",", ":"];
150310
+ } else {
150311
+ separators = [", ", ": "];
150312
+ }
150313
+ }
150314
+ __privateSet(this, _encoder_config, {
150315
+ encoding,
150316
+ skipkeys,
150317
+ ensure_ascii,
150318
+ check_circular,
150319
+ allow_nan,
150320
+ indent,
150321
+ separators,
150322
+ sort_keys
150323
+ });
150324
+ __privateSet(this, _decoder_config, { strict });
150325
+ }
150326
+ static fromConfig(configuration) {
150327
+ return new _JsonCodec(configuration);
150328
+ }
150329
+ encode(buf) {
150330
+ const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = __privateGet(this, _encoder_config);
150331
+ if (encoding !== "utf-8") {
150332
+ throw new Error("JsonCodec does not yet support non-utf-8 encoding.");
150333
+ }
150334
+ const replacer_functions = [];
150335
+ if (!check_circular) {
150336
+ throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");
150337
+ }
150338
+ if (!allow_nan) {
150339
+ replacer_functions.push(throw_on_nan_replacer);
150340
+ }
150341
+ if (sort_keys) {
150342
+ replacer_functions.push(sort_keys_replacer);
150343
+ }
150344
+ const items = Array.from(buf.data);
150345
+ items.push("|O");
150346
+ items.push(buf.shape);
150347
+ let replacer = void 0;
150348
+ if (replacer_functions.length) {
150349
+ replacer = function(key, value) {
150350
+ let new_value = value;
150351
+ replacer_functions.forEach((sub_replacer) => {
150352
+ new_value = sub_replacer(key, new_value);
150353
+ });
150354
+ return new_value;
150355
+ };
150356
+ }
150357
+ let json_str = JSON.stringify(items, replacer, indent);
150358
+ if (ensure_ascii) {
150359
+ json_str = json_str.replace(/[\u007F-\uFFFF]/g, function(chr) {
150360
+ const full_str = "0000" + chr.charCodeAt(0).toString(16);
150361
+ const sub_str = full_str.substring(full_str.length - 4);
150362
+ return "\\u" + sub_str;
150363
+ });
150364
+ }
150365
+ return new TextEncoder().encode(json_str);
150366
+ }
150367
+ decode(bytes) {
150368
+ const { strict } = __privateGet(this, _decoder_config);
150369
+ if (!strict) {
150370
+ throw new Error("JsonCodec does not yet support non-strict decoding.");
150371
+ }
150372
+ const items = json_decode_object(bytes);
150373
+ const shape = items.pop();
150374
+ items.pop();
150375
+ if (!shape) {
150376
+ throw new Error("0D not implemented for JsonCodec.");
150377
+ } else {
150378
+ const stride = get_strides(shape, "C");
150379
+ const data = items;
150380
+ return { data, shape, stride };
150381
+ }
150382
+ }
150383
+ };
150384
+ let JsonCodec = _JsonCodec;
150385
+ _encoder_config = new WeakMap();
150386
+ _decoder_config = new WeakMap();
150247
150387
  function create_default_registry() {
150248
- return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-0acfcf7e.js").then((m) => m.default)).set("gzip", () => import("./gzip-dd5ab7c8.js").then((m) => m.default)).set("lz4", () => import("./lz4-abb4416a.js").then((m) => m.default)).set("zlib", () => import("./zlib-cd823c38.js").then((m) => m.default)).set("zstd", () => import("./zstd-4072ca78.js").then((m) => m.default)).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8);
150388
+ return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-537fd004.js").then((m) => m.default)).set("gzip", () => import("./gzip-6a24f0fe.js").then((m) => m.default)).set("lz4", () => import("./lz4-bbd18009.js").then((m) => m.default)).set("zlib", () => import("./zlib-175cd38d.js").then((m) => m.default)).set("zstd", () => import("./zstd-ec5a40b8.js").then((m) => m.default)).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec);
150249
150389
  }
150250
150390
  const registry = create_default_registry();
150251
150391
  function create_codec_pipeline(chunk_metadata) {
@@ -150491,6 +150631,7 @@ let Array$1 = (_b = class extends Location {
150491
150631
  return is_dtype(this.dtype, query);
150492
150632
  }
150493
150633
  }, _a2 = CONTEXT_MARKER, _metadata2 = new WeakMap(), _b);
150634
+ let VERSION_COUNTER = create_version_counter();
150494
150635
  function create_version_counter() {
150495
150636
  let version_counts = /* @__PURE__ */ new WeakMap();
150496
150637
  function get_counts(store) {
@@ -150508,7 +150649,6 @@ function create_version_counter() {
150508
150649
  }
150509
150650
  };
150510
150651
  }
150511
- let VERSION_COUNTER = create_version_counter();
150512
150652
  async function load_attrs(location) {
150513
150653
  let meta_bytes = await location.store.get(location.resolve(".zattrs").path);
150514
150654
  if (!meta_bytes)
@@ -150534,7 +150674,9 @@ async function open_array_v2(location, attrs) {
150534
150674
  let { path } = location.resolve(".zarray");
150535
150675
  let meta2 = await location.store.get(path);
150536
150676
  if (!meta2) {
150537
- throw new NodeNotFoundError(path);
150677
+ throw new NodeNotFoundError("v2 array", {
150678
+ cause: new KeyError(path)
150679
+ });
150538
150680
  }
150539
150681
  VERSION_COUNTER.increment(location.store, "v2");
150540
150682
  return new Array$1(location.store, location.path, v2_to_v3_array_metadata(json_decode_object(meta2), attrs));
@@ -150543,7 +150685,9 @@ async function open_group_v2(location, attrs) {
150543
150685
  let { path } = location.resolve(".zgroup");
150544
150686
  let meta2 = await location.store.get(path);
150545
150687
  if (!meta2) {
150546
- throw new NodeNotFoundError(path);
150688
+ throw new NodeNotFoundError("v2 group", {
150689
+ cause: new KeyError(path)
150690
+ });
150547
150691
  }
150548
150692
  VERSION_COUNTER.increment(location.store, "v2");
150549
150693
  return new Group(location.store, location.path, v2_to_v3_group_metadata(json_decode_object(meta2), attrs));
@@ -150552,7 +150696,9 @@ async function _open_v3(location) {
150552
150696
  let { store, path } = location.resolve("zarr.json");
150553
150697
  let meta2 = await location.store.get(path);
150554
150698
  if (!meta2) {
150555
- throw new NodeNotFoundError(path);
150699
+ throw new NodeNotFoundError("v3 array or group", {
150700
+ cause: new KeyError(path)
150701
+ });
150556
150702
  }
150557
150703
  let meta_doc = json_decode_object(meta2);
150558
150704
  if (meta_doc.node_type === "array" && (meta_doc.data_type === "uint64" || meta_doc.data_type === "int64") && meta_doc.fill_value != void 0) {
@@ -150574,8 +150720,8 @@ async function open_v3(location, options = {}) {
150574
150720
  throw new Error(`Expected node of kind ${options.kind}, found ${kind}.`);
150575
150721
  }
150576
150722
  async function open(location, options = {}) {
150577
- const store = "store" in location ? location.store : location;
150578
- const version_max = VERSION_COUNTER.version_max(store);
150723
+ let store = "store" in location ? location.store : location;
150724
+ let version_max = VERSION_COUNTER.version_max(store);
150579
150725
  let open_primary = version_max === "v2" ? open.v2 : open.v3;
150580
150726
  let open_secondary = version_max === "v2" ? open.v3 : open.v2;
150581
150727
  return open_primary(location, options).catch((err2) => {
@@ -150619,7 +150765,7 @@ function* product(...iterables) {
150619
150765
  results[i2] = iterators[i2].next();
150620
150766
  }
150621
150767
  }
150622
- function slice_indices(start, stop, step, length2) {
150768
+ function slice_indices({ start, stop, step }, length2) {
150623
150769
  if (step === 0) {
150624
150770
  throw new Error("slice step cannot be zero");
150625
150771
  }
@@ -150660,10 +150806,7 @@ function slice(start, stop, step = null) {
150660
150806
  return {
150661
150807
  start,
150662
150808
  stop,
150663
- step,
150664
- indices(length2) {
150665
- return slice_indices(this.start, this.stop, this.step, length2);
150666
- }
150809
+ step
150667
150810
  };
150668
150811
  }
150669
150812
  function create_queue() {
@@ -150731,7 +150874,7 @@ class SliceDimIndexer {
150731
150874
  __publicField(this, "dim_chunk_len");
150732
150875
  __publicField(this, "nitems");
150733
150876
  __publicField(this, "nchunks");
150734
- const [start, stop, step] = dim_sel.indices(dim_len);
150877
+ const [start, stop, step] = slice_indices(dim_sel, dim_len);
150735
150878
  this.start = start;
150736
150879
  this.stop = stop;
150737
150880
  this.step = step;
@@ -150817,25 +150960,20 @@ function unwrap(arr, idx) {
150817
150960
  }
150818
150961
  async function get$1(arr, selection, opts2, setter2) {
150819
150962
  var _a3;
150820
- const context = get_context(arr);
150821
- const indexer = new BasicIndexer({
150963
+ let context = get_context(arr);
150964
+ let indexer = new BasicIndexer({
150822
150965
  selection,
150823
150966
  shape: arr.shape,
150824
150967
  chunk_shape: arr.chunks
150825
150968
  });
150826
- const out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a2, b) => a2 * b, 1)), indexer.shape, context.get_strides(indexer.shape, opts2.order));
150827
- const queue = ((_a3 = opts2.create_queue) == null ? void 0 : _a3.call(opts2)) ?? create_queue();
150969
+ let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a2, b) => a2 * b, 1)), indexer.shape, context.get_strides(indexer.shape, opts2.order));
150970
+ let queue = ((_a3 = opts2.create_queue) == null ? void 0 : _a3.call(opts2)) ?? create_queue();
150828
150971
  for (const { chunk_coords, mapping } of indexer) {
150829
- queue.add(() => arr.getChunk(chunk_coords, opts2.opts).then(({ data, shape, stride }) => {
150830
- const chunk = setter2.prepare(data, shape, stride);
150972
+ queue.add(async () => {
150973
+ let { data, shape, stride } = await arr.getChunk(chunk_coords, opts2.opts);
150974
+ let chunk = setter2.prepare(data, shape, stride);
150831
150975
  setter2.set_from_chunk(out, chunk, mapping);
150832
- }).catch((err2) => {
150833
- if (!(err2 instanceof KeyError))
150834
- throw err2;
150835
- if (context.fill_value) {
150836
- setter2.set_scalar(out, mapping.map((m) => m.to).filter((s2) => s2 !== null), context.fill_value);
150837
- }
150838
- }));
150976
+ });
150839
150977
  }
150840
150978
  await queue.onIdle();
150841
150979
  return indexer.shape.length === 0 ? unwrap(out.data, 0) : out;
@@ -150988,6 +151126,9 @@ function set_from_chunk_binary(dest, src2, bytes_per_element2, projections) {
150988
151126
  }, bytes_per_element2, projs);
150989
151127
  }
150990
151128
  }
151129
+ function strip_prefix(path) {
151130
+ return path.slice(1);
151131
+ }
150991
151132
  function fetch_range(url, offset, length2, opts2 = {}) {
150992
151133
  if (offset !== void 0 && length2 !== void 0) {
150993
151134
  opts2 = {
@@ -151000,6 +151141,16 @@ function fetch_range(url, offset, length2, opts2 = {}) {
151000
151141
  }
151001
151142
  return fetch(url, opts2);
151002
151143
  }
151144
+ function merge_init(storeOverrides, requestOverrides) {
151145
+ return {
151146
+ ...storeOverrides,
151147
+ ...requestOverrides,
151148
+ headers: {
151149
+ ...storeOverrides.headers,
151150
+ ...requestOverrides.headers
151151
+ }
151152
+ };
151153
+ }
151003
151154
  function resolve(root2, path) {
151004
151155
  const base = typeof root2 === "string" ? new URL(root2) : root2;
151005
151156
  if (!base.pathname.endsWith("/")) {
@@ -151064,14 +151215,7 @@ _overrides = new WeakMap();
151064
151215
  _use_suffix_request = new WeakMap();
151065
151216
  _merge_init = new WeakSet();
151066
151217
  merge_init_fn = function(overrides) {
151067
- return {
151068
- ...__privateGet(this, _overrides),
151069
- ...overrides,
151070
- headers: {
151071
- ...__privateGet(this, _overrides).headers,
151072
- ...overrides.headers
151073
- }
151074
- };
151218
+ return merge_init(__privateGet(this, _overrides), overrides);
151075
151219
  };
151076
151220
  const FetchStore$1 = FetchStore;
151077
151221
  function getV2DataType(dtype) {
@@ -151113,8 +151257,896 @@ function createZarrArrayAdapter(arr) {
151113
151257
  }
151114
151258
  });
151115
151259
  }
151116
- function zarrOpenRoot(url, requestInit2) {
151117
- const store = new FetchStore$1(url, { overrides: requestInit2 });
151260
+ function readBlobAsArrayBuffer(blob) {
151261
+ if (blob.arrayBuffer) {
151262
+ return blob.arrayBuffer();
151263
+ }
151264
+ return new Promise((resolve2, reject) => {
151265
+ const reader = new FileReader();
151266
+ reader.addEventListener("loadend", () => {
151267
+ resolve2(reader.result);
151268
+ });
151269
+ reader.addEventListener("error", reject);
151270
+ reader.readAsArrayBuffer(blob);
151271
+ });
151272
+ }
151273
+ async function readBlobAsUint8Array(blob) {
151274
+ const arrayBuffer2 = await readBlobAsArrayBuffer(blob);
151275
+ return new Uint8Array(arrayBuffer2);
151276
+ }
151277
+ function isBlob(v) {
151278
+ return typeof Blob !== "undefined" && v instanceof Blob;
151279
+ }
151280
+ function isSharedArrayBuffer(b) {
151281
+ return typeof SharedArrayBuffer !== "undefined" && b instanceof SharedArrayBuffer;
151282
+ }
151283
+ const isNode = typeof process !== "undefined" && process.versions && typeof process.versions.node !== "undefined" && typeof process.versions.electron === "undefined";
151284
+ function isTypedArraySameAsArrayBuffer(typedArray) {
151285
+ return typedArray.byteOffset === 0 && typedArray.byteLength === typedArray.buffer.byteLength;
151286
+ }
151287
+ class ArrayBufferReader {
151288
+ constructor(arrayBufferOrView) {
151289
+ this.typedArray = arrayBufferOrView instanceof ArrayBuffer || isSharedArrayBuffer(arrayBufferOrView) ? new Uint8Array(arrayBufferOrView) : new Uint8Array(arrayBufferOrView.buffer, arrayBufferOrView.byteOffset, arrayBufferOrView.byteLength);
151290
+ }
151291
+ async getLength() {
151292
+ return this.typedArray.byteLength;
151293
+ }
151294
+ async read(offset, length2) {
151295
+ return new Uint8Array(this.typedArray.buffer, this.typedArray.byteOffset + offset, length2);
151296
+ }
151297
+ }
151298
+ let BlobReader$1 = class BlobReader {
151299
+ constructor(blob) {
151300
+ this.blob = blob;
151301
+ }
151302
+ async getLength() {
151303
+ return this.blob.size;
151304
+ }
151305
+ async read(offset, length2) {
151306
+ const blob = this.blob.slice(offset, offset + length2);
151307
+ const arrayBuffer2 = await readBlobAsArrayBuffer(blob);
151308
+ return new Uint8Array(arrayBuffer2);
151309
+ }
151310
+ async sliceAsBlob(offset, length2, type = "") {
151311
+ return this.blob.slice(offset, offset + length2, type);
151312
+ }
151313
+ };
151314
+ function inflate(data, buf) {
151315
+ var u8 = Uint8Array;
151316
+ if (data[0] == 3 && data[1] == 0)
151317
+ return buf ? buf : new u8(0);
151318
+ var bitsF = _bitsF, bitsE = _bitsE, decodeTiny = _decodeTiny, get17 = _get17;
151319
+ var noBuf = buf == null;
151320
+ if (noBuf)
151321
+ buf = new u8(data.length >>> 2 << 3);
151322
+ var BFINAL = 0, BTYPE = 0, HLIT = 0, HDIST = 0, HCLEN = 0, ML = 0, MD = 0;
151323
+ var off = 0, pos = 0;
151324
+ var lmap, dmap;
151325
+ while (BFINAL == 0) {
151326
+ BFINAL = bitsF(data, pos, 1);
151327
+ BTYPE = bitsF(data, pos + 1, 2);
151328
+ pos += 3;
151329
+ if (BTYPE == 0) {
151330
+ if ((pos & 7) != 0)
151331
+ pos += 8 - (pos & 7);
151332
+ var p8 = (pos >>> 3) + 4, len2 = data[p8 - 4] | data[p8 - 3] << 8;
151333
+ if (noBuf)
151334
+ buf = _check(buf, off + len2);
151335
+ buf.set(new u8(data.buffer, data.byteOffset + p8, len2), off);
151336
+ pos = p8 + len2 << 3;
151337
+ off += len2;
151338
+ continue;
151339
+ }
151340
+ if (noBuf)
151341
+ buf = _check(buf, off + (1 << 17));
151342
+ if (BTYPE == 1) {
151343
+ lmap = U.flmap;
151344
+ dmap = U.fdmap;
151345
+ ML = (1 << 9) - 1;
151346
+ MD = (1 << 5) - 1;
151347
+ }
151348
+ if (BTYPE == 2) {
151349
+ HLIT = bitsE(data, pos, 5) + 257;
151350
+ HDIST = bitsE(data, pos + 5, 5) + 1;
151351
+ HCLEN = bitsE(data, pos + 10, 4) + 4;
151352
+ pos += 14;
151353
+ for (var i2 = 0; i2 < 38; i2 += 2) {
151354
+ U.itree[i2] = 0;
151355
+ U.itree[i2 + 1] = 0;
151356
+ }
151357
+ var tl = 1;
151358
+ for (var i2 = 0; i2 < HCLEN; i2++) {
151359
+ var l2 = bitsE(data, pos + i2 * 3, 3);
151360
+ U.itree[(U.ordr[i2] << 1) + 1] = l2;
151361
+ if (l2 > tl)
151362
+ tl = l2;
151363
+ }
151364
+ pos += 3 * HCLEN;
151365
+ makeCodes(U.itree, tl);
151366
+ codes2map(U.itree, tl, U.imap);
151367
+ lmap = U.lmap;
151368
+ dmap = U.dmap;
151369
+ pos = decodeTiny(U.imap, (1 << tl) - 1, HLIT + HDIST, data, pos, U.ttree);
151370
+ var mx0 = _copyOut(U.ttree, 0, HLIT, U.ltree);
151371
+ ML = (1 << mx0) - 1;
151372
+ var mx1 = _copyOut(U.ttree, HLIT, HDIST, U.dtree);
151373
+ MD = (1 << mx1) - 1;
151374
+ makeCodes(U.ltree, mx0);
151375
+ codes2map(U.ltree, mx0, lmap);
151376
+ makeCodes(U.dtree, mx1);
151377
+ codes2map(U.dtree, mx1, dmap);
151378
+ }
151379
+ while (true) {
151380
+ var code = lmap[get17(data, pos) & ML];
151381
+ pos += code & 15;
151382
+ var lit = code >>> 4;
151383
+ if (lit >>> 8 == 0) {
151384
+ buf[off++] = lit;
151385
+ } else if (lit == 256) {
151386
+ break;
151387
+ } else {
151388
+ var end = off + lit - 254;
151389
+ if (lit > 264) {
151390
+ var ebs = U.ldef[lit - 257];
151391
+ end = off + (ebs >>> 3) + bitsE(data, pos, ebs & 7);
151392
+ pos += ebs & 7;
151393
+ }
151394
+ var dcode = dmap[get17(data, pos) & MD];
151395
+ pos += dcode & 15;
151396
+ var dlit = dcode >>> 4;
151397
+ var dbs = U.ddef[dlit], dst = (dbs >>> 4) + bitsF(data, pos, dbs & 15);
151398
+ pos += dbs & 15;
151399
+ if (noBuf)
151400
+ buf = _check(buf, off + (1 << 17));
151401
+ while (off < end) {
151402
+ buf[off] = buf[off++ - dst];
151403
+ buf[off] = buf[off++ - dst];
151404
+ buf[off] = buf[off++ - dst];
151405
+ buf[off] = buf[off++ - dst];
151406
+ }
151407
+ off = end;
151408
+ }
151409
+ }
151410
+ }
151411
+ return buf.length == off ? buf : buf.slice(0, off);
151412
+ }
151413
+ function _check(buf, len2) {
151414
+ var bl = buf.length;
151415
+ if (len2 <= bl)
151416
+ return buf;
151417
+ var nbuf = new Uint8Array(Math.max(bl << 1, len2));
151418
+ nbuf.set(buf, 0);
151419
+ return nbuf;
151420
+ }
151421
+ function _decodeTiny(lmap, LL, len2, data, pos, tree) {
151422
+ var bitsE = _bitsE, get17 = _get17;
151423
+ var i2 = 0;
151424
+ while (i2 < len2) {
151425
+ var code = lmap[get17(data, pos) & LL];
151426
+ pos += code & 15;
151427
+ var lit = code >>> 4;
151428
+ if (lit <= 15) {
151429
+ tree[i2] = lit;
151430
+ i2++;
151431
+ } else {
151432
+ var ll = 0, n3 = 0;
151433
+ if (lit == 16) {
151434
+ n3 = 3 + bitsE(data, pos, 2);
151435
+ pos += 2;
151436
+ ll = tree[i2 - 1];
151437
+ } else if (lit == 17) {
151438
+ n3 = 3 + bitsE(data, pos, 3);
151439
+ pos += 3;
151440
+ } else if (lit == 18) {
151441
+ n3 = 11 + bitsE(data, pos, 7);
151442
+ pos += 7;
151443
+ }
151444
+ var ni = i2 + n3;
151445
+ while (i2 < ni) {
151446
+ tree[i2] = ll;
151447
+ i2++;
151448
+ }
151449
+ }
151450
+ }
151451
+ return pos;
151452
+ }
151453
+ function _copyOut(src2, off, len2, tree) {
151454
+ var mx = 0, i2 = 0, tl = tree.length >>> 1;
151455
+ while (i2 < len2) {
151456
+ var v = src2[i2 + off];
151457
+ tree[i2 << 1] = 0;
151458
+ tree[(i2 << 1) + 1] = v;
151459
+ if (v > mx)
151460
+ mx = v;
151461
+ i2++;
151462
+ }
151463
+ while (i2 < tl) {
151464
+ tree[i2 << 1] = 0;
151465
+ tree[(i2 << 1) + 1] = 0;
151466
+ i2++;
151467
+ }
151468
+ return mx;
151469
+ }
151470
+ function makeCodes(tree, MAX_BITS2) {
151471
+ var max_code = tree.length;
151472
+ var code, bits, n3, i2, len2;
151473
+ var bl_count = U.bl_count;
151474
+ for (var i2 = 0; i2 <= MAX_BITS2; i2++)
151475
+ bl_count[i2] = 0;
151476
+ for (i2 = 1; i2 < max_code; i2 += 2)
151477
+ bl_count[tree[i2]]++;
151478
+ var next_code = U.next_code;
151479
+ code = 0;
151480
+ bl_count[0] = 0;
151481
+ for (bits = 1; bits <= MAX_BITS2; bits++) {
151482
+ code = code + bl_count[bits - 1] << 1;
151483
+ next_code[bits] = code;
151484
+ }
151485
+ for (n3 = 0; n3 < max_code; n3 += 2) {
151486
+ len2 = tree[n3 + 1];
151487
+ if (len2 != 0) {
151488
+ tree[n3] = next_code[len2];
151489
+ next_code[len2]++;
151490
+ }
151491
+ }
151492
+ }
151493
+ function codes2map(tree, MAX_BITS2, map2) {
151494
+ var max_code = tree.length;
151495
+ var r15 = U.rev15;
151496
+ for (var i2 = 0; i2 < max_code; i2 += 2)
151497
+ if (tree[i2 + 1] != 0) {
151498
+ var lit = i2 >> 1;
151499
+ var cl = tree[i2 + 1], val = lit << 4 | cl;
151500
+ var rest = MAX_BITS2 - cl, i0 = tree[i2] << rest, i1 = i0 + (1 << rest);
151501
+ while (i0 != i1) {
151502
+ var p02 = r15[i0] >>> 15 - MAX_BITS2;
151503
+ map2[p02] = val;
151504
+ i0++;
151505
+ }
151506
+ }
151507
+ }
151508
+ function revCodes(tree, MAX_BITS2) {
151509
+ var r15 = U.rev15, imb = 15 - MAX_BITS2;
151510
+ for (var i2 = 0; i2 < tree.length; i2 += 2) {
151511
+ var i0 = tree[i2] << MAX_BITS2 - tree[i2 + 1];
151512
+ tree[i2] = r15[i0] >>> imb;
151513
+ }
151514
+ }
151515
+ function _bitsE(dt, pos, length2) {
151516
+ return (dt[pos >>> 3] | dt[(pos >>> 3) + 1] << 8) >>> (pos & 7) & (1 << length2) - 1;
151517
+ }
151518
+ function _bitsF(dt, pos, length2) {
151519
+ return (dt[pos >>> 3] | dt[(pos >>> 3) + 1] << 8 | dt[(pos >>> 3) + 2] << 16) >>> (pos & 7) & (1 << length2) - 1;
151520
+ }
151521
+ function _get17(dt, pos) {
151522
+ return (dt[pos >>> 3] | dt[(pos >>> 3) + 1] << 8 | dt[(pos >>> 3) + 2] << 16) >>> (pos & 7);
151523
+ }
151524
+ const U = function() {
151525
+ var u16 = Uint16Array, u32 = Uint32Array;
151526
+ return {
151527
+ next_code: new u16(16),
151528
+ bl_count: new u16(16),
151529
+ ordr: [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],
151530
+ of0: [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 999, 999, 999],
151531
+ exb: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],
151532
+ ldef: new u16(32),
151533
+ df0: [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 65535, 65535],
151534
+ dxb: [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],
151535
+ ddef: new u32(32),
151536
+ flmap: new u16(512),
151537
+ fltree: [],
151538
+ fdmap: new u16(32),
151539
+ fdtree: [],
151540
+ lmap: new u16(32768),
151541
+ ltree: [],
151542
+ ttree: [],
151543
+ dmap: new u16(32768),
151544
+ dtree: [],
151545
+ imap: new u16(512),
151546
+ itree: [],
151547
+ //rev9 : new u16( 512)
151548
+ rev15: new u16(1 << 15),
151549
+ lhst: new u32(286),
151550
+ dhst: new u32(30),
151551
+ ihst: new u32(19),
151552
+ lits: new u32(15e3),
151553
+ strt: new u16(1 << 16),
151554
+ prev: new u16(1 << 15)
151555
+ };
151556
+ }();
151557
+ (function() {
151558
+ var len2 = 1 << 15;
151559
+ for (var i2 = 0; i2 < len2; i2++) {
151560
+ var x2 = i2;
151561
+ x2 = (x2 & 2863311530) >>> 1 | (x2 & 1431655765) << 1;
151562
+ x2 = (x2 & 3435973836) >>> 2 | (x2 & 858993459) << 2;
151563
+ x2 = (x2 & 4042322160) >>> 4 | (x2 & 252645135) << 4;
151564
+ x2 = (x2 & 4278255360) >>> 8 | (x2 & 16711935) << 8;
151565
+ U.rev15[i2] = (x2 >>> 16 | x2 << 16) >>> 17;
151566
+ }
151567
+ function pushV(tgt, n3, sv) {
151568
+ while (n3-- != 0)
151569
+ tgt.push(0, sv);
151570
+ }
151571
+ for (var i2 = 0; i2 < 32; i2++) {
151572
+ U.ldef[i2] = U.of0[i2] << 3 | U.exb[i2];
151573
+ U.ddef[i2] = U.df0[i2] << 4 | U.dxb[i2];
151574
+ }
151575
+ pushV(U.fltree, 144, 8);
151576
+ pushV(U.fltree, 255 - 143, 9);
151577
+ pushV(U.fltree, 279 - 255, 7);
151578
+ pushV(U.fltree, 287 - 279, 8);
151579
+ makeCodes(U.fltree, 9);
151580
+ codes2map(U.fltree, 9, U.flmap);
151581
+ revCodes(U.fltree, 9);
151582
+ pushV(U.fdtree, 32, 5);
151583
+ makeCodes(U.fdtree, 5);
151584
+ codes2map(U.fdtree, 5, U.fdmap);
151585
+ revCodes(U.fdtree, 5);
151586
+ pushV(U.itree, 19, 0);
151587
+ pushV(U.ltree, 286, 0);
151588
+ pushV(U.dtree, 30, 0);
151589
+ pushV(U.ttree, 320, 0);
151590
+ })();
151591
+ const crc = {
151592
+ table: function() {
151593
+ var tab = new Uint32Array(256);
151594
+ for (var n3 = 0; n3 < 256; n3++) {
151595
+ var c = n3;
151596
+ for (var k = 0; k < 8; k++) {
151597
+ if (c & 1)
151598
+ c = 3988292384 ^ c >>> 1;
151599
+ else
151600
+ c = c >>> 1;
151601
+ }
151602
+ tab[n3] = c;
151603
+ }
151604
+ return tab;
151605
+ }(),
151606
+ update: function(c, buf, off, len2) {
151607
+ for (var i2 = 0; i2 < len2; i2++)
151608
+ c = crc.table[(c ^ buf[off + i2]) & 255] ^ c >>> 8;
151609
+ return c;
151610
+ },
151611
+ crc: function(b, o2, l2) {
151612
+ return crc.update(4294967295, b, o2, l2) ^ 4294967295;
151613
+ }
151614
+ };
151615
+ function inflateRaw(file, buf) {
151616
+ return inflate(file, buf);
151617
+ }
151618
+ const config2 = {
151619
+ numWorkers: 1,
151620
+ workerURL: "",
151621
+ useWorkers: false
151622
+ };
151623
+ let nextId = 0;
151624
+ const waitingForWorkerQueue = [];
151625
+ function startWorker(url) {
151626
+ return new Promise((resolve2, reject) => {
151627
+ const worker = new Worker(url);
151628
+ worker.onmessage = (e2) => {
151629
+ if (e2.data === "start") {
151630
+ worker.onerror = void 0;
151631
+ worker.onmessage = void 0;
151632
+ resolve2(worker);
151633
+ } else {
151634
+ reject(new Error(`unexpected message: ${e2.data}`));
151635
+ }
151636
+ };
151637
+ worker.onerror = reject;
151638
+ });
151639
+ }
151640
+ function dynamicRequire(mod2, request) {
151641
+ return mod2.require ? mod2.require(request) : {};
151642
+ }
151643
+ (function() {
151644
+ if (isNode) {
151645
+ const { Worker: Worker3 } = dynamicRequire(module, "worker_threads");
151646
+ return {
151647
+ async createWorker(url) {
151648
+ return new Worker3(url);
151649
+ },
151650
+ addEventListener(worker, fn) {
151651
+ worker.on("message", (data) => {
151652
+ fn({ target: worker, data });
151653
+ });
151654
+ },
151655
+ async terminate(worker) {
151656
+ await worker.terminate();
151657
+ }
151658
+ };
151659
+ } else {
151660
+ return {
151661
+ async createWorker(url) {
151662
+ try {
151663
+ const worker = await startWorker(url);
151664
+ return worker;
151665
+ } catch (e2) {
151666
+ console.warn("could not load worker:", url);
151667
+ }
151668
+ let text;
151669
+ try {
151670
+ const req = await fetch(url, { mode: "cors" });
151671
+ if (!req.ok) {
151672
+ throw new Error(`could not load: ${url}`);
151673
+ }
151674
+ text = await req.text();
151675
+ url = URL.createObjectURL(new Blob([text], { type: "application/javascript" }));
151676
+ const worker = await startWorker(url);
151677
+ config2.workerURL = url;
151678
+ return worker;
151679
+ } catch (e2) {
151680
+ console.warn("could not load worker via fetch:", url);
151681
+ }
151682
+ if (text !== void 0) {
151683
+ try {
151684
+ url = `data:application/javascript;base64,${btoa(text)}`;
151685
+ const worker = await startWorker(url);
151686
+ config2.workerURL = url;
151687
+ return worker;
151688
+ } catch (e2) {
151689
+ console.warn("could not load worker via dataURI");
151690
+ }
151691
+ }
151692
+ console.warn("workers will not be used");
151693
+ throw new Error("can not start workers");
151694
+ },
151695
+ addEventListener(worker, fn) {
151696
+ worker.addEventListener("message", fn);
151697
+ },
151698
+ async terminate(worker) {
151699
+ worker.terminate();
151700
+ }
151701
+ };
151702
+ }
151703
+ })();
151704
+ function inflateRawLocal(src2, uncompressedSize, type, resolve2) {
151705
+ const dst = new Uint8Array(uncompressedSize);
151706
+ inflateRaw(src2, dst);
151707
+ resolve2(type ? new Blob([dst], { type }) : dst.buffer);
151708
+ }
151709
+ async function processWaitingForWorkerQueue() {
151710
+ if (waitingForWorkerQueue.length === 0) {
151711
+ return;
151712
+ }
151713
+ while (waitingForWorkerQueue.length) {
151714
+ const { src: src2, uncompressedSize, type, resolve: resolve2 } = waitingForWorkerQueue.shift();
151715
+ let data = src2;
151716
+ if (isBlob(src2)) {
151717
+ data = await readBlobAsUint8Array(src2);
151718
+ }
151719
+ inflateRawLocal(data, uncompressedSize, type, resolve2);
151720
+ }
151721
+ }
151722
+ function inflateRawAsync(src2, uncompressedSize, type) {
151723
+ return new Promise((resolve2, reject) => {
151724
+ waitingForWorkerQueue.push({ src: src2, uncompressedSize, type, resolve: resolve2, reject, id: nextId++ });
151725
+ processWaitingForWorkerQueue();
151726
+ });
151727
+ }
151728
+ function dosDateTimeToDate(date, time) {
151729
+ const day = date & 31;
151730
+ const month = (date >> 5 & 15) - 1;
151731
+ const year = (date >> 9 & 127) + 1980;
151732
+ const millisecond = 0;
151733
+ const second = (time & 31) * 2;
151734
+ const minute = time >> 5 & 63;
151735
+ const hour = time >> 11 & 31;
151736
+ return new Date(year, month, day, hour, minute, second, millisecond);
151737
+ }
151738
+ class ZipEntry {
151739
+ constructor(reader, rawEntry) {
151740
+ this._reader = reader;
151741
+ this._rawEntry = rawEntry;
151742
+ this.name = rawEntry.name;
151743
+ this.nameBytes = rawEntry.nameBytes;
151744
+ this.size = rawEntry.uncompressedSize;
151745
+ this.compressedSize = rawEntry.compressedSize;
151746
+ this.comment = rawEntry.comment;
151747
+ this.commentBytes = rawEntry.commentBytes;
151748
+ this.compressionMethod = rawEntry.compressionMethod;
151749
+ this.lastModDate = dosDateTimeToDate(rawEntry.lastModFileDate, rawEntry.lastModFileTime);
151750
+ this.isDirectory = rawEntry.uncompressedSize === 0 && rawEntry.name.endsWith("/");
151751
+ this.encrypted = !!(rawEntry.generalPurposeBitFlag & 1);
151752
+ this.externalFileAttributes = rawEntry.externalFileAttributes;
151753
+ this.versionMadeBy = rawEntry.versionMadeBy;
151754
+ }
151755
+ // returns a promise that returns a Blob for this entry
151756
+ async blob(type = "application/octet-stream") {
151757
+ return await readEntryDataAsBlob(this._reader, this._rawEntry, type);
151758
+ }
151759
+ // returns a promise that returns an ArrayBuffer for this entry
151760
+ async arrayBuffer() {
151761
+ return await readEntryDataAsArrayBuffer(this._reader, this._rawEntry);
151762
+ }
151763
+ // returns text, assumes the text is valid utf8. If you want more options decode arrayBuffer yourself
151764
+ async text() {
151765
+ const buffer2 = await this.arrayBuffer();
151766
+ return decodeBuffer(new Uint8Array(buffer2));
151767
+ }
151768
+ // returns text with JSON.parse called on it. If you want more options decode arrayBuffer yourself
151769
+ async json() {
151770
+ const text = await this.text();
151771
+ return JSON.parse(text);
151772
+ }
151773
+ }
151774
+ const EOCDR_WITHOUT_COMMENT_SIZE = 22;
151775
+ const MAX_COMMENT_SIZE = 65535;
151776
+ const EOCDR_SIGNATURE = 101010256;
151777
+ const ZIP64_EOCDR_SIGNATURE = 101075792;
151778
+ async function readAs(reader, offset, length2) {
151779
+ return await reader.read(offset, length2);
151780
+ }
151781
+ async function readAsBlobOrTypedArray(reader, offset, length2, type) {
151782
+ if (reader.sliceAsBlob) {
151783
+ return await reader.sliceAsBlob(offset, length2, type);
151784
+ }
151785
+ return await reader.read(offset, length2);
151786
+ }
151787
+ const crc$1 = {
151788
+ unsigned() {
151789
+ return 0;
151790
+ }
151791
+ };
151792
+ function getUint16LE(uint8View, offset) {
151793
+ return uint8View[offset] + uint8View[offset + 1] * 256;
151794
+ }
151795
+ function getUint32LE(uint8View, offset) {
151796
+ return uint8View[offset] + uint8View[offset + 1] * 256 + uint8View[offset + 2] * 65536 + uint8View[offset + 3] * 16777216;
151797
+ }
151798
+ function getUint64LE(uint8View, offset) {
151799
+ return getUint32LE(uint8View, offset) + getUint32LE(uint8View, offset + 4) * 4294967296;
151800
+ }
151801
+ const utf8Decoder = new TextDecoder();
151802
+ function decodeBuffer(uint8View, isUTF8) {
151803
+ if (isSharedArrayBuffer(uint8View.buffer)) {
151804
+ uint8View = new Uint8Array(uint8View);
151805
+ }
151806
+ return utf8Decoder.decode(uint8View);
151807
+ }
151808
+ async function findEndOfCentralDirector(reader, totalLength) {
151809
+ const size2 = Math.min(EOCDR_WITHOUT_COMMENT_SIZE + MAX_COMMENT_SIZE, totalLength);
151810
+ const readStart = totalLength - size2;
151811
+ const data = await readAs(reader, readStart, size2);
151812
+ for (let i2 = size2 - EOCDR_WITHOUT_COMMENT_SIZE; i2 >= 0; --i2) {
151813
+ if (getUint32LE(data, i2) !== EOCDR_SIGNATURE) {
151814
+ continue;
151815
+ }
151816
+ const eocdr = new Uint8Array(data.buffer, data.byteOffset + i2, data.byteLength - i2);
151817
+ const diskNumber = getUint16LE(eocdr, 4);
151818
+ if (diskNumber !== 0) {
151819
+ throw new Error(`multi-volume zip files are not supported. This is volume: ${diskNumber}`);
151820
+ }
151821
+ const entryCount = getUint16LE(eocdr, 10);
151822
+ const centralDirectorySize = getUint32LE(eocdr, 12);
151823
+ const centralDirectoryOffset = getUint32LE(eocdr, 16);
151824
+ const commentLength = getUint16LE(eocdr, 20);
151825
+ const expectedCommentLength = eocdr.length - EOCDR_WITHOUT_COMMENT_SIZE;
151826
+ if (commentLength !== expectedCommentLength) {
151827
+ throw new Error(`invalid comment length. expected: ${expectedCommentLength}, actual: ${commentLength}`);
151828
+ }
151829
+ const commentBytes = new Uint8Array(eocdr.buffer, eocdr.byteOffset + 22, commentLength);
151830
+ const comment = decodeBuffer(commentBytes);
151831
+ if (entryCount === 65535 || centralDirectoryOffset === 4294967295) {
151832
+ return await readZip64CentralDirectory(reader, readStart + i2, comment, commentBytes);
151833
+ } else {
151834
+ return await readEntries(reader, centralDirectoryOffset, centralDirectorySize, entryCount, comment, commentBytes);
151835
+ }
151836
+ }
151837
+ throw new Error("could not find end of central directory. maybe not zip file");
151838
+ }
151839
+ const END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE = 117853008;
151840
+ async function readZip64CentralDirectory(reader, offset, comment, commentBytes) {
151841
+ const zip64EocdlOffset = offset - 20;
151842
+ const eocdl = await readAs(reader, zip64EocdlOffset, 20);
151843
+ if (getUint32LE(eocdl, 0) !== END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE) {
151844
+ throw new Error("invalid zip64 end of central directory locator signature");
151845
+ }
151846
+ const zip64EocdrOffset = getUint64LE(eocdl, 8);
151847
+ const zip64Eocdr = await readAs(reader, zip64EocdrOffset, 56);
151848
+ if (getUint32LE(zip64Eocdr, 0) !== ZIP64_EOCDR_SIGNATURE) {
151849
+ throw new Error("invalid zip64 end of central directory record signature");
151850
+ }
151851
+ const entryCount = getUint64LE(zip64Eocdr, 32);
151852
+ const centralDirectorySize = getUint64LE(zip64Eocdr, 40);
151853
+ const centralDirectoryOffset = getUint64LE(zip64Eocdr, 48);
151854
+ return readEntries(reader, centralDirectoryOffset, centralDirectorySize, entryCount, comment, commentBytes);
151855
+ }
151856
+ const CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE = 33639248;
151857
+ async function readEntries(reader, centralDirectoryOffset, centralDirectorySize, rawEntryCount, comment, commentBytes) {
151858
+ let readEntryCursor = 0;
151859
+ const allEntriesBuffer = await readAs(reader, centralDirectoryOffset, centralDirectorySize);
151860
+ const rawEntries = [];
151861
+ for (let e2 = 0; e2 < rawEntryCount; ++e2) {
151862
+ const buffer2 = allEntriesBuffer.subarray(readEntryCursor, readEntryCursor + 46);
151863
+ const signature = getUint32LE(buffer2, 0);
151864
+ if (signature !== CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE) {
151865
+ throw new Error(`invalid central directory file header signature: 0x${signature.toString(16)}`);
151866
+ }
151867
+ const rawEntry = {
151868
+ // 4 - Version made by
151869
+ versionMadeBy: getUint16LE(buffer2, 4),
151870
+ // 6 - Version needed to extract (minimum)
151871
+ versionNeededToExtract: getUint16LE(buffer2, 6),
151872
+ // 8 - General purpose bit flag
151873
+ generalPurposeBitFlag: getUint16LE(buffer2, 8),
151874
+ // 10 - Compression method
151875
+ compressionMethod: getUint16LE(buffer2, 10),
151876
+ // 12 - File last modification time
151877
+ lastModFileTime: getUint16LE(buffer2, 12),
151878
+ // 14 - File last modification date
151879
+ lastModFileDate: getUint16LE(buffer2, 14),
151880
+ // 16 - CRC-32
151881
+ crc32: getUint32LE(buffer2, 16),
151882
+ // 20 - Compressed size
151883
+ compressedSize: getUint32LE(buffer2, 20),
151884
+ // 24 - Uncompressed size
151885
+ uncompressedSize: getUint32LE(buffer2, 24),
151886
+ // 28 - File name length (n)
151887
+ fileNameLength: getUint16LE(buffer2, 28),
151888
+ // 30 - Extra field length (m)
151889
+ extraFieldLength: getUint16LE(buffer2, 30),
151890
+ // 32 - File comment length (k)
151891
+ fileCommentLength: getUint16LE(buffer2, 32),
151892
+ // 34 - Disk number where file starts
151893
+ // 36 - Internal file attributes
151894
+ internalFileAttributes: getUint16LE(buffer2, 36),
151895
+ // 38 - External file attributes
151896
+ externalFileAttributes: getUint32LE(buffer2, 38),
151897
+ // 42 - Relative offset of local file header
151898
+ relativeOffsetOfLocalHeader: getUint32LE(buffer2, 42)
151899
+ };
151900
+ if (rawEntry.generalPurposeBitFlag & 64) {
151901
+ throw new Error("strong encryption is not supported");
151902
+ }
151903
+ readEntryCursor += 46;
151904
+ const data = allEntriesBuffer.subarray(readEntryCursor, readEntryCursor + rawEntry.fileNameLength + rawEntry.extraFieldLength + rawEntry.fileCommentLength);
151905
+ rawEntry.nameBytes = data.slice(0, rawEntry.fileNameLength);
151906
+ rawEntry.name = decodeBuffer(rawEntry.nameBytes);
151907
+ const fileCommentStart = rawEntry.fileNameLength + rawEntry.extraFieldLength;
151908
+ const extraFieldBuffer = data.slice(rawEntry.fileNameLength, fileCommentStart);
151909
+ rawEntry.extraFields = [];
151910
+ let i2 = 0;
151911
+ while (i2 < extraFieldBuffer.length - 3) {
151912
+ const headerId = getUint16LE(extraFieldBuffer, i2 + 0);
151913
+ const dataSize = getUint16LE(extraFieldBuffer, i2 + 2);
151914
+ const dataStart = i2 + 4;
151915
+ const dataEnd = dataStart + dataSize;
151916
+ if (dataEnd > extraFieldBuffer.length) {
151917
+ throw new Error("extra field length exceeds extra field buffer size");
151918
+ }
151919
+ rawEntry.extraFields.push({
151920
+ id: headerId,
151921
+ data: extraFieldBuffer.slice(dataStart, dataEnd)
151922
+ });
151923
+ i2 = dataEnd;
151924
+ }
151925
+ rawEntry.commentBytes = data.slice(fileCommentStart, fileCommentStart + rawEntry.fileCommentLength);
151926
+ rawEntry.comment = decodeBuffer(rawEntry.commentBytes);
151927
+ readEntryCursor += data.length;
151928
+ if (rawEntry.uncompressedSize === 4294967295 || rawEntry.compressedSize === 4294967295 || rawEntry.relativeOffsetOfLocalHeader === 4294967295) {
151929
+ const zip64ExtraField = rawEntry.extraFields.find((e3) => e3.id === 1);
151930
+ if (!zip64ExtraField) {
151931
+ throw new Error("expected zip64 extended information extra field");
151932
+ }
151933
+ const zip64EiefBuffer = zip64ExtraField.data;
151934
+ let index2 = 0;
151935
+ if (rawEntry.uncompressedSize === 4294967295) {
151936
+ if (index2 + 8 > zip64EiefBuffer.length) {
151937
+ throw new Error("zip64 extended information extra field does not include uncompressed size");
151938
+ }
151939
+ rawEntry.uncompressedSize = getUint64LE(zip64EiefBuffer, index2);
151940
+ index2 += 8;
151941
+ }
151942
+ if (rawEntry.compressedSize === 4294967295) {
151943
+ if (index2 + 8 > zip64EiefBuffer.length) {
151944
+ throw new Error("zip64 extended information extra field does not include compressed size");
151945
+ }
151946
+ rawEntry.compressedSize = getUint64LE(zip64EiefBuffer, index2);
151947
+ index2 += 8;
151948
+ }
151949
+ if (rawEntry.relativeOffsetOfLocalHeader === 4294967295) {
151950
+ if (index2 + 8 > zip64EiefBuffer.length) {
151951
+ throw new Error("zip64 extended information extra field does not include relative header offset");
151952
+ }
151953
+ rawEntry.relativeOffsetOfLocalHeader = getUint64LE(zip64EiefBuffer, index2);
151954
+ index2 += 8;
151955
+ }
151956
+ }
151957
+ const nameField = rawEntry.extraFields.find((e3) => e3.id === 28789 && e3.data.length >= 6 && // too short to be meaningful
151958
+ e3.data[0] === 1 && // Version 1 byte version of this extra field, currently 1
151959
+ getUint32LE(e3.data, 1), crc$1.unsigned(rawEntry.nameBytes));
151960
+ if (nameField) {
151961
+ rawEntry.fileName = decodeBuffer(nameField.data.slice(5));
151962
+ }
151963
+ if (rawEntry.compressionMethod === 0) {
151964
+ let expectedCompressedSize = rawEntry.uncompressedSize;
151965
+ if ((rawEntry.generalPurposeBitFlag & 1) !== 0) {
151966
+ expectedCompressedSize += 12;
151967
+ }
151968
+ if (rawEntry.compressedSize !== expectedCompressedSize) {
151969
+ throw new Error(`compressed size mismatch for stored file: ${rawEntry.compressedSize} != ${expectedCompressedSize}`);
151970
+ }
151971
+ }
151972
+ rawEntries.push(rawEntry);
151973
+ }
151974
+ const zip2 = {
151975
+ comment,
151976
+ commentBytes
151977
+ };
151978
+ return {
151979
+ zip: zip2,
151980
+ entries: rawEntries.map((e2) => new ZipEntry(reader, e2))
151981
+ };
151982
+ }
151983
+ async function readEntryDataHeader(reader, rawEntry) {
151984
+ if (rawEntry.generalPurposeBitFlag & 1) {
151985
+ throw new Error("encrypted entries not supported");
151986
+ }
151987
+ const buffer2 = await readAs(reader, rawEntry.relativeOffsetOfLocalHeader, 30);
151988
+ const totalLength = await reader.getLength();
151989
+ const signature = getUint32LE(buffer2, 0);
151990
+ if (signature !== 67324752) {
151991
+ throw new Error(`invalid local file header signature: 0x${signature.toString(16)}`);
151992
+ }
151993
+ const fileNameLength = getUint16LE(buffer2, 26);
151994
+ const extraFieldLength = getUint16LE(buffer2, 28);
151995
+ const localFileHeaderEnd = rawEntry.relativeOffsetOfLocalHeader + buffer2.length + fileNameLength + extraFieldLength;
151996
+ let decompress;
151997
+ if (rawEntry.compressionMethod === 0) {
151998
+ decompress = false;
151999
+ } else if (rawEntry.compressionMethod === 8) {
152000
+ decompress = true;
152001
+ } else {
152002
+ throw new Error(`unsupported compression method: ${rawEntry.compressionMethod}`);
152003
+ }
152004
+ const fileDataStart = localFileHeaderEnd;
152005
+ const fileDataEnd = fileDataStart + rawEntry.compressedSize;
152006
+ if (rawEntry.compressedSize !== 0) {
152007
+ if (fileDataEnd > totalLength) {
152008
+ throw new Error(`file data overflows file bounds: ${fileDataStart} + ${rawEntry.compressedSize} > ${totalLength}`);
152009
+ }
152010
+ }
152011
+ return {
152012
+ decompress,
152013
+ fileDataStart
152014
+ };
152015
+ }
152016
+ async function readEntryDataAsArrayBuffer(reader, rawEntry) {
152017
+ const { decompress, fileDataStart } = await readEntryDataHeader(reader, rawEntry);
152018
+ if (!decompress) {
152019
+ const dataView = await readAs(reader, fileDataStart, rawEntry.compressedSize);
152020
+ return isTypedArraySameAsArrayBuffer(dataView) ? dataView.buffer : dataView.slice().buffer;
152021
+ }
152022
+ const typedArrayOrBlob = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize);
152023
+ const result = await inflateRawAsync(typedArrayOrBlob, rawEntry.uncompressedSize);
152024
+ return result;
152025
+ }
152026
+ async function readEntryDataAsBlob(reader, rawEntry, type) {
152027
+ const { decompress, fileDataStart } = await readEntryDataHeader(reader, rawEntry);
152028
+ if (!decompress) {
152029
+ const typedArrayOrBlob2 = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize, type);
152030
+ if (isBlob(typedArrayOrBlob2)) {
152031
+ return typedArrayOrBlob2;
152032
+ }
152033
+ return new Blob([isSharedArrayBuffer(typedArrayOrBlob2.buffer) ? new Uint8Array(typedArrayOrBlob2) : typedArrayOrBlob2], { type });
152034
+ }
152035
+ const typedArrayOrBlob = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize);
152036
+ const result = await inflateRawAsync(typedArrayOrBlob, rawEntry.uncompressedSize, type);
152037
+ return result;
152038
+ }
152039
+ async function unzipRaw(source) {
152040
+ let reader;
152041
+ if (typeof Blob !== "undefined" && source instanceof Blob) {
152042
+ reader = new BlobReader$1(source);
152043
+ } else if (source instanceof ArrayBuffer || source && source.buffer && source.buffer instanceof ArrayBuffer) {
152044
+ reader = new ArrayBufferReader(source);
152045
+ } else if (isSharedArrayBuffer(source) || isSharedArrayBuffer(source.buffer)) {
152046
+ reader = new ArrayBufferReader(source);
152047
+ } else if (typeof source === "string") {
152048
+ const req = await fetch(source);
152049
+ if (!req.ok) {
152050
+ throw new Error(`failed http request ${source}, status: ${req.status}: ${req.statusText}`);
152051
+ }
152052
+ const blob = await req.blob();
152053
+ reader = new BlobReader$1(blob);
152054
+ } else if (typeof source.getLength === "function" && typeof source.read === "function") {
152055
+ reader = source;
152056
+ } else {
152057
+ throw new Error("unsupported source type");
152058
+ }
152059
+ const totalLength = await reader.getLength();
152060
+ if (totalLength > Number.MAX_SAFE_INTEGER) {
152061
+ throw new Error(`file too large. size: ${totalLength}. Only file sizes up 4503599627370496 bytes are supported`);
152062
+ }
152063
+ return await findEndOfCentralDirector(reader, totalLength);
152064
+ }
152065
+ async function unzip(source) {
152066
+ const { zip: zip2, entries } = await unzipRaw(source);
152067
+ return {
152068
+ zip: zip2,
152069
+ entries: Object.fromEntries(entries.map((v) => [v.name, v]))
152070
+ };
152071
+ }
152072
+ class BlobReader2 {
152073
+ constructor(blob) {
152074
+ __publicField(this, "blob");
152075
+ this.blob = blob;
152076
+ }
152077
+ async getLength() {
152078
+ return this.blob.size;
152079
+ }
152080
+ async read(offset, length2) {
152081
+ const blob = this.blob.slice(offset, offset + length2);
152082
+ return new Uint8Array(await blob.arrayBuffer());
152083
+ }
152084
+ }
152085
+ class HTTPRangeReader {
152086
+ constructor(url, opts2 = {}) {
152087
+ __publicField(this, "url");
152088
+ __publicField(this, "length");
152089
+ __privateAdd(this, _overrides2, void 0);
152090
+ this.url = url;
152091
+ __privateSet(this, _overrides2, opts2.overrides ?? {});
152092
+ }
152093
+ async getLength() {
152094
+ if (this.length === void 0) {
152095
+ const req = await fetch(this.url, {
152096
+ ...__privateGet(this, _overrides2),
152097
+ method: "HEAD"
152098
+ });
152099
+ if (!req.ok) {
152100
+ throw new Error(`failed http request ${this.url}, status: ${req.status}: ${req.statusText}`);
152101
+ }
152102
+ this.length = parseInt(req.headers.get("content-length"));
152103
+ if (Number.isNaN(this.length)) {
152104
+ throw Error("could not get length");
152105
+ }
152106
+ }
152107
+ return this.length;
152108
+ }
152109
+ async read(offset, size2) {
152110
+ if (size2 === 0) {
152111
+ return new Uint8Array(0);
152112
+ }
152113
+ const req = await fetch_range(this.url, offset, size2, __privateGet(this, _overrides2));
152114
+ if (!req.ok) {
152115
+ throw new Error(`failed http request ${this.url}, status: ${req.status} offset: ${offset} size: ${size2}: ${req.statusText}`);
152116
+ }
152117
+ return new Uint8Array(await req.arrayBuffer());
152118
+ }
152119
+ }
152120
+ _overrides2 = new WeakMap();
152121
+ class ZipFileStore {
152122
+ constructor(reader) {
152123
+ __publicField(this, "info");
152124
+ this.info = unzip(reader);
152125
+ }
152126
+ async get(key) {
152127
+ let entry = (await this.info).entries[strip_prefix(key)];
152128
+ if (!entry)
152129
+ return;
152130
+ return new Uint8Array(await entry.arrayBuffer());
152131
+ }
152132
+ async has(key) {
152133
+ return strip_prefix(key) in (await this.info).entries;
152134
+ }
152135
+ static fromUrl(href, opts2 = {}) {
152136
+ return new ZipFileStore(new HTTPRangeReader(href, opts2));
152137
+ }
152138
+ static fromBlob(blob) {
152139
+ return new ZipFileStore(new BlobReader2(blob));
152140
+ }
152141
+ }
152142
+ const ZipFileStore$1 = ZipFileStore;
152143
+ function zarrOpenRoot(url, fileType, requestInit2) {
152144
+ let store;
152145
+ if (fileType && fileType.endsWith(".zip")) {
152146
+ store = ZipFileStore$1.fromUrl(url, { overrides: requestInit2 });
152147
+ } else {
152148
+ store = new FetchStore$1(url, { overrides: requestInit2 });
152149
+ }
151118
152150
  return root(store);
151119
152151
  }
151120
152152
  function prevPowerOf2(x2) {
@@ -151394,7 +152426,7 @@ async function initLoader(imageData) {
151394
152426
  } = metadata || {};
151395
152427
  const labels = dimensions.map((d) => d.field);
151396
152428
  let source;
151397
- const root2 = await zarrOpenRoot(url, requestInit2);
152429
+ const root2 = await zarrOpenRoot(url, null, requestInit2);
151398
152430
  if (isPyramid) {
151399
152431
  const metadataUrl = `${url}${url.slice(-1) === "/" ? "" : "/"}.zmetadata`;
151400
152432
  const response = await fetch(metadataUrl);
@@ -151437,7 +152469,7 @@ async function initLoader(imageData) {
151437
152469
  }
151438
152470
  case "ome-zarr": {
151439
152471
  const { coordinateTransformations: coordinateTransformationsFromOptions } = metadata || {};
151440
- const root2 = await zarrOpenRoot(url, requestInit2);
152472
+ const root2 = await zarrOpenRoot(url, null, requestInit2);
151441
152473
  const loader = await loadOmeZarr(root2);
151442
152474
  const { metadata: loaderMetadata } = loader;
151443
152475
  const { omero, multiscales } = loaderMetadata;