@designcombo/state 0.1.29 → 0.1.31

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
- var fi = Object.defineProperty;
2
- var pi = (t, r, n) => r in t ? fi(t, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[r] = n;
3
- var Mt = (t, r, n) => pi(t, typeof r != "symbol" ? r + "" : r, n);
4
- import { subject as $t, filter as Kt, DESIGN_PREFIX as di, ADD_PREFIX as hi, LAYER_PREFIX as yi, HISTORY_PREFIX as mi, ACTIVE_PREFIX as bi, EDIT_PREFIX as gi, DESIGN_LOAD as _i, DESIGN_RESIZE as vi, HISTORY_UNDO as Ii, HISTORY_REDO as Si, LAYER_DELETE as wi, LAYER_CLONE as ki, ADD_CAPTION as Ti, ADD_TEXT as Ei, ADD_IMAGE as Ai, ADD_AUDIO as Mi, ADD_VIDEO as Oi, ACTIVE_SPLIT as xi, ACTIVE_CLONE as Di, ACTIVE_PASTE as Pi, EDIT_OBJECT as Ci } from "@designcombo/events";
1
+ var pi = Object.defineProperty;
2
+ var hi = (t, r, n) => r in t ? pi(t, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[r] = n;
3
+ var Dt = (t, r, n) => hi(t, typeof r != "symbol" ? r + "" : r, n);
4
+ import { subject as Vt, filter as Xt, DESIGN_PREFIX as mi, ADD_PREFIX as yi, LAYER_PREFIX as bi, HISTORY_PREFIX as gi, ACTIVE_PREFIX as _i, EDIT_PREFIX as Ii, DESIGN_LOAD as vi, DESIGN_RESIZE as Si, HISTORY_UNDO as wi, HISTORY_REDO as ki, LAYER_DELETE as Ti, LAYER_CLONE as Ei, ADD_CAPTION as Mi, ADD_TEXT as Ai, ADD_TEMPLATE as Oi, ADD_IMAGE as xi, ADD_AUDIO as Di, ADD_VIDEO as Pi, ACTIVE_SPLIT as Ci, ACTIVE_CLONE as Ri, ACTIVE_PASTE as Fi, DELETE_TEMPLATE_ITEM as ji, EDIT_OBJECT as zi, EDIT_TEMPLATE_ITEM as Hi, CLOSE_EDIT_TEMPLATE as Ni } from "@designcombo/events";
5
5
  var sn = function(t, r) {
6
6
  return sn = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
7
7
  n.__proto__ = i;
@@ -9,7 +9,7 @@ var sn = function(t, r) {
9
9
  for (var s in i) Object.prototype.hasOwnProperty.call(i, s) && (n[s] = i[s]);
10
10
  }, sn(t, r);
11
11
  };
12
- function ge(t, r) {
12
+ function we(t, r) {
13
13
  if (typeof r != "function" && r !== null)
14
14
  throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
15
15
  sn(t, r);
@@ -31,16 +31,16 @@ function on(t) {
31
31
  function cn(t, r) {
32
32
  var n = typeof Symbol == "function" && t[Symbol.iterator];
33
33
  if (!n) return t;
34
- var i = n.call(t), s, c = [], f;
34
+ var i = n.call(t), s, c = [], h;
35
35
  try {
36
36
  for (; (r === void 0 || r-- > 0) && !(s = i.next()).done; ) c.push(s.value);
37
- } catch (h) {
38
- f = { error: h };
37
+ } catch (m) {
38
+ h = { error: m };
39
39
  } finally {
40
40
  try {
41
41
  s && !s.done && (n = i.return) && n.call(i);
42
42
  } finally {
43
- if (f) throw f.error;
43
+ if (h) throw h.error;
44
44
  }
45
45
  }
46
46
  return c;
@@ -50,7 +50,7 @@ function un(t, r, n) {
50
50
  (c || !(i in r)) && (c || (c = Array.prototype.slice.call(r, 0, i)), c[i] = r[i]);
51
51
  return t.concat(c || Array.prototype.slice.call(r));
52
52
  }
53
- function bt(t) {
53
+ function It(t) {
54
54
  return typeof t == "function";
55
55
  }
56
56
  function Yn(t) {
@@ -74,7 +74,7 @@ function ln(t, r) {
74
74
  0 <= n && t.splice(n, 1);
75
75
  }
76
76
  }
77
- var er = function() {
77
+ var ar = function() {
78
78
  function t(r) {
79
79
  this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
80
80
  }
@@ -82,49 +82,49 @@ var er = function() {
82
82
  var r, n, i, s, c;
83
83
  if (!this.closed) {
84
84
  this.closed = !0;
85
- var f = this._parentage;
86
- if (f)
87
- if (this._parentage = null, Array.isArray(f))
85
+ var h = this._parentage;
86
+ if (h)
87
+ if (this._parentage = null, Array.isArray(h))
88
88
  try {
89
- for (var h = on(f), x = h.next(); !x.done; x = h.next()) {
90
- var F = x.value;
89
+ for (var m = on(h), P = m.next(); !P.done; P = m.next()) {
90
+ var F = P.value;
91
91
  F.remove(this);
92
92
  }
93
- } catch (l) {
94
- r = { error: l };
93
+ } catch (p) {
94
+ r = { error: p };
95
95
  } finally {
96
96
  try {
97
- x && !x.done && (n = h.return) && n.call(h);
97
+ P && !P.done && (n = m.return) && n.call(m);
98
98
  } finally {
99
99
  if (r) throw r.error;
100
100
  }
101
101
  }
102
102
  else
103
- f.remove(this);
104
- var T = this.initialTeardown;
105
- if (bt(T))
103
+ h.remove(this);
104
+ var E = this.initialTeardown;
105
+ if (It(E))
106
106
  try {
107
- T();
108
- } catch (l) {
109
- c = l instanceof Qr ? l.errors : [l];
107
+ E();
108
+ } catch (p) {
109
+ c = p instanceof Qr ? p.errors : [p];
110
110
  }
111
- var H = this._finalizers;
112
- if (H) {
111
+ var N = this._finalizers;
112
+ if (N) {
113
113
  this._finalizers = null;
114
114
  try {
115
- for (var g = on(H), p = g.next(); !p.done; p = g.next()) {
116
- var y = p.value;
115
+ for (var b = on(N), d = b.next(); !d.done; d = b.next()) {
116
+ var f = d.value;
117
117
  try {
118
- En(y);
119
- } catch (l) {
120
- c = c ?? [], l instanceof Qr ? c = un(un([], cn(c)), cn(l.errors)) : c.push(l);
118
+ Dn(f);
119
+ } catch (p) {
120
+ c = c ?? [], p instanceof Qr ? c = un(un([], cn(c)), cn(p.errors)) : c.push(p);
121
121
  }
122
122
  }
123
- } catch (l) {
124
- i = { error: l };
123
+ } catch (p) {
124
+ i = { error: p };
125
125
  } finally {
126
126
  try {
127
- p && !p.done && (s = g.return) && s.call(g);
127
+ d && !d.done && (s = b.return) && s.call(b);
128
128
  } finally {
129
129
  if (i) throw i.error;
130
130
  }
@@ -137,7 +137,7 @@ var er = function() {
137
137
  var n;
138
138
  if (r && r !== this)
139
139
  if (this.closed)
140
- En(r);
140
+ Dn(r);
141
141
  else {
142
142
  if (r instanceof t) {
143
143
  if (r.closed || r._hasParent(this))
@@ -162,12 +162,12 @@ var er = function() {
162
162
  var r = new t();
163
163
  return r.closed = !0, r;
164
164
  }(), t;
165
- }(), Vn = er.EMPTY;
165
+ }(), Vn = ar.EMPTY;
166
166
  function Xn(t) {
167
- return t instanceof er || t && "closed" in t && bt(t.remove) && bt(t.add) && bt(t.unsubscribe);
167
+ return t instanceof ar || t && "closed" in t && It(t.remove) && It(t.add) && It(t.unsubscribe);
168
168
  }
169
- function En(t) {
170
- bt(t) ? t() : t.unsubscribe();
169
+ function Dn(t) {
170
+ It(t) ? t() : t.unsubscribe();
171
171
  }
172
172
  var qn = {
173
173
  onUnhandledError: null,
@@ -187,21 +187,21 @@ var qn = {
187
187
  },
188
188
  delegate: void 0
189
189
  };
190
- function ji(t) {
190
+ function Li(t) {
191
191
  Jn.setTimeout(function() {
192
192
  throw t;
193
193
  });
194
194
  }
195
- function An() {
195
+ function Pn() {
196
196
  }
197
- function Xe(t) {
197
+ function Qe(t) {
198
198
  t();
199
199
  }
200
200
  var Zn = function(t) {
201
- ge(r, t);
201
+ we(r, t);
202
202
  function r(n) {
203
203
  var i = t.call(this) || this;
204
- return i.isStopped = !1, n ? (i.destination = n, Xn(n) && n.add(i)) : i.destination = Ni, i;
204
+ return i.isStopped = !1, n ? (i.destination = n, Xn(n) && n.add(i)) : i.destination = Bi, i;
205
205
  }
206
206
  return r.create = function(n, i, s) {
207
207
  return new fn(n, i, s);
@@ -228,11 +228,11 @@ var Zn = function(t) {
228
228
  this.unsubscribe();
229
229
  }
230
230
  }, r;
231
- }(er), Ri = Function.prototype.bind;
231
+ }(ar), Ui = Function.prototype.bind;
232
232
  function tn(t, r) {
233
- return Ri.call(t, r);
233
+ return Ui.call(t, r);
234
234
  }
235
- var Fi = function() {
235
+ var Wi = function() {
236
236
  function t(r) {
237
237
  this.partialObserver = r;
238
238
  }
@@ -242,7 +242,7 @@ var Fi = function() {
242
242
  try {
243
243
  n.next(r);
244
244
  } catch (i) {
245
- Ve(i);
245
+ Ze(i);
246
246
  }
247
247
  }, t.prototype.error = function(r) {
248
248
  var n = this.partialObserver;
@@ -250,68 +250,68 @@ var Fi = function() {
250
250
  try {
251
251
  n.error(r);
252
252
  } catch (i) {
253
- Ve(i);
253
+ Ze(i);
254
254
  }
255
255
  else
256
- Ve(r);
256
+ Ze(r);
257
257
  }, t.prototype.complete = function() {
258
258
  var r = this.partialObserver;
259
259
  if (r.complete)
260
260
  try {
261
261
  r.complete();
262
262
  } catch (n) {
263
- Ve(n);
263
+ Ze(n);
264
264
  }
265
265
  }, t;
266
266
  }(), fn = function(t) {
267
- ge(r, t);
267
+ we(r, t);
268
268
  function r(n, i, s) {
269
- var c = t.call(this) || this, f;
270
- if (bt(n) || !n)
271
- f = {
269
+ var c = t.call(this) || this, h;
270
+ if (It(n) || !n)
271
+ h = {
272
272
  next: n ?? void 0,
273
273
  error: i ?? void 0,
274
274
  complete: s ?? void 0
275
275
  };
276
276
  else {
277
- var h;
278
- c && qn.useDeprecatedNextContext ? (h = Object.create(n), h.unsubscribe = function() {
277
+ var m;
278
+ c && qn.useDeprecatedNextContext ? (m = Object.create(n), m.unsubscribe = function() {
279
279
  return c.unsubscribe();
280
- }, f = {
281
- next: n.next && tn(n.next, h),
282
- error: n.error && tn(n.error, h),
283
- complete: n.complete && tn(n.complete, h)
284
- }) : f = n;
280
+ }, h = {
281
+ next: n.next && tn(n.next, m),
282
+ error: n.error && tn(n.error, m),
283
+ complete: n.complete && tn(n.complete, m)
284
+ }) : h = n;
285
285
  }
286
- return c.destination = new Fi(f), c;
286
+ return c.destination = new Wi(h), c;
287
287
  }
288
288
  return r;
289
289
  }(Zn);
290
- function Ve(t) {
291
- ji(t);
290
+ function Ze(t) {
291
+ Li(t);
292
292
  }
293
- function zi(t) {
293
+ function Gi(t) {
294
294
  throw t;
295
295
  }
296
- var Ni = {
296
+ var Bi = {
297
297
  closed: !0,
298
- next: An,
299
- error: zi,
300
- complete: An
301
- }, Hi = function() {
298
+ next: Pn,
299
+ error: Gi,
300
+ complete: Pn
301
+ }, $i = function() {
302
302
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
303
303
  }();
304
- function Ui(t) {
304
+ function Ki(t) {
305
305
  return t;
306
306
  }
307
- function Li(t) {
308
- return t.length === 0 ? Ui : t.length === 1 ? t[0] : function(n) {
307
+ function Yi(t) {
308
+ return t.length === 0 ? Ki : t.length === 1 ? t[0] : function(n) {
309
309
  return t.reduce(function(i, s) {
310
310
  return s(i);
311
311
  }, n);
312
312
  };
313
313
  }
314
- var Mn = function() {
314
+ var Cn = function() {
315
315
  function t(r) {
316
316
  r && (this._subscribe = r);
317
317
  }
@@ -319,10 +319,10 @@ var Mn = function() {
319
319
  var n = new t();
320
320
  return n.source = this, n.operator = r, n;
321
321
  }, t.prototype.subscribe = function(r, n, i) {
322
- var s = this, c = Wi(r) ? r : new fn(r, n, i);
323
- return Xe(function() {
324
- var f = s, h = f.operator, x = f.source;
325
- c.add(h ? h.call(c, x) : x ? s._subscribe(c) : s._trySubscribe(c));
322
+ var s = this, c = Xi(r) ? r : new fn(r, n, i);
323
+ return Qe(function() {
324
+ var h = s, m = h.operator, P = h.source;
325
+ c.add(m ? m.call(c, P) : P ? s._subscribe(c) : s._trySubscribe(c));
326
326
  }), c;
327
327
  }, t.prototype._trySubscribe = function(r) {
328
328
  try {
@@ -332,37 +332,37 @@ var Mn = function() {
332
332
  }
333
333
  }, t.prototype.forEach = function(r, n) {
334
334
  var i = this;
335
- return n = On(n), new n(function(s, c) {
336
- var f = new fn({
337
- next: function(h) {
335
+ return n = Rn(n), new n(function(s, c) {
336
+ var h = new fn({
337
+ next: function(m) {
338
338
  try {
339
- r(h);
340
- } catch (x) {
341
- c(x), f.unsubscribe();
339
+ r(m);
340
+ } catch (P) {
341
+ c(P), h.unsubscribe();
342
342
  }
343
343
  },
344
344
  error: c,
345
345
  complete: s
346
346
  });
347
- i.subscribe(f);
347
+ i.subscribe(h);
348
348
  });
349
349
  }, t.prototype._subscribe = function(r) {
350
350
  var n;
351
351
  return (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(r);
352
- }, t.prototype[Hi] = function() {
352
+ }, t.prototype[$i] = function() {
353
353
  return this;
354
354
  }, t.prototype.pipe = function() {
355
355
  for (var r = [], n = 0; n < arguments.length; n++)
356
356
  r[n] = arguments[n];
357
- return Li(r)(this);
357
+ return Yi(r)(this);
358
358
  }, t.prototype.toPromise = function(r) {
359
359
  var n = this;
360
- return r = On(r), new r(function(i, s) {
360
+ return r = Rn(r), new r(function(i, s) {
361
361
  var c;
362
- n.subscribe(function(f) {
363
- return c = f;
364
- }, function(f) {
365
- return s(f);
362
+ n.subscribe(function(h) {
363
+ return c = h;
364
+ }, function(h) {
365
+ return s(h);
366
366
  }, function() {
367
367
  return i(c);
368
368
  });
@@ -371,48 +371,48 @@ var Mn = function() {
371
371
  return new t(r);
372
372
  }, t;
373
373
  }();
374
- function On(t) {
374
+ function Rn(t) {
375
375
  var r;
376
376
  return (r = t ?? qn.Promise) !== null && r !== void 0 ? r : Promise;
377
377
  }
378
- function Gi(t) {
379
- return t && bt(t.next) && bt(t.error) && bt(t.complete);
378
+ function Vi(t) {
379
+ return t && It(t.next) && It(t.error) && It(t.complete);
380
380
  }
381
- function Wi(t) {
382
- return t && t instanceof Zn || Gi(t) && Xn(t);
381
+ function Xi(t) {
382
+ return t && t instanceof Zn || Vi(t) && Xn(t);
383
383
  }
384
- var Bi = Yn(function(t) {
384
+ var qi = Yn(function(t) {
385
385
  return function() {
386
386
  t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
387
387
  };
388
388
  }), Qn = function(t) {
389
- ge(r, t);
389
+ we(r, t);
390
390
  function r() {
391
391
  var n = t.call(this) || this;
392
392
  return n.closed = !1, n.currentObservers = null, n.observers = [], n.isStopped = !1, n.hasError = !1, n.thrownError = null, n;
393
393
  }
394
394
  return r.prototype.lift = function(n) {
395
- var i = new xn(this, this);
395
+ var i = new Fn(this, this);
396
396
  return i.operator = n, i;
397
397
  }, r.prototype._throwIfClosed = function() {
398
398
  if (this.closed)
399
- throw new Bi();
399
+ throw new qi();
400
400
  }, r.prototype.next = function(n) {
401
401
  var i = this;
402
- Xe(function() {
402
+ Qe(function() {
403
403
  var s, c;
404
404
  if (i._throwIfClosed(), !i.isStopped) {
405
405
  i.currentObservers || (i.currentObservers = Array.from(i.observers));
406
406
  try {
407
- for (var f = on(i.currentObservers), h = f.next(); !h.done; h = f.next()) {
408
- var x = h.value;
409
- x.next(n);
407
+ for (var h = on(i.currentObservers), m = h.next(); !m.done; m = h.next()) {
408
+ var P = m.value;
409
+ P.next(n);
410
410
  }
411
411
  } catch (F) {
412
412
  s = { error: F };
413
413
  } finally {
414
414
  try {
415
- h && !h.done && (c = f.return) && c.call(f);
415
+ m && !m.done && (c = h.return) && c.call(h);
416
416
  } finally {
417
417
  if (s) throw s.error;
418
418
  }
@@ -421,7 +421,7 @@ var Bi = Yn(function(t) {
421
421
  });
422
422
  }, r.prototype.error = function(n) {
423
423
  var i = this;
424
- Xe(function() {
424
+ Qe(function() {
425
425
  if (i._throwIfClosed(), !i.isStopped) {
426
426
  i.hasError = i.isStopped = !0, i.thrownError = n;
427
427
  for (var s = i.observers; s.length; )
@@ -430,7 +430,7 @@ var Bi = Yn(function(t) {
430
430
  });
431
431
  }, r.prototype.complete = function() {
432
432
  var n = this;
433
- Xe(function() {
433
+ Qe(function() {
434
434
  if (n._throwIfClosed(), !n.isStopped) {
435
435
  n.isStopped = !0;
436
436
  for (var i = n.observers; i.length; )
@@ -451,21 +451,21 @@ var Bi = Yn(function(t) {
451
451
  }, r.prototype._subscribe = function(n) {
452
452
  return this._throwIfClosed(), this._checkFinalizedStatuses(n), this._innerSubscribe(n);
453
453
  }, r.prototype._innerSubscribe = function(n) {
454
- var i = this, s = this, c = s.hasError, f = s.isStopped, h = s.observers;
455
- return c || f ? Vn : (this.currentObservers = null, h.push(n), new er(function() {
456
- i.currentObservers = null, ln(h, n);
454
+ var i = this, s = this, c = s.hasError, h = s.isStopped, m = s.observers;
455
+ return c || h ? Vn : (this.currentObservers = null, m.push(n), new ar(function() {
456
+ i.currentObservers = null, ln(m, n);
457
457
  }));
458
458
  }, r.prototype._checkFinalizedStatuses = function(n) {
459
- var i = this, s = i.hasError, c = i.thrownError, f = i.isStopped;
460
- s ? n.error(c) : f && n.complete();
459
+ var i = this, s = i.hasError, c = i.thrownError, h = i.isStopped;
460
+ s ? n.error(c) : h && n.complete();
461
461
  }, r.prototype.asObservable = function() {
462
- var n = new Mn();
462
+ var n = new Cn();
463
463
  return n.source = this, n;
464
464
  }, r.create = function(n, i) {
465
- return new xn(n, i);
465
+ return new Fn(n, i);
466
466
  }, r;
467
- }(Mn), xn = function(t) {
468
- ge(r, t);
467
+ }(Cn), Fn = function(t) {
468
+ we(r, t);
469
469
  function r(n, i) {
470
470
  var s = t.call(this) || this;
471
471
  return s.destination = n, s.source = i, s;
@@ -483,8 +483,8 @@ var Bi = Yn(function(t) {
483
483
  var i, s;
484
484
  return (s = (i = this.source) === null || i === void 0 ? void 0 : i.subscribe(n)) !== null && s !== void 0 ? s : Vn;
485
485
  }, r;
486
- }(Qn), Dn = function(t) {
487
- ge(r, t);
486
+ }(Qn), jn = function(t) {
487
+ we(r, t);
488
488
  function r(n) {
489
489
  var i = t.call(this) || this;
490
490
  return i._value = n, i;
@@ -506,79 +506,79 @@ var Bi = Yn(function(t) {
506
506
  }, r.prototype.next = function(n) {
507
507
  t.prototype.next.call(this, this._value = n);
508
508
  }, r;
509
- }(Qn), it = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
510
- function gn(t) {
509
+ }(Qn), st = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
510
+ function wn(t) {
511
511
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
512
512
  }
513
- var Je = { exports: {} };
514
- Je.exports;
513
+ var er = { exports: {} };
514
+ er.exports;
515
515
  (function(t, r) {
516
- var n = 200, i = "__lodash_hash_undefined__", s = 1, c = 2, f = 9007199254740991, h = "[object Arguments]", x = "[object Array]", F = "[object AsyncFunction]", T = "[object Boolean]", H = "[object Date]", g = "[object Error]", p = "[object Function]", y = "[object GeneratorFunction]", l = "[object Map]", m = "[object Number]", S = "[object Null]", v = "[object Object]", b = "[object Promise]", d = "[object Proxy]", O = "[object RegExp]", E = "[object Set]", _ = "[object String]", D = "[object Symbol]", I = "[object Undefined]", P = "[object WeakMap]", k = "[object ArrayBuffer]", A = "[object DataView]", U = "[object Float32Array]", J = "[object Float64Array]", Se = "[object Int8Array]", ar = "[object Int16Array]", sr = "[object Int32Array]", or = "[object Uint8Array]", cr = "[object Uint8ClampedArray]", z = "[object Uint16Array]", ur = "[object Uint32Array]", lr = /[\\^$.*+?()[\]{}|]/g, at = /^\[object .+?Constructor\]$/, we = /^(?:0|[1-9]\d*)$/, N = {};
517
- N[U] = N[J] = N[Se] = N[ar] = N[sr] = N[or] = N[cr] = N[z] = N[ur] = !0, N[h] = N[x] = N[k] = N[T] = N[A] = N[H] = N[g] = N[p] = N[l] = N[m] = N[v] = N[O] = N[E] = N[_] = N[P] = !1;
518
- var ke = typeof it == "object" && it && it.Object === Object && it, fr = typeof self == "object" && self && self.Object === Object && self, st = ke || fr || Function("return this")(), Te = r && !r.nodeType && r, Ee = Te && !0 && t && !t.nodeType && t, Vt = Ee && Ee.exports === Te, Xt = Vt && ke.process, Ae = function() {
516
+ var n = 200, i = "__lodash_hash_undefined__", s = 1, c = 2, h = 9007199254740991, m = "[object Arguments]", P = "[object Array]", F = "[object AsyncFunction]", E = "[object Boolean]", N = "[object Date]", b = "[object Error]", d = "[object Function]", f = "[object GeneratorFunction]", p = "[object Map]", g = "[object Number]", v = "[object Null]", _ = "[object Object]", y = "[object Promise]", l = "[object Proxy]", x = "[object RegExp]", M = "[object Set]", I = "[object String]", C = "[object Symbol]", w = "[object Undefined]", D = "[object WeakMap]", k = "[object ArrayBuffer]", S = "[object DataView]", A = "[object Float32Array]", O = "[object Float64Array]", Z = "[object Int8Array]", V = "[object Int16Array]", ft = "[object Int32Array]", Jt = "[object Uint8Array]", Zt = "[object Uint8ClampedArray]", L = "[object Uint16Array]", ur = "[object Uint32Array]", lr = /[\\^$.*+?()[\]{}|]/g, ot = /^\[object .+?Constructor\]$/, Me = /^(?:0|[1-9]\d*)$/, U = {};
517
+ U[A] = U[O] = U[Z] = U[V] = U[ft] = U[Jt] = U[Zt] = U[L] = U[ur] = !0, U[m] = U[P] = U[k] = U[E] = U[S] = U[N] = U[b] = U[d] = U[p] = U[g] = U[_] = U[x] = U[M] = U[I] = U[D] = !1;
518
+ var Ae = typeof st == "object" && st && st.Object === Object && st, fr = typeof self == "object" && self && self.Object === Object && self, ct = Ae || fr || Function("return this")(), Oe = r && !r.nodeType && r, xe = Oe && !0 && t && !t.nodeType && t, Qt = xe && xe.exports === Oe, te = Qt && Ae.process, De = function() {
519
519
  try {
520
- return Xt && Xt.binding && Xt.binding("util");
520
+ return te && te.binding && te.binding("util");
521
521
  } catch {
522
522
  }
523
- }(), qt = Ae && Ae.isTypedArray;
524
- function Me(e, a) {
525
- for (var o = -1, u = e == null ? 0 : e.length, M = 0, w = []; ++o < u; ) {
526
- var j = e[o];
527
- a(j, o, e) && (w[M++] = j);
523
+ }(), ee = De && De.isTypedArray;
524
+ function Pe(e, a) {
525
+ for (var o = -1, u = e == null ? 0 : e.length, R = 0, T = []; ++o < u; ) {
526
+ var z = e[o];
527
+ a(z, o, e) && (T[R++] = z);
528
528
  }
529
- return w;
529
+ return T;
530
530
  }
531
- function Jt(e, a) {
532
- for (var o = -1, u = a.length, M = e.length; ++o < u; )
533
- e[M + o] = a[o];
531
+ function re(e, a) {
532
+ for (var o = -1, u = a.length, R = e.length; ++o < u; )
533
+ e[R + o] = a[o];
534
534
  return e;
535
535
  }
536
- function Oe(e, a) {
536
+ function Ce(e, a) {
537
537
  for (var o = -1, u = e == null ? 0 : e.length; ++o < u; )
538
538
  if (a(e[o], o, e))
539
539
  return !0;
540
540
  return !1;
541
541
  }
542
- function pr(e, a) {
542
+ function dr(e, a) {
543
543
  for (var o = -1, u = Array(e); ++o < e; )
544
544
  u[o] = a(o);
545
545
  return u;
546
546
  }
547
- function dr(e) {
547
+ function pr(e) {
548
548
  return function(a) {
549
549
  return e(a);
550
550
  };
551
551
  }
552
- function jt(e, a) {
552
+ function zt(e, a) {
553
553
  return e.has(a);
554
554
  }
555
- function Zt(e, a) {
555
+ function ne(e, a) {
556
556
  return e == null ? void 0 : e[a];
557
557
  }
558
- function xe(e) {
558
+ function Re(e) {
559
559
  var a = -1, o = Array(e.size);
560
- return e.forEach(function(u, M) {
561
- o[++a] = [M, u];
560
+ return e.forEach(function(u, R) {
561
+ o[++a] = [R, u];
562
562
  }), o;
563
563
  }
564
- function De(e, a) {
564
+ function Fe(e, a) {
565
565
  return function(o) {
566
566
  return e(a(o));
567
567
  };
568
568
  }
569
- function ut(e) {
569
+ function dt(e) {
570
570
  var a = -1, o = Array(e.size);
571
571
  return e.forEach(function(u) {
572
572
  o[++a] = u;
573
573
  }), o;
574
574
  }
575
- var Rt = Array.prototype, hr = Function.prototype, It = Object.prototype, Ft = st["__core-js_shared__"], Qt = hr.toString, rt = It.hasOwnProperty, Pe = function() {
576
- var e = /[^.]+$/.exec(Ft && Ft.keys && Ft.keys.IE_PROTO || "");
575
+ var Ht = Array.prototype, hr = Function.prototype, kt = Object.prototype, Nt = ct["__core-js_shared__"], ie = hr.toString, at = kt.hasOwnProperty, je = function() {
576
+ var e = /[^.]+$/.exec(Nt && Nt.keys && Nt.keys.IE_PROTO || "");
577
577
  return e ? "Symbol(src)_1." + e : "";
578
- }(), Ce = It.toString, yr = RegExp(
579
- "^" + Qt.call(rt).replace(lr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
580
- ), te = Vt ? st.Buffer : void 0, zt = st.Symbol, je = st.Uint8Array, Nt = It.propertyIsEnumerable, St = Rt.splice, ot = zt ? zt.toStringTag : void 0, Ht = Object.getOwnPropertySymbols, ee = te ? te.isBuffer : void 0, wt = De(Object.keys, Object), re = ht(st, "DataView"), kt = ht(st, "Map"), ne = ht(st, "Promise"), ie = ht(st, "Set"), ae = ht(st, "WeakMap"), gt = ht(Object, "create"), Re = q(re), dt = q(kt), mr = q(ne), br = q(ie), gr = q(ae), Fe = zt ? zt.prototype : void 0, se = Fe ? Fe.valueOf : void 0;
581
- function B(e) {
578
+ }(), ze = kt.toString, mr = RegExp(
579
+ "^" + ie.call(at).replace(lr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
580
+ ), ae = Qt ? ct.Buffer : void 0, Lt = ct.Symbol, He = ct.Uint8Array, Ut = kt.propertyIsEnumerable, Tt = Ht.splice, ut = Lt ? Lt.toStringTag : void 0, Wt = Object.getOwnPropertySymbols, se = ae ? ae.isBuffer : void 0, Et = Fe(Object.keys, Object), oe = bt(ct, "DataView"), Mt = bt(ct, "Map"), ce = bt(ct, "Promise"), ue = bt(ct, "Set"), le = bt(ct, "WeakMap"), vt = bt(Object, "create"), Ne = Q(oe), yt = Q(Mt), yr = Q(ce), br = Q(ue), gr = Q(le), Le = Lt ? Lt.prototype : void 0, fe = Le ? Le.valueOf : void 0;
581
+ function K(e) {
582
582
  var a = -1, o = e == null ? 0 : e.length;
583
583
  for (this.clear(); ++a < o; ) {
584
584
  var u = e[a];
@@ -586,30 +586,30 @@ Je.exports;
586
586
  }
587
587
  }
588
588
  function _r() {
589
- this.__data__ = gt ? gt(null) : {}, this.size = 0;
589
+ this.__data__ = vt ? vt(null) : {}, this.size = 0;
590
590
  }
591
- function vr(e) {
591
+ function Ir(e) {
592
592
  var a = this.has(e) && delete this.__data__[e];
593
593
  return this.size -= a ? 1 : 0, a;
594
594
  }
595
- function Ir(e) {
595
+ function vr(e) {
596
596
  var a = this.__data__;
597
- if (gt) {
597
+ if (vt) {
598
598
  var o = a[e];
599
599
  return o === i ? void 0 : o;
600
600
  }
601
- return rt.call(a, e) ? a[e] : void 0;
601
+ return at.call(a, e) ? a[e] : void 0;
602
602
  }
603
603
  function Sr(e) {
604
604
  var a = this.__data__;
605
- return gt ? a[e] !== void 0 : rt.call(a, e);
605
+ return vt ? a[e] !== void 0 : at.call(a, e);
606
606
  }
607
607
  function wr(e, a) {
608
608
  var o = this.__data__;
609
- return this.size += this.has(e) ? 0 : 1, o[e] = gt && a === void 0 ? i : a, this;
609
+ return this.size += this.has(e) ? 0 : 1, o[e] = vt && a === void 0 ? i : a, this;
610
610
  }
611
- B.prototype.clear = _r, B.prototype.delete = vr, B.prototype.get = Ir, B.prototype.has = Sr, B.prototype.set = wr;
612
- function K(e) {
611
+ K.prototype.clear = _r, K.prototype.delete = Ir, K.prototype.get = vr, K.prototype.has = Sr, K.prototype.set = wr;
612
+ function X(e) {
613
613
  var a = -1, o = e == null ? 0 : e.length;
614
614
  for (this.clear(); ++a < o; ) {
615
615
  var u = e[a];
@@ -620,25 +620,25 @@ Je.exports;
620
620
  this.__data__ = [], this.size = 0;
621
621
  }
622
622
  function Tr(e) {
623
- var a = this.__data__, o = Gt(a, e);
623
+ var a = this.__data__, o = $t(a, e);
624
624
  if (o < 0)
625
625
  return !1;
626
626
  var u = a.length - 1;
627
- return o == u ? a.pop() : St.call(a, o, 1), --this.size, !0;
627
+ return o == u ? a.pop() : Tt.call(a, o, 1), --this.size, !0;
628
628
  }
629
629
  function Er(e) {
630
- var a = this.__data__, o = Gt(a, e);
630
+ var a = this.__data__, o = $t(a, e);
631
631
  return o < 0 ? void 0 : a[o][1];
632
632
  }
633
- function Ar(e) {
634
- return Gt(this.__data__, e) > -1;
633
+ function Mr(e) {
634
+ return $t(this.__data__, e) > -1;
635
635
  }
636
- function Mr(e, a) {
637
- var o = this.__data__, u = Gt(o, e);
636
+ function Ar(e, a) {
637
+ var o = this.__data__, u = $t(o, e);
638
638
  return u < 0 ? (++this.size, o.push([e, a])) : o[u][1] = a, this;
639
639
  }
640
- K.prototype.clear = kr, K.prototype.delete = Tr, K.prototype.get = Er, K.prototype.has = Ar, K.prototype.set = Mr;
641
- function Z(e) {
640
+ X.prototype.clear = kr, X.prototype.delete = Tr, X.prototype.get = Er, X.prototype.has = Mr, X.prototype.set = Ar;
641
+ function tt(e) {
642
642
  var a = -1, o = e == null ? 0 : e.length;
643
643
  for (this.clear(); ++a < o; ) {
644
644
  var u = e[a];
@@ -647,295 +647,295 @@ Je.exports;
647
647
  }
648
648
  function Or() {
649
649
  this.size = 0, this.__data__ = {
650
- hash: new B(),
651
- map: new (kt || K)(),
652
- string: new B()
650
+ hash: new K(),
651
+ map: new (Mt || X)(),
652
+ string: new K()
653
653
  };
654
654
  }
655
655
  function xr(e) {
656
- var a = ct(this, e).delete(e);
656
+ var a = lt(this, e).delete(e);
657
657
  return this.size -= a ? 1 : 0, a;
658
658
  }
659
659
  function Dr(e) {
660
- return ct(this, e).get(e);
660
+ return lt(this, e).get(e);
661
661
  }
662
662
  function Pr(e) {
663
- return ct(this, e).has(e);
663
+ return lt(this, e).has(e);
664
664
  }
665
665
  function Cr(e, a) {
666
- var o = ct(this, e), u = o.size;
666
+ var o = lt(this, e), u = o.size;
667
667
  return o.set(e, a), this.size += o.size == u ? 0 : 1, this;
668
668
  }
669
- Z.prototype.clear = Or, Z.prototype.delete = xr, Z.prototype.get = Dr, Z.prototype.has = Pr, Z.prototype.set = Cr;
670
- function Ut(e) {
669
+ tt.prototype.clear = Or, tt.prototype.delete = xr, tt.prototype.get = Dr, tt.prototype.has = Pr, tt.prototype.set = Cr;
670
+ function Gt(e) {
671
671
  var a = -1, o = e == null ? 0 : e.length;
672
- for (this.__data__ = new Z(); ++a < o; )
672
+ for (this.__data__ = new tt(); ++a < o; )
673
673
  this.add(e[a]);
674
674
  }
675
- function ze(e) {
675
+ function Ue(e) {
676
676
  return this.__data__.set(e, i), this;
677
677
  }
678
- function Lt(e) {
678
+ function Bt(e) {
679
679
  return this.__data__.has(e);
680
680
  }
681
- Ut.prototype.add = Ut.prototype.push = ze, Ut.prototype.has = Lt;
682
- function lt(e) {
683
- var a = this.__data__ = new K(e);
681
+ Gt.prototype.add = Gt.prototype.push = Ue, Gt.prototype.has = Bt;
682
+ function pt(e) {
683
+ var a = this.__data__ = new X(e);
684
684
  this.size = a.size;
685
685
  }
686
- function oe() {
687
- this.__data__ = new K(), this.size = 0;
686
+ function de() {
687
+ this.__data__ = new X(), this.size = 0;
688
688
  }
689
- function jr(e) {
689
+ function Rr(e) {
690
690
  var a = this.__data__, o = a.delete(e);
691
691
  return this.size = a.size, o;
692
692
  }
693
- function Rr(e) {
693
+ function Fr(e) {
694
694
  return this.__data__.get(e);
695
695
  }
696
- function Fr(e) {
696
+ function jr(e) {
697
697
  return this.__data__.has(e);
698
698
  }
699
699
  function zr(e, a) {
700
700
  var o = this.__data__;
701
- if (o instanceof K) {
701
+ if (o instanceof X) {
702
702
  var u = o.__data__;
703
- if (!kt || u.length < n - 1)
703
+ if (!Mt || u.length < n - 1)
704
704
  return u.push([e, a]), this.size = ++o.size, this;
705
- o = this.__data__ = new Z(u);
705
+ o = this.__data__ = new tt(u);
706
706
  }
707
707
  return o.set(e, a), this.size = o.size, this;
708
708
  }
709
- lt.prototype.clear = oe, lt.prototype.delete = jr, lt.prototype.get = Rr, lt.prototype.has = Fr, lt.prototype.set = zr;
710
- function Nr(e, a) {
711
- var o = Wt(e), u = !o && Ge(e), M = !o && !u && Bt(e), w = !o && !u && !M && $e(e), j = o || u || M || w, C = j ? pr(e.length, String) : [], L = C.length;
712
- for (var R in e)
713
- rt.call(e, R) && !(j && // Safari 9 has enumerable `arguments.length` in strict mode.
714
- (R == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
715
- M && (R == "offset" || R == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
716
- w && (R == "buffer" || R == "byteLength" || R == "byteOffset") || // Skip index properties.
717
- Kr(R, L))) && C.push(R);
718
- return C;
719
- }
720
- function Gt(e, a) {
709
+ pt.prototype.clear = de, pt.prototype.delete = Rr, pt.prototype.get = Fr, pt.prototype.has = jr, pt.prototype.set = zr;
710
+ function Hr(e, a) {
711
+ var o = Kt(e), u = !o && Ke(e), R = !o && !u && Yt(e), T = !o && !u && !R && Xe(e), z = o || u || R || T, j = z ? dr(e.length, String) : [], W = j.length;
712
+ for (var H in e)
713
+ at.call(e, H) && !(z && // Safari 9 has enumerable `arguments.length` in strict mode.
714
+ (H == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
715
+ R && (H == "offset" || H == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
716
+ T && (H == "buffer" || H == "byteLength" || H == "byteOffset") || // Skip index properties.
717
+ Kr(H, W))) && j.push(H);
718
+ return j;
719
+ }
720
+ function $t(e, a) {
721
721
  for (var o = e.length; o--; )
722
- if (Le(e[o][0], a))
722
+ if ($e(e[o][0], a))
723
723
  return o;
724
724
  return -1;
725
725
  }
726
- function ce(e, a, o) {
726
+ function pe(e, a, o) {
727
727
  var u = a(e);
728
- return Wt(e) ? u : Jt(u, o(e));
728
+ return Kt(e) ? u : re(u, o(e));
729
729
  }
730
- function Tt(e) {
731
- return e == null ? e === void 0 ? I : S : ot && ot in Object(e) ? yt(e) : Ue(e);
730
+ function At(e) {
731
+ return e == null ? e === void 0 ? w : v : ut && ut in Object(e) ? gt(e) : Be(e);
732
732
  }
733
- function Ne(e) {
734
- return pt(e) && Tt(e) == h;
733
+ function We(e) {
734
+ return mt(e) && At(e) == m;
735
735
  }
736
- function He(e, a, o, u, M) {
737
- return e === a ? !0 : e == null || a == null || !pt(e) && !pt(a) ? e !== e && a !== a : Hr(e, a, o, u, He, M);
736
+ function Ge(e, a, o, u, R) {
737
+ return e === a ? !0 : e == null || a == null || !mt(e) && !mt(a) ? e !== e && a !== a : Nr(e, a, o, u, Ge, R);
738
738
  }
739
- function Hr(e, a, o, u, M, w) {
740
- var j = Wt(e), C = Wt(a), L = j ? x : ft(e), R = C ? x : ft(a);
741
- L = L == h ? v : L, R = R == h ? v : R;
742
- var Y = L == v, Q = R == v, G = L == R;
743
- if (G && Bt(e)) {
744
- if (!Bt(a))
739
+ function Nr(e, a, o, u, R, T) {
740
+ var z = Kt(e), j = Kt(a), W = z ? P : ht(e), H = j ? P : ht(a);
741
+ W = W == m ? _ : W, H = H == m ? _ : H;
742
+ var q = W == _, et = H == _, G = W == H;
743
+ if (G && Yt(e)) {
744
+ if (!Yt(a))
745
745
  return !1;
746
- j = !0, Y = !1;
746
+ z = !0, q = !1;
747
747
  }
748
- if (G && !Y)
749
- return w || (w = new lt()), j || $e(e) ? ue(e, a, o, u, M, w) : Wr(e, a, L, o, u, M, w);
748
+ if (G && !q)
749
+ return T || (T = new pt()), z || Xe(e) ? he(e, a, o, u, R, T) : Gr(e, a, W, o, u, R, T);
750
750
  if (!(o & s)) {
751
- var V = Y && rt.call(e, "__wrapped__"), $ = Q && rt.call(a, "__wrapped__");
752
- if (V || $) {
753
- var _t = V ? e.value() : e, mt = $ ? a.value() : a;
754
- return w || (w = new lt()), M(_t, mt, o, u, w);
751
+ var J = q && at.call(e, "__wrapped__"), Y = et && at.call(a, "__wrapped__");
752
+ if (J || Y) {
753
+ var St = J ? e.value() : e, _t = Y ? a.value() : a;
754
+ return T || (T = new pt()), R(St, _t, o, u, T);
755
755
  }
756
756
  }
757
- return G ? (w || (w = new lt()), Br(e, a, o, u, M, w)) : !1;
757
+ return G ? (T || (T = new pt()), Br(e, a, o, u, R, T)) : !1;
758
758
  }
759
- function Ur(e) {
760
- if (!Be(e) || Vr(e))
759
+ function Lr(e) {
760
+ if (!Ve(e) || Vr(e))
761
761
  return !1;
762
- var a = We(e) ? yr : at;
763
- return a.test(q(e));
762
+ var a = Ye(e) ? mr : ot;
763
+ return a.test(Q(e));
764
764
  }
765
- function Lr(e) {
766
- return pt(e) && fe(e.length) && !!N[Tt(e)];
765
+ function Ur(e) {
766
+ return mt(e) && ye(e.length) && !!U[At(e)];
767
767
  }
768
- function Gr(e) {
768
+ function Wr(e) {
769
769
  if (!Xr(e))
770
- return wt(e);
770
+ return Et(e);
771
771
  var a = [];
772
772
  for (var o in Object(e))
773
- rt.call(e, o) && o != "constructor" && a.push(o);
773
+ at.call(e, o) && o != "constructor" && a.push(o);
774
774
  return a;
775
775
  }
776
- function ue(e, a, o, u, M, w) {
777
- var j = o & s, C = e.length, L = a.length;
778
- if (C != L && !(j && L > C))
776
+ function he(e, a, o, u, R, T) {
777
+ var z = o & s, j = e.length, W = a.length;
778
+ if (j != W && !(z && W > j))
779
779
  return !1;
780
- var R = w.get(e);
781
- if (R && w.get(a))
782
- return R == a;
783
- var Y = -1, Q = !0, G = o & c ? new Ut() : void 0;
784
- for (w.set(e, a), w.set(a, e); ++Y < C; ) {
785
- var V = e[Y], $ = a[Y];
780
+ var H = T.get(e);
781
+ if (H && T.get(a))
782
+ return H == a;
783
+ var q = -1, et = !0, G = o & c ? new Gt() : void 0;
784
+ for (T.set(e, a), T.set(a, e); ++q < j; ) {
785
+ var J = e[q], Y = a[q];
786
786
  if (u)
787
- var _t = j ? u($, V, Y, a, e, w) : u(V, $, Y, e, a, w);
788
- if (_t !== void 0) {
789
- if (_t)
787
+ var St = z ? u(Y, J, q, a, e, T) : u(J, Y, q, e, a, T);
788
+ if (St !== void 0) {
789
+ if (St)
790
790
  continue;
791
- Q = !1;
791
+ et = !1;
792
792
  break;
793
793
  }
794
794
  if (G) {
795
- if (!Oe(a, function(mt, At) {
796
- if (!jt(G, At) && (V === mt || M(V, mt, o, u, w)))
797
- return G.push(At);
795
+ if (!Ce(a, function(_t, xt) {
796
+ if (!zt(G, xt) && (J === _t || R(J, _t, o, u, T)))
797
+ return G.push(xt);
798
798
  })) {
799
- Q = !1;
799
+ et = !1;
800
800
  break;
801
801
  }
802
- } else if (!(V === $ || M(V, $, o, u, w))) {
803
- Q = !1;
802
+ } else if (!(J === Y || R(J, Y, o, u, T))) {
803
+ et = !1;
804
804
  break;
805
805
  }
806
806
  }
807
- return w.delete(e), w.delete(a), Q;
807
+ return T.delete(e), T.delete(a), et;
808
808
  }
809
- function Wr(e, a, o, u, M, w, j) {
809
+ function Gr(e, a, o, u, R, T, z) {
810
810
  switch (o) {
811
- case A:
811
+ case S:
812
812
  if (e.byteLength != a.byteLength || e.byteOffset != a.byteOffset)
813
813
  return !1;
814
814
  e = e.buffer, a = a.buffer;
815
815
  case k:
816
- return !(e.byteLength != a.byteLength || !w(new je(e), new je(a)));
817
- case T:
818
- case H:
819
- case m:
820
- return Le(+e, +a);
816
+ return !(e.byteLength != a.byteLength || !T(new He(e), new He(a)));
817
+ case E:
818
+ case N:
821
819
  case g:
820
+ return $e(+e, +a);
821
+ case b:
822
822
  return e.name == a.name && e.message == a.message;
823
- case O:
824
- case _:
823
+ case x:
824
+ case I:
825
825
  return e == a + "";
826
- case l:
827
- var C = xe;
828
- case E:
829
- var L = u & s;
830
- if (C || (C = ut), e.size != a.size && !L)
826
+ case p:
827
+ var j = Re;
828
+ case M:
829
+ var W = u & s;
830
+ if (j || (j = dt), e.size != a.size && !W)
831
831
  return !1;
832
- var R = j.get(e);
833
- if (R)
834
- return R == a;
835
- u |= c, j.set(e, a);
836
- var Y = ue(C(e), C(a), u, M, w, j);
837
- return j.delete(e), Y;
838
- case D:
839
- if (se)
840
- return se.call(e) == se.call(a);
832
+ var H = z.get(e);
833
+ if (H)
834
+ return H == a;
835
+ u |= c, z.set(e, a);
836
+ var q = he(j(e), j(a), u, R, T, z);
837
+ return z.delete(e), q;
838
+ case C:
839
+ if (fe)
840
+ return fe.call(e) == fe.call(a);
841
841
  }
842
842
  return !1;
843
843
  }
844
- function Br(e, a, o, u, M, w) {
845
- var j = o & s, C = Et(e), L = C.length, R = Et(a), Y = R.length;
846
- if (L != Y && !j)
844
+ function Br(e, a, o, u, R, T) {
845
+ var z = o & s, j = Ot(e), W = j.length, H = Ot(a), q = H.length;
846
+ if (W != q && !z)
847
847
  return !1;
848
- for (var Q = L; Q--; ) {
849
- var G = C[Q];
850
- if (!(j ? G in a : rt.call(a, G)))
848
+ for (var et = W; et--; ) {
849
+ var G = j[et];
850
+ if (!(z ? G in a : at.call(a, G)))
851
851
  return !1;
852
852
  }
853
- var V = w.get(e);
854
- if (V && w.get(a))
855
- return V == a;
856
- var $ = !0;
857
- w.set(e, a), w.set(a, e);
858
- for (var _t = j; ++Q < L; ) {
859
- G = C[Q];
860
- var mt = e[G], At = a[G];
853
+ var J = T.get(e);
854
+ if (J && T.get(a))
855
+ return J == a;
856
+ var Y = !0;
857
+ T.set(e, a), T.set(a, e);
858
+ for (var St = z; ++et < W; ) {
859
+ G = j[et];
860
+ var _t = e[G], xt = a[G];
861
861
  if (u)
862
- var Tn = j ? u(At, mt, G, a, e, w) : u(mt, At, G, e, a, w);
863
- if (!(Tn === void 0 ? mt === At || M(mt, At, o, u, w) : Tn)) {
864
- $ = !1;
862
+ var xn = z ? u(xt, _t, G, a, e, T) : u(_t, xt, G, e, a, T);
863
+ if (!(xn === void 0 ? _t === xt || R(_t, xt, o, u, T) : xn)) {
864
+ Y = !1;
865
865
  break;
866
866
  }
867
- _t || (_t = G == "constructor");
867
+ St || (St = G == "constructor");
868
868
  }
869
- if ($ && !_t) {
870
- var Ke = e.constructor, Ye = a.constructor;
871
- Ke != Ye && "constructor" in e && "constructor" in a && !(typeof Ke == "function" && Ke instanceof Ke && typeof Ye == "function" && Ye instanceof Ye) && ($ = !1);
869
+ if (Y && !St) {
870
+ var qe = e.constructor, Je = a.constructor;
871
+ qe != Je && "constructor" in e && "constructor" in a && !(typeof qe == "function" && qe instanceof qe && typeof Je == "function" && Je instanceof Je) && (Y = !1);
872
872
  }
873
- return w.delete(e), w.delete(a), $;
873
+ return T.delete(e), T.delete(a), Y;
874
874
  }
875
- function Et(e) {
876
- return ce(e, pe, $r);
875
+ function Ot(e) {
876
+ return pe(e, be, $r);
877
877
  }
878
- function ct(e, a) {
878
+ function lt(e, a) {
879
879
  var o = e.__data__;
880
880
  return Yr(a) ? o[typeof a == "string" ? "string" : "hash"] : o.map;
881
881
  }
882
- function ht(e, a) {
883
- var o = Zt(e, a);
884
- return Ur(o) ? o : void 0;
882
+ function bt(e, a) {
883
+ var o = ne(e, a);
884
+ return Lr(o) ? o : void 0;
885
885
  }
886
- function yt(e) {
887
- var a = rt.call(e, ot), o = e[ot];
886
+ function gt(e) {
887
+ var a = at.call(e, ut), o = e[ut];
888
888
  try {
889
- e[ot] = void 0;
889
+ e[ut] = void 0;
890
890
  var u = !0;
891
891
  } catch {
892
892
  }
893
- var M = Ce.call(e);
894
- return u && (a ? e[ot] = o : delete e[ot]), M;
893
+ var R = ze.call(e);
894
+ return u && (a ? e[ut] = o : delete e[ut]), R;
895
895
  }
896
- var $r = Ht ? function(e) {
897
- return e == null ? [] : (e = Object(e), Me(Ht(e), function(a) {
898
- return Nt.call(e, a);
896
+ var $r = Wt ? function(e) {
897
+ return e == null ? [] : (e = Object(e), Pe(Wt(e), function(a) {
898
+ return Ut.call(e, a);
899
899
  }));
900
- } : Jr, ft = Tt;
901
- (re && ft(new re(new ArrayBuffer(1))) != A || kt && ft(new kt()) != l || ne && ft(ne.resolve()) != b || ie && ft(new ie()) != E || ae && ft(new ae()) != P) && (ft = function(e) {
902
- var a = Tt(e), o = a == v ? e.constructor : void 0, u = o ? q(o) : "";
900
+ } : Jr, ht = At;
901
+ (oe && ht(new oe(new ArrayBuffer(1))) != S || Mt && ht(new Mt()) != p || ce && ht(ce.resolve()) != y || ue && ht(new ue()) != M || le && ht(new le()) != D) && (ht = function(e) {
902
+ var a = At(e), o = a == _ ? e.constructor : void 0, u = o ? Q(o) : "";
903
903
  if (u)
904
904
  switch (u) {
905
- case Re:
906
- return A;
907
- case dt:
908
- return l;
909
- case mr:
910
- return b;
905
+ case Ne:
906
+ return S;
907
+ case yt:
908
+ return p;
909
+ case yr:
910
+ return y;
911
911
  case br:
912
- return E;
912
+ return M;
913
913
  case gr:
914
- return P;
914
+ return D;
915
915
  }
916
916
  return a;
917
917
  });
918
918
  function Kr(e, a) {
919
- return a = a ?? f, !!a && (typeof e == "number" || we.test(e)) && e > -1 && e % 1 == 0 && e < a;
919
+ return a = a ?? h, !!a && (typeof e == "number" || Me.test(e)) && e > -1 && e % 1 == 0 && e < a;
920
920
  }
921
921
  function Yr(e) {
922
922
  var a = typeof e;
923
923
  return a == "string" || a == "number" || a == "symbol" || a == "boolean" ? e !== "__proto__" : e === null;
924
924
  }
925
925
  function Vr(e) {
926
- return !!Pe && Pe in e;
926
+ return !!je && je in e;
927
927
  }
928
928
  function Xr(e) {
929
- var a = e && e.constructor, o = typeof a == "function" && a.prototype || It;
929
+ var a = e && e.constructor, o = typeof a == "function" && a.prototype || kt;
930
930
  return e === o;
931
931
  }
932
- function Ue(e) {
933
- return Ce.call(e);
932
+ function Be(e) {
933
+ return ze.call(e);
934
934
  }
935
- function q(e) {
935
+ function Q(e) {
936
936
  if (e != null) {
937
937
  try {
938
- return Qt.call(e);
938
+ return ie.call(e);
939
939
  } catch {
940
940
  }
941
941
  try {
@@ -945,40 +945,40 @@ Je.exports;
945
945
  }
946
946
  return "";
947
947
  }
948
- function Le(e, a) {
948
+ function $e(e, a) {
949
949
  return e === a || e !== e && a !== a;
950
950
  }
951
- var Ge = Ne(/* @__PURE__ */ function() {
951
+ var Ke = We(/* @__PURE__ */ function() {
952
952
  return arguments;
953
- }()) ? Ne : function(e) {
954
- return pt(e) && rt.call(e, "callee") && !Nt.call(e, "callee");
955
- }, Wt = Array.isArray;
956
- function le(e) {
957
- return e != null && fe(e.length) && !We(e);
953
+ }()) ? We : function(e) {
954
+ return mt(e) && at.call(e, "callee") && !Ut.call(e, "callee");
955
+ }, Kt = Array.isArray;
956
+ function me(e) {
957
+ return e != null && ye(e.length) && !Ye(e);
958
958
  }
959
- var Bt = ee || Zr;
959
+ var Yt = se || Zr;
960
960
  function qr(e, a) {
961
- return He(e, a);
961
+ return Ge(e, a);
962
962
  }
963
- function We(e) {
964
- if (!Be(e))
963
+ function Ye(e) {
964
+ if (!Ve(e))
965
965
  return !1;
966
- var a = Tt(e);
967
- return a == p || a == y || a == F || a == d;
966
+ var a = At(e);
967
+ return a == d || a == f || a == F || a == l;
968
968
  }
969
- function fe(e) {
970
- return typeof e == "number" && e > -1 && e % 1 == 0 && e <= f;
969
+ function ye(e) {
970
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= h;
971
971
  }
972
- function Be(e) {
972
+ function Ve(e) {
973
973
  var a = typeof e;
974
974
  return e != null && (a == "object" || a == "function");
975
975
  }
976
- function pt(e) {
976
+ function mt(e) {
977
977
  return e != null && typeof e == "object";
978
978
  }
979
- var $e = qt ? dr(qt) : Lr;
980
- function pe(e) {
981
- return le(e) ? Nr(e) : Gr(e);
979
+ var Xe = ee ? pr(ee) : Ur;
980
+ function be(e) {
981
+ return me(e) ? Hr(e) : Wr(e);
982
982
  }
983
983
  function Jr() {
984
984
  return [];
@@ -987,45 +987,45 @@ Je.exports;
987
987
  return !1;
988
988
  }
989
989
  t.exports = qr;
990
- })(Je, Je.exports);
991
- var $i = Je.exports;
992
- const nt = /* @__PURE__ */ gn($i);
993
- var Ze = { exports: {} };
994
- Ze.exports;
990
+ })(er, er.exports);
991
+ var Ji = er.exports;
992
+ const rt = /* @__PURE__ */ wn(Ji);
993
+ var rr = { exports: {} };
994
+ rr.exports;
995
995
  (function(t, r) {
996
- var n = 200, i = "__lodash_hash_undefined__", s = 9007199254740991, c = "[object Arguments]", f = "[object Array]", h = "[object Boolean]", x = "[object Date]", F = "[object Error]", T = "[object Function]", H = "[object GeneratorFunction]", g = "[object Map]", p = "[object Number]", y = "[object Object]", l = "[object Promise]", m = "[object RegExp]", S = "[object Set]", v = "[object String]", b = "[object Symbol]", d = "[object WeakMap]", O = "[object ArrayBuffer]", E = "[object DataView]", _ = "[object Float32Array]", D = "[object Float64Array]", I = "[object Int8Array]", P = "[object Int16Array]", k = "[object Int32Array]", A = "[object Uint8Array]", U = "[object Uint8ClampedArray]", J = "[object Uint16Array]", Se = "[object Uint32Array]", ar = /[\\^$.*+?()[\]{}|]/g, sr = /\w*$/, or = /^\[object .+?Constructor\]$/, cr = /^(?:0|[1-9]\d*)$/, z = {};
997
- z[c] = z[f] = z[O] = z[E] = z[h] = z[x] = z[_] = z[D] = z[I] = z[P] = z[k] = z[g] = z[p] = z[y] = z[m] = z[S] = z[v] = z[b] = z[A] = z[U] = z[J] = z[Se] = !0, z[F] = z[T] = z[d] = !1;
998
- var ur = typeof it == "object" && it && it.Object === Object && it, lr = typeof self == "object" && self && self.Object === Object && self, at = ur || lr || Function("return this")(), we = r && !r.nodeType && r, N = we && !0 && t && !t.nodeType && t, ke = N && N.exports === we;
996
+ var n = 200, i = "__lodash_hash_undefined__", s = 9007199254740991, c = "[object Arguments]", h = "[object Array]", m = "[object Boolean]", P = "[object Date]", F = "[object Error]", E = "[object Function]", N = "[object GeneratorFunction]", b = "[object Map]", d = "[object Number]", f = "[object Object]", p = "[object Promise]", g = "[object RegExp]", v = "[object Set]", _ = "[object String]", y = "[object Symbol]", l = "[object WeakMap]", x = "[object ArrayBuffer]", M = "[object DataView]", I = "[object Float32Array]", C = "[object Float64Array]", w = "[object Int8Array]", D = "[object Int16Array]", k = "[object Int32Array]", S = "[object Uint8Array]", A = "[object Uint8ClampedArray]", O = "[object Uint16Array]", Z = "[object Uint32Array]", V = /[\\^$.*+?()[\]{}|]/g, ft = /\w*$/, Jt = /^\[object .+?Constructor\]$/, Zt = /^(?:0|[1-9]\d*)$/, L = {};
997
+ L[c] = L[h] = L[x] = L[M] = L[m] = L[P] = L[I] = L[C] = L[w] = L[D] = L[k] = L[b] = L[d] = L[f] = L[g] = L[v] = L[_] = L[y] = L[S] = L[A] = L[O] = L[Z] = !0, L[F] = L[E] = L[l] = !1;
998
+ var ur = typeof st == "object" && st && st.Object === Object && st, lr = typeof self == "object" && self && self.Object === Object && self, ot = ur || lr || Function("return this")(), Me = r && !r.nodeType && r, U = Me && !0 && t && !t.nodeType && t, Ae = U && U.exports === Me;
999
999
  function fr(e, a) {
1000
1000
  return e.set(a[0], a[1]), e;
1001
1001
  }
1002
- function st(e, a) {
1002
+ function ct(e, a) {
1003
1003
  return e.add(a), e;
1004
1004
  }
1005
- function Te(e, a) {
1005
+ function Oe(e, a) {
1006
1006
  for (var o = -1, u = e ? e.length : 0; ++o < u && a(e[o], o, e) !== !1; )
1007
1007
  ;
1008
1008
  return e;
1009
1009
  }
1010
- function Ee(e, a) {
1011
- for (var o = -1, u = a.length, M = e.length; ++o < u; )
1012
- e[M + o] = a[o];
1010
+ function xe(e, a) {
1011
+ for (var o = -1, u = a.length, R = e.length; ++o < u; )
1012
+ e[R + o] = a[o];
1013
1013
  return e;
1014
1014
  }
1015
- function Vt(e, a, o, u) {
1016
- for (var M = -1, w = e ? e.length : 0; ++M < w; )
1017
- o = a(o, e[M], M, e);
1015
+ function Qt(e, a, o, u) {
1016
+ for (var R = -1, T = e ? e.length : 0; ++R < T; )
1017
+ o = a(o, e[R], R, e);
1018
1018
  return o;
1019
1019
  }
1020
- function Xt(e, a) {
1020
+ function te(e, a) {
1021
1021
  for (var o = -1, u = Array(e); ++o < e; )
1022
1022
  u[o] = a(o);
1023
1023
  return u;
1024
1024
  }
1025
- function Ae(e, a) {
1025
+ function De(e, a) {
1026
1026
  return e == null ? void 0 : e[a];
1027
1027
  }
1028
- function qt(e) {
1028
+ function ee(e) {
1029
1029
  var a = !1;
1030
1030
  if (e != null && typeof e.toString != "function")
1031
1031
  try {
@@ -1034,60 +1034,60 @@ Ze.exports;
1034
1034
  }
1035
1035
  return a;
1036
1036
  }
1037
- function Me(e) {
1037
+ function Pe(e) {
1038
1038
  var a = -1, o = Array(e.size);
1039
- return e.forEach(function(u, M) {
1040
- o[++a] = [M, u];
1039
+ return e.forEach(function(u, R) {
1040
+ o[++a] = [R, u];
1041
1041
  }), o;
1042
1042
  }
1043
- function Jt(e, a) {
1043
+ function re(e, a) {
1044
1044
  return function(o) {
1045
1045
  return e(a(o));
1046
1046
  };
1047
1047
  }
1048
- function Oe(e) {
1048
+ function Ce(e) {
1049
1049
  var a = -1, o = Array(e.size);
1050
1050
  return e.forEach(function(u) {
1051
1051
  o[++a] = u;
1052
1052
  }), o;
1053
1053
  }
1054
- var pr = Array.prototype, dr = Function.prototype, jt = Object.prototype, Zt = at["__core-js_shared__"], xe = function() {
1055
- var e = /[^.]+$/.exec(Zt && Zt.keys && Zt.keys.IE_PROTO || "");
1054
+ var dr = Array.prototype, pr = Function.prototype, zt = Object.prototype, ne = ot["__core-js_shared__"], Re = function() {
1055
+ var e = /[^.]+$/.exec(ne && ne.keys && ne.keys.IE_PROTO || "");
1056
1056
  return e ? "Symbol(src)_1." + e : "";
1057
- }(), De = dr.toString, ut = jt.hasOwnProperty, Rt = jt.toString, hr = RegExp(
1058
- "^" + De.call(ut).replace(ar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1059
- ), It = ke ? at.Buffer : void 0, Ft = at.Symbol, Qt = at.Uint8Array, rt = Jt(Object.getPrototypeOf, Object), Pe = Object.create, Ce = jt.propertyIsEnumerable, yr = pr.splice, te = Object.getOwnPropertySymbols, zt = It ? It.isBuffer : void 0, je = Jt(Object.keys, Object), Nt = ct(at, "DataView"), St = ct(at, "Map"), ot = ct(at, "Promise"), Ht = ct(at, "Set"), ee = ct(at, "WeakMap"), wt = ct(Object, "create"), re = q(Nt), kt = q(St), ne = q(ot), ie = q(Ht), ae = q(ee), gt = Ft ? Ft.prototype : void 0, Re = gt ? gt.valueOf : void 0;
1060
- function dt(e) {
1057
+ }(), Fe = pr.toString, dt = zt.hasOwnProperty, Ht = zt.toString, hr = RegExp(
1058
+ "^" + Fe.call(dt).replace(V, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1059
+ ), kt = Ae ? ot.Buffer : void 0, Nt = ot.Symbol, ie = ot.Uint8Array, at = re(Object.getPrototypeOf, Object), je = Object.create, ze = zt.propertyIsEnumerable, mr = dr.splice, ae = Object.getOwnPropertySymbols, Lt = kt ? kt.isBuffer : void 0, He = re(Object.keys, Object), Ut = lt(ot, "DataView"), Tt = lt(ot, "Map"), ut = lt(ot, "Promise"), Wt = lt(ot, "Set"), se = lt(ot, "WeakMap"), Et = lt(Object, "create"), oe = Q(Ut), Mt = Q(Tt), ce = Q(ut), ue = Q(Wt), le = Q(se), vt = Nt ? Nt.prototype : void 0, Ne = vt ? vt.valueOf : void 0;
1060
+ function yt(e) {
1061
1061
  var a = -1, o = e ? e.length : 0;
1062
1062
  for (this.clear(); ++a < o; ) {
1063
1063
  var u = e[a];
1064
1064
  this.set(u[0], u[1]);
1065
1065
  }
1066
1066
  }
1067
- function mr() {
1068
- this.__data__ = wt ? wt(null) : {};
1067
+ function yr() {
1068
+ this.__data__ = Et ? Et(null) : {};
1069
1069
  }
1070
1070
  function br(e) {
1071
1071
  return this.has(e) && delete this.__data__[e];
1072
1072
  }
1073
1073
  function gr(e) {
1074
1074
  var a = this.__data__;
1075
- if (wt) {
1075
+ if (Et) {
1076
1076
  var o = a[e];
1077
1077
  return o === i ? void 0 : o;
1078
1078
  }
1079
- return ut.call(a, e) ? a[e] : void 0;
1079
+ return dt.call(a, e) ? a[e] : void 0;
1080
1080
  }
1081
- function Fe(e) {
1081
+ function Le(e) {
1082
1082
  var a = this.__data__;
1083
- return wt ? a[e] !== void 0 : ut.call(a, e);
1083
+ return Et ? a[e] !== void 0 : dt.call(a, e);
1084
1084
  }
1085
- function se(e, a) {
1085
+ function fe(e, a) {
1086
1086
  var o = this.__data__;
1087
- return o[e] = wt && a === void 0 ? i : a, this;
1087
+ return o[e] = Et && a === void 0 ? i : a, this;
1088
1088
  }
1089
- dt.prototype.clear = mr, dt.prototype.delete = br, dt.prototype.get = gr, dt.prototype.has = Fe, dt.prototype.set = se;
1090
- function B(e) {
1089
+ yt.prototype.clear = yr, yt.prototype.delete = br, yt.prototype.get = gr, yt.prototype.has = Le, yt.prototype.set = fe;
1090
+ function K(e) {
1091
1091
  var a = -1, o = e ? e.length : 0;
1092
1092
  for (this.clear(); ++a < o; ) {
1093
1093
  var u = e[a];
@@ -1097,26 +1097,26 @@ Ze.exports;
1097
1097
  function _r() {
1098
1098
  this.__data__ = [];
1099
1099
  }
1100
- function vr(e) {
1101
- var a = this.__data__, o = Lt(a, e);
1100
+ function Ir(e) {
1101
+ var a = this.__data__, o = Bt(a, e);
1102
1102
  if (o < 0)
1103
1103
  return !1;
1104
1104
  var u = a.length - 1;
1105
- return o == u ? a.pop() : yr.call(a, o, 1), !0;
1105
+ return o == u ? a.pop() : mr.call(a, o, 1), !0;
1106
1106
  }
1107
- function Ir(e) {
1108
- var a = this.__data__, o = Lt(a, e);
1107
+ function vr(e) {
1108
+ var a = this.__data__, o = Bt(a, e);
1109
1109
  return o < 0 ? void 0 : a[o][1];
1110
1110
  }
1111
1111
  function Sr(e) {
1112
- return Lt(this.__data__, e) > -1;
1112
+ return Bt(this.__data__, e) > -1;
1113
1113
  }
1114
1114
  function wr(e, a) {
1115
- var o = this.__data__, u = Lt(o, e);
1115
+ var o = this.__data__, u = Bt(o, e);
1116
1116
  return u < 0 ? o.push([e, a]) : o[u][1] = a, this;
1117
1117
  }
1118
- B.prototype.clear = _r, B.prototype.delete = vr, B.prototype.get = Ir, B.prototype.has = Sr, B.prototype.set = wr;
1119
- function K(e) {
1118
+ K.prototype.clear = _r, K.prototype.delete = Ir, K.prototype.get = vr, K.prototype.has = Sr, K.prototype.set = wr;
1119
+ function X(e) {
1120
1120
  var a = -1, o = e ? e.length : 0;
1121
1121
  for (this.clear(); ++a < o; ) {
1122
1122
  var u = e[a];
@@ -1125,29 +1125,29 @@ Ze.exports;
1125
1125
  }
1126
1126
  function kr() {
1127
1127
  this.__data__ = {
1128
- hash: new dt(),
1129
- map: new (St || B)(),
1130
- string: new dt()
1128
+ hash: new yt(),
1129
+ map: new (Tt || K)(),
1130
+ string: new yt()
1131
1131
  };
1132
1132
  }
1133
1133
  function Tr(e) {
1134
- return Et(this, e).delete(e);
1134
+ return Ot(this, e).delete(e);
1135
1135
  }
1136
1136
  function Er(e) {
1137
- return Et(this, e).get(e);
1137
+ return Ot(this, e).get(e);
1138
1138
  }
1139
- function Ar(e) {
1140
- return Et(this, e).has(e);
1139
+ function Mr(e) {
1140
+ return Ot(this, e).has(e);
1141
1141
  }
1142
- function Mr(e, a) {
1143
- return Et(this, e).set(e, a), this;
1142
+ function Ar(e, a) {
1143
+ return Ot(this, e).set(e, a), this;
1144
1144
  }
1145
- K.prototype.clear = kr, K.prototype.delete = Tr, K.prototype.get = Er, K.prototype.has = Ar, K.prototype.set = Mr;
1146
- function Z(e) {
1147
- this.__data__ = new B(e);
1145
+ X.prototype.clear = kr, X.prototype.delete = Tr, X.prototype.get = Er, X.prototype.has = Mr, X.prototype.set = Ar;
1146
+ function tt(e) {
1147
+ this.__data__ = new K(e);
1148
1148
  }
1149
1149
  function Or() {
1150
- this.__data__ = new B();
1150
+ this.__data__ = new K();
1151
1151
  }
1152
1152
  function xr(e) {
1153
1153
  return this.__data__.delete(e);
@@ -1160,230 +1160,230 @@ Ze.exports;
1160
1160
  }
1161
1161
  function Cr(e, a) {
1162
1162
  var o = this.__data__;
1163
- if (o instanceof B) {
1163
+ if (o instanceof K) {
1164
1164
  var u = o.__data__;
1165
- if (!St || u.length < n - 1)
1165
+ if (!Tt || u.length < n - 1)
1166
1166
  return u.push([e, a]), this;
1167
- o = this.__data__ = new K(u);
1167
+ o = this.__data__ = new X(u);
1168
1168
  }
1169
1169
  return o.set(e, a), this;
1170
1170
  }
1171
- Z.prototype.clear = Or, Z.prototype.delete = xr, Z.prototype.get = Dr, Z.prototype.has = Pr, Z.prototype.set = Cr;
1172
- function Ut(e, a) {
1173
- var o = le(e) || Wt(e) ? Xt(e.length, String) : [], u = o.length, M = !!u;
1174
- for (var w in e)
1175
- ut.call(e, w) && !(M && (w == "length" || Yr(w, u))) && o.push(w);
1171
+ tt.prototype.clear = Or, tt.prototype.delete = xr, tt.prototype.get = Dr, tt.prototype.has = Pr, tt.prototype.set = Cr;
1172
+ function Gt(e, a) {
1173
+ var o = me(e) || Kt(e) ? te(e.length, String) : [], u = o.length, R = !!u;
1174
+ for (var T in e)
1175
+ dt.call(e, T) && !(R && (T == "length" || Yr(T, u))) && o.push(T);
1176
1176
  return o;
1177
1177
  }
1178
- function ze(e, a, o) {
1178
+ function Ue(e, a, o) {
1179
1179
  var u = e[a];
1180
- (!(ut.call(e, a) && Ge(u, o)) || o === void 0 && !(a in e)) && (e[a] = o);
1180
+ (!(dt.call(e, a) && Ke(u, o)) || o === void 0 && !(a in e)) && (e[a] = o);
1181
1181
  }
1182
- function Lt(e, a) {
1182
+ function Bt(e, a) {
1183
1183
  for (var o = e.length; o--; )
1184
- if (Ge(e[o][0], a))
1184
+ if (Ke(e[o][0], a))
1185
1185
  return o;
1186
1186
  return -1;
1187
1187
  }
1188
- function lt(e, a) {
1189
- return e && ue(a, pe(a), e);
1188
+ function pt(e, a) {
1189
+ return e && he(a, be(a), e);
1190
1190
  }
1191
- function oe(e, a, o, u, M, w, j) {
1192
- var C;
1193
- if (u && (C = w ? u(e, M, w, j) : u(e)), C !== void 0)
1194
- return C;
1195
- if (!pt(e))
1191
+ function de(e, a, o, u, R, T, z) {
1192
+ var j;
1193
+ if (u && (j = T ? u(e, R, T, z) : u(e)), j !== void 0)
1194
+ return j;
1195
+ if (!mt(e))
1196
1196
  return e;
1197
- var L = le(e);
1198
- if (L) {
1199
- if (C = $r(e), !a)
1200
- return Gr(e, C);
1197
+ var W = me(e);
1198
+ if (W) {
1199
+ if (j = $r(e), !a)
1200
+ return Wr(e, j);
1201
1201
  } else {
1202
- var R = yt(e), Y = R == T || R == H;
1203
- if (We(e))
1204
- return Gt(e, a);
1205
- if (R == y || R == c || Y && !w) {
1206
- if (qt(e))
1207
- return w ? e : {};
1208
- if (C = ft(Y ? {} : e), !a)
1209
- return Wr(e, lt(C, e));
1202
+ var H = gt(e), q = H == E || H == N;
1203
+ if (Ye(e))
1204
+ return $t(e, a);
1205
+ if (H == f || H == c || q && !T) {
1206
+ if (ee(e))
1207
+ return T ? e : {};
1208
+ if (j = ht(q ? {} : e), !a)
1209
+ return Gr(e, pt(j, e));
1210
1210
  } else {
1211
- if (!z[R])
1212
- return w ? e : {};
1213
- C = Kr(e, R, oe, a);
1211
+ if (!L[H])
1212
+ return T ? e : {};
1213
+ j = Kr(e, H, de, a);
1214
1214
  }
1215
1215
  }
1216
- j || (j = new Z());
1217
- var Q = j.get(e);
1218
- if (Q)
1219
- return Q;
1220
- if (j.set(e, C), !L)
1221
- var G = o ? Br(e) : pe(e);
1222
- return Te(G || e, function(V, $) {
1223
- G && ($ = V, V = e[$]), ze(C, $, oe(V, a, o, u, $, e, j));
1224
- }), C;
1216
+ z || (z = new tt());
1217
+ var et = z.get(e);
1218
+ if (et)
1219
+ return et;
1220
+ if (z.set(e, j), !W)
1221
+ var G = o ? Br(e) : be(e);
1222
+ return Oe(G || e, function(J, Y) {
1223
+ G && (Y = J, J = e[Y]), Ue(j, Y, de(J, a, o, u, Y, e, z));
1224
+ }), j;
1225
1225
  }
1226
- function jr(e) {
1227
- return pt(e) ? Pe(e) : {};
1226
+ function Rr(e) {
1227
+ return mt(e) ? je(e) : {};
1228
1228
  }
1229
- function Rr(e, a, o) {
1229
+ function Fr(e, a, o) {
1230
1230
  var u = a(e);
1231
- return le(e) ? u : Ee(u, o(e));
1231
+ return me(e) ? u : xe(u, o(e));
1232
1232
  }
1233
- function Fr(e) {
1234
- return Rt.call(e);
1233
+ function jr(e) {
1234
+ return Ht.call(e);
1235
1235
  }
1236
1236
  function zr(e) {
1237
- if (!pt(e) || Xr(e))
1237
+ if (!mt(e) || Xr(e))
1238
1238
  return !1;
1239
- var a = fe(e) || qt(e) ? hr : or;
1240
- return a.test(q(e));
1239
+ var a = ye(e) || ee(e) ? hr : Jt;
1240
+ return a.test(Q(e));
1241
1241
  }
1242
- function Nr(e) {
1243
- if (!Ue(e))
1244
- return je(e);
1242
+ function Hr(e) {
1243
+ if (!Be(e))
1244
+ return He(e);
1245
1245
  var a = [];
1246
1246
  for (var o in Object(e))
1247
- ut.call(e, o) && o != "constructor" && a.push(o);
1247
+ dt.call(e, o) && o != "constructor" && a.push(o);
1248
1248
  return a;
1249
1249
  }
1250
- function Gt(e, a) {
1250
+ function $t(e, a) {
1251
1251
  if (a)
1252
1252
  return e.slice();
1253
1253
  var o = new e.constructor(e.length);
1254
1254
  return e.copy(o), o;
1255
1255
  }
1256
- function ce(e) {
1256
+ function pe(e) {
1257
1257
  var a = new e.constructor(e.byteLength);
1258
- return new Qt(a).set(new Qt(e)), a;
1258
+ return new ie(a).set(new ie(e)), a;
1259
1259
  }
1260
- function Tt(e, a) {
1261
- var o = a ? ce(e.buffer) : e.buffer;
1260
+ function At(e, a) {
1261
+ var o = a ? pe(e.buffer) : e.buffer;
1262
1262
  return new e.constructor(o, e.byteOffset, e.byteLength);
1263
1263
  }
1264
- function Ne(e, a, o) {
1265
- var u = a ? o(Me(e), !0) : Me(e);
1266
- return Vt(u, fr, new e.constructor());
1264
+ function We(e, a, o) {
1265
+ var u = a ? o(Pe(e), !0) : Pe(e);
1266
+ return Qt(u, fr, new e.constructor());
1267
1267
  }
1268
- function He(e) {
1269
- var a = new e.constructor(e.source, sr.exec(e));
1268
+ function Ge(e) {
1269
+ var a = new e.constructor(e.source, ft.exec(e));
1270
1270
  return a.lastIndex = e.lastIndex, a;
1271
1271
  }
1272
- function Hr(e, a, o) {
1273
- var u = a ? o(Oe(e), !0) : Oe(e);
1274
- return Vt(u, st, new e.constructor());
1272
+ function Nr(e, a, o) {
1273
+ var u = a ? o(Ce(e), !0) : Ce(e);
1274
+ return Qt(u, ct, new e.constructor());
1275
1275
  }
1276
- function Ur(e) {
1277
- return Re ? Object(Re.call(e)) : {};
1276
+ function Lr(e) {
1277
+ return Ne ? Object(Ne.call(e)) : {};
1278
1278
  }
1279
- function Lr(e, a) {
1280
- var o = a ? ce(e.buffer) : e.buffer;
1279
+ function Ur(e, a) {
1280
+ var o = a ? pe(e.buffer) : e.buffer;
1281
1281
  return new e.constructor(o, e.byteOffset, e.length);
1282
1282
  }
1283
- function Gr(e, a) {
1283
+ function Wr(e, a) {
1284
1284
  var o = -1, u = e.length;
1285
1285
  for (a || (a = Array(u)); ++o < u; )
1286
1286
  a[o] = e[o];
1287
1287
  return a;
1288
1288
  }
1289
- function ue(e, a, o, u) {
1289
+ function he(e, a, o, u) {
1290
1290
  o || (o = {});
1291
- for (var M = -1, w = a.length; ++M < w; ) {
1292
- var j = a[M], C = void 0;
1293
- ze(o, j, C === void 0 ? e[j] : C);
1291
+ for (var R = -1, T = a.length; ++R < T; ) {
1292
+ var z = a[R], j = void 0;
1293
+ Ue(o, z, j === void 0 ? e[z] : j);
1294
1294
  }
1295
1295
  return o;
1296
1296
  }
1297
- function Wr(e, a) {
1298
- return ue(e, ht(e), a);
1297
+ function Gr(e, a) {
1298
+ return he(e, bt(e), a);
1299
1299
  }
1300
1300
  function Br(e) {
1301
- return Rr(e, pe, ht);
1301
+ return Fr(e, be, bt);
1302
1302
  }
1303
- function Et(e, a) {
1303
+ function Ot(e, a) {
1304
1304
  var o = e.__data__;
1305
1305
  return Vr(a) ? o[typeof a == "string" ? "string" : "hash"] : o.map;
1306
1306
  }
1307
- function ct(e, a) {
1308
- var o = Ae(e, a);
1307
+ function lt(e, a) {
1308
+ var o = De(e, a);
1309
1309
  return zr(o) ? o : void 0;
1310
1310
  }
1311
- var ht = te ? Jt(te, Object) : Jr, yt = Fr;
1312
- (Nt && yt(new Nt(new ArrayBuffer(1))) != E || St && yt(new St()) != g || ot && yt(ot.resolve()) != l || Ht && yt(new Ht()) != S || ee && yt(new ee()) != d) && (yt = function(e) {
1313
- var a = Rt.call(e), o = a == y ? e.constructor : void 0, u = o ? q(o) : void 0;
1311
+ var bt = ae ? re(ae, Object) : Jr, gt = jr;
1312
+ (Ut && gt(new Ut(new ArrayBuffer(1))) != M || Tt && gt(new Tt()) != b || ut && gt(ut.resolve()) != p || Wt && gt(new Wt()) != v || se && gt(new se()) != l) && (gt = function(e) {
1313
+ var a = Ht.call(e), o = a == f ? e.constructor : void 0, u = o ? Q(o) : void 0;
1314
1314
  if (u)
1315
1315
  switch (u) {
1316
- case re:
1317
- return E;
1318
- case kt:
1319
- return g;
1320
- case ne:
1316
+ case oe:
1317
+ return M;
1318
+ case Mt:
1319
+ return b;
1320
+ case ce:
1321
+ return p;
1322
+ case ue:
1323
+ return v;
1324
+ case le:
1321
1325
  return l;
1322
- case ie:
1323
- return S;
1324
- case ae:
1325
- return d;
1326
1326
  }
1327
1327
  return a;
1328
1328
  });
1329
1329
  function $r(e) {
1330
1330
  var a = e.length, o = e.constructor(a);
1331
- return a && typeof e[0] == "string" && ut.call(e, "index") && (o.index = e.index, o.input = e.input), o;
1331
+ return a && typeof e[0] == "string" && dt.call(e, "index") && (o.index = e.index, o.input = e.input), o;
1332
1332
  }
1333
- function ft(e) {
1334
- return typeof e.constructor == "function" && !Ue(e) ? jr(rt(e)) : {};
1333
+ function ht(e) {
1334
+ return typeof e.constructor == "function" && !Be(e) ? Rr(at(e)) : {};
1335
1335
  }
1336
1336
  function Kr(e, a, o, u) {
1337
- var M = e.constructor;
1337
+ var R = e.constructor;
1338
1338
  switch (a) {
1339
- case O:
1340
- return ce(e);
1341
- case h:
1342
1339
  case x:
1343
- return new M(+e);
1344
- case E:
1345
- return Tt(e, u);
1346
- case _:
1347
- case D:
1348
- case I:
1340
+ return pe(e);
1341
+ case m:
1349
1342
  case P:
1343
+ return new R(+e);
1344
+ case M:
1345
+ return At(e, u);
1346
+ case I:
1347
+ case C:
1348
+ case w:
1349
+ case D:
1350
1350
  case k:
1351
+ case S:
1351
1352
  case A:
1352
- case U:
1353
- case J:
1354
- case Se:
1355
- return Lr(e, u);
1353
+ case O:
1354
+ case Z:
1355
+ return Ur(e, u);
1356
+ case b:
1357
+ return We(e, u, o);
1358
+ case d:
1359
+ case _:
1360
+ return new R(e);
1356
1361
  case g:
1357
- return Ne(e, u, o);
1358
- case p:
1362
+ return Ge(e);
1359
1363
  case v:
1360
- return new M(e);
1361
- case m:
1362
- return He(e);
1363
- case S:
1364
- return Hr(e, u, o);
1365
- case b:
1366
- return Ur(e);
1364
+ return Nr(e, u, o);
1365
+ case y:
1366
+ return Lr(e);
1367
1367
  }
1368
1368
  }
1369
1369
  function Yr(e, a) {
1370
- return a = a ?? s, !!a && (typeof e == "number" || cr.test(e)) && e > -1 && e % 1 == 0 && e < a;
1370
+ return a = a ?? s, !!a && (typeof e == "number" || Zt.test(e)) && e > -1 && e % 1 == 0 && e < a;
1371
1371
  }
1372
1372
  function Vr(e) {
1373
1373
  var a = typeof e;
1374
1374
  return a == "string" || a == "number" || a == "symbol" || a == "boolean" ? e !== "__proto__" : e === null;
1375
1375
  }
1376
1376
  function Xr(e) {
1377
- return !!xe && xe in e;
1377
+ return !!Re && Re in e;
1378
1378
  }
1379
- function Ue(e) {
1380
- var a = e && e.constructor, o = typeof a == "function" && a.prototype || jt;
1379
+ function Be(e) {
1380
+ var a = e && e.constructor, o = typeof a == "function" && a.prototype || zt;
1381
1381
  return e === o;
1382
1382
  }
1383
- function q(e) {
1383
+ function Q(e) {
1384
1384
  if (e != null) {
1385
1385
  try {
1386
- return De.call(e);
1386
+ return Fe.call(e);
1387
1387
  } catch {
1388
1388
  }
1389
1389
  try {
@@ -1393,39 +1393,39 @@ Ze.exports;
1393
1393
  }
1394
1394
  return "";
1395
1395
  }
1396
- function Le(e) {
1397
- return oe(e, !0, !0);
1396
+ function $e(e) {
1397
+ return de(e, !0, !0);
1398
1398
  }
1399
- function Ge(e, a) {
1399
+ function Ke(e, a) {
1400
1400
  return e === a || e !== e && a !== a;
1401
1401
  }
1402
- function Wt(e) {
1403
- return qr(e) && ut.call(e, "callee") && (!Ce.call(e, "callee") || Rt.call(e) == c);
1402
+ function Kt(e) {
1403
+ return qr(e) && dt.call(e, "callee") && (!ze.call(e, "callee") || Ht.call(e) == c);
1404
1404
  }
1405
- var le = Array.isArray;
1406
- function Bt(e) {
1407
- return e != null && Be(e.length) && !fe(e);
1405
+ var me = Array.isArray;
1406
+ function Yt(e) {
1407
+ return e != null && Ve(e.length) && !ye(e);
1408
1408
  }
1409
1409
  function qr(e) {
1410
- return $e(e) && Bt(e);
1410
+ return Xe(e) && Yt(e);
1411
1411
  }
1412
- var We = zt || Zr;
1413
- function fe(e) {
1414
- var a = pt(e) ? Rt.call(e) : "";
1415
- return a == T || a == H;
1412
+ var Ye = Lt || Zr;
1413
+ function ye(e) {
1414
+ var a = mt(e) ? Ht.call(e) : "";
1415
+ return a == E || a == N;
1416
1416
  }
1417
- function Be(e) {
1417
+ function Ve(e) {
1418
1418
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= s;
1419
1419
  }
1420
- function pt(e) {
1420
+ function mt(e) {
1421
1421
  var a = typeof e;
1422
1422
  return !!e && (a == "object" || a == "function");
1423
1423
  }
1424
- function $e(e) {
1424
+ function Xe(e) {
1425
1425
  return !!e && typeof e == "object";
1426
1426
  }
1427
- function pe(e) {
1428
- return Bt(e) ? Ut(e) : Nr(e);
1427
+ function be(e) {
1428
+ return Yt(e) ? Gt(e) : Hr(e);
1429
1429
  }
1430
1430
  function Jr() {
1431
1431
  return [];
@@ -1433,10 +1433,10 @@ Ze.exports;
1433
1433
  function Zr() {
1434
1434
  return !1;
1435
1435
  }
1436
- t.exports = Le;
1437
- })(Ze, Ze.exports);
1438
- var Ki = Ze.exports;
1439
- const X = /* @__PURE__ */ gn(Ki), Yi = (t) => new Promise((r, n) => {
1436
+ t.exports = $e;
1437
+ })(rr, rr.exports);
1438
+ var Zi = rr.exports;
1439
+ const B = /* @__PURE__ */ wn(Zi), ti = (t) => new Promise((r, n) => {
1440
1440
  const i = new Image();
1441
1441
  console.warn("update cdn config for cors?"), i.onload = () => {
1442
1442
  const s = i.width, c = i.height;
@@ -1444,7 +1444,7 @@ const X = /* @__PURE__ */ gn(Ki), Yi = (t) => new Promise((r, n) => {
1444
1444
  }, i.onerror = (s) => {
1445
1445
  n(s);
1446
1446
  }, i.crossOrigin = "anonymous", i.src = t;
1447
- }), Vi = (t) => new Promise((r, n) => {
1447
+ }), Qi = (t) => new Promise((r, n) => {
1448
1448
  const i = new Audio();
1449
1449
  i.preload = "auto", i.addEventListener("loadedmetadata", () => {
1450
1450
  const s = i.duration * 1e3;
@@ -1452,22 +1452,22 @@ const X = /* @__PURE__ */ gn(Ki), Yi = (t) => new Promise((r, n) => {
1452
1452
  }), i.addEventListener("error", (s) => {
1453
1453
  n(s);
1454
1454
  }), i.src = t, i.crossOrigin = "anonymous", i.load();
1455
- }), Xi = (t) => new Promise((r, n) => {
1455
+ }), ei = (t) => new Promise((r, n) => {
1456
1456
  const i = document.createElement("video");
1457
1457
  i.preload = "auto", i.addEventListener("loadedmetadata", () => {
1458
- const s = i.duration * 1e3, c = i.videoWidth, f = i.videoHeight;
1459
- r({ duration: s, width: c, height: f });
1458
+ const s = i.duration * 1e3, c = i.videoWidth, h = i.videoHeight;
1459
+ r({ duration: s, width: c, height: h });
1460
1460
  }), i.addEventListener("error", (s) => {
1461
1461
  n(s);
1462
1462
  }), i.src = t, i.load();
1463
- }), ti = (t, r) => {
1463
+ }), ri = (t, r) => {
1464
1464
  const n = document.createElement("div");
1465
1465
  Object.keys(r).forEach((s) => {
1466
1466
  s !== "height" && (n.style[s] = r[s]);
1467
1467
  }), document.body.appendChild(n), n.textContent = t, n.style.whiteSpace = "normal", n.style.position = "absolute", n.style.visibility = "hidden", n.style.display = "inline-block", n.style.width = r.width + "px", n.style.fontSize = r.fontSize + "px";
1468
1468
  const i = getComputedStyle(n).height;
1469
1469
  return document.body.removeChild(n), parseFloat(i);
1470
- }, _n = (t) => {
1470
+ }, kn = (t) => {
1471
1471
  const r = t.map((n) => new FontFace(n.fontFamily, `url(${n.url})`).load().catch((i) => i));
1472
1472
  return r.length === 0 ? Promise.resolve(!0) : new Promise((n, i) => {
1473
1473
  Promise.all(r).then((s) => {
@@ -1476,12 +1476,12 @@ const X = /* @__PURE__ */ gn(Ki), Yi = (t) => new Promise((r, n) => {
1476
1476
  });
1477
1477
  }).catch((s) => i(s));
1478
1478
  });
1479
- }, rr = {
1479
+ }, sr = {
1480
1480
  color: "#000000",
1481
1481
  x: 0,
1482
1482
  y: 0,
1483
1483
  blur: 0
1484
- }, _e = (t, r) => {
1484
+ }, ke = (t, r) => {
1485
1485
  let n = r != null && r.trim ? r.trim.to - r.trim.from : (r == null ? void 0 : r.duration) || 5e3;
1486
1486
  const i = {
1487
1487
  from: 0,
@@ -1509,14 +1509,14 @@ const X = /* @__PURE__ */ gn(Ki), Yi = (t) => new Promise((r, n) => {
1509
1509
  ), i;
1510
1510
  }
1511
1511
  return t;
1512
- }, ei = (t, r) => t ? t.from && !t.to ? {
1512
+ }, ni = (t, r) => t ? t.from && !t.to ? {
1513
1513
  from: t.from,
1514
1514
  to: r.duration
1515
1515
  } : t : {
1516
1516
  from: 0,
1517
1517
  to: r.duration
1518
1518
  };
1519
- function nr(t, r) {
1519
+ function or(t, r) {
1520
1520
  const n = {
1521
1521
  x: t.size.width / 2,
1522
1522
  y: t.size.height / 2
@@ -1530,10 +1530,10 @@ function nr(t, r) {
1530
1530
  transform: `scale(${s})`
1531
1531
  };
1532
1532
  }
1533
- const Pn = async (t, r) => {
1534
- const n = t.details.src, i = await Xi(n), s = nr(r, {
1533
+ const dn = async (t, r) => {
1534
+ const n = t.details.src, i = await ei(n), s = or(r, {
1535
1535
  ...i
1536
- }), c = ei(t.trim, { duration: i.duration }), f = {
1536
+ }), c = ni(t.trim, { duration: i.duration }), h = {
1537
1537
  width: i.width,
1538
1538
  height: i.height,
1539
1539
  opacity: 100,
@@ -1546,7 +1546,7 @@ const Pn = async (t, r) => {
1546
1546
  // Default border width
1547
1547
  borderColor: t.details.borderColor || "#000000",
1548
1548
  // Default border color
1549
- boxShadow: t.details.boxShadow || rr,
1549
+ boxShadow: t.details.boxShadow || sr,
1550
1550
  top: t.details.top || s.top || "0px",
1551
1551
  // Default top
1552
1552
  left: t.details.left || s.left || "0px",
@@ -1557,28 +1557,31 @@ const Pn = async (t, r) => {
1557
1557
  brightness: t.details.brightness || 100,
1558
1558
  flipX: t.details.flipX || !1,
1559
1559
  flipY: t.details.flipY || !1,
1560
- rotate: t.details.rotate || "0deg"
1560
+ rotate: t.details.rotate || "0deg",
1561
+ visibility: t.details.visibility || "visible",
1562
+ mediaWidth: t.details.mediaWidth || i.width || 100,
1563
+ mediaHeight: t.details.mediaHeight || i.height || 100
1561
1564
  };
1562
1565
  return {
1563
1566
  ...t,
1564
1567
  trim: c,
1565
1568
  type: "video",
1566
1569
  name: "video",
1567
- details: f,
1570
+ details: h,
1568
1571
  playbackRate: t.playbackRate || 1,
1569
- display: _e(t.display, { duration: i.duration, trim: c }),
1572
+ display: ke(t.display, { duration: i.duration, trim: c }),
1570
1573
  duration: i.duration
1571
1574
  };
1572
- }, Cn = async (t) => {
1575
+ }, pn = async (t) => {
1573
1576
  console.log({ payload: t });
1574
- const r = t.id, n = t.details, i = await Vi(n.src);
1577
+ const r = t.id, n = t.details, i = await Qi(n.src);
1575
1578
  console.log({ audioData: i });
1576
- const s = i.duration, c = ei(t.trim, { duration: s });
1579
+ const s = i.duration, c = ni(t.trim, { duration: s });
1577
1580
  return {
1578
1581
  id: r,
1579
1582
  name: "",
1580
1583
  type: "audio",
1581
- display: _e(t.display, { duration: s, trim: c }),
1584
+ display: ke(t.display, { duration: s, trim: c }),
1582
1585
  trim: c,
1583
1586
  playbackRate: t.playbackRate || 1,
1584
1587
  details: {
@@ -1589,14 +1592,61 @@ const Pn = async (t, r) => {
1589
1592
  metadata: { ...t.metadata },
1590
1593
  duration: s
1591
1594
  };
1592
- }, jn = async (t, r) => {
1593
- console.log({ payload: t });
1594
- const n = t.details, i = await Yi(n.src), s = nr(r, i);
1595
+ }, ta = async (t, r) => {
1596
+ const n = t.trackItemsIds, i = t.size, s = Math.min(
1597
+ r.size.width / i.width,
1598
+ r.size.height / i.height
1599
+ ), c = t.rotate || 0, h = t.position, m = t.display, P = t.trim || t.display;
1600
+ let F = 1 / 0, E = 0;
1601
+ const N = n.map((d) => {
1602
+ const f = t.trackItemsMap[d], p = t.trackItemsDetails[d];
1603
+ if (f.display.from < F && (F = f.display.from), f.display.to > E && (E = f.display.to), f.type === "text")
1604
+ return yn(
1605
+ { ...f, details: p.details },
1606
+ { size: i }
1607
+ );
1608
+ if (f.type === "image")
1609
+ return hn(
1610
+ { ...f, details: p.details },
1611
+ { size: i }
1612
+ );
1613
+ if (f.type === "video")
1614
+ return dn(
1615
+ { ...f, details: p.details },
1616
+ { size: i }
1617
+ );
1618
+ if (f.type === "audio")
1619
+ return pn({
1620
+ ...f,
1621
+ details: p.details
1622
+ });
1623
+ if (f.type === "caption")
1624
+ return mn(
1625
+ { ...f, details: p.details },
1626
+ { size: i }
1627
+ );
1628
+ }), b = await Promise.all(N);
1629
+ return {
1630
+ id: t.id,
1631
+ details: b,
1632
+ size: i,
1633
+ position: {
1634
+ top: h.top || 0,
1635
+ left: h.left || 0
1636
+ },
1637
+ trim: P,
1638
+ scale: s,
1639
+ display: m || { from: F, to: E },
1640
+ rotate: c,
1641
+ activeEdit: !1
1642
+ };
1643
+ }, hn = async (t, r) => {
1644
+ const n = t.details, i = await ti(n.src), s = or(r, i);
1595
1645
  return {
1596
1646
  id: t.id,
1597
1647
  type: "image",
1598
1648
  name: "image",
1599
- display: _e(t.display),
1649
+ display: ke(t.display),
1600
1650
  playbackRate: t.playbackRate || 1,
1601
1651
  details: {
1602
1652
  src: n.src || "",
@@ -1613,7 +1663,7 @@ const Pn = async (t, r) => {
1613
1663
  // Default border
1614
1664
  borderRadius: n.borderRadius || 0,
1615
1665
  // Default border radius
1616
- boxShadow: n.boxShadow || rr,
1666
+ boxShadow: n.boxShadow || sr,
1617
1667
  // Default box shadow
1618
1668
  top: n.top || s.top || "0px",
1619
1669
  // Default top
@@ -1627,51 +1677,54 @@ const Pn = async (t, r) => {
1627
1677
  brightness: n.brightness || 100,
1628
1678
  flipX: n.flipX || !1,
1629
1679
  flipY: n.flipY || !1,
1630
- rotate: n.rotate || "0deg"
1680
+ rotate: n.rotate || "0deg",
1681
+ visibility: n.visibility || "visible",
1682
+ mediaWidth: n.mediaWidth || n.width || i.width || 100,
1683
+ mediaHeight: n.mediaHeight || n.height || i.height || 100
1631
1684
  },
1632
1685
  metadata: t.metadata || {}
1633
1686
  };
1634
- }, Rn = async (t, r) => {
1687
+ }, mn = async (t, r) => {
1635
1688
  const n = t;
1636
- n.details.fontUrl && await _n([
1689
+ n.details.fontUrl && await kn([
1637
1690
  {
1638
1691
  fontFamily: n.details.fontFamily,
1639
1692
  url: n.details.fontUrl
1640
1693
  }
1641
1694
  ]);
1642
- const i = n.id, s = n.details, c = ri(s), f = ti(n.details.text, c), h = nr(r, {
1695
+ const i = n.id, s = n.details, c = ii(s), h = ri(n.details.text, c), m = or(r, {
1643
1696
  width: c.width,
1644
- height: f
1697
+ height: h
1645
1698
  });
1646
1699
  return {
1647
1700
  id: i,
1648
1701
  name: "caption",
1649
1702
  type: "caption",
1650
- display: _e(n.display),
1703
+ display: ke(n.display),
1651
1704
  details: {
1652
1705
  ...c,
1653
1706
  text: s.text || "",
1654
1707
  // Default text content
1655
- height: f,
1708
+ height: h,
1656
1709
  // Default height
1657
1710
  fontUrl: s.fontUrl,
1658
- top: c.top || h.top,
1659
- left: c.left || h.left,
1711
+ top: c.top || m.top,
1712
+ left: c.left || m.left,
1660
1713
  borderWidth: s.borderWidth || 0,
1661
1714
  borderColor: s.borderColor || "#000000",
1662
- boxShadow: s.boxShadow || rr,
1715
+ boxShadow: s.boxShadow || sr,
1663
1716
  words: s.words || []
1664
1717
  },
1665
1718
  metadata: {}
1666
1719
  };
1667
- }, Fn = async (t, r) => {
1668
- t.details.fontUrl && await _n([
1720
+ }, yn = async (t, r) => {
1721
+ t.details.fontUrl && await kn([
1669
1722
  {
1670
1723
  fontFamily: t.details.fontFamily,
1671
1724
  url: t.details.fontUrl
1672
1725
  }
1673
1726
  ]);
1674
- const n = t.id, i = t.details, s = ri(i), c = ti(t.details.text, s), f = nr(r, {
1727
+ const n = t.id, i = t.details, s = ii(i), c = ri(t.details.text, s), h = or(r, {
1675
1728
  width: s.width,
1676
1729
  height: c
1677
1730
  });
@@ -1679,7 +1732,7 @@ const Pn = async (t, r) => {
1679
1732
  id: n,
1680
1733
  name: "text",
1681
1734
  type: "text",
1682
- display: _e(t.display),
1735
+ display: ke(t.display),
1683
1736
  details: {
1684
1737
  ...s,
1685
1738
  text: i.text || "",
@@ -1687,15 +1740,15 @@ const Pn = async (t, r) => {
1687
1740
  height: c,
1688
1741
  // Default height
1689
1742
  fontUrl: i.fontUrl,
1690
- top: s.top || f.top,
1691
- left: s.left || f.left,
1743
+ top: s.top || h.top,
1744
+ left: s.left || h.left,
1692
1745
  borderWidth: i.borderWidth || 0,
1693
1746
  borderColor: i.borderColor || "#000000",
1694
- boxShadow: i.boxShadow || rr
1747
+ boxShadow: i.boxShadow || sr
1695
1748
  },
1696
1749
  metadata: {}
1697
1750
  };
1698
- }, ri = (t) => ({
1751
+ }, ii = (t) => ({
1699
1752
  fontFamily: t.fontFamily || "Arial",
1700
1753
  // Default font family
1701
1754
  fontSize: t.fontSize || "16px",
@@ -1737,14 +1790,14 @@ const Pn = async (t, r) => {
1737
1790
  left: t.left,
1738
1791
  textTransform: t.textTransform || "none",
1739
1792
  transform: t.transform || "none"
1740
- }), qi = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
1741
- let qe = (t = 21) => {
1793
+ }), ea = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
1794
+ let tr = (t = 21) => {
1742
1795
  let r = "", n = crypto.getRandomValues(new Uint8Array(t));
1743
1796
  for (; t--; )
1744
- r += qi[n[t] & 63];
1797
+ r += ea[n[t] & 63];
1745
1798
  return r;
1746
1799
  };
1747
- function Ji(t, r) {
1800
+ function ra(t, r) {
1748
1801
  return t.filter((i) => {
1749
1802
  if (r.forEach((s) => {
1750
1803
  i.items.includes(s) && (i.items = i.items.filter((c) => c !== s));
@@ -1754,165 +1807,181 @@ function Ji(t, r) {
1754
1807
  }
1755
1808
  function en(t = 16) {
1756
1809
  const r = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", n = r.charAt(Math.floor(Math.random() * r.length));
1757
- let i = qe(t - 1);
1810
+ let i = tr(t - 1);
1758
1811
  return i = i.replace(/[^a-zA-Z0-9]/g, "").slice(0, t - 1), n + i;
1759
1812
  }
1760
- const Yt = (t) => Object.keys(t).reduce((r, n) => {
1813
+ const qt = (t) => Object.keys(t).reduce((r, n) => {
1761
1814
  const { display: i, playbackRate: s } = t[n];
1762
1815
  return Math.max(r, i.to / (s || 1));
1763
- }, 0);
1764
- function Zi(t) {
1765
- const r = $t.pipe(
1766
- Kt(({ key: p }) => p.startsWith(di))
1767
- ), n = $t.pipe(
1768
- Kt(({ key: p }) => p.startsWith(hi))
1769
- ), i = $t.pipe(
1770
- Kt(({ key: p }) => p.startsWith(yi))
1771
- ), s = $t.pipe(
1772
- Kt(({ key: p }) => p.startsWith(mi))
1773
- ), c = $t.pipe(
1774
- Kt(({ key: p }) => p.startsWith(bi))
1775
- ), f = $t.pipe(
1776
- Kt(({ key: p }) => p.startsWith(gi))
1777
- ), h = r.subscribe(async (p) => {
1778
- var y, l;
1779
- if (p.key === _i) {
1780
- const m = (y = p.value) == null ? void 0 : y.payload, S = m.size, v = m.trackItemIds, b = m.trackItemsMap, d = m.trackItemDetailsMap;
1816
+ }, 0), na = (t, r, n, i, s) => {
1817
+ let c = !1;
1818
+ return t.forEach((h) => {
1819
+ const m = n[h], P = m.display.from, F = m.display.to;
1820
+ if (i !== void 0 || s !== void 0) {
1821
+ const E = r.find((b, d) => {
1822
+ if (i !== void 0 && b.id === i) return b;
1823
+ if (s !== void 0 && d === s) return b;
1824
+ });
1825
+ if (!E) return;
1826
+ c = E.items.map((b) => n[b]).some((b) => {
1827
+ const d = b.display.from, f = b.display.to;
1828
+ return d <= P && f >= F;
1829
+ });
1830
+ }
1831
+ }), c;
1832
+ };
1833
+ function ia(t) {
1834
+ const r = Vt.pipe(
1835
+ Xt(({ key: d }) => d.startsWith(mi))
1836
+ ), n = Vt.pipe(
1837
+ Xt(({ key: d }) => d.startsWith(yi))
1838
+ ), i = Vt.pipe(
1839
+ Xt(({ key: d }) => d.startsWith(bi))
1840
+ ), s = Vt.pipe(
1841
+ Xt(({ key: d }) => d.startsWith(gi))
1842
+ ), c = Vt.pipe(
1843
+ Xt(({ key: d }) => d.startsWith(_i))
1844
+ ), h = Vt.pipe(
1845
+ Xt(({ key: d }) => d.startsWith(Ii))
1846
+ ), m = r.subscribe(async (d) => {
1847
+ var f, p;
1848
+ if (d.key === vi) {
1849
+ const g = (f = d.value) == null ? void 0 : f.payload, v = g.size, _ = g.trackItemIds, y = g.trackItemsMap, l = g.trackItemDetailsMap;
1781
1850
  console.warn("IMPROVE FONTS LOADING");
1782
- const O = v.map(async (_) => {
1783
- var D;
1851
+ const x = _.map(async (I) => {
1852
+ var C;
1784
1853
  try {
1785
- const I = d[_], P = b[_];
1786
- if (I.type === "image") {
1787
- const k = await jn(
1788
- { id: _, details: I.details, ...P },
1854
+ const w = l[I], D = y[I];
1855
+ if (w.type === "image") {
1856
+ const k = await hn(
1857
+ { id: I, details: w.details, ...D },
1789
1858
  {
1790
- size: S
1859
+ size: v
1791
1860
  }
1792
- ), { details: A, ...U } = k;
1793
- d[_] = { type: "image", details: A }, b[_] = U;
1794
- } else if (I.type === "video") {
1795
- const k = X(
1796
- (D = p.value) == null ? void 0 : D.payload.trackItemsMap[_]
1797
- ), A = await Pn(
1798
- { ...I, ...k, ...P },
1861
+ ), { details: S, ...A } = k;
1862
+ l[I] = { type: "image", details: S }, y[I] = A;
1863
+ } else if (w.type === "video") {
1864
+ const k = B(
1865
+ (C = d.value) == null ? void 0 : C.payload.trackItemsMap[I]
1866
+ ), S = await dn(
1867
+ { ...w, ...k, ...D },
1799
1868
  {
1800
- size: S
1869
+ size: v
1801
1870
  }
1802
- ), { details: U, ...J } = A;
1803
- d[_] = { type: "video", details: U }, b[_] = J;
1804
- } else if (I.type === "audio") {
1805
- const k = await Cn({
1806
- id: _,
1807
- details: I.details,
1808
- ...P
1809
- }), { details: A, ...U } = k;
1810
- d[_] = { type: "audio", details: A }, b[_] = U;
1811
- } else if (I.type === "caption") {
1812
- const k = await Rn(
1813
- { id: _, details: I.details, ...P },
1871
+ ), { details: A, ...O } = S;
1872
+ l[I] = { type: "video", details: A }, y[I] = O;
1873
+ } else if (w.type === "audio") {
1874
+ const k = await pn({
1875
+ id: I,
1876
+ details: w.details,
1877
+ ...D
1878
+ }), { details: S, ...A } = k;
1879
+ l[I] = { type: "audio", details: S }, y[I] = A;
1880
+ } else if (w.type === "caption") {
1881
+ const k = await mn(
1882
+ { id: I, details: w.details, ...D },
1814
1883
  {
1815
- size: S
1884
+ size: v
1816
1885
  }
1817
- ), { details: A, ...U } = k;
1818
- d[_] = { type: "caption", details: A }, b[_] = U;
1819
- } else if (I.type === "text") {
1820
- const k = await Fn(
1821
- { id: _, details: I.details, ...P },
1886
+ ), { details: S, ...A } = k;
1887
+ l[I] = { type: "caption", details: S }, y[I] = A;
1888
+ } else if (w.type === "text") {
1889
+ const k = await yn(
1890
+ { id: I, details: w.details, ...D },
1822
1891
  {
1823
- size: S
1892
+ size: v
1824
1893
  }
1825
- ), { details: A, ...U } = k;
1826
- d[_] = { type: "text", details: A }, b[_] = U;
1894
+ ), { details: S, ...A } = k;
1895
+ l[I] = { type: "text", details: S }, y[I] = A;
1827
1896
  }
1828
1897
  return !0;
1829
1898
  } catch {
1830
1899
  return !1;
1831
1900
  }
1832
1901
  });
1833
- await Promise.all(O);
1834
- const E = Yt(b);
1902
+ await Promise.all(x);
1903
+ const M = qt(y);
1835
1904
  t.updateState({
1836
- ...m,
1837
- trackItemsMap: b,
1838
- duration: E
1905
+ ...g,
1906
+ trackItemsMap: y,
1907
+ duration: M
1839
1908
  });
1840
1909
  }
1841
- if (p.key === vi) {
1842
- const m = (l = p.value) == null ? void 0 : l.payload;
1910
+ if (d.key === Si) {
1911
+ const g = (p = d.value) == null ? void 0 : p.payload;
1843
1912
  t.updateState({
1844
- size: m
1913
+ size: g
1845
1914
  });
1846
1915
  }
1847
- }), x = s.subscribe((p) => {
1848
- if (p.key === Ii) return t.undo();
1849
- if (p.key === Si) return t.redo();
1850
- }), F = i.subscribe((p) => {
1851
- var m, S, v, b;
1852
- const y = [], l = [];
1853
- if ((m = p.value) != null && m.payload.trackItemIds && (y.push((S = p.value) == null ? void 0 : S.payload.trackItemIds), t.updateState({ activeIds: y })), p.key === wi) {
1854
- const d = (v = p.value) == null ? void 0 : v.payload.trackItemIds, O = X(t.getState()), E = d && d.length ? d : O.activeIds, _ = O.trackItemIds, D = O.trackItemDetailsMap, I = _.filter(
1855
- (J) => !E.includes(J)
1856
- ), P = Object.fromEntries(
1857
- Object.entries(D).filter(
1858
- ([J]) => !E.includes(J)
1916
+ }), P = s.subscribe((d) => {
1917
+ if (d.key === wi) return t.undo();
1918
+ if (d.key === ki) return t.redo();
1919
+ }), F = i.subscribe((d) => {
1920
+ var g, v, _, y;
1921
+ const f = [], p = [];
1922
+ if ((g = d.value) != null && g.payload.trackItemIds && (f.push((v = d.value) == null ? void 0 : v.payload.trackItemIds), t.updateState({ activeIds: f })), d.key === Ti) {
1923
+ const l = (_ = d.value) == null ? void 0 : _.payload.trackItemIds, x = B(t.getState()), M = l && l.length ? l : x.activeIds, I = x.trackItemIds, C = x.trackItemDetailsMap, w = I.filter(
1924
+ (O) => !M.includes(O)
1925
+ ), D = Object.fromEntries(
1926
+ Object.entries(C).filter(
1927
+ ([O]) => !M.includes(O)
1859
1928
  )
1860
- ), k = Ji(
1861
- O.tracks,
1862
- E
1863
- ), A = Object.fromEntries(
1864
- Object.entries(O.trackItemsMap).filter(
1865
- ([J]) => !E.includes(J)
1929
+ ), k = ra(
1930
+ x.tracks,
1931
+ M
1932
+ ), S = Object.fromEntries(
1933
+ Object.entries(x.trackItemsMap).filter(
1934
+ ([O]) => !M.includes(O)
1866
1935
  )
1867
- ), U = Yt(A);
1936
+ ), A = qt(S);
1868
1937
  t.updateState(
1869
1938
  {
1870
- trackItemIds: I,
1871
- trackItemDetailsMap: P,
1939
+ trackItemIds: w,
1940
+ trackItemDetailsMap: D,
1872
1941
  activeIds: [],
1873
- trackItemsMap: A,
1942
+ trackItemsMap: S,
1874
1943
  tracks: k,
1875
- duration: U
1944
+ duration: A
1876
1945
  },
1877
1946
  { updateHistory: !0, kind: "remove" }
1878
1947
  );
1879
1948
  }
1880
- if (p.key === ki) {
1881
- const d = X(t.getState()), O = ((b = p.value) == null ? void 0 : b.payload.trackItemIds) || d.activeIds;
1882
- if (O.length === 0) return;
1883
- O.forEach((_) => {
1884
- const D = d.trackItemsMap[_], I = d.trackItemDetailsMap[_], P = en();
1885
- l.push(P), d.trackItemsMap = {
1886
- ...d.trackItemsMap,
1887
- [P]: { ...X(D), id: P }
1888
- }, d.trackItemDetailsMap = {
1889
- ...d.trackItemDetailsMap,
1890
- [P]: {
1891
- ...X(I)
1949
+ if (d.key === Ei) {
1950
+ const l = B(t.getState()), x = ((y = d.value) == null ? void 0 : y.payload.trackItemIds) || l.activeIds;
1951
+ if (x.length === 0) return;
1952
+ x.forEach((I) => {
1953
+ const C = l.trackItemsMap[I], w = l.trackItemDetailsMap[I], D = en();
1954
+ p.push(D), l.trackItemsMap = {
1955
+ ...l.trackItemsMap,
1956
+ [D]: { ...B(C), id: D }
1957
+ }, l.trackItemDetailsMap = {
1958
+ ...l.trackItemDetailsMap,
1959
+ [D]: {
1960
+ ...B(w)
1892
1961
  }
1893
- }, d.trackItemIds.push(P);
1962
+ }, l.trackItemIds.push(D);
1894
1963
  });
1895
- const E = [];
1896
- d.tracks.forEach((_) => {
1897
- const D = {
1898
- ..._,
1964
+ const M = [];
1965
+ l.tracks.forEach((I) => {
1966
+ const C = {
1967
+ ...I,
1899
1968
  items: [],
1900
- id: qe()
1969
+ id: tr()
1901
1970
  };
1902
- _.items.forEach((I) => {
1903
- if (O.includes(I)) {
1904
- const P = O.indexOf(I);
1905
- D.items.push(l[P]);
1971
+ I.items.forEach((w) => {
1972
+ if (x.includes(w)) {
1973
+ const D = x.indexOf(w);
1974
+ C.items.push(p[D]);
1906
1975
  }
1907
- }), E.push(D);
1908
- }), E.forEach((_) => {
1909
- _.items.length !== 0 && d.tracks.unshift(_);
1976
+ }), M.push(C);
1977
+ }), M.forEach((I) => {
1978
+ I.items.length !== 0 && l.tracks.unshift(I);
1910
1979
  }), t.updateState(
1911
1980
  {
1912
- trackItemDetailsMap: d.trackItemDetailsMap,
1913
- tracks: d.tracks,
1914
- trackItemIds: d.trackItemIds,
1915
- trackItemsMap: d.trackItemsMap
1981
+ trackItemDetailsMap: l.trackItemDetailsMap,
1982
+ tracks: l.tracks,
1983
+ trackItemIds: l.trackItemIds,
1984
+ trackItemsMap: l.trackItemsMap
1916
1985
  },
1917
1986
  {
1918
1987
  updateHistory: !0,
@@ -1920,119 +1989,138 @@ function Zi(t) {
1920
1989
  }
1921
1990
  );
1922
1991
  }
1923
- }), T = n.subscribe(async (p) => {
1924
- var v, b, d, O, E;
1925
- const y = X(t.getState());
1926
- let l = [], m = "text";
1927
- if (p.key === Ti) {
1928
- m = "caption";
1929
- const _ = (v = p.value) == null ? void 0 : v.payload, D = [];
1930
- for (const k of _) {
1931
- const A = Rn(k, {
1932
- size: y.size
1992
+ }), E = n.subscribe(async (d) => {
1993
+ var l, x, M, I, C, w, D, k;
1994
+ const f = B(t.getState());
1995
+ let p = [], g = "text";
1996
+ const v = (l = d.value) == null ? void 0 : l.options.trackId, _ = (x = d.value) == null ? void 0 : x.options.trackIndex;
1997
+ if (d.key === Mi) {
1998
+ g = "caption";
1999
+ const S = (M = d.value) == null ? void 0 : M.payload, A = [];
2000
+ for (const V of S) {
2001
+ const ft = mn(V, {
2002
+ size: f.size
1933
2003
  });
1934
- D.push(A);
2004
+ A.push(ft);
1935
2005
  }
1936
- const I = await Promise.all(D), P = [];
1937
- for (const k of I) {
1938
- const A = k.id;
1939
- P.push(A);
1940
- const { details: U, ...J } = k;
1941
- y.trackItemDetailsMap[A] = {
1942
- type: m,
1943
- details: U
1944
- }, y.trackItemsMap[A] = J, y.trackItemIds.push(A);
2006
+ const O = await Promise.all(A), Z = [];
2007
+ for (const V of O) {
2008
+ const ft = V.id;
2009
+ Z.push(ft);
2010
+ const { details: Jt, ...Zt } = V;
2011
+ f.trackItemDetailsMap[ft] = {
2012
+ type: g,
2013
+ details: Jt
2014
+ }, f.trackItemsMap[ft] = Zt, f.trackItemIds.push(ft);
1945
2015
  }
1946
- l = P;
2016
+ p = Z;
2017
+ }
2018
+ if (d.key === Ai) {
2019
+ g = "text";
2020
+ const S = await yn((I = d.value) == null ? void 0 : I.payload, {
2021
+ size: f.size
2022
+ }), { details: A, ...O } = S;
2023
+ f.trackItemDetailsMap[O.id] = {
2024
+ type: g,
2025
+ details: A
2026
+ }, f.trackItemsMap[O.id] = O, f.trackItemIds.push(O.id), p = [O.id];
1947
2027
  }
1948
- if (p.key === Ei) {
1949
- m = "text";
1950
- const _ = await Fn((b = p.value) == null ? void 0 : b.payload, {
1951
- size: y.size
1952
- }), { details: D, ...I } = _;
1953
- y.trackItemDetailsMap[I.id] = {
1954
- type: m,
1955
- details: D
1956
- }, y.trackItemsMap[I.id] = I, y.trackItemIds.push(I.id), l = [I.id];
2028
+ if (d.key === Oi) {
2029
+ g = "template";
2030
+ const S = await ta((C = d.value) == null ? void 0 : C.payload, {
2031
+ size: f.size
2032
+ }), { details: A, ...O } = S;
2033
+ f.trackItemsMap[S.id] = {
2034
+ ...O,
2035
+ type: "template"
2036
+ }, f.trackItemIds.push(O.id), f.trackItemDetailsMap[O.id] = {
2037
+ type: "template",
2038
+ details: A
2039
+ }, p = [O.id];
1957
2040
  }
1958
- if (p.key === Ai) {
1959
- m = "image";
1960
- const _ = await jn((d = p.value) == null ? void 0 : d.payload, {
1961
- size: y.size
1962
- }), { details: D, ...I } = _;
1963
- y.trackItemDetailsMap[I.id] = {
1964
- type: m,
1965
- details: D
1966
- }, y.trackItemsMap[I.id] = I, y.trackItemIds.push(I.id), l = [I.id];
2041
+ if (d.key === xi) {
2042
+ g = "image";
2043
+ const S = await hn((w = d.value) == null ? void 0 : w.payload, {
2044
+ size: f.size
2045
+ }), { details: A, ...O } = S;
2046
+ f.trackItemDetailsMap[O.id] = {
2047
+ type: g,
2048
+ details: A
2049
+ }, f.trackItemsMap[O.id] = O, f.trackItemIds.push(O.id), p = [O.id];
1967
2050
  }
1968
- if (p.key === Mi) {
1969
- m = "audio";
1970
- const _ = await Cn((O = p.value) == null ? void 0 : O.payload), { details: D, ...I } = _;
1971
- y.trackItemDetailsMap[I.id] = {
1972
- type: m,
1973
- details: D
1974
- }, y.trackItemsMap[I.id] = I, y.trackItemIds.push(I.id), l = [I.id];
2051
+ if (d.key === Di) {
2052
+ g = "audio";
2053
+ const S = await pn((D = d.value) == null ? void 0 : D.payload), { details: A, ...O } = S;
2054
+ f.trackItemDetailsMap[O.id] = {
2055
+ type: g,
2056
+ details: A
2057
+ }, f.trackItemsMap[O.id] = O, f.trackItemIds.push(O.id), p = [O.id];
1975
2058
  }
1976
- if (p.key === Oi) {
1977
- m = "video";
1978
- const _ = await Pn((E = p.value) == null ? void 0 : E.payload, {
1979
- size: y.size
1980
- }), { details: D, ...I } = _;
1981
- y.trackItemDetailsMap[I.id] = {
1982
- type: m,
1983
- details: D
1984
- }, y.trackItemsMap[I.id] = I, y.trackItemIds.push(I.id), l = [I.id];
2059
+ if (d.key === Pi) {
2060
+ g = "video";
2061
+ const S = await dn((k = d.value) == null ? void 0 : k.payload, {
2062
+ size: f.size
2063
+ }), { details: A, ...O } = S;
2064
+ f.trackItemDetailsMap[O.id] = {
2065
+ type: g,
2066
+ details: A
2067
+ }, f.trackItemsMap[O.id] = O, f.trackItemIds.push(O.id), p = [O.id];
1985
2068
  }
1986
- y.tracks.unshift({
1987
- id: qe(),
2069
+ const y = na(
2070
+ p,
2071
+ f.tracks,
2072
+ f.trackItemsMap,
2073
+ v,
2074
+ _
2075
+ );
2076
+ v !== void 0 && v !== "main" && !y ? f.tracks.map((A) => A.id).includes(v) && (f.tracks = f.tracks.map((A) => (A.id === v && A.items.push(...p), A))) : _ !== void 0 && !y ? f.tracks = f.tracks.map((S, A) => (A === _ && S.items.push(...p), S)) : f.tracks.unshift({
2077
+ id: tr(),
1988
2078
  accepts: ["text", "audio", "helper", "video", "image", "caption"],
1989
- type: m,
1990
- items: l,
2079
+ type: g,
2080
+ items: p,
1991
2081
  magnetic: !1,
1992
2082
  static: !1
1993
- });
1994
- const S = Yt(y.trackItemsMap);
1995
- t.updateState(
2083
+ }), f.duration = qt(f.trackItemsMap), t.updateState(
1996
2084
  {
1997
- trackItemIds: y.trackItemIds,
1998
- trackItemDetailsMap: y.trackItemDetailsMap,
1999
- trackItemsMap: y.trackItemsMap,
2000
- tracks: y.tracks,
2001
- duration: S
2085
+ trackItemIds: f.trackItemIds,
2086
+ trackItemDetailsMap: f.trackItemDetailsMap,
2087
+ trackItemsMap: f.trackItemsMap,
2088
+ tracks: f.tracks,
2089
+ duration: f.duration
2002
2090
  },
2003
2091
  {
2004
2092
  updateHistory: !0,
2005
2093
  kind: "add"
2006
2094
  }
2007
2095
  );
2008
- }), H = c.subscribe(async (p) => {
2009
- var y;
2010
- if (p.key === xi) {
2011
- const l = X(t.getState()), m = (y = p.value) == null ? void 0 : y.options.time;
2012
- if (l.activeIds.length === 1) {
2013
- const S = l.activeIds[0], v = l.trackItemsMap[S];
2014
- if (m >= v.display.to || m <= v.display.from)
2096
+ }), N = c.subscribe(async (d) => {
2097
+ var f;
2098
+ if (d.key === Ci) {
2099
+ const p = B(t.getState()), g = (f = d.value) == null ? void 0 : f.options.time;
2100
+ if (p.activeIds.length === 1) {
2101
+ const v = p.activeIds[0], _ = p.trackItemsMap[v];
2102
+ if (g >= _.display.to || g <= _.display.from)
2015
2103
  return;
2016
- const b = l.trackItemDetailsMap[S], d = en(), O = {
2017
- ...v,
2018
- id: d,
2104
+ const y = p.trackItemDetailsMap[v], l = en(), x = {
2105
+ ..._,
2106
+ id: l,
2019
2107
  display: {
2020
- from: m,
2021
- to: v.display.to
2108
+ from: g,
2109
+ to: _.display.to
2022
2110
  },
2023
2111
  trim: {
2024
- from: m,
2025
- to: v.display.to
2112
+ from: g,
2113
+ to: _.display.to
2026
2114
  }
2027
2115
  };
2028
- l.trackItemsMap[S].display.to = m, l.trackItemsMap[d] = O, l.trackItemIds.push(d), l.trackItemDetailsMap[d] = b, l.tracks.forEach((E) => {
2029
- E.items.includes(S) && E.items.push(d);
2116
+ p.trackItemsMap[v].display.to = g, p.trackItemsMap[l] = x, p.trackItemIds.push(l), p.trackItemDetailsMap[l] = y, p.tracks.forEach((M) => {
2117
+ M.items.includes(v) && M.items.push(l);
2030
2118
  }), t.updateState(
2031
2119
  {
2032
- trackItemDetailsMap: l.trackItemDetailsMap,
2033
- tracks: l.tracks,
2034
- trackItemIds: l.trackItemIds,
2035
- trackItemsMap: l.trackItemsMap
2120
+ trackItemDetailsMap: p.trackItemDetailsMap,
2121
+ tracks: p.tracks,
2122
+ trackItemIds: p.trackItemIds,
2123
+ trackItemsMap: p.trackItemsMap
2036
2124
  },
2037
2125
  {
2038
2126
  updateHistory: !0,
@@ -2042,54 +2130,76 @@ function Zi(t) {
2042
2130
  }
2043
2131
  return;
2044
2132
  }
2045
- if (p.key === Di) {
2046
- const l = X(t.getState());
2047
- if (l.activeIds.length) {
2048
- const m = l.activeIds, S = [], v = {
2049
- activeIds: m,
2133
+ if (d.key === Ri) {
2134
+ const p = B(t.getState());
2135
+ if (p.activeIds.length) {
2136
+ const g = p.activeIds, v = [], _ = {
2137
+ activeIds: g,
2050
2138
  trackItemDetailsMap: {},
2051
2139
  trackItemsMap: {},
2052
2140
  tracks: []
2053
2141
  };
2054
- m.forEach((d) => {
2055
- v.trackItemDetailsMap[d] = l.trackItemDetailsMap[d], v.trackItemsMap[d] = l.trackItemsMap[d], S.push(
2056
- l.tracks.find((O) => O.items.includes(d))
2142
+ g.forEach((l) => {
2143
+ _.trackItemDetailsMap[l] = p.trackItemDetailsMap[l], _.trackItemsMap[l] = p.trackItemsMap[l], v.push(
2144
+ p.tracks.find((x) => x.items.includes(l))
2057
2145
  );
2058
2146
  });
2059
- const b = /* @__PURE__ */ new Set();
2060
- S.filter((d) => b.has(d.id) ? !1 : (b.add(d), !0)), v.tracks = Array.from(b.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(v));
2147
+ const y = /* @__PURE__ */ new Set();
2148
+ v.filter((l) => y.has(l.id) ? !1 : (y.add(l), !0)), _.tracks = Array.from(y.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(_));
2061
2149
  }
2062
2150
  }
2063
- if (p.key === Pi) {
2064
- const l = localStorage.getItem("DesignComboTemp");
2065
- if (!l) return;
2066
- const m = X(t.getState()), S = JSON.parse(l), v = {}, b = S.trackItemsMap, d = S.trackItemDetailsMap, O = S.tracks, E = [], _ = S.activeIds.map(async (D) => {
2067
- const I = d[D];
2068
- (I.type === "caption" || I.type === "text") && I.details.fontUrl && await _n([
2151
+ if (d.key === Fi) {
2152
+ const p = localStorage.getItem("DesignComboTemp");
2153
+ if (!p) return;
2154
+ const g = B(t.getState()), v = JSON.parse(p), _ = {}, y = v.trackItemsMap, l = v.trackItemDetailsMap, x = v.tracks, M = [], I = v.activeIds.map(async (C) => {
2155
+ const w = l[C];
2156
+ (w.type === "caption" || w.type === "text") && w.details.fontUrl && await kn([
2069
2157
  {
2070
- fontFamily: I.details.fontFamily,
2071
- url: I.details.fontUrl
2158
+ fontFamily: w.details.fontFamily,
2159
+ url: w.details.fontUrl
2072
2160
  }
2073
2161
  ]);
2074
- const P = en();
2075
- return v[D] = P, m.trackItemsMap[P] = {
2076
- ...b[D],
2077
- id: P
2078
- }, m.trackItemDetailsMap[P] = I, m.trackItemIds.push(P), !0;
2162
+ const D = en();
2163
+ return _[C] = D, g.trackItemsMap[D] = {
2164
+ ...y[C],
2165
+ id: D
2166
+ }, g.trackItemDetailsMap[D] = w, g.trackItemIds.push(D), !0;
2079
2167
  });
2080
- await Promise.all(_), O.forEach((D) => {
2081
- const I = D.items.map((k) => v[k]), P = {
2082
- ...D,
2083
- items: I,
2084
- id: qe()
2168
+ await Promise.all(I), x.forEach((C) => {
2169
+ const w = C.items.map((k) => _[k]), D = {
2170
+ ...C,
2171
+ items: w,
2172
+ id: tr()
2085
2173
  };
2086
- E.push(P);
2087
- }), m.tracks = [...m.tracks, ...E], t.updateState(
2174
+ M.push(D);
2175
+ }), g.tracks = [...g.tracks, ...M], t.updateState(
2176
+ {
2177
+ trackItemDetailsMap: g.trackItemDetailsMap,
2178
+ tracks: g.tracks,
2179
+ trackItemIds: g.trackItemIds,
2180
+ trackItemsMap: g.trackItemsMap
2181
+ },
2182
+ {
2183
+ updateHistory: !0,
2184
+ kind: "update"
2185
+ }
2186
+ );
2187
+ }
2188
+ }), b = h.subscribe(async (d) => {
2189
+ var f, p, g, v;
2190
+ if (d.key === ji) {
2191
+ const _ = B(t.getState()), [y] = (f = d.value) == null ? void 0 : f.payload.trackItemIds, l = _.trackItemDetailsMap;
2192
+ _.trackItemIds.forEach((M) => {
2193
+ const I = l[M];
2194
+ if (I.type === "template" && I.details.map((w) => w.id).includes(y)) {
2195
+ const w = I.details.filter(
2196
+ (D) => D.id !== y
2197
+ );
2198
+ I.details = w;
2199
+ }
2200
+ }), t.updateState(
2088
2201
  {
2089
- trackItemDetailsMap: m.trackItemDetailsMap,
2090
- tracks: m.tracks,
2091
- trackItemIds: m.trackItemIds,
2092
- trackItemsMap: m.trackItemsMap
2202
+ trackItemDetailsMap: { ...l }
2093
2203
  },
2094
2204
  {
2095
2205
  updateHistory: !0,
@@ -2097,25 +2207,26 @@ function Zi(t) {
2097
2207
  }
2098
2208
  );
2099
2209
  }
2100
- }), g = f.subscribe((p) => {
2101
- var y, l;
2102
- if (p.key === Ci) {
2103
- const m = X(t.getState()), S = m.trackItemDetailsMap, v = m.trackItemsMap, b = Object.keys((y = p.value) == null ? void 0 : y.payload);
2104
- if (!b.length) return;
2105
- const d = (l = p.value) == null ? void 0 : l.payload;
2106
- b.forEach((E) => {
2107
- const _ = d[E];
2108
- _.details ? S[E].details = {
2109
- ...S[E].details,
2110
- ..._.details
2111
- } : _.playbackRate && (v[E].playbackRate = _.playbackRate);
2210
+ if (d.key === zi) {
2211
+ const _ = B(t.getState()), y = _.trackItemDetailsMap, l = _.trackItemsMap, x = Object.keys((p = d.value) == null ? void 0 : p.payload);
2212
+ if (!x.length) return;
2213
+ const M = (g = d.value) == null ? void 0 : g.payload;
2214
+ x.forEach((C) => {
2215
+ const w = M[C];
2216
+ w.details ? y[C].details = {
2217
+ ...y[C].details,
2218
+ ...w.details
2219
+ } : M[C].playbackRate ? l[C].playbackRate = M[C].playbackRate : y[C].type === "template" && (l[C] = {
2220
+ ...l[C],
2221
+ ...M[C]
2222
+ });
2112
2223
  });
2113
- const O = Yt(v);
2224
+ const I = qt(l);
2114
2225
  t.updateState(
2115
2226
  {
2116
- trackItemDetailsMap: { ...S },
2117
- trackItemsMap: { ...v },
2118
- duration: O
2227
+ trackItemDetailsMap: { ...y },
2228
+ trackItemsMap: { ...l },
2229
+ duration: I
2119
2230
  },
2120
2231
  {
2121
2232
  updateHistory: !0,
@@ -2123,50 +2234,103 @@ function Zi(t) {
2123
2234
  }
2124
2235
  );
2125
2236
  }
2237
+ if (d.key === Hi) {
2238
+ const _ = (v = d.value) == null ? void 0 : v.payload, y = Object.keys(_)[0], l = Object.values(_)[0], x = B(t.getState());
2239
+ for (const M of x.trackItemIds)
2240
+ if (x.trackItemsMap[M].type === "template") {
2241
+ const I = x.trackItemDetailsMap[M];
2242
+ if (I.details.map((w) => w.id).includes(y)) {
2243
+ for (let w of I.details)
2244
+ if (w.id === y) {
2245
+ if (l.details) {
2246
+ if (l.type === "image" && l.details.src) {
2247
+ const k = await ti(l.details.src), S = w.details.width, A = w.details.height;
2248
+ let O = k.width, Z = k.height;
2249
+ const V = k.width / k.height;
2250
+ S / A > V ? (O = S, Z = S / V) : (Z = A, O = A * V), l.details.mediaWidth = O, l.details.mediaHeight = Z;
2251
+ }
2252
+ if (l.type === "video" && l.details.src) {
2253
+ const k = await ei(l.details.src), S = w.details.width, A = w.details.height;
2254
+ let O = k.width, Z = k.height;
2255
+ const V = k.width / k.height;
2256
+ S / A > V ? (O = S, Z = S / V) : (Z = A, O = A * V), l.details.mediaWidth = O, l.details.mediaHeight = Z;
2257
+ }
2258
+ const D = w.details;
2259
+ w.details = { ...D, ...l.details }, l.details = w.details;
2260
+ }
2261
+ w = { ...w, ...l }, x.trackItemDetailsMap[M].details = I.details.map((D) => D.id === y ? w : D);
2262
+ }
2263
+ }
2264
+ }
2265
+ t.updateState(
2266
+ {
2267
+ trackItemDetailsMap: {
2268
+ ...x.trackItemDetailsMap
2269
+ }
2270
+ },
2271
+ {
2272
+ updateHistory: !0,
2273
+ kind: "update:details"
2274
+ }
2275
+ );
2276
+ }
2277
+ if (d.key === Ni) {
2278
+ const _ = B(t.getState());
2279
+ _.trackItemIds.forEach((y) => {
2280
+ const l = _.trackItemsMap[y];
2281
+ l.type === "template" && (l.activeEdit = !1, t.updateState({
2282
+ trackItemsMap: {
2283
+ ..._.trackItemsMap,
2284
+ [y]: l
2285
+ },
2286
+ activeIds: []
2287
+ }));
2288
+ });
2289
+ }
2126
2290
  });
2127
2291
  return {
2128
2292
  unsubscribe: () => {
2129
- T.unsubscribe(), H.unsubscribe(), g.unsubscribe(), x.unsubscribe(), F.unsubscribe(), h.unsubscribe();
2293
+ E.unsubscribe(), N.unsubscribe(), b.unsubscribe(), P.unsubscribe(), F.unsubscribe(), m.unsubscribe();
2130
2294
  }
2131
2295
  };
2132
2296
  }
2133
- const Qi = { Date: !0, RegExp: !0, String: !0, Number: !0 };
2134
- function ni(t, r, n = { cyclesFix: !0 }, i = []) {
2135
- var h, x;
2297
+ const aa = { Date: !0, RegExp: !0, String: !0, Number: !0 };
2298
+ function ai(t, r, n = { cyclesFix: !0 }, i = []) {
2299
+ var m, P;
2136
2300
  let s = [];
2137
2301
  const c = Array.isArray(t);
2138
2302
  for (const F in t) {
2139
- const T = t[F], H = c ? +F : F;
2303
+ const E = t[F], N = c ? +F : F;
2140
2304
  if (!(F in r)) {
2141
2305
  s.push({
2142
2306
  type: "REMOVE",
2143
- path: [H],
2307
+ path: [N],
2144
2308
  oldValue: t[F]
2145
2309
  });
2146
2310
  continue;
2147
2311
  }
2148
- const g = r[F], p = typeof T == "object" && typeof g == "object" && Array.isArray(T) === Array.isArray(g);
2149
- if (T && g && p && !Qi[(x = (h = Object.getPrototypeOf(T)) == null ? void 0 : h.constructor) == null ? void 0 : x.name] && (!n.cyclesFix || !i.includes(T))) {
2150
- const y = ni(T, g, n, n.cyclesFix ? i.concat([T]) : []);
2151
- s.push.apply(s, y.map((l) => (l.path.unshift(H), l)));
2152
- } else T !== g && // treat NaN values as equivalent
2153
- !(Number.isNaN(T) && Number.isNaN(g)) && !(p && (isNaN(T) ? T + "" == g + "" : +T == +g)) && s.push({
2154
- path: [H],
2312
+ const b = r[F], d = typeof E == "object" && typeof b == "object" && Array.isArray(E) === Array.isArray(b);
2313
+ if (E && b && d && !aa[(P = (m = Object.getPrototypeOf(E)) == null ? void 0 : m.constructor) == null ? void 0 : P.name] && (!n.cyclesFix || !i.includes(E))) {
2314
+ const f = ai(E, b, n, n.cyclesFix ? i.concat([E]) : []);
2315
+ s.push.apply(s, f.map((p) => (p.path.unshift(N), p)));
2316
+ } else E !== b && // treat NaN values as equivalent
2317
+ !(Number.isNaN(E) && Number.isNaN(b)) && !(d && (isNaN(E) ? E + "" == b + "" : +E == +b)) && s.push({
2318
+ path: [N],
2155
2319
  type: "CHANGE",
2156
- value: g,
2157
- oldValue: T
2320
+ value: b,
2321
+ oldValue: E
2158
2322
  });
2159
2323
  }
2160
- const f = Array.isArray(r);
2324
+ const h = Array.isArray(r);
2161
2325
  for (const F in r)
2162
2326
  F in t || s.push({
2163
2327
  type: "CREATE",
2164
- path: [f ? +F : F],
2328
+ path: [h ? +F : F],
2165
2329
  value: r[F]
2166
2330
  });
2167
2331
  return s;
2168
2332
  }
2169
- var vn = Symbol.for("immer-nothing"), de = Symbol.for("immer-draftable"), tt = Symbol.for("immer-state"), ii = process.env.NODE_ENV !== "production" ? [
2333
+ var Tn = Symbol.for("immer-nothing"), ge = Symbol.for("immer-draftable"), nt = Symbol.for("immer-state"), si = process.env.NODE_ENV !== "production" ? [
2170
2334
  // All error codes, starting by 0:
2171
2335
  function(t) {
2172
2336
  return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
@@ -2197,117 +2361,117 @@ var vn = Symbol.for("immer-nothing"), de = Symbol.for("immer-draftable"), tt = S
2197
2361
  // Note: if more errors are added, the errorOffset in Patches.ts should be increased
2198
2362
  // See Patches.ts for additional errors
2199
2363
  ] : [];
2200
- function W(t, ...r) {
2364
+ function $(t, ...r) {
2201
2365
  if (process.env.NODE_ENV !== "production") {
2202
- const n = ii[t], i = typeof n == "function" ? n.apply(null, r) : n;
2366
+ const n = si[t], i = typeof n == "function" ? n.apply(null, r) : n;
2203
2367
  throw new Error(`[Immer] ${i}`);
2204
2368
  }
2205
2369
  throw new Error(
2206
2370
  `[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`
2207
2371
  );
2208
2372
  }
2209
- var xt = Object.getPrototypeOf;
2210
- function Dt(t) {
2211
- return !!t && !!t[tt];
2373
+ var Ct = Object.getPrototypeOf;
2374
+ function Rt(t) {
2375
+ return !!t && !!t[nt];
2212
2376
  }
2213
- function vt(t) {
2377
+ function wt(t) {
2214
2378
  var r;
2215
- return t ? ai(t) || Array.isArray(t) || !!t[de] || !!((r = t.constructor) != null && r[de]) || ve(t) || Ie(t) : !1;
2379
+ return t ? oi(t) || Array.isArray(t) || !!t[ge] || !!((r = t.constructor) != null && r[ge]) || Te(t) || Ee(t) : !1;
2216
2380
  }
2217
- var ta = Object.prototype.constructor.toString();
2218
- function ai(t) {
2381
+ var sa = Object.prototype.constructor.toString();
2382
+ function oi(t) {
2219
2383
  if (!t || typeof t != "object")
2220
2384
  return !1;
2221
- const r = xt(t);
2385
+ const r = Ct(t);
2222
2386
  if (r === null)
2223
2387
  return !0;
2224
2388
  const n = Object.hasOwnProperty.call(r, "constructor") && r.constructor;
2225
- return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === ta;
2389
+ return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === sa;
2226
2390
  }
2227
- function he(t, r) {
2228
- Pt(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
2391
+ function _e(t, r) {
2392
+ Ft(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
2229
2393
  r(n, t[n], t);
2230
2394
  }) : t.forEach((n, i) => r(i, n, t));
2231
2395
  }
2232
- function Pt(t) {
2233
- const r = t[tt];
2234
- return r ? r.type_ : Array.isArray(t) ? 1 : ve(t) ? 2 : Ie(t) ? 3 : 0;
2396
+ function Ft(t) {
2397
+ const r = t[nt];
2398
+ return r ? r.type_ : Array.isArray(t) ? 1 : Te(t) ? 2 : Ee(t) ? 3 : 0;
2235
2399
  }
2236
- function ye(t, r) {
2237
- return Pt(t) === 2 ? t.has(r) : Object.prototype.hasOwnProperty.call(t, r);
2400
+ function Ie(t, r) {
2401
+ return Ft(t) === 2 ? t.has(r) : Object.prototype.hasOwnProperty.call(t, r);
2238
2402
  }
2239
2403
  function rn(t, r) {
2240
- return Pt(t) === 2 ? t.get(r) : t[r];
2404
+ return Ft(t) === 2 ? t.get(r) : t[r];
2241
2405
  }
2242
- function si(t, r, n) {
2243
- const i = Pt(t);
2406
+ function ci(t, r, n) {
2407
+ const i = Ft(t);
2244
2408
  i === 2 ? t.set(r, n) : i === 3 ? t.add(n) : t[r] = n;
2245
2409
  }
2246
- function ea(t, r) {
2410
+ function oa(t, r) {
2247
2411
  return t === r ? t !== 0 || 1 / t === 1 / r : t !== t && r !== r;
2248
2412
  }
2249
- function ve(t) {
2413
+ function Te(t) {
2250
2414
  return t instanceof Map;
2251
2415
  }
2252
- function Ie(t) {
2416
+ function Ee(t) {
2253
2417
  return t instanceof Set;
2254
2418
  }
2255
- function Ot(t) {
2419
+ function Pt(t) {
2256
2420
  return t.copy_ || t.base_;
2257
2421
  }
2258
- function pn(t, r) {
2259
- if (ve(t))
2422
+ function bn(t, r) {
2423
+ if (Te(t))
2260
2424
  return new Map(t);
2261
- if (Ie(t))
2425
+ if (Ee(t))
2262
2426
  return new Set(t);
2263
2427
  if (Array.isArray(t))
2264
2428
  return Array.prototype.slice.call(t);
2265
- const n = ai(t);
2429
+ const n = oi(t);
2266
2430
  if (r === !0 || r === "class_only" && !n) {
2267
2431
  const i = Object.getOwnPropertyDescriptors(t);
2268
- delete i[tt];
2432
+ delete i[nt];
2269
2433
  let s = Reflect.ownKeys(i);
2270
2434
  for (let c = 0; c < s.length; c++) {
2271
- const f = s[c], h = i[f];
2272
- h.writable === !1 && (h.writable = !0, h.configurable = !0), (h.get || h.set) && (i[f] = {
2435
+ const h = s[c], m = i[h];
2436
+ m.writable === !1 && (m.writable = !0, m.configurable = !0), (m.get || m.set) && (i[h] = {
2273
2437
  configurable: !0,
2274
2438
  writable: !0,
2275
2439
  // could live with !!desc.set as well here...
2276
- enumerable: h.enumerable,
2277
- value: t[f]
2440
+ enumerable: m.enumerable,
2441
+ value: t[h]
2278
2442
  });
2279
2443
  }
2280
- return Object.create(xt(t), i);
2444
+ return Object.create(Ct(t), i);
2281
2445
  } else {
2282
- const i = xt(t);
2446
+ const i = Ct(t);
2283
2447
  if (i !== null && n)
2284
2448
  return { ...t };
2285
2449
  const s = Object.create(i);
2286
2450
  return Object.assign(s, t);
2287
2451
  }
2288
2452
  }
2289
- function In(t, r = !1) {
2290
- return ir(t) || Dt(t) || !vt(t) || (Pt(t) > 1 && (t.set = t.add = t.clear = t.delete = ra), Object.freeze(t), r && Object.entries(t).forEach(([n, i]) => In(i, !0))), t;
2453
+ function En(t, r = !1) {
2454
+ return cr(t) || Rt(t) || !wt(t) || (Ft(t) > 1 && (t.set = t.add = t.clear = t.delete = ca), Object.freeze(t), r && Object.entries(t).forEach(([n, i]) => En(i, !0))), t;
2291
2455
  }
2292
- function ra() {
2293
- W(2);
2456
+ function ca() {
2457
+ $(2);
2294
2458
  }
2295
- function ir(t) {
2459
+ function cr(t) {
2296
2460
  return Object.isFrozen(t);
2297
2461
  }
2298
- var dn = {};
2299
- function Ct(t) {
2300
- const r = dn[t];
2301
- return r || W(0, t), r;
2462
+ var gn = {};
2463
+ function jt(t) {
2464
+ const r = gn[t];
2465
+ return r || $(0, t), r;
2302
2466
  }
2303
- function na(t, r) {
2304
- dn[t] || (dn[t] = r);
2467
+ function ua(t, r) {
2468
+ gn[t] || (gn[t] = r);
2305
2469
  }
2306
- var me;
2307
- function oi() {
2308
- return me;
2470
+ var ve;
2471
+ function ui() {
2472
+ return ve;
2309
2473
  }
2310
- function ia(t, r) {
2474
+ function la(t, r) {
2311
2475
  return {
2312
2476
  drafts_: [],
2313
2477
  parent_: t,
@@ -2319,52 +2483,52 @@ function ia(t, r) {
2319
2483
  };
2320
2484
  }
2321
2485
  function zn(t, r) {
2322
- r && (Ct("Patches"), t.patches_ = [], t.inversePatches_ = [], t.patchListener_ = r);
2486
+ r && (jt("Patches"), t.patches_ = [], t.inversePatches_ = [], t.patchListener_ = r);
2323
2487
  }
2324
- function hn(t) {
2325
- yn(t), t.drafts_.forEach(aa), t.drafts_ = null;
2488
+ function _n(t) {
2489
+ In(t), t.drafts_.forEach(fa), t.drafts_ = null;
2326
2490
  }
2327
- function yn(t) {
2328
- t === me && (me = t.parent_);
2491
+ function In(t) {
2492
+ t === ve && (ve = t.parent_);
2329
2493
  }
2330
- function Nn(t) {
2331
- return me = ia(me, t);
2494
+ function Hn(t) {
2495
+ return ve = la(ve, t);
2332
2496
  }
2333
- function aa(t) {
2334
- const r = t[tt];
2497
+ function fa(t) {
2498
+ const r = t[nt];
2335
2499
  r.type_ === 0 || r.type_ === 1 ? r.revoke_() : r.revoked_ = !0;
2336
2500
  }
2337
- function Hn(t, r) {
2501
+ function Nn(t, r) {
2338
2502
  r.unfinalizedDrafts_ = r.drafts_.length;
2339
2503
  const n = r.drafts_[0];
2340
- return t !== void 0 && t !== n ? (n[tt].modified_ && (hn(r), W(4)), vt(t) && (t = Qe(r, t), r.parent_ || tr(r, t)), r.patches_ && Ct("Patches").generateReplacementPatches_(
2341
- n[tt].base_,
2504
+ return t !== void 0 && t !== n ? (n[nt].modified_ && (_n(r), $(4)), wt(t) && (t = nr(r, t), r.parent_ || ir(r, t)), r.patches_ && jt("Patches").generateReplacementPatches_(
2505
+ n[nt].base_,
2342
2506
  t,
2343
2507
  r.patches_,
2344
2508
  r.inversePatches_
2345
- )) : t = Qe(r, n, []), hn(r), r.patches_ && r.patchListener_(r.patches_, r.inversePatches_), t !== vn ? t : void 0;
2509
+ )) : t = nr(r, n, []), _n(r), r.patches_ && r.patchListener_(r.patches_, r.inversePatches_), t !== Tn ? t : void 0;
2346
2510
  }
2347
- function Qe(t, r, n) {
2348
- if (ir(r))
2511
+ function nr(t, r, n) {
2512
+ if (cr(r))
2349
2513
  return r;
2350
- const i = r[tt];
2514
+ const i = r[nt];
2351
2515
  if (!i)
2352
- return he(
2516
+ return _e(
2353
2517
  r,
2354
- (s, c) => Un(t, i, r, s, c, n)
2518
+ (s, c) => Ln(t, i, r, s, c, n)
2355
2519
  ), r;
2356
2520
  if (i.scope_ !== t)
2357
2521
  return r;
2358
2522
  if (!i.modified_)
2359
- return tr(t, i.base_, !0), i.base_;
2523
+ return ir(t, i.base_, !0), i.base_;
2360
2524
  if (!i.finalized_) {
2361
2525
  i.finalized_ = !0, i.scope_.unfinalizedDrafts_--;
2362
2526
  const s = i.copy_;
2363
- let c = s, f = !1;
2364
- i.type_ === 3 && (c = new Set(s), s.clear(), f = !0), he(
2527
+ let c = s, h = !1;
2528
+ i.type_ === 3 && (c = new Set(s), s.clear(), h = !0), _e(
2365
2529
  c,
2366
- (h, x) => Un(t, i, s, h, x, n, f)
2367
- ), tr(t, s, !1), n && t.patches_ && Ct("Patches").generatePatches_(
2530
+ (m, P) => Ln(t, i, s, m, P, n, h)
2531
+ ), ir(t, s, !1), n && t.patches_ && jt("Patches").generatePatches_(
2368
2532
  i,
2369
2533
  n,
2370
2534
  t.patches_,
@@ -2373,29 +2537,29 @@ function Qe(t, r, n) {
2373
2537
  }
2374
2538
  return i.copy_;
2375
2539
  }
2376
- function Un(t, r, n, i, s, c, f) {
2377
- if (process.env.NODE_ENV !== "production" && s === n && W(5), Dt(s)) {
2378
- const h = c && r && r.type_ !== 3 && // Set objects are atomic since they have no keys.
2379
- !ye(r.assigned_, i) ? c.concat(i) : void 0, x = Qe(t, s, h);
2380
- if (si(n, i, x), Dt(x))
2540
+ function Ln(t, r, n, i, s, c, h) {
2541
+ if (process.env.NODE_ENV !== "production" && s === n && $(5), Rt(s)) {
2542
+ const m = c && r && r.type_ !== 3 && // Set objects are atomic since they have no keys.
2543
+ !Ie(r.assigned_, i) ? c.concat(i) : void 0, P = nr(t, s, m);
2544
+ if (ci(n, i, P), Rt(P))
2381
2545
  t.canAutoFreeze_ = !1;
2382
2546
  else
2383
2547
  return;
2384
- } else f && n.add(s);
2385
- if (vt(s) && !ir(s)) {
2548
+ } else h && n.add(s);
2549
+ if (wt(s) && !cr(s)) {
2386
2550
  if (!t.immer_.autoFreeze_ && t.unfinalizedDrafts_ < 1)
2387
2551
  return;
2388
- Qe(t, s), (!r || !r.scope_.parent_) && typeof i != "symbol" && Object.prototype.propertyIsEnumerable.call(n, i) && tr(t, s);
2552
+ nr(t, s), (!r || !r.scope_.parent_) && typeof i != "symbol" && Object.prototype.propertyIsEnumerable.call(n, i) && ir(t, s);
2389
2553
  }
2390
2554
  }
2391
- function tr(t, r, n = !1) {
2392
- !t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && In(r, n);
2555
+ function ir(t, r, n = !1) {
2556
+ !t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && En(r, n);
2393
2557
  }
2394
- function sa(t, r) {
2558
+ function da(t, r) {
2395
2559
  const n = Array.isArray(t), i = {
2396
2560
  type_: n ? 1 : 0,
2397
2561
  // Track which produce call this is associated with.
2398
- scope_: r ? r.scope_ : oi(),
2562
+ scope_: r ? r.scope_ : ui(),
2399
2563
  // True for both shallow and deep changes.
2400
2564
  modified_: !1,
2401
2565
  // Used during finalization.
@@ -2415,50 +2579,50 @@ function sa(t, r) {
2415
2579
  revoke_: null,
2416
2580
  isManual_: !1
2417
2581
  };
2418
- let s = i, c = Sn;
2419
- n && (s = [i], c = be);
2420
- const { revoke: f, proxy: h } = Proxy.revocable(s, c);
2421
- return i.draft_ = h, i.revoke_ = f, h;
2582
+ let s = i, c = Mn;
2583
+ n && (s = [i], c = Se);
2584
+ const { revoke: h, proxy: m } = Proxy.revocable(s, c);
2585
+ return i.draft_ = m, i.revoke_ = h, m;
2422
2586
  }
2423
- var Sn = {
2587
+ var Mn = {
2424
2588
  get(t, r) {
2425
- if (r === tt)
2589
+ if (r === nt)
2426
2590
  return t;
2427
- const n = Ot(t);
2428
- if (!ye(n, r))
2429
- return oa(t, n, r);
2591
+ const n = Pt(t);
2592
+ if (!Ie(n, r))
2593
+ return pa(t, n, r);
2430
2594
  const i = n[r];
2431
- return t.finalized_ || !vt(i) ? i : i === nn(t.base_, r) ? (an(t), t.copy_[r] = bn(i, t)) : i;
2595
+ return t.finalized_ || !wt(i) ? i : i === nn(t.base_, r) ? (an(t), t.copy_[r] = Sn(i, t)) : i;
2432
2596
  },
2433
2597
  has(t, r) {
2434
- return r in Ot(t);
2598
+ return r in Pt(t);
2435
2599
  },
2436
2600
  ownKeys(t) {
2437
- return Reflect.ownKeys(Ot(t));
2601
+ return Reflect.ownKeys(Pt(t));
2438
2602
  },
2439
2603
  set(t, r, n) {
2440
- const i = ci(Ot(t), r);
2604
+ const i = li(Pt(t), r);
2441
2605
  if (i != null && i.set)
2442
2606
  return i.set.call(t.draft_, n), !0;
2443
2607
  if (!t.modified_) {
2444
- const s = nn(Ot(t), r), c = s == null ? void 0 : s[tt];
2608
+ const s = nn(Pt(t), r), c = s == null ? void 0 : s[nt];
2445
2609
  if (c && c.base_ === n)
2446
2610
  return t.copy_[r] = n, t.assigned_[r] = !1, !0;
2447
- if (ea(n, s) && (n !== void 0 || ye(t.base_, r)))
2611
+ if (oa(n, s) && (n !== void 0 || Ie(t.base_, r)))
2448
2612
  return !0;
2449
- an(t), mn(t);
2613
+ an(t), vn(t);
2450
2614
  }
2451
2615
  return t.copy_[r] === n && // special case: handle new props with value 'undefined'
2452
2616
  (n !== void 0 || r in t.copy_) || // special case: NaN
2453
2617
  Number.isNaN(n) && Number.isNaN(t.copy_[r]) || (t.copy_[r] = n, t.assigned_[r] = !0), !0;
2454
2618
  },
2455
2619
  deleteProperty(t, r) {
2456
- return nn(t.base_, r) !== void 0 || r in t.base_ ? (t.assigned_[r] = !1, an(t), mn(t)) : delete t.assigned_[r], t.copy_ && delete t.copy_[r], !0;
2620
+ return nn(t.base_, r) !== void 0 || r in t.base_ ? (t.assigned_[r] = !1, an(t), vn(t)) : delete t.assigned_[r], t.copy_ && delete t.copy_[r], !0;
2457
2621
  },
2458
2622
  // Note: We never coerce `desc.value` into an Immer draft, because we can't make
2459
2623
  // the same guarantee in ES5 mode.
2460
2624
  getOwnPropertyDescriptor(t, r) {
2461
- const n = Ot(t), i = Reflect.getOwnPropertyDescriptor(n, r);
2625
+ const n = Pt(t), i = Reflect.getOwnPropertyDescriptor(n, r);
2462
2626
  return i && {
2463
2627
  writable: !0,
2464
2628
  configurable: t.type_ !== 1 || r !== "length",
@@ -2467,108 +2631,108 @@ var Sn = {
2467
2631
  };
2468
2632
  },
2469
2633
  defineProperty() {
2470
- W(11);
2634
+ $(11);
2471
2635
  },
2472
2636
  getPrototypeOf(t) {
2473
- return xt(t.base_);
2637
+ return Ct(t.base_);
2474
2638
  },
2475
2639
  setPrototypeOf() {
2476
- W(12);
2640
+ $(12);
2477
2641
  }
2478
- }, be = {};
2479
- he(Sn, (t, r) => {
2480
- be[t] = function() {
2642
+ }, Se = {};
2643
+ _e(Mn, (t, r) => {
2644
+ Se[t] = function() {
2481
2645
  return arguments[0] = arguments[0][0], r.apply(this, arguments);
2482
2646
  };
2483
2647
  });
2484
- be.deleteProperty = function(t, r) {
2485
- return process.env.NODE_ENV !== "production" && isNaN(parseInt(r)) && W(13), be.set.call(this, t, r, void 0);
2648
+ Se.deleteProperty = function(t, r) {
2649
+ return process.env.NODE_ENV !== "production" && isNaN(parseInt(r)) && $(13), Se.set.call(this, t, r, void 0);
2486
2650
  };
2487
- be.set = function(t, r, n) {
2488
- return process.env.NODE_ENV !== "production" && r !== "length" && isNaN(parseInt(r)) && W(14), Sn.set.call(this, t[0], r, n, t[0]);
2651
+ Se.set = function(t, r, n) {
2652
+ return process.env.NODE_ENV !== "production" && r !== "length" && isNaN(parseInt(r)) && $(14), Mn.set.call(this, t[0], r, n, t[0]);
2489
2653
  };
2490
2654
  function nn(t, r) {
2491
- const n = t[tt];
2492
- return (n ? Ot(n) : t)[r];
2655
+ const n = t[nt];
2656
+ return (n ? Pt(n) : t)[r];
2493
2657
  }
2494
- function oa(t, r, n) {
2658
+ function pa(t, r, n) {
2495
2659
  var s;
2496
- const i = ci(r, n);
2660
+ const i = li(r, n);
2497
2661
  return i ? "value" in i ? i.value : (
2498
2662
  // This is a very special case, if the prop is a getter defined by the
2499
2663
  // prototype, we should invoke it with the draft as context!
2500
2664
  (s = i.get) == null ? void 0 : s.call(t.draft_)
2501
2665
  ) : void 0;
2502
2666
  }
2503
- function ci(t, r) {
2667
+ function li(t, r) {
2504
2668
  if (!(r in t))
2505
2669
  return;
2506
- let n = xt(t);
2670
+ let n = Ct(t);
2507
2671
  for (; n; ) {
2508
2672
  const i = Object.getOwnPropertyDescriptor(n, r);
2509
2673
  if (i)
2510
2674
  return i;
2511
- n = xt(n);
2675
+ n = Ct(n);
2512
2676
  }
2513
2677
  }
2514
- function mn(t) {
2515
- t.modified_ || (t.modified_ = !0, t.parent_ && mn(t.parent_));
2678
+ function vn(t) {
2679
+ t.modified_ || (t.modified_ = !0, t.parent_ && vn(t.parent_));
2516
2680
  }
2517
2681
  function an(t) {
2518
- t.copy_ || (t.copy_ = pn(
2682
+ t.copy_ || (t.copy_ = bn(
2519
2683
  t.base_,
2520
2684
  t.scope_.immer_.useStrictShallowCopy_
2521
2685
  ));
2522
2686
  }
2523
- var ca = class {
2687
+ var ha = class {
2524
2688
  constructor(t) {
2525
2689
  this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (r, n, i) => {
2526
2690
  if (typeof r == "function" && typeof n != "function") {
2527
2691
  const c = n;
2528
2692
  n = r;
2529
- const f = this;
2530
- return function(x = c, ...F) {
2531
- return f.produce(x, (T) => n.call(this, T, ...F));
2693
+ const h = this;
2694
+ return function(P = c, ...F) {
2695
+ return h.produce(P, (E) => n.call(this, E, ...F));
2532
2696
  };
2533
2697
  }
2534
- typeof n != "function" && W(6), i !== void 0 && typeof i != "function" && W(7);
2698
+ typeof n != "function" && $(6), i !== void 0 && typeof i != "function" && $(7);
2535
2699
  let s;
2536
- if (vt(r)) {
2537
- const c = Nn(this), f = bn(r, void 0);
2538
- let h = !0;
2700
+ if (wt(r)) {
2701
+ const c = Hn(this), h = Sn(r, void 0);
2702
+ let m = !0;
2539
2703
  try {
2540
- s = n(f), h = !1;
2704
+ s = n(h), m = !1;
2541
2705
  } finally {
2542
- h ? hn(c) : yn(c);
2706
+ m ? _n(c) : In(c);
2543
2707
  }
2544
- return zn(c, i), Hn(s, c);
2708
+ return zn(c, i), Nn(s, c);
2545
2709
  } else if (!r || typeof r != "object") {
2546
- if (s = n(r), s === void 0 && (s = r), s === vn && (s = void 0), this.autoFreeze_ && In(s, !0), i) {
2547
- const c = [], f = [];
2548
- Ct("Patches").generateReplacementPatches_(r, s, c, f), i(c, f);
2710
+ if (s = n(r), s === void 0 && (s = r), s === Tn && (s = void 0), this.autoFreeze_ && En(s, !0), i) {
2711
+ const c = [], h = [];
2712
+ jt("Patches").generateReplacementPatches_(r, s, c, h), i(c, h);
2549
2713
  }
2550
2714
  return s;
2551
2715
  } else
2552
- W(1, r);
2716
+ $(1, r);
2553
2717
  }, this.produceWithPatches = (r, n) => {
2554
2718
  if (typeof r == "function")
2555
- return (f, ...h) => this.produceWithPatches(f, (x) => r(x, ...h));
2719
+ return (h, ...m) => this.produceWithPatches(h, (P) => r(P, ...m));
2556
2720
  let i, s;
2557
- return [this.produce(r, n, (f, h) => {
2558
- i = f, s = h;
2721
+ return [this.produce(r, n, (h, m) => {
2722
+ i = h, s = m;
2559
2723
  }), i, s];
2560
2724
  }, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
2561
2725
  }
2562
2726
  createDraft(t) {
2563
- vt(t) || W(8), Dt(t) && (t = ua(t));
2564
- const r = Nn(this), n = bn(t, void 0);
2565
- return n[tt].isManual_ = !0, yn(r), n;
2727
+ wt(t) || $(8), Rt(t) && (t = ma(t));
2728
+ const r = Hn(this), n = Sn(t, void 0);
2729
+ return n[nt].isManual_ = !0, In(r), n;
2566
2730
  }
2567
2731
  finishDraft(t, r) {
2568
- const n = t && t[tt];
2569
- (!n || !n.isManual_) && W(9);
2732
+ const n = t && t[nt];
2733
+ (!n || !n.isManual_) && $(9);
2570
2734
  const { scope_: i } = n;
2571
- return zn(i, r), Hn(void 0, i);
2735
+ return zn(i, r), Nn(void 0, i);
2572
2736
  }
2573
2737
  /**
2574
2738
  * Pass true to automatically freeze all copies created by Immer.
@@ -2596,242 +2760,242 @@ var ca = class {
2596
2760
  }
2597
2761
  }
2598
2762
  n > -1 && (r = r.slice(n + 1));
2599
- const i = Ct("Patches").applyPatches_;
2600
- return Dt(t) ? i(t, r) : this.produce(
2763
+ const i = jt("Patches").applyPatches_;
2764
+ return Rt(t) ? i(t, r) : this.produce(
2601
2765
  t,
2602
2766
  (s) => i(s, r)
2603
2767
  );
2604
2768
  }
2605
2769
  };
2606
- function bn(t, r) {
2607
- const n = ve(t) ? Ct("MapSet").proxyMap_(t, r) : Ie(t) ? Ct("MapSet").proxySet_(t, r) : sa(t, r);
2608
- return (r ? r.scope_ : oi()).drafts_.push(n), n;
2770
+ function Sn(t, r) {
2771
+ const n = Te(t) ? jt("MapSet").proxyMap_(t, r) : Ee(t) ? jt("MapSet").proxySet_(t, r) : da(t, r);
2772
+ return (r ? r.scope_ : ui()).drafts_.push(n), n;
2609
2773
  }
2610
- function ua(t) {
2611
- return Dt(t) || W(10, t), ui(t);
2774
+ function ma(t) {
2775
+ return Rt(t) || $(10, t), fi(t);
2612
2776
  }
2613
- function ui(t) {
2614
- if (!vt(t) || ir(t))
2777
+ function fi(t) {
2778
+ if (!wt(t) || cr(t))
2615
2779
  return t;
2616
- const r = t[tt];
2780
+ const r = t[nt];
2617
2781
  let n;
2618
2782
  if (r) {
2619
2783
  if (!r.modified_)
2620
2784
  return r.base_;
2621
- r.finalized_ = !0, n = pn(t, r.scope_.immer_.useStrictShallowCopy_);
2785
+ r.finalized_ = !0, n = bn(t, r.scope_.immer_.useStrictShallowCopy_);
2622
2786
  } else
2623
- n = pn(t, !0);
2624
- return he(n, (i, s) => {
2625
- si(n, i, ui(s));
2787
+ n = bn(t, !0);
2788
+ return _e(n, (i, s) => {
2789
+ ci(n, i, fi(s));
2626
2790
  }), r && (r.finalized_ = !1), n;
2627
2791
  }
2628
- function Ln() {
2629
- process.env.NODE_ENV !== "production" && ii.push(
2792
+ function Un() {
2793
+ process.env.NODE_ENV !== "production" && si.push(
2630
2794
  'Sets cannot have "replace" patches.',
2631
- function(g) {
2632
- return "Unsupported patch operation: " + g;
2795
+ function(b) {
2796
+ return "Unsupported patch operation: " + b;
2633
2797
  },
2634
- function(g) {
2635
- return "Cannot apply patch, path doesn't resolve: " + g;
2798
+ function(b) {
2799
+ return "Cannot apply patch, path doesn't resolve: " + b;
2636
2800
  },
2637
2801
  "Patching reserved attributes like __proto__, prototype and constructor is not allowed"
2638
2802
  );
2639
2803
  const r = "replace", n = "add", i = "remove";
2640
- function s(g, p, y, l) {
2641
- switch (g.type_) {
2804
+ function s(b, d, f, p) {
2805
+ switch (b.type_) {
2642
2806
  case 0:
2643
2807
  case 2:
2644
- return f(
2645
- g,
2646
- p,
2647
- y,
2648
- l
2808
+ return h(
2809
+ b,
2810
+ d,
2811
+ f,
2812
+ p
2649
2813
  );
2650
2814
  case 1:
2651
- return c(g, p, y, l);
2815
+ return c(b, d, f, p);
2652
2816
  case 3:
2653
- return h(
2654
- g,
2655
- p,
2656
- y,
2657
- l
2817
+ return m(
2818
+ b,
2819
+ d,
2820
+ f,
2821
+ p
2658
2822
  );
2659
2823
  }
2660
2824
  }
2661
- function c(g, p, y, l) {
2662
- let { base_: m, assigned_: S } = g, v = g.copy_;
2663
- v.length < m.length && ([m, v] = [v, m], [y, l] = [l, y]);
2664
- for (let b = 0; b < m.length; b++)
2665
- if (S[b] && v[b] !== m[b]) {
2666
- const d = p.concat([b]);
2667
- y.push({
2825
+ function c(b, d, f, p) {
2826
+ let { base_: g, assigned_: v } = b, _ = b.copy_;
2827
+ _.length < g.length && ([g, _] = [_, g], [f, p] = [p, f]);
2828
+ for (let y = 0; y < g.length; y++)
2829
+ if (v[y] && _[y] !== g[y]) {
2830
+ const l = d.concat([y]);
2831
+ f.push({
2668
2832
  op: r,
2669
- path: d,
2833
+ path: l,
2670
2834
  // Need to maybe clone it, as it can in fact be the original value
2671
2835
  // due to the base/copy inversion at the start of this function
2672
- value: H(v[b])
2673
- }), l.push({
2836
+ value: N(_[y])
2837
+ }), p.push({
2674
2838
  op: r,
2675
- path: d,
2676
- value: H(m[b])
2839
+ path: l,
2840
+ value: N(g[y])
2677
2841
  });
2678
2842
  }
2679
- for (let b = m.length; b < v.length; b++) {
2680
- const d = p.concat([b]);
2681
- y.push({
2843
+ for (let y = g.length; y < _.length; y++) {
2844
+ const l = d.concat([y]);
2845
+ f.push({
2682
2846
  op: n,
2683
- path: d,
2847
+ path: l,
2684
2848
  // Need to maybe clone it, as it can in fact be the original value
2685
2849
  // due to the base/copy inversion at the start of this function
2686
- value: H(v[b])
2850
+ value: N(_[y])
2687
2851
  });
2688
2852
  }
2689
- for (let b = v.length - 1; m.length <= b; --b) {
2690
- const d = p.concat([b]);
2691
- l.push({
2853
+ for (let y = _.length - 1; g.length <= y; --y) {
2854
+ const l = d.concat([y]);
2855
+ p.push({
2692
2856
  op: i,
2693
- path: d
2857
+ path: l
2694
2858
  });
2695
2859
  }
2696
2860
  }
2697
- function f(g, p, y, l) {
2698
- const { base_: m, copy_: S } = g;
2699
- he(g.assigned_, (v, b) => {
2700
- const d = rn(m, v), O = rn(S, v), E = b ? ye(m, v) ? r : n : i;
2701
- if (d === O && E === r)
2861
+ function h(b, d, f, p) {
2862
+ const { base_: g, copy_: v } = b;
2863
+ _e(b.assigned_, (_, y) => {
2864
+ const l = rn(g, _), x = rn(v, _), M = y ? Ie(g, _) ? r : n : i;
2865
+ if (l === x && M === r)
2702
2866
  return;
2703
- const _ = p.concat(v);
2704
- y.push(E === i ? { op: E, path: _ } : { op: E, path: _, value: O }), l.push(
2705
- E === n ? { op: i, path: _ } : E === i ? { op: n, path: _, value: H(d) } : { op: r, path: _, value: H(d) }
2867
+ const I = d.concat(_);
2868
+ f.push(M === i ? { op: M, path: I } : { op: M, path: I, value: x }), p.push(
2869
+ M === n ? { op: i, path: I } : M === i ? { op: n, path: I, value: N(l) } : { op: r, path: I, value: N(l) }
2706
2870
  );
2707
2871
  });
2708
2872
  }
2709
- function h(g, p, y, l) {
2710
- let { base_: m, copy_: S } = g, v = 0;
2711
- m.forEach((b) => {
2712
- if (!S.has(b)) {
2713
- const d = p.concat([v]);
2714
- y.push({
2873
+ function m(b, d, f, p) {
2874
+ let { base_: g, copy_: v } = b, _ = 0;
2875
+ g.forEach((y) => {
2876
+ if (!v.has(y)) {
2877
+ const l = d.concat([_]);
2878
+ f.push({
2715
2879
  op: i,
2716
- path: d,
2717
- value: b
2718
- }), l.unshift({
2880
+ path: l,
2881
+ value: y
2882
+ }), p.unshift({
2719
2883
  op: n,
2720
- path: d,
2721
- value: b
2884
+ path: l,
2885
+ value: y
2722
2886
  });
2723
2887
  }
2724
- v++;
2725
- }), v = 0, S.forEach((b) => {
2726
- if (!m.has(b)) {
2727
- const d = p.concat([v]);
2728
- y.push({
2888
+ _++;
2889
+ }), _ = 0, v.forEach((y) => {
2890
+ if (!g.has(y)) {
2891
+ const l = d.concat([_]);
2892
+ f.push({
2729
2893
  op: n,
2730
- path: d,
2731
- value: b
2732
- }), l.unshift({
2894
+ path: l,
2895
+ value: y
2896
+ }), p.unshift({
2733
2897
  op: i,
2734
- path: d,
2735
- value: b
2898
+ path: l,
2899
+ value: y
2736
2900
  });
2737
2901
  }
2738
- v++;
2902
+ _++;
2739
2903
  });
2740
2904
  }
2741
- function x(g, p, y, l) {
2742
- y.push({
2905
+ function P(b, d, f, p) {
2906
+ f.push({
2743
2907
  op: r,
2744
2908
  path: [],
2745
- value: p === vn ? void 0 : p
2746
- }), l.push({
2909
+ value: d === Tn ? void 0 : d
2910
+ }), p.push({
2747
2911
  op: r,
2748
2912
  path: [],
2749
- value: g
2913
+ value: b
2750
2914
  });
2751
2915
  }
2752
- function F(g, p) {
2753
- return p.forEach((y) => {
2754
- const { path: l, op: m } = y;
2755
- let S = g;
2756
- for (let O = 0; O < l.length - 1; O++) {
2757
- const E = Pt(S);
2758
- let _ = l[O];
2759
- typeof _ != "string" && typeof _ != "number" && (_ = "" + _), (E === 0 || E === 1) && (_ === "__proto__" || _ === "constructor") && W(19), typeof S == "function" && _ === "prototype" && W(19), S = rn(S, _), typeof S != "object" && W(18, l.join("/"));
2916
+ function F(b, d) {
2917
+ return d.forEach((f) => {
2918
+ const { path: p, op: g } = f;
2919
+ let v = b;
2920
+ for (let x = 0; x < p.length - 1; x++) {
2921
+ const M = Ft(v);
2922
+ let I = p[x];
2923
+ typeof I != "string" && typeof I != "number" && (I = "" + I), (M === 0 || M === 1) && (I === "__proto__" || I === "constructor") && $(19), typeof v == "function" && I === "prototype" && $(19), v = rn(v, I), typeof v != "object" && $(18, p.join("/"));
2760
2924
  }
2761
- const v = Pt(S), b = T(y.value), d = l[l.length - 1];
2762
- switch (m) {
2925
+ const _ = Ft(v), y = E(f.value), l = p[p.length - 1];
2926
+ switch (g) {
2763
2927
  case r:
2764
- switch (v) {
2928
+ switch (_) {
2765
2929
  case 2:
2766
- return S.set(d, b);
2930
+ return v.set(l, y);
2767
2931
  case 3:
2768
- W(16);
2932
+ $(16);
2769
2933
  default:
2770
- return S[d] = b;
2934
+ return v[l] = y;
2771
2935
  }
2772
2936
  case n:
2773
- switch (v) {
2937
+ switch (_) {
2774
2938
  case 1:
2775
- return d === "-" ? S.push(b) : S.splice(d, 0, b);
2939
+ return l === "-" ? v.push(y) : v.splice(l, 0, y);
2776
2940
  case 2:
2777
- return S.set(d, b);
2941
+ return v.set(l, y);
2778
2942
  case 3:
2779
- return S.add(b);
2943
+ return v.add(y);
2780
2944
  default:
2781
- return S[d] = b;
2945
+ return v[l] = y;
2782
2946
  }
2783
2947
  case i:
2784
- switch (v) {
2948
+ switch (_) {
2785
2949
  case 1:
2786
- return S.splice(d, 1);
2950
+ return v.splice(l, 1);
2787
2951
  case 2:
2788
- return S.delete(d);
2952
+ return v.delete(l);
2789
2953
  case 3:
2790
- return S.delete(y.value);
2954
+ return v.delete(f.value);
2791
2955
  default:
2792
- return delete S[d];
2956
+ return delete v[l];
2793
2957
  }
2794
2958
  default:
2795
- W(17, m);
2959
+ $(17, g);
2796
2960
  }
2797
- }), g;
2798
- }
2799
- function T(g) {
2800
- if (!vt(g))
2801
- return g;
2802
- if (Array.isArray(g))
2803
- return g.map(T);
2804
- if (ve(g))
2961
+ }), b;
2962
+ }
2963
+ function E(b) {
2964
+ if (!wt(b))
2965
+ return b;
2966
+ if (Array.isArray(b))
2967
+ return b.map(E);
2968
+ if (Te(b))
2805
2969
  return new Map(
2806
- Array.from(g.entries()).map(([y, l]) => [y, T(l)])
2970
+ Array.from(b.entries()).map(([f, p]) => [f, E(p)])
2807
2971
  );
2808
- if (Ie(g))
2809
- return new Set(Array.from(g).map(T));
2810
- const p = Object.create(xt(g));
2811
- for (const y in g)
2812
- p[y] = T(g[y]);
2813
- return ye(g, de) && (p[de] = g[de]), p;
2972
+ if (Ee(b))
2973
+ return new Set(Array.from(b).map(E));
2974
+ const d = Object.create(Ct(b));
2975
+ for (const f in b)
2976
+ d[f] = E(b[f]);
2977
+ return Ie(b, ge) && (d[ge] = b[ge]), d;
2814
2978
  }
2815
- function H(g) {
2816
- return Dt(g) ? T(g) : g;
2979
+ function N(b) {
2980
+ return Rt(b) ? E(b) : b;
2817
2981
  }
2818
- na("Patches", {
2982
+ ua("Patches", {
2819
2983
  applyPatches_: F,
2820
2984
  generatePatches_: s,
2821
- generateReplacementPatches_: x
2985
+ generateReplacementPatches_: P
2822
2986
  });
2823
2987
  }
2824
- var et = new ca(), la = et.produce;
2825
- et.produceWithPatches.bind(
2826
- et
2988
+ var it = new ha(), ya = it.produce;
2989
+ it.produceWithPatches.bind(
2990
+ it
2827
2991
  );
2828
- et.setAutoFreeze.bind(et);
2829
- et.setUseStrictShallowCopy.bind(et);
2830
- var fa = et.applyPatches.bind(et);
2831
- et.createDraft.bind(et);
2832
- et.finishDraft.bind(et);
2833
- var pa = 1 / 0, da = 9007199254740991, ha = "[object Arguments]", ya = "[object Function]", ma = "[object GeneratorFunction]", ba = "[object Symbol]", ga = typeof it == "object" && it && it.Object === Object && it, _a = typeof self == "object" && self && self.Object === Object && self, va = ga || _a || Function("return this")();
2834
- function Ia(t, r, n) {
2992
+ it.setAutoFreeze.bind(it);
2993
+ it.setUseStrictShallowCopy.bind(it);
2994
+ var ba = it.applyPatches.bind(it);
2995
+ it.createDraft.bind(it);
2996
+ it.finishDraft.bind(it);
2997
+ var ga = 1 / 0, _a = 9007199254740991, Ia = "[object Arguments]", va = "[object Function]", Sa = "[object GeneratorFunction]", wa = "[object Symbol]", ka = typeof st == "object" && st && st.Object === Object && st, Ta = typeof self == "object" && self && self.Object === Object && self, Ea = ka || Ta || Function("return this")();
2998
+ function Ma(t, r, n) {
2835
2999
  switch (n.length) {
2836
3000
  case 0:
2837
3001
  return t.call(r);
@@ -2844,91 +3008,91 @@ function Ia(t, r, n) {
2844
3008
  }
2845
3009
  return t.apply(r, n);
2846
3010
  }
2847
- function Sa(t, r) {
3011
+ function Aa(t, r) {
2848
3012
  for (var n = -1, i = t ? t.length : 0, s = Array(i); ++n < i; )
2849
3013
  s[n] = r(t[n], n, t);
2850
3014
  return s;
2851
3015
  }
2852
- function wa(t, r) {
3016
+ function Oa(t, r) {
2853
3017
  for (var n = -1, i = r.length, s = t.length; ++n < i; )
2854
3018
  t[s + n] = r[n];
2855
3019
  return t;
2856
3020
  }
2857
- var wn = Object.prototype, ka = wn.hasOwnProperty, kn = wn.toString, Gn = va.Symbol, Ta = wn.propertyIsEnumerable, Wn = Gn ? Gn.isConcatSpreadable : void 0, Bn = Math.max;
2858
- function Ea(t, r, n, i, s) {
2859
- var c = -1, f = t.length;
2860
- for (n || (n = xa), s || (s = []); ++c < f; ) {
2861
- var h = t[c];
2862
- n(h) ? wa(s, h) : s[s.length] = h;
3021
+ var An = Object.prototype, xa = An.hasOwnProperty, On = An.toString, Wn = Ea.Symbol, Da = An.propertyIsEnumerable, Gn = Wn ? Wn.isConcatSpreadable : void 0, Bn = Math.max;
3022
+ function Pa(t, r, n, i, s) {
3023
+ var c = -1, h = t.length;
3024
+ for (n || (n = ja), s || (s = []); ++c < h; ) {
3025
+ var m = t[c];
3026
+ n(m) ? Oa(s, m) : s[s.length] = m;
2863
3027
  }
2864
3028
  return s;
2865
3029
  }
2866
- function Aa(t, r) {
2867
- return t = Object(t), Ma(t, r, function(n, i) {
3030
+ function Ca(t, r) {
3031
+ return t = Object(t), Ra(t, r, function(n, i) {
2868
3032
  return i in t;
2869
3033
  });
2870
3034
  }
2871
- function Ma(t, r, n) {
3035
+ function Ra(t, r, n) {
2872
3036
  for (var i = -1, s = r.length, c = {}; ++i < s; ) {
2873
- var f = r[i], h = t[f];
2874
- n(h, f) && (c[f] = h);
3037
+ var h = r[i], m = t[h];
3038
+ n(m, h) && (c[h] = m);
2875
3039
  }
2876
3040
  return c;
2877
3041
  }
2878
- function Oa(t, r) {
3042
+ function Fa(t, r) {
2879
3043
  return r = Bn(r === void 0 ? t.length - 1 : r, 0), function() {
2880
3044
  for (var n = arguments, i = -1, s = Bn(n.length - r, 0), c = Array(s); ++i < s; )
2881
3045
  c[i] = n[r + i];
2882
3046
  i = -1;
2883
- for (var f = Array(r + 1); ++i < r; )
2884
- f[i] = n[i];
2885
- return f[r] = c, Ia(t, this, f);
3047
+ for (var h = Array(r + 1); ++i < r; )
3048
+ h[i] = n[i];
3049
+ return h[r] = c, Ma(t, this, h);
2886
3050
  };
2887
3051
  }
2888
- function xa(t) {
2889
- return Ca(t) || Pa(t) || !!(Wn && t && t[Wn]);
3052
+ function ja(t) {
3053
+ return Na(t) || Ha(t) || !!(Gn && t && t[Gn]);
2890
3054
  }
2891
- function Da(t) {
2892
- if (typeof t == "string" || Ha(t))
3055
+ function za(t) {
3056
+ if (typeof t == "string" || $a(t))
2893
3057
  return t;
2894
3058
  var r = t + "";
2895
- return r == "0" && 1 / t == -pa ? "-0" : r;
3059
+ return r == "0" && 1 / t == -ga ? "-0" : r;
2896
3060
  }
2897
- function Pa(t) {
2898
- return Ra(t) && ka.call(t, "callee") && (!Ta.call(t, "callee") || kn.call(t) == ha);
3061
+ function Ha(t) {
3062
+ return Ua(t) && xa.call(t, "callee") && (!Da.call(t, "callee") || On.call(t) == Ia);
2899
3063
  }
2900
- var Ca = Array.isArray;
2901
- function ja(t) {
2902
- return t != null && za(t.length) && !Fa(t);
3064
+ var Na = Array.isArray;
3065
+ function La(t) {
3066
+ return t != null && Ga(t.length) && !Wa(t);
2903
3067
  }
2904
- function Ra(t) {
2905
- return li(t) && ja(t);
3068
+ function Ua(t) {
3069
+ return di(t) && La(t);
2906
3070
  }
2907
- function Fa(t) {
2908
- var r = Na(t) ? kn.call(t) : "";
2909
- return r == ya || r == ma;
3071
+ function Wa(t) {
3072
+ var r = Ba(t) ? On.call(t) : "";
3073
+ return r == va || r == Sa;
2910
3074
  }
2911
- function za(t) {
2912
- return typeof t == "number" && t > -1 && t % 1 == 0 && t <= da;
3075
+ function Ga(t) {
3076
+ return typeof t == "number" && t > -1 && t % 1 == 0 && t <= _a;
2913
3077
  }
2914
- function Na(t) {
3078
+ function Ba(t) {
2915
3079
  var r = typeof t;
2916
3080
  return !!t && (r == "object" || r == "function");
2917
3081
  }
2918
- function li(t) {
3082
+ function di(t) {
2919
3083
  return !!t && typeof t == "object";
2920
3084
  }
2921
- function Ha(t) {
2922
- return typeof t == "symbol" || li(t) && kn.call(t) == ba;
3085
+ function $a(t) {
3086
+ return typeof t == "symbol" || di(t) && On.call(t) == wa;
2923
3087
  }
2924
- var Ua = Oa(function(t, r) {
2925
- return t == null ? {} : Aa(t, Sa(Ea(r), Da));
2926
- }), La = Ua;
2927
- const $n = /* @__PURE__ */ gn(La), Ga = {
3088
+ var Ka = Fa(function(t, r) {
3089
+ return t == null ? {} : Ca(t, Aa(Pa(r), za));
3090
+ }), Ya = Ka;
3091
+ const $n = /* @__PURE__ */ wn(Ya), Va = {
2928
3092
  width: 1080,
2929
3093
  height: 1920
2930
- }, Wa = {
2931
- size: Ga,
3094
+ }, Xa = {
3095
+ size: Va,
2932
3096
  tracks: [],
2933
3097
  trackItemIds: [],
2934
3098
  trackItemsMap: {},
@@ -2951,22 +3115,22 @@ const $n = /* @__PURE__ */ gn(La), Ga = {
2951
3115
  "transitionsMap",
2952
3116
  "trackItemIds"
2953
3117
  ];
2954
- class Ka {
3118
+ class Za {
2955
3119
  constructor(r) {
2956
- Mt(this, "stateSubject");
2957
- Mt(this, "stateHistorySubject");
2958
- Mt(this, "prevState");
2959
- Mt(this, "undos", []);
2960
- Mt(this, "redos", []);
2961
- Mt(this, "listener");
2962
- const n = r || Wa;
2963
- this.stateSubject = new Dn(n), this.stateHistorySubject = new Dn({
3120
+ Dt(this, "stateSubject");
3121
+ Dt(this, "stateHistorySubject");
3122
+ Dt(this, "prevState");
3123
+ Dt(this, "undos", []);
3124
+ Dt(this, "redos", []);
3125
+ Dt(this, "listener");
3126
+ const n = r || Xa;
3127
+ this.stateSubject = new jn(n), this.stateHistorySubject = new jn({
2964
3128
  handleRedo: !1,
2965
3129
  handleUndo: !1
2966
3130
  }), this.prevState = n, this.initListeners();
2967
3131
  }
2968
3132
  initListeners() {
2969
- Zi(this);
3133
+ ia(this);
2970
3134
  }
2971
3135
  destroyListeners() {
2972
3136
  this.listener && this.listener.unsubscribe();
@@ -2975,7 +3139,7 @@ class Ka {
2975
3139
  this.destroyListeners();
2976
3140
  }
2977
3141
  updateHistory(r, n) {
2978
- const i = $n(r, Kn), s = $n(this.getState(), Kn), c = ni(s, i);
3142
+ const i = $n(r, Kn), s = $n(this.getState(), Kn), c = ai(s, i);
2979
3143
  c.length && (this.undos.push({ undos: c, type: n }), this.redos = []);
2980
3144
  }
2981
3145
  getStateHistory() {
@@ -2998,28 +3162,28 @@ class Ka {
2998
3162
  ...i,
2999
3163
  ...r
3000
3164
  };
3001
- nt(i, s) || (n.updateHistory && this.updateHistory(s, n.kind), this.prevState = i, this.stateSubject.next(s));
3165
+ rt(i, s) || (n.updateHistory && this.updateHistory(s, n.kind), this.prevState = i, this.stateSubject.next(s));
3002
3166
  }
3003
3167
  // emit changes for design size
3004
3168
  subscribeToSize(r) {
3005
3169
  return this.stateSubject.asObservable().subscribe((n) => {
3006
- nt(n.size, this.prevState.size) || r({ size: n.size });
3170
+ rt(n.size, this.prevState.size) || r({ size: n.size });
3007
3171
  });
3008
3172
  }
3009
3173
  // Selectively subscribe to scale changes
3010
3174
  subscribeToScale(r) {
3011
3175
  return this.stateSubject.asObservable().subscribe((n) => {
3012
- nt(n.scale, this.prevState.scale) || r({ scale: n.scale });
3176
+ rt(n.scale, this.prevState.scale) || r({ scale: n.scale });
3013
3177
  });
3014
3178
  }
3015
3179
  subscribeToUpdateTrackItem(r) {
3016
3180
  return this.stateSubject.asObservable().subscribe((n) => {
3017
- nt(n.trackItemsMap, this.prevState.trackItemsMap) || r({ trackItemsMap: n.trackItemsMap });
3181
+ rt(n.trackItemsMap, this.prevState.trackItemsMap) || r({ trackItemsMap: n.trackItemsMap });
3018
3182
  });
3019
3183
  }
3020
3184
  subscribeToUpdateItemDetails(r) {
3021
3185
  return this.stateSubject.asObservable().subscribe((n) => {
3022
- nt(n.trackItemDetailsMap, this.prevState.trackItemDetailsMap) || r({ trackItemDetailsMap: n.trackItemDetailsMap });
3186
+ rt(n.trackItemDetailsMap, this.prevState.trackItemDetailsMap) || r({ trackItemDetailsMap: n.trackItemDetailsMap });
3023
3187
  });
3024
3188
  }
3025
3189
  // Selectively subscribe to duration changes
@@ -3042,19 +3206,19 @@ class Ka {
3042
3206
  }
3043
3207
  subscribeToAddOrRemoveItems(r) {
3044
3208
  return this.stateSubject.asObservable().subscribe((n) => {
3045
- nt(n.trackItemIds, this.prevState.trackItemIds) || r({ trackItemIds: n.trackItemIds });
3209
+ rt(n.trackItemIds, this.prevState.trackItemIds) || r({ trackItemIds: n.trackItemIds });
3046
3210
  });
3047
3211
  }
3048
3212
  // Selectively subscribe to activeIds changes
3049
3213
  subscribeToActiveIds(r) {
3050
3214
  return this.stateSubject.asObservable().subscribe((n) => {
3051
- nt(n.activeIds, this.prevState.activeIds) || r({ activeIds: n.activeIds });
3215
+ rt(n.activeIds, this.prevState.activeIds) || r({ activeIds: n.activeIds });
3052
3216
  });
3053
3217
  }
3054
3218
  // Selectively subscribe to multiple track-related properties
3055
3219
  subscribeToTracks(r) {
3056
3220
  return this.stateSubject.asObservable().subscribe((n) => {
3057
- (!nt(n.tracks, this.prevState.tracks) || !nt(n.trackItemIds, this.prevState.trackItemIds) || !nt(n.trackItemsMap, this.prevState.trackItemsMap) || !nt(n.transitionIds, this.prevState.transitionIds) || !nt(n.transitionsMap, this.prevState.transitionsMap)) && r({
3221
+ (!rt(n.tracks, this.prevState.tracks) || !rt(n.trackItemIds, this.prevState.trackItemIds) || !rt(n.trackItemsMap, this.prevState.trackItemsMap) || !rt(n.transitionIds, this.prevState.transitionIds) || !rt(n.transitionsMap, this.prevState.transitionsMap) || !rt(n.trackItemDetailsMap, this.prevState.trackItemDetailsMap)) && r({
3058
3222
  tracks: n.tracks,
3059
3223
  trackItemIds: n.trackItemIds,
3060
3224
  trackItemsMap: n.trackItemsMap,
@@ -3067,141 +3231,141 @@ class Ka {
3067
3231
  undo() {
3068
3232
  const r = this.undos.pop(), n = r == null ? void 0 : r.undos, i = r == null ? void 0 : r.type;
3069
3233
  if (!n || !i) return;
3070
- Ln();
3234
+ Un();
3071
3235
  const {
3072
3236
  trackItemDetailsMap: s,
3073
3237
  trackItemIds: c,
3074
- tracks: f,
3075
- transitionIds: h,
3076
- transitionsMap: x,
3238
+ tracks: h,
3239
+ transitionIds: m,
3240
+ transitionsMap: P,
3077
3241
  trackItemsMap: F
3078
- } = this.getState(), T = X({
3242
+ } = this.getState(), E = B({
3079
3243
  trackItemDetailsMap: s,
3080
3244
  trackItemIds: c,
3081
- tracks: f,
3082
- transitionIds: h,
3083
- transitionsMap: x,
3245
+ tracks: h,
3246
+ transitionIds: m,
3247
+ transitionsMap: P,
3084
3248
  trackItemsMap: F
3085
- }), H = [], g = [], p = [], y = [], l = [], m = [];
3249
+ }), N = [], b = [], d = [], f = [], p = [], g = [];
3086
3250
  n.forEach((k) => {
3087
- let A;
3088
- const U = k.path.slice(1);
3089
- k.type === "CREATE" ? A = {
3090
- path: U,
3251
+ let S;
3252
+ const A = k.path.slice(1);
3253
+ k.type === "CREATE" ? S = {
3254
+ path: A,
3091
3255
  op: "remove",
3092
3256
  value: k.value
3093
- } : k.type === "CHANGE" ? A = {
3094
- path: U,
3257
+ } : k.type === "CHANGE" ? S = {
3258
+ path: A,
3095
3259
  op: "replace",
3096
3260
  value: k.oldValue
3097
- } : A = {
3098
- path: U,
3261
+ } : S = {
3262
+ path: A,
3099
3263
  op: "add",
3100
3264
  value: k.oldValue
3101
- }, k.path.includes("trackItemIds") ? p.push(A) : k.path.includes("transitionIds") ? g.push(A) : k.path.includes("trackItemsMap") ? l.push(A) : k.path.includes("transitionsMap") ? y.push(A) : k.path.includes("tracks") ? H.push(A) : k.path.includes("trackItemDetailsMap") && m.push(A);
3265
+ }, k.path.includes("trackItemIds") ? d.push(S) : k.path.includes("transitionIds") ? b.push(S) : k.path.includes("trackItemsMap") ? p.push(S) : k.path.includes("transitionsMap") ? f.push(S) : k.path.includes("tracks") ? N.push(S) : k.path.includes("trackItemDetailsMap") && g.push(S);
3102
3266
  });
3103
- const S = this.applyPatch(
3104
- T.tracks,
3105
- H
3106
- ), v = this.applyPatch(
3107
- T.transitionIds,
3108
- g
3109
- ), b = this.applyPatch(
3110
- T.trackItemIds,
3267
+ const v = this.applyPatch(
3268
+ E.tracks,
3269
+ N
3270
+ ), _ = this.applyPatch(
3271
+ E.transitionIds,
3272
+ b
3273
+ ), y = this.applyPatch(
3274
+ E.trackItemIds,
3275
+ d
3276
+ ), l = this.applyPatch(
3277
+ E.transitionsMap,
3278
+ f
3279
+ ), x = this.applyPatch(
3280
+ E.trackItemsMap,
3111
3281
  p
3112
- ), d = this.applyPatch(
3113
- T.transitionsMap,
3114
- y
3115
- ), O = this.applyPatch(
3116
- T.trackItemsMap,
3117
- l
3118
- ), E = this.applyPatch(
3119
- T.trackItemDetailsMap,
3120
- m
3121
- ), _ = X({
3122
- tracks: S,
3123
- transitionIds: v,
3124
- trackItemIds: b,
3125
- transitionsMap: d,
3126
- trackItemsMap: O,
3127
- trackItemDetailsMap: E
3128
- }), D = X(this.getState()), I = { ...D, ..._ };
3129
- this.prevState = D, this.redos.push({ redos: n, type: i });
3130
- const P = Yt(I.trackItemsMap);
3131
- this.stateSubject.next({ ...I, duration: P }), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 });
3282
+ ), M = this.applyPatch(
3283
+ E.trackItemDetailsMap,
3284
+ g
3285
+ ), I = B({
3286
+ tracks: v,
3287
+ transitionIds: _,
3288
+ trackItemIds: y,
3289
+ transitionsMap: l,
3290
+ trackItemsMap: x,
3291
+ trackItemDetailsMap: M
3292
+ }), C = B(this.getState()), w = { ...C, ...I };
3293
+ this.prevState = C, this.redos.push({ redos: n, type: i });
3294
+ const D = qt(w.trackItemsMap);
3295
+ this.stateSubject.next({ ...w, duration: D }), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 });
3132
3296
  }
3133
3297
  applyPatch(r, n) {
3134
- return n.reverse().reduce((i, s) => la(i, (c) => {
3135
- fa(c, [s]);
3298
+ return n.reverse().reduce((i, s) => ya(i, (c) => {
3299
+ ba(c, [s]);
3136
3300
  }), r);
3137
3301
  }
3138
3302
  redo() {
3139
3303
  const r = this.redos.pop(), n = r == null ? void 0 : r.redos, i = r == null ? void 0 : r.type;
3140
3304
  if (!n || !i) return;
3141
- Ln();
3305
+ Un();
3142
3306
  const {
3143
3307
  trackItemDetailsMap: s,
3144
3308
  trackItemIds: c,
3145
- tracks: f,
3146
- transitionIds: h,
3147
- transitionsMap: x,
3309
+ tracks: h,
3310
+ transitionIds: m,
3311
+ transitionsMap: P,
3148
3312
  trackItemsMap: F
3149
- } = this.getState(), T = X({
3313
+ } = this.getState(), E = B({
3150
3314
  trackItemDetailsMap: s,
3151
3315
  trackItemIds: c,
3152
- tracks: f,
3153
- transitionIds: h,
3154
- transitionsMap: x,
3316
+ tracks: h,
3317
+ transitionIds: m,
3318
+ transitionsMap: P,
3155
3319
  trackItemsMap: F
3156
- }), H = [], g = [], p = [], y = [], l = [], m = [];
3320
+ }), N = [], b = [], d = [], f = [], p = [], g = [];
3157
3321
  n.forEach((k) => {
3158
- let A;
3159
- const U = k.path.slice(1);
3160
- k.type === "CREATE" ? A = {
3161
- path: U,
3322
+ let S;
3323
+ const A = k.path.slice(1);
3324
+ k.type === "CREATE" ? S = {
3325
+ path: A,
3162
3326
  op: "add",
3163
3327
  value: k.value
3164
- } : k.type === "CHANGE" ? A = {
3165
- path: U,
3328
+ } : k.type === "CHANGE" ? S = {
3329
+ path: A,
3166
3330
  op: "replace",
3167
3331
  value: k.value
3168
- } : A = {
3169
- path: U,
3332
+ } : S = {
3333
+ path: A,
3170
3334
  op: "remove",
3171
3335
  value: k.oldValue
3172
- }, k.path.includes("trackItemIds") ? p.push(A) : k.path.includes("transitionIds") ? g.push(A) : k.path.includes("trackItemsMap") ? l.push(A) : k.path.includes("transitionsMap") ? y.push(A) : k.path.includes("trackItemDetailsMap") ? m.push(A) : H.push(A);
3336
+ }, k.path.includes("trackItemIds") ? d.push(S) : k.path.includes("transitionIds") ? b.push(S) : k.path.includes("trackItemsMap") ? p.push(S) : k.path.includes("transitionsMap") ? f.push(S) : k.path.includes("trackItemDetailsMap") ? g.push(S) : N.push(S);
3173
3337
  });
3174
- const S = this.applyPatch(
3175
- T.tracks,
3176
- H
3177
- ), v = this.applyPatch(
3178
- T.transitionIds,
3179
- g
3180
- ), b = this.applyPatch(
3181
- T.trackItemIds,
3338
+ const v = this.applyPatch(
3339
+ E.tracks,
3340
+ N
3341
+ ), _ = this.applyPatch(
3342
+ E.transitionIds,
3343
+ b
3344
+ ), y = this.applyPatch(
3345
+ E.trackItemIds,
3346
+ d
3347
+ ), l = this.applyPatch(
3348
+ E.transitionsMap,
3349
+ f
3350
+ ), x = this.applyPatch(
3351
+ E.trackItemsMap,
3182
3352
  p
3183
- ), d = this.applyPatch(
3184
- T.transitionsMap,
3185
- y
3186
- ), O = this.applyPatch(
3187
- T.trackItemsMap,
3188
- l
3189
- ), E = this.applyPatch(
3190
- T.trackItemDetailsMap,
3191
- m
3192
- ), _ = X({
3193
- tracks: S,
3194
- transitionIds: v,
3195
- trackItemIds: b,
3196
- transitionsMap: d,
3197
- trackItemsMap: O,
3198
- trackItemDetailsMap: E
3199
- }), D = X(this.getState()), I = { ...D, ..._ };
3200
- this.prevState = D, this.undos.push({ undos: n, type: i });
3201
- const P = Yt(I.trackItemsMap);
3202
- this.stateSubject.next({ ...I, duration: P }), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 });
3353
+ ), M = this.applyPatch(
3354
+ E.trackItemDetailsMap,
3355
+ g
3356
+ ), I = B({
3357
+ tracks: v,
3358
+ transitionIds: _,
3359
+ trackItemIds: y,
3360
+ transitionsMap: l,
3361
+ trackItemsMap: x,
3362
+ trackItemDetailsMap: M
3363
+ }), C = B(this.getState()), w = { ...C, ...I };
3364
+ this.prevState = C, this.undos.push({ undos: n, type: i });
3365
+ const D = qt(w.trackItemsMap);
3366
+ this.stateSubject.next({ ...w, duration: D }), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 });
3203
3367
  }
3204
3368
  }
3205
3369
  export {
3206
- Ka as default
3370
+ Za as default
3207
3371
  };