@rive-app/webgl2 2.37.5 → 2.37.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/rive.js +243 -166
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_fallback.wasm +0 -0
- package/runtimeLoader.d.ts +3 -1
package/rive.js
CHANGED
|
@@ -174,6 +174,16 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
174
174
|
// Class is never instantiated
|
|
175
175
|
function RuntimeLoader() {
|
|
176
176
|
}
|
|
177
|
+
// Rejects all pending awaitInstance() promises and resets loading state so
|
|
178
|
+
// the next call to getInstance() / awaitInstance() can retry with a new URL.
|
|
179
|
+
RuntimeLoader.notifyError = function (error) {
|
|
180
|
+
var _a;
|
|
181
|
+
RuntimeLoader.isLoading = false;
|
|
182
|
+
while (RuntimeLoader.errorCallbackQueue.length > 0) {
|
|
183
|
+
(_a = RuntimeLoader.errorCallbackQueue.shift()) === null || _a === void 0 ? void 0 : _a(error);
|
|
184
|
+
}
|
|
185
|
+
RuntimeLoader.callBackQueue = [];
|
|
186
|
+
};
|
|
177
187
|
// Loads the runtime
|
|
178
188
|
RuntimeLoader.loadRuntime = function () {
|
|
179
189
|
// Capture the URL at call time so the catch closure always refers to the
|
|
@@ -192,6 +202,7 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
192
202
|
performance.measure('rive:wasm-init', 'rive:wasm-init:start', 'rive:wasm-init:end');
|
|
193
203
|
}
|
|
194
204
|
RuntimeLoader.runtime = rive;
|
|
205
|
+
RuntimeLoader.errorCallbackQueue = [];
|
|
195
206
|
// Fire all the callbacks
|
|
196
207
|
while (RuntimeLoader.callBackQueue.length > 0) {
|
|
197
208
|
(_a = RuntimeLoader.callBackQueue.shift()) === null || _a === void 0 ? void 0 : _a(RuntimeLoader.runtime);
|
|
@@ -244,14 +255,15 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
244
255
|
"\nTo resolve, you may need to:",
|
|
245
256
|
"1. Check your network connection",
|
|
246
257
|
"2. Set a new WASM source via RuntimeLoader.setWasmUrl()",
|
|
247
|
-
"3. Call RuntimeLoader.
|
|
258
|
+
"3. Call RuntimeLoader.awaitInstance() again",
|
|
248
259
|
].join("\n");
|
|
249
260
|
console.error(errorMessage);
|
|
261
|
+
RuntimeLoader.notifyError(new Error(errorMessage));
|
|
250
262
|
}
|
|
251
263
|
});
|
|
252
264
|
};
|
|
253
265
|
// Provides a runtime instance via a callback
|
|
254
|
-
RuntimeLoader.getInstance = function (callback) {
|
|
266
|
+
RuntimeLoader.getInstance = function (callback, onError) {
|
|
255
267
|
// If it's not loading, start loading runtime
|
|
256
268
|
if (!RuntimeLoader.isLoading) {
|
|
257
269
|
RuntimeLoader.isLoading = true;
|
|
@@ -259,15 +271,18 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
259
271
|
}
|
|
260
272
|
if (!RuntimeLoader.runtime) {
|
|
261
273
|
RuntimeLoader.callBackQueue.push(callback);
|
|
274
|
+
if (onError) {
|
|
275
|
+
RuntimeLoader.errorCallbackQueue.push(onError);
|
|
276
|
+
}
|
|
262
277
|
}
|
|
263
278
|
else {
|
|
264
279
|
callback(RuntimeLoader.runtime);
|
|
265
280
|
}
|
|
266
281
|
};
|
|
267
|
-
// Provides a runtime instance via a promise
|
|
282
|
+
// Provides a runtime instance via a promise; rejects if WASM fails to load.
|
|
268
283
|
RuntimeLoader.awaitInstance = function () {
|
|
269
|
-
return new Promise(function (resolve) {
|
|
270
|
-
return RuntimeLoader.getInstance(
|
|
284
|
+
return new Promise(function (resolve, reject) {
|
|
285
|
+
return RuntimeLoader.getInstance(resolve, reject);
|
|
271
286
|
});
|
|
272
287
|
};
|
|
273
288
|
// Manually sets the wasm url
|
|
@@ -314,6 +329,8 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
314
329
|
// the fallback entirely. Defaults to pulling from the jsdelivr CDN.
|
|
315
330
|
RuntimeLoader.wasmFallbackURL = "https://cdn.jsdelivr.net/npm/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive_fallback.wasm");
|
|
316
331
|
RuntimeLoader.wasmBinary = null;
|
|
332
|
+
// Error callbacks enqueued from .getInstance()
|
|
333
|
+
RuntimeLoader.errorCallbackQueue = [];
|
|
317
334
|
/**
|
|
318
335
|
* When true, performance.mark / performance.measure entries are emitted for
|
|
319
336
|
* WASM initialization.
|
|
@@ -357,7 +374,7 @@ function fa() {
|
|
|
357
374
|
}
|
|
358
375
|
});
|
|
359
376
|
this.mb();
|
|
360
|
-
e && e.
|
|
377
|
+
e && e.Nb();
|
|
361
378
|
}
|
|
362
379
|
let b = 0, c = 0, d = new Map(), e = null, f = null;
|
|
363
380
|
this.requestAnimationFrame = function(g) {
|
|
@@ -370,14 +387,14 @@ function fa() {
|
|
|
370
387
|
d.delete(g);
|
|
371
388
|
b && 0 == d.size && (cancelAnimationFrame(b), b = 0);
|
|
372
389
|
};
|
|
373
|
-
this.
|
|
390
|
+
this.Lb = function(g) {
|
|
374
391
|
f && (document.body.remove(f), f = null);
|
|
375
392
|
g || (f = document.createElement("div"), f.style.backgroundColor = "black", f.style.position = "fixed", f.style.right = 0, f.style.top = 0, f.style.color = "white", f.style.padding = "4px", f.innerHTML = "RIVE FPS", g = function(k) {
|
|
376
393
|
f.innerHTML = "RIVE FPS " + k.toFixed(1);
|
|
377
394
|
}, document.body.appendChild(f));
|
|
378
395
|
e = new function() {
|
|
379
396
|
let k = 0, p = 0;
|
|
380
|
-
this.
|
|
397
|
+
this.Nb = function() {
|
|
381
398
|
var m = performance.now();
|
|
382
399
|
p ? (++k, m -= p, 1000 < m && (g(1000 * k / m), k = p = 0)) : (p = m, k = 0);
|
|
383
400
|
};
|
|
@@ -476,7 +493,7 @@ l.onRuntimeInitialized = function() {
|
|
|
476
493
|
function a(r) {
|
|
477
494
|
this.G = r;
|
|
478
495
|
this.Ab = r.getContext("2d");
|
|
479
|
-
this.
|
|
496
|
+
this.Eb = d;
|
|
480
497
|
this.S = [];
|
|
481
498
|
this.ja = 0;
|
|
482
499
|
this.clear = function() {
|
|
@@ -494,8 +511,8 @@ l.onRuntimeInitialized = function() {
|
|
|
494
511
|
this.transform = function(u) {
|
|
495
512
|
this.S.push(d.transform.bind(d, u));
|
|
496
513
|
};
|
|
497
|
-
this.align = function(u, z, A, C,
|
|
498
|
-
this.S.push(d.align.bind(d, u, z, A, C,
|
|
514
|
+
this.align = function(u, z, A, C, H = 1.0) {
|
|
515
|
+
this.S.push(d.align.bind(d, u, z, A, C, H));
|
|
499
516
|
};
|
|
500
517
|
this.flush = function() {
|
|
501
518
|
console.assert(0 == this.ja);
|
|
@@ -522,19 +539,19 @@ l.onRuntimeInitialized = function() {
|
|
|
522
539
|
var C = A.delete;
|
|
523
540
|
A.delete = function() {
|
|
524
541
|
C.call(this);
|
|
525
|
-
var
|
|
526
|
-
q === w[
|
|
527
|
-
"object" == typeof JSEvents && JSEvents.
|
|
528
|
-
w[
|
|
529
|
-
this.La = this.G = this.Ma = this.T = w[
|
|
542
|
+
var H = this.La;
|
|
543
|
+
q === w[H] && (q = null);
|
|
544
|
+
"object" == typeof JSEvents && JSEvents.Qc(w[H].F.canvas);
|
|
545
|
+
w[H] && w[H].F.canvas && (w[H].F.canvas.zb = void 0);
|
|
546
|
+
this.La = this.G = this.Ma = this.T = w[H] = null;
|
|
530
547
|
};
|
|
531
548
|
return A;
|
|
532
549
|
}
|
|
533
550
|
function c() {
|
|
534
551
|
if (d) {
|
|
535
|
-
var r = d.
|
|
552
|
+
var r = d.Db, u = 0, z = 0, A = 0, C = Array(e.size), H = 0;
|
|
536
553
|
for (var J of e) {
|
|
537
|
-
J.ea = Math.min(J.G.width, r), J.da = Math.min(J.G.height, r), J.Ja = J.da * J.ea, u = Math.max(u, J.ea), z = Math.max(z, J.da), A += J.Ja, C[
|
|
554
|
+
J.ea = Math.min(J.G.width, r), J.da = Math.min(J.G.height, r), J.Ja = J.da * J.ea, u = Math.max(u, J.ea), z = Math.max(z, J.da), A += J.Ja, C[H++] = J;
|
|
538
555
|
}
|
|
539
556
|
e.clear();
|
|
540
557
|
if (!(0 >= A)) {
|
|
@@ -548,10 +565,10 @@ l.onRuntimeInitialized = function() {
|
|
|
548
565
|
A = new l.DynamicRectanizer(r);
|
|
549
566
|
for (J = 0; J < C.length;) {
|
|
550
567
|
A.reset(u, z);
|
|
551
|
-
for (
|
|
552
|
-
var K = C[
|
|
568
|
+
for (H = J; H < C.length; ++H) {
|
|
569
|
+
var K = C[H], I = A.addRect(K.ea, K.da);
|
|
553
570
|
if (0 > I) {
|
|
554
|
-
console.assert(
|
|
571
|
+
console.assert(H > J);
|
|
555
572
|
break;
|
|
556
573
|
}
|
|
557
574
|
K.pa = I & 65535;
|
|
@@ -566,7 +583,7 @@ l.onRuntimeInitialized = function() {
|
|
|
566
583
|
d.G.width != K && (d.G.width = K);
|
|
567
584
|
d.G.height != I && (d.G.height = I);
|
|
568
585
|
d.clear();
|
|
569
|
-
for (K = J; K <
|
|
586
|
+
for (K = J; K < H; ++K) {
|
|
570
587
|
I = C[K];
|
|
571
588
|
d.saveClipRect(I.pa, I.qa, I.pa + I.ea, I.qa + I.da);
|
|
572
589
|
let Z = new l.Mat2D();
|
|
@@ -582,10 +599,10 @@ l.onRuntimeInitialized = function() {
|
|
|
582
599
|
d.restoreClipRect();
|
|
583
600
|
I.S = [];
|
|
584
601
|
}
|
|
585
|
-
for (d.flush(); J <
|
|
602
|
+
for (d.flush(); J < H; ++J) {
|
|
586
603
|
K = C[J], I = K.Ab, I.globalCompositeOperation = "copy", I.drawImage(d.G, K.pa, K.qa, K.ea, K.da, 0, 0, K.G.width, K.G.height);
|
|
587
604
|
}
|
|
588
|
-
J =
|
|
605
|
+
J = H;
|
|
589
606
|
}
|
|
590
607
|
}
|
|
591
608
|
}
|
|
@@ -600,8 +617,11 @@ l.onRuntimeInitialized = function() {
|
|
|
600
617
|
C.width = 1;
|
|
601
618
|
C.height = 1;
|
|
602
619
|
d = b(C, A);
|
|
620
|
+
if (!d) {
|
|
621
|
+
return null;
|
|
622
|
+
}
|
|
603
623
|
d.Ya = !!d.T.getExtension("WEBGL_shader_pixel_local_storage");
|
|
604
|
-
d.
|
|
624
|
+
d.Db = Math.min(d.T.getParameter(d.T.MAX_RENDERBUFFER_SIZE), d.T.getParameter(d.T.MAX_TEXTURE_SIZE));
|
|
605
625
|
d.Ka = !d.Ya;
|
|
606
626
|
if (A = d.T.getExtension("WEBGL_debug_renderer_info")) {
|
|
607
627
|
C = d.T.getParameter(A.UNMASKED_RENDERER_WEBGL), d.T.getParameter(A.UNMASKED_VENDOR_WEBGL).includes("Google") && C.includes("ANGLE Metal Renderer") && (d.Ka = !1);
|
|
@@ -609,25 +629,28 @@ l.onRuntimeInitialized = function() {
|
|
|
609
629
|
return d;
|
|
610
630
|
}
|
|
611
631
|
d = z(!0);
|
|
632
|
+
if (!d) {
|
|
633
|
+
throw "Unable to create WebGL context, your environment may not support WebGL. Try out @rive-app/canvas as an alternative.";
|
|
634
|
+
}
|
|
612
635
|
d.Ka || (d = z(!1));
|
|
613
636
|
}
|
|
614
637
|
return u ? new a(r) : b(r, d.Ka);
|
|
615
638
|
};
|
|
616
639
|
const g = l.Artboard.prototype["delete"];
|
|
617
640
|
l.Artboard.prototype["delete"] = function() {
|
|
618
|
-
this.
|
|
641
|
+
this.Fb = !0;
|
|
619
642
|
g.call(this);
|
|
620
643
|
};
|
|
621
644
|
const k = l.Artboard.prototype.draw;
|
|
622
645
|
l.Artboard.prototype.draw = function(r) {
|
|
623
646
|
r.S ? r.S.push(() => {
|
|
624
|
-
this.
|
|
647
|
+
this.Fb || k.call(this, r.Eb);
|
|
625
648
|
}) : k.call(this, r);
|
|
626
649
|
};
|
|
627
650
|
const p = new ha(), m = new ha(), t = new fa();
|
|
628
651
|
l.requestAnimationFrame = t.requestAnimationFrame.bind(t);
|
|
629
652
|
l.cancelAnimationFrame = t.cancelAnimationFrame.bind(t);
|
|
630
|
-
l.enableFPSCounter = t.
|
|
653
|
+
l.enableFPSCounter = t.Lb.bind(t);
|
|
631
654
|
t.mb = c;
|
|
632
655
|
l.resolveAnimationFrame = c;
|
|
633
656
|
let v = l.load;
|
|
@@ -684,7 +707,7 @@ ma = null;
|
|
|
684
707
|
l.thisProgram && (na = l.thisProgram);
|
|
685
708
|
var ta;
|
|
686
709
|
l.wasmBinary && (ta = l.wasmBinary);
|
|
687
|
-
var ua, va = !1, B, D, E, wa, F,
|
|
710
|
+
var ua, va = !1, B, D, E, wa, F, G, xa, ya;
|
|
688
711
|
function za() {
|
|
689
712
|
var a = ua.buffer;
|
|
690
713
|
l.HEAP8 = B = new Int8Array(a);
|
|
@@ -692,7 +715,7 @@ function za() {
|
|
|
692
715
|
l.HEAPU8 = D = new Uint8Array(a);
|
|
693
716
|
l.HEAPU16 = wa = new Uint16Array(a);
|
|
694
717
|
l.HEAP32 = F = new Int32Array(a);
|
|
695
|
-
l.HEAPU32 =
|
|
718
|
+
l.HEAPU32 = G = new Uint32Array(a);
|
|
696
719
|
l.HEAPF32 = xa = new Float32Array(a);
|
|
697
720
|
l.HEAPF64 = ya = new Float64Array(a);
|
|
698
721
|
}
|
|
@@ -746,7 +769,7 @@ function Na(a, b) {
|
|
|
746
769
|
return Ma(c, a, b);
|
|
747
770
|
}));
|
|
748
771
|
}
|
|
749
|
-
var Oa, Pa, Ta = {
|
|
772
|
+
var Oa, Pa, Ta = {569208:(a, b, c, d, e) => {
|
|
750
773
|
if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
|
|
751
774
|
return 0;
|
|
752
775
|
}
|
|
@@ -761,7 +784,7 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
|
|
|
761
784
|
window.h.ha.ub = e;
|
|
762
785
|
let f = window.h;
|
|
763
786
|
f.C = [];
|
|
764
|
-
f.
|
|
787
|
+
f.mc = function(g) {
|
|
765
788
|
for (var k = 0; k < f.C.length; ++k) {
|
|
766
789
|
if (null == f.C[k]) {
|
|
767
790
|
return f.C[k] = g, k;
|
|
@@ -779,7 +802,7 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
|
|
|
779
802
|
}
|
|
780
803
|
}
|
|
781
804
|
};
|
|
782
|
-
f.
|
|
805
|
+
f.Tc = function(g) {
|
|
783
806
|
for (var k = 0; k < f.C.length; ++k) {
|
|
784
807
|
if (f.C[k] == g) {
|
|
785
808
|
return f.yb(k);
|
|
@@ -809,11 +832,11 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
|
|
|
809
832
|
}
|
|
810
833
|
window.h.Ea += 1;
|
|
811
834
|
return 1;
|
|
812
|
-
},
|
|
835
|
+
}, 571386:() => {
|
|
813
836
|
"undefined" !== typeof window.h && (window.h.Xa.map(function(a) {
|
|
814
837
|
document.removeEventListener(a, window.h.unlock, !0);
|
|
815
838
|
}), --window.h.Ea, 0 === window.h.Ea && delete window.h);
|
|
816
|
-
},
|
|
839
|
+
}, 571690:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 571794:() => {
|
|
817
840
|
try {
|
|
818
841
|
var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
|
|
819
842
|
a.close();
|
|
@@ -821,7 +844,7 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
|
|
|
821
844
|
} catch (c) {
|
|
822
845
|
return 0;
|
|
823
846
|
}
|
|
824
|
-
},
|
|
847
|
+
}, 571965:(a, b, c, d, e, f) => {
|
|
825
848
|
if ("undefined" === typeof window.h) {
|
|
826
849
|
return -1;
|
|
827
850
|
}
|
|
@@ -866,8 +889,8 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
|
|
|
866
889
|
});
|
|
867
890
|
a == window.h.I.Ba && g.Y.connect(g.K.destination);
|
|
868
891
|
g.nb = f;
|
|
869
|
-
return window.h.
|
|
870
|
-
},
|
|
892
|
+
return window.h.mc(g);
|
|
893
|
+
}, 574842:a => window.h.sa(a).K.sampleRate, 574915:a => {
|
|
871
894
|
a = window.h.sa(a);
|
|
872
895
|
void 0 !== a.Y && (a.Y.onaudioprocess = function() {
|
|
873
896
|
}, a.Y.disconnect(), a.Y = void 0);
|
|
@@ -875,13 +898,13 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
|
|
|
875
898
|
a.K.close();
|
|
876
899
|
a.K = void 0;
|
|
877
900
|
a.nb = void 0;
|
|
878
|
-
},
|
|
901
|
+
}, 575315:a => {
|
|
879
902
|
window.h.yb(a);
|
|
880
|
-
},
|
|
903
|
+
}, 575365:a => {
|
|
881
904
|
a = window.h.sa(a);
|
|
882
905
|
a.K.resume();
|
|
883
906
|
a.state = window.h.ha.ub;
|
|
884
|
-
},
|
|
907
|
+
}, 575504:a => {
|
|
885
908
|
a = window.h.sa(a);
|
|
886
909
|
a.K.suspend();
|
|
887
910
|
a.state = window.h.ha.stopped;
|
|
@@ -1095,11 +1118,11 @@ var lb = {open(a) {
|
|
|
1095
1118
|
null === b || 10 === b ? (ra(L(a.H, 0)), a.H = []) : 0 != b && a.H.push(b);
|
|
1096
1119
|
}, ra(a) {
|
|
1097
1120
|
a.H && 0 < a.H.length && (ra(L(a.H, 0)), a.H = []);
|
|
1098
|
-
}, Vb() {
|
|
1099
|
-
return {sc:25856, uc:5, rc:191, tc:35387, qc:[3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]};
|
|
1100
1121
|
}, Wb() {
|
|
1101
|
-
return 0;
|
|
1122
|
+
return {xc:25856, zc:5, wc:191, yc:35387, vc:[3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]};
|
|
1102
1123
|
}, Xb() {
|
|
1124
|
+
return 0;
|
|
1125
|
+
}, Yb() {
|
|
1103
1126
|
return [24, 80];
|
|
1104
1127
|
},}, nb = {Sa(a, b) {
|
|
1105
1128
|
null === b || 10 === b ? (sa(L(a.H, 0)), a.H = []) : 0 != b && a.H.push(b);
|
|
@@ -1122,23 +1145,23 @@ var N = {N:null, U() {
|
|
|
1122
1145
|
c.timestamp = Date.now();
|
|
1123
1146
|
a && (a.l[b] = c, a.timestamp = c.timestamp);
|
|
1124
1147
|
return c;
|
|
1125
|
-
},
|
|
1148
|
+
}, Fc(a) {
|
|
1126
1149
|
return a.l ? a.l.subarray ? a.l.subarray(0, a.v) : new Uint8Array(a.l) : new Uint8Array(0);
|
|
1127
1150
|
}, j:{X(a) {
|
|
1128
1151
|
var b = {};
|
|
1129
|
-
b.
|
|
1130
|
-
b.
|
|
1152
|
+
b.Cc = 8192 === (a.mode & 61440) ? a.id : 1;
|
|
1153
|
+
b.Hc = a.id;
|
|
1131
1154
|
b.mode = a.mode;
|
|
1132
|
-
b.
|
|
1155
|
+
b.Nc = 1;
|
|
1133
1156
|
b.uid = 0;
|
|
1134
|
-
b.
|
|
1157
|
+
b.Gc = 0;
|
|
1135
1158
|
b.Da = a.Da;
|
|
1136
1159
|
16384 === (a.mode & 61440) ? b.size = 4096 : 32768 === (a.mode & 61440) ? b.size = a.v : 40960 === (a.mode & 61440) ? b.size = a.link.length : b.size = 0;
|
|
1137
|
-
b.
|
|
1138
|
-
b.
|
|
1139
|
-
b.
|
|
1140
|
-
b.
|
|
1141
|
-
b.
|
|
1160
|
+
b.tc = new Date(a.timestamp);
|
|
1161
|
+
b.Mc = new Date(a.timestamp);
|
|
1162
|
+
b.Ac = new Date(a.timestamp);
|
|
1163
|
+
b.Gb = 4096;
|
|
1164
|
+
b.uc = Math.ceil(b.size / b.Gb);
|
|
1142
1165
|
return b;
|
|
1143
1166
|
}, P(a, b) {
|
|
1144
1167
|
void 0 !== b.mode && (a.mode = b.mode);
|
|
@@ -1269,7 +1292,7 @@ var N = {N:null, U() {
|
|
|
1269
1292
|
} else {
|
|
1270
1293
|
c = !1, b = a.byteOffset;
|
|
1271
1294
|
}
|
|
1272
|
-
return {o:b,
|
|
1295
|
+
return {o:b, sc:c};
|
|
1273
1296
|
}, lb(a, b, c, d) {
|
|
1274
1297
|
N.m.write(a, b, 0, d, c, !1);
|
|
1275
1298
|
return 0;
|
|
@@ -1374,7 +1397,7 @@ function tb(a, b) {
|
|
|
1374
1397
|
if (c) {
|
|
1375
1398
|
throw new M(c);
|
|
1376
1399
|
}
|
|
1377
|
-
for (c = zb[Gb(a.id, b)]; c; c = c
|
|
1400
|
+
for (c = zb[Gb(a.id, b)]; c; c = c.ac) {
|
|
1378
1401
|
var d = c.name;
|
|
1379
1402
|
if (c.parent.id === a.id && d === b) {
|
|
1380
1403
|
return c;
|
|
@@ -1385,7 +1408,7 @@ function tb(a, b) {
|
|
|
1385
1408
|
function rb(a, b, c, d) {
|
|
1386
1409
|
a = new Cb(a, b, c, d);
|
|
1387
1410
|
b = Gb(a.parent.id, a.name);
|
|
1388
|
-
a
|
|
1411
|
+
a.ac = zb[b];
|
|
1389
1412
|
return zb[b] = a;
|
|
1390
1413
|
}
|
|
1391
1414
|
function Ib(a) {
|
|
@@ -1437,7 +1460,7 @@ function Lb(a, b = -1) {
|
|
|
1437
1460
|
}
|
|
1438
1461
|
function Mb(a, b = -1) {
|
|
1439
1462
|
a = Lb(a, b);
|
|
1440
|
-
a.m?.
|
|
1463
|
+
a.m?.Ec?.(a);
|
|
1441
1464
|
return a;
|
|
1442
1465
|
}
|
|
1443
1466
|
var qb = {open(a) {
|
|
@@ -1465,11 +1488,11 @@ function Nb(a, b) {
|
|
|
1465
1488
|
throw new M(54);
|
|
1466
1489
|
}
|
|
1467
1490
|
}
|
|
1468
|
-
b = {type:a,
|
|
1491
|
+
b = {type:a, Pc:{}, kb:b, Zb:[]};
|
|
1469
1492
|
a = a.U(b);
|
|
1470
1493
|
a.U = b;
|
|
1471
1494
|
b.root = a;
|
|
1472
|
-
c ? vb = a : d && (d.Aa = b, d.U && d.U.
|
|
1495
|
+
c ? vb = a : d && (d.Aa = b, d.U && d.U.Zb.push(b));
|
|
1473
1496
|
}
|
|
1474
1497
|
function Ob(a, b, c) {
|
|
1475
1498
|
var d = Db(a, {parent:!0}).node;
|
|
@@ -1580,7 +1603,7 @@ function Sb(a, b, c) {
|
|
|
1580
1603
|
c.j.P(c, {size:0, timestamp:Date.now()});
|
|
1581
1604
|
}
|
|
1582
1605
|
b &= -131713;
|
|
1583
|
-
e = Lb({node:e, path:Fb(e), flags:b, seekable:!0, position:0, m:e.m,
|
|
1606
|
+
e = Lb({node:e, path:Fb(e), flags:b, seekable:!0, position:0, m:e.m, nc:[], error:!1});
|
|
1584
1607
|
e.m.open && e.m.open(e);
|
|
1585
1608
|
!l.logReadFiles || b & 1 || (Tb ||= {}, a in Tb || (Tb[a] = 1));
|
|
1586
1609
|
return e;
|
|
@@ -1596,7 +1619,7 @@ function Ub(a, b, c) {
|
|
|
1596
1619
|
throw new M(28);
|
|
1597
1620
|
}
|
|
1598
1621
|
a.position = a.m.aa(a, b, c);
|
|
1599
|
-
a.
|
|
1622
|
+
a.nc = [];
|
|
1600
1623
|
}
|
|
1601
1624
|
var Vb;
|
|
1602
1625
|
function Wb(a, b, c) {
|
|
@@ -1712,7 +1735,7 @@ var Xb, Yb = {}, Tb, Wa = void 0, Zb = (a, b) => Object.defineProperty(b, "name"
|
|
|
1712
1735
|
return null;
|
|
1713
1736
|
}
|
|
1714
1737
|
a = qc(a, b, c.B);
|
|
1715
|
-
return null === a ? null : c.
|
|
1738
|
+
return null === a ? null : c.Jb(a);
|
|
1716
1739
|
}, rc = {}, sc = (a, b) => {
|
|
1717
1740
|
b = ic(a, b);
|
|
1718
1741
|
return hc[b];
|
|
@@ -1750,7 +1773,7 @@ var Xb, Yb = {}, Tb, Wa = void 0, Zb = (a, b) => Object.defineProperty(b, "name"
|
|
|
1750
1773
|
}
|
|
1751
1774
|
};
|
|
1752
1775
|
function yc(a) {
|
|
1753
|
-
return this.fromWireType(
|
|
1776
|
+
return this.fromWireType(G[a >> 2]);
|
|
1754
1777
|
}
|
|
1755
1778
|
var zc = {}, Ac = {}, T = (a, b, c) => {
|
|
1756
1779
|
function d(k) {
|
|
@@ -1781,7 +1804,7 @@ function Bc(a, b, c = {}) {
|
|
|
1781
1804
|
throw new P(`type "${d}" must have a positive integer typeid pointer`);
|
|
1782
1805
|
}
|
|
1783
1806
|
if (jc.hasOwnProperty(a)) {
|
|
1784
|
-
if (c.
|
|
1807
|
+
if (c.Tb) {
|
|
1785
1808
|
return;
|
|
1786
1809
|
}
|
|
1787
1810
|
throw new P(`Cannot register type '${d}' twice`);
|
|
@@ -1824,7 +1847,7 @@ var Ec = (a, b, c) => {
|
|
|
1824
1847
|
}
|
|
1825
1848
|
l[a].A[c] = b;
|
|
1826
1849
|
} else {
|
|
1827
|
-
l[a] = b, void 0 !== c && (l[a].
|
|
1850
|
+
l[a] = b, void 0 !== c && (l[a].Oc = c);
|
|
1828
1851
|
}
|
|
1829
1852
|
}, Gc = a => {
|
|
1830
1853
|
if (void 0 === a) {
|
|
@@ -1840,9 +1863,9 @@ function Hc(a, b, c, d, e, f, g, k) {
|
|
|
1840
1863
|
this.M = c;
|
|
1841
1864
|
this.O = d;
|
|
1842
1865
|
this.B = e;
|
|
1843
|
-
this.
|
|
1866
|
+
this.Ob = f;
|
|
1844
1867
|
this.na = g;
|
|
1845
|
-
this.
|
|
1868
|
+
this.Jb = k;
|
|
1846
1869
|
this.ob = [];
|
|
1847
1870
|
}
|
|
1848
1871
|
var Ic = (a, b, c) => {
|
|
@@ -1896,7 +1919,7 @@ function Lc(a, b) {
|
|
|
1896
1919
|
if (void 0 === b.g.D) {
|
|
1897
1920
|
throw new P("Passing raw pointer to smart pointer is illegal");
|
|
1898
1921
|
}
|
|
1899
|
-
switch(this.
|
|
1922
|
+
switch(this.hc) {
|
|
1900
1923
|
case 0:
|
|
1901
1924
|
if (b.g.J === this) {
|
|
1902
1925
|
c = b.g.D;
|
|
@@ -1912,7 +1935,7 @@ function Lc(a, b) {
|
|
|
1912
1935
|
c = b.g.D;
|
|
1913
1936
|
} else {
|
|
1914
1937
|
var d = b.clone();
|
|
1915
|
-
c = this.
|
|
1938
|
+
c = this.cc(c, ac(() => d["delete"]()));
|
|
1916
1939
|
null !== a && a.push(this.O, c);
|
|
1917
1940
|
}
|
|
1918
1941
|
break;
|
|
@@ -1946,11 +1969,11 @@ function Nc(a, b, c, d, e, f, g, k, p, m, t) {
|
|
|
1946
1969
|
this.Ra = c;
|
|
1947
1970
|
this.ua = d;
|
|
1948
1971
|
this.va = e;
|
|
1949
|
-
this.
|
|
1950
|
-
this.
|
|
1972
|
+
this.bc = f;
|
|
1973
|
+
this.hc = g;
|
|
1951
1974
|
this.qb = k;
|
|
1952
1975
|
this.Ta = p;
|
|
1953
|
-
this.
|
|
1976
|
+
this.cc = m;
|
|
1954
1977
|
this.O = t;
|
|
1955
1978
|
e || void 0 !== b.B ? this.toWireType = Lc : (this.toWireType = d ? Jc : Mc, this.L = null);
|
|
1956
1979
|
}
|
|
@@ -2024,7 +2047,7 @@ function Xc(a, b, c, d, e) {
|
|
|
2024
2047
|
}
|
|
2025
2048
|
var Yc = (a, b) => {
|
|
2026
2049
|
for (var c = [], d = 0; d < a; d++) {
|
|
2027
|
-
c.push(
|
|
2050
|
+
c.push(G[b + 4 * d >> 2]);
|
|
2028
2051
|
}
|
|
2029
2052
|
return c;
|
|
2030
2053
|
}, Zc = a => {
|
|
@@ -2066,7 +2089,7 @@ var Yc = (a, b) => {
|
|
|
2066
2089
|
return c ? function(d) {
|
|
2067
2090
|
return this.fromWireType(F[d >> 2]);
|
|
2068
2091
|
} : function(d) {
|
|
2069
|
-
return this.fromWireType(
|
|
2092
|
+
return this.fromWireType(G[d >> 2]);
|
|
2070
2093
|
};
|
|
2071
2094
|
default:
|
|
2072
2095
|
throw new TypeError(`invalid integer width (${b}): ${a}`);
|
|
@@ -2097,7 +2120,7 @@ var Yc = (a, b) => {
|
|
|
2097
2120
|
case 2:
|
|
2098
2121
|
return c ? d => E[d >> 1] : d => wa[d >> 1];
|
|
2099
2122
|
case 4:
|
|
2100
|
-
return c ? d => F[d >> 2] : d =>
|
|
2123
|
+
return c ? d => F[d >> 2] : d => G[d >> 2];
|
|
2101
2124
|
default:
|
|
2102
2125
|
throw new TypeError(`invalid integer width (${b}): ${a}`);
|
|
2103
2126
|
}
|
|
@@ -2173,7 +2196,7 @@ var Yc = (a, b) => {
|
|
|
2173
2196
|
}, nd = (a, b, c) => {
|
|
2174
2197
|
var d = [];
|
|
2175
2198
|
a = a.toWireType(d, c);
|
|
2176
|
-
d.length && (
|
|
2199
|
+
d.length && (G[b >> 2] = ac(d));
|
|
2177
2200
|
return a;
|
|
2178
2201
|
}, od = [], pd = {}, qd = a => {
|
|
2179
2202
|
var b = pd[a];
|
|
@@ -2184,13 +2207,13 @@ var Yc = (a, b) => {
|
|
|
2184
2207
|
return b;
|
|
2185
2208
|
}, sd = (a, b) => {
|
|
2186
2209
|
for (var c = Array(a), d = 0; d < a; ++d) {
|
|
2187
|
-
c[d] = nc(
|
|
2210
|
+
c[d] = nc(G[b + 4 * d >> 2], "parameter " + d);
|
|
2188
2211
|
}
|
|
2189
2212
|
return c;
|
|
2190
2213
|
}, td = Reflect.construct, ud = a => 0 === a % 4 && (0 !== a % 100 || 0 === a % 400), vd = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], wd = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], xd = [], yd = a => {
|
|
2191
|
-
a.
|
|
2214
|
+
a.Dc = a.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");
|
|
2192
2215
|
}, zd = a => {
|
|
2193
|
-
a.
|
|
2216
|
+
a.Lc = a.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");
|
|
2194
2217
|
}, Ad = a => {
|
|
2195
2218
|
var b = "EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw".split(" ");
|
|
2196
2219
|
return (a.getSupportedExtensions() || []).filter(c => b.includes(c));
|
|
@@ -2206,19 +2229,19 @@ var Yc = (a, b) => {
|
|
|
2206
2229
|
F[b + 4 * e >> 2] = g;
|
|
2207
2230
|
}
|
|
2208
2231
|
}, ka = (a, b) => {
|
|
2209
|
-
var c = Ld(w), d = {handle:c, attributes:b, version:b.
|
|
2232
|
+
var c = Ld(w), d = {handle:c, attributes:b, version:b.Kc, F:a};
|
|
2210
2233
|
a.canvas && (a.canvas.zb = d);
|
|
2211
2234
|
w[c] = d;
|
|
2212
|
-
("undefined" == typeof b.
|
|
2235
|
+
("undefined" == typeof b.Kb || b.Kb) && Nd(d);
|
|
2213
2236
|
return c;
|
|
2214
2237
|
}, la = a => {
|
|
2215
2238
|
q = w[a];
|
|
2216
|
-
l.
|
|
2239
|
+
l.Bc = W = q?.F;
|
|
2217
2240
|
return !(a && !W);
|
|
2218
2241
|
}, Nd = a => {
|
|
2219
2242
|
a ||= q;
|
|
2220
|
-
if (!a.
|
|
2221
|
-
a.
|
|
2243
|
+
if (!a.Ub) {
|
|
2244
|
+
a.Ub = !0;
|
|
2222
2245
|
var b = a.F;
|
|
2223
2246
|
yd(b);
|
|
2224
2247
|
zd(b);
|
|
@@ -2226,7 +2249,7 @@ var Yc = (a, b) => {
|
|
|
2226
2249
|
if (2 > a.version || !b.cb) {
|
|
2227
2250
|
b.cb = b.getExtension("EXT_disjoint_timer_query");
|
|
2228
2251
|
}
|
|
2229
|
-
b
|
|
2252
|
+
b.$b = b.getExtension("WEBGL_multi_draw");
|
|
2230
2253
|
Ad(b).forEach(c => {
|
|
2231
2254
|
c.includes("lose_context") || c.includes("debug") || b.getExtension(c);
|
|
2232
2255
|
});
|
|
@@ -2352,7 +2375,7 @@ var Td = (a, b) => {
|
|
|
2352
2375
|
return c;
|
|
2353
2376
|
}, Wd = a => "]" == a.slice(-1) && a.lastIndexOf("["), Xd = a => {
|
|
2354
2377
|
a -= 5120;
|
|
2355
|
-
return 0 == a ? B : 1 == a ? D : 2 == a ? E : 4 == a ? F : 6 == a ? xa : 5 == a || 28922 == a || 28520 == a || 30779 == a || 30782 == a ?
|
|
2378
|
+
return 0 == a ? B : 1 == a ? D : 2 == a ? E : 4 == a ? F : 6 == a ? xa : 5 == a || 28922 == a || 28520 == a || 30779 == a || 30782 == a ? G : wa;
|
|
2356
2379
|
}, Yd = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Zd = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], $d = (a, b, c, d) => {
|
|
2357
2380
|
function e(n, r, u) {
|
|
2358
2381
|
for (n = "number" == typeof n ? n.toString() : n || ""; n.length < r;) {
|
|
@@ -2405,8 +2428,8 @@ var Td = (a, b) => {
|
|
|
2405
2428
|
u = k(u);
|
|
2406
2429
|
return 0 >= g(r, n) ? 0 >= g(u, n) ? n.getFullYear() + 1 : n.getFullYear() : n.getFullYear() - 1;
|
|
2407
2430
|
}
|
|
2408
|
-
var m =
|
|
2409
|
-
d = {
|
|
2431
|
+
var m = G[d + 40 >> 2];
|
|
2432
|
+
d = {kc:F[d >> 2], jc:F[d + 4 >> 2], Ha:F[d + 8 >> 2], Va:F[d + 12 >> 2], Ia:F[d + 16 >> 2], ca:F[d + 20 >> 2], R:F[d + 24 >> 2], ba:F[d + 28 >> 2], Sc:F[d + 32 >> 2], ic:F[d + 36 >> 2], lc:m ? m ? L(D, m) : "" : ""};
|
|
2410
2433
|
c = c ? L(D, c) : "";
|
|
2411
2434
|
m = {"%c":"%a %b %d %H:%M:%S %Y", "%D":"%m/%d/%y", "%F":"%Y-%m-%d", "%h":"%b", "%r":"%I:%M:%S %p", "%R":"%H:%M", "%T":"%H:%M:%S", "%x":"%m/%d/%y", "%X":"%H:%M:%S", "%Ec":"%c", "%EC":"%C", "%Ex":"%m/%d/%y", "%EX":"%H:%M:%S", "%Ey":"%y", "%EY":"%Y", "%Od":"%d", "%Oe":"%e", "%OH":"%H", "%OI":"%I", "%Om":"%m", "%OM":"%M", "%OS":"%S", "%Ou":"%u", "%OU":"%U", "%OV":"%V", "%Ow":"%w", "%OW":"%W", "%Oy":"%y",};
|
|
2412
2435
|
for (var t in m) {
|
|
@@ -2421,7 +2444,7 @@ var Td = (a, b) => {
|
|
|
2421
2444
|
for (var r = 0, u = 0; u <= n.Ia - 1; r += (ud(n.ca + 1900) ? Yd : Zd)[u++]) {
|
|
2422
2445
|
}
|
|
2423
2446
|
return f(n.Va + r, 3);
|
|
2424
|
-
}, "%m":n => f(n.Ia + 1, 2), "%M":n => f(n.
|
|
2447
|
+
}, "%m":n => f(n.Ia + 1, 2), "%M":n => f(n.jc, 2), "%n":() => "\n", "%p":n => 0 <= n.Ha && 12 > n.Ha ? "AM" : "PM", "%S":n => f(n.kc, 2), "%t":() => "\t", "%u":n => n.R || 7, "%U":n => f(Math.floor((n.ba + 7 - n.R) / 7), 2), "%V":n => {
|
|
2425
2448
|
var r = Math.floor((n.ba + 7 - (n.R + 6) % 7) / 7);
|
|
2426
2449
|
2 >= (n.R + 371 - n.ba - 2) % 7 && r++;
|
|
2427
2450
|
if (r) {
|
|
@@ -2433,11 +2456,11 @@ var Td = (a, b) => {
|
|
|
2433
2456
|
}
|
|
2434
2457
|
return f(r, 2);
|
|
2435
2458
|
}, "%w":n => n.R, "%W":n => f(Math.floor((n.ba + 7 - (n.R + 6) % 7) / 7), 2), "%y":n => (n.ca + 1900).toString().substring(2), "%Y":n => n.ca + 1900, "%z":n => {
|
|
2436
|
-
n = n.
|
|
2459
|
+
n = n.ic;
|
|
2437
2460
|
var r = 0 <= n;
|
|
2438
2461
|
n = Math.abs(n) / 60;
|
|
2439
2462
|
return (r ? "+" : "-") + String("0000" + (n / 60 * 100 + n % 60)).slice(-4);
|
|
2440
|
-
}, "%Z":n => n.
|
|
2463
|
+
}, "%Z":n => n.lc, "%%":() => "%"};
|
|
2441
2464
|
c = c.replace(/%%/g, "\x00\x00");
|
|
2442
2465
|
for (t in m) {
|
|
2443
2466
|
c.includes(t) && (c = c.replace(new RegExp(t, "g"), m[t](d)));
|
|
@@ -2568,16 +2591,16 @@ Object.assign(Dc.prototype, {isAliasOf:function(a) {
|
|
|
2568
2591
|
this.g.ga = !0;
|
|
2569
2592
|
return this;
|
|
2570
2593
|
},});
|
|
2571
|
-
Object.assign(Nc.prototype, {
|
|
2594
|
+
Object.assign(Nc.prototype, {Pb(a) {
|
|
2572
2595
|
this.qb && (a = this.qb(a));
|
|
2573
2596
|
return a;
|
|
2574
2597
|
}, bb(a) {
|
|
2575
2598
|
this.O?.(a);
|
|
2576
2599
|
}, argPackAdvance:8, readValueFromPointer:yc, fromWireType:function(a) {
|
|
2577
2600
|
function b() {
|
|
2578
|
-
return this.va ? vc(this.i.M, {u:this.
|
|
2601
|
+
return this.va ? vc(this.i.M, {u:this.bc, o:c, J:this, D:a,}) : vc(this.i.M, {u:this, o:a,});
|
|
2579
2602
|
}
|
|
2580
|
-
var c = this.
|
|
2603
|
+
var c = this.Pb(a);
|
|
2581
2604
|
if (!c) {
|
|
2582
2605
|
return this.bb(a), null;
|
|
2583
2606
|
}
|
|
@@ -2590,12 +2613,12 @@ Object.assign(Nc.prototype, {Ob(a) {
|
|
|
2590
2613
|
this.bb(a);
|
|
2591
2614
|
return d;
|
|
2592
2615
|
}
|
|
2593
|
-
d = this.i.
|
|
2616
|
+
d = this.i.Ob(c);
|
|
2594
2617
|
d = rc[d];
|
|
2595
2618
|
if (!d) {
|
|
2596
2619
|
return b.call(this);
|
|
2597
2620
|
}
|
|
2598
|
-
d = this.ua ? d.
|
|
2621
|
+
d = this.ua ? d.Hb : d.pointerType;
|
|
2599
2622
|
var e = qc(c, this.i, d.i);
|
|
2600
2623
|
return null === e ? b.call(this) : this.va ? vc(d.i.M, {u:d, o:e, J:this, D:a,}) : vc(d.i.M, {u:d, o:e,});
|
|
2601
2624
|
},});
|
|
@@ -2648,7 +2671,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2648
2671
|
if (!d.s) {
|
|
2649
2672
|
return -59;
|
|
2650
2673
|
}
|
|
2651
|
-
if (d.s.V.
|
|
2674
|
+
if (d.s.V.Wb) {
|
|
2652
2675
|
a = [3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,];
|
|
2653
2676
|
var e = Va();
|
|
2654
2677
|
F[e >> 2] = 25856;
|
|
@@ -2670,7 +2693,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2670
2693
|
if (!d.s) {
|
|
2671
2694
|
return -59;
|
|
2672
2695
|
}
|
|
2673
|
-
if (d.s.V.
|
|
2696
|
+
if (d.s.V.Xb) {
|
|
2674
2697
|
for (e = Va(), a = [], f = 0; 32 > f; f++) {
|
|
2675
2698
|
a.push(B[e + f + 17]);
|
|
2676
2699
|
}
|
|
@@ -2686,15 +2709,15 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2686
2709
|
return d.s ? -28 : -59;
|
|
2687
2710
|
case 21531:
|
|
2688
2711
|
e = Va();
|
|
2689
|
-
if (!d.m.
|
|
2712
|
+
if (!d.m.Vb) {
|
|
2690
2713
|
throw new M(59);
|
|
2691
2714
|
}
|
|
2692
|
-
return d.m.
|
|
2715
|
+
return d.m.Vb(d, b, e);
|
|
2693
2716
|
case 21523:
|
|
2694
2717
|
if (!d.s) {
|
|
2695
2718
|
return -59;
|
|
2696
2719
|
}
|
|
2697
|
-
d.s.V.
|
|
2720
|
+
d.s.V.Yb && (f = [24, 80], e = Va(), E[e >> 1] = f[0], E[e + 2 >> 1] = f[1]);
|
|
2698
2721
|
return 0;
|
|
2699
2722
|
case 21524:
|
|
2700
2723
|
return d.s ? 0 : -59;
|
|
@@ -2784,12 +2807,12 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2784
2807
|
}, _embind_finalize_value_object:a => {
|
|
2785
2808
|
var b = wc[a];
|
|
2786
2809
|
delete wc[a];
|
|
2787
|
-
var c = b.Ta, d = b.O, e = b.eb, f = e.map(g => g.
|
|
2810
|
+
var c = b.Ta, d = b.O, e = b.eb, f = e.map(g => g.Sb).concat(e.map(g => g.ec));
|
|
2788
2811
|
T([a], f, g => {
|
|
2789
2812
|
var k = {};
|
|
2790
2813
|
e.forEach((p, m) => {
|
|
2791
|
-
var t = g[m], v = p.
|
|
2792
|
-
k[p.
|
|
2814
|
+
var t = g[m], v = p.Qb, x = p.Rb, n = g[m + e.length], r = p.dc, u = p.fc;
|
|
2815
|
+
k[p.Mb] = {read:z => t.fromWireType(v(x, z)), write:(z, A) => {
|
|
2793
2816
|
var C = [];
|
|
2794
2817
|
r(u, z, n.toWireType(C, A));
|
|
2795
2818
|
xc(C);
|
|
@@ -2861,16 +2884,16 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2861
2884
|
r.prototype = A;
|
|
2862
2885
|
var C = new Hc(t, r, A, x, u, f, k, m);
|
|
2863
2886
|
if (C.B) {
|
|
2864
|
-
var
|
|
2865
|
-
(
|
|
2887
|
+
var H;
|
|
2888
|
+
(H = C.B).oa ?? (H.oa = []);
|
|
2866
2889
|
C.B.oa.push(C);
|
|
2867
2890
|
}
|
|
2868
2891
|
u = new Nc(t, C, !0, !1, !1);
|
|
2869
|
-
|
|
2892
|
+
H = new Nc(t + "*", C, !1, !1, !1);
|
|
2870
2893
|
z = new Nc(t + " const*", C, !1, !0, !1);
|
|
2871
|
-
rc[a] = {pointerType:
|
|
2894
|
+
rc[a] = {pointerType:H, Hb:z};
|
|
2872
2895
|
Oc(n, r);
|
|
2873
|
-
return [u,
|
|
2896
|
+
return [u, H, z];
|
|
2874
2897
|
});
|
|
2875
2898
|
}, _embind_register_class_class_function:(a, b, c, d, e, f, g) => {
|
|
2876
2899
|
var k = Yc(c, d);
|
|
@@ -2990,9 +3013,9 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2990
3013
|
p = U(k, p);
|
|
2991
3014
|
var z = n[1];
|
|
2992
3015
|
u.set = function(A) {
|
|
2993
|
-
var C = $c(this, t, v + " setter"),
|
|
2994
|
-
p(m, C, z.toWireType(
|
|
2995
|
-
xc(
|
|
3016
|
+
var C = $c(this, t, v + " setter"), H = [];
|
|
3017
|
+
p(m, C, z.toWireType(H, A));
|
|
3018
|
+
xc(H);
|
|
2996
3019
|
};
|
|
2997
3020
|
}
|
|
2998
3021
|
Object.defineProperty(t.i.M, b, u);
|
|
@@ -3048,16 +3071,16 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3048
3071
|
S(a, {name:b, fromWireType:e, toWireType:g, argPackAdvance:8, readValueFromPointer:ed(b, c, 0 !== d), L:null,});
|
|
3049
3072
|
}, _embind_register_memory_view:(a, b, c) => {
|
|
3050
3073
|
function d(f) {
|
|
3051
|
-
return new e(B.buffer,
|
|
3074
|
+
return new e(B.buffer, G[f + 4 >> 2], G[f >> 2]);
|
|
3052
3075
|
}
|
|
3053
3076
|
var e = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array,][b];
|
|
3054
3077
|
c = R(c);
|
|
3055
|
-
S(a, {name:c, fromWireType:d, argPackAdvance:8, readValueFromPointer:d,}, {
|
|
3078
|
+
S(a, {name:c, fromWireType:d, argPackAdvance:8, readValueFromPointer:d,}, {Tb:!0,});
|
|
3056
3079
|
}, _embind_register_std_string:(a, b) => {
|
|
3057
3080
|
b = R(b);
|
|
3058
3081
|
var c = "std::string" === b;
|
|
3059
3082
|
S(a, {name:b, fromWireType:function(d) {
|
|
3060
|
-
var e =
|
|
3083
|
+
var e = G[d >> 2], f = d + 4;
|
|
3061
3084
|
if (c) {
|
|
3062
3085
|
for (var g = f, k = 0; k <= e; ++k) {
|
|
3063
3086
|
var p = f + k;
|
|
@@ -3088,7 +3111,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3088
3111
|
}
|
|
3089
3112
|
var g = c && f ? fb(e) : e.length;
|
|
3090
3113
|
var k = Ud(4 + g + 1), p = k + 4;
|
|
3091
|
-
|
|
3114
|
+
G[k >> 2] = g;
|
|
3092
3115
|
if (c && f) {
|
|
3093
3116
|
gb(e, D, p, g + 1);
|
|
3094
3117
|
} else {
|
|
@@ -3119,10 +3142,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3119
3142
|
var f = jd;
|
|
3120
3143
|
var g = k => wa[k >> 1];
|
|
3121
3144
|
} else {
|
|
3122
|
-
4 === b && (d = kd, e = ld, f = md, g = k =>
|
|
3145
|
+
4 === b && (d = kd, e = ld, f = md, g = k => G[k >> 2]);
|
|
3123
3146
|
}
|
|
3124
3147
|
S(a, {name:c, fromWireType:k => {
|
|
3125
|
-
for (var p =
|
|
3148
|
+
for (var p = G[k >> 2], m, t = k + 4, v = 0; v <= p; ++v) {
|
|
3126
3149
|
var x = k + 4 + v * b;
|
|
3127
3150
|
if (v == p || 0 == g(x)) {
|
|
3128
3151
|
t = d(t, x - t), void 0 === m ? m = t : (m += String.fromCharCode(0), m += t), t = x + b;
|
|
@@ -3135,7 +3158,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3135
3158
|
throw new P(`Cannot pass non-string to C++ string type ${c}`);
|
|
3136
3159
|
}
|
|
3137
3160
|
var m = f(p), t = Ud(4 + m + b);
|
|
3138
|
-
|
|
3161
|
+
G[t >> 2] = m / b;
|
|
3139
3162
|
e(p, t + 4, m + b);
|
|
3140
3163
|
null !== k && k.push(lc, t);
|
|
3141
3164
|
return t;
|
|
@@ -3145,10 +3168,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3145
3168
|
}, _embind_register_value_object:(a, b, c, d, e, f) => {
|
|
3146
3169
|
wc[a] = {name:R(b), Ta:U(c, d), O:U(e, f), eb:[],};
|
|
3147
3170
|
}, _embind_register_value_object_field:(a, b, c, d, e, f, g, k, p, m) => {
|
|
3148
|
-
wc[a].eb.push({
|
|
3171
|
+
wc[a].eb.push({Mb:R(b), Sb:c, Qb:U(d, e), Rb:f, ec:g, dc:U(k, p), fc:m,});
|
|
3149
3172
|
}, _embind_register_void:(a, b) => {
|
|
3150
3173
|
b = R(b);
|
|
3151
|
-
S(a, {
|
|
3174
|
+
S(a, {Ic:!0, name:b, argPackAdvance:0, fromWireType:() => {
|
|
3152
3175
|
}, toWireType:() => {
|
|
3153
3176
|
},});
|
|
3154
3177
|
}, _emscripten_get_now_is_monotonic:() => 1, _emscripten_memcpy_js:(a, b, c) => D.copyWithin(a, b, b + c), _emscripten_throw_longjmp:() => {
|
|
@@ -3225,7 +3248,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3225
3248
|
var e = (new Date()).getFullYear(), f = new Date(e, 0, 1), g = new Date(e, 6, 1);
|
|
3226
3249
|
e = f.getTimezoneOffset();
|
|
3227
3250
|
var k = g.getTimezoneOffset();
|
|
3228
|
-
|
|
3251
|
+
G[a >> 2] = 60 * Math.max(e, k);
|
|
3229
3252
|
F[b >> 2] = Number(e != k);
|
|
3230
3253
|
a = p => p.toLocaleTimeString(void 0, {hour12:!1, timeZoneName:"short"}).split(" ")[1];
|
|
3231
3254
|
f = a(f);
|
|
@@ -3254,7 +3277,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3254
3277
|
var e = 105 != d;
|
|
3255
3278
|
e &= 112 != d;
|
|
3256
3279
|
c += e && c % 8 ? 4 : 0;
|
|
3257
|
-
xd.push(112 == d ?
|
|
3280
|
+
xd.push(112 == d ? G[c >> 2] : 105 == d ? F[c >> 2] : ya[c >> 3]);
|
|
3258
3281
|
c += e ? 8 : 4;
|
|
3259
3282
|
}
|
|
3260
3283
|
return Ta[a](...xd);
|
|
@@ -3291,7 +3314,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3291
3314
|
b.startsWith("GL_") && (b = b.substr(3));
|
|
3292
3315
|
"WEBGL_draw_instanced_base_vertex_base_instance" == b && yd(W);
|
|
3293
3316
|
"WEBGL_multi_draw_instanced_base_vertex_base_instance" == b && zd(W);
|
|
3294
|
-
"WEBGL_multi_draw" == b && (W
|
|
3317
|
+
"WEBGL_multi_draw" == b && (W.$b = W.getExtension("WEBGL_multi_draw"));
|
|
3295
3318
|
return !!a.F.getExtension(b);
|
|
3296
3319
|
}, emscripten_webgl_get_current_context:() => q ? q.handle : 0, emscripten_webgl_make_context_current:a => la(a) ? 0 : -5, enable_WEBGL_provoking_vertex:function(a) {
|
|
3297
3320
|
a = w[a].F;
|
|
@@ -3307,7 +3330,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3307
3330
|
var c = 0;
|
|
3308
3331
|
Qd().forEach((d, e) => {
|
|
3309
3332
|
var f = b + c;
|
|
3310
|
-
e =
|
|
3333
|
+
e = G[a + 4 * e >> 2] = f;
|
|
3311
3334
|
for (f = 0; f < d.length; ++f) {
|
|
3312
3335
|
B[e++] = d.charCodeAt(f);
|
|
3313
3336
|
}
|
|
@@ -3317,10 +3340,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3317
3340
|
return 0;
|
|
3318
3341
|
}, environ_sizes_get:(a, b) => {
|
|
3319
3342
|
var c = Qd();
|
|
3320
|
-
|
|
3343
|
+
G[a >> 2] = c.length;
|
|
3321
3344
|
var d = 0;
|
|
3322
3345
|
c.forEach(e => d += e.length + 1);
|
|
3323
|
-
|
|
3346
|
+
G[b >> 2] = d;
|
|
3324
3347
|
return 0;
|
|
3325
3348
|
}, fd_close:function(a) {
|
|
3326
3349
|
try {
|
|
@@ -3350,7 +3373,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3350
3373
|
var e = Kb(a);
|
|
3351
3374
|
a = b;
|
|
3352
3375
|
for (var f, g = b = 0; g < c; g++) {
|
|
3353
|
-
var k =
|
|
3376
|
+
var k = G[a >> 2], p = G[a + 4 >> 2];
|
|
3354
3377
|
a += 8;
|
|
3355
3378
|
var m = e, t = f, v = B;
|
|
3356
3379
|
if (0 > p || 0 > t) {
|
|
@@ -3389,7 +3412,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3389
3412
|
}
|
|
3390
3413
|
u = b;
|
|
3391
3414
|
}
|
|
3392
|
-
|
|
3415
|
+
G[d >> 2] = u;
|
|
3393
3416
|
return 0;
|
|
3394
3417
|
} catch (z) {
|
|
3395
3418
|
if ("undefined" == typeof Yb || "ErrnoError" !== z.name) {
|
|
@@ -3422,7 +3445,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3422
3445
|
var e = Kb(a);
|
|
3423
3446
|
a = b;
|
|
3424
3447
|
for (var f, g = b = 0; g < c; g++) {
|
|
3425
|
-
var k =
|
|
3448
|
+
var k = G[a >> 2], p = G[a + 4 >> 2];
|
|
3426
3449
|
a += 8;
|
|
3427
3450
|
var m = e, t = k, v = p, x = f, n = B;
|
|
3428
3451
|
if (0 > v || 0 > x) {
|
|
@@ -3459,7 +3482,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3459
3482
|
}
|
|
3460
3483
|
A = b;
|
|
3461
3484
|
}
|
|
3462
|
-
|
|
3485
|
+
G[d >> 2] = A;
|
|
3463
3486
|
return 0;
|
|
3464
3487
|
} catch (C) {
|
|
3465
3488
|
if ("undefined" == typeof Yb || "ErrnoError" !== C.name) {
|
|
@@ -3493,7 +3516,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3493
3516
|
}, glClear:a => W.clear(a), glClearBufferfv:(a, b, c) => {
|
|
3494
3517
|
W.clearBufferfv(a, b, xa, c >> 2);
|
|
3495
3518
|
}, glClearBufferuiv:(a, b, c) => {
|
|
3496
|
-
W.clearBufferuiv(a, b,
|
|
3519
|
+
W.clearBufferuiv(a, b, G, c >> 2);
|
|
3497
3520
|
}, glClearColor:(a, b, c, d) => W.clearColor(a, b, c, d), glClearDepthf:a => W.clearDepth(a), glClearStencil:a => W.clearStencil(a), glColorMask:(a, b, c, d) => {
|
|
3498
3521
|
W.colorMask(!!a, !!b, !!c, !!d);
|
|
3499
3522
|
}, glCompileShader:a => {
|
|
@@ -3694,7 +3717,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3694
3717
|
}
|
|
3695
3718
|
}, glRenderbufferStorageMultisample:(a, b, c, d, e) => W.renderbufferStorageMultisample(a, b, c, d, e), glScissor:(a, b, c, d) => W.scissor(a, b, c, d), glShaderSource:(a, b, c, d) => {
|
|
3696
3719
|
for (var e = "", f = 0; f < b; ++f) {
|
|
3697
|
-
var g = (g =
|
|
3720
|
+
var g = (g = G[c + 4 * f >> 2]) ? L(D, g, d ? G[d + 4 * f >> 2] : void 0) : "";
|
|
3698
3721
|
e += g;
|
|
3699
3722
|
}
|
|
3700
3723
|
W.shaderSource(Gd[a], e);
|
|
@@ -3719,7 +3742,7 @@ f, g, k, p) => {
|
|
|
3719
3742
|
}
|
|
3720
3743
|
}, glUniform1i:(a, b) => {
|
|
3721
3744
|
var c = W, d = c.uniform1i;
|
|
3722
|
-
var e = W.
|
|
3745
|
+
var e = W.Ib;
|
|
3723
3746
|
if (e) {
|
|
3724
3747
|
var f = e.ma[a];
|
|
3725
3748
|
"number" == typeof f && (e.ma[a] = f = W.getUniformLocation(e, e.vb[a] + (0 < f ? `[${f}]` : "")));
|
|
@@ -3734,7 +3757,7 @@ f, g, k, p) => {
|
|
|
3734
3757
|
}, glUseProgram:a => {
|
|
3735
3758
|
a = V[a];
|
|
3736
3759
|
W.useProgram(a);
|
|
3737
|
-
W.
|
|
3760
|
+
W.Ib = a;
|
|
3738
3761
|
}, glVertexAttribDivisor:(a, b) => {
|
|
3739
3762
|
W.vertexAttribDivisor(a, b);
|
|
3740
3763
|
}, glVertexAttribIPointer:(a, b, c, d, e) => {
|
|
@@ -3748,6 +3771,24 @@ f, g, k, p) => {
|
|
|
3748
3771
|
}, strftime:$d, strftime_l:(a, b, c, d) => $d(a, b, c, d), upload_image:function(a, b) {
|
|
3749
3772
|
var c = l.images;
|
|
3750
3773
|
c && (b = c.get(b)) && (a = w[a].F, a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, b), a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1));
|
|
3774
|
+
}, wasm_start_image_decode:function(a, b, c) {
|
|
3775
|
+
b = l.HEAP8.subarray(b, b + c);
|
|
3776
|
+
c = new Uint8Array(c);
|
|
3777
|
+
c.set(b);
|
|
3778
|
+
createImageBitmap(new Blob([c])).then(function(d) {
|
|
3779
|
+
var e = (new OffscreenCanvas(d.width, d.height)).getContext("2d");
|
|
3780
|
+
e.drawImage(d, 0, 0);
|
|
3781
|
+
e = e.getImageData(0, 0, d.width, d.height);
|
|
3782
|
+
var f = e.data.length, g = l.Cb(f);
|
|
3783
|
+
l.oc.set(e.data, g);
|
|
3784
|
+
l.qc(a, d.width, d.height, g, f);
|
|
3785
|
+
}).catch(function(d) {
|
|
3786
|
+
d = d.message || "decode failed";
|
|
3787
|
+
var e = l.Jc(d) + 1, f = l.Cb(e);
|
|
3788
|
+
l.Rc(d, f, e);
|
|
3789
|
+
l.rc(a, f);
|
|
3790
|
+
l.pc(f);
|
|
3791
|
+
});
|
|
3751
3792
|
}}, Y = function() {
|
|
3752
3793
|
function a(c) {
|
|
3753
3794
|
Y = c.exports;
|
|
@@ -3777,7 +3818,10 @@ f, g, k, p) => {
|
|
|
3777
3818
|
return {};
|
|
3778
3819
|
}(), lc = a => (lc = Y.free)(a), Ud = a => (Ud = Y.malloc)(a);
|
|
3779
3820
|
l._setWebImage = (a, b, c) => (l._setWebImage = Y.setWebImage)(a, b, c);
|
|
3780
|
-
var kc = a => (kc = Y.__getTypeName)(a)
|
|
3821
|
+
var kc = a => (kc = Y.__getTypeName)(a);
|
|
3822
|
+
l._wasm_image_decode_complete = (a, b, c, d, e) => (l._wasm_image_decode_complete = Y.wasm_image_decode_complete)(a, b, c, d, e);
|
|
3823
|
+
l._wasm_image_decode_error = (a, b) => (l._wasm_image_decode_error = Y.wasm_image_decode_error)(a, b);
|
|
3824
|
+
var Qa = l._ma_device__on_notification_unlocked = a => (Qa = l._ma_device__on_notification_unlocked = Y.ma_device__on_notification_unlocked)(a);
|
|
3781
3825
|
l._ma_malloc_emscripten = (a, b) => (l._ma_malloc_emscripten = Y.ma_malloc_emscripten)(a, b);
|
|
3782
3826
|
l._ma_free_emscripten = (a, b) => (l._ma_free_emscripten = Y.ma_free_emscripten)(a, b);
|
|
3783
3827
|
var Ra = l._ma_device_process_pcm_frames_capture__webaudio = (a, b, c) => (Ra = l._ma_device_process_pcm_frames_capture__webaudio = Y.ma_device_process_pcm_frames_capture__webaudio)(a, b, c), Sa = l._ma_device_process_pcm_frames_playback__webaudio = (a, b, c) => (Sa = l._ma_device_process_pcm_frames_playback__webaudio = Y.ma_device_process_pcm_frames_playback__webaudio)(a, b, c), fe = (a, b) => (fe = Y.setThrew)(a, b), ge = a => (ge = Y._emscripten_stack_restore)(a), he = () => (he = Y.emscripten_stack_get_current)();
|
|
@@ -3863,7 +3907,7 @@ moduleRtn = ca;
|
|
|
3863
3907
|
/* 5 */
|
|
3864
3908
|
/***/ ((module) => {
|
|
3865
3909
|
|
|
3866
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"2.37.
|
|
3910
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"2.37.7","description":"Rive\'s webgl2 based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive_fallback.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
3867
3911
|
|
|
3868
3912
|
/***/ }),
|
|
3869
3913
|
/* 6 */
|
|
@@ -5217,7 +5261,8 @@ var Animator = /** @class */ (function () {
|
|
|
5217
5261
|
* @param animatables the name(s) of animations to add
|
|
5218
5262
|
* @param playing whether animations should play on instantiation
|
|
5219
5263
|
*/
|
|
5220
|
-
Animator.prototype.initLinearAnimations = function (animatables, playing) {
|
|
5264
|
+
Animator.prototype.initLinearAnimations = function (animatables, playing, isFallingBackFromStateMachines) {
|
|
5265
|
+
if (isFallingBackFromStateMachines === void 0) { isFallingBackFromStateMachines = false; }
|
|
5221
5266
|
// Play/pause already instanced items, or create new instances
|
|
5222
5267
|
// This validation is kept to maintain compatibility with current behavior.
|
|
5223
5268
|
// But given that it this is called during artboard initialization
|
|
@@ -5238,6 +5283,10 @@ var Animator = /** @class */ (function () {
|
|
|
5238
5283
|
newAnimation.apply(1.0);
|
|
5239
5284
|
this.animations.push(newAnimation);
|
|
5240
5285
|
}
|
|
5286
|
+
else if (isFallingBackFromStateMachines) { // Throw LoadError if we cannot load the state machine name at all
|
|
5287
|
+
var smInitializationMessage = "State Machine with name ".concat(animatables[i], " not found");
|
|
5288
|
+
throw new RiveError(smInitializationMessage);
|
|
5289
|
+
}
|
|
5241
5290
|
else {
|
|
5242
5291
|
console.error("Animation with name ".concat(animatables[i], " not found."));
|
|
5243
5292
|
}
|
|
@@ -5268,10 +5317,11 @@ var Animator = /** @class */ (function () {
|
|
|
5268
5317
|
this.stateMachines.push(newStateMachine);
|
|
5269
5318
|
}
|
|
5270
5319
|
else {
|
|
5271
|
-
console.warn("State Machine with name ".concat(animatables[i], " not found."));
|
|
5320
|
+
console.warn("State Machine with name ".concat(animatables[i], " not found. Falling back to find an animation with the same name."));
|
|
5321
|
+
// TODO: Remove this fallback in next major release as it complicates initialization.
|
|
5272
5322
|
// In order to maintain compatibility with current behavior, if a state machine is not found
|
|
5273
5323
|
// we look for an animation with the same name
|
|
5274
|
-
this.initLinearAnimations([animatables[i]], playing);
|
|
5324
|
+
this.initLinearAnimations([animatables[i]], playing, true);
|
|
5275
5325
|
}
|
|
5276
5326
|
}
|
|
5277
5327
|
}
|
|
@@ -5873,17 +5923,26 @@ var RiveFile = /** @class */ (function () {
|
|
|
5873
5923
|
};
|
|
5874
5924
|
RiveFile.prototype.initData = function () {
|
|
5875
5925
|
return __awaiter(this, void 0, void 0, function () {
|
|
5876
|
-
var _a, loader, loaderWrapper, _b, fileFinalizer;
|
|
5926
|
+
var _a, error_1, loader, loaderWrapper, _b, fileFinalizer;
|
|
5877
5927
|
return __generator(this, function (_c) {
|
|
5878
5928
|
switch (_c.label) {
|
|
5879
5929
|
case 0:
|
|
5880
|
-
if (!(this.src && !this.buffer)) return [3 /*break*/,
|
|
5930
|
+
if (!(this.src && !this.buffer)) return [3 /*break*/, 4];
|
|
5931
|
+
_c.label = 1;
|
|
5932
|
+
case 1:
|
|
5933
|
+
_c.trys.push([1, 3, , 4]);
|
|
5881
5934
|
_a = this;
|
|
5882
5935
|
return [4 /*yield*/, loadRiveFile(this.src)];
|
|
5883
|
-
case 1:
|
|
5884
|
-
_a.buffer = _c.sent();
|
|
5885
|
-
_c.label = 2;
|
|
5886
5936
|
case 2:
|
|
5937
|
+
_a.buffer = _c.sent();
|
|
5938
|
+
return [3 /*break*/, 4];
|
|
5939
|
+
case 3:
|
|
5940
|
+
error_1 = _c.sent();
|
|
5941
|
+
if (error_1 instanceof Error) {
|
|
5942
|
+
throw error_1;
|
|
5943
|
+
}
|
|
5944
|
+
throw new RiveError(RiveFile.fileLoadErrorMessage);
|
|
5945
|
+
case 4:
|
|
5887
5946
|
if (this.destroyed) {
|
|
5888
5947
|
return [2 /*return*/];
|
|
5889
5948
|
}
|
|
@@ -5896,7 +5955,7 @@ var RiveFile = /** @class */ (function () {
|
|
|
5896
5955
|
performance.mark('rive:file-load:start');
|
|
5897
5956
|
_b = this;
|
|
5898
5957
|
return [4 /*yield*/, this.runtime.load(new Uint8Array(this.buffer), loader, this.enableRiveAssetCDN)];
|
|
5899
|
-
case
|
|
5958
|
+
case 5:
|
|
5900
5959
|
_b.file = _c.sent();
|
|
5901
5960
|
if (this.enablePerfMarks) {
|
|
5902
5961
|
performance.mark('rive:file-load:end');
|
|
@@ -5960,7 +6019,7 @@ var RiveFile = /** @class */ (function () {
|
|
|
5960
6019
|
};
|
|
5961
6020
|
RiveFile.prototype.init = function () {
|
|
5962
6021
|
return __awaiter(this, void 0, void 0, function () {
|
|
5963
|
-
var _a, bufferResolved, runtimeResolved,
|
|
6022
|
+
var _a, bufferResolved, runtimeResolved, error_2;
|
|
5964
6023
|
return __generator(this, function (_b) {
|
|
5965
6024
|
switch (_b.label) {
|
|
5966
6025
|
case 0:
|
|
@@ -5992,8 +6051,8 @@ var RiveFile = /** @class */ (function () {
|
|
|
5992
6051
|
}
|
|
5993
6052
|
return [3 /*break*/, 5];
|
|
5994
6053
|
case 4:
|
|
5995
|
-
|
|
5996
|
-
this.fireLoadError(
|
|
6054
|
+
error_2 = _b.sent();
|
|
6055
|
+
this.fireLoadError(error_2 instanceof Error ? error_2.message : RiveFile.fileLoadErrorMessage);
|
|
5997
6056
|
return [3 /*break*/, 5];
|
|
5998
6057
|
case 5: return [2 /*return*/];
|
|
5999
6058
|
}
|
|
@@ -6005,7 +6064,7 @@ var RiveFile = /** @class */ (function () {
|
|
|
6005
6064
|
type: EventType.LoadError,
|
|
6006
6065
|
data: message,
|
|
6007
6066
|
});
|
|
6008
|
-
throw new
|
|
6067
|
+
throw new RiveError(message);
|
|
6009
6068
|
};
|
|
6010
6069
|
/**
|
|
6011
6070
|
* Subscribe to Rive-generated events
|
|
@@ -6311,7 +6370,16 @@ var Rive = /** @class */ (function () {
|
|
|
6311
6370
|
// Get the canvas where you want to render the animation and create a renderer
|
|
6312
6371
|
if (_this.enablePerfMarks)
|
|
6313
6372
|
performance.mark('rive:make-renderer:start');
|
|
6314
|
-
|
|
6373
|
+
try {
|
|
6374
|
+
_this.renderer = _this.runtime.makeRenderer(_this.canvas, useOffscreenRenderer);
|
|
6375
|
+
if (!_this.renderer) {
|
|
6376
|
+
throw new Error("Renderer is null, cannot render Rive on the canvas.");
|
|
6377
|
+
}
|
|
6378
|
+
}
|
|
6379
|
+
catch (e) {
|
|
6380
|
+
console.error(e);
|
|
6381
|
+
throw new RiveError("Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.");
|
|
6382
|
+
}
|
|
6315
6383
|
if (_this.enablePerfMarks) {
|
|
6316
6384
|
performance.mark('rive:make-renderer:end');
|
|
6317
6385
|
performance.measure('rive:make-renderer', 'rive:make-renderer:start', 'rive:make-renderer:end');
|
|
@@ -6329,11 +6397,13 @@ var Rive = /** @class */ (function () {
|
|
|
6329
6397
|
}
|
|
6330
6398
|
})
|
|
6331
6399
|
.catch(function (e) {
|
|
6400
|
+
// initData already catches RiveErrors for load issues like artboard/state machine initialization
|
|
6401
|
+
// failures, so just console error and catch here so we don't double-fire the LoadError event
|
|
6332
6402
|
console.error(e);
|
|
6333
6403
|
});
|
|
6334
6404
|
})
|
|
6335
6405
|
.catch(function (e) {
|
|
6336
|
-
|
|
6406
|
+
_this.eventManager.fire({ type: EventType.LoadError, data: e.message });
|
|
6337
6407
|
});
|
|
6338
6408
|
};
|
|
6339
6409
|
/**
|
|
@@ -6415,7 +6485,7 @@ var Rive = /** @class */ (function () {
|
|
|
6415
6485
|
// Returns true for successful initialization.
|
|
6416
6486
|
Rive.prototype.initData = function (artboardName, animationNames, stateMachineNames, autoplay, autoBind) {
|
|
6417
6487
|
return __awaiter(this, void 0, void 0, function () {
|
|
6418
|
-
var riveFile,
|
|
6488
|
+
var riveFile, error_3, msg;
|
|
6419
6489
|
var _a;
|
|
6420
6490
|
return __generator(this, function (_b) {
|
|
6421
6491
|
switch (_b.label) {
|
|
@@ -6449,11 +6519,19 @@ var Rive = /** @class */ (function () {
|
|
|
6449
6519
|
// Check for audio
|
|
6450
6520
|
this.initializeAudio();
|
|
6451
6521
|
// Everything's set up, emit a load event
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6522
|
+
try {
|
|
6523
|
+
this.loaded = true;
|
|
6524
|
+
this.eventManager.fire({
|
|
6525
|
+
type: EventType.Load,
|
|
6526
|
+
data: (_a = this.src) !== null && _a !== void 0 ? _a : "buffer",
|
|
6527
|
+
});
|
|
6528
|
+
}
|
|
6529
|
+
catch (e) {
|
|
6530
|
+
// If any synchronous errors surface from the user-supplied onLoad callback,
|
|
6531
|
+
// this will console.error the error but will not invoke LoadError (onLoadError).
|
|
6532
|
+
// Notably, this will not interfere with Rive rendering
|
|
6533
|
+
console.error(e);
|
|
6534
|
+
}
|
|
6457
6535
|
// Only initialize paused state machines after the load event has been fired
|
|
6458
6536
|
// to allow users to initialize inputs and view models before the first advance
|
|
6459
6537
|
this.animator.advanceIfPaused();
|
|
@@ -6464,9 +6542,8 @@ var Rive = /** @class */ (function () {
|
|
|
6464
6542
|
this.drawFrame();
|
|
6465
6543
|
return [2 /*return*/, true];
|
|
6466
6544
|
case 3:
|
|
6467
|
-
|
|
6468
|
-
msg = resolveErrorMessage(
|
|
6469
|
-
console.warn(msg);
|
|
6545
|
+
error_3 = _b.sent();
|
|
6546
|
+
msg = resolveErrorMessage(error_3);
|
|
6470
6547
|
this.eventManager.fire({ type: EventType.LoadError, data: msg });
|
|
6471
6548
|
return [2 /*return*/, Promise.reject(msg)];
|
|
6472
6549
|
case 4: return [2 /*return*/];
|
|
@@ -6485,10 +6562,7 @@ var Rive = /** @class */ (function () {
|
|
|
6485
6562
|
: this.file.defaultArtboard();
|
|
6486
6563
|
// Check we have a working artboard
|
|
6487
6564
|
if (!rootArtboard) {
|
|
6488
|
-
|
|
6489
|
-
console.warn(msg);
|
|
6490
|
-
this.eventManager.fire({ type: EventType.LoadError, data: msg });
|
|
6491
|
-
return;
|
|
6565
|
+
throw new RiveError("Invalid artboard name or no default artboard");
|
|
6492
6566
|
}
|
|
6493
6567
|
this.artboard = rootArtboard;
|
|
6494
6568
|
rootArtboard.volume = this._volume * audioManager.systemVolume;
|
|
@@ -8507,6 +8581,9 @@ var loadRiveFile = function (src) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
8507
8581
|
return [4 /*yield*/, fetch(req)];
|
|
8508
8582
|
case 1:
|
|
8509
8583
|
res = _a.sent();
|
|
8584
|
+
if (!res.ok) {
|
|
8585
|
+
throw new Error("Failed to fetch the Rive file: HTTP ".concat(res.status));
|
|
8586
|
+
}
|
|
8510
8587
|
return [4 /*yield*/, res.arrayBuffer()];
|
|
8511
8588
|
case 2:
|
|
8512
8589
|
buffer = _a.sent();
|