@idetik/core 0.9.1 → 0.10.1

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.
package/dist/index.js CHANGED
@@ -2238,12 +2238,12 @@ class gQ {
2238
2238
  this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(vI);
2239
2239
  const i = this.fallbackLOD();
2240
2240
  for (const o of E) {
2241
- if (o.lod !== this.currentLOD_ || !this.isChunkChannelInSlice(o, A)) continue;
2242
- const a = o.lod === i, D = this.computePriority(
2241
+ const a = o.lod === this.currentLOD_, D = o.lod === i;
2242
+ if (!a && !D || !this.isChunkChannelInSlice(o, A)) continue;
2243
+ const h = this.computePriority(
2244
+ D,
2243
2245
  a,
2244
2246
  !0,
2245
- // isCurrentLOD
2246
- !0,
2247
2247
  // isVisible
2248
2248
  !1,
2249
2249
  // isPrefetch
@@ -2253,7 +2253,7 @@ class gQ {
2253
2253
  this.chunkViewStates_.set(o, {
2254
2254
  visible: !0,
2255
2255
  prefetch: !1,
2256
- priority: D,
2256
+ priority: h,
2257
2257
  orderKey: 0
2258
2258
  // All chunks have the same ordering for volume rendering
2259
2259
  });
@@ -2299,12 +2299,16 @@ class gQ {
2299
2299
  updateChunksAtTimeIndex(A, I, B, C) {
2300
2300
  const Q = this.getPaddedBounds(B), E = this.store_.getChunksAtTime(A), i = this.fallbackLOD();
2301
2301
  for (const o of E) {
2302
- const a = this.isChunkWithinBounds(o, B), D = this.isChunkChannelInSlice(o, I), h = o.lod === this.currentLOD_, t = o.lod === i, y = !a && D && h && this.isChunkWithinBounds(o, Q), w = a && D, n = this.computePriority(
2303
- t,
2304
- h,
2302
+ const a = o.lod === this.currentLOD_, D = o.lod === i;
2303
+ if (!a && !D) continue;
2304
+ const h = this.isChunkChannelInSlice(o, I);
2305
+ if (!h) continue;
2306
+ const t = this.isChunkWithinBounds(o, B), y = !t && h && a && this.isChunkWithinBounds(o, Q), w = t && h, n = this.computePriority(
2307
+ D,
2305
2308
  a,
2309
+ t,
2306
2310
  y,
2307
- D
2311
+ h
2308
2312
  );
2309
2313
  if (n !== null) {
2310
2314
  const r = this.squareDistance2D(o, C);
@@ -2957,7 +2961,7 @@ class tQ {
2957
2961
  this.resizeObserver_?.disconnect(), this.mediaQuery_ && this.onMediaQueryChange_ && this.mediaQuery_.removeEventListener("change", this.onMediaQueryChange_);
2958
2962
  }
2959
2963
  }
2960
- class wo {
2964
+ class no {
2961
2965
  chunkManager_;
2962
2966
  context_;
2963
2967
  renderer_;
@@ -3345,7 +3349,7 @@ class YB extends TA {
3345
3349
  }
3346
3350
  }
3347
3351
  const dB = 1.77, Xg = 128, jg = 128 / dB;
3348
- class no extends YB {
3352
+ class Fo extends YB {
3349
3353
  // width_ and height_ should always be defined by constructor (see setFrame)
3350
3354
  width_ = Xg;
3351
3355
  height_ = jg;
@@ -3401,7 +3405,7 @@ class no extends YB {
3401
3405
  }
3402
3406
  }
3403
3407
  const nQ = 60, FQ = 1.77, GI = 0.1, XI = 180 - GI;
3404
- class Fo extends YB {
3408
+ class ro extends YB {
3405
3409
  fov_;
3406
3410
  aspectRatio_;
3407
3411
  constructor(A = {}) {
@@ -3443,13 +3447,16 @@ class Fo extends YB {
3443
3447
  }
3444
3448
  }
3445
3449
  const zg = 0;
3446
- class ro {
3450
+ class So {
3447
3451
  camera_;
3448
3452
  dragActive_ = !1;
3449
3453
  dragStart_ = f();
3450
3454
  constructor(A) {
3451
3455
  this.camera_ = A;
3452
3456
  }
3457
+ get isMoving() {
3458
+ return this.dragActive_;
3459
+ }
3453
3460
  onEvent(A) {
3454
3461
  switch (A.type) {
3455
3462
  case "wheel":
@@ -3674,7 +3681,7 @@ class tg extends TA {
3674
3681
  };
3675
3682
  }
3676
3683
  }
3677
- class So extends FA {
3684
+ class Ro extends FA {
3678
3685
  type = "AxesLayer";
3679
3686
  constructor(A) {
3680
3687
  super();
@@ -3710,7 +3717,7 @@ function jI(g) {
3710
3717
  width: I
3711
3718
  });
3712
3719
  }
3713
- class Ro extends FA {
3720
+ class No extends FA {
3714
3721
  type = "ProjectedLineLayer";
3715
3722
  paths_ = [];
3716
3723
  constructor(A = []) {
@@ -3738,7 +3745,7 @@ function rQ(g) {
3738
3745
  const [I, B] = A(0), [C, Q] = A(1), [E, i] = A(2);
3739
3746
  return { xMin: I, xMax: B, yMin: C, yMax: Q, zMin: E, zMax: i };
3740
3747
  }
3741
- class No extends FA {
3748
+ class co extends FA {
3742
3749
  type = "TracksLayer";
3743
3750
  tracks_ = [];
3744
3751
  constructor(A = []) {
@@ -4456,7 +4463,8 @@ class wg extends yg {
4456
4463
  return B.unpackAlignment = A.rowAlignmentBytes, B;
4457
4464
  }
4458
4465
  }
4459
- class co extends FA {
4466
+ const KQ = 2;
4467
+ class Uo extends FA {
4460
4468
  type = "VolumeLayer";
4461
4469
  source_;
4462
4470
  sliceCoords_;
@@ -4465,6 +4473,7 @@ class co extends FA {
4465
4473
  sourcePolicy_;
4466
4474
  chunkStoreView_;
4467
4475
  lastLoadedTime_ = void 0;
4476
+ interactiveStepSizeScale_ = 1;
4468
4477
  // TODO: Make a debug config object to manage debug options
4469
4478
  debugShowWireframes_ = !1;
4470
4479
  debugShowDegenerateRays = !1;
@@ -4552,16 +4561,17 @@ class co extends FA {
4552
4561
  }
4553
4562
  }
4554
4563
  update(A) {
4555
- if (this.chunkStoreView_) {
4556
- if (A === void 0)
4557
- throw new Error(
4558
- "RenderContext is required for the VolumeLayer update as camera information is used to reorder the chunks."
4559
- );
4560
- this.reorderObjects(A.viewport.camera), this.chunkStoreView_.updateChunksForVolume(
4561
- this.sliceCoords_,
4562
- A.viewport
4563
- ), this.updateChunks();
4564
- }
4564
+ if (!this.chunkStoreView_) return;
4565
+ if (A === void 0)
4566
+ throw new Error(
4567
+ "RenderContext is required for the VolumeLayer update as camera information is used to reorder the chunks."
4568
+ );
4569
+ this.reorderObjects(A.viewport.camera), this.chunkStoreView_.updateChunksForVolume(
4570
+ this.sliceCoords_,
4571
+ A.viewport
4572
+ );
4573
+ const I = A.viewport.cameraControls?.isMoving ?? !1;
4574
+ this.interactiveStepSizeScale_ = I ? KQ : 1, this.updateChunks();
4565
4575
  }
4566
4576
  reorderObjects(A) {
4567
4577
  const I = A.position, B = f(), C = f();
@@ -4574,7 +4584,7 @@ class co extends FA {
4574
4584
  getUniforms() {
4575
4585
  return {
4576
4586
  DebugShowDegenerateRays: Number(this.debugShowDegenerateRays),
4577
- RelativeStepSize: this.relativeStepSize,
4587
+ RelativeStepSize: this.relativeStepSize * this.interactiveStepSizeScale_,
4578
4588
  MaxIntensity: this.maxIntensity,
4579
4589
  OpacityMultiplier: this.opacityMultiplier,
4580
4590
  VolumeColor: this.color,
@@ -4589,7 +4599,7 @@ function gB(g) {
4589
4599
  `align${g.rowAlignmentBytes}`
4590
4600
  ].join(":");
4591
4601
  }
4592
- class Uo extends FA {
4602
+ class ko extends FA {
4593
4603
  type = "ImageLayer";
4594
4604
  source_;
4595
4605
  region_;
@@ -4736,7 +4746,7 @@ class jA extends yg {
4736
4746
  return C.unpackAlignment = A.rowAlignmentBytes, C;
4737
4747
  }
4738
4748
  }
4739
- const KQ = [
4749
+ const HQ = [
4740
4750
  [1, 0.5, 0.5],
4741
4751
  [0.5, 1, 0.5],
4742
4752
  [0.5, 0.5, 1],
@@ -4744,7 +4754,7 @@ const KQ = [
4744
4754
  [1, 0.5, 1],
4745
4755
  [1, 1, 0.5]
4746
4756
  ];
4747
- function HQ(g) {
4757
+ function qQ(g) {
4748
4758
  return g = g ?? /* @__PURE__ */ new Map(), new Map(
4749
4759
  Array.from(g.entries()).map(([A, I]) => [
4750
4760
  A,
@@ -4752,37 +4762,37 @@ function HQ(g) {
4752
4762
  ])
4753
4763
  );
4754
4764
  }
4755
- function qQ(g) {
4756
- return g = g ?? KQ, g.map(l.from);
4765
+ function lQ(g) {
4766
+ return g = g ?? HQ, g.map(l.from);
4757
4767
  }
4758
4768
  class BB {
4759
4769
  lookupTable;
4760
4770
  cycle;
4761
4771
  constructor(A = {}) {
4762
- this.lookupTable = HQ(A.lookupTable), this.cycle = qQ(A.cycle);
4772
+ this.lookupTable = qQ(A.lookupTable), this.cycle = lQ(A.cycle);
4763
4773
  }
4764
4774
  }
4765
- const lQ = /* @__PURE__ */ new Set([
4775
+ const fQ = /* @__PURE__ */ new Set([
4766
4776
  "unsigned_byte",
4767
4777
  "unsigned_short",
4768
4778
  "unsigned_int"
4769
4779
  ]);
4770
- function fQ(g) {
4780
+ function pQ(g) {
4771
4781
  if (g.dataFormat !== "scalar")
4772
4782
  throw new Error(
4773
4783
  `Image data format must be scalar, instead found: ${g.dataFormat}`
4774
4784
  );
4775
- if (!lQ.has(g.dataType))
4785
+ if (!fQ.has(g.dataType))
4776
4786
  throw new Error(
4777
4787
  `Image data type must be unsigned, instead found: ${g.dataType}`
4778
4788
  );
4779
4789
  return g;
4780
4790
  }
4781
- class pQ extends TA {
4791
+ class mQ extends TA {
4782
4792
  outlineSelected_;
4783
4793
  selectedValue_;
4784
4794
  constructor(A) {
4785
- super(), this.geometry = new MB(A.width, A.height, 1, 1), this.setTexture(0, fQ(A.imageData));
4795
+ super(), this.geometry = new MB(A.width, A.height, 1, 1), this.setTexture(0, pQ(A.imageData));
4786
4796
  const I = this.makeColorCycleTexture(A.colorMap.cycle);
4787
4797
  this.setTexture(1, I);
4788
4798
  const B = this.makeColorLookupTableTexture(
@@ -4820,7 +4830,7 @@ class pQ extends TA {
4820
4830
  return Q.set(I, 0), Q.set(B, C), new jA(Q, C, 2);
4821
4831
  }
4822
4832
  }
4823
- class ko extends FA {
4833
+ class Lo extends FA {
4824
4834
  type = "LabelImageLayer";
4825
4835
  source_;
4826
4836
  region_;
@@ -4885,7 +4895,7 @@ class ko extends FA {
4885
4895
  }
4886
4896
  createImage(A) {
4887
4897
  this.imageChunk_ = A;
4888
- const I = new pQ({
4898
+ const I = new mQ({
4889
4899
  width: A.shape.x,
4890
4900
  height: A.shape.y,
4891
4901
  imageData: jA.createWithChunk(A),
@@ -4914,7 +4924,7 @@ class fI extends Error {
4914
4924
  super(A), this.name = "AbortError", Object.setPrototypeOf(this, fI.prototype);
4915
4925
  }
4916
4926
  }
4917
- class mQ {
4927
+ class uQ {
4918
4928
  maxConcurrent_;
4919
4929
  pending_ = [];
4920
4930
  abortController_ = new AbortController();
@@ -4958,12 +4968,12 @@ class mQ {
4958
4968
  return this.pending_.length;
4959
4969
  }
4960
4970
  }
4961
- class uQ {
4971
+ class TQ {
4962
4972
  source_;
4963
4973
  region_;
4964
4974
  seriesDimensionName_;
4965
4975
  seriesIndex_;
4966
- scheduler_ = new mQ(16);
4976
+ scheduler_ = new uQ(16);
4967
4977
  lod_;
4968
4978
  loader_ = null;
4969
4979
  seriesAttributes_;
@@ -5076,7 +5086,7 @@ class uQ {
5076
5086
  return this.loader_ ??= await this.source_.open(), this.loader_;
5077
5087
  }
5078
5088
  }
5079
- class Lo extends FA {
5089
+ class Jo extends FA {
5080
5090
  type = "ImageSeriesLayer";
5081
5091
  seriesLoader_;
5082
5092
  initialChannelProps_;
@@ -5093,7 +5103,7 @@ class Lo extends FA {
5093
5103
  lod: Q,
5094
5104
  ...E
5095
5105
  }) {
5096
- super(E), this.setState("initialized"), this.channelProps_ = C, this.initialChannelProps_ = C, this.seriesLoader_ = new uQ({
5106
+ super(E), this.setState("initialized"), this.channelProps_ = C, this.initialChannelProps_ = C, this.seriesLoader_ = new TQ({
5097
5107
  source: A,
5098
5108
  region: I,
5099
5109
  seriesDimensionName: B,
@@ -5168,7 +5178,7 @@ function qB(g, A, I, B = {}) {
5168
5178
  }
5169
5179
  }), fetch(g, B);
5170
5180
  }
5171
- function TQ(g, A) {
5181
+ function WQ(g, A) {
5172
5182
  return {
5173
5183
  ...g,
5174
5184
  ...A,
@@ -5191,7 +5201,7 @@ async function QB(g) {
5191
5201
  throw new Error(`Unexpected response status ${g.status} ${g.statusText}`);
5192
5202
  }
5193
5203
  }
5194
- async function WQ(g, A, I, B) {
5204
+ async function xQ(g, A, I, B) {
5195
5205
  if (B)
5196
5206
  return fetch(g, {
5197
5207
  ...I,
@@ -5211,7 +5221,7 @@ class WA {
5211
5221
  this.url = A, this.#A = I.overrides ?? {}, this.#I = I.useSuffixRequest ?? !1;
5212
5222
  }
5213
5223
  #g(A) {
5214
- return TQ(this.#A, A);
5224
+ return WQ(this.#A, A);
5215
5225
  }
5216
5226
  async get(A, I = {}) {
5217
5227
  let B = CB(this.url, A).href, C = await fetch(B, this.#g(I));
@@ -5219,7 +5229,7 @@ class WA {
5219
5229
  }
5220
5230
  async getRange(A, I, B = {}) {
5221
5231
  let C = CB(this.url, A), Q = this.#g(B), E;
5222
- return "suffixLength" in I ? E = await WQ(C, I.suffixLength, Q, this.#I) : E = await qB(C, I.offset, I.length, Q), QB(E);
5232
+ return "suffixLength" in I ? E = await xQ(C, I.suffixLength, Q, this.#I) : E = await qB(C, I.offset, I.length, Q), QB(E);
5223
5233
  }
5224
5234
  }
5225
5235
  class lB {
@@ -5404,7 +5414,7 @@ function cA(g, A) {
5404
5414
  C[A[Q]] = B, B *= g[A[Q]];
5405
5415
  return C;
5406
5416
  }
5407
- function xQ({ name: g, configuration: A }) {
5417
+ function bQ({ name: g, configuration: A }) {
5408
5418
  if (g === "default") {
5409
5419
  const I = A?.separator ?? "/";
5410
5420
  return (B) => ["c", ...B].join(I);
@@ -5415,7 +5425,7 @@ function xQ({ name: g, configuration: A }) {
5415
5425
  }
5416
5426
  throw new Error(`Unknown chunk key encoding: ${g}`);
5417
5427
  }
5418
- function bQ(g) {
5428
+ function ZQ(g) {
5419
5429
  if (g === "|O")
5420
5430
  return { data_type: "v2:object" };
5421
5431
  let A = g.match(/^([<|>])(.*)$/);
@@ -5436,8 +5446,8 @@ function bQ(g) {
5436
5446
  }[B] ?? (B.startsWith("S") || B.startsWith("U") ? `v2:${B}` : void 0);
5437
5447
  return W(C, `Unsupported or unknown dtype: ${g}`), I === "|" ? { data_type: C } : { data_type: C, endian: I === "<" ? "little" : "big" };
5438
5448
  }
5439
- function ZQ(g, A = {}) {
5440
- let I = [], B = bQ(g.dtype);
5449
+ function PQ(g, A = {}) {
5450
+ let I = [], B = ZQ(g.dtype);
5441
5451
  g.order === "F" && I.push({ name: "transpose", configuration: { order: "F" } }), "endian" in B && B.endian === "big" && I.push({ name: "bytes", configuration: { endian: "big" } });
5442
5452
  for (let { id: C, ...Q } of g.filters ?? [])
5443
5453
  I.push({ name: C, configuration: Q });
@@ -5467,14 +5477,14 @@ function ZQ(g, A = {}) {
5467
5477
  attributes: A
5468
5478
  };
5469
5479
  }
5470
- function PQ(g, A = {}) {
5480
+ function OQ(g, A = {}) {
5471
5481
  return {
5472
5482
  zarr_format: 3,
5473
5483
  node_type: "group",
5474
5484
  attributes: A
5475
5485
  };
5476
5486
  }
5477
- function OQ(g, A) {
5487
+ function VQ(g, A) {
5478
5488
  if (A !== "number" && A !== "bigint" && A !== "boolean" && A !== "object" && A !== "string")
5479
5489
  return g === A;
5480
5490
  let I = g === "bool";
@@ -5489,7 +5499,7 @@ function OQ(g, A) {
5489
5499
  let Q = g === "v2:object";
5490
5500
  return A === "object" ? Q : !B && !C && !I && !Q;
5491
5501
  }
5492
- function VQ(g) {
5502
+ function vQ(g) {
5493
5503
  return g?.name === "sharding_indexed";
5494
5504
  }
5495
5505
  function pB(g) {
@@ -5536,8 +5546,8 @@ class Fg {
5536
5546
  return A;
5537
5547
  }
5538
5548
  }
5539
- const iB = vQ();
5540
- function vQ() {
5549
+ const iB = XQ();
5550
+ function XQ() {
5541
5551
  const g = new Uint32Array([305419896]);
5542
5552
  return new Uint8Array(g.buffer, g.byteOffset, g.byteLength)[0] !== 18;
5543
5553
  }
@@ -5596,10 +5606,10 @@ class Sg {
5596
5606
  return new Uint8Array(I);
5597
5607
  }
5598
5608
  }
5599
- function XQ(g, A) {
5609
+ function jQ(g, A) {
5600
5610
  return W(!Number.isNaN(A), "JsonCodec allow_nan is false but NaN was encountered during encoding."), W(A !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding."), W(A !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding."), A;
5601
5611
  }
5602
- function jQ(g, A) {
5612
+ function zQ(g, A) {
5603
5613
  return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, B) => (I[B] = A[B], I), {}) : A;
5604
5614
  }
5605
5615
  class Rg {
@@ -5629,7 +5639,7 @@ class Rg {
5629
5639
  const { indent: I, encoding: B, ensure_ascii: C, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
5630
5640
  W(B === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
5631
5641
  const o = [];
5632
- W(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(XQ), i && o.push(jQ);
5642
+ W(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(jQ), i && o.push(zQ);
5633
5643
  const a = Array.from(A.data);
5634
5644
  a.push("|O"), a.push(A.shape);
5635
5645
  let D;
@@ -5664,7 +5674,7 @@ function aB(g) {
5664
5674
  }
5665
5675
  }) : g;
5666
5676
  }
5667
- function zQ(g, A) {
5677
+ function _Q(g, A) {
5668
5678
  let I;
5669
5679
  return g.data instanceof ng || g.data instanceof sI ? I = new g.constructor(
5670
5680
  // @ts-expect-error
@@ -5676,8 +5686,8 @@ function zQ(g, A) {
5676
5686
  stride: cA(g.shape, A)
5677
5687
  };
5678
5688
  }
5679
- function _Q(g, A) {
5680
- let I = zQ(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = aB(g.data), i = aB(I.data);
5689
+ function $Q(g, A) {
5690
+ let I = _Q(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = aB(g.data), i = aB(I.data);
5681
5691
  for (let o = 0; o < C; o++) {
5682
5692
  let a = 0;
5683
5693
  for (let D = 0; D < B; D++)
@@ -5692,12 +5702,12 @@ function _Q(g, A) {
5692
5702
  }
5693
5703
  return I;
5694
5704
  }
5695
- function $Q(g) {
5705
+ function AE(g) {
5696
5706
  let A = g.shape.length;
5697
5707
  return W(A === g.stride.length, "Shape and stride must have the same length."), g.stride.map((I, B) => ({ stride: I, index: B })).sort((I, B) => B.stride - I.stride).map((I) => I.index);
5698
5708
  }
5699
- function AE(g, A) {
5700
- let I = $Q(g);
5709
+ function IE(g, A) {
5710
+ let I = AE(g);
5701
5711
  return W(I.length === A.length, "Orders must match"), I.every((B, C) => B === A[C]);
5702
5712
  }
5703
5713
  class Ng {
@@ -5722,7 +5732,7 @@ class Ng {
5722
5732
  return new Ng(A, I);
5723
5733
  }
5724
5734
  encode(A) {
5725
- return AE(A, this.#I) ? A : _Q(A, this.#I);
5735
+ return IE(A, this.#I) ? A : $Q(A, this.#I);
5726
5736
  }
5727
5737
  decode(A) {
5728
5738
  return {
@@ -5767,10 +5777,10 @@ class Ug {
5767
5777
  return new Uint8Array(I);
5768
5778
  }
5769
5779
  }
5770
- function IE() {
5780
+ function gE() {
5771
5781
  return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BOWv2fO7.js").then((g) => g.default)).set("lz4", () => import("./lz4-DUlZKApi.js").then((g) => g.default)).set("zstd", () => import("./zstd-DnzmycJs.js").then((g) => g.default)).set("gzip", () => Sg).set("zlib", () => Ug).set("transpose", () => Ng).set("bytes", () => pI).set("crc32c", () => rg).set("vlen-utf8", () => cg).set("json2", () => Rg).set("bitround", () => Fg);
5772
5782
  }
5773
- const gE = IE();
5783
+ const BE = gE();
5774
5784
  function Cg(g) {
5775
5785
  let A;
5776
5786
  return {
@@ -5796,7 +5806,7 @@ function Cg(g) {
5796
5806
  }
5797
5807
  async function DB(g) {
5798
5808
  let A = g.codecs.map(async (Q) => {
5799
- let E = await gE.get(Q.name)?.();
5809
+ let E = await BE.get(Q.name)?.();
5800
5810
  return W(E, `Unknown codec: ${Q.name}`), { Codec: E, meta: Q };
5801
5811
  }), I = [], B, C = [];
5802
5812
  for await (let { Codec: Q, meta: E } of A) {
@@ -5812,9 +5822,9 @@ async function DB(g) {
5812
5822
  C.push(i);
5813
5823
  }
5814
5824
  }
5815
- return B || (W(BE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B = pI.fromConfig({ endian: "little" }, g)), { array_to_array: I, array_to_bytes: B, bytes_to_bytes: C };
5825
+ return B || (W(CE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B = pI.fromConfig({ endian: "little" }, g)), { array_to_array: I, array_to_bytes: B, bytes_to_bytes: C };
5816
5826
  }
5817
- function BE(g) {
5827
+ function CE(g) {
5818
5828
  return g.data_type !== "v2:object";
5819
5829
  }
5820
5830
  class tI extends Error {
@@ -5828,7 +5838,7 @@ class kg extends Error {
5828
5838
  }
5829
5839
  }
5830
5840
  const sB = 18446744073709551615n;
5831
- function CE(g, A, I, B) {
5841
+ function QE(g, A, I, B) {
5832
5842
  W(g.store.getRange, "Store does not support range requests");
5833
5843
  let C = g.store.getRange.bind(g.store), Q = A.map((o, a) => o / B.chunk_shape[a]), E = Cg({
5834
5844
  data_type: "uint64",
@@ -5880,12 +5890,12 @@ function hB(g) {
5880
5890
  return g.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
5881
5891
  }
5882
5892
  const xA = Symbol("zarrita.context");
5883
- function QE(g) {
5893
+ function EE(g) {
5884
5894
  return g[xA];
5885
5895
  }
5886
- function EE(g, A) {
5887
- let { configuration: I } = A.codecs.find(VQ) ?? {}, B = {
5888
- encode_chunk_key: xQ(A.chunk_key_encoding),
5896
+ function iE(g, A) {
5897
+ let { configuration: I } = A.codecs.find(vQ) ?? {}, B = {
5898
+ encode_chunk_key: bQ(A.chunk_key_encoding),
5889
5899
  TypedArray: fB(A.data_type),
5890
5900
  fill_value: A.fill_value
5891
5901
  };
@@ -5903,7 +5913,7 @@ function EE(g, A) {
5903
5913
  get_strides(E) {
5904
5914
  return cA(E, Q);
5905
5915
  },
5906
- get_chunk_bytes: CE(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
5916
+ get_chunk_bytes: QE(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
5907
5917
  };
5908
5918
  }
5909
5919
  let C = hB(A.codecs);
@@ -5933,7 +5943,7 @@ let cI = class extends z {
5933
5943
  super(A, I), this.#A = {
5934
5944
  ...B,
5935
5945
  fill_value: pB(B)
5936
- }, this[xA] = EE(this, B);
5946
+ }, this[xA] = iE(this, B);
5937
5947
  }
5938
5948
  get attrs() {
5939
5949
  return this.#A.attributes;
@@ -5977,15 +5987,15 @@ let cI = class extends z {
5977
5987
  * ```
5978
5988
  */
5979
5989
  is(A) {
5980
- return OQ(this.dtype, A);
5990
+ return VQ(this.dtype, A);
5981
5991
  }
5982
5992
  };
5983
- function* iE(g, A, I = 1) {
5993
+ function* oE(g, A, I = 1) {
5984
5994
  A === void 0 && (A = g, g = 0);
5985
5995
  for (let B = g; B < A; B += I)
5986
5996
  yield B;
5987
5997
  }
5988
- function* oE(...g) {
5998
+ function* aE(...g) {
5989
5999
  if (g.length === 0)
5990
6000
  return;
5991
6001
  const A = g.map((B) => B[Symbol.iterator]()), I = A.map((B) => B.next());
@@ -6000,7 +6010,7 @@ function* oE(...g) {
6000
6010
  I[B] = A[B].next();
6001
6011
  }
6002
6012
  }
6003
- function aE({ start: g, stop: A, step: I }, B) {
6013
+ function DE({ start: g, stop: A, step: I }, B) {
6004
6014
  if (I === 0)
6005
6015
  throw new Error("slice step cannot be zero");
6006
6016
  I = I ?? 1;
@@ -6014,7 +6024,7 @@ function UI(g, A, I = null) {
6014
6024
  step: I
6015
6025
  };
6016
6026
  }
6017
- function DE() {
6027
+ function sE() {
6018
6028
  const g = [];
6019
6029
  return {
6020
6030
  add: (A) => g.push(A()),
@@ -6026,28 +6036,28 @@ class Jg extends Error {
6026
6036
  super(A), this.name = "IndexError";
6027
6037
  }
6028
6038
  }
6029
- function sE(g, A) {
6039
+ function hE(g, A) {
6030
6040
  throw new Jg(`too many indicies for array; expected ${A.length}, got ${g.length}`);
6031
6041
  }
6032
- function hE(g) {
6042
+ function tE(g) {
6033
6043
  throw new Jg(`index out of bounds for dimension with length ${g}`);
6034
6044
  }
6035
- function tE() {
6045
+ function yE() {
6036
6046
  throw new Jg("only slices with step >= 1 are supported");
6037
6047
  }
6038
- function yE(g, A) {
6039
- g.length > A.length && sE(g, A);
6040
- }
6041
6048
  function eE(g, A) {
6042
- return g = Math.trunc(g), g < 0 && (g = A + g), (g >= A || g < 0) && hE(A), g;
6049
+ g.length > A.length && hE(g, A);
6043
6050
  }
6044
- class GE {
6051
+ function GE(g, A) {
6052
+ return g = Math.trunc(g), g < 0 && (g = A + g), (g >= A || g < 0) && tE(A), g;
6053
+ }
6054
+ class wE {
6045
6055
  dim_sel;
6046
6056
  dim_len;
6047
6057
  dim_chunk_len;
6048
6058
  nitems;
6049
6059
  constructor({ dim_sel: A, dim_len: I, dim_chunk_len: B }) {
6050
- A = eE(A, I), this.dim_sel = A, this.dim_len = I, this.dim_chunk_len = B, this.nitems = 1;
6060
+ A = GE(A, I), this.dim_sel = A, this.dim_len = I, this.dim_chunk_len = B, this.nitems = 1;
6051
6061
  }
6052
6062
  *[Symbol.iterator]() {
6053
6063
  const A = Math.floor(this.dim_sel / this.dim_chunk_len), I = A * this.dim_chunk_len, B = this.dim_sel - I;
@@ -6063,12 +6073,12 @@ class tB {
6063
6073
  nitems;
6064
6074
  nchunks;
6065
6075
  constructor({ dim_sel: A, dim_len: I, dim_chunk_len: B }) {
6066
- const [C, Q, E] = aE(A, I);
6067
- this.start = C, this.stop = Q, this.step = E, this.step < 1 && tE(), this.dim_len = I, this.dim_chunk_len = B, this.nitems = Math.max(0, Math.ceil((this.stop - this.start) / this.step)), this.nchunks = Math.ceil(this.dim_len / this.dim_chunk_len);
6076
+ const [C, Q, E] = DE(A, I);
6077
+ this.start = C, this.stop = Q, this.step = E, this.step < 1 && yE(), this.dim_len = I, this.dim_chunk_len = B, this.nitems = Math.max(0, Math.ceil((this.stop - this.start) / this.step)), this.nchunks = Math.ceil(this.dim_len / this.dim_chunk_len);
6068
6078
  }
6069
6079
  *[Symbol.iterator]() {
6070
6080
  const A = Math.floor(this.start / this.dim_chunk_len), I = Math.ceil(this.stop / this.dim_chunk_len);
6071
- for (const B of iE(A, I)) {
6081
+ for (const B of oE(A, I)) {
6072
6082
  const C = B * this.dim_chunk_len, Q = Math.min(this.dim_len, (B + 1) * this.dim_chunk_len), E = Q - C;
6073
6083
  let i = 0, o = 0;
6074
6084
  if (this.start < C) {
@@ -6089,15 +6099,15 @@ class tB {
6089
6099
  }
6090
6100
  }
6091
6101
  }
6092
- function wE(g, A) {
6102
+ function nE(g, A) {
6093
6103
  let I = [];
6094
- return g === null ? I = A.map((B) => UI(null)) : Array.isArray(g) && (I = g.map((B) => B ?? UI(null))), yE(I, A), I;
6104
+ return g === null ? I = A.map((B) => UI(null)) : Array.isArray(g) && (I = g.map((B) => B ?? UI(null))), eE(I, A), I;
6095
6105
  }
6096
- class nE {
6106
+ class FE {
6097
6107
  dim_indexers;
6098
6108
  shape;
6099
6109
  constructor({ selection: A, shape: I, chunk_shape: B }) {
6100
- this.dim_indexers = wE(A, I).map((C, Q) => new (typeof C == "number" ? GE : tB)({
6110
+ this.dim_indexers = nE(A, I).map((C, Q) => new (typeof C == "number" ? wE : tB)({
6101
6111
  // @ts-expect-error ts inference not strong enough to know correct chunk
6102
6112
  dim_sel: C,
6103
6113
  dim_len: I[Q],
@@ -6105,27 +6115,27 @@ class nE {
6105
6115
  })), this.shape = this.dim_indexers.filter((C) => C instanceof tB).map((C) => C.nitems);
6106
6116
  }
6107
6117
  *[Symbol.iterator]() {
6108
- for (const A of oE(...this.dim_indexers)) {
6118
+ for (const A of aE(...this.dim_indexers)) {
6109
6119
  const I = A.map((C) => C.dim_chunk_ix), B = A.map((C) => "dim_out_sel" in C ? { from: C.dim_chunk_sel, to: C.dim_out_sel } : { from: C.dim_chunk_sel, to: null });
6110
6120
  yield { chunk_coords: I, mapping: B };
6111
6121
  }
6112
6122
  }
6113
6123
  }
6114
- function FE(g, A) {
6124
+ function rE(g, A) {
6115
6125
  return "get" in g ? g.get(A) : g[A];
6116
6126
  }
6117
- async function rE(g, A, I, B) {
6118
- let C = QE(g), Q = new nE({
6127
+ async function SE(g, A, I, B) {
6128
+ let C = EE(g), Q = new FE({
6119
6129
  selection: A,
6120
6130
  shape: g.shape,
6121
6131
  chunk_shape: g.chunks
6122
- }), E = B.prepare(new C.TypedArray(Q.shape.reduce((o, a) => o * a, 1)), Q.shape, C.get_strides(Q.shape)), i = I.create_queue?.() ?? DE();
6132
+ }), E = B.prepare(new C.TypedArray(Q.shape.reduce((o, a) => o * a, 1)), Q.shape, C.get_strides(Q.shape)), i = I.create_queue?.() ?? sE();
6123
6133
  for (const { chunk_coords: o, mapping: a } of Q)
6124
6134
  i.add(async () => {
6125
6135
  let { data: D, shape: h, stride: t } = await g.getChunk(o, I.opts), y = B.prepare(D, h, t);
6126
6136
  B.set_from_chunk(E, y, a);
6127
6137
  });
6128
- return await i.onIdle(), Q.shape.length === 0 ? FE(E.data, 0) : E;
6138
+ return await i.onIdle(), Q.shape.length === 0 ? rE(E.data, 0) : E;
6129
6139
  }
6130
6140
  function Yg(g, A = 0, I) {
6131
6141
  let B = I ?? g.length - A;
@@ -6155,30 +6165,30 @@ function zI(g) {
6155
6165
  bytes_per_element: g.data.BYTES_PER_ELEMENT
6156
6166
  };
6157
6167
  }
6158
- function SE(g) {
6168
+ function RE(g) {
6159
6169
  return "chars" in g ? g.constructor.bind(null, g.chars) : g.constructor;
6160
6170
  }
6161
- function RE(g, A) {
6171
+ function NE(g, A) {
6162
6172
  if (globalThis.Array.isArray(g.data))
6163
6173
  return Yg([A]);
6164
- let I = SE(g.data), B = new I([A]);
6174
+ let I = RE(g.data), B = new I([A]);
6165
6175
  return new Uint8Array(B.buffer, B.byteOffset, B.byteLength);
6166
6176
  }
6167
- const NE = {
6177
+ const cE = {
6168
6178
  prepare(g, A, I) {
6169
6179
  return { data: g, shape: A, stride: I };
6170
6180
  },
6171
6181
  set_scalar(g, A, I) {
6172
6182
  let B = zI(g);
6173
- Qg(B, A, RE(g, I), B.bytes_per_element);
6183
+ Qg(B, A, NE(g, I), B.bytes_per_element);
6174
6184
  },
6175
6185
  set_from_chunk(g, A, I) {
6176
6186
  let B = zI(g);
6177
6187
  wI(B, zI(A), B.bytes_per_element, I);
6178
6188
  }
6179
6189
  };
6180
- async function cE(g, A = null, I = {}) {
6181
- return rE(g, A, I, NE);
6190
+ async function UE(g, A = null, I = {}) {
6191
+ return SE(g, A, I, cE);
6182
6192
  }
6183
6193
  function TB(g, A, I) {
6184
6194
  return I < 0 && A < g ? Math.floor((g - A - 1) / -I) + 1 : g < A ? Math.floor((A - g - 1) / I) + 1 : 0;
@@ -6252,8 +6262,8 @@ function wI(g, A, I, B) {
6252
6262
  stride: a
6253
6263
  }, I, Q);
6254
6264
  }
6255
- let mI = UE();
6256
- function UE() {
6265
+ let mI = kE();
6266
+ function kE() {
6257
6267
  let g = /* @__PURE__ */ new WeakMap();
6258
6268
  function A(I) {
6259
6269
  let B = g.get(I) ?? { v2: 0, v3: 0 };
@@ -6269,13 +6279,13 @@ function UE() {
6269
6279
  }
6270
6280
  };
6271
6281
  }
6272
- async function kE(g) {
6282
+ async function LE(g) {
6273
6283
  let A = await g.store.get(g.resolve(".zattrs").path);
6274
6284
  return A ? hI(A) : {};
6275
6285
  }
6276
- async function LE(g, A = {}) {
6286
+ async function JE(g, A = {}) {
6277
6287
  let I = "store" in g ? g : new z(g), B = {};
6278
- return (A.attrs ?? !0) && (B = await kE(I)), A.kind === "array" ? yB(I, B) : A.kind === "group" ? eB(I, B) : yB(I, B).catch((C) => (mB(C, tI), eB(I, B)));
6288
+ return (A.attrs ?? !0) && (B = await LE(I)), A.kind === "array" ? yB(I, B) : A.kind === "group" ? eB(I, B) : yB(I, B).catch((C) => (mB(C, tI), eB(I, B)));
6279
6289
  }
6280
6290
  async function yB(g, A) {
6281
6291
  let { path: I } = g.resolve(".zarray"), B = await g.store.get(I);
@@ -6283,7 +6293,7 @@ async function yB(g, A) {
6283
6293
  throw new tI("v2 array", {
6284
6294
  cause: new kg(I)
6285
6295
  });
6286
- return mI.increment(g.store, "v2"), new cI(g.store, g.path, ZQ(hI(B), A));
6296
+ return mI.increment(g.store, "v2"), new cI(g.store, g.path, PQ(hI(B), A));
6287
6297
  }
6288
6298
  async function eB(g, A) {
6289
6299
  let { path: I } = g.resolve(".zgroup"), B = await g.store.get(I);
@@ -6291,9 +6301,9 @@ async function eB(g, A) {
6291
6301
  throw new tI("v2 group", {
6292
6302
  cause: new kg(I)
6293
6303
  });
6294
- return mI.increment(g.store, "v2"), new Lg(g.store, g.path, PQ(hI(B), A));
6304
+ return mI.increment(g.store, "v2"), new Lg(g.store, g.path, OQ(hI(B), A));
6295
6305
  }
6296
- async function JE(g) {
6306
+ async function YE(g) {
6297
6307
  let { store: A, path: I } = g.resolve("zarr.json"), B = await g.store.get(I);
6298
6308
  if (!B)
6299
6309
  throw new tI("v3 array or group", {
@@ -6302,8 +6312,8 @@ async function JE(g) {
6302
6312
  let C = hI(B);
6303
6313
  return C.node_type === "array" && (C.fill_value = pB(C)), C.node_type === "array" ? new cI(A, g.path, C) : new Lg(A, g.path, C);
6304
6314
  }
6305
- async function YE(g, A = {}) {
6306
- let I = "store" in g ? g : new z(g), B = await JE(I);
6315
+ async function dE(g, A = {}) {
6316
+ let I = "store" in g ? g : new z(g), B = await YE(I);
6307
6317
  if (mI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof cI || A.kind === "group" && B instanceof Lg)
6308
6318
  return B;
6309
6319
  let C = B instanceof cI ? "array" : "group";
@@ -6313,9 +6323,9 @@ async function IA(g, A = {}) {
6313
6323
  let I = "store" in g ? g.store : g, B = mI.version_max(I), C = B === "v2" ? IA.v2 : IA.v3, Q = B === "v2" ? IA.v3 : IA.v2;
6314
6324
  return C(g, A).catch((E) => (mB(E, tI), Q(g, A)));
6315
6325
  }
6316
- IA.v2 = LE;
6317
- IA.v3 = YE;
6318
- async function dE(g, A) {
6326
+ IA.v2 = JE;
6327
+ IA.v3 = dE;
6328
+ async function ME(g, A) {
6319
6329
  const I = A.split("/"), B = I.pop();
6320
6330
  if (!B)
6321
6331
  throw new Error("Invalid path");
@@ -6332,7 +6342,7 @@ class dg {
6332
6342
  return this.#A;
6333
6343
  }
6334
6344
  async get(A) {
6335
- const I = await dE(this.#A, A.slice(1)).catch(
6345
+ const I = await ME(this.#A, A.slice(1)).catch(
6336
6346
  () => {
6337
6347
  }
6338
6348
  );
@@ -6342,7 +6352,7 @@ class dg {
6342
6352
  return new Uint8Array(C);
6343
6353
  }
6344
6354
  }
6345
- function ME() {
6355
+ function KE() {
6346
6356
  if (typeof window > "u")
6347
6357
  return;
6348
6358
  const g = window.location.hostname;
@@ -6359,7 +6369,7 @@ class Mg extends WA {
6359
6369
  overrides;
6360
6370
  useSuffixRequest;
6361
6371
  constructor(A) {
6362
- ME(), super(A.url, {
6372
+ KE(), super(A.url, {
6363
6373
  overrides: A.overrides,
6364
6374
  useSuffixRequest: A.useSuffixRequest
6365
6375
  }), this.credentials = A.credentials, this.region = A.region, this.overrides = A.overrides, this.useSuffixRequest = A.useSuffixRequest;
@@ -6497,7 +6507,7 @@ async function yI(g, A) {
6497
6507
  throw new Error(`Failed to open Zarr group at ${g}`);
6498
6508
  }
6499
6509
  }
6500
- async function KE(g, A) {
6510
+ async function HE(g, A) {
6501
6511
  if (A === "v2")
6502
6512
  try {
6503
6513
  return IA.v2(g, { kind: "array", attrs: !1 });
@@ -6516,7 +6526,7 @@ async function KE(g, A) {
6516
6526
  throw new Error(`Failed to open Zarr array at ${g}`);
6517
6527
  }
6518
6528
  }
6519
- async function HE(g) {
6529
+ async function qE(g) {
6520
6530
  let A;
6521
6531
  switch (g.type) {
6522
6532
  case "fetch": {
@@ -6542,9 +6552,9 @@ async function HE(g) {
6542
6552
  }
6543
6553
  }
6544
6554
  const I = g.arrayPath ? A.resolve(g.arrayPath) : A;
6545
- return KE(I, g.zarrVersion);
6555
+ return HE(I, g.zarrVersion);
6546
6556
  }
6547
- function qE(g, A, I) {
6557
+ function lE(g, A, I) {
6548
6558
  if (g.store instanceof Mg)
6549
6559
  return {
6550
6560
  type: "s3",
@@ -9719,7 +9729,7 @@ return ret;
9719
9729
  });
9720
9730
  //# sourceMappingURL=worker_kernel-uaRPnPAm.js.map
9721
9731
  `, GB = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", WB], { type: "text/javascript;charset=utf-8" });
9722
- function lE(g) {
9732
+ function fE(g) {
9723
9733
  let A;
9724
9734
  try {
9725
9735
  if (A = GB && (self.URL || self.webkitURL).createObjectURL(GB), !A) throw "";
@@ -9740,8 +9750,8 @@ function lE(g) {
9740
9750
  );
9741
9751
  }
9742
9752
  }
9743
- const fE = Math.min(navigator.hardwareConcurrency, 8);
9744
- let CA = [], pE = 0, xB = 0;
9753
+ const pE = Math.min(navigator.hardwareConcurrency, 8);
9754
+ let CA = [], mE = 0, xB = 0;
9745
9755
  const UA = /* @__PURE__ */ new Map(), kI = /* @__PURE__ */ new Set();
9746
9756
  function bB(g) {
9747
9757
  const A = CA.find((I) => I.worker === g);
@@ -9750,7 +9760,7 @@ function bB(g) {
9750
9760
  "Worker not found in pool - this should not happen"
9751
9761
  ), A;
9752
9762
  }
9753
- function mE(g, A) {
9763
+ function uE(g, A) {
9754
9764
  const { id: I, success: B } = g.data, C = UA.get(I);
9755
9765
  if (!C) {
9756
9766
  kI.has(I) ? kI.delete(I) : U.warn(
@@ -9801,20 +9811,20 @@ function wB(g, A) {
9801
9811
  }
9802
9812
  }
9803
9813
  function ZB() {
9804
- const g = new lE();
9805
- return g.addEventListener("message", (A) => mE(A, g)), g.addEventListener("error", (A) => wB(A, g)), g.addEventListener(
9814
+ const g = new fE();
9815
+ return g.addEventListener("message", (A) => uE(A, g)), g.addEventListener("error", (A) => wB(A, g)), g.addEventListener(
9806
9816
  "messageerror",
9807
9817
  (A) => wB(A, g)
9808
9818
  ), g;
9809
9819
  }
9810
- function uE() {
9820
+ function TE() {
9811
9821
  if (CA.length === 0)
9812
9822
  throw new Error("Worker pool is not initialized");
9813
9823
  return CA.sort((g, A) => g.pendingCount - A.pendingCount)[0];
9814
9824
  }
9815
- async function TE(g, A, I) {
9825
+ async function WE(g, A, I) {
9816
9826
  return new Promise((B, C) => {
9817
- const Q = uE(), E = pE++, i = {
9827
+ const Q = TE(), E = mE++, i = {
9818
9828
  resolve: B,
9819
9829
  reject: C,
9820
9830
  workerId: Q.workerId
@@ -9840,10 +9850,10 @@ async function TE(g, A, I) {
9840
9850
  });
9841
9851
  });
9842
9852
  }
9843
- function WE() {
9853
+ function xE() {
9844
9854
  if (!(CA.length > 0))
9845
9855
  try {
9846
- for (let g = 0; g < fE; g++) {
9856
+ for (let g = 0; g < pE; g++) {
9847
9857
  const A = ZB();
9848
9858
  CA.push({
9849
9859
  worker: A,
@@ -9856,26 +9866,26 @@ function WE() {
9856
9866
  `Initialized worker pool with ${CA.length} workers`
9857
9867
  );
9858
9868
  } catch {
9859
- U.warn("ZarrWorker", "Failed to create workers - clearing pool"), bE();
9869
+ U.warn("ZarrWorker", "Failed to create workers - clearing pool"), ZE();
9860
9870
  return;
9861
9871
  }
9862
9872
  }
9863
- async function xE(g, A, I, B) {
9864
- WE();
9873
+ async function bE(g, A, I, B) {
9874
+ xE();
9865
9875
  try {
9866
- return await TE(A, I, B);
9876
+ return await WE(A, I, B);
9867
9877
  } catch (C) {
9868
9878
  if (C instanceof DOMException && C.name === "AbortError")
9869
9879
  throw C;
9870
9880
  return U.warn("ZarrWorker", "Falling back to main thread", C), await g.getChunk(I, B);
9871
9881
  }
9872
9882
  }
9873
- function bE() {
9883
+ function ZE() {
9874
9884
  for (const g of CA)
9875
9885
  g.worker.terminate();
9876
9886
  CA = [], UA.clear();
9877
9887
  }
9878
- class ZE {
9888
+ class PE {
9879
9889
  promises_ = [];
9880
9890
  scheduler_;
9881
9891
  constructor(A) {
@@ -9888,13 +9898,13 @@ class ZE {
9888
9898
  return Promise.all(this.promises_.map((A) => this.scheduler_.submit(A)));
9889
9899
  }
9890
9900
  }
9891
- class PE {
9901
+ class OE {
9892
9902
  metadata_;
9893
9903
  arrays_;
9894
9904
  arrayParams_;
9895
9905
  dimensions_;
9896
9906
  constructor(A) {
9897
- this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = OE(this.metadata_, this.arrays_);
9907
+ this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = VE(this.metadata_, this.arrays_);
9898
9908
  }
9899
9909
  getSourceDimensionMap() {
9900
9910
  return this.dimensions_;
@@ -9902,7 +9912,7 @@ class PE {
9902
9912
  async loadChunkData(A, I) {
9903
9913
  const B = [];
9904
9914
  B[this.dimensions_.x.index] = A.chunkIndex.x, B[this.dimensions_.y.index] = A.chunkIndex.y, this.dimensions_.z && (B[this.dimensions_.z.index] = A.chunkIndex.z), this.dimensions_.c && (B[this.dimensions_.c.index] = A.chunkIndex.c), this.dimensions_.t && (B[this.dimensions_.t.index] = A.chunkIndex.t);
9905
- const C = this.arrays_[A.lod], Q = this.arrayParams_[A.lod], E = await xE(C, Q, B, {
9915
+ const C = this.arrays_[A.lod], Q = this.arrayParams_[A.lod], E = await bE(C, Q, B, {
9906
9916
  signal: I
9907
9917
  });
9908
9918
  if (!vg(E.data))
@@ -9952,10 +9962,10 @@ class PE {
9952
9962
  const C = this.regionToIndices(A, I), Q = this.arrays_[I];
9953
9963
  let E = {};
9954
9964
  B !== void 0 && (E = {
9955
- create_queue: () => new ZE(B),
9965
+ create_queue: () => new PE(B),
9956
9966
  opts: { signal: B.abortSignal }
9957
9967
  });
9958
- const i = await cE(Q, C, E);
9968
+ const i = await UE(Q, C, E);
9959
9969
  if (!vg(i.data))
9960
9970
  throw new Error(
9961
9971
  `Subarray has an unsupported data type, data=${i.data.constructor.name}`
@@ -10017,7 +10027,7 @@ class PE {
10017
10027
  return C;
10018
10028
  }
10019
10029
  }
10020
- function OE(g, A) {
10030
+ function VE(g, A) {
10021
10031
  const I = g.axes.map((h) => h.name), B = g.axes.length, C = nB(I, "x"), Q = nB(I, "y"), E = (h, t) => {
10022
10032
  const y = [];
10023
10033
  for (let w = 0; w < g.datasets.length; w++) {
@@ -10173,7 +10183,7 @@ const S = H.arrayToEnum([
10173
10183
  "invalid_intersection_types",
10174
10184
  "not_multiple_of",
10175
10185
  "not_finite"
10176
- ]), VE = (g) => JSON.stringify(g, null, 2).replace(/"([^"]+)":/g, "$1:");
10186
+ ]), vE = (g) => JSON.stringify(g, null, 2).replace(/"([^"]+)":/g, "$1:");
10177
10187
  class $ extends Error {
10178
10188
  get errors() {
10179
10189
  return this.issues;
@@ -10291,7 +10301,7 @@ const lA = (g, A) => {
10291
10301
  return { message: I };
10292
10302
  };
10293
10303
  let OB = lA;
10294
- function vE(g) {
10304
+ function XE(g) {
10295
10305
  OB = g;
10296
10306
  }
10297
10307
  function LI() {
@@ -10317,7 +10327,7 @@ const JI = (g) => {
10317
10327
  path: Q,
10318
10328
  message: i
10319
10329
  };
10320
- }, XE = [];
10330
+ }, jE = [];
10321
10331
  function F(g, A) {
10322
10332
  const I = LI(), B = JI({
10323
10333
  issueData: A,
@@ -10648,14 +10658,14 @@ class K {
10648
10658
  return this.safeParse(null).success;
10649
10659
  }
10650
10660
  }
10651
- const jE = /^c[^\s-]{8,}$/i, zE = /^[0-9a-z]+$/, _E = /^[0-9A-HJKMNP-TV-Z]{26}$/i, $E = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ai = /^[a-z0-9_-]{21}$/i, Ii = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, gi = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Bi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ci = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
10661
+ const zE = /^c[^\s-]{8,}$/i, _E = /^[0-9a-z]+$/, $E = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ai = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ii = /^[a-z0-9_-]{21}$/i, gi = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Bi = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ci = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Qi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
10652
10662
  let _I;
10653
- const Qi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Ei = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, ii = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, oi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ai = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Di = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, vB = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", si = new RegExp(`^${vB}$`);
10663
+ const Ei = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ii = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, oi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, ai = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Di = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, si = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, vB = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", hi = new RegExp(`^${vB}$`);
10654
10664
  function XB(g) {
10655
10665
  let A = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
10656
10666
  return g.precision ? A = `${A}\\.\\d{${g.precision}}` : g.precision == null && (A = `${A}(\\.\\d+)?`), A;
10657
10667
  }
10658
- function hi(g) {
10668
+ function ti(g) {
10659
10669
  return new RegExp(`^${XB(g)}$`);
10660
10670
  }
10661
10671
  function jB(g) {
@@ -10663,11 +10673,11 @@ function jB(g) {
10663
10673
  const I = [];
10664
10674
  return I.push(g.local ? "Z?" : "Z"), g.offset && I.push("([+-]\\d{2}:?\\d{2})"), A = `${A}(${I.join("|")})`, new RegExp(`^${A}$`);
10665
10675
  }
10666
- function ti(g, A) {
10667
- return !!((A === "v4" || !A) && Qi.test(g) || (A === "v6" || !A) && ii.test(g));
10668
- }
10669
10676
  function yi(g, A) {
10670
- if (!Ii.test(g))
10677
+ return !!((A === "v4" || !A) && Ei.test(g) || (A === "v6" || !A) && oi.test(g));
10678
+ }
10679
+ function ei(g, A) {
10680
+ if (!gi.test(g))
10671
10681
  return !1;
10672
10682
  try {
10673
10683
  const [I] = g.split("."), B = I.replace(/-/g, "+").replace(/_/g, "/").padEnd(I.length + (4 - I.length % 4) % 4, "="), C = JSON.parse(atob(B));
@@ -10676,8 +10686,8 @@ function yi(g, A) {
10676
10686
  return !1;
10677
10687
  }
10678
10688
  }
10679
- function ei(g, A) {
10680
- return !!((A === "v4" || !A) && Ei.test(g) || (A === "v6" || !A) && oi.test(g));
10689
+ function Gi(g, A) {
10690
+ return !!((A === "v4" || !A) && ii.test(g) || (A === "v6" || !A) && ai.test(g));
10681
10691
  }
10682
10692
  class gA extends K {
10683
10693
  _parse(A) {
@@ -10728,43 +10738,43 @@ class gA extends K {
10728
10738
  message: Q.message
10729
10739
  }), B.dirty());
10730
10740
  } else if (Q.kind === "email")
10731
- Bi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10741
+ Ci.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10732
10742
  validation: "email",
10733
10743
  code: e.invalid_string,
10734
10744
  message: Q.message
10735
10745
  }), B.dirty());
10736
10746
  else if (Q.kind === "emoji")
10737
- _I || (_I = new RegExp(Ci, "u")), _I.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10747
+ _I || (_I = new RegExp(Qi, "u")), _I.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10738
10748
  validation: "emoji",
10739
10749
  code: e.invalid_string,
10740
10750
  message: Q.message
10741
10751
  }), B.dirty());
10742
10752
  else if (Q.kind === "uuid")
10743
- $E.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10753
+ Ai.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10744
10754
  validation: "uuid",
10745
10755
  code: e.invalid_string,
10746
10756
  message: Q.message
10747
10757
  }), B.dirty());
10748
10758
  else if (Q.kind === "nanoid")
10749
- Ai.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10759
+ Ii.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10750
10760
  validation: "nanoid",
10751
10761
  code: e.invalid_string,
10752
10762
  message: Q.message
10753
10763
  }), B.dirty());
10754
10764
  else if (Q.kind === "cuid")
10755
- jE.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10765
+ zE.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10756
10766
  validation: "cuid",
10757
10767
  code: e.invalid_string,
10758
10768
  message: Q.message
10759
10769
  }), B.dirty());
10760
10770
  else if (Q.kind === "cuid2")
10761
- zE.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10771
+ _E.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10762
10772
  validation: "cuid2",
10763
10773
  code: e.invalid_string,
10764
10774
  message: Q.message
10765
10775
  }), B.dirty());
10766
10776
  else if (Q.kind === "ulid")
10767
- _E.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10777
+ $E.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10768
10778
  validation: "ulid",
10769
10779
  code: e.invalid_string,
10770
10780
  message: Q.message
@@ -10799,35 +10809,35 @@ class gA extends K {
10799
10809
  code: e.invalid_string,
10800
10810
  validation: "datetime",
10801
10811
  message: Q.message
10802
- }), B.dirty()) : Q.kind === "date" ? si.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10812
+ }), B.dirty()) : Q.kind === "date" ? hi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10803
10813
  code: e.invalid_string,
10804
10814
  validation: "date",
10805
10815
  message: Q.message
10806
- }), B.dirty()) : Q.kind === "time" ? hi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10816
+ }), B.dirty()) : Q.kind === "time" ? ti(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10807
10817
  code: e.invalid_string,
10808
10818
  validation: "time",
10809
10819
  message: Q.message
10810
- }), B.dirty()) : Q.kind === "duration" ? gi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10820
+ }), B.dirty()) : Q.kind === "duration" ? Bi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10811
10821
  validation: "duration",
10812
10822
  code: e.invalid_string,
10813
10823
  message: Q.message
10814
- }), B.dirty()) : Q.kind === "ip" ? ti(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10824
+ }), B.dirty()) : Q.kind === "ip" ? yi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10815
10825
  validation: "ip",
10816
10826
  code: e.invalid_string,
10817
10827
  message: Q.message
10818
- }), B.dirty()) : Q.kind === "jwt" ? yi(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), F(C, {
10828
+ }), B.dirty()) : Q.kind === "jwt" ? ei(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), F(C, {
10819
10829
  validation: "jwt",
10820
10830
  code: e.invalid_string,
10821
10831
  message: Q.message
10822
- }), B.dirty()) : Q.kind === "cidr" ? ei(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10832
+ }), B.dirty()) : Q.kind === "cidr" ? Gi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10823
10833
  validation: "cidr",
10824
10834
  code: e.invalid_string,
10825
10835
  message: Q.message
10826
- }), B.dirty()) : Q.kind === "base64" ? ai.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10836
+ }), B.dirty()) : Q.kind === "base64" ? Di.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10827
10837
  validation: "base64",
10828
10838
  code: e.invalid_string,
10829
10839
  message: Q.message
10830
- }), B.dirty()) : Q.kind === "base64url" ? Di.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10840
+ }), B.dirty()) : Q.kind === "base64url" ? si.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10831
10841
  validation: "base64url",
10832
10842
  code: e.invalid_string,
10833
10843
  message: Q.message
@@ -11066,7 +11076,7 @@ gA.create = (g) => {
11066
11076
  ...M(g)
11067
11077
  });
11068
11078
  };
11069
- function Gi(g, A) {
11079
+ function wi(g, A) {
11070
11080
  const I = (g.toString().split(".")[1] || "").length, B = (A.toString().split(".")[1] || "").length, C = I > B ? I : B, Q = parseInt(g.toFixed(C).replace(".", "")), E = parseInt(A.toFixed(C).replace(".", ""));
11071
11081
  return Q % E / Math.pow(10, C);
11072
11082
  }
@@ -11105,7 +11115,7 @@ class eA extends K {
11105
11115
  inclusive: Q.inclusive,
11106
11116
  exact: !1,
11107
11117
  message: Q.message
11108
- }), C.dirty()) : Q.kind === "multipleOf" ? Gi(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), F(B, {
11118
+ }), C.dirty()) : Q.kind === "multipleOf" ? wi(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), F(B, {
11109
11119
  code: e.not_multiple_of,
11110
11120
  multipleOf: Q.value,
11111
11121
  message: Q.message
@@ -12814,7 +12824,7 @@ HI.create = (g) => new HI({
12814
12824
  typeName: J.ZodNaN,
12815
12825
  ...M(g)
12816
12826
  });
12817
- const wi = Symbol("zod_brand");
12827
+ const ni = Symbol("zod_brand");
12818
12828
  class Kg extends K {
12819
12829
  _parse(A) {
12820
12830
  const { ctx: I } = this._processInputParams(A), B = I.data;
@@ -12904,16 +12914,16 @@ function _B(g, A = {}, I) {
12904
12914
  }
12905
12915
  }) : fA.create();
12906
12916
  }
12907
- const ni = {
12917
+ const Fi = {
12908
12918
  object: m.lazycreate
12909
12919
  };
12910
12920
  var J;
12911
12921
  (function(g) {
12912
12922
  g.ZodString = "ZodString", g.ZodNumber = "ZodNumber", g.ZodNaN = "ZodNaN", g.ZodBigInt = "ZodBigInt", g.ZodBoolean = "ZodBoolean", g.ZodDate = "ZodDate", g.ZodSymbol = "ZodSymbol", g.ZodUndefined = "ZodUndefined", g.ZodNull = "ZodNull", g.ZodAny = "ZodAny", g.ZodUnknown = "ZodUnknown", g.ZodNever = "ZodNever", g.ZodVoid = "ZodVoid", g.ZodArray = "ZodArray", g.ZodObject = "ZodObject", g.ZodUnion = "ZodUnion", g.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", g.ZodIntersection = "ZodIntersection", g.ZodTuple = "ZodTuple", g.ZodRecord = "ZodRecord", g.ZodMap = "ZodMap", g.ZodSet = "ZodSet", g.ZodFunction = "ZodFunction", g.ZodLazy = "ZodLazy", g.ZodLiteral = "ZodLiteral", g.ZodEnum = "ZodEnum", g.ZodEffects = "ZodEffects", g.ZodNativeEnum = "ZodNativeEnum", g.ZodOptional = "ZodOptional", g.ZodNullable = "ZodNullable", g.ZodDefault = "ZodDefault", g.ZodCatch = "ZodCatch", g.ZodPromise = "ZodPromise", g.ZodBranded = "ZodBranded", g.ZodPipeline = "ZodPipeline", g.ZodReadonly = "ZodReadonly";
12913
12923
  })(J || (J = {}));
12914
- const Fi = (g, A = {
12924
+ const ri = (g, A = {
12915
12925
  message: `Input not instance of ${g.name}`
12916
- }) => _B((I) => I instanceof g, A), $B = gA.create, AC = eA.create, ri = HI.create, Si = GA.create, IC = _A.create, Ri = LA.create, Ni = dI.create, ci = $A.create, Ui = AI.create, ki = fA.create, Li = NA.create, Ji = yA.create, Yi = MI.create, di = QA.create, Mi = m.create, Ki = m.strictCreate, Hi = II.create, qi = uI.create, li = gI.create, fi = sA.create, pi = BI.create, mi = KI.create, ui = JA.create, Ti = KA.create, Wi = CI.create, xi = QI.create, bi = wA.create, Zi = EI.create, Pi = pA.create, RB = EA.create, Oi = aA.create, Vi = nA.create, vi = EA.createWithPreprocess, Xi = eI.create, ji = () => $B().optional(), zi = () => AC().optional(), _i = () => IC().optional(), $i = {
12926
+ }) => _B((I) => I instanceof g, A), $B = gA.create, AC = eA.create, Si = HI.create, Ri = GA.create, IC = _A.create, Ni = LA.create, ci = dI.create, Ui = $A.create, ki = AI.create, Li = fA.create, Ji = NA.create, Yi = yA.create, di = MI.create, Mi = QA.create, Ki = m.create, Hi = m.strictCreate, qi = II.create, li = uI.create, fi = gI.create, pi = sA.create, mi = BI.create, ui = KI.create, Ti = JA.create, Wi = KA.create, xi = CI.create, bi = QI.create, Zi = wA.create, Pi = EI.create, Oi = pA.create, RB = EA.create, Vi = aA.create, vi = nA.create, Xi = EA.createWithPreprocess, ji = eI.create, zi = () => $B().optional(), _i = () => AC().optional(), $i = () => IC().optional(), Ao = {
12917
12927
  string: (g) => gA.create({ ...g, coerce: !0 }),
12918
12928
  number: (g) => eA.create({ ...g, coerce: !0 }),
12919
12929
  boolean: (g) => _A.create({
@@ -12922,14 +12932,14 @@ const Fi = (g, A = {
12922
12932
  }),
12923
12933
  bigint: (g) => GA.create({ ...g, coerce: !0 }),
12924
12934
  date: (g) => LA.create({ ...g, coerce: !0 })
12925
- }, Ao = Y;
12935
+ }, Io = Y;
12926
12936
  var s = /* @__PURE__ */ Object.freeze({
12927
12937
  __proto__: null,
12928
12938
  defaultErrorMap: lA,
12929
- setErrorMap: vE,
12939
+ setErrorMap: XE,
12930
12940
  getErrorMap: LI,
12931
12941
  makeIssue: JI,
12932
- EMPTY_PATH: XE,
12942
+ EMPTY_PATH: jE,
12933
12943
  addIssueToContext: F,
12934
12944
  ParseStatus: X,
12935
12945
  INVALID: Y,
@@ -12983,63 +12993,63 @@ var s = /* @__PURE__ */ Object.freeze({
12983
12993
  ZodDefault: iI,
12984
12994
  ZodCatch: oI,
12985
12995
  ZodNaN: HI,
12986
- BRAND: wi,
12996
+ BRAND: ni,
12987
12997
  ZodBranded: Kg,
12988
12998
  ZodPipeline: eI,
12989
12999
  ZodReadonly: aI,
12990
13000
  custom: _B,
12991
13001
  Schema: K,
12992
13002
  ZodSchema: K,
12993
- late: ni,
13003
+ late: Fi,
12994
13004
  get ZodFirstPartyTypeKind() {
12995
13005
  return J;
12996
13006
  },
12997
- coerce: $i,
12998
- any: ki,
12999
- array: di,
13000
- bigint: Si,
13007
+ coerce: Ao,
13008
+ any: Li,
13009
+ array: Mi,
13010
+ bigint: Ri,
13001
13011
  boolean: IC,
13002
- date: Ri,
13003
- discriminatedUnion: qi,
13012
+ date: Ni,
13013
+ discriminatedUnion: li,
13004
13014
  effect: RB,
13005
- enum: bi,
13006
- function: Ti,
13007
- instanceof: Fi,
13008
- intersection: li,
13009
- lazy: Wi,
13010
- literal: xi,
13011
- map: mi,
13012
- nan: ri,
13013
- nativeEnum: Zi,
13014
- never: Ji,
13015
- null: Ui,
13016
- nullable: Vi,
13015
+ enum: Zi,
13016
+ function: Wi,
13017
+ instanceof: ri,
13018
+ intersection: fi,
13019
+ lazy: xi,
13020
+ literal: bi,
13021
+ map: ui,
13022
+ nan: Si,
13023
+ nativeEnum: Pi,
13024
+ never: Yi,
13025
+ null: ki,
13026
+ nullable: vi,
13017
13027
  number: AC,
13018
- object: Mi,
13019
- oboolean: _i,
13020
- onumber: zi,
13021
- optional: Oi,
13022
- ostring: ji,
13023
- pipeline: Xi,
13024
- preprocess: vi,
13025
- promise: Pi,
13026
- record: pi,
13027
- set: ui,
13028
- strictObject: Ki,
13028
+ object: Ki,
13029
+ oboolean: $i,
13030
+ onumber: _i,
13031
+ optional: Vi,
13032
+ ostring: zi,
13033
+ pipeline: ji,
13034
+ preprocess: Xi,
13035
+ promise: Oi,
13036
+ record: mi,
13037
+ set: Ti,
13038
+ strictObject: Hi,
13029
13039
  string: $B,
13030
- symbol: Ni,
13040
+ symbol: ci,
13031
13041
  transformer: RB,
13032
- tuple: fi,
13033
- undefined: ci,
13034
- union: Hi,
13035
- unknown: Li,
13036
- void: Yi,
13037
- NEVER: Ao,
13042
+ tuple: pi,
13043
+ undefined: Ui,
13044
+ union: qi,
13045
+ unknown: Ji,
13046
+ void: di,
13047
+ NEVER: Io,
13038
13048
  ZodIssueCode: e,
13039
- quotelessJson: VE,
13049
+ quotelessJson: vE,
13040
13050
  ZodError: $
13041
13051
  });
13042
- const Io = s.object({
13052
+ const go = s.object({
13043
13053
  /**The multiscale datasets for this image*/
13044
13054
  multiscales: s.array(
13045
13055
  s.object({
@@ -13167,7 +13177,7 @@ const Io = s.object({
13167
13177
  projection: s.string().optional()
13168
13178
  }).optional()
13169
13179
  }).optional()
13170
- }).describe("JSON from OME-NGFF .zattrs"), go = s.object({
13180
+ }).describe("JSON from OME-NGFF .zattrs"), Bo = s.object({
13171
13181
  plate: s.object({
13172
13182
  /**The acquisitions for this plate*/
13173
13183
  acquisitions: s.array(
@@ -13226,7 +13236,7 @@ const Io = s.object({
13226
13236
  })
13227
13237
  ).min(1).describe("The wells of the plate")
13228
13238
  }).optional()
13229
- }).describe("JSON from OME-NGFF .zattrs"), Bo = s.object({
13239
+ }).describe("JSON from OME-NGFF .zattrs"), Co = s.object({
13230
13240
  well: s.object({
13231
13241
  /**The fields of view for this well*/
13232
13242
  images: s.array(
@@ -13240,7 +13250,7 @@ const Io = s.object({
13240
13250
  /**The version of the specification*/
13241
13251
  version: s.literal("0.4").describe("The version of the specification").optional()
13242
13252
  }).optional()
13243
- }).describe("JSON from OME-NGFF .zattrs"), Co = s.object({
13253
+ }).describe("JSON from OME-NGFF .zattrs"), Qo = s.object({
13244
13254
  /**The versioned OME-Zarr Metadata namespace*/
13245
13255
  ome: s.object({
13246
13256
  /**The multiscale datasets for this image*/
@@ -13370,7 +13380,7 @@ const Io = s.object({
13370
13380
  /**The version of the OME-Zarr Metadata*/
13371
13381
  version: s.literal("0.5").describe("The version of the OME-Zarr Metadata")
13372
13382
  }).describe("The versioned OME-Zarr Metadata namespace")
13373
- }).describe("The zarr.json attributes key"), Qo = s.object({
13383
+ }).describe("The zarr.json attributes key"), Eo = s.object({
13374
13384
  /**The versioned OME-Zarr Metadata namespace*/
13375
13385
  ome: s.object({
13376
13386
  plate: s.object({
@@ -13432,7 +13442,7 @@ const Io = s.object({
13432
13442
  /**The version of the OME-Zarr Metadata*/
13433
13443
  version: s.literal("0.5").describe("The version of the OME-Zarr Metadata")
13434
13444
  }).describe("The versioned OME-Zarr Metadata namespace")
13435
- }).describe("The zarr.json attributes key"), Eo = s.object({
13445
+ }).describe("The zarr.json attributes key"), io = s.object({
13436
13446
  /**The versioned OME-Zarr Metadata namespace*/
13437
13447
  ome: s.object({
13438
13448
  well: s.object({
@@ -13451,15 +13461,15 @@ const Io = s.object({
13451
13461
  /**The version of the OME-Zarr Metadata*/
13452
13462
  version: s.literal("0.5").describe("The version of the OME-Zarr Metadata")
13453
13463
  }).describe("The versioned OME-Zarr Metadata namespace")
13454
- }).describe("JSON from OME-Zarr zarr.json"), io = ["0.4", "0.5"], oo = new Set(io);
13455
- function ao(g) {
13464
+ }).describe("JSON from OME-Zarr zarr.json"), oo = ["0.4", "0.5"], ao = new Set(oo);
13465
+ function Do(g) {
13456
13466
  if (!("ome" in g) || !(g.ome instanceof Object)) return;
13457
13467
  const A = g.ome;
13458
- if ("version" in A && typeof A.version == "string" && oo.has(A.version))
13468
+ if ("version" in A && typeof A.version == "string" && ao.has(A.version))
13459
13469
  return A.version;
13460
13470
  }
13461
13471
  function Hg(g) {
13462
- const A = ao(g);
13472
+ const A = Do(g);
13463
13473
  return A === void 0 ? "0.4" : A;
13464
13474
  }
13465
13475
  function mA(g) {
@@ -13475,10 +13485,10 @@ function gC(g, A) {
13475
13485
  const I = { ...g };
13476
13486
  return delete I[A], I;
13477
13487
  }
13478
- async function Yo(g, A) {
13488
+ async function Mo(g, A) {
13479
13489
  const I = new WA(g), B = new z(I), C = mA(A), Q = await yI(B, C);
13480
13490
  try {
13481
- return Do(Q.attrs);
13491
+ return so(Q.attrs);
13482
13492
  } catch {
13483
13493
  throw Error(
13484
13494
  `Failed to parse OME-Zarr plate:
@@ -13486,21 +13496,21 @@ ${JSON.stringify(Q.attrs)}`
13486
13496
  );
13487
13497
  }
13488
13498
  }
13489
- function Do(g) {
13499
+ function so(g) {
13490
13500
  switch (Hg(g)) {
13491
13501
  case "0.5":
13492
13502
  return {
13493
- ...Qo.parse(g).ome,
13503
+ ...Eo.parse(g).ome,
13494
13504
  originalVersion: "0.5"
13495
13505
  };
13496
13506
  case "0.4":
13497
13507
  return {
13498
- ...so(go.parse(g)).ome,
13508
+ ...ho(Bo.parse(g)).ome,
13499
13509
  originalVersion: "0.4"
13500
13510
  };
13501
13511
  }
13502
13512
  }
13503
- function so(g) {
13513
+ function ho(g) {
13504
13514
  if (g.plate === void 0)
13505
13515
  throw new Error("Plate metadata is missing in OME-Zarr v0.4 plate");
13506
13516
  return {
@@ -13510,7 +13520,7 @@ function so(g) {
13510
13520
  }
13511
13521
  };
13512
13522
  }
13513
- function ho(g) {
13523
+ function to(g) {
13514
13524
  if (g.well === void 0)
13515
13525
  throw new Error("Well metadata is missing in OME-Zarr v0.4 well");
13516
13526
  return {
@@ -13520,24 +13530,24 @@ function ho(g) {
13520
13530
  }
13521
13531
  };
13522
13532
  }
13523
- function to(g) {
13533
+ function yo(g) {
13524
13534
  switch (Hg(g)) {
13525
13535
  case "0.5":
13526
13536
  return {
13527
- ...Eo.parse(g).ome,
13537
+ ...io.parse(g).ome,
13528
13538
  originalVersion: "0.5"
13529
13539
  };
13530
13540
  case "0.4":
13531
13541
  return {
13532
- ...ho(Bo.parse(g)).ome,
13542
+ ...to(Co.parse(g)).ome,
13533
13543
  originalVersion: "0.4"
13534
13544
  };
13535
13545
  }
13536
13546
  }
13537
- async function Mo(g, A, I) {
13547
+ async function Ko(g, A, I) {
13538
13548
  const B = g + "/" + A, C = new WA(B), Q = new z(C), E = mA(I), i = await yI(Q, E);
13539
13549
  try {
13540
- return to(i.attrs);
13550
+ return yo(i.attrs);
13541
13551
  } catch {
13542
13552
  throw Error(
13543
13553
  `Failed to parse OME-Zarr well:
@@ -13545,15 +13555,15 @@ ${JSON.stringify(i.attrs)}`
13545
13555
  );
13546
13556
  }
13547
13557
  }
13548
- async function Ko(g) {
13558
+ async function Ho(g) {
13549
13559
  const A = mA(g.version), I = await yI(g.location, A);
13550
13560
  return qg(I.attrs).omero?.channels ?? [];
13551
13561
  }
13552
- async function Ho(g) {
13562
+ async function qo(g) {
13553
13563
  const A = mA(g.version), I = await yI(g.location, A);
13554
13564
  return qg(I.attrs).omero?.rdefs;
13555
13565
  }
13556
- function yo(g) {
13566
+ function eo(g) {
13557
13567
  return {
13558
13568
  ome: {
13559
13569
  multiscales: g.multiscales,
@@ -13562,23 +13572,23 @@ function yo(g) {
13562
13572
  }
13563
13573
  };
13564
13574
  }
13565
- function eo(g) {
13575
+ function Go(g) {
13566
13576
  switch (Hg(g)) {
13567
13577
  case "0.5":
13568
13578
  return {
13569
- ...Co.parse(g).ome,
13579
+ ...Qo.parse(g).ome,
13570
13580
  originalVersion: "0.5"
13571
13581
  };
13572
13582
  case "0.4":
13573
13583
  return {
13574
- ...yo(Io.parse(g)).ome,
13584
+ ...eo(go.parse(g)).ome,
13575
13585
  originalVersion: "0.4"
13576
13586
  };
13577
13587
  }
13578
13588
  }
13579
13589
  function qg(g) {
13580
13590
  try {
13581
- return eo(g);
13591
+ return Go(g);
13582
13592
  } catch {
13583
13593
  throw Error(`Failed to parse OME-Zarr image:
13584
13594
  ${JSON.stringify(g)}`);
@@ -13602,15 +13612,15 @@ class FI {
13602
13612
  throw new Error("No datasets found in the multiscale image.");
13603
13613
  A || (A = mA(B.originalVersion));
13604
13614
  const E = Q.datasets.map(
13605
- (D) => qE(this.location, D.path, A)
13615
+ (D) => lE(this.location, D.path, A)
13606
13616
  ), i = await Promise.all(
13607
- E.map((D) => HE(D))
13617
+ E.map((D) => qE(D))
13608
13618
  ), o = i[0].shape, a = Q.axes;
13609
13619
  if (a.length !== o.length)
13610
13620
  throw new Error(
13611
13621
  `Mismatch between number of axes (${a.length}) and array shape (${o.length})`
13612
13622
  );
13613
- return new PE({
13623
+ return new OE({
13614
13624
  metadata: Q,
13615
13625
  arrays: i,
13616
13626
  arrayParams: E
@@ -13671,7 +13681,7 @@ const BC = [
13671
13681
  "prefetchSpace"
13672
13682
  ];
13673
13683
  function lg(g) {
13674
- Go(g);
13684
+ wo(g);
13675
13685
  const A = {
13676
13686
  x: g.prefetch.x,
13677
13687
  y: g.prefetch.y,
@@ -13698,7 +13708,7 @@ function lg(g) {
13698
13708
  };
13699
13709
  return Object.freeze(C);
13700
13710
  }
13701
- function qo(g = {}) {
13711
+ function lo(g = {}) {
13702
13712
  return lg(fg({
13703
13713
  profile: "exploration",
13704
13714
  prefetch: { x: 1, y: 1, z: 1, t: 0 },
@@ -13711,7 +13721,7 @@ function qo(g = {}) {
13711
13721
  ]
13712
13722
  }, g));
13713
13723
  }
13714
- function lo(g = {}) {
13724
+ function fo(g = {}) {
13715
13725
  return lg(fg({
13716
13726
  profile: "playback",
13717
13727
  prefetch: { x: 0, y: 0, z: 0, t: 20 },
@@ -13724,7 +13734,7 @@ function lo(g = {}) {
13724
13734
  ]
13725
13735
  }, g));
13726
13736
  }
13727
- function fo(g = {}) {
13737
+ function po(g = {}) {
13728
13738
  return lg(fg({
13729
13739
  profile: "no-prefetch",
13730
13740
  prefetch: { x: 0, y: 0, z: 0, t: 0 },
@@ -13737,7 +13747,7 @@ function fo(g = {}) {
13737
13747
  ]
13738
13748
  }, g));
13739
13749
  }
13740
- function Go(g) {
13750
+ function wo(g) {
13741
13751
  for (const [B, C] of Object.entries(g.prefetch))
13742
13752
  if (C !== void 0 && C < 0)
13743
13753
  throw new Error(`prefetch.${B} must be a non-negative number`);
@@ -13756,7 +13766,7 @@ function fg(g, A = {}) {
13756
13766
  priorityOrder: A.priorityOrder ?? g.priorityOrder
13757
13767
  };
13758
13768
  }
13759
- class po {
13769
+ class mo {
13760
13770
  radius;
13761
13771
  phi;
13762
13772
  theta;
@@ -13772,7 +13782,7 @@ class po {
13772
13782
  );
13773
13783
  }
13774
13784
  }
13775
- class mo extends TA {
13785
+ class uo extends TA {
13776
13786
  atlas_;
13777
13787
  constructor(A, I) {
13778
13788
  super(), this.programName = "points", this.atlas_ = I, A.forEach((Q) => {
@@ -13816,40 +13826,40 @@ class mo extends TA {
13816
13826
  }
13817
13827
  }
13818
13828
  export {
13819
- So as AxesLayer,
13829
+ Ro as AxesLayer,
13820
13830
  AA as Box2,
13821
13831
  RA as Box3,
13822
13832
  HB as ChunkedImageLayer,
13823
13833
  l as Color,
13824
13834
  wQ as Frustum,
13825
- wo as Idetik,
13826
- Uo as ImageLayer,
13827
- Lo as ImageSeriesLayer,
13828
- ko as LabelImageLayer,
13835
+ no as Idetik,
13836
+ ko as ImageLayer,
13837
+ Jo as ImageSeriesLayer,
13838
+ Lo as LabelImageLayer,
13829
13839
  FA as Layer,
13830
13840
  EQ as LayerManager,
13831
13841
  FI as OmeZarrImageSource,
13832
- no as OrthographicCamera,
13833
- ro as PanZoomControls,
13834
- Fo as PerspectiveCamera,
13842
+ Fo as OrthographicCamera,
13843
+ So as PanZoomControls,
13844
+ ro as PerspectiveCamera,
13835
13845
  YA as Plane,
13836
- mo as Points,
13837
- Ro as ProjectedLineLayer,
13838
- po as Spherical,
13846
+ uo as Points,
13847
+ No as ProjectedLineLayer,
13848
+ mo as Spherical,
13839
13849
  DI as Texture2DArray,
13840
13850
  wg as Texture3D,
13841
- No as TracksLayer,
13851
+ co as TracksLayer,
13842
13852
  DQ as Viewport,
13843
- co as VolumeLayer,
13853
+ Uo as VolumeLayer,
13844
13854
  _C as WebGLRenderer,
13845
- qo as createExplorationPolicy,
13855
+ lo as createExplorationPolicy,
13846
13856
  lg as createImageSourcePolicy,
13847
- fo as createNoPrefetchPolicy,
13848
- lo as createPlaybackPolicy,
13849
- Yo as loadOmeZarrPlate,
13850
- Mo as loadOmeZarrWell,
13851
- Ko as loadOmeroChannels,
13852
- Ho as loadOmeroDefaults,
13857
+ po as createNoPrefetchPolicy,
13858
+ fo as createPlaybackPolicy,
13859
+ Mo as loadOmeZarrPlate,
13860
+ Ko as loadOmeZarrWell,
13861
+ Ho as loadOmeroChannels,
13862
+ qo as loadOmeroDefaults,
13853
13863
  hQ as parseViewportConfigs
13854
13864
  };
13855
13865
  //# sourceMappingURL=index.js.map