@designcombo/state 5.0.3 → 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +433 -428
- package/dist/index.umd.js +3 -3
- package/dist/state-options.d.ts +15 -0
- package/dist/state.d.ts +7 -1
- package/dist/utils/load-item.d.ts +10 -84
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var Ct = (t, r, e) =>
|
4
|
-
import { subject as Wt, filter as Bt, dispatch as
|
1
|
+
var $s = Object.defineProperty;
|
2
|
+
var Fs = (t, r, e) => r in t ? $s(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
3
|
+
var Ct = (t, r, e) => Fs(t, typeof r != "symbol" ? r + "" : r, e);
|
4
|
+
import { subject as Wt, filter as Bt, dispatch as Ls } from "@designcombo/events";
|
5
5
|
var yn = function(t, r) {
|
6
6
|
return yn = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, s) {
|
7
7
|
e.__proto__ = s;
|
@@ -53,13 +53,13 @@ function _n(t, r, e) {
|
|
53
53
|
function Pt(t) {
|
54
54
|
return typeof t == "function";
|
55
55
|
}
|
56
|
-
function
|
56
|
+
function is(t) {
|
57
57
|
var r = function(s) {
|
58
58
|
Error.call(s), s.stack = new Error().stack;
|
59
59
|
}, e = t(r);
|
60
60
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
61
61
|
}
|
62
|
-
var fn =
|
62
|
+
var fn = is(function(t) {
|
63
63
|
return function(e) {
|
64
64
|
t(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
65
65
|
` + e.map(function(s, a) {
|
@@ -115,7 +115,7 @@ var Mr = function() {
|
|
115
115
|
for (var f = bn(m), I = f.next(); !I.done; I = f.next()) {
|
116
116
|
var b = I.value;
|
117
117
|
try {
|
118
|
-
|
118
|
+
Un(b);
|
119
119
|
} catch (_) {
|
120
120
|
o = o ?? [], _ instanceof fn ? o = _n(_n([], kn(o)), kn(_.errors)) : o.push(_);
|
121
121
|
}
|
@@ -137,7 +137,7 @@ var Mr = function() {
|
|
137
137
|
var e;
|
138
138
|
if (r && r !== this)
|
139
139
|
if (this.closed)
|
140
|
-
|
140
|
+
Un(r);
|
141
141
|
else {
|
142
142
|
if (r instanceof t) {
|
143
143
|
if (r.closed || r._hasParent(this))
|
@@ -162,16 +162,16 @@ var Mr = function() {
|
|
162
162
|
var r = new t();
|
163
163
|
return r.closed = !0, r;
|
164
164
|
}(), t;
|
165
|
-
}(),
|
166
|
-
function
|
165
|
+
}(), os = Mr.EMPTY;
|
166
|
+
function cs(t) {
|
167
167
|
return t instanceof Mr || t && "closed" in t && Pt(t.remove) && Pt(t.add) && Pt(t.unsubscribe);
|
168
168
|
}
|
169
|
-
function
|
169
|
+
function Un(t) {
|
170
170
|
Pt(t) ? t() : t.unsubscribe();
|
171
171
|
}
|
172
|
-
var
|
172
|
+
var Ns = {
|
173
173
|
Promise: void 0
|
174
|
-
},
|
174
|
+
}, Hs = {
|
175
175
|
setTimeout: function(t, r) {
|
176
176
|
for (var e = [], s = 2; s < arguments.length; s++)
|
177
177
|
e[s - 2] = arguments[s];
|
@@ -182,21 +182,21 @@ var Fs = {
|
|
182
182
|
},
|
183
183
|
delegate: void 0
|
184
184
|
};
|
185
|
-
function
|
186
|
-
|
185
|
+
function Us(t) {
|
186
|
+
Hs.setTimeout(function() {
|
187
187
|
throw t;
|
188
188
|
});
|
189
189
|
}
|
190
|
-
function
|
190
|
+
function jn() {
|
191
191
|
}
|
192
192
|
function kr(t) {
|
193
193
|
t();
|
194
194
|
}
|
195
|
-
var
|
195
|
+
var us = function(t) {
|
196
196
|
tr(r, t);
|
197
197
|
function r(e) {
|
198
198
|
var s = t.call(this) || this;
|
199
|
-
return s.isStopped = !1, e ? (s.destination = e,
|
199
|
+
return s.isStopped = !1, e ? (s.destination = e, cs(e) && e.add(s)) : s.destination = Bs, s;
|
200
200
|
}
|
201
201
|
return r.create = function(e, s, a) {
|
202
202
|
return new Sn(e, s, a);
|
@@ -223,7 +223,7 @@ var os = function(t) {
|
|
223
223
|
this.unsubscribe();
|
224
224
|
}
|
225
225
|
}, r;
|
226
|
-
}(Mr),
|
226
|
+
}(Mr), js = function() {
|
227
227
|
function t(r) {
|
228
228
|
this.partialObserver = r;
|
229
229
|
}
|
@@ -262,35 +262,35 @@ var os = function(t) {
|
|
262
262
|
next: e ?? void 0,
|
263
263
|
error: s ?? void 0,
|
264
264
|
complete: a ?? void 0
|
265
|
-
} : u = e, o.destination = new
|
265
|
+
} : u = e, o.destination = new js(u), o;
|
266
266
|
}
|
267
267
|
return r;
|
268
|
-
}(
|
268
|
+
}(us);
|
269
269
|
function br(t) {
|
270
|
-
|
270
|
+
Us(t);
|
271
271
|
}
|
272
|
-
function
|
272
|
+
function Ws(t) {
|
273
273
|
throw t;
|
274
274
|
}
|
275
|
-
var
|
275
|
+
var Bs = {
|
276
276
|
closed: !0,
|
277
|
-
next:
|
278
|
-
error:
|
279
|
-
complete:
|
280
|
-
},
|
277
|
+
next: jn,
|
278
|
+
error: Ws,
|
279
|
+
complete: jn
|
280
|
+
}, Gs = function() {
|
281
281
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
282
282
|
}();
|
283
|
-
function
|
283
|
+
function Ys(t) {
|
284
284
|
return t;
|
285
285
|
}
|
286
|
-
function
|
287
|
-
return t.length === 0 ?
|
286
|
+
function Xs(t) {
|
287
|
+
return t.length === 0 ? Ys : t.length === 1 ? t[0] : function(e) {
|
288
288
|
return t.reduce(function(s, a) {
|
289
289
|
return a(s);
|
290
290
|
}, e);
|
291
291
|
};
|
292
292
|
}
|
293
|
-
var
|
293
|
+
var Wn = function() {
|
294
294
|
function t(r) {
|
295
295
|
r && (this._subscribe = r);
|
296
296
|
}
|
@@ -298,7 +298,7 @@ var Un = function() {
|
|
298
298
|
var e = new t();
|
299
299
|
return e.source = this, e.operator = r, e;
|
300
300
|
}, t.prototype.subscribe = function(r, e, s) {
|
301
|
-
var a = this, o =
|
301
|
+
var a = this, o = Vs(r) ? r : new Sn(r, e, s);
|
302
302
|
return kr(function() {
|
303
303
|
var u = a, c = u.operator, p = u.source;
|
304
304
|
o.add(c ? c.call(o, p) : p ? a._subscribe(o) : a._trySubscribe(o));
|
@@ -311,7 +311,7 @@ var Un = function() {
|
|
311
311
|
}
|
312
312
|
}, t.prototype.forEach = function(r, e) {
|
313
313
|
var s = this;
|
314
|
-
return e =
|
314
|
+
return e = Bn(e), new e(function(a, o) {
|
315
315
|
var u = new Sn({
|
316
316
|
next: function(c) {
|
317
317
|
try {
|
@@ -328,15 +328,15 @@ var Un = function() {
|
|
328
328
|
}, t.prototype._subscribe = function(r) {
|
329
329
|
var e;
|
330
330
|
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(r);
|
331
|
-
}, t.prototype[
|
331
|
+
}, t.prototype[Gs] = function() {
|
332
332
|
return this;
|
333
333
|
}, t.prototype.pipe = function() {
|
334
334
|
for (var r = [], e = 0; e < arguments.length; e++)
|
335
335
|
r[e] = arguments[e];
|
336
|
-
return
|
336
|
+
return Xs(r)(this);
|
337
337
|
}, t.prototype.toPromise = function(r) {
|
338
338
|
var e = this;
|
339
|
-
return r =
|
339
|
+
return r = Bn(r), new r(function(s, a) {
|
340
340
|
var o;
|
341
341
|
e.subscribe(function(u) {
|
342
342
|
return o = u;
|
@@ -350,32 +350,32 @@ var Un = function() {
|
|
350
350
|
return new t(r);
|
351
351
|
}, t;
|
352
352
|
}();
|
353
|
-
function
|
353
|
+
function Bn(t) {
|
354
354
|
var r;
|
355
|
-
return (r = t ??
|
355
|
+
return (r = t ?? Ns.Promise) !== null && r !== void 0 ? r : Promise;
|
356
356
|
}
|
357
|
-
function
|
357
|
+
function Ks(t) {
|
358
358
|
return t && Pt(t.next) && Pt(t.error) && Pt(t.complete);
|
359
359
|
}
|
360
|
-
function
|
361
|
-
return t && t instanceof
|
360
|
+
function Vs(t) {
|
361
|
+
return t && t instanceof us || Ks(t) && cs(t);
|
362
362
|
}
|
363
|
-
var
|
363
|
+
var Js = is(function(t) {
|
364
364
|
return function() {
|
365
365
|
t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
366
366
|
};
|
367
|
-
}),
|
367
|
+
}), ls = function(t) {
|
368
368
|
tr(r, t);
|
369
369
|
function r() {
|
370
370
|
var e = t.call(this) || this;
|
371
371
|
return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
|
372
372
|
}
|
373
373
|
return r.prototype.lift = function(e) {
|
374
|
-
var s = new
|
374
|
+
var s = new Gn(this, this);
|
375
375
|
return s.operator = e, s;
|
376
376
|
}, r.prototype._throwIfClosed = function() {
|
377
377
|
if (this.closed)
|
378
|
-
throw new
|
378
|
+
throw new Js();
|
379
379
|
}, r.prototype.next = function(e) {
|
380
380
|
var s = this;
|
381
381
|
kr(function() {
|
@@ -431,19 +431,19 @@ var Ks = ss(function(t) {
|
|
431
431
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
432
432
|
}, r.prototype._innerSubscribe = function(e) {
|
433
433
|
var s = this, a = this, o = a.hasError, u = a.isStopped, c = a.observers;
|
434
|
-
return o || u ?
|
434
|
+
return o || u ? os : (this.currentObservers = null, c.push(e), new Mr(function() {
|
435
435
|
s.currentObservers = null, vn(c, e);
|
436
436
|
}));
|
437
437
|
}, r.prototype._checkFinalizedStatuses = function(e) {
|
438
438
|
var s = this, a = s.hasError, o = s.thrownError, u = s.isStopped;
|
439
439
|
a ? e.error(o) : u && e.complete();
|
440
440
|
}, r.prototype.asObservable = function() {
|
441
|
-
var e = new
|
441
|
+
var e = new Wn();
|
442
442
|
return e.source = this, e;
|
443
443
|
}, r.create = function(e, s) {
|
444
|
-
return new
|
444
|
+
return new Gn(e, s);
|
445
445
|
}, r;
|
446
|
-
}(
|
446
|
+
}(Wn), Gn = function(t) {
|
447
447
|
tr(r, t);
|
448
448
|
function r(e, s) {
|
449
449
|
var a = t.call(this) || this;
|
@@ -460,9 +460,9 @@ var Ks = ss(function(t) {
|
|
460
460
|
(s = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || s === void 0 || s.call(e);
|
461
461
|
}, r.prototype._subscribe = function(e) {
|
462
462
|
var s, a;
|
463
|
-
return (a = (s = this.source) === null || s === void 0 ? void 0 : s.subscribe(e)) !== null && a !== void 0 ? a :
|
463
|
+
return (a = (s = this.source) === null || s === void 0 ? void 0 : s.subscribe(e)) !== null && a !== void 0 ? a : os;
|
464
464
|
}, r;
|
465
|
-
}(
|
465
|
+
}(ls), Yn = function(t) {
|
466
466
|
tr(r, t);
|
467
467
|
function r(e) {
|
468
468
|
var s = t.call(this) || this;
|
@@ -485,8 +485,8 @@ var Ks = ss(function(t) {
|
|
485
485
|
}, r.prototype.next = function(e) {
|
486
486
|
t.prototype.next.call(this, this._value = e);
|
487
487
|
}, r;
|
488
|
-
}(
|
489
|
-
function
|
488
|
+
}(ls), ht = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
489
|
+
function On(t) {
|
490
490
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
491
491
|
}
|
492
492
|
var _r = { exports: {} };
|
@@ -838,8 +838,8 @@ _r.exports;
|
|
838
838
|
B = P[ut];
|
839
839
|
var Ot = n[B], ue = i[B];
|
840
840
|
if (g)
|
841
|
-
var
|
842
|
-
if (!(
|
841
|
+
var Hn = R ? g(ue, Ot, B, i, n, A) : g(Ot, ue, B, n, i, A);
|
842
|
+
if (!(Hn === void 0 ? Ot === ue || D(Ot, ue, l, g, A) : Hn)) {
|
843
843
|
K = !1;
|
844
844
|
break;
|
845
845
|
}
|
@@ -967,8 +967,8 @@ _r.exports;
|
|
967
967
|
}
|
968
968
|
t.exports = un;
|
969
969
|
})(_r, _r.exports);
|
970
|
-
var
|
971
|
-
const W = /* @__PURE__ */
|
970
|
+
var qs = _r.exports;
|
971
|
+
const W = /* @__PURE__ */ On(qs), ho = "add", Zs = "track", Qs = "trackItems", mo = `${Zs}:changed`, Io = `${Qs}:changed`, ta = "state", go = `${ta}:changed`, ea = "bulk", Xn = `${ea}:edit`, Cn = "design", ra = `${Cn}:load`, na = `${Cn}:resize`, H = "add", sa = `${H}:text`, aa = `${H}:video`, ia = `${H}:audio`, yo = `${H}:placeholder`, oa = `${H}:image`, ca = `${H}:illustration`, ua = `${H}:shape`, bo = `${H}:mask`, ko = `${H}:transition`, la = `${H}:animation`, da = `${H}:caption`, fa = `${H}:template`, pa = `${H}:items`, ha = `${H}:composition`, ma = `${H}:progressBar`, Ia = `${H}:progressFrame`, ga = `${H}:radialAudioBars`, ya = `${H}:linealAudioBars`, ba = `${H}:waveAudioBars`, ka = `${H}:hillAudioBars`, _a = `${H}:rect`, Yt = "edit", va = `${Yt}:object`, Sa = `${Yt}:replaceMedia`, _o = `${Yt}:text`, vo = `${Yt}:shape`, So = `${Yt}:templateItem`, wo = `${Yt}:deleteTemplateItem`, wa = `${Yt}:backgroundEditor`, Mo = "enterEditMode", Re = "active", To = `${Re}:set`, Eo = `${Re}:delete`, Ma = `${Re}:paste`, Ao = `${Re}:clone`, Ta = `${Re}:split`, et = "layer", Do = `${et}:locked`, xo = `${et}:hidden`, Oo = `${et}:move`, Ea = `${et}:select`, Co = `${et}:selection`, Po = `${et}:sendTo`, Ro = `${et}:rename`, zo = `${et}:editingName`, Aa = `${et}:copy`, $o = `${et}:paste`, Da = `${et}:clone`, Fo = `${et}:split`, Lo = `${et}:cut`, xa = `${et}:delete`, Oa = `${et}:replace`, Tr = "history", Ca = `${Tr}:undo`, Pa = `${Tr}:redo`, No = `${Tr}:reset`, ds = "scale", Ra = `${ds}:changed`;
|
972
972
|
var vr = { exports: {} };
|
973
973
|
vr.exports;
|
974
974
|
(function(t, r) {
|
@@ -1414,9 +1414,9 @@ vr.exports;
|
|
1414
1414
|
}
|
1415
1415
|
t.exports = fr;
|
1416
1416
|
})(vr, vr.exports);
|
1417
|
-
var
|
1418
|
-
const x = /* @__PURE__ */
|
1419
|
-
function
|
1417
|
+
var za = vr.exports;
|
1418
|
+
const x = /* @__PURE__ */ On(za);
|
1419
|
+
function $a(t, r) {
|
1420
1420
|
return t.filter((s) => {
|
1421
1421
|
if (r.forEach((a) => {
|
1422
1422
|
s.items.includes(a) && (s.items = s.items.filter((o) => o !== a));
|
@@ -1468,14 +1468,14 @@ function st(t, r, e) {
|
|
1468
1468
|
});
|
1469
1469
|
});
|
1470
1470
|
}
|
1471
|
-
function
|
1471
|
+
function Fa(t, r, e) {
|
1472
1472
|
const s = t.toId, a = e[s], o = r.find((u) => u.items.includes(s));
|
1473
1473
|
o && (o.magnetic || o.items.forEach((u) => {
|
1474
1474
|
const c = e[u];
|
1475
1475
|
c.display.from > a.display.from && (c.display.from = c.display.from + t.duration, c.display.to = c.display.to + t.duration);
|
1476
1476
|
}));
|
1477
1477
|
}
|
1478
|
-
function
|
1478
|
+
function La(t, r) {
|
1479
1479
|
const e = x(t), s = r && r.length ? r : e.activeIds, a = s.map((y) => e.trackItemsMap[y]).filter((y) => !!y).map((y) => y.id), o = e.transitionIds.filter(
|
1480
1480
|
(y) => {
|
1481
1481
|
const w = e.transitionsMap[y];
|
@@ -1522,7 +1522,7 @@ function $a(t, r) {
|
|
1522
1522
|
Object.keys(_).forEach((y) => {
|
1523
1523
|
s.includes(y) && (_[y].kind = "none");
|
1524
1524
|
});
|
1525
|
-
const T =
|
1525
|
+
const T = $a(
|
1526
1526
|
e.tracks,
|
1527
1527
|
a
|
1528
1528
|
), d = Object.fromEntries(
|
@@ -1533,7 +1533,7 @@ function $a(t, r) {
|
|
1533
1533
|
st(v, d, []);
|
1534
1534
|
const S = J(d);
|
1535
1535
|
return Object.keys(u).forEach((y) => {
|
1536
|
-
|
1536
|
+
Fa(
|
1537
1537
|
u[y],
|
1538
1538
|
T,
|
1539
1539
|
d
|
@@ -1550,16 +1550,16 @@ function $a(t, r) {
|
|
1550
1550
|
transitionsMap: _
|
1551
1551
|
};
|
1552
1552
|
}
|
1553
|
-
const
|
1554
|
-
let
|
1553
|
+
const Na = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
1554
|
+
let fs = (t = 21) => {
|
1555
1555
|
let r = "", e = crypto.getRandomValues(new Uint8Array(t |= 0));
|
1556
1556
|
for (; t--; )
|
1557
|
-
r +=
|
1557
|
+
r += Na[e[t] & 63];
|
1558
1558
|
return r;
|
1559
1559
|
};
|
1560
1560
|
function de(t = 16) {
|
1561
1561
|
const r = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", e = r.charAt(Math.floor(Math.random() * r.length));
|
1562
|
-
let s =
|
1562
|
+
let s = fs(t - 1);
|
1563
1563
|
return s = s.replace(/[^a-zA-Z0-9]/g, "").slice(0, t - 1), e + s;
|
1564
1564
|
}
|
1565
1565
|
const er = (t) => {
|
@@ -1572,7 +1572,7 @@ const er = (t) => {
|
|
1572
1572
|
}).catch((a) => s(a));
|
1573
1573
|
});
|
1574
1574
|
};
|
1575
|
-
async function
|
1575
|
+
async function Ha(t) {
|
1576
1576
|
const r = localStorage.getItem("DesignComboTemp");
|
1577
1577
|
if (!r) return {};
|
1578
1578
|
const e = { ...t }, s = JSON.parse(r), a = {}, o = s.trackItemsMap, u = s.trackItemDetailsMap, c = s.tracks, p = [], h = s.activeIds.map(async (k) => {
|
@@ -1605,42 +1605,51 @@ async function La(t) {
|
|
1605
1605
|
trackItemsMap: e.trackItemsMap
|
1606
1606
|
};
|
1607
1607
|
}
|
1608
|
-
|
1608
|
+
let wn = {
|
1609
|
+
cors: {
|
1610
|
+
audio: !0,
|
1611
|
+
video: !0,
|
1612
|
+
image: !0
|
1613
|
+
}
|
1614
|
+
};
|
1615
|
+
const Ua = (t) => {
|
1616
|
+
wn = { ...wn, ...t };
|
1617
|
+
}, Pn = () => wn.cors, ze = (t) => new Promise((r, e) => {
|
1609
1618
|
const s = new Image();
|
1610
1619
|
console.warn("update cdn config for cors?"), s.onload = () => {
|
1611
|
-
const
|
1612
|
-
r({ width:
|
1613
|
-
}, s.onerror = (
|
1614
|
-
e(
|
1615
|
-
}, s.crossOrigin = "anonymous", s.src = t;
|
1616
|
-
}),
|
1620
|
+
const o = s.width, u = s.height;
|
1621
|
+
r({ width: o, height: u });
|
1622
|
+
}, s.onerror = (o) => {
|
1623
|
+
e(o);
|
1624
|
+
}, Pn().image && (s.crossOrigin = "anonymous"), s.src = t;
|
1625
|
+
}), ps = (t) => new Promise((r, e) => {
|
1617
1626
|
const s = new Audio();
|
1618
1627
|
s.preload = "auto", s.addEventListener("loadedmetadata", () => {
|
1619
|
-
const
|
1620
|
-
r({ duration:
|
1621
|
-
}), s.addEventListener("error", (
|
1622
|
-
e(
|
1623
|
-
}), s.src = t, s.crossOrigin = "anonymous", s.load();
|
1624
|
-
}),
|
1628
|
+
const o = s.duration * 1e3;
|
1629
|
+
r({ duration: o });
|
1630
|
+
}), s.addEventListener("error", (o) => {
|
1631
|
+
e(o);
|
1632
|
+
}), s.src = t, Pn().audio && (console.log("setting cors"), s.crossOrigin = "anonymous"), s.load();
|
1633
|
+
}), Rn = (t) => new Promise((r, e) => {
|
1625
1634
|
const s = document.createElement("video");
|
1626
1635
|
s.preload = "auto", s.addEventListener("loadedmetadata", () => {
|
1627
|
-
const
|
1628
|
-
r({ duration:
|
1629
|
-
}), s.addEventListener("error", (
|
1630
|
-
e(
|
1631
|
-
}), s.src = t, s.load();
|
1632
|
-
}),
|
1636
|
+
const o = s.duration * 1e3, u = s.videoWidth, c = s.videoHeight;
|
1637
|
+
r({ duration: o, width: u, height: c });
|
1638
|
+
}), s.addEventListener("error", (o) => {
|
1639
|
+
e(o);
|
1640
|
+
}), s.src = t, Pn().video && (s.crossOrigin = "anonymous"), s.load();
|
1641
|
+
}), ja = async (t) => {
|
1633
1642
|
var a, o;
|
1634
1643
|
const r = t.duration, e = (a = t.details) == null ? void 0 : a.width, s = (o = t.details) == null ? void 0 : o.height;
|
1635
|
-
return r && e && s ? { duration: r, width: e, height: s } :
|
1636
|
-
},
|
1644
|
+
return r && e && s ? { duration: r, width: e, height: s } : Rn(t.details.src);
|
1645
|
+
}, hs = (t, r) => {
|
1637
1646
|
const e = document.createElement("div");
|
1638
1647
|
Object.keys(r).forEach((a) => {
|
1639
1648
|
a !== "height" && (e.style[a] = r[a]);
|
1640
1649
|
}), document.body.appendChild(e), e.textContent = t, e.style.whiteSpace = "normal", e.style.position = "absolute", e.style.visibility = "hidden", e.style.display = "inline-block", e.style.width = r.width + "px", e.style.fontSize = r.fontSize + "px";
|
1641
1650
|
const s = getComputedStyle(e).height;
|
1642
1651
|
return document.body.removeChild(e), parseFloat(s);
|
1643
|
-
},
|
1652
|
+
}, Kn = (t, r) => {
|
1644
1653
|
var c, p;
|
1645
1654
|
const e = ((c = t.details.crop) == null ? void 0 : c.width) || t.details.width || 0, s = ((p = t.details.crop) == null ? void 0 : p.height) || t.details.height || 0;
|
1646
1655
|
let a = r.width, o = r.height;
|
@@ -1655,7 +1664,7 @@ const ze = (t) => new Promise((r, e) => {
|
|
1655
1664
|
width: e
|
1656
1665
|
}
|
1657
1666
|
};
|
1658
|
-
},
|
1667
|
+
}, Vn = (t, r) => {
|
1659
1668
|
const e = x(t.trim), s = x(t.display);
|
1660
1669
|
return r.duration < t.display.to && (s.to = r.duration, e && (e.to = r.duration)), {
|
1661
1670
|
duration: r.duration,
|
@@ -1663,17 +1672,17 @@ const ze = (t) => new Promise((r, e) => {
|
|
1663
1672
|
display: s
|
1664
1673
|
};
|
1665
1674
|
};
|
1666
|
-
async function
|
1675
|
+
async function Wa(t, r) {
|
1667
1676
|
const e = { ...t }, s = Object.keys(r)[0], a = Object.values(r)[0], o = e.trackItemDetailsMap[s], u = { ...e.trackItemsMap[s] }, c = o.details;
|
1668
1677
|
if (!a.details.src) return {};
|
1669
1678
|
if (o.type === "image") {
|
1670
|
-
const p = await ze(a.details.src), { crop: h, newHeight: k, newWidth: m } =
|
1679
|
+
const p = await ze(a.details.src), { crop: h, newHeight: k, newWidth: m } = Kn(o, p);
|
1671
1680
|
a.details.crop = h, a.details.height = k, a.details.width = m;
|
1672
1681
|
} else if (o.type === "video") {
|
1673
|
-
const p = await
|
1682
|
+
const p = await Rn(a.details.src), h = e.trackItemsMap[s], { display: k, duration: m, trim: f } = Vn(h, p), { crop: I, newHeight: b, newWidth: _ } = Kn(o, p);
|
1674
1683
|
a.details.crop = I, a.details.height = b, a.details.width = _, u.display = k, u.duration = m, u.trim = f;
|
1675
1684
|
} else if (o.type === "audio") {
|
1676
|
-
const p = await
|
1685
|
+
const p = await ps(a.details.src), h = e.trackItemsMap[s], { display: k, duration: m, trim: f } = Vn(h, p);
|
1677
1686
|
u.display = k, u.duration = m, u.trim = f;
|
1678
1687
|
}
|
1679
1688
|
return o.details = { ...c, ...a.details }, e.trackItemDetailsMap[s] = { ...o }, e.trackItemsMap[s] = { ...u }, {
|
@@ -1681,7 +1690,7 @@ async function Ha(t, r) {
|
|
1681
1690
|
trackItemsMap: e.trackItemsMap
|
1682
1691
|
};
|
1683
1692
|
}
|
1684
|
-
function
|
1693
|
+
function Ba(t, r) {
|
1685
1694
|
const e = x(t), s = {}, a = r && r.length ? r : e.activeIds;
|
1686
1695
|
if (a.length === 0) return {};
|
1687
1696
|
a.forEach((u) => {
|
@@ -1711,7 +1720,7 @@ function Ua(t, r) {
|
|
1711
1720
|
trackItemsMap: e.trackItemsMap
|
1712
1721
|
};
|
1713
1722
|
}
|
1714
|
-
function
|
1723
|
+
function Ga(t) {
|
1715
1724
|
const r = /#([0-9a-fA-F]{3,6})\b/g, e = /rgb\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)/g, s = /rgba\(\s*(\d+),\s*(\d+),\s*(\d+),\s*([0-9.]+)\s*\)/g;
|
1716
1725
|
function a(u) {
|
1717
1726
|
return u.length === 3 ? `#${u[0]}${u[0]}${u[1]}${u[1]}${u[2]}${u[2]}`.toUpperCase() : `#${u.toUpperCase()}`;
|
@@ -1730,7 +1739,7 @@ function ja(t) {
|
|
1730
1739
|
function V(t) {
|
1731
1740
|
return /^#[0-9a-fA-F]{3}$/.test(t) ? "#" + t[1] + t[1] + t[2] + t[2] + t[3] + t[3] : t;
|
1732
1741
|
}
|
1733
|
-
function
|
1742
|
+
function ms(t, r) {
|
1734
1743
|
let e = t;
|
1735
1744
|
for (const s in r)
|
1736
1745
|
if (Object.prototype.hasOwnProperty.call(r, s)) {
|
@@ -1739,7 +1748,7 @@ function ps(t, r) {
|
|
1739
1748
|
}
|
1740
1749
|
return e;
|
1741
1750
|
}
|
1742
|
-
function
|
1751
|
+
function Is(t) {
|
1743
1752
|
const r = t.getAttribute("fill");
|
1744
1753
|
if (r && r.trim() !== "" && r.trim() !== "none")
|
1745
1754
|
return r.trim();
|
@@ -1753,12 +1762,12 @@ function hs(t) {
|
|
1753
1762
|
}
|
1754
1763
|
}
|
1755
1764
|
const s = t.parentElement;
|
1756
|
-
return s ?
|
1765
|
+
return s ? Is(s) : null;
|
1757
1766
|
}
|
1758
1767
|
function Ke(t) {
|
1759
1768
|
return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(t);
|
1760
1769
|
}
|
1761
|
-
const
|
1770
|
+
const Ya = (t) => {
|
1762
1771
|
const r = `.${t.split(".").filter((o) => o.includes("fill:")).join(".")}`, e = {}, s = /\.([\w-]+)\s*\{\s*([^}]+)\s*\}/g;
|
1763
1772
|
let a;
|
1764
1773
|
for (; (a = s.exec(r)) !== null; ) {
|
@@ -1776,12 +1785,12 @@ function pn(t) {
|
|
1776
1785
|
}
|
1777
1786
|
return !1;
|
1778
1787
|
}
|
1779
|
-
function
|
1788
|
+
function Xa(t, r, e = 300, s = 300) {
|
1780
1789
|
const a = [], u = new DOMParser().parseFromString(t, "image/svg+xml"), c = u.documentElement;
|
1781
1790
|
c.setAttribute("width", `${e}`), c.setAttribute("height", `${s}`);
|
1782
1791
|
const p = c.querySelectorAll("style"), h = {};
|
1783
1792
|
p.forEach((_) => {
|
1784
|
-
const T = _.textContent || "", d =
|
1793
|
+
const T = _.textContent || "", d = Ya(T);
|
1785
1794
|
Object.assign(h, d);
|
1786
1795
|
const v = T.replace(/\.(st[\w-]+)/g, `.${r}-$1`).replace(/url\(#(.*?)\)/g, `url(#${r}-$1)`);
|
1787
1796
|
_.textContent = v;
|
@@ -1872,7 +1881,7 @@ function Ba(t, r, e = 300, s = 300) {
|
|
1872
1881
|
}
|
1873
1882
|
}), Array.from(u.querySelectorAll("path")).forEach((_) => {
|
1874
1883
|
if (pn(_)) return;
|
1875
|
-
!
|
1884
|
+
!Is(_) && !_.getAttribute("class") && (_.setAttribute("fill", "#000000"), a.includes("#000000") || a.push("#000000"));
|
1876
1885
|
}), { serializer: new XMLSerializer().serializeToString(u), colors: a };
|
1877
1886
|
}
|
1878
1887
|
const rr = {
|
@@ -1908,7 +1917,7 @@ const rr = {
|
|
1908
1917
|
), s;
|
1909
1918
|
}
|
1910
1919
|
return t;
|
1911
|
-
},
|
1920
|
+
}, gs = (t, r) => t ? t.from && !t.to ? {
|
1912
1921
|
from: t.from,
|
1913
1922
|
to: r.duration
|
1914
1923
|
} : t : {
|
@@ -1944,10 +1953,10 @@ function pt(t, r) {
|
|
1944
1953
|
transform: `scale(${o})`
|
1945
1954
|
};
|
1946
1955
|
}
|
1947
|
-
const
|
1948
|
-
const e = t.details.src, s = await
|
1956
|
+
const ys = async (t, r) => {
|
1957
|
+
const e = t.details.src, s = await ja(t), a = pt(r, {
|
1949
1958
|
...s
|
1950
|
-
}), o =
|
1959
|
+
}), o = gs(t.trim, { duration: s.duration }), u = {
|
1951
1960
|
width: s.width,
|
1952
1961
|
height: s.height,
|
1953
1962
|
opacity: 100,
|
@@ -1980,13 +1989,12 @@ const Is = async (t, r) => {
|
|
1980
1989
|
type: "video",
|
1981
1990
|
name: "video",
|
1982
1991
|
details: u,
|
1983
|
-
animations: t.animations,
|
1984
1992
|
playbackRate: t.playbackRate || 1,
|
1985
1993
|
display: yt(t.display, { duration: s.duration, trim: o }),
|
1986
1994
|
duration: s.duration
|
1987
1995
|
};
|
1988
|
-
},
|
1989
|
-
const r = t.id, e = t.details, a = (await
|
1996
|
+
}, bs = async (t) => {
|
1997
|
+
const r = t.id, e = t.details, a = (await ps(e.src)).duration, o = gs(t.trim, { duration: a });
|
1990
1998
|
return {
|
1991
1999
|
id: r,
|
1992
2000
|
name: t.name || "audio",
|
@@ -2002,7 +2010,7 @@ const Is = async (t, r) => {
|
|
2002
2010
|
metadata: { ...t.metadata },
|
2003
2011
|
duration: a
|
2004
2012
|
};
|
2005
|
-
},
|
2013
|
+
}, Ka = async (t, r) => {
|
2006
2014
|
var c, p;
|
2007
2015
|
const e = t.id, s = {
|
2008
2016
|
width: ((c = t.details) == null ? void 0 : c.width) || r.size.width,
|
@@ -2040,7 +2048,7 @@ const Is = async (t, r) => {
|
|
2040
2048
|
},
|
2041
2049
|
metadata: {}
|
2042
2050
|
};
|
2043
|
-
},
|
2051
|
+
}, Va = async (t, r) => {
|
2044
2052
|
var c, p;
|
2045
2053
|
const e = t.id, s = {
|
2046
2054
|
width: ((c = t.details) == null ? void 0 : c.width) || r.size.width,
|
@@ -2079,7 +2087,7 @@ const Is = async (t, r) => {
|
|
2079
2087
|
},
|
2080
2088
|
metadata: {}
|
2081
2089
|
};
|
2082
|
-
},
|
2090
|
+
}, Ja = async (t, r) => {
|
2083
2091
|
var c, p;
|
2084
2092
|
const e = t.id, s = {
|
2085
2093
|
width: ((c = t.details) == null ? void 0 : c.width) || r.size.width,
|
@@ -2166,7 +2174,7 @@ const Is = async (t, r) => {
|
|
2166
2174
|
},
|
2167
2175
|
metadata: {}
|
2168
2176
|
};
|
2169
|
-
},
|
2177
|
+
}, ks = async (t, r) => {
|
2170
2178
|
var m;
|
2171
2179
|
const e = t.trackItemIds, s = t.size || {
|
2172
2180
|
width: t.details.width,
|
@@ -2198,7 +2206,7 @@ const Is = async (t, r) => {
|
|
2198
2206
|
display: c || { from: p, to: h },
|
2199
2207
|
activeEdit: !1
|
2200
2208
|
};
|
2201
|
-
},
|
2209
|
+
}, qa = async (t, r) => {
|
2202
2210
|
var k;
|
2203
2211
|
const e = t.trackItemIds, s = t.size || {
|
2204
2212
|
width: t.details.width,
|
@@ -2225,12 +2233,12 @@ const Is = async (t, r) => {
|
|
2225
2233
|
},
|
2226
2234
|
display: c || { from: p, to: h }
|
2227
2235
|
};
|
2228
|
-
},
|
2236
|
+
}, _s = async (t, r) => {
|
2229
2237
|
const e = t.details, s = ze(e.src), a = fetch(e.src), [o, u] = await Promise.all([
|
2230
2238
|
s,
|
2231
2239
|
a
|
2232
|
-
]), c = await u.text(), p = pt(r, o), { serializer: h, colors: k } =
|
2233
|
-
|
2240
|
+
]), c = await u.text(), p = pt(r, o), { serializer: h, colors: k } = Xa(
|
2241
|
+
Ga(c),
|
2234
2242
|
t.id,
|
2235
2243
|
parseFloat(e.width || o.width),
|
2236
2244
|
parseFloat(e.height || o.height)
|
@@ -2274,7 +2282,7 @@ const Is = async (t, r) => {
|
|
2274
2282
|
},
|
2275
2283
|
metadata: t.metadata || {}
|
2276
2284
|
};
|
2277
|
-
},
|
2285
|
+
}, Za = async (t, r) => {
|
2278
2286
|
const e = t.details, s = ze(e.src), [a] = await Promise.all([s]), o = pt(r, a);
|
2279
2287
|
return {
|
2280
2288
|
id: t.id,
|
@@ -2313,7 +2321,7 @@ const Is = async (t, r) => {
|
|
2313
2321
|
},
|
2314
2322
|
metadata: t.metadata || {}
|
2315
2323
|
};
|
2316
|
-
},
|
2324
|
+
}, Qa = async (t, r) => {
|
2317
2325
|
const e = t.details, s = pt(r, {
|
2318
2326
|
width: e.width,
|
2319
2327
|
height: e.height
|
@@ -2355,10 +2363,9 @@ const Is = async (t, r) => {
|
|
2355
2363
|
blur: e.blur || 0,
|
2356
2364
|
brightness: e.brightness || 100
|
2357
2365
|
},
|
2358
|
-
animations: t.animations,
|
2359
2366
|
metadata: t.metadata || {}
|
2360
2367
|
};
|
2361
|
-
},
|
2368
|
+
}, vs = async (t, r) => {
|
2362
2369
|
const e = t.details, s = await ze(e.src), a = pt(r, s);
|
2363
2370
|
return {
|
2364
2371
|
id: t.id,
|
@@ -2398,10 +2405,9 @@ const Is = async (t, r) => {
|
|
2398
2405
|
rotate: e.rotate || "0deg",
|
2399
2406
|
visibility: e.visibility || "visible"
|
2400
2407
|
},
|
2401
|
-
animations: t.animations,
|
2402
2408
|
metadata: t.metadata || {}
|
2403
2409
|
};
|
2404
|
-
},
|
2410
|
+
}, Ss = async (t, r) => {
|
2405
2411
|
const e = t;
|
2406
2412
|
e.details.fontUrl && await er([
|
2407
2413
|
{
|
@@ -2409,7 +2415,7 @@ const Is = async (t, r) => {
|
|
2409
2415
|
url: e.details.fontUrl
|
2410
2416
|
}
|
2411
2417
|
]);
|
2412
|
-
const s = e.id, a = e.details, o =
|
2418
|
+
const s = e.id, a = e.details, o = Ms(a), u = hs(e.details.text, o), c = pt(r, {
|
2413
2419
|
width: o.width,
|
2414
2420
|
height: u
|
2415
2421
|
});
|
@@ -2437,14 +2443,14 @@ const Is = async (t, r) => {
|
|
2437
2443
|
},
|
2438
2444
|
metadata: t.metadata || {}
|
2439
2445
|
};
|
2440
|
-
},
|
2446
|
+
}, ws = async (t, r) => {
|
2441
2447
|
t.details.fontUrl && await er([
|
2442
2448
|
{
|
2443
2449
|
fontFamily: t.details.fontFamily,
|
2444
2450
|
url: t.details.fontUrl
|
2445
2451
|
}
|
2446
2452
|
]);
|
2447
|
-
const e = t.id, s = t.details, a =
|
2453
|
+
const e = t.id, s = t.details, a = Ms(s), o = hs(t.details.text, a), u = pt(r, {
|
2448
2454
|
width: a.width,
|
2449
2455
|
height: o
|
2450
2456
|
});
|
@@ -2466,10 +2472,9 @@ const Is = async (t, r) => {
|
|
2466
2472
|
borderColor: s.borderColor || "#000000",
|
2467
2473
|
boxShadow: s.boxShadow || rr
|
2468
2474
|
},
|
2469
|
-
animations: t.animations,
|
2470
2475
|
metadata: {}
|
2471
2476
|
};
|
2472
|
-
},
|
2477
|
+
}, Ms = (t) => ({
|
2473
2478
|
fontFamily: t.fontFamily || "Arial",
|
2474
2479
|
// Default font family
|
2475
2480
|
fontSize: t.fontSize || "16px",
|
@@ -2513,32 +2518,32 @@ const Is = async (t, r) => {
|
|
2513
2518
|
transform: t.transform || "none",
|
2514
2519
|
skewX: t.skewX || 0,
|
2515
2520
|
skewY: t.skewY || 0
|
2516
|
-
}),
|
2521
|
+
}), ti = async (t, r) => {
|
2517
2522
|
switch (t.type) {
|
2518
2523
|
case "video":
|
2519
|
-
return
|
2524
|
+
return ys(t, r || {});
|
2520
2525
|
case "audio":
|
2521
|
-
return
|
2526
|
+
return bs(t);
|
2522
2527
|
case "image":
|
2523
|
-
return ks(t, r || {});
|
2524
|
-
case "text":
|
2525
2528
|
return vs(t, r || {});
|
2529
|
+
case "text":
|
2530
|
+
return ws(t, r || {});
|
2526
2531
|
case "caption":
|
2527
|
-
return
|
2532
|
+
return Ss(t, r || {});
|
2528
2533
|
case "template":
|
2529
|
-
return
|
2534
|
+
return ks(t, {
|
2530
2535
|
size: r == null ? void 0 : r.size
|
2531
2536
|
});
|
2532
2537
|
default:
|
2533
2538
|
throw new Error("Unsupported track item");
|
2534
2539
|
}
|
2535
2540
|
};
|
2536
|
-
function
|
2541
|
+
function Ts(t, r) {
|
2537
2542
|
return r.some(
|
2538
2543
|
(e) => t.some((s) => s.id === e.id)
|
2539
2544
|
);
|
2540
2545
|
}
|
2541
|
-
const
|
2546
|
+
const Es = (t = [], r = []) => t.length === 0 ? r.map((s) => ({
|
2542
2547
|
id: de(),
|
2543
2548
|
items: [s.id],
|
2544
2549
|
type: s.type,
|
@@ -2552,7 +2557,7 @@ const Ms = (t = [], r = []) => t.length === 0 ? r.map((s) => ({
|
|
2552
2557
|
static: e.static || !1,
|
2553
2558
|
id: e.id || de()
|
2554
2559
|
}));
|
2555
|
-
async function
|
2560
|
+
async function ei(t, r) {
|
2556
2561
|
var c, p, h;
|
2557
2562
|
const e = r.trackItemsMap, s = r.trackItemDetailsMap, a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
2558
2563
|
for (const k in s) {
|
@@ -2594,12 +2599,12 @@ async function Za(t, r) {
|
|
2594
2599
|
Array.from(a).map((k) => JSON.parse(k))
|
2595
2600
|
);
|
2596
2601
|
for (const [k, m] of o) {
|
2597
|
-
const f = await
|
2602
|
+
const f = await _s(
|
2598
2603
|
{ ...m.trackItem, details: m.details },
|
2599
2604
|
{
|
2600
2605
|
size: { width: m.details.width, height: m.details.height }
|
2601
2606
|
}
|
2602
|
-
), I =
|
2607
|
+
), I = ms(
|
2603
2608
|
f.details.svgString,
|
2604
2609
|
m.details.colorMap
|
2605
2610
|
);
|
@@ -2611,7 +2616,7 @@ async function Za(t, r) {
|
|
2611
2616
|
duration: u
|
2612
2617
|
};
|
2613
2618
|
}
|
2614
|
-
function
|
2619
|
+
function ri(t) {
|
2615
2620
|
const r = x(t);
|
2616
2621
|
if (!r.activeIds.length) return;
|
2617
2622
|
const e = r.activeIds, s = [], a = {
|
@@ -2626,7 +2631,7 @@ function Qa(t) {
|
|
2626
2631
|
const o = /* @__PURE__ */ new Set();
|
2627
2632
|
s.filter((u) => o.has(u.id) ? !1 : (o.add(u.id), !0)), a.tracks = Array.from(o), localStorage.setItem("DesignComboTemp", JSON.stringify(a));
|
2628
2633
|
}
|
2629
|
-
function
|
2634
|
+
function ni(t, r) {
|
2630
2635
|
const e = x(t);
|
2631
2636
|
if (e.activeIds.length !== 1) return {};
|
2632
2637
|
const s = e.activeIds[0], a = x(e.trackItemsMap[s]);
|
@@ -2701,7 +2706,7 @@ function ti(t, r) {
|
|
2701
2706
|
transitionIds: e.transitionIds
|
2702
2707
|
};
|
2703
2708
|
}
|
2704
|
-
async function
|
2709
|
+
async function si(t, r) {
|
2705
2710
|
const e = x(t), s = e.trackItemDetailsMap, a = e.trackItemsMap, o = Object.keys(r);
|
2706
2711
|
if (!o.length) return {};
|
2707
2712
|
for (const c of o) {
|
@@ -2710,7 +2715,7 @@ async function ei(t, r) {
|
|
2710
2715
|
...s[c].details,
|
2711
2716
|
...p.details
|
2712
2717
|
}, p.details.colorMap)) {
|
2713
|
-
const h = s[c].details.initialSvgString, k =
|
2718
|
+
const h = s[c].details.initialSvgString, k = ms(
|
2714
2719
|
h,
|
2715
2720
|
p.details.colorMap
|
2716
2721
|
);
|
@@ -2745,7 +2750,7 @@ async function ei(t, r) {
|
|
2745
2750
|
duration: u
|
2746
2751
|
};
|
2747
2752
|
}
|
2748
|
-
async function
|
2753
|
+
async function ai(t, r) {
|
2749
2754
|
const e = x(t), s = Object.keys(r)[0], a = Object.values(r)[0], o = e.trackItemDetailsMap[s], u = o.details;
|
2750
2755
|
if (!a.details.src) return {};
|
2751
2756
|
if (o.type === "image") {
|
@@ -2759,7 +2764,7 @@ async function ri(t, r) {
|
|
2759
2764
|
width: u.width
|
2760
2765
|
}, a.details.width = m, a.details.height = f;
|
2761
2766
|
} else if (o.type === "video") {
|
2762
|
-
const p = await
|
2767
|
+
const p = await Rn(a.details.src), h = o.details.width || 0, k = o.details.height || 0;
|
2763
2768
|
let m = p.width, f = p.height;
|
2764
2769
|
const I = p.width / p.height;
|
2765
2770
|
h / k > I ? (m = h, f = h / I) : (f = k, m = k * I), u.crop = {
|
@@ -2783,18 +2788,18 @@ async function ri(t, r) {
|
|
2783
2788
|
}
|
2784
2789
|
};
|
2785
2790
|
}
|
2786
|
-
function
|
2791
|
+
function ii(t, r) {
|
2787
2792
|
const e = x(t);
|
2788
2793
|
return e.background.value = r.value, e.background.type = r.type || "color", {
|
2789
2794
|
...e
|
2790
2795
|
};
|
2791
2796
|
}
|
2792
|
-
async function
|
2797
|
+
async function oi(t, r, e = {}) {
|
2793
2798
|
const s = x(t), a = r.trackItems.map(
|
2794
|
-
(b) =>
|
2799
|
+
(b) => ti(b, {
|
2795
2800
|
size: s.size
|
2796
2801
|
})
|
2797
|
-
), o = await Promise.all(a), u =
|
2802
|
+
), o = await Promise.all(a), u = Es(r.tracks, r.trackItems), c = [], p = o.map((b) => b.id);
|
2798
2803
|
r.trackItems.forEach((b) => {
|
2799
2804
|
if (b.type !== "template") return;
|
2800
2805
|
s.trackItemsMap = {
|
@@ -2822,7 +2827,7 @@ async function si(t, r, e = {}) {
|
|
2822
2827
|
type: b.type,
|
2823
2828
|
details: _
|
2824
2829
|
}, m[b.id] = T;
|
2825
|
-
}),
|
2830
|
+
}), Ts(
|
2826
2831
|
s.tracks,
|
2827
2832
|
u
|
2828
2833
|
))
|
@@ -2880,7 +2885,7 @@ function St(t, r, e = {}) {
|
|
2880
2885
|
h.items.push(...a);
|
2881
2886
|
} else {
|
2882
2887
|
const c = {
|
2883
|
-
id:
|
2888
|
+
id: fs(),
|
2884
2889
|
accepts: Object.keys(t.acceptsMap),
|
2885
2890
|
type: r[0].type,
|
2886
2891
|
items: s,
|
@@ -2900,9 +2905,9 @@ function St(t, r, e = {}) {
|
|
2900
2905
|
...a
|
2901
2906
|
], t;
|
2902
2907
|
}
|
2903
|
-
async function
|
2908
|
+
async function ci(t, r, e = {}) {
|
2904
2909
|
const s = x(t), a = [
|
2905
|
-
|
2910
|
+
vs(r, {
|
2906
2911
|
size: s.size,
|
2907
2912
|
scaleMode: e.scaleMode,
|
2908
2913
|
scaleAspectRatio: e.scaleAspectRatio
|
@@ -2916,8 +2921,8 @@ async function ai(t, r, e = {}) {
|
|
2916
2921
|
duration: c.duration
|
2917
2922
|
};
|
2918
2923
|
}
|
2919
|
-
async function
|
2920
|
-
const s = x(t), a = [
|
2924
|
+
async function ui(t, r, e = {}) {
|
2925
|
+
const s = x(t), a = [bs(r)], o = await Promise.all(a), u = o.map((h) => h.id), c = St(s, o, e);
|
2921
2926
|
c.duration = J(c.trackItemsMap);
|
2922
2927
|
const p = c.tracks.filter((h) => h.magnetic);
|
2923
2928
|
return st(p, c.trackItemsMap, u), {
|
@@ -2928,9 +2933,9 @@ async function ii(t, r, e = {}) {
|
|
2928
2933
|
duration: c.duration
|
2929
2934
|
};
|
2930
2935
|
}
|
2931
|
-
async function
|
2936
|
+
async function li(t, r, e = {}) {
|
2932
2937
|
const s = x(t), a = [
|
2933
|
-
|
2938
|
+
ys(r, {
|
2934
2939
|
size: s.size,
|
2935
2940
|
scaleMode: e.scaleMode,
|
2936
2941
|
scaleAspectRatio: e.scaleAspectRatio
|
@@ -2946,9 +2951,9 @@ async function oi(t, r, e = {}) {
|
|
2946
2951
|
duration: c.duration
|
2947
2952
|
};
|
2948
2953
|
}
|
2949
|
-
async function
|
2954
|
+
async function di(t, r, e = {}) {
|
2950
2955
|
const s = x(t), a = [
|
2951
|
-
|
2956
|
+
ws(r, {
|
2952
2957
|
size: e.size
|
2953
2958
|
})
|
2954
2959
|
], o = await Promise.all(a), u = o.map((h) => h.id), c = St(s, o, e);
|
@@ -2962,9 +2967,9 @@ async function ci(t, r, e = {}) {
|
|
2962
2967
|
duration: c.duration
|
2963
2968
|
};
|
2964
2969
|
}
|
2965
|
-
async function
|
2970
|
+
async function fi(t, r, e = {}) {
|
2966
2971
|
const s = x(t), a = [
|
2967
|
-
|
2972
|
+
Za(r, {
|
2968
2973
|
size: s.size,
|
2969
2974
|
scaleMode: e.scaleMode,
|
2970
2975
|
scaleAspectRatio: e.scaleAspectRatio
|
@@ -2980,9 +2985,9 @@ async function ui(t, r, e = {}) {
|
|
2980
2985
|
duration: c.duration
|
2981
2986
|
};
|
2982
2987
|
}
|
2983
|
-
async function
|
2988
|
+
async function pi(t, r, e = {}) {
|
2984
2989
|
const s = x(t), a = [
|
2985
|
-
|
2990
|
+
_s(r, {
|
2986
2991
|
size: s.size,
|
2987
2992
|
scaleMode: e.scaleMode,
|
2988
2993
|
scaleAspectRatio: e.scaleAspectRatio
|
@@ -2998,8 +3003,8 @@ async function li(t, r, e = {}) {
|
|
2998
3003
|
duration: c.duration
|
2999
3004
|
};
|
3000
3005
|
}
|
3001
|
-
async function
|
3002
|
-
const s = x(t), a = "composition", o = r.trackItemsMap, u = r.trackItemDetailsMap, c = r.trackItemIds, p = r.tracks || [], { details: h, ...k } = await
|
3006
|
+
async function hi(t, r, e = {}) {
|
3007
|
+
const s = x(t), a = "composition", o = r.trackItemsMap, u = r.trackItemDetailsMap, c = r.trackItemIds, p = r.tracks || [], { details: h, ...k } = await qa(r, {
|
3003
3008
|
size: s.size,
|
3004
3009
|
scaleMode: e.scaleMode,
|
3005
3010
|
scaleAspectRatio: e.scaleAspectRatio
|
@@ -3046,19 +3051,19 @@ async function Pe(t, r, e = {}, s) {
|
|
3046
3051
|
to: a.duration
|
3047
3052
|
}, u = [];
|
3048
3053
|
s === "progress-bar" && u.push(
|
3049
|
-
|
3054
|
+
Ka(r, {
|
3050
3055
|
size: a.size,
|
3051
3056
|
scaleMode: e.scaleMode,
|
3052
3057
|
scaleAspectRatio: e.scaleAspectRatio
|
3053
3058
|
})
|
3054
3059
|
), s === "progress-frame" && u.push(
|
3055
|
-
|
3060
|
+
Va(r, {
|
3056
3061
|
size: a.size,
|
3057
3062
|
scaleMode: e.scaleMode,
|
3058
3063
|
scaleAspectRatio: e.scaleAspectRatio
|
3059
3064
|
})
|
3060
3065
|
), s === "radial-audio-bars" && (r.display = o(r), u.push(
|
3061
|
-
|
3066
|
+
Ja(r, {
|
3062
3067
|
size: a.size,
|
3063
3068
|
scaleMode: e.scaleMode,
|
3064
3069
|
scaleAspectRatio: e.scaleAspectRatio
|
@@ -3093,8 +3098,8 @@ async function Pe(t, r, e = {}, s) {
|
|
3093
3098
|
duration: h.duration
|
3094
3099
|
};
|
3095
3100
|
}
|
3096
|
-
async function
|
3097
|
-
const s = x(t), a = "template", o = r.trackItemsMap, u = r.trackItemDetailsMap, c = r.trackItemIds, p = r.transitionsMap, h = r.transitionIds || [], k = r.tracks || [], m = r.structure || [], { details: f, ...I } = await
|
3101
|
+
async function mi(t, r, e = {}) {
|
3102
|
+
const s = x(t), a = "template", o = r.trackItemsMap, u = r.trackItemDetailsMap, c = r.trackItemIds, p = r.transitionsMap, h = r.transitionIds || [], k = r.tracks || [], m = r.structure || [], { details: f, ...I } = await ks(r, {
|
3098
3103
|
size: s.size,
|
3099
3104
|
scaleMode: e.scaleMode,
|
3100
3105
|
scaleAspectRatio: e.scaleAspectRatio
|
@@ -3146,19 +3151,19 @@ async function fi(t, r, e = {}) {
|
|
3146
3151
|
transitionsMap: d.transitionsMap
|
3147
3152
|
};
|
3148
3153
|
}
|
3149
|
-
async function
|
3154
|
+
async function Ii(t, r, e = {}) {
|
3150
3155
|
const s = x(t), a = r.trackItems.map(
|
3151
|
-
(f) =>
|
3156
|
+
(f) => Ss(f, {
|
3152
3157
|
size: e.size
|
3153
3158
|
})
|
3154
|
-
), o = await Promise.all(a), u =
|
3159
|
+
), o = await Promise.all(a), u = Es(r.tracks, r.trackItems), c = [], p = {}, h = {};
|
3155
3160
|
if (o.forEach((f) => {
|
3156
3161
|
const { details: I, ...b } = f;
|
3157
3162
|
c.push(f.id), p[f.id] = {
|
3158
3163
|
type: f.type,
|
3159
3164
|
details: I
|
3160
3165
|
}, h[f.id] = b;
|
3161
|
-
}),
|
3166
|
+
}), Ts(
|
3162
3167
|
s.tracks,
|
3163
3168
|
u
|
3164
3169
|
))
|
@@ -3201,7 +3206,7 @@ async function pi(t, r, e = {}) {
|
|
3201
3206
|
duration: s.duration
|
3202
3207
|
};
|
3203
3208
|
}
|
3204
|
-
async function
|
3209
|
+
async function gi(t, r) {
|
3205
3210
|
const e = x(t), s = e.trackItemsMap[r.id], a = [];
|
3206
3211
|
if (!s) return {};
|
3207
3212
|
let o = s.animations || {};
|
@@ -3224,9 +3229,9 @@ async function hi(t, r) {
|
|
3224
3229
|
trackItemsMap: e.trackItemsMap
|
3225
3230
|
};
|
3226
3231
|
}
|
3227
|
-
async function
|
3232
|
+
async function yi(t, r, e = {}) {
|
3228
3233
|
const s = x(t), a = [
|
3229
|
-
|
3234
|
+
Qa(r, {
|
3230
3235
|
size: s.size,
|
3231
3236
|
scaleMode: e.scaleMode,
|
3232
3237
|
scaleAspectRatio: e.scaleAspectRatio
|
@@ -3242,11 +3247,11 @@ async function mi(t, r, e = {}) {
|
|
3242
3247
|
duration: c.duration
|
3243
3248
|
};
|
3244
3249
|
}
|
3245
|
-
function
|
3250
|
+
function bi(t) {
|
3246
3251
|
const r = Wt.pipe(
|
3247
|
-
Bt(({ key: d }) => d.startsWith(
|
3252
|
+
Bt(({ key: d }) => d.startsWith(Xn))
|
3248
3253
|
), e = Wt.pipe(
|
3249
|
-
Bt(({ key: d }) => d.startsWith(
|
3254
|
+
Bt(({ key: d }) => d.startsWith(Cn))
|
3250
3255
|
), s = Wt.pipe(
|
3251
3256
|
Bt(({ key: d }) => d.startsWith(H))
|
3252
3257
|
), a = Wt.pipe(
|
@@ -3258,25 +3263,25 @@ function Ii(t) {
|
|
3258
3263
|
), c = Wt.pipe(
|
3259
3264
|
Bt(({ key: d }) => d.startsWith(Yt))
|
3260
3265
|
), p = Wt.pipe(
|
3261
|
-
Bt(({ key: d }) => d.startsWith(
|
3266
|
+
Bt(({ key: d }) => d.startsWith(ds))
|
3262
3267
|
), h = r.subscribe(async (d) => {
|
3263
3268
|
var v;
|
3264
|
-
if (d.key ===
|
3269
|
+
if (d.key === Xn) {
|
3265
3270
|
const { actions: S } = (v = d.value) == null ? void 0 : v.payload;
|
3266
3271
|
S.forEach((y) => {
|
3267
|
-
|
3272
|
+
Ls(y.type, y.payload && { payload: y.payload });
|
3268
3273
|
});
|
3269
3274
|
}
|
3270
3275
|
}), k = e.subscribe(async (d) => {
|
3271
3276
|
var v, S;
|
3272
|
-
if (d.key ===
|
3273
|
-
const y = (v = d.value) == null ? void 0 : v.payload, w = await
|
3277
|
+
if (d.key === ra) {
|
3278
|
+
const y = (v = d.value) == null ? void 0 : v.payload, w = await ei(t.getState(), y);
|
3274
3279
|
t.updateState(w, {
|
3275
3280
|
kind: "design:load",
|
3276
3281
|
updateHistory: !1
|
3277
3282
|
});
|
3278
3283
|
}
|
3279
|
-
if (d.key ===
|
3284
|
+
if (d.key === na) {
|
3280
3285
|
const y = (S = d.value) == null ? void 0 : S.payload;
|
3281
3286
|
t.updateState(
|
3282
3287
|
{
|
@@ -3289,11 +3294,11 @@ function Ii(t) {
|
|
3289
3294
|
);
|
3290
3295
|
}
|
3291
3296
|
}), m = o.subscribe((d) => {
|
3292
|
-
if (d.key ===
|
3293
|
-
if (d.key ===
|
3297
|
+
if (d.key === Ca) return t.undo();
|
3298
|
+
if (d.key === Pa) return t.redo();
|
3294
3299
|
}), f = p.subscribe((d) => {
|
3295
3300
|
var v;
|
3296
|
-
if (d.key ===
|
3301
|
+
if (d.key === Ra) {
|
3297
3302
|
const S = (v = d.value) == null ? void 0 : v.payload.scale;
|
3298
3303
|
t.updateState(
|
3299
3304
|
{
|
@@ -3307,7 +3312,7 @@ function Ii(t) {
|
|
3307
3312
|
}
|
3308
3313
|
}), I = a.subscribe(async (d) => {
|
3309
3314
|
var v, S, y, w;
|
3310
|
-
if (d.key ===
|
3315
|
+
if (d.key === Ea) {
|
3311
3316
|
const M = ((v = d.value) == null ? void 0 : v.payload.trackItemIds) || [];
|
3312
3317
|
t.updateState(
|
3313
3318
|
{ activeIds: M },
|
@@ -3317,12 +3322,12 @@ function Ii(t) {
|
|
3317
3322
|
}
|
3318
3323
|
);
|
3319
3324
|
}
|
3320
|
-
if (d.key ===
|
3321
|
-
const M = (S = d.value) == null ? void 0 : S.payload.trackItemIds, E =
|
3325
|
+
if (d.key === Aa && ri(t.getState()), d.key === xa) {
|
3326
|
+
const M = (S = d.value) == null ? void 0 : S.payload.trackItemIds, E = La(t.getState(), M);
|
3322
3327
|
t.updateState(E, { updateHistory: !0, kind: "remove" });
|
3323
3328
|
}
|
3324
|
-
if (d.key ===
|
3325
|
-
const M =
|
3329
|
+
if (d.key === Da) {
|
3330
|
+
const M = Ba(
|
3326
3331
|
t.getState(),
|
3327
3332
|
(y = d.value) == null ? void 0 : y.payload.trackItemIds
|
3328
3333
|
);
|
@@ -3331,8 +3336,8 @@ function Ii(t) {
|
|
3331
3336
|
kind: "update"
|
3332
3337
|
});
|
3333
3338
|
}
|
3334
|
-
if (d.key ===
|
3335
|
-
const M = (w = d.value) == null ? void 0 : w.payload, E = await
|
3339
|
+
if (d.key === Oa) {
|
3340
|
+
const M = (w = d.value) == null ? void 0 : w.payload, E = await Wa(t.getState(), M);
|
3336
3341
|
t.updateState(E, {
|
3337
3342
|
updateHistory: !0,
|
3338
3343
|
kind: "update:details"
|
@@ -3342,53 +3347,53 @@ function Ii(t) {
|
|
3342
3347
|
var U, C, q, L, Y, mt, O, N, at, Ie, ge, ye, z, be, ke, it, Xt, $, Kt, _e, ot, Vt, Jt, Rt, zt, qt, $t, Zt, Ft, Qt, ve, Se, wt, Lt, te, ee, lt, Mt, we, bt, Tt, Nt, rt, re, ne, Me, Ht, Et;
|
3343
3348
|
const v = x(t.getState()), S = ((C = (U = d.value) == null ? void 0 : U.options) == null ? void 0 : C.isSelected) || !1, y = (L = (q = d.value) == null ? void 0 : q.options) == null ? void 0 : L.scaleMode, w = (mt = (Y = d.value) == null ? void 0 : Y.options) == null ? void 0 : mt.scaleAspectRatio, M = (N = (O = d.value) == null ? void 0 : O.options) == null ? void 0 : N.trackIndex;
|
3344
3349
|
let E = {};
|
3345
|
-
d.key ===
|
3350
|
+
d.key === la ? E = await gi(v, (at = d.value) == null ? void 0 : at.payload) : d.key === pa ? E = await oi(v, (Ie = d.value) == null ? void 0 : Ie.payload, {
|
3346
3351
|
trackIndex: M
|
3347
|
-
}) : d.key ===
|
3352
|
+
}) : d.key === da ? E = await Ii(v, (ge = d.value) == null ? void 0 : ge.payload, {
|
3348
3353
|
trackIndex: M
|
3349
|
-
}) : d.key ===
|
3354
|
+
}) : d.key === sa ? E = await di(v, (ye = d.value) == null ? void 0 : ye.payload, {
|
3350
3355
|
targetTrackIndex: M,
|
3351
3356
|
targetTrackId: (z = d.value) == null ? void 0 : z.options.targetTrackId,
|
3352
3357
|
size: v.size
|
3353
|
-
}) : d.key ===
|
3358
|
+
}) : d.key === fa ? E = await mi(v, (be = d.value) == null ? void 0 : be.payload, {
|
3354
3359
|
scaleMode: y,
|
3355
3360
|
scaleAspectRatio: w,
|
3356
3361
|
targetTrackIndex: M,
|
3357
3362
|
targetTrackId: (it = (ke = d.value) == null ? void 0 : ke.options) == null ? void 0 : it.targetTrackId
|
3358
|
-
}) : d.key ===
|
3363
|
+
}) : d.key === ca ? E = await pi(v, (Xt = d.value) == null ? void 0 : Xt.payload, {
|
3359
3364
|
scaleMode: y,
|
3360
3365
|
scaleAspectRatio: w,
|
3361
3366
|
targetTrackIndex: M,
|
3362
3367
|
targetTrackId: ($ = d.value) == null ? void 0 : $.options.targetTrackId
|
3363
|
-
}) : d.key ===
|
3368
|
+
}) : d.key === ua ? E = await fi(v, (Kt = d.value) == null ? void 0 : Kt.payload, {
|
3364
3369
|
scaleMode: y,
|
3365
3370
|
scaleAspectRatio: w,
|
3366
3371
|
targetTrackIndex: M,
|
3367
3372
|
targetTrackId: (_e = d.value) == null ? void 0 : _e.options.targetTrackId
|
3368
|
-
}) : d.key ===
|
3373
|
+
}) : d.key === _a ? E = await yi(v, (ot = d.value) == null ? void 0 : ot.payload, {
|
3369
3374
|
scaleMode: y,
|
3370
3375
|
scaleAspectRatio: w,
|
3371
3376
|
targetTrackIndex: M,
|
3372
3377
|
targetTrackId: (Vt = d.value) == null ? void 0 : Vt.options.targetTrackId
|
3373
|
-
}) : d.key ===
|
3378
|
+
}) : d.key === oa ? E = await ci(v, (Jt = d.value) == null ? void 0 : Jt.payload, {
|
3374
3379
|
scaleMode: y,
|
3375
3380
|
scaleAspectRatio: w,
|
3376
3381
|
targetTrackIndex: M,
|
3377
3382
|
targetTrackId: (Rt = d.value) == null ? void 0 : Rt.options.targetTrackId
|
3378
|
-
}) : d.key ===
|
3383
|
+
}) : d.key === ia ? E = await ui(v, (zt = d.value) == null ? void 0 : zt.payload, {
|
3379
3384
|
targetTrackIndex: M,
|
3380
3385
|
targetTrackId: (qt = d.value) == null ? void 0 : qt.options.targetTrackId
|
3381
|
-
}) : d.key ===
|
3386
|
+
}) : d.key === aa ? E = await li(v, ($t = d.value) == null ? void 0 : $t.payload, {
|
3382
3387
|
scaleMode: y,
|
3383
3388
|
scaleAspectRatio: w,
|
3384
3389
|
targetTrackIndex: M,
|
3385
3390
|
targetTrackId: (Zt = d.value) == null ? void 0 : Zt.options.targetTrackId
|
3386
|
-
}) : d.key ===
|
3391
|
+
}) : d.key === ha ? E = await hi(v, (Ft = d.value) == null ? void 0 : Ft.payload, {
|
3387
3392
|
scaleMode: y,
|
3388
3393
|
scaleAspectRatio: w,
|
3389
3394
|
targetTrackIndex: M,
|
3390
3395
|
targetTrackId: (Qt = d.value) == null ? void 0 : Qt.options.targetTrackId
|
3391
|
-
}) : d.key ===
|
3396
|
+
}) : d.key === ma ? E = await Pe(
|
3392
3397
|
v,
|
3393
3398
|
(ve = d.value) == null ? void 0 : ve.payload,
|
3394
3399
|
{
|
@@ -3396,7 +3401,7 @@ function Ii(t) {
|
|
3396
3401
|
targetTrackId: (wt = (Se = d.value) == null ? void 0 : Se.options) == null ? void 0 : wt.targetTrackId
|
3397
3402
|
},
|
3398
3403
|
"progress-bar"
|
3399
|
-
) : d.key ===
|
3404
|
+
) : d.key === Ia ? E = await Pe(
|
3400
3405
|
v,
|
3401
3406
|
(Lt = d.value) == null ? void 0 : Lt.payload,
|
3402
3407
|
{
|
@@ -3404,7 +3409,7 @@ function Ii(t) {
|
|
3404
3409
|
targetTrackId: (ee = (te = d.value) == null ? void 0 : te.options) == null ? void 0 : ee.targetTrackId
|
3405
3410
|
},
|
3406
3411
|
"progress-frame"
|
3407
|
-
) : d.key ===
|
3412
|
+
) : d.key === ga ? E = await Pe(
|
3408
3413
|
v,
|
3409
3414
|
(lt = d.value) == null ? void 0 : lt.payload,
|
3410
3415
|
{
|
@@ -3412,7 +3417,7 @@ function Ii(t) {
|
|
3412
3417
|
targetTrackId: (we = (Mt = d.value) == null ? void 0 : Mt.options) == null ? void 0 : we.targetTrackId
|
3413
3418
|
},
|
3414
3419
|
"radial-audio-bars"
|
3415
|
-
) : d.key ===
|
3420
|
+
) : d.key === ya ? E = await Pe(
|
3416
3421
|
v,
|
3417
3422
|
(bt = d.value) == null ? void 0 : bt.payload,
|
3418
3423
|
{
|
@@ -3420,7 +3425,7 @@ function Ii(t) {
|
|
3420
3425
|
targetTrackId: (Nt = (Tt = d.value) == null ? void 0 : Tt.options) == null ? void 0 : Nt.targetTrackId
|
3421
3426
|
},
|
3422
3427
|
"lineal-audio-bars"
|
3423
|
-
) : d.key ===
|
3428
|
+
) : d.key === ba ? E = await Pe(
|
3424
3429
|
v,
|
3425
3430
|
(rt = d.value) == null ? void 0 : rt.payload,
|
3426
3431
|
{
|
@@ -3428,7 +3433,7 @@ function Ii(t) {
|
|
3428
3433
|
targetTrackId: (ne = (re = d.value) == null ? void 0 : re.options) == null ? void 0 : ne.targetTrackId
|
3429
3434
|
},
|
3430
3435
|
"wave-audio-bars"
|
3431
|
-
) : d.key ===
|
3436
|
+
) : d.key === ka && (E = await Pe(
|
3432
3437
|
v,
|
3433
3438
|
(Me = d.value) == null ? void 0 : Me.payload,
|
3434
3439
|
{
|
@@ -3442,15 +3447,15 @@ function Ii(t) {
|
|
3442
3447
|
});
|
3443
3448
|
}), _ = u.subscribe(async (d) => {
|
3444
3449
|
var v;
|
3445
|
-
if (d.key ===
|
3446
|
-
const S = (v = d.value) == null ? void 0 : v.options.time, y =
|
3450
|
+
if (d.key === Ta) {
|
3451
|
+
const S = (v = d.value) == null ? void 0 : v.options.time, y = ni(t.getState(), S);
|
3447
3452
|
Object.keys(y).length > 0 && t.updateState(y, {
|
3448
3453
|
updateHistory: !0,
|
3449
3454
|
kind: "update"
|
3450
3455
|
});
|
3451
3456
|
}
|
3452
|
-
if (d.key ===
|
3453
|
-
const S = await
|
3457
|
+
if (d.key === Ma) {
|
3458
|
+
const S = await Ha(t.getState());
|
3454
3459
|
t.updateState(S, {
|
3455
3460
|
updateHistory: !0,
|
3456
3461
|
kind: "update"
|
@@ -3458,8 +3463,8 @@ function Ii(t) {
|
|
3458
3463
|
}
|
3459
3464
|
}), T = c.subscribe(async (d) => {
|
3460
3465
|
var v, S, y;
|
3461
|
-
if (d.key ===
|
3462
|
-
const w = await
|
3466
|
+
if (d.key === va) {
|
3467
|
+
const w = await si(
|
3463
3468
|
t.getState(),
|
3464
3469
|
(v = d.value) == null ? void 0 : v.payload
|
3465
3470
|
);
|
@@ -3468,8 +3473,8 @@ function Ii(t) {
|
|
3468
3473
|
kind: "update:details"
|
3469
3474
|
});
|
3470
3475
|
}
|
3471
|
-
if (d.key ===
|
3472
|
-
const w = await
|
3476
|
+
if (d.key === Sa) {
|
3477
|
+
const w = await ai(
|
3473
3478
|
t.getState(),
|
3474
3479
|
(S = d.value) == null ? void 0 : S.payload
|
3475
3480
|
);
|
@@ -3478,8 +3483,8 @@ function Ii(t) {
|
|
3478
3483
|
kind: "update:details"
|
3479
3484
|
});
|
3480
3485
|
}
|
3481
|
-
if (d.key ===
|
3482
|
-
const w =
|
3486
|
+
if (d.key === wa) {
|
3487
|
+
const w = ii(t.getState(), (y = d.value) == null ? void 0 : y.payload);
|
3483
3488
|
t.updateState(w, {
|
3484
3489
|
updateHistory: !0,
|
3485
3490
|
kind: "update:details"
|
@@ -3492,8 +3497,8 @@ function Ii(t) {
|
|
3492
3497
|
}
|
3493
3498
|
};
|
3494
3499
|
}
|
3495
|
-
const
|
3496
|
-
function
|
3500
|
+
const ki = { Date: !0, RegExp: !0, String: !0, Number: !0 };
|
3501
|
+
function As(t, r, e = { cyclesFix: !0 }, s = []) {
|
3497
3502
|
var c, p;
|
3498
3503
|
let a = [];
|
3499
3504
|
const o = Array.isArray(t);
|
@@ -3508,7 +3513,7 @@ function Ts(t, r, e = { cyclesFix: !0 }, s = []) {
|
|
3508
3513
|
continue;
|
3509
3514
|
}
|
3510
3515
|
const f = r[h], I = typeof k == "object" && typeof f == "object" && Array.isArray(k) === Array.isArray(f);
|
3511
|
-
k && f && I && !
|
3516
|
+
k && f && I && !ki[(p = (c = Object.getPrototypeOf(k)) == null ? void 0 : c.constructor) == null ? void 0 : p.name] && (!e.cyclesFix || !s.includes(k)) ? a.push.apply(a, As(k, f, e, e.cyclesFix ? s.concat([k]) : []).map((b) => (b.path.unshift(m), b))) : k !== f && // treat NaN values as equivalent
|
3512
3517
|
!(Number.isNaN(k) && Number.isNaN(f)) && !(I && (isNaN(k) ? k + "" == f + "" : +k == +f)) && a.push({
|
3513
3518
|
path: [m],
|
3514
3519
|
type: "CHANGE",
|
@@ -3525,7 +3530,7 @@ function Ts(t, r, e = { cyclesFix: !0 }, s = []) {
|
|
3525
3530
|
});
|
3526
3531
|
return a;
|
3527
3532
|
}
|
3528
|
-
var
|
3533
|
+
var zn = Symbol.for("immer-nothing"), Ve = Symbol.for("immer-draftable"), dt = Symbol.for("immer-state"), Ds = process.env.NODE_ENV !== "production" ? [
|
3529
3534
|
// All error codes, starting by 0:
|
3530
3535
|
function(t) {
|
3531
3536
|
return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
|
@@ -3558,7 +3563,7 @@ var Pn = Symbol.for("immer-nothing"), Ve = Symbol.for("immer-draftable"), dt = S
|
|
3558
3563
|
] : [];
|
3559
3564
|
function G(t, ...r) {
|
3560
3565
|
if (process.env.NODE_ENV !== "production") {
|
3561
|
-
const e =
|
3566
|
+
const e = Ds[t], s = typeof e == "function" ? e.apply(null, r) : e;
|
3562
3567
|
throw new Error(`[Immer] ${s}`);
|
3563
3568
|
}
|
3564
3569
|
throw new Error(
|
@@ -3571,17 +3576,17 @@ function pe(t) {
|
|
3571
3576
|
}
|
3572
3577
|
function Gt(t) {
|
3573
3578
|
var r;
|
3574
|
-
return t ?
|
3579
|
+
return t ? xs(t) || Array.isArray(t) || !!t[Ve] || !!((r = t.constructor) != null && r[Ve]) || nr(t) || sr(t) : !1;
|
3575
3580
|
}
|
3576
|
-
var
|
3577
|
-
function
|
3581
|
+
var _i = Object.prototype.constructor.toString();
|
3582
|
+
function xs(t) {
|
3578
3583
|
if (!t || typeof t != "object")
|
3579
3584
|
return !1;
|
3580
3585
|
const r = fe(t);
|
3581
3586
|
if (r === null)
|
3582
3587
|
return !0;
|
3583
3588
|
const e = Object.hasOwnProperty.call(r, "constructor") && r.constructor;
|
3584
|
-
return e === Object ? !0 : typeof e == "function" && Function.toString.call(e) ===
|
3589
|
+
return e === Object ? !0 : typeof e == "function" && Function.toString.call(e) === _i;
|
3585
3590
|
}
|
3586
3591
|
function Je(t, r) {
|
3587
3592
|
he(t) === 0 ? Reflect.ownKeys(t).forEach((e) => {
|
@@ -3598,11 +3603,11 @@ function qe(t, r) {
|
|
3598
3603
|
function mn(t, r) {
|
3599
3604
|
return he(t) === 2 ? t.get(r) : t[r];
|
3600
3605
|
}
|
3601
|
-
function
|
3606
|
+
function Os(t, r, e) {
|
3602
3607
|
const s = he(t);
|
3603
3608
|
s === 2 ? t.set(r, e) : s === 3 ? t.add(e) : t[r] = e;
|
3604
3609
|
}
|
3605
|
-
function
|
3610
|
+
function vi(t, r) {
|
3606
3611
|
return t === r ? t !== 0 || 1 / t === 1 / r : t !== t && r !== r;
|
3607
3612
|
}
|
3608
3613
|
function nr(t) {
|
@@ -3614,14 +3619,14 @@ function sr(t) {
|
|
3614
3619
|
function le(t) {
|
3615
3620
|
return t.copy_ || t.base_;
|
3616
3621
|
}
|
3617
|
-
function
|
3622
|
+
function Mn(t, r) {
|
3618
3623
|
if (nr(t))
|
3619
3624
|
return new Map(t);
|
3620
3625
|
if (sr(t))
|
3621
3626
|
return new Set(t);
|
3622
3627
|
if (Array.isArray(t))
|
3623
3628
|
return Array.prototype.slice.call(t);
|
3624
|
-
const e =
|
3629
|
+
const e = xs(t);
|
3625
3630
|
if (r === !0 || r === "class_only" && !e) {
|
3626
3631
|
const s = Object.getOwnPropertyDescriptors(t);
|
3627
3632
|
delete s[dt];
|
@@ -3645,28 +3650,28 @@ function wn(t, r) {
|
|
3645
3650
|
return Object.assign(a, t);
|
3646
3651
|
}
|
3647
3652
|
}
|
3648
|
-
function
|
3649
|
-
return Er(t) || pe(t) || !Gt(t) || (he(t) > 1 && (t.set = t.add = t.clear = t.delete =
|
3653
|
+
function $n(t, r = !1) {
|
3654
|
+
return Er(t) || pe(t) || !Gt(t) || (he(t) > 1 && (t.set = t.add = t.clear = t.delete = Si), Object.freeze(t), r && Object.entries(t).forEach(([e, s]) => $n(s, !0))), t;
|
3650
3655
|
}
|
3651
|
-
function
|
3656
|
+
function Si() {
|
3652
3657
|
G(2);
|
3653
3658
|
}
|
3654
3659
|
function Er(t) {
|
3655
3660
|
return Object.isFrozen(t);
|
3656
3661
|
}
|
3657
|
-
var
|
3662
|
+
var Tn = {};
|
3658
3663
|
function me(t) {
|
3659
|
-
const r =
|
3664
|
+
const r = Tn[t];
|
3660
3665
|
return r || G(0, t), r;
|
3661
3666
|
}
|
3662
|
-
function
|
3663
|
-
|
3667
|
+
function wi(t, r) {
|
3668
|
+
Tn[t] || (Tn[t] = r);
|
3664
3669
|
}
|
3665
3670
|
var Ze;
|
3666
|
-
function
|
3671
|
+
function Cs() {
|
3667
3672
|
return Ze;
|
3668
3673
|
}
|
3669
|
-
function
|
3674
|
+
function Mi(t, r) {
|
3670
3675
|
return {
|
3671
3676
|
drafts_: [],
|
3672
3677
|
parent_: t,
|
@@ -3677,31 +3682,31 @@ function vi(t, r) {
|
|
3677
3682
|
unfinalizedDrafts_: 0
|
3678
3683
|
};
|
3679
3684
|
}
|
3680
|
-
function
|
3685
|
+
function Jn(t, r) {
|
3681
3686
|
r && (me("Patches"), t.patches_ = [], t.inversePatches_ = [], t.patchListener_ = r);
|
3682
3687
|
}
|
3683
|
-
function Tn(t) {
|
3684
|
-
En(t), t.drafts_.forEach(Si), t.drafts_ = null;
|
3685
|
-
}
|
3686
3688
|
function En(t) {
|
3689
|
+
An(t), t.drafts_.forEach(Ti), t.drafts_ = null;
|
3690
|
+
}
|
3691
|
+
function An(t) {
|
3687
3692
|
t === Ze && (Ze = t.parent_);
|
3688
3693
|
}
|
3689
|
-
function
|
3690
|
-
return Ze =
|
3694
|
+
function qn(t) {
|
3695
|
+
return Ze = Mi(Ze, t);
|
3691
3696
|
}
|
3692
|
-
function
|
3697
|
+
function Ti(t) {
|
3693
3698
|
const r = t[dt];
|
3694
3699
|
r.type_ === 0 || r.type_ === 1 ? r.revoke_() : r.revoked_ = !0;
|
3695
3700
|
}
|
3696
|
-
function
|
3701
|
+
function Zn(t, r) {
|
3697
3702
|
r.unfinalizedDrafts_ = r.drafts_.length;
|
3698
3703
|
const e = r.drafts_[0];
|
3699
|
-
return t !== void 0 && t !== e ? (e[dt].modified_ && (
|
3704
|
+
return t !== void 0 && t !== e ? (e[dt].modified_ && (En(r), G(4)), Gt(t) && (t = Sr(r, t), r.parent_ || wr(r, t)), r.patches_ && me("Patches").generateReplacementPatches_(
|
3700
3705
|
e[dt].base_,
|
3701
3706
|
t,
|
3702
3707
|
r.patches_,
|
3703
3708
|
r.inversePatches_
|
3704
|
-
)) : t = Sr(r, e, []),
|
3709
|
+
)) : t = Sr(r, e, []), En(r), r.patches_ && r.patchListener_(r.patches_, r.inversePatches_), t !== zn ? t : void 0;
|
3705
3710
|
}
|
3706
3711
|
function Sr(t, r, e) {
|
3707
3712
|
if (Er(r))
|
@@ -3710,7 +3715,7 @@ function Sr(t, r, e) {
|
|
3710
3715
|
if (!s)
|
3711
3716
|
return Je(
|
3712
3717
|
r,
|
3713
|
-
(a, o) =>
|
3718
|
+
(a, o) => Qn(t, s, r, a, o, e)
|
3714
3719
|
), r;
|
3715
3720
|
if (s.scope_ !== t)
|
3716
3721
|
return r;
|
@@ -3722,7 +3727,7 @@ function Sr(t, r, e) {
|
|
3722
3727
|
let o = a, u = !1;
|
3723
3728
|
s.type_ === 3 && (o = new Set(a), a.clear(), u = !0), Je(
|
3724
3729
|
o,
|
3725
|
-
(c, p) =>
|
3730
|
+
(c, p) => Qn(t, s, a, c, p, e, u)
|
3726
3731
|
), wr(t, a, !1), e && t.patches_ && me("Patches").generatePatches_(
|
3727
3732
|
s,
|
3728
3733
|
e,
|
@@ -3732,11 +3737,11 @@ function Sr(t, r, e) {
|
|
3732
3737
|
}
|
3733
3738
|
return s.copy_;
|
3734
3739
|
}
|
3735
|
-
function
|
3740
|
+
function Qn(t, r, e, s, a, o, u) {
|
3736
3741
|
if (process.env.NODE_ENV !== "production" && a === e && G(5), pe(a)) {
|
3737
3742
|
const c = o && r && r.type_ !== 3 && // Set objects are atomic since they have no keys.
|
3738
3743
|
!qe(r.assigned_, s) ? o.concat(s) : void 0, p = Sr(t, a, c);
|
3739
|
-
if (
|
3744
|
+
if (Os(e, s, p), pe(p))
|
3740
3745
|
t.canAutoFreeze_ = !1;
|
3741
3746
|
else
|
3742
3747
|
return;
|
@@ -3748,13 +3753,13 @@ function qn(t, r, e, s, a, o, u) {
|
|
3748
3753
|
}
|
3749
3754
|
}
|
3750
3755
|
function wr(t, r, e = !1) {
|
3751
|
-
!t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ &&
|
3756
|
+
!t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && $n(r, e);
|
3752
3757
|
}
|
3753
|
-
function
|
3758
|
+
function Ei(t, r) {
|
3754
3759
|
const e = Array.isArray(t), s = {
|
3755
3760
|
type_: e ? 1 : 0,
|
3756
3761
|
// Track which produce call this is associated with.
|
3757
|
-
scope_: r ? r.scope_ :
|
3762
|
+
scope_: r ? r.scope_ : Cs(),
|
3758
3763
|
// True for both shallow and deep changes.
|
3759
3764
|
modified_: !1,
|
3760
3765
|
// Used during finalization.
|
@@ -3774,20 +3779,20 @@ function wi(t, r) {
|
|
3774
3779
|
revoke_: null,
|
3775
3780
|
isManual_: !1
|
3776
3781
|
};
|
3777
|
-
let a = s, o =
|
3782
|
+
let a = s, o = Fn;
|
3778
3783
|
e && (a = [s], o = Qe);
|
3779
3784
|
const { revoke: u, proxy: c } = Proxy.revocable(a, o);
|
3780
3785
|
return s.draft_ = c, s.revoke_ = u, c;
|
3781
3786
|
}
|
3782
|
-
var
|
3787
|
+
var Fn = {
|
3783
3788
|
get(t, r) {
|
3784
3789
|
if (r === dt)
|
3785
3790
|
return t;
|
3786
3791
|
const e = le(t);
|
3787
3792
|
if (!qe(e, r))
|
3788
|
-
return
|
3793
|
+
return Ai(t, e, r);
|
3789
3794
|
const s = e[r];
|
3790
|
-
return t.finalized_ || !Gt(s) ? s : s === In(t.base_, r) ? (gn(t), t.copy_[r] =
|
3795
|
+
return t.finalized_ || !Gt(s) ? s : s === In(t.base_, r) ? (gn(t), t.copy_[r] = xn(s, t)) : s;
|
3791
3796
|
},
|
3792
3797
|
has(t, r) {
|
3793
3798
|
return r in le(t);
|
@@ -3796,23 +3801,23 @@ var zn = {
|
|
3796
3801
|
return Reflect.ownKeys(le(t));
|
3797
3802
|
},
|
3798
3803
|
set(t, r, e) {
|
3799
|
-
const s =
|
3804
|
+
const s = Ps(le(t), r);
|
3800
3805
|
if (s != null && s.set)
|
3801
3806
|
return s.set.call(t.draft_, e), !0;
|
3802
3807
|
if (!t.modified_) {
|
3803
3808
|
const a = In(le(t), r), o = a == null ? void 0 : a[dt];
|
3804
3809
|
if (o && o.base_ === e)
|
3805
3810
|
return t.copy_[r] = e, t.assigned_[r] = !1, !0;
|
3806
|
-
if (
|
3811
|
+
if (vi(e, a) && (e !== void 0 || qe(t.base_, r)))
|
3807
3812
|
return !0;
|
3808
|
-
gn(t),
|
3813
|
+
gn(t), Dn(t);
|
3809
3814
|
}
|
3810
3815
|
return t.copy_[r] === e && // special case: handle new props with value 'undefined'
|
3811
3816
|
(e !== void 0 || r in t.copy_) || // special case: NaN
|
3812
3817
|
Number.isNaN(e) && Number.isNaN(t.copy_[r]) || (t.copy_[r] = e, t.assigned_[r] = !0), !0;
|
3813
3818
|
},
|
3814
3819
|
deleteProperty(t, r) {
|
3815
|
-
return In(t.base_, r) !== void 0 || r in t.base_ ? (t.assigned_[r] = !1, gn(t),
|
3820
|
+
return In(t.base_, r) !== void 0 || r in t.base_ ? (t.assigned_[r] = !1, gn(t), Dn(t)) : delete t.assigned_[r], t.copy_ && delete t.copy_[r], !0;
|
3816
3821
|
},
|
3817
3822
|
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
3818
3823
|
// the same guarantee in ES5 mode.
|
@@ -3835,7 +3840,7 @@ var zn = {
|
|
3835
3840
|
G(12);
|
3836
3841
|
}
|
3837
3842
|
}, Qe = {};
|
3838
|
-
Je(
|
3843
|
+
Je(Fn, (t, r) => {
|
3839
3844
|
Qe[t] = function() {
|
3840
3845
|
return arguments[0] = arguments[0][0], r.apply(this, arguments);
|
3841
3846
|
};
|
@@ -3844,22 +3849,22 @@ Qe.deleteProperty = function(t, r) {
|
|
3844
3849
|
return process.env.NODE_ENV !== "production" && isNaN(parseInt(r)) && G(13), Qe.set.call(this, t, r, void 0);
|
3845
3850
|
};
|
3846
3851
|
Qe.set = function(t, r, e) {
|
3847
|
-
return process.env.NODE_ENV !== "production" && r !== "length" && isNaN(parseInt(r)) && G(14),
|
3852
|
+
return process.env.NODE_ENV !== "production" && r !== "length" && isNaN(parseInt(r)) && G(14), Fn.set.call(this, t[0], r, e, t[0]);
|
3848
3853
|
};
|
3849
3854
|
function In(t, r) {
|
3850
3855
|
const e = t[dt];
|
3851
3856
|
return (e ? le(e) : t)[r];
|
3852
3857
|
}
|
3853
|
-
function
|
3858
|
+
function Ai(t, r, e) {
|
3854
3859
|
var a;
|
3855
|
-
const s =
|
3860
|
+
const s = Ps(r, e);
|
3856
3861
|
return s ? "value" in s ? s.value : (
|
3857
3862
|
// This is a very special case, if the prop is a getter defined by the
|
3858
3863
|
// prototype, we should invoke it with the draft as context!
|
3859
3864
|
(a = s.get) == null ? void 0 : a.call(t.draft_)
|
3860
3865
|
) : void 0;
|
3861
3866
|
}
|
3862
|
-
function
|
3867
|
+
function Ps(t, r) {
|
3863
3868
|
if (!(r in t))
|
3864
3869
|
return;
|
3865
3870
|
let e = fe(t);
|
@@ -3870,16 +3875,16 @@ function Os(t, r) {
|
|
3870
3875
|
e = fe(e);
|
3871
3876
|
}
|
3872
3877
|
}
|
3873
|
-
function
|
3874
|
-
t.modified_ || (t.modified_ = !0, t.parent_ &&
|
3878
|
+
function Dn(t) {
|
3879
|
+
t.modified_ || (t.modified_ = !0, t.parent_ && Dn(t.parent_));
|
3875
3880
|
}
|
3876
3881
|
function gn(t) {
|
3877
|
-
t.copy_ || (t.copy_ =
|
3882
|
+
t.copy_ || (t.copy_ = Mn(
|
3878
3883
|
t.base_,
|
3879
3884
|
t.scope_.immer_.useStrictShallowCopy_
|
3880
3885
|
));
|
3881
3886
|
}
|
3882
|
-
var
|
3887
|
+
var Di = class {
|
3883
3888
|
constructor(t) {
|
3884
3889
|
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (r, e, s) => {
|
3885
3890
|
if (typeof r == "function" && typeof e != "function") {
|
@@ -3893,16 +3898,16 @@ var Ti = class {
|
|
3893
3898
|
typeof e != "function" && G(6), s !== void 0 && typeof s != "function" && G(7);
|
3894
3899
|
let a;
|
3895
3900
|
if (Gt(r)) {
|
3896
|
-
const o =
|
3901
|
+
const o = qn(this), u = xn(r, void 0);
|
3897
3902
|
let c = !0;
|
3898
3903
|
try {
|
3899
3904
|
a = e(u), c = !1;
|
3900
3905
|
} finally {
|
3901
|
-
c ?
|
3906
|
+
c ? En(o) : An(o);
|
3902
3907
|
}
|
3903
|
-
return
|
3908
|
+
return Jn(o, s), Zn(a, o);
|
3904
3909
|
} else if (!r || typeof r != "object") {
|
3905
|
-
if (a = e(r), a === void 0 && (a = r), a ===
|
3910
|
+
if (a = e(r), a === void 0 && (a = r), a === zn && (a = void 0), this.autoFreeze_ && $n(a, !0), s) {
|
3906
3911
|
const o = [], u = [];
|
3907
3912
|
me("Patches").generateReplacementPatches_(r, a, o, u), s(o, u);
|
3908
3913
|
}
|
@@ -3919,15 +3924,15 @@ var Ti = class {
|
|
3919
3924
|
}, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
|
3920
3925
|
}
|
3921
3926
|
createDraft(t) {
|
3922
|
-
Gt(t) || G(8), pe(t) && (t =
|
3923
|
-
const r =
|
3924
|
-
return e[dt].isManual_ = !0,
|
3927
|
+
Gt(t) || G(8), pe(t) && (t = xi(t));
|
3928
|
+
const r = qn(this), e = xn(t, void 0);
|
3929
|
+
return e[dt].isManual_ = !0, An(r), e;
|
3925
3930
|
}
|
3926
3931
|
finishDraft(t, r) {
|
3927
3932
|
const e = t && t[dt];
|
3928
3933
|
(!e || !e.isManual_) && G(9);
|
3929
3934
|
const { scope_: s } = e;
|
3930
|
-
return
|
3935
|
+
return Jn(s, r), Zn(void 0, s);
|
3931
3936
|
}
|
3932
3937
|
/**
|
3933
3938
|
* Pass true to automatically freeze all copies created by Immer.
|
@@ -3962,14 +3967,14 @@ var Ti = class {
|
|
3962
3967
|
);
|
3963
3968
|
}
|
3964
3969
|
};
|
3965
|
-
function
|
3966
|
-
const e = nr(t) ? me("MapSet").proxyMap_(t, r) : sr(t) ? me("MapSet").proxySet_(t, r) :
|
3967
|
-
return (r ? r.scope_ :
|
3970
|
+
function xn(t, r) {
|
3971
|
+
const e = nr(t) ? me("MapSet").proxyMap_(t, r) : sr(t) ? me("MapSet").proxySet_(t, r) : Ei(t, r);
|
3972
|
+
return (r ? r.scope_ : Cs()).drafts_.push(e), e;
|
3968
3973
|
}
|
3969
|
-
function
|
3970
|
-
return pe(t) || G(10, t),
|
3974
|
+
function xi(t) {
|
3975
|
+
return pe(t) || G(10, t), Rs(t);
|
3971
3976
|
}
|
3972
|
-
function
|
3977
|
+
function Rs(t) {
|
3973
3978
|
if (!Gt(t) || Er(t))
|
3974
3979
|
return t;
|
3975
3980
|
const r = t[dt];
|
@@ -3977,15 +3982,15 @@ function Cs(t) {
|
|
3977
3982
|
if (r) {
|
3978
3983
|
if (!r.modified_)
|
3979
3984
|
return r.base_;
|
3980
|
-
r.finalized_ = !0, e =
|
3985
|
+
r.finalized_ = !0, e = Mn(t, r.scope_.immer_.useStrictShallowCopy_);
|
3981
3986
|
} else
|
3982
|
-
e =
|
3987
|
+
e = Mn(t, !0);
|
3983
3988
|
return Je(e, (s, a) => {
|
3984
|
-
|
3989
|
+
Os(e, s, Rs(a));
|
3985
3990
|
}), r && (r.finalized_ = !1), e;
|
3986
3991
|
}
|
3987
|
-
function
|
3988
|
-
process.env.NODE_ENV !== "production" &&
|
3992
|
+
function ts() {
|
3993
|
+
process.env.NODE_ENV !== "production" && Ds.push(
|
3989
3994
|
'Sets cannot have "replace" patches.',
|
3990
3995
|
function(f) {
|
3991
3996
|
return "Unsupported patch operation: " + f;
|
@@ -4101,7 +4106,7 @@ function Zn() {
|
|
4101
4106
|
b.push({
|
4102
4107
|
op: r,
|
4103
4108
|
path: [],
|
4104
|
-
value: I ===
|
4109
|
+
value: I === zn ? void 0 : I
|
4105
4110
|
}), _.push({
|
4106
4111
|
op: r,
|
4107
4112
|
path: [],
|
@@ -4174,23 +4179,23 @@ function Zn() {
|
|
4174
4179
|
function m(f) {
|
4175
4180
|
return pe(f) ? k(f) : f;
|
4176
4181
|
}
|
4177
|
-
|
4182
|
+
wi("Patches", {
|
4178
4183
|
applyPatches_: h,
|
4179
4184
|
generatePatches_: a,
|
4180
4185
|
generateReplacementPatches_: p
|
4181
4186
|
});
|
4182
4187
|
}
|
4183
|
-
var ft = new
|
4188
|
+
var ft = new Di(), Oi = ft.produce;
|
4184
4189
|
ft.produceWithPatches.bind(
|
4185
4190
|
ft
|
4186
4191
|
);
|
4187
4192
|
ft.setAutoFreeze.bind(ft);
|
4188
4193
|
ft.setUseStrictShallowCopy.bind(ft);
|
4189
|
-
var
|
4194
|
+
var Ci = ft.applyPatches.bind(ft);
|
4190
4195
|
ft.createDraft.bind(ft);
|
4191
4196
|
ft.finishDraft.bind(ft);
|
4192
|
-
var
|
4193
|
-
function
|
4197
|
+
var Pi = 9007199254740991, Ri = "[object Arguments]", zi = "[object Function]", $i = "[object GeneratorFunction]", Fi = "[object Symbol]", Li = typeof ht == "object" && ht && ht.Object === Object && ht, Ni = typeof self == "object" && self && self.Object === Object && self, Hi = Li || Ni || Function("return this")();
|
4198
|
+
function Ui(t, r, e) {
|
4194
4199
|
switch (e.length) {
|
4195
4200
|
case 0:
|
4196
4201
|
return t.call(r);
|
@@ -4203,92 +4208,92 @@ function Li(t, r, e) {
|
|
4203
4208
|
}
|
4204
4209
|
return t.apply(r, e);
|
4205
4210
|
}
|
4206
|
-
function
|
4211
|
+
function ji(t, r) {
|
4207
4212
|
for (var e = -1, s = t ? t.length : 0, a = Array(s); ++e < s; )
|
4208
4213
|
a[e] = r(t[e], e, t);
|
4209
4214
|
return a;
|
4210
4215
|
}
|
4211
|
-
function
|
4216
|
+
function Wi(t, r) {
|
4212
4217
|
for (var e = -1, s = r.length, a = t.length; ++e < s; )
|
4213
4218
|
t[a + e] = r[e];
|
4214
4219
|
return t;
|
4215
4220
|
}
|
4216
|
-
var
|
4217
|
-
function
|
4221
|
+
var Ln = Object.prototype, Bi = Ln.hasOwnProperty, Nn = Ln.toString, es = Hi.Symbol, Gi = Ln.propertyIsEnumerable, rs = es ? es.isConcatSpreadable : void 0, ns = Math.max;
|
4222
|
+
function Yi(t, r, e, s, a) {
|
4218
4223
|
var o = -1, u = t.length;
|
4219
|
-
for (e || (e =
|
4224
|
+
for (e || (e = Ji), a || (a = []); ++o < u; ) {
|
4220
4225
|
var c = t[o];
|
4221
|
-
e(c) ?
|
4226
|
+
e(c) ? Wi(a, c) : a[a.length] = c;
|
4222
4227
|
}
|
4223
4228
|
return a;
|
4224
4229
|
}
|
4225
|
-
function
|
4226
|
-
return t = Object(t),
|
4230
|
+
function Xi(t, r) {
|
4231
|
+
return t = Object(t), Ki(t, r, function(e, s) {
|
4227
4232
|
return s in t;
|
4228
4233
|
});
|
4229
4234
|
}
|
4230
|
-
function
|
4235
|
+
function Ki(t, r, e) {
|
4231
4236
|
for (var s = -1, a = r.length, o = {}; ++s < a; ) {
|
4232
4237
|
var u = r[s], c = t[u];
|
4233
4238
|
e(c, u) && (o[u] = c);
|
4234
4239
|
}
|
4235
4240
|
return o;
|
4236
4241
|
}
|
4237
|
-
function
|
4238
|
-
return r =
|
4239
|
-
for (var e = arguments, s = -1, a =
|
4242
|
+
function Vi(t, r) {
|
4243
|
+
return r = ns(r === void 0 ? t.length - 1 : r, 0), function() {
|
4244
|
+
for (var e = arguments, s = -1, a = ns(e.length - r, 0), o = Array(a); ++s < a; )
|
4240
4245
|
o[s] = e[r + s];
|
4241
4246
|
s = -1;
|
4242
4247
|
for (var u = Array(r + 1); ++s < r; )
|
4243
4248
|
u[s] = e[s];
|
4244
|
-
return u[r] = o,
|
4249
|
+
return u[r] = o, Ui(t, this, u);
|
4245
4250
|
};
|
4246
4251
|
}
|
4247
|
-
function
|
4248
|
-
return
|
4252
|
+
function Ji(t) {
|
4253
|
+
return Qi(t) || Zi(t) || !!(rs && t && t[rs]);
|
4249
4254
|
}
|
4250
|
-
function
|
4251
|
-
if (typeof t == "string" ||
|
4255
|
+
function qi(t) {
|
4256
|
+
if (typeof t == "string" || ao(t))
|
4252
4257
|
return t;
|
4253
4258
|
var r = t + "";
|
4254
4259
|
return r == "0" && 1 / t == -1 / 0 ? "-0" : r;
|
4255
4260
|
}
|
4256
|
-
function Vi(t) {
|
4257
|
-
return Zi(t) && Ui.call(t, "callee") && (!ji.call(t, "callee") || Fn.call(t) == Oi);
|
4258
|
-
}
|
4259
|
-
var Ji = Array.isArray;
|
4260
|
-
function qi(t) {
|
4261
|
-
return t != null && to(t.length) && !Qi(t);
|
4262
|
-
}
|
4263
4261
|
function Zi(t) {
|
4264
|
-
return
|
4265
|
-
}
|
4266
|
-
function Qi(t) {
|
4267
|
-
var r = eo(t) ? Fn.call(t) : "";
|
4268
|
-
return r == Ci || r == Pi;
|
4262
|
+
return eo(t) && Bi.call(t, "callee") && (!Gi.call(t, "callee") || Nn.call(t) == Ri);
|
4269
4263
|
}
|
4264
|
+
var Qi = Array.isArray;
|
4270
4265
|
function to(t) {
|
4271
|
-
return
|
4266
|
+
return t != null && no(t.length) && !ro(t);
|
4272
4267
|
}
|
4273
4268
|
function eo(t) {
|
4269
|
+
return zs(t) && to(t);
|
4270
|
+
}
|
4271
|
+
function ro(t) {
|
4272
|
+
var r = so(t) ? Nn.call(t) : "";
|
4273
|
+
return r == zi || r == $i;
|
4274
|
+
}
|
4275
|
+
function no(t) {
|
4276
|
+
return typeof t == "number" && t > -1 && t % 1 == 0 && t <= Pi;
|
4277
|
+
}
|
4278
|
+
function so(t) {
|
4274
4279
|
var r = typeof t;
|
4275
4280
|
return !!t && (r == "object" || r == "function");
|
4276
4281
|
}
|
4277
|
-
function
|
4282
|
+
function zs(t) {
|
4278
4283
|
return !!t && typeof t == "object";
|
4279
4284
|
}
|
4280
|
-
function
|
4281
|
-
return typeof t == "symbol" ||
|
4285
|
+
function ao(t) {
|
4286
|
+
return typeof t == "symbol" || zs(t) && Nn.call(t) == Fi;
|
4282
4287
|
}
|
4283
|
-
var
|
4284
|
-
return t == null ? {} :
|
4285
|
-
}),
|
4286
|
-
const
|
4288
|
+
var io = Vi(function(t, r) {
|
4289
|
+
return t == null ? {} : Xi(t, ji(Yi(r), qi));
|
4290
|
+
}), oo = io;
|
4291
|
+
const ss = /* @__PURE__ */ On(oo), co = {
|
4287
4292
|
width: 1080,
|
4288
4293
|
height: 1920
|
4289
|
-
},
|
4290
|
-
size:
|
4291
|
-
fps:
|
4294
|
+
}, uo = 30, lo = {
|
4295
|
+
size: co,
|
4296
|
+
fps: uo,
|
4292
4297
|
tracks: [],
|
4293
4298
|
trackItemIds: [],
|
4294
4299
|
trackItemsMap: {},
|
@@ -4309,7 +4314,7 @@ const rs = /* @__PURE__ */ xn(so), ao = {
|
|
4309
4314
|
value: "transparent"
|
4310
4315
|
},
|
4311
4316
|
acceptsMap: {}
|
4312
|
-
},
|
4317
|
+
}, as = [
|
4313
4318
|
"tracks",
|
4314
4319
|
"trackItemsMap",
|
4315
4320
|
"trackItemDetailsMap",
|
@@ -4318,8 +4323,8 @@ const rs = /* @__PURE__ */ xn(so), ao = {
|
|
4318
4323
|
"trackItemIds",
|
4319
4324
|
"structure"
|
4320
4325
|
];
|
4321
|
-
class
|
4322
|
-
constructor(r) {
|
4326
|
+
class Ho {
|
4327
|
+
constructor(r, e) {
|
4323
4328
|
Ct(this, "stateSubject");
|
4324
4329
|
Ct(this, "stateHistorySubject");
|
4325
4330
|
Ct(this, "prevState");
|
@@ -4328,14 +4333,14 @@ class Fo {
|
|
4328
4333
|
Ct(this, "redos", []);
|
4329
4334
|
Ct(this, "acceptsMap");
|
4330
4335
|
Ct(this, "listener");
|
4331
|
-
const
|
4332
|
-
this.stateSubject = new
|
4336
|
+
const s = Object.assign({}, lo, r);
|
4337
|
+
this.stateSubject = new Yn(s), this.stateHistorySubject = new Yn({
|
4333
4338
|
handleRedo: !1,
|
4334
4339
|
handleUndo: !1
|
4335
|
-
}), this.background =
|
4340
|
+
}), this.background = s.background, this.prevState = s, this.acceptsMap = s.acceptsMap, e != null && e.cors && Ua({ cors: e.cors }), this.initListeners();
|
4336
4341
|
}
|
4337
4342
|
initListeners() {
|
4338
|
-
|
4343
|
+
bi(this);
|
4339
4344
|
}
|
4340
4345
|
destroyListeners() {
|
4341
4346
|
this.listener && this.listener.unsubscribe();
|
@@ -4344,7 +4349,7 @@ class Fo {
|
|
4344
4349
|
this.destroyListeners();
|
4345
4350
|
}
|
4346
4351
|
updateHistory(r, e) {
|
4347
|
-
const s =
|
4352
|
+
const s = ss(r, as), a = ss(this.getState(), as), o = As(a, s);
|
4348
4353
|
o.length && (this.undos.push({ undos: o, type: e }), this.redos = []);
|
4349
4354
|
}
|
4350
4355
|
getStateHistory() {
|
@@ -4492,7 +4497,7 @@ class Fo {
|
|
4492
4497
|
undo() {
|
4493
4498
|
const r = this.undos.pop(), e = r == null ? void 0 : r.undos, s = r == null ? void 0 : r.type;
|
4494
4499
|
if (!e || !s) return;
|
4495
|
-
|
4500
|
+
ts();
|
4496
4501
|
const {
|
4497
4502
|
trackItemDetailsMap: a,
|
4498
4503
|
trackItemIds: o,
|
@@ -4562,14 +4567,14 @@ class Fo {
|
|
4562
4567
|
this.stateSubject.next({ ...Y, duration: mt }), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 }), this.updateState(Y, { updateHistory: !1 });
|
4563
4568
|
}
|
4564
4569
|
applyPatch(r, e) {
|
4565
|
-
return e.reverse().reduce((s, a) =>
|
4566
|
-
|
4570
|
+
return e.reverse().reduce((s, a) => Oi(s, (o) => {
|
4571
|
+
Ci(o, [a]);
|
4567
4572
|
}), r);
|
4568
4573
|
}
|
4569
4574
|
redo() {
|
4570
4575
|
const r = this.redos.pop(), e = r == null ? void 0 : r.redos, s = r == null ? void 0 : r.type;
|
4571
4576
|
if (!e || !s) return;
|
4572
|
-
|
4577
|
+
ts();
|
4573
4578
|
const {
|
4574
4579
|
trackItemDetailsMap: a,
|
4575
4580
|
trackItemIds: o,
|
@@ -4662,76 +4667,76 @@ class Fo {
|
|
4662
4667
|
}
|
4663
4668
|
}
|
4664
4669
|
export {
|
4665
|
-
|
4666
|
-
|
4667
|
-
|
4670
|
+
Ao as ACTIVE_CLONE,
|
4671
|
+
Eo as ACTIVE_DELETE,
|
4672
|
+
Ma as ACTIVE_PASTE,
|
4668
4673
|
Re as ACTIVE_PREFIX,
|
4669
|
-
|
4670
|
-
|
4671
|
-
|
4672
|
-
|
4673
|
-
|
4674
|
-
|
4675
|
-
|
4676
|
-
|
4677
|
-
|
4678
|
-
|
4679
|
-
|
4680
|
-
|
4681
|
-
|
4674
|
+
To as ACTIVE_SET,
|
4675
|
+
Ta as ACTIVE_SPLIT,
|
4676
|
+
la as ADD_ANIMATION,
|
4677
|
+
ia as ADD_AUDIO,
|
4678
|
+
da as ADD_CAPTIONS,
|
4679
|
+
ha as ADD_COMPOSITION,
|
4680
|
+
ka as ADD_HILL_AUDIO_BARS,
|
4681
|
+
ca as ADD_ILLUSTRATION,
|
4682
|
+
oa as ADD_IMAGE,
|
4683
|
+
pa as ADD_ITEMS,
|
4684
|
+
ya as ADD_LINEAL_AUDIO_BARS,
|
4685
|
+
bo as ADD_MASK,
|
4686
|
+
yo as ADD_PLACEHOLDER,
|
4682
4687
|
H as ADD_PREFIX,
|
4683
|
-
|
4684
|
-
|
4685
|
-
|
4686
|
-
|
4687
|
-
|
4688
|
-
|
4689
|
-
|
4690
|
-
|
4691
|
-
|
4692
|
-
|
4693
|
-
|
4694
|
-
|
4695
|
-
|
4696
|
-
|
4697
|
-
|
4698
|
-
|
4699
|
-
|
4700
|
-
|
4701
|
-
|
4688
|
+
ma as ADD_PROGRESS_BAR,
|
4689
|
+
Ia as ADD_PROGRESS_FRAME,
|
4690
|
+
ga as ADD_RADIAL_AUDIO_BARS,
|
4691
|
+
_a as ADD_RECT,
|
4692
|
+
ua as ADD_SHAPE,
|
4693
|
+
ho as ADD_SUFFIX,
|
4694
|
+
fa as ADD_TEMPLATE,
|
4695
|
+
sa as ADD_TEXT,
|
4696
|
+
ko as ADD_TRANSITION,
|
4697
|
+
aa as ADD_VIDEO,
|
4698
|
+
ba as ADD_WAVE_AUDIO_BARS,
|
4699
|
+
ea as BULK_PREFIX,
|
4700
|
+
wo as DELETE_TEMPLATE_ITEM,
|
4701
|
+
ra as DESIGN_LOAD,
|
4702
|
+
Cn as DESIGN_PREFIX,
|
4703
|
+
na as DESIGN_RESIZE,
|
4704
|
+
wa as EDIT_BACKGROUND_EDITOR,
|
4705
|
+
Xn as EDIT_BULK,
|
4706
|
+
va as EDIT_OBJECT,
|
4702
4707
|
Yt as EDIT_PREFIX,
|
4703
|
-
|
4704
|
-
|
4705
|
-
|
4706
|
-
|
4708
|
+
vo as EDIT_SHAPE,
|
4709
|
+
So as EDIT_TEMPLATE_ITEM,
|
4710
|
+
_o as EDIT_TEXT,
|
4711
|
+
Mo as ENTER_EDIT_MODE,
|
4707
4712
|
Tr as HISTORY_PREFIX,
|
4708
|
-
|
4709
|
-
|
4710
|
-
|
4711
|
-
|
4712
|
-
|
4713
|
-
|
4714
|
-
|
4715
|
-
|
4716
|
-
|
4717
|
-
|
4718
|
-
|
4719
|
-
|
4713
|
+
Pa as HISTORY_REDO,
|
4714
|
+
No as HISTORY_RESET,
|
4715
|
+
Ca as HISTORY_UNDO,
|
4716
|
+
Da as LAYER_CLONE,
|
4717
|
+
Aa as LAYER_COPY,
|
4718
|
+
Lo as LAYER_CUT,
|
4719
|
+
xa as LAYER_DELETE,
|
4720
|
+
zo as LAYER_EDITING_NAME,
|
4721
|
+
xo as LAYER_HIDDEN,
|
4722
|
+
Do as LAYER_LOCKED,
|
4723
|
+
Oo as LAYER_MOVE,
|
4724
|
+
$o as LAYER_PASTE,
|
4720
4725
|
et as LAYER_PREFIX,
|
4721
|
-
|
4722
|
-
|
4723
|
-
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4727
|
-
|
4728
|
-
|
4729
|
-
|
4730
|
-
|
4731
|
-
|
4732
|
-
|
4733
|
-
|
4734
|
-
|
4735
|
-
|
4736
|
-
|
4726
|
+
Ro as LAYER_RENAME,
|
4727
|
+
Oa as LAYER_REPLACE,
|
4728
|
+
Ea as LAYER_SELECT,
|
4729
|
+
Co as LAYER_SELECTION,
|
4730
|
+
Po as LAYER_SEND_TO,
|
4731
|
+
Fo as LAYER_SPLIT,
|
4732
|
+
Sa as REPLACE_MEDIA,
|
4733
|
+
go as STATE_CHANGED,
|
4734
|
+
ta as STATE_PREFIX,
|
4735
|
+
Ra as TIMELINE_SCALE_CHANGED,
|
4736
|
+
ds as TIMELINE_SCALE_PREFIX,
|
4737
|
+
mo as TRACKS_CHANGED,
|
4738
|
+
Io as TRACK_ITEMS_CHANGED,
|
4739
|
+
Qs as TRACK_ITEMS_PREFIX,
|
4740
|
+
Zs as TRACK_PREFIX,
|
4741
|
+
Ho as default
|
4737
4742
|
};
|