@idetik/core 0.7.8 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +94 -70
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +44 -27
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/layers/volume_layer.d.ts +1 -1
- package/dist/types/src/layers/volume_layer.d.ts.map +1 -1
- package/dist/types/src/objects/renderable/volume_renderable.d.ts +3 -0
- package/dist/types/src/objects/renderable/volume_renderable.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -874,7 +874,7 @@ declare class VolumeLayer extends Layer {
|
|
|
874
874
|
private debugShowWireframes_;
|
|
875
875
|
debugShowDegenerateRays: boolean;
|
|
876
876
|
color: vec3;
|
|
877
|
-
|
|
877
|
+
relativeStepSize: number;
|
|
878
878
|
maxIntensity: number;
|
|
879
879
|
opacityMultiplier: number;
|
|
880
880
|
earlyTerminationAlpha: number;
|
package/dist/index.js
CHANGED
|
@@ -347,11 +347,12 @@ vec3 boundingboxMin = vec3(-0.50);
|
|
|
347
347
|
vec3 boundingboxMax = vec3(0.50);
|
|
348
348
|
|
|
349
349
|
uniform bool DebugShowDegenerateRays;
|
|
350
|
-
uniform float SamplesPerUnit;
|
|
351
350
|
uniform float MaxIntensity;
|
|
352
351
|
uniform float OpacityMultiplier;
|
|
353
352
|
uniform float EarlyTerminationAlpha;
|
|
354
353
|
uniform vec3 VolumeColor;
|
|
354
|
+
uniform float RelativeStepSize;
|
|
355
|
+
uniform vec3 VoxelScale;
|
|
355
356
|
|
|
356
357
|
vec2 findBoxIntersectionsAlongRay(vec3 rayOrigin, vec3 rayDir, vec3 boxMin, vec3 boxMax) {
|
|
357
358
|
vec3 reciprocalRayDir = 1.0 / rayDir;
|
|
@@ -390,19 +391,35 @@ void main() {
|
|
|
390
391
|
exitPoint = clamp(exitPoint + 0.5, 0.0, 1.0);
|
|
391
392
|
|
|
392
393
|
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
393
397
|
vec3 rayWithinModel = exitPoint - entryPoint;
|
|
394
|
-
|
|
395
|
-
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
vec3 textureSize = vec3(textureSize(ImageSampler, 0));
|
|
401
|
+
vec3 rayInVoxels = rayWithinModel * textureSize;
|
|
402
|
+
float rayLengthInVoxels = length(rayInVoxels);
|
|
403
|
+
int numSamples = max(int(ceil(rayLengthInVoxels / RelativeStepSize)), 1);
|
|
396
404
|
vec3 stepIncrement = rayWithinModel / float(numSamples);
|
|
397
405
|
|
|
398
406
|
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
vec3 stepInWorldSpace = stepIncrement * textureSize * VoxelScale;
|
|
411
|
+
float worldSpaceStepSize = length(stepInWorldSpace);
|
|
412
|
+
|
|
413
|
+
|
|
399
414
|
vec3 position = entryPoint;
|
|
400
415
|
vec4 accumulatedColor = vec4(0.0);
|
|
401
416
|
float sampledData, sampleAlpha, blendedSampleAlpha;
|
|
402
417
|
|
|
403
418
|
|
|
404
419
|
|
|
405
|
-
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
float intensityScale = (OpacityMultiplier / MaxIntensity) * worldSpaceStepSize;
|
|
406
423
|
|
|
407
424
|
|
|
408
425
|
for (int i = 0; i < numSamples && accumulatedColor.a < EarlyTerminationAlpha; i++) {
|
|
@@ -1151,7 +1168,7 @@ function q(g, A, I) {
|
|
|
1151
1168
|
function PA(g, A) {
|
|
1152
1169
|
return g[0] = A[0], g[1] = A[1], g[2] = A[2], g;
|
|
1153
1170
|
}
|
|
1154
|
-
function
|
|
1171
|
+
function SA(g, A, I, B) {
|
|
1155
1172
|
return g[0] = A, g[1] = I, g[2] = B, g;
|
|
1156
1173
|
}
|
|
1157
1174
|
function rI(g, A, I) {
|
|
@@ -1334,7 +1351,7 @@ function VI(g, A) {
|
|
|
1334
1351
|
return A;
|
|
1335
1352
|
};
|
|
1336
1353
|
})();
|
|
1337
|
-
class
|
|
1354
|
+
class RA {
|
|
1338
1355
|
min;
|
|
1339
1356
|
max;
|
|
1340
1357
|
/**
|
|
@@ -1347,7 +1364,7 @@ class SA {
|
|
|
1347
1364
|
this.min = A ? gA(A) : q(1 / 0, 1 / 0, 1 / 0), this.max = I ? gA(I) : q(-1 / 0, -1 / 0, -1 / 0);
|
|
1348
1365
|
}
|
|
1349
1366
|
clone() {
|
|
1350
|
-
return new
|
|
1367
|
+
return new RA(this.min, this.max);
|
|
1351
1368
|
}
|
|
1352
1369
|
isEmpty() {
|
|
1353
1370
|
return this.max[0] <= this.min[0] || this.max[1] <= this.min[1] || this.max[2] <= this.min[2];
|
|
@@ -1426,7 +1443,7 @@ class uA extends Dg {
|
|
|
1426
1443
|
const A = this.getAttribute("position");
|
|
1427
1444
|
if (!A || this.vertexCount === 0)
|
|
1428
1445
|
throw new Error("Failed to generate bounding box");
|
|
1429
|
-
const I = (A.offset ?? 0) / Float32Array.BYTES_PER_ELEMENT, B = new
|
|
1446
|
+
const I = (A.offset ?? 0) / Float32Array.BYTES_PER_ELEMENT, B = new RA(), C = f();
|
|
1430
1447
|
for (let Q = 0; Q < this.vertexData_.length; Q += this.stride)
|
|
1431
1448
|
C[0] = this.vertexData_[Q + I + 0], C[1] = this.vertexData_[Q + I + 1], C[2] = this.vertexData_[Q + I + 2], B.expandWithPoint(C);
|
|
1432
1449
|
this.boundingBox_ = B;
|
|
@@ -2182,7 +2199,7 @@ class _C {
|
|
|
2182
2199
|
}
|
|
2183
2200
|
const n = UB();
|
|
2184
2201
|
xC(n, Q.min, Q.max, 0.5);
|
|
2185
|
-
const [S, G] = this.getZBounds(A), c = new
|
|
2202
|
+
const [S, G] = this.getZBounds(A), c = new RA(
|
|
2186
2203
|
q(Q.min[0], Q.min[1], S),
|
|
2187
2204
|
q(Q.max[0], Q.max[1], G)
|
|
2188
2205
|
);
|
|
@@ -2305,7 +2322,7 @@ class _C {
|
|
|
2305
2322
|
return A && B ? E.fallbackVisible : I && B ? E.visibleCurrent : A ? E.fallbackBackground : I && C ? E.prefetchSpace : null;
|
|
2306
2323
|
}
|
|
2307
2324
|
isChunkWithinBounds(A, I) {
|
|
2308
|
-
const B = new
|
|
2325
|
+
const B = new RA(
|
|
2309
2326
|
q(A.offset.x, A.offset.y, A.offset.z),
|
|
2310
2327
|
q(
|
|
2311
2328
|
A.offset.x + A.shape.x * A.scale.x,
|
|
@@ -2313,7 +2330,7 @@ class _C {
|
|
|
2313
2330
|
A.offset.z + A.shape.z * A.scale.z
|
|
2314
2331
|
)
|
|
2315
2332
|
);
|
|
2316
|
-
return
|
|
2333
|
+
return RA.intersects(B, I);
|
|
2317
2334
|
}
|
|
2318
2335
|
fallbackLOD() {
|
|
2319
2336
|
return Math.min(this.policy_.lod.max, this.store_.getLowestResLOD());
|
|
@@ -2346,7 +2363,7 @@ class _C {
|
|
|
2346
2363
|
getPaddedBounds(A) {
|
|
2347
2364
|
const I = this.store_.dimensions, B = I.x.lods[this.currentLOD_], C = I.y.lods[this.currentLOD_], Q = I.z?.lods[this.currentLOD_], E = B.chunkSize * B.scale * this.policy_.prefetch.x, i = C.chunkSize * C.scale * this.policy_.prefetch.y;
|
|
2348
2365
|
let o = 0;
|
|
2349
|
-
return Q && (o = Q.chunkSize * Q.scale * this.policy_.prefetch.z), new
|
|
2366
|
+
return Q && (o = Q.chunkSize * Q.scale * this.policy_.prefetch.z), new RA(
|
|
2350
2367
|
q(
|
|
2351
2368
|
A.min[0] - E,
|
|
2352
2369
|
A.min[1] - i,
|
|
@@ -3206,22 +3223,22 @@ class tQ {
|
|
|
3206
3223
|
setWithViewProjection(A) {
|
|
3207
3224
|
const I = f();
|
|
3208
3225
|
this.planes_[0].set(
|
|
3209
|
-
|
|
3226
|
+
SA(I, A[3] + A[0], A[7] + A[4], A[11] + A[8]),
|
|
3210
3227
|
A[15] + A[12]
|
|
3211
3228
|
), this.planes_[1].set(
|
|
3212
|
-
|
|
3229
|
+
SA(I, A[3] - A[0], A[7] - A[4], A[11] - A[8]),
|
|
3213
3230
|
A[15] - A[12]
|
|
3214
3231
|
), this.planes_[2].set(
|
|
3215
|
-
|
|
3232
|
+
SA(I, A[3] - A[1], A[7] - A[5], A[11] - A[9]),
|
|
3216
3233
|
A[15] - A[13]
|
|
3217
3234
|
), this.planes_[3].set(
|
|
3218
|
-
|
|
3235
|
+
SA(I, A[3] + A[1], A[7] + A[5], A[11] + A[9]),
|
|
3219
3236
|
A[15] + A[13]
|
|
3220
3237
|
), this.planes_[4].set(
|
|
3221
|
-
|
|
3238
|
+
SA(I, A[3] + A[2], A[7] + A[6], A[11] + A[10]),
|
|
3222
3239
|
A[15] + A[14]
|
|
3223
3240
|
), this.planes_[5].set(
|
|
3224
|
-
|
|
3241
|
+
SA(I, A[3] - A[2], A[7] - A[6], A[11] - A[10]),
|
|
3225
3242
|
A[15] - A[14]
|
|
3226
3243
|
);
|
|
3227
3244
|
for (const B of this.planes_) B.normalize();
|
|
@@ -4317,12 +4334,18 @@ class UQ extends uA {
|
|
|
4317
4334
|
}
|
|
4318
4335
|
}
|
|
4319
4336
|
class kQ extends TA {
|
|
4337
|
+
voxelScale = q(1, 1, 1);
|
|
4320
4338
|
constructor(A) {
|
|
4321
4339
|
super(), this.geometry = new UQ(1, 1, 1, 1, 1, 1), this.setTexture(0, A), this.programName = LQ(A.dataType), this.cullFaceMode = "front", this.depthTest = !1;
|
|
4322
4340
|
}
|
|
4323
4341
|
get type() {
|
|
4324
4342
|
return "VolumeRenderable";
|
|
4325
4343
|
}
|
|
4344
|
+
getUniforms() {
|
|
4345
|
+
return {
|
|
4346
|
+
VoxelScale: this.voxelScale
|
|
4347
|
+
};
|
|
4348
|
+
}
|
|
4326
4349
|
}
|
|
4327
4350
|
function LQ(g) {
|
|
4328
4351
|
switch (g) {
|
|
@@ -4404,7 +4427,7 @@ class ro extends wA {
|
|
|
4404
4427
|
debugShowWireframes_ = !1;
|
|
4405
4428
|
debugShowDegenerateRays = !1;
|
|
4406
4429
|
color = q(1, 1, 1);
|
|
4407
|
-
|
|
4430
|
+
relativeStepSize = 1;
|
|
4408
4431
|
maxIntensity = 255;
|
|
4409
4432
|
opacityMultiplier = 0.1;
|
|
4410
4433
|
earlyTerminationAlpha = 0.99;
|
|
@@ -4463,20 +4486,21 @@ class ro extends wA {
|
|
|
4463
4486
|
this.lastLoadedTime_ = I, this.state !== "ready" && this.setState("ready");
|
|
4464
4487
|
}
|
|
4465
4488
|
updateVolumeChunk(A, I) {
|
|
4466
|
-
A.transform.setScale([
|
|
4467
|
-
I.shape.x * I.scale.x,
|
|
4468
|
-
I.shape.y * I.scale.y,
|
|
4469
|
-
I.shape.z * I.scale.z
|
|
4470
|
-
]);
|
|
4471
4489
|
const B = {
|
|
4490
|
+
x: I.shape.x * I.scale.x,
|
|
4491
|
+
y: I.shape.y * I.scale.y,
|
|
4492
|
+
z: I.shape.z * I.scale.z
|
|
4493
|
+
};
|
|
4494
|
+
A.transform.setScale([B.x, B.y, B.z]), SA(A.voxelScale, I.scale.x, I.scale.y, I.scale.z);
|
|
4495
|
+
const C = {
|
|
4472
4496
|
x: I.shape.x * I.scale.x / 2,
|
|
4473
4497
|
y: I.shape.y * I.scale.y / 2,
|
|
4474
4498
|
z: I.shape.z * I.scale.z / 2
|
|
4475
4499
|
};
|
|
4476
4500
|
A.transform.setTranslation([
|
|
4477
|
-
I.offset.x +
|
|
4478
|
-
I.offset.y +
|
|
4479
|
-
I.offset.z +
|
|
4501
|
+
I.offset.x + C.x,
|
|
4502
|
+
I.offset.y + C.y,
|
|
4503
|
+
I.offset.z + C.z
|
|
4480
4504
|
]);
|
|
4481
4505
|
}
|
|
4482
4506
|
releaseAndRemoveChunks(A) {
|
|
@@ -4505,7 +4529,7 @@ class ro extends wA {
|
|
|
4505
4529
|
getUniforms() {
|
|
4506
4530
|
return {
|
|
4507
4531
|
DebugShowDegenerateRays: Number(this.debugShowDegenerateRays),
|
|
4508
|
-
|
|
4532
|
+
RelativeStepSize: this.relativeStepSize,
|
|
4509
4533
|
MaxIntensity: this.maxIntensity,
|
|
4510
4534
|
OpacityMultiplier: this.opacityMultiplier,
|
|
4511
4535
|
VolumeColor: this.color,
|
|
@@ -5327,7 +5351,7 @@ function HB(g) {
|
|
|
5327
5351
|
}[g];
|
|
5328
5352
|
return u(I, `Unknown or unsupported data_type: ${g}`), I;
|
|
5329
5353
|
}
|
|
5330
|
-
function
|
|
5354
|
+
function cA(g, A) {
|
|
5331
5355
|
const I = g.length;
|
|
5332
5356
|
typeof A == "string" && (A = A === "C" ? Array.from({ length: I }, (Q, E) => E) : Array.from({ length: I }, (Q, E) => I - 1 - E)), u(I === A.length, "Order length must match the number of dimensions.");
|
|
5333
5357
|
let B = 1, C = new Array(I);
|
|
@@ -5483,7 +5507,7 @@ class pI {
|
|
|
5483
5507
|
#C;
|
|
5484
5508
|
#B;
|
|
5485
5509
|
constructor(A, I) {
|
|
5486
|
-
this.#B = A?.endian, this.#I = HB(I.data_type), this.#C = I.shape, this.#A =
|
|
5510
|
+
this.#B = A?.endian, this.#I = HB(I.data_type), this.#C = I.shape, this.#A = cA(I.shape, "C");
|
|
5487
5511
|
const B = new this.#I(0);
|
|
5488
5512
|
this.#g = B.BYTES_PER_ELEMENT;
|
|
5489
5513
|
}
|
|
@@ -5581,7 +5605,7 @@ class Rg {
|
|
|
5581
5605
|
u(I, "JsonCodec does not yet support non-strict decoding.");
|
|
5582
5606
|
const B = sI(A), C = B.pop();
|
|
5583
5607
|
B.pop(), u(C, "0D not implemented for JsonCodec.");
|
|
5584
|
-
const Q =
|
|
5608
|
+
const Q = cA(C, "C");
|
|
5585
5609
|
return { data: B, shape: C, stride: Q };
|
|
5586
5610
|
}
|
|
5587
5611
|
}
|
|
@@ -5604,7 +5628,7 @@ function VQ(g, A) {
|
|
|
5604
5628
|
) : I = new g.constructor(g.data.length), {
|
|
5605
5629
|
data: I,
|
|
5606
5630
|
shape: g.shape,
|
|
5607
|
-
stride:
|
|
5631
|
+
stride: cA(g.shape, A)
|
|
5608
5632
|
};
|
|
5609
5633
|
}
|
|
5610
5634
|
function vQ(g, A) {
|
|
@@ -5659,7 +5683,7 @@ class Ng {
|
|
|
5659
5683
|
return {
|
|
5660
5684
|
data: A.data,
|
|
5661
5685
|
shape: A.shape,
|
|
5662
|
-
stride:
|
|
5686
|
+
stride: cA(A.shape, this.#A)
|
|
5663
5687
|
};
|
|
5664
5688
|
}
|
|
5665
5689
|
}
|
|
@@ -5668,7 +5692,7 @@ class cg {
|
|
|
5668
5692
|
#A;
|
|
5669
5693
|
#I;
|
|
5670
5694
|
constructor(A) {
|
|
5671
|
-
this.#A = A, this.#I =
|
|
5695
|
+
this.#A = A, this.#I = cA(A, "C");
|
|
5672
5696
|
}
|
|
5673
5697
|
static fromConfig(A, I) {
|
|
5674
5698
|
return new cg(I.shape);
|
|
@@ -5832,7 +5856,7 @@ function gE(g, A) {
|
|
|
5832
5856
|
codecs: I.codecs
|
|
5833
5857
|
}),
|
|
5834
5858
|
get_strides(E) {
|
|
5835
|
-
return
|
|
5859
|
+
return cA(E, Q);
|
|
5836
5860
|
},
|
|
5837
5861
|
get_chunk_bytes: AE(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
|
|
5838
5862
|
};
|
|
@@ -5848,7 +5872,7 @@ function gE(g, A) {
|
|
|
5848
5872
|
codecs: A.codecs
|
|
5849
5873
|
}),
|
|
5850
5874
|
get_strides(Q) {
|
|
5851
|
-
return
|
|
5875
|
+
return cA(Q, C);
|
|
5852
5876
|
},
|
|
5853
5877
|
async get_chunk_bytes(Q, E) {
|
|
5854
5878
|
let i = B.encode_chunk_key(Q), o = g.resolve(i).path;
|
|
@@ -9673,7 +9697,7 @@ function ME(g) {
|
|
|
9673
9697
|
}
|
|
9674
9698
|
const KE = Math.min(navigator.hardwareConcurrency, 8);
|
|
9675
9699
|
let BA = [], HE = 0, uB = 0;
|
|
9676
|
-
const
|
|
9700
|
+
const UA = /* @__PURE__ */ new Map(), kI = /* @__PURE__ */ new Set();
|
|
9677
9701
|
function TB(g) {
|
|
9678
9702
|
const A = BA.find((I) => I.worker === g);
|
|
9679
9703
|
return A || U.error(
|
|
@@ -9682,7 +9706,7 @@ function TB(g) {
|
|
|
9682
9706
|
), A;
|
|
9683
9707
|
}
|
|
9684
9708
|
function qE(g, A) {
|
|
9685
|
-
const { id: I, success: B } = g.data, C =
|
|
9709
|
+
const { id: I, success: B } = g.data, C = UA.get(I);
|
|
9686
9710
|
if (!C) {
|
|
9687
9711
|
kI.has(I) ? kI.delete(I) : U.warn(
|
|
9688
9712
|
"ZarrWorker",
|
|
@@ -9691,7 +9715,7 @@ function qE(g, A) {
|
|
|
9691
9715
|
);
|
|
9692
9716
|
return;
|
|
9693
9717
|
}
|
|
9694
|
-
|
|
9718
|
+
UA.delete(I), C.abortListener && C.abortSignal && C.abortSignal.removeEventListener("abort", C.abortListener);
|
|
9695
9719
|
const Q = TB(A);
|
|
9696
9720
|
Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q && U.error(
|
|
9697
9721
|
"ZarrWorker",
|
|
@@ -9718,8 +9742,8 @@ function yB(g, A) {
|
|
|
9718
9742
|
}
|
|
9719
9743
|
const B = I?.workerId;
|
|
9720
9744
|
if (B !== void 0)
|
|
9721
|
-
for (const [C, Q] of
|
|
9722
|
-
Q.workerId === B && (Q.reject(new Error(`Worker error: ${g.message}`)),
|
|
9745
|
+
for (const [C, Q] of UA.entries())
|
|
9746
|
+
Q.workerId === B && (Q.reject(new Error(`Worker error: ${g.message}`)), UA.delete(C));
|
|
9723
9747
|
try {
|
|
9724
9748
|
const C = WB();
|
|
9725
9749
|
BA.push({
|
|
@@ -9750,12 +9774,12 @@ async function fE(g, A, I) {
|
|
|
9750
9774
|
reject: C,
|
|
9751
9775
|
workerId: Q.workerId
|
|
9752
9776
|
};
|
|
9753
|
-
if (
|
|
9777
|
+
if (UA.set(E, i), I?.signal) {
|
|
9754
9778
|
const o = () => {
|
|
9755
9779
|
Q.worker.postMessage({
|
|
9756
9780
|
id: E,
|
|
9757
9781
|
type: "cancel"
|
|
9758
|
-
}),
|
|
9782
|
+
}), UA.delete(E), kI.add(E), Q.pendingCount--, C(new DOMException("Operation was aborted", "AbortError"));
|
|
9759
9783
|
};
|
|
9760
9784
|
if (I.signal.aborted) {
|
|
9761
9785
|
o(), kI.delete(E);
|
|
@@ -9804,7 +9828,7 @@ async function mE(g, A, I, B) {
|
|
|
9804
9828
|
function uE() {
|
|
9805
9829
|
for (const g of BA)
|
|
9806
9830
|
g.worker.terminate();
|
|
9807
|
-
BA = [],
|
|
9831
|
+
BA = [], UA.clear();
|
|
9808
9832
|
}
|
|
9809
9833
|
class TE {
|
|
9810
9834
|
promises_ = [];
|
|
@@ -10310,7 +10334,7 @@ class Z {
|
|
|
10310
10334
|
}
|
|
10311
10335
|
const L = Object.freeze({
|
|
10312
10336
|
status: "aborted"
|
|
10313
|
-
}), MA = (g) => ({ status: "dirty", value: g }), P = (g) => ({ status: "valid", value: g }), ig = (g) => g.status === "aborted", og = (g) => g.status === "dirty",
|
|
10337
|
+
}), MA = (g) => ({ status: "dirty", value: g }), P = (g) => ({ status: "valid", value: g }), ig = (g) => g.status === "aborted", og = (g) => g.status === "dirty", kA = (g) => g.status === "valid", jA = (g) => typeof Promise < "u" && g instanceof Promise;
|
|
10314
10338
|
function YI(g, A, I, B) {
|
|
10315
10339
|
if (typeof A == "function" ? g !== A || !0 : !A.has(g)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10316
10340
|
return A.get(g);
|
|
@@ -10333,7 +10357,7 @@ class iA {
|
|
|
10333
10357
|
}
|
|
10334
10358
|
}
|
|
10335
10359
|
const wB = (g, A) => {
|
|
10336
|
-
if (
|
|
10360
|
+
if (kA(A))
|
|
10337
10361
|
return { success: !0, data: A.value };
|
|
10338
10362
|
if (!g.common.issues.length)
|
|
10339
10363
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -10437,7 +10461,7 @@ class K {
|
|
|
10437
10461
|
if (!this["~standard"].async)
|
|
10438
10462
|
try {
|
|
10439
10463
|
const Q = this._parseSync({ data: A, path: [], parent: C });
|
|
10440
|
-
return
|
|
10464
|
+
return kA(Q) ? {
|
|
10441
10465
|
value: Q.value
|
|
10442
10466
|
} : {
|
|
10443
10467
|
issues: C.common.issues
|
|
@@ -10448,7 +10472,7 @@ class K {
|
|
|
10448
10472
|
async: !0
|
|
10449
10473
|
};
|
|
10450
10474
|
}
|
|
10451
|
-
return this._parseAsync({ data: A, path: [], parent: C }).then((Q) =>
|
|
10475
|
+
return this._parseAsync({ data: A, path: [], parent: C }).then((Q) => kA(Q) ? {
|
|
10452
10476
|
value: Q.value
|
|
10453
10477
|
} : {
|
|
10454
10478
|
issues: C.common.issues
|
|
@@ -11327,7 +11351,7 @@ zA.create = (g) => new zA({
|
|
|
11327
11351
|
coerce: g?.coerce || !1,
|
|
11328
11352
|
...M(g)
|
|
11329
11353
|
});
|
|
11330
|
-
class
|
|
11354
|
+
class LA extends K {
|
|
11331
11355
|
_parse(A) {
|
|
11332
11356
|
if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== r.date) {
|
|
11333
11357
|
const Q = this._getOrReturnCtx(A);
|
|
@@ -11367,7 +11391,7 @@ class kA extends K {
|
|
|
11367
11391
|
};
|
|
11368
11392
|
}
|
|
11369
11393
|
_addCheck(A) {
|
|
11370
|
-
return new
|
|
11394
|
+
return new LA({
|
|
11371
11395
|
...this._def,
|
|
11372
11396
|
checks: [...this._def.checks, A]
|
|
11373
11397
|
});
|
|
@@ -11399,7 +11423,7 @@ class kA extends K {
|
|
|
11399
11423
|
return A != null ? new Date(A) : null;
|
|
11400
11424
|
}
|
|
11401
11425
|
}
|
|
11402
|
-
|
|
11426
|
+
LA.create = (g) => new LA({
|
|
11403
11427
|
checks: [],
|
|
11404
11428
|
coerce: g?.coerce || !1,
|
|
11405
11429
|
typeName: k.ZodDate,
|
|
@@ -11468,7 +11492,7 @@ fA.create = (g) => new fA({
|
|
|
11468
11492
|
typeName: k.ZodAny,
|
|
11469
11493
|
...M(g)
|
|
11470
11494
|
});
|
|
11471
|
-
class
|
|
11495
|
+
class NA extends K {
|
|
11472
11496
|
constructor() {
|
|
11473
11497
|
super(...arguments), this._unknown = !0;
|
|
11474
11498
|
}
|
|
@@ -11476,7 +11500,7 @@ class RA extends K {
|
|
|
11476
11500
|
return P(A.data);
|
|
11477
11501
|
}
|
|
11478
11502
|
}
|
|
11479
|
-
|
|
11503
|
+
NA.create = (g) => new NA({
|
|
11480
11504
|
typeName: k.ZodUnknown,
|
|
11481
11505
|
...M(g)
|
|
11482
11506
|
});
|
|
@@ -12226,7 +12250,7 @@ KI.create = (g, A, I) => new KI({
|
|
|
12226
12250
|
typeName: k.ZodMap,
|
|
12227
12251
|
...M(I)
|
|
12228
12252
|
});
|
|
12229
|
-
class
|
|
12253
|
+
class JA extends K {
|
|
12230
12254
|
_parse(A) {
|
|
12231
12255
|
const { status: I, ctx: B } = this._processInputParams(A);
|
|
12232
12256
|
if (B.parsedType !== r.set)
|
|
@@ -12265,13 +12289,13 @@ class LA extends K {
|
|
|
12265
12289
|
return B.common.async ? Promise.all(i).then((o) => E(o)) : E(i);
|
|
12266
12290
|
}
|
|
12267
12291
|
min(A, I) {
|
|
12268
|
-
return new
|
|
12292
|
+
return new JA({
|
|
12269
12293
|
...this._def,
|
|
12270
12294
|
minSize: { value: A, message: R.toString(I) }
|
|
12271
12295
|
});
|
|
12272
12296
|
}
|
|
12273
12297
|
max(A, I) {
|
|
12274
|
-
return new
|
|
12298
|
+
return new JA({
|
|
12275
12299
|
...this._def,
|
|
12276
12300
|
maxSize: { value: A, message: R.toString(I) }
|
|
12277
12301
|
});
|
|
@@ -12283,7 +12307,7 @@ class LA extends K {
|
|
|
12283
12307
|
return this.min(1, A);
|
|
12284
12308
|
}
|
|
12285
12309
|
}
|
|
12286
|
-
|
|
12310
|
+
JA.create = (g, A) => new JA({
|
|
12287
12311
|
valueType: g,
|
|
12288
12312
|
minSize: null,
|
|
12289
12313
|
maxSize: null,
|
|
@@ -12367,7 +12391,7 @@ class KA extends K {
|
|
|
12367
12391
|
args(...A) {
|
|
12368
12392
|
return new KA({
|
|
12369
12393
|
...this._def,
|
|
12370
|
-
args: oA.create(A).rest(
|
|
12394
|
+
args: oA.create(A).rest(NA.create())
|
|
12371
12395
|
});
|
|
12372
12396
|
}
|
|
12373
12397
|
returns(A) {
|
|
@@ -12384,8 +12408,8 @@ class KA extends K {
|
|
|
12384
12408
|
}
|
|
12385
12409
|
static create(A, I, B) {
|
|
12386
12410
|
return new KA({
|
|
12387
|
-
args: A || oA.create([]).rest(
|
|
12388
|
-
returns: I ||
|
|
12411
|
+
args: A || oA.create([]).rest(NA.create()),
|
|
12412
|
+
returns: I || NA.create(),
|
|
12389
12413
|
typeName: k.ZodFunction,
|
|
12390
12414
|
...M(B)
|
|
12391
12415
|
});
|
|
@@ -12616,14 +12640,14 @@ class QA extends K {
|
|
|
12616
12640
|
path: B.path,
|
|
12617
12641
|
parent: B
|
|
12618
12642
|
});
|
|
12619
|
-
if (!
|
|
12643
|
+
if (!kA(E))
|
|
12620
12644
|
return E;
|
|
12621
12645
|
const i = C.transform(E.value, Q);
|
|
12622
12646
|
if (i instanceof Promise)
|
|
12623
12647
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
12624
12648
|
return { status: I.value, value: i };
|
|
12625
12649
|
} else
|
|
12626
|
-
return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((E) =>
|
|
12650
|
+
return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((E) => kA(E) ? Promise.resolve(C.transform(E.value, Q)).then((i) => ({ status: I.value, value: i })) : E);
|
|
12627
12651
|
H.assertNever(C);
|
|
12628
12652
|
}
|
|
12629
12653
|
}
|
|
@@ -12801,7 +12825,7 @@ class yI extends K {
|
|
|
12801
12825
|
}
|
|
12802
12826
|
class oI extends K {
|
|
12803
12827
|
_parse(A) {
|
|
12804
|
-
const I = this._def.innerType._parse(A), B = (C) => (
|
|
12828
|
+
const I = this._def.innerType._parse(A), B = (C) => (kA(C) && (C.value = Object.freeze(C.value)), C);
|
|
12805
12829
|
return jA(I) ? I.then((C) => B(C)) : B(I);
|
|
12806
12830
|
}
|
|
12807
12831
|
unwrap() {
|
|
@@ -12844,7 +12868,7 @@ var k;
|
|
|
12844
12868
|
})(k || (k = {}));
|
|
12845
12869
|
const ei = (g, A = {
|
|
12846
12870
|
message: `Input not instance of ${g.name}`
|
|
12847
|
-
}) => XB((I) => I instanceof g, A), jB = IA.create, zB = tA.create, Gi = HI.create, wi = yA.create, _B = zA.create, ni =
|
|
12871
|
+
}) => XB((I) => I instanceof g, A), jB = IA.create, zB = tA.create, Gi = HI.create, wi = yA.create, _B = zA.create, ni = LA.create, Fi = dI.create, ri = _A.create, Si = $A.create, Ri = fA.create, Ni = NA.create, ci = sA.create, Ui = MI.create, ki = CA.create, Li = p.create, Ji = p.strictCreate, Yi = AI.create, di = uI.create, Mi = II.create, Ki = oA.create, Hi = gI.create, qi = KI.create, li = JA.create, fi = KA.create, pi = BI.create, mi = CI.create, ui = eA.create, Ti = QI.create, Wi = pA.create, FB = QA.create, xi = EA.create, bi = GA.create, Zi = QA.createWithPreprocess, Pi = yI.create, Oi = () => jB().optional(), Vi = () => zB().optional(), vi = () => _B().optional(), Xi = {
|
|
12848
12872
|
string: (g) => IA.create({ ...g, coerce: !0 }),
|
|
12849
12873
|
number: (g) => tA.create({ ...g, coerce: !0 }),
|
|
12850
12874
|
boolean: (g) => zA.create({
|
|
@@ -12852,7 +12876,7 @@ const ei = (g, A = {
|
|
|
12852
12876
|
coerce: !0
|
|
12853
12877
|
}),
|
|
12854
12878
|
bigint: (g) => yA.create({ ...g, coerce: !0 }),
|
|
12855
|
-
date: (g) =>
|
|
12879
|
+
date: (g) => LA.create({ ...g, coerce: !0 })
|
|
12856
12880
|
}, ji = L;
|
|
12857
12881
|
var s = /* @__PURE__ */ Object.freeze({
|
|
12858
12882
|
__proto__: null,
|
|
@@ -12868,7 +12892,7 @@ var s = /* @__PURE__ */ Object.freeze({
|
|
|
12868
12892
|
OK: P,
|
|
12869
12893
|
isAborted: ig,
|
|
12870
12894
|
isDirty: og,
|
|
12871
|
-
isValid:
|
|
12895
|
+
isValid: kA,
|
|
12872
12896
|
isAsync: jA,
|
|
12873
12897
|
get util() {
|
|
12874
12898
|
return H;
|
|
@@ -12884,12 +12908,12 @@ var s = /* @__PURE__ */ Object.freeze({
|
|
|
12884
12908
|
ZodNumber: tA,
|
|
12885
12909
|
ZodBigInt: yA,
|
|
12886
12910
|
ZodBoolean: zA,
|
|
12887
|
-
ZodDate:
|
|
12911
|
+
ZodDate: LA,
|
|
12888
12912
|
ZodSymbol: dI,
|
|
12889
12913
|
ZodUndefined: _A,
|
|
12890
12914
|
ZodNull: $A,
|
|
12891
12915
|
ZodAny: fA,
|
|
12892
|
-
ZodUnknown:
|
|
12916
|
+
ZodUnknown: NA,
|
|
12893
12917
|
ZodNever: sA,
|
|
12894
12918
|
ZodVoid: MI,
|
|
12895
12919
|
ZodArray: CA,
|
|
@@ -12900,7 +12924,7 @@ var s = /* @__PURE__ */ Object.freeze({
|
|
|
12900
12924
|
ZodTuple: oA,
|
|
12901
12925
|
ZodRecord: gI,
|
|
12902
12926
|
ZodMap: KI,
|
|
12903
|
-
ZodSet:
|
|
12927
|
+
ZodSet: JA,
|
|
12904
12928
|
ZodFunction: KA,
|
|
12905
12929
|
ZodLazy: BI,
|
|
12906
12930
|
ZodLiteral: CI,
|
|
@@ -13749,7 +13773,7 @@ class qo extends TA {
|
|
|
13749
13773
|
export {
|
|
13750
13774
|
wo as AxesLayer,
|
|
13751
13775
|
_ as Box2,
|
|
13752
|
-
|
|
13776
|
+
RA as Box3,
|
|
13753
13777
|
dB as ChunkedImageLayer,
|
|
13754
13778
|
l as Color,
|
|
13755
13779
|
tQ as Frustum,
|