@designcombo/state 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +463 -437
- package/dist/index.umd.js +2 -2
- package/package.json +5 -5
package/dist/index.es.js
CHANGED
@@ -86,25 +86,25 @@ var Ze = function() {
|
|
86
86
|
if (l)
|
87
87
|
if (this._parentage = null, Array.isArray(l))
|
88
88
|
try {
|
89
|
-
for (var d = rn(l),
|
90
|
-
var D =
|
89
|
+
for (var d = rn(l), E = d.next(); !E.done; E = d.next()) {
|
90
|
+
var D = E.value;
|
91
91
|
D.remove(this);
|
92
92
|
}
|
93
93
|
} catch (f) {
|
94
94
|
r = { error: f };
|
95
95
|
} finally {
|
96
96
|
try {
|
97
|
-
|
97
|
+
E && !E.done && (n = d.return) && n.call(d);
|
98
98
|
} finally {
|
99
99
|
if (r) throw r.error;
|
100
100
|
}
|
101
101
|
}
|
102
102
|
else
|
103
103
|
l.remove(this);
|
104
|
-
var
|
105
|
-
if (yt(
|
104
|
+
var S = this.initialTeardown;
|
105
|
+
if (yt(S))
|
106
106
|
try {
|
107
|
-
|
107
|
+
S();
|
108
108
|
} catch (f) {
|
109
109
|
c = f instanceof Xr ? f.errors : [f];
|
110
110
|
}
|
@@ -113,9 +113,9 @@ var Ze = function() {
|
|
113
113
|
this._finalizers = null;
|
114
114
|
try {
|
115
115
|
for (var h = rn(R), p = h.next(); !p.done; p = h.next()) {
|
116
|
-
var
|
116
|
+
var v = p.value;
|
117
117
|
try {
|
118
|
-
An(
|
118
|
+
An(v);
|
119
119
|
} catch (f) {
|
120
120
|
c = c ?? [], f instanceof Xr ? c = an(an([], nn(c)), nn(f.errors)) : c.push(f);
|
121
121
|
}
|
@@ -321,8 +321,8 @@ var kn = function() {
|
|
321
321
|
}, t.prototype.subscribe = function(r, n, a) {
|
322
322
|
var o = this, c = Fi(r) ? r : new on(r, n, a);
|
323
323
|
return Ve(function() {
|
324
|
-
var l = o, d = l.operator,
|
325
|
-
c.add(d ? d.call(c,
|
324
|
+
var l = o, d = l.operator, E = l.source;
|
325
|
+
c.add(d ? d.call(c, E) : E ? o._subscribe(c) : o._trySubscribe(c));
|
326
326
|
}), c;
|
327
327
|
}, t.prototype._trySubscribe = function(r) {
|
328
328
|
try {
|
@@ -337,8 +337,8 @@ var kn = function() {
|
|
337
337
|
next: function(d) {
|
338
338
|
try {
|
339
339
|
r(d);
|
340
|
-
} catch (
|
341
|
-
c(
|
340
|
+
} catch (E) {
|
341
|
+
c(E), l.unsubscribe();
|
342
342
|
}
|
343
343
|
},
|
344
344
|
error: c,
|
@@ -405,8 +405,8 @@ var Ri = Bn(function(t) {
|
|
405
405
|
a.currentObservers || (a.currentObservers = Array.from(a.observers));
|
406
406
|
try {
|
407
407
|
for (var l = rn(a.currentObservers), d = l.next(); !d.done; d = l.next()) {
|
408
|
-
var
|
409
|
-
|
408
|
+
var E = d.value;
|
409
|
+
E.next(n);
|
410
410
|
}
|
411
411
|
} catch (D) {
|
412
412
|
o = { error: D };
|
@@ -513,8 +513,8 @@ function mn(t) {
|
|
513
513
|
var Ye = { exports: {} };
|
514
514
|
Ye.exports;
|
515
515
|
(function(t, r) {
|
516
|
-
var n = 200, a = "__lodash_hash_undefined__", o = 1, c = 2, l = 9007199254740991, d = "[object Arguments]",
|
517
|
-
j[_e] = j[ge] = j[ve] = j[er] = j[rr] = j[nr] = j[ir] = j[C] = j[ar] = !0, j[d] = j[
|
516
|
+
var n = 200, a = "__lodash_hash_undefined__", o = 1, c = 2, l = 9007199254740991, d = "[object Arguments]", E = "[object Array]", D = "[object AsyncFunction]", S = "[object Boolean]", R = "[object Date]", h = "[object Error]", p = "[object Function]", v = "[object GeneratorFunction]", f = "[object Map]", _ = "[object Number]", m = "[object Null]", g = "[object Object]", b = "[object Promise]", y = "[object Proxy]", F = "[object RegExp]", k = "[object Set]", O = "[object String]", N = "[object Symbol]", z = "[object Undefined]", w = "[object WeakMap]", T = "[object ArrayBuffer]", H = "[object DataView]", _e = "[object Float32Array]", ge = "[object Float64Array]", ve = "[object Int8Array]", er = "[object Int16Array]", rr = "[object Int32Array]", nr = "[object Uint8Array]", ir = "[object Uint8ClampedArray]", C = "[object Uint16Array]", ar = "[object Uint32Array]", sr = /[\\^$.*+?()[\]{}|]/g, rt = /^\[object .+?Constructor\]$/, Ie = /^(?:0|[1-9]\d*)$/, j = {};
|
517
|
+
j[_e] = j[ge] = j[ve] = j[er] = j[rr] = j[nr] = j[ir] = j[C] = j[ar] = !0, j[d] = j[E] = j[T] = j[S] = j[H] = j[R] = j[h] = j[p] = j[f] = j[_] = j[g] = j[F] = j[k] = j[O] = j[w] = !1;
|
518
518
|
var Se = typeof et == "object" && et && et.Object === Object && et, or = typeof self == "object" && self && self.Object === Object && self, nt = Se || or || Function("return this")(), we = r && !r.nodeType && r, Te = we && !0 && t && !t.nodeType && t, $t = Te && Te.exports === we, Kt = $t && Se.process, Ae = function() {
|
519
519
|
try {
|
520
520
|
return Kt && Kt.binding && Kt.binding("util");
|
@@ -522,15 +522,15 @@ Ye.exports;
|
|
522
522
|
}
|
523
523
|
}(), Vt = Ae && Ae.isTypedArray;
|
524
524
|
function Ee(e, i) {
|
525
|
-
for (var s = -1, u = e == null ? 0 : e.length,
|
525
|
+
for (var s = -1, u = e == null ? 0 : e.length, A = 0, I = []; ++s < u; ) {
|
526
526
|
var M = e[s];
|
527
|
-
i(M, s, e) && (
|
527
|
+
i(M, s, e) && (I[A++] = M);
|
528
528
|
}
|
529
|
-
return
|
529
|
+
return I;
|
530
530
|
}
|
531
531
|
function Yt(e, i) {
|
532
|
-
for (var s = -1, u = i.length,
|
533
|
-
e[
|
532
|
+
for (var s = -1, u = i.length, A = e.length; ++s < u; )
|
533
|
+
e[A + s] = i[s];
|
534
534
|
return e;
|
535
535
|
}
|
536
536
|
function ke(e, i) {
|
@@ -557,8 +557,8 @@ Ye.exports;
|
|
557
557
|
}
|
558
558
|
function Oe(e) {
|
559
559
|
var i = -1, s = Array(e.size);
|
560
|
-
return e.forEach(function(u,
|
561
|
-
s[++i] = [
|
560
|
+
return e.forEach(function(u, A) {
|
561
|
+
s[++i] = [A, u];
|
562
562
|
}), s;
|
563
563
|
}
|
564
564
|
function xe(e, i) {
|
@@ -578,7 +578,7 @@ Ye.exports;
|
|
578
578
|
}(), Pe = gt.toString, lr = RegExp(
|
579
579
|
"^" + qt.call(Q).replace(sr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
580
580
|
), Jt = $t ? nt.Buffer : void 0, Ft = nt.Symbol, De = nt.Uint8Array, Rt = gt.propertyIsEnumerable, vt = Ct.splice, it = Ft ? Ft.toStringTag : void 0, zt = Object.getOwnPropertySymbols, Zt = Jt ? Jt.isBuffer : void 0, It = xe(Object.keys, Object), Qt = pt(nt, "DataView"), St = pt(nt, "Map"), te = pt(nt, "Promise"), ee = pt(nt, "Set"), re = pt(nt, "WeakMap"), mt = pt(Object, "create"), Ce = Y(Qt), lt = Y(St), pr = Y(te), dr = Y(ee), hr = Y(re), je = Ft ? Ft.prototype : void 0, ne = je ? je.valueOf : void 0;
|
581
|
-
function
|
581
|
+
function B(e) {
|
582
582
|
var i = -1, s = e == null ? 0 : e.length;
|
583
583
|
for (this.clear(); ++i < s; ) {
|
584
584
|
var u = e[i];
|
@@ -608,8 +608,8 @@ Ye.exports;
|
|
608
608
|
var s = this.__data__;
|
609
609
|
return this.size += this.has(e) ? 0 : 1, s[e] = mt && i === void 0 ? a : i, this;
|
610
610
|
}
|
611
|
-
|
612
|
-
function
|
611
|
+
B.prototype.clear = yr, B.prototype.delete = mr, B.prototype.get = br, B.prototype.has = _r, B.prototype.set = gr;
|
612
|
+
function $(e) {
|
613
613
|
var i = -1, s = e == null ? 0 : e.length;
|
614
614
|
for (this.clear(); ++i < s; ) {
|
615
615
|
var u = e[i];
|
@@ -637,7 +637,7 @@ Ye.exports;
|
|
637
637
|
var s = this.__data__, u = Ut(s, e);
|
638
638
|
return u < 0 ? (++this.size, s.push([e, i])) : s[u][1] = i, this;
|
639
639
|
}
|
640
|
-
|
640
|
+
$.prototype.clear = vr, $.prototype.delete = Ir, $.prototype.get = Sr, $.prototype.has = wr, $.prototype.set = Tr;
|
641
641
|
function X(e) {
|
642
642
|
var i = -1, s = e == null ? 0 : e.length;
|
643
643
|
for (this.clear(); ++i < s; ) {
|
@@ -647,9 +647,9 @@ Ye.exports;
|
|
647
647
|
}
|
648
648
|
function Ar() {
|
649
649
|
this.size = 0, this.__data__ = {
|
650
|
-
hash: new
|
651
|
-
map: new (St ||
|
652
|
-
string: new
|
650
|
+
hash: new B(),
|
651
|
+
map: new (St || $)(),
|
652
|
+
string: new B()
|
653
653
|
};
|
654
654
|
}
|
655
655
|
function Er(e) {
|
@@ -680,11 +680,11 @@ Ye.exports;
|
|
680
680
|
}
|
681
681
|
Nt.prototype.add = Nt.prototype.push = Fe, Nt.prototype.has = Ht;
|
682
682
|
function ot(e) {
|
683
|
-
var i = this.__data__ = new
|
683
|
+
var i = this.__data__ = new $(e);
|
684
684
|
this.size = i.size;
|
685
685
|
}
|
686
686
|
function ie() {
|
687
|
-
this.__data__ = new
|
687
|
+
this.__data__ = new $(), this.size = 0;
|
688
688
|
}
|
689
689
|
function Mr(e) {
|
690
690
|
var i = this.__data__, s = i.delete(e);
|
@@ -698,7 +698,7 @@ Ye.exports;
|
|
698
698
|
}
|
699
699
|
function Cr(e, i) {
|
700
700
|
var s = this.__data__;
|
701
|
-
if (s instanceof
|
701
|
+
if (s instanceof $) {
|
702
702
|
var u = s.__data__;
|
703
703
|
if (!St || u.length < n - 1)
|
704
704
|
return u.push([e, i]), this.size = ++s.size, this;
|
@@ -708,14 +708,14 @@ Ye.exports;
|
|
708
708
|
}
|
709
709
|
ot.prototype.clear = ie, ot.prototype.delete = Mr, ot.prototype.get = Pr, ot.prototype.has = Dr, ot.prototype.set = Cr;
|
710
710
|
function jr(e, i) {
|
711
|
-
var s = Lt(e), u = !s && Ue(e),
|
711
|
+
var s = Lt(e), u = !s && Ue(e), A = !s && !u && Gt(e), I = !s && !u && !A && Be(e), M = s || u || A || I, x = M ? cr(e.length, String) : [], U = x.length;
|
712
712
|
for (var P in e)
|
713
713
|
Q.call(e, P) && !(M && // Safari 9 has enumerable `arguments.length` in strict mode.
|
714
714
|
(P == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
715
|
-
|
716
|
-
|
717
|
-
Gr(P,
|
718
|
-
return
|
715
|
+
A && (P == "offset" || P == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
716
|
+
I && (P == "buffer" || P == "byteLength" || P == "byteOffset") || // Skip index properties.
|
717
|
+
Gr(P, U))) && x.push(P);
|
718
|
+
return x;
|
719
719
|
}
|
720
720
|
function Ut(e, i) {
|
721
721
|
for (var s = e.length; s--; )
|
@@ -728,33 +728,33 @@ Ye.exports;
|
|
728
728
|
return Lt(e) ? u : Yt(u, s(e));
|
729
729
|
}
|
730
730
|
function wt(e) {
|
731
|
-
return e == null ? e === void 0 ?
|
731
|
+
return e == null ? e === void 0 ? z : m : it && it in Object(e) ? dt(e) : Ne(e);
|
732
732
|
}
|
733
733
|
function Re(e) {
|
734
734
|
return ut(e) && wt(e) == d;
|
735
735
|
}
|
736
|
-
function ze(e, i, s, u,
|
737
|
-
return e === i ? !0 : e == null || i == null || !ut(e) && !ut(i) ? e !== e && i !== i : Fr(e, i, s, u, ze,
|
736
|
+
function ze(e, i, s, u, A) {
|
737
|
+
return e === i ? !0 : e == null || i == null || !ut(e) && !ut(i) ? e !== e && i !== i : Fr(e, i, s, u, ze, A);
|
738
738
|
}
|
739
|
-
function Fr(e, i, s, u,
|
740
|
-
var M = Lt(e),
|
741
|
-
|
742
|
-
var
|
743
|
-
if (
|
739
|
+
function Fr(e, i, s, u, A, I) {
|
740
|
+
var M = Lt(e), x = Lt(i), U = M ? E : ct(e), P = x ? E : ct(i);
|
741
|
+
U = U == d ? g : U, P = P == d ? g : P;
|
742
|
+
var K = U == g, q = P == g, L = U == P;
|
743
|
+
if (L && Gt(e)) {
|
744
744
|
if (!Gt(i))
|
745
745
|
return !1;
|
746
|
-
M = !0,
|
746
|
+
M = !0, K = !1;
|
747
747
|
}
|
748
|
-
if (
|
749
|
-
return
|
748
|
+
if (L && !K)
|
749
|
+
return I || (I = new ot()), M || Be(e) ? se(e, i, s, u, A, I) : Hr(e, i, U, s, u, A, I);
|
750
750
|
if (!(s & o)) {
|
751
|
-
var
|
752
|
-
if (
|
753
|
-
var bt =
|
754
|
-
return
|
751
|
+
var V = K && Q.call(e, "__wrapped__"), W = q && Q.call(i, "__wrapped__");
|
752
|
+
if (V || W) {
|
753
|
+
var bt = V ? e.value() : e, ht = W ? i.value() : i;
|
754
|
+
return I || (I = new ot()), A(bt, ht, s, u, I);
|
755
755
|
}
|
756
756
|
}
|
757
|
-
return
|
757
|
+
return L ? (I || (I = new ot()), Ur(e, i, s, u, A, I)) : !1;
|
758
758
|
}
|
759
759
|
function Rr(e) {
|
760
760
|
if (!Ge(e) || Wr(e))
|
@@ -773,104 +773,104 @@ Ye.exports;
|
|
773
773
|
Q.call(e, s) && s != "constructor" && i.push(s);
|
774
774
|
return i;
|
775
775
|
}
|
776
|
-
function se(e, i, s, u,
|
777
|
-
var M = s & o,
|
778
|
-
if (
|
776
|
+
function se(e, i, s, u, A, I) {
|
777
|
+
var M = s & o, x = e.length, U = i.length;
|
778
|
+
if (x != U && !(M && U > x))
|
779
779
|
return !1;
|
780
|
-
var P =
|
781
|
-
if (P &&
|
780
|
+
var P = I.get(e);
|
781
|
+
if (P && I.get(i))
|
782
782
|
return P == i;
|
783
|
-
var
|
784
|
-
for (
|
785
|
-
var
|
783
|
+
var K = -1, q = !0, L = s & c ? new Nt() : void 0;
|
784
|
+
for (I.set(e, i), I.set(i, e); ++K < x; ) {
|
785
|
+
var V = e[K], W = i[K];
|
786
786
|
if (u)
|
787
|
-
var bt = M ? u(
|
787
|
+
var bt = M ? u(W, V, K, i, e, I) : u(V, W, K, e, i, I);
|
788
788
|
if (bt !== void 0) {
|
789
789
|
if (bt)
|
790
790
|
continue;
|
791
791
|
q = !1;
|
792
792
|
break;
|
793
793
|
}
|
794
|
-
if (
|
794
|
+
if (L) {
|
795
795
|
if (!ke(i, function(ht, At) {
|
796
|
-
if (!Dt(
|
797
|
-
return
|
796
|
+
if (!Dt(L, At) && (V === ht || A(V, ht, s, u, I)))
|
797
|
+
return L.push(At);
|
798
798
|
})) {
|
799
799
|
q = !1;
|
800
800
|
break;
|
801
801
|
}
|
802
|
-
} else if (!(
|
802
|
+
} else if (!(V === W || A(V, W, s, u, I))) {
|
803
803
|
q = !1;
|
804
804
|
break;
|
805
805
|
}
|
806
806
|
}
|
807
|
-
return
|
807
|
+
return I.delete(e), I.delete(i), q;
|
808
808
|
}
|
809
|
-
function Hr(e, i, s, u,
|
809
|
+
function Hr(e, i, s, u, A, I, M) {
|
810
810
|
switch (s) {
|
811
|
-
case
|
811
|
+
case H:
|
812
812
|
if (e.byteLength != i.byteLength || e.byteOffset != i.byteOffset)
|
813
813
|
return !1;
|
814
814
|
e = e.buffer, i = i.buffer;
|
815
|
-
case
|
816
|
-
return !(e.byteLength != i.byteLength || !
|
817
|
-
case
|
815
|
+
case T:
|
816
|
+
return !(e.byteLength != i.byteLength || !I(new De(e), new De(i)));
|
817
|
+
case S:
|
818
818
|
case R:
|
819
|
-
case
|
819
|
+
case _:
|
820
820
|
return He(+e, +i);
|
821
821
|
case h:
|
822
822
|
return e.name == i.name && e.message == i.message;
|
823
823
|
case F:
|
824
|
-
case
|
824
|
+
case O:
|
825
825
|
return e == i + "";
|
826
826
|
case f:
|
827
|
-
var
|
828
|
-
case
|
829
|
-
var
|
830
|
-
if (
|
827
|
+
var x = Oe;
|
828
|
+
case k:
|
829
|
+
var U = u & o;
|
830
|
+
if (x || (x = st), e.size != i.size && !U)
|
831
831
|
return !1;
|
832
832
|
var P = M.get(e);
|
833
833
|
if (P)
|
834
834
|
return P == i;
|
835
835
|
u |= c, M.set(e, i);
|
836
|
-
var
|
837
|
-
return M.delete(e),
|
838
|
-
case
|
836
|
+
var K = se(x(e), x(i), u, A, I, M);
|
837
|
+
return M.delete(e), K;
|
838
|
+
case N:
|
839
839
|
if (ne)
|
840
840
|
return ne.call(e) == ne.call(i);
|
841
841
|
}
|
842
842
|
return !1;
|
843
843
|
}
|
844
|
-
function Ur(e, i, s, u,
|
845
|
-
var M = s & o,
|
846
|
-
if (
|
844
|
+
function Ur(e, i, s, u, A, I) {
|
845
|
+
var M = s & o, x = Tt(e), U = x.length, P = Tt(i), K = P.length;
|
846
|
+
if (U != K && !M)
|
847
847
|
return !1;
|
848
|
-
for (var q =
|
849
|
-
var
|
850
|
-
if (!(M ?
|
848
|
+
for (var q = U; q--; ) {
|
849
|
+
var L = x[q];
|
850
|
+
if (!(M ? L in i : Q.call(i, L)))
|
851
851
|
return !1;
|
852
852
|
}
|
853
|
-
var
|
854
|
-
if (
|
855
|
-
return
|
856
|
-
var
|
857
|
-
|
858
|
-
for (var bt = M; ++q <
|
859
|
-
|
860
|
-
var ht = e[
|
853
|
+
var V = I.get(e);
|
854
|
+
if (V && I.get(i))
|
855
|
+
return V == i;
|
856
|
+
var W = !0;
|
857
|
+
I.set(e, i), I.set(i, e);
|
858
|
+
for (var bt = M; ++q < U; ) {
|
859
|
+
L = x[q];
|
860
|
+
var ht = e[L], At = i[L];
|
861
861
|
if (u)
|
862
|
-
var Tn = M ? u(At, ht,
|
863
|
-
if (!(Tn === void 0 ? ht === At ||
|
864
|
-
|
862
|
+
var Tn = M ? u(At, ht, L, i, e, I) : u(ht, At, L, e, i, I);
|
863
|
+
if (!(Tn === void 0 ? ht === At || A(ht, At, s, u, I) : Tn)) {
|
864
|
+
W = !1;
|
865
865
|
break;
|
866
866
|
}
|
867
|
-
bt || (bt =
|
867
|
+
bt || (bt = L == "constructor");
|
868
868
|
}
|
869
|
-
if (
|
869
|
+
if (W && !bt) {
|
870
870
|
var We = e.constructor, $e = i.constructor;
|
871
|
-
We != $e && "constructor" in e && "constructor" in i && !(typeof We == "function" && We instanceof We && typeof $e == "function" && $e instanceof $e) && (
|
871
|
+
We != $e && "constructor" in e && "constructor" in i && !(typeof We == "function" && We instanceof We && typeof $e == "function" && $e instanceof $e) && (W = !1);
|
872
872
|
}
|
873
|
-
return
|
873
|
+
return I.delete(e), I.delete(i), W;
|
874
874
|
}
|
875
875
|
function Tt(e) {
|
876
876
|
return ae(e, ue, Lr);
|
@@ -890,28 +890,28 @@ Ye.exports;
|
|
890
890
|
var u = !0;
|
891
891
|
} catch {
|
892
892
|
}
|
893
|
-
var
|
894
|
-
return u && (i ? e[it] = s : delete e[it]),
|
893
|
+
var A = Pe.call(e);
|
894
|
+
return u && (i ? e[it] = s : delete e[it]), A;
|
895
895
|
}
|
896
896
|
var Lr = zt ? function(e) {
|
897
897
|
return e == null ? [] : (e = Object(e), Ee(zt(e), function(i) {
|
898
898
|
return Rt.call(e, i);
|
899
899
|
}));
|
900
900
|
} : Vr, ct = wt;
|
901
|
-
(Qt && ct(new Qt(new ArrayBuffer(1))) !=
|
902
|
-
var i = wt(e), s = i ==
|
901
|
+
(Qt && ct(new Qt(new ArrayBuffer(1))) != H || St && ct(new St()) != f || te && ct(te.resolve()) != b || ee && ct(new ee()) != k || re && ct(new re()) != w) && (ct = function(e) {
|
902
|
+
var i = wt(e), s = i == g ? e.constructor : void 0, u = s ? Y(s) : "";
|
903
903
|
if (u)
|
904
904
|
switch (u) {
|
905
905
|
case Ce:
|
906
|
-
return
|
906
|
+
return H;
|
907
907
|
case lt:
|
908
908
|
return f;
|
909
909
|
case pr:
|
910
|
-
return
|
910
|
+
return b;
|
911
911
|
case dr:
|
912
|
-
return
|
912
|
+
return k;
|
913
913
|
case hr:
|
914
|
-
return
|
914
|
+
return w;
|
915
915
|
}
|
916
916
|
return i;
|
917
917
|
});
|
@@ -964,7 +964,7 @@ Ye.exports;
|
|
964
964
|
if (!Ge(e))
|
965
965
|
return !1;
|
966
966
|
var i = wt(e);
|
967
|
-
return i == p || i ==
|
967
|
+
return i == p || i == v || i == D || i == y;
|
968
968
|
}
|
969
969
|
function ce(e) {
|
970
970
|
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= l;
|
@@ -993,8 +993,8 @@ const ft = /* @__PURE__ */ mn(zi);
|
|
993
993
|
var Xe = { exports: {} };
|
994
994
|
Xe.exports;
|
995
995
|
(function(t, r) {
|
996
|
-
var n = 200, a = "__lodash_hash_undefined__", o = 9007199254740991, c = "[object Arguments]", l = "[object Array]", d = "[object Boolean]",
|
997
|
-
C[c] = C[l] = C[F] = C[
|
996
|
+
var n = 200, a = "__lodash_hash_undefined__", o = 9007199254740991, c = "[object Arguments]", l = "[object Array]", d = "[object Boolean]", E = "[object Date]", D = "[object Error]", S = "[object Function]", R = "[object GeneratorFunction]", h = "[object Map]", p = "[object Number]", v = "[object Object]", f = "[object Promise]", _ = "[object RegExp]", m = "[object Set]", g = "[object String]", b = "[object Symbol]", y = "[object WeakMap]", F = "[object ArrayBuffer]", k = "[object DataView]", O = "[object Float32Array]", N = "[object Float64Array]", z = "[object Int8Array]", w = "[object Int16Array]", T = "[object Int32Array]", H = "[object Uint8Array]", _e = "[object Uint8ClampedArray]", ge = "[object Uint16Array]", ve = "[object Uint32Array]", er = /[\\^$.*+?()[\]{}|]/g, rr = /\w*$/, nr = /^\[object .+?Constructor\]$/, ir = /^(?:0|[1-9]\d*)$/, C = {};
|
997
|
+
C[c] = C[l] = C[F] = C[k] = C[d] = C[E] = C[O] = C[N] = C[z] = C[w] = C[T] = C[h] = C[p] = C[v] = C[_] = C[m] = C[g] = C[b] = C[H] = C[_e] = C[ge] = C[ve] = !0, C[D] = C[S] = C[y] = !1;
|
998
998
|
var ar = typeof et == "object" && et && et.Object === Object && et, sr = typeof self == "object" && self && self.Object === Object && self, rt = ar || sr || Function("return this")(), Ie = r && !r.nodeType && r, j = Ie && !0 && t && !t.nodeType && t, Se = j && j.exports === Ie;
|
999
999
|
function or(e, i) {
|
1000
1000
|
return e.set(i[0], i[1]), e;
|
@@ -1008,13 +1008,13 @@ Xe.exports;
|
|
1008
1008
|
return e;
|
1009
1009
|
}
|
1010
1010
|
function Te(e, i) {
|
1011
|
-
for (var s = -1, u = i.length,
|
1012
|
-
e[
|
1011
|
+
for (var s = -1, u = i.length, A = e.length; ++s < u; )
|
1012
|
+
e[A + s] = i[s];
|
1013
1013
|
return e;
|
1014
1014
|
}
|
1015
1015
|
function $t(e, i, s, u) {
|
1016
|
-
for (var
|
1017
|
-
s = i(s, e[
|
1016
|
+
for (var A = -1, I = e ? e.length : 0; ++A < I; )
|
1017
|
+
s = i(s, e[A], A, e);
|
1018
1018
|
return s;
|
1019
1019
|
}
|
1020
1020
|
function Kt(e, i) {
|
@@ -1036,8 +1036,8 @@ Xe.exports;
|
|
1036
1036
|
}
|
1037
1037
|
function Ee(e) {
|
1038
1038
|
var i = -1, s = Array(e.size);
|
1039
|
-
return e.forEach(function(u,
|
1040
|
-
s[++i] = [
|
1039
|
+
return e.forEach(function(u, A) {
|
1040
|
+
s[++i] = [A, u];
|
1041
1041
|
}), s;
|
1042
1042
|
}
|
1043
1043
|
function Yt(e, i) {
|
@@ -1087,7 +1087,7 @@ Xe.exports;
|
|
1087
1087
|
return s[e] = It && i === void 0 ? a : i, this;
|
1088
1088
|
}
|
1089
1089
|
lt.prototype.clear = pr, lt.prototype.delete = dr, lt.prototype.get = hr, lt.prototype.has = je, lt.prototype.set = ne;
|
1090
|
-
function
|
1090
|
+
function B(e) {
|
1091
1091
|
var i = -1, s = e ? e.length : 0;
|
1092
1092
|
for (this.clear(); ++i < s; ) {
|
1093
1093
|
var u = e[i];
|
@@ -1115,8 +1115,8 @@ Xe.exports;
|
|
1115
1115
|
var s = this.__data__, u = Ht(s, e);
|
1116
1116
|
return u < 0 ? s.push([e, i]) : s[u][1] = i, this;
|
1117
1117
|
}
|
1118
|
-
|
1119
|
-
function
|
1118
|
+
B.prototype.clear = yr, B.prototype.delete = mr, B.prototype.get = br, B.prototype.has = _r, B.prototype.set = gr;
|
1119
|
+
function $(e) {
|
1120
1120
|
var i = -1, s = e ? e.length : 0;
|
1121
1121
|
for (this.clear(); ++i < s; ) {
|
1122
1122
|
var u = e[i];
|
@@ -1126,7 +1126,7 @@ Xe.exports;
|
|
1126
1126
|
function vr() {
|
1127
1127
|
this.__data__ = {
|
1128
1128
|
hash: new lt(),
|
1129
|
-
map: new (vt ||
|
1129
|
+
map: new (vt || B)(),
|
1130
1130
|
string: new lt()
|
1131
1131
|
};
|
1132
1132
|
}
|
@@ -1142,12 +1142,12 @@ Xe.exports;
|
|
1142
1142
|
function Tr(e, i) {
|
1143
1143
|
return Tt(this, e).set(e, i), this;
|
1144
1144
|
}
|
1145
|
-
|
1145
|
+
$.prototype.clear = vr, $.prototype.delete = Ir, $.prototype.get = Sr, $.prototype.has = wr, $.prototype.set = Tr;
|
1146
1146
|
function X(e) {
|
1147
|
-
this.__data__ = new
|
1147
|
+
this.__data__ = new B(e);
|
1148
1148
|
}
|
1149
1149
|
function Ar() {
|
1150
|
-
this.__data__ = new
|
1150
|
+
this.__data__ = new B();
|
1151
1151
|
}
|
1152
1152
|
function Er(e) {
|
1153
1153
|
return this.__data__.delete(e);
|
@@ -1160,19 +1160,19 @@ Xe.exports;
|
|
1160
1160
|
}
|
1161
1161
|
function xr(e, i) {
|
1162
1162
|
var s = this.__data__;
|
1163
|
-
if (s instanceof
|
1163
|
+
if (s instanceof B) {
|
1164
1164
|
var u = s.__data__;
|
1165
1165
|
if (!vt || u.length < n - 1)
|
1166
1166
|
return u.push([e, i]), this;
|
1167
|
-
s = this.__data__ = new
|
1167
|
+
s = this.__data__ = new $(u);
|
1168
1168
|
}
|
1169
1169
|
return s.set(e, i), this;
|
1170
1170
|
}
|
1171
1171
|
X.prototype.clear = Ar, X.prototype.delete = Er, X.prototype.get = kr, X.prototype.has = Or, X.prototype.set = xr;
|
1172
1172
|
function Nt(e, i) {
|
1173
|
-
var s = oe(e) || Lt(e) ? Kt(e.length, String) : [], u = s.length,
|
1174
|
-
for (var
|
1175
|
-
st.call(e,
|
1173
|
+
var s = oe(e) || Lt(e) ? Kt(e.length, String) : [], u = s.length, A = !!u;
|
1174
|
+
for (var I in e)
|
1175
|
+
st.call(e, I) && !(A && (I == "length" || Br(I, u))) && s.push(I);
|
1176
1176
|
return s;
|
1177
1177
|
}
|
1178
1178
|
function Fe(e, i, s) {
|
@@ -1188,40 +1188,40 @@ Xe.exports;
|
|
1188
1188
|
function ot(e, i) {
|
1189
1189
|
return e && se(i, ue(i), e);
|
1190
1190
|
}
|
1191
|
-
function ie(e, i, s, u,
|
1192
|
-
var
|
1193
|
-
if (u && (
|
1194
|
-
return
|
1191
|
+
function ie(e, i, s, u, A, I, M) {
|
1192
|
+
var x;
|
1193
|
+
if (u && (x = I ? u(e, A, I, M) : u(e)), x !== void 0)
|
1194
|
+
return x;
|
1195
1195
|
if (!ut(e))
|
1196
1196
|
return e;
|
1197
|
-
var
|
1198
|
-
if (
|
1199
|
-
if (
|
1200
|
-
return Nr(e,
|
1197
|
+
var U = oe(e);
|
1198
|
+
if (U) {
|
1199
|
+
if (x = Lr(e), !i)
|
1200
|
+
return Nr(e, x);
|
1201
1201
|
} else {
|
1202
|
-
var P = dt(e),
|
1202
|
+
var P = dt(e), K = P == S || P == R;
|
1203
1203
|
if (Le(e))
|
1204
1204
|
return Ut(e, i);
|
1205
|
-
if (P ==
|
1205
|
+
if (P == v || P == c || K && !I) {
|
1206
1206
|
if (Vt(e))
|
1207
|
-
return
|
1208
|
-
if (
|
1209
|
-
return Hr(e, ot(
|
1207
|
+
return I ? e : {};
|
1208
|
+
if (x = ct(K ? {} : e), !i)
|
1209
|
+
return Hr(e, ot(x, e));
|
1210
1210
|
} else {
|
1211
1211
|
if (!C[P])
|
1212
|
-
return
|
1213
|
-
|
1212
|
+
return I ? e : {};
|
1213
|
+
x = Gr(e, P, ie, i);
|
1214
1214
|
}
|
1215
1215
|
}
|
1216
1216
|
M || (M = new X());
|
1217
1217
|
var q = M.get(e);
|
1218
1218
|
if (q)
|
1219
1219
|
return q;
|
1220
|
-
if (M.set(e,
|
1221
|
-
var
|
1222
|
-
return we(
|
1223
|
-
|
1224
|
-
}),
|
1220
|
+
if (M.set(e, x), !U)
|
1221
|
+
var L = s ? Ur(e) : ue(e);
|
1222
|
+
return we(L || e, function(V, W) {
|
1223
|
+
L && (W = V, V = e[W]), Fe(x, W, ie(V, i, s, u, W, e, M));
|
1224
|
+
}), x;
|
1225
1225
|
}
|
1226
1226
|
function Mr(e) {
|
1227
1227
|
return ut(e) ? Me(e) : {};
|
@@ -1288,9 +1288,9 @@ Xe.exports;
|
|
1288
1288
|
}
|
1289
1289
|
function se(e, i, s, u) {
|
1290
1290
|
s || (s = {});
|
1291
|
-
for (var
|
1292
|
-
var M = i[
|
1293
|
-
Fe(s, M,
|
1291
|
+
for (var A = -1, I = i.length; ++A < I; ) {
|
1292
|
+
var M = i[A], x = void 0;
|
1293
|
+
Fe(s, M, x === void 0 ? e[M] : x);
|
1294
1294
|
}
|
1295
1295
|
return s;
|
1296
1296
|
}
|
@@ -1309,18 +1309,18 @@ Xe.exports;
|
|
1309
1309
|
return Cr(s) ? s : void 0;
|
1310
1310
|
}
|
1311
1311
|
var pt = Jt ? Yt(Jt, Object) : Vr, dt = Dr;
|
1312
|
-
(Rt && dt(new Rt(new ArrayBuffer(1))) !=
|
1313
|
-
var i = Ct.call(e), s = i ==
|
1312
|
+
(Rt && dt(new Rt(new ArrayBuffer(1))) != k || vt && dt(new vt()) != h || it && dt(it.resolve()) != f || zt && dt(new zt()) != m || Zt && dt(new Zt()) != y) && (dt = function(e) {
|
1313
|
+
var i = Ct.call(e), s = i == v ? e.constructor : void 0, u = s ? Y(s) : void 0;
|
1314
1314
|
if (u)
|
1315
1315
|
switch (u) {
|
1316
1316
|
case Qt:
|
1317
|
-
return
|
1317
|
+
return k;
|
1318
1318
|
case St:
|
1319
1319
|
return h;
|
1320
1320
|
case te:
|
1321
1321
|
return f;
|
1322
1322
|
case ee:
|
1323
|
-
return
|
1323
|
+
return m;
|
1324
1324
|
case re:
|
1325
1325
|
return y;
|
1326
1326
|
}
|
@@ -1334,21 +1334,21 @@ Xe.exports;
|
|
1334
1334
|
return typeof e.constructor == "function" && !Ne(e) ? Mr(Q(e)) : {};
|
1335
1335
|
}
|
1336
1336
|
function Gr(e, i, s, u) {
|
1337
|
-
var
|
1337
|
+
var A = e.constructor;
|
1338
1338
|
switch (i) {
|
1339
1339
|
case F:
|
1340
1340
|
return ae(e);
|
1341
1341
|
case d:
|
1342
|
-
case A:
|
1343
|
-
return new T(+e);
|
1344
1342
|
case E:
|
1345
|
-
return
|
1343
|
+
return new A(+e);
|
1346
1344
|
case k:
|
1347
|
-
|
1345
|
+
return wt(e, u);
|
1346
|
+
case O:
|
1348
1347
|
case N:
|
1349
|
-
case
|
1350
|
-
case
|
1351
|
-
case
|
1348
|
+
case z:
|
1349
|
+
case w:
|
1350
|
+
case T:
|
1351
|
+
case H:
|
1352
1352
|
case _e:
|
1353
1353
|
case ge:
|
1354
1354
|
case ve:
|
@@ -1356,13 +1356,13 @@ Xe.exports;
|
|
1356
1356
|
case h:
|
1357
1357
|
return Re(e, u, s);
|
1358
1358
|
case p:
|
1359
|
+
case g:
|
1360
|
+
return new A(e);
|
1359
1361
|
case _:
|
1360
|
-
return new T(e);
|
1361
|
-
case b:
|
1362
1362
|
return ze(e);
|
1363
|
-
case v:
|
1364
|
-
return Fr(e, u, s);
|
1365
1363
|
case m:
|
1364
|
+
return Fr(e, u, s);
|
1365
|
+
case b:
|
1366
1366
|
return Rr(e);
|
1367
1367
|
}
|
1368
1368
|
}
|
@@ -1412,7 +1412,7 @@ Xe.exports;
|
|
1412
1412
|
var Le = Ft || Yr;
|
1413
1413
|
function ce(e) {
|
1414
1414
|
var i = ut(e) ? Ct.call(e) : "";
|
1415
|
-
return i ==
|
1415
|
+
return i == S || i == R;
|
1416
1416
|
}
|
1417
1417
|
function Ge(e) {
|
1418
1418
|
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= o;
|
@@ -1720,7 +1720,9 @@ const Pn = (t) => Object.keys(t).reduce((r, n) => {
|
|
1720
1720
|
}, r.trackItemsMap[c.id] = c, c.id;
|
1721
1721
|
};
|
1722
1722
|
function qi(t) {
|
1723
|
-
const r = Bt.pipe(
|
1723
|
+
const r = Bt.pipe(
|
1724
|
+
Wt(({ key: p }) => p.startsWith(oi))
|
1725
|
+
), n = Bt.pipe(
|
1724
1726
|
Wt(({ key: p }) => p.startsWith(ci))
|
1725
1727
|
), a = Bt.pipe(
|
1726
1728
|
Wt(({ key: p }) => p.startsWith(ui))
|
@@ -1731,83 +1733,96 @@ function qi(t) {
|
|
1731
1733
|
), l = Bt.pipe(
|
1732
1734
|
Wt(({ key: p }) => p.startsWith(pi))
|
1733
1735
|
), d = r.subscribe(async (p) => {
|
1734
|
-
var
|
1736
|
+
var v;
|
1735
1737
|
if (p.key === di) {
|
1736
|
-
const f = (
|
1737
|
-
const y =
|
1738
|
-
return (y.type === "caption" || y.type === "text") && await cn([
|
1738
|
+
const f = (v = p.value) == null ? void 0 : v.payload, _ = f.trackItemIds, m = f.trackItemDetailsMap, g = _.map(async (b) => {
|
1739
|
+
const y = m[b];
|
1740
|
+
return (y.type === "caption" || y.type === "text") && await cn([
|
1741
|
+
{
|
1742
|
+
fontFamily: y.details.fontFamily,
|
1743
|
+
url: y.details.fontUrl
|
1744
|
+
}
|
1745
|
+
]), !0;
|
1739
1746
|
});
|
1740
|
-
await Promise.all(
|
1747
|
+
await Promise.all(g), t.updateState({
|
1741
1748
|
...f
|
1742
1749
|
});
|
1743
1750
|
}
|
1744
|
-
}),
|
1751
|
+
}), E = o.subscribe((p) => {
|
1745
1752
|
if (p.key === hi) return t.undo();
|
1746
1753
|
if (p.key === yi) return t.redo();
|
1747
1754
|
}), D = a.subscribe((p) => {
|
1748
|
-
var f,
|
1749
|
-
const
|
1750
|
-
(f = p.value) != null && f.payload.trackItemIds &&
|
1751
|
-
}),
|
1752
|
-
var
|
1753
|
-
const
|
1754
|
-
if (
|
1755
|
-
const
|
1756
|
-
|
1757
|
-
|
1755
|
+
var f, _;
|
1756
|
+
const v = [];
|
1757
|
+
(f = p.value) != null && f.payload.trackItemIds && v.push((_ = p.value) == null ? void 0 : _.payload.trackItemIds), t.updateState({ activeIds: v });
|
1758
|
+
}), S = n.subscribe(async (p) => {
|
1759
|
+
var b, y, F, k, O, N;
|
1760
|
+
const v = [], f = tt(t.getState()), _ = ((b = p.value) == null ? void 0 : b.payload.id) ?? Jr();
|
1761
|
+
if (v.push(_), p.key === mi) {
|
1762
|
+
const w = ((y = p.value) == null ? void 0 : y.payload).map(async (H) => await Dn(H, f, "caption")), T = await Promise.all(w);
|
1763
|
+
v.splice(0, v.length), T.forEach((H) => {
|
1764
|
+
v.push(H), f.trackItemIds.push(H);
|
1758
1765
|
});
|
1759
1766
|
}
|
1760
1767
|
if (p.key === bi) {
|
1761
|
-
const z = await Dn(
|
1768
|
+
const z = await Dn(
|
1769
|
+
(F = p.value) == null ? void 0 : F.payload,
|
1770
|
+
f,
|
1771
|
+
"text"
|
1772
|
+
);
|
1762
1773
|
f.trackItemIds.push(z);
|
1763
1774
|
}
|
1775
|
+
let m = "text";
|
1764
1776
|
if (p.key === _i) {
|
1765
|
-
|
1777
|
+
m = "image";
|
1778
|
+
const z = await $i((k = p.value) == null ? void 0 : k.payload, {
|
1766
1779
|
size: {
|
1767
1780
|
width: 1080,
|
1768
1781
|
height: 1920
|
1769
1782
|
}
|
1770
|
-
}), { details:
|
1771
|
-
f.trackItemDetailsMap[
|
1772
|
-
type:
|
1773
|
-
details:
|
1774
|
-
}, f.trackItemsMap[
|
1783
|
+
}), { details: w, ...T } = z;
|
1784
|
+
f.trackItemDetailsMap[T.id] = {
|
1785
|
+
type: m,
|
1786
|
+
details: w
|
1787
|
+
}, f.trackItemsMap[T.id] = T, f.trackItemIds.push(T.id);
|
1775
1788
|
}
|
1776
1789
|
if (p.key === gi) {
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1790
|
+
m = "audio";
|
1791
|
+
const z = await Wi((O = p.value) == null ? void 0 : O.payload), { details: w, ...T } = z;
|
1792
|
+
f.trackItemDetailsMap[T.id] = {
|
1793
|
+
type: m,
|
1794
|
+
details: w
|
1795
|
+
}, f.trackItemsMap[T.id] = T, f.trackItemIds.push(T.id);
|
1782
1796
|
}
|
1783
1797
|
if (p.key === vi) {
|
1784
|
-
|
1798
|
+
m = "video";
|
1799
|
+
const z = await Bi((N = p.value) == null ? void 0 : N.payload, {
|
1785
1800
|
size: {
|
1786
1801
|
width: 1080,
|
1787
1802
|
height: 1920
|
1788
1803
|
}
|
1789
|
-
}), { details:
|
1790
|
-
f.trackItemDetailsMap[
|
1791
|
-
type:
|
1792
|
-
details:
|
1793
|
-
}, f.trackItemsMap[
|
1804
|
+
}), { details: w, ...T } = z;
|
1805
|
+
f.trackItemDetailsMap[T.id] = {
|
1806
|
+
type: m,
|
1807
|
+
details: w
|
1808
|
+
}, f.trackItemsMap[T.id] = T, f.trackItemIds.push(T.id);
|
1794
1809
|
}
|
1795
1810
|
f.tracks.unshift({
|
1796
1811
|
id: un(),
|
1797
1812
|
accepts: ["text", "audio", "helper", "video", "image", "caption"],
|
1798
|
-
type:
|
1799
|
-
items:
|
1813
|
+
type: m,
|
1814
|
+
items: v,
|
1800
1815
|
magnetic: !1,
|
1801
1816
|
static: !1
|
1802
1817
|
});
|
1803
|
-
const
|
1818
|
+
const g = Pn(f.trackItemsMap);
|
1804
1819
|
t.updateState(
|
1805
1820
|
{
|
1806
1821
|
trackItemIds: f.trackItemIds,
|
1807
1822
|
trackItemDetailsMap: f.trackItemDetailsMap,
|
1808
1823
|
trackItemsMap: f.trackItemsMap,
|
1809
1824
|
tracks: f.tracks,
|
1810
|
-
duration:
|
1825
|
+
duration: g
|
1811
1826
|
},
|
1812
1827
|
{
|
1813
1828
|
updateHistory: !0,
|
@@ -1815,44 +1830,45 @@ function qi(t) {
|
|
1815
1830
|
}
|
1816
1831
|
);
|
1817
1832
|
}), R = c.subscribe(async (p) => {
|
1818
|
-
var
|
1833
|
+
var v;
|
1819
1834
|
if (p.key === Ii) {
|
1820
|
-
const f = tt(t.getState()),
|
1821
|
-
(
|
1835
|
+
const f = tt(t.getState()), _ = f.activeIds, m = f.trackItemIds, g = f.trackItemDetailsMap, b = m.filter(
|
1836
|
+
(O) => !_.includes(O)
|
1822
1837
|
), y = Object.fromEntries(
|
1823
|
-
Object.entries(
|
1824
|
-
([
|
1838
|
+
Object.entries(g).filter(
|
1839
|
+
([O]) => !_.includes(O)
|
1825
1840
|
)
|
1826
1841
|
), F = Xi(
|
1827
1842
|
f.tracks,
|
1828
|
-
|
1829
|
-
),
|
1843
|
+
_
|
1844
|
+
), k = Pn(f.trackItemsMap);
|
1830
1845
|
t.updateState(
|
1831
1846
|
{
|
1832
|
-
trackItemIds:
|
1847
|
+
trackItemIds: b,
|
1833
1848
|
trackItemDetailsMap: y,
|
1834
1849
|
activeIds: [],
|
1835
1850
|
tracks: F,
|
1836
|
-
duration:
|
1851
|
+
duration: k
|
1837
1852
|
},
|
1838
1853
|
{ updateHistory: !0, kind: "remove" }
|
1839
1854
|
);
|
1840
1855
|
}
|
1841
1856
|
if (p.key === Si) {
|
1842
|
-
const f = tt(t.getState()),
|
1857
|
+
const f = tt(t.getState()), _ = (v = p.value) == null ? void 0 : v.options.time;
|
1843
1858
|
if (f.activeIds.length === 1) {
|
1844
|
-
const
|
1845
|
-
if (
|
1846
|
-
|
1847
|
-
|
1859
|
+
const m = f.activeIds[0], g = f.trackItemsMap[m];
|
1860
|
+
if (_ >= g.display.to || _ <= g.display.from)
|
1861
|
+
return;
|
1862
|
+
const b = f.trackItemDetailsMap[m], y = Jr(), F = {
|
1863
|
+
...g,
|
1848
1864
|
id: y,
|
1849
1865
|
display: {
|
1850
|
-
from:
|
1851
|
-
to:
|
1866
|
+
from: _,
|
1867
|
+
to: g.display.to
|
1852
1868
|
}
|
1853
1869
|
};
|
1854
|
-
f.trackItemsMap[
|
1855
|
-
|
1870
|
+
f.trackItemsMap[m].display.to = _, f.trackItemsMap[y] = F, f.trackItemIds.push(y), f.trackItemDetailsMap[y] = b, f.tracks.forEach((k) => {
|
1871
|
+
k.items.includes(m) && k.items.push(y);
|
1856
1872
|
}), t.updateState(
|
1857
1873
|
{
|
1858
1874
|
trackItemDetailsMap: f.trackItemDetailsMap,
|
@@ -1871,41 +1887,51 @@ function qi(t) {
|
|
1871
1887
|
if (p.key === wi) {
|
1872
1888
|
const f = tt(t.getState());
|
1873
1889
|
if (f.activeIds.length) {
|
1874
|
-
const
|
1875
|
-
activeIds:
|
1890
|
+
const _ = f.activeIds, m = [], g = {
|
1891
|
+
activeIds: _,
|
1876
1892
|
trackItemDetailsMap: {},
|
1877
1893
|
trackItemsMap: {},
|
1878
1894
|
tracks: []
|
1879
1895
|
};
|
1880
|
-
|
1881
|
-
|
1896
|
+
_.forEach((y) => {
|
1897
|
+
g.trackItemDetailsMap[y] = f.trackItemDetailsMap[y], g.trackItemsMap[y] = f.trackItemsMap[y], m.push(
|
1898
|
+
f.tracks.find((F) => F.items.includes(y))
|
1899
|
+
);
|
1882
1900
|
});
|
1883
|
-
const
|
1884
|
-
|
1901
|
+
const b = /* @__PURE__ */ new Set();
|
1902
|
+
m.filter((y) => b.has(y.id) ? !1 : (b.add(y), !0)), g.tracks = Array.from(b.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(g));
|
1885
1903
|
}
|
1886
1904
|
}
|
1887
1905
|
if (p.key === Ti) {
|
1888
1906
|
const f = localStorage.getItem("DesignComboTemp");
|
1889
1907
|
if (!f) return;
|
1890
|
-
const
|
1891
|
-
const
|
1892
|
-
(
|
1893
|
-
|
1894
|
-
|
1908
|
+
const _ = tt(t.getState()), m = JSON.parse(f), g = {}, b = m.trackItemsMap, y = m.trackItemDetailsMap, F = m.tracks, k = [], O = m.activeIds.map(async (N) => {
|
1909
|
+
const z = y[N];
|
1910
|
+
(z.type === "caption" || z.type === "text") && await cn([
|
1911
|
+
{
|
1912
|
+
fontFamily: z.details.fontFamily,
|
1913
|
+
url: z.details.fontUrl
|
1914
|
+
}
|
1915
|
+
]);
|
1916
|
+
const w = Jr();
|
1917
|
+
return g[N] = w, _.trackItemsMap[w] = {
|
1918
|
+
...b[N],
|
1919
|
+
id: w
|
1920
|
+
}, _.trackItemDetailsMap[w] = z, _.trackItemIds.push(w), !0;
|
1895
1921
|
});
|
1896
|
-
await Promise.all(
|
1897
|
-
const
|
1898
|
-
...
|
1899
|
-
items:
|
1922
|
+
await Promise.all(O), F.forEach((N) => {
|
1923
|
+
const z = N.items.map((T) => g[T]), w = {
|
1924
|
+
...N,
|
1925
|
+
items: z,
|
1900
1926
|
id: un()
|
1901
1927
|
};
|
1902
|
-
|
1903
|
-
}),
|
1928
|
+
k.push(w);
|
1929
|
+
}), _.tracks = [..._.tracks, ...k], t.updateState(
|
1904
1930
|
{
|
1905
|
-
trackItemDetailsMap:
|
1906
|
-
tracks:
|
1907
|
-
trackItemIds:
|
1908
|
-
trackItemsMap:
|
1931
|
+
trackItemDetailsMap: _.trackItemDetailsMap,
|
1932
|
+
tracks: _.tracks,
|
1933
|
+
trackItemIds: _.trackItemIds,
|
1934
|
+
trackItemsMap: _.trackItemsMap
|
1909
1935
|
},
|
1910
1936
|
{
|
1911
1937
|
updateHistory: !0,
|
@@ -1914,19 +1940,19 @@ function qi(t) {
|
|
1914
1940
|
);
|
1915
1941
|
}
|
1916
1942
|
}), h = l.subscribe((p) => {
|
1917
|
-
var
|
1943
|
+
var v, f;
|
1918
1944
|
if (p.key === Ai) {
|
1919
|
-
const
|
1920
|
-
if (!
|
1921
|
-
const
|
1922
|
-
|
1923
|
-
|
1924
|
-
...
|
1925
|
-
...
|
1945
|
+
const _ = t.getState(), m = tt(_.trackItemDetailsMap), g = Object.keys((v = p.value) == null ? void 0 : v.payload);
|
1946
|
+
if (!g.length) return;
|
1947
|
+
const b = (f = p.value) == null ? void 0 : f.payload;
|
1948
|
+
g.forEach((y) => {
|
1949
|
+
m[y].details = {
|
1950
|
+
...m[y].details,
|
1951
|
+
...b[y].details
|
1926
1952
|
};
|
1927
1953
|
}), t.updateState(
|
1928
1954
|
{
|
1929
|
-
trackItemDetailsMap: { ...
|
1955
|
+
trackItemDetailsMap: { ...m }
|
1930
1956
|
},
|
1931
1957
|
{
|
1932
1958
|
updateHistory: !0,
|
@@ -1937,17 +1963,17 @@ function qi(t) {
|
|
1937
1963
|
});
|
1938
1964
|
return {
|
1939
1965
|
unsubscribe: () => {
|
1940
|
-
|
1966
|
+
S.unsubscribe(), R.unsubscribe(), h.unsubscribe(), E.unsubscribe(), D.unsubscribe(), d.unsubscribe();
|
1941
1967
|
}
|
1942
1968
|
};
|
1943
1969
|
}
|
1944
1970
|
const Ji = { Date: !0, RegExp: !0, String: !0, Number: !0 };
|
1945
1971
|
function Jn(t, r, n = { cyclesFix: !0 }, a = []) {
|
1946
|
-
var d,
|
1972
|
+
var d, E;
|
1947
1973
|
let o = [];
|
1948
1974
|
const c = Array.isArray(t);
|
1949
1975
|
for (const D in t) {
|
1950
|
-
const
|
1976
|
+
const S = t[D], R = c ? +D : D;
|
1951
1977
|
if (!(D in r)) {
|
1952
1978
|
o.push({
|
1953
1979
|
type: "REMOVE",
|
@@ -1956,16 +1982,16 @@ function Jn(t, r, n = { cyclesFix: !0 }, a = []) {
|
|
1956
1982
|
});
|
1957
1983
|
continue;
|
1958
1984
|
}
|
1959
|
-
const h = r[D], p = typeof
|
1960
|
-
if (
|
1961
|
-
const
|
1962
|
-
o.push.apply(o,
|
1963
|
-
} else
|
1964
|
-
!(Number.isNaN(
|
1985
|
+
const h = r[D], p = typeof S == "object" && typeof h == "object" && Array.isArray(S) === Array.isArray(h);
|
1986
|
+
if (S && h && p && !Ji[(E = (d = Object.getPrototypeOf(S)) == null ? void 0 : d.constructor) == null ? void 0 : E.name] && (!n.cyclesFix || !a.includes(S))) {
|
1987
|
+
const v = Jn(S, h, n, n.cyclesFix ? a.concat([S]) : []);
|
1988
|
+
o.push.apply(o, v.map((f) => (f.path.unshift(R), f)));
|
1989
|
+
} else S !== h && // treat NaN values as equivalent
|
1990
|
+
!(Number.isNaN(S) && Number.isNaN(h)) && !(p && (isNaN(S) ? S + "" == h + "" : +S == +h)) && o.push({
|
1965
1991
|
path: [R],
|
1966
1992
|
type: "CHANGE",
|
1967
1993
|
value: h,
|
1968
|
-
oldValue:
|
1994
|
+
oldValue: S
|
1969
1995
|
});
|
1970
1996
|
}
|
1971
1997
|
const l = Array.isArray(r);
|
@@ -2008,7 +2034,7 @@ var gn = Symbol.for("immer-nothing"), fe = Symbol.for("immer-draftable"), J = Sy
|
|
2008
2034
|
// Note: if more errors are added, the errorOffset in Patches.ts should be increased
|
2009
2035
|
// See Patches.ts for additional errors
|
2010
2036
|
] : [];
|
2011
|
-
function
|
2037
|
+
function G(t, ...r) {
|
2012
2038
|
if (process.env.NODE_ENV !== "production") {
|
2013
2039
|
const n = Zn[t], a = typeof n == "function" ? n.apply(null, r) : n;
|
2014
2040
|
throw new Error(`[Immer] ${a}`);
|
@@ -2101,7 +2127,7 @@ function vn(t, r = !1) {
|
|
2101
2127
|
return tr(t) || xt(t) || !_t(t) || (Mt(t) > 1 && (t.set = t.add = t.clear = t.delete = ta), Object.freeze(t), r && Object.entries(t).forEach(([n, a]) => vn(a, !0))), t;
|
2102
2128
|
}
|
2103
2129
|
function ta() {
|
2104
|
-
|
2130
|
+
G(2);
|
2105
2131
|
}
|
2106
2132
|
function tr(t) {
|
2107
2133
|
return Object.isFrozen(t);
|
@@ -2109,7 +2135,7 @@ function tr(t) {
|
|
2109
2135
|
var ln = {};
|
2110
2136
|
function Pt(t) {
|
2111
2137
|
const r = ln[t];
|
2112
|
-
return r ||
|
2138
|
+
return r || G(0, t), r;
|
2113
2139
|
}
|
2114
2140
|
function ea(t, r) {
|
2115
2141
|
ln[t] || (ln[t] = r);
|
@@ -2148,7 +2174,7 @@ function na(t) {
|
|
2148
2174
|
function Fn(t, r) {
|
2149
2175
|
r.unfinalizedDrafts_ = r.drafts_.length;
|
2150
2176
|
const n = r.drafts_[0];
|
2151
|
-
return t !== void 0 && t !== n ? (n[J].modified_ && (pn(r),
|
2177
|
+
return t !== void 0 && t !== n ? (n[J].modified_ && (pn(r), G(4)), _t(t) && (t = qe(r, t), r.parent_ || Je(r, t)), r.patches_ && Pt("Patches").generateReplacementPatches_(
|
2152
2178
|
n[J].base_,
|
2153
2179
|
t,
|
2154
2180
|
r.patches_,
|
@@ -2174,7 +2200,7 @@ function qe(t, r, n) {
|
|
2174
2200
|
let c = o, l = !1;
|
2175
2201
|
a.type_ === 3 && (c = new Set(o), o.clear(), l = !0), le(
|
2176
2202
|
c,
|
2177
|
-
(d,
|
2203
|
+
(d, E) => Rn(t, a, o, d, E, n, l)
|
2178
2204
|
), Je(t, o, !1), n && t.patches_ && Pt("Patches").generatePatches_(
|
2179
2205
|
a,
|
2180
2206
|
n,
|
@@ -2185,10 +2211,10 @@ function qe(t, r, n) {
|
|
2185
2211
|
return a.copy_;
|
2186
2212
|
}
|
2187
2213
|
function Rn(t, r, n, a, o, c, l) {
|
2188
|
-
if (process.env.NODE_ENV !== "production" && o === n &&
|
2214
|
+
if (process.env.NODE_ENV !== "production" && o === n && G(5), xt(o)) {
|
2189
2215
|
const d = c && r && r.type_ !== 3 && // Set objects are atomic since they have no keys.
|
2190
|
-
!pe(r.assigned_, a) ? c.concat(a) : void 0,
|
2191
|
-
if (ti(n, a,
|
2216
|
+
!pe(r.assigned_, a) ? c.concat(a) : void 0, E = qe(t, o, d);
|
2217
|
+
if (ti(n, a, E), xt(E))
|
2192
2218
|
t.canAutoFreeze_ = !1;
|
2193
2219
|
else
|
2194
2220
|
return;
|
@@ -2278,13 +2304,13 @@ var In = {
|
|
2278
2304
|
};
|
2279
2305
|
},
|
2280
2306
|
defineProperty() {
|
2281
|
-
|
2307
|
+
G(11);
|
2282
2308
|
},
|
2283
2309
|
getPrototypeOf(t) {
|
2284
2310
|
return Ot(t.base_);
|
2285
2311
|
},
|
2286
2312
|
setPrototypeOf() {
|
2287
|
-
|
2313
|
+
G(12);
|
2288
2314
|
}
|
2289
2315
|
}, he = {};
|
2290
2316
|
le(In, (t, r) => {
|
@@ -2293,10 +2319,10 @@ le(In, (t, r) => {
|
|
2293
2319
|
};
|
2294
2320
|
});
|
2295
2321
|
he.deleteProperty = function(t, r) {
|
2296
|
-
return process.env.NODE_ENV !== "production" && isNaN(parseInt(r)) &&
|
2322
|
+
return process.env.NODE_ENV !== "production" && isNaN(parseInt(r)) && G(13), he.set.call(this, t, r, void 0);
|
2297
2323
|
};
|
2298
2324
|
he.set = function(t, r, n) {
|
2299
|
-
return process.env.NODE_ENV !== "production" && r !== "length" && isNaN(parseInt(r)) &&
|
2325
|
+
return process.env.NODE_ENV !== "production" && r !== "length" && isNaN(parseInt(r)) && G(14), In.set.call(this, t[0], r, n, t[0]);
|
2300
2326
|
};
|
2301
2327
|
function Qr(t, r) {
|
2302
2328
|
const n = t[J];
|
@@ -2338,11 +2364,11 @@ var sa = class {
|
|
2338
2364
|
const c = n;
|
2339
2365
|
n = r;
|
2340
2366
|
const l = this;
|
2341
|
-
return function(
|
2342
|
-
return l.produce(
|
2367
|
+
return function(E = c, ...D) {
|
2368
|
+
return l.produce(E, (S) => n.call(this, S, ...D));
|
2343
2369
|
};
|
2344
2370
|
}
|
2345
|
-
typeof n != "function" &&
|
2371
|
+
typeof n != "function" && G(6), a !== void 0 && typeof a != "function" && G(7);
|
2346
2372
|
let o;
|
2347
2373
|
if (_t(r)) {
|
2348
2374
|
const c = jn(this), l = yn(r, void 0);
|
@@ -2360,10 +2386,10 @@ var sa = class {
|
|
2360
2386
|
}
|
2361
2387
|
return o;
|
2362
2388
|
} else
|
2363
|
-
|
2389
|
+
G(1, r);
|
2364
2390
|
}, this.produceWithPatches = (r, n) => {
|
2365
2391
|
if (typeof r == "function")
|
2366
|
-
return (l, ...d) => this.produceWithPatches(l, (
|
2392
|
+
return (l, ...d) => this.produceWithPatches(l, (E) => r(E, ...d));
|
2367
2393
|
let a, o;
|
2368
2394
|
return [this.produce(r, n, (l, d) => {
|
2369
2395
|
a = l, o = d;
|
@@ -2371,13 +2397,13 @@ var sa = class {
|
|
2371
2397
|
}, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
|
2372
2398
|
}
|
2373
2399
|
createDraft(t) {
|
2374
|
-
_t(t) ||
|
2400
|
+
_t(t) || G(8), xt(t) && (t = oa(t));
|
2375
2401
|
const r = jn(this), n = yn(t, void 0);
|
2376
2402
|
return n[J].isManual_ = !0, dn(r), n;
|
2377
2403
|
}
|
2378
2404
|
finishDraft(t, r) {
|
2379
2405
|
const n = t && t[J];
|
2380
|
-
(!n || !n.isManual_) &&
|
2406
|
+
(!n || !n.isManual_) && G(9);
|
2381
2407
|
const { scope_: a } = n;
|
2382
2408
|
return Cn(a, r), Fn(void 0, a);
|
2383
2409
|
}
|
@@ -2419,7 +2445,7 @@ function yn(t, r) {
|
|
2419
2445
|
return (r ? r.scope_ : ei()).drafts_.push(n), n;
|
2420
2446
|
}
|
2421
2447
|
function oa(t) {
|
2422
|
-
return xt(t) ||
|
2448
|
+
return xt(t) || G(10, t), ni(t);
|
2423
2449
|
}
|
2424
2450
|
function ni(t) {
|
2425
2451
|
if (!_t(t) || tr(t))
|
@@ -2448,109 +2474,109 @@ function zn() {
|
|
2448
2474
|
"Patching reserved attributes like __proto__, prototype and constructor is not allowed"
|
2449
2475
|
);
|
2450
2476
|
const r = "replace", n = "add", a = "remove";
|
2451
|
-
function o(h, p,
|
2477
|
+
function o(h, p, v, f) {
|
2452
2478
|
switch (h.type_) {
|
2453
2479
|
case 0:
|
2454
2480
|
case 2:
|
2455
2481
|
return l(
|
2456
2482
|
h,
|
2457
2483
|
p,
|
2458
|
-
|
2484
|
+
v,
|
2459
2485
|
f
|
2460
2486
|
);
|
2461
2487
|
case 1:
|
2462
|
-
return c(h, p,
|
2488
|
+
return c(h, p, v, f);
|
2463
2489
|
case 3:
|
2464
2490
|
return d(
|
2465
2491
|
h,
|
2466
2492
|
p,
|
2467
|
-
|
2493
|
+
v,
|
2468
2494
|
f
|
2469
2495
|
);
|
2470
2496
|
}
|
2471
2497
|
}
|
2472
|
-
function c(h, p,
|
2473
|
-
let { base_:
|
2474
|
-
|
2475
|
-
for (let
|
2476
|
-
if (
|
2477
|
-
const y = p.concat([
|
2478
|
-
|
2498
|
+
function c(h, p, v, f) {
|
2499
|
+
let { base_: _, assigned_: m } = h, g = h.copy_;
|
2500
|
+
g.length < _.length && ([_, g] = [g, _], [v, f] = [f, v]);
|
2501
|
+
for (let b = 0; b < _.length; b++)
|
2502
|
+
if (m[b] && g[b] !== _[b]) {
|
2503
|
+
const y = p.concat([b]);
|
2504
|
+
v.push({
|
2479
2505
|
op: r,
|
2480
2506
|
path: y,
|
2481
2507
|
// Need to maybe clone it, as it can in fact be the original value
|
2482
2508
|
// due to the base/copy inversion at the start of this function
|
2483
|
-
value: R(
|
2509
|
+
value: R(g[b])
|
2484
2510
|
}), f.push({
|
2485
2511
|
op: r,
|
2486
2512
|
path: y,
|
2487
|
-
value: R(b
|
2513
|
+
value: R(_[b])
|
2488
2514
|
});
|
2489
2515
|
}
|
2490
|
-
for (let
|
2491
|
-
const y = p.concat([
|
2492
|
-
|
2516
|
+
for (let b = _.length; b < g.length; b++) {
|
2517
|
+
const y = p.concat([b]);
|
2518
|
+
v.push({
|
2493
2519
|
op: n,
|
2494
2520
|
path: y,
|
2495
2521
|
// Need to maybe clone it, as it can in fact be the original value
|
2496
2522
|
// due to the base/copy inversion at the start of this function
|
2497
|
-
value: R(
|
2523
|
+
value: R(g[b])
|
2498
2524
|
});
|
2499
2525
|
}
|
2500
|
-
for (let
|
2501
|
-
const y = p.concat([
|
2526
|
+
for (let b = g.length - 1; _.length <= b; --b) {
|
2527
|
+
const y = p.concat([b]);
|
2502
2528
|
f.push({
|
2503
2529
|
op: a,
|
2504
2530
|
path: y
|
2505
2531
|
});
|
2506
2532
|
}
|
2507
2533
|
}
|
2508
|
-
function l(h, p,
|
2509
|
-
const { base_:
|
2510
|
-
le(h.assigned_, (
|
2511
|
-
const y = Zr(
|
2512
|
-
if (y === F &&
|
2534
|
+
function l(h, p, v, f) {
|
2535
|
+
const { base_: _, copy_: m } = h;
|
2536
|
+
le(h.assigned_, (g, b) => {
|
2537
|
+
const y = Zr(_, g), F = Zr(m, g), k = b ? pe(_, g) ? r : n : a;
|
2538
|
+
if (y === F && k === r)
|
2513
2539
|
return;
|
2514
|
-
const
|
2515
|
-
|
2516
|
-
|
2540
|
+
const O = p.concat(g);
|
2541
|
+
v.push(k === a ? { op: k, path: O } : { op: k, path: O, value: F }), f.push(
|
2542
|
+
k === n ? { op: a, path: O } : k === a ? { op: n, path: O, value: R(y) } : { op: r, path: O, value: R(y) }
|
2517
2543
|
);
|
2518
2544
|
});
|
2519
2545
|
}
|
2520
|
-
function d(h, p,
|
2521
|
-
let { base_:
|
2522
|
-
|
2523
|
-
if (!
|
2524
|
-
const y = p.concat([
|
2525
|
-
|
2546
|
+
function d(h, p, v, f) {
|
2547
|
+
let { base_: _, copy_: m } = h, g = 0;
|
2548
|
+
_.forEach((b) => {
|
2549
|
+
if (!m.has(b)) {
|
2550
|
+
const y = p.concat([g]);
|
2551
|
+
v.push({
|
2526
2552
|
op: a,
|
2527
2553
|
path: y,
|
2528
|
-
value:
|
2554
|
+
value: b
|
2529
2555
|
}), f.unshift({
|
2530
2556
|
op: n,
|
2531
2557
|
path: y,
|
2532
|
-
value:
|
2558
|
+
value: b
|
2533
2559
|
});
|
2534
2560
|
}
|
2535
|
-
|
2536
|
-
}),
|
2537
|
-
if (!
|
2538
|
-
const y = p.concat([
|
2539
|
-
|
2561
|
+
g++;
|
2562
|
+
}), g = 0, m.forEach((b) => {
|
2563
|
+
if (!_.has(b)) {
|
2564
|
+
const y = p.concat([g]);
|
2565
|
+
v.push({
|
2540
2566
|
op: n,
|
2541
2567
|
path: y,
|
2542
|
-
value:
|
2568
|
+
value: b
|
2543
2569
|
}), f.unshift({
|
2544
2570
|
op: a,
|
2545
2571
|
path: y,
|
2546
|
-
value:
|
2572
|
+
value: b
|
2547
2573
|
});
|
2548
2574
|
}
|
2549
|
-
|
2575
|
+
g++;
|
2550
2576
|
});
|
2551
2577
|
}
|
2552
|
-
function
|
2553
|
-
|
2578
|
+
function E(h, p, v, f) {
|
2579
|
+
v.push({
|
2554
2580
|
op: r,
|
2555
2581
|
path: [],
|
2556
2582
|
value: p === gn ? void 0 : p
|
@@ -2561,75 +2587,75 @@ function zn() {
|
|
2561
2587
|
});
|
2562
2588
|
}
|
2563
2589
|
function D(h, p) {
|
2564
|
-
return p.forEach((
|
2565
|
-
const { path: f, op:
|
2566
|
-
let
|
2590
|
+
return p.forEach((v) => {
|
2591
|
+
const { path: f, op: _ } = v;
|
2592
|
+
let m = h;
|
2567
2593
|
for (let F = 0; F < f.length - 1; F++) {
|
2568
|
-
const
|
2569
|
-
let
|
2570
|
-
typeof
|
2594
|
+
const k = Mt(m);
|
2595
|
+
let O = f[F];
|
2596
|
+
typeof O != "string" && typeof O != "number" && (O = "" + O), (k === 0 || k === 1) && (O === "__proto__" || O === "constructor") && G(19), typeof m == "function" && O === "prototype" && G(19), m = Zr(m, O), typeof m != "object" && G(18, f.join("/"));
|
2571
2597
|
}
|
2572
|
-
const
|
2573
|
-
switch (
|
2598
|
+
const g = Mt(m), b = S(v.value), y = f[f.length - 1];
|
2599
|
+
switch (_) {
|
2574
2600
|
case r:
|
2575
|
-
switch (
|
2601
|
+
switch (g) {
|
2576
2602
|
case 2:
|
2577
|
-
return
|
2603
|
+
return m.set(y, b);
|
2578
2604
|
case 3:
|
2579
|
-
|
2605
|
+
G(16);
|
2580
2606
|
default:
|
2581
|
-
return
|
2607
|
+
return m[y] = b;
|
2582
2608
|
}
|
2583
2609
|
case n:
|
2584
|
-
switch (
|
2610
|
+
switch (g) {
|
2585
2611
|
case 1:
|
2586
|
-
return y === "-" ?
|
2612
|
+
return y === "-" ? m.push(b) : m.splice(y, 0, b);
|
2587
2613
|
case 2:
|
2588
|
-
return
|
2614
|
+
return m.set(y, b);
|
2589
2615
|
case 3:
|
2590
|
-
return
|
2616
|
+
return m.add(b);
|
2591
2617
|
default:
|
2592
|
-
return
|
2618
|
+
return m[y] = b;
|
2593
2619
|
}
|
2594
2620
|
case a:
|
2595
|
-
switch (
|
2621
|
+
switch (g) {
|
2596
2622
|
case 1:
|
2597
|
-
return
|
2623
|
+
return m.splice(y, 1);
|
2598
2624
|
case 2:
|
2599
|
-
return
|
2625
|
+
return m.delete(y);
|
2600
2626
|
case 3:
|
2601
|
-
return
|
2627
|
+
return m.delete(v.value);
|
2602
2628
|
default:
|
2603
|
-
return delete
|
2629
|
+
return delete m[y];
|
2604
2630
|
}
|
2605
2631
|
default:
|
2606
|
-
|
2632
|
+
G(17, _);
|
2607
2633
|
}
|
2608
2634
|
}), h;
|
2609
2635
|
}
|
2610
|
-
function
|
2636
|
+
function S(h) {
|
2611
2637
|
if (!_t(h))
|
2612
2638
|
return h;
|
2613
2639
|
if (Array.isArray(h))
|
2614
|
-
return h.map(
|
2640
|
+
return h.map(S);
|
2615
2641
|
if (me(h))
|
2616
2642
|
return new Map(
|
2617
|
-
Array.from(h.entries()).map(([
|
2643
|
+
Array.from(h.entries()).map(([v, f]) => [v, S(f)])
|
2618
2644
|
);
|
2619
2645
|
if (be(h))
|
2620
|
-
return new Set(Array.from(h).map(
|
2646
|
+
return new Set(Array.from(h).map(S));
|
2621
2647
|
const p = Object.create(Ot(h));
|
2622
|
-
for (const
|
2623
|
-
p[
|
2648
|
+
for (const v in h)
|
2649
|
+
p[v] = S(h[v]);
|
2624
2650
|
return pe(h, fe) && (p[fe] = h[fe]), p;
|
2625
2651
|
}
|
2626
2652
|
function R(h) {
|
2627
|
-
return xt(h) ?
|
2653
|
+
return xt(h) ? S(h) : h;
|
2628
2654
|
}
|
2629
2655
|
ea("Patches", {
|
2630
2656
|
applyPatches_: D,
|
2631
2657
|
generatePatches_: o,
|
2632
|
-
generateReplacementPatches_:
|
2658
|
+
generateReplacementPatches_: E
|
2633
2659
|
});
|
2634
2660
|
}
|
2635
2661
|
var Z = new sa(), ca = Z.produce;
|
@@ -2868,60 +2894,60 @@ class Ba {
|
|
2868
2894
|
trackItemIds: c,
|
2869
2895
|
tracks: l,
|
2870
2896
|
transitionIds: d,
|
2871
|
-
transitionsMap:
|
2897
|
+
transitionsMap: E,
|
2872
2898
|
trackItemsMap: D
|
2873
|
-
} = this.getState(),
|
2899
|
+
} = this.getState(), S = tt({
|
2874
2900
|
trackItemDetailsMap: o,
|
2875
2901
|
trackItemIds: c,
|
2876
2902
|
tracks: l,
|
2877
2903
|
transitionIds: d,
|
2878
|
-
transitionsMap:
|
2904
|
+
transitionsMap: E,
|
2879
2905
|
trackItemsMap: D
|
2880
|
-
}), R = [], h = [], p = [],
|
2881
|
-
n.forEach((
|
2882
|
-
let
|
2883
|
-
const
|
2884
|
-
|
2885
|
-
path:
|
2906
|
+
}), R = [], h = [], p = [], v = [], f = [], _ = [];
|
2907
|
+
n.forEach((w) => {
|
2908
|
+
let T;
|
2909
|
+
const H = w.path.slice(1);
|
2910
|
+
w.type === "CREATE" ? T = {
|
2911
|
+
path: H,
|
2886
2912
|
op: "remove",
|
2887
|
-
value:
|
2888
|
-
} :
|
2889
|
-
path:
|
2913
|
+
value: w.value
|
2914
|
+
} : w.type === "CHANGE" ? T = {
|
2915
|
+
path: H,
|
2890
2916
|
op: "replace",
|
2891
|
-
value:
|
2892
|
-
} :
|
2893
|
-
path:
|
2917
|
+
value: w.oldValue
|
2918
|
+
} : T = {
|
2919
|
+
path: H,
|
2894
2920
|
op: "add",
|
2895
|
-
value:
|
2896
|
-
},
|
2921
|
+
value: w.oldValue
|
2922
|
+
}, w.path.includes("trackItemIds") ? p.push(T) : w.path.includes("transitionIds") ? h.push(T) : w.path.includes("trackItemsMap") ? f.push(T) : w.path.includes("transitionsMap") ? v.push(T) : w.path.includes("tracks") ? R.push(T) : w.path.includes("trackItemDetailsMap") && _.push(T);
|
2897
2923
|
});
|
2898
|
-
const
|
2899
|
-
|
2924
|
+
const m = this.applyPatch(
|
2925
|
+
S.tracks,
|
2900
2926
|
R
|
2901
|
-
),
|
2902
|
-
|
2927
|
+
), g = this.applyPatch(
|
2928
|
+
S.transitionIds,
|
2903
2929
|
h
|
2904
|
-
),
|
2905
|
-
|
2930
|
+
), b = this.applyPatch(
|
2931
|
+
S.trackItemIds,
|
2906
2932
|
p
|
2907
2933
|
), y = this.applyPatch(
|
2908
|
-
|
2909
|
-
|
2934
|
+
S.transitionsMap,
|
2935
|
+
v
|
2910
2936
|
), F = this.applyPatch(
|
2911
|
-
|
2937
|
+
S.trackItemsMap,
|
2912
2938
|
f
|
2913
|
-
),
|
2914
|
-
|
2915
|
-
|
2916
|
-
),
|
2917
|
-
tracks:
|
2918
|
-
transitionIds:
|
2919
|
-
trackItemIds:
|
2939
|
+
), k = this.applyPatch(
|
2940
|
+
S.trackItemDetailsMap,
|
2941
|
+
_
|
2942
|
+
), O = tt({
|
2943
|
+
tracks: m,
|
2944
|
+
transitionIds: g,
|
2945
|
+
trackItemIds: b,
|
2920
2946
|
transitionsMap: y,
|
2921
2947
|
trackItemsMap: F,
|
2922
|
-
trackItemDetailsMap:
|
2923
|
-
}),
|
2924
|
-
this.prevState =
|
2948
|
+
trackItemDetailsMap: k
|
2949
|
+
}), N = tt(this.getState()), z = { ...N, ...O };
|
2950
|
+
this.prevState = N, this.redos.push({ redos: n, type: a }), this.stateSubject.next(z), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 });
|
2925
2951
|
}
|
2926
2952
|
applyPatch(r, n) {
|
2927
2953
|
return n.reverse().reduce((a, o) => ca(a, (c) => {
|
@@ -2937,60 +2963,60 @@ class Ba {
|
|
2937
2963
|
trackItemIds: c,
|
2938
2964
|
tracks: l,
|
2939
2965
|
transitionIds: d,
|
2940
|
-
transitionsMap:
|
2966
|
+
transitionsMap: E,
|
2941
2967
|
trackItemsMap: D
|
2942
|
-
} = this.getState(),
|
2968
|
+
} = this.getState(), S = tt({
|
2943
2969
|
trackItemDetailsMap: o,
|
2944
2970
|
trackItemIds: c,
|
2945
2971
|
tracks: l,
|
2946
2972
|
transitionIds: d,
|
2947
|
-
transitionsMap:
|
2973
|
+
transitionsMap: E,
|
2948
2974
|
trackItemsMap: D
|
2949
|
-
}), R = [], h = [], p = [],
|
2950
|
-
n.forEach((
|
2951
|
-
let
|
2952
|
-
const
|
2953
|
-
|
2954
|
-
path:
|
2975
|
+
}), R = [], h = [], p = [], v = [], f = [], _ = [];
|
2976
|
+
n.forEach((w) => {
|
2977
|
+
let T;
|
2978
|
+
const H = w.path.slice(1);
|
2979
|
+
w.type === "CREATE" ? T = {
|
2980
|
+
path: H,
|
2955
2981
|
op: "add",
|
2956
|
-
value:
|
2957
|
-
} :
|
2958
|
-
path:
|
2982
|
+
value: w.value
|
2983
|
+
} : w.type === "CHANGE" ? T = {
|
2984
|
+
path: H,
|
2959
2985
|
op: "replace",
|
2960
|
-
value:
|
2961
|
-
} :
|
2962
|
-
path:
|
2986
|
+
value: w.value
|
2987
|
+
} : T = {
|
2988
|
+
path: H,
|
2963
2989
|
op: "remove",
|
2964
|
-
value:
|
2965
|
-
},
|
2990
|
+
value: w.oldValue
|
2991
|
+
}, w.path.includes("trackItemIds") ? p.push(T) : w.path.includes("transitionIds") ? h.push(T) : w.path.includes("trackItemsMap") ? f.push(T) : w.path.includes("transitionsMap") ? v.push(T) : w.path.includes("trackItemDetailsMap") ? _.push(T) : R.push(T);
|
2966
2992
|
});
|
2967
|
-
const
|
2968
|
-
|
2993
|
+
const m = this.applyPatch(
|
2994
|
+
S.tracks,
|
2969
2995
|
R
|
2970
|
-
),
|
2971
|
-
|
2996
|
+
), g = this.applyPatch(
|
2997
|
+
S.transitionIds,
|
2972
2998
|
h
|
2973
|
-
),
|
2974
|
-
|
2999
|
+
), b = this.applyPatch(
|
3000
|
+
S.trackItemIds,
|
2975
3001
|
p
|
2976
3002
|
), y = this.applyPatch(
|
2977
|
-
|
2978
|
-
|
3003
|
+
S.transitionsMap,
|
3004
|
+
v
|
2979
3005
|
), F = this.applyPatch(
|
2980
|
-
|
3006
|
+
S.trackItemsMap,
|
2981
3007
|
f
|
2982
|
-
),
|
2983
|
-
|
2984
|
-
|
2985
|
-
),
|
2986
|
-
tracks:
|
2987
|
-
transitionIds:
|
2988
|
-
trackItemIds:
|
3008
|
+
), k = this.applyPatch(
|
3009
|
+
S.trackItemDetailsMap,
|
3010
|
+
_
|
3011
|
+
), O = tt({
|
3012
|
+
tracks: m,
|
3013
|
+
transitionIds: g,
|
3014
|
+
trackItemIds: b,
|
2989
3015
|
transitionsMap: y,
|
2990
3016
|
trackItemsMap: F,
|
2991
|
-
trackItemDetailsMap:
|
2992
|
-
}),
|
2993
|
-
this.prevState =
|
3017
|
+
trackItemDetailsMap: k
|
3018
|
+
}), N = tt(this.getState()), z = { ...N, ...O };
|
3019
|
+
this.prevState = N, this.undos.push({ undos: n, type: a }), this.stateSubject.next(z), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 });
|
2994
3020
|
}
|
2995
3021
|
}
|
2996
3022
|
export {
|