@designcombo/state 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +309 -322
- package/dist/index.umd.js +1 -1
- package/package.json +6 -6
package/dist/index.es.js
CHANGED
@@ -87,8 +87,8 @@ var tr = function() {
|
|
87
87
|
if (this._parentage = null, Array.isArray(f))
|
88
88
|
try {
|
89
89
|
for (var d = sn(f), E = d.next(); !E.done; E = d.next()) {
|
90
|
-
var
|
91
|
-
|
90
|
+
var j = E.value;
|
91
|
+
j.remove(this);
|
92
92
|
}
|
93
93
|
} catch (l) {
|
94
94
|
r = { error: l };
|
@@ -112,7 +112,7 @@ var tr = function() {
|
|
112
112
|
if (N) {
|
113
113
|
this._finalizers = null;
|
114
114
|
try {
|
115
|
-
for (var
|
115
|
+
for (var m = sn(N), p = m.next(); !p.done; p = m.next()) {
|
116
116
|
var h = p.value;
|
117
117
|
try {
|
118
118
|
kn(h);
|
@@ -124,7 +124,7 @@ var tr = function() {
|
|
124
124
|
i = { error: l };
|
125
125
|
} finally {
|
126
126
|
try {
|
127
|
-
p && !p.done && (o =
|
127
|
+
p && !p.done && (o = m.return) && o.call(m);
|
128
128
|
} finally {
|
129
129
|
if (i) throw i.error;
|
130
130
|
}
|
@@ -408,8 +408,8 @@ var zi = Gn(function(t) {
|
|
408
408
|
var E = d.value;
|
409
409
|
E.next(n);
|
410
410
|
}
|
411
|
-
} catch (
|
412
|
-
o = { error:
|
411
|
+
} catch (j) {
|
412
|
+
o = { error: j };
|
413
413
|
} finally {
|
414
414
|
try {
|
415
415
|
d && !d.done && (c = f.return) && c.call(f);
|
@@ -513,8 +513,8 @@ function gn(t) {
|
|
513
513
|
var Xe = { exports: {} };
|
514
514
|
Xe.exports;
|
515
515
|
(function(t, r) {
|
516
|
-
var n = 200, i = "__lodash_hash_undefined__", o = 1, c = 2, f = 9007199254740991, d = "[object Arguments]", E = "[object Array]",
|
517
|
-
H[Dt] = H[Ct] = H[Ie] = H[ir] = H[ar] = H[sr] = H[or] = H[z] = H[cr] = !0, H[d] = H[E] = H[
|
516
|
+
var n = 200, i = "__lodash_hash_undefined__", o = 1, c = 2, f = 9007199254740991, d = "[object Arguments]", E = "[object Array]", j = "[object AsyncFunction]", S = "[object Boolean]", N = "[object Date]", m = "[object Error]", p = "[object Function]", h = "[object GeneratorFunction]", l = "[object Map]", g = "[object Number]", v = "[object Null]", _ = "[object Object]", b = "[object Promise]", y = "[object Proxy]", R = "[object RegExp]", A = "[object Set]", O = "[object String]", D = "[object Symbol]", w = "[object Undefined]", T = "[object WeakMap]", x = "[object ArrayBuffer]", F = "[object DataView]", Dt = "[object Float32Array]", Ct = "[object Float64Array]", Ie = "[object Int8Array]", ir = "[object Int16Array]", ar = "[object Int32Array]", sr = "[object Uint8Array]", or = "[object Uint8ClampedArray]", z = "[object Uint16Array]", cr = "[object Uint32Array]", ur = /[\\^$.*+?()[\]{}|]/g, rt = /^\[object .+?Constructor\]$/, Se = /^(?:0|[1-9]\d*)$/, H = {};
|
517
|
+
H[Dt] = H[Ct] = H[Ie] = H[ir] = H[ar] = H[sr] = H[or] = H[z] = H[cr] = !0, H[d] = H[E] = H[x] = H[S] = H[F] = H[N] = H[m] = H[p] = H[l] = H[g] = H[_] = H[R] = H[A] = H[O] = H[T] = !1;
|
518
518
|
var we = typeof et == "object" && et && et.Object === Object && et, lr = typeof self == "object" && self && self.Object === Object && self, nt = we || lr || Function("return this")(), Te = r && !r.nodeType && r, ke = Te && !0 && t && !t.nodeType && t, Yt = ke && ke.exports === Te, Vt = Yt && we.process, Ae = function() {
|
519
519
|
try {
|
520
520
|
return Vt && Vt.binding && Vt.binding("util");
|
@@ -523,8 +523,8 @@ Xe.exports;
|
|
523
523
|
}(), Xt = Ae && Ae.isTypedArray;
|
524
524
|
function Ee(e, a) {
|
525
525
|
for (var s = -1, u = e == null ? 0 : e.length, k = 0, I = []; ++s < u; ) {
|
526
|
-
var
|
527
|
-
a(
|
526
|
+
var P = e[s];
|
527
|
+
a(P, s, e) && (I[k++] = P);
|
528
528
|
}
|
529
529
|
return I;
|
530
530
|
}
|
@@ -708,14 +708,14 @@ Xe.exports;
|
|
708
708
|
}
|
709
709
|
ct.prototype.clear = se, ct.prototype.delete = Cr, ct.prototype.get = jr, ct.prototype.has = Rr, ct.prototype.set = Fr;
|
710
710
|
function zr(e, a) {
|
711
|
-
var s = Wt(e), u = !s && Le(e), k = !s && !u && Bt(e), I = !s && !u && !k && Be(e),
|
712
|
-
for (var
|
713
|
-
Q.call(e,
|
714
|
-
(
|
715
|
-
k && (
|
716
|
-
I && (
|
717
|
-
$r(
|
718
|
-
return
|
711
|
+
var s = Wt(e), u = !s && Le(e), k = !s && !u && Bt(e), I = !s && !u && !k && Be(e), P = s || u || k || I, M = P ? fr(e.length, String) : [], U = M.length;
|
712
|
+
for (var C in e)
|
713
|
+
Q.call(e, C) && !(P && // Safari 9 has enumerable `arguments.length` in strict mode.
|
714
|
+
(C == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
715
|
+
k && (C == "offset" || C == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
716
|
+
I && (C == "buffer" || C == "byteLength" || C == "byteOffset") || // Skip index properties.
|
717
|
+
$r(C, U))) && M.push(C);
|
718
|
+
return M;
|
719
719
|
}
|
720
720
|
function Gt(e, a) {
|
721
721
|
for (var s = e.length; s--; )
|
@@ -737,16 +737,16 @@ Xe.exports;
|
|
737
737
|
return e === a ? !0 : e == null || a == null || !lt(e) && !lt(a) ? e !== e && a !== a : Hr(e, a, s, u, He, k);
|
738
738
|
}
|
739
739
|
function Hr(e, a, s, u, k, I) {
|
740
|
-
var
|
741
|
-
U = U == d ? _ : U,
|
742
|
-
var K = U == _, q =
|
740
|
+
var P = Wt(e), M = Wt(a), U = P ? E : ut(e), C = M ? E : ut(a);
|
741
|
+
U = U == d ? _ : U, C = C == d ? _ : C;
|
742
|
+
var K = U == _, q = C == _, L = U == C;
|
743
743
|
if (L && Bt(e)) {
|
744
744
|
if (!Bt(a))
|
745
745
|
return !1;
|
746
|
-
|
746
|
+
P = !0, K = !1;
|
747
747
|
}
|
748
748
|
if (L && !K)
|
749
|
-
return I || (I = new ct()),
|
749
|
+
return I || (I = new ct()), P || Be(e) ? ce(e, a, s, u, k, I) : Gr(e, a, U, s, u, k, I);
|
750
750
|
if (!(s & o)) {
|
751
751
|
var Y = K && Q.call(e, "__wrapped__"), B = q && Q.call(a, "__wrapped__");
|
752
752
|
if (Y || B) {
|
@@ -774,17 +774,17 @@ Xe.exports;
|
|
774
774
|
return a;
|
775
775
|
}
|
776
776
|
function ce(e, a, s, u, k, I) {
|
777
|
-
var
|
778
|
-
if (
|
777
|
+
var P = s & o, M = e.length, U = a.length;
|
778
|
+
if (M != U && !(P && U > M))
|
779
779
|
return !1;
|
780
|
-
var
|
781
|
-
if (
|
782
|
-
return
|
780
|
+
var C = I.get(e);
|
781
|
+
if (C && I.get(a))
|
782
|
+
return C == a;
|
783
783
|
var K = -1, q = !0, L = s & c ? new Ut() : void 0;
|
784
|
-
for (I.set(e, a), I.set(a, e); ++K <
|
784
|
+
for (I.set(e, a), I.set(a, e); ++K < M; ) {
|
785
785
|
var Y = e[K], B = a[K];
|
786
786
|
if (u)
|
787
|
-
var bt =
|
787
|
+
var bt = P ? u(B, Y, K, a, e, I) : u(Y, B, K, e, a, I);
|
788
788
|
if (bt !== void 0) {
|
789
789
|
if (bt)
|
790
790
|
continue;
|
@@ -806,48 +806,48 @@ Xe.exports;
|
|
806
806
|
}
|
807
807
|
return I.delete(e), I.delete(a), q;
|
808
808
|
}
|
809
|
-
function Gr(e, a, s, u, k, I,
|
809
|
+
function Gr(e, a, s, u, k, I, P) {
|
810
810
|
switch (s) {
|
811
811
|
case F:
|
812
812
|
if (e.byteLength != a.byteLength || e.byteOffset != a.byteOffset)
|
813
813
|
return !1;
|
814
814
|
e = e.buffer, a = a.buffer;
|
815
|
-
case
|
815
|
+
case x:
|
816
816
|
return !(e.byteLength != a.byteLength || !I(new Ce(e), new Ce(a)));
|
817
817
|
case S:
|
818
818
|
case N:
|
819
819
|
case g:
|
820
820
|
return Ue(+e, +a);
|
821
|
-
case
|
821
|
+
case m:
|
822
822
|
return e.name == a.name && e.message == a.message;
|
823
|
-
case
|
824
|
-
case
|
823
|
+
case R:
|
824
|
+
case O:
|
825
825
|
return e == a + "";
|
826
826
|
case l:
|
827
|
-
var
|
828
|
-
case
|
827
|
+
var M = xe;
|
828
|
+
case A:
|
829
829
|
var U = u & o;
|
830
|
-
if (
|
830
|
+
if (M || (M = ot), e.size != a.size && !U)
|
831
831
|
return !1;
|
832
|
-
var
|
833
|
-
if (
|
834
|
-
return
|
835
|
-
u |= c,
|
836
|
-
var K = ce(
|
837
|
-
return
|
838
|
-
case
|
832
|
+
var C = P.get(e);
|
833
|
+
if (C)
|
834
|
+
return C == a;
|
835
|
+
u |= c, P.set(e, a);
|
836
|
+
var K = ce(M(e), M(a), u, k, I, P);
|
837
|
+
return P.delete(e), K;
|
838
|
+
case D:
|
839
839
|
if (ae)
|
840
840
|
return ae.call(e) == ae.call(a);
|
841
841
|
}
|
842
842
|
return !1;
|
843
843
|
}
|
844
844
|
function Wr(e, a, s, u, k, I) {
|
845
|
-
var
|
846
|
-
if (U != K && !
|
845
|
+
var P = s & o, M = Tt(e), U = M.length, C = Tt(a), K = C.length;
|
846
|
+
if (U != K && !P)
|
847
847
|
return !1;
|
848
848
|
for (var q = U; q--; ) {
|
849
|
-
var L =
|
850
|
-
if (!(
|
849
|
+
var L = M[q];
|
850
|
+
if (!(P ? L in a : Q.call(a, L)))
|
851
851
|
return !1;
|
852
852
|
}
|
853
853
|
var Y = I.get(e);
|
@@ -855,11 +855,11 @@ Xe.exports;
|
|
855
855
|
return Y == a;
|
856
856
|
var B = !0;
|
857
857
|
I.set(e, a), I.set(a, e);
|
858
|
-
for (var bt =
|
859
|
-
L =
|
858
|
+
for (var bt = P; ++q < U; ) {
|
859
|
+
L = M[q];
|
860
860
|
var ht = e[L], kt = a[L];
|
861
861
|
if (u)
|
862
|
-
var Tn =
|
862
|
+
var Tn = P ? u(kt, ht, L, a, e, I) : u(ht, kt, L, e, a, I);
|
863
863
|
if (!(Tn === void 0 ? ht === kt || k(ht, kt, s, u, I) : Tn)) {
|
864
864
|
B = !1;
|
865
865
|
break;
|
@@ -898,7 +898,7 @@ Xe.exports;
|
|
898
898
|
return Ht.call(e, a);
|
899
899
|
}));
|
900
900
|
} : qr, ut = wt;
|
901
|
-
(ee && ut(new ee(new ArrayBuffer(1))) != F || St && ut(new St()) != l || re && ut(re.resolve()) !=
|
901
|
+
(ee && ut(new ee(new ArrayBuffer(1))) != F || St && ut(new St()) != l || re && ut(re.resolve()) != b || ne && ut(new ne()) != A || ie && ut(new ie()) != T) && (ut = function(e) {
|
902
902
|
var a = wt(e), s = a == _ ? e.constructor : void 0, u = s ? V(s) : "";
|
903
903
|
if (u)
|
904
904
|
switch (u) {
|
@@ -907,9 +907,9 @@ Xe.exports;
|
|
907
907
|
case ft:
|
908
908
|
return l;
|
909
909
|
case yr:
|
910
|
-
return
|
910
|
+
return b;
|
911
911
|
case mr:
|
912
|
-
return
|
912
|
+
return A;
|
913
913
|
case br:
|
914
914
|
return T;
|
915
915
|
}
|
@@ -964,7 +964,7 @@ Xe.exports;
|
|
964
964
|
if (!We(e))
|
965
965
|
return !1;
|
966
966
|
var a = wt(e);
|
967
|
-
return a == p || a == h || a ==
|
967
|
+
return a == p || a == h || a == j || a == y;
|
968
968
|
}
|
969
969
|
function le(e) {
|
970
970
|
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= f;
|
@@ -993,8 +993,8 @@ const st = /* @__PURE__ */ gn(Hi);
|
|
993
993
|
var qe = { exports: {} };
|
994
994
|
qe.exports;
|
995
995
|
(function(t, r) {
|
996
|
-
var n = 200, i = "__lodash_hash_undefined__", o = 9007199254740991, c = "[object Arguments]", f = "[object Array]", d = "[object Boolean]", E = "[object Date]",
|
997
|
-
z[c] = z[f] = z[
|
996
|
+
var n = 200, i = "__lodash_hash_undefined__", o = 9007199254740991, c = "[object Arguments]", f = "[object Array]", d = "[object Boolean]", E = "[object Date]", j = "[object Error]", S = "[object Function]", N = "[object GeneratorFunction]", m = "[object Map]", p = "[object Number]", h = "[object Object]", l = "[object Promise]", g = "[object RegExp]", v = "[object Set]", _ = "[object String]", b = "[object Symbol]", y = "[object WeakMap]", R = "[object ArrayBuffer]", A = "[object DataView]", O = "[object Float32Array]", D = "[object Float64Array]", w = "[object Int8Array]", T = "[object Int16Array]", x = "[object Int32Array]", F = "[object Uint8Array]", Dt = "[object Uint8ClampedArray]", Ct = "[object Uint16Array]", Ie = "[object Uint32Array]", ir = /[\\^$.*+?()[\]{}|]/g, ar = /\w*$/, sr = /^\[object .+?Constructor\]$/, or = /^(?:0|[1-9]\d*)$/, z = {};
|
997
|
+
z[c] = z[f] = z[R] = z[A] = z[d] = z[E] = z[O] = z[D] = z[w] = z[T] = z[x] = z[m] = z[p] = z[h] = z[g] = z[v] = z[_] = z[b] = z[F] = z[Dt] = z[Ct] = z[Ie] = !0, z[j] = z[S] = z[y] = !1;
|
998
998
|
var cr = typeof et == "object" && et && et.Object === Object && et, ur = typeof self == "object" && self && self.Object === Object && self, rt = cr || ur || Function("return this")(), Se = r && !r.nodeType && r, H = Se && !0 && t && !t.nodeType && t, we = H && H.exports === Se;
|
999
999
|
function lr(e, a) {
|
1000
1000
|
return e.set(a[0], a[1]), e;
|
@@ -1188,40 +1188,40 @@ qe.exports;
|
|
1188
1188
|
function ct(e, a) {
|
1189
1189
|
return e && ce(a, fe(a), e);
|
1190
1190
|
}
|
1191
|
-
function se(e, a, s, u, k, I,
|
1192
|
-
var
|
1193
|
-
if (u && (
|
1194
|
-
return
|
1191
|
+
function se(e, a, s, u, k, I, P) {
|
1192
|
+
var M;
|
1193
|
+
if (u && (M = I ? u(e, k, I, P) : u(e)), M !== void 0)
|
1194
|
+
return M;
|
1195
1195
|
if (!lt(e))
|
1196
1196
|
return e;
|
1197
1197
|
var U = ue(e);
|
1198
1198
|
if (U) {
|
1199
|
-
if (
|
1200
|
-
return Lr(e,
|
1199
|
+
if (M = Br(e), !a)
|
1200
|
+
return Lr(e, M);
|
1201
1201
|
} else {
|
1202
|
-
var
|
1202
|
+
var C = dt(e), K = C == S || C == N;
|
1203
1203
|
if (Ge(e))
|
1204
1204
|
return Gt(e, a);
|
1205
|
-
if (
|
1205
|
+
if (C == h || C == c || K && !I) {
|
1206
1206
|
if (Xt(e))
|
1207
1207
|
return I ? e : {};
|
1208
|
-
if (
|
1209
|
-
return Gr(e, ct(
|
1208
|
+
if (M = ut(K ? {} : e), !a)
|
1209
|
+
return Gr(e, ct(M, e));
|
1210
1210
|
} else {
|
1211
|
-
if (!z[
|
1211
|
+
if (!z[C])
|
1212
1212
|
return I ? e : {};
|
1213
|
-
|
1213
|
+
M = $r(e, C, se, a);
|
1214
1214
|
}
|
1215
1215
|
}
|
1216
|
-
|
1217
|
-
var q =
|
1216
|
+
P || (P = new X());
|
1217
|
+
var q = P.get(e);
|
1218
1218
|
if (q)
|
1219
1219
|
return q;
|
1220
|
-
if (
|
1220
|
+
if (P.set(e, M), !U)
|
1221
1221
|
var L = s ? Wr(e) : fe(e);
|
1222
1222
|
return Te(L || e, function(Y, B) {
|
1223
|
-
L && (B = Y, Y = e[B]), Fe(
|
1224
|
-
}),
|
1223
|
+
L && (B = Y, Y = e[B]), Fe(M, B, se(Y, a, s, u, B, e, P));
|
1224
|
+
}), M;
|
1225
1225
|
}
|
1226
1226
|
function Cr(e) {
|
1227
1227
|
return lt(e) ? Pe(e) : {};
|
@@ -1289,8 +1289,8 @@ qe.exports;
|
|
1289
1289
|
function ce(e, a, s, u) {
|
1290
1290
|
s || (s = {});
|
1291
1291
|
for (var k = -1, I = a.length; ++k < I; ) {
|
1292
|
-
var
|
1293
|
-
Fe(s,
|
1292
|
+
var P = a[k], M = void 0;
|
1293
|
+
Fe(s, P, M === void 0 ? e[P] : M);
|
1294
1294
|
}
|
1295
1295
|
return s;
|
1296
1296
|
}
|
@@ -1309,20 +1309,20 @@ qe.exports;
|
|
1309
1309
|
return Fr(s) ? s : void 0;
|
1310
1310
|
}
|
1311
1311
|
var pt = Qt ? qt(Qt, Object) : qr, dt = Rr;
|
1312
|
-
(Ht && dt(new Ht(new ArrayBuffer(1))) !=
|
1312
|
+
(Ht && dt(new Ht(new ArrayBuffer(1))) != A || vt && dt(new vt()) != m || it && dt(it.resolve()) != l || Nt && dt(new Nt()) != v || te && dt(new te()) != y) && (dt = function(e) {
|
1313
1313
|
var a = Rt.call(e), s = a == h ? e.constructor : void 0, u = s ? V(s) : void 0;
|
1314
1314
|
if (u)
|
1315
1315
|
switch (u) {
|
1316
1316
|
case ee:
|
1317
|
-
return
|
1317
|
+
return A;
|
1318
1318
|
case St:
|
1319
|
-
return
|
1319
|
+
return m;
|
1320
1320
|
case re:
|
1321
1321
|
return l;
|
1322
1322
|
case ne:
|
1323
1323
|
return v;
|
1324
1324
|
case ie:
|
1325
|
-
return
|
1325
|
+
return y;
|
1326
1326
|
}
|
1327
1327
|
return a;
|
1328
1328
|
});
|
@@ -1336,24 +1336,24 @@ qe.exports;
|
|
1336
1336
|
function $r(e, a, s, u) {
|
1337
1337
|
var k = e.constructor;
|
1338
1338
|
switch (a) {
|
1339
|
-
case
|
1339
|
+
case R:
|
1340
1340
|
return oe(e);
|
1341
1341
|
case d:
|
1342
1342
|
case E:
|
1343
1343
|
return new k(+e);
|
1344
|
-
case O:
|
1345
|
-
return wt(e, u);
|
1346
1344
|
case A:
|
1347
|
-
|
1345
|
+
return wt(e, u);
|
1346
|
+
case O:
|
1347
|
+
case D:
|
1348
1348
|
case w:
|
1349
1349
|
case T:
|
1350
|
-
case
|
1350
|
+
case x:
|
1351
1351
|
case F:
|
1352
1352
|
case Dt:
|
1353
1353
|
case Ct:
|
1354
1354
|
case Ie:
|
1355
1355
|
return Ur(e, u);
|
1356
|
-
case
|
1356
|
+
case m:
|
1357
1357
|
return ze(e, u, s);
|
1358
1358
|
case p:
|
1359
1359
|
case _:
|
@@ -1362,7 +1362,7 @@ qe.exports;
|
|
1362
1362
|
return He(e);
|
1363
1363
|
case v:
|
1364
1364
|
return Hr(e, u, s);
|
1365
|
-
case
|
1365
|
+
case b:
|
1366
1366
|
return Nr(e);
|
1367
1367
|
}
|
1368
1368
|
}
|
@@ -1768,12 +1768,12 @@ function qi(t) {
|
|
1768
1768
|
), d = r.subscribe(async (p) => {
|
1769
1769
|
var h;
|
1770
1770
|
if (p.key === hi) {
|
1771
|
-
const l = (h = p.value) == null ? void 0 : h.payload, g = l.trackItemIds, v = l.trackItemDetailsMap, _ = g.map(async (
|
1772
|
-
const
|
1773
|
-
return (
|
1771
|
+
const l = (h = p.value) == null ? void 0 : h.payload, g = l.trackItemIds, v = l.trackItemDetailsMap, _ = g.map(async (b) => {
|
1772
|
+
const y = v[b];
|
1773
|
+
return (y.type === "caption" || y.type === "text") && await Je([
|
1774
1774
|
{
|
1775
|
-
fontFamily:
|
1776
|
-
url:
|
1775
|
+
fontFamily: y.details.fontFamily,
|
1776
|
+
url: y.details.fontUrl
|
1777
1777
|
}
|
1778
1778
|
]), !0;
|
1779
1779
|
});
|
@@ -1784,56 +1784,56 @@ function qi(t) {
|
|
1784
1784
|
}), E = o.subscribe((p) => {
|
1785
1785
|
if (p.key === yi) return t.undo();
|
1786
1786
|
if (p.key === mi) return t.redo();
|
1787
|
-
}),
|
1787
|
+
}), j = i.subscribe((p) => {
|
1788
1788
|
var l, g, v;
|
1789
1789
|
const h = [];
|
1790
1790
|
if ((l = p.value) != null && l.payload.trackItemIds && (h.push((g = p.value) == null ? void 0 : g.payload.trackItemIds), t.updateState({ activeIds: h })), p.key === bi) {
|
1791
|
-
const _ = (v = p.value) == null ? void 0 : v.payload.trackItemIds,
|
1792
|
-
(F) => !
|
1793
|
-
),
|
1794
|
-
Object.entries(
|
1795
|
-
([F]) => !
|
1791
|
+
const _ = (v = p.value) == null ? void 0 : v.payload.trackItemIds, b = tt(t.getState()), y = _ && _.length ? _ : b.activeIds, R = b.trackItemIds, A = b.trackItemDetailsMap, O = R.filter(
|
1792
|
+
(F) => !y.includes(F)
|
1793
|
+
), D = Object.fromEntries(
|
1794
|
+
Object.entries(A).filter(
|
1795
|
+
([F]) => !y.includes(F)
|
1796
1796
|
)
|
1797
1797
|
), w = Xi(
|
1798
|
-
|
1799
|
-
|
1798
|
+
b.tracks,
|
1799
|
+
y
|
1800
1800
|
), T = Object.fromEntries(
|
1801
|
-
Object.entries(
|
1802
|
-
([F]) => !
|
1801
|
+
Object.entries(b.trackItemsMap).filter(
|
1802
|
+
([F]) => !y.includes(F)
|
1803
1803
|
)
|
1804
|
-
),
|
1804
|
+
), x = tn(b.trackItemsMap);
|
1805
1805
|
t.updateState(
|
1806
1806
|
{
|
1807
|
-
trackItemIds:
|
1808
|
-
trackItemDetailsMap:
|
1807
|
+
trackItemIds: O,
|
1808
|
+
trackItemDetailsMap: D,
|
1809
1809
|
activeIds: [],
|
1810
1810
|
trackItemsMap: T,
|
1811
1811
|
tracks: w,
|
1812
|
-
duration:
|
1812
|
+
duration: x
|
1813
1813
|
},
|
1814
1814
|
{ updateHistory: !0, kind: "remove" }
|
1815
1815
|
);
|
1816
1816
|
}
|
1817
1817
|
}), S = n.subscribe(async (p) => {
|
1818
|
-
var _,
|
1818
|
+
var _, b, y, R, A;
|
1819
1819
|
const h = tt(t.getState());
|
1820
1820
|
let l = [], g = "text";
|
1821
1821
|
if (p.key === gi) {
|
1822
|
-
const
|
1823
|
-
for (const
|
1824
|
-
const F = Ki(
|
1822
|
+
const O = (_ = p.value) == null ? void 0 : _.payload, D = [];
|
1823
|
+
for (const x of O) {
|
1824
|
+
const F = Ki(x, {
|
1825
1825
|
size: {
|
1826
1826
|
width: 1080,
|
1827
1827
|
height: 1920
|
1828
1828
|
}
|
1829
1829
|
});
|
1830
|
-
|
1830
|
+
D.push(F);
|
1831
1831
|
}
|
1832
|
-
const w = await Promise.all(
|
1833
|
-
for (const
|
1834
|
-
const F =
|
1832
|
+
const w = await Promise.all(D), T = [];
|
1833
|
+
for (const x of w) {
|
1834
|
+
const F = x.id;
|
1835
1835
|
T.push(F);
|
1836
|
-
const { details: Dt, ...Ct } =
|
1836
|
+
const { details: Dt, ...Ct } = x;
|
1837
1837
|
h.trackItemDetailsMap[F] = {
|
1838
1838
|
type: g,
|
1839
1839
|
details: Dt
|
@@ -1843,49 +1843,49 @@ function qi(t) {
|
|
1843
1843
|
}
|
1844
1844
|
if (p.key === _i) {
|
1845
1845
|
g = "text";
|
1846
|
-
const
|
1846
|
+
const O = await Yi((b = p.value) == null ? void 0 : b.payload, {
|
1847
1847
|
size: {
|
1848
1848
|
width: 1080,
|
1849
1849
|
height: 1920
|
1850
1850
|
}
|
1851
|
-
}), { details:
|
1851
|
+
}), { details: D, ...w } = O;
|
1852
1852
|
h.trackItemDetailsMap[w.id] = {
|
1853
1853
|
type: g,
|
1854
|
-
details:
|
1854
|
+
details: D
|
1855
1855
|
}, h.trackItemsMap[w.id] = w, h.trackItemIds.push(w.id), l = [w.id];
|
1856
1856
|
}
|
1857
1857
|
if (p.key === vi) {
|
1858
1858
|
g = "image";
|
1859
|
-
const
|
1859
|
+
const O = await $i((y = p.value) == null ? void 0 : y.payload, {
|
1860
1860
|
size: {
|
1861
1861
|
width: 1080,
|
1862
1862
|
height: 1920
|
1863
1863
|
}
|
1864
|
-
}), { details:
|
1864
|
+
}), { details: D, ...w } = O;
|
1865
1865
|
h.trackItemDetailsMap[w.id] = {
|
1866
1866
|
type: g,
|
1867
|
-
details:
|
1867
|
+
details: D
|
1868
1868
|
}, h.trackItemsMap[w.id] = w, h.trackItemIds.push(w.id), l = [w.id];
|
1869
1869
|
}
|
1870
1870
|
if (p.key === Ii) {
|
1871
1871
|
g = "audio";
|
1872
|
-
const
|
1872
|
+
const O = await Bi((R = p.value) == null ? void 0 : R.payload), { details: D, ...w } = O;
|
1873
1873
|
h.trackItemDetailsMap[w.id] = {
|
1874
1874
|
type: g,
|
1875
|
-
details:
|
1875
|
+
details: D
|
1876
1876
|
}, h.trackItemsMap[w.id] = w, h.trackItemIds.push(w.id), l = [w.id];
|
1877
1877
|
}
|
1878
1878
|
if (p.key === Si) {
|
1879
1879
|
g = "video";
|
1880
|
-
const
|
1880
|
+
const O = await Wi((A = p.value) == null ? void 0 : A.payload, {
|
1881
1881
|
size: {
|
1882
1882
|
width: 1080,
|
1883
1883
|
height: 1920
|
1884
1884
|
}
|
1885
|
-
}), { details:
|
1885
|
+
}), { details: D, ...w } = O;
|
1886
1886
|
h.trackItemDetailsMap[w.id] = {
|
1887
1887
|
type: g,
|
1888
|
-
details:
|
1888
|
+
details: D
|
1889
1889
|
}, h.trackItemsMap[w.id] = w, h.trackItemIds.push(w.id), l = [w.id];
|
1890
1890
|
}
|
1891
1891
|
h.tracks.unshift({
|
@@ -1918,9 +1918,9 @@ function qi(t) {
|
|
1918
1918
|
const v = l.activeIds[0], _ = l.trackItemsMap[v];
|
1919
1919
|
if (g >= _.display.to || g <= _.display.from)
|
1920
1920
|
return;
|
1921
|
-
const
|
1921
|
+
const b = l.trackItemDetailsMap[v], y = Pn(), R = {
|
1922
1922
|
..._,
|
1923
|
-
id:
|
1923
|
+
id: y,
|
1924
1924
|
display: {
|
1925
1925
|
from: g,
|
1926
1926
|
to: _.display.to
|
@@ -1930,8 +1930,8 @@ function qi(t) {
|
|
1930
1930
|
to: _.display.to
|
1931
1931
|
}
|
1932
1932
|
};
|
1933
|
-
l.trackItemsMap[v].display.to = g, l.trackItemsMap[
|
1934
|
-
|
1933
|
+
l.trackItemsMap[v].display.to = g, l.trackItemsMap[y] = R, l.trackItemIds.push(y), l.trackItemDetailsMap[y] = b, l.tracks.forEach((A) => {
|
1934
|
+
A.items.includes(v) && A.items.push(y);
|
1935
1935
|
}), t.updateState(
|
1936
1936
|
{
|
1937
1937
|
trackItemDetailsMap: l.trackItemDetailsMap,
|
@@ -1956,20 +1956,20 @@ function qi(t) {
|
|
1956
1956
|
trackItemsMap: {},
|
1957
1957
|
tracks: []
|
1958
1958
|
};
|
1959
|
-
g.forEach((
|
1960
|
-
_.trackItemDetailsMap[
|
1961
|
-
l.tracks.find((
|
1959
|
+
g.forEach((y) => {
|
1960
|
+
_.trackItemDetailsMap[y] = l.trackItemDetailsMap[y], _.trackItemsMap[y] = l.trackItemsMap[y], v.push(
|
1961
|
+
l.tracks.find((R) => R.items.includes(y))
|
1962
1962
|
);
|
1963
1963
|
});
|
1964
|
-
const
|
1965
|
-
v.filter((
|
1964
|
+
const b = /* @__PURE__ */ new Set();
|
1965
|
+
v.filter((y) => b.has(y.id) ? !1 : (b.add(y), !0)), _.tracks = Array.from(b.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(_));
|
1966
1966
|
}
|
1967
1967
|
}
|
1968
1968
|
if (p.key === ki) {
|
1969
1969
|
const l = localStorage.getItem("DesignComboTemp");
|
1970
1970
|
if (!l) return;
|
1971
|
-
const g = tt(t.getState()), v = JSON.parse(l), _ = {},
|
1972
|
-
const w =
|
1971
|
+
const g = tt(t.getState()), v = JSON.parse(l), _ = {}, b = v.trackItemsMap, y = v.trackItemDetailsMap, R = v.tracks, A = [], O = v.activeIds.map(async (D) => {
|
1972
|
+
const w = y[D];
|
1973
1973
|
(w.type === "caption" || w.type === "text") && await Je([
|
1974
1974
|
{
|
1975
1975
|
fontFamily: w.details.fontFamily,
|
@@ -1977,19 +1977,19 @@ function qi(t) {
|
|
1977
1977
|
}
|
1978
1978
|
]);
|
1979
1979
|
const T = Pn();
|
1980
|
-
return _[
|
1981
|
-
...
|
1980
|
+
return _[D] = T, g.trackItemsMap[T] = {
|
1981
|
+
...b[D],
|
1982
1982
|
id: T
|
1983
1983
|
}, g.trackItemDetailsMap[T] = w, g.trackItemIds.push(T), !0;
|
1984
1984
|
});
|
1985
|
-
await Promise.all(
|
1986
|
-
const w =
|
1987
|
-
...
|
1985
|
+
await Promise.all(O), R.forEach((D) => {
|
1986
|
+
const w = D.items.map((x) => _[x]), T = {
|
1987
|
+
...D,
|
1988
1988
|
items: w,
|
1989
1989
|
id: fn()
|
1990
1990
|
};
|
1991
|
-
|
1992
|
-
}), g.tracks = [...g.tracks, ...
|
1991
|
+
A.push(T);
|
1992
|
+
}), g.tracks = [...g.tracks, ...A], t.updateState(
|
1993
1993
|
{
|
1994
1994
|
trackItemDetailsMap: g.trackItemDetailsMap,
|
1995
1995
|
tracks: g.tracks,
|
@@ -2002,48 +2002,35 @@ function qi(t) {
|
|
2002
2002
|
}
|
2003
2003
|
);
|
2004
2004
|
}
|
2005
|
-
}),
|
2005
|
+
}), m = f.subscribe((p) => {
|
2006
2006
|
var h, l;
|
2007
2007
|
if (p.key === Ai) {
|
2008
|
-
const g = tt(t.getState()), v = g.trackItemDetailsMap, _ = g.trackItemsMap,
|
2009
|
-
if (!
|
2010
|
-
const
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
2017
|
-
|
2018
|
-
|
2019
|
-
|
2020
|
-
},
|
2021
|
-
{
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
...v[x].details,
|
2030
|
-
...b[x].details
|
2031
|
-
});
|
2032
|
-
}), t.updateState(
|
2033
|
-
{
|
2034
|
-
trackItemDetailsMap: { ...v },
|
2035
|
-
trackItemsMap: { ..._ }
|
2036
|
-
},
|
2037
|
-
{
|
2038
|
-
updateHistory: !0,
|
2039
|
-
kind: "update:details"
|
2040
|
-
}
|
2041
|
-
);
|
2008
|
+
const g = tt(t.getState()), v = g.trackItemDetailsMap, _ = g.trackItemsMap, b = Object.keys((h = p.value) == null ? void 0 : h.payload);
|
2009
|
+
if (!b.length) return;
|
2010
|
+
const y = (l = p.value) == null ? void 0 : l.payload;
|
2011
|
+
b.forEach((A) => {
|
2012
|
+
y[A].details ? v[A].details = {
|
2013
|
+
...v[A].details,
|
2014
|
+
...y[A].details
|
2015
|
+
} : y[A].playbackRate && (_[A].playbackRate = y[A].playbackRate);
|
2016
|
+
});
|
2017
|
+
const R = tn(_);
|
2018
|
+
t.updateState(
|
2019
|
+
{
|
2020
|
+
trackItemDetailsMap: { ...v },
|
2021
|
+
trackItemsMap: { ..._ },
|
2022
|
+
duration: R
|
2023
|
+
},
|
2024
|
+
{
|
2025
|
+
updateHistory: !0,
|
2026
|
+
kind: "update:details"
|
2027
|
+
}
|
2028
|
+
);
|
2042
2029
|
}
|
2043
2030
|
});
|
2044
2031
|
return {
|
2045
2032
|
unsubscribe: () => {
|
2046
|
-
S.unsubscribe(), N.unsubscribe(),
|
2033
|
+
S.unsubscribe(), N.unsubscribe(), m.unsubscribe(), E.unsubscribe(), j.unsubscribe(), d.unsubscribe();
|
2047
2034
|
}
|
2048
2035
|
};
|
2049
2036
|
}
|
@@ -2052,34 +2039,34 @@ function Zn(t, r, n = { cyclesFix: !0 }, i = []) {
|
|
2052
2039
|
var d, E;
|
2053
2040
|
let o = [];
|
2054
2041
|
const c = Array.isArray(t);
|
2055
|
-
for (const
|
2056
|
-
const S = t[
|
2057
|
-
if (!(
|
2042
|
+
for (const j in t) {
|
2043
|
+
const S = t[j], N = c ? +j : j;
|
2044
|
+
if (!(j in r)) {
|
2058
2045
|
o.push({
|
2059
2046
|
type: "REMOVE",
|
2060
2047
|
path: [N],
|
2061
|
-
oldValue: t[
|
2048
|
+
oldValue: t[j]
|
2062
2049
|
});
|
2063
2050
|
continue;
|
2064
2051
|
}
|
2065
|
-
const
|
2066
|
-
if (S &&
|
2067
|
-
const h = Zn(S,
|
2052
|
+
const m = r[j], p = typeof S == "object" && typeof m == "object" && Array.isArray(S) === Array.isArray(m);
|
2053
|
+
if (S && m && p && !Ji[(E = (d = Object.getPrototypeOf(S)) == null ? void 0 : d.constructor) == null ? void 0 : E.name] && (!n.cyclesFix || !i.includes(S))) {
|
2054
|
+
const h = Zn(S, m, n, n.cyclesFix ? i.concat([S]) : []);
|
2068
2055
|
o.push.apply(o, h.map((l) => (l.path.unshift(N), l)));
|
2069
|
-
} else S !==
|
2070
|
-
!(Number.isNaN(S) && Number.isNaN(
|
2056
|
+
} else S !== m && // treat NaN values as equivalent
|
2057
|
+
!(Number.isNaN(S) && Number.isNaN(m)) && !(p && (isNaN(S) ? S + "" == m + "" : +S == +m)) && o.push({
|
2071
2058
|
path: [N],
|
2072
2059
|
type: "CHANGE",
|
2073
|
-
value:
|
2060
|
+
value: m,
|
2074
2061
|
oldValue: S
|
2075
2062
|
});
|
2076
2063
|
}
|
2077
2064
|
const f = Array.isArray(r);
|
2078
|
-
for (const
|
2079
|
-
|
2065
|
+
for (const j in r)
|
2066
|
+
j in t || o.push({
|
2080
2067
|
type: "CREATE",
|
2081
|
-
path: [f ? +
|
2082
|
-
value: r[
|
2068
|
+
path: [f ? +j : j],
|
2069
|
+
value: r[j]
|
2083
2070
|
});
|
2084
2071
|
return o;
|
2085
2072
|
}
|
@@ -2444,8 +2431,8 @@ var sa = class {
|
|
2444
2431
|
const c = n;
|
2445
2432
|
n = r;
|
2446
2433
|
const f = this;
|
2447
|
-
return function(E = c, ...
|
2448
|
-
return f.produce(E, (S) => n.call(this, S, ...
|
2434
|
+
return function(E = c, ...j) {
|
2435
|
+
return f.produce(E, (S) => n.call(this, S, ...j));
|
2449
2436
|
};
|
2450
2437
|
}
|
2451
2438
|
typeof n != "function" && G(6), i !== void 0 && typeof i != "function" && G(7);
|
@@ -2545,117 +2532,117 @@ function ii(t) {
|
|
2545
2532
|
function Fn() {
|
2546
2533
|
process.env.NODE_ENV !== "production" && Qn.push(
|
2547
2534
|
'Sets cannot have "replace" patches.',
|
2548
|
-
function(
|
2549
|
-
return "Unsupported patch operation: " +
|
2535
|
+
function(m) {
|
2536
|
+
return "Unsupported patch operation: " + m;
|
2550
2537
|
},
|
2551
|
-
function(
|
2552
|
-
return "Cannot apply patch, path doesn't resolve: " +
|
2538
|
+
function(m) {
|
2539
|
+
return "Cannot apply patch, path doesn't resolve: " + m;
|
2553
2540
|
},
|
2554
2541
|
"Patching reserved attributes like __proto__, prototype and constructor is not allowed"
|
2555
2542
|
);
|
2556
2543
|
const r = "replace", n = "add", i = "remove";
|
2557
|
-
function o(
|
2558
|
-
switch (
|
2544
|
+
function o(m, p, h, l) {
|
2545
|
+
switch (m.type_) {
|
2559
2546
|
case 0:
|
2560
2547
|
case 2:
|
2561
2548
|
return f(
|
2562
|
-
|
2549
|
+
m,
|
2563
2550
|
p,
|
2564
2551
|
h,
|
2565
2552
|
l
|
2566
2553
|
);
|
2567
2554
|
case 1:
|
2568
|
-
return c(
|
2555
|
+
return c(m, p, h, l);
|
2569
2556
|
case 3:
|
2570
2557
|
return d(
|
2571
|
-
|
2558
|
+
m,
|
2572
2559
|
p,
|
2573
2560
|
h,
|
2574
2561
|
l
|
2575
2562
|
);
|
2576
2563
|
}
|
2577
2564
|
}
|
2578
|
-
function c(
|
2579
|
-
let { base_: g, assigned_: v } =
|
2565
|
+
function c(m, p, h, l) {
|
2566
|
+
let { base_: g, assigned_: v } = m, _ = m.copy_;
|
2580
2567
|
_.length < g.length && ([g, _] = [_, g], [h, l] = [l, h]);
|
2581
|
-
for (let
|
2582
|
-
if (v[
|
2583
|
-
const
|
2568
|
+
for (let b = 0; b < g.length; b++)
|
2569
|
+
if (v[b] && _[b] !== g[b]) {
|
2570
|
+
const y = p.concat([b]);
|
2584
2571
|
h.push({
|
2585
2572
|
op: r,
|
2586
|
-
path:
|
2573
|
+
path: y,
|
2587
2574
|
// Need to maybe clone it, as it can in fact be the original value
|
2588
2575
|
// due to the base/copy inversion at the start of this function
|
2589
|
-
value: N(_[
|
2576
|
+
value: N(_[b])
|
2590
2577
|
}), l.push({
|
2591
2578
|
op: r,
|
2592
|
-
path:
|
2593
|
-
value: N(g[
|
2579
|
+
path: y,
|
2580
|
+
value: N(g[b])
|
2594
2581
|
});
|
2595
2582
|
}
|
2596
|
-
for (let
|
2597
|
-
const
|
2583
|
+
for (let b = g.length; b < _.length; b++) {
|
2584
|
+
const y = p.concat([b]);
|
2598
2585
|
h.push({
|
2599
2586
|
op: n,
|
2600
|
-
path:
|
2587
|
+
path: y,
|
2601
2588
|
// Need to maybe clone it, as it can in fact be the original value
|
2602
2589
|
// due to the base/copy inversion at the start of this function
|
2603
|
-
value: N(_[
|
2590
|
+
value: N(_[b])
|
2604
2591
|
});
|
2605
2592
|
}
|
2606
|
-
for (let
|
2607
|
-
const
|
2593
|
+
for (let b = _.length - 1; g.length <= b; --b) {
|
2594
|
+
const y = p.concat([b]);
|
2608
2595
|
l.push({
|
2609
2596
|
op: i,
|
2610
|
-
path:
|
2597
|
+
path: y
|
2611
2598
|
});
|
2612
2599
|
}
|
2613
2600
|
}
|
2614
|
-
function f(
|
2615
|
-
const { base_: g, copy_: v } =
|
2616
|
-
de(
|
2617
|
-
const
|
2618
|
-
if (
|
2601
|
+
function f(m, p, h, l) {
|
2602
|
+
const { base_: g, copy_: v } = m;
|
2603
|
+
de(m.assigned_, (_, b) => {
|
2604
|
+
const y = en(g, _), R = en(v, _), A = b ? he(g, _) ? r : n : i;
|
2605
|
+
if (y === R && A === r)
|
2619
2606
|
return;
|
2620
|
-
const
|
2621
|
-
h.push(
|
2622
|
-
|
2607
|
+
const O = p.concat(_);
|
2608
|
+
h.push(A === i ? { op: A, path: O } : { op: A, path: O, value: R }), l.push(
|
2609
|
+
A === n ? { op: i, path: O } : A === i ? { op: n, path: O, value: N(y) } : { op: r, path: O, value: N(y) }
|
2623
2610
|
);
|
2624
2611
|
});
|
2625
2612
|
}
|
2626
|
-
function d(
|
2627
|
-
let { base_: g, copy_: v } =
|
2628
|
-
g.forEach((
|
2629
|
-
if (!v.has(
|
2630
|
-
const
|
2613
|
+
function d(m, p, h, l) {
|
2614
|
+
let { base_: g, copy_: v } = m, _ = 0;
|
2615
|
+
g.forEach((b) => {
|
2616
|
+
if (!v.has(b)) {
|
2617
|
+
const y = p.concat([_]);
|
2631
2618
|
h.push({
|
2632
2619
|
op: i,
|
2633
|
-
path:
|
2634
|
-
value:
|
2620
|
+
path: y,
|
2621
|
+
value: b
|
2635
2622
|
}), l.unshift({
|
2636
2623
|
op: n,
|
2637
|
-
path:
|
2638
|
-
value:
|
2624
|
+
path: y,
|
2625
|
+
value: b
|
2639
2626
|
});
|
2640
2627
|
}
|
2641
2628
|
_++;
|
2642
|
-
}), _ = 0, v.forEach((
|
2643
|
-
if (!g.has(
|
2644
|
-
const
|
2629
|
+
}), _ = 0, v.forEach((b) => {
|
2630
|
+
if (!g.has(b)) {
|
2631
|
+
const y = p.concat([_]);
|
2645
2632
|
h.push({
|
2646
2633
|
op: n,
|
2647
|
-
path:
|
2648
|
-
value:
|
2634
|
+
path: y,
|
2635
|
+
value: b
|
2649
2636
|
}), l.unshift({
|
2650
2637
|
op: i,
|
2651
|
-
path:
|
2652
|
-
value:
|
2638
|
+
path: y,
|
2639
|
+
value: b
|
2653
2640
|
});
|
2654
2641
|
}
|
2655
2642
|
_++;
|
2656
2643
|
});
|
2657
2644
|
}
|
2658
|
-
function E(
|
2645
|
+
function E(m, p, h, l) {
|
2659
2646
|
h.push({
|
2660
2647
|
op: r,
|
2661
2648
|
path: [],
|
@@ -2663,77 +2650,77 @@ function Fn() {
|
|
2663
2650
|
}), l.push({
|
2664
2651
|
op: r,
|
2665
2652
|
path: [],
|
2666
|
-
value:
|
2653
|
+
value: m
|
2667
2654
|
});
|
2668
2655
|
}
|
2669
|
-
function
|
2656
|
+
function j(m, p) {
|
2670
2657
|
return p.forEach((h) => {
|
2671
2658
|
const { path: l, op: g } = h;
|
2672
|
-
let v =
|
2673
|
-
for (let
|
2674
|
-
const
|
2675
|
-
let
|
2676
|
-
typeof
|
2659
|
+
let v = m;
|
2660
|
+
for (let R = 0; R < l.length - 1; R++) {
|
2661
|
+
const A = Mt(v);
|
2662
|
+
let O = l[R];
|
2663
|
+
typeof O != "string" && typeof O != "number" && (O = "" + O), (A === 0 || A === 1) && (O === "__proto__" || O === "constructor") && G(19), typeof v == "function" && O === "prototype" && G(19), v = en(v, O), typeof v != "object" && G(18, l.join("/"));
|
2677
2664
|
}
|
2678
|
-
const _ = Mt(v),
|
2665
|
+
const _ = Mt(v), b = S(h.value), y = l[l.length - 1];
|
2679
2666
|
switch (g) {
|
2680
2667
|
case r:
|
2681
2668
|
switch (_) {
|
2682
2669
|
case 2:
|
2683
|
-
return v.set(
|
2670
|
+
return v.set(y, b);
|
2684
2671
|
case 3:
|
2685
2672
|
G(16);
|
2686
2673
|
default:
|
2687
|
-
return v[
|
2674
|
+
return v[y] = b;
|
2688
2675
|
}
|
2689
2676
|
case n:
|
2690
2677
|
switch (_) {
|
2691
2678
|
case 1:
|
2692
|
-
return
|
2679
|
+
return y === "-" ? v.push(b) : v.splice(y, 0, b);
|
2693
2680
|
case 2:
|
2694
|
-
return v.set(
|
2681
|
+
return v.set(y, b);
|
2695
2682
|
case 3:
|
2696
|
-
return v.add(
|
2683
|
+
return v.add(b);
|
2697
2684
|
default:
|
2698
|
-
return v[
|
2685
|
+
return v[y] = b;
|
2699
2686
|
}
|
2700
2687
|
case i:
|
2701
2688
|
switch (_) {
|
2702
2689
|
case 1:
|
2703
|
-
return v.splice(
|
2690
|
+
return v.splice(y, 1);
|
2704
2691
|
case 2:
|
2705
|
-
return v.delete(
|
2692
|
+
return v.delete(y);
|
2706
2693
|
case 3:
|
2707
2694
|
return v.delete(h.value);
|
2708
2695
|
default:
|
2709
|
-
return delete v[
|
2696
|
+
return delete v[y];
|
2710
2697
|
}
|
2711
2698
|
default:
|
2712
2699
|
G(17, g);
|
2713
2700
|
}
|
2714
|
-
}),
|
2715
|
-
}
|
2716
|
-
function S(
|
2717
|
-
if (!gt(
|
2718
|
-
return
|
2719
|
-
if (Array.isArray(
|
2720
|
-
return
|
2721
|
-
if (_e(
|
2701
|
+
}), m;
|
2702
|
+
}
|
2703
|
+
function S(m) {
|
2704
|
+
if (!gt(m))
|
2705
|
+
return m;
|
2706
|
+
if (Array.isArray(m))
|
2707
|
+
return m.map(S);
|
2708
|
+
if (_e(m))
|
2722
2709
|
return new Map(
|
2723
|
-
Array.from(
|
2710
|
+
Array.from(m.entries()).map(([h, l]) => [h, S(l)])
|
2724
2711
|
);
|
2725
|
-
if (ve(
|
2726
|
-
return new Set(Array.from(
|
2727
|
-
const p = Object.create(Ot(
|
2728
|
-
for (const h in
|
2729
|
-
p[h] = S(
|
2730
|
-
return he(
|
2712
|
+
if (ve(m))
|
2713
|
+
return new Set(Array.from(m).map(S));
|
2714
|
+
const p = Object.create(Ot(m));
|
2715
|
+
for (const h in m)
|
2716
|
+
p[h] = S(m[h]);
|
2717
|
+
return he(m, pe) && (p[pe] = m[pe]), p;
|
2731
2718
|
}
|
2732
|
-
function N(
|
2733
|
-
return xt(
|
2719
|
+
function N(m) {
|
2720
|
+
return xt(m) ? S(m) : m;
|
2734
2721
|
}
|
2735
2722
|
ea("Patches", {
|
2736
|
-
applyPatches_:
|
2723
|
+
applyPatches_: j,
|
2737
2724
|
generatePatches_: o,
|
2738
2725
|
generateReplacementPatches_: E
|
2739
2726
|
});
|
@@ -2980,59 +2967,59 @@ class Wa {
|
|
2980
2967
|
tracks: f,
|
2981
2968
|
transitionIds: d,
|
2982
2969
|
transitionsMap: E,
|
2983
|
-
trackItemsMap:
|
2970
|
+
trackItemsMap: j
|
2984
2971
|
} = this.getState(), S = tt({
|
2985
2972
|
trackItemDetailsMap: o,
|
2986
2973
|
trackItemIds: c,
|
2987
2974
|
tracks: f,
|
2988
2975
|
transitionIds: d,
|
2989
2976
|
transitionsMap: E,
|
2990
|
-
trackItemsMap:
|
2991
|
-
}), N = [],
|
2977
|
+
trackItemsMap: j
|
2978
|
+
}), N = [], m = [], p = [], h = [], l = [], g = [];
|
2992
2979
|
n.forEach((T) => {
|
2993
|
-
let
|
2980
|
+
let x;
|
2994
2981
|
const F = T.path.slice(1);
|
2995
|
-
T.type === "CREATE" ?
|
2982
|
+
T.type === "CREATE" ? x = {
|
2996
2983
|
path: F,
|
2997
2984
|
op: "remove",
|
2998
2985
|
value: T.value
|
2999
|
-
} : T.type === "CHANGE" ?
|
2986
|
+
} : T.type === "CHANGE" ? x = {
|
3000
2987
|
path: F,
|
3001
2988
|
op: "replace",
|
3002
2989
|
value: T.oldValue
|
3003
|
-
} :
|
2990
|
+
} : x = {
|
3004
2991
|
path: F,
|
3005
2992
|
op: "add",
|
3006
2993
|
value: T.oldValue
|
3007
|
-
}, T.path.includes("trackItemIds") ? p.push(
|
2994
|
+
}, T.path.includes("trackItemIds") ? p.push(x) : T.path.includes("transitionIds") ? m.push(x) : T.path.includes("trackItemsMap") ? l.push(x) : T.path.includes("transitionsMap") ? h.push(x) : T.path.includes("tracks") ? N.push(x) : T.path.includes("trackItemDetailsMap") && g.push(x);
|
3008
2995
|
});
|
3009
2996
|
const v = this.applyPatch(
|
3010
2997
|
S.tracks,
|
3011
2998
|
N
|
3012
2999
|
), _ = this.applyPatch(
|
3013
3000
|
S.transitionIds,
|
3014
|
-
|
3015
|
-
),
|
3001
|
+
m
|
3002
|
+
), b = this.applyPatch(
|
3016
3003
|
S.trackItemIds,
|
3017
3004
|
p
|
3018
|
-
),
|
3005
|
+
), y = this.applyPatch(
|
3019
3006
|
S.transitionsMap,
|
3020
3007
|
h
|
3021
|
-
),
|
3008
|
+
), R = this.applyPatch(
|
3022
3009
|
S.trackItemsMap,
|
3023
3010
|
l
|
3024
|
-
),
|
3011
|
+
), A = this.applyPatch(
|
3025
3012
|
S.trackItemDetailsMap,
|
3026
3013
|
g
|
3027
|
-
),
|
3014
|
+
), O = tt({
|
3028
3015
|
tracks: v,
|
3029
3016
|
transitionIds: _,
|
3030
|
-
trackItemIds:
|
3031
|
-
transitionsMap:
|
3032
|
-
trackItemsMap:
|
3033
|
-
trackItemDetailsMap:
|
3034
|
-
}),
|
3035
|
-
this.prevState =
|
3017
|
+
trackItemIds: b,
|
3018
|
+
transitionsMap: y,
|
3019
|
+
trackItemsMap: R,
|
3020
|
+
trackItemDetailsMap: A
|
3021
|
+
}), D = tt(this.getState()), w = { ...D, ...O };
|
3022
|
+
this.prevState = D, this.redos.push({ redos: n, type: i }), this.stateSubject.next(w), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 });
|
3036
3023
|
}
|
3037
3024
|
applyPatch(r, n) {
|
3038
3025
|
return n.reverse().reduce((i, o) => ca(i, (c) => {
|
@@ -3049,59 +3036,59 @@ class Wa {
|
|
3049
3036
|
tracks: f,
|
3050
3037
|
transitionIds: d,
|
3051
3038
|
transitionsMap: E,
|
3052
|
-
trackItemsMap:
|
3039
|
+
trackItemsMap: j
|
3053
3040
|
} = this.getState(), S = tt({
|
3054
3041
|
trackItemDetailsMap: o,
|
3055
3042
|
trackItemIds: c,
|
3056
3043
|
tracks: f,
|
3057
3044
|
transitionIds: d,
|
3058
3045
|
transitionsMap: E,
|
3059
|
-
trackItemsMap:
|
3060
|
-
}), N = [],
|
3046
|
+
trackItemsMap: j
|
3047
|
+
}), N = [], m = [], p = [], h = [], l = [], g = [];
|
3061
3048
|
n.forEach((T) => {
|
3062
|
-
let
|
3049
|
+
let x;
|
3063
3050
|
const F = T.path.slice(1);
|
3064
|
-
T.type === "CREATE" ?
|
3051
|
+
T.type === "CREATE" ? x = {
|
3065
3052
|
path: F,
|
3066
3053
|
op: "add",
|
3067
3054
|
value: T.value
|
3068
|
-
} : T.type === "CHANGE" ?
|
3055
|
+
} : T.type === "CHANGE" ? x = {
|
3069
3056
|
path: F,
|
3070
3057
|
op: "replace",
|
3071
3058
|
value: T.value
|
3072
|
-
} :
|
3059
|
+
} : x = {
|
3073
3060
|
path: F,
|
3074
3061
|
op: "remove",
|
3075
3062
|
value: T.oldValue
|
3076
|
-
}, T.path.includes("trackItemIds") ? p.push(
|
3063
|
+
}, T.path.includes("trackItemIds") ? p.push(x) : T.path.includes("transitionIds") ? m.push(x) : T.path.includes("trackItemsMap") ? l.push(x) : T.path.includes("transitionsMap") ? h.push(x) : T.path.includes("trackItemDetailsMap") ? g.push(x) : N.push(x);
|
3077
3064
|
});
|
3078
3065
|
const v = this.applyPatch(
|
3079
3066
|
S.tracks,
|
3080
3067
|
N
|
3081
3068
|
), _ = this.applyPatch(
|
3082
3069
|
S.transitionIds,
|
3083
|
-
|
3084
|
-
),
|
3070
|
+
m
|
3071
|
+
), b = this.applyPatch(
|
3085
3072
|
S.trackItemIds,
|
3086
3073
|
p
|
3087
|
-
),
|
3074
|
+
), y = this.applyPatch(
|
3088
3075
|
S.transitionsMap,
|
3089
3076
|
h
|
3090
|
-
),
|
3077
|
+
), R = this.applyPatch(
|
3091
3078
|
S.trackItemsMap,
|
3092
3079
|
l
|
3093
|
-
),
|
3080
|
+
), A = this.applyPatch(
|
3094
3081
|
S.trackItemDetailsMap,
|
3095
3082
|
g
|
3096
|
-
),
|
3083
|
+
), O = tt({
|
3097
3084
|
tracks: v,
|
3098
3085
|
transitionIds: _,
|
3099
|
-
trackItemIds:
|
3100
|
-
transitionsMap:
|
3101
|
-
trackItemsMap:
|
3102
|
-
trackItemDetailsMap:
|
3103
|
-
}),
|
3104
|
-
this.prevState =
|
3086
|
+
trackItemIds: b,
|
3087
|
+
transitionsMap: y,
|
3088
|
+
trackItemsMap: R,
|
3089
|
+
trackItemDetailsMap: A
|
3090
|
+
}), D = tt(this.getState()), w = { ...D, ...O };
|
3091
|
+
this.prevState = D, this.undos.push({ undos: n, type: i }), this.stateSubject.next(w), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 });
|
3105
3092
|
}
|
3106
3093
|
}
|
3107
3094
|
export {
|