@ridp/threejs 1.0.15 → 1.0.17
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/hooks.cjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/threejs.cjs +1 -1
- package/dist/threejs.js +8 -8
- package/dist/useGLTFLoader-CbugDLyo.cjs +4 -0
- package/dist/{useGLTFLoader-BC2fdAUM.js → useGLTFLoader-D94xeCEW.js} +816 -836
- package/package.json +2 -2
- package/dist/useGLTFLoader-CERIYOx6.cjs +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _t from "three";
|
|
2
|
-
import { TrianglesDrawMode as
|
|
3
|
-
import { ref as
|
|
2
|
+
import { TrianglesDrawMode as Ai, TriangleFanDrawMode as Or, TriangleStripDrawMode as Ds, Loader as Ns, FileLoader as Nn, SRGBColorSpace as ut, LinearSRGBColorSpace as He, BufferGeometry as Fs, BufferAttribute as Zt, Color as Qe, ColorManagement as Mr, LoaderUtils as en, MeshPhysicalMaterial as Ge, Vector2 as Fr, SpotLight as Si, PointLight as Ri, DirectionalLight as ki, Matrix4 as Dt, Vector3 as le, Quaternion as Ks, InstancedMesh as Oi, InstancedBufferAttribute as Mi, Object3D as js, TextureLoader as Pi, ImageBitmapLoader as Ci, InterleavedBuffer as Ii, InterleavedBufferAttribute as Li, LinearMipmapLinearFilter as Bs, NearestMipmapLinearFilter as Di, LinearMipmapNearestFilter as Ni, NearestMipmapNearestFilter as Fi, LinearFilter as Pr, NearestFilter as Us, RepeatWrapping as Cr, MirroredRepeatWrapping as Ki, ClampToEdgeWrapping as ji, PointsMaterial as Bi, Material as xr, LineBasicMaterial as Ui, MeshStandardMaterial as qs, DoubleSide as qi, MeshBasicMaterial as Jt, PropertyBinding as Hi, SkinnedMesh as Gi, Mesh as zi, LineSegments as Vi, Line as Xi, LineLoop as Wi, Points as Yi, Group as Tr, PerspectiveCamera as Hs, MathUtils as It, OrthographicCamera as $i, Skeleton as Qi, AnimationClip as Ji, Bone as Zi, InterpolateDiscrete as eo, InterpolateLinear as Gs, Texture as vs, VectorKeyframeTrack as bs, NumberKeyframeTrack as ws, QuaternionKeyframeTrack as _s, FrontSide as to, Interpolant as no, Box3 as Kn, Sphere as ro, Matrix3 as zs, Ray as so, WebGLRenderer as io, Scene as oo, Raycaster as ao } from "three";
|
|
3
|
+
import { ref as Er, shallowRef as uo, onMounted as co, onUnmounted as lo, nextTick as xs } from "vue";
|
|
4
4
|
import { d as fo, j as ho, S as po, C as mo } from "./ImageLoader-xzOH4Owt.js";
|
|
5
|
-
function
|
|
6
|
-
if (s ===
|
|
5
|
+
function Ts(C, s) {
|
|
6
|
+
if (s === Ai)
|
|
7
7
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), C;
|
|
8
8
|
if (s === Or || s === Ds) {
|
|
9
9
|
let i = C.getIndex();
|
|
@@ -29,7 +29,7 @@ function xs(C, s) {
|
|
|
29
29
|
} else
|
|
30
30
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", s), C;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const Ar = /* @__PURE__ */ new WeakMap();
|
|
33
33
|
class yo extends Ns {
|
|
34
34
|
/**
|
|
35
35
|
* Constructs a new Draco loader.
|
|
@@ -104,7 +104,7 @@ class yo extends Ns {
|
|
|
104
104
|
this.decodeDracoFile(s, i, null, null, ut, a).catch(a);
|
|
105
105
|
}
|
|
106
106
|
//
|
|
107
|
-
decodeDracoFile(s, i, a, u, c =
|
|
107
|
+
decodeDracoFile(s, i, a, u, c = He, l = () => {
|
|
108
108
|
}) {
|
|
109
109
|
const p = {
|
|
110
110
|
attributeIDs: a || this.defaultAttributeIDs,
|
|
@@ -116,8 +116,8 @@ class yo extends Ns {
|
|
|
116
116
|
}
|
|
117
117
|
decodeGeometry(s, i) {
|
|
118
118
|
const a = JSON.stringify(i);
|
|
119
|
-
if (
|
|
120
|
-
const h =
|
|
119
|
+
if (Ar.has(s)) {
|
|
120
|
+
const h = Ar.get(s);
|
|
121
121
|
if (h.key === a)
|
|
122
122
|
return h.promise;
|
|
123
123
|
if (s.byteLength === 0)
|
|
@@ -126,12 +126,12 @@ class yo extends Ns {
|
|
|
126
126
|
);
|
|
127
127
|
}
|
|
128
128
|
let u;
|
|
129
|
-
const c = this.workerNextTaskID++, l = s.byteLength, p = this._getWorker(c, l).then((h) => (u = h, new Promise((y,
|
|
130
|
-
u._callbacks[c] = { resolve: y, reject:
|
|
129
|
+
const c = this.workerNextTaskID++, l = s.byteLength, p = this._getWorker(c, l).then((h) => (u = h, new Promise((y, A) => {
|
|
130
|
+
u._callbacks[c] = { resolve: y, reject: A }, u.postMessage({ type: "decode", id: c, taskConfig: i, buffer: s }, [s]);
|
|
131
131
|
}))).then((h) => this._createGeometry(h.geometry));
|
|
132
132
|
return p.catch(() => !0).then(() => {
|
|
133
133
|
u && c && this._releaseTask(u, c);
|
|
134
|
-
}),
|
|
134
|
+
}), Ar.set(s, {
|
|
135
135
|
key: a,
|
|
136
136
|
promise: p
|
|
137
137
|
}), p;
|
|
@@ -147,9 +147,9 @@ class yo extends Ns {
|
|
|
147
147
|
}
|
|
148
148
|
_assignVertexColorSpace(s, i) {
|
|
149
149
|
if (i !== ut) return;
|
|
150
|
-
const a = new
|
|
150
|
+
const a = new Qe();
|
|
151
151
|
for (let u = 0, c = s.count; u < c; u++)
|
|
152
|
-
a.fromBufferAttribute(s, u), Mr.
|
|
152
|
+
a.fromBufferAttribute(s, u), Mr.colorSpaceToWorking(a, ut), s.setXYZ(u, a.r, a.g, a.b);
|
|
153
153
|
}
|
|
154
154
|
_loadLibrary(s, i) {
|
|
155
155
|
const a = new Nn(this.manager);
|
|
@@ -220,16 +220,16 @@ function go() {
|
|
|
220
220
|
const p = l.data;
|
|
221
221
|
switch (p.type) {
|
|
222
222
|
case "init":
|
|
223
|
-
C = p.decoderConfig, s = new Promise(function(
|
|
223
|
+
C = p.decoderConfig, s = new Promise(function(A) {
|
|
224
224
|
C.onModuleLoaded = function(_) {
|
|
225
|
-
|
|
225
|
+
A({ draco: _ });
|
|
226
226
|
}, DracoDecoderModule(C);
|
|
227
227
|
});
|
|
228
228
|
break;
|
|
229
229
|
case "decode":
|
|
230
230
|
const h = p.buffer, y = p.taskConfig;
|
|
231
|
-
s.then((
|
|
232
|
-
const _ =
|
|
231
|
+
s.then((A) => {
|
|
232
|
+
const _ = A.draco, P = new _.Decoder();
|
|
233
233
|
try {
|
|
234
234
|
const L = i(_, P, new Int8Array(h), y), q = L.attributes.map((X) => X.array.buffer);
|
|
235
235
|
L.index && q.push(L.index.array.buffer), self.postMessage({ type: "decode", id: p.id, geometry: L }, q);
|
|
@@ -243,7 +243,7 @@ function go() {
|
|
|
243
243
|
}
|
|
244
244
|
};
|
|
245
245
|
function i(l, p, h, y) {
|
|
246
|
-
const
|
|
246
|
+
const A = y.attributeIDs, _ = y.attributeTypes;
|
|
247
247
|
let P, L;
|
|
248
248
|
const q = p.GetEncodedGeometryType(h);
|
|
249
249
|
if (q === l.TRIANGULAR_MESH)
|
|
@@ -255,30 +255,30 @@ function go() {
|
|
|
255
255
|
if (!L.ok() || P.ptr === 0)
|
|
256
256
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + L.error_msg());
|
|
257
257
|
const X = { index: null, attributes: [] };
|
|
258
|
-
for (const
|
|
259
|
-
const W = self[_[
|
|
258
|
+
for (const G in A) {
|
|
259
|
+
const W = self[_[G]];
|
|
260
260
|
let Z, ce;
|
|
261
261
|
if (y.useUniqueIDs)
|
|
262
|
-
ce =
|
|
262
|
+
ce = A[G], Z = p.GetAttributeByUniqueId(P, ce);
|
|
263
263
|
else {
|
|
264
|
-
if (ce = p.GetAttributeId(P, l[
|
|
264
|
+
if (ce = p.GetAttributeId(P, l[A[G]]), ce === -1) continue;
|
|
265
265
|
Z = p.GetAttribute(P, ce);
|
|
266
266
|
}
|
|
267
|
-
const Y = u(l, p, P,
|
|
268
|
-
|
|
267
|
+
const Y = u(l, p, P, G, W, Z);
|
|
268
|
+
G === "color" && (Y.vertexColorSpace = y.vertexColorSpace), X.attributes.push(Y);
|
|
269
269
|
}
|
|
270
270
|
return q === l.TRIANGULAR_MESH && (X.index = a(l, p, P)), l.destroy(P), X;
|
|
271
271
|
}
|
|
272
272
|
function a(l, p, h) {
|
|
273
|
-
const
|
|
273
|
+
const A = h.num_faces() * 3, _ = A * 4, P = l._malloc(_);
|
|
274
274
|
p.GetTrianglesUInt32Array(h, _, P);
|
|
275
|
-
const L = new Uint32Array(l.HEAPF32.buffer, P,
|
|
275
|
+
const L = new Uint32Array(l.HEAPF32.buffer, P, A).slice();
|
|
276
276
|
return l._free(P), { array: L, itemSize: 1 };
|
|
277
277
|
}
|
|
278
|
-
function u(l, p, h, y,
|
|
279
|
-
const P = _.num_components(), q = h.num_points() * P, X = q *
|
|
280
|
-
p.GetAttributeDataArrayForAllPoints(h, _,
|
|
281
|
-
const Z = new
|
|
278
|
+
function u(l, p, h, y, A, _) {
|
|
279
|
+
const P = _.num_components(), q = h.num_points() * P, X = q * A.BYTES_PER_ELEMENT, G = c(l, A), W = l._malloc(X);
|
|
280
|
+
p.GetAttributeDataArrayForAllPoints(h, _, G, X, W);
|
|
281
|
+
const Z = new A(l.HEAPF32.buffer, W, q).slice();
|
|
282
282
|
return l._free(W), {
|
|
283
283
|
name: y,
|
|
284
284
|
array: Z,
|
|
@@ -312,9 +312,9 @@ class vo extends Ns {
|
|
|
312
312
|
*/
|
|
313
313
|
constructor(s) {
|
|
314
314
|
super(s), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(i) {
|
|
315
|
-
return new xo(i);
|
|
316
|
-
}), this.register(function(i) {
|
|
317
315
|
return new To(i);
|
|
316
|
+
}), this.register(function(i) {
|
|
317
|
+
return new Eo(i);
|
|
318
318
|
}), this.register(function(i) {
|
|
319
319
|
return new Io(i);
|
|
320
320
|
}), this.register(function(i) {
|
|
@@ -330,11 +330,11 @@ class vo extends Ns {
|
|
|
330
330
|
}), this.register(function(i) {
|
|
331
331
|
return new Oo(i);
|
|
332
332
|
}), this.register(function(i) {
|
|
333
|
-
return new
|
|
333
|
+
return new xo(i);
|
|
334
334
|
}), this.register(function(i) {
|
|
335
335
|
return new Mo(i);
|
|
336
336
|
}), this.register(function(i) {
|
|
337
|
-
return new
|
|
337
|
+
return new Ao(i);
|
|
338
338
|
}), this.register(function(i) {
|
|
339
339
|
return new Co(i);
|
|
340
340
|
}), this.register(function(i) {
|
|
@@ -372,11 +372,11 @@ class vo extends Ns {
|
|
|
372
372
|
}, h = new Nn(this.manager);
|
|
373
373
|
h.setPath(this.path), h.setResponseType("arraybuffer"), h.setRequestHeader(this.requestHeader), h.setWithCredentials(this.withCredentials), h.load(s, function(y) {
|
|
374
374
|
try {
|
|
375
|
-
c.parse(y, l, function(
|
|
376
|
-
i(
|
|
375
|
+
c.parse(y, l, function(A) {
|
|
376
|
+
i(A), c.manager.itemEnd(s);
|
|
377
377
|
}, p);
|
|
378
|
-
} catch (
|
|
379
|
-
p(
|
|
378
|
+
} catch (A) {
|
|
379
|
+
p(A);
|
|
380
380
|
}
|
|
381
381
|
}, a, p);
|
|
382
382
|
}
|
|
@@ -446,7 +446,7 @@ class vo extends Ns {
|
|
|
446
446
|
else if (s instanceof ArrayBuffer)
|
|
447
447
|
if (h.decode(new Uint8Array(s, 0, 4)) === Vs) {
|
|
448
448
|
try {
|
|
449
|
-
l[ne.KHR_BINARY_GLTF] = new
|
|
449
|
+
l[ne.KHR_BINARY_GLTF] = new Ko(s);
|
|
450
450
|
} catch (_) {
|
|
451
451
|
u && u(_);
|
|
452
452
|
return;
|
|
@@ -460,7 +460,7 @@ class vo extends Ns {
|
|
|
460
460
|
u && u(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
461
461
|
return;
|
|
462
462
|
}
|
|
463
|
-
const y = new
|
|
463
|
+
const y = new Qo(c, {
|
|
464
464
|
path: i || this.resourcePath || "",
|
|
465
465
|
crossOrigin: this.crossOrigin,
|
|
466
466
|
requestHeader: this.requestHeader,
|
|
@@ -469,19 +469,19 @@ class vo extends Ns {
|
|
|
469
469
|
meshoptDecoder: this.meshoptDecoder
|
|
470
470
|
});
|
|
471
471
|
y.fileLoader.setRequestHeader(this.requestHeader);
|
|
472
|
-
for (let
|
|
473
|
-
const _ = this.pluginCallbacks[
|
|
472
|
+
for (let A = 0; A < this.pluginCallbacks.length; A++) {
|
|
473
|
+
const _ = this.pluginCallbacks[A](y);
|
|
474
474
|
_.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), p[_.name] = _, l[_.name] = !0;
|
|
475
475
|
}
|
|
476
476
|
if (c.extensionsUsed)
|
|
477
|
-
for (let
|
|
478
|
-
const _ = c.extensionsUsed[
|
|
477
|
+
for (let A = 0; A < c.extensionsUsed.length; ++A) {
|
|
478
|
+
const _ = c.extensionsUsed[A], P = c.extensionsRequired || [];
|
|
479
479
|
switch (_) {
|
|
480
480
|
case ne.KHR_MATERIALS_UNLIT:
|
|
481
481
|
l[_] = new _o();
|
|
482
482
|
break;
|
|
483
483
|
case ne.KHR_DRACO_MESH_COMPRESSION:
|
|
484
|
-
l[_] = new
|
|
484
|
+
l[_] = new jo(c, this.dracoLoader);
|
|
485
485
|
break;
|
|
486
486
|
case ne.KHR_TEXTURE_TRANSFORM:
|
|
487
487
|
l[_] = new Bo();
|
|
@@ -568,23 +568,23 @@ class wo {
|
|
|
568
568
|
if (u) return u;
|
|
569
569
|
const c = i.json, h = ((c.extensions && c.extensions[this.name] || {}).lights || [])[s];
|
|
570
570
|
let y;
|
|
571
|
-
const
|
|
572
|
-
h.color !== void 0 &&
|
|
571
|
+
const A = new Qe(16777215);
|
|
572
|
+
h.color !== void 0 && A.setRGB(h.color[0], h.color[1], h.color[2], He);
|
|
573
573
|
const _ = h.range !== void 0 ? h.range : 0;
|
|
574
574
|
switch (h.type) {
|
|
575
575
|
case "directional":
|
|
576
|
-
y = new ki(
|
|
576
|
+
y = new ki(A), y.target.position.set(0, 0, -1), y.add(y.target);
|
|
577
577
|
break;
|
|
578
578
|
case "point":
|
|
579
|
-
y = new Ri(
|
|
579
|
+
y = new Ri(A), y.distance = _;
|
|
580
580
|
break;
|
|
581
581
|
case "spot":
|
|
582
|
-
y = new Si(
|
|
582
|
+
y = new Si(A), y.distance = _, h.spot = h.spot || {}, h.spot.innerConeAngle = h.spot.innerConeAngle !== void 0 ? h.spot.innerConeAngle : 0, h.spot.outerConeAngle = h.spot.outerConeAngle !== void 0 ? h.spot.outerConeAngle : Math.PI / 4, y.angle = h.spot.outerConeAngle, y.penumbra = 1 - h.spot.innerConeAngle / h.spot.outerConeAngle, y.target.position.set(0, 0, -1), y.add(y.target);
|
|
583
583
|
break;
|
|
584
584
|
default:
|
|
585
585
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + h.type);
|
|
586
586
|
}
|
|
587
|
-
return y.position.set(0, 0, 0),
|
|
587
|
+
return y.position.set(0, 0, 0), $e(y, h), h.intensity !== void 0 && (y.intensity = h.intensity), y.name = i.createUniqueName(h.name || "light_" + s), u = Promise.resolve(y), i.cache.add(a, u), u;
|
|
588
588
|
}
|
|
589
589
|
getDependency(s, i) {
|
|
590
590
|
if (s === "light")
|
|
@@ -606,19 +606,19 @@ class _o {
|
|
|
606
606
|
}
|
|
607
607
|
extendParams(s, i, a) {
|
|
608
608
|
const u = [];
|
|
609
|
-
s.color = new
|
|
609
|
+
s.color = new Qe(1, 1, 1), s.opacity = 1;
|
|
610
610
|
const c = i.pbrMetallicRoughness;
|
|
611
611
|
if (c) {
|
|
612
612
|
if (Array.isArray(c.baseColorFactor)) {
|
|
613
613
|
const l = c.baseColorFactor;
|
|
614
|
-
s.color.setRGB(l[0], l[1], l[2],
|
|
614
|
+
s.color.setRGB(l[0], l[1], l[2], He), s.opacity = l[3];
|
|
615
615
|
}
|
|
616
616
|
c.baseColorTexture !== void 0 && u.push(a.assignTexture(s, "map", c.baseColorTexture, ut));
|
|
617
617
|
}
|
|
618
618
|
return Promise.all(u);
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
class
|
|
621
|
+
class xo {
|
|
622
622
|
constructor(s) {
|
|
623
623
|
this.parser = s, this.name = ne.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
624
624
|
}
|
|
@@ -630,13 +630,13 @@ class Ao {
|
|
|
630
630
|
return c !== void 0 && (i.emissiveIntensity = c), Promise.resolve();
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
class
|
|
633
|
+
class To {
|
|
634
634
|
constructor(s) {
|
|
635
635
|
this.parser = s, this.name = ne.KHR_MATERIALS_CLEARCOAT;
|
|
636
636
|
}
|
|
637
637
|
getMaterialType(s) {
|
|
638
638
|
const a = this.parser.json.materials[s];
|
|
639
|
-
return !a.extensions || !a.extensions[this.name] ? null :
|
|
639
|
+
return !a.extensions || !a.extensions[this.name] ? null : Ge;
|
|
640
640
|
}
|
|
641
641
|
extendMaterialParams(s, i) {
|
|
642
642
|
const a = this.parser, u = a.json.materials[s];
|
|
@@ -650,13 +650,13 @@ class xo {
|
|
|
650
650
|
return Promise.all(c);
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
class
|
|
653
|
+
class Eo {
|
|
654
654
|
constructor(s) {
|
|
655
655
|
this.parser = s, this.name = ne.KHR_MATERIALS_DISPERSION;
|
|
656
656
|
}
|
|
657
657
|
getMaterialType(s) {
|
|
658
658
|
const a = this.parser.json.materials[s];
|
|
659
|
-
return !a.extensions || !a.extensions[this.name] ? null :
|
|
659
|
+
return !a.extensions || !a.extensions[this.name] ? null : Ge;
|
|
660
660
|
}
|
|
661
661
|
extendMaterialParams(s, i) {
|
|
662
662
|
const u = this.parser.json.materials[s];
|
|
@@ -666,13 +666,13 @@ class To {
|
|
|
666
666
|
return i.dispersion = c.dispersion !== void 0 ? c.dispersion : 0, Promise.resolve();
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
-
class
|
|
669
|
+
class Ao {
|
|
670
670
|
constructor(s) {
|
|
671
671
|
this.parser = s, this.name = ne.KHR_MATERIALS_IRIDESCENCE;
|
|
672
672
|
}
|
|
673
673
|
getMaterialType(s) {
|
|
674
674
|
const a = this.parser.json.materials[s];
|
|
675
|
-
return !a.extensions || !a.extensions[this.name] ? null :
|
|
675
|
+
return !a.extensions || !a.extensions[this.name] ? null : Ge;
|
|
676
676
|
}
|
|
677
677
|
extendMaterialParams(s, i) {
|
|
678
678
|
const a = this.parser, u = a.json.materials[s];
|
|
@@ -688,18 +688,18 @@ class So {
|
|
|
688
688
|
}
|
|
689
689
|
getMaterialType(s) {
|
|
690
690
|
const a = this.parser.json.materials[s];
|
|
691
|
-
return !a.extensions || !a.extensions[this.name] ? null :
|
|
691
|
+
return !a.extensions || !a.extensions[this.name] ? null : Ge;
|
|
692
692
|
}
|
|
693
693
|
extendMaterialParams(s, i) {
|
|
694
694
|
const a = this.parser, u = a.json.materials[s];
|
|
695
695
|
if (!u.extensions || !u.extensions[this.name])
|
|
696
696
|
return Promise.resolve();
|
|
697
697
|
const c = [];
|
|
698
|
-
i.sheenColor = new
|
|
698
|
+
i.sheenColor = new Qe(0, 0, 0), i.sheenRoughness = 0, i.sheen = 1;
|
|
699
699
|
const l = u.extensions[this.name];
|
|
700
700
|
if (l.sheenColorFactor !== void 0) {
|
|
701
701
|
const p = l.sheenColorFactor;
|
|
702
|
-
i.sheenColor.setRGB(p[0], p[1], p[2],
|
|
702
|
+
i.sheenColor.setRGB(p[0], p[1], p[2], He);
|
|
703
703
|
}
|
|
704
704
|
return l.sheenRoughnessFactor !== void 0 && (i.sheenRoughness = l.sheenRoughnessFactor), l.sheenColorTexture !== void 0 && c.push(a.assignTexture(i, "sheenColorMap", l.sheenColorTexture, ut)), l.sheenRoughnessTexture !== void 0 && c.push(a.assignTexture(i, "sheenRoughnessMap", l.sheenRoughnessTexture)), Promise.all(c);
|
|
705
705
|
}
|
|
@@ -710,7 +710,7 @@ class Ro {
|
|
|
710
710
|
}
|
|
711
711
|
getMaterialType(s) {
|
|
712
712
|
const a = this.parser.json.materials[s];
|
|
713
|
-
return !a.extensions || !a.extensions[this.name] ? null :
|
|
713
|
+
return !a.extensions || !a.extensions[this.name] ? null : Ge;
|
|
714
714
|
}
|
|
715
715
|
extendMaterialParams(s, i) {
|
|
716
716
|
const a = this.parser, u = a.json.materials[s];
|
|
@@ -726,7 +726,7 @@ class ko {
|
|
|
726
726
|
}
|
|
727
727
|
getMaterialType(s) {
|
|
728
728
|
const a = this.parser.json.materials[s];
|
|
729
|
-
return !a.extensions || !a.extensions[this.name] ? null :
|
|
729
|
+
return !a.extensions || !a.extensions[this.name] ? null : Ge;
|
|
730
730
|
}
|
|
731
731
|
extendMaterialParams(s, i) {
|
|
732
732
|
const a = this.parser, u = a.json.materials[s];
|
|
@@ -735,7 +735,7 @@ class ko {
|
|
|
735
735
|
const c = [], l = u.extensions[this.name];
|
|
736
736
|
i.thickness = l.thicknessFactor !== void 0 ? l.thicknessFactor : 0, l.thicknessTexture !== void 0 && c.push(a.assignTexture(i, "thicknessMap", l.thicknessTexture)), i.attenuationDistance = l.attenuationDistance || 1 / 0;
|
|
737
737
|
const p = l.attenuationColor || [1, 1, 1];
|
|
738
|
-
return i.attenuationColor = new
|
|
738
|
+
return i.attenuationColor = new Qe().setRGB(p[0], p[1], p[2], He), Promise.all(c);
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
class Oo {
|
|
@@ -744,7 +744,7 @@ class Oo {
|
|
|
744
744
|
}
|
|
745
745
|
getMaterialType(s) {
|
|
746
746
|
const a = this.parser.json.materials[s];
|
|
747
|
-
return !a.extensions || !a.extensions[this.name] ? null :
|
|
747
|
+
return !a.extensions || !a.extensions[this.name] ? null : Ge;
|
|
748
748
|
}
|
|
749
749
|
extendMaterialParams(s, i) {
|
|
750
750
|
const u = this.parser.json.materials[s];
|
|
@@ -760,7 +760,7 @@ class Mo {
|
|
|
760
760
|
}
|
|
761
761
|
getMaterialType(s) {
|
|
762
762
|
const a = this.parser.json.materials[s];
|
|
763
|
-
return !a.extensions || !a.extensions[this.name] ? null :
|
|
763
|
+
return !a.extensions || !a.extensions[this.name] ? null : Ge;
|
|
764
764
|
}
|
|
765
765
|
extendMaterialParams(s, i) {
|
|
766
766
|
const a = this.parser, u = a.json.materials[s];
|
|
@@ -769,7 +769,7 @@ class Mo {
|
|
|
769
769
|
const c = [], l = u.extensions[this.name];
|
|
770
770
|
i.specularIntensity = l.specularFactor !== void 0 ? l.specularFactor : 1, l.specularTexture !== void 0 && c.push(a.assignTexture(i, "specularIntensityMap", l.specularTexture));
|
|
771
771
|
const p = l.specularColorFactor || [1, 1, 1];
|
|
772
|
-
return i.specularColor = new
|
|
772
|
+
return i.specularColor = new Qe().setRGB(p[0], p[1], p[2], He), l.specularColorTexture !== void 0 && c.push(a.assignTexture(i, "specularColorMap", l.specularColorTexture, ut)), Promise.all(c);
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
775
|
class Po {
|
|
@@ -778,7 +778,7 @@ class Po {
|
|
|
778
778
|
}
|
|
779
779
|
getMaterialType(s) {
|
|
780
780
|
const a = this.parser.json.materials[s];
|
|
781
|
-
return !a.extensions || !a.extensions[this.name] ? null :
|
|
781
|
+
return !a.extensions || !a.extensions[this.name] ? null : Ge;
|
|
782
782
|
}
|
|
783
783
|
extendMaterialParams(s, i) {
|
|
784
784
|
const a = this.parser, u = a.json.materials[s];
|
|
@@ -794,7 +794,7 @@ class Co {
|
|
|
794
794
|
}
|
|
795
795
|
getMaterialType(s) {
|
|
796
796
|
const a = this.parser.json.materials[s];
|
|
797
|
-
return !a.extensions || !a.extensions[this.name] ? null :
|
|
797
|
+
return !a.extensions || !a.extensions[this.name] ? null : Ge;
|
|
798
798
|
}
|
|
799
799
|
extendMaterialParams(s, i) {
|
|
800
800
|
const a = this.parser, u = a.json.materials[s];
|
|
@@ -823,7 +823,7 @@ class Io {
|
|
|
823
823
|
}
|
|
824
824
|
class Lo {
|
|
825
825
|
constructor(s) {
|
|
826
|
-
this.parser = s, this.name = ne.EXT_TEXTURE_WEBP
|
|
826
|
+
this.parser = s, this.name = ne.EXT_TEXTURE_WEBP;
|
|
827
827
|
}
|
|
828
828
|
loadTexture(s) {
|
|
829
829
|
const i = this.name, a = this.parser, u = a.json, c = u.textures[s];
|
|
@@ -835,25 +835,12 @@ class Lo {
|
|
|
835
835
|
const y = a.options.manager.getHandler(p.uri);
|
|
836
836
|
y !== null && (h = y);
|
|
837
837
|
}
|
|
838
|
-
return
|
|
839
|
-
if (y) return a.loadTextureImage(s, l.source, h);
|
|
840
|
-
if (u.extensionsRequired && u.extensionsRequired.indexOf(i) >= 0)
|
|
841
|
-
throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
|
|
842
|
-
return a.loadTexture(s);
|
|
843
|
-
});
|
|
844
|
-
}
|
|
845
|
-
detectSupport() {
|
|
846
|
-
return this.isSupported || (this.isSupported = new Promise(function(s) {
|
|
847
|
-
const i = new Image();
|
|
848
|
-
i.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", i.onload = i.onerror = function() {
|
|
849
|
-
s(i.height === 1);
|
|
850
|
-
};
|
|
851
|
-
})), this.isSupported;
|
|
838
|
+
return a.loadTextureImage(s, l.source, h);
|
|
852
839
|
}
|
|
853
840
|
}
|
|
854
841
|
class Do {
|
|
855
842
|
constructor(s) {
|
|
856
|
-
this.parser = s, this.name = ne.EXT_TEXTURE_AVIF
|
|
843
|
+
this.parser = s, this.name = ne.EXT_TEXTURE_AVIF;
|
|
857
844
|
}
|
|
858
845
|
loadTexture(s) {
|
|
859
846
|
const i = this.name, a = this.parser, u = a.json, c = u.textures[s];
|
|
@@ -865,20 +852,7 @@ class Do {
|
|
|
865
852
|
const y = a.options.manager.getHandler(p.uri);
|
|
866
853
|
y !== null && (h = y);
|
|
867
854
|
}
|
|
868
|
-
return
|
|
869
|
-
if (y) return a.loadTextureImage(s, l.source, h);
|
|
870
|
-
if (u.extensionsRequired && u.extensionsRequired.indexOf(i) >= 0)
|
|
871
|
-
throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
|
|
872
|
-
return a.loadTexture(s);
|
|
873
|
-
});
|
|
874
|
-
}
|
|
875
|
-
detectSupport() {
|
|
876
|
-
return this.isSupported || (this.isSupported = new Promise(function(s) {
|
|
877
|
-
const i = new Image();
|
|
878
|
-
i.src = "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=", i.onload = i.onerror = function() {
|
|
879
|
-
s(i.height === 1);
|
|
880
|
-
};
|
|
881
|
-
})), this.isSupported;
|
|
855
|
+
return a.loadTextureImage(s, l.source, h);
|
|
882
856
|
}
|
|
883
857
|
}
|
|
884
858
|
class No {
|
|
@@ -895,12 +869,12 @@ class No {
|
|
|
895
869
|
return null;
|
|
896
870
|
}
|
|
897
871
|
return c.then(function(p) {
|
|
898
|
-
const h = u.byteOffset || 0, y = u.byteLength || 0,
|
|
899
|
-
return l.decodeGltfBufferAsync ? l.decodeGltfBufferAsync(
|
|
872
|
+
const h = u.byteOffset || 0, y = u.byteLength || 0, A = u.count, _ = u.byteStride, P = new Uint8Array(p, h, y);
|
|
873
|
+
return l.decodeGltfBufferAsync ? l.decodeGltfBufferAsync(A, _, P, u.mode, u.filter).then(function(L) {
|
|
900
874
|
return L.buffer;
|
|
901
875
|
}) : l.ready.then(function() {
|
|
902
|
-
const L = new ArrayBuffer(
|
|
903
|
-
return l.decodeGltfBuffer(new Uint8Array(L),
|
|
876
|
+
const L = new ArrayBuffer(A * _);
|
|
877
|
+
return l.decodeGltfBuffer(new Uint8Array(L), A, _, P, u.mode, u.filter), L;
|
|
904
878
|
});
|
|
905
879
|
});
|
|
906
880
|
} else
|
|
@@ -921,29 +895,29 @@ class Fo {
|
|
|
921
895
|
return null;
|
|
922
896
|
const l = a.extensions[this.name].attributes, p = [], h = {};
|
|
923
897
|
for (const y in l)
|
|
924
|
-
p.push(this.parser.getDependency("accessor", l[y]).then((
|
|
898
|
+
p.push(this.parser.getDependency("accessor", l[y]).then((A) => (h[y] = A, h[y])));
|
|
925
899
|
return p.length < 1 ? null : (p.push(this.parser.createNodeMesh(s)), Promise.all(p).then((y) => {
|
|
926
|
-
const
|
|
900
|
+
const A = y.pop(), _ = A.isGroup ? A.children : [A], P = y[0].count, L = [];
|
|
927
901
|
for (const q of _) {
|
|
928
|
-
const X = new Dt(),
|
|
902
|
+
const X = new Dt(), G = new le(), W = new Ks(), Z = new le(1, 1, 1), ce = new Oi(q.geometry, q.material, P);
|
|
929
903
|
for (let Y = 0; Y < P; Y++)
|
|
930
|
-
h.TRANSLATION &&
|
|
904
|
+
h.TRANSLATION && G.fromBufferAttribute(h.TRANSLATION, Y), h.ROTATION && W.fromBufferAttribute(h.ROTATION, Y), h.SCALE && Z.fromBufferAttribute(h.SCALE, Y), ce.setMatrixAt(Y, X.compose(G, W, Z));
|
|
931
905
|
for (const Y in h)
|
|
932
906
|
if (Y === "_COLOR_0") {
|
|
933
907
|
const we = h[Y];
|
|
934
908
|
ce.instanceColor = new Mi(we.array, we.itemSize, we.normalized);
|
|
935
909
|
} else Y !== "TRANSLATION" && Y !== "ROTATION" && Y !== "SCALE" && q.geometry.setAttribute(Y, h[Y]);
|
|
936
|
-
|
|
910
|
+
js.prototype.copy.call(ce, q), this.parser.assignFinalMaterial(ce), L.push(ce);
|
|
937
911
|
}
|
|
938
|
-
return
|
|
912
|
+
return A.isGroup ? (A.clear(), A.add(...L), A) : L[0];
|
|
939
913
|
}));
|
|
940
914
|
}
|
|
941
915
|
}
|
|
942
|
-
const Vs = "glTF",
|
|
943
|
-
class
|
|
916
|
+
const Vs = "glTF", Qt = 12, Es = { JSON: 1313821514, BIN: 5130562 };
|
|
917
|
+
class Ko {
|
|
944
918
|
constructor(s) {
|
|
945
919
|
this.name = ne.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
946
|
-
const i = new DataView(s, 0,
|
|
920
|
+
const i = new DataView(s, 0, Qt), a = new TextDecoder();
|
|
947
921
|
if (this.header = {
|
|
948
922
|
magic: a.decode(new Uint8Array(s.slice(0, 4))),
|
|
949
923
|
version: i.getUint32(4, !0),
|
|
@@ -952,17 +926,17 @@ class jo {
|
|
|
952
926
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
953
927
|
if (this.header.version < 2)
|
|
954
928
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
955
|
-
const u = this.header.length -
|
|
929
|
+
const u = this.header.length - Qt, c = new DataView(s, Qt);
|
|
956
930
|
let l = 0;
|
|
957
931
|
for (; l < u; ) {
|
|
958
932
|
const p = c.getUint32(l, !0);
|
|
959
933
|
l += 4;
|
|
960
934
|
const h = c.getUint32(l, !0);
|
|
961
|
-
if (l += 4, h ===
|
|
962
|
-
const y = new Uint8Array(s,
|
|
935
|
+
if (l += 4, h === Es.JSON) {
|
|
936
|
+
const y = new Uint8Array(s, Qt + l, p);
|
|
963
937
|
this.content = a.decode(y);
|
|
964
|
-
} else if (h ===
|
|
965
|
-
const y =
|
|
938
|
+
} else if (h === Es.BIN) {
|
|
939
|
+
const y = Qt + l;
|
|
966
940
|
this.body = s.slice(y, y + p);
|
|
967
941
|
}
|
|
968
942
|
l += p;
|
|
@@ -971,7 +945,7 @@ class jo {
|
|
|
971
945
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
972
946
|
}
|
|
973
947
|
}
|
|
974
|
-
class
|
|
948
|
+
class jo {
|
|
975
949
|
constructor(s, i) {
|
|
976
950
|
if (!i)
|
|
977
951
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
@@ -979,26 +953,26 @@ class Ko {
|
|
|
979
953
|
}
|
|
980
954
|
decodePrimitive(s, i) {
|
|
981
955
|
const a = this.json, u = this.dracoLoader, c = s.extensions[this.name].bufferView, l = s.extensions[this.name].attributes, p = {}, h = {}, y = {};
|
|
982
|
-
for (const
|
|
983
|
-
const _ = Ir[
|
|
984
|
-
p[_] = l[
|
|
956
|
+
for (const A in l) {
|
|
957
|
+
const _ = Ir[A] || A.toLowerCase();
|
|
958
|
+
p[_] = l[A];
|
|
985
959
|
}
|
|
986
|
-
for (const
|
|
987
|
-
const _ = Ir[
|
|
988
|
-
if (l[
|
|
989
|
-
const P = a.accessors[s.attributes[
|
|
960
|
+
for (const A in s.attributes) {
|
|
961
|
+
const _ = Ir[A] || A.toLowerCase();
|
|
962
|
+
if (l[A] !== void 0) {
|
|
963
|
+
const P = a.accessors[s.attributes[A]], L = Lt[P.componentType];
|
|
990
964
|
y[_] = L.name, h[_] = P.normalized === !0;
|
|
991
965
|
}
|
|
992
966
|
}
|
|
993
|
-
return i.getDependency("bufferView", c).then(function(
|
|
967
|
+
return i.getDependency("bufferView", c).then(function(A) {
|
|
994
968
|
return new Promise(function(_, P) {
|
|
995
|
-
u.decodeDracoFile(
|
|
969
|
+
u.decodeDracoFile(A, function(L) {
|
|
996
970
|
for (const q in L.attributes) {
|
|
997
|
-
const X = L.attributes[q],
|
|
998
|
-
|
|
971
|
+
const X = L.attributes[q], G = h[q];
|
|
972
|
+
G !== void 0 && (X.normalized = G);
|
|
999
973
|
}
|
|
1000
974
|
_(L);
|
|
1001
|
-
}, p, y,
|
|
975
|
+
}, p, y, He, P);
|
|
1002
976
|
});
|
|
1003
977
|
});
|
|
1004
978
|
}
|
|
@@ -1027,16 +1001,16 @@ class Xs extends no {
|
|
|
1027
1001
|
return i;
|
|
1028
1002
|
}
|
|
1029
1003
|
interpolate_(s, i, a, u) {
|
|
1030
|
-
const c = this.resultBuffer, l = this.sampleValues, p = this.valueSize, h = p * 2, y = p * 3,
|
|
1004
|
+
const c = this.resultBuffer, l = this.sampleValues, p = this.valueSize, h = p * 2, y = p * 3, A = u - i, _ = (a - i) / A, P = _ * _, L = P * _, q = s * y, X = q - y, G = -2 * L + 3 * P, W = L - P, Z = 1 - G, ce = W - P + _;
|
|
1031
1005
|
for (let Y = 0; Y !== p; Y++) {
|
|
1032
|
-
const we = l[X + Y + p], ve = l[X + Y + h] *
|
|
1033
|
-
c[Y] = Z * we + ce * ve +
|
|
1006
|
+
const we = l[X + Y + p], ve = l[X + Y + h] * A, ae = l[q + Y + p], Le = l[q + Y] * A;
|
|
1007
|
+
c[Y] = Z * we + ce * ve + G * ae + W * Le;
|
|
1034
1008
|
}
|
|
1035
1009
|
return c;
|
|
1036
1010
|
}
|
|
1037
1011
|
}
|
|
1038
|
-
const qo = new
|
|
1039
|
-
class
|
|
1012
|
+
const qo = new Ks();
|
|
1013
|
+
class Ho extends Xs {
|
|
1040
1014
|
interpolate_(s, i, a, u) {
|
|
1041
1015
|
const c = super.interpolate_(s, i, a, u);
|
|
1042
1016
|
return qo.fromArray(c).normalize().toArray(c), c;
|
|
@@ -1057,7 +1031,7 @@ const Ie = {
|
|
|
1057
1031
|
5123: Uint16Array,
|
|
1058
1032
|
5125: Uint32Array,
|
|
1059
1033
|
5126: Float32Array
|
|
1060
|
-
},
|
|
1034
|
+
}, As = {
|
|
1061
1035
|
9728: Us,
|
|
1062
1036
|
9729: Pr,
|
|
1063
1037
|
9984: Fi,
|
|
@@ -1065,8 +1039,8 @@ const Ie = {
|
|
|
1065
1039
|
9986: Di,
|
|
1066
1040
|
9987: Bs
|
|
1067
1041
|
}, Ss = {
|
|
1068
|
-
33071:
|
|
1069
|
-
33648:
|
|
1042
|
+
33071: ji,
|
|
1043
|
+
33648: Ki,
|
|
1070
1044
|
10497: Cr
|
|
1071
1045
|
}, Sr = {
|
|
1072
1046
|
SCALAR: 1,
|
|
@@ -1092,11 +1066,11 @@ const Ie = {
|
|
|
1092
1066
|
translation: "position",
|
|
1093
1067
|
rotation: "quaternion",
|
|
1094
1068
|
weights: "morphTargetInfluences"
|
|
1095
|
-
},
|
|
1069
|
+
}, Go = {
|
|
1096
1070
|
CUBICSPLINE: void 0,
|
|
1097
1071
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
1098
1072
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
1099
|
-
LINEAR:
|
|
1073
|
+
LINEAR: Gs,
|
|
1100
1074
|
STEP: eo
|
|
1101
1075
|
}, Rr = {
|
|
1102
1076
|
OPAQUE: "OPAQUE",
|
|
@@ -1114,22 +1088,22 @@ function zo(C) {
|
|
|
1114
1088
|
side: to
|
|
1115
1089
|
})), C.DefaultMaterial;
|
|
1116
1090
|
}
|
|
1117
|
-
function
|
|
1091
|
+
function xt(C, s, i) {
|
|
1118
1092
|
for (const a in i.extensions)
|
|
1119
1093
|
C[a] === void 0 && (s.userData.gltfExtensions = s.userData.gltfExtensions || {}, s.userData.gltfExtensions[a] = i.extensions[a]);
|
|
1120
1094
|
}
|
|
1121
|
-
function
|
|
1095
|
+
function $e(C, s) {
|
|
1122
1096
|
s.extras !== void 0 && (typeof s.extras == "object" ? Object.assign(C.userData, s.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + s.extras));
|
|
1123
1097
|
}
|
|
1124
1098
|
function Vo(C, s, i) {
|
|
1125
1099
|
let a = !1, u = !1, c = !1;
|
|
1126
|
-
for (let y = 0,
|
|
1100
|
+
for (let y = 0, A = s.length; y < A; y++) {
|
|
1127
1101
|
const _ = s[y];
|
|
1128
1102
|
if (_.POSITION !== void 0 && (a = !0), _.NORMAL !== void 0 && (u = !0), _.COLOR_0 !== void 0 && (c = !0), a && u && c) break;
|
|
1129
1103
|
}
|
|
1130
1104
|
if (!a && !u && !c) return Promise.resolve(C);
|
|
1131
1105
|
const l = [], p = [], h = [];
|
|
1132
|
-
for (let y = 0,
|
|
1106
|
+
for (let y = 0, A = s.length; y < A; y++) {
|
|
1133
1107
|
const _ = s[y];
|
|
1134
1108
|
if (a) {
|
|
1135
1109
|
const P = _.POSITION !== void 0 ? i.getDependency("accessor", _.POSITION) : C.attributes.position;
|
|
@@ -1149,8 +1123,8 @@ function Vo(C, s, i) {
|
|
|
1149
1123
|
Promise.all(p),
|
|
1150
1124
|
Promise.all(h)
|
|
1151
1125
|
]).then(function(y) {
|
|
1152
|
-
const
|
|
1153
|
-
return a && (C.morphAttributes.position =
|
|
1126
|
+
const A = y[0], _ = y[1], P = y[2];
|
|
1127
|
+
return a && (C.morphAttributes.position = A), u && (C.morphAttributes.normal = _), c && (C.morphAttributes.color = P), C.morphTargetsRelative = !0, C;
|
|
1154
1128
|
});
|
|
1155
1129
|
}
|
|
1156
1130
|
function Xo(C, s) {
|
|
@@ -1199,8 +1173,8 @@ function Lr(C) {
|
|
|
1199
1173
|
function Yo(C) {
|
|
1200
1174
|
return C.search(/\.jpe?g($|\?)/i) > 0 || C.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : C.search(/\.webp($|\?)/i) > 0 || C.search(/^data\:image\/webp/) === 0 ? "image/webp" : C.search(/\.ktx2($|\?)/i) > 0 || C.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
1201
1175
|
}
|
|
1202
|
-
const
|
|
1203
|
-
class
|
|
1176
|
+
const $o = new Dt();
|
|
1177
|
+
class Qo {
|
|
1204
1178
|
constructor(s = {}, i = {}) {
|
|
1205
1179
|
this.json = s, this.extensions = {}, this.plugins = {}, this.options = i, this.cache = new bo(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
1206
1180
|
let a = !1, u = -1, c = !1, l = -1;
|
|
@@ -1240,7 +1214,7 @@ class $o {
|
|
|
1240
1214
|
parser: a,
|
|
1241
1215
|
userData: {}
|
|
1242
1216
|
};
|
|
1243
|
-
return
|
|
1217
|
+
return xt(c, p, u), $e(p, u), Promise.all(a._invokeAll(function(h) {
|
|
1244
1218
|
return h.afterRoot && h.afterRoot(p);
|
|
1245
1219
|
})).then(function() {
|
|
1246
1220
|
for (const h of p.scenes)
|
|
@@ -1296,8 +1270,8 @@ class $o {
|
|
|
1296
1270
|
const u = a.clone(), c = (l, p) => {
|
|
1297
1271
|
const h = this.associations.get(l);
|
|
1298
1272
|
h != null && this.associations.set(p, h);
|
|
1299
|
-
for (const [y,
|
|
1300
|
-
c(
|
|
1273
|
+
for (const [y, A] of l.children.entries())
|
|
1274
|
+
c(A, p.children[y]);
|
|
1301
1275
|
};
|
|
1302
1276
|
return c(a, u), u.name += "_instance_" + s.uses[i]++, u;
|
|
1303
1277
|
}
|
|
@@ -1455,24 +1429,24 @@ class $o {
|
|
|
1455
1429
|
}
|
|
1456
1430
|
const c = [];
|
|
1457
1431
|
return u.bufferView !== void 0 ? c.push(this.getDependency("bufferView", u.bufferView)) : c.push(null), u.sparse !== void 0 && (c.push(this.getDependency("bufferView", u.sparse.indices.bufferView)), c.push(this.getDependency("bufferView", u.sparse.values.bufferView))), Promise.all(c).then(function(l) {
|
|
1458
|
-
const p = l[0], h = Sr[u.type], y = Lt[u.componentType],
|
|
1459
|
-
let X,
|
|
1432
|
+
const p = l[0], h = Sr[u.type], y = Lt[u.componentType], A = y.BYTES_PER_ELEMENT, _ = A * h, P = u.byteOffset || 0, L = u.bufferView !== void 0 ? a.bufferViews[u.bufferView].byteStride : void 0, q = u.normalized === !0;
|
|
1433
|
+
let X, G;
|
|
1460
1434
|
if (L && L !== _) {
|
|
1461
1435
|
const W = Math.floor(P / L), Z = "InterleavedBuffer:" + u.bufferView + ":" + u.componentType + ":" + W + ":" + u.count;
|
|
1462
1436
|
let ce = i.cache.get(Z);
|
|
1463
|
-
ce || (X = new y(p, W * L, u.count * L /
|
|
1437
|
+
ce || (X = new y(p, W * L, u.count * L / A), ce = new Ii(X, L / A), i.cache.add(Z, ce)), G = new Li(ce, h, P % L / A, q);
|
|
1464
1438
|
} else
|
|
1465
|
-
p === null ? X = new y(u.count * h) : X = new y(p, P, u.count * h),
|
|
1439
|
+
p === null ? X = new y(u.count * h) : X = new y(p, P, u.count * h), G = new Zt(X, h, q);
|
|
1466
1440
|
if (u.sparse !== void 0) {
|
|
1467
1441
|
const W = Sr.SCALAR, Z = Lt[u.sparse.indices.componentType], ce = u.sparse.indices.byteOffset || 0, Y = u.sparse.values.byteOffset || 0, we = new Z(l[1], ce, u.sparse.count * W), ve = new y(l[2], Y, u.sparse.count * h);
|
|
1468
|
-
p !== null && (
|
|
1442
|
+
p !== null && (G = new Zt(G.array.slice(), G.itemSize, G.normalized)), G.normalized = !1;
|
|
1469
1443
|
for (let ae = 0, Le = we.length; ae < Le; ae++) {
|
|
1470
1444
|
const Me = we[ae];
|
|
1471
|
-
if (
|
|
1445
|
+
if (G.setX(Me, ve[ae * h]), h >= 2 && G.setY(Me, ve[ae * h + 1]), h >= 3 && G.setZ(Me, ve[ae * h + 2]), h >= 4 && G.setW(Me, ve[ae * h + 3]), h >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
1472
1446
|
}
|
|
1473
|
-
|
|
1447
|
+
G.normalized = q;
|
|
1474
1448
|
}
|
|
1475
|
-
return
|
|
1449
|
+
return G;
|
|
1476
1450
|
});
|
|
1477
1451
|
}
|
|
1478
1452
|
/**
|
|
@@ -1495,10 +1469,10 @@ class $o {
|
|
|
1495
1469
|
const u = this, c = this.json, l = c.textures[s], p = c.images[i], h = (p.uri || p.bufferView) + ":" + l.sampler;
|
|
1496
1470
|
if (this.textureCache[h])
|
|
1497
1471
|
return this.textureCache[h];
|
|
1498
|
-
const y = this.loadImageSource(i, a).then(function(
|
|
1499
|
-
|
|
1472
|
+
const y = this.loadImageSource(i, a).then(function(A) {
|
|
1473
|
+
A.flipY = !1, A.name = l.name || p.name || "", A.name === "" && typeof p.uri == "string" && p.uri.startsWith("data:image/") === !1 && (A.name = p.uri);
|
|
1500
1474
|
const P = (c.samplers || {})[l.sampler] || {};
|
|
1501
|
-
return
|
|
1475
|
+
return A.magFilter = As[P.magFilter] || Pr, A.minFilter = As[P.minFilter] || Bs, A.wrapS = Ss[P.wrapS] || Cr, A.wrapT = Ss[P.wrapT] || Cr, A.generateMipmaps = !A.isCompressedTexture && A.minFilter !== Us && A.minFilter !== Pr, u.associations.set(A, { textures: s }), A;
|
|
1502
1476
|
}).catch(function() {
|
|
1503
1477
|
return null;
|
|
1504
1478
|
});
|
|
@@ -1518,20 +1492,20 @@ class $o {
|
|
|
1518
1492
|
});
|
|
1519
1493
|
else if (l.uri === void 0)
|
|
1520
1494
|
throw new Error("THREE.GLTFLoader: Image " + s + " is missing URI and bufferView");
|
|
1521
|
-
const
|
|
1495
|
+
const A = Promise.resolve(h).then(function(_) {
|
|
1522
1496
|
return new Promise(function(P, L) {
|
|
1523
1497
|
let q = P;
|
|
1524
1498
|
i.isImageBitmapLoader === !0 && (q = function(X) {
|
|
1525
|
-
const
|
|
1526
|
-
|
|
1499
|
+
const G = new vs(X);
|
|
1500
|
+
G.needsUpdate = !0, P(G);
|
|
1527
1501
|
}), i.load(en.resolveURL(_, c.path), q, void 0, L);
|
|
1528
1502
|
});
|
|
1529
1503
|
}).then(function(_) {
|
|
1530
|
-
return y === !0 && p.revokeObjectURL(h),
|
|
1504
|
+
return y === !0 && p.revokeObjectURL(h), $e(_, l), _.userData.mimeType = l.mimeType || Yo(l.uri), _;
|
|
1531
1505
|
}).catch(function(_) {
|
|
1532
1506
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", h), _;
|
|
1533
1507
|
});
|
|
1534
|
-
return this.sourceCache[s] =
|
|
1508
|
+
return this.sourceCache[s] = A, A;
|
|
1535
1509
|
}
|
|
1536
1510
|
/**
|
|
1537
1511
|
* Asynchronously assigns a texture to the given material parameters.
|
|
@@ -1574,11 +1548,11 @@ class $o {
|
|
|
1574
1548
|
if (s.isPoints) {
|
|
1575
1549
|
const p = "PointsMaterial:" + a.uuid;
|
|
1576
1550
|
let h = this.cache.get(p);
|
|
1577
|
-
h || (h = new Bi(),
|
|
1551
|
+
h || (h = new Bi(), xr.prototype.copy.call(h, a), h.color.copy(a.color), h.map = a.map, h.sizeAttenuation = !1, this.cache.add(p, h)), a = h;
|
|
1578
1552
|
} else if (s.isLine) {
|
|
1579
1553
|
const p = "LineBasicMaterial:" + a.uuid;
|
|
1580
1554
|
let h = this.cache.get(p);
|
|
1581
|
-
h || (h = new Ui(),
|
|
1555
|
+
h || (h = new Ui(), xr.prototype.copy.call(h, a), h.color.copy(a.color), h.map = a.map, this.cache.add(p, h)), a = h;
|
|
1582
1556
|
}
|
|
1583
1557
|
if (u || c || l) {
|
|
1584
1558
|
let p = "ClonedMaterial:" + a.uuid + ":";
|
|
@@ -1607,9 +1581,9 @@ class $o {
|
|
|
1607
1581
|
l = _.getMaterialType(), y.push(_.extendParams(p, c, i));
|
|
1608
1582
|
} else {
|
|
1609
1583
|
const _ = c.pbrMetallicRoughness || {};
|
|
1610
|
-
if (p.color = new
|
|
1584
|
+
if (p.color = new Qe(1, 1, 1), p.opacity = 1, Array.isArray(_.baseColorFactor)) {
|
|
1611
1585
|
const P = _.baseColorFactor;
|
|
1612
|
-
p.color.setRGB(P[0], P[1], P[2],
|
|
1586
|
+
p.color.setRGB(P[0], P[1], P[2], He), p.opacity = P[3];
|
|
1613
1587
|
}
|
|
1614
1588
|
_.baseColorTexture !== void 0 && y.push(i.assignTexture(p, "map", _.baseColorTexture, ut)), p.metalness = _.metallicFactor !== void 0 ? _.metallicFactor : 1, p.roughness = _.roughnessFactor !== void 0 ? _.roughnessFactor : 1, _.metallicRoughnessTexture !== void 0 && (y.push(i.assignTexture(p, "metalnessMap", _.metallicRoughnessTexture)), y.push(i.assignTexture(p, "roughnessMap", _.metallicRoughnessTexture))), l = this._invokeOne(function(P) {
|
|
1615
1589
|
return P.getMaterialType && P.getMaterialType(s);
|
|
@@ -1618,18 +1592,18 @@ class $o {
|
|
|
1618
1592
|
})));
|
|
1619
1593
|
}
|
|
1620
1594
|
c.doubleSided === !0 && (p.side = qi);
|
|
1621
|
-
const
|
|
1622
|
-
if (
|
|
1595
|
+
const A = c.alphaMode || Rr.OPAQUE;
|
|
1596
|
+
if (A === Rr.BLEND ? (p.transparent = !0, p.depthWrite = !1) : (p.transparent = !1, A === Rr.MASK && (p.alphaTest = c.alphaCutoff !== void 0 ? c.alphaCutoff : 0.5)), c.normalTexture !== void 0 && l !== Jt && (y.push(i.assignTexture(p, "normalMap", c.normalTexture)), p.normalScale = new Fr(1, 1), c.normalTexture.scale !== void 0)) {
|
|
1623
1597
|
const _ = c.normalTexture.scale;
|
|
1624
1598
|
p.normalScale.set(_, _);
|
|
1625
1599
|
}
|
|
1626
1600
|
if (c.occlusionTexture !== void 0 && l !== Jt && (y.push(i.assignTexture(p, "aoMap", c.occlusionTexture)), c.occlusionTexture.strength !== void 0 && (p.aoMapIntensity = c.occlusionTexture.strength)), c.emissiveFactor !== void 0 && l !== Jt) {
|
|
1627
1601
|
const _ = c.emissiveFactor;
|
|
1628
|
-
p.emissive = new
|
|
1602
|
+
p.emissive = new Qe().setRGB(_[0], _[1], _[2], He);
|
|
1629
1603
|
}
|
|
1630
1604
|
return c.emissiveTexture !== void 0 && l !== Jt && y.push(i.assignTexture(p, "emissiveMap", c.emissiveTexture, ut)), Promise.all(y).then(function() {
|
|
1631
1605
|
const _ = new l(p);
|
|
1632
|
-
return c.name && (_.name = c.name),
|
|
1606
|
+
return c.name && (_.name = c.name), $e(_, c), i.associations.set(_, { materials: s }), c.extensions && xt(u, _, c), _;
|
|
1633
1607
|
});
|
|
1634
1608
|
}
|
|
1635
1609
|
/**
|
|
@@ -1640,7 +1614,7 @@ class $o {
|
|
|
1640
1614
|
* @return {string}
|
|
1641
1615
|
*/
|
|
1642
1616
|
createUniqueName(s) {
|
|
1643
|
-
const i =
|
|
1617
|
+
const i = Hi.sanitizeNodeName(s || "");
|
|
1644
1618
|
return i in this.nodeNamesUsed ? i + "_" + ++this.nodeNamesUsed[i] : (this.nodeNamesUsed[i] = 0, i);
|
|
1645
1619
|
}
|
|
1646
1620
|
/**
|
|
@@ -1661,12 +1635,12 @@ class $o {
|
|
|
1661
1635
|
}
|
|
1662
1636
|
const l = [];
|
|
1663
1637
|
for (let p = 0, h = s.length; p < h; p++) {
|
|
1664
|
-
const y = s[p],
|
|
1638
|
+
const y = s[p], A = Wo(y), _ = u[A];
|
|
1665
1639
|
if (_)
|
|
1666
1640
|
l.push(_.promise);
|
|
1667
1641
|
else {
|
|
1668
1642
|
let P;
|
|
1669
|
-
y.extensions && y.extensions[ne.KHR_DRACO_MESH_COMPRESSION] ? P = c(y) : P = Rs(new Fs(), y, i), u[
|
|
1643
|
+
y.extensions && y.extensions[ne.KHR_DRACO_MESH_COMPRESSION] ? P = c(y) : P = Rs(new Fs(), y, i), u[A] = { primitive: y, promise: P }, l.push(P);
|
|
1670
1644
|
}
|
|
1671
1645
|
}
|
|
1672
1646
|
return Promise.all(l);
|
|
@@ -1681,28 +1655,28 @@ class $o {
|
|
|
1681
1655
|
loadMesh(s) {
|
|
1682
1656
|
const i = this, a = this.json, u = this.extensions, c = a.meshes[s], l = c.primitives, p = [];
|
|
1683
1657
|
for (let h = 0, y = l.length; h < y; h++) {
|
|
1684
|
-
const
|
|
1685
|
-
p.push(
|
|
1658
|
+
const A = l[h].material === void 0 ? zo(this.cache) : this.getDependency("material", l[h].material);
|
|
1659
|
+
p.push(A);
|
|
1686
1660
|
}
|
|
1687
1661
|
return p.push(i.loadGeometries(l)), Promise.all(p).then(function(h) {
|
|
1688
|
-
const y = h.slice(0, h.length - 1),
|
|
1689
|
-
for (let L = 0, q =
|
|
1690
|
-
const X =
|
|
1662
|
+
const y = h.slice(0, h.length - 1), A = h[h.length - 1], _ = [];
|
|
1663
|
+
for (let L = 0, q = A.length; L < q; L++) {
|
|
1664
|
+
const X = A[L], G = l[L];
|
|
1691
1665
|
let W;
|
|
1692
1666
|
const Z = y[L];
|
|
1693
|
-
if (
|
|
1694
|
-
W = c.isSkinnedMesh === !0 ? new
|
|
1695
|
-
else if (
|
|
1667
|
+
if (G.mode === Ie.TRIANGLES || G.mode === Ie.TRIANGLE_STRIP || G.mode === Ie.TRIANGLE_FAN || G.mode === void 0)
|
|
1668
|
+
W = c.isSkinnedMesh === !0 ? new Gi(X, Z) : new zi(X, Z), W.isSkinnedMesh === !0 && W.normalizeSkinWeights(), G.mode === Ie.TRIANGLE_STRIP ? W.geometry = Ts(W.geometry, Ds) : G.mode === Ie.TRIANGLE_FAN && (W.geometry = Ts(W.geometry, Or));
|
|
1669
|
+
else if (G.mode === Ie.LINES)
|
|
1696
1670
|
W = new Vi(X, Z);
|
|
1697
|
-
else if (
|
|
1671
|
+
else if (G.mode === Ie.LINE_STRIP)
|
|
1698
1672
|
W = new Xi(X, Z);
|
|
1699
|
-
else if (
|
|
1673
|
+
else if (G.mode === Ie.LINE_LOOP)
|
|
1700
1674
|
W = new Wi(X, Z);
|
|
1701
|
-
else if (
|
|
1675
|
+
else if (G.mode === Ie.POINTS)
|
|
1702
1676
|
W = new Yi(X, Z);
|
|
1703
1677
|
else
|
|
1704
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " +
|
|
1705
|
-
Object.keys(W.geometry.morphAttributes).length > 0 && Xo(W, c), W.name = i.createUniqueName(c.name || "mesh_" + s),
|
|
1678
|
+
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + G.mode);
|
|
1679
|
+
Object.keys(W.geometry.morphAttributes).length > 0 && Xo(W, c), W.name = i.createUniqueName(c.name || "mesh_" + s), $e(W, c), G.extensions && xt(u, W, G), i.assignFinalMaterial(W), _.push(W);
|
|
1706
1680
|
}
|
|
1707
1681
|
for (let L = 0, q = _.length; L < q; L++)
|
|
1708
1682
|
i.associations.set(_[L], {
|
|
@@ -1710,9 +1684,9 @@ class $o {
|
|
|
1710
1684
|
primitives: L
|
|
1711
1685
|
});
|
|
1712
1686
|
if (_.length === 1)
|
|
1713
|
-
return c.extensions &&
|
|
1714
|
-
const P = new
|
|
1715
|
-
c.extensions &&
|
|
1687
|
+
return c.extensions && xt(u, _[0], c), _[0];
|
|
1688
|
+
const P = new Tr();
|
|
1689
|
+
c.extensions && xt(u, P, c), i.associations.set(P, { meshes: s });
|
|
1716
1690
|
for (let L = 0, q = _.length; L < q; L++)
|
|
1717
1691
|
P.add(_[L]);
|
|
1718
1692
|
return P;
|
|
@@ -1732,7 +1706,7 @@ class $o {
|
|
|
1732
1706
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1733
1707
|
return;
|
|
1734
1708
|
}
|
|
1735
|
-
return a.type === "perspective" ? i = new
|
|
1709
|
+
return a.type === "perspective" ? i = new Hs(It.radToDeg(u.yfov), u.aspectRatio || 1, u.znear || 1, u.zfar || 2e6) : a.type === "orthographic" && (i = new $i(-u.xmag, u.xmag, u.ymag, -u.ymag, u.znear, u.zfar)), a.name && (i.name = this.createUniqueName(a.name)), $e(i, a), Promise.resolve(i);
|
|
1736
1710
|
}
|
|
1737
1711
|
/**
|
|
1738
1712
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -1747,7 +1721,7 @@ class $o {
|
|
|
1747
1721
|
a.push(this._loadNodeShallow(i.joints[u]));
|
|
1748
1722
|
return i.inverseBindMatrices !== void 0 ? a.push(this.getDependency("accessor", i.inverseBindMatrices)) : a.push(null), Promise.all(a).then(function(u) {
|
|
1749
1723
|
const c = u.pop(), l = u, p = [], h = [];
|
|
1750
|
-
for (let y = 0,
|
|
1724
|
+
for (let y = 0, A = l.length; y < A; y++) {
|
|
1751
1725
|
const _ = l[y];
|
|
1752
1726
|
if (_) {
|
|
1753
1727
|
p.push(_);
|
|
@@ -1756,7 +1730,7 @@ class $o {
|
|
|
1756
1730
|
} else
|
|
1757
1731
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', i.joints[y]);
|
|
1758
1732
|
}
|
|
1759
|
-
return new
|
|
1733
|
+
return new Qi(p, h);
|
|
1760
1734
|
});
|
|
1761
1735
|
}
|
|
1762
1736
|
/**
|
|
@@ -1767,21 +1741,21 @@ class $o {
|
|
|
1767
1741
|
* @return {Promise<AnimationClip>}
|
|
1768
1742
|
*/
|
|
1769
1743
|
loadAnimation(s) {
|
|
1770
|
-
const i = this.json, a = this, u = i.animations[s], c = u.name ? u.name : "animation_" + s, l = [], p = [], h = [], y = [],
|
|
1744
|
+
const i = this.json, a = this, u = i.animations[s], c = u.name ? u.name : "animation_" + s, l = [], p = [], h = [], y = [], A = [];
|
|
1771
1745
|
for (let _ = 0, P = u.channels.length; _ < P; _++) {
|
|
1772
|
-
const L = u.channels[_], q = u.samplers[L.sampler], X = L.target,
|
|
1773
|
-
X.node !== void 0 && (l.push(this.getDependency("node",
|
|
1746
|
+
const L = u.channels[_], q = u.samplers[L.sampler], X = L.target, G = X.node, W = u.parameters !== void 0 ? u.parameters[q.input] : q.input, Z = u.parameters !== void 0 ? u.parameters[q.output] : q.output;
|
|
1747
|
+
X.node !== void 0 && (l.push(this.getDependency("node", G)), p.push(this.getDependency("accessor", W)), h.push(this.getDependency("accessor", Z)), y.push(q), A.push(X));
|
|
1774
1748
|
}
|
|
1775
1749
|
return Promise.all([
|
|
1776
1750
|
Promise.all(l),
|
|
1777
1751
|
Promise.all(p),
|
|
1778
1752
|
Promise.all(h),
|
|
1779
1753
|
Promise.all(y),
|
|
1780
|
-
Promise.all(
|
|
1754
|
+
Promise.all(A)
|
|
1781
1755
|
]).then(function(_) {
|
|
1782
|
-
const P = _[0], L = _[1], q = _[2], X = _[3],
|
|
1756
|
+
const P = _[0], L = _[1], q = _[2], X = _[3], G = _[4], W = [];
|
|
1783
1757
|
for (let Z = 0, ce = P.length; Z < ce; Z++) {
|
|
1784
|
-
const Y = P[Z], we = L[Z], ve = q[Z], ae = X[Z], Le =
|
|
1758
|
+
const Y = P[Z], we = L[Z], ve = q[Z], ae = X[Z], Le = G[Z];
|
|
1785
1759
|
if (Y === void 0) continue;
|
|
1786
1760
|
Y.updateMatrix && Y.updateMatrix();
|
|
1787
1761
|
const Me = a._createAnimationTracks(Y, we, ve, ae, Le);
|
|
@@ -1812,7 +1786,7 @@ class $o {
|
|
|
1812
1786
|
*/
|
|
1813
1787
|
loadNode(s) {
|
|
1814
1788
|
const i = this.json, a = this, u = i.nodes[s], c = a._loadNodeShallow(s), l = [], p = u.children || [];
|
|
1815
|
-
for (let y = 0,
|
|
1789
|
+
for (let y = 0, A = p.length; y < A; y++)
|
|
1816
1790
|
l.push(a.getDependency("node", p[y]));
|
|
1817
1791
|
const h = u.skin === void 0 ? Promise.resolve(null) : a.getDependency("skin", u.skin);
|
|
1818
1792
|
return Promise.all([
|
|
@@ -1820,13 +1794,13 @@ class $o {
|
|
|
1820
1794
|
Promise.all(l),
|
|
1821
1795
|
h
|
|
1822
1796
|
]).then(function(y) {
|
|
1823
|
-
const
|
|
1824
|
-
P !== null &&
|
|
1825
|
-
L.isSkinnedMesh && L.bind(P,
|
|
1797
|
+
const A = y[0], _ = y[1], P = y[2];
|
|
1798
|
+
P !== null && A.traverse(function(L) {
|
|
1799
|
+
L.isSkinnedMesh && L.bind(P, $o);
|
|
1826
1800
|
});
|
|
1827
1801
|
for (let L = 0, q = _.length; L < q; L++)
|
|
1828
|
-
|
|
1829
|
-
return
|
|
1802
|
+
A.add(_[L]);
|
|
1803
|
+
return A;
|
|
1830
1804
|
});
|
|
1831
1805
|
}
|
|
1832
1806
|
// ._loadNodeShallow() parses a single node.
|
|
@@ -1845,16 +1819,22 @@ class $o {
|
|
|
1845
1819
|
}).forEach(function(y) {
|
|
1846
1820
|
p.push(y);
|
|
1847
1821
|
}), this.nodeCache[s] = Promise.all(p).then(function(y) {
|
|
1848
|
-
let
|
|
1849
|
-
if (c.isBone === !0 ?
|
|
1822
|
+
let A;
|
|
1823
|
+
if (c.isBone === !0 ? A = new Zi() : y.length > 1 ? A = new Tr() : y.length === 1 ? A = y[0] : A = new js(), A !== y[0])
|
|
1850
1824
|
for (let _ = 0, P = y.length; _ < P; _++)
|
|
1851
|
-
|
|
1852
|
-
if (c.name && (
|
|
1825
|
+
A.add(y[_]);
|
|
1826
|
+
if (c.name && (A.userData.name = c.name, A.name = l), $e(A, c), c.extensions && xt(a, A, c), c.matrix !== void 0) {
|
|
1853
1827
|
const _ = new Dt();
|
|
1854
|
-
_.fromArray(c.matrix),
|
|
1828
|
+
_.fromArray(c.matrix), A.applyMatrix4(_);
|
|
1855
1829
|
} else
|
|
1856
|
-
c.translation !== void 0 &&
|
|
1857
|
-
|
|
1830
|
+
c.translation !== void 0 && A.position.fromArray(c.translation), c.rotation !== void 0 && A.quaternion.fromArray(c.rotation), c.scale !== void 0 && A.scale.fromArray(c.scale);
|
|
1831
|
+
if (!u.associations.has(A))
|
|
1832
|
+
u.associations.set(A, {});
|
|
1833
|
+
else if (c.mesh !== void 0 && u.meshCache.refs[c.mesh] > 1) {
|
|
1834
|
+
const _ = u.associations.get(A);
|
|
1835
|
+
u.associations.set(A, { ..._ });
|
|
1836
|
+
}
|
|
1837
|
+
return u.associations.get(A).nodes = s, A;
|
|
1858
1838
|
}), this.nodeCache[s];
|
|
1859
1839
|
}
|
|
1860
1840
|
/**
|
|
@@ -1865,19 +1845,19 @@ class $o {
|
|
|
1865
1845
|
* @return {Promise<Group>}
|
|
1866
1846
|
*/
|
|
1867
1847
|
loadScene(s) {
|
|
1868
|
-
const i = this.extensions, a = this.json.scenes[s], u = this, c = new
|
|
1869
|
-
a.name && (c.name = u.createUniqueName(a.name)),
|
|
1848
|
+
const i = this.extensions, a = this.json.scenes[s], u = this, c = new Tr();
|
|
1849
|
+
a.name && (c.name = u.createUniqueName(a.name)), $e(c, a), a.extensions && xt(i, c, a);
|
|
1870
1850
|
const l = a.nodes || [], p = [];
|
|
1871
1851
|
for (let h = 0, y = l.length; h < y; h++)
|
|
1872
1852
|
p.push(u.getDependency("node", l[h]));
|
|
1873
1853
|
return Promise.all(p).then(function(h) {
|
|
1874
|
-
for (let
|
|
1875
|
-
c.add(h[
|
|
1876
|
-
const y = (
|
|
1854
|
+
for (let A = 0, _ = h.length; A < _; A++)
|
|
1855
|
+
c.add(h[A]);
|
|
1856
|
+
const y = (A) => {
|
|
1877
1857
|
const _ = /* @__PURE__ */ new Map();
|
|
1878
1858
|
for (const [P, L] of u.associations)
|
|
1879
|
-
(P instanceof
|
|
1880
|
-
return
|
|
1859
|
+
(P instanceof xr || P instanceof vs) && _.set(P, L);
|
|
1860
|
+
return A.traverse((P) => {
|
|
1881
1861
|
const L = u.associations.get(P);
|
|
1882
1862
|
L != null && _.set(P, L);
|
|
1883
1863
|
}), _;
|
|
@@ -1915,13 +1895,13 @@ class $o {
|
|
|
1915
1895
|
}
|
|
1916
1896
|
break;
|
|
1917
1897
|
}
|
|
1918
|
-
const
|
|
1898
|
+
const A = u.interpolation !== void 0 ? Go[u.interpolation] : Gs, _ = this._getArrayFromAccessor(a);
|
|
1919
1899
|
for (let P = 0, L = h.length; P < L; P++) {
|
|
1920
1900
|
const q = new y(
|
|
1921
1901
|
h[P] + "." + at[c.path],
|
|
1922
1902
|
i.array,
|
|
1923
1903
|
_,
|
|
1924
|
-
|
|
1904
|
+
A
|
|
1925
1905
|
);
|
|
1926
1906
|
u.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(q), l.push(q);
|
|
1927
1907
|
}
|
|
@@ -1939,13 +1919,13 @@ class $o {
|
|
|
1939
1919
|
}
|
|
1940
1920
|
_createCubicSplineTrackInterpolant(s) {
|
|
1941
1921
|
s.createInterpolant = function(a) {
|
|
1942
|
-
const u = this instanceof _s ?
|
|
1922
|
+
const u = this instanceof _s ? Ho : Xs;
|
|
1943
1923
|
return new u(this.times, this.values, this.getValueSize() / 3, a);
|
|
1944
1924
|
}, s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
1945
1925
|
}
|
|
1946
1926
|
}
|
|
1947
1927
|
function Jo(C, s, i) {
|
|
1948
|
-
const a = s.attributes, u = new
|
|
1928
|
+
const a = s.attributes, u = new Kn();
|
|
1949
1929
|
if (a.POSITION !== void 0) {
|
|
1950
1930
|
const p = i.json.accessors[a.POSITION], h = p.min, y = p.max;
|
|
1951
1931
|
if (h !== void 0 && y !== void 0) {
|
|
@@ -1953,8 +1933,8 @@ function Jo(C, s, i) {
|
|
|
1953
1933
|
new le(h[0], h[1], h[2]),
|
|
1954
1934
|
new le(y[0], y[1], y[2])
|
|
1955
1935
|
), p.normalized) {
|
|
1956
|
-
const
|
|
1957
|
-
u.min.multiplyScalar(
|
|
1936
|
+
const A = Lr(Lt[p.componentType]);
|
|
1937
|
+
u.min.multiplyScalar(A), u.max.multiplyScalar(A);
|
|
1958
1938
|
}
|
|
1959
1939
|
} else {
|
|
1960
1940
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
@@ -1965,7 +1945,7 @@ function Jo(C, s, i) {
|
|
|
1965
1945
|
const c = s.targets;
|
|
1966
1946
|
if (c !== void 0) {
|
|
1967
1947
|
const p = new le(), h = new le();
|
|
1968
|
-
for (let y = 0,
|
|
1948
|
+
for (let y = 0, A = c.length; y < A; y++) {
|
|
1969
1949
|
const _ = c[y];
|
|
1970
1950
|
if (_.POSITION !== void 0) {
|
|
1971
1951
|
const P = i.json.accessors[_.POSITION], L = P.min, q = P.max;
|
|
@@ -2002,7 +1982,7 @@ function Rs(C, s, i) {
|
|
|
2002
1982
|
});
|
|
2003
1983
|
u.push(l);
|
|
2004
1984
|
}
|
|
2005
|
-
return Mr.workingColorSpace !==
|
|
1985
|
+
return Mr.workingColorSpace !== He && "COLOR_0" in a && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Mr.workingColorSpace}" not supported.`), $e(C, s), Jo(C, s, i), Promise.all(u).then(function() {
|
|
2006
1986
|
return s.targets !== void 0 ? Vo(C, s.targets, i) : C;
|
|
2007
1987
|
});
|
|
2008
1988
|
}
|
|
@@ -2020,7 +2000,7 @@ const se = {
|
|
|
2020
2000
|
// basis vectors
|
|
2021
2001
|
e: []
|
|
2022
2002
|
// half width
|
|
2023
|
-
}, pe = [[], [], []],
|
|
2003
|
+
}, pe = [[], [], []], Q = [[], [], []], he = [], Tt = new le(), Et = new le(), At = new le(), be = new le(), ks = new le(), Os = new le(), De = new zs(), Ms = new Kn(), In = new Dt(), Ps = new Dt(), Cs = new so();
|
|
2024
2004
|
class Dr {
|
|
2025
2005
|
/**
|
|
2026
2006
|
* Constructs a new OBB.
|
|
@@ -2078,13 +2058,13 @@ class Dr {
|
|
|
2078
2058
|
*/
|
|
2079
2059
|
clampPoint(s, i) {
|
|
2080
2060
|
const a = this.halfSize;
|
|
2081
|
-
be.subVectors(s, this.center), this.rotation.extractBasis(
|
|
2082
|
-
const u = It.clamp(be.dot(
|
|
2083
|
-
i.add(
|
|
2084
|
-
const c = It.clamp(be.dot(
|
|
2085
|
-
i.add(
|
|
2086
|
-
const l = It.clamp(be.dot(
|
|
2087
|
-
return i.add(
|
|
2061
|
+
be.subVectors(s, this.center), this.rotation.extractBasis(Tt, Et, At), i.copy(this.center);
|
|
2062
|
+
const u = It.clamp(be.dot(Tt), -a.x, a.x);
|
|
2063
|
+
i.add(Tt.multiplyScalar(u));
|
|
2064
|
+
const c = It.clamp(be.dot(Et), -a.y, a.y);
|
|
2065
|
+
i.add(Et.multiplyScalar(c));
|
|
2066
|
+
const l = It.clamp(be.dot(At), -a.z, a.z);
|
|
2067
|
+
return i.add(At.multiplyScalar(l)), i;
|
|
2088
2068
|
}
|
|
2089
2069
|
/**
|
|
2090
2070
|
* Returns `true` if the given point lies within this OBB.
|
|
@@ -2093,7 +2073,7 @@ class Dr {
|
|
|
2093
2073
|
* @returns {boolean} - Whether the given point lies within this OBB or not.
|
|
2094
2074
|
*/
|
|
2095
2075
|
containsPoint(s) {
|
|
2096
|
-
return be.subVectors(s, this.center), this.rotation.extractBasis(
|
|
2076
|
+
return be.subVectors(s, this.center), this.rotation.extractBasis(Tt, Et, At), Math.abs(be.dot(Tt)) <= this.halfSize.x && Math.abs(be.dot(Et)) <= this.halfSize.y && Math.abs(be.dot(At)) <= this.halfSize.z;
|
|
2097
2077
|
}
|
|
2098
2078
|
/**
|
|
2099
2079
|
* Returns `true` if the given AABB intersects this OBB.
|
|
@@ -2128,13 +2108,13 @@ class Dr {
|
|
|
2128
2108
|
be.subVectors(oe.c, se.c), he[0] = be.dot(se.u[0]), he[1] = be.dot(se.u[1]), he[2] = be.dot(se.u[2]);
|
|
2129
2109
|
for (let c = 0; c < 3; c++)
|
|
2130
2110
|
for (let l = 0; l < 3; l++)
|
|
2131
|
-
|
|
2111
|
+
Q[c][l] = Math.abs(pe[c][l]) + i;
|
|
2132
2112
|
let a, u;
|
|
2133
2113
|
for (let c = 0; c < 3; c++)
|
|
2134
|
-
if (a = se.e[c], u = oe.e[0] *
|
|
2114
|
+
if (a = se.e[c], u = oe.e[0] * Q[c][0] + oe.e[1] * Q[c][1] + oe.e[2] * Q[c][2], Math.abs(he[c]) > a + u) return !1;
|
|
2135
2115
|
for (let c = 0; c < 3; c++)
|
|
2136
|
-
if (a = se.e[0] *
|
|
2137
|
-
return a = se.e[1] *
|
|
2116
|
+
if (a = se.e[0] * Q[0][c] + se.e[1] * Q[1][c] + se.e[2] * Q[2][c], u = oe.e[c], Math.abs(he[0] * pe[0][c] + he[1] * pe[1][c] + he[2] * pe[2][c]) > a + u) return !1;
|
|
2117
|
+
return a = se.e[1] * Q[2][0] + se.e[2] * Q[1][0], u = oe.e[1] * Q[0][2] + oe.e[2] * Q[0][1], !(Math.abs(he[2] * pe[1][0] - he[1] * pe[2][0]) > a + u || (a = se.e[1] * Q[2][1] + se.e[2] * Q[1][1], u = oe.e[0] * Q[0][2] + oe.e[2] * Q[0][0], Math.abs(he[2] * pe[1][1] - he[1] * pe[2][1]) > a + u) || (a = se.e[1] * Q[2][2] + se.e[2] * Q[1][2], u = oe.e[0] * Q[0][1] + oe.e[1] * Q[0][0], Math.abs(he[2] * pe[1][2] - he[1] * pe[2][2]) > a + u) || (a = se.e[0] * Q[2][0] + se.e[2] * Q[0][0], u = oe.e[1] * Q[1][2] + oe.e[2] * Q[1][1], Math.abs(he[0] * pe[2][0] - he[2] * pe[0][0]) > a + u) || (a = se.e[0] * Q[2][1] + se.e[2] * Q[0][1], u = oe.e[0] * Q[1][2] + oe.e[2] * Q[1][0], Math.abs(he[0] * pe[2][1] - he[2] * pe[0][1]) > a + u) || (a = se.e[0] * Q[2][2] + se.e[2] * Q[0][2], u = oe.e[0] * Q[1][1] + oe.e[1] * Q[1][0], Math.abs(he[0] * pe[2][2] - he[2] * pe[0][2]) > a + u) || (a = se.e[0] * Q[1][0] + se.e[1] * Q[0][0], u = oe.e[1] * Q[2][2] + oe.e[2] * Q[2][1], Math.abs(he[1] * pe[0][0] - he[0] * pe[1][0]) > a + u) || (a = se.e[0] * Q[1][1] + se.e[1] * Q[0][1], u = oe.e[0] * Q[2][2] + oe.e[2] * Q[2][0], Math.abs(he[1] * pe[0][1] - he[0] * pe[1][1]) > a + u) || (a = se.e[0] * Q[1][2] + se.e[1] * Q[0][2], u = oe.e[0] * Q[2][1] + oe.e[1] * Q[2][0], Math.abs(he[1] * pe[0][2] - he[0] * pe[1][2]) > a + u));
|
|
2138
2118
|
}
|
|
2139
2119
|
/**
|
|
2140
2120
|
* Returns `true` if the given plane intersects this OBB.
|
|
@@ -2143,8 +2123,8 @@ class Dr {
|
|
|
2143
2123
|
* @returns {boolean} Whether the given plane intersects this OBB or not.
|
|
2144
2124
|
*/
|
|
2145
2125
|
intersectsPlane(s) {
|
|
2146
|
-
this.rotation.extractBasis(
|
|
2147
|
-
const i = this.halfSize.x * Math.abs(s.normal.dot(
|
|
2126
|
+
this.rotation.extractBasis(Tt, Et, At);
|
|
2127
|
+
const i = this.halfSize.x * Math.abs(s.normal.dot(Tt)) + this.halfSize.y * Math.abs(s.normal.dot(Et)) + this.halfSize.z * Math.abs(s.normal.dot(At)), a = s.normal.dot(this.center) - s.constant;
|
|
2148
2128
|
return Math.abs(a) <= i;
|
|
2149
2129
|
}
|
|
2150
2130
|
/**
|
|
@@ -2224,18 +2204,18 @@ function la(C, s) {
|
|
|
2224
2204
|
s || {}
|
|
2225
2205
|
);
|
|
2226
2206
|
let a, u, c, l = [];
|
|
2227
|
-
const p =
|
|
2207
|
+
const p = Er(!1), h = uo(), y = Er(0), A = Er(0), _ = new io({
|
|
2228
2208
|
antialias: !0,
|
|
2229
2209
|
alpha: !0,
|
|
2230
2210
|
precision: "mediump",
|
|
2231
2211
|
logarithmicDepthBuffer: !0
|
|
2232
|
-
}), P = new oo({}), L = new
|
|
2212
|
+
}), P = new oo({}), L = new Hs(50, 1, 0.1, 2e3), q = Math.tan(Math.PI / 180 * L.fov / 2);
|
|
2233
2213
|
let X = !1;
|
|
2234
2214
|
_.setPixelRatio(window.devicePixelRatio);
|
|
2235
|
-
function
|
|
2215
|
+
function G() {
|
|
2236
2216
|
p.value = !1;
|
|
2237
2217
|
const me = Le();
|
|
2238
|
-
y.value = me[0],
|
|
2218
|
+
y.value = me[0], A.value = me[1], L.aspect = y.value / A.value, L.position.set(47, 39, 100), L.fov = 360 / Math.PI * Math.atan(q * (A.value / y.value)), L.lookAt(0, 0, 0), L.updateProjectionMatrix(), _.setSize(y.value, A.value), a.appendChild(_.domElement), i.stats && Me(), i.css3d && tn();
|
|
2239
2219
|
let Ne;
|
|
2240
2220
|
if (i.control && i.control.init) {
|
|
2241
2221
|
Ne = fo(L, _.domElement);
|
|
@@ -2247,13 +2227,13 @@ function la(C, s) {
|
|
|
2247
2227
|
Ne[ze] = Pe[ze];
|
|
2248
2228
|
});
|
|
2249
2229
|
}
|
|
2250
|
-
return
|
|
2230
|
+
return xs(() => p.value = !0), Ne;
|
|
2251
2231
|
}
|
|
2252
2232
|
function W(me) {
|
|
2253
2233
|
me.preventDefault(), cancelAnimationFrame(Y);
|
|
2254
2234
|
}
|
|
2255
2235
|
function Z(me) {
|
|
2256
|
-
me.preventDefault(),
|
|
2236
|
+
me.preventDefault(), G(), Y();
|
|
2257
2237
|
}
|
|
2258
2238
|
function ce(me) {
|
|
2259
2239
|
l.push(me);
|
|
@@ -2270,9 +2250,9 @@ function la(C, s) {
|
|
|
2270
2250
|
X || (X = !0, requestAnimationFrame(we));
|
|
2271
2251
|
}
|
|
2272
2252
|
function ae() {
|
|
2273
|
-
|
|
2253
|
+
xs(() => {
|
|
2274
2254
|
const me = Le();
|
|
2275
|
-
y.value = me[0],
|
|
2255
|
+
y.value = me[0], A.value = me[1], L.aspect = y.value / A.value, L.fov = 360 / Math.PI * Math.atan(q * (A.value / y.value)), L.updateProjectionMatrix(), L.lookAt(P.position), _.setSize(y.value, A.value), c && c.setSize(y.value, A.value), we();
|
|
2276
2256
|
});
|
|
2277
2257
|
}
|
|
2278
2258
|
function Le() {
|
|
@@ -2282,30 +2262,30 @@ function la(C, s) {
|
|
|
2282
2262
|
u = new po(), u.dom.style.cssText = "position:absolute;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", a.appendChild(u.dom);
|
|
2283
2263
|
}
|
|
2284
2264
|
function Je(me, Ne, Pe, ze, nn) {
|
|
2285
|
-
const Fe = new
|
|
2286
|
-
nn &&
|
|
2287
|
-
const
|
|
2288
|
-
x:
|
|
2289
|
-
y:
|
|
2290
|
-
z:
|
|
2291
|
-
lookAt_x:
|
|
2292
|
-
lookAt_y:
|
|
2293
|
-
lookAt_z:
|
|
2265
|
+
const Fe = new Kn().setFromObject(me), Ve = Fe.getSize(new le()).length(), Te = Fe.getCenter(new le());
|
|
2266
|
+
nn && Te.add(nn);
|
|
2267
|
+
const jn = Ve * Ne * 0.5, Ze = It.degToRad(Pe.fov * 0.5), sn = jn / Math.tan(Ze), Ke = new le().subVectors(Pe.position, Te).multiply(new le(1, 1, 1)).normalize().multiplyScalar(sn).add(Te), je = {
|
|
2268
|
+
x: Ke.x,
|
|
2269
|
+
y: Ke.y,
|
|
2270
|
+
z: Ke.z,
|
|
2271
|
+
lookAt_x: Te.x,
|
|
2272
|
+
lookAt_y: Te.y,
|
|
2273
|
+
lookAt_z: Te.z
|
|
2294
2274
|
};
|
|
2295
|
-
return Pe.position.set(
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
), Pe.updateProjectionMatrix(), ze.target.copy(
|
|
2275
|
+
return Pe.position.set(je.x, je.y, je.z), Pe.lookAt(
|
|
2276
|
+
je.lookAt_x,
|
|
2277
|
+
je.lookAt_y,
|
|
2278
|
+
je.lookAt_z
|
|
2279
|
+
), Pe.updateProjectionMatrix(), ze.target.copy(Te), ze.update(), Ve;
|
|
2300
2280
|
}
|
|
2301
2281
|
function tn() {
|
|
2302
|
-
c = new mo(), c.setSize(y.value,
|
|
2282
|
+
c = new mo(), c.setSize(y.value, A.value), c.domElement.style.position = "absolute", c.domElement.style.top = 0, c.domElement.style.left = 0, c.domElement.style.pointerEvents = "none", a.appendChild(c.domElement);
|
|
2303
2283
|
}
|
|
2304
2284
|
function ct() {
|
|
2305
2285
|
ho(P);
|
|
2306
2286
|
}
|
|
2307
2287
|
return co(() => {
|
|
2308
|
-
h.value =
|
|
2288
|
+
h.value = G(), window.addEventListener("resize", ae, !1), _.domElement.addEventListener(
|
|
2309
2289
|
"webglcontextlost",
|
|
2310
2290
|
W,
|
|
2311
2291
|
!1
|
|
@@ -2334,7 +2314,7 @@ function la(C, s) {
|
|
|
2334
2314
|
control: h,
|
|
2335
2315
|
renderer: _,
|
|
2336
2316
|
domWidth: y,
|
|
2337
|
-
domHeight:
|
|
2317
|
+
domHeight: A,
|
|
2338
2318
|
isReady: p
|
|
2339
2319
|
};
|
|
2340
2320
|
}
|
|
@@ -2343,19 +2323,19 @@ const fa = (C = "app") => {
|
|
|
2343
2323
|
s.params.Line.threshold = 8;
|
|
2344
2324
|
const i = new Fr(), a = document.getElementById(C);
|
|
2345
2325
|
function u(p, h) {
|
|
2346
|
-
const { scaleX: y, scaleY:
|
|
2347
|
-
return i.x = (p.clientX - L.left) / q * 2 - 1, i.y = -((p.clientY - L.top) / X) * 2 + 1, { pointer: i, x:
|
|
2326
|
+
const { scaleX: y, scaleY: A } = l(a), { clientWidth: _, clientHeight: P } = h, L = h.getBoundingClientRect(), q = _ * y, X = P * A, G = p.clientX - L.left, W = p.clientY - L.top;
|
|
2327
|
+
return i.x = (p.clientX - L.left) / q * 2 - 1, i.y = -((p.clientY - L.top) / X) * 2 + 1, { pointer: i, x: G, y: W };
|
|
2348
2328
|
}
|
|
2349
|
-
function c(p, h, y,
|
|
2329
|
+
function c(p, h, y, A) {
|
|
2350
2330
|
const { pointer: _, x: P, y: L } = u(p, h);
|
|
2351
|
-
return s.setFromCamera(_, y), { intersects: s.intersectObjects(
|
|
2331
|
+
return s.setFromCamera(_, y), { intersects: s.intersectObjects(A), pointer: _, x: P, y: L };
|
|
2352
2332
|
}
|
|
2353
2333
|
function l(p) {
|
|
2354
2334
|
const h = window.getComputedStyle(p), y = h.transform || h.webkitTransform || h.mozTransform;
|
|
2355
2335
|
if (y && y !== "none") {
|
|
2356
|
-
const
|
|
2357
|
-
if (
|
|
2358
|
-
const _ =
|
|
2336
|
+
const A = y.match(/^matrix\((.+)\)$/);
|
|
2337
|
+
if (A) {
|
|
2338
|
+
const _ = A[1].split(", "), P = parseFloat(_[0]), L = parseFloat(_[3]);
|
|
2359
2339
|
return { scaleX: P, scaleY: L };
|
|
2360
2340
|
}
|
|
2361
2341
|
}
|
|
@@ -2368,7 +2348,7 @@ const fa = (C = "app") => {
|
|
|
2368
2348
|
getScale: l,
|
|
2369
2349
|
getIntersects: c
|
|
2370
2350
|
};
|
|
2371
|
-
}, Ye = [], ha = new
|
|
2351
|
+
}, Ye = [], ha = new Qe(16711680), da = () => {
|
|
2372
2352
|
const C = () => {
|
|
2373
2353
|
Ye.splice(0);
|
|
2374
2354
|
}, s = (p, h) => {
|
|
@@ -2377,7 +2357,7 @@ const fa = (C = "app") => {
|
|
|
2377
2357
|
});
|
|
2378
2358
|
}, i = (p, h) => {
|
|
2379
2359
|
if (h.userData.needCheck && (h.autoUpdateMatrix = !1, h.updateMatrix(), h.updateMatrixWorld(), h.isMesh)) {
|
|
2380
|
-
const y = new
|
|
2360
|
+
const y = new Kn(new le()).setFromObject(h);
|
|
2381
2361
|
h.geometry.userData.obb = new Dr(), h.geometry.userData.obb.halfSize.copy(y.getSize(new le())).multiplyScalar(0.5).multiplyScalar(0.88), h.userData.obb = new Dr(), h.userData.originColor = h.material.color.clone(), h.userData.parentUid = p, Ye.push({
|
|
2382
2362
|
object: h,
|
|
2383
2363
|
parentUid: p
|
|
@@ -2389,7 +2369,7 @@ const fa = (C = "app") => {
|
|
|
2389
2369
|
initObb: s,
|
|
2390
2370
|
getObbObjectByParentUid: (p) => Ye.filter((h) => h.parentUid === p),
|
|
2391
2371
|
addObbFromArray: (p, h) => {
|
|
2392
|
-
for (let y = 0,
|
|
2372
|
+
for (let y = 0, A = h.length; y < A; y++)
|
|
2393
2373
|
i(p, h[y]);
|
|
2394
2374
|
},
|
|
2395
2375
|
removeObbFromArray: (p) => {
|
|
@@ -2435,9 +2415,9 @@ function sa() {
|
|
|
2435
2415
|
}), e;
|
|
2436
2416
|
}
|
|
2437
2417
|
typeof Promise > "u" || c.Promise || (c.Promise = Promise);
|
|
2438
|
-
var y = Object.getPrototypeOf,
|
|
2418
|
+
var y = Object.getPrototypeOf, A = {}.hasOwnProperty;
|
|
2439
2419
|
function _(e, t) {
|
|
2440
|
-
return
|
|
2420
|
+
return A.call(e, t);
|
|
2441
2421
|
}
|
|
2442
2422
|
function P(e, t) {
|
|
2443
2423
|
typeof t == "function" && (t = t(y(e))), (typeof Reflect > "u" ? l : Reflect.ownKeys)(t).forEach(function(n) {
|
|
@@ -2453,7 +2433,7 @@ function sa() {
|
|
|
2453
2433
|
return e.prototype = Object.create(t.prototype), q(e.prototype, "constructor", e), { extend: P.bind(null, e.prototype) };
|
|
2454
2434
|
} };
|
|
2455
2435
|
}
|
|
2456
|
-
var
|
|
2436
|
+
var G = Object.getOwnPropertyDescriptor, W = [].slice;
|
|
2457
2437
|
function Z(e, t, n) {
|
|
2458
2438
|
return W.call(e, t, n);
|
|
2459
2439
|
}
|
|
@@ -2539,7 +2519,7 @@ function sa() {
|
|
|
2539
2519
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
2540
2520
|
}
|
|
2541
2521
|
var Ve = {};
|
|
2542
|
-
function
|
|
2522
|
+
function Te(e) {
|
|
2543
2523
|
var t, n, r, o;
|
|
2544
2524
|
if (arguments.length === 1) {
|
|
2545
2525
|
if (p(e)) return e.slice();
|
|
@@ -2560,7 +2540,7 @@ function sa() {
|
|
|
2560
2540
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
2561
2541
|
} : function() {
|
|
2562
2542
|
return !1;
|
|
2563
|
-
},
|
|
2543
|
+
}, jt = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], Ce = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(jt), jn = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
2564
2544
|
function Ze(e, t) {
|
|
2565
2545
|
this.name = e, this.message = t;
|
|
2566
2546
|
}
|
|
@@ -2575,26 +2555,26 @@ function sa() {
|
|
|
2575
2555
|
function Nt(e, t, n, r) {
|
|
2576
2556
|
this.failures = t, this.failedKeys = r, this.successCount = n, this.message = sn(e, t);
|
|
2577
2557
|
}
|
|
2578
|
-
function
|
|
2558
|
+
function Ke(e, t) {
|
|
2579
2559
|
this.name = "BulkError", this.failures = Object.keys(t).map(function(n) {
|
|
2580
2560
|
return t[n];
|
|
2581
2561
|
}), this.failuresByPos = t, this.message = sn(e, this.failures);
|
|
2582
2562
|
}
|
|
2583
2563
|
X(Ze).from(Error).extend({ toString: function() {
|
|
2584
2564
|
return this.name + ": " + this.message;
|
|
2585
|
-
} }), X(Nt).from(Ze), X(
|
|
2586
|
-
var
|
|
2565
|
+
} }), X(Nt).from(Ze), X(Ke).from(Ze);
|
|
2566
|
+
var je = Ce.reduce(function(e, t) {
|
|
2587
2567
|
return e[t] = t + "Error", e;
|
|
2588
2568
|
}, {}), Ws = Ze, V = Ce.reduce(function(e, t) {
|
|
2589
2569
|
var n = t + "Error";
|
|
2590
2570
|
function r(o, f) {
|
|
2591
2571
|
this.name = n, o ? typeof o == "string" ? (this.message = "".concat(o).concat(f ? `
|
|
2592
|
-
` + f : ""), this.inner = f || null) : typeof o == "object" && (this.message = "".concat(o.name, " ").concat(o.message), this.inner = o) : (this.message =
|
|
2572
|
+
` + f : ""), this.inner = f || null) : typeof o == "object" && (this.message = "".concat(o.name, " ").concat(o.message), this.inner = o) : (this.message = jn[t] || n, this.inner = null);
|
|
2593
2573
|
}
|
|
2594
2574
|
return X(r).from(Ws), e[t] = r, e;
|
|
2595
2575
|
}, {});
|
|
2596
2576
|
V.Syntax = SyntaxError, V.Type = TypeError, V.Range = RangeError;
|
|
2597
|
-
var
|
|
2577
|
+
var Kr = jt.reduce(function(e, t) {
|
|
2598
2578
|
return e[t + "Error"] = V[t], e;
|
|
2599
2579
|
}, {}), on = Ce.reduce(function(e, t) {
|
|
2600
2580
|
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = V[t]), e;
|
|
@@ -2614,7 +2594,7 @@ function sa() {
|
|
|
2614
2594
|
e.apply(this, arguments), t.apply(this, arguments);
|
|
2615
2595
|
};
|
|
2616
2596
|
}
|
|
2617
|
-
function
|
|
2597
|
+
function $s(e, t) {
|
|
2618
2598
|
return e === ue ? t : function() {
|
|
2619
2599
|
var n = e.apply(this, arguments);
|
|
2620
2600
|
n !== void 0 && (arguments[0] = n);
|
|
@@ -2624,7 +2604,7 @@ function sa() {
|
|
|
2624
2604
|
return r && (this.onsuccess = this.onsuccess ? lt(r, this.onsuccess) : r), o && (this.onerror = this.onerror ? lt(o, this.onerror) : o), f !== void 0 ? f : n;
|
|
2625
2605
|
};
|
|
2626
2606
|
}
|
|
2627
|
-
function
|
|
2607
|
+
function Qs(e, t) {
|
|
2628
2608
|
return e === ue ? t : function() {
|
|
2629
2609
|
e.apply(this, arguments);
|
|
2630
2610
|
var n = this.onsuccess, r = this.onerror;
|
|
@@ -2656,25 +2636,25 @@ function sa() {
|
|
|
2656
2636
|
return t.apply(this, arguments);
|
|
2657
2637
|
};
|
|
2658
2638
|
}
|
|
2659
|
-
on.ModifyError = Nt, on.DexieError = Ze, on.BulkError =
|
|
2639
|
+
on.ModifyError = Nt, on.DexieError = Ze, on.BulkError = Ke;
|
|
2660
2640
|
var Be = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
2661
|
-
function
|
|
2641
|
+
function jr(e) {
|
|
2662
2642
|
Be = e;
|
|
2663
2643
|
}
|
|
2664
|
-
var
|
|
2644
|
+
var Kt = {}, Br = 100, ft = typeof Promise > "u" ? [] : function() {
|
|
2665
2645
|
var e = Promise.resolve();
|
|
2666
2646
|
if (typeof crypto > "u" || !crypto.subtle) return [e, y(e), e];
|
|
2667
2647
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
2668
2648
|
return [t, y(t), e];
|
|
2669
|
-
}(),
|
|
2649
|
+
}(), jt = ft[0], Ce = ft[1], ft = ft[2], Ce = Ce && Ce.then, ht = jt && jt.constructor, Un = !!ft, Bt = function(e, t) {
|
|
2670
2650
|
Ut.push([e, t]), an && (queueMicrotask(ti), an = !1);
|
|
2671
|
-
}, qn = !0, an = !0, dt = [], un = [],
|
|
2651
|
+
}, qn = !0, an = !0, dt = [], un = [], Hn = Ft, et = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: ue, pgp: !1, env: {}, finalize: ue }, z = et, Ut = [], pt = 0, cn = [];
|
|
2672
2652
|
function U(e) {
|
|
2673
2653
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
2674
2654
|
this._listeners = [], this._lib = !1;
|
|
2675
2655
|
var t = this._PSD = z;
|
|
2676
2656
|
if (typeof e != "function") {
|
|
2677
|
-
if (e !==
|
|
2657
|
+
if (e !== Kt) throw new TypeError("Not a function");
|
|
2678
2658
|
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && zn(this, this._value));
|
|
2679
2659
|
}
|
|
2680
2660
|
this._state = null, this._value = null, ++t.ref, function n(r, o) {
|
|
@@ -2693,26 +2673,26 @@ function sa() {
|
|
|
2693
2673
|
}
|
|
2694
2674
|
}(this, e);
|
|
2695
2675
|
}
|
|
2696
|
-
var
|
|
2676
|
+
var Gn = { get: function() {
|
|
2697
2677
|
var e = z, t = dn;
|
|
2698
2678
|
function n(r, o) {
|
|
2699
|
-
var f = this, d = !e.global && (e !== z || t !== dn), m = d && !nt(), v = new U(function(w,
|
|
2700
|
-
Vn(f, new Ur(
|
|
2679
|
+
var f = this, d = !e.global && (e !== z || t !== dn), m = d && !nt(), v = new U(function(w, E) {
|
|
2680
|
+
Vn(f, new Ur(Gr(r, e, d, m), Gr(o, e, d, m), w, E, e));
|
|
2701
2681
|
});
|
|
2702
2682
|
return this._consoleTask && (v._consoleTask = this._consoleTask), v;
|
|
2703
2683
|
}
|
|
2704
|
-
return n.prototype =
|
|
2684
|
+
return n.prototype = Kt, n;
|
|
2705
2685
|
}, set: function(e) {
|
|
2706
|
-
q(this, "then", e && e.prototype ===
|
|
2686
|
+
q(this, "then", e && e.prototype === Kt ? Gn : { get: function() {
|
|
2707
2687
|
return e;
|
|
2708
|
-
}, set:
|
|
2688
|
+
}, set: Gn.set });
|
|
2709
2689
|
} };
|
|
2710
2690
|
function Ur(e, t, n, r, o) {
|
|
2711
2691
|
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = o;
|
|
2712
2692
|
}
|
|
2713
2693
|
function zn(e, t) {
|
|
2714
2694
|
var n, r;
|
|
2715
|
-
un.push(t), e._state === null && (n = e._lib && St(), t =
|
|
2695
|
+
un.push(t), e._state === null && (n = e._lib && St(), t = Hn(t), e._state = !1, e._value = t, r = e, dt.some(function(o) {
|
|
2716
2696
|
return o._value === r._value;
|
|
2717
2697
|
}) || dt.push(r), qr(e), n && Rt());
|
|
2718
2698
|
}
|
|
@@ -2773,7 +2753,7 @@ function sa() {
|
|
|
2773
2753
|
for (var t = cn.slice(0), n = t.length; n; ) t[--n]();
|
|
2774
2754
|
}
|
|
2775
2755
|
function ln(e) {
|
|
2776
|
-
return new U(
|
|
2756
|
+
return new U(Kt, !1, e);
|
|
2777
2757
|
}
|
|
2778
2758
|
function de(e, t) {
|
|
2779
2759
|
var n = z;
|
|
@@ -2788,7 +2768,7 @@ function sa() {
|
|
|
2788
2768
|
}
|
|
2789
2769
|
};
|
|
2790
2770
|
}
|
|
2791
|
-
P(U.prototype, { then:
|
|
2771
|
+
P(U.prototype, { then: Gn, _then: function(e, t) {
|
|
2792
2772
|
Vn(this, new Ur(null, null, e, t, z));
|
|
2793
2773
|
}, catch: function(e) {
|
|
2794
2774
|
if (arguments.length === 1) return this.then(null, e);
|
|
@@ -2816,8 +2796,8 @@ function sa() {
|
|
|
2816
2796
|
}, e);
|
|
2817
2797
|
n.then(r, o).finally(clearTimeout.bind(null, f));
|
|
2818
2798
|
}) : this;
|
|
2819
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && q(U.prototype, Symbol.toStringTag, "Dexie.Promise"), et.env =
|
|
2820
|
-
var e =
|
|
2799
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && q(U.prototype, Symbol.toStringTag, "Dexie.Promise"), et.env = Hr(), P(U, { all: function() {
|
|
2800
|
+
var e = Te.apply(null, arguments).map(pn);
|
|
2821
2801
|
return new U(function(t, n) {
|
|
2822
2802
|
e.length === 0 && t([]);
|
|
2823
2803
|
var r = e.length;
|
|
@@ -2830,9 +2810,9 @@ function sa() {
|
|
|
2830
2810
|
}, resolve: function(e) {
|
|
2831
2811
|
return e instanceof U ? e : e && typeof e.then == "function" ? new U(function(t, n) {
|
|
2832
2812
|
e.then(t, n);
|
|
2833
|
-
}) : new U(
|
|
2813
|
+
}) : new U(Kt, !0, e);
|
|
2834
2814
|
}, reject: ln, race: function() {
|
|
2835
|
-
var e =
|
|
2815
|
+
var e = Te.apply(null, arguments).map(pn);
|
|
2836
2816
|
return new U(function(t, n) {
|
|
2837
2817
|
e.map(function(r) {
|
|
2838
2818
|
return U.resolve(r).then(t, n);
|
|
@@ -2849,9 +2829,9 @@ function sa() {
|
|
|
2849
2829
|
}, set: function(e) {
|
|
2850
2830
|
Bt = e;
|
|
2851
2831
|
} }, rejectionMapper: { get: function() {
|
|
2852
|
-
return
|
|
2832
|
+
return Hn;
|
|
2853
2833
|
}, set: function(e) {
|
|
2854
|
-
|
|
2834
|
+
Hn = e;
|
|
2855
2835
|
} }, follow: function(e, t) {
|
|
2856
2836
|
return new U(function(n, r) {
|
|
2857
2837
|
return tt(function(o, f) {
|
|
@@ -2869,7 +2849,7 @@ function sa() {
|
|
|
2869
2849
|
}, t, n, r);
|
|
2870
2850
|
});
|
|
2871
2851
|
} }), ht && (ht.allSettled && q(U, "allSettled", function() {
|
|
2872
|
-
var e =
|
|
2852
|
+
var e = Te.apply(null, arguments).map(pn);
|
|
2873
2853
|
return new U(function(t) {
|
|
2874
2854
|
e.length === 0 && t([]);
|
|
2875
2855
|
var n = e.length, r = new Array(n);
|
|
@@ -2884,7 +2864,7 @@ function sa() {
|
|
|
2884
2864
|
});
|
|
2885
2865
|
});
|
|
2886
2866
|
}), ht.any && typeof AggregateError < "u" && q(U, "any", function() {
|
|
2887
|
-
var e =
|
|
2867
|
+
var e = Te.apply(null, arguments).map(pn);
|
|
2888
2868
|
return new U(function(t, n) {
|
|
2889
2869
|
e.length === 0 && n(new AggregateError([]));
|
|
2890
2870
|
var r = e.length, o = new Array(r);
|
|
@@ -2925,9 +2905,9 @@ function sa() {
|
|
|
2925
2905
|
var n, r = z;
|
|
2926
2906
|
(t ? !_e.echoes || hn++ && e === z : !hn || --hn && e === z) || queueMicrotask(t ? (function(o) {
|
|
2927
2907
|
++dn, _e.echoes && --_e.echoes != 0 || (_e.echoes = _e.awaits = _e.id = 0), fn.push(z), rt(o, !0);
|
|
2928
|
-
}).bind(null, e) : si), e !== z && (z = e, r === et && (et.env =
|
|
2908
|
+
}).bind(null, e) : si), e !== z && (z = e, r === et && (et.env = Hr()), Un && (n = et.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(c, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
2929
2909
|
}
|
|
2930
|
-
function
|
|
2910
|
+
function Hr() {
|
|
2931
2911
|
var e = c.Promise;
|
|
2932
2912
|
return Un ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(c, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
2933
2913
|
}
|
|
@@ -2939,7 +2919,7 @@ function sa() {
|
|
|
2939
2919
|
rt(f, !1);
|
|
2940
2920
|
}
|
|
2941
2921
|
}
|
|
2942
|
-
function
|
|
2922
|
+
function Gr(e, t, n, r) {
|
|
2943
2923
|
return typeof e != "function" ? e : function() {
|
|
2944
2924
|
var o = z;
|
|
2945
2925
|
n && kt(), rt(t, !0);
|
|
@@ -2954,7 +2934,7 @@ function sa() {
|
|
|
2954
2934
|
Promise === ht && _e.echoes === 0 ? hn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
2955
2935
|
}
|
|
2956
2936
|
("" + Ce).indexOf("[native code]") === -1 && (kt = nt = ue);
|
|
2957
|
-
var ye = U.reject, yt = "", Xe = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", zr = "String expected.", Ot = [], mn = "__dbnames", Yn = "readonly",
|
|
2937
|
+
var ye = U.reject, yt = "", Xe = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", zr = "String expected.", Ot = [], mn = "__dbnames", Yn = "readonly", $n = "readwrite";
|
|
2958
2938
|
function gt(e, t) {
|
|
2959
2939
|
return e ? t ? function() {
|
|
2960
2940
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -2988,8 +2968,8 @@ function sa() {
|
|
|
2988
2968
|
case "Array":
|
|
2989
2969
|
return function(o, f) {
|
|
2990
2970
|
for (var d = o.length, m = f.length, v = d < m ? d : m, w = 0; w < v; ++w) {
|
|
2991
|
-
var
|
|
2992
|
-
if (
|
|
2971
|
+
var E = re(o[w], f[w]);
|
|
2972
|
+
if (E !== 0) return E;
|
|
2993
2973
|
}
|
|
2994
2974
|
return d === m ? 0 : d < m ? -1 : 1;
|
|
2995
2975
|
}(e, t);
|
|
@@ -3005,9 +2985,9 @@ function sa() {
|
|
|
3005
2985
|
function Yr(e) {
|
|
3006
2986
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
3007
2987
|
}
|
|
3008
|
-
var
|
|
2988
|
+
var $r = (fe.prototype._trans = function(e, t, n) {
|
|
3009
2989
|
var r = this._tx || z.trans, o = this.name, f = Be && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
3010
|
-
function d(w,
|
|
2990
|
+
function d(w, E, g) {
|
|
3011
2991
|
if (!g.schema[o]) throw new V.NotFound("Table " + o + " not part of transaction");
|
|
3012
2992
|
return t(g.idbtrans, g);
|
|
3013
2993
|
}
|
|
@@ -3015,37 +2995,37 @@ function sa() {
|
|
|
3015
2995
|
try {
|
|
3016
2996
|
var v = r && r.db._novip === this.db._novip ? r === z.trans ? r._promise(e, d, n) : tt(function() {
|
|
3017
2997
|
return r._promise(e, d, n);
|
|
3018
|
-
}, { trans: r, transless: z.transless || z }) : function w(
|
|
3019
|
-
if (
|
|
3020
|
-
var
|
|
2998
|
+
}, { trans: r, transless: z.transless || z }) : function w(E, g, R, b) {
|
|
2999
|
+
if (E.idbdb && (E._state.openComplete || z.letThrough || E._vip)) {
|
|
3000
|
+
var T = E._createTransaction(g, R, E._dbSchema);
|
|
3021
3001
|
try {
|
|
3022
|
-
|
|
3002
|
+
T.create(), E._state.PR1398_maxLoop = 3;
|
|
3023
3003
|
} catch (S) {
|
|
3024
|
-
return S.name ===
|
|
3025
|
-
return w(
|
|
3004
|
+
return S.name === je.InvalidState && E.isOpen() && 0 < --E._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), E.close({ disableAutoOpen: !1 }), E.open().then(function() {
|
|
3005
|
+
return w(E, g, R, b);
|
|
3026
3006
|
})) : ye(S);
|
|
3027
3007
|
}
|
|
3028
|
-
return
|
|
3008
|
+
return T._promise(g, function(S, x) {
|
|
3029
3009
|
return tt(function() {
|
|
3030
|
-
return z.trans =
|
|
3010
|
+
return z.trans = T, b(S, x, T);
|
|
3031
3011
|
});
|
|
3032
3012
|
}).then(function(S) {
|
|
3033
3013
|
if (g === "readwrite") try {
|
|
3034
|
-
|
|
3014
|
+
T.idbtrans.commit();
|
|
3035
3015
|
} catch {
|
|
3036
3016
|
}
|
|
3037
|
-
return g === "readonly" ? S :
|
|
3017
|
+
return g === "readonly" ? S : T._completion.then(function() {
|
|
3038
3018
|
return S;
|
|
3039
3019
|
});
|
|
3040
3020
|
});
|
|
3041
3021
|
}
|
|
3042
|
-
if (
|
|
3043
|
-
if (!
|
|
3044
|
-
if (!
|
|
3045
|
-
|
|
3022
|
+
if (E._state.openComplete) return ye(new V.DatabaseClosed(E._state.dbOpenError));
|
|
3023
|
+
if (!E._state.isBeingOpened) {
|
|
3024
|
+
if (!E._state.autoOpen) return ye(new V.DatabaseClosed());
|
|
3025
|
+
E.open().catch(ue);
|
|
3046
3026
|
}
|
|
3047
|
-
return
|
|
3048
|
-
return w(
|
|
3027
|
+
return E._state.dbReadyPromise.then(function() {
|
|
3028
|
+
return w(E, g, R, b);
|
|
3049
3029
|
});
|
|
3050
3030
|
}(this.db, e, [this.name], d);
|
|
3051
3031
|
return f && (v._consoleTask = f, v = v.catch(function(w) {
|
|
@@ -3089,14 +3069,14 @@ function sa() {
|
|
|
3089
3069
|
return re(m, v) === 0;
|
|
3090
3070
|
}
|
|
3091
3071
|
var d = t.reduce(function(g, v) {
|
|
3092
|
-
var w = g[0],
|
|
3093
|
-
return [w || g, w || !g ? gt(
|
|
3094
|
-
return b = ve(b, v), p(b) && b.some(function(
|
|
3095
|
-
return o(R,
|
|
3072
|
+
var w = g[0], E = g[1], g = r[v], R = e[v];
|
|
3073
|
+
return [w || g, w || !g ? gt(E, g && g.multi ? function(b) {
|
|
3074
|
+
return b = ve(b, v), p(b) && b.some(function(T) {
|
|
3075
|
+
return o(R, T);
|
|
3096
3076
|
});
|
|
3097
3077
|
} : function(b) {
|
|
3098
3078
|
return o(R, ve(b, v));
|
|
3099
|
-
}) :
|
|
3079
|
+
}) : E];
|
|
3100
3080
|
}, [null, null]), f = d[0], d = d[1];
|
|
3101
3081
|
return f ? this.where(f.name).equals(e[f.keyPath]).filter(d) : n ? this.filter(d) : this.where(t).equals("");
|
|
3102
3082
|
}, fe.prototype.filter = function(e) {
|
|
@@ -3124,10 +3104,10 @@ function sa() {
|
|
|
3124
3104
|
}
|
|
3125
3105
|
(this.schema.mappedClass = e).prototype instanceof Xr && (function(v, w) {
|
|
3126
3106
|
if (typeof w != "function" && w !== null) throw new TypeError("Class extends value " + String(w) + " is not a constructor or null");
|
|
3127
|
-
function
|
|
3107
|
+
function E() {
|
|
3128
3108
|
this.constructor = v;
|
|
3129
3109
|
}
|
|
3130
|
-
i(v, w), v.prototype = w === null ? Object.create(w) : (
|
|
3110
|
+
i(v, w), v.prototype = w === null ? Object.create(w) : (E.prototype = w.prototype, new E());
|
|
3131
3111
|
}(o, t = e), Object.defineProperty(o.prototype, "db", { get: function() {
|
|
3132
3112
|
return n;
|
|
3133
3113
|
}, enumerable: !1, configurable: !0 }), o.prototype.table = function() {
|
|
@@ -3138,12 +3118,12 @@ function sa() {
|
|
|
3138
3118
|
});
|
|
3139
3119
|
function m(v) {
|
|
3140
3120
|
if (!v) return v;
|
|
3141
|
-
var w,
|
|
3121
|
+
var w, E = Object.create(e.prototype);
|
|
3142
3122
|
for (w in v) if (!f.has(w)) try {
|
|
3143
|
-
|
|
3123
|
+
E[w] = v[w];
|
|
3144
3124
|
} catch {
|
|
3145
3125
|
}
|
|
3146
|
-
return
|
|
3126
|
+
return E;
|
|
3147
3127
|
}
|
|
3148
3128
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = m, this.hook("reading", m), e;
|
|
3149
3129
|
}, fe.prototype.defineClass = function() {
|
|
@@ -3208,10 +3188,10 @@ function sa() {
|
|
|
3208
3188
|
if (w && o) throw new V.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
3209
3189
|
if (o && o.length !== e.length) throw new V.InvalidArgument("Arguments objects and keys must have the same length");
|
|
3210
3190
|
var v = e.length, w = w && m ? e.map(yn(w)) : e;
|
|
3211
|
-
return r.core.mutate({ trans: d, type: "add", keys: o, values: w, wantResults: f }).then(function(
|
|
3212
|
-
var g =
|
|
3191
|
+
return r.core.mutate({ trans: d, type: "add", keys: o, values: w, wantResults: f }).then(function(T) {
|
|
3192
|
+
var g = T.numFailures, R = T.results, b = T.lastResult, T = T.failures;
|
|
3213
3193
|
if (g === 0) return f ? R : b;
|
|
3214
|
-
throw new
|
|
3194
|
+
throw new Ke("".concat(r.name, ".bulkAdd(): ").concat(g, " of ").concat(v, " operations failed"), T);
|
|
3215
3195
|
});
|
|
3216
3196
|
});
|
|
3217
3197
|
}, fe.prototype.bulkPut = function(e, t, n) {
|
|
@@ -3221,10 +3201,10 @@ function sa() {
|
|
|
3221
3201
|
if (w && o) throw new V.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
3222
3202
|
if (o && o.length !== e.length) throw new V.InvalidArgument("Arguments objects and keys must have the same length");
|
|
3223
3203
|
var v = e.length, w = w && m ? e.map(yn(w)) : e;
|
|
3224
|
-
return r.core.mutate({ trans: d, type: "put", keys: o, values: w, wantResults: f }).then(function(
|
|
3225
|
-
var g =
|
|
3204
|
+
return r.core.mutate({ trans: d, type: "put", keys: o, values: w, wantResults: f }).then(function(T) {
|
|
3205
|
+
var g = T.numFailures, R = T.results, b = T.lastResult, T = T.failures;
|
|
3226
3206
|
if (g === 0) return f ? R : b;
|
|
3227
|
-
throw new
|
|
3207
|
+
throw new Ke("".concat(r.name, ".bulkPut(): ").concat(g, " of ").concat(v, " operations failed"), T);
|
|
3228
3208
|
});
|
|
3229
3209
|
});
|
|
3230
3210
|
}, fe.prototype.bulkUpdate = function(e) {
|
|
@@ -3237,10 +3217,10 @@ function sa() {
|
|
|
3237
3217
|
return n.getMany({ trans: d, keys: r, cache: "clone" }).then(function(m) {
|
|
3238
3218
|
var v = [], w = [];
|
|
3239
3219
|
e.forEach(function(g, R) {
|
|
3240
|
-
var b = g.key,
|
|
3220
|
+
var b = g.key, T = g.changes, S = m[R];
|
|
3241
3221
|
if (S) {
|
|
3242
|
-
for (var
|
|
3243
|
-
var O = k[
|
|
3222
|
+
for (var x = 0, k = Object.keys(T); x < k.length; x++) {
|
|
3223
|
+
var O = k[x], M = T[O];
|
|
3244
3224
|
if (O === t.schema.primKey.keyPath) {
|
|
3245
3225
|
if (re(M, b) !== 0) throw new V.Constraint("Cannot update primary key in bulkUpdate()");
|
|
3246
3226
|
} else ae(S, O, M);
|
|
@@ -3248,15 +3228,15 @@ function sa() {
|
|
|
3248
3228
|
f.push(R), v.push(b), w.push(S);
|
|
3249
3229
|
}
|
|
3250
3230
|
});
|
|
3251
|
-
var
|
|
3231
|
+
var E = v.length;
|
|
3252
3232
|
return n.mutate({ trans: d, type: "put", keys: v, values: w, updates: { keys: r, changeSpecs: o } }).then(function(g) {
|
|
3253
3233
|
var R = g.numFailures, b = g.failures;
|
|
3254
|
-
if (R === 0) return
|
|
3255
|
-
for (var
|
|
3256
|
-
var
|
|
3257
|
-
O != null && (
|
|
3234
|
+
if (R === 0) return E;
|
|
3235
|
+
for (var T = 0, S = Object.keys(b); T < S.length; T++) {
|
|
3236
|
+
var x, k = S[T], O = f[Number(k)];
|
|
3237
|
+
O != null && (x = b[k], delete b[k], b[O] = x);
|
|
3258
3238
|
}
|
|
3259
|
-
throw new
|
|
3239
|
+
throw new Ke("".concat(t.name, ".bulkUpdate(): ").concat(R, " of ").concat(E, " operations failed"), b);
|
|
3260
3240
|
});
|
|
3261
3241
|
});
|
|
3262
3242
|
});
|
|
@@ -3267,7 +3247,7 @@ function sa() {
|
|
|
3267
3247
|
}).then(function(d) {
|
|
3268
3248
|
var o = d.numFailures, f = d.lastResult, d = d.failures;
|
|
3269
3249
|
if (o === 0) return f;
|
|
3270
|
-
throw new
|
|
3250
|
+
throw new Ke("".concat(t.name, ".bulkDelete(): ").concat(o, " of ").concat(n, " operations failed"), d);
|
|
3271
3251
|
});
|
|
3272
3252
|
}, fe);
|
|
3273
3253
|
function fe() {
|
|
@@ -3288,14 +3268,14 @@ function sa() {
|
|
|
3288
3268
|
if (typeof d != "object") {
|
|
3289
3269
|
var w;
|
|
3290
3270
|
m = m || Zs;
|
|
3291
|
-
var
|
|
3292
|
-
|
|
3271
|
+
var E = { subscribers: [], fire: v = v || ue, subscribe: function(g) {
|
|
3272
|
+
E.subscribers.indexOf(g) === -1 && (E.subscribers.push(g), E.fire = m(E.fire, g));
|
|
3293
3273
|
}, unsubscribe: function(g) {
|
|
3294
|
-
|
|
3274
|
+
E.subscribers = E.subscribers.filter(function(R) {
|
|
3295
3275
|
return R !== g;
|
|
3296
|
-
}),
|
|
3276
|
+
}), E.fire = E.subscribers.reduce(m, v);
|
|
3297
3277
|
} };
|
|
3298
|
-
return n[d] = t[d] =
|
|
3278
|
+
return n[d] = t[d] = E;
|
|
3299
3279
|
}
|
|
3300
3280
|
l(w = d).forEach(function(g) {
|
|
3301
3281
|
var R = w[g];
|
|
@@ -3303,10 +3283,10 @@ function sa() {
|
|
|
3303
3283
|
else {
|
|
3304
3284
|
if (R !== "asap") throw new V.InvalidArgument("Invalid event config");
|
|
3305
3285
|
var b = f(g, Ft, function() {
|
|
3306
|
-
for (var
|
|
3307
|
-
b.subscribers.forEach(function(
|
|
3286
|
+
for (var T = arguments.length, S = new Array(T); T--; ) S[T] = arguments[T];
|
|
3287
|
+
b.subscribers.forEach(function(x) {
|
|
3308
3288
|
we(function() {
|
|
3309
|
-
|
|
3289
|
+
x.apply(null, S);
|
|
3310
3290
|
});
|
|
3311
3291
|
});
|
|
3312
3292
|
});
|
|
@@ -3314,13 +3294,13 @@ function sa() {
|
|
|
3314
3294
|
});
|
|
3315
3295
|
}
|
|
3316
3296
|
}
|
|
3317
|
-
function
|
|
3297
|
+
function Ht(e, t) {
|
|
3318
3298
|
return X(t).from({ prototype: e }), t;
|
|
3319
3299
|
}
|
|
3320
3300
|
function Mt(e, t) {
|
|
3321
3301
|
return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
|
|
3322
3302
|
}
|
|
3323
|
-
function
|
|
3303
|
+
function Qn(e, t) {
|
|
3324
3304
|
e.filter = gt(e.filter, t);
|
|
3325
3305
|
}
|
|
3326
3306
|
function Jn(e, t, n) {
|
|
@@ -3335,7 +3315,7 @@ function sa() {
|
|
|
3335
3315
|
if (!n) throw new V.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
3336
3316
|
return n;
|
|
3337
3317
|
}
|
|
3338
|
-
function
|
|
3318
|
+
function Qr(e, t, n) {
|
|
3339
3319
|
var r = gn(e, t.schema);
|
|
3340
3320
|
return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: r, range: e.range } });
|
|
3341
3321
|
}
|
|
@@ -3343,16 +3323,16 @@ function sa() {
|
|
|
3343
3323
|
var o = e.replayFilter ? gt(e.filter, e.replayFilter()) : e.filter;
|
|
3344
3324
|
if (e.or) {
|
|
3345
3325
|
var f = {}, d = function(m, v, w) {
|
|
3346
|
-
var
|
|
3326
|
+
var E, g;
|
|
3347
3327
|
o && !o(v, w, function(R) {
|
|
3348
3328
|
return v.stop(R);
|
|
3349
3329
|
}, function(R) {
|
|
3350
3330
|
return v.fail(R);
|
|
3351
|
-
}) || ((g = "" + (
|
|
3331
|
+
}) || ((g = "" + (E = v.primaryKey)) == "[object ArrayBuffer]" && (g = "" + new Uint8Array(E)), _(f, g) || (f[g] = !0, t(m, v, w)));
|
|
3352
3332
|
};
|
|
3353
|
-
return Promise.all([e.or._iterate(d, n), Jr(
|
|
3333
|
+
return Promise.all([e.or._iterate(d, n), Jr(Qr(e, r, n), e.algorithm, d, !e.keysOnly && e.valueMapper)]);
|
|
3354
3334
|
}
|
|
3355
|
-
return Jr(
|
|
3335
|
+
return Jr(Qr(e, r, n), gt(e.algorithm, o), t, !e.keysOnly && e.valueMapper);
|
|
3356
3336
|
}
|
|
3357
3337
|
function Jr(e, t, n, r) {
|
|
3358
3338
|
var o = de(r ? function(f, d, m) {
|
|
@@ -3375,7 +3355,7 @@ function sa() {
|
|
|
3375
3355
|
});
|
|
3376
3356
|
});
|
|
3377
3357
|
}
|
|
3378
|
-
var
|
|
3358
|
+
var Gt = (Zr.prototype.execute = function(e) {
|
|
3379
3359
|
var t = this["@@propmod"];
|
|
3380
3360
|
if (t.add !== void 0) {
|
|
3381
3361
|
var n = t.add;
|
|
@@ -3493,7 +3473,7 @@ function sa() {
|
|
|
3493
3473
|
};
|
|
3494
3474
|
}, !0), this;
|
|
3495
3475
|
}, ie.prototype.until = function(e, t) {
|
|
3496
|
-
return
|
|
3476
|
+
return Qn(this._ctx, function(n, r, o) {
|
|
3497
3477
|
return !e(n.value) || (r(o), t);
|
|
3498
3478
|
}), this;
|
|
3499
3479
|
}, ie.prototype.first = function(e) {
|
|
@@ -3504,7 +3484,7 @@ function sa() {
|
|
|
3504
3484
|
return this.reverse().first(e);
|
|
3505
3485
|
}, ie.prototype.filter = function(e) {
|
|
3506
3486
|
var t;
|
|
3507
|
-
return
|
|
3487
|
+
return Qn(this._ctx, function(n) {
|
|
3508
3488
|
return e(n.value);
|
|
3509
3489
|
}), (t = this._ctx).isMatch = gt(t.isMatch, e), this;
|
|
3510
3490
|
}, ie.prototype.and = function(e) {
|
|
@@ -3563,7 +3543,7 @@ function sa() {
|
|
|
3563
3543
|
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
3564
3544
|
if (!e || !e.multi) return this;
|
|
3565
3545
|
var t = {};
|
|
3566
|
-
return
|
|
3546
|
+
return Qn(this._ctx, function(o) {
|
|
3567
3547
|
var r = o.primaryKey.toString(), o = _(t, r);
|
|
3568
3548
|
return t[r] = !0, !o;
|
|
3569
3549
|
}), this;
|
|
@@ -3571,35 +3551,35 @@ function sa() {
|
|
|
3571
3551
|
var t = this, n = this._ctx;
|
|
3572
3552
|
return this._write(function(r) {
|
|
3573
3553
|
var o, f, d;
|
|
3574
|
-
d = typeof e == "function" ? e : (o = l(e), f = o.length, function(
|
|
3554
|
+
d = typeof e == "function" ? e : (o = l(e), f = o.length, function(x) {
|
|
3575
3555
|
for (var k = !1, O = 0; O < f; ++O) {
|
|
3576
|
-
var M = o[O], I = e[M], D = ve(
|
|
3577
|
-
I instanceof
|
|
3556
|
+
var M = o[O], I = e[M], D = ve(x, M);
|
|
3557
|
+
I instanceof Gt ? (ae(x, M, I.execute(D)), k = !0) : D !== I && (ae(x, M, I), k = !0);
|
|
3578
3558
|
}
|
|
3579
3559
|
return k;
|
|
3580
3560
|
});
|
|
3581
|
-
var m = n.table.core, g = m.schema.primaryKey, v = g.outbound, w = g.extractKey,
|
|
3582
|
-
g && (
|
|
3583
|
-
function R(
|
|
3561
|
+
var m = n.table.core, g = m.schema.primaryKey, v = g.outbound, w = g.extractKey, E = 200, g = t.db._options.modifyChunkSize;
|
|
3562
|
+
g && (E = typeof g == "object" ? g[m.name] || g["*"] || 200 : g);
|
|
3563
|
+
function R(x, M) {
|
|
3584
3564
|
var O = M.failures, M = M.numFailures;
|
|
3585
|
-
|
|
3565
|
+
T += x - M;
|
|
3586
3566
|
for (var I = 0, D = l(O); I < D.length; I++) {
|
|
3587
|
-
var
|
|
3588
|
-
b.push(O[
|
|
3567
|
+
var j = D[I];
|
|
3568
|
+
b.push(O[j]);
|
|
3589
3569
|
}
|
|
3590
3570
|
}
|
|
3591
|
-
var b = [],
|
|
3592
|
-
return t.clone().primaryKeys().then(function(
|
|
3571
|
+
var b = [], T = 0, S = [];
|
|
3572
|
+
return t.clone().primaryKeys().then(function(x) {
|
|
3593
3573
|
function k(M) {
|
|
3594
|
-
var I = Math.min(
|
|
3595
|
-
return m.getMany({ trans: r, keys:
|
|
3596
|
-
for (var
|
|
3597
|
-
var
|
|
3598
|
-
d.call(J, J.value, J) !== !1 && (J.value == null ? B.push(
|
|
3574
|
+
var I = Math.min(E, x.length - M);
|
|
3575
|
+
return m.getMany({ trans: r, keys: x.slice(M, M + I), cache: "immutable" }).then(function(D) {
|
|
3576
|
+
for (var j = [], N = [], F = v ? [] : null, B = [], K = 0; K < I; ++K) {
|
|
3577
|
+
var H = D[K], J = { value: me(H), primKey: x[M + K] };
|
|
3578
|
+
d.call(J, J.value, J) !== !1 && (J.value == null ? B.push(x[M + K]) : v || re(w(H), w(J.value)) === 0 ? (N.push(J.value), v && F.push(x[M + K])) : (B.push(x[M + K]), j.push(J.value)));
|
|
3599
3579
|
}
|
|
3600
|
-
return Promise.resolve(0 <
|
|
3580
|
+
return Promise.resolve(0 < j.length && m.mutate({ trans: r, type: "add", values: j }).then(function(ee) {
|
|
3601
3581
|
for (var te in ee.failures) B.splice(parseInt(te), 1);
|
|
3602
|
-
R(
|
|
3582
|
+
R(j.length, ee);
|
|
3603
3583
|
})).then(function() {
|
|
3604
3584
|
return (0 < N.length || O && typeof e == "object") && m.mutate({ trans: r, type: "put", keys: F, values: N, criteria: O, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < M }).then(function(ee) {
|
|
3605
3585
|
return R(N.length, ee);
|
|
@@ -3609,14 +3589,14 @@ function sa() {
|
|
|
3609
3589
|
return R(B.length, ee);
|
|
3610
3590
|
});
|
|
3611
3591
|
}).then(function() {
|
|
3612
|
-
return
|
|
3592
|
+
return x.length > M + I && k(M + E);
|
|
3613
3593
|
});
|
|
3614
3594
|
});
|
|
3615
3595
|
}
|
|
3616
3596
|
var O = Mt(n) && n.limit === 1 / 0 && (typeof e != "function" || e === Zn) && { index: n.index, range: n.range };
|
|
3617
3597
|
return k(0).then(function() {
|
|
3618
|
-
if (0 < b.length) throw new Nt("Error modifying one or more objects", b,
|
|
3619
|
-
return
|
|
3598
|
+
if (0 < b.length) throw new Nt("Error modifying one or more objects", b, T, S);
|
|
3599
|
+
return x.length;
|
|
3620
3600
|
});
|
|
3621
3601
|
});
|
|
3622
3602
|
});
|
|
@@ -3655,56 +3635,56 @@ function sa() {
|
|
|
3655
3635
|
}).limit(0);
|
|
3656
3636
|
}
|
|
3657
3637
|
function bn(e, t, n, r) {
|
|
3658
|
-
var o, f, d, m, v, w,
|
|
3659
|
-
if (!n.every(function(
|
|
3660
|
-
return typeof
|
|
3638
|
+
var o, f, d, m, v, w, E, g = n.length;
|
|
3639
|
+
if (!n.every(function(T) {
|
|
3640
|
+
return typeof T == "string";
|
|
3661
3641
|
})) return ke(e, zr);
|
|
3662
|
-
function R(
|
|
3663
|
-
o =
|
|
3664
|
-
return
|
|
3665
|
-
} : function(
|
|
3666
|
-
return
|
|
3667
|
-
}, f =
|
|
3668
|
-
return
|
|
3669
|
-
} : function(
|
|
3670
|
-
return
|
|
3671
|
-
}, d =
|
|
3672
|
-
var S = n.map(function(
|
|
3673
|
-
return { lower: f(
|
|
3674
|
-
}).sort(function(
|
|
3675
|
-
return d(
|
|
3642
|
+
function R(T) {
|
|
3643
|
+
o = T === "next" ? function(x) {
|
|
3644
|
+
return x.toUpperCase();
|
|
3645
|
+
} : function(x) {
|
|
3646
|
+
return x.toLowerCase();
|
|
3647
|
+
}, f = T === "next" ? function(x) {
|
|
3648
|
+
return x.toLowerCase();
|
|
3649
|
+
} : function(x) {
|
|
3650
|
+
return x.toUpperCase();
|
|
3651
|
+
}, d = T === "next" ? oi : ai;
|
|
3652
|
+
var S = n.map(function(x) {
|
|
3653
|
+
return { lower: f(x), upper: o(x) };
|
|
3654
|
+
}).sort(function(x, k) {
|
|
3655
|
+
return d(x.lower, k.lower);
|
|
3676
3656
|
});
|
|
3677
|
-
m = S.map(function(
|
|
3678
|
-
return
|
|
3679
|
-
}), v = S.map(function(
|
|
3680
|
-
return
|
|
3681
|
-
}),
|
|
3657
|
+
m = S.map(function(x) {
|
|
3658
|
+
return x.upper;
|
|
3659
|
+
}), v = S.map(function(x) {
|
|
3660
|
+
return x.lower;
|
|
3661
|
+
}), E = (w = T) === "next" ? "" : r;
|
|
3682
3662
|
}
|
|
3683
3663
|
R("next"), e = new e.Collection(e, function() {
|
|
3684
3664
|
return st(m[0], v[g - 1] + r);
|
|
3685
|
-
}), e._ondirectionchange = function(
|
|
3686
|
-
R(
|
|
3665
|
+
}), e._ondirectionchange = function(T) {
|
|
3666
|
+
R(T);
|
|
3687
3667
|
};
|
|
3688
3668
|
var b = 0;
|
|
3689
|
-
return e._addAlgorithm(function(
|
|
3690
|
-
var k =
|
|
3669
|
+
return e._addAlgorithm(function(T, S, x) {
|
|
3670
|
+
var k = T.key;
|
|
3691
3671
|
if (typeof k != "string") return !1;
|
|
3692
3672
|
var O = f(k);
|
|
3693
3673
|
if (t(O, v, b)) return !0;
|
|
3694
3674
|
for (var M = null, I = b; I < g; ++I) {
|
|
3695
|
-
var D = function(
|
|
3696
|
-
for (var J = Math.min(
|
|
3675
|
+
var D = function(j, N, F, B, K, H) {
|
|
3676
|
+
for (var J = Math.min(j.length, B.length), ee = -1, te = 0; te < J; ++te) {
|
|
3697
3677
|
var Oe = N[te];
|
|
3698
|
-
if (Oe !== B[te]) return j
|
|
3699
|
-
j
|
|
3678
|
+
if (Oe !== B[te]) return K(j[te], F[te]) < 0 ? j.substr(0, te) + F[te] + F.substr(te + 1) : K(j[te], B[te]) < 0 ? j.substr(0, te) + B[te] + F.substr(te + 1) : 0 <= ee ? j.substr(0, ee) + N[ee] + F.substr(ee + 1) : null;
|
|
3679
|
+
K(j[te], Oe) < 0 && (ee = te);
|
|
3700
3680
|
}
|
|
3701
|
-
return J < B.length &&
|
|
3681
|
+
return J < B.length && H === "next" ? j + F.substr(j.length) : J < j.length && H === "prev" ? j.substr(0, F.length) : ee < 0 ? null : j.substr(0, ee) + B[ee] + F.substr(ee + 1);
|
|
3702
3682
|
}(k, O, m[I], v[I], d, w);
|
|
3703
3683
|
D === null && M === null ? b = I + 1 : (M === null || 0 < d(M, D)) && (M = D);
|
|
3704
3684
|
}
|
|
3705
3685
|
return S(M !== null ? function() {
|
|
3706
|
-
|
|
3707
|
-
} :
|
|
3686
|
+
T.continue(M + E);
|
|
3687
|
+
} : x), !1;
|
|
3708
3688
|
}), e;
|
|
3709
3689
|
}
|
|
3710
3690
|
function st(e, t, n, r) {
|
|
@@ -3713,9 +3693,9 @@ function sa() {
|
|
|
3713
3693
|
function es(e) {
|
|
3714
3694
|
return { type: 1, lower: e, upper: e };
|
|
3715
3695
|
}
|
|
3716
|
-
var ts = (Object.defineProperty(
|
|
3696
|
+
var ts = (Object.defineProperty(xe.prototype, "Collection", { get: function() {
|
|
3717
3697
|
return this._ctx.table.db.Collection;
|
|
3718
|
-
}, enumerable: !1, configurable: !0 }),
|
|
3698
|
+
}, enumerable: !1, configurable: !0 }), xe.prototype.between = function(e, t, n, r) {
|
|
3719
3699
|
n = n !== !1, r = r === !0;
|
|
3720
3700
|
try {
|
|
3721
3701
|
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || r) && (!n || !r) ? Pt(this) : new this.Collection(this, function() {
|
|
@@ -3724,50 +3704,50 @@ function sa() {
|
|
|
3724
3704
|
} catch {
|
|
3725
3705
|
return ke(this, Xe);
|
|
3726
3706
|
}
|
|
3727
|
-
},
|
|
3707
|
+
}, xe.prototype.equals = function(e) {
|
|
3728
3708
|
return e == null ? ke(this, Xe) : new this.Collection(this, function() {
|
|
3729
3709
|
return es(e);
|
|
3730
3710
|
});
|
|
3731
|
-
},
|
|
3711
|
+
}, xe.prototype.above = function(e) {
|
|
3732
3712
|
return e == null ? ke(this, Xe) : new this.Collection(this, function() {
|
|
3733
3713
|
return st(e, void 0, !0);
|
|
3734
3714
|
});
|
|
3735
|
-
},
|
|
3715
|
+
}, xe.prototype.aboveOrEqual = function(e) {
|
|
3736
3716
|
return e == null ? ke(this, Xe) : new this.Collection(this, function() {
|
|
3737
3717
|
return st(e, void 0, !1);
|
|
3738
3718
|
});
|
|
3739
|
-
},
|
|
3719
|
+
}, xe.prototype.below = function(e) {
|
|
3740
3720
|
return e == null ? ke(this, Xe) : new this.Collection(this, function() {
|
|
3741
3721
|
return st(void 0, e, !1, !0);
|
|
3742
3722
|
});
|
|
3743
|
-
},
|
|
3723
|
+
}, xe.prototype.belowOrEqual = function(e) {
|
|
3744
3724
|
return e == null ? ke(this, Xe) : new this.Collection(this, function() {
|
|
3745
3725
|
return st(void 0, e);
|
|
3746
3726
|
});
|
|
3747
|
-
},
|
|
3727
|
+
}, xe.prototype.startsWith = function(e) {
|
|
3748
3728
|
return typeof e != "string" ? ke(this, zr) : this.between(e, e + yt, !0, !0);
|
|
3749
|
-
},
|
|
3729
|
+
}, xe.prototype.startsWithIgnoreCase = function(e) {
|
|
3750
3730
|
return e === "" ? this.startsWith(e) : bn(this, function(t, n) {
|
|
3751
3731
|
return t.indexOf(n[0]) === 0;
|
|
3752
3732
|
}, [e], yt);
|
|
3753
|
-
},
|
|
3733
|
+
}, xe.prototype.equalsIgnoreCase = function(e) {
|
|
3754
3734
|
return bn(this, function(t, n) {
|
|
3755
3735
|
return t === n[0];
|
|
3756
3736
|
}, [e], "");
|
|
3757
|
-
},
|
|
3758
|
-
var e =
|
|
3737
|
+
}, xe.prototype.anyOfIgnoreCase = function() {
|
|
3738
|
+
var e = Te.apply(Ve, arguments);
|
|
3759
3739
|
return e.length === 0 ? Pt(this) : bn(this, function(t, n) {
|
|
3760
3740
|
return n.indexOf(t) !== -1;
|
|
3761
3741
|
}, e, "");
|
|
3762
|
-
},
|
|
3763
|
-
var e =
|
|
3742
|
+
}, xe.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
3743
|
+
var e = Te.apply(Ve, arguments);
|
|
3764
3744
|
return e.length === 0 ? Pt(this) : bn(this, function(t, n) {
|
|
3765
3745
|
return n.some(function(r) {
|
|
3766
3746
|
return t.indexOf(r) === 0;
|
|
3767
3747
|
});
|
|
3768
3748
|
}, e, yt);
|
|
3769
|
-
},
|
|
3770
|
-
var e = this, t =
|
|
3749
|
+
}, xe.prototype.anyOf = function() {
|
|
3750
|
+
var e = this, t = Te.apply(Ve, arguments), n = this._cmp;
|
|
3771
3751
|
try {
|
|
3772
3752
|
t.sort(n);
|
|
3773
3753
|
} catch {
|
|
@@ -3787,10 +3767,10 @@ function sa() {
|
|
|
3787
3767
|
f.continue(t[o]);
|
|
3788
3768
|
}), !1);
|
|
3789
3769
|
}), r;
|
|
3790
|
-
},
|
|
3770
|
+
}, xe.prototype.notEqual = function(e) {
|
|
3791
3771
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
3792
|
-
},
|
|
3793
|
-
var e =
|
|
3772
|
+
}, xe.prototype.noneOf = function() {
|
|
3773
|
+
var e = Te.apply(Ve, arguments);
|
|
3794
3774
|
if (e.length === 0) return new this.Collection(this);
|
|
3795
3775
|
try {
|
|
3796
3776
|
e.sort(this._ascending);
|
|
@@ -3801,22 +3781,22 @@ function sa() {
|
|
|
3801
3781
|
return n ? n.concat([[n[n.length - 1][1], r]]) : [[-1 / 0, r]];
|
|
3802
3782
|
}, null);
|
|
3803
3783
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
3804
|
-
},
|
|
3784
|
+
}, xe.prototype.inAnyRange = function(k, t) {
|
|
3805
3785
|
var n = this, r = this._cmp, o = this._ascending, f = this._descending, d = this._min, m = this._max;
|
|
3806
3786
|
if (k.length === 0) return Pt(this);
|
|
3807
3787
|
if (!k.every(function(O) {
|
|
3808
3788
|
return O[0] !== void 0 && O[1] !== void 0 && o(O[0], O[1]) <= 0;
|
|
3809
3789
|
})) return ke(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", V.InvalidArgument);
|
|
3810
|
-
var v = !t || t.includeLowers !== !1, w = t && t.includeUppers === !0,
|
|
3790
|
+
var v = !t || t.includeLowers !== !1, w = t && t.includeUppers === !0, E, g = o;
|
|
3811
3791
|
function R(O, M) {
|
|
3812
3792
|
return g(O[0], M[0]);
|
|
3813
3793
|
}
|
|
3814
3794
|
try {
|
|
3815
|
-
(
|
|
3795
|
+
(E = k.reduce(function(O, M) {
|
|
3816
3796
|
for (var I = 0, D = O.length; I < D; ++I) {
|
|
3817
|
-
var
|
|
3818
|
-
if (r(M[0],
|
|
3819
|
-
|
|
3797
|
+
var j = O[I];
|
|
3798
|
+
if (r(M[0], j[1]) < 0 && 0 < r(M[1], j[0])) {
|
|
3799
|
+
j[0] = d(j[0], M[0]), j[1] = m(j[1], M[1]);
|
|
3820
3800
|
break;
|
|
3821
3801
|
}
|
|
3822
3802
|
}
|
|
@@ -3825,34 +3805,34 @@ function sa() {
|
|
|
3825
3805
|
} catch {
|
|
3826
3806
|
return ke(this, Xe);
|
|
3827
3807
|
}
|
|
3828
|
-
var b = 0,
|
|
3829
|
-
return 0 < o(O,
|
|
3808
|
+
var b = 0, T = w ? function(O) {
|
|
3809
|
+
return 0 < o(O, E[b][1]);
|
|
3830
3810
|
} : function(O) {
|
|
3831
|
-
return 0 <= o(O,
|
|
3811
|
+
return 0 <= o(O, E[b][1]);
|
|
3832
3812
|
}, S = v ? function(O) {
|
|
3833
|
-
return 0 < f(O,
|
|
3813
|
+
return 0 < f(O, E[b][0]);
|
|
3834
3814
|
} : function(O) {
|
|
3835
|
-
return 0 <= f(O,
|
|
3836
|
-
},
|
|
3837
|
-
return st(
|
|
3815
|
+
return 0 <= f(O, E[b][0]);
|
|
3816
|
+
}, x = T, k = new this.Collection(this, function() {
|
|
3817
|
+
return st(E[0][0], E[E.length - 1][1], !v, !w);
|
|
3838
3818
|
});
|
|
3839
3819
|
return k._ondirectionchange = function(O) {
|
|
3840
|
-
g = O === "next" ? (
|
|
3820
|
+
g = O === "next" ? (x = T, o) : (x = S, f), E.sort(R);
|
|
3841
3821
|
}, k._addAlgorithm(function(O, M, I) {
|
|
3842
|
-
for (var D,
|
|
3843
|
-
return !
|
|
3844
|
-
g === o ? O.continue(
|
|
3822
|
+
for (var D, j = O.key; x(j); ) if (++b === E.length) return M(I), !1;
|
|
3823
|
+
return !T(D = j) && !S(D) || (n._cmp(j, E[b][1]) === 0 || n._cmp(j, E[b][0]) === 0 || M(function() {
|
|
3824
|
+
g === o ? O.continue(E[b][0]) : O.continue(E[b][1]);
|
|
3845
3825
|
}), !1);
|
|
3846
3826
|
}), k;
|
|
3847
|
-
},
|
|
3848
|
-
var e =
|
|
3827
|
+
}, xe.prototype.startsWithAnyOf = function() {
|
|
3828
|
+
var e = Te.apply(Ve, arguments);
|
|
3849
3829
|
return e.every(function(t) {
|
|
3850
3830
|
return typeof t == "string";
|
|
3851
3831
|
}) ? e.length === 0 ? Pt(this) : this.inAnyRange(e.map(function(t) {
|
|
3852
3832
|
return [t, t + yt];
|
|
3853
3833
|
})) : ke(this, "startsWithAnyOf() only works with strings");
|
|
3854
|
-
},
|
|
3855
|
-
function
|
|
3834
|
+
}, xe);
|
|
3835
|
+
function xe() {
|
|
3856
3836
|
}
|
|
3857
3837
|
function Ue(e) {
|
|
3858
3838
|
return de(function(t) {
|
|
@@ -3994,34 +3974,34 @@ function sa() {
|
|
|
3994
3974
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
3995
3975
|
}
|
|
3996
3976
|
function li(e, t, v) {
|
|
3997
|
-
function r(
|
|
3998
|
-
if (
|
|
3999
|
-
if (
|
|
4000
|
-
var b =
|
|
4001
|
-
return b === void 0 ?
|
|
3977
|
+
function r(x) {
|
|
3978
|
+
if (x.type === 3) return null;
|
|
3979
|
+
if (x.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
3980
|
+
var b = x.lower, T = x.upper, S = x.lowerOpen, x = x.upperOpen;
|
|
3981
|
+
return b === void 0 ? T === void 0 ? null : t.upperBound(T, !!x) : T === void 0 ? t.lowerBound(b, !!S) : t.bound(b, T, !!S, !!x);
|
|
4002
3982
|
}
|
|
4003
3983
|
function o(R) {
|
|
4004
|
-
var b,
|
|
4005
|
-
return { name:
|
|
4006
|
-
var
|
|
4007
|
-
return new Promise(function(D,
|
|
3984
|
+
var b, T = R.name;
|
|
3985
|
+
return { name: T, schema: R, mutate: function(S) {
|
|
3986
|
+
var x = S.trans, k = S.type, O = S.keys, M = S.values, I = S.range;
|
|
3987
|
+
return new Promise(function(D, j) {
|
|
4008
3988
|
D = de(D);
|
|
4009
|
-
var N =
|
|
3989
|
+
var N = x.objectStore(T), F = N.keyPath == null, B = k === "put" || k === "add";
|
|
4010
3990
|
if (!B && k !== "delete" && k !== "deleteRange") throw new Error("Invalid operation type: " + k);
|
|
4011
|
-
var
|
|
3991
|
+
var K, H = (O || M || { length: 1 }).length;
|
|
4012
3992
|
if (O && M && O.length !== M.length) throw new Error("Given keys array must have same length as given values array.");
|
|
4013
|
-
if (
|
|
3993
|
+
if (H === 0) return D({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
4014
3994
|
function J(Re) {
|
|
4015
3995
|
++Oe, zt(Re);
|
|
4016
3996
|
}
|
|
4017
3997
|
var ee = [], te = [], Oe = 0;
|
|
4018
3998
|
if (k === "deleteRange") {
|
|
4019
3999
|
if (I.type === 4) return D({ numFailures: Oe, failures: te, results: [], lastResult: void 0 });
|
|
4020
|
-
I.type === 3 ? ee.push(
|
|
4000
|
+
I.type === 3 ? ee.push(K = N.clear()) : ee.push(K = N.delete(r(I)));
|
|
4021
4001
|
} else {
|
|
4022
|
-
var F = B ? F ? [M, O] : [M, null] : [O, null],
|
|
4023
|
-
if (B) for (var Se = 0; Se <
|
|
4024
|
-
else for (Se = 0; Se <
|
|
4002
|
+
var F = B ? F ? [M, O] : [M, null] : [O, null], $ = F[0], Ae = F[1];
|
|
4003
|
+
if (B) for (var Se = 0; Se < H; ++Se) ee.push(K = Ae && Ae[Se] !== void 0 ? N[k]($[Se], Ae[Se]) : N[k]($[Se])), K.onerror = J;
|
|
4004
|
+
else for (Se = 0; Se < H; ++Se) ee.push(K = N[k]($[Se])), K.onerror = J;
|
|
4025
4005
|
}
|
|
4026
4006
|
function Cn(Re) {
|
|
4027
4007
|
Re = Re.target.result, ee.forEach(function(wt, _r) {
|
|
@@ -4030,94 +4010,94 @@ function sa() {
|
|
|
4030
4010
|
return wt.result;
|
|
4031
4011
|
}), lastResult: Re });
|
|
4032
4012
|
}
|
|
4033
|
-
|
|
4013
|
+
K.onerror = function(Re) {
|
|
4034
4014
|
J(Re), Cn(Re);
|
|
4035
|
-
},
|
|
4015
|
+
}, K.onsuccess = Cn;
|
|
4036
4016
|
});
|
|
4037
4017
|
}, getMany: function(S) {
|
|
4038
|
-
var
|
|
4018
|
+
var x = S.trans, k = S.keys;
|
|
4039
4019
|
return new Promise(function(O, M) {
|
|
4040
4020
|
O = de(O);
|
|
4041
|
-
for (var I, D =
|
|
4021
|
+
for (var I, D = x.objectStore(T), j = k.length, N = new Array(j), F = 0, B = 0, K = function(ee) {
|
|
4042
4022
|
ee = ee.target, N[ee._pos] = ee.result, ++B === F && O(N);
|
|
4043
|
-
},
|
|
4023
|
+
}, H = Ue(M), J = 0; J < j; ++J) k[J] != null && ((I = D.get(k[J]))._pos = J, I.onsuccess = K, I.onerror = H, ++F);
|
|
4044
4024
|
F === 0 && O(N);
|
|
4045
4025
|
});
|
|
4046
4026
|
}, get: function(S) {
|
|
4047
|
-
var
|
|
4027
|
+
var x = S.trans, k = S.key;
|
|
4048
4028
|
return new Promise(function(O, M) {
|
|
4049
4029
|
O = de(O);
|
|
4050
|
-
var I =
|
|
4030
|
+
var I = x.objectStore(T).get(k);
|
|
4051
4031
|
I.onsuccess = function(D) {
|
|
4052
4032
|
return O(D.target.result);
|
|
4053
4033
|
}, I.onerror = Ue(M);
|
|
4054
4034
|
});
|
|
4055
4035
|
}, query: (b = w, function(S) {
|
|
4056
|
-
return new Promise(function(
|
|
4057
|
-
|
|
4058
|
-
var O, M, I, F = S.trans, D = S.values,
|
|
4059
|
-
if (
|
|
4060
|
-
b ? ((N = D ? B.getAll(
|
|
4061
|
-
return
|
|
4062
|
-
}, N.onerror = Ue(k)) : (O = 0, M = !D && "openKeyCursor" in B ? B.openKeyCursor(
|
|
4036
|
+
return new Promise(function(x, k) {
|
|
4037
|
+
x = de(x);
|
|
4038
|
+
var O, M, I, F = S.trans, D = S.values, j = S.limit, K = S.query, N = j === 1 / 0 ? void 0 : j, B = K.index, K = K.range, F = F.objectStore(T), B = B.isPrimaryKey ? F : F.index(B.name), K = r(K);
|
|
4039
|
+
if (j === 0) return x({ result: [] });
|
|
4040
|
+
b ? ((N = D ? B.getAll(K, N) : B.getAllKeys(K, N)).onsuccess = function(H) {
|
|
4041
|
+
return x({ result: H.target.result });
|
|
4042
|
+
}, N.onerror = Ue(k)) : (O = 0, M = !D && "openKeyCursor" in B ? B.openKeyCursor(K) : B.openCursor(K), I = [], M.onsuccess = function(H) {
|
|
4063
4043
|
var J = M.result;
|
|
4064
|
-
return J ? (I.push(D ? J.value : J.primaryKey), ++O ===
|
|
4044
|
+
return J ? (I.push(D ? J.value : J.primaryKey), ++O === j ? x({ result: I }) : void J.continue()) : x({ result: I });
|
|
4065
4045
|
}, M.onerror = Ue(k));
|
|
4066
4046
|
});
|
|
4067
4047
|
}), openCursor: function(S) {
|
|
4068
|
-
var
|
|
4069
|
-
return new Promise(function(D,
|
|
4048
|
+
var x = S.trans, k = S.values, O = S.query, M = S.reverse, I = S.unique;
|
|
4049
|
+
return new Promise(function(D, j) {
|
|
4070
4050
|
D = de(D);
|
|
4071
|
-
var B = O.index, N = O.range, F =
|
|
4072
|
-
|
|
4073
|
-
var J, ee, te, Oe,
|
|
4074
|
-
|
|
4051
|
+
var B = O.index, N = O.range, F = x.objectStore(T), F = B.isPrimaryKey ? F : F.index(B.name), B = M ? I ? "prevunique" : "prev" : I ? "nextunique" : "next", K = !k && "openKeyCursor" in F ? F.openKeyCursor(r(N), B) : F.openCursor(r(N), B);
|
|
4052
|
+
K.onerror = Ue(j), K.onsuccess = de(function(H) {
|
|
4053
|
+
var J, ee, te, Oe, $ = K.result;
|
|
4054
|
+
$ ? ($.___id = ++ci, $.done = !1, J = $.continue.bind($), ee = (ee = $.continuePrimaryKey) && ee.bind($), te = $.advance.bind($), Oe = function() {
|
|
4075
4055
|
throw new Error("Cursor not stopped");
|
|
4076
|
-
},
|
|
4056
|
+
}, $.trans = x, $.stop = $.continue = $.continuePrimaryKey = $.advance = function() {
|
|
4077
4057
|
throw new Error("Cursor not started");
|
|
4078
|
-
},
|
|
4079
|
-
var
|
|
4058
|
+
}, $.fail = de(j), $.next = function() {
|
|
4059
|
+
var Ae = this, Se = 1;
|
|
4080
4060
|
return this.start(function() {
|
|
4081
|
-
return Se-- ?
|
|
4061
|
+
return Se-- ? Ae.continue() : Ae.stop();
|
|
4082
4062
|
}).then(function() {
|
|
4083
|
-
return
|
|
4063
|
+
return Ae;
|
|
4084
4064
|
});
|
|
4085
|
-
},
|
|
4065
|
+
}, $.start = function(Ae) {
|
|
4086
4066
|
function Se() {
|
|
4087
|
-
if (
|
|
4088
|
-
|
|
4067
|
+
if (K.result) try {
|
|
4068
|
+
Ae();
|
|
4089
4069
|
} catch (Re) {
|
|
4090
|
-
|
|
4070
|
+
$.fail(Re);
|
|
4091
4071
|
}
|
|
4092
|
-
else
|
|
4072
|
+
else $.done = !0, $.start = function() {
|
|
4093
4073
|
throw new Error("Cursor behind last entry");
|
|
4094
|
-
},
|
|
4074
|
+
}, $.stop();
|
|
4095
4075
|
}
|
|
4096
4076
|
var Cn = new Promise(function(Re, wt) {
|
|
4097
|
-
Re = de(Re),
|
|
4098
|
-
|
|
4077
|
+
Re = de(Re), K.onerror = Ue(wt), $.fail = wt, $.stop = function(_r) {
|
|
4078
|
+
$.stop = $.continue = $.continuePrimaryKey = $.advance = Oe, Re(_r);
|
|
4099
4079
|
};
|
|
4100
4080
|
});
|
|
4101
|
-
return
|
|
4102
|
-
|
|
4103
|
-
}),
|
|
4104
|
-
}, D(
|
|
4105
|
-
},
|
|
4081
|
+
return K.onsuccess = de(function(Re) {
|
|
4082
|
+
K.onsuccess = Se, Se();
|
|
4083
|
+
}), $.continue = J, $.continuePrimaryKey = ee, $.advance = te, Se(), Cn;
|
|
4084
|
+
}, D($)) : D(null);
|
|
4085
|
+
}, j);
|
|
4106
4086
|
});
|
|
4107
4087
|
}, count: function(S) {
|
|
4108
|
-
var
|
|
4088
|
+
var x = S.query, k = S.trans, O = x.index, M = x.range;
|
|
4109
4089
|
return new Promise(function(I, D) {
|
|
4110
|
-
var
|
|
4090
|
+
var j = k.objectStore(T), N = O.isPrimaryKey ? j : j.index(O.name), j = r(M), N = j ? N.count(j) : N.count();
|
|
4111
4091
|
N.onsuccess = de(function(F) {
|
|
4112
4092
|
return I(F.target.result);
|
|
4113
4093
|
}), N.onerror = Ue(D);
|
|
4114
4094
|
});
|
|
4115
4095
|
} };
|
|
4116
4096
|
}
|
|
4117
|
-
var f, d, m,
|
|
4097
|
+
var f, d, m, E = (d = v, m = rs((f = e).objectStoreNames), { schema: { name: f.name, tables: m.map(function(R) {
|
|
4118
4098
|
return d.objectStore(R);
|
|
4119
4099
|
}).map(function(R) {
|
|
4120
|
-
var b = R.keyPath,
|
|
4100
|
+
var b = R.keyPath, x = R.autoIncrement, T = p(b), S = {}, x = { name: R.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: b == null, compound: T, keyPath: b, autoIncrement: x, unique: !0, extractKey: rr(b) }, indexes: rs(R.indexNames).map(function(k) {
|
|
4121
4101
|
return R.index(k);
|
|
4122
4102
|
}).map(function(I) {
|
|
4123
4103
|
var O = I.name, M = I.unique, D = I.multiEntry, I = I.keyPath, D = { name: O, compound: p(I), keyPath: I, unique: M, multiEntry: D, extractKey: rr(I) };
|
|
@@ -4125,9 +4105,9 @@ function sa() {
|
|
|
4125
4105
|
}), getIndexByKeyPath: function(k) {
|
|
4126
4106
|
return S[Wt(k)];
|
|
4127
4107
|
} };
|
|
4128
|
-
return S[":id"] =
|
|
4129
|
-
}) }, hasGetAll: 0 < m.length && "getAll" in d.objectStore(m[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), v =
|
|
4130
|
-
return
|
|
4108
|
+
return S[":id"] = x.primaryKey, b != null && (S[Wt(b)] = x.primaryKey), x;
|
|
4109
|
+
}) }, hasGetAll: 0 < m.length && "getAll" in d.objectStore(m[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), v = E.schema, w = E.hasGetAll, E = v.tables.map(o), g = {};
|
|
4110
|
+
return E.forEach(function(R) {
|
|
4131
4111
|
return g[R.name] = R;
|
|
4132
4112
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(R) {
|
|
4133
4113
|
if (!g[R]) throw new Error("Table '".concat(R, "' not found"));
|
|
@@ -4153,8 +4133,8 @@ function sa() {
|
|
|
4153
4133
|
n.forEach(function(o) {
|
|
4154
4134
|
var f = r[o];
|
|
4155
4135
|
t.forEach(function(d) {
|
|
4156
|
-
var m = function v(w,
|
|
4157
|
-
return
|
|
4136
|
+
var m = function v(w, E) {
|
|
4137
|
+
return G(w, E) || (w = y(w)) && v(w, E);
|
|
4158
4138
|
}(d, o);
|
|
4159
4139
|
(!m || "value" in m && m.value === void 0) && (d === e.Transaction.prototype || d instanceof e.Transaction ? q(d, o, { get: function() {
|
|
4160
4140
|
return this.table(o);
|
|
@@ -4179,36 +4159,36 @@ function sa() {
|
|
|
4179
4159
|
f.create(n), f._completion.catch(r);
|
|
4180
4160
|
var d = f._reject.bind(f), m = z.transless || z;
|
|
4181
4161
|
tt(function() {
|
|
4182
|
-
return z.trans = f, z.transless = m, t !== 0 ? (wn(e, n), w = t, ((v = f).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(
|
|
4183
|
-
return
|
|
4184
|
-
}) : U.resolve(w)).then(function(
|
|
4185
|
-
return R =
|
|
4162
|
+
return z.trans = f, z.transless = m, t !== 0 ? (wn(e, n), w = t, ((v = f).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(E) {
|
|
4163
|
+
return E ?? w;
|
|
4164
|
+
}) : U.resolve(w)).then(function(E) {
|
|
4165
|
+
return R = E, b = f, T = n, S = [], E = (g = e)._versions, x = g._dbSchema = Tn(0, g.idbdb, T), (E = E.filter(function(k) {
|
|
4186
4166
|
return k._cfg.version >= R;
|
|
4187
|
-
})).length !== 0 ? (
|
|
4167
|
+
})).length !== 0 ? (E.forEach(function(k) {
|
|
4188
4168
|
S.push(function() {
|
|
4189
|
-
var O =
|
|
4190
|
-
|
|
4169
|
+
var O = x, M = k._cfg.dbschema;
|
|
4170
|
+
En(g, O, T), En(g, M, T), x = g._dbSchema = M;
|
|
4191
4171
|
var I = ir(O, M);
|
|
4192
4172
|
I.add.forEach(function(B) {
|
|
4193
|
-
or(
|
|
4173
|
+
or(T, B[0], B[1].primKey, B[1].indexes);
|
|
4194
4174
|
}), I.change.forEach(function(B) {
|
|
4195
4175
|
if (B.recreate) throw new V.Upgrade("Not yet support for changing primary key");
|
|
4196
|
-
var
|
|
4197
|
-
B.add.forEach(function(
|
|
4198
|
-
return
|
|
4199
|
-
}), B.change.forEach(function(
|
|
4200
|
-
|
|
4201
|
-
}), B.del.forEach(function(
|
|
4202
|
-
return
|
|
4176
|
+
var K = T.objectStore(B.name);
|
|
4177
|
+
B.add.forEach(function(H) {
|
|
4178
|
+
return xn(K, H);
|
|
4179
|
+
}), B.change.forEach(function(H) {
|
|
4180
|
+
K.deleteIndex(H.name), xn(K, H);
|
|
4181
|
+
}), B.del.forEach(function(H) {
|
|
4182
|
+
return K.deleteIndex(H);
|
|
4203
4183
|
});
|
|
4204
4184
|
});
|
|
4205
4185
|
var D = k._cfg.contentUpgrade;
|
|
4206
4186
|
if (D && k._cfg.version > R) {
|
|
4207
|
-
wn(g,
|
|
4208
|
-
var
|
|
4187
|
+
wn(g, T), b._memoizedTables = {};
|
|
4188
|
+
var j = Le(M);
|
|
4209
4189
|
I.del.forEach(function(B) {
|
|
4210
|
-
|
|
4211
|
-
}), sr(g, [g.Transaction.prototype]), _n(g, [g.Transaction.prototype], l(
|
|
4190
|
+
j[B] = O[B];
|
|
4191
|
+
}), sr(g, [g.Transaction.prototype]), _n(g, [g.Transaction.prototype], l(j), j), b.schema = j;
|
|
4212
4192
|
var N, F = rn(D);
|
|
4213
4193
|
return F && kt(), I = U.follow(function() {
|
|
4214
4194
|
var B;
|
|
@@ -4219,8 +4199,8 @@ function sa() {
|
|
|
4219
4199
|
}
|
|
4220
4200
|
}), S.push(function(O) {
|
|
4221
4201
|
var M, I, D = k._cfg.dbschema;
|
|
4222
|
-
M = D, I = O, [].slice.call(I.db.objectStoreNames).forEach(function(
|
|
4223
|
-
return M[
|
|
4202
|
+
M = D, I = O, [].slice.call(I.db.objectStoreNames).forEach(function(j) {
|
|
4203
|
+
return M[j] == null && I.db.deleteObjectStore(j);
|
|
4224
4204
|
}), sr(g, [g.Transaction.prototype]), _n(g, [g.Transaction.prototype], g._storeNames, g._dbSchema), b.schema = g._dbSchema;
|
|
4225
4205
|
}), S.push(function(O) {
|
|
4226
4206
|
g.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(g.idbdb.version / 10) === k._cfg.version ? (g.idbdb.deleteObjectStore("$meta"), delete g._dbSchema.$meta, g._storeNames = g._storeNames.filter(function(M) {
|
|
@@ -4230,11 +4210,11 @@ function sa() {
|
|
|
4230
4210
|
}), function k() {
|
|
4231
4211
|
return S.length ? U.resolve(S.shift()(b.idbtrans)).then(k) : U.resolve();
|
|
4232
4212
|
}().then(function() {
|
|
4233
|
-
ss(
|
|
4213
|
+
ss(x, T);
|
|
4234
4214
|
})) : U.resolve();
|
|
4235
|
-
var g, R, b,
|
|
4236
|
-
}).catch(d)) : (l(o).forEach(function(
|
|
4237
|
-
or(n,
|
|
4215
|
+
var g, R, b, T, S, x;
|
|
4216
|
+
}).catch(d)) : (l(o).forEach(function(E) {
|
|
4217
|
+
or(n, E, o[E].primKey, o[E].indexes);
|
|
4238
4218
|
}), wn(e, n), void U.follow(function() {
|
|
4239
4219
|
return e.on.populate.fire(f);
|
|
4240
4220
|
}).catch(d));
|
|
@@ -4243,14 +4223,14 @@ function sa() {
|
|
|
4243
4223
|
}
|
|
4244
4224
|
function pi(e, t) {
|
|
4245
4225
|
ss(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
4246
|
-
var n =
|
|
4247
|
-
|
|
4226
|
+
var n = Tn(0, e.idbdb, t);
|
|
4227
|
+
En(e, e._dbSchema, t);
|
|
4248
4228
|
for (var r = 0, o = ir(n, e._dbSchema).change; r < o.length; r++) {
|
|
4249
4229
|
var f = function(d) {
|
|
4250
4230
|
if (d.change.length || d.recreate) return console.warn("Unable to patch indexes of table ".concat(d.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
4251
4231
|
var m = t.objectStore(d.name);
|
|
4252
4232
|
d.add.forEach(function(v) {
|
|
4253
|
-
Be && console.debug("Dexie upgrade patch: Creating missing index ".concat(d.name, ".").concat(v.src)),
|
|
4233
|
+
Be && console.debug("Dexie upgrade patch: Creating missing index ".concat(d.name, ".").concat(v.src)), xn(m, v);
|
|
4254
4234
|
});
|
|
4255
4235
|
}(o[r]);
|
|
4256
4236
|
if (typeof f == "object") return f.value;
|
|
@@ -4268,8 +4248,8 @@ function sa() {
|
|
|
4268
4248
|
var m = o.idxByName, v = f.idxByName, w = void 0;
|
|
4269
4249
|
for (w in m) v[w] || d.del.push(w);
|
|
4270
4250
|
for (w in v) {
|
|
4271
|
-
var
|
|
4272
|
-
|
|
4251
|
+
var E = m[w], g = v[w];
|
|
4252
|
+
E ? E.src !== g.src && d.change.push(g) : d.add.push(g);
|
|
4273
4253
|
}
|
|
4274
4254
|
(0 < d.del.length || 0 < d.add.length || 0 < d.change.length) && r.change.push(d);
|
|
4275
4255
|
}
|
|
@@ -4280,7 +4260,7 @@ function sa() {
|
|
|
4280
4260
|
function or(e, t, n, r) {
|
|
4281
4261
|
var o = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
4282
4262
|
return r.forEach(function(f) {
|
|
4283
|
-
return
|
|
4263
|
+
return xn(o, f);
|
|
4284
4264
|
}), o;
|
|
4285
4265
|
}
|
|
4286
4266
|
function ss(e, t) {
|
|
@@ -4288,26 +4268,26 @@ function sa() {
|
|
|
4288
4268
|
t.db.objectStoreNames.contains(n) || (Be && console.debug("Dexie: Creating missing table", n), or(t, n, e[n].primKey, e[n].indexes));
|
|
4289
4269
|
});
|
|
4290
4270
|
}
|
|
4291
|
-
function
|
|
4271
|
+
function xn(e, t) {
|
|
4292
4272
|
e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
|
|
4293
4273
|
}
|
|
4294
|
-
function
|
|
4274
|
+
function Tn(e, t, n) {
|
|
4295
4275
|
var r = {};
|
|
4296
4276
|
return Z(t.objectStoreNames, 0).forEach(function(o) {
|
|
4297
4277
|
for (var f = n.objectStore(o), d = tr(ns(w = f.keyPath), w || "", !0, !1, !!f.autoIncrement, w && typeof w != "string", !0), m = [], v = 0; v < f.indexNames.length; ++v) {
|
|
4298
|
-
var
|
|
4299
|
-
m.push(
|
|
4278
|
+
var E = f.index(f.indexNames[v]), w = E.keyPath, E = tr(E.name, w, !!E.unique, !!E.multiEntry, !1, w && typeof w != "string", !1);
|
|
4279
|
+
m.push(E);
|
|
4300
4280
|
}
|
|
4301
4281
|
r[o] = nr(o, d, m);
|
|
4302
4282
|
}), r;
|
|
4303
4283
|
}
|
|
4304
|
-
function
|
|
4284
|
+
function En(e, t, n) {
|
|
4305
4285
|
for (var r = n.db.objectStoreNames, o = 0; o < r.length; ++o) {
|
|
4306
4286
|
var f = r[o], d = n.objectStore(f);
|
|
4307
4287
|
e._hasGetAll = "getAll" in d;
|
|
4308
4288
|
for (var m = 0; m < d.indexNames.length; ++m) {
|
|
4309
|
-
var v = d.indexNames[m], w = d.index(v).keyPath,
|
|
4310
|
-
!t[f] || (w = t[f].idxByName[
|
|
4289
|
+
var v = d.indexNames[m], w = d.index(v).keyPath, E = typeof w == "string" ? w : "[" + Z(w).join("+") + "]";
|
|
4290
|
+
!t[f] || (w = t[f].idxByName[E]) && (w.name = v, delete t[f].idxByName[E], t[f].idxByName[v] = w);
|
|
4311
4291
|
}
|
|
4312
4292
|
}
|
|
4313
4293
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && c.WorkerGlobalScope && c instanceof c.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
@@ -4318,7 +4298,7 @@ function sa() {
|
|
|
4318
4298
|
return tr(r, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), p(o), n === 0);
|
|
4319
4299
|
});
|
|
4320
4300
|
}
|
|
4321
|
-
var mi = (
|
|
4301
|
+
var mi = (An.prototype._parseStoresSpec = function(e, t) {
|
|
4322
4302
|
l(e).forEach(function(n) {
|
|
4323
4303
|
if (e[n] !== null) {
|
|
4324
4304
|
var r = is(e[n]), o = r.shift();
|
|
@@ -4329,17 +4309,17 @@ function sa() {
|
|
|
4329
4309
|
}), t[n] = nr(n, o, r);
|
|
4330
4310
|
}
|
|
4331
4311
|
});
|
|
4332
|
-
},
|
|
4312
|
+
}, An.prototype.stores = function(n) {
|
|
4333
4313
|
var t = this.db;
|
|
4334
4314
|
this._cfg.storesSource = this._cfg.storesSource ? h(this._cfg.storesSource, n) : n;
|
|
4335
4315
|
var n = t._versions, r = {}, o = {};
|
|
4336
4316
|
return n.forEach(function(f) {
|
|
4337
4317
|
h(r, f._cfg.storesSource), o = f._cfg.dbschema = {}, f._parseStoresSpec(r, o);
|
|
4338
4318
|
}), t._dbSchema = o, sr(t, [t._allTables, t, t.Transaction.prototype]), _n(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], l(o), o), t._storeNames = l(o), this;
|
|
4339
|
-
},
|
|
4319
|
+
}, An.prototype.upgrade = function(e) {
|
|
4340
4320
|
return this._cfg.contentUpgrade = Bn(this._cfg.contentUpgrade || ue, e), this;
|
|
4341
|
-
},
|
|
4342
|
-
function
|
|
4321
|
+
}, An);
|
|
4322
|
+
function An() {
|
|
4343
4323
|
}
|
|
4344
4324
|
function ar(e, t) {
|
|
4345
4325
|
var n = e._dbNamesDB;
|
|
@@ -4356,9 +4336,9 @@ function sa() {
|
|
|
4356
4336
|
function lr(e) {
|
|
4357
4337
|
return !("from" in e);
|
|
4358
4338
|
}
|
|
4359
|
-
var
|
|
4339
|
+
var Ee = function(e, t) {
|
|
4360
4340
|
if (!this) {
|
|
4361
|
-
var n = new
|
|
4341
|
+
var n = new Ee();
|
|
4362
4342
|
return e && "d" in e && h(n, e), n;
|
|
4363
4343
|
}
|
|
4364
4344
|
h(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
@@ -4371,10 +4351,10 @@ function sa() {
|
|
|
4371
4351
|
var o = e.l, r = e.r;
|
|
4372
4352
|
if (re(n, e.from) < 0) return o ? Yt(o, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, as(e);
|
|
4373
4353
|
if (0 < re(t, e.to)) return r ? Yt(r, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, as(e);
|
|
4374
|
-
re(t, e.from) < 0 && (e.from = t, e.l = null, e.d = r ? r.d + 1 : 1), 0 < re(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, o && !e.l &&
|
|
4354
|
+
re(t, e.from) < 0 && (e.from = t, e.l = null, e.d = r ? r.d + 1 : 1), 0 < re(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, o && !e.l && $t(e, o), r && n && $t(e, r);
|
|
4375
4355
|
}
|
|
4376
4356
|
}
|
|
4377
|
-
function
|
|
4357
|
+
function $t(e, t) {
|
|
4378
4358
|
lr(t) || function n(r, v) {
|
|
4379
4359
|
var f = v.from, d = v.to, m = v.l, v = v.r;
|
|
4380
4360
|
Yt(r, f, d), m && n(r, m), v && n(r, v);
|
|
@@ -4419,7 +4399,7 @@ function sa() {
|
|
|
4419
4399
|
}
|
|
4420
4400
|
function Rn(e, t) {
|
|
4421
4401
|
return l(t).forEach(function(n) {
|
|
4422
|
-
e[n] ?
|
|
4402
|
+
e[n] ? $t(e[n], t[n]) : e[n] = function r(o) {
|
|
4423
4403
|
var f, d, m = {};
|
|
4424
4404
|
for (f in o) _(o, f) && (d = o[f], m[f] = !d || typeof d != "object" || tn.has(d.constructor) ? d : r(d));
|
|
4425
4405
|
return m;
|
|
@@ -4431,8 +4411,8 @@ function sa() {
|
|
|
4431
4411
|
return t[n] && os(t[n], e[n]);
|
|
4432
4412
|
});
|
|
4433
4413
|
}
|
|
4434
|
-
P(
|
|
4435
|
-
return
|
|
4414
|
+
P(Ee.prototype, ((Ce = { add: function(e) {
|
|
4415
|
+
return $t(this, e), this;
|
|
4436
4416
|
}, addKey: function(e) {
|
|
4437
4417
|
return Yt(this, e, e), this;
|
|
4438
4418
|
}, addKeys: function(e) {
|
|
@@ -4466,16 +4446,16 @@ function sa() {
|
|
|
4466
4446
|
}
|
|
4467
4447
|
function cs(e, t, n, r) {
|
|
4468
4448
|
for (var o = [], f = 0, d = Object.entries(e.queries.query); f < d.length; f++) {
|
|
4469
|
-
for (var m = d[f], v = m[0], w = [],
|
|
4470
|
-
var R = g[
|
|
4471
|
-
fr(t, R.obsSet) ? R.subscribers.forEach(function(
|
|
4472
|
-
return n.add(
|
|
4449
|
+
for (var m = d[f], v = m[0], w = [], E = 0, g = m[1]; E < g.length; E++) {
|
|
4450
|
+
var R = g[E];
|
|
4451
|
+
fr(t, R.obsSet) ? R.subscribers.forEach(function(x) {
|
|
4452
|
+
return n.add(x);
|
|
4473
4453
|
}) : r && w.push(R);
|
|
4474
4454
|
}
|
|
4475
4455
|
r && o.push([v, w]);
|
|
4476
4456
|
}
|
|
4477
|
-
if (r) for (var b = 0,
|
|
4478
|
-
var S =
|
|
4457
|
+
if (r) for (var b = 0, T = o; b < T.length; b++) {
|
|
4458
|
+
var S = T[b], v = S[0], w = S[1];
|
|
4479
4459
|
e.queries.query[v] = w;
|
|
4480
4460
|
}
|
|
4481
4461
|
}
|
|
@@ -4492,20 +4472,20 @@ function sa() {
|
|
|
4492
4472
|
function m() {
|
|
4493
4473
|
return new U(function(R, b) {
|
|
4494
4474
|
if (d(), !n) throw new V.MissingAPI();
|
|
4495
|
-
var
|
|
4475
|
+
var T = e.name, S = t.autoSchema || !o ? n.open(T) : n.open(T, o);
|
|
4496
4476
|
if (!S) throw new V.MissingAPI();
|
|
4497
|
-
S.onerror = Ue(b), S.onblocked = de(e._fireOnBlocked), S.onupgradeneeded = de(function(
|
|
4477
|
+
S.onerror = Ue(b), S.onblocked = de(e._fireOnBlocked), S.onupgradeneeded = de(function(x) {
|
|
4498
4478
|
var k;
|
|
4499
|
-
|
|
4500
|
-
b(new V.NoSuchDatabase("Database ".concat(
|
|
4501
|
-
})) : (
|
|
4479
|
+
E = S.transaction, t.autoSchema && !e._options.allowEmptyDB ? (S.onerror = zt, E.abort(), S.result.close(), (k = n.deleteDatabase(T)).onsuccess = k.onerror = de(function() {
|
|
4480
|
+
b(new V.NoSuchDatabase("Database ".concat(T, " doesnt exist")));
|
|
4481
|
+
})) : (E.onerror = Ue(b), x = x.oldVersion > Math.pow(2, 62) ? 0 : x.oldVersion, g = x < 1, e.idbdb = S.result, f && pi(e, E), di(e, x / 10, E, b));
|
|
4502
4482
|
}, b), S.onsuccess = de(function() {
|
|
4503
|
-
|
|
4504
|
-
var
|
|
4505
|
-
if (0 <
|
|
4506
|
-
var N = D.transaction((M =
|
|
4507
|
-
if (t.autoSchema) k = D, O = N, (
|
|
4508
|
-
else if (
|
|
4483
|
+
E = null;
|
|
4484
|
+
var x, k, O, M, I, D = e.idbdb = S.result, j = Z(D.objectStoreNames);
|
|
4485
|
+
if (0 < j.length) try {
|
|
4486
|
+
var N = D.transaction((M = j).length === 1 ? M[0] : M, "readonly");
|
|
4487
|
+
if (t.autoSchema) k = D, O = N, (x = e).verno = k.version / 10, O = x._dbSchema = Tn(0, k, O), x._storeNames = Z(k.objectStoreNames, 0), _n(x, [x._allTables], l(O), O);
|
|
4488
|
+
else if (En(e, e._dbSchema, N), ((I = ir(Tn(0, (I = e).idbdb, N), I._dbSchema)).add.length || I.change.some(function(F) {
|
|
4509
4489
|
return F.add.length || F.change.length;
|
|
4510
4490
|
})) && !f) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), D.close(), o = D.version + 1, f = !0, R(m());
|
|
4511
4491
|
wn(e, N);
|
|
@@ -4515,7 +4495,7 @@ function sa() {
|
|
|
4515
4495
|
t.vcFired = !0, e.on("versionchange").fire(F);
|
|
4516
4496
|
}), D.onclose = de(function(F) {
|
|
4517
4497
|
e.on("close").fire(F);
|
|
4518
|
-
}), g && (I = e._deps, N =
|
|
4498
|
+
}), g && (I = e._deps, N = T, D = I.indexedDB, I = I.IDBKeyRange, ur(D) || N === mn || ar(D, I).put({ name: N }).catch(ue)), R();
|
|
4519
4499
|
}, b);
|
|
4520
4500
|
}).catch(function(R) {
|
|
4521
4501
|
switch (R == null ? void 0 : R.name) {
|
|
@@ -4528,7 +4508,7 @@ function sa() {
|
|
|
4528
4508
|
return U.reject(R);
|
|
4529
4509
|
});
|
|
4530
4510
|
}
|
|
4531
|
-
var v, w = t.dbReadyResolve,
|
|
4511
|
+
var v, w = t.dbReadyResolve, E = null, g = !1;
|
|
4532
4512
|
return U.race([r, (typeof navigator > "u" ? U.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(R) {
|
|
4533
4513
|
function b() {
|
|
4534
4514
|
return indexedDB.databases().finally(R);
|
|
@@ -4552,7 +4532,7 @@ function sa() {
|
|
|
4552
4532
|
}).catch(function(R) {
|
|
4553
4533
|
t.dbOpenError = R;
|
|
4554
4534
|
try {
|
|
4555
|
-
|
|
4535
|
+
E && E.abort();
|
|
4556
4536
|
} catch {
|
|
4557
4537
|
}
|
|
4558
4538
|
return r === t.openCanceller && e._close(), ye(R);
|
|
@@ -4561,9 +4541,9 @@ function sa() {
|
|
|
4561
4541
|
}).then(function() {
|
|
4562
4542
|
var R;
|
|
4563
4543
|
return g && (R = {}, e.tables.forEach(function(b) {
|
|
4564
|
-
b.schema.indexes.forEach(function(
|
|
4565
|
-
|
|
4566
|
-
}), R["idb://".concat(e.name, "/").concat(b.name, "/")] = R["idb://".concat(e.name, "/").concat(b.name, "/:dels")] = new
|
|
4544
|
+
b.schema.indexes.forEach(function(T) {
|
|
4545
|
+
T.name && (R["idb://".concat(e.name, "/").concat(b.name, "/").concat(T.name)] = new Ee(-1 / 0, [[[]]]));
|
|
4546
|
+
}), R["idb://".concat(e.name, "/").concat(b.name, "/")] = R["idb://".concat(e.name, "/").concat(b.name, "/:dels")] = new Ee(-1 / 0, [[[]]]);
|
|
4567
4547
|
}), it(Vt).fire(R), pr(R, !0)), e;
|
|
4568
4548
|
});
|
|
4569
4549
|
}
|
|
@@ -4590,8 +4570,8 @@ function sa() {
|
|
|
4590
4570
|
return a(a({}, e), { table: function(t) {
|
|
4591
4571
|
var n = e.table(t), r = n.schema, o = {}, f = [];
|
|
4592
4572
|
function d(g, R, b) {
|
|
4593
|
-
var
|
|
4594
|
-
return S.push(k), k.isPrimaryKey || f.push(k), 1 <
|
|
4573
|
+
var T = Wt(g), S = o[T] = o[T] || [], x = g == null ? 0 : typeof g == "string" ? 1 : g.length, k = 0 < R, k = a(a({}, b), { name: k ? "".concat(T, "(virtual-from:").concat(b.name, ")") : b.name, lowLevelIndex: b, isVirtual: k, keyTail: R, keyLength: x, extractKey: rr(g), unique: !k && b.unique });
|
|
4574
|
+
return S.push(k), k.isPrimaryKey || f.push(k), 1 < x && d(x === 2 ? g[0] : g.slice(0, x - 1), R + 1, b), S.sort(function(O, M) {
|
|
4595
4575
|
return O.keyTail - M.keyTail;
|
|
4596
4576
|
}), k;
|
|
4597
4577
|
}
|
|
@@ -4600,22 +4580,22 @@ function sa() {
|
|
|
4600
4580
|
var w = v[m];
|
|
4601
4581
|
d(w.keyPath, 0, w);
|
|
4602
4582
|
}
|
|
4603
|
-
function
|
|
4583
|
+
function E(g) {
|
|
4604
4584
|
var R, b = g.query.index;
|
|
4605
4585
|
return b.isVirtual ? a(a({}, g), { query: { index: b.lowLevelIndex, range: (R = g.query.range, b = b.keyTail, { type: R.type === 1 ? 2 : R.type, lower: On(R.lower, R.lowerOpen ? e.MAX_KEY : e.MIN_KEY, b), lowerOpen: !0, upper: On(R.upper, R.upperOpen ? e.MIN_KEY : e.MAX_KEY, b), upperOpen: !0 }) } }) : g;
|
|
4606
4586
|
}
|
|
4607
4587
|
return a(a({}, n), { schema: a(a({}, r), { primaryKey: t, indexes: f, getIndexByKeyPath: function(g) {
|
|
4608
4588
|
return (g = o[Wt(g)]) && g[0];
|
|
4609
4589
|
} }), count: function(g) {
|
|
4610
|
-
return n.count(
|
|
4590
|
+
return n.count(E(g));
|
|
4611
4591
|
}, query: function(g) {
|
|
4612
|
-
return n.query(
|
|
4592
|
+
return n.query(E(g));
|
|
4613
4593
|
}, openCursor: function(g) {
|
|
4614
|
-
var R = g.query.index, b = R.keyTail,
|
|
4615
|
-
return
|
|
4616
|
-
return k &&
|
|
4594
|
+
var R = g.query.index, b = R.keyTail, T = R.isVirtual, S = R.keyLength;
|
|
4595
|
+
return T ? n.openCursor(E(g)).then(function(k) {
|
|
4596
|
+
return k && x(k);
|
|
4617
4597
|
}) : n.openCursor(g);
|
|
4618
|
-
function
|
|
4598
|
+
function x(k) {
|
|
4619
4599
|
return Object.create(k, { continue: { value: function(O) {
|
|
4620
4600
|
O != null ? k.continue(On(O, g.reverse ? e.MAX_KEY : e.MIN_KEY, b)) : g.unique ? k.continue(k.key.slice(0, S).concat(g.reverse ? e.MIN_KEY : e.MAX_KEY, b)) : k.continue();
|
|
4621
4601
|
} }, continuePrimaryKey: { value: function(O, M) {
|
|
@@ -4652,48 +4632,48 @@ function sa() {
|
|
|
4652
4632
|
case "add":
|
|
4653
4633
|
if (v.fire === ue) break;
|
|
4654
4634
|
return f._promise("readwrite", function() {
|
|
4655
|
-
return
|
|
4635
|
+
return E(o);
|
|
4656
4636
|
}, !0);
|
|
4657
4637
|
case "put":
|
|
4658
4638
|
if (v.fire === ue && w.fire === ue) break;
|
|
4659
4639
|
return f._promise("readwrite", function() {
|
|
4660
|
-
return
|
|
4640
|
+
return E(o);
|
|
4661
4641
|
}, !0);
|
|
4662
4642
|
case "delete":
|
|
4663
4643
|
if (m.fire === ue) break;
|
|
4664
4644
|
return f._promise("readwrite", function() {
|
|
4665
|
-
return
|
|
4645
|
+
return E(o);
|
|
4666
4646
|
}, !0);
|
|
4667
4647
|
case "deleteRange":
|
|
4668
4648
|
if (m.fire === ue) break;
|
|
4669
4649
|
return f._promise("readwrite", function() {
|
|
4670
|
-
return function g(R, b,
|
|
4671
|
-
return n.query({ trans: R, values: !1, query: { index: r, range: b }, limit:
|
|
4672
|
-
var
|
|
4673
|
-
return
|
|
4674
|
-
return 0 < k.numFailures ? Promise.reject(k.failures[0]) :
|
|
4650
|
+
return function g(R, b, T) {
|
|
4651
|
+
return n.query({ trans: R, values: !1, query: { index: r, range: b }, limit: T }).then(function(S) {
|
|
4652
|
+
var x = S.result;
|
|
4653
|
+
return E({ type: "delete", keys: x, trans: R }).then(function(k) {
|
|
4654
|
+
return 0 < k.numFailures ? Promise.reject(k.failures[0]) : x.length < T ? { failures: [], numFailures: 0, lastResult: void 0 } : g(R, a(a({}, b), { lower: x[x.length - 1], lowerOpen: !0 }), T);
|
|
4675
4655
|
});
|
|
4676
4656
|
});
|
|
4677
4657
|
}(o.trans, o.range, 1e4);
|
|
4678
4658
|
}, !0);
|
|
4679
4659
|
}
|
|
4680
4660
|
return n.mutate(o);
|
|
4681
|
-
function
|
|
4682
|
-
var R, b,
|
|
4683
|
-
if (!
|
|
4684
|
-
return (g = g.type === "add" || g.type === "put" ? a(a({}, g), { keys:
|
|
4685
|
-
var O =
|
|
4686
|
-
var D,
|
|
4687
|
-
return g.type === "delete" ? m.fire.call(B, M, F, S) : g.type === "add" || F === void 0 ? (D = v.fire.call(B, M, g.values[I], S), M == null && D != null && (g.keys[I] = M = D, r.outbound || ae(g.values[I], r.keyPath, M))) : (D = yr(F, g.values[I]), (
|
|
4688
|
-
_(N,
|
|
4661
|
+
function E(g) {
|
|
4662
|
+
var R, b, T, S = z.trans, x = g.keys || gr(r, g);
|
|
4663
|
+
if (!x) throw new Error("Keys missing");
|
|
4664
|
+
return (g = g.type === "add" || g.type === "put" ? a(a({}, g), { keys: x }) : a({}, g)).type !== "delete" && (g.values = u([], g.values)), g.keys && (g.keys = u([], g.keys)), R = n, T = x, ((b = g).type === "add" ? Promise.resolve([]) : R.getMany({ trans: b.trans, keys: T, cache: "immutable" })).then(function(k) {
|
|
4665
|
+
var O = x.map(function(M, I) {
|
|
4666
|
+
var D, j, N, F = k[I], B = { onerror: null, onsuccess: null };
|
|
4667
|
+
return g.type === "delete" ? m.fire.call(B, M, F, S) : g.type === "add" || F === void 0 ? (D = v.fire.call(B, M, g.values[I], S), M == null && D != null && (g.keys[I] = M = D, r.outbound || ae(g.values[I], r.keyPath, M))) : (D = yr(F, g.values[I]), (j = w.fire.call(B, D, M, F, S)) && (N = g.values[I], Object.keys(j).forEach(function(K) {
|
|
4668
|
+
_(N, K) ? N[K] = j[K] : ae(N, K, j[K]);
|
|
4689
4669
|
}))), B;
|
|
4690
4670
|
});
|
|
4691
4671
|
return n.mutate(g).then(function(M) {
|
|
4692
|
-
for (var I = M.failures, D = M.results,
|
|
4693
|
-
var F = (D ||
|
|
4672
|
+
for (var I = M.failures, D = M.results, j = M.numFailures, M = M.lastResult, N = 0; N < x.length; ++N) {
|
|
4673
|
+
var F = (D || x)[N], B = O[N];
|
|
4694
4674
|
F == null ? B.onerror && B.onerror(I[N]) : B.onsuccess && B.onsuccess(g.type === "put" && k[N] ? g.values[N] : F);
|
|
4695
4675
|
}
|
|
4696
|
-
return { failures: I, results: D, numFailures:
|
|
4676
|
+
return { failures: I, results: D, numFailures: j, lastResult: M };
|
|
4697
4677
|
}).catch(function(M) {
|
|
4698
4678
|
return O.forEach(function(I) {
|
|
4699
4679
|
return I.onerror && I.onerror(M);
|
|
@@ -4742,80 +4722,80 @@ function sa() {
|
|
|
4742
4722
|
}
|
|
4743
4723
|
}
|
|
4744
4724
|
var wi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
4745
|
-
var t = e.schema.name, n = new
|
|
4725
|
+
var t = e.schema.name, n = new Ee(e.MIN_KEY, e.MAX_KEY);
|
|
4746
4726
|
return a(a({}, e), { transaction: function(r, o, f) {
|
|
4747
4727
|
if (z.subscr && o !== "readonly") throw new V.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(z.querier));
|
|
4748
4728
|
return e.transaction(r, o, f);
|
|
4749
4729
|
}, table: function(r) {
|
|
4750
4730
|
var o = e.table(r), f = o.schema, d = f.primaryKey, g = f.indexes, m = d.extractKey, v = d.outbound, w = d.autoIncrement && g.filter(function(b) {
|
|
4751
4731
|
return b.compound && b.keyPath.includes(d.keyPath);
|
|
4752
|
-
}),
|
|
4753
|
-
function
|
|
4754
|
-
return
|
|
4732
|
+
}), E = a(a({}, o), { mutate: function(b) {
|
|
4733
|
+
function T(K) {
|
|
4734
|
+
return K = "idb://".concat(t, "/").concat(r, "/").concat(K), M[K] || (M[K] = new Ee());
|
|
4755
4735
|
}
|
|
4756
|
-
var S,
|
|
4757
|
-
return
|
|
4736
|
+
var S, x, k, O = b.trans, M = b.mutatedParts || (b.mutatedParts = {}), I = T(""), D = T(":dels"), j = b.type, B = b.type === "deleteRange" ? [b.range] : b.type === "delete" ? [b.keys] : b.values.length < 50 ? [gr(d, b).filter(function(K) {
|
|
4737
|
+
return K;
|
|
4758
4738
|
}), b.values] : [], N = B[0], F = B[1], B = b.trans._cache;
|
|
4759
|
-
return p(N) ? (I.addKeys(N), (B =
|
|
4760
|
-
var
|
|
4739
|
+
return p(N) ? (I.addKeys(N), (B = j === "delete" || N.length === F.length ? ls(N, B) : null) || D.addKeys(N), (B || F) && (S = T, x = B, k = F, f.indexes.forEach(function(K) {
|
|
4740
|
+
var H = S(K.name || "");
|
|
4761
4741
|
function J(te) {
|
|
4762
|
-
return te != null ?
|
|
4742
|
+
return te != null ? K.extractKey(te) : null;
|
|
4763
4743
|
}
|
|
4764
4744
|
function ee(te) {
|
|
4765
|
-
return
|
|
4766
|
-
return
|
|
4767
|
-
}) :
|
|
4745
|
+
return K.multiEntry && p(te) ? te.forEach(function(Oe) {
|
|
4746
|
+
return H.addKey(Oe);
|
|
4747
|
+
}) : H.addKey(te);
|
|
4768
4748
|
}
|
|
4769
|
-
(
|
|
4770
|
-
var
|
|
4771
|
-
re(
|
|
4749
|
+
(x || k).forEach(function(te, Ae) {
|
|
4750
|
+
var $ = x && J(x[Ae]), Ae = k && J(k[Ae]);
|
|
4751
|
+
re($, Ae) !== 0 && ($ != null && ee($), Ae != null && ee(Ae));
|
|
4772
4752
|
});
|
|
4773
|
-
}))) : N ? (F = { from: (F = N.lower) !== null && F !== void 0 ? F : e.MIN_KEY, to: (F = N.upper) !== null && F !== void 0 ? F : e.MAX_KEY }, D.add(F), I.add(F)) : (I.add(n), D.add(n), f.indexes.forEach(function(
|
|
4774
|
-
return
|
|
4775
|
-
})), o.mutate(b).then(function(
|
|
4776
|
-
return !N || b.type !== "add" && b.type !== "put" || (I.addKeys(
|
|
4777
|
-
for (var J = b.values.map(function(
|
|
4778
|
-
return
|
|
4779
|
-
}), ee =
|
|
4780
|
-
return
|
|
4781
|
-
}), te = 0, Oe =
|
|
4782
|
-
|
|
4783
|
-
})), O.mutatedParts = Rn(O.mutatedParts || {}, M),
|
|
4753
|
+
}))) : N ? (F = { from: (F = N.lower) !== null && F !== void 0 ? F : e.MIN_KEY, to: (F = N.upper) !== null && F !== void 0 ? F : e.MAX_KEY }, D.add(F), I.add(F)) : (I.add(n), D.add(n), f.indexes.forEach(function(K) {
|
|
4754
|
+
return T(K.name).add(n);
|
|
4755
|
+
})), o.mutate(b).then(function(K) {
|
|
4756
|
+
return !N || b.type !== "add" && b.type !== "put" || (I.addKeys(K.results), w && w.forEach(function(H) {
|
|
4757
|
+
for (var J = b.values.map(function($) {
|
|
4758
|
+
return H.extractKey($);
|
|
4759
|
+
}), ee = H.keyPath.findIndex(function($) {
|
|
4760
|
+
return $ === d.keyPath;
|
|
4761
|
+
}), te = 0, Oe = K.results.length; te < Oe; ++te) J[te][ee] = K.results[te];
|
|
4762
|
+
T(H.name).addKeys(J);
|
|
4763
|
+
})), O.mutatedParts = Rn(O.mutatedParts || {}, M), K;
|
|
4784
4764
|
});
|
|
4785
|
-
} }), g = function(
|
|
4786
|
-
var S =
|
|
4787
|
-
return [
|
|
4765
|
+
} }), g = function(T) {
|
|
4766
|
+
var S = T.query, T = S.index, S = S.range;
|
|
4767
|
+
return [T, new Ee((T = S.lower) !== null && T !== void 0 ? T : e.MIN_KEY, (S = S.upper) !== null && S !== void 0 ? S : e.MAX_KEY)];
|
|
4788
4768
|
}, R = { get: function(b) {
|
|
4789
|
-
return [d, new
|
|
4769
|
+
return [d, new Ee(b.key)];
|
|
4790
4770
|
}, getMany: function(b) {
|
|
4791
|
-
return [d, new
|
|
4771
|
+
return [d, new Ee().addKeys(b.keys)];
|
|
4792
4772
|
}, count: g, query: g, openCursor: g };
|
|
4793
4773
|
return l(R).forEach(function(b) {
|
|
4794
|
-
|
|
4795
|
-
var S = z.subscr,
|
|
4796
|
-
if (
|
|
4774
|
+
E[b] = function(T) {
|
|
4775
|
+
var S = z.subscr, x = !!S, k = fs(z, o) && hs(b, T) ? T.obsSet = {} : S;
|
|
4776
|
+
if (x) {
|
|
4797
4777
|
var O = function(F) {
|
|
4798
|
-
return F = "idb://".concat(t, "/").concat(r, "/").concat(F), k[F] || (k[F] = new
|
|
4799
|
-
}, M = O(""), I = O(":dels"), S = R[b](
|
|
4800
|
-
if ((b === "query" &&
|
|
4778
|
+
return F = "idb://".concat(t, "/").concat(r, "/").concat(F), k[F] || (k[F] = new Ee());
|
|
4779
|
+
}, M = O(""), I = O(":dels"), S = R[b](T), x = S[0], S = S[1];
|
|
4780
|
+
if ((b === "query" && x.isPrimaryKey && !T.values ? I : O(x.name || "")).add(S), !x.isPrimaryKey) {
|
|
4801
4781
|
if (b !== "count") {
|
|
4802
|
-
var D = b === "query" && v &&
|
|
4782
|
+
var D = b === "query" && v && T.values && o.query(a(a({}, T), { values: !1 }));
|
|
4803
4783
|
return o[b].apply(this, arguments).then(function(F) {
|
|
4804
4784
|
if (b === "query") {
|
|
4805
|
-
if (v &&
|
|
4785
|
+
if (v && T.values) return D.then(function(J) {
|
|
4806
4786
|
return J = J.result, M.addKeys(J), F;
|
|
4807
4787
|
});
|
|
4808
|
-
var B =
|
|
4809
|
-
(
|
|
4788
|
+
var B = T.values ? F.result.map(m) : F.result;
|
|
4789
|
+
(T.values ? M : I).addKeys(B);
|
|
4810
4790
|
} else if (b === "openCursor") {
|
|
4811
|
-
var
|
|
4812
|
-
return
|
|
4813
|
-
return I.addKey(
|
|
4791
|
+
var K = F, H = T.values;
|
|
4792
|
+
return K && Object.create(K, { key: { get: function() {
|
|
4793
|
+
return I.addKey(K.primaryKey), K.key;
|
|
4814
4794
|
} }, primaryKey: { get: function() {
|
|
4815
|
-
var J =
|
|
4795
|
+
var J = K.primaryKey;
|
|
4816
4796
|
return I.addKey(J), J;
|
|
4817
4797
|
} }, value: { get: function() {
|
|
4818
|
-
return
|
|
4798
|
+
return H && M.addKey(K.primaryKey), K.value;
|
|
4819
4799
|
} } });
|
|
4820
4800
|
}
|
|
4821
4801
|
return F;
|
|
@@ -4826,7 +4806,7 @@ function sa() {
|
|
|
4826
4806
|
}
|
|
4827
4807
|
return o[b].apply(this, arguments);
|
|
4828
4808
|
};
|
|
4829
|
-
}),
|
|
4809
|
+
}), E;
|
|
4830
4810
|
} });
|
|
4831
4811
|
} };
|
|
4832
4812
|
function ds(e, t, n) {
|
|
@@ -4845,52 +4825,52 @@ function sa() {
|
|
|
4845
4825
|
}
|
|
4846
4826
|
function ps(e, t, R, r, o, f) {
|
|
4847
4827
|
if (!R || R.length === 0) return e;
|
|
4848
|
-
var d = t.query.index, m = d.multiEntry, v = t.query.range, w = r.schema.primaryKey.extractKey,
|
|
4849
|
-
var S = b,
|
|
4850
|
-
if (
|
|
4851
|
-
var M, I =
|
|
4852
|
-
k.hasKey(D) || (M =
|
|
4853
|
-
return vr(
|
|
4854
|
-
}) : vr(M, v)) && (k.addKey(D),
|
|
4828
|
+
var d = t.query.index, m = d.multiEntry, v = t.query.range, w = r.schema.primaryKey.extractKey, E = d.extractKey, g = (d.lowLevelIndex || d).extractKey, R = R.reduce(function(b, T) {
|
|
4829
|
+
var S = b, x = [];
|
|
4830
|
+
if (T.type === "add" || T.type === "put") for (var k = new Ee(), O = T.values.length - 1; 0 <= O; --O) {
|
|
4831
|
+
var M, I = T.values[O], D = w(I);
|
|
4832
|
+
k.hasKey(D) || (M = E(I), (m && p(M) ? M.some(function(K) {
|
|
4833
|
+
return vr(K, v);
|
|
4834
|
+
}) : vr(M, v)) && (k.addKey(D), x.push(I)));
|
|
4855
4835
|
}
|
|
4856
|
-
switch (
|
|
4836
|
+
switch (T.type) {
|
|
4857
4837
|
case "add":
|
|
4858
|
-
var
|
|
4859
|
-
return w(
|
|
4860
|
-
}) : b), S = b.concat(t.values ?
|
|
4861
|
-
return
|
|
4862
|
-
}) :
|
|
4863
|
-
return w(
|
|
4864
|
-
}).filter(function(
|
|
4865
|
-
return !
|
|
4838
|
+
var j = new Ee().addKeys(t.values ? b.map(function(H) {
|
|
4839
|
+
return w(H);
|
|
4840
|
+
}) : b), S = b.concat(t.values ? x.filter(function(H) {
|
|
4841
|
+
return H = w(H), !j.hasKey(H) && (j.addKey(H), !0);
|
|
4842
|
+
}) : x.map(function(H) {
|
|
4843
|
+
return w(H);
|
|
4844
|
+
}).filter(function(H) {
|
|
4845
|
+
return !j.hasKey(H) && (j.addKey(H), !0);
|
|
4866
4846
|
}));
|
|
4867
4847
|
break;
|
|
4868
4848
|
case "put":
|
|
4869
|
-
var N = new
|
|
4870
|
-
return w(
|
|
4849
|
+
var N = new Ee().addKeys(T.values.map(function(H) {
|
|
4850
|
+
return w(H);
|
|
4871
4851
|
}));
|
|
4872
|
-
S = b.filter(function(
|
|
4873
|
-
return !N.hasKey(t.values ? w(
|
|
4874
|
-
}).concat(t.values ?
|
|
4875
|
-
return w(
|
|
4852
|
+
S = b.filter(function(H) {
|
|
4853
|
+
return !N.hasKey(t.values ? w(H) : H);
|
|
4854
|
+
}).concat(t.values ? x : x.map(function(H) {
|
|
4855
|
+
return w(H);
|
|
4876
4856
|
}));
|
|
4877
4857
|
break;
|
|
4878
4858
|
case "delete":
|
|
4879
|
-
var F = new
|
|
4880
|
-
S = b.filter(function(
|
|
4881
|
-
return !F.hasKey(t.values ? w(
|
|
4859
|
+
var F = new Ee().addKeys(T.keys);
|
|
4860
|
+
S = b.filter(function(H) {
|
|
4861
|
+
return !F.hasKey(t.values ? w(H) : H);
|
|
4882
4862
|
});
|
|
4883
4863
|
break;
|
|
4884
4864
|
case "deleteRange":
|
|
4885
|
-
var B =
|
|
4886
|
-
S = b.filter(function(
|
|
4887
|
-
return !vr(w(
|
|
4865
|
+
var B = T.range;
|
|
4866
|
+
S = b.filter(function(H) {
|
|
4867
|
+
return !vr(w(H), B);
|
|
4888
4868
|
});
|
|
4889
4869
|
}
|
|
4890
4870
|
return S;
|
|
4891
4871
|
}, e);
|
|
4892
|
-
return R === e ? e : (R.sort(function(b,
|
|
4893
|
-
return re(g(b), g(
|
|
4872
|
+
return R === e ? e : (R.sort(function(b, T) {
|
|
4873
|
+
return re(g(b), g(T)) || re(w(b), w(T));
|
|
4894
4874
|
}), t.limit && t.limit < 1 / 0 && (R.length > t.limit ? R.length = t.limit : e.length === t.limit && R.length < t.limit && (o.dirty = !0)), f ? Object.freeze(R) : R);
|
|
4895
4875
|
}
|
|
4896
4876
|
function ms(e, t) {
|
|
@@ -4917,7 +4897,7 @@ function sa() {
|
|
|
4917
4897
|
return r;
|
|
4918
4898
|
}(e.upper, t.upper, e.upperOpen, t.upperOpen);
|
|
4919
4899
|
}
|
|
4920
|
-
function
|
|
4900
|
+
function xi(e, t, n, r) {
|
|
4921
4901
|
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
4922
4902
|
var o, f;
|
|
4923
4903
|
e.subscribers.delete(n), e.subscribers.size === 0 && (o = e, f = t, setTimeout(function() {
|
|
@@ -4925,36 +4905,36 @@ function sa() {
|
|
|
4925
4905
|
}, 3e3));
|
|
4926
4906
|
});
|
|
4927
4907
|
}
|
|
4928
|
-
var
|
|
4908
|
+
var Ti = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
4929
4909
|
var t = e.schema.name;
|
|
4930
4910
|
return a(a({}, e), { transaction: function(n, r, o) {
|
|
4931
4911
|
var f, d, m = e.transaction(n, r, o);
|
|
4932
4912
|
return r === "readwrite" && (d = (f = new AbortController()).signal, o = function(v) {
|
|
4933
4913
|
return function() {
|
|
4934
4914
|
if (f.abort(), r === "readwrite") {
|
|
4935
|
-
for (var w = /* @__PURE__ */ new Set(),
|
|
4936
|
-
var R = g[
|
|
4915
|
+
for (var w = /* @__PURE__ */ new Set(), E = 0, g = n; E < g.length; E++) {
|
|
4916
|
+
var R = g[E], b = vt["idb://".concat(t, "/").concat(R)];
|
|
4937
4917
|
if (b) {
|
|
4938
|
-
var
|
|
4939
|
-
return
|
|
4918
|
+
var T = e.table(R), S = b.optimisticOps.filter(function(H) {
|
|
4919
|
+
return H.trans === m;
|
|
4940
4920
|
});
|
|
4941
|
-
if (m._explicit && v && m.mutatedParts) for (var
|
|
4942
|
-
return w.add(
|
|
4921
|
+
if (m._explicit && v && m.mutatedParts) for (var x = 0, k = Object.values(b.queries.query); x < k.length; x++) for (var O = 0, M = (j = k[x]).slice(); O < M.length; O++) fr((N = M[O]).obsSet, m.mutatedParts) && (Fe(j, N), N.subscribers.forEach(function(H) {
|
|
4922
|
+
return w.add(H);
|
|
4943
4923
|
}));
|
|
4944
4924
|
else if (0 < S.length) {
|
|
4945
|
-
b.optimisticOps = b.optimisticOps.filter(function(
|
|
4946
|
-
return
|
|
4925
|
+
b.optimisticOps = b.optimisticOps.filter(function(H) {
|
|
4926
|
+
return H.trans !== m;
|
|
4947
4927
|
});
|
|
4948
|
-
for (var I = 0, D = Object.values(b.queries.query); I < D.length; I++) for (var
|
|
4949
|
-
return w.add(
|
|
4950
|
-
})) : F !== N.res && (N.res = F, N.promise = U.resolve({ result: F }))) : (N.dirty && Fe(
|
|
4951
|
-
return w.add(
|
|
4928
|
+
for (var I = 0, D = Object.values(b.queries.query); I < D.length; I++) for (var j, N, F, B = 0, K = (j = D[I]).slice(); B < K.length; B++) (N = K[B]).res != null && m.mutatedParts && (v && !N.dirty ? (F = Object.isFrozen(N.res), F = ps(N.res, N.req, S, T, N, F), N.dirty ? (Fe(j, N), N.subscribers.forEach(function(H) {
|
|
4929
|
+
return w.add(H);
|
|
4930
|
+
})) : F !== N.res && (N.res = F, N.promise = U.resolve({ result: F }))) : (N.dirty && Fe(j, N), N.subscribers.forEach(function(H) {
|
|
4931
|
+
return w.add(H);
|
|
4952
4932
|
})));
|
|
4953
4933
|
}
|
|
4954
4934
|
}
|
|
4955
4935
|
}
|
|
4956
|
-
w.forEach(function(
|
|
4957
|
-
return
|
|
4936
|
+
w.forEach(function(H) {
|
|
4937
|
+
return H();
|
|
4958
4938
|
});
|
|
4959
4939
|
}
|
|
4960
4940
|
};
|
|
@@ -4972,9 +4952,9 @@ function sa() {
|
|
|
4972
4952
|
}), d.catch(function() {
|
|
4973
4953
|
Fe(m.optimisticOps, f), f.mutatedParts && kn(f.mutatedParts);
|
|
4974
4954
|
})) : d.then(function(v) {
|
|
4975
|
-
var w = ds(0, a(a({}, f), { values: f.values.map(function(
|
|
4955
|
+
var w = ds(0, a(a({}, f), { values: f.values.map(function(E, g) {
|
|
4976
4956
|
var R;
|
|
4977
|
-
return v.failures[g] ?
|
|
4957
|
+
return v.failures[g] ? E : (E = (R = o.keyPath) !== null && R !== void 0 && R.includes(".") ? me(E) : a({}, E), ae(E, o.keyPath, v.results[g]), E);
|
|
4978
4958
|
}) }), v);
|
|
4979
4959
|
m.optimisticOps.push(w), queueMicrotask(function() {
|
|
4980
4960
|
return f.mutatedParts && kn(f.mutatedParts);
|
|
@@ -4982,13 +4962,13 @@ function sa() {
|
|
|
4982
4962
|
}), d) : r.mutate(f);
|
|
4983
4963
|
}, query: function(f) {
|
|
4984
4964
|
if (!fs(z, r) || !hs("query", f)) return r.query(f);
|
|
4985
|
-
var d = ((w = z.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", g = z, m = g.requery, v = g.signal, w = function(
|
|
4986
|
-
var O = vt["idb://".concat(
|
|
4965
|
+
var d = ((w = z.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", g = z, m = g.requery, v = g.signal, w = function(T, S, x, k) {
|
|
4966
|
+
var O = vt["idb://".concat(T, "/").concat(S)];
|
|
4987
4967
|
if (!O) return [];
|
|
4988
|
-
if (!(S = O.queries[
|
|
4968
|
+
if (!(S = O.queries[x])) return [null, !1, O, null];
|
|
4989
4969
|
var M = S[(k.query ? k.query.index.name : null) || ""];
|
|
4990
4970
|
if (!M) return [null, !1, O, null];
|
|
4991
|
-
switch (
|
|
4971
|
+
switch (x) {
|
|
4992
4972
|
case "query":
|
|
4993
4973
|
var I = M.find(function(D) {
|
|
4994
4974
|
return D.req.limit === k.limit && D.req.values === k.values && ms(D.req.query.range, k.query.range);
|
|
@@ -5001,18 +4981,18 @@ function sa() {
|
|
|
5001
4981
|
return ms(D.req.query.range, k.query.range);
|
|
5002
4982
|
}), [I, !!I, O, M];
|
|
5003
4983
|
}
|
|
5004
|
-
}(t, n, "query", f),
|
|
5005
|
-
return
|
|
5006
|
-
var S =
|
|
5007
|
-
if (
|
|
5008
|
-
for (var
|
|
4984
|
+
}(t, n, "query", f), E = w[0], g = w[1], R = w[2], b = w[3];
|
|
4985
|
+
return E && g ? E.obsSet = f.obsSet : (g = r.query(f).then(function(T) {
|
|
4986
|
+
var S = T.result;
|
|
4987
|
+
if (E && (E.res = S), d) {
|
|
4988
|
+
for (var x = 0, k = S.length; x < k; ++x) Object.freeze(S[x]);
|
|
5009
4989
|
Object.freeze(S);
|
|
5010
|
-
} else
|
|
5011
|
-
return
|
|
5012
|
-
}).catch(function(
|
|
5013
|
-
return b &&
|
|
5014
|
-
}),
|
|
5015
|
-
return { result: ps(
|
|
4990
|
+
} else T.result = me(S);
|
|
4991
|
+
return T;
|
|
4992
|
+
}).catch(function(T) {
|
|
4993
|
+
return b && E && Fe(b, E), Promise.reject(T);
|
|
4994
|
+
}), E = { obsSet: f.obsSet, promise: g, subscribers: /* @__PURE__ */ new Set(), type: "query", req: f, dirty: !1 }, b ? b.push(E) : (b = [E], (R = R || (vt["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[f.query.index.name || ""] = b)), xi(E, b, m, v), E.promise.then(function(T) {
|
|
4995
|
+
return { result: ps(T.result, f, R == null ? void 0 : R.optimisticOps, r, E, d) };
|
|
5016
4996
|
});
|
|
5017
4997
|
} });
|
|
5018
4998
|
} });
|
|
@@ -5081,8 +5061,8 @@ function sa() {
|
|
|
5081
5061
|
t.close(e);
|
|
5082
5062
|
var m = t._deps.indexedDB.deleteDatabase(t.name);
|
|
5083
5063
|
m.onsuccess = de(function() {
|
|
5084
|
-
var v, w,
|
|
5085
|
-
v = t._deps, w = t.name,
|
|
5064
|
+
var v, w, E;
|
|
5065
|
+
v = t._deps, w = t.name, E = v.indexedDB, v = v.IDBKeyRange, ur(E) || w === mn || ar(E, v).delete(w).catch(ue), o();
|
|
5086
5066
|
}), m.onerror = Ue(f), m.onblocked = t._fireOnBlocked;
|
|
5087
5067
|
}
|
|
5088
5068
|
if (n) throw new V.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
@@ -5123,11 +5103,11 @@ function sa() {
|
|
|
5123
5103
|
return w;
|
|
5124
5104
|
}), e == "r" || e === Yn) f = Yn;
|
|
5125
5105
|
else {
|
|
5126
|
-
if (e != "rw" && e !=
|
|
5127
|
-
f =
|
|
5106
|
+
if (e != "rw" && e != $n) throw new V.InvalidArgument("Invalid transaction mode: " + e);
|
|
5107
|
+
f = $n;
|
|
5128
5108
|
}
|
|
5129
5109
|
if (o) {
|
|
5130
|
-
if (o.mode === Yn && f ===
|
|
5110
|
+
if (o.mode === Yn && f === $n) {
|
|
5131
5111
|
if (!m) throw new V.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
5132
5112
|
o = null;
|
|
5133
5113
|
}
|
|
@@ -5139,35 +5119,35 @@ function sa() {
|
|
|
5139
5119
|
}), m && o && !o.active && (o = null);
|
|
5140
5120
|
}
|
|
5141
5121
|
} catch (w) {
|
|
5142
|
-
return o ? o._promise(null, function(
|
|
5122
|
+
return o ? o._promise(null, function(E, g) {
|
|
5143
5123
|
g(w);
|
|
5144
5124
|
}) : ye(w);
|
|
5145
5125
|
}
|
|
5146
|
-
var v = (function w(
|
|
5126
|
+
var v = (function w(E, g, R, b, T) {
|
|
5147
5127
|
return U.resolve().then(function() {
|
|
5148
|
-
var S = z.transless || z,
|
|
5149
|
-
if (
|
|
5128
|
+
var S = z.transless || z, x = E._createTransaction(g, R, E._dbSchema, b);
|
|
5129
|
+
if (x.explicit = !0, S = { trans: x, transless: S }, b) x.idbtrans = b.idbtrans;
|
|
5150
5130
|
else try {
|
|
5151
|
-
|
|
5131
|
+
x.create(), x.idbtrans._explicit = !0, E._state.PR1398_maxLoop = 3;
|
|
5152
5132
|
} catch (M) {
|
|
5153
|
-
return M.name ===
|
|
5154
|
-
return w(
|
|
5133
|
+
return M.name === je.InvalidState && E.isOpen() && 0 < --E._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), E.close({ disableAutoOpen: !1 }), E.open().then(function() {
|
|
5134
|
+
return w(E, g, R, null, T);
|
|
5155
5135
|
})) : ye(M);
|
|
5156
5136
|
}
|
|
5157
|
-
var k, O = rn(
|
|
5137
|
+
var k, O = rn(T);
|
|
5158
5138
|
return O && kt(), S = U.follow(function() {
|
|
5159
5139
|
var M;
|
|
5160
|
-
(k =
|
|
5140
|
+
(k = T.call(x, x)) && (O ? (M = nt.bind(null, null), k.then(M, M)) : typeof k.next == "function" && typeof k.throw == "function" && (k = mr(k)));
|
|
5161
5141
|
}, S), (k && typeof k.then == "function" ? U.resolve(k).then(function(M) {
|
|
5162
|
-
return
|
|
5142
|
+
return x.active ? M : ye(new V.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
5163
5143
|
}) : S.then(function() {
|
|
5164
5144
|
return k;
|
|
5165
5145
|
})).then(function(M) {
|
|
5166
|
-
return b &&
|
|
5146
|
+
return b && x._resolve(), x._completion.then(function() {
|
|
5167
5147
|
return M;
|
|
5168
5148
|
});
|
|
5169
5149
|
}).catch(function(M) {
|
|
5170
|
-
return
|
|
5150
|
+
return x._reject(M), ye(M);
|
|
5171
5151
|
});
|
|
5172
5152
|
});
|
|
5173
5153
|
}).bind(null, this, f, d, o, n);
|
|
@@ -5191,74 +5171,74 @@ function sa() {
|
|
|
5191
5171
|
}), this._state = w, this.name = e, this.on = qt(this, "populate", "blocked", "versionchange", "close", { ready: [Bn, ue] }), this.on.ready.subscribe = ce(this.on.ready.subscribe, function(g) {
|
|
5192
5172
|
return function(R, b) {
|
|
5193
5173
|
ge.vip(function() {
|
|
5194
|
-
var
|
|
5195
|
-
S.openComplete ? (S.dbOpenError || U.resolve().then(R), b && g(R)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(R), b && g(R)) : (g(R),
|
|
5196
|
-
|
|
5174
|
+
var T, S = n._state;
|
|
5175
|
+
S.openComplete ? (S.dbOpenError || U.resolve().then(R), b && g(R)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(R), b && g(R)) : (g(R), T = n, b || g(function x() {
|
|
5176
|
+
T.on.ready.unsubscribe(R), T.on.ready.unsubscribe(x);
|
|
5197
5177
|
}));
|
|
5198
5178
|
});
|
|
5199
5179
|
};
|
|
5200
|
-
}), this.Collection = (o = this,
|
|
5180
|
+
}), this.Collection = (o = this, Ht(ii.prototype, function(k, x) {
|
|
5201
5181
|
this.db = o;
|
|
5202
|
-
var b = Vr,
|
|
5203
|
-
if (
|
|
5204
|
-
b =
|
|
5182
|
+
var b = Vr, T = null;
|
|
5183
|
+
if (x) try {
|
|
5184
|
+
b = x();
|
|
5205
5185
|
} catch (O) {
|
|
5206
|
-
|
|
5186
|
+
T = O;
|
|
5207
5187
|
}
|
|
5208
|
-
var S = k._ctx,
|
|
5209
|
-
this._ctx = { table:
|
|
5210
|
-
})), this.Table = (f = this,
|
|
5211
|
-
this.db = f, this._tx = b, this.name = g, this.schema = R, this.hook = f._allTables[g] ? f._allTables[g].hook : qt(null, { creating: [
|
|
5212
|
-
})), this.Transaction = (d = this,
|
|
5213
|
-
var
|
|
5214
|
-
this.db = d, this.mode = g, this.storeNames = R, this.schema = b, this.chromeTransactionDurability =
|
|
5215
|
-
|
|
5188
|
+
var S = k._ctx, x = S.table, k = x.hook.reading.fire;
|
|
5189
|
+
this._ctx = { table: x, index: S.index, isPrimKey: !S.index || x.schema.primKey.keyPath && S.index === x.schema.primKey.name, range: b, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: T, or: S.or, valueMapper: k !== Ft ? k : null };
|
|
5190
|
+
})), this.Table = (f = this, Ht($r.prototype, function(g, R, b) {
|
|
5191
|
+
this.db = f, this._tx = b, this.name = g, this.schema = R, this.hook = f._allTables[g] ? f._allTables[g].hook : qt(null, { creating: [$s, ue], reading: [Ys, Ft], updating: [Js, ue], deleting: [Qs, ue] });
|
|
5192
|
+
})), this.Transaction = (d = this, Ht(ui.prototype, function(g, R, b, T, S) {
|
|
5193
|
+
var x = this;
|
|
5194
|
+
this.db = d, this.mode = g, this.storeNames = R, this.schema = b, this.chromeTransactionDurability = T, this.idbtrans = null, this.on = qt(this, "complete", "error", "abort"), this.parent = S || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new U(function(k, O) {
|
|
5195
|
+
x._resolve = k, x._reject = O;
|
|
5216
5196
|
}), this._completion.then(function() {
|
|
5217
|
-
|
|
5197
|
+
x.active = !1, x.on.complete.fire();
|
|
5218
5198
|
}, function(k) {
|
|
5219
|
-
var O =
|
|
5220
|
-
return
|
|
5199
|
+
var O = x.active;
|
|
5200
|
+
return x.active = !1, x.on.error.fire(k), x.parent ? x.parent._reject(k) : O && x.idbtrans && x.idbtrans.abort(), ye(k);
|
|
5221
5201
|
});
|
|
5222
|
-
})), this.Version = (m = this,
|
|
5202
|
+
})), this.Version = (m = this, Ht(mi.prototype, function(g) {
|
|
5223
5203
|
this.db = m, this._cfg = { version: g, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
5224
|
-
})), this.WhereClause = (v = this,
|
|
5225
|
-
if (this.db = v, this._ctx = { table: g, index: R === ":id" ? null : R, or: b }, this._cmp = this._ascending = re, this._descending = function(
|
|
5226
|
-
return re(S,
|
|
5227
|
-
}, this._max = function(
|
|
5228
|
-
return 0 < re(
|
|
5229
|
-
}, this._min = function(
|
|
5230
|
-
return re(
|
|
5204
|
+
})), this.WhereClause = (v = this, Ht(ts.prototype, function(g, R, b) {
|
|
5205
|
+
if (this.db = v, this._ctx = { table: g, index: R === ":id" ? null : R, or: b }, this._cmp = this._ascending = re, this._descending = function(T, S) {
|
|
5206
|
+
return re(S, T);
|
|
5207
|
+
}, this._max = function(T, S) {
|
|
5208
|
+
return 0 < re(T, S) ? T : S;
|
|
5209
|
+
}, this._min = function(T, S) {
|
|
5210
|
+
return re(T, S) < 0 ? T : S;
|
|
5231
5211
|
}, this._IDBKeyRange = v._deps.IDBKeyRange, !this._IDBKeyRange) throw new V.MissingAPI();
|
|
5232
5212
|
})), this.on("versionchange", function(g) {
|
|
5233
5213
|
0 < g.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
5234
5214
|
}), this.on("blocked", function(g) {
|
|
5235
5215
|
!g.newVersion || g.newVersion < g.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(g.oldVersion / 10));
|
|
5236
|
-
}), this._maxKey = Xt(t.IDBKeyRange), this._createTransaction = function(g, R, b,
|
|
5237
|
-
return new n.Transaction(g, R, b, n._options.chromeTransactionDurability,
|
|
5216
|
+
}), this._maxKey = Xt(t.IDBKeyRange), this._createTransaction = function(g, R, b, T) {
|
|
5217
|
+
return new n.Transaction(g, R, b, n._options.chromeTransactionDurability, T);
|
|
5238
5218
|
}, this._fireOnBlocked = function(g) {
|
|
5239
5219
|
n.on("blocked").fire(g), Ot.filter(function(R) {
|
|
5240
5220
|
return R.name === n.name && R !== n && !R._state.vcFired;
|
|
5241
5221
|
}).map(function(R) {
|
|
5242
5222
|
return R.on("versionchange").fire(g);
|
|
5243
5223
|
});
|
|
5244
|
-
}, this.use(bi), this.use(
|
|
5245
|
-
var
|
|
5224
|
+
}, this.use(bi), this.use(Ti), this.use(wi), this.use(gi), this.use(vi);
|
|
5225
|
+
var E = new Proxy(this, { get: function(g, R, b) {
|
|
5246
5226
|
if (R === "_vip") return !0;
|
|
5247
5227
|
if (R === "table") return function(S) {
|
|
5248
|
-
return Mn(n.table(S),
|
|
5228
|
+
return Mn(n.table(S), E);
|
|
5249
5229
|
};
|
|
5250
|
-
var
|
|
5251
|
-
return
|
|
5252
|
-
return Mn(S,
|
|
5230
|
+
var T = Reflect.get(g, R, b);
|
|
5231
|
+
return T instanceof $r ? Mn(T, E) : R === "tables" ? T.map(function(S) {
|
|
5232
|
+
return Mn(S, E);
|
|
5253
5233
|
}) : R === "_createTransaction" ? function() {
|
|
5254
|
-
return Mn(
|
|
5255
|
-
} :
|
|
5234
|
+
return Mn(T.apply(this, arguments), E);
|
|
5235
|
+
} : T;
|
|
5256
5236
|
} });
|
|
5257
|
-
this.vip =
|
|
5237
|
+
this.vip = E, r.forEach(function(g) {
|
|
5258
5238
|
return g(n);
|
|
5259
5239
|
});
|
|
5260
5240
|
}
|
|
5261
|
-
var Pn, Ce = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable",
|
|
5241
|
+
var Pn, Ce = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Ei = (br.prototype.subscribe = function(e, t, n) {
|
|
5262
5242
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
|
|
5263
5243
|
}, br.prototype[Ce] = function() {
|
|
5264
5244
|
return this;
|
|
@@ -5272,19 +5252,19 @@ function sa() {
|
|
|
5272
5252
|
Pn = { indexedDB: null, IDBKeyRange: null };
|
|
5273
5253
|
}
|
|
5274
5254
|
function ys(e) {
|
|
5275
|
-
var t, n = !1, r = new
|
|
5276
|
-
var f = rn(e), d, m = !1, v = {}, w = {},
|
|
5255
|
+
var t, n = !1, r = new Ei(function(o) {
|
|
5256
|
+
var f = rn(e), d, m = !1, v = {}, w = {}, E = { get closed() {
|
|
5277
5257
|
return m;
|
|
5278
5258
|
}, unsubscribe: function() {
|
|
5279
5259
|
m || (m = !0, d && d.abort(), g && it.storagemutated.unsubscribe(b));
|
|
5280
5260
|
} };
|
|
5281
|
-
o.start && o.start(
|
|
5261
|
+
o.start && o.start(E);
|
|
5282
5262
|
var g = !1, R = function() {
|
|
5283
|
-
return Wn(
|
|
5263
|
+
return Wn(T);
|
|
5284
5264
|
}, b = function(S) {
|
|
5285
5265
|
Rn(v, S), fr(w, v) && R();
|
|
5286
|
-
},
|
|
5287
|
-
var S,
|
|
5266
|
+
}, T = function() {
|
|
5267
|
+
var S, x, k;
|
|
5288
5268
|
!m && Pn.indexedDB && (v = {}, S = {}, d && d.abort(), d = new AbortController(), k = function(O) {
|
|
5289
5269
|
var M = St();
|
|
5290
5270
|
try {
|
|
@@ -5294,8 +5274,8 @@ function sa() {
|
|
|
5294
5274
|
} finally {
|
|
5295
5275
|
M && Rt();
|
|
5296
5276
|
}
|
|
5297
|
-
}(
|
|
5298
|
-
n = !0, t = O, m ||
|
|
5277
|
+
}(x = { subscr: S, signal: d.signal, requery: R, querier: e, trans: null }), Promise.resolve(k).then(function(O) {
|
|
5278
|
+
n = !0, t = O, m || x.signal.aborted || (v = {}, function(M) {
|
|
5299
5279
|
for (var I in M) if (_(M, I)) return;
|
|
5300
5280
|
return 1;
|
|
5301
5281
|
}(w = S) || g || (it(Vt, b), g = !0), Wn(function() {
|
|
@@ -5307,7 +5287,7 @@ function sa() {
|
|
|
5307
5287
|
});
|
|
5308
5288
|
}));
|
|
5309
5289
|
};
|
|
5310
|
-
return setTimeout(R, 0),
|
|
5290
|
+
return setTimeout(R, 0), E;
|
|
5311
5291
|
});
|
|
5312
5292
|
return r.hasValue = function() {
|
|
5313
5293
|
return n;
|
|
@@ -5374,12 +5354,12 @@ function sa() {
|
|
|
5374
5354
|
}, Promise: U, debug: { get: function() {
|
|
5375
5355
|
return Be;
|
|
5376
5356
|
}, set: function(e) {
|
|
5377
|
-
|
|
5357
|
+
jr(e);
|
|
5378
5358
|
} }, derive: X, extend: h, props: P, override: ce, Events: qt, on: it, liveQuery: ys, extendObservabilitySet: Rn, getByKeyPath: ve, setByKeyPath: ae, delByKeyPath: function(e, t) {
|
|
5379
5359
|
typeof t == "string" ? ae(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
5380
5360
|
ae(e, n, void 0);
|
|
5381
5361
|
});
|
|
5382
|
-
}, shallowClone: Le, deepClone: me, getObjectDiff: yr, cmp: re, asap: we, minKey: -1 / 0, addons: [], connections: Ot, errnames:
|
|
5362
|
+
}, shallowClone: Le, deepClone: me, getObjectDiff: yr, cmp: re, asap: we, minKey: -1 / 0, addons: [], connections: Ot, errnames: je, dependencies: Pn, cache: vt, semVer: "4.0.11", version: "4.0.11".split(".").map(function(e) {
|
|
5383
5363
|
return parseInt(e);
|
|
5384
5364
|
}).reduce(function(e, t, n) {
|
|
5385
5365
|
return e + t / Math.pow(10, 2 * n);
|
|
@@ -5402,18 +5382,18 @@ function sa() {
|
|
|
5402
5382
|
for (var t = 0, n = Ot; t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
|
|
5403
5383
|
}
|
|
5404
5384
|
}), addEventListener("pageshow", function(e) {
|
|
5405
|
-
!We.disableBfCache && e.persisted && (Be && console.debug("Dexie: handling persisted pageshow"), gs(), wr({ all: new
|
|
5385
|
+
!We.disableBfCache && e.persisted && (Be && console.debug("Dexie: handling persisted pageshow"), gs(), wr({ all: new Ee(-1 / 0, [[]]) }));
|
|
5406
5386
|
})), U.rejectionMapper = function(e, t) {
|
|
5407
|
-
return !e || e instanceof Ze || e instanceof TypeError || e instanceof SyntaxError || !e.name || !
|
|
5387
|
+
return !e || e instanceof Ze || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Kr[e.name] ? e : (t = new Kr[e.name](t || e.message, e), "stack" in e && q(t, "stack", { get: function() {
|
|
5408
5388
|
return this.inner.stack;
|
|
5409
5389
|
} }), t);
|
|
5410
|
-
},
|
|
5411
|
-
return new
|
|
5390
|
+
}, jr(Be), a(We, Object.freeze({ __proto__: null, Dexie: We, liveQuery: ys, Entity: Xr, cmp: re, PropModification: Gt, replacePrefix: function(e, t) {
|
|
5391
|
+
return new Gt({ replacePrefix: [e, t] });
|
|
5412
5392
|
}, add: function(e) {
|
|
5413
|
-
return new
|
|
5393
|
+
return new Gt({ add: e });
|
|
5414
5394
|
}, remove: function(e) {
|
|
5415
|
-
return new
|
|
5416
|
-
}, default: We, RangeSet:
|
|
5395
|
+
return new Gt({ remove: e });
|
|
5396
|
+
}, default: We, RangeSet: Ee, mergeRanges: $t, rangesOverlap: os }), { default: We }), We;
|
|
5417
5397
|
});
|
|
5418
5398
|
}(Dn)), Dn.exports;
|
|
5419
5399
|
}
|
|
@@ -5430,8 +5410,8 @@ const {
|
|
|
5430
5410
|
Entity: ba,
|
|
5431
5411
|
PropModification: wa,
|
|
5432
5412
|
replacePrefix: _a,
|
|
5433
|
-
add:
|
|
5434
|
-
remove:
|
|
5413
|
+
add: xa,
|
|
5414
|
+
remove: Ta
|
|
5435
5415
|
} = Fn;
|
|
5436
5416
|
class oa {
|
|
5437
5417
|
/**
|
|
@@ -5624,7 +5604,7 @@ class oa {
|
|
|
5624
5604
|
}
|
|
5625
5605
|
}
|
|
5626
5606
|
let Ln;
|
|
5627
|
-
const
|
|
5607
|
+
const Ea = () => {
|
|
5628
5608
|
const C = new vo(), s = new yo();
|
|
5629
5609
|
s.setDecoderPath("/draco/"), C.setDRACOLoader(s);
|
|
5630
5610
|
function i(c, l, p, h) {
|
|
@@ -5638,8 +5618,8 @@ const Ta = () => {
|
|
|
5638
5618
|
async function u(c, l, p) {
|
|
5639
5619
|
Ln || (Ln = new oa());
|
|
5640
5620
|
const h = await Ln.loadCachedModel(c, l);
|
|
5641
|
-
return h || new Promise((y,
|
|
5642
|
-
C.load(c, y, p,
|
|
5621
|
+
return h || new Promise((y, A) => {
|
|
5622
|
+
C.load(c, y, p, A);
|
|
5643
5623
|
}).then(async (y) => (await Ln.cacheModel(c, y.scene, l), y.scene));
|
|
5644
5624
|
}
|
|
5645
5625
|
return {
|
|
@@ -5652,7 +5632,7 @@ export {
|
|
|
5652
5632
|
oa as I,
|
|
5653
5633
|
fa as a,
|
|
5654
5634
|
da as b,
|
|
5655
|
-
|
|
5635
|
+
Ea as c,
|
|
5656
5636
|
ha as i,
|
|
5657
5637
|
Ye as o,
|
|
5658
5638
|
la as u
|