@vitessce/dev 3.6.5 → 3.6.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.
- package/dist/{ReactNeuroglancer-Bxraqwdg.js → ReactNeuroglancer-D8uj4yly.js} +1 -1
- package/dist/{deflate-DIUGujry.js → deflate-DSg-Fr9r.js} +1 -1
- package/dist/{higlass-BE_Wyh8v.js → higlass-xUpmTfKO.js} +86946 -101122
- package/dist/{index-BRgFrTlZ.js → index-9kcg40fJ.js} +2 -2
- package/dist/{index-V3ohmXYj.js → index-YthrVSEK.js} +542 -1987
- package/dist/index.js +1 -1
- package/dist/{jpeg-Dq_qYUFw.js → jpeg-D40_cEtP.js} +1 -1
- package/dist/{lerc-Cx4nw6UL.js → lerc-DUsVxZoD.js} +1 -1
- package/dist/{lzw-CQYaPiag.js → lzw-DokUd_oP.js} +1 -1
- package/dist/{packbits-inu-OpHk.js → packbits-BFRLW0tW.js} +1 -1
- package/dist/{raw-B_XBAxid.js → raw-BYhalBdp.js} +1 -1
- package/dist/{troika-three-text.esm-CHyv3Hij.js → troika-three-text.esm-C-vPhIB6.js} +1 -1
- package/dist/{webimage-CfKyc_Zj.js → webimage-D2SmoHLs.js} +1 -1
- package/package.json +5 -5
- package/dist/browser-CwsEWr7C.js +0 -784
- package/dist/gzip-BcpOCWcu.js +0 -27
- package/dist/zlib-ZTk3sZPP.js +0 -27
|
@@ -17,7 +17,7 @@ var __privateWrapper = (obj, member, setter2, getter2) => ({
|
|
|
17
17
|
return __privateGet(obj, member, getter2);
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
var _focused, _cleanup, _setup, _a2, _online, _cleanup2, _setup2, _b2, _gcTimeout, _c2, _initialState, _revertState, _cache2, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn, _d, _queries, _e2, _observers, _mutationCache, _retryer2, _Mutation_instances, dispatch_fn2, _f3, _mutations, _scopes, _mutationId, _g2, _queryCache, _mutationCache2, _defaultOptions2, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h2, _client2, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn, _i, _client3, _result, _queries2, _options, _observers2, _combinedResult, _lastCombine, _lastResult, _observerMatches, _QueriesObserver_instances, trackResult_fn, combineResult_fn, findMatchingObservers_fn, onUpdate_fn, notify_fn2, _j2, _k2, _l2, _bytes,
|
|
20
|
+
var _focused, _cleanup, _setup, _a2, _online, _cleanup2, _setup2, _b2, _gcTimeout, _c2, _initialState, _revertState, _cache2, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn, _d, _queries, _e2, _observers, _mutationCache, _retryer2, _Mutation_instances, dispatch_fn2, _f3, _mutations, _scopes, _mutationId, _g2, _queryCache, _mutationCache2, _defaultOptions2, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h2, _client2, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn, _i, _client3, _result, _queries2, _options, _observers2, _combinedResult, _lastCombine, _lastResult, _observerMatches, _QueriesObserver_instances, trackResult_fn, combineResult_fn, findMatchingObservers_fn, onUpdate_fn, notify_fn2, _j2, _k2, _l2, _bytes, _encoder, _data, _stride, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _encoder_config, _decoder_config, _order, _inverseOrder, _shape2, _strides, _metadata, _m, _n, _o2, _metadata2, _p, _overrides, _use_suffix_request, _FetchStore_instances, merge_init_fn, _overrides2, _refs, _opts, _overrides3;
|
|
21
21
|
import * as React from "react";
|
|
22
22
|
import React__default, { useContext, forwardRef as forwardRef$1, useRef, useMemo as useMemo$1, createContext, createElement, isValidElement, cloneElement, Children, useCallback, Component as Component$1, useState, useEffect, useLayoutEffect as useLayoutEffect$1, version as version$7, useImperativeHandle, PureComponent, Suspense, useReducer } from "react";
|
|
23
23
|
import * as ReactDOM from "react-dom";
|
|
@@ -1321,7 +1321,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
1321
1321
|
CoordinationType$2.HIERARCHY_LEVELS
|
|
1322
1322
|
]
|
|
1323
1323
|
};
|
|
1324
|
-
const version$6 = "3.6.
|
|
1324
|
+
const version$6 = "3.6.7";
|
|
1325
1325
|
const META_VERSION = {
|
|
1326
1326
|
version: version$6
|
|
1327
1327
|
};
|
|
@@ -4795,7 +4795,7 @@ function peek$3() {
|
|
|
4795
4795
|
function caret() {
|
|
4796
4796
|
return position$3;
|
|
4797
4797
|
}
|
|
4798
|
-
function slice$
|
|
4798
|
+
function slice$7(begin, end2) {
|
|
4799
4799
|
return substr(characters, begin, end2);
|
|
4800
4800
|
}
|
|
4801
4801
|
function token(type2) {
|
|
@@ -4843,7 +4843,7 @@ function dealloc(value2) {
|
|
|
4843
4843
|
return characters = "", value2;
|
|
4844
4844
|
}
|
|
4845
4845
|
function delimit(type2) {
|
|
4846
|
-
return trim$1(slice$
|
|
4846
|
+
return trim$1(slice$7(position$3 - 1, delimiter(type2 === 91 ? type2 + 2 : type2 === 40 ? type2 + 1 : type2)));
|
|
4847
4847
|
}
|
|
4848
4848
|
function whitespace$1(type2) {
|
|
4849
4849
|
while (character = peek$3())
|
|
@@ -4857,7 +4857,7 @@ function escaping(index2, count2) {
|
|
|
4857
4857
|
while (--count2 && next())
|
|
4858
4858
|
if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
|
|
4859
4859
|
break;
|
|
4860
|
-
return slice$
|
|
4860
|
+
return slice$7(index2, caret() + (count2 < 6 && peek$3() == 32 && next() == 32));
|
|
4861
4861
|
}
|
|
4862
4862
|
function delimiter(type2) {
|
|
4863
4863
|
while (next())
|
|
@@ -4889,12 +4889,12 @@ function commenter(type2, index2) {
|
|
|
4889
4889
|
break;
|
|
4890
4890
|
else if (type2 + character === 42 + 42 && peek$3() === 47)
|
|
4891
4891
|
break;
|
|
4892
|
-
return "/*" + slice$
|
|
4892
|
+
return "/*" + slice$7(index2, position$3 - 1) + "*" + from(type2 === 47 ? type2 : next());
|
|
4893
4893
|
}
|
|
4894
4894
|
function identifier(index2) {
|
|
4895
4895
|
while (!token(peek$3()))
|
|
4896
4896
|
next();
|
|
4897
|
-
return slice$
|
|
4897
|
+
return slice$7(index2, position$3);
|
|
4898
4898
|
}
|
|
4899
4899
|
function compile$1(value2) {
|
|
4900
4900
|
return dealloc(parse$g("", null, null, null, [""], value2 = alloc(value2), 0, [0], value2));
|
|
@@ -5104,7 +5104,7 @@ var identifierWithPointTracking = function identifierWithPointTracking2(begin, p
|
|
|
5104
5104
|
}
|
|
5105
5105
|
next();
|
|
5106
5106
|
}
|
|
5107
|
-
return slice$
|
|
5107
|
+
return slice$7(begin, position$3);
|
|
5108
5108
|
};
|
|
5109
5109
|
var toRules = function toRules2(parsed, points2) {
|
|
5110
5110
|
var index2 = -1;
|
|
@@ -41423,7 +41423,7 @@ function escapeRegExp(value2) {
|
|
|
41423
41423
|
return value2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
41424
41424
|
}
|
|
41425
41425
|
const clamp$7 = (value2, min2, max2) => Math.max(min2, Math.min(max2, value2));
|
|
41426
|
-
function range$
|
|
41426
|
+
function range$e(from2, to) {
|
|
41427
41427
|
return Array.from({
|
|
41428
41428
|
length: to - from2
|
|
41429
41429
|
}).map((_, i2) => from2 + i2);
|
|
@@ -45821,7 +45821,7 @@ const useGridVirtualScroller = () => {
|
|
|
45821
45821
|
const rowModels = params2.rows ?? currentPage.rows;
|
|
45822
45822
|
const firstRowToRender = baseRenderContext.firstRowIndex;
|
|
45823
45823
|
const lastRowToRender = Math.min(baseRenderContext.lastRowIndex, rowModels.length);
|
|
45824
|
-
const rowIndexes = params2.rows ? range$
|
|
45824
|
+
const rowIndexes = params2.rows ? range$e(0, params2.rows.length) : range$e(firstRowToRender, lastRowToRender);
|
|
45825
45825
|
let virtualRowIndex = -1;
|
|
45826
45826
|
if (!isPinnedSection && focusedVirtualCell) {
|
|
45827
45827
|
if (focusedVirtualCell.rowIndex < firstRowToRender) {
|
|
@@ -70595,7 +70595,7 @@ function baseGet$3(object2, path2) {
|
|
|
70595
70595
|
}
|
|
70596
70596
|
return index2 && index2 == length2 ? object2 : void 0;
|
|
70597
70597
|
}
|
|
70598
|
-
function get$
|
|
70598
|
+
function get$e(object2, path2, defaultValue2) {
|
|
70599
70599
|
var result = object2 == null ? void 0 : baseGet$3(object2, path2);
|
|
70600
70600
|
return result === void 0 ? defaultValue2 : result;
|
|
70601
70601
|
}
|
|
@@ -71225,7 +71225,7 @@ function baseMatchesProperty$2(path2, srcValue) {
|
|
|
71225
71225
|
return matchesStrictComparable$3(toKey$5(path2), srcValue);
|
|
71226
71226
|
}
|
|
71227
71227
|
return function(object2) {
|
|
71228
|
-
var objValue = get$
|
|
71228
|
+
var objValue = get$e(object2, path2);
|
|
71229
71229
|
return objValue === void 0 && objValue === srcValue ? hasIn$2(object2, path2) : baseIsEqual$3(srcValue, objValue, COMPARE_PARTIAL_FLAG$6 | COMPARE_UNORDERED_FLAG$4);
|
|
71230
71230
|
};
|
|
71231
71231
|
}
|
|
@@ -71520,7 +71520,7 @@ function createRange(fromRight) {
|
|
|
71520
71520
|
return baseRange(start2, end2, step);
|
|
71521
71521
|
};
|
|
71522
71522
|
}
|
|
71523
|
-
var range$
|
|
71523
|
+
var range$d = createRange();
|
|
71524
71524
|
function sum$8(array2) {
|
|
71525
71525
|
return array2 && array2.length ? baseSum(array2, identity$i) : 0;
|
|
71526
71526
|
}
|
|
@@ -71572,7 +71572,7 @@ var util;
|
|
|
71572
71572
|
function assertIs(_arg) {
|
|
71573
71573
|
}
|
|
71574
71574
|
util2.assertIs = assertIs;
|
|
71575
|
-
function assertNever(
|
|
71575
|
+
function assertNever(_x3) {
|
|
71576
71576
|
throw new Error();
|
|
71577
71577
|
}
|
|
71578
71578
|
util2.assertNever = assertNever;
|
|
@@ -76936,10 +76936,10 @@ function requireLrucache() {
|
|
|
76936
76936
|
lrucache = LRUCache3;
|
|
76937
76937
|
return lrucache;
|
|
76938
76938
|
}
|
|
76939
|
-
var range$
|
|
76939
|
+
var range$c;
|
|
76940
76940
|
var hasRequiredRange$1;
|
|
76941
76941
|
function requireRange$1() {
|
|
76942
|
-
if (hasRequiredRange$1) return range$
|
|
76942
|
+
if (hasRequiredRange$1) return range$c;
|
|
76943
76943
|
hasRequiredRange$1 = 1;
|
|
76944
76944
|
const SPACE_CHARACTERS = /\s+/g;
|
|
76945
76945
|
class Range2 {
|
|
@@ -77080,7 +77080,7 @@ function requireRange$1() {
|
|
|
77080
77080
|
return false;
|
|
77081
77081
|
}
|
|
77082
77082
|
}
|
|
77083
|
-
range$
|
|
77083
|
+
range$c = Range2;
|
|
77084
77084
|
const LRU = requireLrucache();
|
|
77085
77085
|
const cache2 = new LRU();
|
|
77086
77086
|
const parseOptions2 = requireParseOptions();
|
|
@@ -77310,7 +77310,7 @@ function requireRange$1() {
|
|
|
77310
77310
|
}
|
|
77311
77311
|
return true;
|
|
77312
77312
|
};
|
|
77313
|
-
return range$
|
|
77313
|
+
return range$c;
|
|
77314
77314
|
}
|
|
77315
77315
|
var comparator$2;
|
|
77316
77316
|
var hasRequiredComparator$1;
|
|
@@ -82226,10 +82226,10 @@ function requireDraggableCore() {
|
|
|
82226
82226
|
var _arr = [];
|
|
82227
82227
|
var _n2 = true;
|
|
82228
82228
|
var _d3 = false;
|
|
82229
|
-
var
|
|
82229
|
+
var _s2, _e3;
|
|
82230
82230
|
try {
|
|
82231
|
-
for (_i2 = _i2.call(arr); !(_n2 = (
|
|
82232
|
-
_arr.push(
|
|
82231
|
+
for (_i2 = _i2.call(arr); !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
82232
|
+
_arr.push(_s2.value);
|
|
82233
82233
|
if (i2 && _arr.length === i2) break;
|
|
82234
82234
|
}
|
|
82235
82235
|
} catch (err2) {
|
|
@@ -82837,10 +82837,10 @@ function requireDraggable() {
|
|
|
82837
82837
|
var _arr = [];
|
|
82838
82838
|
var _n2 = true;
|
|
82839
82839
|
var _d3 = false;
|
|
82840
|
-
var
|
|
82840
|
+
var _s2, _e3;
|
|
82841
82841
|
try {
|
|
82842
|
-
for (_i2 = _i2.call(arr); !(_n2 = (
|
|
82843
|
-
_arr.push(
|
|
82842
|
+
for (_i2 = _i2.call(arr); !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
82843
|
+
_arr.push(_s2.value);
|
|
82844
82844
|
if (i2 && _arr.length === i2) break;
|
|
82845
82845
|
}
|
|
82846
82846
|
} catch (err2) {
|
|
@@ -84704,10 +84704,10 @@ function requireReactGridLayout() {
|
|
|
84704
84704
|
var _arr = [];
|
|
84705
84705
|
var _n2 = true;
|
|
84706
84706
|
var _d3 = false;
|
|
84707
|
-
var
|
|
84707
|
+
var _s2, _e3;
|
|
84708
84708
|
try {
|
|
84709
|
-
for (_i2 = _i2.call(arr); !(_n2 = (
|
|
84710
|
-
_arr.push(
|
|
84709
|
+
for (_i2 = _i2.call(arr); !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
84710
|
+
_arr.push(_s2.value);
|
|
84711
84711
|
if (i2 && _arr.length === i2) break;
|
|
84712
84712
|
}
|
|
84713
84713
|
} catch (err2) {
|
|
@@ -86186,7 +86186,7 @@ function resolveLayout(layout) {
|
|
|
86186
86186
|
const id2 = "ID";
|
|
86187
86187
|
const columnCount = 12;
|
|
86188
86188
|
cols[id2] = columnCount;
|
|
86189
|
-
layouts[id2] = makeGridLayout(range$
|
|
86189
|
+
layouts[id2] = makeGridLayout(range$d(columnCount + 1), positions);
|
|
86190
86190
|
breakpoints2[id2] = 1e3;
|
|
86191
86191
|
}
|
|
86192
86192
|
return {
|
|
@@ -86800,7 +86800,7 @@ function nest$1(values3, map2, reduce2, keys2) {
|
|
|
86800
86800
|
}(values3, 0);
|
|
86801
86801
|
}
|
|
86802
86802
|
var array$8 = Array.prototype;
|
|
86803
|
-
var slice$
|
|
86803
|
+
var slice$6 = array$8.slice;
|
|
86804
86804
|
function constant$9(x2) {
|
|
86805
86805
|
return function() {
|
|
86806
86806
|
return x2;
|
|
@@ -86905,7 +86905,7 @@ function bin$2() {
|
|
|
86905
86905
|
return arguments.length ? (domain2 = typeof _ === "function" ? _ : constant$9([_[0], _[1]]), histogram) : domain2;
|
|
86906
86906
|
};
|
|
86907
86907
|
histogram.thresholds = function(_) {
|
|
86908
|
-
return arguments.length ? (threshold2 = typeof _ === "function" ? _ : Array.isArray(_) ? constant$9(slice$
|
|
86908
|
+
return arguments.length ? (threshold2 = typeof _ === "function" ? _ : Array.isArray(_) ? constant$9(slice$6.call(_)) : constant$9(_), histogram) : threshold2;
|
|
86909
86909
|
};
|
|
86910
86910
|
return histogram;
|
|
86911
86911
|
}
|
|
@@ -101361,7 +101361,7 @@ function treeToExpectedCheckedLevel(currTree, checkedPaths) {
|
|
|
101361
101361
|
currTree.tree.forEach((lzn) => {
|
|
101362
101362
|
const levelZeroPath = [lzn.name];
|
|
101363
101363
|
const height2 = nodeToHeight(lzn);
|
|
101364
|
-
range$
|
|
101364
|
+
range$d(height2).forEach((i2) => {
|
|
101365
101365
|
const levelIndex = i2 + 1;
|
|
101366
101366
|
const levelNodePaths = nodeToLevelDescendantNamePaths(lzn, levelIndex, [], true);
|
|
101367
101367
|
if (isEqual$3(levelNodePaths, checkedPaths)) {
|
|
@@ -101434,7 +101434,7 @@ function treeToMembershipMap(currTree) {
|
|
|
101434
101434
|
if (currTree) {
|
|
101435
101435
|
currTree.tree.forEach((lzn) => {
|
|
101436
101436
|
const height2 = nodeToHeight(lzn);
|
|
101437
|
-
range$
|
|
101437
|
+
range$d(height2).forEach((i2) => {
|
|
101438
101438
|
const levelIndex = i2 + 1;
|
|
101439
101439
|
const levelNodePaths = nodeToLevelDescendantNamePaths(lzn, levelIndex, [], true);
|
|
101440
101440
|
levelNodePaths.forEach((setNamePath) => {
|
|
@@ -116022,8 +116022,8 @@ var _DataView = DataView$1;
|
|
|
116022
116022
|
var getNative$3 = _getNative, root$3 = _root;
|
|
116023
116023
|
var Promise$2 = getNative$3(root$3, "Promise");
|
|
116024
116024
|
var _Promise = Promise$2;
|
|
116025
|
-
var getNative$2 = _getNative, root$2
|
|
116026
|
-
var Set$1 = getNative$2(root$2
|
|
116025
|
+
var getNative$2 = _getNative, root$2 = _root;
|
|
116026
|
+
var Set$1 = getNative$2(root$2, "Set");
|
|
116027
116027
|
var _Set = Set$1;
|
|
116028
116028
|
var getNative$1 = _getNative, root$1$1 = _root;
|
|
116029
116029
|
var WeakMap$1 = getNative$1(root$1$1, "WeakMap");
|
|
@@ -118333,7 +118333,7 @@ const render$1 = (c1, c2, size2, serverCanvas) => {
|
|
|
118333
118333
|
ctx.fillRect(0, 0, size2, size2);
|
|
118334
118334
|
return canvas.toDataURL();
|
|
118335
118335
|
};
|
|
118336
|
-
const get$
|
|
118336
|
+
const get$d = (c1, c2, size2, serverCanvas) => {
|
|
118337
118337
|
const key2 = `${c1}-${c2}-${size2}${serverCanvas ? "-server" : ""}`;
|
|
118338
118338
|
if (checkboardCache[key2]) {
|
|
118339
118339
|
return checkboardCache[key2];
|
|
@@ -118349,7 +118349,7 @@ const Checkboard = ({ white, grey: grey2, size: size2, renderers, borderRadius:
|
|
|
118349
118349
|
borderRadius: borderRadius22,
|
|
118350
118350
|
boxShadow: boxShadow2,
|
|
118351
118351
|
absolute: "0px 0px 0px 0px",
|
|
118352
|
-
background: `url(${get$
|
|
118352
|
+
background: `url(${get$d(white, grey2, size2, renderers.canvas)}) center left`
|
|
118353
118353
|
}
|
|
118354
118354
|
}
|
|
118355
118355
|
});
|
|
@@ -119073,7 +119073,7 @@ function LevelsButtons(props) {
|
|
|
119073
119073
|
}
|
|
119074
119074
|
}
|
|
119075
119075
|
const { classes: classes2 } = useStyles$s();
|
|
119076
|
-
return jsxRuntimeExports.jsx("div", { className: classes2.levelButtonsContainer, children: range$
|
|
119076
|
+
return jsxRuntimeExports.jsx("div", { className: classes2.levelButtonsContainer, children: range$d(1, height2 + 1).map((i2) => {
|
|
119077
119077
|
const isChecked = isEqual$3(path2, checkedLevelPath) && i2 === checkedLevelIndex;
|
|
119078
119078
|
return jsxRuntimeExports.jsx("div", { children: jsxRuntimeExports.jsx(HelpTooltip, { title: getLevelTooltipText(i2), children: jsxRuntimeExports.jsx("input", { className: clsx(classes2.levelRadioButton, { [classes2.levelRadioButtonChecked]: isChecked && !hasColorEncoding }), type: "checkbox", value: i2, checked: isChecked && hasColorEncoding, onChange: onCheck }) }) }, i2);
|
|
119079
119079
|
}) });
|
|
@@ -120044,7 +120044,7 @@ Dispatch$1.prototype = dispatch$1.prototype = {
|
|
|
120044
120044
|
on: function(typename, callback) {
|
|
120045
120045
|
var _ = this._, T = parseTypenames$2(typename + "", _), t4, i2 = -1, n3 = T.length;
|
|
120046
120046
|
if (arguments.length < 2) {
|
|
120047
|
-
while (++i2 < n3) if ((t4 = (typename = T[i2]).type) && (t4 = get$
|
|
120047
|
+
while (++i2 < n3) if ((t4 = (typename = T[i2]).type) && (t4 = get$c(_[t4], typename.name))) return t4;
|
|
120048
120048
|
return;
|
|
120049
120049
|
}
|
|
120050
120050
|
if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
|
|
@@ -120069,7 +120069,7 @@ Dispatch$1.prototype = dispatch$1.prototype = {
|
|
|
120069
120069
|
for (var t4 = this._[type2], i2 = 0, n3 = t4.length; i2 < n3; ++i2) t4[i2].value.apply(that, args);
|
|
120070
120070
|
}
|
|
120071
120071
|
};
|
|
120072
|
-
function get$
|
|
120072
|
+
function get$c(type2, name2) {
|
|
120073
120073
|
for (var i2 = 0, n3 = type2.length, c2; i2 < n3; ++i2) {
|
|
120074
120074
|
if ((c2 = type2[i2]).name === name2) {
|
|
120075
120075
|
return c2.value;
|
|
@@ -190474,7 +190474,7 @@ function requireJsts_min() {
|
|
|
190474
190474
|
}, dt.Mod2BoundaryNodeRule.get = function() {
|
|
190475
190475
|
return yt;
|
|
190476
190476
|
}, dt.EndPointBoundaryNodeRule.get = function() {
|
|
190477
|
-
return
|
|
190477
|
+
return _t2;
|
|
190478
190478
|
}, dt.MultiValentEndPointBoundaryNodeRule.get = function() {
|
|
190479
190479
|
return mt;
|
|
190480
190480
|
}, dt.MonoValentEndPointBoundaryNodeRule.get = function() {
|
|
@@ -190482,7 +190482,7 @@ function requireJsts_min() {
|
|
|
190482
190482
|
}, dt.MOD2_BOUNDARY_RULE.get = function() {
|
|
190483
190483
|
return new yt();
|
|
190484
190484
|
}, dt.ENDPOINT_BOUNDARY_RULE.get = function() {
|
|
190485
|
-
return new
|
|
190485
|
+
return new _t2();
|
|
190486
190486
|
}, dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get = function() {
|
|
190487
190487
|
return new mt();
|
|
190488
190488
|
}, dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get = function() {
|
|
@@ -190499,14 +190499,14 @@ function requireJsts_min() {
|
|
|
190499
190499
|
}, yt.prototype.getClass = function() {
|
|
190500
190500
|
return yt;
|
|
190501
190501
|
};
|
|
190502
|
-
var
|
|
190502
|
+
var _t2 = function() {
|
|
190503
190503
|
};
|
|
190504
|
-
|
|
190504
|
+
_t2.prototype.isInBoundary = function(t5) {
|
|
190505
190505
|
return t5 > 0;
|
|
190506
|
-
},
|
|
190506
|
+
}, _t2.prototype.interfaces_ = function() {
|
|
190507
190507
|
return [gt2];
|
|
190508
|
-
},
|
|
190509
|
-
return
|
|
190508
|
+
}, _t2.prototype.getClass = function() {
|
|
190509
|
+
return _t2;
|
|
190510
190510
|
};
|
|
190511
190511
|
var mt = function() {
|
|
190512
190512
|
};
|
|
@@ -197505,29 +197505,29 @@ function requireJsts_min() {
|
|
|
197505
197505
|
}, e4.prototype.getClass = function() {
|
|
197506
197506
|
return e4;
|
|
197507
197507
|
}, e4;
|
|
197508
|
-
}(hr),
|
|
197508
|
+
}(hr), _r2 = function() {
|
|
197509
197509
|
this._leaves = new Nt(), this._root = null, this._level = 0;
|
|
197510
197510
|
};
|
|
197511
|
-
|
|
197511
|
+
_r2.prototype.buildTree = function() {
|
|
197512
197512
|
$e.sort(this._leaves, new hr.NodeComparator());
|
|
197513
197513
|
for (var t5 = this._leaves, e4 = null, n4 = new Nt(); ; ) {
|
|
197514
197514
|
if (this.buildLevel(t5, n4), 1 === n4.size()) return n4.get(0);
|
|
197515
197515
|
e4 = t5, t5 = n4, n4 = e4;
|
|
197516
197516
|
}
|
|
197517
|
-
},
|
|
197517
|
+
}, _r2.prototype.insert = function(t5, e4, n4) {
|
|
197518
197518
|
if (null !== this._root) throw new Error("Index cannot be added to once it has been queried");
|
|
197519
197519
|
this._leaves.add(new dr(t5, e4, n4));
|
|
197520
|
-
},
|
|
197520
|
+
}, _r2.prototype.query = function(t5, e4, n4) {
|
|
197521
197521
|
this.init(), this._root.query(t5, e4, n4);
|
|
197522
|
-
},
|
|
197522
|
+
}, _r2.prototype.buildRoot = function() {
|
|
197523
197523
|
if (null !== this._root) return null;
|
|
197524
197524
|
this._root = this.buildTree();
|
|
197525
|
-
},
|
|
197525
|
+
}, _r2.prototype.printNode = function(t5) {
|
|
197526
197526
|
Y3.out.println(Z.toLineString(new C3(t5._min, this._level), new C3(t5._max, this._level)));
|
|
197527
|
-
},
|
|
197527
|
+
}, _r2.prototype.init = function() {
|
|
197528
197528
|
if (null !== this._root) return null;
|
|
197529
197529
|
this.buildRoot();
|
|
197530
|
-
},
|
|
197530
|
+
}, _r2.prototype.buildLevel = function(t5, e4) {
|
|
197531
197531
|
this._level++, e4.clear();
|
|
197532
197532
|
for (var n4 = 0; n4 < t5.size(); n4 += 2) {
|
|
197533
197533
|
var i3 = t5.get(n4);
|
|
@@ -197537,10 +197537,10 @@ function requireJsts_min() {
|
|
|
197537
197537
|
e4.add(r4);
|
|
197538
197538
|
}
|
|
197539
197539
|
}
|
|
197540
|
-
},
|
|
197540
|
+
}, _r2.prototype.interfaces_ = function() {
|
|
197541
197541
|
return [];
|
|
197542
|
-
},
|
|
197543
|
-
return
|
|
197542
|
+
}, _r2.prototype.getClass = function() {
|
|
197543
|
+
return _r2;
|
|
197544
197544
|
};
|
|
197545
197545
|
var mr = function() {
|
|
197546
197546
|
this._items = new Nt();
|
|
@@ -197586,7 +197586,7 @@ function requireJsts_min() {
|
|
|
197586
197586
|
return Er;
|
|
197587
197587
|
};
|
|
197588
197588
|
var xr = function() {
|
|
197589
|
-
this._index = new
|
|
197589
|
+
this._index = new _r2();
|
|
197590
197590
|
var t5 = arguments[0];
|
|
197591
197591
|
this.init(t5);
|
|
197592
197592
|
};
|
|
@@ -198422,7 +198422,7 @@ function cartesianNormalizeInPlace$1(d) {
|
|
|
198422
198422
|
var l2 = sqrt$5(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
|
|
198423
198423
|
d[0] /= l2, d[1] /= l2, d[2] /= l2;
|
|
198424
198424
|
}
|
|
198425
|
-
var lambda0$3, phi0$1, lambda1$1, phi1$1, lambda2$1, lambda00$4, phi00$4, p0$1, deltaSum$1 = adder(), ranges$1, range$
|
|
198425
|
+
var lambda0$3, phi0$1, lambda1$1, phi1$1, lambda2$1, lambda00$4, phi00$4, p0$1, deltaSum$1 = adder(), ranges$1, range$b;
|
|
198426
198426
|
var boundsStream$3 = {
|
|
198427
198427
|
point: boundsPoint$3,
|
|
198428
198428
|
lineStart: boundsLineStart$1,
|
|
@@ -198442,11 +198442,11 @@ var boundsStream$3 = {
|
|
|
198442
198442
|
if (areaRingSum$3 < 0) lambda0$3 = -(lambda1$1 = 180), phi0$1 = -(phi1$1 = 90);
|
|
198443
198443
|
else if (deltaSum$1 > epsilon$8) phi1$1 = 90;
|
|
198444
198444
|
else if (deltaSum$1 < -1e-6) phi0$1 = -90;
|
|
198445
|
-
range$
|
|
198445
|
+
range$b[0] = lambda0$3, range$b[1] = lambda1$1;
|
|
198446
198446
|
}
|
|
198447
198447
|
};
|
|
198448
198448
|
function boundsPoint$3(lambda, phi2) {
|
|
198449
|
-
ranges$1.push(range$
|
|
198449
|
+
ranges$1.push(range$b = [lambda0$3 = lambda, lambda1$1 = lambda]);
|
|
198450
198450
|
if (phi2 < phi0$1) phi0$1 = phi2;
|
|
198451
198451
|
if (phi2 > phi1$1) phi1$1 = phi2;
|
|
198452
198452
|
}
|
|
@@ -198486,7 +198486,7 @@ function linePoint$1(lambda, phi2) {
|
|
|
198486
198486
|
}
|
|
198487
198487
|
}
|
|
198488
198488
|
} else {
|
|
198489
|
-
ranges$1.push(range$
|
|
198489
|
+
ranges$1.push(range$b = [lambda0$3 = lambda, lambda1$1 = lambda]);
|
|
198490
198490
|
}
|
|
198491
198491
|
if (phi2 < phi0$1) phi0$1 = phi2;
|
|
198492
198492
|
if (phi2 > phi1$1) phi1$1 = phi2;
|
|
@@ -198496,7 +198496,7 @@ function boundsLineStart$1() {
|
|
|
198496
198496
|
boundsStream$3.point = linePoint$1;
|
|
198497
198497
|
}
|
|
198498
198498
|
function boundsLineEnd$1() {
|
|
198499
|
-
range$
|
|
198499
|
+
range$b[0] = lambda0$3, range$b[1] = lambda1$1;
|
|
198500
198500
|
boundsStream$3.point = boundsPoint$3;
|
|
198501
198501
|
p0$1 = null;
|
|
198502
198502
|
}
|
|
@@ -198517,7 +198517,7 @@ function boundsRingEnd$1() {
|
|
|
198517
198517
|
boundsRingPoint$1(lambda00$4, phi00$4);
|
|
198518
198518
|
areaStream$3.lineEnd();
|
|
198519
198519
|
if (abs$5(deltaSum$1) > epsilon$8) lambda0$3 = -(lambda1$1 = 180);
|
|
198520
|
-
range$
|
|
198520
|
+
range$b[0] = lambda0$3, range$b[1] = lambda1$1;
|
|
198521
198521
|
p0$1 = null;
|
|
198522
198522
|
}
|
|
198523
198523
|
function angle$1(lambda02, lambda12) {
|
|
@@ -198550,7 +198550,7 @@ function bounds$2(feature2) {
|
|
|
198550
198550
|
if ((delta = angle$1(a2[1], b2[0])) > deltaMax) deltaMax = delta, lambda0$3 = b2[0], lambda1$1 = a2[1];
|
|
198551
198551
|
}
|
|
198552
198552
|
}
|
|
198553
|
-
ranges$1 = range$
|
|
198553
|
+
ranges$1 = range$b = null;
|
|
198554
198554
|
return lambda0$3 === Infinity || phi0$1 === Infinity ? [[NaN, NaN], [NaN, NaN]] : [[lambda0$3, phi0$1], [lambda1$1, phi1$1]];
|
|
198555
198555
|
}
|
|
198556
198556
|
var W0$1, W1$1, X0$3, Y0$3, Z0$3, X1$3, Y1$3, Z1$3, X2$4, Y2$4, Z2$3, lambda00$3, phi00$3, x0$9, y0$9, z0$1;
|
|
@@ -198930,7 +198930,7 @@ function ascendingComparator(f2) {
|
|
|
198930
198930
|
};
|
|
198931
198931
|
}
|
|
198932
198932
|
bisector$3(ascending$7);
|
|
198933
|
-
function range$
|
|
198933
|
+
function range$a(start2, stop3, step) {
|
|
198934
198934
|
start2 = +start2, stop3 = +stop3, step = (n3 = arguments.length) < 2 ? (stop3 = start2, start2 = 0, 1) : n3 < 3 ? 1 : +step;
|
|
198935
198935
|
var i2 = -1, n3 = Math.max(0, Math.ceil((stop3 - start2) / step)) | 0, range2 = new Array(n3);
|
|
198936
198936
|
while (++i2 < n3) {
|
|
@@ -199212,7 +199212,7 @@ function contains$2(object2, point2) {
|
|
|
199212
199212
|
return (object2 && containsObjectType.hasOwnProperty(object2.type) ? containsObjectType[object2.type] : containsGeometry)(object2, point2);
|
|
199213
199213
|
}
|
|
199214
199214
|
function graticuleX$1(y02, y12, dy) {
|
|
199215
|
-
var y2 = range$
|
|
199215
|
+
var y2 = range$a(y02, y12 - epsilon$8, dy).concat(y12);
|
|
199216
199216
|
return function(x2) {
|
|
199217
199217
|
return y2.map(function(y3) {
|
|
199218
199218
|
return [x2, y3];
|
|
@@ -199220,7 +199220,7 @@ function graticuleX$1(y02, y12, dy) {
|
|
|
199220
199220
|
};
|
|
199221
199221
|
}
|
|
199222
199222
|
function graticuleY$1(x02, x12, dx) {
|
|
199223
|
-
var x2 = range$
|
|
199223
|
+
var x2 = range$a(x02, x12 - epsilon$8, dx).concat(x12);
|
|
199224
199224
|
return function(y2) {
|
|
199225
199225
|
return x2.map(function(x3) {
|
|
199226
199226
|
return [x3, y2];
|
|
@@ -199233,9 +199233,9 @@ function graticule$1() {
|
|
|
199233
199233
|
return { type: "MultiLineString", coordinates: lines() };
|
|
199234
199234
|
}
|
|
199235
199235
|
function lines() {
|
|
199236
|
-
return range$
|
|
199236
|
+
return range$a(ceil$3(X02 / DX) * DX, X12, DX).map(X3).concat(range$a(ceil$3(Y02 / DY) * DY, Y12, DY).map(Y3)).concat(range$a(ceil$3(x02 / dx) * dx, x12, dx).filter(function(x3) {
|
|
199237
199237
|
return abs$5(x3 % DX) > epsilon$8;
|
|
199238
|
-
}).map(x2)).concat(range$
|
|
199238
|
+
}).map(x2)).concat(range$a(ceil$3(y02 / dy) * dy, y12, dy).filter(function(y3) {
|
|
199239
199239
|
return abs$5(y3 % DY) > epsilon$8;
|
|
199240
199240
|
}).map(y2));
|
|
199241
199241
|
}
|
|
@@ -202769,8 +202769,8 @@ function requireDeckDrawer() {
|
|
|
202769
202769
|
var _d3 = false;
|
|
202770
202770
|
var _e3 = void 0;
|
|
202771
202771
|
try {
|
|
202772
|
-
for (var _i2 = arr[Symbol.iterator](),
|
|
202773
|
-
_arr.push(
|
|
202772
|
+
for (var _i2 = arr[Symbol.iterator](), _s2; !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
202773
|
+
_arr.push(_s2.value);
|
|
202774
202774
|
if (i2 && _arr.length === i2) break;
|
|
202775
202775
|
}
|
|
202776
202776
|
} catch (err2) {
|
|
@@ -207748,8 +207748,8 @@ function requireUtils$2() {
|
|
|
207748
207748
|
var _d3 = false;
|
|
207749
207749
|
var _e3 = void 0;
|
|
207750
207750
|
try {
|
|
207751
|
-
for (var _i2 = arr[Symbol.iterator](),
|
|
207752
|
-
_arr.push(
|
|
207751
|
+
for (var _i2 = arr[Symbol.iterator](), _s2; !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
207752
|
+
_arr.push(_s2.value);
|
|
207753
207753
|
if (i2 && _arr.length === i2) break;
|
|
207754
207754
|
}
|
|
207755
207755
|
} catch (err2) {
|
|
@@ -211677,8 +211677,8 @@ function requireSplitPolygonMode() {
|
|
|
211677
211677
|
var _d3 = false;
|
|
211678
211678
|
var _e3 = void 0;
|
|
211679
211679
|
try {
|
|
211680
|
-
for (var _i2 = arr[Symbol.iterator](),
|
|
211681
|
-
_arr.push(
|
|
211680
|
+
for (var _i2 = arr[Symbol.iterator](), _s2; !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
211681
|
+
_arr.push(_s2.value);
|
|
211682
211682
|
if (i2 && _arr.length === i2) break;
|
|
211683
211683
|
}
|
|
211684
211684
|
} catch (err2) {
|
|
@@ -211997,8 +211997,8 @@ function requireExtrudeMode() {
|
|
|
211997
211997
|
var _d3 = false;
|
|
211998
211998
|
var _e3 = void 0;
|
|
211999
211999
|
try {
|
|
212000
|
-
for (var _i2 = arr[Symbol.iterator](),
|
|
212001
|
-
_arr.push(
|
|
212000
|
+
for (var _i2 = arr[Symbol.iterator](), _s2; !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
212001
|
+
_arr.push(_s2.value);
|
|
212002
212002
|
if (i2 && _arr.length === i2) break;
|
|
212003
212003
|
}
|
|
212004
212004
|
} catch (err2) {
|
|
@@ -215061,8 +215061,8 @@ function requireDrawRectangleUsingThreePointsMode() {
|
|
|
215061
215061
|
var _d3 = false;
|
|
215062
215062
|
var _e3 = void 0;
|
|
215063
215063
|
try {
|
|
215064
|
-
for (var _i2 = arr[Symbol.iterator](),
|
|
215065
|
-
_arr.push(
|
|
215064
|
+
for (var _i2 = arr[Symbol.iterator](), _s2; !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
215065
|
+
_arr.push(_s2.value);
|
|
215066
215066
|
if (i2 && _arr.length === i2) break;
|
|
215067
215067
|
}
|
|
215068
215068
|
} catch (err2) {
|
|
@@ -215263,8 +215263,8 @@ function requireDraw90degreePolygonMode() {
|
|
|
215263
215263
|
var _d3 = false;
|
|
215264
215264
|
var _e3 = void 0;
|
|
215265
215265
|
try {
|
|
215266
|
-
for (var _i2 = arr[Symbol.iterator](),
|
|
215267
|
-
_arr.push(
|
|
215266
|
+
for (var _i2 = arr[Symbol.iterator](), _s2; !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
215267
|
+
_arr.push(_s2.value);
|
|
215268
215268
|
if (i2 && _arr.length === i2) break;
|
|
215269
215269
|
}
|
|
215270
215270
|
} catch (err2) {
|
|
@@ -219005,8 +219005,8 @@ function requireSelectionLayer() {
|
|
|
219005
219005
|
var _d3 = false;
|
|
219006
219006
|
var _e3 = void 0;
|
|
219007
219007
|
try {
|
|
219008
|
-
for (var _i2 = arr[Symbol.iterator](),
|
|
219009
|
-
_arr.push(
|
|
219008
|
+
for (var _i2 = arr[Symbol.iterator](), _s2; !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
219009
|
+
_arr.push(_s2.value);
|
|
219010
219010
|
if (i2 && _arr.length === i2) break;
|
|
219011
219011
|
}
|
|
219012
219012
|
} catch (err2) {
|
|
@@ -220813,8 +220813,8 @@ function requirePathMarkerLayer() {
|
|
|
220813
220813
|
var _d3 = false;
|
|
220814
220814
|
var _e3 = void 0;
|
|
220815
220815
|
try {
|
|
220816
|
-
for (var _i2 = arr[Symbol.iterator](),
|
|
220817
|
-
_arr.push(
|
|
220816
|
+
for (var _i2 = arr[Symbol.iterator](), _s2; !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
220817
|
+
_arr.push(_s2.value);
|
|
220818
220818
|
if (i2 && _arr.length === i2) break;
|
|
220819
220819
|
}
|
|
220820
220820
|
} catch (err2) {
|
|
@@ -220977,8 +220977,8 @@ function requirePathMarkerLayer() {
|
|
|
220977
220977
|
return viewport2.projectFlat([x2 + dx, dy + y2]);
|
|
220978
220978
|
} else if (coordinateSystem === _core2.COORDINATE_SYSTEM.LNGLAT_OFFSETS) {
|
|
220979
220979
|
var _xyz = _slicedToArray2(xyz, 2), _dx = _xyz[0], _dy = _xyz[1];
|
|
220980
|
-
var _coordinateOrigin2 = _slicedToArray2(coordinateOrigin, 2),
|
|
220981
|
-
return viewport2.projectFlat([
|
|
220980
|
+
var _coordinateOrigin2 = _slicedToArray2(coordinateOrigin, 2), _x3 = _coordinateOrigin2[0], _y3 = _coordinateOrigin2[1];
|
|
220981
|
+
return viewport2.projectFlat([_x3 + _dx, _dy + _y3]);
|
|
220982
220982
|
}
|
|
220983
220983
|
return viewport2.projectFlat(xyz);
|
|
220984
220984
|
}
|
|
@@ -221303,8 +221303,8 @@ function requireUtils$1() {
|
|
|
221303
221303
|
var _d3 = false;
|
|
221304
221304
|
var _e3 = void 0;
|
|
221305
221305
|
try {
|
|
221306
|
-
for (var _i2 = arr[Symbol.iterator](),
|
|
221307
|
-
_arr.push(
|
|
221306
|
+
for (var _i2 = arr[Symbol.iterator](), _s2; !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
|
|
221307
|
+
_arr.push(_s2.value);
|
|
221308
221308
|
if (i2 && _arr.length === i2) break;
|
|
221309
221309
|
}
|
|
221310
221310
|
} catch (err2) {
|
|
@@ -224928,37 +224928,37 @@ function fromCIELab(cieLabRaster) {
|
|
|
224928
224928
|
}
|
|
224929
224929
|
return rgbRaster;
|
|
224930
224930
|
}
|
|
224931
|
-
const registry$
|
|
224931
|
+
const registry$2 = /* @__PURE__ */ new Map();
|
|
224932
224932
|
function addDecoder(cases2, importFn) {
|
|
224933
224933
|
if (!Array.isArray(cases2)) {
|
|
224934
224934
|
cases2 = [cases2];
|
|
224935
224935
|
}
|
|
224936
|
-
cases2.forEach((c2) => registry$
|
|
224936
|
+
cases2.forEach((c2) => registry$2.set(c2, importFn));
|
|
224937
224937
|
}
|
|
224938
224938
|
async function getDecoder(fileDirectory) {
|
|
224939
|
-
const importFn = registry$
|
|
224939
|
+
const importFn = registry$2.get(fileDirectory.Compression);
|
|
224940
224940
|
if (!importFn) {
|
|
224941
224941
|
throw new Error(`Unknown compression method identifier: ${fileDirectory.Compression}`);
|
|
224942
224942
|
}
|
|
224943
224943
|
const Decoder = await importFn();
|
|
224944
224944
|
return new Decoder(fileDirectory);
|
|
224945
224945
|
}
|
|
224946
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
224947
|
-
addDecoder(5, () => import("./lzw-
|
|
224946
|
+
addDecoder([void 0, 1], () => import("./raw-BYhalBdp.js").then((m2) => m2.default));
|
|
224947
|
+
addDecoder(5, () => import("./lzw-DokUd_oP.js").then((m2) => m2.default));
|
|
224948
224948
|
addDecoder(6, () => {
|
|
224949
224949
|
throw new Error("old style JPEG compression is not supported.");
|
|
224950
224950
|
});
|
|
224951
|
-
addDecoder(7, () => import("./jpeg-
|
|
224952
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
224953
|
-
addDecoder(32773, () => import("./packbits-
|
|
224951
|
+
addDecoder(7, () => import("./jpeg-D40_cEtP.js").then((m2) => m2.default));
|
|
224952
|
+
addDecoder([8, 32946], () => import("./deflate-DSg-Fr9r.js").then((m2) => m2.default));
|
|
224953
|
+
addDecoder(32773, () => import("./packbits-BFRLW0tW.js").then((m2) => m2.default));
|
|
224954
224954
|
addDecoder(
|
|
224955
224955
|
34887,
|
|
224956
|
-
() => import("./lerc-
|
|
224956
|
+
() => import("./lerc-DUsVxZoD.js").then(async (m2) => {
|
|
224957
224957
|
await m2.zstd.init();
|
|
224958
224958
|
return m2;
|
|
224959
224959
|
}).then((m2) => m2.default)
|
|
224960
224960
|
);
|
|
224961
|
-
addDecoder(50001, () => import("./webimage-
|
|
224961
|
+
addDecoder(50001, () => import("./webimage-D2SmoHLs.js").then((m2) => m2.default));
|
|
224962
224962
|
function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
|
|
224963
224963
|
return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
|
|
224964
224964
|
}
|
|
@@ -227764,9 +227764,9 @@ async function N(A5, I2) {
|
|
|
227764
227764
|
if (0 === g2.length) throw Error("Failed to decode with LZW decoder.");
|
|
227765
227765
|
return g2;
|
|
227766
227766
|
}
|
|
227767
|
-
const registry$
|
|
227767
|
+
const registry$1 = /* @__PURE__ */ new Map();
|
|
227768
227768
|
function addCodec(id2, importFn) {
|
|
227769
|
-
registry$
|
|
227769
|
+
registry$1.set(id2, importFn);
|
|
227770
227770
|
}
|
|
227771
227771
|
typeof process !== "undefined" && process.versions && process.versions.node;
|
|
227772
227772
|
function createCommonjsModule(fn2) {
|
|
@@ -233757,7 +233757,7 @@ const DTYPE_LOOKUP = {
|
|
|
233757
233757
|
i2: "Int16",
|
|
233758
233758
|
i4: "Int32"
|
|
233759
233759
|
};
|
|
233760
|
-
function slice$
|
|
233760
|
+
function slice$5(start2, stop3) {
|
|
233761
233761
|
return { start: start2, stop: stop3, step: 1, _slice: true };
|
|
233762
233762
|
}
|
|
233763
233763
|
class BoundsCheckError extends Error {
|
|
@@ -233809,7 +233809,7 @@ class ZarrPixelSource {
|
|
|
233809
233809
|
} else if (xStart < 0 || yStart < 0 || xStop > width2 || yStop > height2) {
|
|
233810
233810
|
throw new BoundsCheckError("Tile slice is out of bounds.");
|
|
233811
233811
|
}
|
|
233812
|
-
return [slice$
|
|
233812
|
+
return [slice$5(xStart, xStop), slice$5(yStart, yStop)];
|
|
233813
233813
|
}
|
|
233814
233814
|
async _getRaw(selection, getOptions) {
|
|
233815
233815
|
const result = await this._data.getRaw(selection, getOptions);
|
|
@@ -235914,7 +235914,7 @@ const channels = {
|
|
|
235914
235914
|
},
|
|
235915
235915
|
fs: fs$2
|
|
235916
235916
|
};
|
|
235917
|
-
function range$
|
|
235917
|
+
function range$9(len2) {
|
|
235918
235918
|
return [...Array(len2).keys()];
|
|
235919
235919
|
}
|
|
235920
235920
|
function padWithDefault$2(arr, defaultValue2, padWidth) {
|
|
@@ -237014,7 +237014,7 @@ const ScaleBarLayer = class extends CompositeLayer {
|
|
|
237014
237014
|
sizeScale: 2 ** -zoom2,
|
|
237015
237015
|
characterSet: [
|
|
237016
237016
|
...displayUnit.split(""),
|
|
237017
|
-
...range$
|
|
237017
|
+
...range$9(10).map((i2) => String(i2)),
|
|
237018
237018
|
".",
|
|
237019
237019
|
"e",
|
|
237020
237020
|
"+"
|
|
@@ -238436,7 +238436,7 @@ class BitmaskLayer2 extends XRLayer {
|
|
|
238436
238436
|
} = this.state;
|
|
238437
238437
|
if (textures && model) {
|
|
238438
238438
|
const scaleFactor = 1 / 2 ** (maxZoom - zoom2);
|
|
238439
|
-
const colors2 = Object.fromEntries(range$
|
|
238439
|
+
const colors2 = Object.fromEntries(range$d(MAX_CHANNELS).map((i2) => [`color${i2}`, getColor(channelColors[i2])]));
|
|
238440
238440
|
model.setUniforms(Object.assign({}, uniforms, {
|
|
238441
238441
|
...colors2,
|
|
238442
238442
|
// Bitmask image channel data textures
|
|
@@ -241623,7 +241623,7 @@ class ContourLayerWithText extends ContourLayer {
|
|
|
241623
241623
|
let minCirclePointI;
|
|
241624
241624
|
let minPolygonPoint;
|
|
241625
241625
|
const numVertices = maxAreaPolygon.geometry.coordinates[0].length;
|
|
241626
|
-
const polygonVertices = numVertices > MAX_NUM_VERTICES ? range$
|
|
241626
|
+
const polygonVertices = numVertices > MAX_NUM_VERTICES ? range$d(MAX_NUM_VERTICES).map((i2) => maxAreaPolygon.geometry.coordinates[0][Math.floor(i2 * numVertices / MAX_NUM_VERTICES)]) : [...maxAreaPolygon.geometry.coordinates[0]];
|
|
241627
241627
|
circlePolygon.geometry.coordinates[0].forEach((circleCoord, circlePointI) => {
|
|
241628
241628
|
const circlePoint = point$9(circleCoord);
|
|
241629
241629
|
polygonVertices.forEach((polyCoord) => {
|
|
@@ -242021,7 +242021,7 @@ function createQuadTree(obsEmbedding, getCellCoords) {
|
|
|
242021
242021
|
if (!obsEmbedding) {
|
|
242022
242022
|
return null;
|
|
242023
242023
|
}
|
|
242024
|
-
const tree2 = quadtree$1().x((i2) => getCellCoords(i2)[0]).y((i2) => getCellCoords(i2)[1]).addAll(range$
|
|
242024
|
+
const tree2 = quadtree$1().x((i2) => getCellCoords(i2)[0]).y((i2) => getCellCoords(i2)[1]).addAll(range$d(obsEmbedding.shape[1]));
|
|
242025
242025
|
return tree2;
|
|
242026
242026
|
}
|
|
242027
242027
|
function constant$6(v) {
|
|
@@ -243463,7 +243463,7 @@ function* selection_iterator() {
|
|
|
243463
243463
|
}
|
|
243464
243464
|
}
|
|
243465
243465
|
}
|
|
243466
|
-
var root$
|
|
243466
|
+
var root$1 = [null];
|
|
243467
243467
|
function Selection(groups, parents) {
|
|
243468
243468
|
this._groups = groups;
|
|
243469
243469
|
this._parents = parents;
|
|
@@ -243510,7 +243510,7 @@ Selection.prototype = {
|
|
|
243510
243510
|
[Symbol.iterator]: selection_iterator
|
|
243511
243511
|
};
|
|
243512
243512
|
function select$1(selector2) {
|
|
243513
|
-
return typeof selector2 === "string" ? new Selection([[document.querySelector(selector2)]], [document.documentElement]) : new Selection([[selector2]], root$
|
|
243513
|
+
return typeof selector2 === "string" ? new Selection([[document.querySelector(selector2)]], [document.documentElement]) : new Selection([[selector2]], root$1);
|
|
243514
243514
|
}
|
|
243515
243515
|
function ascending$5(a2, b2) {
|
|
243516
243516
|
return a2 == null || b2 == null ? NaN : a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
|
|
@@ -243816,7 +243816,7 @@ function* flatten$2(arrays) {
|
|
|
243816
243816
|
function merge$3(arrays) {
|
|
243817
243817
|
return Array.from(flatten$2(arrays));
|
|
243818
243818
|
}
|
|
243819
|
-
function range$
|
|
243819
|
+
function range$8(start2, stop3, step) {
|
|
243820
243820
|
start2 = +start2, stop3 = +stop3, step = (n3 = arguments.length) < 2 ? (stop3 = start2, start2 = 0, 1) : n3 < 3 ? 1 : +step;
|
|
243821
243821
|
var i2 = -1, n3 = Math.max(0, Math.ceil((stop3 - start2) / step)) | 0, range2 = new Array(n3);
|
|
243822
243822
|
while (++i2 < n3) {
|
|
@@ -249150,8 +249150,8 @@ DimensionError.prototype = new RangeError();
|
|
|
249150
249150
|
DimensionError.prototype.constructor = RangeError;
|
|
249151
249151
|
DimensionError.prototype.name = "DimensionError";
|
|
249152
249152
|
DimensionError.prototype.isDimensionError = true;
|
|
249153
|
-
function IndexError$
|
|
249154
|
-
if (!(this instanceof IndexError$
|
|
249153
|
+
function IndexError$1(index2, min2, max2) {
|
|
249154
|
+
if (!(this instanceof IndexError$1)) {
|
|
249155
249155
|
throw new SyntaxError("Constructor must be called with the new operator");
|
|
249156
249156
|
}
|
|
249157
249157
|
this.index = index2;
|
|
@@ -249171,10 +249171,10 @@ function IndexError$2(index2, min2, max2) {
|
|
|
249171
249171
|
}
|
|
249172
249172
|
this.stack = new Error().stack;
|
|
249173
249173
|
}
|
|
249174
|
-
IndexError$
|
|
249175
|
-
IndexError$
|
|
249176
|
-
IndexError$
|
|
249177
|
-
IndexError$
|
|
249174
|
+
IndexError$1.prototype = new RangeError();
|
|
249175
|
+
IndexError$1.prototype.constructor = RangeError;
|
|
249176
|
+
IndexError$1.prototype.name = "IndexError";
|
|
249177
|
+
IndexError$1.prototype.isIndexError = true;
|
|
249178
249178
|
function arraySize(x2) {
|
|
249179
249179
|
var s2 = [];
|
|
249180
249180
|
while (Array.isArray(x2)) {
|
|
@@ -249221,7 +249221,7 @@ function validateIndex(index2, length2) {
|
|
|
249221
249221
|
throw new TypeError("Index must be an integer (value: " + index2 + ")");
|
|
249222
249222
|
}
|
|
249223
249223
|
if (index2 < 0 || typeof length2 === "number" && index2 >= length2) {
|
|
249224
|
-
throw new IndexError$
|
|
249224
|
+
throw new IndexError$1(index2, length2);
|
|
249225
249225
|
}
|
|
249226
249226
|
}
|
|
249227
249227
|
function resize$1(array2, size2, defaultValue2) {
|
|
@@ -249283,7 +249283,7 @@ function reshape(array2, sizes) {
|
|
|
249283
249283
|
throw new DimensionError(0, currentLength, "!=");
|
|
249284
249284
|
}
|
|
249285
249285
|
sizes = processSizesWildcard(sizes, currentLength);
|
|
249286
|
-
var newLength = product$
|
|
249286
|
+
var newLength = product$2(sizes);
|
|
249287
249287
|
if (currentLength !== newLength) {
|
|
249288
249288
|
throw new DimensionError(newLength, currentLength, "!=");
|
|
249289
249289
|
}
|
|
@@ -249297,7 +249297,7 @@ function reshape(array2, sizes) {
|
|
|
249297
249297
|
}
|
|
249298
249298
|
}
|
|
249299
249299
|
function processSizesWildcard(sizes, currentLength) {
|
|
249300
|
-
var newLength = product$
|
|
249300
|
+
var newLength = product$2(sizes);
|
|
249301
249301
|
var processedSizes = sizes.slice();
|
|
249302
249302
|
var WILDCARD = -1;
|
|
249303
249303
|
var wildCardIndex = sizes.indexOf(WILDCARD);
|
|
@@ -249316,7 +249316,7 @@ function processSizesWildcard(sizes, currentLength) {
|
|
|
249316
249316
|
}
|
|
249317
249317
|
return processedSizes;
|
|
249318
249318
|
}
|
|
249319
|
-
function product$
|
|
249319
|
+
function product$2(array2) {
|
|
249320
249320
|
return array2.reduce((prev2, curr) => prev2 * curr, 1);
|
|
249321
249321
|
}
|
|
249322
249322
|
function _reshape(array2, sizes) {
|
|
@@ -262861,19 +262861,19 @@ function normalizeCoordinateTransformations(coordinateTransformations, datasets)
|
|
|
262861
262861
|
}
|
|
262862
262862
|
return result;
|
|
262863
262863
|
}
|
|
262864
|
-
|
|
262864
|
+
class NodeNotFoundError extends Error {
|
|
262865
262865
|
constructor(context2, options = {}) {
|
|
262866
262866
|
super(`Node not found: ${context2}`, options);
|
|
262867
262867
|
this.name = "NodeNotFoundError";
|
|
262868
262868
|
}
|
|
262869
|
-
}
|
|
262870
|
-
|
|
262869
|
+
}
|
|
262870
|
+
class KeyError extends Error {
|
|
262871
262871
|
constructor(path2) {
|
|
262872
262872
|
super(`Missing key: ${path2}`);
|
|
262873
262873
|
this.name = "KeyError";
|
|
262874
262874
|
}
|
|
262875
|
-
}
|
|
262876
|
-
|
|
262875
|
+
}
|
|
262876
|
+
class BoolArray {
|
|
262877
262877
|
constructor(x2, byteOffset, length2) {
|
|
262878
262878
|
__privateAdd(this, _bytes);
|
|
262879
262879
|
if (typeof x2 === "number") {
|
|
@@ -262914,8 +262914,9 @@ let BoolArray$1 = (_m = class {
|
|
|
262914
262914
|
yield this.get(i2);
|
|
262915
262915
|
}
|
|
262916
262916
|
}
|
|
262917
|
-
}
|
|
262918
|
-
|
|
262917
|
+
}
|
|
262918
|
+
_bytes = new WeakMap();
|
|
262919
|
+
class ByteStringArray {
|
|
262919
262920
|
constructor(chars, x2, byteOffset, length2) {
|
|
262920
262921
|
__publicField(this, "_data");
|
|
262921
262922
|
__publicField(this, "chars");
|
|
@@ -262971,8 +262972,9 @@ let ByteStringArray$1 = (_n = class {
|
|
|
262971
262972
|
yield this.get(i2);
|
|
262972
262973
|
}
|
|
262973
262974
|
}
|
|
262974
|
-
}
|
|
262975
|
-
|
|
262975
|
+
}
|
|
262976
|
+
_encoder = new WeakMap();
|
|
262977
|
+
const _UnicodeStringArray = class _UnicodeStringArray {
|
|
262976
262978
|
constructor(chars, x2, byteOffset, length2) {
|
|
262977
262979
|
__privateAdd(this, _data);
|
|
262978
262980
|
__publicField(this, "chars");
|
|
@@ -262985,7 +262987,7 @@ let UnicodeStringArray$1 = (_o = class {
|
|
|
262985
262987
|
__privateSet(this, _data, new Int32Array(x2, byteOffset, length2));
|
|
262986
262988
|
} else {
|
|
262987
262989
|
const values3 = x2;
|
|
262988
|
-
const d = new
|
|
262990
|
+
const d = new _UnicodeStringArray(chars, 1);
|
|
262989
262991
|
__privateSet(this, _data, new Int32Array(function* () {
|
|
262990
262992
|
for (let str of values3) {
|
|
262991
262993
|
d.set(0, str);
|
|
@@ -263037,12 +263039,14 @@ let UnicodeStringArray$1 = (_o = class {
|
|
|
263037
263039
|
yield this.get(i2);
|
|
263038
263040
|
}
|
|
263039
263041
|
}
|
|
263040
|
-
}
|
|
263041
|
-
|
|
263042
|
+
};
|
|
263043
|
+
_data = new WeakMap();
|
|
263044
|
+
let UnicodeStringArray = _UnicodeStringArray;
|
|
263045
|
+
function json_decode_object(bytes) {
|
|
263042
263046
|
const str = new TextDecoder().decode(bytes);
|
|
263043
263047
|
return JSON.parse(str);
|
|
263044
263048
|
}
|
|
263045
|
-
function byteswap_inplace
|
|
263049
|
+
function byteswap_inplace(view, bytes_per_element2) {
|
|
263046
263050
|
const numFlips = bytes_per_element2 / 2;
|
|
263047
263051
|
const endByteIndex = bytes_per_element2 - 1;
|
|
263048
263052
|
let t4 = 0;
|
|
@@ -263054,14 +263058,14 @@ function byteswap_inplace$1(view, bytes_per_element2) {
|
|
|
263054
263058
|
}
|
|
263055
263059
|
}
|
|
263056
263060
|
}
|
|
263057
|
-
function get_ctr
|
|
263061
|
+
function get_ctr(data_type) {
|
|
263058
263062
|
if (data_type === "v2:object") {
|
|
263059
263063
|
return globalThis.Array;
|
|
263060
263064
|
}
|
|
263061
263065
|
let match2 = data_type.match(/v2:([US])(\d+)/);
|
|
263062
263066
|
if (match2) {
|
|
263063
263067
|
let [, kind, chars] = match2;
|
|
263064
|
-
return (kind === "U" ? UnicodeStringArray
|
|
263068
|
+
return (kind === "U" ? UnicodeStringArray : ByteStringArray).bind(null, Number(chars));
|
|
263065
263069
|
}
|
|
263066
263070
|
let ctr = {
|
|
263067
263071
|
int8: Int8Array,
|
|
@@ -263075,12 +263079,12 @@ function get_ctr$1(data_type) {
|
|
|
263075
263079
|
float16: globalThis.Float16Array,
|
|
263076
263080
|
float32: Float32Array,
|
|
263077
263081
|
float64: Float64Array,
|
|
263078
|
-
bool: BoolArray
|
|
263082
|
+
bool: BoolArray
|
|
263079
263083
|
}[data_type];
|
|
263080
263084
|
assert$4(ctr, `Unknown or unsupported data_type: ${data_type}`);
|
|
263081
263085
|
return ctr;
|
|
263082
263086
|
}
|
|
263083
|
-
function get_strides
|
|
263087
|
+
function get_strides(shape2, order2) {
|
|
263084
263088
|
const rank2 = shape2.length;
|
|
263085
263089
|
if (typeof order2 === "string") {
|
|
263086
263090
|
order2 = order2 === "C" ? Array.from({ length: rank2 }, (_, i2) => i2) : Array.from({ length: rank2 }, (_, i2) => rank2 - 1 - i2);
|
|
@@ -263094,7 +263098,7 @@ function get_strides$1(shape2, order2) {
|
|
|
263094
263098
|
}
|
|
263095
263099
|
return stride;
|
|
263096
263100
|
}
|
|
263097
|
-
function create_chunk_key_encoder
|
|
263101
|
+
function create_chunk_key_encoder({ name: name2, configuration: configuration2 }) {
|
|
263098
263102
|
if (name2 === "default") {
|
|
263099
263103
|
const separator = configuration2?.separator ?? "/";
|
|
263100
263104
|
return (chunk_coords) => ["c", ...chunk_coords].join(separator);
|
|
@@ -263105,7 +263109,7 @@ function create_chunk_key_encoder$1({ name: name2, configuration: configuration2
|
|
|
263105
263109
|
}
|
|
263106
263110
|
throw new Error(`Unknown chunk key encoding: ${name2}`);
|
|
263107
263111
|
}
|
|
263108
|
-
function coerce_dtype
|
|
263112
|
+
function coerce_dtype(dtype) {
|
|
263109
263113
|
if (dtype === "|O") {
|
|
263110
263114
|
return { data_type: "v2:object" };
|
|
263111
263115
|
}
|
|
@@ -263132,9 +263136,9 @@ function coerce_dtype$1(dtype) {
|
|
|
263132
263136
|
}
|
|
263133
263137
|
return { data_type, endian: endian === "<" ? "little" : "big" };
|
|
263134
263138
|
}
|
|
263135
|
-
function v2_to_v3_array_metadata
|
|
263139
|
+
function v2_to_v3_array_metadata(meta, attributes = {}) {
|
|
263136
263140
|
let codecs = [];
|
|
263137
|
-
let dtype = coerce_dtype
|
|
263141
|
+
let dtype = coerce_dtype(meta.dtype);
|
|
263138
263142
|
if (meta.order === "F") {
|
|
263139
263143
|
codecs.push({ name: "transpose", configuration: { order: "F" } });
|
|
263140
263144
|
}
|
|
@@ -263170,14 +263174,14 @@ function v2_to_v3_array_metadata$1(meta, attributes = {}) {
|
|
|
263170
263174
|
attributes
|
|
263171
263175
|
};
|
|
263172
263176
|
}
|
|
263173
|
-
function v2_to_v3_group_metadata
|
|
263177
|
+
function v2_to_v3_group_metadata(_meta2, attributes = {}) {
|
|
263174
263178
|
return {
|
|
263175
263179
|
zarr_format: 3,
|
|
263176
263180
|
node_type: "group",
|
|
263177
263181
|
attributes
|
|
263178
263182
|
};
|
|
263179
263183
|
}
|
|
263180
|
-
function is_dtype
|
|
263184
|
+
function is_dtype(dtype, query) {
|
|
263181
263185
|
if (query !== "number" && query !== "bigint" && query !== "boolean" && query !== "object" && query !== "string") {
|
|
263182
263186
|
return dtype === query;
|
|
263183
263187
|
}
|
|
@@ -263195,10 +263199,10 @@ function is_dtype$1(dtype, query) {
|
|
|
263195
263199
|
return is_object;
|
|
263196
263200
|
return !is_string && !is_bigint && !is_boolean && !is_object;
|
|
263197
263201
|
}
|
|
263198
|
-
function is_sharding_codec
|
|
263202
|
+
function is_sharding_codec(codec) {
|
|
263199
263203
|
return codec?.name === "sharding_indexed";
|
|
263200
263204
|
}
|
|
263201
|
-
function ensure_correct_scalar
|
|
263205
|
+
function ensure_correct_scalar(metadata2) {
|
|
263202
263206
|
if ((metadata2.data_type === "uint64" || metadata2.data_type === "int64") && metadata2.fill_value != null) {
|
|
263203
263207
|
return BigInt(metadata2.fill_value);
|
|
263204
263208
|
}
|
|
@@ -263250,19 +263254,19 @@ class BitroundCodec {
|
|
|
263250
263254
|
return arr;
|
|
263251
263255
|
}
|
|
263252
263256
|
}
|
|
263253
|
-
const LITTLE_ENDIAN_OS
|
|
263254
|
-
function system_is_little_endian
|
|
263257
|
+
const LITTLE_ENDIAN_OS = system_is_little_endian();
|
|
263258
|
+
function system_is_little_endian() {
|
|
263255
263259
|
const a2 = new Uint32Array([305419896]);
|
|
263256
263260
|
const b2 = new Uint8Array(a2.buffer, a2.byteOffset, a2.byteLength);
|
|
263257
263261
|
return !(b2[0] === 18);
|
|
263258
263262
|
}
|
|
263259
|
-
function bytes_per_element
|
|
263263
|
+
function bytes_per_element(TypedArray2) {
|
|
263260
263264
|
if ("BYTES_PER_ELEMENT" in TypedArray2) {
|
|
263261
263265
|
return TypedArray2.BYTES_PER_ELEMENT;
|
|
263262
263266
|
}
|
|
263263
263267
|
return 4;
|
|
263264
263268
|
}
|
|
263265
|
-
|
|
263269
|
+
const _BytesCodec = class _BytesCodec {
|
|
263266
263270
|
constructor(configuration2, meta) {
|
|
263267
263271
|
__publicField(this, "kind", "array_to_bytes");
|
|
263268
263272
|
__privateAdd(this, _stride);
|
|
@@ -263271,25 +263275,25 @@ let BytesCodec$1 = (_p = class {
|
|
|
263271
263275
|
__privateAdd(this, _shape);
|
|
263272
263276
|
__privateAdd(this, _endian);
|
|
263273
263277
|
__privateSet(this, _endian, configuration2?.endian);
|
|
263274
|
-
__privateSet(this, _TypedArray, get_ctr
|
|
263278
|
+
__privateSet(this, _TypedArray, get_ctr(meta.data_type));
|
|
263275
263279
|
__privateSet(this, _shape, meta.shape);
|
|
263276
|
-
__privateSet(this, _stride, get_strides
|
|
263280
|
+
__privateSet(this, _stride, get_strides(meta.shape, "C"));
|
|
263277
263281
|
const sample = new (__privateGet(this, _TypedArray))(0);
|
|
263278
263282
|
__privateSet(this, _BYTES_PER_ELEMENT, sample.BYTES_PER_ELEMENT);
|
|
263279
263283
|
}
|
|
263280
263284
|
static fromConfig(configuration2, meta) {
|
|
263281
|
-
return new
|
|
263285
|
+
return new _BytesCodec(configuration2, meta);
|
|
263282
263286
|
}
|
|
263283
263287
|
encode(arr) {
|
|
263284
263288
|
let bytes = new Uint8Array(arr.data.buffer);
|
|
263285
|
-
if (LITTLE_ENDIAN_OS
|
|
263286
|
-
byteswap_inplace
|
|
263289
|
+
if (LITTLE_ENDIAN_OS && __privateGet(this, _endian) === "big") {
|
|
263290
|
+
byteswap_inplace(bytes, bytes_per_element(__privateGet(this, _TypedArray)));
|
|
263287
263291
|
}
|
|
263288
263292
|
return bytes;
|
|
263289
263293
|
}
|
|
263290
263294
|
decode(bytes) {
|
|
263291
|
-
if (LITTLE_ENDIAN_OS
|
|
263292
|
-
byteswap_inplace
|
|
263295
|
+
if (LITTLE_ENDIAN_OS && __privateGet(this, _endian) === "big") {
|
|
263296
|
+
byteswap_inplace(bytes, bytes_per_element(__privateGet(this, _TypedArray)));
|
|
263293
263297
|
}
|
|
263294
263298
|
return {
|
|
263295
263299
|
data: new (__privateGet(this, _TypedArray))(bytes.buffer, bytes.byteOffset, bytes.byteLength / __privateGet(this, _BYTES_PER_ELEMENT)),
|
|
@@ -263297,8 +263301,14 @@ let BytesCodec$1 = (_p = class {
|
|
|
263297
263301
|
stride: __privateGet(this, _stride)
|
|
263298
263302
|
};
|
|
263299
263303
|
}
|
|
263300
|
-
}
|
|
263301
|
-
|
|
263304
|
+
};
|
|
263305
|
+
_stride = new WeakMap();
|
|
263306
|
+
_TypedArray = new WeakMap();
|
|
263307
|
+
_BYTES_PER_ELEMENT = new WeakMap();
|
|
263308
|
+
_shape = new WeakMap();
|
|
263309
|
+
_endian = new WeakMap();
|
|
263310
|
+
let BytesCodec = _BytesCodec;
|
|
263311
|
+
class Crc32cCodec {
|
|
263302
263312
|
constructor() {
|
|
263303
263313
|
__publicField(this, "kind", "bytes_to_bytes");
|
|
263304
263314
|
}
|
|
@@ -263311,7 +263321,7 @@ let Crc32cCodec$1 = class Crc32cCodec {
|
|
|
263311
263321
|
decode(arr) {
|
|
263312
263322
|
return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength - 4);
|
|
263313
263323
|
}
|
|
263314
|
-
}
|
|
263324
|
+
}
|
|
263315
263325
|
class GzipCodec {
|
|
263316
263326
|
constructor() {
|
|
263317
263327
|
__publicField(this, "kind", "bytes_to_bytes");
|
|
@@ -263319,7 +263329,7 @@ class GzipCodec {
|
|
|
263319
263329
|
static fromConfig(_) {
|
|
263320
263330
|
return new GzipCodec();
|
|
263321
263331
|
}
|
|
263322
|
-
encode(
|
|
263332
|
+
encode(_bytes2) {
|
|
263323
263333
|
throw new Error("Gzip encoding is not enabled by default. Please register a custom codec with `numcodecs/gzip`.");
|
|
263324
263334
|
}
|
|
263325
263335
|
async decode(bytes) {
|
|
@@ -263327,19 +263337,19 @@ class GzipCodec {
|
|
|
263327
263337
|
return new Uint8Array(buffer2);
|
|
263328
263338
|
}
|
|
263329
263339
|
}
|
|
263330
|
-
function throw_on_nan_replacer
|
|
263340
|
+
function throw_on_nan_replacer(_key, value2) {
|
|
263331
263341
|
assert$4(!Number.isNaN(value2), "JsonCodec allow_nan is false but NaN was encountered during encoding.");
|
|
263332
263342
|
assert$4(value2 !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding.");
|
|
263333
263343
|
assert$4(value2 !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
|
|
263334
263344
|
return value2;
|
|
263335
263345
|
}
|
|
263336
|
-
function sort_keys_replacer
|
|
263346
|
+
function sort_keys_replacer(_key, value2) {
|
|
263337
263347
|
return value2 instanceof Object && !Array.isArray(value2) ? Object.keys(value2).sort().reduce((sorted, key2) => {
|
|
263338
263348
|
sorted[key2] = value2[key2];
|
|
263339
263349
|
return sorted;
|
|
263340
263350
|
}, {}) : value2;
|
|
263341
263351
|
}
|
|
263342
|
-
|
|
263352
|
+
const _JsonCodec = class _JsonCodec {
|
|
263343
263353
|
constructor(configuration2 = {}) {
|
|
263344
263354
|
__publicField(this, "configuration");
|
|
263345
263355
|
__publicField(this, "kind", "array_to_bytes");
|
|
@@ -263368,7 +263378,7 @@ let JsonCodec$1 = (_q = class {
|
|
|
263368
263378
|
__privateSet(this, _decoder_config, { strict });
|
|
263369
263379
|
}
|
|
263370
263380
|
static fromConfig(configuration2) {
|
|
263371
|
-
return new
|
|
263381
|
+
return new _JsonCodec(configuration2);
|
|
263372
263382
|
}
|
|
263373
263383
|
encode(buf) {
|
|
263374
263384
|
const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = __privateGet(this, _encoder_config);
|
|
@@ -263376,10 +263386,10 @@ let JsonCodec$1 = (_q = class {
|
|
|
263376
263386
|
const replacer_functions = [];
|
|
263377
263387
|
assert$4(check_circular, "JsonCodec does not yet support skipping the check for circular references during encoding.");
|
|
263378
263388
|
if (!allow_nan) {
|
|
263379
|
-
replacer_functions.push(throw_on_nan_replacer
|
|
263389
|
+
replacer_functions.push(throw_on_nan_replacer);
|
|
263380
263390
|
}
|
|
263381
263391
|
if (sort_keys) {
|
|
263382
|
-
replacer_functions.push(sort_keys_replacer
|
|
263392
|
+
replacer_functions.push(sort_keys_replacer);
|
|
263383
263393
|
}
|
|
263384
263394
|
const items = Array.from(buf.data);
|
|
263385
263395
|
items.push("|O");
|
|
@@ -263407,17 +263417,20 @@ let JsonCodec$1 = (_q = class {
|
|
|
263407
263417
|
decode(bytes) {
|
|
263408
263418
|
const { strict } = __privateGet(this, _decoder_config);
|
|
263409
263419
|
assert$4(strict, "JsonCodec does not yet support non-strict decoding.");
|
|
263410
|
-
const items = json_decode_object
|
|
263420
|
+
const items = json_decode_object(bytes);
|
|
263411
263421
|
const shape2 = items.pop();
|
|
263412
263422
|
items.pop();
|
|
263413
263423
|
assert$4(shape2, "0D not implemented for JsonCodec.");
|
|
263414
|
-
const stride = get_strides
|
|
263424
|
+
const stride = get_strides(shape2, "C");
|
|
263415
263425
|
const data2 = items;
|
|
263416
263426
|
return { data: data2, shape: shape2, stride };
|
|
263417
263427
|
}
|
|
263418
|
-
}
|
|
263419
|
-
|
|
263420
|
-
|
|
263428
|
+
};
|
|
263429
|
+
_encoder_config = new WeakMap();
|
|
263430
|
+
_decoder_config = new WeakMap();
|
|
263431
|
+
let JsonCodec = _JsonCodec;
|
|
263432
|
+
function proxy(arr) {
|
|
263433
|
+
if (arr instanceof BoolArray || arr instanceof ByteStringArray || arr instanceof UnicodeStringArray) {
|
|
263421
263434
|
const arrp = new Proxy(arr, {
|
|
263422
263435
|
get(target2, prop) {
|
|
263423
263436
|
return target2.get(Number(prop));
|
|
@@ -263431,9 +263444,9 @@ function proxy$1(arr) {
|
|
|
263431
263444
|
}
|
|
263432
263445
|
return arr;
|
|
263433
263446
|
}
|
|
263434
|
-
function empty_like
|
|
263447
|
+
function empty_like(chunk, order2) {
|
|
263435
263448
|
let data2;
|
|
263436
|
-
if (chunk.data instanceof ByteStringArray
|
|
263449
|
+
if (chunk.data instanceof ByteStringArray || chunk.data instanceof UnicodeStringArray) {
|
|
263437
263450
|
data2 = new chunk.constructor(
|
|
263438
263451
|
// @ts-expect-error
|
|
263439
263452
|
chunk.data.length,
|
|
@@ -263445,16 +263458,16 @@ function empty_like$1(chunk, order2) {
|
|
|
263445
263458
|
return {
|
|
263446
263459
|
data: data2,
|
|
263447
263460
|
shape: chunk.shape,
|
|
263448
|
-
stride: get_strides
|
|
263461
|
+
stride: get_strides(chunk.shape, order2)
|
|
263449
263462
|
};
|
|
263450
263463
|
}
|
|
263451
|
-
function convert_array_order
|
|
263452
|
-
let out = empty_like
|
|
263464
|
+
function convert_array_order(src, target2) {
|
|
263465
|
+
let out = empty_like(src, target2);
|
|
263453
263466
|
let n_dims = src.shape.length;
|
|
263454
263467
|
let size2 = src.data.length;
|
|
263455
263468
|
let index2 = Array(n_dims).fill(0);
|
|
263456
|
-
let src_data = proxy
|
|
263457
|
-
let out_data = proxy
|
|
263469
|
+
let src_data = proxy(src.data);
|
|
263470
|
+
let out_data = proxy(out.data);
|
|
263458
263471
|
for (let src_idx = 0; src_idx < size2; src_idx++) {
|
|
263459
263472
|
let out_idx = 0;
|
|
263460
263473
|
for (let dim = 0; dim < n_dims; dim++) {
|
|
@@ -263474,17 +263487,17 @@ function convert_array_order$1(src, target2) {
|
|
|
263474
263487
|
}
|
|
263475
263488
|
return out;
|
|
263476
263489
|
}
|
|
263477
|
-
function get_order
|
|
263490
|
+
function get_order(chunk) {
|
|
263478
263491
|
let rank2 = chunk.shape.length;
|
|
263479
263492
|
assert$4(rank2 === chunk.stride.length, "Shape and stride must have the same length.");
|
|
263480
263493
|
return chunk.stride.map((s2, i2) => ({ stride: s2, index: i2 })).sort((a2, b2) => b2.stride - a2.stride).map((entry2) => entry2.index);
|
|
263481
263494
|
}
|
|
263482
263495
|
function matches_order(chunk, target2) {
|
|
263483
|
-
let source2 = get_order
|
|
263496
|
+
let source2 = get_order(chunk);
|
|
263484
263497
|
assert$4(source2.length === target2.length, "Orders must match");
|
|
263485
263498
|
return source2.every((dim, i2) => dim === target2[i2]);
|
|
263486
263499
|
}
|
|
263487
|
-
|
|
263500
|
+
const _TransposeCodec = class _TransposeCodec {
|
|
263488
263501
|
constructor(configuration2, meta) {
|
|
263489
263502
|
__publicField(this, "kind", "array_to_array");
|
|
263490
263503
|
__privateAdd(this, _order);
|
|
@@ -263514,32 +263527,35 @@ let TransposeCodec$1 = (_r = class {
|
|
|
263514
263527
|
__privateSet(this, _inverseOrder, inverseOrder);
|
|
263515
263528
|
}
|
|
263516
263529
|
static fromConfig(configuration2, meta) {
|
|
263517
|
-
return new
|
|
263530
|
+
return new _TransposeCodec(configuration2, meta);
|
|
263518
263531
|
}
|
|
263519
263532
|
encode(arr) {
|
|
263520
263533
|
if (matches_order(arr, __privateGet(this, _inverseOrder))) {
|
|
263521
263534
|
return arr;
|
|
263522
263535
|
}
|
|
263523
|
-
return convert_array_order
|
|
263536
|
+
return convert_array_order(arr, __privateGet(this, _inverseOrder));
|
|
263524
263537
|
}
|
|
263525
263538
|
decode(arr) {
|
|
263526
263539
|
return {
|
|
263527
263540
|
data: arr.data,
|
|
263528
263541
|
shape: arr.shape,
|
|
263529
|
-
stride: get_strides
|
|
263542
|
+
stride: get_strides(arr.shape, __privateGet(this, _order))
|
|
263530
263543
|
};
|
|
263531
263544
|
}
|
|
263532
|
-
}
|
|
263533
|
-
|
|
263545
|
+
};
|
|
263546
|
+
_order = new WeakMap();
|
|
263547
|
+
_inverseOrder = new WeakMap();
|
|
263548
|
+
let TransposeCodec = _TransposeCodec;
|
|
263549
|
+
const _VLenUTF8 = class _VLenUTF8 {
|
|
263534
263550
|
constructor(shape2) {
|
|
263535
263551
|
__publicField(this, "kind", "array_to_bytes");
|
|
263536
263552
|
__privateAdd(this, _shape2);
|
|
263537
263553
|
__privateAdd(this, _strides);
|
|
263538
263554
|
__privateSet(this, _shape2, shape2);
|
|
263539
|
-
__privateSet(this, _strides, get_strides
|
|
263555
|
+
__privateSet(this, _strides, get_strides(shape2, "C"));
|
|
263540
263556
|
}
|
|
263541
263557
|
static fromConfig(_, meta) {
|
|
263542
|
-
return new
|
|
263558
|
+
return new _VLenUTF8(meta.shape);
|
|
263543
263559
|
}
|
|
263544
263560
|
encode(_chunk) {
|
|
263545
263561
|
throw new Error("Method not implemented.");
|
|
@@ -263557,7 +263573,10 @@ let VLenUTF8$1 = (_s = class {
|
|
|
263557
263573
|
}
|
|
263558
263574
|
return { data: data2, shape: __privateGet(this, _shape2), stride: __privateGet(this, _strides) };
|
|
263559
263575
|
}
|
|
263560
|
-
}
|
|
263576
|
+
};
|
|
263577
|
+
_shape2 = new WeakMap();
|
|
263578
|
+
_strides = new WeakMap();
|
|
263579
|
+
let VLenUTF8 = _VLenUTF8;
|
|
263561
263580
|
class ZlibCodec {
|
|
263562
263581
|
constructor() {
|
|
263563
263582
|
__publicField(this, "kind", "bytes_to_bytes");
|
|
@@ -263565,7 +263584,7 @@ class ZlibCodec {
|
|
|
263565
263584
|
static fromConfig(_) {
|
|
263566
263585
|
return new ZlibCodec();
|
|
263567
263586
|
}
|
|
263568
|
-
encode(
|
|
263587
|
+
encode(_bytes2) {
|
|
263569
263588
|
throw new Error("Zlib encoding is not enabled by default. Please register a codec with `numcodecs/zlib`.");
|
|
263570
263589
|
}
|
|
263571
263590
|
async decode(bytes) {
|
|
@@ -263573,16 +263592,16 @@ class ZlibCodec {
|
|
|
263573
263592
|
return new Uint8Array(buffer2);
|
|
263574
263593
|
}
|
|
263575
263594
|
}
|
|
263576
|
-
function create_default_registry
|
|
263577
|
-
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BGDKghio.js").then((m2) => m2.default)).set("lz4", () => import("./lz4-DTu7K31c.js").then((m2) => m2.default)).set("zstd", () => import("./zstd-DNA9nISO.js").then((m2) => m2.default)).set("gzip", () => GzipCodec).set("zlib", () => ZlibCodec).set("transpose", () => TransposeCodec
|
|
263595
|
+
function create_default_registry() {
|
|
263596
|
+
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BGDKghio.js").then((m2) => m2.default)).set("lz4", () => import("./lz4-DTu7K31c.js").then((m2) => m2.default)).set("zstd", () => import("./zstd-DNA9nISO.js").then((m2) => m2.default)).set("gzip", () => GzipCodec).set("zlib", () => ZlibCodec).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec).set("bitround", () => BitroundCodec);
|
|
263578
263597
|
}
|
|
263579
|
-
const registry
|
|
263580
|
-
function create_codec_pipeline
|
|
263598
|
+
const registry = create_default_registry();
|
|
263599
|
+
function create_codec_pipeline(chunk_metadata) {
|
|
263581
263600
|
let codecs;
|
|
263582
263601
|
return {
|
|
263583
263602
|
async encode(chunk) {
|
|
263584
263603
|
if (!codecs)
|
|
263585
|
-
codecs = await load_codecs
|
|
263604
|
+
codecs = await load_codecs(chunk_metadata);
|
|
263586
263605
|
for (const codec of codecs.array_to_array) {
|
|
263587
263606
|
chunk = await codec.encode(chunk);
|
|
263588
263607
|
}
|
|
@@ -263594,7 +263613,7 @@ function create_codec_pipeline$1(chunk_metadata) {
|
|
|
263594
263613
|
},
|
|
263595
263614
|
async decode(bytes) {
|
|
263596
263615
|
if (!codecs)
|
|
263597
|
-
codecs = await load_codecs
|
|
263616
|
+
codecs = await load_codecs(chunk_metadata);
|
|
263598
263617
|
for (let i2 = codecs.bytes_to_bytes.length - 1; i2 >= 0; i2--) {
|
|
263599
263618
|
bytes = await codecs.bytes_to_bytes[i2].decode(bytes);
|
|
263600
263619
|
}
|
|
@@ -263606,9 +263625,9 @@ function create_codec_pipeline$1(chunk_metadata) {
|
|
|
263606
263625
|
}
|
|
263607
263626
|
};
|
|
263608
263627
|
}
|
|
263609
|
-
async function load_codecs
|
|
263628
|
+
async function load_codecs(chunk_meta) {
|
|
263610
263629
|
let promises = chunk_meta.codecs.map(async (meta) => {
|
|
263611
|
-
let Codec = await registry
|
|
263630
|
+
let Codec = await registry.get(meta.name)?.();
|
|
263612
263631
|
assert$4(Codec, `Unknown codec: ${meta.name}`);
|
|
263613
263632
|
return { Codec, meta };
|
|
263614
263633
|
});
|
|
@@ -263629,20 +263648,20 @@ async function load_codecs$1(chunk_meta) {
|
|
|
263629
263648
|
}
|
|
263630
263649
|
}
|
|
263631
263650
|
if (!array_to_bytes) {
|
|
263632
|
-
assert$4(is_typed_array_like_meta
|
|
263633
|
-
array_to_bytes = BytesCodec
|
|
263651
|
+
assert$4(is_typed_array_like_meta(chunk_meta), `Cannot encode ${chunk_meta.data_type} to bytes without a codec`);
|
|
263652
|
+
array_to_bytes = BytesCodec.fromConfig({ endian: "little" }, chunk_meta);
|
|
263634
263653
|
}
|
|
263635
263654
|
return { array_to_array, array_to_bytes, bytes_to_bytes };
|
|
263636
263655
|
}
|
|
263637
|
-
function is_typed_array_like_meta
|
|
263656
|
+
function is_typed_array_like_meta(meta) {
|
|
263638
263657
|
return meta.data_type !== "v2:object";
|
|
263639
263658
|
}
|
|
263640
|
-
const MAX_BIG_UINT
|
|
263641
|
-
function create_sharded_chunk_getter
|
|
263659
|
+
const MAX_BIG_UINT = 18446744073709551615n;
|
|
263660
|
+
function create_sharded_chunk_getter(location, shard_shape, encode_shard_key, sharding_config) {
|
|
263642
263661
|
assert$4(location.store.getRange, "Store does not support range requests");
|
|
263643
263662
|
let get_range = location.store.getRange.bind(location.store);
|
|
263644
263663
|
let index_shape = shard_shape.map((d, i2) => d / sharding_config.chunk_shape[i2]);
|
|
263645
|
-
let index_codec = create_codec_pipeline
|
|
263664
|
+
let index_codec = create_codec_pipeline({
|
|
263646
263665
|
data_type: "uint64",
|
|
263647
263666
|
shape: [...index_shape, 2],
|
|
263648
263667
|
codecs: sharding_config.index_codecs
|
|
@@ -263669,7 +263688,7 @@ function create_sharded_chunk_getter$1(location, shard_shape, encode_shard_key,
|
|
|
263669
263688
|
let linear_offset = chunk_coord.map((d, i2) => d % shape2[i2]).reduce((acc, sel, idx) => acc + sel * stride[idx], 0);
|
|
263670
263689
|
let offset2 = data2[linear_offset];
|
|
263671
263690
|
let length2 = data2[linear_offset + 1];
|
|
263672
|
-
if (offset2 === MAX_BIG_UINT
|
|
263691
|
+
if (offset2 === MAX_BIG_UINT && length2 === MAX_BIG_UINT) {
|
|
263673
263692
|
return void 0;
|
|
263674
263693
|
}
|
|
263675
263694
|
return get_range(shard_path, {
|
|
@@ -263678,7 +263697,7 @@ function create_sharded_chunk_getter$1(location, shard_shape, encode_shard_key,
|
|
|
263678
263697
|
});
|
|
263679
263698
|
};
|
|
263680
263699
|
}
|
|
263681
|
-
|
|
263700
|
+
class Location {
|
|
263682
263701
|
constructor(store, path2 = "/") {
|
|
263683
263702
|
__publicField(this, "store");
|
|
263684
263703
|
__publicField(this, "path");
|
|
@@ -263689,11 +263708,11 @@ let Location$1 = class Location {
|
|
|
263689
263708
|
let root2 = new URL(`file://${this.path.endsWith("/") ? this.path : `${this.path}/`}`);
|
|
263690
263709
|
return new Location(this.store, new URL(path2, root2).pathname);
|
|
263691
263710
|
}
|
|
263692
|
-
};
|
|
263693
|
-
function root$1(store) {
|
|
263694
|
-
return new Location$1(store ?? /* @__PURE__ */ new Map());
|
|
263695
263711
|
}
|
|
263696
|
-
|
|
263712
|
+
function root(store) {
|
|
263713
|
+
return new Location(store ?? /* @__PURE__ */ new Map());
|
|
263714
|
+
}
|
|
263715
|
+
let Group$2 = (_m = class extends Location {
|
|
263697
263716
|
constructor(store, path2, metadata2) {
|
|
263698
263717
|
super(store, path2);
|
|
263699
263718
|
__publicField(this, "kind", "group");
|
|
@@ -263703,51 +263722,51 @@ let Group$3 = (_t = class extends Location$1 {
|
|
|
263703
263722
|
get attrs() {
|
|
263704
263723
|
return __privateGet(this, _metadata).attributes;
|
|
263705
263724
|
}
|
|
263706
|
-
}, _metadata = new WeakMap(),
|
|
263707
|
-
function get_array_order
|
|
263725
|
+
}, _metadata = new WeakMap(), _m);
|
|
263726
|
+
function get_array_order(codecs) {
|
|
263708
263727
|
const maybe_transpose_codec = codecs.find((c2) => c2.name === "transpose");
|
|
263709
263728
|
return maybe_transpose_codec?.configuration?.order ?? "C";
|
|
263710
263729
|
}
|
|
263711
|
-
const CONTEXT_MARKER
|
|
263712
|
-
function get_context
|
|
263713
|
-
return obj[CONTEXT_MARKER
|
|
263730
|
+
const CONTEXT_MARKER = Symbol("zarrita.context");
|
|
263731
|
+
function get_context(obj) {
|
|
263732
|
+
return obj[CONTEXT_MARKER];
|
|
263714
263733
|
}
|
|
263715
|
-
function create_context
|
|
263716
|
-
let { configuration: configuration2 } = metadata2.codecs.find(is_sharding_codec
|
|
263734
|
+
function create_context(location, metadata2) {
|
|
263735
|
+
let { configuration: configuration2 } = metadata2.codecs.find(is_sharding_codec) ?? {};
|
|
263717
263736
|
let shared_context = {
|
|
263718
|
-
encode_chunk_key: create_chunk_key_encoder
|
|
263719
|
-
TypedArray: get_ctr
|
|
263737
|
+
encode_chunk_key: create_chunk_key_encoder(metadata2.chunk_key_encoding),
|
|
263738
|
+
TypedArray: get_ctr(metadata2.data_type),
|
|
263720
263739
|
fill_value: metadata2.fill_value
|
|
263721
263740
|
};
|
|
263722
263741
|
if (configuration2) {
|
|
263723
|
-
let native_order2 = get_array_order
|
|
263742
|
+
let native_order2 = get_array_order(configuration2.codecs);
|
|
263724
263743
|
return {
|
|
263725
263744
|
...shared_context,
|
|
263726
263745
|
kind: "sharded",
|
|
263727
263746
|
chunk_shape: configuration2.chunk_shape,
|
|
263728
|
-
codec: create_codec_pipeline
|
|
263747
|
+
codec: create_codec_pipeline({
|
|
263729
263748
|
data_type: metadata2.data_type,
|
|
263730
263749
|
shape: configuration2.chunk_shape,
|
|
263731
263750
|
codecs: configuration2.codecs
|
|
263732
263751
|
}),
|
|
263733
263752
|
get_strides(shape2) {
|
|
263734
|
-
return get_strides
|
|
263753
|
+
return get_strides(shape2, native_order2);
|
|
263735
263754
|
},
|
|
263736
|
-
get_chunk_bytes: create_sharded_chunk_getter
|
|
263755
|
+
get_chunk_bytes: create_sharded_chunk_getter(location, metadata2.chunk_grid.configuration.chunk_shape, shared_context.encode_chunk_key, configuration2)
|
|
263737
263756
|
};
|
|
263738
263757
|
}
|
|
263739
|
-
let native_order = get_array_order
|
|
263758
|
+
let native_order = get_array_order(metadata2.codecs);
|
|
263740
263759
|
return {
|
|
263741
263760
|
...shared_context,
|
|
263742
263761
|
kind: "regular",
|
|
263743
263762
|
chunk_shape: metadata2.chunk_grid.configuration.chunk_shape,
|
|
263744
|
-
codec: create_codec_pipeline
|
|
263763
|
+
codec: create_codec_pipeline({
|
|
263745
263764
|
data_type: metadata2.data_type,
|
|
263746
263765
|
shape: metadata2.chunk_grid.configuration.chunk_shape,
|
|
263747
263766
|
codecs: metadata2.codecs
|
|
263748
263767
|
}),
|
|
263749
263768
|
get_strides(shape2) {
|
|
263750
|
-
return get_strides
|
|
263769
|
+
return get_strides(shape2, native_order);
|
|
263751
263770
|
},
|
|
263752
263771
|
async get_chunk_bytes(chunk_coords, options) {
|
|
263753
263772
|
let chunk_key = shared_context.encode_chunk_key(chunk_coords);
|
|
@@ -263756,17 +263775,17 @@ function create_context$1(location, metadata2) {
|
|
|
263756
263775
|
}
|
|
263757
263776
|
};
|
|
263758
263777
|
}
|
|
263759
|
-
let Array$
|
|
263778
|
+
let Array$1 = (_p = class extends (_o2 = Location, _n = CONTEXT_MARKER, _o2) {
|
|
263760
263779
|
constructor(store, path2, metadata2) {
|
|
263761
263780
|
super(store, path2);
|
|
263762
263781
|
__publicField(this, "kind", "array");
|
|
263763
263782
|
__privateAdd(this, _metadata2);
|
|
263764
|
-
__publicField(this,
|
|
263783
|
+
__publicField(this, _n);
|
|
263765
263784
|
__privateSet(this, _metadata2, {
|
|
263766
263785
|
...metadata2,
|
|
263767
|
-
fill_value: ensure_correct_scalar
|
|
263786
|
+
fill_value: ensure_correct_scalar(metadata2)
|
|
263768
263787
|
});
|
|
263769
|
-
this[CONTEXT_MARKER
|
|
263788
|
+
this[CONTEXT_MARKER] = create_context(this, metadata2);
|
|
263770
263789
|
}
|
|
263771
263790
|
get attrs() {
|
|
263772
263791
|
return __privateGet(this, _metadata2).attributes;
|
|
@@ -263775,13 +263794,13 @@ let Array$2 = (_w = class extends (_v4 = Location$1, _u2 = CONTEXT_MARKER$1, _v4
|
|
|
263775
263794
|
return __privateGet(this, _metadata2).shape;
|
|
263776
263795
|
}
|
|
263777
263796
|
get chunks() {
|
|
263778
|
-
return this[CONTEXT_MARKER
|
|
263797
|
+
return this[CONTEXT_MARKER].chunk_shape;
|
|
263779
263798
|
}
|
|
263780
263799
|
get dtype() {
|
|
263781
263800
|
return __privateGet(this, _metadata2).data_type;
|
|
263782
263801
|
}
|
|
263783
263802
|
async getChunk(chunk_coords, options) {
|
|
263784
|
-
let context2 = this[CONTEXT_MARKER
|
|
263803
|
+
let context2 = this[CONTEXT_MARKER];
|
|
263785
263804
|
let maybe_bytes = await context2.get_chunk_bytes(chunk_coords, options);
|
|
263786
263805
|
if (!maybe_bytes) {
|
|
263787
263806
|
let size2 = context2.chunk_shape.reduce((a2, b2) => a2 * b2, 1);
|
|
@@ -263813,11 +263832,11 @@ let Array$2 = (_w = class extends (_v4 = Location$1, _u2 = CONTEXT_MARKER$1, _v4
|
|
|
263813
263832
|
* ```
|
|
263814
263833
|
*/
|
|
263815
263834
|
is(query) {
|
|
263816
|
-
return is_dtype
|
|
263835
|
+
return is_dtype(this.dtype, query);
|
|
263817
263836
|
}
|
|
263818
|
-
}, _metadata2 = new WeakMap(),
|
|
263819
|
-
let VERSION_COUNTER
|
|
263820
|
-
function create_version_counter
|
|
263837
|
+
}, _metadata2 = new WeakMap(), _p);
|
|
263838
|
+
let VERSION_COUNTER = create_version_counter();
|
|
263839
|
+
function create_version_counter() {
|
|
263821
263840
|
let version_counts = /* @__PURE__ */ new WeakMap();
|
|
263822
263841
|
function get_counts(store) {
|
|
263823
263842
|
let counts = version_counts.get(store) ?? { v2: 0, v3: 0 };
|
|
@@ -263834,88 +263853,88 @@ function create_version_counter$1() {
|
|
|
263834
263853
|
}
|
|
263835
263854
|
};
|
|
263836
263855
|
}
|
|
263837
|
-
async function load_attrs
|
|
263856
|
+
async function load_attrs(location) {
|
|
263838
263857
|
let meta_bytes = await location.store.get(location.resolve(".zattrs").path);
|
|
263839
263858
|
if (!meta_bytes)
|
|
263840
263859
|
return {};
|
|
263841
|
-
return json_decode_object
|
|
263860
|
+
return json_decode_object(meta_bytes);
|
|
263842
263861
|
}
|
|
263843
|
-
async function open_v2
|
|
263844
|
-
let loc = "store" in location ? location : new Location
|
|
263862
|
+
async function open_v2(location, options = {}) {
|
|
263863
|
+
let loc = "store" in location ? location : new Location(location);
|
|
263845
263864
|
let attrs = {};
|
|
263846
263865
|
if (options.attrs ?? true)
|
|
263847
|
-
attrs = await load_attrs
|
|
263866
|
+
attrs = await load_attrs(loc);
|
|
263848
263867
|
if (options.kind === "array")
|
|
263849
|
-
return open_array_v2
|
|
263868
|
+
return open_array_v2(loc, attrs);
|
|
263850
263869
|
if (options.kind === "group")
|
|
263851
|
-
return open_group_v2
|
|
263852
|
-
return open_array_v2
|
|
263853
|
-
rethrow_unless(err2, NodeNotFoundError
|
|
263854
|
-
return open_group_v2
|
|
263870
|
+
return open_group_v2(loc, attrs);
|
|
263871
|
+
return open_array_v2(loc, attrs).catch((err2) => {
|
|
263872
|
+
rethrow_unless(err2, NodeNotFoundError);
|
|
263873
|
+
return open_group_v2(loc, attrs);
|
|
263855
263874
|
});
|
|
263856
263875
|
}
|
|
263857
|
-
async function open_array_v2
|
|
263876
|
+
async function open_array_v2(location, attrs) {
|
|
263858
263877
|
let { path: path2 } = location.resolve(".zarray");
|
|
263859
263878
|
let meta = await location.store.get(path2);
|
|
263860
263879
|
if (!meta) {
|
|
263861
|
-
throw new NodeNotFoundError
|
|
263862
|
-
cause: new KeyError
|
|
263880
|
+
throw new NodeNotFoundError("v2 array", {
|
|
263881
|
+
cause: new KeyError(path2)
|
|
263863
263882
|
});
|
|
263864
263883
|
}
|
|
263865
|
-
VERSION_COUNTER
|
|
263866
|
-
return new Array$
|
|
263884
|
+
VERSION_COUNTER.increment(location.store, "v2");
|
|
263885
|
+
return new Array$1(location.store, location.path, v2_to_v3_array_metadata(json_decode_object(meta), attrs));
|
|
263867
263886
|
}
|
|
263868
|
-
async function open_group_v2
|
|
263887
|
+
async function open_group_v2(location, attrs) {
|
|
263869
263888
|
let { path: path2 } = location.resolve(".zgroup");
|
|
263870
263889
|
let meta = await location.store.get(path2);
|
|
263871
263890
|
if (!meta) {
|
|
263872
|
-
throw new NodeNotFoundError
|
|
263873
|
-
cause: new KeyError
|
|
263891
|
+
throw new NodeNotFoundError("v2 group", {
|
|
263892
|
+
cause: new KeyError(path2)
|
|
263874
263893
|
});
|
|
263875
263894
|
}
|
|
263876
|
-
VERSION_COUNTER
|
|
263877
|
-
return new Group$
|
|
263895
|
+
VERSION_COUNTER.increment(location.store, "v2");
|
|
263896
|
+
return new Group$2(location.store, location.path, v2_to_v3_group_metadata(json_decode_object(meta), attrs));
|
|
263878
263897
|
}
|
|
263879
|
-
async function _open_v3
|
|
263898
|
+
async function _open_v3(location) {
|
|
263880
263899
|
let { store, path: path2 } = location.resolve("zarr.json");
|
|
263881
263900
|
let meta = await location.store.get(path2);
|
|
263882
263901
|
if (!meta) {
|
|
263883
|
-
throw new NodeNotFoundError
|
|
263884
|
-
cause: new KeyError
|
|
263902
|
+
throw new NodeNotFoundError("v3 array or group", {
|
|
263903
|
+
cause: new KeyError(path2)
|
|
263885
263904
|
});
|
|
263886
263905
|
}
|
|
263887
|
-
let meta_doc = json_decode_object
|
|
263906
|
+
let meta_doc = json_decode_object(meta);
|
|
263888
263907
|
if (meta_doc.node_type === "array") {
|
|
263889
|
-
meta_doc.fill_value = ensure_correct_scalar
|
|
263908
|
+
meta_doc.fill_value = ensure_correct_scalar(meta_doc);
|
|
263890
263909
|
}
|
|
263891
|
-
return meta_doc.node_type === "array" ? new Array$
|
|
263910
|
+
return meta_doc.node_type === "array" ? new Array$1(store, location.path, meta_doc) : new Group$2(store, location.path, meta_doc);
|
|
263892
263911
|
}
|
|
263893
|
-
async function open_v3
|
|
263894
|
-
let loc = "store" in location ? location : new Location
|
|
263895
|
-
let node2 = await _open_v3
|
|
263896
|
-
VERSION_COUNTER
|
|
263912
|
+
async function open_v3(location, options = {}) {
|
|
263913
|
+
let loc = "store" in location ? location : new Location(location);
|
|
263914
|
+
let node2 = await _open_v3(loc);
|
|
263915
|
+
VERSION_COUNTER.increment(loc.store, "v3");
|
|
263897
263916
|
if (options.kind === void 0)
|
|
263898
263917
|
return node2;
|
|
263899
|
-
if (options.kind === "array" && node2 instanceof Array$
|
|
263918
|
+
if (options.kind === "array" && node2 instanceof Array$1)
|
|
263900
263919
|
return node2;
|
|
263901
|
-
if (options.kind === "group" && node2 instanceof Group$
|
|
263920
|
+
if (options.kind === "group" && node2 instanceof Group$2)
|
|
263902
263921
|
return node2;
|
|
263903
|
-
let kind = node2 instanceof Array$
|
|
263922
|
+
let kind = node2 instanceof Array$1 ? "array" : "group";
|
|
263904
263923
|
throw new Error(`Expected node of kind ${options.kind}, found ${kind}.`);
|
|
263905
263924
|
}
|
|
263906
|
-
async function open
|
|
263925
|
+
async function open(location, options = {}) {
|
|
263907
263926
|
let store = "store" in location ? location.store : location;
|
|
263908
|
-
let version_max = VERSION_COUNTER
|
|
263909
|
-
let open_primary = version_max === "v2" ? open
|
|
263910
|
-
let open_secondary = version_max === "v2" ? open
|
|
263927
|
+
let version_max = VERSION_COUNTER.version_max(store);
|
|
263928
|
+
let open_primary = version_max === "v2" ? open.v2 : open.v3;
|
|
263929
|
+
let open_secondary = version_max === "v2" ? open.v3 : open.v2;
|
|
263911
263930
|
return open_primary(location, options).catch((err2) => {
|
|
263912
|
-
rethrow_unless(err2, NodeNotFoundError
|
|
263931
|
+
rethrow_unless(err2, NodeNotFoundError);
|
|
263913
263932
|
return open_secondary(location, options);
|
|
263914
263933
|
});
|
|
263915
263934
|
}
|
|
263916
|
-
open
|
|
263917
|
-
open
|
|
263918
|
-
function* range$
|
|
263935
|
+
open.v2 = open_v2;
|
|
263936
|
+
open.v3 = open_v3;
|
|
263937
|
+
function* range$7(start2, stop3, step = 1) {
|
|
263919
263938
|
if (stop3 === void 0) {
|
|
263920
263939
|
stop3 = start2;
|
|
263921
263940
|
start2 = 0;
|
|
@@ -263924,7 +263943,7 @@ function* range$8(start2, stop3, step = 1) {
|
|
|
263924
263943
|
yield i2;
|
|
263925
263944
|
}
|
|
263926
263945
|
}
|
|
263927
|
-
function* product$
|
|
263946
|
+
function* product$1(...iterables) {
|
|
263928
263947
|
if (iterables.length === 0) {
|
|
263929
263948
|
return;
|
|
263930
263949
|
}
|
|
@@ -263947,7 +263966,7 @@ function* product$2(...iterables) {
|
|
|
263947
263966
|
results[i2] = iterators[i2].next();
|
|
263948
263967
|
}
|
|
263949
263968
|
}
|
|
263950
|
-
function slice_indices
|
|
263969
|
+
function slice_indices({ start: start2, stop: stop3, step }, length2) {
|
|
263951
263970
|
if (step === 0) {
|
|
263952
263971
|
throw new Error("slice step cannot be zero");
|
|
263953
263972
|
}
|
|
@@ -263980,7 +263999,7 @@ function slice_indices$1({ start: start2, stop: stop3, step }, length2) {
|
|
|
263980
263999
|
}
|
|
263981
264000
|
return [start2, stop3, step];
|
|
263982
264001
|
}
|
|
263983
|
-
function slice$
|
|
264002
|
+
function slice$4(start2, stop3, step = null) {
|
|
263984
264003
|
if (stop3 === void 0) {
|
|
263985
264004
|
stop3 = start2;
|
|
263986
264005
|
start2 = null;
|
|
@@ -263991,50 +264010,50 @@ function slice$5(start2, stop3, step = null) {
|
|
|
263991
264010
|
step
|
|
263992
264011
|
};
|
|
263993
264012
|
}
|
|
263994
|
-
function create_queue
|
|
264013
|
+
function create_queue() {
|
|
263995
264014
|
const promises = [];
|
|
263996
264015
|
return {
|
|
263997
264016
|
add: (fn2) => promises.push(fn2()),
|
|
263998
264017
|
onIdle: () => Promise.all(promises)
|
|
263999
264018
|
};
|
|
264000
264019
|
}
|
|
264001
|
-
|
|
264020
|
+
class IndexError extends Error {
|
|
264002
264021
|
constructor(msg) {
|
|
264003
264022
|
super(msg);
|
|
264004
264023
|
this.name = "IndexError";
|
|
264005
264024
|
}
|
|
264006
|
-
};
|
|
264007
|
-
function err_too_many_indices$1(selection, shape2) {
|
|
264008
|
-
throw new IndexError$1(`too many indicies for array; expected ${shape2.length}, got ${selection.length}`);
|
|
264009
264025
|
}
|
|
264010
|
-
function
|
|
264011
|
-
throw new IndexError
|
|
264026
|
+
function err_too_many_indices(selection, shape2) {
|
|
264027
|
+
throw new IndexError(`too many indicies for array; expected ${shape2.length}, got ${selection.length}`);
|
|
264028
|
+
}
|
|
264029
|
+
function err_boundscheck(dim_len) {
|
|
264030
|
+
throw new IndexError(`index out of bounds for dimension with length ${dim_len}`);
|
|
264012
264031
|
}
|
|
264013
|
-
function err_negative_step
|
|
264014
|
-
throw new IndexError
|
|
264032
|
+
function err_negative_step() {
|
|
264033
|
+
throw new IndexError("only slices with step >= 1 are supported");
|
|
264015
264034
|
}
|
|
264016
|
-
function check_selection_length
|
|
264035
|
+
function check_selection_length(selection, shape2) {
|
|
264017
264036
|
if (selection.length > shape2.length) {
|
|
264018
|
-
err_too_many_indices
|
|
264037
|
+
err_too_many_indices(selection, shape2);
|
|
264019
264038
|
}
|
|
264020
264039
|
}
|
|
264021
|
-
function normalize_integer_selection
|
|
264040
|
+
function normalize_integer_selection(dim_sel, dim_len) {
|
|
264022
264041
|
dim_sel = Math.trunc(dim_sel);
|
|
264023
264042
|
if (dim_sel < 0) {
|
|
264024
264043
|
dim_sel = dim_len + dim_sel;
|
|
264025
264044
|
}
|
|
264026
264045
|
if (dim_sel >= dim_len || dim_sel < 0) {
|
|
264027
|
-
err_boundscheck
|
|
264046
|
+
err_boundscheck(dim_len);
|
|
264028
264047
|
}
|
|
264029
264048
|
return dim_sel;
|
|
264030
264049
|
}
|
|
264031
|
-
|
|
264050
|
+
class IntDimIndexer {
|
|
264032
264051
|
constructor({ dim_sel, dim_len, dim_chunk_len }) {
|
|
264033
264052
|
__publicField(this, "dim_sel");
|
|
264034
264053
|
__publicField(this, "dim_len");
|
|
264035
264054
|
__publicField(this, "dim_chunk_len");
|
|
264036
264055
|
__publicField(this, "nitems");
|
|
264037
|
-
dim_sel = normalize_integer_selection
|
|
264056
|
+
dim_sel = normalize_integer_selection(dim_sel, dim_len);
|
|
264038
264057
|
this.dim_sel = dim_sel;
|
|
264039
264058
|
this.dim_len = dim_len;
|
|
264040
264059
|
this.dim_chunk_len = dim_chunk_len;
|
|
@@ -264046,8 +264065,8 @@ let IntDimIndexer$1 = class IntDimIndexer {
|
|
|
264046
264065
|
const dim_chunk_sel = this.dim_sel - dim_offset;
|
|
264047
264066
|
yield { dim_chunk_ix, dim_chunk_sel };
|
|
264048
264067
|
}
|
|
264049
|
-
}
|
|
264050
|
-
|
|
264068
|
+
}
|
|
264069
|
+
class SliceDimIndexer {
|
|
264051
264070
|
constructor({ dim_sel, dim_len, dim_chunk_len }) {
|
|
264052
264071
|
__publicField(this, "start");
|
|
264053
264072
|
__publicField(this, "stop");
|
|
@@ -264056,12 +264075,12 @@ let SliceDimIndexer$1 = class SliceDimIndexer {
|
|
|
264056
264075
|
__publicField(this, "dim_chunk_len");
|
|
264057
264076
|
__publicField(this, "nitems");
|
|
264058
264077
|
__publicField(this, "nchunks");
|
|
264059
|
-
const [start2, stop3, step] = slice_indices
|
|
264078
|
+
const [start2, stop3, step] = slice_indices(dim_sel, dim_len);
|
|
264060
264079
|
this.start = start2;
|
|
264061
264080
|
this.stop = stop3;
|
|
264062
264081
|
this.step = step;
|
|
264063
264082
|
if (this.step < 1)
|
|
264064
|
-
err_negative_step
|
|
264083
|
+
err_negative_step();
|
|
264065
264084
|
this.dim_len = dim_len;
|
|
264066
264085
|
this.dim_chunk_len = dim_chunk_len;
|
|
264067
264086
|
this.nitems = Math.max(0, Math.ceil((this.stop - this.start) / this.step));
|
|
@@ -264070,7 +264089,7 @@ let SliceDimIndexer$1 = class SliceDimIndexer {
|
|
|
264070
264089
|
*[Symbol.iterator]() {
|
|
264071
264090
|
const dim_chunk_ix_from = Math.floor(this.start / this.dim_chunk_len);
|
|
264072
264091
|
const dim_chunk_ix_to = Math.ceil(this.stop / this.dim_chunk_len);
|
|
264073
|
-
for (const dim_chunk_ix of range$
|
|
264092
|
+
for (const dim_chunk_ix of range$7(dim_chunk_ix_from, dim_chunk_ix_to)) {
|
|
264074
264093
|
const dim_offset = dim_chunk_ix * this.dim_chunk_len;
|
|
264075
264094
|
const dim_limit = Math.min(this.dim_len, (dim_chunk_ix + 1) * this.dim_chunk_len);
|
|
264076
264095
|
const dim_chunk_len = dim_limit - dim_offset;
|
|
@@ -264099,33 +264118,33 @@ let SliceDimIndexer$1 = class SliceDimIndexer {
|
|
|
264099
264118
|
yield { dim_chunk_ix, dim_chunk_sel, dim_out_sel };
|
|
264100
264119
|
}
|
|
264101
264120
|
}
|
|
264102
|
-
}
|
|
264103
|
-
function normalize_selection
|
|
264121
|
+
}
|
|
264122
|
+
function normalize_selection(selection, shape2) {
|
|
264104
264123
|
let normalized = [];
|
|
264105
264124
|
if (selection === null) {
|
|
264106
|
-
normalized = shape2.map((_) => slice$
|
|
264125
|
+
normalized = shape2.map((_) => slice$4(null));
|
|
264107
264126
|
} else if (Array.isArray(selection)) {
|
|
264108
|
-
normalized = selection.map((s2) => s2 ?? slice$
|
|
264127
|
+
normalized = selection.map((s2) => s2 ?? slice$4(null));
|
|
264109
264128
|
}
|
|
264110
|
-
check_selection_length
|
|
264129
|
+
check_selection_length(normalized, shape2);
|
|
264111
264130
|
return normalized;
|
|
264112
264131
|
}
|
|
264113
|
-
|
|
264132
|
+
class BasicIndexer {
|
|
264114
264133
|
constructor({ selection, shape: shape2, chunk_shape }) {
|
|
264115
264134
|
__publicField(this, "dim_indexers");
|
|
264116
264135
|
__publicField(this, "shape");
|
|
264117
|
-
this.dim_indexers = normalize_selection
|
|
264118
|
-
return new (typeof dim_sel === "number" ? IntDimIndexer
|
|
264136
|
+
this.dim_indexers = normalize_selection(selection, shape2).map((dim_sel, i2) => {
|
|
264137
|
+
return new (typeof dim_sel === "number" ? IntDimIndexer : SliceDimIndexer)({
|
|
264119
264138
|
// @ts-expect-error ts inference not strong enough to know correct chunk
|
|
264120
264139
|
dim_sel,
|
|
264121
264140
|
dim_len: shape2[i2],
|
|
264122
264141
|
dim_chunk_len: chunk_shape[i2]
|
|
264123
264142
|
});
|
|
264124
264143
|
});
|
|
264125
|
-
this.shape = this.dim_indexers.filter((ixr) => ixr instanceof SliceDimIndexer
|
|
264144
|
+
this.shape = this.dim_indexers.filter((ixr) => ixr instanceof SliceDimIndexer).map((sixr) => sixr.nitems);
|
|
264126
264145
|
}
|
|
264127
264146
|
*[Symbol.iterator]() {
|
|
264128
|
-
for (const dim_projections of product$
|
|
264147
|
+
for (const dim_projections of product$1(...this.dim_indexers)) {
|
|
264129
264148
|
const chunk_coords = dim_projections.map((p) => p.dim_chunk_ix);
|
|
264130
264149
|
const mapping = dim_projections.map((p) => {
|
|
264131
264150
|
if ("dim_out_sel" in p) {
|
|
@@ -264136,19 +264155,19 @@ let BasicIndexer$1 = class BasicIndexer {
|
|
|
264136
264155
|
yield { chunk_coords, mapping };
|
|
264137
264156
|
}
|
|
264138
264157
|
}
|
|
264139
|
-
}
|
|
264140
|
-
function unwrap
|
|
264158
|
+
}
|
|
264159
|
+
function unwrap(arr, idx) {
|
|
264141
264160
|
return "get" in arr ? arr.get(idx) : arr[idx];
|
|
264142
264161
|
}
|
|
264143
|
-
async function get$
|
|
264144
|
-
let context2 = get_context
|
|
264145
|
-
let indexer = new BasicIndexer
|
|
264162
|
+
async function get$b(arr, selection, opts2, setter2) {
|
|
264163
|
+
let context2 = get_context(arr);
|
|
264164
|
+
let indexer = new BasicIndexer({
|
|
264146
264165
|
selection,
|
|
264147
264166
|
shape: arr.shape,
|
|
264148
264167
|
chunk_shape: arr.chunks
|
|
264149
264168
|
});
|
|
264150
264169
|
let out = setter2.prepare(new context2.TypedArray(indexer.shape.reduce((a2, b2) => a2 * b2, 1)), indexer.shape, context2.get_strides(indexer.shape));
|
|
264151
|
-
let queue = opts2.create_queue?.() ?? create_queue
|
|
264170
|
+
let queue = opts2.create_queue?.() ?? create_queue();
|
|
264152
264171
|
for (const { chunk_coords, mapping } of indexer) {
|
|
264153
264172
|
queue.add(async () => {
|
|
264154
264173
|
let { data: data2, shape: shape2, stride } = await arr.getChunk(chunk_coords, opts2.opts);
|
|
@@ -264157,14 +264176,14 @@ async function get$d(arr, selection, opts2, setter2) {
|
|
|
264157
264176
|
});
|
|
264158
264177
|
}
|
|
264159
264178
|
await queue.onIdle();
|
|
264160
|
-
return indexer.shape.length === 0 ? unwrap
|
|
264179
|
+
return indexer.shape.length === 0 ? unwrap(out.data, 0) : out;
|
|
264161
264180
|
}
|
|
264162
|
-
function object_array_view
|
|
264181
|
+
function object_array_view(arr, offset2 = 0, size2) {
|
|
264163
264182
|
let length2 = size2 ?? arr.length - offset2;
|
|
264164
264183
|
return {
|
|
264165
264184
|
length: length2,
|
|
264166
264185
|
subarray(from2, to = length2) {
|
|
264167
|
-
return object_array_view
|
|
264186
|
+
return object_array_view(arr, offset2 + from2, to - from2);
|
|
264168
264187
|
},
|
|
264169
264188
|
set(data2, start2 = 0) {
|
|
264170
264189
|
for (let i2 = 0; i2 < data2.length; i2++) {
|
|
@@ -264176,11 +264195,11 @@ function object_array_view$1(arr, offset2 = 0, size2) {
|
|
|
264176
264195
|
}
|
|
264177
264196
|
};
|
|
264178
264197
|
}
|
|
264179
|
-
function compat_chunk
|
|
264198
|
+
function compat_chunk(arr) {
|
|
264180
264199
|
if (globalThis.Array.isArray(arr.data)) {
|
|
264181
264200
|
return {
|
|
264182
264201
|
// @ts-expect-error
|
|
264183
|
-
data: object_array_view
|
|
264202
|
+
data: object_array_view(arr.data),
|
|
264184
264203
|
stride: arr.stride,
|
|
264185
264204
|
bytes_per_element: 1
|
|
264186
264205
|
};
|
|
@@ -264191,37 +264210,37 @@ function compat_chunk$1(arr) {
|
|
|
264191
264210
|
bytes_per_element: arr.data.BYTES_PER_ELEMENT
|
|
264192
264211
|
};
|
|
264193
264212
|
}
|
|
264194
|
-
function get_typed_array_constructor
|
|
264213
|
+
function get_typed_array_constructor(arr) {
|
|
264195
264214
|
if ("chars" in arr) {
|
|
264196
264215
|
return arr.constructor.bind(null, arr.chars);
|
|
264197
264216
|
}
|
|
264198
264217
|
return arr.constructor;
|
|
264199
264218
|
}
|
|
264200
|
-
function compat_scalar
|
|
264219
|
+
function compat_scalar(arr, value2) {
|
|
264201
264220
|
if (globalThis.Array.isArray(arr.data)) {
|
|
264202
|
-
return object_array_view
|
|
264221
|
+
return object_array_view([value2]);
|
|
264203
264222
|
}
|
|
264204
|
-
let TypedArray2 = get_typed_array_constructor
|
|
264223
|
+
let TypedArray2 = get_typed_array_constructor(arr.data);
|
|
264205
264224
|
let data2 = new TypedArray2([value2]);
|
|
264206
264225
|
return new Uint8Array(data2.buffer, data2.byteOffset, data2.byteLength);
|
|
264207
264226
|
}
|
|
264208
|
-
const setter
|
|
264227
|
+
const setter = {
|
|
264209
264228
|
prepare(data2, shape2, stride) {
|
|
264210
264229
|
return { data: data2, shape: shape2, stride };
|
|
264211
264230
|
},
|
|
264212
264231
|
set_scalar(dest, sel, value2) {
|
|
264213
|
-
let view = compat_chunk
|
|
264214
|
-
set_scalar_binary
|
|
264232
|
+
let view = compat_chunk(dest);
|
|
264233
|
+
set_scalar_binary(view, sel, compat_scalar(dest, value2), view.bytes_per_element);
|
|
264215
264234
|
},
|
|
264216
264235
|
set_from_chunk(dest, src, projections2) {
|
|
264217
|
-
let view = compat_chunk
|
|
264218
|
-
set_from_chunk_binary
|
|
264236
|
+
let view = compat_chunk(dest);
|
|
264237
|
+
set_from_chunk_binary(view, compat_chunk(src), view.bytes_per_element, projections2);
|
|
264219
264238
|
}
|
|
264220
264239
|
};
|
|
264221
|
-
async function get$
|
|
264222
|
-
return get$
|
|
264240
|
+
async function get$a(arr, selection = null, opts2 = {}) {
|
|
264241
|
+
return get$b(arr, selection, opts2, setter);
|
|
264223
264242
|
}
|
|
264224
|
-
function indices_len
|
|
264243
|
+
function indices_len(start2, stop3, step) {
|
|
264225
264244
|
if (step < 0 && stop3 < start2) {
|
|
264226
264245
|
return Math.floor((start2 - stop3 - 1) / -step) + 1;
|
|
264227
264246
|
}
|
|
@@ -264229,7 +264248,7 @@ function indices_len$1(start2, stop3, step) {
|
|
|
264229
264248
|
return Math.floor((stop3 - start2 - 1) / step) + 1;
|
|
264230
264249
|
return 0;
|
|
264231
264250
|
}
|
|
264232
|
-
function set_scalar_binary
|
|
264251
|
+
function set_scalar_binary(out, out_selection, value2, bytes_per_element2) {
|
|
264233
264252
|
if (out_selection.length === 0) {
|
|
264234
264253
|
out.data.set(value2, 0);
|
|
264235
264254
|
return;
|
|
@@ -264238,11 +264257,11 @@ function set_scalar_binary$1(out, out_selection, value2, bytes_per_element2) {
|
|
|
264238
264257
|
const [curr_stride, ...stride] = out.stride;
|
|
264239
264258
|
if (typeof slice2 === "number") {
|
|
264240
264259
|
const data2 = out.data.subarray(curr_stride * slice2 * bytes_per_element2);
|
|
264241
|
-
set_scalar_binary
|
|
264260
|
+
set_scalar_binary({ data: data2, stride }, slices, value2, bytes_per_element2);
|
|
264242
264261
|
return;
|
|
264243
264262
|
}
|
|
264244
264263
|
const [from2, to, step] = slice2;
|
|
264245
|
-
const len2 = indices_len
|
|
264264
|
+
const len2 = indices_len(from2, to, step);
|
|
264246
264265
|
if (slices.length === 0) {
|
|
264247
264266
|
for (let i2 = 0; i2 < len2; i2++) {
|
|
264248
264267
|
out.data.set(value2, curr_stride * (from2 + step * i2) * bytes_per_element2);
|
|
@@ -264251,10 +264270,10 @@ function set_scalar_binary$1(out, out_selection, value2, bytes_per_element2) {
|
|
|
264251
264270
|
}
|
|
264252
264271
|
for (let i2 = 0; i2 < len2; i2++) {
|
|
264253
264272
|
const data2 = out.data.subarray(curr_stride * (from2 + step * i2) * bytes_per_element2);
|
|
264254
|
-
set_scalar_binary
|
|
264273
|
+
set_scalar_binary({ data: data2, stride }, slices, value2, bytes_per_element2);
|
|
264255
264274
|
}
|
|
264256
264275
|
}
|
|
264257
|
-
function set_from_chunk_binary
|
|
264276
|
+
function set_from_chunk_binary(dest, src, bytes_per_element2, projections2) {
|
|
264258
264277
|
const [proj, ...projs] = projections2;
|
|
264259
264278
|
const [dstride, ...dstrides] = dest.stride;
|
|
264260
264279
|
const [sstride, ...sstrides] = src.stride;
|
|
@@ -264263,7 +264282,7 @@ function set_from_chunk_binary$1(dest, src, bytes_per_element2, projections2) {
|
|
|
264263
264282
|
dest.data.set(src.data.subarray(0, bytes_per_element2), proj.to * bytes_per_element2);
|
|
264264
264283
|
return;
|
|
264265
264284
|
}
|
|
264266
|
-
set_from_chunk_binary
|
|
264285
|
+
set_from_chunk_binary({
|
|
264267
264286
|
data: dest.data.subarray(dstride * proj.to * bytes_per_element2),
|
|
264268
264287
|
stride: dstrides
|
|
264269
264288
|
}, src, bytes_per_element2, projs);
|
|
@@ -264275,7 +264294,7 @@ function set_from_chunk_binary$1(dest, src, bytes_per_element2, projections2) {
|
|
|
264275
264294
|
dest.data.set(src.data.subarray(offset2, offset2 + bytes_per_element2), 0);
|
|
264276
264295
|
return;
|
|
264277
264296
|
}
|
|
264278
|
-
set_from_chunk_binary
|
|
264297
|
+
set_from_chunk_binary(dest, {
|
|
264279
264298
|
data: src.data.subarray(sstride * proj.from * bytes_per_element2),
|
|
264280
264299
|
stride: sstrides
|
|
264281
264300
|
}, bytes_per_element2, projs);
|
|
@@ -264283,7 +264302,7 @@ function set_from_chunk_binary$1(dest, src, bytes_per_element2, projections2) {
|
|
|
264283
264302
|
}
|
|
264284
264303
|
const [from2, to, step] = proj.to;
|
|
264285
264304
|
const [sfrom, _, sstep] = proj.from;
|
|
264286
|
-
const len2 = indices_len
|
|
264305
|
+
const len2 = indices_len(from2, to, step);
|
|
264287
264306
|
if (projs.length === 0) {
|
|
264288
264307
|
if (step === 1 && sstep === 1 && dstride === 1 && sstride === 1) {
|
|
264289
264308
|
let offset2 = sfrom * bytes_per_element2;
|
|
@@ -264298,7 +264317,7 @@ function set_from_chunk_binary$1(dest, src, bytes_per_element2, projections2) {
|
|
|
264298
264317
|
return;
|
|
264299
264318
|
}
|
|
264300
264319
|
for (let i2 = 0; i2 < len2; i2++) {
|
|
264301
|
-
set_from_chunk_binary
|
|
264320
|
+
set_from_chunk_binary({
|
|
264302
264321
|
data: dest.data.subarray(dstride * (from2 + i2 * step) * bytes_per_element2),
|
|
264303
264322
|
stride: dstrides
|
|
264304
264323
|
}, {
|
|
@@ -264323,7 +264342,7 @@ function uri2href(url) {
|
|
|
264323
264342
|
}
|
|
264324
264343
|
throw Error(`Protocol not supported, got: ${JSON.stringify(protocol)}`);
|
|
264325
264344
|
}
|
|
264326
|
-
function fetch_range
|
|
264345
|
+
function fetch_range(url, offset2, length2, opts2 = {}) {
|
|
264327
264346
|
if (offset2 !== void 0 && length2 !== void 0) {
|
|
264328
264347
|
opts2 = {
|
|
264329
264348
|
...opts2,
|
|
@@ -264335,7 +264354,7 @@ function fetch_range$1(url, offset2, length2, opts2 = {}) {
|
|
|
264335
264354
|
}
|
|
264336
264355
|
return fetch(url, opts2);
|
|
264337
264356
|
}
|
|
264338
|
-
function merge_init
|
|
264357
|
+
function merge_init(storeOverrides, requestOverrides) {
|
|
264339
264358
|
return {
|
|
264340
264359
|
...storeOverrides,
|
|
264341
264360
|
...requestOverrides,
|
|
@@ -264349,7 +264368,7 @@ function assert$3(expression2, msg = "") {
|
|
|
264349
264368
|
if (!expression2)
|
|
264350
264369
|
throw new Error(msg);
|
|
264351
264370
|
}
|
|
264352
|
-
function resolve$
|
|
264371
|
+
function resolve$1(root2, path2) {
|
|
264353
264372
|
const base2 = typeof root2 === "string" ? new URL(root2) : root2;
|
|
264354
264373
|
if (!base2.pathname.endsWith("/")) {
|
|
264355
264374
|
base2.pathname += "/";
|
|
@@ -264358,7 +264377,7 @@ function resolve$2(root2, path2) {
|
|
|
264358
264377
|
resolved.search = base2.search;
|
|
264359
264378
|
return resolved;
|
|
264360
264379
|
}
|
|
264361
|
-
async function handle_response
|
|
264380
|
+
async function handle_response(response) {
|
|
264362
264381
|
if (response.status === 404) {
|
|
264363
264382
|
return void 0;
|
|
264364
264383
|
}
|
|
@@ -264367,7 +264386,7 @@ async function handle_response$1(response) {
|
|
|
264367
264386
|
}
|
|
264368
264387
|
throw new Error(`Unexpected response status ${response.status} ${response.statusText}`);
|
|
264369
264388
|
}
|
|
264370
|
-
async function fetch_suffix
|
|
264389
|
+
async function fetch_suffix(url, suffix_length, init2, use_suffix_request) {
|
|
264371
264390
|
if (use_suffix_request) {
|
|
264372
264391
|
return fetch(url, {
|
|
264373
264392
|
...init2,
|
|
@@ -264380,9 +264399,9 @@ async function fetch_suffix$1(url, suffix_length, init2, use_suffix_request) {
|
|
|
264380
264399
|
}
|
|
264381
264400
|
let content_length = response.headers.get("Content-Length");
|
|
264382
264401
|
let length2 = Number(content_length);
|
|
264383
|
-
return fetch_range
|
|
264402
|
+
return fetch_range(url, length2 - suffix_length, length2, init2);
|
|
264384
264403
|
}
|
|
264385
|
-
|
|
264404
|
+
class FetchStore {
|
|
264386
264405
|
constructor(url, options = {}) {
|
|
264387
264406
|
__privateAdd(this, _FetchStore_instances);
|
|
264388
264407
|
__publicField(this, "url");
|
|
@@ -264393,24 +264412,28 @@ let FetchStore$1 = (_x = class {
|
|
|
264393
264412
|
__privateSet(this, _use_suffix_request, options.useSuffixRequest ?? false);
|
|
264394
264413
|
}
|
|
264395
264414
|
async get(key2, options = {}) {
|
|
264396
|
-
let href2 = resolve$
|
|
264415
|
+
let href2 = resolve$1(this.url, key2).href;
|
|
264397
264416
|
let response = await fetch(href2, __privateMethod(this, _FetchStore_instances, merge_init_fn).call(this, options));
|
|
264398
|
-
return handle_response
|
|
264417
|
+
return handle_response(response);
|
|
264399
264418
|
}
|
|
264400
264419
|
async getRange(key2, range2, options = {}) {
|
|
264401
|
-
let url = resolve$
|
|
264420
|
+
let url = resolve$1(this.url, key2);
|
|
264402
264421
|
let init2 = __privateMethod(this, _FetchStore_instances, merge_init_fn).call(this, options);
|
|
264403
264422
|
let response;
|
|
264404
264423
|
if ("suffixLength" in range2) {
|
|
264405
|
-
response = await fetch_suffix
|
|
264424
|
+
response = await fetch_suffix(url, range2.suffixLength, init2, __privateGet(this, _use_suffix_request));
|
|
264406
264425
|
} else {
|
|
264407
|
-
response = await fetch_range
|
|
264426
|
+
response = await fetch_range(url, range2.offset, range2.length, init2);
|
|
264408
264427
|
}
|
|
264409
|
-
return handle_response
|
|
264428
|
+
return handle_response(response);
|
|
264410
264429
|
}
|
|
264411
|
-
}
|
|
264412
|
-
|
|
264413
|
-
|
|
264430
|
+
}
|
|
264431
|
+
_overrides = new WeakMap();
|
|
264432
|
+
_use_suffix_request = new WeakMap();
|
|
264433
|
+
_FetchStore_instances = new WeakSet();
|
|
264434
|
+
merge_init_fn = function(overrides) {
|
|
264435
|
+
return merge_init(__privateGet(this, _overrides), overrides);
|
|
264436
|
+
};
|
|
264414
264437
|
function getV2DataType(dtype) {
|
|
264415
264438
|
const mapping = {
|
|
264416
264439
|
int8: "|i1",
|
|
@@ -264433,9 +264456,9 @@ function createZarrArrayAdapter(arr) {
|
|
|
264433
264456
|
return new Proxy(arr, {
|
|
264434
264457
|
get(target2, prop) {
|
|
264435
264458
|
if (prop === "getRaw") {
|
|
264436
|
-
return (selection) => get$
|
|
264459
|
+
return (selection) => get$a(target2, selection ? selection.map((s2) => {
|
|
264437
264460
|
if (typeof s2 === "object" && s2 !== null) {
|
|
264438
|
-
return slice$
|
|
264461
|
+
return slice$4(s2.start, s2.stop, s2.step);
|
|
264439
264462
|
}
|
|
264440
264463
|
return s2;
|
|
264441
264464
|
}) : target2.shape.map(() => null));
|
|
@@ -265278,7 +265301,7 @@ class HTTPRangeReader {
|
|
|
265278
265301
|
if (size2 === 0) {
|
|
265279
265302
|
return new Uint8Array(0);
|
|
265280
265303
|
}
|
|
265281
|
-
const req = await fetch_range
|
|
265304
|
+
const req = await fetch_range(this.url, offset2, size2, __privateGet(this, _overrides2));
|
|
265282
265305
|
assert$3(req.ok, `failed http request ${this.url}, status: ${req.status} offset: ${offset2} size: ${size2}: ${req.statusText}`);
|
|
265283
265306
|
return new Uint8Array(await req.arrayBuffer());
|
|
265284
265307
|
}
|
|
@@ -265442,13 +265465,13 @@ function parseV1(spec, renderString) {
|
|
|
265442
265465
|
function* iterDims(dimensions) {
|
|
265443
265466
|
const keys2 = Object.keys(dimensions);
|
|
265444
265467
|
const iterables = Object.values(dimensions).map(
|
|
265445
|
-
(i2) => Array.isArray(i2) ? i2 : [...range$
|
|
265468
|
+
(i2) => Array.isArray(i2) ? i2 : [...range$6(i2)]
|
|
265446
265469
|
);
|
|
265447
|
-
for (const values3 of product
|
|
265470
|
+
for (const values3 of product(...iterables)) {
|
|
265448
265471
|
yield Object.fromEntries(keys2.map((key2, i2) => [key2, values3[i2]]));
|
|
265449
265472
|
}
|
|
265450
265473
|
}
|
|
265451
|
-
function* product
|
|
265474
|
+
function* product(...iterables) {
|
|
265452
265475
|
if (iterables.length === 0) {
|
|
265453
265476
|
return;
|
|
265454
265477
|
}
|
|
@@ -265471,7 +265494,7 @@ function* product$1(...iterables) {
|
|
|
265471
265494
|
results[i2] = iterators[i2].next();
|
|
265472
265495
|
}
|
|
265473
265496
|
}
|
|
265474
|
-
function* range$
|
|
265497
|
+
function* range$6({ stop: stop3, start: start2 = 0, step = 1 }) {
|
|
265475
265498
|
for (let i2 = start2; i2 < stop3; i2 += step) {
|
|
265476
265499
|
yield i2;
|
|
265477
265500
|
}
|
|
@@ -265543,7 +265566,7 @@ const _ReferenceStore = class _ReferenceStore {
|
|
|
265543
265566
|
if (!url) {
|
|
265544
265567
|
throw Error(`No url for key ${key2}, and no target url provided.`);
|
|
265545
265568
|
}
|
|
265546
|
-
let res = await fetch_range
|
|
265569
|
+
let res = await fetch_range(uri2href(url), offset2, size2, merge_init(__privateGet(this, _overrides3), opts2));
|
|
265547
265570
|
if (res.status === 200 || res.status === 206) {
|
|
265548
265571
|
return new Uint8Array(await res.arrayBuffer());
|
|
265549
265572
|
}
|
|
@@ -265562,7 +265585,7 @@ _refs = new WeakMap();
|
|
|
265562
265585
|
_opts = new WeakMap();
|
|
265563
265586
|
_overrides3 = new WeakMap();
|
|
265564
265587
|
let ReferenceStore = _ReferenceStore;
|
|
265565
|
-
class RelaxedFetchStore extends FetchStore
|
|
265588
|
+
class RelaxedFetchStore extends FetchStore {
|
|
265566
265589
|
// This allows returning `undefined` for 403 responses,
|
|
265567
265590
|
// as opposed to completely erroring.
|
|
265568
265591
|
// Needed due to https://github.com/manzt/zarrita.js/pull/212
|
|
@@ -265603,7 +265626,7 @@ function zarrOpenRoot(url, fileType, opts2) {
|
|
|
265603
265626
|
} else {
|
|
265604
265627
|
store = new RelaxedFetchStore(url, { overrides: opts2?.requestInit });
|
|
265605
265628
|
}
|
|
265606
|
-
return root
|
|
265629
|
+
return root(store);
|
|
265607
265630
|
}
|
|
265608
265631
|
function prevPowerOf2(x2) {
|
|
265609
265632
|
return 2 ** Math.floor(Math.log2(x2));
|
|
@@ -265622,7 +265645,7 @@ function isAxis(axisOrLabel) {
|
|
|
265622
265645
|
return typeof axisOrLabel[0] !== "string";
|
|
265623
265646
|
}
|
|
265624
265647
|
async function loadMultiscales(root2) {
|
|
265625
|
-
const rootAttrs = (await open
|
|
265648
|
+
const rootAttrs = (await open(root2)).attrs;
|
|
265626
265649
|
let paths = ["0"];
|
|
265627
265650
|
let labels2 = ["t", "c", "z", "y", "x"];
|
|
265628
265651
|
if ("multiscales" in rootAttrs) {
|
|
@@ -265636,7 +265659,7 @@ async function loadMultiscales(root2) {
|
|
|
265636
265659
|
}
|
|
265637
265660
|
}
|
|
265638
265661
|
}
|
|
265639
|
-
const data2 = paths.map((path2) => open
|
|
265662
|
+
const data2 = paths.map((path2) => open(root2.resolve(path2), { kind: "array" }));
|
|
265640
265663
|
return {
|
|
265641
265664
|
data: await Promise.all(data2),
|
|
265642
265665
|
rootAttrs,
|
|
@@ -268165,7 +268188,7 @@ class ErrorBoundary2 extends React__default.Component {
|
|
|
268165
268188
|
}
|
|
268166
268189
|
}
|
|
268167
268190
|
const LazySpatialThree = React__default.lazy(async () => {
|
|
268168
|
-
const { SpatialWrapper: SpatialWrapper2 } = await import("./index-
|
|
268191
|
+
const { SpatialWrapper: SpatialWrapper2 } = await import("./index-9kcg40fJ.js");
|
|
268169
268192
|
return { default: SpatialWrapper2 };
|
|
268170
268193
|
});
|
|
268171
268194
|
const SpatialThreeAdapter = React__default.forwardRef((props, ref2) => jsxRuntimeExports.jsx("div", { ref: ref2, style: { width: "100%", height: "100%" }, children: jsxRuntimeExports.jsx(ErrorBoundary2, { children: jsxRuntimeExports.jsx(Suspense, { fallback: jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: jsxRuntimeExports.jsx(LazySpatialThree, { ...props }) }) }) }));
|
|
@@ -269119,7 +269142,7 @@ const Heatmap$1 = forwardRef$1((props, deckRef) => {
|
|
|
269119
269142
|
}
|
|
269120
269143
|
const curr = backlog[backlog.length - 1];
|
|
269121
269144
|
if (dataRef.current && dataRef.current.buffer.byteLength && expressionRowLookUp.size > 0 && !shouldUsePaddedImplementation(dataRef.current.length)) {
|
|
269122
|
-
const promises = range$
|
|
269145
|
+
const promises = range$d(yTiles).map((i2) => range$d(xTiles).map(async (j) => workerPool.process({
|
|
269123
269146
|
curr,
|
|
269124
269147
|
tileI: i2,
|
|
269125
269148
|
tileJ: j,
|
|
@@ -269228,7 +269251,7 @@ const Heatmap$1 = forwardRef$1((props, deckRef) => {
|
|
|
269228
269251
|
});
|
|
269229
269252
|
};
|
|
269230
269253
|
const cellOrdering = transpose2 ? axisTopLabels : axisLeftLabels;
|
|
269231
|
-
const layers3 = range$
|
|
269254
|
+
const layers3 = range$d(yTiles * xTiles).map((index2) => getLayer2(Math.floor(index2 / xTiles), index2 % xTiles));
|
|
269232
269255
|
return layers3;
|
|
269233
269256
|
}
|
|
269234
269257
|
function getLayer(i2, j, tile) {
|
|
@@ -269380,10 +269403,10 @@ const Heatmap$1 = forwardRef$1((props, deckRef) => {
|
|
|
269380
269403
|
const cellOrdering = transpose2 ? axisTopLabels : axisLeftLabels;
|
|
269381
269404
|
const colorBarTileWidthPx = transpose2 ? TILE_SIZE : 1;
|
|
269382
269405
|
const colorBarTileHeightPx = transpose2 ? 1 : TILE_SIZE;
|
|
269383
|
-
const result = range$
|
|
269384
|
-
const trackResult = range$
|
|
269406
|
+
const result = range$d(numCellColorTracks).map((track) => {
|
|
269407
|
+
const trackResult = range$d(transpose2 ? xTiles : yTiles).map((i2) => {
|
|
269385
269408
|
const tileData = new Uint8ClampedArray(TILE_SIZE * 1 * 4);
|
|
269386
|
-
range$
|
|
269409
|
+
range$d(TILE_SIZE).forEach((tileY) => {
|
|
269387
269410
|
rowI = i2 * TILE_SIZE + tileY;
|
|
269388
269411
|
if (rowI < cellOrdering.length) {
|
|
269389
269412
|
cellId = cellOrdering[rowI];
|
|
@@ -269513,7 +269536,7 @@ const Heatmap$1 = forwardRef$1((props, deckRef) => {
|
|
|
269513
269536
|
}
|
|
269514
269537
|
}
|
|
269515
269538
|
const cellColorsViews = useMemo$1(() => {
|
|
269516
|
-
const result = range$
|
|
269539
|
+
const result = range$d(numCellColorTracks).map((track) => {
|
|
269517
269540
|
let view;
|
|
269518
269541
|
if (transpose2) {
|
|
269519
269542
|
view = new OrthographicView({
|
|
@@ -276916,7 +276939,7 @@ function LayerOptions({ colormap, opacity: opacity2, handleColormapChange, handl
|
|
|
276916
276939
|
const domainSelectorId = $bdb11010cef70236$export$f680877a34711e37();
|
|
276917
276940
|
const opacitySliderId = $bdb11010cef70236$export$f680877a34711e37();
|
|
276918
276941
|
const zeroTransparentId = $bdb11010cef70236$export$f680877a34711e37();
|
|
276919
|
-
return jsxRuntimeExports.jsxs(Grid$1, { container: true, direction: "column", sx: { width: "100%" }, children: [hasZStack && !disable3d && hasViewableResolutions && jsxRuntimeExports.jsx(VolumeDropdown, { loader: loader2, handleSliderChange, handleDomainChange, channels: channels2, handleMultiPropertyChange, resolution, disable3d, setRasterLayerCallback, setAreAllChannelsLoading, setViewState, spatialHeight, spatialWidth, use3d, modelMatrix: modelMatrix2 }), hasDimensionsAndChannels && !use3d && globalControlLabels.map((field2) => shape2[labels2.indexOf(field2)] > 1 && jsxRuntimeExports.jsx(LayerOption, { name: field2, inputId: `${field2}-${globalSelectionSliderId}`, children: jsxRuntimeExports.jsx(GlobalSelectionSlider, { field: field2, inputId: `${field2}-${globalSelectionSliderId}`, value: globalLabelValues[field2], handleChange: handleGlobalChannelsSelectionChange, possibleValues: range$
|
|
276942
|
+
return jsxRuntimeExports.jsxs(Grid$1, { container: true, direction: "column", sx: { width: "100%" }, children: [hasZStack && !disable3d && hasViewableResolutions && jsxRuntimeExports.jsx(VolumeDropdown, { loader: loader2, handleSliderChange, handleDomainChange, channels: channels2, handleMultiPropertyChange, resolution, disable3d, setRasterLayerCallback, setAreAllChannelsLoading, setViewState, spatialHeight, spatialWidth, use3d, modelMatrix: modelMatrix2 }), hasDimensionsAndChannels && !use3d && globalControlLabels.map((field2) => shape2[labels2.indexOf(field2)] > 1 && jsxRuntimeExports.jsx(LayerOption, { name: field2, inputId: `${field2}-${globalSelectionSliderId}`, children: jsxRuntimeExports.jsx(GlobalSelectionSlider, { field: field2, inputId: `${field2}-${globalSelectionSliderId}`, value: globalLabelValues[field2], handleChange: handleGlobalChannelsSelectionChange, possibleValues: range$d(shape2[labels2.indexOf(field2)]) }) }, field2)), !disableChannelsIfRgbDetected ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [shouldShowColormap && jsxRuntimeExports.jsx(Grid$1, { children: jsxRuntimeExports.jsx(LayerOption, { name: "Colormap", inputId: colormapSelectId, children: jsxRuntimeExports.jsx(ColormapSelect, { value: colormap || "", inputId: colormapSelectId, handleChange: handleColormapChange }) }) }), shouldShowDomain && jsxRuntimeExports.jsx(Grid$1, { children: jsxRuntimeExports.jsx(LayerOption, { name: "Domain", inputId: domainSelectorId, children: jsxRuntimeExports.jsx(SliderDomainSelector, { value: domainType || DEFAULT_RASTER_DOMAIN_TYPE, inputId: domainSelectorId, handleChange: (value2) => {
|
|
276920
276943
|
handleDomainChange(value2);
|
|
276921
276944
|
} }) }) })] }) : null, !use3d && jsxRuntimeExports.jsx(Grid$1, { children: jsxRuntimeExports.jsx(LayerOption, { name: "Opacity", inputId: opacitySliderId, children: jsxRuntimeExports.jsx(OpacitySlider, { value: opacity2, handleChange: handleOpacityChange, inputId: opacitySliderId }) }) }), shouldShowTransparentColor && !use3d && jsxRuntimeExports.jsx(Grid$1, { children: jsxRuntimeExports.jsx(LayerOption, { name: "Zero Transparent", inputId: zeroTransparentId, children: jsxRuntimeExports.jsx(TransparentColorCheckbox, { value: transparentColor, handleChange: handleTransparentColorChange, inputId: zeroTransparentId }) }) })] });
|
|
276922
276945
|
}
|
|
@@ -278424,1492 +278447,6 @@ const register = (definition2, options = {}) => {
|
|
|
278424
278447
|
registerDataFetcher(definition2, options);
|
|
278425
278448
|
}
|
|
278426
278449
|
};
|
|
278427
|
-
class NodeNotFoundError2 extends Error {
|
|
278428
|
-
constructor(context2, options = {}) {
|
|
278429
|
-
super(`Node not found: ${context2}`, options);
|
|
278430
|
-
this.name = "NodeNotFoundError";
|
|
278431
|
-
}
|
|
278432
|
-
}
|
|
278433
|
-
class KeyError2 extends Error {
|
|
278434
|
-
constructor(path2) {
|
|
278435
|
-
super(`Missing key: ${path2}`);
|
|
278436
|
-
this.name = "KeyError";
|
|
278437
|
-
}
|
|
278438
|
-
}
|
|
278439
|
-
class BoolArray {
|
|
278440
|
-
constructor(x2, byteOffset, length2) {
|
|
278441
|
-
__privateAdd(this, _bytes2);
|
|
278442
|
-
if (typeof x2 === "number") {
|
|
278443
|
-
__privateSet(this, _bytes2, new Uint8Array(x2));
|
|
278444
|
-
} else if (x2 instanceof ArrayBuffer) {
|
|
278445
|
-
__privateSet(this, _bytes2, new Uint8Array(x2, byteOffset, length2));
|
|
278446
|
-
} else {
|
|
278447
|
-
__privateSet(this, _bytes2, new Uint8Array(Array.from(x2, (v) => v ? 1 : 0)));
|
|
278448
|
-
}
|
|
278449
|
-
}
|
|
278450
|
-
get BYTES_PER_ELEMENT() {
|
|
278451
|
-
return 1;
|
|
278452
|
-
}
|
|
278453
|
-
get byteOffset() {
|
|
278454
|
-
return __privateGet(this, _bytes2).byteOffset;
|
|
278455
|
-
}
|
|
278456
|
-
get byteLength() {
|
|
278457
|
-
return __privateGet(this, _bytes2).byteLength;
|
|
278458
|
-
}
|
|
278459
|
-
/** @type {ArrayBuffer} */
|
|
278460
|
-
get buffer() {
|
|
278461
|
-
return __privateGet(this, _bytes2).buffer;
|
|
278462
|
-
}
|
|
278463
|
-
/** @type {number} */
|
|
278464
|
-
get length() {
|
|
278465
|
-
return __privateGet(this, _bytes2).length;
|
|
278466
|
-
}
|
|
278467
|
-
get(idx) {
|
|
278468
|
-
let value2 = __privateGet(this, _bytes2)[idx];
|
|
278469
|
-
return typeof value2 === "number" ? value2 !== 0 : value2;
|
|
278470
|
-
}
|
|
278471
|
-
set(idx, value2) {
|
|
278472
|
-
__privateGet(this, _bytes2)[idx] = value2 ? 1 : 0;
|
|
278473
|
-
}
|
|
278474
|
-
fill(value2) {
|
|
278475
|
-
__privateGet(this, _bytes2).fill(value2 ? 1 : 0);
|
|
278476
|
-
}
|
|
278477
|
-
*[Symbol.iterator]() {
|
|
278478
|
-
for (let i2 = 0; i2 < this.length; i2++) {
|
|
278479
|
-
yield this.get(i2);
|
|
278480
|
-
}
|
|
278481
|
-
}
|
|
278482
|
-
}
|
|
278483
|
-
_bytes2 = new WeakMap();
|
|
278484
|
-
class ByteStringArray {
|
|
278485
|
-
constructor(chars, x2, byteOffset, length2) {
|
|
278486
|
-
__publicField(this, "_data");
|
|
278487
|
-
__publicField(this, "chars");
|
|
278488
|
-
__privateAdd(this, _encoder2);
|
|
278489
|
-
this.chars = chars;
|
|
278490
|
-
__privateSet(this, _encoder2, new TextEncoder());
|
|
278491
|
-
if (typeof x2 === "number") {
|
|
278492
|
-
this._data = new Uint8Array(x2 * chars);
|
|
278493
|
-
} else if (x2 instanceof ArrayBuffer) {
|
|
278494
|
-
if (length2)
|
|
278495
|
-
length2 = length2 * chars;
|
|
278496
|
-
this._data = new Uint8Array(x2, byteOffset, length2);
|
|
278497
|
-
} else {
|
|
278498
|
-
let values3 = Array.from(x2);
|
|
278499
|
-
this._data = new Uint8Array(values3.length * chars);
|
|
278500
|
-
for (let i2 = 0; i2 < values3.length; i2++) {
|
|
278501
|
-
this.set(i2, values3[i2]);
|
|
278502
|
-
}
|
|
278503
|
-
}
|
|
278504
|
-
}
|
|
278505
|
-
get BYTES_PER_ELEMENT() {
|
|
278506
|
-
return this.chars;
|
|
278507
|
-
}
|
|
278508
|
-
get byteOffset() {
|
|
278509
|
-
return this._data.byteOffset;
|
|
278510
|
-
}
|
|
278511
|
-
get byteLength() {
|
|
278512
|
-
return this._data.byteLength;
|
|
278513
|
-
}
|
|
278514
|
-
/** @type {ArrayBuffer} */
|
|
278515
|
-
get buffer() {
|
|
278516
|
-
return this._data.buffer;
|
|
278517
|
-
}
|
|
278518
|
-
/** @type {number} */
|
|
278519
|
-
get length() {
|
|
278520
|
-
return this.byteLength / this.BYTES_PER_ELEMENT;
|
|
278521
|
-
}
|
|
278522
|
-
get(idx) {
|
|
278523
|
-
const view = new Uint8Array(this.buffer, this.byteOffset + this.chars * idx, this.chars);
|
|
278524
|
-
return new TextDecoder().decode(view).replace(/\x00/g, "");
|
|
278525
|
-
}
|
|
278526
|
-
set(idx, value2) {
|
|
278527
|
-
const view = new Uint8Array(this.buffer, this.byteOffset + this.chars * idx, this.chars);
|
|
278528
|
-
view.fill(0);
|
|
278529
|
-
view.set(__privateGet(this, _encoder2).encode(value2));
|
|
278530
|
-
}
|
|
278531
|
-
fill(value2) {
|
|
278532
|
-
const encoded = __privateGet(this, _encoder2).encode(value2);
|
|
278533
|
-
for (let i2 = 0; i2 < this.length; i2++) {
|
|
278534
|
-
this._data.set(encoded, i2 * this.chars);
|
|
278535
|
-
}
|
|
278536
|
-
}
|
|
278537
|
-
*[Symbol.iterator]() {
|
|
278538
|
-
for (let i2 = 0; i2 < this.length; i2++) {
|
|
278539
|
-
yield this.get(i2);
|
|
278540
|
-
}
|
|
278541
|
-
}
|
|
278542
|
-
}
|
|
278543
|
-
_encoder2 = new WeakMap();
|
|
278544
|
-
const _UnicodeStringArray = class _UnicodeStringArray {
|
|
278545
|
-
constructor(chars, x2, byteOffset, length2) {
|
|
278546
|
-
__privateAdd(this, _data2);
|
|
278547
|
-
__publicField(this, "chars");
|
|
278548
|
-
this.chars = chars;
|
|
278549
|
-
if (typeof x2 === "number") {
|
|
278550
|
-
__privateSet(this, _data2, new Int32Array(x2 * chars));
|
|
278551
|
-
} else if (x2 instanceof ArrayBuffer) {
|
|
278552
|
-
if (length2)
|
|
278553
|
-
length2 *= chars;
|
|
278554
|
-
__privateSet(this, _data2, new Int32Array(x2, byteOffset, length2));
|
|
278555
|
-
} else {
|
|
278556
|
-
const values3 = x2;
|
|
278557
|
-
const d = new _UnicodeStringArray(chars, 1);
|
|
278558
|
-
__privateSet(this, _data2, new Int32Array(function* () {
|
|
278559
|
-
for (let str of values3) {
|
|
278560
|
-
d.set(0, str);
|
|
278561
|
-
yield* __privateGet(d, _data2);
|
|
278562
|
-
}
|
|
278563
|
-
}()));
|
|
278564
|
-
}
|
|
278565
|
-
}
|
|
278566
|
-
get BYTES_PER_ELEMENT() {
|
|
278567
|
-
return __privateGet(this, _data2).BYTES_PER_ELEMENT * this.chars;
|
|
278568
|
-
}
|
|
278569
|
-
get byteLength() {
|
|
278570
|
-
return __privateGet(this, _data2).byteLength;
|
|
278571
|
-
}
|
|
278572
|
-
get byteOffset() {
|
|
278573
|
-
return __privateGet(this, _data2).byteOffset;
|
|
278574
|
-
}
|
|
278575
|
-
/** @type {ArrayBuffer} */
|
|
278576
|
-
get buffer() {
|
|
278577
|
-
return __privateGet(this, _data2).buffer;
|
|
278578
|
-
}
|
|
278579
|
-
/** @type {number} */
|
|
278580
|
-
get length() {
|
|
278581
|
-
return __privateGet(this, _data2).length / this.chars;
|
|
278582
|
-
}
|
|
278583
|
-
get(idx) {
|
|
278584
|
-
const offset2 = this.chars * idx;
|
|
278585
|
-
let result = "";
|
|
278586
|
-
for (let i2 = 0; i2 < this.chars; i2++) {
|
|
278587
|
-
result += String.fromCodePoint(__privateGet(this, _data2)[offset2 + i2]);
|
|
278588
|
-
}
|
|
278589
|
-
return result.replace(/\u0000/g, "");
|
|
278590
|
-
}
|
|
278591
|
-
set(idx, value2) {
|
|
278592
|
-
const offset2 = this.chars * idx;
|
|
278593
|
-
const view = __privateGet(this, _data2).subarray(offset2, offset2 + this.chars);
|
|
278594
|
-
view.fill(0);
|
|
278595
|
-
for (let i2 = 0; i2 < this.chars; i2++) {
|
|
278596
|
-
view[i2] = value2.codePointAt(i2) ?? 0;
|
|
278597
|
-
}
|
|
278598
|
-
}
|
|
278599
|
-
fill(value2) {
|
|
278600
|
-
this.set(0, value2);
|
|
278601
|
-
let encoded = __privateGet(this, _data2).subarray(0, this.chars);
|
|
278602
|
-
for (let i2 = 1; i2 < this.length; i2++) {
|
|
278603
|
-
__privateGet(this, _data2).set(encoded, i2 * this.chars);
|
|
278604
|
-
}
|
|
278605
|
-
}
|
|
278606
|
-
*[Symbol.iterator]() {
|
|
278607
|
-
for (let i2 = 0; i2 < this.length; i2++) {
|
|
278608
|
-
yield this.get(i2);
|
|
278609
|
-
}
|
|
278610
|
-
}
|
|
278611
|
-
};
|
|
278612
|
-
_data2 = new WeakMap();
|
|
278613
|
-
let UnicodeStringArray = _UnicodeStringArray;
|
|
278614
|
-
function json_decode_object(bytes) {
|
|
278615
|
-
const str = new TextDecoder().decode(bytes);
|
|
278616
|
-
return JSON.parse(str);
|
|
278617
|
-
}
|
|
278618
|
-
function byteswap_inplace(view, bytes_per_element2) {
|
|
278619
|
-
const numFlips = bytes_per_element2 / 2;
|
|
278620
|
-
const endByteIndex = bytes_per_element2 - 1;
|
|
278621
|
-
let t4 = 0;
|
|
278622
|
-
for (let i2 = 0; i2 < view.length; i2 += bytes_per_element2) {
|
|
278623
|
-
for (let j = 0; j < numFlips; j += 1) {
|
|
278624
|
-
t4 = view[i2 + j];
|
|
278625
|
-
view[i2 + j] = view[i2 + endByteIndex - j];
|
|
278626
|
-
view[i2 + endByteIndex - j] = t4;
|
|
278627
|
-
}
|
|
278628
|
-
}
|
|
278629
|
-
}
|
|
278630
|
-
const CONSTRUCTORS = {
|
|
278631
|
-
int8: Int8Array,
|
|
278632
|
-
int16: Int16Array,
|
|
278633
|
-
int32: Int32Array,
|
|
278634
|
-
int64: globalThis.BigInt64Array,
|
|
278635
|
-
uint8: Uint8Array,
|
|
278636
|
-
uint16: Uint16Array,
|
|
278637
|
-
uint32: Uint32Array,
|
|
278638
|
-
uint64: globalThis.BigUint64Array,
|
|
278639
|
-
float32: Float32Array,
|
|
278640
|
-
float64: Float64Array,
|
|
278641
|
-
bool: BoolArray
|
|
278642
|
-
};
|
|
278643
|
-
const V2_STRING_REGEX = /v2:([US])(\d+)/;
|
|
278644
|
-
function get_ctr(data_type) {
|
|
278645
|
-
if (data_type === "v2:object") {
|
|
278646
|
-
return globalThis.Array;
|
|
278647
|
-
}
|
|
278648
|
-
let match2 = data_type.match(V2_STRING_REGEX);
|
|
278649
|
-
if (match2) {
|
|
278650
|
-
let [, kind, chars] = match2;
|
|
278651
|
-
return (kind === "U" ? UnicodeStringArray : ByteStringArray).bind(null, Number(chars));
|
|
278652
|
-
}
|
|
278653
|
-
let ctr = CONSTRUCTORS[data_type];
|
|
278654
|
-
if (!ctr) {
|
|
278655
|
-
throw new Error(`Unknown or unsupported data_type: ${data_type}`);
|
|
278656
|
-
}
|
|
278657
|
-
return ctr;
|
|
278658
|
-
}
|
|
278659
|
-
function get_strides(shape2, order2) {
|
|
278660
|
-
return (order2 === "C" ? row_major_stride : col_major_stride)(shape2);
|
|
278661
|
-
}
|
|
278662
|
-
function row_major_stride(shape2) {
|
|
278663
|
-
const ndim = shape2.length;
|
|
278664
|
-
const stride = globalThis.Array(ndim);
|
|
278665
|
-
for (let i2 = ndim - 1, step = 1; i2 >= 0; i2--) {
|
|
278666
|
-
stride[i2] = step;
|
|
278667
|
-
step *= shape2[i2];
|
|
278668
|
-
}
|
|
278669
|
-
return stride;
|
|
278670
|
-
}
|
|
278671
|
-
function col_major_stride(shape2) {
|
|
278672
|
-
const ndim = shape2.length;
|
|
278673
|
-
const stride = globalThis.Array(ndim);
|
|
278674
|
-
for (let i2 = 0, step = 1; i2 < ndim; i2++) {
|
|
278675
|
-
stride[i2] = step;
|
|
278676
|
-
step *= shape2[i2];
|
|
278677
|
-
}
|
|
278678
|
-
return stride;
|
|
278679
|
-
}
|
|
278680
|
-
function create_chunk_key_encoder({ name: name2, configuration: configuration2 }) {
|
|
278681
|
-
if (name2 === "default") {
|
|
278682
|
-
const separator = configuration2?.separator ?? "/";
|
|
278683
|
-
return (chunk_coords) => ["c", ...chunk_coords].join(separator);
|
|
278684
|
-
}
|
|
278685
|
-
if (name2 === "v2") {
|
|
278686
|
-
const separator = configuration2?.separator ?? ".";
|
|
278687
|
-
return (chunk_coords) => chunk_coords.join(separator) || "0";
|
|
278688
|
-
}
|
|
278689
|
-
throw new Error(`Unknown chunk key encoding: ${name2}`);
|
|
278690
|
-
}
|
|
278691
|
-
function get_array_order(codecs) {
|
|
278692
|
-
const maybe_transpose_codec = codecs.find((c2) => c2.name === "transpose");
|
|
278693
|
-
return maybe_transpose_codec?.configuration?.order === "F" ? "F" : "C";
|
|
278694
|
-
}
|
|
278695
|
-
const endian_regex = /^([<|>])(.*)$/;
|
|
278696
|
-
function coerce_dtype(dtype) {
|
|
278697
|
-
if (dtype === "|O") {
|
|
278698
|
-
return { data_type: "v2:object" };
|
|
278699
|
-
}
|
|
278700
|
-
let match2 = dtype.match(endian_regex);
|
|
278701
|
-
if (!match2) {
|
|
278702
|
-
throw new Error(`Invalid dtype: ${dtype}`);
|
|
278703
|
-
}
|
|
278704
|
-
let [, endian, rest] = match2;
|
|
278705
|
-
let data_type = {
|
|
278706
|
-
b1: "bool",
|
|
278707
|
-
i1: "int8",
|
|
278708
|
-
u1: "uint8",
|
|
278709
|
-
i2: "int16",
|
|
278710
|
-
u2: "uint16",
|
|
278711
|
-
i4: "int32",
|
|
278712
|
-
u4: "uint32",
|
|
278713
|
-
i8: "int64",
|
|
278714
|
-
u8: "uint64",
|
|
278715
|
-
f4: "float32",
|
|
278716
|
-
f8: "float64"
|
|
278717
|
-
}[rest] ?? (rest.startsWith("S") || rest.startsWith("U") ? `v2:${rest}` : void 0);
|
|
278718
|
-
if (!data_type) {
|
|
278719
|
-
throw new Error(`Unsupported or unknown dtype: ${dtype}`);
|
|
278720
|
-
}
|
|
278721
|
-
if (endian === "|") {
|
|
278722
|
-
return { data_type };
|
|
278723
|
-
}
|
|
278724
|
-
return { data_type, endian: endian === "<" ? "little" : "big" };
|
|
278725
|
-
}
|
|
278726
|
-
function v2_to_v3_array_metadata(meta, attributes = {}) {
|
|
278727
|
-
let codecs = [];
|
|
278728
|
-
let dtype = coerce_dtype(meta.dtype);
|
|
278729
|
-
if (meta.order === "F") {
|
|
278730
|
-
codecs.push({ name: "transpose", configuration: { order: "F" } });
|
|
278731
|
-
}
|
|
278732
|
-
if ("endian" in dtype && dtype.endian === "big") {
|
|
278733
|
-
codecs.push({ name: "bytes", configuration: { endian: "big" } });
|
|
278734
|
-
}
|
|
278735
|
-
for (let { id: id2, ...configuration2 } of meta.filters ?? []) {
|
|
278736
|
-
codecs.push({ name: id2, configuration: configuration2 });
|
|
278737
|
-
}
|
|
278738
|
-
if (meta.compressor) {
|
|
278739
|
-
let { id: id2, ...configuration2 } = meta.compressor;
|
|
278740
|
-
codecs.push({ name: id2, configuration: configuration2 });
|
|
278741
|
-
}
|
|
278742
|
-
return {
|
|
278743
|
-
zarr_format: 3,
|
|
278744
|
-
node_type: "array",
|
|
278745
|
-
shape: meta.shape,
|
|
278746
|
-
data_type: dtype.data_type,
|
|
278747
|
-
chunk_grid: {
|
|
278748
|
-
name: "regular",
|
|
278749
|
-
configuration: {
|
|
278750
|
-
chunk_shape: meta.chunks
|
|
278751
|
-
}
|
|
278752
|
-
},
|
|
278753
|
-
chunk_key_encoding: {
|
|
278754
|
-
name: "v2",
|
|
278755
|
-
configuration: {
|
|
278756
|
-
separator: meta.dimension_separator ?? "."
|
|
278757
|
-
}
|
|
278758
|
-
},
|
|
278759
|
-
codecs,
|
|
278760
|
-
fill_value: meta.fill_value,
|
|
278761
|
-
attributes
|
|
278762
|
-
};
|
|
278763
|
-
}
|
|
278764
|
-
function v2_to_v3_group_metadata(_meta2, attributes = {}) {
|
|
278765
|
-
return {
|
|
278766
|
-
zarr_format: 3,
|
|
278767
|
-
node_type: "group",
|
|
278768
|
-
attributes
|
|
278769
|
-
};
|
|
278770
|
-
}
|
|
278771
|
-
function is_dtype(dtype, query) {
|
|
278772
|
-
if (query !== "number" && query !== "bigint" && query !== "boolean" && query !== "object" && query !== "string") {
|
|
278773
|
-
return dtype === query;
|
|
278774
|
-
}
|
|
278775
|
-
let is_boolean = dtype === "bool";
|
|
278776
|
-
if (query === "boolean")
|
|
278777
|
-
return is_boolean;
|
|
278778
|
-
let is_string = dtype.startsWith("v2:U") || dtype.startsWith("v2:S");
|
|
278779
|
-
if (query === "string")
|
|
278780
|
-
return is_string;
|
|
278781
|
-
let is_bigint = dtype === "int64" || dtype === "uint64";
|
|
278782
|
-
if (query === "bigint")
|
|
278783
|
-
return is_bigint;
|
|
278784
|
-
let is_object = dtype === "v2:object";
|
|
278785
|
-
if (query === "object")
|
|
278786
|
-
return is_object;
|
|
278787
|
-
return !is_string && !is_bigint && !is_boolean && !is_object;
|
|
278788
|
-
}
|
|
278789
|
-
function is_sharding_codec(codec) {
|
|
278790
|
-
return codec?.name === "sharding_indexed";
|
|
278791
|
-
}
|
|
278792
|
-
function ensure_correct_scalar(metadata2) {
|
|
278793
|
-
if ((metadata2.data_type === "uint64" || metadata2.data_type === "int64") && metadata2.fill_value != null) {
|
|
278794
|
-
return BigInt(metadata2.fill_value);
|
|
278795
|
-
}
|
|
278796
|
-
return metadata2.fill_value;
|
|
278797
|
-
}
|
|
278798
|
-
const LITTLE_ENDIAN_OS = system_is_little_endian();
|
|
278799
|
-
function system_is_little_endian() {
|
|
278800
|
-
const a2 = new Uint32Array([305419896]);
|
|
278801
|
-
const b2 = new Uint8Array(a2.buffer, a2.byteOffset, a2.byteLength);
|
|
278802
|
-
return !(b2[0] === 18);
|
|
278803
|
-
}
|
|
278804
|
-
function bytes_per_element(TypedArray2) {
|
|
278805
|
-
if ("BYTES_PER_ELEMENT" in TypedArray2) {
|
|
278806
|
-
return TypedArray2.BYTES_PER_ELEMENT;
|
|
278807
|
-
}
|
|
278808
|
-
return 4;
|
|
278809
|
-
}
|
|
278810
|
-
const _BytesCodec = class _BytesCodec {
|
|
278811
|
-
constructor(configuration2, meta) {
|
|
278812
|
-
__publicField(this, "kind", "array_to_bytes");
|
|
278813
|
-
__privateAdd(this, _strides2);
|
|
278814
|
-
__privateAdd(this, _TypedArray2);
|
|
278815
|
-
__privateAdd(this, _BYTES_PER_ELEMENT2);
|
|
278816
|
-
__privateAdd(this, _shape3);
|
|
278817
|
-
__privateAdd(this, _endian2);
|
|
278818
|
-
__privateSet(this, _endian2, configuration2?.endian);
|
|
278819
|
-
__privateSet(this, _TypedArray2, get_ctr(meta.data_type));
|
|
278820
|
-
__privateSet(this, _shape3, meta.shape);
|
|
278821
|
-
__privateSet(this, _strides2, get_strides(meta.shape, get_array_order(meta.codecs)));
|
|
278822
|
-
const sample = new (__privateGet(this, _TypedArray2))(0);
|
|
278823
|
-
__privateSet(this, _BYTES_PER_ELEMENT2, sample.BYTES_PER_ELEMENT);
|
|
278824
|
-
}
|
|
278825
|
-
static fromConfig(configuration2, meta) {
|
|
278826
|
-
return new _BytesCodec(configuration2, meta);
|
|
278827
|
-
}
|
|
278828
|
-
encode(arr) {
|
|
278829
|
-
let bytes = new Uint8Array(arr.data.buffer);
|
|
278830
|
-
if (LITTLE_ENDIAN_OS && __privateGet(this, _endian2) === "big") {
|
|
278831
|
-
byteswap_inplace(bytes, bytes_per_element(__privateGet(this, _TypedArray2)));
|
|
278832
|
-
}
|
|
278833
|
-
return bytes;
|
|
278834
|
-
}
|
|
278835
|
-
decode(bytes) {
|
|
278836
|
-
if (LITTLE_ENDIAN_OS && __privateGet(this, _endian2) === "big") {
|
|
278837
|
-
byteswap_inplace(bytes, bytes_per_element(__privateGet(this, _TypedArray2)));
|
|
278838
|
-
}
|
|
278839
|
-
return {
|
|
278840
|
-
data: new (__privateGet(this, _TypedArray2))(bytes.buffer, bytes.byteOffset, bytes.byteLength / __privateGet(this, _BYTES_PER_ELEMENT2)),
|
|
278841
|
-
shape: __privateGet(this, _shape3),
|
|
278842
|
-
stride: __privateGet(this, _strides2)
|
|
278843
|
-
};
|
|
278844
|
-
}
|
|
278845
|
-
};
|
|
278846
|
-
_strides2 = new WeakMap();
|
|
278847
|
-
_TypedArray2 = new WeakMap();
|
|
278848
|
-
_BYTES_PER_ELEMENT2 = new WeakMap();
|
|
278849
|
-
_shape3 = new WeakMap();
|
|
278850
|
-
_endian2 = new WeakMap();
|
|
278851
|
-
let BytesCodec = _BytesCodec;
|
|
278852
|
-
class Crc32cCodec2 {
|
|
278853
|
-
constructor() {
|
|
278854
|
-
__publicField(this, "kind", "bytes_to_bytes");
|
|
278855
|
-
}
|
|
278856
|
-
static fromConfig() {
|
|
278857
|
-
return new Crc32cCodec2();
|
|
278858
|
-
}
|
|
278859
|
-
encode(_) {
|
|
278860
|
-
throw new Error("Not implemented");
|
|
278861
|
-
}
|
|
278862
|
-
decode(arr) {
|
|
278863
|
-
return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength - 4);
|
|
278864
|
-
}
|
|
278865
|
-
}
|
|
278866
|
-
function throw_on_nan_replacer(_key, value2) {
|
|
278867
|
-
if (Number.isNaN(value2)) {
|
|
278868
|
-
throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");
|
|
278869
|
-
}
|
|
278870
|
-
if (value2 === Number.POSITIVE_INFINITY) {
|
|
278871
|
-
throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");
|
|
278872
|
-
}
|
|
278873
|
-
if (value2 === Number.NEGATIVE_INFINITY) {
|
|
278874
|
-
throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
|
|
278875
|
-
}
|
|
278876
|
-
return value2;
|
|
278877
|
-
}
|
|
278878
|
-
function sort_keys_replacer(_key, value2) {
|
|
278879
|
-
return value2 instanceof Object && !Array.isArray(value2) ? Object.keys(value2).sort().reduce((sorted, key2) => {
|
|
278880
|
-
sorted[key2] = value2[key2];
|
|
278881
|
-
return sorted;
|
|
278882
|
-
}, {}) : value2;
|
|
278883
|
-
}
|
|
278884
|
-
const _JsonCodec = class _JsonCodec {
|
|
278885
|
-
constructor(configuration2 = {}) {
|
|
278886
|
-
__publicField(this, "configuration");
|
|
278887
|
-
__publicField(this, "kind", "array_to_bytes");
|
|
278888
|
-
__privateAdd(this, _encoder_config2);
|
|
278889
|
-
__privateAdd(this, _decoder_config2);
|
|
278890
|
-
this.configuration = configuration2;
|
|
278891
|
-
const { encoding = "utf-8", skipkeys = false, ensure_ascii = true, check_circular = true, allow_nan = true, sort_keys = true, indent, strict = true } = configuration2;
|
|
278892
|
-
let separators = configuration2.separators;
|
|
278893
|
-
if (!separators) {
|
|
278894
|
-
if (!indent) {
|
|
278895
|
-
separators = [",", ":"];
|
|
278896
|
-
} else {
|
|
278897
|
-
separators = [", ", ": "];
|
|
278898
|
-
}
|
|
278899
|
-
}
|
|
278900
|
-
__privateSet(this, _encoder_config2, {
|
|
278901
|
-
encoding,
|
|
278902
|
-
skipkeys,
|
|
278903
|
-
ensure_ascii,
|
|
278904
|
-
check_circular,
|
|
278905
|
-
allow_nan,
|
|
278906
|
-
indent,
|
|
278907
|
-
separators,
|
|
278908
|
-
sort_keys
|
|
278909
|
-
});
|
|
278910
|
-
__privateSet(this, _decoder_config2, { strict });
|
|
278911
|
-
}
|
|
278912
|
-
static fromConfig(configuration2) {
|
|
278913
|
-
return new _JsonCodec(configuration2);
|
|
278914
|
-
}
|
|
278915
|
-
encode(buf) {
|
|
278916
|
-
const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = __privateGet(this, _encoder_config2);
|
|
278917
|
-
if (encoding !== "utf-8") {
|
|
278918
|
-
throw new Error("JsonCodec does not yet support non-utf-8 encoding.");
|
|
278919
|
-
}
|
|
278920
|
-
const replacer_functions = [];
|
|
278921
|
-
if (!check_circular) {
|
|
278922
|
-
throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");
|
|
278923
|
-
}
|
|
278924
|
-
if (!allow_nan) {
|
|
278925
|
-
replacer_functions.push(throw_on_nan_replacer);
|
|
278926
|
-
}
|
|
278927
|
-
if (sort_keys) {
|
|
278928
|
-
replacer_functions.push(sort_keys_replacer);
|
|
278929
|
-
}
|
|
278930
|
-
const items = Array.from(buf.data);
|
|
278931
|
-
items.push("|O");
|
|
278932
|
-
items.push(buf.shape);
|
|
278933
|
-
let replacer2 = void 0;
|
|
278934
|
-
if (replacer_functions.length) {
|
|
278935
|
-
replacer2 = (key2, value2) => {
|
|
278936
|
-
let new_value = value2;
|
|
278937
|
-
for (let sub_replacer of replacer_functions) {
|
|
278938
|
-
new_value = sub_replacer(key2, new_value);
|
|
278939
|
-
}
|
|
278940
|
-
return new_value;
|
|
278941
|
-
};
|
|
278942
|
-
}
|
|
278943
|
-
let json_str = JSON.stringify(items, replacer2, indent);
|
|
278944
|
-
if (ensure_ascii) {
|
|
278945
|
-
json_str = json_str.replace(/[\u007F-\uFFFF]/g, (chr) => {
|
|
278946
|
-
const full_str = `0000${chr.charCodeAt(0).toString(16)}`;
|
|
278947
|
-
const sub_str = full_str.substring(full_str.length - 4);
|
|
278948
|
-
return `\\u${sub_str}`;
|
|
278949
|
-
});
|
|
278950
|
-
}
|
|
278951
|
-
return new TextEncoder().encode(json_str);
|
|
278952
|
-
}
|
|
278953
|
-
decode(bytes) {
|
|
278954
|
-
const { strict } = __privateGet(this, _decoder_config2);
|
|
278955
|
-
if (!strict) {
|
|
278956
|
-
throw new Error("JsonCodec does not yet support non-strict decoding.");
|
|
278957
|
-
}
|
|
278958
|
-
const items = json_decode_object(bytes);
|
|
278959
|
-
const shape2 = items.pop();
|
|
278960
|
-
items.pop();
|
|
278961
|
-
if (!shape2) {
|
|
278962
|
-
throw new Error("0D not implemented for JsonCodec.");
|
|
278963
|
-
}
|
|
278964
|
-
const stride = get_strides(shape2, "C");
|
|
278965
|
-
const data2 = items;
|
|
278966
|
-
return { data: data2, shape: shape2, stride };
|
|
278967
|
-
}
|
|
278968
|
-
};
|
|
278969
|
-
_encoder_config2 = new WeakMap();
|
|
278970
|
-
_decoder_config2 = new WeakMap();
|
|
278971
|
-
let JsonCodec = _JsonCodec;
|
|
278972
|
-
function proxy(arr) {
|
|
278973
|
-
if (arr instanceof BoolArray || arr instanceof ByteStringArray || arr instanceof UnicodeStringArray) {
|
|
278974
|
-
const arrp = new Proxy(arr, {
|
|
278975
|
-
get(target2, prop) {
|
|
278976
|
-
return target2.get(Number(prop));
|
|
278977
|
-
},
|
|
278978
|
-
set(target2, prop, value2) {
|
|
278979
|
-
target2.set(Number(prop), value2);
|
|
278980
|
-
return true;
|
|
278981
|
-
}
|
|
278982
|
-
});
|
|
278983
|
-
return arrp;
|
|
278984
|
-
}
|
|
278985
|
-
return arr;
|
|
278986
|
-
}
|
|
278987
|
-
function empty_like(chunk, order2) {
|
|
278988
|
-
let data2;
|
|
278989
|
-
if (chunk.data instanceof ByteStringArray || chunk.data instanceof UnicodeStringArray) {
|
|
278990
|
-
data2 = new chunk.constructor(
|
|
278991
|
-
// @ts-expect-error
|
|
278992
|
-
chunk.data.length,
|
|
278993
|
-
chunk.data.chars
|
|
278994
|
-
);
|
|
278995
|
-
} else {
|
|
278996
|
-
data2 = new chunk.constructor(chunk.data.length);
|
|
278997
|
-
}
|
|
278998
|
-
return {
|
|
278999
|
-
data: data2,
|
|
279000
|
-
shape: chunk.shape,
|
|
279001
|
-
stride: get_strides(chunk.shape, order2)
|
|
279002
|
-
};
|
|
279003
|
-
}
|
|
279004
|
-
function convert_array_order(src, target2) {
|
|
279005
|
-
let out = empty_like(src, target2);
|
|
279006
|
-
let n_dims = src.shape.length;
|
|
279007
|
-
let size2 = src.data.length;
|
|
279008
|
-
let index2 = Array(n_dims).fill(0);
|
|
279009
|
-
let src_data = proxy(src.data);
|
|
279010
|
-
let out_data = proxy(out.data);
|
|
279011
|
-
for (let src_idx = 0; src_idx < size2; src_idx++) {
|
|
279012
|
-
let out_idx = 0;
|
|
279013
|
-
for (let dim = 0; dim < n_dims; dim++) {
|
|
279014
|
-
out_idx += index2[dim] * out.stride[dim];
|
|
279015
|
-
}
|
|
279016
|
-
out_data[out_idx] = src_data[src_idx];
|
|
279017
|
-
index2[0] += 1;
|
|
279018
|
-
for (let dim = 0; dim < n_dims; dim++) {
|
|
279019
|
-
if (index2[dim] === src.shape[dim]) {
|
|
279020
|
-
if (dim + 1 === n_dims) {
|
|
279021
|
-
break;
|
|
279022
|
-
}
|
|
279023
|
-
index2[dim] = 0;
|
|
279024
|
-
index2[dim + 1] += 1;
|
|
279025
|
-
}
|
|
279026
|
-
}
|
|
279027
|
-
}
|
|
279028
|
-
return out;
|
|
279029
|
-
}
|
|
279030
|
-
function get_order(arr) {
|
|
279031
|
-
if (!arr.stride)
|
|
279032
|
-
return "C";
|
|
279033
|
-
let row_major_strides = get_strides(arr.shape, "C");
|
|
279034
|
-
return arr.stride.every((s2, i2) => s2 === row_major_strides[i2]) ? "C" : "F";
|
|
279035
|
-
}
|
|
279036
|
-
class TransposeCodec {
|
|
279037
|
-
constructor(configuration2) {
|
|
279038
|
-
__publicField(this, "configuration");
|
|
279039
|
-
__publicField(this, "kind", "array_to_array");
|
|
279040
|
-
this.configuration = configuration2;
|
|
279041
|
-
}
|
|
279042
|
-
static fromConfig(configuration2) {
|
|
279043
|
-
return new TransposeCodec(configuration2);
|
|
279044
|
-
}
|
|
279045
|
-
encode(arr) {
|
|
279046
|
-
if (get_order(arr) === this.configuration?.order) {
|
|
279047
|
-
return arr;
|
|
279048
|
-
}
|
|
279049
|
-
return convert_array_order(arr, this.configuration?.order ?? "C");
|
|
279050
|
-
}
|
|
279051
|
-
decode(arr) {
|
|
279052
|
-
return arr;
|
|
279053
|
-
}
|
|
279054
|
-
}
|
|
279055
|
-
const _VLenUTF8 = class _VLenUTF8 {
|
|
279056
|
-
constructor(shape2) {
|
|
279057
|
-
__publicField(this, "kind", "array_to_bytes");
|
|
279058
|
-
__privateAdd(this, _shape4);
|
|
279059
|
-
__privateAdd(this, _strides3);
|
|
279060
|
-
__privateSet(this, _shape4, shape2);
|
|
279061
|
-
__privateSet(this, _strides3, get_strides(shape2, "C"));
|
|
279062
|
-
}
|
|
279063
|
-
static fromConfig(_, meta) {
|
|
279064
|
-
return new _VLenUTF8(meta.shape);
|
|
279065
|
-
}
|
|
279066
|
-
encode(_chunk) {
|
|
279067
|
-
throw new Error("Method not implemented.");
|
|
279068
|
-
}
|
|
279069
|
-
decode(bytes) {
|
|
279070
|
-
let decoder2 = new TextDecoder();
|
|
279071
|
-
let view = new DataView(bytes.buffer);
|
|
279072
|
-
let data2 = Array(view.getUint32(0, true));
|
|
279073
|
-
let pos = 4;
|
|
279074
|
-
for (let i2 = 0; i2 < data2.length; i2++) {
|
|
279075
|
-
let item_length = view.getUint32(pos, true);
|
|
279076
|
-
pos += 4;
|
|
279077
|
-
data2[i2] = decoder2.decode(bytes.buffer.slice(pos, pos + item_length));
|
|
279078
|
-
pos += item_length;
|
|
279079
|
-
}
|
|
279080
|
-
return { data: data2, shape: __privateGet(this, _shape4), stride: __privateGet(this, _strides3) };
|
|
279081
|
-
}
|
|
279082
|
-
};
|
|
279083
|
-
_shape4 = new WeakMap();
|
|
279084
|
-
_strides3 = new WeakMap();
|
|
279085
|
-
let VLenUTF8 = _VLenUTF8;
|
|
279086
|
-
function create_default_registry() {
|
|
279087
|
-
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BGDKghio.js").then((m2) => m2.default)).set("gzip", () => import("./gzip-BcpOCWcu.js").then((m2) => m2.default)).set("lz4", () => import("./lz4-DTu7K31c.js").then((m2) => m2.default)).set("zlib", () => import("./zlib-ZTk3sZPP.js").then((m2) => m2.default)).set("zstd", () => import("./zstd-DNA9nISO.js").then((m2) => m2.default)).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec2).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec);
|
|
279088
|
-
}
|
|
279089
|
-
const registry = create_default_registry();
|
|
279090
|
-
function create_codec_pipeline(chunk_metadata) {
|
|
279091
|
-
let codecs;
|
|
279092
|
-
return {
|
|
279093
|
-
async encode(chunk) {
|
|
279094
|
-
if (!codecs)
|
|
279095
|
-
codecs = await load_codecs(chunk_metadata);
|
|
279096
|
-
for (const codec of codecs.array_to_array) {
|
|
279097
|
-
chunk = await codec.encode(chunk);
|
|
279098
|
-
}
|
|
279099
|
-
let bytes = await codecs.array_to_bytes.encode(chunk);
|
|
279100
|
-
for (const codec of codecs.bytes_to_bytes) {
|
|
279101
|
-
bytes = await codec.encode(bytes);
|
|
279102
|
-
}
|
|
279103
|
-
return bytes;
|
|
279104
|
-
},
|
|
279105
|
-
async decode(bytes) {
|
|
279106
|
-
if (!codecs)
|
|
279107
|
-
codecs = await load_codecs(chunk_metadata);
|
|
279108
|
-
for (let i2 = codecs.bytes_to_bytes.length - 1; i2 >= 0; i2--) {
|
|
279109
|
-
bytes = await codecs.bytes_to_bytes[i2].decode(bytes);
|
|
279110
|
-
}
|
|
279111
|
-
let chunk = await codecs.array_to_bytes.decode(bytes);
|
|
279112
|
-
for (let i2 = codecs.array_to_array.length - 1; i2 >= 0; i2--) {
|
|
279113
|
-
chunk = await codecs.array_to_array[i2].decode(chunk);
|
|
279114
|
-
}
|
|
279115
|
-
return chunk;
|
|
279116
|
-
}
|
|
279117
|
-
};
|
|
279118
|
-
}
|
|
279119
|
-
async function load_codecs(chunk_meta) {
|
|
279120
|
-
let promises = chunk_meta.codecs.map(async (meta) => {
|
|
279121
|
-
let Codec = await registry.get(meta.name)?.();
|
|
279122
|
-
if (!Codec) {
|
|
279123
|
-
throw new Error(`Unknown codec: ${meta.name}`);
|
|
279124
|
-
}
|
|
279125
|
-
return { Codec, meta };
|
|
279126
|
-
});
|
|
279127
|
-
let array_to_array = [];
|
|
279128
|
-
let array_to_bytes;
|
|
279129
|
-
let bytes_to_bytes = [];
|
|
279130
|
-
for await (let { Codec, meta } of promises) {
|
|
279131
|
-
let codec = Codec.fromConfig(meta.configuration, chunk_meta);
|
|
279132
|
-
switch (codec.kind) {
|
|
279133
|
-
case "array_to_array":
|
|
279134
|
-
array_to_array.push(codec);
|
|
279135
|
-
break;
|
|
279136
|
-
case "array_to_bytes":
|
|
279137
|
-
array_to_bytes = codec;
|
|
279138
|
-
break;
|
|
279139
|
-
default:
|
|
279140
|
-
bytes_to_bytes.push(codec);
|
|
279141
|
-
}
|
|
279142
|
-
}
|
|
279143
|
-
if (!array_to_bytes) {
|
|
279144
|
-
if (!is_typed_array_like_meta(chunk_meta)) {
|
|
279145
|
-
throw new Error(`Cannot encode ${chunk_meta.data_type} to bytes without a codec`);
|
|
279146
|
-
}
|
|
279147
|
-
array_to_bytes = BytesCodec.fromConfig({ endian: "little" }, chunk_meta);
|
|
279148
|
-
}
|
|
279149
|
-
return { array_to_array, array_to_bytes, bytes_to_bytes };
|
|
279150
|
-
}
|
|
279151
|
-
function is_typed_array_like_meta(meta) {
|
|
279152
|
-
return meta.data_type !== "v2:object";
|
|
279153
|
-
}
|
|
279154
|
-
const MAX_BIG_UINT = 18446744073709551615n;
|
|
279155
|
-
function create_sharded_chunk_getter(location, shard_shape, encode_shard_key, sharding_config) {
|
|
279156
|
-
if (location.store.getRange === void 0) {
|
|
279157
|
-
throw new Error("Store does not support range requests");
|
|
279158
|
-
}
|
|
279159
|
-
let get_range = location.store.getRange.bind(location.store);
|
|
279160
|
-
let index_shape = shard_shape.map((d, i2) => d / sharding_config.chunk_shape[i2]);
|
|
279161
|
-
let index_codec = create_codec_pipeline({
|
|
279162
|
-
data_type: "uint64",
|
|
279163
|
-
shape: [...index_shape, 2],
|
|
279164
|
-
codecs: sharding_config.index_codecs
|
|
279165
|
-
});
|
|
279166
|
-
let cache2 = {};
|
|
279167
|
-
return async (chunk_coord) => {
|
|
279168
|
-
let shard_coord = chunk_coord.map((d, i2) => Math.floor(d / index_shape[i2]));
|
|
279169
|
-
let shard_path = location.resolve(encode_shard_key(shard_coord)).path;
|
|
279170
|
-
let index2;
|
|
279171
|
-
if (shard_path in cache2) {
|
|
279172
|
-
index2 = cache2[shard_path];
|
|
279173
|
-
} else {
|
|
279174
|
-
let checksum_size = 4;
|
|
279175
|
-
let index_size = 16 * index_shape.reduce((a2, b2) => a2 * b2, 1);
|
|
279176
|
-
let bytes = await get_range(shard_path, {
|
|
279177
|
-
suffixLength: index_size + checksum_size
|
|
279178
|
-
});
|
|
279179
|
-
index2 = cache2[shard_path] = bytes ? await index_codec.decode(bytes) : null;
|
|
279180
|
-
}
|
|
279181
|
-
if (index2 === null) {
|
|
279182
|
-
return void 0;
|
|
279183
|
-
}
|
|
279184
|
-
let { data: data2, shape: shape2, stride } = index2;
|
|
279185
|
-
let linear_offset = chunk_coord.map((d, i2) => d % shape2[i2]).reduce((acc, sel, idx) => acc + sel * stride[idx], 0);
|
|
279186
|
-
let offset2 = data2[linear_offset];
|
|
279187
|
-
let length2 = data2[linear_offset + 1];
|
|
279188
|
-
if (offset2 === MAX_BIG_UINT && length2 === MAX_BIG_UINT) {
|
|
279189
|
-
return void 0;
|
|
279190
|
-
}
|
|
279191
|
-
return get_range(shard_path, {
|
|
279192
|
-
offset: Number(offset2),
|
|
279193
|
-
length: Number(length2)
|
|
279194
|
-
});
|
|
279195
|
-
};
|
|
279196
|
-
}
|
|
279197
|
-
class Location2 {
|
|
279198
|
-
constructor(store, path2 = "/") {
|
|
279199
|
-
__publicField(this, "store");
|
|
279200
|
-
__publicField(this, "path");
|
|
279201
|
-
this.store = store;
|
|
279202
|
-
this.path = path2;
|
|
279203
|
-
}
|
|
279204
|
-
resolve(path2) {
|
|
279205
|
-
let root2 = new URL(`file://${this.path.endsWith("/") ? this.path : `${this.path}/`}`);
|
|
279206
|
-
return new Location2(this.store, new URL(path2, root2).pathname);
|
|
279207
|
-
}
|
|
279208
|
-
}
|
|
279209
|
-
function root(store) {
|
|
279210
|
-
return new Location2(store ?? /* @__PURE__ */ new Map());
|
|
279211
|
-
}
|
|
279212
|
-
let Group$2 = (_y = class extends Location2 {
|
|
279213
|
-
constructor(store, path2, metadata2) {
|
|
279214
|
-
super(store, path2);
|
|
279215
|
-
__publicField(this, "kind", "group");
|
|
279216
|
-
__privateAdd(this, _metadata3);
|
|
279217
|
-
__privateSet(this, _metadata3, metadata2);
|
|
279218
|
-
}
|
|
279219
|
-
get attrs() {
|
|
279220
|
-
return __privateGet(this, _metadata3).attributes;
|
|
279221
|
-
}
|
|
279222
|
-
}, _metadata3 = new WeakMap(), _y);
|
|
279223
|
-
const CONTEXT_MARKER = Symbol("zarrita.context");
|
|
279224
|
-
function get_context(obj) {
|
|
279225
|
-
return obj[CONTEXT_MARKER];
|
|
279226
|
-
}
|
|
279227
|
-
function create_context(location, metadata2) {
|
|
279228
|
-
let { configuration: configuration2 } = metadata2.codecs.find(is_sharding_codec) ?? {};
|
|
279229
|
-
let shared_context = {
|
|
279230
|
-
encode_chunk_key: create_chunk_key_encoder(metadata2.chunk_key_encoding),
|
|
279231
|
-
TypedArray: get_ctr(metadata2.data_type),
|
|
279232
|
-
fill_value: metadata2.fill_value
|
|
279233
|
-
};
|
|
279234
|
-
if (configuration2) {
|
|
279235
|
-
let native_order2 = get_array_order(configuration2.codecs);
|
|
279236
|
-
return {
|
|
279237
|
-
...shared_context,
|
|
279238
|
-
kind: "sharded",
|
|
279239
|
-
chunk_shape: configuration2.chunk_shape,
|
|
279240
|
-
codec: create_codec_pipeline({
|
|
279241
|
-
data_type: metadata2.data_type,
|
|
279242
|
-
shape: configuration2.chunk_shape,
|
|
279243
|
-
codecs: configuration2.codecs
|
|
279244
|
-
}),
|
|
279245
|
-
get_strides(shape2, order2) {
|
|
279246
|
-
return get_strides(shape2, order2 ?? native_order2);
|
|
279247
|
-
},
|
|
279248
|
-
get_chunk_bytes: create_sharded_chunk_getter(location, metadata2.chunk_grid.configuration.chunk_shape, shared_context.encode_chunk_key, configuration2)
|
|
279249
|
-
};
|
|
279250
|
-
}
|
|
279251
|
-
let native_order = get_array_order(metadata2.codecs);
|
|
279252
|
-
return {
|
|
279253
|
-
...shared_context,
|
|
279254
|
-
kind: "regular",
|
|
279255
|
-
chunk_shape: metadata2.chunk_grid.configuration.chunk_shape,
|
|
279256
|
-
codec: create_codec_pipeline({
|
|
279257
|
-
data_type: metadata2.data_type,
|
|
279258
|
-
shape: metadata2.chunk_grid.configuration.chunk_shape,
|
|
279259
|
-
codecs: metadata2.codecs
|
|
279260
|
-
}),
|
|
279261
|
-
get_strides(shape2, order2) {
|
|
279262
|
-
return get_strides(shape2, order2 ?? native_order);
|
|
279263
|
-
},
|
|
279264
|
-
async get_chunk_bytes(chunk_coords, options) {
|
|
279265
|
-
let chunk_key = shared_context.encode_chunk_key(chunk_coords);
|
|
279266
|
-
let chunk_path = location.resolve(chunk_key).path;
|
|
279267
|
-
return location.store.get(chunk_path, options);
|
|
279268
|
-
}
|
|
279269
|
-
};
|
|
279270
|
-
}
|
|
279271
|
-
let Array$1 = (_B = class extends (_A = Location2, _z2 = CONTEXT_MARKER, _A) {
|
|
279272
|
-
constructor(store, path2, metadata2) {
|
|
279273
|
-
super(store, path2);
|
|
279274
|
-
__publicField(this, "kind", "array");
|
|
279275
|
-
__privateAdd(this, _metadata4);
|
|
279276
|
-
__publicField(this, _z2);
|
|
279277
|
-
__privateSet(this, _metadata4, {
|
|
279278
|
-
...metadata2,
|
|
279279
|
-
fill_value: ensure_correct_scalar(metadata2)
|
|
279280
|
-
});
|
|
279281
|
-
this[CONTEXT_MARKER] = create_context(this, metadata2);
|
|
279282
|
-
}
|
|
279283
|
-
get attrs() {
|
|
279284
|
-
return __privateGet(this, _metadata4).attributes;
|
|
279285
|
-
}
|
|
279286
|
-
get shape() {
|
|
279287
|
-
return __privateGet(this, _metadata4).shape;
|
|
279288
|
-
}
|
|
279289
|
-
get chunks() {
|
|
279290
|
-
return this[CONTEXT_MARKER].chunk_shape;
|
|
279291
|
-
}
|
|
279292
|
-
get dtype() {
|
|
279293
|
-
return __privateGet(this, _metadata4).data_type;
|
|
279294
|
-
}
|
|
279295
|
-
async getChunk(chunk_coords, options) {
|
|
279296
|
-
let context2 = this[CONTEXT_MARKER];
|
|
279297
|
-
let maybe_bytes = await context2.get_chunk_bytes(chunk_coords, options);
|
|
279298
|
-
if (!maybe_bytes) {
|
|
279299
|
-
let size2 = context2.chunk_shape.reduce((a2, b2) => a2 * b2, 1);
|
|
279300
|
-
let data2 = new context2.TypedArray(size2);
|
|
279301
|
-
data2.fill(context2.fill_value);
|
|
279302
|
-
return {
|
|
279303
|
-
data: data2,
|
|
279304
|
-
shape: context2.chunk_shape,
|
|
279305
|
-
stride: context2.get_strides(context2.chunk_shape)
|
|
279306
|
-
};
|
|
279307
|
-
}
|
|
279308
|
-
return context2.codec.decode(maybe_bytes);
|
|
279309
|
-
}
|
|
279310
|
-
/**
|
|
279311
|
-
* A helper method to narrow `zarr.Array` Dtype.
|
|
279312
|
-
*
|
|
279313
|
-
* ```typescript
|
|
279314
|
-
* let arr: zarr.Array<DataType, FetchStore> = zarr.open(store, { kind: "array" });
|
|
279315
|
-
*
|
|
279316
|
-
* // Option 1: narrow by scalar type (e.g. "bool", "raw", "bigint", "number")
|
|
279317
|
-
* if (arr.is("bigint")) {
|
|
279318
|
-
* // zarr.Array<"int64" | "uint64", FetchStore>
|
|
279319
|
-
* }
|
|
279320
|
-
*
|
|
279321
|
-
* // Option 3: exact match
|
|
279322
|
-
* if (arr.is("float32")) {
|
|
279323
|
-
* // zarr.Array<"float32", FetchStore, "/">
|
|
279324
|
-
* }
|
|
279325
|
-
* ```
|
|
279326
|
-
*/
|
|
279327
|
-
is(query) {
|
|
279328
|
-
return is_dtype(this.dtype, query);
|
|
279329
|
-
}
|
|
279330
|
-
}, _metadata4 = new WeakMap(), _B);
|
|
279331
|
-
let VERSION_COUNTER = create_version_counter();
|
|
279332
|
-
function create_version_counter() {
|
|
279333
|
-
let version_counts = /* @__PURE__ */ new WeakMap();
|
|
279334
|
-
function get_counts(store) {
|
|
279335
|
-
let counts = version_counts.get(store) ?? { v2: 0, v3: 0 };
|
|
279336
|
-
version_counts.set(store, counts);
|
|
279337
|
-
return counts;
|
|
279338
|
-
}
|
|
279339
|
-
return {
|
|
279340
|
-
increment(store, version2) {
|
|
279341
|
-
get_counts(store)[version2] += 1;
|
|
279342
|
-
},
|
|
279343
|
-
version_max(store) {
|
|
279344
|
-
let counts = get_counts(store);
|
|
279345
|
-
return counts.v3 > counts.v2 ? "v3" : "v2";
|
|
279346
|
-
}
|
|
279347
|
-
};
|
|
279348
|
-
}
|
|
279349
|
-
async function load_attrs(location) {
|
|
279350
|
-
let meta_bytes = await location.store.get(location.resolve(".zattrs").path);
|
|
279351
|
-
if (!meta_bytes)
|
|
279352
|
-
return {};
|
|
279353
|
-
return json_decode_object(meta_bytes);
|
|
279354
|
-
}
|
|
279355
|
-
async function open_v2(location, options = {}) {
|
|
279356
|
-
let loc = "store" in location ? location : new Location2(location);
|
|
279357
|
-
let attrs = {};
|
|
279358
|
-
if (options.attrs ?? true)
|
|
279359
|
-
attrs = await load_attrs(loc);
|
|
279360
|
-
if (options.kind === "array")
|
|
279361
|
-
return open_array_v2(loc, attrs);
|
|
279362
|
-
if (options.kind === "group")
|
|
279363
|
-
return open_group_v2(loc, attrs);
|
|
279364
|
-
return open_array_v2(loc, attrs).catch((err2) => {
|
|
279365
|
-
if (err2 instanceof NodeNotFoundError2)
|
|
279366
|
-
return open_group_v2(loc, attrs);
|
|
279367
|
-
throw err2;
|
|
279368
|
-
});
|
|
279369
|
-
}
|
|
279370
|
-
async function open_array_v2(location, attrs) {
|
|
279371
|
-
let { path: path2 } = location.resolve(".zarray");
|
|
279372
|
-
let meta = await location.store.get(path2);
|
|
279373
|
-
if (!meta) {
|
|
279374
|
-
throw new NodeNotFoundError2("v2 array", {
|
|
279375
|
-
cause: new KeyError2(path2)
|
|
279376
|
-
});
|
|
279377
|
-
}
|
|
279378
|
-
VERSION_COUNTER.increment(location.store, "v2");
|
|
279379
|
-
return new Array$1(location.store, location.path, v2_to_v3_array_metadata(json_decode_object(meta), attrs));
|
|
279380
|
-
}
|
|
279381
|
-
async function open_group_v2(location, attrs) {
|
|
279382
|
-
let { path: path2 } = location.resolve(".zgroup");
|
|
279383
|
-
let meta = await location.store.get(path2);
|
|
279384
|
-
if (!meta) {
|
|
279385
|
-
throw new NodeNotFoundError2("v2 group", {
|
|
279386
|
-
cause: new KeyError2(path2)
|
|
279387
|
-
});
|
|
279388
|
-
}
|
|
279389
|
-
VERSION_COUNTER.increment(location.store, "v2");
|
|
279390
|
-
return new Group$2(location.store, location.path, v2_to_v3_group_metadata(json_decode_object(meta), attrs));
|
|
279391
|
-
}
|
|
279392
|
-
async function _open_v3(location) {
|
|
279393
|
-
let { store, path: path2 } = location.resolve("zarr.json");
|
|
279394
|
-
let meta = await location.store.get(path2);
|
|
279395
|
-
if (!meta) {
|
|
279396
|
-
throw new NodeNotFoundError2("v3 array or group", {
|
|
279397
|
-
cause: new KeyError2(path2)
|
|
279398
|
-
});
|
|
279399
|
-
}
|
|
279400
|
-
let meta_doc = json_decode_object(meta);
|
|
279401
|
-
if (meta_doc.node_type === "array") {
|
|
279402
|
-
meta_doc.fill_value = ensure_correct_scalar(meta_doc);
|
|
279403
|
-
}
|
|
279404
|
-
return meta_doc.node_type === "array" ? new Array$1(store, location.path, meta_doc) : new Group$2(store, location.path, meta_doc);
|
|
279405
|
-
}
|
|
279406
|
-
async function open_v3(location, options = {}) {
|
|
279407
|
-
let loc = "store" in location ? location : new Location2(location);
|
|
279408
|
-
let node2 = await _open_v3(loc);
|
|
279409
|
-
VERSION_COUNTER.increment(loc.store, "v3");
|
|
279410
|
-
if (options.kind === void 0)
|
|
279411
|
-
return node2;
|
|
279412
|
-
if (options.kind === "array" && node2 instanceof Array$1)
|
|
279413
|
-
return node2;
|
|
279414
|
-
if (options.kind === "group" && node2 instanceof Group$2)
|
|
279415
|
-
return node2;
|
|
279416
|
-
let kind = node2 instanceof Array$1 ? "array" : "group";
|
|
279417
|
-
throw new Error(`Expected node of kind ${options.kind}, found ${kind}.`);
|
|
279418
|
-
}
|
|
279419
|
-
async function open(location, options = {}) {
|
|
279420
|
-
let store = "store" in location ? location.store : location;
|
|
279421
|
-
let version_max = VERSION_COUNTER.version_max(store);
|
|
279422
|
-
let open_primary = version_max === "v2" ? open.v2 : open.v3;
|
|
279423
|
-
let open_secondary = version_max === "v2" ? open.v3 : open.v2;
|
|
279424
|
-
return open_primary(location, options).catch((err2) => {
|
|
279425
|
-
if (err2 instanceof NodeNotFoundError2) {
|
|
279426
|
-
return open_secondary(location, options);
|
|
279427
|
-
}
|
|
279428
|
-
throw err2;
|
|
279429
|
-
});
|
|
279430
|
-
}
|
|
279431
|
-
open.v2 = open_v2;
|
|
279432
|
-
open.v3 = open_v3;
|
|
279433
|
-
function* range$6(start2, stop3, step = 1) {
|
|
279434
|
-
if (stop3 === void 0) {
|
|
279435
|
-
stop3 = start2;
|
|
279436
|
-
start2 = 0;
|
|
279437
|
-
}
|
|
279438
|
-
for (let i2 = start2; i2 < stop3; i2 += step) {
|
|
279439
|
-
yield i2;
|
|
279440
|
-
}
|
|
279441
|
-
}
|
|
279442
|
-
function* product(...iterables) {
|
|
279443
|
-
if (iterables.length === 0) {
|
|
279444
|
-
return;
|
|
279445
|
-
}
|
|
279446
|
-
const iterators = iterables.map((it) => it[Symbol.iterator]());
|
|
279447
|
-
const results = iterators.map((it) => it.next());
|
|
279448
|
-
if (results.some((r3) => r3.done)) {
|
|
279449
|
-
throw new Error("Input contains an empty iterator.");
|
|
279450
|
-
}
|
|
279451
|
-
for (let i2 = 0; ; ) {
|
|
279452
|
-
if (results[i2].done) {
|
|
279453
|
-
iterators[i2] = iterables[i2][Symbol.iterator]();
|
|
279454
|
-
results[i2] = iterators[i2].next();
|
|
279455
|
-
if (++i2 >= iterators.length) {
|
|
279456
|
-
return;
|
|
279457
|
-
}
|
|
279458
|
-
} else {
|
|
279459
|
-
yield results.map(({ value: value2 }) => value2);
|
|
279460
|
-
i2 = 0;
|
|
279461
|
-
}
|
|
279462
|
-
results[i2] = iterators[i2].next();
|
|
279463
|
-
}
|
|
279464
|
-
}
|
|
279465
|
-
function slice_indices({ start: start2, stop: stop3, step }, length2) {
|
|
279466
|
-
if (step === 0) {
|
|
279467
|
-
throw new Error("slice step cannot be zero");
|
|
279468
|
-
}
|
|
279469
|
-
step = step ?? 1;
|
|
279470
|
-
const step_is_negative = step < 0;
|
|
279471
|
-
const [lower2, upper] = step_is_negative ? [-1, length2 - 1] : [0, length2];
|
|
279472
|
-
if (start2 === null) {
|
|
279473
|
-
start2 = step_is_negative ? upper : lower2;
|
|
279474
|
-
} else {
|
|
279475
|
-
if (start2 < 0) {
|
|
279476
|
-
start2 += length2;
|
|
279477
|
-
if (start2 < lower2) {
|
|
279478
|
-
start2 = lower2;
|
|
279479
|
-
}
|
|
279480
|
-
} else if (start2 > upper) {
|
|
279481
|
-
start2 = upper;
|
|
279482
|
-
}
|
|
279483
|
-
}
|
|
279484
|
-
if (stop3 === null) {
|
|
279485
|
-
stop3 = step_is_negative ? lower2 : upper;
|
|
279486
|
-
} else {
|
|
279487
|
-
if (stop3 < 0) {
|
|
279488
|
-
stop3 += length2;
|
|
279489
|
-
if (stop3 < lower2) {
|
|
279490
|
-
stop3 = lower2;
|
|
279491
|
-
}
|
|
279492
|
-
} else if (stop3 > upper) {
|
|
279493
|
-
stop3 = upper;
|
|
279494
|
-
}
|
|
279495
|
-
}
|
|
279496
|
-
return [start2, stop3, step];
|
|
279497
|
-
}
|
|
279498
|
-
function slice$4(start2, stop3, step = null) {
|
|
279499
|
-
if (stop3 === void 0) {
|
|
279500
|
-
stop3 = start2;
|
|
279501
|
-
start2 = null;
|
|
279502
|
-
}
|
|
279503
|
-
return {
|
|
279504
|
-
start: start2,
|
|
279505
|
-
stop: stop3,
|
|
279506
|
-
step
|
|
279507
|
-
};
|
|
279508
|
-
}
|
|
279509
|
-
function create_queue() {
|
|
279510
|
-
const promises = [];
|
|
279511
|
-
return {
|
|
279512
|
-
add: (fn2) => promises.push(fn2()),
|
|
279513
|
-
onIdle: () => Promise.all(promises)
|
|
279514
|
-
};
|
|
279515
|
-
}
|
|
279516
|
-
class IndexError2 extends Error {
|
|
279517
|
-
constructor(msg) {
|
|
279518
|
-
super(msg);
|
|
279519
|
-
this.name = "IndexError";
|
|
279520
|
-
}
|
|
279521
|
-
}
|
|
279522
|
-
function err_too_many_indices(selection, shape2) {
|
|
279523
|
-
throw new IndexError2(`too many indicies for array; expected ${shape2.length}, got ${selection.length}`);
|
|
279524
|
-
}
|
|
279525
|
-
function err_boundscheck(dim_len) {
|
|
279526
|
-
throw new IndexError2(`index out of bounds for dimension with length ${dim_len}`);
|
|
279527
|
-
}
|
|
279528
|
-
function err_negative_step() {
|
|
279529
|
-
throw new IndexError2("only slices with step >= 1 are supported");
|
|
279530
|
-
}
|
|
279531
|
-
function check_selection_length(selection, shape2) {
|
|
279532
|
-
if (selection.length > shape2.length) {
|
|
279533
|
-
err_too_many_indices(selection, shape2);
|
|
279534
|
-
}
|
|
279535
|
-
}
|
|
279536
|
-
function normalize_integer_selection(dim_sel, dim_len) {
|
|
279537
|
-
dim_sel = Math.trunc(dim_sel);
|
|
279538
|
-
if (dim_sel < 0) {
|
|
279539
|
-
dim_sel = dim_len + dim_sel;
|
|
279540
|
-
}
|
|
279541
|
-
if (dim_sel >= dim_len || dim_sel < 0) {
|
|
279542
|
-
err_boundscheck(dim_len);
|
|
279543
|
-
}
|
|
279544
|
-
return dim_sel;
|
|
279545
|
-
}
|
|
279546
|
-
class IntDimIndexer2 {
|
|
279547
|
-
constructor({ dim_sel, dim_len, dim_chunk_len }) {
|
|
279548
|
-
__publicField(this, "dim_sel");
|
|
279549
|
-
__publicField(this, "dim_len");
|
|
279550
|
-
__publicField(this, "dim_chunk_len");
|
|
279551
|
-
__publicField(this, "nitems");
|
|
279552
|
-
dim_sel = normalize_integer_selection(dim_sel, dim_len);
|
|
279553
|
-
this.dim_sel = dim_sel;
|
|
279554
|
-
this.dim_len = dim_len;
|
|
279555
|
-
this.dim_chunk_len = dim_chunk_len;
|
|
279556
|
-
this.nitems = 1;
|
|
279557
|
-
}
|
|
279558
|
-
*[Symbol.iterator]() {
|
|
279559
|
-
const dim_chunk_ix = Math.floor(this.dim_sel / this.dim_chunk_len);
|
|
279560
|
-
const dim_offset = dim_chunk_ix * this.dim_chunk_len;
|
|
279561
|
-
const dim_chunk_sel = this.dim_sel - dim_offset;
|
|
279562
|
-
yield { dim_chunk_ix, dim_chunk_sel };
|
|
279563
|
-
}
|
|
279564
|
-
}
|
|
279565
|
-
class SliceDimIndexer2 {
|
|
279566
|
-
constructor({ dim_sel, dim_len, dim_chunk_len }) {
|
|
279567
|
-
__publicField(this, "start");
|
|
279568
|
-
__publicField(this, "stop");
|
|
279569
|
-
__publicField(this, "step");
|
|
279570
|
-
__publicField(this, "dim_len");
|
|
279571
|
-
__publicField(this, "dim_chunk_len");
|
|
279572
|
-
__publicField(this, "nitems");
|
|
279573
|
-
__publicField(this, "nchunks");
|
|
279574
|
-
const [start2, stop3, step] = slice_indices(dim_sel, dim_len);
|
|
279575
|
-
this.start = start2;
|
|
279576
|
-
this.stop = stop3;
|
|
279577
|
-
this.step = step;
|
|
279578
|
-
if (this.step < 1)
|
|
279579
|
-
err_negative_step();
|
|
279580
|
-
this.dim_len = dim_len;
|
|
279581
|
-
this.dim_chunk_len = dim_chunk_len;
|
|
279582
|
-
this.nitems = Math.max(0, Math.ceil((this.stop - this.start) / this.step));
|
|
279583
|
-
this.nchunks = Math.ceil(this.dim_len / this.dim_chunk_len);
|
|
279584
|
-
}
|
|
279585
|
-
*[Symbol.iterator]() {
|
|
279586
|
-
const dim_chunk_ix_from = Math.floor(this.start / this.dim_chunk_len);
|
|
279587
|
-
const dim_chunk_ix_to = Math.ceil(this.stop / this.dim_chunk_len);
|
|
279588
|
-
for (const dim_chunk_ix of range$6(dim_chunk_ix_from, dim_chunk_ix_to)) {
|
|
279589
|
-
const dim_offset = dim_chunk_ix * this.dim_chunk_len;
|
|
279590
|
-
const dim_limit = Math.min(this.dim_len, (dim_chunk_ix + 1) * this.dim_chunk_len);
|
|
279591
|
-
const dim_chunk_len = dim_limit - dim_offset;
|
|
279592
|
-
let dim_out_offset = 0;
|
|
279593
|
-
let dim_chunk_sel_start = 0;
|
|
279594
|
-
if (this.start < dim_offset) {
|
|
279595
|
-
const remainder = (dim_offset - this.start) % this.step;
|
|
279596
|
-
if (remainder)
|
|
279597
|
-
dim_chunk_sel_start += this.step - remainder;
|
|
279598
|
-
dim_out_offset = Math.ceil((dim_offset - this.start) / this.step);
|
|
279599
|
-
} else {
|
|
279600
|
-
dim_chunk_sel_start = this.start - dim_offset;
|
|
279601
|
-
}
|
|
279602
|
-
const dim_chunk_sel_stop = this.stop > dim_limit ? dim_chunk_len : this.stop - dim_offset;
|
|
279603
|
-
const dim_chunk_sel = [
|
|
279604
|
-
dim_chunk_sel_start,
|
|
279605
|
-
dim_chunk_sel_stop,
|
|
279606
|
-
this.step
|
|
279607
|
-
];
|
|
279608
|
-
const dim_chunk_nitems = Math.ceil((dim_chunk_sel_stop - dim_chunk_sel_start) / this.step);
|
|
279609
|
-
const dim_out_sel = [
|
|
279610
|
-
dim_out_offset,
|
|
279611
|
-
dim_out_offset + dim_chunk_nitems,
|
|
279612
|
-
1
|
|
279613
|
-
];
|
|
279614
|
-
yield { dim_chunk_ix, dim_chunk_sel, dim_out_sel };
|
|
279615
|
-
}
|
|
279616
|
-
}
|
|
279617
|
-
}
|
|
279618
|
-
function normalize_selection(selection, shape2) {
|
|
279619
|
-
let normalized = [];
|
|
279620
|
-
if (selection === null) {
|
|
279621
|
-
normalized = shape2.map((_) => slice$4(null));
|
|
279622
|
-
} else if (Array.isArray(selection)) {
|
|
279623
|
-
normalized = selection.map((s2) => s2 ?? slice$4(null));
|
|
279624
|
-
}
|
|
279625
|
-
check_selection_length(normalized, shape2);
|
|
279626
|
-
return normalized;
|
|
279627
|
-
}
|
|
279628
|
-
class BasicIndexer2 {
|
|
279629
|
-
constructor({ selection, shape: shape2, chunk_shape }) {
|
|
279630
|
-
__publicField(this, "dim_indexers");
|
|
279631
|
-
__publicField(this, "shape");
|
|
279632
|
-
this.dim_indexers = normalize_selection(selection, shape2).map((dim_sel, i2) => {
|
|
279633
|
-
return new (typeof dim_sel === "number" ? IntDimIndexer2 : SliceDimIndexer2)({
|
|
279634
|
-
// @ts-expect-error ts inference not strong enough to know correct chunk
|
|
279635
|
-
dim_sel,
|
|
279636
|
-
dim_len: shape2[i2],
|
|
279637
|
-
dim_chunk_len: chunk_shape[i2]
|
|
279638
|
-
});
|
|
279639
|
-
});
|
|
279640
|
-
this.shape = this.dim_indexers.filter((ixr) => ixr instanceof SliceDimIndexer2).map((sixr) => sixr.nitems);
|
|
279641
|
-
}
|
|
279642
|
-
*[Symbol.iterator]() {
|
|
279643
|
-
for (const dim_projections of product(...this.dim_indexers)) {
|
|
279644
|
-
const chunk_coords = dim_projections.map((p) => p.dim_chunk_ix);
|
|
279645
|
-
const mapping = dim_projections.map((p) => {
|
|
279646
|
-
if ("dim_out_sel" in p) {
|
|
279647
|
-
return { from: p.dim_chunk_sel, to: p.dim_out_sel };
|
|
279648
|
-
}
|
|
279649
|
-
return { from: p.dim_chunk_sel, to: null };
|
|
279650
|
-
});
|
|
279651
|
-
yield { chunk_coords, mapping };
|
|
279652
|
-
}
|
|
279653
|
-
}
|
|
279654
|
-
}
|
|
279655
|
-
function unwrap(arr, idx) {
|
|
279656
|
-
return "get" in arr ? arr.get(idx) : arr[idx];
|
|
279657
|
-
}
|
|
279658
|
-
async function get$b(arr, selection, opts2, setter2) {
|
|
279659
|
-
let context2 = get_context(arr);
|
|
279660
|
-
let indexer = new BasicIndexer2({
|
|
279661
|
-
selection,
|
|
279662
|
-
shape: arr.shape,
|
|
279663
|
-
chunk_shape: arr.chunks
|
|
279664
|
-
});
|
|
279665
|
-
let out = setter2.prepare(new context2.TypedArray(indexer.shape.reduce((a2, b2) => a2 * b2, 1)), indexer.shape, context2.get_strides(indexer.shape, opts2.order));
|
|
279666
|
-
let queue = opts2.create_queue?.() ?? create_queue();
|
|
279667
|
-
for (const { chunk_coords, mapping } of indexer) {
|
|
279668
|
-
queue.add(async () => {
|
|
279669
|
-
let { data: data2, shape: shape2, stride } = await arr.getChunk(chunk_coords, opts2.opts);
|
|
279670
|
-
let chunk = setter2.prepare(data2, shape2, stride);
|
|
279671
|
-
setter2.set_from_chunk(out, chunk, mapping);
|
|
279672
|
-
});
|
|
279673
|
-
}
|
|
279674
|
-
await queue.onIdle();
|
|
279675
|
-
return indexer.shape.length === 0 ? unwrap(out.data, 0) : out;
|
|
279676
|
-
}
|
|
279677
|
-
function object_array_view(arr, offset2 = 0, size2) {
|
|
279678
|
-
let length2 = size2 ?? arr.length - offset2;
|
|
279679
|
-
return {
|
|
279680
|
-
length: length2,
|
|
279681
|
-
subarray(from2, to = length2) {
|
|
279682
|
-
return object_array_view(arr, offset2 + from2, to - from2);
|
|
279683
|
-
},
|
|
279684
|
-
set(data2, start2 = 0) {
|
|
279685
|
-
for (let i2 = 0; i2 < data2.length; i2++) {
|
|
279686
|
-
arr[offset2 + start2 + i2] = data2.get(i2);
|
|
279687
|
-
}
|
|
279688
|
-
},
|
|
279689
|
-
get(index2) {
|
|
279690
|
-
return arr[offset2 + index2];
|
|
279691
|
-
}
|
|
279692
|
-
};
|
|
279693
|
-
}
|
|
279694
|
-
function compat_chunk(arr) {
|
|
279695
|
-
if (globalThis.Array.isArray(arr.data)) {
|
|
279696
|
-
return {
|
|
279697
|
-
// @ts-expect-error
|
|
279698
|
-
data: object_array_view(arr.data),
|
|
279699
|
-
stride: arr.stride,
|
|
279700
|
-
bytes_per_element: 1
|
|
279701
|
-
};
|
|
279702
|
-
}
|
|
279703
|
-
return {
|
|
279704
|
-
data: new Uint8Array(arr.data.buffer, arr.data.byteOffset, arr.data.byteLength),
|
|
279705
|
-
stride: arr.stride,
|
|
279706
|
-
bytes_per_element: arr.data.BYTES_PER_ELEMENT
|
|
279707
|
-
};
|
|
279708
|
-
}
|
|
279709
|
-
function get_typed_array_constructor(arr) {
|
|
279710
|
-
if ("chars" in arr) {
|
|
279711
|
-
return arr.constructor.bind(null, arr.chars);
|
|
279712
|
-
}
|
|
279713
|
-
return arr.constructor;
|
|
279714
|
-
}
|
|
279715
|
-
function compat_scalar(arr, value2) {
|
|
279716
|
-
if (globalThis.Array.isArray(arr.data)) {
|
|
279717
|
-
return object_array_view([value2]);
|
|
279718
|
-
}
|
|
279719
|
-
let TypedArray2 = get_typed_array_constructor(arr.data);
|
|
279720
|
-
let data2 = new TypedArray2([value2]);
|
|
279721
|
-
return new Uint8Array(data2.buffer, data2.byteOffset, data2.byteLength);
|
|
279722
|
-
}
|
|
279723
|
-
const setter = {
|
|
279724
|
-
prepare(data2, shape2, stride) {
|
|
279725
|
-
return { data: data2, shape: shape2, stride };
|
|
279726
|
-
},
|
|
279727
|
-
set_scalar(dest, sel, value2) {
|
|
279728
|
-
let view = compat_chunk(dest);
|
|
279729
|
-
set_scalar_binary(view, sel, compat_scalar(dest, value2), view.bytes_per_element);
|
|
279730
|
-
},
|
|
279731
|
-
set_from_chunk(dest, src, projections2) {
|
|
279732
|
-
let view = compat_chunk(dest);
|
|
279733
|
-
set_from_chunk_binary(view, compat_chunk(src), view.bytes_per_element, projections2);
|
|
279734
|
-
}
|
|
279735
|
-
};
|
|
279736
|
-
async function get$a(arr, selection = null, opts2 = {}) {
|
|
279737
|
-
return get$b(arr, selection, opts2, setter);
|
|
279738
|
-
}
|
|
279739
|
-
function indices_len(start2, stop3, step) {
|
|
279740
|
-
if (step < 0 && stop3 < start2) {
|
|
279741
|
-
return Math.floor((start2 - stop3 - 1) / -step) + 1;
|
|
279742
|
-
}
|
|
279743
|
-
if (start2 < stop3)
|
|
279744
|
-
return Math.floor((stop3 - start2 - 1) / step) + 1;
|
|
279745
|
-
return 0;
|
|
279746
|
-
}
|
|
279747
|
-
function set_scalar_binary(out, out_selection, value2, bytes_per_element2) {
|
|
279748
|
-
if (out_selection.length === 0) {
|
|
279749
|
-
out.data.set(value2, 0);
|
|
279750
|
-
return;
|
|
279751
|
-
}
|
|
279752
|
-
const [slice2, ...slices] = out_selection;
|
|
279753
|
-
const [curr_stride, ...stride] = out.stride;
|
|
279754
|
-
if (typeof slice2 === "number") {
|
|
279755
|
-
const data2 = out.data.subarray(curr_stride * slice2 * bytes_per_element2);
|
|
279756
|
-
set_scalar_binary({ data: data2, stride }, slices, value2, bytes_per_element2);
|
|
279757
|
-
return;
|
|
279758
|
-
}
|
|
279759
|
-
const [from2, to, step] = slice2;
|
|
279760
|
-
const len2 = indices_len(from2, to, step);
|
|
279761
|
-
if (slices.length === 0) {
|
|
279762
|
-
for (let i2 = 0; i2 < len2; i2++) {
|
|
279763
|
-
out.data.set(value2, curr_stride * (from2 + step * i2) * bytes_per_element2);
|
|
279764
|
-
}
|
|
279765
|
-
return;
|
|
279766
|
-
}
|
|
279767
|
-
for (let i2 = 0; i2 < len2; i2++) {
|
|
279768
|
-
const data2 = out.data.subarray(curr_stride * (from2 + step * i2) * bytes_per_element2);
|
|
279769
|
-
set_scalar_binary({ data: data2, stride }, slices, value2, bytes_per_element2);
|
|
279770
|
-
}
|
|
279771
|
-
}
|
|
279772
|
-
function set_from_chunk_binary(dest, src, bytes_per_element2, projections2) {
|
|
279773
|
-
const [proj, ...projs] = projections2;
|
|
279774
|
-
const [dstride, ...dstrides] = dest.stride;
|
|
279775
|
-
const [sstride, ...sstrides] = src.stride;
|
|
279776
|
-
if (proj.from === null) {
|
|
279777
|
-
if (projs.length === 0) {
|
|
279778
|
-
dest.data.set(src.data.subarray(0, bytes_per_element2), proj.to * bytes_per_element2);
|
|
279779
|
-
return;
|
|
279780
|
-
}
|
|
279781
|
-
set_from_chunk_binary({
|
|
279782
|
-
data: dest.data.subarray(dstride * proj.to * bytes_per_element2),
|
|
279783
|
-
stride: dstrides
|
|
279784
|
-
}, src, bytes_per_element2, projs);
|
|
279785
|
-
return;
|
|
279786
|
-
}
|
|
279787
|
-
if (proj.to === null) {
|
|
279788
|
-
if (projs.length === 0) {
|
|
279789
|
-
let offset2 = proj.from * bytes_per_element2;
|
|
279790
|
-
dest.data.set(src.data.subarray(offset2, offset2 + bytes_per_element2), 0);
|
|
279791
|
-
return;
|
|
279792
|
-
}
|
|
279793
|
-
set_from_chunk_binary(dest, {
|
|
279794
|
-
data: src.data.subarray(sstride * proj.from * bytes_per_element2),
|
|
279795
|
-
stride: sstrides
|
|
279796
|
-
}, bytes_per_element2, projs);
|
|
279797
|
-
return;
|
|
279798
|
-
}
|
|
279799
|
-
const [from2, to, step] = proj.to;
|
|
279800
|
-
const [sfrom, _, sstep] = proj.from;
|
|
279801
|
-
const len2 = indices_len(from2, to, step);
|
|
279802
|
-
if (projs.length === 0) {
|
|
279803
|
-
if (step === 1 && sstep === 1 && dstride === 1 && sstride === 1) {
|
|
279804
|
-
let offset2 = sfrom * bytes_per_element2;
|
|
279805
|
-
let size2 = len2 * bytes_per_element2;
|
|
279806
|
-
dest.data.set(src.data.subarray(offset2, offset2 + size2), from2 * bytes_per_element2);
|
|
279807
|
-
return;
|
|
279808
|
-
}
|
|
279809
|
-
for (let i2 = 0; i2 < len2; i2++) {
|
|
279810
|
-
let offset2 = sstride * (sfrom + sstep * i2) * bytes_per_element2;
|
|
279811
|
-
dest.data.set(src.data.subarray(offset2, offset2 + bytes_per_element2), dstride * (from2 + step * i2) * bytes_per_element2);
|
|
279812
|
-
}
|
|
279813
|
-
return;
|
|
279814
|
-
}
|
|
279815
|
-
for (let i2 = 0; i2 < len2; i2++) {
|
|
279816
|
-
set_from_chunk_binary({
|
|
279817
|
-
data: dest.data.subarray(dstride * (from2 + i2 * step) * bytes_per_element2),
|
|
279818
|
-
stride: dstrides
|
|
279819
|
-
}, {
|
|
279820
|
-
data: src.data.subarray(sstride * (sfrom + i2 * sstep) * bytes_per_element2),
|
|
279821
|
-
stride: sstrides
|
|
279822
|
-
}, bytes_per_element2, projs);
|
|
279823
|
-
}
|
|
279824
|
-
}
|
|
279825
|
-
function fetch_range(url, offset2, length2, opts2 = {}) {
|
|
279826
|
-
if (offset2 !== void 0 && length2 !== void 0) {
|
|
279827
|
-
opts2 = {
|
|
279828
|
-
...opts2,
|
|
279829
|
-
headers: {
|
|
279830
|
-
...opts2.headers,
|
|
279831
|
-
Range: `bytes=${offset2}-${offset2 + length2 - 1}`
|
|
279832
|
-
}
|
|
279833
|
-
};
|
|
279834
|
-
}
|
|
279835
|
-
return fetch(url, opts2);
|
|
279836
|
-
}
|
|
279837
|
-
function merge_init(storeOverrides, requestOverrides) {
|
|
279838
|
-
return {
|
|
279839
|
-
...storeOverrides,
|
|
279840
|
-
...requestOverrides,
|
|
279841
|
-
headers: {
|
|
279842
|
-
...storeOverrides.headers,
|
|
279843
|
-
...requestOverrides.headers
|
|
279844
|
-
}
|
|
279845
|
-
};
|
|
279846
|
-
}
|
|
279847
|
-
function resolve$1(root2, path2) {
|
|
279848
|
-
const base2 = typeof root2 === "string" ? new URL(root2) : root2;
|
|
279849
|
-
if (!base2.pathname.endsWith("/")) {
|
|
279850
|
-
base2.pathname += "/";
|
|
279851
|
-
}
|
|
279852
|
-
const resolved = new URL(path2.slice(1), base2);
|
|
279853
|
-
resolved.search = base2.search;
|
|
279854
|
-
return resolved;
|
|
279855
|
-
}
|
|
279856
|
-
async function handle_response(response) {
|
|
279857
|
-
if (response.status === 404) {
|
|
279858
|
-
return void 0;
|
|
279859
|
-
}
|
|
279860
|
-
if (response.status === 200 || response.status === 206) {
|
|
279861
|
-
return new Uint8Array(await response.arrayBuffer());
|
|
279862
|
-
}
|
|
279863
|
-
throw new Error(`Unexpected response status ${response.status} ${response.statusText}`);
|
|
279864
|
-
}
|
|
279865
|
-
async function fetch_suffix(url, suffix_length, init2, use_suffix_request) {
|
|
279866
|
-
if (use_suffix_request) {
|
|
279867
|
-
return fetch(url, {
|
|
279868
|
-
...init2,
|
|
279869
|
-
headers: { ...init2.headers, Range: `bytes=-${suffix_length}` }
|
|
279870
|
-
});
|
|
279871
|
-
}
|
|
279872
|
-
let response = await fetch(url, { ...init2, method: "HEAD" });
|
|
279873
|
-
if (!response.ok) {
|
|
279874
|
-
return response;
|
|
279875
|
-
}
|
|
279876
|
-
let content_length = response.headers.get("Content-Length");
|
|
279877
|
-
let length2 = Number(content_length);
|
|
279878
|
-
return fetch_range(url, length2 - suffix_length, length2, init2);
|
|
279879
|
-
}
|
|
279880
|
-
class FetchStore {
|
|
279881
|
-
constructor(url, options = {}) {
|
|
279882
|
-
__privateAdd(this, _FetchStore_instances2);
|
|
279883
|
-
__publicField(this, "url");
|
|
279884
|
-
__privateAdd(this, _overrides4);
|
|
279885
|
-
__privateAdd(this, _use_suffix_request2);
|
|
279886
|
-
this.url = url;
|
|
279887
|
-
__privateSet(this, _overrides4, options.overrides ?? {});
|
|
279888
|
-
__privateSet(this, _use_suffix_request2, options.useSuffixRequest ?? false);
|
|
279889
|
-
}
|
|
279890
|
-
async get(key2, options = {}) {
|
|
279891
|
-
let href2 = resolve$1(this.url, key2).href;
|
|
279892
|
-
let response = await fetch(href2, __privateMethod(this, _FetchStore_instances2, merge_init_fn2).call(this, options));
|
|
279893
|
-
return handle_response(response);
|
|
279894
|
-
}
|
|
279895
|
-
async getRange(key2, range2, options = {}) {
|
|
279896
|
-
let url = resolve$1(this.url, key2);
|
|
279897
|
-
let init2 = __privateMethod(this, _FetchStore_instances2, merge_init_fn2).call(this, options);
|
|
279898
|
-
let response;
|
|
279899
|
-
if ("suffixLength" in range2) {
|
|
279900
|
-
response = await fetch_suffix(url, range2.suffixLength, init2, __privateGet(this, _use_suffix_request2));
|
|
279901
|
-
} else {
|
|
279902
|
-
response = await fetch_range(url, range2.offset, range2.length, init2);
|
|
279903
|
-
}
|
|
279904
|
-
return handle_response(response);
|
|
279905
|
-
}
|
|
279906
|
-
}
|
|
279907
|
-
_overrides4 = new WeakMap();
|
|
279908
|
-
_use_suffix_request2 = new WeakMap();
|
|
279909
|
-
_FetchStore_instances2 = new WeakSet();
|
|
279910
|
-
merge_init_fn2 = function(overrides) {
|
|
279911
|
-
return merge_init(__privateGet(this, _overrides4), overrides);
|
|
279912
|
-
};
|
|
279913
278450
|
function multivecChunksToTileDenseArray(chunks, tileShape, isRow) {
|
|
279914
278451
|
const fullTileLength = isRow ? tileShape[1] : tileShape[0] * tileShape[1];
|
|
279915
278452
|
const fullTileArray = new Float32Array(fullTileLength);
|
|
@@ -279951,7 +278488,9 @@ var ZarrMultivecDataFetcher = function ZarrMultivecDataFetcher2(HGC, ...args) {
|
|
|
279951
278488
|
constructor(dataConfig) {
|
|
279952
278489
|
this.dataConfig = dataConfig;
|
|
279953
278490
|
this.trackUid = slugid.nice();
|
|
279954
|
-
if (dataConfig.
|
|
278491
|
+
if (dataConfig.hasStoreRoot) {
|
|
278492
|
+
this.storeRoot = Promise.resolve(ZarrMultivecDataFetcher2.urlToStoreRoot[dataConfig.url]);
|
|
278493
|
+
} else if (dataConfig.url) {
|
|
279955
278494
|
const { url, options = {} } = dataConfig;
|
|
279956
278495
|
this.store = new FetchStore(url, options);
|
|
279957
278496
|
this.storeRoot = Promise.resolve(root(this.store));
|
|
@@ -280070,6 +278609,7 @@ var ZarrMultivecDataFetcher = function ZarrMultivecDataFetcher2(HGC, ...args) {
|
|
|
280070
278609
|
ZarrMultivecDataFetcher.config = {
|
|
280071
278610
|
type: "zarr-multivec"
|
|
280072
278611
|
};
|
|
278612
|
+
ZarrMultivecDataFetcher.urlToStoreRoot = {};
|
|
280073
278613
|
var ZarrMultivecDataFetcher_default = ZarrMultivecDataFetcher;
|
|
280074
278614
|
const useStyles$5 = makeStyles()((theme) => ({
|
|
280075
278615
|
higlassTitleWrapper: {
|
|
@@ -280128,17 +278668,25 @@ function HiglassGlobalStyles(props) {
|
|
|
280128
278668
|
}
|
|
280129
278669
|
register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
|
|
280130
278670
|
const LazyHiGlassComponent = React__default.lazy(async () => {
|
|
280131
|
-
const { HiGlassComponent } = await import("./higlass-
|
|
278671
|
+
const { HiGlassComponent } = await import("./higlass-xUpmTfKO.js");
|
|
280132
278672
|
return { default: HiGlassComponent };
|
|
280133
278673
|
});
|
|
280134
278674
|
const HG_SIZE = 800;
|
|
278675
|
+
function setStoreRootForHiGlass(url, storeRoot) {
|
|
278676
|
+
ZarrMultivecDataFetcher_default.urlToStoreRoot[url] = storeRoot;
|
|
278677
|
+
}
|
|
280135
278678
|
function HiGlassLazy(props) {
|
|
280136
|
-
const { coordinationScopes, theme, hgViewConfig: hgViewConfigProp, hgOptions: hgOptionsProp, genomeSize, height: height2 } = props;
|
|
278679
|
+
const { coordinationScopes, theme, hgViewConfig: hgViewConfigProp, hgOptions: hgOptionsProp, genomeSize = 31e8, height: height2 } = props;
|
|
280137
278680
|
const [{ genomicZoomX, genomicZoomY, genomicTargetX, genomicTargetY }, { setGenomicZoomX, setGenomicZoomY, setGenomicTargetX, setGenomicTargetY }] = useCoordination(COMPONENT_COORDINATION_TYPES.higlass, coordinationScopes);
|
|
280138
278681
|
const [width2, computedHeight, containerRef] = useGridItemSize();
|
|
280139
278682
|
const [hgInstance, setHgInstance] = useState();
|
|
280140
278683
|
const isActiveRef = useRef();
|
|
280141
278684
|
const hgOptions = useMemo$1(() => ({
|
|
278685
|
+
bounded: true,
|
|
278686
|
+
pixelPreciseMarginPadding: true,
|
|
278687
|
+
containerPaddingX: 0,
|
|
278688
|
+
containerPaddingY: 0,
|
|
278689
|
+
sizeMode: "default",
|
|
280142
278690
|
...hgOptionsProp,
|
|
280143
278691
|
theme
|
|
280144
278692
|
}), [hgOptionsProp, theme]);
|
|
@@ -280245,16 +278793,6 @@ function HiGlassLazy(props) {
|
|
|
280245
278793
|
const { classes: classes2 } = useStyles$5();
|
|
280246
278794
|
return jsxRuntimeExports.jsx("div", { className: classes2.higlassWrapperParent, children: jsxRuntimeExports.jsx("div", { className: classes2.higlassWrapper, ref: containerRef, style: { height: `${height2}px` }, children: jsxRuntimeExports.jsx(Suspense, { fallback: jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: jsxRuntimeExports.jsx(LazyHiGlassComponent, { ref: setHgInstance, zoomFixed: false, viewConfig: hgViewConfig, options: hgOptions }) }) }) });
|
|
280247
278795
|
}
|
|
280248
|
-
HiGlassLazy.defaultProps = {
|
|
280249
|
-
hgOptions: {
|
|
280250
|
-
bounded: true,
|
|
280251
|
-
pixelPreciseMarginPadding: true,
|
|
280252
|
-
containerPaddingX: 0,
|
|
280253
|
-
containerPaddingY: 0,
|
|
280254
|
-
sizeMode: "default"
|
|
280255
|
-
},
|
|
280256
|
-
genomeSize: 31e8
|
|
280257
|
-
};
|
|
280258
278796
|
const urls = [];
|
|
280259
278797
|
function HiGlassSubscriber(props) {
|
|
280260
278798
|
const { coordinationScopes, theme, hgViewConfig, closeButtonVisible, downloadButtonVisible, removeGridComponent } = props;
|
|
@@ -280300,11 +278838,16 @@ function GenomicProfilesSubscriber(props) {
|
|
|
280300
278838
|
const [width2, height2, containerRef] = useGridItemSize();
|
|
280301
278839
|
const loaders = useLoaders();
|
|
280302
278840
|
const [{ dataset, obsSetColor: cellSetColor, obsSetSelection: cellSetSelection }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.GENOMIC_PROFILES], coordinationScopes);
|
|
280303
|
-
const [
|
|
278841
|
+
const [genomicProfilesData, genomicProfilesStatus, genomicProfilesUrls] = useGenomicProfilesData(loaders, dataset, true, {}, {}, {});
|
|
280304
278842
|
const isReady = useReady([genomicProfilesStatus]);
|
|
280305
278843
|
const urls2 = useUrls([genomicProfilesUrls]);
|
|
280306
278844
|
const hgViewConfig = useMemo$1(() => {
|
|
280307
|
-
|
|
278845
|
+
const { genomicProfiles } = genomicProfilesData;
|
|
278846
|
+
if (!genomicProfiles) {
|
|
278847
|
+
return null;
|
|
278848
|
+
}
|
|
278849
|
+
const { attrs: genomicProfilesAttrs, storeRoot: genomicProfilesStoreRoot } = genomicProfiles;
|
|
278850
|
+
if (!genomicProfilesAttrs || !genomicProfilesStoreRoot) {
|
|
280308
278851
|
return null;
|
|
280309
278852
|
}
|
|
280310
278853
|
const { url } = urls2[0];
|
|
@@ -280367,14 +278910,15 @@ function GenomicProfilesSubscriber(props) {
|
|
|
280367
278910
|
const setInSelection = isPath2 ? cellSetSelection?.find((s2) => isEqual$3(s2, trackUid)) : false;
|
|
280368
278911
|
const setColor2 = isPath2 ? cellSetColor?.find((s2) => isEqual$3(s2.path, trackUid))?.color : null;
|
|
280369
278912
|
const trackUidString = isPath2 ? trackUid.join("__") : trackUid;
|
|
280370
|
-
|
|
278913
|
+
setStoreRootForHiGlass(url, genomicProfilesStoreRoot);
|
|
280371
278914
|
const track = {
|
|
280372
278915
|
type: "horizontal-bar",
|
|
280373
278916
|
uid: `bar-track-${trackUidString}`,
|
|
280374
278917
|
data: {
|
|
280375
278918
|
type: "zarr-multivec",
|
|
280376
278919
|
url,
|
|
280377
|
-
|
|
278920
|
+
// The storeRoot takes precedence over the URL.
|
|
278921
|
+
hasStoreRoot: true,
|
|
280378
278922
|
row: i2
|
|
280379
278923
|
},
|
|
280380
278924
|
options: {
|
|
@@ -280419,7 +278963,7 @@ function GenomicProfilesSubscriber(props) {
|
|
|
280419
278963
|
};
|
|
280420
278964
|
return hgView;
|
|
280421
278965
|
}, [
|
|
280422
|
-
|
|
278966
|
+
genomicProfilesData,
|
|
280423
278967
|
urls2,
|
|
280424
278968
|
theme,
|
|
280425
278969
|
height2,
|
|
@@ -280431,7 +278975,7 @@ function GenomicProfilesSubscriber(props) {
|
|
|
280431
278975
|
assembly
|
|
280432
278976
|
]);
|
|
280433
278977
|
const { classes: classes2 } = useStyles$5();
|
|
280434
|
-
return jsxRuntimeExports.jsx("div", { className: classes2.higlassTitleWrapper, children: jsxRuntimeExports.jsx(TitleInfo, { title: title2, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, urls: urls2, helpText, children: jsxRuntimeExports.
|
|
278978
|
+
return jsxRuntimeExports.jsx("div", { className: classes2.higlassTitleWrapper, children: jsxRuntimeExports.jsx(TitleInfo, { title: title2, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, urls: urls2, helpText, children: jsxRuntimeExports.jsxs("div", { className: classes2.higlassLazyWrapper, ref: containerRef, children: [jsxRuntimeExports.jsx(HiglassGlobalStyles, { classes: classes2 }), hgViewConfig ? jsxRuntimeExports.jsx(HiGlassLazy, { coordinationScopes, theme, hgViewConfig, height: height2 }) : null] }) }) });
|
|
280435
278979
|
}
|
|
280436
278980
|
function decodeBase64(base64, enableUnicode) {
|
|
280437
278981
|
var binaryString = atob(base64);
|
|
@@ -283064,7 +281608,7 @@ function NeuroglancerGlobalStyles(props) {
|
|
|
283064
281608
|
const { classes: classes2 } = props;
|
|
283065
281609
|
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(GlobalStyles$3, { styles: globalNeuroglancerCss }), jsxRuntimeExports.jsx(ScopedGlobalStyles, { styles: globalNeuroglancerStyles, parentClassName: classes2.neuroglancerWrapper })] });
|
|
283066
281610
|
}
|
|
283067
|
-
const LazyReactNeuroglancer = React__default.lazy(() => import("./ReactNeuroglancer-
|
|
281611
|
+
const LazyReactNeuroglancer = React__default.lazy(() => import("./ReactNeuroglancer-D8uj4yly.js"));
|
|
283068
281612
|
function createWorker() {
|
|
283069
281613
|
return new WorkerFactory();
|
|
283070
281614
|
}
|
|
@@ -285649,7 +284193,7 @@ function CellSetExpressionPlotSubscriber(props) {
|
|
|
285649
284193
|
}, [geneSelection, featureAggregationStrategyToUse]);
|
|
285650
284194
|
const selectedTransformName = transformOptions.find((o2) => o2.value === featureValueTransform)?.name;
|
|
285651
284195
|
const titleSuffix = featureSuffix ? ` (${featureSuffix})` : "";
|
|
285652
|
-
return jsxRuntimeExports.jsx(TitleInfo, { title: title2 ? `${title2}${titleSuffix}` :
|
|
284196
|
+
return jsxRuntimeExports.jsx(TitleInfo, { title: title2 ? `${title2}${titleSuffix}` : `${capitalize$3(featureValueType)} by ${capitalize$3(obsType)} Set${titleSuffix}`, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, helpText, options: jsxRuntimeExports.jsx(CellSetExpressionPlotOptions, { featureValueTransform, setFeatureValueTransform, featureValueTransformCoefficient, setFeatureValueTransformCoefficient, transformOptions, featureAggregationStrategy, setFeatureAggregationStrategy }), children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes2.vegaContainer, children: histogramData ? jsxRuntimeExports.jsx(CellSetExpressionPlot, { yMin, yUnits, jitter: jitter2, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, sampleSetSelection, sampleSetColor, colors: setArr, data: histogramData, exprMax, theme, width: width2, height: height2, obsType, featureType, featureValueType, featureValueTransformName: selectedTransformName, xAxisTitle }) : jsxRuntimeExports.jsxs("span", { children: ["Select a ", featureType, "."] }) }) });
|
|
285653
284197
|
}
|
|
285654
284198
|
function accessor(fn2, fields, name2) {
|
|
285655
284199
|
fn2.fields = fields || [];
|
|
@@ -292019,7 +290563,7 @@ inherits(Quantile$1, Transform2, {
|
|
|
292019
290563
|
out.source = this.value;
|
|
292020
290564
|
return out;
|
|
292021
290565
|
}
|
|
292022
|
-
const source2 = pulse2.materialize(pulse2.SOURCE).source, groups = partition$1$1(source2, _.groupby, _.field), names = (_.groupby || []).map(accessorName), values3 = [], step = _.step || 0.01, p = _.probs || range$
|
|
290566
|
+
const source2 = pulse2.materialize(pulse2.SOURCE).source, groups = partition$1$1(source2, _.groupby, _.field), names = (_.groupby || []).map(accessorName), values3 = [], step = _.step || 0.01, p = _.probs || range$8(step / 2, 1 - EPSILON$2, step), n3 = p.length;
|
|
292023
290567
|
groups.forEach((g2) => {
|
|
292024
290568
|
const q = quantiles(g2, p);
|
|
292025
290569
|
for (let i2 = 0; i2 < n3; ++i2) {
|
|
@@ -292178,7 +290722,7 @@ inherits(Sequence, Transform2, {
|
|
|
292178
290722
|
if (this.value && !_.modified()) return;
|
|
292179
290723
|
const out = pulse2.materialize().fork(pulse2.MOD), as = _.as || "data";
|
|
292180
290724
|
out.rem = this.value ? pulse2.rem.concat(this.value) : pulse2.rem;
|
|
292181
|
-
this.value = range$
|
|
290725
|
+
this.value = range$8(_.start, _.stop, _.step || 1).map((v) => {
|
|
292182
290726
|
const t4 = {};
|
|
292183
290727
|
t4[as] = v;
|
|
292184
290728
|
return ingest$1(t4);
|
|
@@ -292796,7 +291340,7 @@ function band() {
|
|
|
292796
291340
|
start2 = Math.round(start2);
|
|
292797
291341
|
bandwidth2 = Math.round(bandwidth2);
|
|
292798
291342
|
}
|
|
292799
|
-
const values3 = range$
|
|
291343
|
+
const values3 = range$8(n3).map((i2) => start2 + step * i2);
|
|
292800
291344
|
return ordinalRange(reverse2 ? values3.reverse() : values3);
|
|
292801
291345
|
}
|
|
292802
291346
|
scale2.domain = function(_) {
|
|
@@ -298640,7 +297184,7 @@ Pie.Definition = {
|
|
|
298640
297184
|
};
|
|
298641
297185
|
inherits(Pie, Transform2, {
|
|
298642
297186
|
transform(_, pulse2) {
|
|
298643
|
-
var as = _.as || ["startAngle", "endAngle"], startAngle = as[0], endAngle = as[1], field2 = _.field || one$1, start2 = _.startAngle || 0, stop3 = _.endAngle != null ? _.endAngle : 2 * Math.PI, data2 = pulse2.source, values3 = data2.map(field2), n3 = values3.length, a2 = start2, k = (stop3 - start2) / sum$2(values3), index2 = range$
|
|
297187
|
+
var as = _.as || ["startAngle", "endAngle"], startAngle = as[0], endAngle = as[1], field2 = _.field || one$1, start2 = _.startAngle || 0, stop3 = _.endAngle != null ? _.endAngle : 2 * Math.PI, data2 = pulse2.source, values3 = data2.map(field2), n3 = values3.length, a2 = start2, k = (stop3 - start2) / sum$2(values3), index2 = range$8(n3), i2, t4, v;
|
|
298644
297188
|
if (_.sort) {
|
|
298645
297189
|
index2.sort((a3, b2) => values3[a3] - values3[b2]);
|
|
298646
297190
|
}
|
|
@@ -298758,7 +297302,7 @@ function configureBins(scale2, _, count2) {
|
|
|
298758
297302
|
if (!step) error("Scale bins parameter missing step property.");
|
|
298759
297303
|
if (start2 < lo) start2 = step * Math.ceil(lo / step);
|
|
298760
297304
|
if (stop3 > hi) stop3 = step * Math.floor(hi / step);
|
|
298761
|
-
bins2 = range$
|
|
297305
|
+
bins2 = range$8(start2, stop3 + step / 2, step);
|
|
298762
297306
|
}
|
|
298763
297307
|
if (bins2) {
|
|
298764
297308
|
scale2.bins = bins2;
|
|
@@ -299979,7 +298523,7 @@ function clipRectangle(x02, y02, x12, y12) {
|
|
|
299979
298523
|
};
|
|
299980
298524
|
}
|
|
299981
298525
|
function graticuleX(y02, y12, dy) {
|
|
299982
|
-
var y2 = range$
|
|
298526
|
+
var y2 = range$8(y02, y12 - epsilon$3, dy).concat(y12);
|
|
299983
298527
|
return function(x2) {
|
|
299984
298528
|
return y2.map(function(y3) {
|
|
299985
298529
|
return [x2, y3];
|
|
@@ -299987,7 +298531,7 @@ function graticuleX(y02, y12, dy) {
|
|
|
299987
298531
|
};
|
|
299988
298532
|
}
|
|
299989
298533
|
function graticuleY(x02, x12, dx) {
|
|
299990
|
-
var x2 = range$
|
|
298534
|
+
var x2 = range$8(x02, x12 - epsilon$3, dx).concat(x12);
|
|
299991
298535
|
return function(y2) {
|
|
299992
298536
|
return x2.map(function(x3) {
|
|
299993
298537
|
return [x3, y2];
|
|
@@ -300000,9 +298544,9 @@ function graticule() {
|
|
|
300000
298544
|
return { type: "MultiLineString", coordinates: lines() };
|
|
300001
298545
|
}
|
|
300002
298546
|
function lines() {
|
|
300003
|
-
return range$
|
|
298547
|
+
return range$8(ceil(X02 / DX) * DX, X12, DX).map(X3).concat(range$8(ceil(Y02 / DY) * DY, Y12, DY).map(Y3)).concat(range$8(ceil(x02 / dx) * dx, x12, dx).filter(function(x3) {
|
|
300004
298548
|
return abs$1(x3 % DX) > epsilon$3;
|
|
300005
|
-
}).map(x2)).concat(range$
|
|
298549
|
+
}).map(x2)).concat(range$8(ceil(y02 / dy) * dy, y12, dy).filter(function(y3) {
|
|
300006
298550
|
return abs$1(y3 % DY) > epsilon$3;
|
|
300007
298551
|
}).map(y2));
|
|
300008
298552
|
}
|
|
@@ -301277,7 +299821,7 @@ function within(p, q, r3) {
|
|
|
301277
299821
|
function quantize$1(k, nice2, zero2) {
|
|
301278
299822
|
return function(values3) {
|
|
301279
299823
|
var ex = extent(values3), start2 = zero2 ? Math.min(ex[0], 0) : ex[0], stop3 = ex[1], span2 = stop3 - start2, step = nice2 ? tickStep(start2, stop3, k) : span2 / (k + 1);
|
|
301280
|
-
return range$
|
|
299824
|
+
return range$8(start2 + step, stop3, step);
|
|
301281
299825
|
};
|
|
301282
299826
|
}
|
|
301283
299827
|
function Isocontour(params2) {
|
|
@@ -304840,8 +303384,8 @@ function collision($2, x2, y2, textHeight, textWidth, h2, bm0, bm1) {
|
|
|
304840
303384
|
}
|
|
304841
303385
|
function placeAreaLabelReducedSearch($2, bitmaps, avoidBaseMark, markIndex) {
|
|
304842
303386
|
const width2 = $2.width, height2 = $2.height, bm0 = bitmaps[0], bm1 = bitmaps[1];
|
|
304843
|
-
function tryLabel(
|
|
304844
|
-
const x2 = $2.invert(
|
|
303387
|
+
function tryLabel(_x3, _y3, maxSize, textWidth, textHeight) {
|
|
303388
|
+
const x2 = $2.invert(_x3), y2 = $2.invert(_y3);
|
|
304845
303389
|
let lo = maxSize, hi = height2, mid;
|
|
304846
303390
|
if (!outOfBounds(x2, y2, textWidth, textHeight, width2, height2) && !collision($2, x2, y2, textHeight, textWidth, lo, bm0, bm1) && !collision($2, x2, y2, textHeight, textWidth, textHeight, bm0, null)) {
|
|
304847
303391
|
while (hi - lo >= 1) {
|
|
@@ -304859,7 +303403,7 @@ function placeAreaLabelReducedSearch($2, bitmaps, avoidBaseMark, markIndex) {
|
|
|
304859
303403
|
}
|
|
304860
303404
|
return function(d) {
|
|
304861
303405
|
const items = d.datum.datum.items[markIndex].items, n3 = items.length, textHeight = d.datum.fontSize, textWidth = textMetrics.width(d.datum, d.datum.text);
|
|
304862
|
-
let maxSize = avoidBaseMark ? textHeight : 0, labelPlaced = false, labelPlaced2 = false, maxAreaWidth = 0, x12, x2, y12, y2, x3, y3,
|
|
303406
|
+
let maxSize = avoidBaseMark ? textHeight : 0, labelPlaced = false, labelPlaced2 = false, maxAreaWidth = 0, x12, x2, y12, y2, x3, y3, _x3, _y3, _x1, _xMid, _x22, _y1, _yMid, _y22, areaWidth, result, swapTmp;
|
|
304863
303407
|
for (let i2 = 0; i2 < n3; ++i2) {
|
|
304864
303408
|
x12 = items[i2].x;
|
|
304865
303409
|
y12 = items[i2].y;
|
|
@@ -304881,17 +303425,17 @@ function placeAreaLabelReducedSearch($2, bitmaps, avoidBaseMark, markIndex) {
|
|
|
304881
303425
|
_y1 = $2(y12);
|
|
304882
303426
|
_y22 = $2(y2);
|
|
304883
303427
|
_yMid = ~~((_y1 + _y22) / 2);
|
|
304884
|
-
for (
|
|
304885
|
-
for (
|
|
304886
|
-
result = tryLabel(
|
|
303428
|
+
for (_x3 = _xMid; _x3 >= _x1; --_x3) {
|
|
303429
|
+
for (_y3 = _yMid; _y3 >= _y1; --_y3) {
|
|
303430
|
+
result = tryLabel(_x3, _y3, maxSize, textWidth, textHeight);
|
|
304887
303431
|
if (result) {
|
|
304888
303432
|
[d.x, d.y, maxSize, labelPlaced] = result;
|
|
304889
303433
|
}
|
|
304890
303434
|
}
|
|
304891
303435
|
}
|
|
304892
|
-
for (
|
|
304893
|
-
for (
|
|
304894
|
-
result = tryLabel(
|
|
303436
|
+
for (_x3 = _xMid; _x3 <= _x22; ++_x3) {
|
|
303437
|
+
for (_y3 = _yMid; _y3 <= _y22; ++_y3) {
|
|
303438
|
+
result = tryLabel(_x3, _y3, maxSize, textWidth, textHeight);
|
|
304895
303439
|
if (result) {
|
|
304896
303440
|
[d.x, d.y, maxSize, labelPlaced] = result;
|
|
304897
303441
|
}
|
|
@@ -304927,7 +303471,7 @@ function placeAreaLabelFloodFill($2, bitmaps, avoidBaseMark, markIndex) {
|
|
|
304927
303471
|
const width2 = $2.width, height2 = $2.height, bm0 = bitmaps[0], bm1 = bitmaps[1], bm2 = $2.bitmap();
|
|
304928
303472
|
return function(d) {
|
|
304929
303473
|
const items = d.datum.datum.items[markIndex].items, n3 = items.length, textHeight = d.datum.fontSize, textWidth = textMetrics.width(d.datum, d.datum.text), stack2 = [];
|
|
304930
|
-
let maxSize = avoidBaseMark ? textHeight : 0, labelPlaced = false, labelPlaced2 = false, maxAreaWidth = 0, x12, x2, y12, y2, x3, y3,
|
|
303474
|
+
let maxSize = avoidBaseMark ? textHeight : 0, labelPlaced = false, labelPlaced2 = false, maxAreaWidth = 0, x12, x2, y12, y2, x3, y3, _x3, _y3, lo, hi, mid, areaWidth;
|
|
304931
303475
|
for (let i2 = 0; i2 < n3; ++i2) {
|
|
304932
303476
|
x12 = items[i2].x;
|
|
304933
303477
|
y12 = items[i2].y;
|
|
@@ -304935,16 +303479,16 @@ function placeAreaLabelFloodFill($2, bitmaps, avoidBaseMark, markIndex) {
|
|
|
304935
303479
|
y2 = items[i2].y2 === void 0 ? y12 : items[i2].y2;
|
|
304936
303480
|
stack2.push([$2((x12 + x2) / 2), $2((y12 + y2) / 2)]);
|
|
304937
303481
|
while (stack2.length) {
|
|
304938
|
-
[
|
|
304939
|
-
if (bm0.get(
|
|
304940
|
-
bm2.set(
|
|
303482
|
+
[_x3, _y3] = stack2.pop();
|
|
303483
|
+
if (bm0.get(_x3, _y3) || bm1.get(_x3, _y3) || bm2.get(_x3, _y3)) continue;
|
|
303484
|
+
bm2.set(_x3, _y3);
|
|
304941
303485
|
for (let j = 0; j < 4; ++j) {
|
|
304942
|
-
x3 =
|
|
304943
|
-
y3 =
|
|
303486
|
+
x3 = _x3 + X_DIR[j];
|
|
303487
|
+
y3 = _y3 + Y_DIR[j];
|
|
304944
303488
|
if (!bm2.outOfBounds(x3, y3, x3, y3)) stack2.push([x3, y3]);
|
|
304945
303489
|
}
|
|
304946
|
-
x3 = $2.invert(
|
|
304947
|
-
y3 = $2.invert(
|
|
303490
|
+
x3 = $2.invert(_x3);
|
|
303491
|
+
y3 = $2.invert(_y3);
|
|
304948
303492
|
lo = maxSize;
|
|
304949
303493
|
hi = height2;
|
|
304950
303494
|
if (!outOfBounds(x3, y3, textWidth, textHeight, width2, height2) && !collision($2, x3, y3, textHeight, textWidth, lo, bm0, bm1) && !collision($2, x3, y3, textHeight, textWidth, textHeight, bm0, null)) {
|
|
@@ -309582,7 +308126,7 @@ const functionContext = {
|
|
|
309582
308126
|
hsl: hsl$2,
|
|
309583
308127
|
luminance,
|
|
309584
308128
|
contrast,
|
|
309585
|
-
sequence: range$
|
|
308129
|
+
sequence: range$8,
|
|
309586
308130
|
format: format$1,
|
|
309587
308131
|
utcFormat,
|
|
309588
308132
|
utcParse,
|
|
@@ -328060,7 +326604,7 @@ function domainsTieBreaker(v12, v2, property2, propertyOf) {
|
|
|
328060
326604
|
function mergeDomains(domains) {
|
|
328061
326605
|
const uniqueDomains = unique(domains.map((domain2) => {
|
|
328062
326606
|
if (isDataRefDomain(domain2)) {
|
|
328063
|
-
const { sort:
|
|
326607
|
+
const { sort: _s2 } = domain2, domainWithoutSort = __rest$8(domain2, ["sort"]);
|
|
328064
326608
|
return domainWithoutSort;
|
|
328065
326609
|
}
|
|
328066
326610
|
return domain2;
|
|
@@ -328188,7 +326732,7 @@ function assembleScalesForModel(model) {
|
|
|
328188
326732
|
return scales2;
|
|
328189
326733
|
}
|
|
328190
326734
|
const scale2 = scaleComponent.combine();
|
|
328191
|
-
const { name: name2, type: type2, selectionExtent, domains: _d3, range:
|
|
326735
|
+
const { name: name2, type: type2, selectionExtent, domains: _d3, range: _r2, reverse: reverse2 } = scale2, otherScaleProps = __rest$7(scale2, ["name", "type", "selectionExtent", "domains", "range", "reverse"]);
|
|
328192
326736
|
const range2 = assembleScaleRange(scale2.range, name2, channel, model);
|
|
328193
326737
|
const domain2 = assembleDomain(model, channel);
|
|
328194
326738
|
const domainRaw = selectionExtent ? assembleSelectionScaleDomain(model, selectionExtent, scaleComponent, domain2) : null;
|
|
@@ -335441,7 +333985,7 @@ function embedOptionsFromUsermeta(parsedSpec) {
|
|
|
335441
333985
|
}
|
|
335442
333986
|
return opts2;
|
|
335443
333987
|
}
|
|
335444
|
-
function embed(
|
|
333988
|
+
function embed(_x3, _x22) {
|
|
335445
333989
|
return _embed2.apply(this, arguments);
|
|
335446
333990
|
}
|
|
335447
333991
|
function _embed2() {
|
|
@@ -335498,7 +334042,7 @@ function _embed2() {
|
|
|
335498
334042
|
}));
|
|
335499
334043
|
return _embed2.apply(this, arguments);
|
|
335500
334044
|
}
|
|
335501
|
-
function loadOpts(
|
|
334045
|
+
function loadOpts(_x3, _x4) {
|
|
335502
334046
|
return _loadOpts.apply(this, arguments);
|
|
335503
334047
|
}
|
|
335504
334048
|
function _loadOpts() {
|
|
@@ -338455,7 +336999,7 @@ class ClustersJsonAsObsFeatureMatrixLoader extends JsonLoader {
|
|
|
338455
336999
|
const normalize2 = (d) => Math.floor((d - min2) / (max2 - min2) * 255);
|
|
338456
337000
|
return col.map(normalize2);
|
|
338457
337001
|
});
|
|
338458
|
-
const tNormalizedMatrix = range$
|
|
337002
|
+
const tNormalizedMatrix = range$d(shape2[0]).map((i2) => range$d(shape2[1]).map((j) => normalizedMatrix[j][i2]));
|
|
338459
337003
|
const normalizedFlatMatrix = tNormalizedMatrix.flat();
|
|
338460
337004
|
const obsFeatureMatrix = { data: Uint8Array.from(normalizedFlatMatrix) };
|
|
338461
337005
|
this.cachedResult = { obsIndex, featureIndex, obsFeatureMatrix };
|
|
@@ -338512,12 +337056,12 @@ class MoleculesJsonAsObsLabelsLoader extends JsonLoader {
|
|
|
338512
337056
|
if (this.cachedResult) {
|
|
338513
337057
|
return this.cachedResult;
|
|
338514
337058
|
}
|
|
338515
|
-
const obsIndex = range$
|
|
337059
|
+
const obsIndex = range$d(sum$8(Object.values(data2).map((v) => v.length))).map((i2) => String(i2));
|
|
338516
337060
|
let obsLabels = [];
|
|
338517
337061
|
Object.entries(data2).forEach(([gene, locations]) => {
|
|
338518
337062
|
obsLabels = [
|
|
338519
337063
|
...obsLabels,
|
|
338520
|
-
...range$
|
|
337064
|
+
...range$d(locations.length).map(() => gene)
|
|
338521
337065
|
];
|
|
338522
337066
|
});
|
|
338523
337067
|
this.cachedResult = { obsIndex, obsLabels };
|
|
@@ -338543,7 +337087,7 @@ class MoleculesJsonAsObsLocationsLoader extends JsonLoader {
|
|
|
338543
337087
|
return this.cachedResult;
|
|
338544
337088
|
}
|
|
338545
337089
|
const moleculesValues = Object.values(data2);
|
|
338546
|
-
const obsIndex = range$
|
|
337090
|
+
const obsIndex = range$d(sum$8(moleculesValues.map((v) => v.length))).map((i2) => String(i2));
|
|
338547
337091
|
const obsLocationsX = new Float32Array(obsIndex.length);
|
|
338548
337092
|
const obsLocationsY = new Float32Array(obsIndex.length);
|
|
338549
337093
|
let startAt = 0;
|
|
@@ -338589,11 +337133,11 @@ async function initLoader(imageData) {
|
|
|
338589
337133
|
throw new Error(`Failed to fetch metadata: ${response.status}`);
|
|
338590
337134
|
const { metadata: zarrMetadata } = await response.json();
|
|
338591
337135
|
const paths = Object.keys(zarrMetadata).filter((metaKey) => metaKey.includes(".zarray")).map((arrMetaKeys) => arrMetaKeys.slice(0, -7));
|
|
338592
|
-
const data2 = await Promise.all(paths.map((path2) => open
|
|
337136
|
+
const data2 = await Promise.all(paths.map((path2) => open(root2.resolve(path2), { kind: "array" })));
|
|
338593
337137
|
const tileSize = guessTileSize(data2[0]);
|
|
338594
337138
|
source2 = data2.map((d) => new ZarritaPixelSource(createZarrArrayAdapter(d), labels2, tileSize));
|
|
338595
337139
|
} else {
|
|
338596
|
-
const data2 = await open
|
|
337140
|
+
const data2 = await open(root2, { kind: "array" });
|
|
338597
337141
|
source2 = new ZarritaPixelSource(createZarrArrayAdapter(data2), labels2);
|
|
338598
337142
|
}
|
|
338599
337143
|
return {
|
|
@@ -338758,7 +337302,7 @@ class ZarrDataSource {
|
|
|
338758
337302
|
*/
|
|
338759
337303
|
constructor({ url, requestInit: requestInit2, refSpecUrl, store, fileType }) {
|
|
338760
337304
|
if (store) {
|
|
338761
|
-
this.storeRoot = root
|
|
337305
|
+
this.storeRoot = root(store);
|
|
338762
337306
|
} else if (url) {
|
|
338763
337307
|
this.storeRoot = zarrOpenRoot(url, fileType, { requestInit: requestInit2, refSpecUrl });
|
|
338764
337308
|
} else {
|
|
@@ -338789,7 +337333,7 @@ class ZarrDataSource {
|
|
|
338789
337333
|
if (key2.endsWith(".zattrs") || key2.endsWith(".zarray") || key2.endsWith(".zgroup")) {
|
|
338790
337334
|
dirKey = key2.substring(0, key2.length - 8);
|
|
338791
337335
|
}
|
|
338792
|
-
return (await open
|
|
337336
|
+
return (await open(storeRootToUse.resolve(dirKey))).attrs;
|
|
338793
337337
|
}
|
|
338794
337338
|
}
|
|
338795
337339
|
function dirname(path2) {
|
|
@@ -338894,12 +337438,12 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
338894
337438
|
let categoriesValues;
|
|
338895
337439
|
let codesPath;
|
|
338896
337440
|
if (categories) {
|
|
338897
|
-
const { dtype } = await open
|
|
337441
|
+
const { dtype } = await open(storeRoot.resolve(`${prefix2}/${categories}`), { kind: "array" });
|
|
338898
337442
|
if (dtype === "v2:object" || dtype === "|O") {
|
|
338899
337443
|
categoriesValues = await this.getFlatArrDecompressed(`${prefix2}/${categories}`);
|
|
338900
337444
|
}
|
|
338901
337445
|
} else if (encodingType === "categorical") {
|
|
338902
|
-
const { dtype } = await open
|
|
337446
|
+
const { dtype } = await open(storeRoot.resolve(`${path2}/categories`), { kind: "array" });
|
|
338903
337447
|
if (dtype === "v2:object" || dtype === "|O") {
|
|
338904
337448
|
categoriesValues = await this.getFlatArrDecompressed(`${path2}/categories`);
|
|
338905
337449
|
}
|
|
@@ -338907,13 +337451,13 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
338907
337451
|
} else if (encodingType === "string-array") {
|
|
338908
337452
|
return this.getFlatArrDecompressed(path2);
|
|
338909
337453
|
} else {
|
|
338910
|
-
const { dtype } = await open
|
|
337454
|
+
const { dtype } = await open(storeRoot.resolve(path2), { kind: "array" });
|
|
338911
337455
|
if (dtype === "v2:object" || dtype === "|O") {
|
|
338912
337456
|
return this.getFlatArrDecompressed(path2);
|
|
338913
337457
|
}
|
|
338914
337458
|
}
|
|
338915
|
-
const arr = await open
|
|
338916
|
-
const values3 = await get$
|
|
337459
|
+
const arr = await open(storeRoot.resolve(codesPath || path2), { kind: "array" });
|
|
337460
|
+
const values3 = await get$a(arr, [null]);
|
|
338917
337461
|
const { data: data2 } = values3;
|
|
338918
337462
|
const mappedValues = Array.from(data2).map((i2) => !categoriesValues ? String(i2) : categoriesValues[
|
|
338919
337463
|
/** @type {number} */
|
|
@@ -338928,7 +337472,7 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
338928
337472
|
*/
|
|
338929
337473
|
async loadNumeric(path2) {
|
|
338930
337474
|
const { storeRoot } = this;
|
|
338931
|
-
return open
|
|
337475
|
+
return open(storeRoot.resolve(path2), { kind: "array" }).then((arr) => get$a(arr));
|
|
338932
337476
|
}
|
|
338933
337477
|
/**
|
|
338934
337478
|
* Class method for loading specific columns of numeric arrays.
|
|
@@ -338941,8 +337485,8 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
338941
337485
|
*/
|
|
338942
337486
|
async loadNumericForDims(path2, dims) {
|
|
338943
337487
|
const { storeRoot } = this;
|
|
338944
|
-
const arr = open
|
|
338945
|
-
return Promise.all(dims.map((dim) => arr.then((loadedArr) => get$
|
|
337488
|
+
const arr = open(storeRoot.resolve(path2), { kind: "array" });
|
|
337489
|
+
return Promise.all(dims.map((dim) => arr.then((loadedArr) => get$a(loadedArr, [null, dim])))).then((cols) => ({
|
|
338946
337490
|
data: (
|
|
338947
337491
|
/** @type {[ZarrTypedArray<any>, ZarrTypedArray<any>]} */
|
|
338948
337492
|
cols.map((col) => col.data)
|
|
@@ -338958,8 +337502,8 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
338958
337502
|
*/
|
|
338959
337503
|
async getFlatArrDecompressed(path2) {
|
|
338960
337504
|
const { storeRoot } = this;
|
|
338961
|
-
const arr = await open
|
|
338962
|
-
const data2 = await get$
|
|
337505
|
+
const arr = await open(storeRoot.resolve(path2), { kind: "array" });
|
|
337506
|
+
const data2 = await get$a(arr);
|
|
338963
337507
|
if (data2.data?.[Symbol.iterator]) {
|
|
338964
337508
|
return (
|
|
338965
337509
|
/** @type {string[]} */
|
|
@@ -339043,7 +337587,7 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
339043
337587
|
if ("encoding-type" in zattrs && "encoding-version" in zattrs) {
|
|
339044
337588
|
const { "encoding-type": encodingType, "encoding-version": encodingVersion } = zattrs;
|
|
339045
337589
|
if (encodingType === "string" && encodingVersion === "0.2.0") {
|
|
339046
|
-
const arr = await open
|
|
337590
|
+
const arr = await open(storeRoot.resolve(path2), { kind: "array" });
|
|
339047
337591
|
const { data: data2 } = (
|
|
339048
337592
|
/** @type {{ data: ByteStringArray }} */
|
|
339049
337593
|
await arr.getChunk([])
|
|
@@ -339116,10 +337660,10 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
339116
337660
|
throw new Error("Keys for encoding-type or encoding-version not found in AnnDataSource._loadString");
|
|
339117
337661
|
}
|
|
339118
337662
|
}
|
|
339119
|
-
const regex
|
|
337663
|
+
const regex = /^mod\/([^/]*)\/(.*)$/;
|
|
339120
337664
|
function getModPrefix(arrPath) {
|
|
339121
337665
|
if (arrPath) {
|
|
339122
|
-
const matches2 = arrPath.match(regex
|
|
337666
|
+
const matches2 = arrPath.match(regex);
|
|
339123
337667
|
if (matches2 && matches2.length === 3) {
|
|
339124
337668
|
return `mod/${matches2[1]}/`;
|
|
339125
337669
|
}
|
|
@@ -339197,7 +337741,7 @@ class MatrixZarrAsObsFeatureMatrixLoader extends AbstractTwoStepLoader {
|
|
|
339197
337741
|
if (this.arr) {
|
|
339198
337742
|
return this.arr;
|
|
339199
337743
|
}
|
|
339200
|
-
const z2 = await open
|
|
337744
|
+
const z2 = await open(storeRoot, { kind: "array" });
|
|
339201
337745
|
this.arr = await createZarrArrayAdapter(z2).getRaw([null, null]);
|
|
339202
337746
|
return this.arr;
|
|
339203
337747
|
}
|
|
@@ -339322,7 +337866,7 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
|
|
|
339322
337866
|
if (this.sparseArrays) {
|
|
339323
337867
|
return this.sparseArrays;
|
|
339324
337868
|
}
|
|
339325
|
-
this.sparseArrays = Promise.all(["indptr", "indices", "data"].map((name2) => open
|
|
337869
|
+
this.sparseArrays = Promise.all(["indptr", "indices", "data"].map((name2) => open(storeRoot.resolve(`${matrix2}/${name2}`), { kind: "array" })));
|
|
339326
337870
|
return this.sparseArrays;
|
|
339327
337871
|
}
|
|
339328
337872
|
/**
|
|
@@ -339343,11 +337887,11 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
|
|
|
339343
337887
|
if (isColumnAllZeros) {
|
|
339344
337888
|
return geneData;
|
|
339345
337889
|
}
|
|
339346
|
-
const { data: rowIndices } = await get$
|
|
339347
|
-
slice$
|
|
337890
|
+
const { data: rowIndices } = await get$a(indexArr, [
|
|
337891
|
+
slice$4(startRowIndex, endRowIndex)
|
|
339348
337892
|
]);
|
|
339349
|
-
let { data: cellXGeneData } = await get$
|
|
339350
|
-
slice$
|
|
337893
|
+
let { data: cellXGeneData } = await get$a(cellXGeneArr, [
|
|
337894
|
+
slice$4(startRowIndex, endRowIndex)
|
|
339351
337895
|
]);
|
|
339352
337896
|
cellXGeneData = maybeDowncastInt64(cellXGeneData);
|
|
339353
337897
|
for (let rowIndex = 0; rowIndex < rowIndices.length; rowIndex += 1) {
|
|
@@ -339460,7 +338004,7 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
|
|
|
339460
338004
|
this.cellXGene = this._loadCSCSparseCellXGene().then((data2) => toObject(data2));
|
|
339461
338005
|
} else {
|
|
339462
338006
|
if (!this.arr) {
|
|
339463
|
-
this.arr = open
|
|
338007
|
+
this.arr = open(storeRoot.resolve(matrix2), { kind: "array" });
|
|
339464
338008
|
}
|
|
339465
338009
|
this.cellXGene = this.arr.then((z2) => createZarrArrayAdapter(z2).getRaw(null)).then(({ data: data2 }) => toObject(maybeDowncastInt64(data2)));
|
|
339466
338010
|
}
|
|
@@ -339506,10 +338050,10 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
|
|
|
339506
338050
|
genes = await this._loadCSRGeneSelection(selection);
|
|
339507
338051
|
} else {
|
|
339508
338052
|
if (!this.arr) {
|
|
339509
|
-
this.arr = open
|
|
338053
|
+
this.arr = open(storeRoot.resolve(matrix2), { kind: "array" });
|
|
339510
338054
|
}
|
|
339511
338055
|
const indices = await this._getGeneIndices(selection);
|
|
339512
|
-
genes = await Promise.all(indices.map((index2) => this.arr.then((z2) => get$
|
|
338056
|
+
genes = await Promise.all(indices.map((index2) => this.arr.then((z2) => get$a(z2, [null, index2])).then(({ data: data2 }) => maybeDowncastInt64(data2))));
|
|
339513
338057
|
}
|
|
339514
338058
|
return { data: genes, url: null };
|
|
339515
338059
|
}
|
|
@@ -340501,7 +339045,13 @@ class GenomicProfilesZarrLoader extends AbstractTwoStepLoader {
|
|
|
340501
339045
|
}
|
|
340502
339046
|
load() {
|
|
340503
339047
|
const { url, requestInit: requestInit2 } = this;
|
|
340504
|
-
|
|
339048
|
+
const storeRoot = this.dataSource.getStoreRoot("/");
|
|
339049
|
+
return this.loadAttrs().then((attrs) => Promise.resolve(new LoaderResult({
|
|
339050
|
+
genomicProfiles: {
|
|
339051
|
+
storeRoot,
|
|
339052
|
+
attrs
|
|
339053
|
+
}
|
|
339054
|
+
}, url, null, requestInit2)));
|
|
340505
339055
|
}
|
|
340506
339056
|
}
|
|
340507
339057
|
class ImageWrapper {
|
|
@@ -340533,10 +339083,11 @@ class ImageWrapper {
|
|
|
340533
339083
|
getModelMatrix() {
|
|
340534
339084
|
const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options;
|
|
340535
339085
|
if ("multiscales" in this.vivLoader.metadata) {
|
|
340536
|
-
const { multiscales: [{ coordinateTransformations, axes }] } = this.vivLoader.metadata;
|
|
339086
|
+
const { multiscales: [{ datasets, coordinateTransformations: coordinateTransformationsFromFile, axes }] } = this.vivLoader.metadata;
|
|
340537
339087
|
const ngffAxes = getNgffAxes(axes);
|
|
340538
339088
|
const transformMatrixFromOptions = coordinateTransformationsToMatrix(coordinateTransformationsFromOptions, ngffAxes);
|
|
340539
|
-
const
|
|
339089
|
+
const normCoordinateTransformationsFromFile = normalizeCoordinateTransformations(coordinateTransformationsFromFile, datasets);
|
|
339090
|
+
const transformMatrixFromFile = coordinateTransformationsToMatrix(normCoordinateTransformationsFromFile, ngffAxes);
|
|
340540
339091
|
const transformMatrix = transformMatrixFromFile.multiplyLeft(transformMatrixFromOptions);
|
|
340541
339092
|
return transformMatrix;
|
|
340542
339093
|
}
|
|
@@ -341087,7 +339638,6 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
|
|
|
341087
339638
|
}
|
|
341088
339639
|
if (!this.locations) {
|
|
341089
339640
|
const modelMatrix2 = await this.loadModelMatrix();
|
|
341090
|
-
this.locations = await this.dataSource.loadNumericForDims(getCoordsPath(path2), [0, 1]);
|
|
341091
339641
|
let locations;
|
|
341092
339642
|
const formatVersion = await this.dataSource.getFormatVersion(path2);
|
|
341093
339643
|
if (formatVersion === "0.1") {
|
|
@@ -344301,7 +342851,7 @@ class BN {
|
|
|
344301
342851
|
return BN.new(num, isSigned);
|
|
344302
342852
|
}
|
|
344303
342853
|
}
|
|
344304
|
-
var _a$3, _b, _c, _d2, _e, _f, _g, _h, _j, _k, _l, _m2,
|
|
342854
|
+
var _a$3, _b, _c, _d2, _e, _f, _g, _h, _j, _k, _l, _m2, _o, _p2, _q$1, _r, _s, _t, _u, _v, _w, _x$1;
|
|
344305
342855
|
class DataType2 {
|
|
344306
342856
|
/** @nocollapse */
|
|
344307
342857
|
static isNull(x2) {
|
|
@@ -344616,8 +343166,8 @@ class Timestamp_ extends DataType2 {
|
|
|
344616
343166
|
return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ``}>`;
|
|
344617
343167
|
}
|
|
344618
343168
|
}
|
|
344619
|
-
|
|
344620
|
-
Timestamp_[
|
|
343169
|
+
_o = Symbol.toStringTag;
|
|
343170
|
+
Timestamp_[_o] = ((proto2) => {
|
|
344621
343171
|
proto2.unit = null;
|
|
344622
343172
|
proto2.timezone = null;
|
|
344623
343173
|
proto2.ArrayType = BigInt64Array;
|
|
@@ -344671,8 +343221,8 @@ class List3 extends DataType2 {
|
|
|
344671
343221
|
return this.valueType.ArrayType;
|
|
344672
343222
|
}
|
|
344673
343223
|
}
|
|
344674
|
-
|
|
344675
|
-
List3[
|
|
343224
|
+
_r = Symbol.toStringTag;
|
|
343225
|
+
List3[_r] = ((proto2) => {
|
|
344676
343226
|
proto2.children = null;
|
|
344677
343227
|
return proto2[Symbol.toStringTag] = "List";
|
|
344678
343228
|
})(List3.prototype);
|
|
@@ -344685,8 +343235,8 @@ class Struct extends DataType2 {
|
|
|
344685
343235
|
return `Struct<{${this.children.map((f2) => `${f2.name}:${f2.type}`).join(`, `)}}>`;
|
|
344686
343236
|
}
|
|
344687
343237
|
}
|
|
344688
|
-
|
|
344689
|
-
Struct[
|
|
343238
|
+
_s = Symbol.toStringTag;
|
|
343239
|
+
Struct[_s] = ((proto2) => {
|
|
344690
343240
|
proto2.children = null;
|
|
344691
343241
|
return proto2[Symbol.toStringTag] = "Struct";
|
|
344692
343242
|
})(Struct.prototype);
|
|
@@ -344702,8 +343252,8 @@ class Union_ extends DataType2 {
|
|
|
344702
343252
|
return `${this[Symbol.toStringTag]}<${this.children.map((x2) => `${x2.type}`).join(` | `)}>`;
|
|
344703
343253
|
}
|
|
344704
343254
|
}
|
|
344705
|
-
|
|
344706
|
-
Union_[
|
|
343255
|
+
_t = Symbol.toStringTag;
|
|
343256
|
+
Union_[_t] = ((proto2) => {
|
|
344707
343257
|
proto2.mode = null;
|
|
344708
343258
|
proto2.typeIds = null;
|
|
344709
343259
|
proto2.children = null;
|
|
@@ -344753,14 +343303,14 @@ FixedSizeList3[_v] = ((proto2) => {
|
|
|
344753
343303
|
})(FixedSizeList3.prototype);
|
|
344754
343304
|
class Map_ extends DataType2 {
|
|
344755
343305
|
constructor(entries2, keysSorted = false) {
|
|
344756
|
-
var
|
|
343306
|
+
var _y3, _z2, _0;
|
|
344757
343307
|
super(Type.Map);
|
|
344758
343308
|
this.children = [entries2];
|
|
344759
343309
|
this.keysSorted = keysSorted;
|
|
344760
343310
|
if (entries2) {
|
|
344761
343311
|
entries2["name"] = "entries";
|
|
344762
|
-
if ((
|
|
344763
|
-
const key2 = (
|
|
343312
|
+
if ((_y3 = entries2 === null || entries2 === void 0 ? void 0 : entries2.type) === null || _y3 === void 0 ? void 0 : _y3.children) {
|
|
343313
|
+
const key2 = (_z2 = entries2 === null || entries2 === void 0 ? void 0 : entries2.type) === null || _z2 === void 0 ? void 0 : _z2.children[0];
|
|
344764
343314
|
if (key2) {
|
|
344765
343315
|
key2["name"] = "key";
|
|
344766
343316
|
}
|
|
@@ -344784,8 +343334,8 @@ class Map_ extends DataType2 {
|
|
|
344784
343334
|
return `Map<{${this.children[0].type.children.map((f2) => `${f2.name}:${f2.type}`).join(`, `)}}>`;
|
|
344785
343335
|
}
|
|
344786
343336
|
}
|
|
344787
|
-
|
|
344788
|
-
Map_[
|
|
343337
|
+
_w = Symbol.toStringTag;
|
|
343338
|
+
Map_[_w] = ((proto2) => {
|
|
344789
343339
|
proto2.children = null;
|
|
344790
343340
|
proto2.keysSorted = null;
|
|
344791
343341
|
return proto2[Symbol.toStringTag] = "Map_";
|
|
@@ -345639,7 +344189,7 @@ function wrapGet(fn2) {
|
|
|
345639
344189
|
return (data2, _1) => data2.getValid(_1) ? fn2(data2, _1) : null;
|
|
345640
344190
|
}
|
|
345641
344191
|
const epochDaysToMs = (data2, index2) => 864e5 * data2[index2];
|
|
345642
|
-
const getNull = (
|
|
344192
|
+
const getNull = (_data2, _index) => null;
|
|
345643
344193
|
const getVariableWidthBytes = (values3, valueOffsets, index2) => {
|
|
345644
344194
|
if (index2 + 1 >= valueOffsets.length) {
|
|
345645
344195
|
return null;
|
|
@@ -346066,10 +344616,10 @@ function compareObject(comparators, obj, keys2) {
|
|
|
346066
344616
|
rValItr.return && rValItr.return();
|
|
346067
344617
|
return false;
|
|
346068
344618
|
}
|
|
346069
|
-
function getBool(
|
|
344619
|
+
function getBool(_data2, _index, byte, bit) {
|
|
346070
344620
|
return (byte & 1 << bit) !== 0;
|
|
346071
344621
|
}
|
|
346072
|
-
function getBit(
|
|
344622
|
+
function getBit(_data2, _index, byte, bit) {
|
|
346073
344623
|
return (byte & 1 << bit) >> bit;
|
|
346074
344624
|
}
|
|
346075
344625
|
function truncateBitmap(offset2, length2, bitmap) {
|
|
@@ -356582,13 +355132,18 @@ async function getReadParquet() {
|
|
|
356582
355132
|
await module2.default();
|
|
356583
355133
|
return module2.readParquet;
|
|
356584
355134
|
}
|
|
356585
|
-
const
|
|
355135
|
+
const elementRegex = /^shapes\/([^/]*)$/;
|
|
355136
|
+
const subElementRegex = /^shapes\/([^/]*)\/(.*)$/;
|
|
356586
355137
|
function getShapesPrefix(arrPath) {
|
|
356587
355138
|
if (arrPath) {
|
|
356588
|
-
const matches2 = arrPath.match(
|
|
355139
|
+
const matches2 = arrPath.match(subElementRegex);
|
|
356589
355140
|
if (matches2 && matches2.length === 3) {
|
|
356590
355141
|
return `shapes/${matches2[1]}/`;
|
|
356591
355142
|
}
|
|
355143
|
+
const elementMatches = arrPath.match(elementRegex);
|
|
355144
|
+
if (elementMatches && elementMatches.length === 2) {
|
|
355145
|
+
return `shapes/${elementMatches[1]}/`;
|
|
355146
|
+
}
|
|
356592
355147
|
}
|
|
356593
355148
|
return "";
|
|
356594
355149
|
}
|
|
@@ -360666,26 +359221,26 @@ class Matrix42 {
|
|
|
360666
359221
|
_z.z = 1;
|
|
360667
359222
|
}
|
|
360668
359223
|
_z.normalize();
|
|
360669
|
-
|
|
360670
|
-
if (
|
|
359224
|
+
_x.crossVectors(up, _z);
|
|
359225
|
+
if (_x.lengthSq() === 0) {
|
|
360671
359226
|
if (Math.abs(up.z) === 1) {
|
|
360672
359227
|
_z.x += 1e-4;
|
|
360673
359228
|
} else {
|
|
360674
359229
|
_z.z += 1e-4;
|
|
360675
359230
|
}
|
|
360676
359231
|
_z.normalize();
|
|
360677
|
-
|
|
359232
|
+
_x.crossVectors(up, _z);
|
|
360678
359233
|
}
|
|
360679
|
-
|
|
360680
|
-
|
|
360681
|
-
te[0] =
|
|
360682
|
-
te[4] =
|
|
359234
|
+
_x.normalize();
|
|
359235
|
+
_y.crossVectors(_z, _x);
|
|
359236
|
+
te[0] = _x.x;
|
|
359237
|
+
te[4] = _y.x;
|
|
360683
359238
|
te[8] = _z.x;
|
|
360684
|
-
te[1] =
|
|
360685
|
-
te[5] =
|
|
359239
|
+
te[1] = _x.y;
|
|
359240
|
+
te[5] = _y.y;
|
|
360686
359241
|
te[9] = _z.y;
|
|
360687
|
-
te[2] =
|
|
360688
|
-
te[6] =
|
|
359242
|
+
te[2] = _x.z;
|
|
359243
|
+
te[6] = _y.z;
|
|
360689
359244
|
te[10] = _z.z;
|
|
360690
359245
|
return this;
|
|
360691
359246
|
}
|
|
@@ -361175,8 +359730,8 @@ const _v1$5 = /* @__PURE__ */ new Vector32();
|
|
|
361175
359730
|
const _m1$2 = /* @__PURE__ */ new Matrix42();
|
|
361176
359731
|
const _zero = /* @__PURE__ */ new Vector32(0, 0, 0);
|
|
361177
359732
|
const _one = /* @__PURE__ */ new Vector32(1, 1, 1);
|
|
361178
|
-
const
|
|
361179
|
-
const
|
|
359733
|
+
const _x = /* @__PURE__ */ new Vector32();
|
|
359734
|
+
const _y = /* @__PURE__ */ new Vector32();
|
|
361180
359735
|
const _z = /* @__PURE__ */ new Vector32();
|
|
361181
359736
|
const _matrix = /* @__PURE__ */ new Matrix42();
|
|
361182
359737
|
const _quaternion$3 = /* @__PURE__ */ new Quaternion2();
|
|
@@ -387669,11 +386224,11 @@ class GLTFCubicSplineInterpolant extends Interpolant {
|
|
|
387669
386224
|
return result;
|
|
387670
386225
|
}
|
|
387671
386226
|
}
|
|
387672
|
-
const
|
|
386227
|
+
const _q = new Quaternion2();
|
|
387673
386228
|
class GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant {
|
|
387674
386229
|
interpolate_(i1, t02, t4, t12) {
|
|
387675
386230
|
const result = super.interpolate_(i1, t02, t4, t12);
|
|
387676
|
-
|
|
386231
|
+
_q.fromArray(result).normalize().toArray(result);
|
|
387677
386232
|
return result;
|
|
387678
386233
|
}
|
|
387679
386234
|
}
|