@metapages/metapage 1.10.8 → 1.10.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ var Us = { exports: {} };
57
57
  retryOn: []
58
58
  };
59
59
  return r = Object.assign(a, r), function(l, c) {
60
- var f = r.retries, p = r.retryDelay, g = r.retryOn;
60
+ var f = r.retries, h = r.retryDelay, p = r.retryOn;
61
61
  if (c && c.retries !== void 0)
62
62
  if (n(c.retries))
63
63
  f = c.retries;
@@ -65,52 +65,52 @@ var Us = { exports: {} };
65
65
  throw new i("retries must be a positive integer");
66
66
  if (c && c.retryDelay !== void 0)
67
67
  if (n(c.retryDelay) || typeof c.retryDelay == "function")
68
- p = c.retryDelay;
68
+ h = c.retryDelay;
69
69
  else
70
70
  throw new i("retryDelay must be a positive integer or a function returning a positive integer");
71
71
  if (c && c.retryOn)
72
72
  if (Array.isArray(c.retryOn) || typeof c.retryOn == "function")
73
- g = c.retryOn;
73
+ p = c.retryOn;
74
74
  else
75
75
  throw new i("retryOn property expects an array or function");
76
- return new Promise(function(y, b) {
77
- var _ = function(v) {
78
- var E = typeof Request < "u" && l instanceof Request ? l.clone() : l;
79
- o(E, c).then(function(P) {
80
- if (Array.isArray(g) && g.indexOf(P.status) === -1)
81
- y(P);
82
- else if (typeof g == "function")
76
+ return new Promise(function(d, b) {
77
+ var w = function(S) {
78
+ var O = typeof Request < "u" && l instanceof Request ? l.clone() : l;
79
+ o(O, c).then(function($) {
80
+ if (Array.isArray(p) && p.indexOf($.status) === -1)
81
+ d($);
82
+ else if (typeof p == "function")
83
83
  try {
84
- return Promise.resolve(g(v, null, P)).then(function(O) {
85
- O ? M(v, null, P) : y(P);
84
+ return Promise.resolve(p(S, null, $)).then(function(E) {
85
+ E ? A(S, null, $) : d($);
86
86
  }).catch(b);
87
- } catch (O) {
88
- b(O);
87
+ } catch (E) {
88
+ b(E);
89
89
  }
90
90
  else
91
- v < f ? M(v, null, P) : y(P);
92
- }).catch(function(P) {
93
- if (typeof g == "function")
91
+ S < f ? A(S, null, $) : d($);
92
+ }).catch(function($) {
93
+ if (typeof p == "function")
94
94
  try {
95
- Promise.resolve(g(v, P, null)).then(function(O) {
96
- O ? M(v, P, null) : b(P);
97
- }).catch(function(O) {
98
- b(O);
95
+ Promise.resolve(p(S, $, null)).then(function(E) {
96
+ E ? A(S, $, null) : b($);
97
+ }).catch(function(E) {
98
+ b(E);
99
99
  });
100
- } catch (O) {
101
- b(O);
100
+ } catch (E) {
101
+ b(E);
102
102
  }
103
103
  else
104
- v < f ? M(v, P, null) : b(P);
104
+ S < f ? A(S, $, null) : b($);
105
105
  });
106
106
  };
107
- function M(v, E, P) {
108
- var O = typeof p == "function" ? p(v, E, P) : p;
107
+ function A(S, O, $) {
108
+ var E = typeof h == "function" ? h(S, O, $) : h;
109
109
  setTimeout(function() {
110
- _(++v);
111
- }, O);
110
+ w(++S);
111
+ }, E);
112
112
  }
113
- _(0);
113
+ w(0);
114
114
  });
115
115
  };
116
116
  };
@@ -157,14 +157,14 @@ function et(t) {
157
157
  return (e = t.copy) !== null && e !== void 0 ? e : t.original;
158
158
  }
159
159
  function Rt(t) {
160
- return !!j(t);
160
+ return !!D(t);
161
161
  }
162
- function j(t) {
162
+ function D(t) {
163
163
  return typeof t != "object" ? null : t == null ? void 0 : t[Hs];
164
164
  }
165
165
  function Ye(t) {
166
166
  var e;
167
- const s = j(t);
167
+ const s = D(t);
168
168
  return s ? (e = s.copy) !== null && e !== void 0 ? e : s.original : t;
169
169
  }
170
170
  function ut(t, e) {
@@ -175,7 +175,7 @@ function ut(t, e) {
175
175
  }
176
176
  function Ns(t, e = []) {
177
177
  if (Object.hasOwnProperty.call(t, "key")) {
178
- const s = t.parent.copy, n = j(bt(s, t.key));
178
+ const s = t.parent.copy, n = D(bt(s, t.key));
179
179
  if (n !== null && (n == null ? void 0 : n.original) !== t.original)
180
180
  return null;
181
181
  const i = t.parent.type === 3, o = i ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
@@ -203,7 +203,7 @@ function Qt(t, e, s) {
203
203
  xt(t) === 2 ? t.set(e, s) : t[e] = s;
204
204
  }
205
205
  function Me(t, e) {
206
- const s = j(t);
206
+ const s = D(t);
207
207
  return (s ? et(s) : t)[e];
208
208
  }
209
209
  function gt(t, e) {
@@ -388,7 +388,7 @@ function Bs(t, e, s) {
388
388
  if (e.add(t), qe(t, (o, r) => {
389
389
  var a;
390
390
  if (Rt(r)) {
391
- const u = j(r);
391
+ const u = D(r);
392
392
  q(u);
393
393
  const l = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
394
394
  Qt(n ? i : t, o, l);
@@ -420,7 +420,7 @@ function Le(t, e, s, n) {
420
420
  }
421
421
  }
422
422
  function Ze(t, e, s, n) {
423
- const i = j(s);
423
+ const i = D(s);
424
424
  i && (i.callbacks || (i.callbacks = []), i.callbacks.push((o, r) => {
425
425
  var a;
426
426
  const u = t.type === 3 ? t.setMap : t.copy;
@@ -471,10 +471,10 @@ function jn(t, e, s, n, i) {
471
471
  });
472
472
  } else
473
473
  for (let c = u.length; o.length < c; c -= 1) {
474
- const f = e.concat([c - 1]), p = Ct(f, i);
474
+ const f = e.concat([c - 1]), h = Ct(f, i);
475
475
  n.push({
476
476
  op: J.Remove,
477
- path: p
477
+ path: h
478
478
  });
479
479
  }
480
480
  }
@@ -484,8 +484,8 @@ function Tn({ original: t, copy: e, assignedMap: s }, n, i, o, r) {
484
484
  const l = bt(t, u), c = re(bt(e, u)), f = a ? Bt(t, u) ? J.Replace : J.Add : J.Remove;
485
485
  if (gt(l, c) && f === J.Replace)
486
486
  return;
487
- const p = n.concat(u), g = Ct(p, r);
488
- i.push(f === J.Remove ? { op: f, path: g } : { op: f, path: g, value: c }), o.push(f === J.Add ? { op: J.Remove, path: g } : f === J.Remove ? { op: J.Add, path: g, value: l } : { op: J.Replace, path: g, value: l });
487
+ const h = n.concat(u), p = Ct(h, r);
488
+ i.push(f === J.Remove ? { op: f, path: p } : { op: f, path: p, value: c }), o.push(f === J.Add ? { op: J.Remove, path: p } : f === J.Remove ? { op: J.Add, path: p, value: l } : { op: J.Replace, path: p, value: l });
489
489
  });
490
490
  }
491
491
  function Ln({ original: t, copy: e }, s, n, i, o) {
@@ -538,23 +538,23 @@ const ce = (t, e, s = !1) => {
538
538
  throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
539
539
  }, ke = {
540
540
  get size() {
541
- return et(j(this)).size;
541
+ return et(D(this)).size;
542
542
  },
543
543
  has(t) {
544
- return et(j(this)).has(t);
544
+ return et(D(this)).has(t);
545
545
  },
546
546
  set(t, e) {
547
- const s = j(this), n = et(s);
547
+ const s = D(this), n = et(s);
548
548
  return (!n.has(t) || !gt(n.get(t), e)) && (q(s), ht(s), s.assignedMap.set(t, !0), s.copy.set(t, e), Ze(s, t, e, Wt)), this;
549
549
  },
550
550
  delete(t) {
551
551
  if (!this.has(t))
552
552
  return !1;
553
- const e = j(this);
553
+ const e = D(this);
554
554
  return q(e), ht(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
555
555
  },
556
556
  clear() {
557
- const t = j(this);
557
+ const t = D(this);
558
558
  if (this.size) {
559
559
  q(t), ht(t), t.assignedMap = /* @__PURE__ */ new Map();
560
560
  for (const [e] of t.original)
@@ -563,14 +563,14 @@ const ce = (t, e, s = !1) => {
563
563
  }
564
564
  },
565
565
  forEach(t, e) {
566
- const s = j(this);
566
+ const s = D(this);
567
567
  et(s).forEach((n, i) => {
568
568
  t.call(e, this.get(i), i, this);
569
569
  });
570
570
  },
571
571
  get(t) {
572
572
  var e, s;
573
- const n = j(this), i = et(n).get(t), o = ((s = (e = n.options).mark) === null || s === void 0 ? void 0 : s.call(e, i, nt)) === nt.mutable;
573
+ const n = D(this), i = et(n).get(t), o = ((s = (e = n.options).mark) === null || s === void 0 ? void 0 : s.call(e, i, nt)) === nt.mutable;
574
574
  if (n.options.strict && ce(i, n.options, o), o || n.finalized || !ut(i, n.options) || i !== n.original.get(t))
575
575
  return i;
576
576
  const r = Qe.createDraft({
@@ -583,7 +583,7 @@ const ce = (t, e, s = !1) => {
583
583
  return q(n), n.copy.set(t, r), r;
584
584
  },
585
585
  keys() {
586
- return et(j(this)).keys();
586
+ return et(D(this)).keys();
587
587
  },
588
588
  values() {
589
589
  const t = this.keys();
@@ -624,7 +624,7 @@ const ce = (t, e, s = !1) => {
624
624
  return o;
625
625
  const r = o.value;
626
626
  let a = t.setMap.get(r);
627
- const u = j(a), l = ((i = (n = t.options).mark) === null || i === void 0 ? void 0 : i.call(n, a, nt)) === nt.mutable;
627
+ const u = D(a), l = ((i = (n = t.options).mark) === null || i === void 0 ? void 0 : i.call(n, a, nt)) === nt.mutable;
628
628
  if (t.options.strict && ce(r, t.options, l), !l && !u && ut(r, t.options) && !t.finalized && t.original.has(r)) {
629
629
  const c = Qe.createDraft({
630
630
  original: r,
@@ -642,39 +642,39 @@ const ce = (t, e, s = !1) => {
642
642
  };
643
643
  }, le = {
644
644
  get size() {
645
- return j(this).setMap.size;
645
+ return D(this).setMap.size;
646
646
  },
647
647
  has(t) {
648
- const e = j(this);
648
+ const e = D(this);
649
649
  if (e.setMap.has(t))
650
650
  return !0;
651
651
  q(e);
652
- const s = j(t);
652
+ const s = D(t);
653
653
  return !!(s && e.setMap.has(s.original));
654
654
  },
655
655
  add(t) {
656
- const e = j(this);
656
+ const e = D(this);
657
657
  return this.has(t) || (q(e), ht(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), Ze(e, t, t, Wt)), this;
658
658
  },
659
659
  delete(t) {
660
660
  if (!this.has(t))
661
661
  return !1;
662
- const e = j(this);
662
+ const e = D(this);
663
663
  q(e), ht(e);
664
- const s = j(t);
664
+ const s = D(t);
665
665
  return s && e.setMap.has(s.original) ? (e.assignedMap.set(s.original, !1), e.setMap.delete(s.original)) : (!s && e.setMap.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.setMap.delete(t));
666
666
  },
667
667
  clear() {
668
668
  if (!this.size)
669
669
  return;
670
- const t = j(this);
670
+ const t = D(this);
671
671
  q(t), ht(t);
672
672
  for (const e of t.original)
673
673
  t.assignedMap.set(e, !1);
674
674
  t.setMap.clear();
675
675
  },
676
676
  values() {
677
- const t = j(this);
677
+ const t = D(this);
678
678
  q(t);
679
679
  const e = t.setMap.keys();
680
680
  return {
@@ -683,7 +683,7 @@ const ce = (t, e, s = !1) => {
683
683
  };
684
684
  },
685
685
  entries() {
686
- const t = j(this);
686
+ const t = D(this);
687
687
  q(t);
688
688
  const e = t.setMap.keys();
689
689
  return {
@@ -766,7 +766,7 @@ const Hn = Reflect.ownKeys(le), zs = {
766
766
  finalities: t.finalities,
767
767
  options: t.options
768
768
  }), typeof r == "function") {
769
- const l = j(t.copy[e]);
769
+ const l = D(t.copy[e]);
770
770
  return q(l), ht(l), l.copy;
771
771
  }
772
772
  return t.copy[e];
@@ -783,7 +783,7 @@ const Hn = Reflect.ownKeys(le), zs = {
783
783
  const o = Ss(et(t), e);
784
784
  if (o != null && o.set)
785
785
  return o.set.call(t.proxy, s), !0;
786
- const r = Me(et(t), e), a = j(r);
786
+ const r = Me(et(t), e), a = D(r);
787
787
  return a && gt(a.original, s) ? (t.copy[e] = s, t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (gt(s, r) && (s !== void 0 || Bt(t.original, e)) || (q(t), ht(t), Bt(t.original, e) && gt(s, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = s, Ze(t, e, s, Wt)), !0);
788
788
  },
789
789
  has(t, e) {
@@ -832,23 +832,23 @@ function ts(t) {
832
832
  const { proxy: u, revoke: l } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, zs);
833
833
  if (i.revoke.push(l), a.proxy = u, s) {
834
834
  const c = s;
835
- c.finalities.draft.push((f, p) => {
836
- var g, y;
837
- const b = j(u);
838
- let _ = c.type === 3 ? c.setMap : c.copy;
839
- const M = bt(_, n), v = j(M);
840
- if (v) {
841
- let E = v.original;
842
- v.operated && (E = Ye(M)), Te(v), Le(v, Wt, f, p), c.options.enableAutoFreeze && (c.options.updatedValues = (g = c.options.updatedValues) !== null && g !== void 0 ? g : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(E, v.original)), Qt(_, n, E);
835
+ c.finalities.draft.push((f, h) => {
836
+ var p, d;
837
+ const b = D(u);
838
+ let w = c.type === 3 ? c.setMap : c.copy;
839
+ const A = bt(w, n), S = D(A);
840
+ if (S) {
841
+ let O = S.original;
842
+ S.operated && (O = Ye(A)), Te(S), Le(S, Wt, f, h), c.options.enableAutoFreeze && (c.options.updatedValues = (p = c.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(O, S.original)), Qt(w, n, O);
843
843
  }
844
- (y = b.callbacks) === null || y === void 0 || y.forEach((E) => {
845
- E(f, p);
844
+ (d = b.callbacks) === null || d === void 0 || d.forEach((O) => {
845
+ O(f, h);
846
846
  });
847
847
  });
848
848
  } else {
849
- const c = j(u);
850
- c.finalities.draft.push((f, p) => {
851
- Te(c), Le(c, Wt, f, p);
849
+ const c = D(u);
850
+ c.finalities.draft.push((f, h) => {
851
+ Te(c), Le(c, Wt, f, h);
852
852
  });
853
853
  }
854
854
  return u;
@@ -856,7 +856,7 @@ function ts(t) {
856
856
  Qe.createDraft = ts;
857
857
  function Nn(t, e, s, n, i) {
858
858
  var o;
859
- const r = j(t), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : t, u = !!e.length;
859
+ const r = D(t), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : t, u = !!e.length;
860
860
  if (r != null && r.operated)
861
861
  for (; r.finalities.draft.length > 0; )
862
862
  r.finalities.draft.pop()(s, n);
@@ -894,7 +894,7 @@ function Fn(t, e) {
894
894
  function Ue(t) {
895
895
  const { rootDraft: e, value: s, useRawReturn: n = !1, isRoot: i = !0 } = t;
896
896
  qe(s, (o, r, a) => {
897
- const u = j(r);
897
+ const u = D(r);
898
898
  if (u && e && u.finalities === e.finalities) {
899
899
  t.isContainDraft = !0;
900
900
  const l = u.original;
@@ -909,7 +909,7 @@ function Ue(t) {
909
909
  }
910
910
  function Vs(t) {
911
911
  var e;
912
- const s = j(t);
912
+ const s = D(t);
913
913
  if (!ut(t, s == null ? void 0 : s.options))
914
914
  return t;
915
915
  const n = xt(t);
@@ -950,72 +950,72 @@ const Bn = (t) => {
950
950
  return function e(s, n, i) {
951
951
  var o, r, a;
952
952
  if (typeof s == "function" && typeof n != "function")
953
- return function(O, ...$) {
954
- return e(O, (T) => s.call(this, T, ...$), n);
953
+ return function(E, ...j) {
954
+ return e(E, (T) => s.call(this, T, ...j), n);
955
955
  };
956
956
  const u = s, l = n;
957
957
  let c = i;
958
958
  if (typeof n != "function" && (c = n), c !== void 0 && Object.prototype.toString.call(c) !== "[object Object]")
959
959
  throw new Error(`Invalid options: ${c}, 'options' should be an object.`);
960
960
  c = Object.assign(Object.assign({}, t), c);
961
- const f = Rt(u) ? Es(u) : u, p = Array.isArray(c.mark) ? (O, $) => {
961
+ const f = Rt(u) ? Es(u) : u, h = Array.isArray(c.mark) ? (E, j) => {
962
962
  for (const T of c.mark) {
963
963
  if (typeof T != "function")
964
964
  throw new Error(`Invalid mark: ${T}, 'mark' should be a function.`);
965
- const w = T(O, $);
966
- if (w)
967
- return w;
965
+ const _ = T(E, j);
966
+ if (_)
967
+ return _;
968
968
  }
969
- } : c.mark, g = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, y = (r = c.strict) !== null && r !== void 0 ? r : !1, _ = {
969
+ } : c.mark, p = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, d = (r = c.strict) !== null && r !== void 0 ? r : !1, w = {
970
970
  enableAutoFreeze: (a = c.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
971
- mark: p,
972
- strict: y,
973
- enablePatches: g
971
+ mark: h,
972
+ strict: d,
973
+ enablePatches: p
974
974
  };
975
- if (!ut(f, _) && typeof f == "object" && f !== null)
975
+ if (!ut(f, w) && typeof f == "object" && f !== null)
976
976
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
977
- const [M, v] = Fn(f, _);
977
+ const [A, S] = Fn(f, w);
978
978
  if (typeof n != "function") {
979
- if (!ut(f, _))
979
+ if (!ut(f, w))
980
980
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
981
- return [M, v];
981
+ return [A, S];
982
982
  }
983
- let E;
983
+ let O;
984
984
  try {
985
- E = l(M);
986
- } catch (O) {
987
- throw je(j(M)), O;
985
+ O = l(A);
986
+ } catch (E) {
987
+ throw je(D(A)), E;
988
988
  }
989
- const P = (O) => {
990
- const $ = j(M);
991
- if (!Rt(O)) {
992
- if (O !== void 0 && !gt(O, M) && ($ != null && $.operated))
989
+ const $ = (E) => {
990
+ const j = D(A);
991
+ if (!Rt(E)) {
992
+ if (E !== void 0 && !gt(E, A) && (j != null && j.operated))
993
993
  throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
994
- const w = O == null ? void 0 : O[Cn];
995
- if (w) {
996
- const A = w[0];
997
- return _.strict && typeof O == "object" && O !== null && Ue({
998
- rootDraft: $,
999
- value: O,
994
+ const _ = E == null ? void 0 : E[Cn];
995
+ if (_) {
996
+ const M = _[0];
997
+ return w.strict && typeof E == "object" && E !== null && Ue({
998
+ rootDraft: j,
999
+ value: E,
1000
1000
  useRawReturn: !0
1001
- }), v([A]);
1001
+ }), S([M]);
1002
1002
  }
1003
- if (O !== void 0)
1004
- return typeof O == "object" && O !== null && Ue({ rootDraft: $, value: O }), v([O]);
1003
+ if (E !== void 0)
1004
+ return typeof E == "object" && E !== null && Ue({ rootDraft: j, value: E }), S([E]);
1005
1005
  }
1006
- if (O === M || O === void 0)
1007
- return v([]);
1008
- const T = j(O);
1009
- if (_ === T.options) {
1006
+ if (E === A || E === void 0)
1007
+ return S([]);
1008
+ const T = D(E);
1009
+ if (w === T.options) {
1010
1010
  if (T.operated)
1011
1011
  throw new Error("Cannot return a modified child draft.");
1012
- return v([Es(O)]);
1012
+ return S([Es(E)]);
1013
1013
  }
1014
- return v([O]);
1014
+ return S([E]);
1015
1015
  };
1016
- return E instanceof Promise ? E.then(P, (O) => {
1017
- throw je(j(M)), O;
1018
- }) : P(E);
1016
+ return O instanceof Promise ? O.then($, (E) => {
1017
+ throw je(D(A)), E;
1018
+ }) : $(O);
1019
1019
  };
1020
1020
  }, C = Bn();
1021
1021
  Object.prototype.constructor.toString();
@@ -1596,10 +1596,10 @@ function bi(t, e, s, n, i) {
1596
1596
  });
1597
1597
  } else
1598
1598
  for (let c = u.length; o.length < c; c -= 1) {
1599
- const f = e.concat([c - 1]), p = $t(f, i);
1599
+ const f = e.concat([c - 1]), h = $t(f, i);
1600
1600
  n.push({
1601
1601
  op: K.Remove,
1602
- path: p
1602
+ path: h
1603
1603
  });
1604
1604
  }
1605
1605
  }
@@ -1609,8 +1609,8 @@ function _i({ original: t, copy: e, assignedMap: s }, n, i, o, r) {
1609
1609
  const l = Et(t, u), c = ae(Et(e, u)), f = a ? zt(t, u) ? K.Replace : K.Add : K.Remove;
1610
1610
  if (Pt(l, c) && f === K.Replace)
1611
1611
  return;
1612
- const p = n.concat(u), g = $t(p, r);
1613
- i.push(f === K.Remove ? { op: f, path: g } : { op: f, path: g, value: c }), o.push(f === K.Add ? { op: K.Remove, path: g } : f === K.Remove ? { op: K.Add, path: g, value: l } : { op: K.Replace, path: g, value: l });
1612
+ const h = n.concat(u), p = $t(h, r);
1613
+ i.push(f === K.Remove ? { op: f, path: p } : { op: f, path: p, value: c }), o.push(f === K.Add ? { op: K.Remove, path: p } : f === K.Remove ? { op: K.Add, path: p, value: l } : { op: K.Replace, path: p, value: l });
1614
1614
  });
1615
1615
  }
1616
1616
  function wi({ original: t, copy: e }, s, n, i, o) {
@@ -1957,23 +1957,23 @@ function en(t) {
1957
1957
  const { proxy: u, revoke: l } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, tn);
1958
1958
  if (i.revoke.push(l), a.proxy = u, s) {
1959
1959
  const c = s;
1960
- c.finalities.draft.push((f, p) => {
1961
- var g, y;
1960
+ c.finalities.draft.push((f, h) => {
1961
+ var p, d;
1962
1962
  const b = k(u);
1963
- let _ = c.type === 3 ? c.setMap : c.copy;
1964
- const M = Et(_, n), v = k(M);
1965
- if (v) {
1966
- let E = v.original;
1967
- v.operated && (E = ss(M)), Ne(v), Fe(v, Jt, f, p), c.options.enableAutoFreeze && (c.options.updatedValues = (g = c.options.updatedValues) !== null && g !== void 0 ? g : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(E, v.original)), ns(_, n, E);
1963
+ let w = c.type === 3 ? c.setMap : c.copy;
1964
+ const A = Et(w, n), S = k(A);
1965
+ if (S) {
1966
+ let O = S.original;
1967
+ S.operated && (O = ss(A)), Ne(S), Fe(S, Jt, f, h), c.options.enableAutoFreeze && (c.options.updatedValues = (p = c.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(O, S.original)), ns(w, n, O);
1968
1968
  }
1969
- (y = b.callbacks) === null || y === void 0 || y.forEach((E) => {
1970
- E(f, p);
1969
+ (d = b.callbacks) === null || d === void 0 || d.forEach((O) => {
1970
+ O(f, h);
1971
1971
  });
1972
1972
  });
1973
1973
  } else {
1974
1974
  const c = k(u);
1975
- c.finalities.draft.push((f, p) => {
1976
- Ne(c), Fe(c, Jt, f, p);
1975
+ c.finalities.draft.push((f, h) => {
1976
+ Ne(c), Fe(c, Jt, f, h);
1977
1977
  });
1978
1978
  }
1979
1979
  return u;
@@ -2209,11 +2209,11 @@ var nn = { exports: {} };
2209
2209
  function i(u, l, c) {
2210
2210
  this.fn = u, this.context = l, this.once = c || !1;
2211
2211
  }
2212
- function o(u, l, c, f, p) {
2212
+ function o(u, l, c, f, h) {
2213
2213
  if (typeof c != "function")
2214
2214
  throw new TypeError("The listener must be a function");
2215
- var g = new i(c, f || u, p), y = s ? s + l : l;
2216
- return u._events[y] ? u._events[y].fn ? u._events[y] = [u._events[y], g] : u._events[y].push(g) : (u._events[y] = g, u._eventsCount++), u;
2215
+ var p = new i(c, f || u, h), d = s ? s + l : l;
2216
+ return u._events[d] ? u._events[d].fn ? u._events[d] = [u._events[d], p] : u._events[d].push(p) : (u._events[d] = p, u._eventsCount++), u;
2217
2217
  }
2218
2218
  function r(u, l) {
2219
2219
  --u._eventsCount === 0 ? u._events = new n() : delete u._events[l];
@@ -2234,56 +2234,56 @@ var nn = { exports: {} };
2234
2234
  return [];
2235
2235
  if (f.fn)
2236
2236
  return [f.fn];
2237
- for (var p = 0, g = f.length, y = new Array(g); p < g; p++)
2238
- y[p] = f[p].fn;
2239
- return y;
2237
+ for (var h = 0, p = f.length, d = new Array(p); h < p; h++)
2238
+ d[h] = f[h].fn;
2239
+ return d;
2240
2240
  }, a.prototype.listenerCount = function(l) {
2241
2241
  var c = s ? s + l : l, f = this._events[c];
2242
2242
  return f ? f.fn ? 1 : f.length : 0;
2243
- }, a.prototype.emit = function(l, c, f, p, g, y) {
2243
+ }, a.prototype.emit = function(l, c, f, h, p, d) {
2244
2244
  var b = s ? s + l : l;
2245
2245
  if (!this._events[b])
2246
2246
  return !1;
2247
- var _ = this._events[b], M = arguments.length, v, E;
2248
- if (_.fn) {
2249
- switch (_.once && this.removeListener(l, _.fn, void 0, !0), M) {
2247
+ var w = this._events[b], A = arguments.length, S, O;
2248
+ if (w.fn) {
2249
+ switch (w.once && this.removeListener(l, w.fn, void 0, !0), A) {
2250
2250
  case 1:
2251
- return _.fn.call(_.context), !0;
2251
+ return w.fn.call(w.context), !0;
2252
2252
  case 2:
2253
- return _.fn.call(_.context, c), !0;
2253
+ return w.fn.call(w.context, c), !0;
2254
2254
  case 3:
2255
- return _.fn.call(_.context, c, f), !0;
2255
+ return w.fn.call(w.context, c, f), !0;
2256
2256
  case 4:
2257
- return _.fn.call(_.context, c, f, p), !0;
2257
+ return w.fn.call(w.context, c, f, h), !0;
2258
2258
  case 5:
2259
- return _.fn.call(_.context, c, f, p, g), !0;
2259
+ return w.fn.call(w.context, c, f, h, p), !0;
2260
2260
  case 6:
2261
- return _.fn.call(_.context, c, f, p, g, y), !0;
2261
+ return w.fn.call(w.context, c, f, h, p, d), !0;
2262
2262
  }
2263
- for (E = 1, v = new Array(M - 1); E < M; E++)
2264
- v[E - 1] = arguments[E];
2265
- _.fn.apply(_.context, v);
2263
+ for (O = 1, S = new Array(A - 1); O < A; O++)
2264
+ S[O - 1] = arguments[O];
2265
+ w.fn.apply(w.context, S);
2266
2266
  } else {
2267
- var P = _.length, O;
2268
- for (E = 0; E < P; E++)
2269
- switch (_[E].once && this.removeListener(l, _[E].fn, void 0, !0), M) {
2267
+ var $ = w.length, E;
2268
+ for (O = 0; O < $; O++)
2269
+ switch (w[O].once && this.removeListener(l, w[O].fn, void 0, !0), A) {
2270
2270
  case 1:
2271
- _[E].fn.call(_[E].context);
2271
+ w[O].fn.call(w[O].context);
2272
2272
  break;
2273
2273
  case 2:
2274
- _[E].fn.call(_[E].context, c);
2274
+ w[O].fn.call(w[O].context, c);
2275
2275
  break;
2276
2276
  case 3:
2277
- _[E].fn.call(_[E].context, c, f);
2277
+ w[O].fn.call(w[O].context, c, f);
2278
2278
  break;
2279
2279
  case 4:
2280
- _[E].fn.call(_[E].context, c, f, p);
2280
+ w[O].fn.call(w[O].context, c, f, h);
2281
2281
  break;
2282
2282
  default:
2283
- if (!v)
2284
- for (O = 1, v = new Array(M - 1); O < M; O++)
2285
- v[O - 1] = arguments[O];
2286
- _[E].fn.apply(_[E].context, v);
2283
+ if (!S)
2284
+ for (E = 1, S = new Array(A - 1); E < A; E++)
2285
+ S[E - 1] = arguments[E];
2286
+ w[O].fn.apply(w[O].context, S);
2287
2287
  }
2288
2288
  }
2289
2289
  return !0;
@@ -2291,19 +2291,19 @@ var nn = { exports: {} };
2291
2291
  return o(this, l, c, f, !1);
2292
2292
  }, a.prototype.once = function(l, c, f) {
2293
2293
  return o(this, l, c, f, !0);
2294
- }, a.prototype.removeListener = function(l, c, f, p) {
2295
- var g = s ? s + l : l;
2296
- if (!this._events[g])
2294
+ }, a.prototype.removeListener = function(l, c, f, h) {
2295
+ var p = s ? s + l : l;
2296
+ if (!this._events[p])
2297
2297
  return this;
2298
2298
  if (!c)
2299
- return r(this, g), this;
2300
- var y = this._events[g];
2301
- if (y.fn)
2302
- y.fn === c && (!p || y.once) && (!f || y.context === f) && r(this, g);
2299
+ return r(this, p), this;
2300
+ var d = this._events[p];
2301
+ if (d.fn)
2302
+ d.fn === c && (!h || d.once) && (!f || d.context === f) && r(this, p);
2303
2303
  else {
2304
- for (var b = 0, _ = [], M = y.length; b < M; b++)
2305
- (y[b].fn !== c || p && !y[b].once || f && y[b].context !== f) && _.push(y[b]);
2306
- _.length ? this._events[g] = _.length === 1 ? _[0] : _ : r(this, g);
2304
+ for (var b = 0, w = [], A = d.length; b < A; b++)
2305
+ (d[b].fn !== c || h && !d[b].once || f && d[b].context !== f) && w.push(d[b]);
2306
+ w.length ? this._events[p] = w.length === 1 ? w[0] : w : r(this, p);
2307
2307
  }
2308
2308
  return this;
2309
2309
  }, a.prototype.removeAllListeners = function(l) {
@@ -2346,8 +2346,8 @@ var Hi = function(t, e) {
2346
2346
  }
2347
2347
  var l = i.push(r) - 1, c = Object.keys(r).sort(n && n(r));
2348
2348
  for (u = "", a = 0; a < c.length; a++) {
2349
- var f = c[a], p = o(r[f]);
2350
- p && (u && (u += ","), u += JSON.stringify(f) + ":" + p);
2349
+ var f = c[a], h = o(r[f]);
2350
+ h && (u && (u += ","), u += JSON.stringify(f) + ":" + h);
2351
2351
  }
2352
2352
  return i.splice(l, 1), "{" + u + "}";
2353
2353
  }
@@ -2488,8 +2488,8 @@ var ir = function(t, e) {
2488
2488
  }
2489
2489
  var l = i.push(r) - 1, c = Object.keys(r).sort(n && n(r));
2490
2490
  for (u = "", a = 0; a < c.length; a++) {
2491
- var f = c[a], p = o(r[f]);
2492
- p && (u && (u += ","), u += JSON.stringify(f) + ":" + p);
2491
+ var f = c[a], h = o(r[f]);
2492
+ h && (u && (u += ","), u += JSON.stringify(f) + ":" + h);
2493
2493
  }
2494
2494
  return i.splice(l, 1), "{" + u + "}";
2495
2495
  }
@@ -3031,37 +3031,37 @@ const xs = Se, {
3031
3031
  t.isPrefix !== !0 && (t.depth = t.isGlobstar ? 1 / 0 : 1);
3032
3032
  }, Ir = (t, e) => {
3033
3033
  const s = e || {}, n = t.length - 1, i = s.parts === !0 || s.scanToEnd === !0, o = [], r = [], a = [];
3034
- let u = t, l = -1, c = 0, f = 0, p = !1, g = !1, y = !1, b = !1, _ = !1, M = !1, v = !1, E = !1, P = !1, O = !1, $ = 0, T, w, A = { value: "", depth: 0, isGlob: !1 };
3035
- const h = () => l >= n, L = () => u.charCodeAt(l + 1), V = () => (T = w, u.charCodeAt(++l));
3034
+ let u = t, l = -1, c = 0, f = 0, h = !1, p = !1, d = !1, b = !1, w = !1, A = !1, S = !1, O = !1, $ = !1, E = !1, j = 0, T, _, M = { value: "", depth: 0, isGlob: !1 };
3035
+ const y = () => l >= n, L = () => u.charCodeAt(l + 1), V = () => (T = _, u.charCodeAt(++l));
3036
3036
  for (; l < n; ) {
3037
- w = V();
3037
+ _ = V();
3038
3038
  let U;
3039
- if (w === Ft) {
3040
- v = A.backslashes = !0, w = V(), w === xe && (M = !0);
3039
+ if (_ === Ft) {
3040
+ S = M.backslashes = !0, _ = V(), _ === xe && (A = !0);
3041
3041
  continue;
3042
3042
  }
3043
- if (M === !0 || w === xe) {
3044
- for ($++; h() !== !0 && (w = V()); ) {
3045
- if (w === Ft) {
3046
- v = A.backslashes = !0, V();
3043
+ if (A === !0 || _ === xe) {
3044
+ for (j++; y() !== !0 && (_ = V()); ) {
3045
+ if (_ === Ft) {
3046
+ S = M.backslashes = !0, V();
3047
3047
  continue;
3048
3048
  }
3049
- if (w === xe) {
3050
- $++;
3049
+ if (_ === xe) {
3050
+ j++;
3051
3051
  continue;
3052
3052
  }
3053
- if (M !== !0 && w === $e && (w = V()) === $e) {
3054
- if (p = A.isBrace = !0, y = A.isGlob = !0, O = !0, i === !0)
3053
+ if (A !== !0 && _ === $e && (_ = V()) === $e) {
3054
+ if (h = M.isBrace = !0, d = M.isGlob = !0, E = !0, i === !0)
3055
3055
  continue;
3056
3056
  break;
3057
3057
  }
3058
- if (M !== !0 && w === Or) {
3059
- if (p = A.isBrace = !0, y = A.isGlob = !0, O = !0, i === !0)
3058
+ if (A !== !0 && _ === Or) {
3059
+ if (h = M.isBrace = !0, d = M.isGlob = !0, E = !0, i === !0)
3060
3060
  continue;
3061
3061
  break;
3062
3062
  }
3063
- if (w === Mr && ($--, $ === 0)) {
3064
- M = !1, p = A.isBrace = !0, O = !0;
3063
+ if (_ === Mr && (j--, j === 0)) {
3064
+ A = !1, h = M.isBrace = !0, E = !0;
3065
3065
  break;
3066
3066
  }
3067
3067
  }
@@ -3069,8 +3069,8 @@ const xs = Se, {
3069
3069
  continue;
3070
3070
  break;
3071
3071
  }
3072
- if (w === gn) {
3073
- if (o.push(l), r.push(A), A = { value: "", depth: 0, isGlob: !1 }, O === !0)
3072
+ if (_ === gn) {
3073
+ if (o.push(l), r.push(M), M = { value: "", depth: 0, isGlob: !1 }, E === !0)
3074
3074
  continue;
3075
3075
  if (T === $e && l === c + 1) {
3076
3076
  c += 2;
@@ -3079,15 +3079,15 @@ const xs = Se, {
3079
3079
  f = l + 1;
3080
3080
  continue;
3081
3081
  }
3082
- if (s.noext !== !0 && (w === Er || w === Sr || w === Ce || w === Ds || w === Pe) === !0 && L() === De) {
3083
- if (y = A.isGlob = !0, b = A.isExtglob = !0, O = !0, w === Pe && l === c && (P = !0), i === !0) {
3084
- for (; h() !== !0 && (w = V()); ) {
3085
- if (w === Ft) {
3086
- v = A.backslashes = !0, w = V();
3082
+ if (s.noext !== !0 && (_ === Er || _ === Sr || _ === Ce || _ === Ds || _ === Pe) === !0 && L() === De) {
3083
+ if (d = M.isGlob = !0, b = M.isExtglob = !0, E = !0, _ === Pe && l === c && ($ = !0), i === !0) {
3084
+ for (; y() !== !0 && (_ = V()); ) {
3085
+ if (_ === Ft) {
3086
+ S = M.backslashes = !0, _ = V();
3087
3087
  continue;
3088
3088
  }
3089
- if (w === js) {
3090
- y = A.isGlob = !0, O = !0;
3089
+ if (_ === js) {
3090
+ d = M.isGlob = !0, E = !0;
3091
3091
  break;
3092
3092
  }
3093
3093
  }
@@ -3095,24 +3095,24 @@ const xs = Se, {
3095
3095
  }
3096
3096
  break;
3097
3097
  }
3098
- if (w === Ce) {
3099
- if (T === Ce && (_ = A.isGlobstar = !0), y = A.isGlob = !0, O = !0, i === !0)
3098
+ if (_ === Ce) {
3099
+ if (T === Ce && (w = M.isGlobstar = !0), d = M.isGlob = !0, E = !0, i === !0)
3100
3100
  continue;
3101
3101
  break;
3102
3102
  }
3103
- if (w === Ds) {
3104
- if (y = A.isGlob = !0, O = !0, i === !0)
3103
+ if (_ === Ds) {
3104
+ if (d = M.isGlob = !0, E = !0, i === !0)
3105
3105
  continue;
3106
3106
  break;
3107
3107
  }
3108
- if (w === Rr) {
3109
- for (; h() !== !0 && (U = V()); ) {
3108
+ if (_ === Rr) {
3109
+ for (; y() !== !0 && (U = V()); ) {
3110
3110
  if (U === Ft) {
3111
- v = A.backslashes = !0, V();
3111
+ S = M.backslashes = !0, V();
3112
3112
  continue;
3113
3113
  }
3114
3114
  if (U === Ar) {
3115
- g = A.isBracket = !0, y = A.isGlob = !0, O = !0;
3115
+ p = M.isBracket = !0, d = M.isGlob = !0, E = !0;
3116
3116
  break;
3117
3117
  }
3118
3118
  }
@@ -3120,19 +3120,19 @@ const xs = Se, {
3120
3120
  continue;
3121
3121
  break;
3122
3122
  }
3123
- if (s.nonegate !== !0 && w === Pe && l === c) {
3124
- E = A.negated = !0, c++;
3123
+ if (s.nonegate !== !0 && _ === Pe && l === c) {
3124
+ O = M.negated = !0, c++;
3125
3125
  continue;
3126
3126
  }
3127
- if (s.noparen !== !0 && w === De) {
3128
- if (y = A.isGlob = !0, i === !0) {
3129
- for (; h() !== !0 && (w = V()); ) {
3130
- if (w === De) {
3131
- v = A.backslashes = !0, w = V();
3127
+ if (s.noparen !== !0 && _ === De) {
3128
+ if (d = M.isGlob = !0, i === !0) {
3129
+ for (; y() !== !0 && (_ = V()); ) {
3130
+ if (_ === De) {
3131
+ S = M.backslashes = !0, _ = V();
3132
3132
  continue;
3133
3133
  }
3134
- if (w === js) {
3135
- O = !0;
3134
+ if (_ === js) {
3135
+ E = !0;
3136
3136
  break;
3137
3137
  }
3138
3138
  }
@@ -3140,34 +3140,34 @@ const xs = Se, {
3140
3140
  }
3141
3141
  break;
3142
3142
  }
3143
- if (y === !0) {
3144
- if (O = !0, i === !0)
3143
+ if (d === !0) {
3144
+ if (E = !0, i === !0)
3145
3145
  continue;
3146
3146
  break;
3147
3147
  }
3148
3148
  }
3149
- s.noext === !0 && (b = !1, y = !1);
3150
- let H = u, d = "", m = "";
3151
- c > 0 && (d = u.slice(0, c), u = u.slice(c), f -= c), H && y === !0 && f > 0 ? (H = u.slice(0, f), m = u.slice(f)) : y === !0 ? (H = "", m = u) : H = u, H && H !== "" && H !== "/" && H !== u && Ts(H.charCodeAt(H.length - 1)) && (H = H.slice(0, -1)), s.unescape === !0 && (m && (m = xs.removeBackslashes(m)), H && v === !0 && (H = xs.removeBackslashes(H)));
3149
+ s.noext === !0 && (b = !1, d = !1);
3150
+ let H = u, m = "", g = "";
3151
+ c > 0 && (m = u.slice(0, c), u = u.slice(c), f -= c), H && d === !0 && f > 0 ? (H = u.slice(0, f), g = u.slice(f)) : d === !0 ? (H = "", g = u) : H = u, H && H !== "" && H !== "/" && H !== u && Ts(H.charCodeAt(H.length - 1)) && (H = H.slice(0, -1)), s.unescape === !0 && (g && (g = xs.removeBackslashes(g)), H && S === !0 && (H = xs.removeBackslashes(H)));
3152
3152
  const it = {
3153
- prefix: d,
3153
+ prefix: m,
3154
3154
  input: t,
3155
3155
  start: c,
3156
3156
  base: H,
3157
- glob: m,
3158
- isBrace: p,
3159
- isBracket: g,
3160
- isGlob: y,
3157
+ glob: g,
3158
+ isBrace: h,
3159
+ isBracket: p,
3160
+ isGlob: d,
3161
3161
  isExtglob: b,
3162
- isGlobstar: _,
3163
- negated: E,
3164
- negatedExtglob: P
3162
+ isGlobstar: w,
3163
+ negated: O,
3164
+ negatedExtglob: $
3165
3165
  };
3166
- if (s.tokens === !0 && (it.maxDepth = 0, Ts(w) || r.push(A), it.tokens = r), s.parts === !0 || s.tokens === !0) {
3166
+ if (s.tokens === !0 && (it.maxDepth = 0, Ts(_) || r.push(M), it.tokens = r), s.parts === !0 || s.tokens === !0) {
3167
3167
  let U;
3168
3168
  for (let F = 0; F < o.length; F++) {
3169
3169
  const yt = U ? U + 1 : c, rt = o[F], _t = t.slice(yt, rt);
3170
- s.tokens && (F === 0 && c !== 0 ? (r[F].isPrefix = !0, r[F].value = d) : r[F].value = _t, Ls(r[F]), it.maxDepth += r[F].depth), (F !== 0 || _t !== "") && a.push(_t), U = rt;
3170
+ s.tokens && (F === 0 && c !== 0 ? (r[F].isPrefix = !0, r[F].value = m) : r[F].value = _t, Ls(r[F]), it.maxDepth += r[F].depth), (F !== 0 || _t !== "") && a.push(_t), U = rt;
3171
3171
  }
3172
3172
  if (U && U + 1 < t.length) {
3173
3173
  const F = t.slice(U + 1);
@@ -3206,20 +3206,20 @@ const ge = Re, pt = Se, {
3206
3206
  const o = { type: "bos", value: "", output: s.prepend || "" }, r = [o], a = s.capture ? "" : "?:", u = ge.globChars(s.windows), l = ge.extglobChars(u), {
3207
3207
  DOT_LITERAL: c,
3208
3208
  PLUS_LITERAL: f,
3209
- SLASH_LITERAL: p,
3210
- ONE_CHAR: g,
3211
- DOTS_SLASH: y,
3209
+ SLASH_LITERAL: h,
3210
+ ONE_CHAR: p,
3211
+ DOTS_SLASH: d,
3212
3212
  NO_DOT: b,
3213
- NO_DOT_SLASH: _,
3214
- NO_DOTS_SLASH: M,
3215
- QMARK: v,
3216
- QMARK_NO_DOT: E,
3217
- STAR: P,
3218
- START_ANCHOR: O
3219
- } = u, $ = (R) => `(${a}(?:(?!${O}${R.dot ? y : c}).)*?)`, T = s.dot ? "" : b, w = s.dot ? v : E;
3220
- let A = s.bash === !0 ? $(s) : P;
3221
- s.capture && (A = `(${A})`), typeof s.noext == "boolean" && (s.noextglob = s.noext);
3222
- const h = {
3213
+ NO_DOT_SLASH: w,
3214
+ NO_DOTS_SLASH: A,
3215
+ QMARK: S,
3216
+ QMARK_NO_DOT: O,
3217
+ STAR: $,
3218
+ START_ANCHOR: E
3219
+ } = u, j = (R) => `(${a}(?:(?!${E}${R.dot ? d : c}).)*?)`, T = s.dot ? "" : b, _ = s.dot ? S : O;
3220
+ let M = s.bash === !0 ? j(s) : $;
3221
+ s.capture && (M = `(${M})`), typeof s.noext == "boolean" && (s.noextglob = s.noext);
3222
+ const y = {
3223
3223
  input: t,
3224
3224
  index: -1,
3225
3225
  start: 0,
@@ -3236,347 +3236,347 @@ const ge = Re, pt = Se, {
3236
3236
  globstar: !1,
3237
3237
  tokens: r
3238
3238
  };
3239
- t = pt.removePrefix(t, h), i = t.length;
3239
+ t = pt.removePrefix(t, y), i = t.length;
3240
3240
  const L = [], V = [], H = [];
3241
- let d = o, m;
3242
- const it = () => h.index === i - 1, U = h.peek = (R = 1) => t[h.index + R], F = h.advance = () => t[++h.index] || "", yt = () => t.slice(h.index + 1), rt = (R = "", N = 0) => {
3243
- h.consumed += R, h.index += N;
3241
+ let m = o, g;
3242
+ const it = () => y.index === i - 1, U = y.peek = (R = 1) => t[y.index + R], F = y.advance = () => t[++y.index] || "", yt = () => t.slice(y.index + 1), rt = (R = "", N = 0) => {
3243
+ y.consumed += R, y.index += N;
3244
3244
  }, _t = (R) => {
3245
- h.output += R.output != null ? R.output : R.value, rt(R.value);
3245
+ y.output += R.output != null ? R.output : R.value, rt(R.value);
3246
3246
  }, vn = () => {
3247
3247
  let R = 1;
3248
3248
  for (; U() === "!" && (U(2) !== "(" || U(3) === "?"); )
3249
- F(), h.start++, R++;
3250
- return R % 2 === 0 ? !1 : (h.negated = !0, h.start++, !0);
3249
+ F(), y.start++, R++;
3250
+ return R % 2 === 0 ? !1 : (y.negated = !0, y.start++, !0);
3251
3251
  }, Zt = (R) => {
3252
- h[R]++, H.push(R);
3252
+ y[R]++, H.push(R);
3253
3253
  }, At = (R) => {
3254
- h[R]--, H.pop();
3255
- }, D = (R) => {
3256
- if (d.type === "globstar") {
3257
- const N = h.braces > 0 && (R.type === "comma" || R.type === "brace"), S = R.extglob === !0 || L.length && (R.type === "pipe" || R.type === "paren");
3258
- R.type !== "slash" && R.type !== "paren" && !N && !S && (h.output = h.output.slice(0, -d.output.length), d.type = "star", d.value = "*", d.output = A, h.output += d.output);
3254
+ y[R]--, H.pop();
3255
+ }, x = (R) => {
3256
+ if (m.type === "globstar") {
3257
+ const N = y.braces > 0 && (R.type === "comma" || R.type === "brace"), v = R.extglob === !0 || L.length && (R.type === "pipe" || R.type === "paren");
3258
+ R.type !== "slash" && R.type !== "paren" && !N && !v && (y.output = y.output.slice(0, -m.output.length), m.type = "star", m.value = "*", m.output = M, y.output += m.output);
3259
3259
  }
3260
- if (L.length && R.type !== "paren" && (L[L.length - 1].inner += R.value), (R.value || R.output) && _t(R), d && d.type === "text" && R.type === "text") {
3261
- d.output = (d.output || d.value) + R.value, d.value += R.value;
3260
+ if (L.length && R.type !== "paren" && (L[L.length - 1].inner += R.value), (R.value || R.output) && _t(R), m && m.type === "text" && R.type === "text") {
3261
+ m.output = (m.output || m.value) + R.value, m.value += R.value;
3262
3262
  return;
3263
3263
  }
3264
- R.prev = d, r.push(R), d = R;
3264
+ R.prev = m, r.push(R), m = R;
3265
3265
  }, te = (R, N) => {
3266
- const S = { ...l[N], conditions: 1, inner: "" };
3267
- S.prev = d, S.parens = h.parens, S.output = h.output;
3268
- const x = (s.capture ? "(" : "") + S.open;
3269
- Zt("parens"), D({ type: R, value: N, output: h.output ? "" : g }), D({ type: "paren", extglob: !0, value: F(), output: x }), L.push(S);
3266
+ const v = { ...l[N], conditions: 1, inner: "" };
3267
+ v.prev = m, v.parens = y.parens, v.output = y.output;
3268
+ const P = (s.capture ? "(" : "") + v.open;
3269
+ Zt("parens"), x({ type: R, value: N, output: y.output ? "" : p }), x({ type: "paren", extglob: !0, value: F(), output: P }), L.push(v);
3270
3270
  }, Sn = (R) => {
3271
- let N = R.close + (s.capture ? ")" : ""), S;
3271
+ let N = R.close + (s.capture ? ")" : ""), v;
3272
3272
  if (R.type === "negate") {
3273
- let x = A;
3274
- if (R.inner && R.inner.length > 1 && R.inner.includes("/") && (x = $(s)), (x !== A || it() || /^\)+$/.test(yt())) && (N = R.close = `)$))${x}`), R.inner.includes("*") && (S = yt()) && /^\.[^\\/.]+$/.test(S)) {
3275
- const B = ds(S, { ...e, fastpaths: !1 }).output;
3276
- N = R.close = `)${B})${x})`;
3273
+ let P = M;
3274
+ if (R.inner && R.inner.length > 1 && R.inner.includes("/") && (P = j(s)), (P !== M || it() || /^\)+$/.test(yt())) && (N = R.close = `)$))${P}`), R.inner.includes("*") && (v = yt()) && /^\.[^\\/.]+$/.test(v)) {
3275
+ const B = ds(v, { ...e, fastpaths: !1 }).output;
3276
+ N = R.close = `)${B})${P})`;
3277
3277
  }
3278
- R.prev.type === "bos" && (h.negatedExtglob = !0);
3278
+ R.prev.type === "bos" && (y.negatedExtglob = !0);
3279
3279
  }
3280
- D({ type: "paren", extglob: !0, value: m, output: N }), At("parens");
3280
+ x({ type: "paren", extglob: !0, value: g, output: N }), At("parens");
3281
3281
  };
3282
3282
  if (s.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(t)) {
3283
- let R = !1, N = t.replace(xr, (S, x, B, X, Q, Ee) => X === "\\" ? (R = !0, S) : X === "?" ? x ? x + X + (Q ? v.repeat(Q.length) : "") : Ee === 0 ? w + (Q ? v.repeat(Q.length) : "") : v.repeat(B.length) : X === "." ? c.repeat(B.length) : X === "*" ? x ? x + X + (Q ? A : "") : A : x ? S : `\\${S}`);
3284
- return R === !0 && (s.unescape === !0 ? N = N.replace(/\\/g, "") : N = N.replace(/\\+/g, (S) => S.length % 2 === 0 ? "\\\\" : S ? "\\" : "")), N === t && s.contains === !0 ? (h.output = t, h) : (h.output = pt.wrapOutput(N, h, e), h);
3283
+ let R = !1, N = t.replace(xr, (v, P, B, X, Q, Ee) => X === "\\" ? (R = !0, v) : X === "?" ? P ? P + X + (Q ? S.repeat(Q.length) : "") : Ee === 0 ? _ + (Q ? S.repeat(Q.length) : "") : S.repeat(B.length) : X === "." ? c.repeat(B.length) : X === "*" ? P ? P + X + (Q ? M : "") : M : P ? v : `\\${v}`);
3284
+ return R === !0 && (s.unescape === !0 ? N = N.replace(/\\/g, "") : N = N.replace(/\\+/g, (v) => v.length % 2 === 0 ? "\\\\" : v ? "\\" : "")), N === t && s.contains === !0 ? (y.output = t, y) : (y.output = pt.wrapOutput(N, y, e), y);
3285
3285
  }
3286
3286
  for (; !it(); ) {
3287
- if (m = F(), m === "\0")
3287
+ if (g = F(), g === "\0")
3288
3288
  continue;
3289
- if (m === "\\") {
3290
- const S = U();
3291
- if (S === "/" && s.bash !== !0 || S === "." || S === ";")
3289
+ if (g === "\\") {
3290
+ const v = U();
3291
+ if (v === "/" && s.bash !== !0 || v === "." || v === ";")
3292
3292
  continue;
3293
- if (!S) {
3294
- m += "\\", D({ type: "text", value: m });
3293
+ if (!v) {
3294
+ g += "\\", x({ type: "text", value: g });
3295
3295
  continue;
3296
3296
  }
3297
- const x = /^\\+/.exec(yt());
3297
+ const P = /^\\+/.exec(yt());
3298
3298
  let B = 0;
3299
- if (x && x[0].length > 2 && (B = x[0].length, h.index += B, B % 2 !== 0 && (m += "\\")), s.unescape === !0 ? m = F() : m += F(), h.brackets === 0) {
3300
- D({ type: "text", value: m });
3299
+ if (P && P[0].length > 2 && (B = P[0].length, y.index += B, B % 2 !== 0 && (g += "\\")), s.unescape === !0 ? g = F() : g += F(), y.brackets === 0) {
3300
+ x({ type: "text", value: g });
3301
3301
  continue;
3302
3302
  }
3303
3303
  }
3304
- if (h.brackets > 0 && (m !== "]" || d.value === "[" || d.value === "[^")) {
3305
- if (s.posix !== !1 && m === ":") {
3306
- const S = d.value.slice(1);
3307
- if (S.includes("[") && (d.posix = !0, S.includes(":"))) {
3308
- const x = d.value.lastIndexOf("["), B = d.value.slice(0, x), X = d.value.slice(x + 2), Q = $r[X];
3304
+ if (y.brackets > 0 && (g !== "]" || m.value === "[" || m.value === "[^")) {
3305
+ if (s.posix !== !1 && g === ":") {
3306
+ const v = m.value.slice(1);
3307
+ if (v.includes("[") && (m.posix = !0, v.includes(":"))) {
3308
+ const P = m.value.lastIndexOf("["), B = m.value.slice(0, P), X = m.value.slice(P + 2), Q = $r[X];
3309
3309
  if (Q) {
3310
- d.value = B + Q, h.backtrack = !0, F(), !o.output && r.indexOf(d) === 1 && (o.output = g);
3310
+ m.value = B + Q, y.backtrack = !0, F(), !o.output && r.indexOf(m) === 1 && (o.output = p);
3311
3311
  continue;
3312
3312
  }
3313
3313
  }
3314
3314
  }
3315
- (m === "[" && U() !== ":" || m === "-" && U() === "]") && (m = `\\${m}`), m === "]" && (d.value === "[" || d.value === "[^") && (m = `\\${m}`), s.posix === !0 && m === "!" && d.value === "[" && (m = "^"), d.value += m, _t({ value: m });
3315
+ (g === "[" && U() !== ":" || g === "-" && U() === "]") && (g = `\\${g}`), g === "]" && (m.value === "[" || m.value === "[^") && (g = `\\${g}`), s.posix === !0 && g === "!" && m.value === "[" && (g = "^"), m.value += g, _t({ value: g });
3316
3316
  continue;
3317
3317
  }
3318
- if (h.quotes === 1 && m !== '"') {
3319
- m = pt.escapeRegex(m), d.value += m, _t({ value: m });
3318
+ if (y.quotes === 1 && g !== '"') {
3319
+ g = pt.escapeRegex(g), m.value += g, _t({ value: g });
3320
3320
  continue;
3321
3321
  }
3322
- if (m === '"') {
3323
- h.quotes = h.quotes === 1 ? 0 : 1, s.keepQuotes === !0 && D({ type: "text", value: m });
3322
+ if (g === '"') {
3323
+ y.quotes = y.quotes === 1 ? 0 : 1, s.keepQuotes === !0 && x({ type: "text", value: g });
3324
3324
  continue;
3325
3325
  }
3326
- if (m === "(") {
3327
- Zt("parens"), D({ type: "paren", value: m });
3326
+ if (g === "(") {
3327
+ Zt("parens"), x({ type: "paren", value: g });
3328
3328
  continue;
3329
3329
  }
3330
- if (m === ")") {
3331
- if (h.parens === 0 && s.strictBrackets === !0)
3330
+ if (g === ")") {
3331
+ if (y.parens === 0 && s.strictBrackets === !0)
3332
3332
  throw new SyntaxError(jt("opening", "("));
3333
- const S = L[L.length - 1];
3334
- if (S && h.parens === S.parens + 1) {
3333
+ const v = L[L.length - 1];
3334
+ if (v && y.parens === v.parens + 1) {
3335
3335
  Sn(L.pop());
3336
3336
  continue;
3337
3337
  }
3338
- D({ type: "paren", value: m, output: h.parens ? ")" : "\\)" }), At("parens");
3338
+ x({ type: "paren", value: g, output: y.parens ? ")" : "\\)" }), At("parens");
3339
3339
  continue;
3340
3340
  }
3341
- if (m === "[") {
3341
+ if (g === "[") {
3342
3342
  if (s.nobracket === !0 || !yt().includes("]")) {
3343
3343
  if (s.nobracket !== !0 && s.strictBrackets === !0)
3344
3344
  throw new SyntaxError(jt("closing", "]"));
3345
- m = `\\${m}`;
3345
+ g = `\\${g}`;
3346
3346
  } else
3347
3347
  Zt("brackets");
3348
- D({ type: "bracket", value: m });
3348
+ x({ type: "bracket", value: g });
3349
3349
  continue;
3350
3350
  }
3351
- if (m === "]") {
3352
- if (s.nobracket === !0 || d && d.type === "bracket" && d.value.length === 1) {
3353
- D({ type: "text", value: m, output: `\\${m}` });
3351
+ if (g === "]") {
3352
+ if (s.nobracket === !0 || m && m.type === "bracket" && m.value.length === 1) {
3353
+ x({ type: "text", value: g, output: `\\${g}` });
3354
3354
  continue;
3355
3355
  }
3356
- if (h.brackets === 0) {
3356
+ if (y.brackets === 0) {
3357
3357
  if (s.strictBrackets === !0)
3358
3358
  throw new SyntaxError(jt("opening", "["));
3359
- D({ type: "text", value: m, output: `\\${m}` });
3359
+ x({ type: "text", value: g, output: `\\${g}` });
3360
3360
  continue;
3361
3361
  }
3362
3362
  At("brackets");
3363
- const S = d.value.slice(1);
3364
- if (d.posix !== !0 && S[0] === "^" && !S.includes("/") && (m = `/${m}`), d.value += m, _t({ value: m }), s.literalBrackets === !1 || pt.hasRegexChars(S))
3363
+ const v = m.value.slice(1);
3364
+ if (m.posix !== !0 && v[0] === "^" && !v.includes("/") && (g = `/${g}`), m.value += g, _t({ value: g }), s.literalBrackets === !1 || pt.hasRegexChars(v))
3365
3365
  continue;
3366
- const x = pt.escapeRegex(d.value);
3367
- if (h.output = h.output.slice(0, -d.value.length), s.literalBrackets === !0) {
3368
- h.output += x, d.value = x;
3366
+ const P = pt.escapeRegex(m.value);
3367
+ if (y.output = y.output.slice(0, -m.value.length), s.literalBrackets === !0) {
3368
+ y.output += P, m.value = P;
3369
3369
  continue;
3370
3370
  }
3371
- d.value = `(${a}${x}|${d.value})`, h.output += d.value;
3371
+ m.value = `(${a}${P}|${m.value})`, y.output += m.value;
3372
3372
  continue;
3373
3373
  }
3374
- if (m === "{" && s.nobrace !== !0) {
3374
+ if (g === "{" && s.nobrace !== !0) {
3375
3375
  Zt("braces");
3376
- const S = {
3376
+ const v = {
3377
3377
  type: "brace",
3378
- value: m,
3378
+ value: g,
3379
3379
  output: "(",
3380
- outputIndex: h.output.length,
3381
- tokensIndex: h.tokens.length
3380
+ outputIndex: y.output.length,
3381
+ tokensIndex: y.tokens.length
3382
3382
  };
3383
- V.push(S), D(S);
3383
+ V.push(v), x(v);
3384
3384
  continue;
3385
3385
  }
3386
- if (m === "}") {
3387
- const S = V[V.length - 1];
3388
- if (s.nobrace === !0 || !S) {
3389
- D({ type: "text", value: m, output: m });
3386
+ if (g === "}") {
3387
+ const v = V[V.length - 1];
3388
+ if (s.nobrace === !0 || !v) {
3389
+ x({ type: "text", value: g, output: g });
3390
3390
  continue;
3391
3391
  }
3392
- let x = ")";
3393
- if (S.dots === !0) {
3392
+ let P = ")";
3393
+ if (v.dots === !0) {
3394
3394
  const B = r.slice(), X = [];
3395
3395
  for (let Q = B.length - 1; Q >= 0 && (r.pop(), B[Q].type !== "brace"); Q--)
3396
3396
  B[Q].type !== "dots" && X.unshift(B[Q].value);
3397
- x = Dr(X, s), h.backtrack = !0;
3397
+ P = Dr(X, s), y.backtrack = !0;
3398
3398
  }
3399
- if (S.comma !== !0 && S.dots !== !0) {
3400
- const B = h.output.slice(0, S.outputIndex), X = h.tokens.slice(S.tokensIndex);
3401
- S.value = S.output = "\\{", m = x = "\\}", h.output = B;
3399
+ if (v.comma !== !0 && v.dots !== !0) {
3400
+ const B = y.output.slice(0, v.outputIndex), X = y.tokens.slice(v.tokensIndex);
3401
+ v.value = v.output = "\\{", g = P = "\\}", y.output = B;
3402
3402
  for (const Q of X)
3403
- h.output += Q.output || Q.value;
3403
+ y.output += Q.output || Q.value;
3404
3404
  }
3405
- D({ type: "brace", value: m, output: x }), At("braces"), V.pop();
3405
+ x({ type: "brace", value: g, output: P }), At("braces"), V.pop();
3406
3406
  continue;
3407
3407
  }
3408
- if (m === "|") {
3409
- L.length > 0 && L[L.length - 1].conditions++, D({ type: "text", value: m });
3408
+ if (g === "|") {
3409
+ L.length > 0 && L[L.length - 1].conditions++, x({ type: "text", value: g });
3410
3410
  continue;
3411
3411
  }
3412
- if (m === ",") {
3413
- let S = m;
3414
- const x = V[V.length - 1];
3415
- x && H[H.length - 1] === "braces" && (x.comma = !0, S = "|"), D({ type: "comma", value: m, output: S });
3412
+ if (g === ",") {
3413
+ let v = g;
3414
+ const P = V[V.length - 1];
3415
+ P && H[H.length - 1] === "braces" && (P.comma = !0, v = "|"), x({ type: "comma", value: g, output: v });
3416
3416
  continue;
3417
3417
  }
3418
- if (m === "/") {
3419
- if (d.type === "dot" && h.index === h.start + 1) {
3420
- h.start = h.index + 1, h.consumed = "", h.output = "", r.pop(), d = o;
3418
+ if (g === "/") {
3419
+ if (m.type === "dot" && y.index === y.start + 1) {
3420
+ y.start = y.index + 1, y.consumed = "", y.output = "", r.pop(), m = o;
3421
3421
  continue;
3422
3422
  }
3423
- D({ type: "slash", value: m, output: p });
3423
+ x({ type: "slash", value: g, output: h });
3424
3424
  continue;
3425
3425
  }
3426
- if (m === ".") {
3427
- if (h.braces > 0 && d.type === "dot") {
3428
- d.value === "." && (d.output = c);
3429
- const S = V[V.length - 1];
3430
- d.type = "dots", d.output += m, d.value += m, S.dots = !0;
3426
+ if (g === ".") {
3427
+ if (y.braces > 0 && m.type === "dot") {
3428
+ m.value === "." && (m.output = c);
3429
+ const v = V[V.length - 1];
3430
+ m.type = "dots", m.output += g, m.value += g, v.dots = !0;
3431
3431
  continue;
3432
3432
  }
3433
- if (h.braces + h.parens === 0 && d.type !== "bos" && d.type !== "slash") {
3434
- D({ type: "text", value: m, output: c });
3433
+ if (y.braces + y.parens === 0 && m.type !== "bos" && m.type !== "slash") {
3434
+ x({ type: "text", value: g, output: c });
3435
3435
  continue;
3436
3436
  }
3437
- D({ type: "dot", value: m, output: c });
3437
+ x({ type: "dot", value: g, output: c });
3438
3438
  continue;
3439
3439
  }
3440
- if (m === "?") {
3441
- if (!(d && d.value === "(") && s.noextglob !== !0 && U() === "(" && U(2) !== "?") {
3442
- te("qmark", m);
3440
+ if (g === "?") {
3441
+ if (!(m && m.value === "(") && s.noextglob !== !0 && U() === "(" && U(2) !== "?") {
3442
+ te("qmark", g);
3443
3443
  continue;
3444
3444
  }
3445
- if (d && d.type === "paren") {
3446
- const x = U();
3447
- let B = m;
3448
- (d.value === "(" && !/[!=<:]/.test(x) || x === "<" && !/<([!=]|\w+>)/.test(yt())) && (B = `\\${m}`), D({ type: "text", value: m, output: B });
3445
+ if (m && m.type === "paren") {
3446
+ const P = U();
3447
+ let B = g;
3448
+ (m.value === "(" && !/[!=<:]/.test(P) || P === "<" && !/<([!=]|\w+>)/.test(yt())) && (B = `\\${g}`), x({ type: "text", value: g, output: B });
3449
3449
  continue;
3450
3450
  }
3451
- if (s.dot !== !0 && (d.type === "slash" || d.type === "bos")) {
3452
- D({ type: "qmark", value: m, output: E });
3451
+ if (s.dot !== !0 && (m.type === "slash" || m.type === "bos")) {
3452
+ x({ type: "qmark", value: g, output: O });
3453
3453
  continue;
3454
3454
  }
3455
- D({ type: "qmark", value: m, output: v });
3455
+ x({ type: "qmark", value: g, output: S });
3456
3456
  continue;
3457
3457
  }
3458
- if (m === "!") {
3458
+ if (g === "!") {
3459
3459
  if (s.noextglob !== !0 && U() === "(" && (U(2) !== "?" || !/[!=<:]/.test(U(3)))) {
3460
- te("negate", m);
3460
+ te("negate", g);
3461
3461
  continue;
3462
3462
  }
3463
- if (s.nonegate !== !0 && h.index === 0) {
3463
+ if (s.nonegate !== !0 && y.index === 0) {
3464
3464
  vn();
3465
3465
  continue;
3466
3466
  }
3467
3467
  }
3468
- if (m === "+") {
3468
+ if (g === "+") {
3469
3469
  if (s.noextglob !== !0 && U() === "(" && U(2) !== "?") {
3470
- te("plus", m);
3470
+ te("plus", g);
3471
3471
  continue;
3472
3472
  }
3473
- if (d && d.value === "(" || s.regex === !1) {
3474
- D({ type: "plus", value: m, output: f });
3473
+ if (m && m.value === "(" || s.regex === !1) {
3474
+ x({ type: "plus", value: g, output: f });
3475
3475
  continue;
3476
3476
  }
3477
- if (d && (d.type === "bracket" || d.type === "paren" || d.type === "brace") || h.parens > 0) {
3478
- D({ type: "plus", value: m });
3477
+ if (m && (m.type === "bracket" || m.type === "paren" || m.type === "brace") || y.parens > 0) {
3478
+ x({ type: "plus", value: g });
3479
3479
  continue;
3480
3480
  }
3481
- D({ type: "plus", value: f });
3481
+ x({ type: "plus", value: f });
3482
3482
  continue;
3483
3483
  }
3484
- if (m === "@") {
3484
+ if (g === "@") {
3485
3485
  if (s.noextglob !== !0 && U() === "(" && U(2) !== "?") {
3486
- D({ type: "at", extglob: !0, value: m, output: "" });
3486
+ x({ type: "at", extglob: !0, value: g, output: "" });
3487
3487
  continue;
3488
3488
  }
3489
- D({ type: "text", value: m });
3489
+ x({ type: "text", value: g });
3490
3490
  continue;
3491
3491
  }
3492
- if (m !== "*") {
3493
- (m === "$" || m === "^") && (m = `\\${m}`);
3494
- const S = Pr.exec(yt());
3495
- S && (m += S[0], h.index += S[0].length), D({ type: "text", value: m });
3492
+ if (g !== "*") {
3493
+ (g === "$" || g === "^") && (g = `\\${g}`);
3494
+ const v = Pr.exec(yt());
3495
+ v && (g += v[0], y.index += v[0].length), x({ type: "text", value: g });
3496
3496
  continue;
3497
3497
  }
3498
- if (d && (d.type === "globstar" || d.star === !0)) {
3499
- d.type = "star", d.star = !0, d.value += m, d.output = A, h.backtrack = !0, h.globstar = !0, rt(m);
3498
+ if (m && (m.type === "globstar" || m.star === !0)) {
3499
+ m.type = "star", m.star = !0, m.value += g, m.output = M, y.backtrack = !0, y.globstar = !0, rt(g);
3500
3500
  continue;
3501
3501
  }
3502
3502
  let R = yt();
3503
3503
  if (s.noextglob !== !0 && /^\([^?]/.test(R)) {
3504
- te("star", m);
3504
+ te("star", g);
3505
3505
  continue;
3506
3506
  }
3507
- if (d.type === "star") {
3507
+ if (m.type === "star") {
3508
3508
  if (s.noglobstar === !0) {
3509
- rt(m);
3509
+ rt(g);
3510
3510
  continue;
3511
3511
  }
3512
- const S = d.prev, x = S.prev, B = S.type === "slash" || S.type === "bos", X = x && (x.type === "star" || x.type === "globstar");
3512
+ const v = m.prev, P = v.prev, B = v.type === "slash" || v.type === "bos", X = P && (P.type === "star" || P.type === "globstar");
3513
3513
  if (s.bash === !0 && (!B || R[0] && R[0] !== "/")) {
3514
- D({ type: "star", value: m, output: "" });
3514
+ x({ type: "star", value: g, output: "" });
3515
3515
  continue;
3516
3516
  }
3517
- const Q = h.braces > 0 && (S.type === "comma" || S.type === "brace"), Ee = L.length && (S.type === "pipe" || S.type === "paren");
3518
- if (!B && S.type !== "paren" && !Q && !Ee) {
3519
- D({ type: "star", value: m, output: "" });
3517
+ const Q = y.braces > 0 && (v.type === "comma" || v.type === "brace"), Ee = L.length && (v.type === "pipe" || v.type === "paren");
3518
+ if (!B && v.type !== "paren" && !Q && !Ee) {
3519
+ x({ type: "star", value: g, output: "" });
3520
3520
  continue;
3521
3521
  }
3522
3522
  for (; R.slice(0, 3) === "/**"; ) {
3523
- const ee = t[h.index + 4];
3523
+ const ee = t[y.index + 4];
3524
3524
  if (ee && ee !== "/")
3525
3525
  break;
3526
3526
  R = R.slice(3), rt("/**", 3);
3527
3527
  }
3528
- if (S.type === "bos" && it()) {
3529
- d.type = "globstar", d.value += m, d.output = $(s), h.output = d.output, h.globstar = !0, rt(m);
3528
+ if (v.type === "bos" && it()) {
3529
+ m.type = "globstar", m.value += g, m.output = j(s), y.output = m.output, y.globstar = !0, rt(g);
3530
3530
  continue;
3531
3531
  }
3532
- if (S.type === "slash" && S.prev.type !== "bos" && !X && it()) {
3533
- h.output = h.output.slice(0, -(S.output + d.output).length), S.output = `(?:${S.output}`, d.type = "globstar", d.output = $(s) + (s.strictSlashes ? ")" : "|$)"), d.value += m, h.globstar = !0, h.output += S.output + d.output, rt(m);
3532
+ if (v.type === "slash" && v.prev.type !== "bos" && !X && it()) {
3533
+ y.output = y.output.slice(0, -(v.output + m.output).length), v.output = `(?:${v.output}`, m.type = "globstar", m.output = j(s) + (s.strictSlashes ? ")" : "|$)"), m.value += g, y.globstar = !0, y.output += v.output + m.output, rt(g);
3534
3534
  continue;
3535
3535
  }
3536
- if (S.type === "slash" && S.prev.type !== "bos" && R[0] === "/") {
3536
+ if (v.type === "slash" && v.prev.type !== "bos" && R[0] === "/") {
3537
3537
  const ee = R[1] !== void 0 ? "|$" : "";
3538
- h.output = h.output.slice(0, -(S.output + d.output).length), S.output = `(?:${S.output}`, d.type = "globstar", d.output = `${$(s)}${p}|${p}${ee})`, d.value += m, h.output += S.output + d.output, h.globstar = !0, rt(m + F()), D({ type: "slash", value: "/", output: "" });
3538
+ y.output = y.output.slice(0, -(v.output + m.output).length), v.output = `(?:${v.output}`, m.type = "globstar", m.output = `${j(s)}${h}|${h}${ee})`, m.value += g, y.output += v.output + m.output, y.globstar = !0, rt(g + F()), x({ type: "slash", value: "/", output: "" });
3539
3539
  continue;
3540
3540
  }
3541
- if (S.type === "bos" && R[0] === "/") {
3542
- d.type = "globstar", d.value += m, d.output = `(?:^|${p}|${$(s)}${p})`, h.output = d.output, h.globstar = !0, rt(m + F()), D({ type: "slash", value: "/", output: "" });
3541
+ if (v.type === "bos" && R[0] === "/") {
3542
+ m.type = "globstar", m.value += g, m.output = `(?:^|${h}|${j(s)}${h})`, y.output = m.output, y.globstar = !0, rt(g + F()), x({ type: "slash", value: "/", output: "" });
3543
3543
  continue;
3544
3544
  }
3545
- h.output = h.output.slice(0, -d.output.length), d.type = "globstar", d.output = $(s), d.value += m, h.output += d.output, h.globstar = !0, rt(m);
3545
+ y.output = y.output.slice(0, -m.output.length), m.type = "globstar", m.output = j(s), m.value += g, y.output += m.output, y.globstar = !0, rt(g);
3546
3546
  continue;
3547
3547
  }
3548
- const N = { type: "star", value: m, output: A };
3548
+ const N = { type: "star", value: g, output: M };
3549
3549
  if (s.bash === !0) {
3550
- N.output = ".*?", (d.type === "bos" || d.type === "slash") && (N.output = T + N.output), D(N);
3550
+ N.output = ".*?", (m.type === "bos" || m.type === "slash") && (N.output = T + N.output), x(N);
3551
3551
  continue;
3552
3552
  }
3553
- if (d && (d.type === "bracket" || d.type === "paren") && s.regex === !0) {
3554
- N.output = m, D(N);
3553
+ if (m && (m.type === "bracket" || m.type === "paren") && s.regex === !0) {
3554
+ N.output = g, x(N);
3555
3555
  continue;
3556
3556
  }
3557
- (h.index === h.start || d.type === "slash" || d.type === "dot") && (d.type === "dot" ? (h.output += _, d.output += _) : s.dot === !0 ? (h.output += M, d.output += M) : (h.output += T, d.output += T), U() !== "*" && (h.output += g, d.output += g)), D(N);
3557
+ (y.index === y.start || m.type === "slash" || m.type === "dot") && (m.type === "dot" ? (y.output += w, m.output += w) : s.dot === !0 ? (y.output += A, m.output += A) : (y.output += T, m.output += T), U() !== "*" && (y.output += p, m.output += p)), x(N);
3558
3558
  }
3559
- for (; h.brackets > 0; ) {
3559
+ for (; y.brackets > 0; ) {
3560
3560
  if (s.strictBrackets === !0)
3561
3561
  throw new SyntaxError(jt("closing", "]"));
3562
- h.output = pt.escapeLast(h.output, "["), At("brackets");
3562
+ y.output = pt.escapeLast(y.output, "["), At("brackets");
3563
3563
  }
3564
- for (; h.parens > 0; ) {
3564
+ for (; y.parens > 0; ) {
3565
3565
  if (s.strictBrackets === !0)
3566
3566
  throw new SyntaxError(jt("closing", ")"));
3567
- h.output = pt.escapeLast(h.output, "("), At("parens");
3567
+ y.output = pt.escapeLast(y.output, "("), At("parens");
3568
3568
  }
3569
- for (; h.braces > 0; ) {
3569
+ for (; y.braces > 0; ) {
3570
3570
  if (s.strictBrackets === !0)
3571
3571
  throw new SyntaxError(jt("closing", "}"));
3572
- h.output = pt.escapeLast(h.output, "{"), At("braces");
3572
+ y.output = pt.escapeLast(y.output, "{"), At("braces");
3573
3573
  }
3574
- if (s.strictSlashes !== !0 && (d.type === "star" || d.type === "bracket") && D({ type: "maybe_slash", value: "", output: `${p}?` }), h.backtrack === !0) {
3575
- h.output = "";
3576
- for (const R of h.tokens)
3577
- h.output += R.output != null ? R.output : R.value, R.suffix && (h.output += R.suffix);
3574
+ if (s.strictSlashes !== !0 && (m.type === "star" || m.type === "bracket") && x({ type: "maybe_slash", value: "", output: `${h}?` }), y.backtrack === !0) {
3575
+ y.output = "";
3576
+ for (const R of y.tokens)
3577
+ y.output += R.output != null ? R.output : R.value, R.suffix && (y.output += R.suffix);
3578
3578
  }
3579
- return h;
3579
+ return y;
3580
3580
  };
3581
3581
  ds.fastpaths = (t, e) => {
3582
3582
  const s = { ...e }, n = typeof s.maxLength == "number" ? Math.min(be, s.maxLength) : be, i = t.length;
@@ -3591,50 +3591,50 @@ ds.fastpaths = (t, e) => {
3591
3591
  NO_DOT: l,
3592
3592
  NO_DOTS: c,
3593
3593
  NO_DOTS_SLASH: f,
3594
- STAR: p,
3595
- START_ANCHOR: g
3596
- } = ge.globChars(s.windows), y = s.dot ? c : l, b = s.dot ? f : l, _ = s.capture ? "" : "?:", M = { negated: !1, prefix: "" };
3597
- let v = s.bash === !0 ? ".*?" : p;
3598
- s.capture && (v = `(${v})`);
3599
- const E = (T) => T.noglobstar === !0 ? v : `(${_}(?:(?!${g}${T.dot ? u : o}).)*?)`, P = (T) => {
3594
+ STAR: h,
3595
+ START_ANCHOR: p
3596
+ } = ge.globChars(s.windows), d = s.dot ? c : l, b = s.dot ? f : l, w = s.capture ? "" : "?:", A = { negated: !1, prefix: "" };
3597
+ let S = s.bash === !0 ? ".*?" : h;
3598
+ s.capture && (S = `(${S})`);
3599
+ const O = (T) => T.noglobstar === !0 ? S : `(${w}(?:(?!${p}${T.dot ? u : o}).)*?)`, $ = (T) => {
3600
3600
  switch (T) {
3601
3601
  case "*":
3602
- return `${y}${a}${v}`;
3602
+ return `${d}${a}${S}`;
3603
3603
  case ".*":
3604
- return `${o}${a}${v}`;
3604
+ return `${o}${a}${S}`;
3605
3605
  case "*.*":
3606
- return `${y}${v}${o}${a}${v}`;
3606
+ return `${d}${S}${o}${a}${S}`;
3607
3607
  case "*/*":
3608
- return `${y}${v}${r}${a}${b}${v}`;
3608
+ return `${d}${S}${r}${a}${b}${S}`;
3609
3609
  case "**":
3610
- return y + E(s);
3610
+ return d + O(s);
3611
3611
  case "**/*":
3612
- return `(?:${y}${E(s)}${r})?${b}${a}${v}`;
3612
+ return `(?:${d}${O(s)}${r})?${b}${a}${S}`;
3613
3613
  case "**/*.*":
3614
- return `(?:${y}${E(s)}${r})?${b}${v}${o}${a}${v}`;
3614
+ return `(?:${d}${O(s)}${r})?${b}${S}${o}${a}${S}`;
3615
3615
  case "**/.*":
3616
- return `(?:${y}${E(s)}${r})?${o}${a}${v}`;
3616
+ return `(?:${d}${O(s)}${r})?${o}${a}${S}`;
3617
3617
  default: {
3618
- const w = /^(.*?)\.(\w+)$/.exec(T);
3619
- if (!w)
3618
+ const _ = /^(.*?)\.(\w+)$/.exec(T);
3619
+ if (!_)
3620
3620
  return;
3621
- const A = P(w[1]);
3622
- return A ? A + o + w[2] : void 0;
3621
+ const M = $(_[1]);
3622
+ return M ? M + o + _[2] : void 0;
3623
3623
  }
3624
3624
  }
3625
- }, O = pt.removePrefix(t, M);
3626
- let $ = P(O);
3627
- return $ && s.strictSlashes !== !0 && ($ += `${r}?`), $;
3625
+ }, E = pt.removePrefix(t, A);
3626
+ let j = $(E);
3627
+ return j && s.strictSlashes !== !0 && (j += `${r}?`), j;
3628
3628
  };
3629
3629
  var jr = ds;
3630
3630
  const Tr = Cr, We = jr, _n = Se, Lr = Re, kr = (t) => t && typeof t == "object" && !Array.isArray(t), G = (t, e, s = !1) => {
3631
3631
  if (Array.isArray(t)) {
3632
- const c = t.map((p) => G(p, e, s));
3633
- return (p) => {
3634
- for (const g of c) {
3635
- const y = g(p);
3636
- if (y)
3637
- return y;
3632
+ const c = t.map((h) => G(h, e, s));
3633
+ return (h) => {
3634
+ for (const p of c) {
3635
+ const d = p(h);
3636
+ if (d)
3637
+ return d;
3638
3638
  }
3639
3639
  return !1;
3640
3640
  };
@@ -3650,8 +3650,8 @@ const Tr = Cr, We = jr, _n = Se, Lr = Re, kr = (t) => t && typeof t == "object"
3650
3650
  u = G(i.ignore, c, s);
3651
3651
  }
3652
3652
  const l = (c, f = !1) => {
3653
- const { isMatch: p, match: g, output: y } = G.test(c, r, e, { glob: t, posix: o }), b = { glob: t, state: a, regex: r, posix: o, input: c, output: y, match: g, isMatch: p };
3654
- return typeof i.onResult == "function" && i.onResult(b), p === !1 ? (b.isMatch = !1, f ? b : !1) : u(c) ? (typeof i.onIgnore == "function" && i.onIgnore(b), b.isMatch = !1, f ? b : !1) : (typeof i.onMatch == "function" && i.onMatch(b), f ? b : !0);
3653
+ const { isMatch: h, match: p, output: d } = G.test(c, r, e, { glob: t, posix: o }), b = { glob: t, state: a, regex: r, posix: o, input: c, output: d, match: p, isMatch: h };
3654
+ return typeof i.onResult == "function" && i.onResult(b), h === !1 ? (b.isMatch = !1, f ? b : !1) : u(c) ? (typeof i.onIgnore == "function" && i.onIgnore(b), b.isMatch = !1, f ? b : !1) : (typeof i.onMatch == "function" && i.onMatch(b), f ? b : !0);
3655
3655
  };
3656
3656
  return s && (l.state = a), l;
3657
3657
  };
@@ -3750,16 +3750,16 @@ class zr extends as.EventEmitter {
3750
3750
  const u = this;
3751
3751
  this.iframe = new Promise((l) => {
3752
3752
  qt().then(async () => {
3753
- var c, f, p, g;
3753
+ var c, f, h, p;
3754
3754
  if (u._iframe) {
3755
- if ((g = (p = (f = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : f.metaframes) == null ? void 0 : p[this.id]) != null && g.allow)
3755
+ if ((p = (h = (f = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : f.metaframes) == null ? void 0 : h[this.id]) != null && p.allow)
3756
3756
  u._iframe.allow = this._metapage._definition.metaframes[this.id].allow, this._debug && this.log(`mf allow=${u._iframe.allow} from this._metapage?._definition`);
3757
3757
  else {
3758
- let y = cs(this.url, "definition");
3759
- if (y = y && (y != null && y.version) ? await He(y) : void 0, !u._iframe)
3758
+ let d = cs(this.url, "definition");
3759
+ if (d = d && (d != null && d.version) ? await He(d) : void 0, !u._iframe)
3760
3760
  return;
3761
- if (y != null && y.allow)
3762
- u._iframe.allow = y.allow;
3761
+ if (d != null && d.allow)
3762
+ u._iframe.allow = d.allow;
3763
3763
  else {
3764
3764
  let b = await u.getDefinition();
3765
3765
  if (this._debug && this.log(`mf metaframeDef=${JSON.stringify(b)}`), b = b && (b != null && b.version) ? await He(b) : void 0, this._debug && this.log(`mf metaframeDef=${JSON.stringify(b)}`), !u._iframe)
@@ -4045,95 +4045,106 @@ class tt extends or {
4045
4045
  let o = i.url;
4046
4046
  const r = this._injectedSecrets[n] || {}, a = this._originalSecretHashParams[n] || {};
4047
4047
  Object.keys(r).forEach((f) => {
4048
- const p = a[f];
4049
- if (p === void 0) {
4050
- const g = new URL(o);
4051
- let y = g.hash.startsWith("#?") ? g.hash.slice(2) : g.hash.slice(1);
4052
- y = y.replace(/\?/g, "&");
4053
- const b = new URLSearchParams(y);
4048
+ const h = a[f];
4049
+ if (h === void 0) {
4050
+ const p = new URL(o);
4051
+ let d = p.hash.startsWith("#?") ? p.hash.slice(2) : p.hash.slice(1);
4052
+ d = d.replace(/\?/g, "&");
4053
+ const b = new URLSearchParams(d);
4054
4054
  b.delete(f);
4055
- const _ = b.toString();
4056
- g.hash = _ ? g.hash.startsWith("#?") ? `?${_}` : _ : "", o = g.href;
4055
+ const w = b.toString();
4056
+ p.hash = w ? p.hash.startsWith("#?") ? `?${w}` : w : "", o = p.href;
4057
4057
  } else {
4058
- const g = kt(o, f, p);
4059
- o = typeof g == "string" ? g : g.href;
4058
+ const p = kt(o, f, h);
4059
+ o = typeof p == "string" ? p : p.href;
4060
4060
  }
4061
4061
  });
4062
4062
  const u = this._injectedQuerySecrets[n] || {}, l = this._originalSecretQueryParams[n] || {};
4063
4063
  Object.keys(u).forEach((f) => {
4064
- const p = l[f], g = new URL(o);
4065
- p === void 0 ? g.searchParams.delete(f) : g.searchParams.set(f, p), o = g.href;
4064
+ const h = l[f], p = new URL(o);
4065
+ h === void 0 ? p.searchParams.delete(f) : p.searchParams.set(f, h), o = p.href;
4066
4066
  }), e.metaframes[n].url = o;
4067
4067
  });
4068
4068
  });
4069
4069
  }
4070
4070
  async _applyDefinition(e, s) {
4071
+ var h;
4071
4072
  const n = await Vn(e);
4072
4073
  if (this.isDisposed())
4073
4074
  return { newDefinition: n, added: {}, removed: {} };
4074
- n.metaframes && Object.keys(n.metaframes).forEach((f) => {
4075
- var p = n.metaframes[f];
4076
- if (typeof p != "object")
4077
- throw this.emitErrorMessage(`Metaframe "${f}" is not an object`), `Metaframe "${f}" is not an object`;
4078
- if (!p.url)
4079
- throw this.emitErrorMessage(`Metaframe "${f}" missing field: url`), `Metaframe "${f}" missing field: url`;
4075
+ n.metaframes && Object.keys(n.metaframes).forEach((p) => {
4076
+ var d = n.metaframes[p];
4077
+ if (typeof d != "object")
4078
+ throw this.emitErrorMessage(`Metaframe "${p}" is not an object`), `Metaframe "${p}" is not an object`;
4079
+ if (!d.url)
4080
+ throw this.emitErrorMessage(`Metaframe "${p}" missing field: url`), `Metaframe "${p}" missing field: url`;
4080
4081
  });
4081
- const i = { ...this._injectedSecrets }, o = { ...this._injectedQuerySecrets }, r = { ...this._originalSecretHashParams }, a = { ...this._originalSecretQueryParams };
4082
- this._definition = n;
4083
- const u = {};
4084
- Object.keys(this._metaframes).forEach((f) => {
4085
- (!n.metaframes || !n.metaframes[f]) && (u[f] = this._metaframes[f]);
4086
- }), Object.keys(u).forEach((f) => {
4087
- this.removeMetaframe(f);
4088
- }), s && (this._state = C(s, (f) => f));
4082
+ const i = { ...this._injectedSecrets }, o = { ...this._injectedQuerySecrets }, r = { ...this._originalSecretHashParams }, a = { ...this._originalSecretQueryParams }, u = {};
4083
+ (h = this._definition) != null && h.metaframes && Object.keys(this._definition.metaframes).forEach((p) => {
4084
+ u[p] = this._definition.metaframes[p].url;
4085
+ }), this._definition = n;
4089
4086
  const l = {};
4090
- return n.metaframes && Object.keys(n.metaframes).forEach((f) => {
4091
- if (!this._metaframes.hasOwnProperty(f)) {
4092
- const p = n.metaframes[f], g = this.addMetaframe(f, p);
4093
- l[f] = g;
4087
+ Object.keys(this._metaframes).forEach((p) => {
4088
+ (!n.metaframes || !n.metaframes[p]) && (l[p] = this._metaframes[p]);
4089
+ }), Object.keys(l).forEach((p) => {
4090
+ this.removeMetaframe(p);
4091
+ }), s && (this._state = C(s, (p) => p));
4092
+ const c = {};
4093
+ return n.metaframes && Object.keys(n.metaframes).forEach((p) => {
4094
+ if (!this._metaframes.hasOwnProperty(p)) {
4095
+ const d = n.metaframes[p], b = this.addMetaframe(p, d);
4096
+ c[p] = b;
4094
4097
  }
4095
- }), n.metaframes && (Object.keys(n.metaframes).forEach((f) => {
4096
- if (l[f])
4098
+ }), n.metaframes && Object.keys(n.metaframes).forEach((p) => {
4099
+ if (c[p])
4097
4100
  return;
4098
- this._inputMap = C(this._inputMap, (g) => {
4099
- delete g[f];
4101
+ const d = this._metaframes[p];
4102
+ if (!d)
4103
+ return;
4104
+ const b = n.metaframes[p].url, w = u[p];
4105
+ b && w !== b && (d.url = b, d._iframe && (d._iframe.src = b));
4106
+ }), n.metaframes && (Object.keys(n.metaframes).forEach((p) => {
4107
+ if (c[p])
4108
+ return;
4109
+ this._inputMap = C(this._inputMap, (b) => {
4110
+ delete b[p];
4100
4111
  });
4101
- const p = n.metaframes[f];
4102
- p.inputs && p.inputs.forEach((g) => this.addPipe(f, g));
4103
- }), this._cachedInputLookupMap = C({}, (f) => f)), (/* @__PURE__ */ new Set([
4112
+ const d = n.metaframes[p];
4113
+ d.inputs && d.inputs.forEach((b) => this.addPipe(p, b));
4114
+ }), this._cachedInputLookupMap = C({}, (p) => p)), (/* @__PURE__ */ new Set([
4104
4115
  ...Object.keys(i),
4105
4116
  ...Object.keys(o)
4106
- ])).forEach((f) => {
4107
- var p, g, y, b, _;
4108
- if (this._metaframes[f]) {
4109
- const M = i[f] || {}, v = o[f] || {}, E = this._metaframes[f], P = (y = (g = (p = this._definition) == null ? void 0 : p.metaframes) == null ? void 0 : g[f]) == null ? void 0 : y.url;
4110
- if (!P || P.startsWith("data:"))
4117
+ ])).forEach((p) => {
4118
+ var d, b, w, A, S;
4119
+ if (this._metaframes[p]) {
4120
+ const O = i[p] || {}, $ = o[p] || {}, E = this._metaframes[p], j = (w = (b = (d = this._definition) == null ? void 0 : d.metaframes) == null ? void 0 : b[p]) == null ? void 0 : w.url;
4121
+ if (!j || j.startsWith("data:"))
4111
4122
  return;
4112
- let O = new URL(P);
4113
- if (Object.keys(M).length > 0) {
4114
- const $ = r[f] || {};
4115
- Object.keys(M).forEach((T) => {
4116
- const w = ze(O.href, T);
4117
- $[T] = w;
4118
- }), this._injectedSecrets[f] = M, this._originalSecretHashParams[f] = $;
4123
+ let T = new URL(j);
4124
+ if (Object.keys(O).length > 0) {
4125
+ const _ = r[p] || {};
4126
+ Object.keys(O).forEach((M) => {
4127
+ const y = ze(T.href, M);
4128
+ _[M] = y;
4129
+ }), this._injectedSecrets[p] = O, this._originalSecretHashParams[p] = _;
4119
4130
  }
4120
- if (Object.keys(v).length > 0) {
4121
- const $ = a[f] || {};
4122
- Object.keys(v).forEach((T) => {
4123
- const w = O.searchParams.get(T);
4124
- $[T] = w || void 0;
4125
- }), this._injectedQuerySecrets[f] = v, this._originalSecretQueryParams[f] = $;
4131
+ if (Object.keys($).length > 0) {
4132
+ const _ = a[p] || {};
4133
+ Object.keys($).forEach((M) => {
4134
+ const y = T.searchParams.get(M);
4135
+ _[M] = y || void 0;
4136
+ }), this._injectedQuerySecrets[p] = $, this._originalSecretQueryParams[p] = _;
4126
4137
  }
4127
- Object.entries(M).forEach(([$, T]) => {
4128
- O = new URL(kt(O.href, $, T));
4129
- }), Object.entries(v).forEach(([$, T]) => {
4130
- const w = btoa(encodeURIComponent(T));
4131
- O.searchParams.set($, w);
4132
- }), E.url = O.href, (_ = (b = this._definition) == null ? void 0 : b.metaframes) != null && _[f] && (this._definition = C(this._definition, ($) => {
4133
- $.metaframes[f].url = O.href;
4138
+ Object.entries(O).forEach(([_, M]) => {
4139
+ T = new URL(kt(T.href, _, M));
4140
+ }), Object.entries($).forEach(([_, M]) => {
4141
+ const y = btoa(encodeURIComponent(M));
4142
+ T.searchParams.set(_, y);
4143
+ }), E.url = T.href, (S = (A = this._definition) == null ? void 0 : A.metaframes) != null && S[p] && (this._definition = C(this._definition, (_) => {
4144
+ _.metaframes[p].url = T.href;
4134
4145
  }));
4135
4146
  }
4136
- }), { newDefinition: n, added: l, removed: u };
4147
+ }), { newDefinition: n, added: c, removed: l };
4137
4148
  }
4138
4149
  async setDefinition(e, s) {
4139
4150
  const n = this._definition, { newDefinition: i } = await this._applyDefinition(e, s);
@@ -4405,10 +4416,10 @@ class tt extends or {
4405
4416
  this.setOutputStateOnlyMetaframeInputMap(n, u), o.setOutputs(u);
4406
4417
  var r = !1;
4407
4418
  const l = Object.keys(u), c = {};
4408
- l.forEach((f, p) => {
4409
- const g = this.getInputsFromOutput(n, f);
4410
- g.length > 0 && g.forEach((y) => {
4411
- c[y.metaframe] || (c[y.metaframe] = {}), c[y.metaframe][y.pipe] = u[f], r = !0;
4419
+ l.forEach((f, h) => {
4420
+ const p = this.getInputsFromOutput(n, f);
4421
+ p.length > 0 && p.forEach((d) => {
4422
+ c[d.metaframe] || (c[d.metaframe] = {}), c[d.metaframe][d.pipe] = u[f], r = !0;
4412
4423
  });
4413
4424
  }), r && (this.setInputStateOnlyMetapageInstanceInputs(c), Object.keys(c).forEach((f) => {
4414
4425
  this._metaframes[f].setInputs(c[f]);
@@ -4429,41 +4440,41 @@ class tt extends or {
4429
4440
  break;
4430
4441
  const l = e.params, c = l.metaframe;
4431
4442
  let f = new URL(i.url);
4432
- f.hash = l.hash, this._injectedSecrets[c] && Object.entries(this._injectedSecrets[c]).forEach(([y, b]) => {
4433
- f = new URL(kt(f.href, y, b));
4434
- }), this._injectedQuerySecrets[c] && Object.entries(this._injectedQuerySecrets[c]).forEach(([y, b]) => {
4435
- const _ = btoa(encodeURIComponent(b));
4436
- f.searchParams.set(y, _);
4443
+ f.hash = l.hash, this._injectedSecrets[c] && Object.entries(this._injectedSecrets[c]).forEach(([d, b]) => {
4444
+ f = new URL(kt(f.href, d, b));
4445
+ }), this._injectedQuerySecrets[c] && Object.entries(this._injectedQuerySecrets[c]).forEach(([d, b]) => {
4446
+ const w = btoa(encodeURIComponent(b));
4447
+ f.searchParams.set(d, w);
4437
4448
  }), i.url = f.href;
4438
- let p = f.href;
4449
+ let h = f.href;
4439
4450
  if (this._injectedSecrets[c]) {
4440
- const y = this._originalSecretHashParams[c] || {};
4451
+ const d = this._originalSecretHashParams[c] || {};
4441
4452
  Object.keys(this._injectedSecrets[c]).forEach((b) => {
4442
- const _ = y[b];
4443
- if (_ === void 0) {
4444
- const M = new URL(p);
4445
- let v = M.hash.startsWith("#?") ? M.hash.slice(2) : M.hash.slice(1);
4446
- v = v.replace(/\?/g, "&");
4447
- const E = new URLSearchParams(v);
4448
- E.delete(b);
4449
- const P = E.toString();
4450
- M.hash = P ? M.hash.startsWith("#?") ? `?${P}` : P : "", p = M.href;
4453
+ const w = d[b];
4454
+ if (w === void 0) {
4455
+ const A = new URL(h);
4456
+ let S = A.hash.startsWith("#?") ? A.hash.slice(2) : A.hash.slice(1);
4457
+ S = S.replace(/\?/g, "&");
4458
+ const O = new URLSearchParams(S);
4459
+ O.delete(b);
4460
+ const $ = O.toString();
4461
+ A.hash = $ ? A.hash.startsWith("#?") ? `?${$}` : $ : "", h = A.href;
4451
4462
  } else {
4452
- const M = kt(p, b, _);
4453
- p = typeof M == "string" ? M : M.href;
4463
+ const A = kt(h, b, w);
4464
+ h = typeof A == "string" ? A : A.href;
4454
4465
  }
4455
4466
  });
4456
4467
  }
4457
4468
  if (this._injectedQuerySecrets[c]) {
4458
- const y = this._originalSecretQueryParams[c] || {};
4469
+ const d = this._originalSecretQueryParams[c] || {};
4459
4470
  Object.keys(this._injectedQuerySecrets[c]).forEach((b) => {
4460
- const _ = y[b], M = new URL(p);
4461
- _ === void 0 ? M.searchParams.delete(b) : M.searchParams.set(b, _), p = M.href;
4471
+ const w = d[b], A = new URL(h);
4472
+ w === void 0 ? A.searchParams.delete(b) : A.searchParams.set(b, w), h = A.href;
4462
4473
  });
4463
4474
  }
4464
- const g = new URL(p);
4465
- this._definition = C(this._definition, (y) => {
4466
- y.metaframes[c].url = g.href;
4475
+ const p = new URL(h);
4476
+ this._definition = C(this._definition, (d) => {
4477
+ d.metaframes[c].url = p.href;
4467
4478
  }), this._emitDefinitionEvent();
4468
4479
  }
4469
4480
  break;
@@ -4530,20 +4541,20 @@ const Gr = (t) => {
4530
4541
  const e = (c = (l = t == null ? void 0 : t.meta) == null ? void 0 : l.layouts) == null ? void 0 : c["react-grid-layout"], s = e == null ? void 0 : e.layout;
4531
4542
  if (!e || !s)
4532
4543
  throw new Error("No valid layout found in metapage definition");
4533
- const n = /* @__PURE__ */ new Set(), i = s.map((p, g) => {
4534
- const y = t.metaframes[p.i];
4535
- return y && ys(y.url) ? { index: g, y: p.y, id: p.i } : null;
4536
- }).filter((p) => p !== null);
4544
+ const n = /* @__PURE__ */ new Set(), i = s.map((h, p) => {
4545
+ const d = t.metaframes[h.i];
4546
+ return d && ys(d.url) ? { index: p, y: h.y, id: h.i } : null;
4547
+ }).filter((h) => h !== null);
4537
4548
  if (i.length > 0) {
4538
- const p = i.reduce((y, b) => b.y < y.y ? b : y), g = ((f = s.find((y) => y.i === p.id)) == null ? void 0 : f.y) ?? 0;
4539
- s.forEach((y) => {
4540
- y.y >= g && n.add(y.i);
4549
+ const h = i.reduce((d, b) => b.y < d.y ? b : d), p = ((f = s.find((d) => d.i === h.id)) == null ? void 0 : f.y) ?? 0;
4550
+ s.forEach((d) => {
4551
+ d.y >= p && n.add(d.i);
4541
4552
  });
4542
4553
  }
4543
- const o = Object.keys(t.metaframes).filter((p) => !n.has(p)), r = Object.keys(t.metaframes).filter((p) => n.has(p));
4544
- let a = s.filter((p) => o.includes(p.i));
4545
- a.sort((p, g) => p.y !== g.y ? p.y - g.y : p.x - g.x);
4546
- const u = a.reduce((p, g) => Math.max(p, g.y + g.h), 0);
4554
+ const o = Object.keys(t.metaframes).filter((h) => !n.has(h)), r = Object.keys(t.metaframes).filter((h) => n.has(h));
4555
+ let a = s.filter((h) => o.includes(h.i));
4556
+ a.sort((h, p) => h.y !== p.y ? h.y - p.y : h.x - p.x);
4557
+ const u = a.reduce((h, p) => Math.max(h, p.y + p.h), 0);
4547
4558
  return {
4548
4559
  visibleLayoutItems: a,
4549
4560
  hiddenMetaframeIds: new Set(r),
@@ -4552,7 +4563,7 @@ const Gr = (t) => {
4552
4563
  };
4553
4564
  };
4554
4565
  async function mo(t) {
4555
- var P, O, $, T;
4566
+ var $, E, j, T;
4556
4567
  let { url: e, definition: s, onOutputs: n, rootDiv: i, options: o = {} } = t;
4557
4568
  if (!e && !s)
4558
4569
  throw new Error("Either url or definition must be provided");
@@ -4565,34 +4576,34 @@ async function mo(t) {
4565
4576
  r.debug = o.debug || !1;
4566
4577
  try {
4567
4578
  await r.setDefinition(JSON.parse(JSON.stringify(s)));
4568
- } catch (w) {
4569
- throw r.dispose(), new Error(`Failed to set metapage definition: ${w}`);
4579
+ } catch (_) {
4580
+ throw r.dispose(), new Error(`Failed to set metapage definition: ${_}`);
4570
4581
  }
4571
4582
  const a = [];
4572
4583
  n && a.push(r.addListenerReturnDisposer(I.Outputs, n));
4573
- const u = (O = (P = s == null ? void 0 : s.meta) == null ? void 0 : P.layouts) == null ? void 0 : O["react-grid-layout"], l = u == null ? void 0 : u.layout;
4584
+ const u = (E = ($ = s == null ? void 0 : s.meta) == null ? void 0 : $.layouts) == null ? void 0 : E["react-grid-layout"], l = u == null ? void 0 : u.layout;
4574
4585
  if (!u || !l)
4575
4586
  throw new Error("No valid layout found in metapage definition");
4576
- let { visibleLayoutItems: c, hiddenMetaframeIds: f, visibleMetaframeIds: p } = Gr(r.getDefinition());
4587
+ let { visibleLayoutItems: c, hiddenMetaframeIds: f, visibleMetaframeIds: h } = Gr(r.getDefinition());
4577
4588
  if (c.length === 0)
4578
4589
  return {
4579
4590
  metapage: r,
4580
- setInputs: (w) => {
4581
- r.isDisposed() || r.setInputs(w);
4591
+ setInputs: (_) => {
4592
+ r.isDisposed() || r.setInputs(_);
4582
4593
  },
4583
- setOutputs: (w) => {
4584
- r.isDisposed() || r.setOutputs(w);
4594
+ setOutputs: (_) => {
4595
+ r.isDisposed() || r.setOutputs(_);
4585
4596
  },
4586
4597
  dispose: () => {
4587
- a.forEach((w) => w()), r.dispose();
4598
+ a.forEach((_) => _()), r.dispose();
4588
4599
  }
4589
4600
  };
4590
- c.sort((w, A) => w.y !== A.y ? w.y - A.y : w.x - A.x);
4591
- const g = {
4601
+ c.sort((_, M) => _.y !== M.y ? _.y - M.y : _.x - M.x);
4602
+ const p = {
4592
4603
  display: "grid",
4593
4604
  gridTemplateColumns: "repeat(1, 1fr)",
4594
4605
  gridAutoRows: "1fr",
4595
- gap: `${(($ = u.props.margin) == null ? void 0 : $[0]) || 10}px`,
4606
+ gap: `${((j = u.props.margin) == null ? void 0 : j[0]) || 10}px`,
4596
4607
  width: "100%",
4597
4608
  height: "100%",
4598
4609
  maxHeight: "100%",
@@ -4601,28 +4612,28 @@ async function mo(t) {
4601
4612
  alignContent: "start",
4602
4613
  alignItems: "start",
4603
4614
  overflow: "hidden"
4604
- }, y = {
4615
+ }, d = {
4605
4616
  width: "100%",
4606
4617
  height: "100%",
4607
4618
  overflow: "hidden",
4608
4619
  display: "flex",
4609
4620
  flexDirection: "column"
4610
4621
  }, b = document.createElement("div");
4611
- Object.assign(b.style, y);
4612
- const _ = document.createElement("div");
4613
- Object.assign(_.style, g);
4614
- const M = [];
4615
- for (const w of p) {
4616
- const A = l.find((d) => d.i === w);
4617
- if (!A)
4622
+ Object.assign(b.style, d);
4623
+ const w = document.createElement("div");
4624
+ Object.assign(w.style, p);
4625
+ const A = [];
4626
+ for (const _ of h) {
4627
+ const M = l.find((m) => m.i === _);
4628
+ if (!M)
4618
4629
  continue;
4619
- const h = r.getMetaframes()[w], L = await h.iframe;
4620
- if (!h)
4630
+ const y = r.getMetaframes()[_], L = await y.iframe;
4631
+ if (!y)
4621
4632
  continue;
4622
- M.push(A);
4633
+ A.push(M);
4623
4634
  const V = {
4624
- gridColumn: `${A.x + 1} / span ${A.w}`,
4625
- gridRow: `${A.y + 1} / span ${A.h}`,
4635
+ gridColumn: `${M.x + 1} / span ${M.w}`,
4636
+ gridRow: `${M.y + 1} / span ${M.h}`,
4626
4637
  position: "relative",
4627
4638
  overflowY: "hidden",
4628
4639
  width: "100%",
@@ -4631,31 +4642,31 @@ async function mo(t) {
4631
4642
  alignSelf: "stretch",
4632
4643
  justifySelf: "stretch"
4633
4644
  }, H = document.createElement("div");
4634
- H.classList.add("metaframe-container"), Object.assign(H.style, V), L.classList.add("metaframe"), L.style.position = "absolute", L.style.top = "0", L.style.left = "0", L.style.width = "100%", L.style.height = "100%", L.style.border = "0", L.style.overflow = "hidden", H.appendChild(L), _.appendChild(H);
4635
- }
4636
- const v = Math.max(...M.map((w) => w.x + w.w));
4637
- Math.max(...M.map((w) => w.y + w.h)), _.style.gridTemplateColumns = `repeat(${Math.max(1, v)}, 1fr)`;
4638
- const E = document.createElement("div");
4639
- E.style.position = "absolute", E.style.top = "-9999px", E.style.left = "-9999px", E.style.width = "1px", E.style.height = "1px", E.style.overflow = "hidden", E.style.pointerEvents = "none";
4640
- for (const w of Object.keys(r.getMetaframes()).filter((A) => f.has(A))) {
4641
- const A = r.getMetaframes()[w];
4642
- if (!A)
4645
+ H.classList.add("metaframe-container"), Object.assign(H.style, V), L.classList.add("metaframe"), L.style.position = "absolute", L.style.top = "0", L.style.left = "0", L.style.width = "100%", L.style.height = "100%", L.style.border = "0", L.style.overflow = "hidden", H.appendChild(L), w.appendChild(H);
4646
+ }
4647
+ const S = Math.max(...A.map((_) => _.x + _.w));
4648
+ Math.max(...A.map((_) => _.y + _.h)), w.style.gridTemplateColumns = `repeat(${Math.max(1, S)}, 1fr)`;
4649
+ const O = document.createElement("div");
4650
+ O.style.position = "absolute", O.style.top = "-9999px", O.style.left = "-9999px", O.style.width = "1px", O.style.height = "1px", O.style.overflow = "hidden", O.style.pointerEvents = "none";
4651
+ for (const _ of Object.keys(r.getMetaframes()).filter((M) => f.has(M))) {
4652
+ const M = r.getMetaframes()[_];
4653
+ if (!M)
4643
4654
  continue;
4644
- const h = document.createElement("div");
4645
- h.setAttribute("data-metaframe-id", w), h.style.width = "100px", h.style.height = "100px";
4655
+ const y = document.createElement("div");
4656
+ y.setAttribute("data-metaframe-id", _), y.style.width = "100px", y.style.height = "100px";
4646
4657
  let L;
4647
- A.iframe ? L = await A.iframe : (L = document.createElement("iframe"), L.src = A.url, L.style.border = "none", L.style.width = "100%", L.style.height = "100%"), h.appendChild(L), E.appendChild(h);
4658
+ M.iframe ? L = await M.iframe : (L = document.createElement("iframe"), L.src = M.url, L.style.border = "none", L.style.width = "100%", L.style.height = "100%"), y.appendChild(L), O.appendChild(y);
4648
4659
  }
4649
- return b.appendChild(_), b.appendChild(E), i.appendChild(b), {
4660
+ return b.appendChild(w), b.appendChild(O), i.appendChild(b), {
4650
4661
  metapage: r,
4651
- setInputs: (w) => {
4652
- r.isDisposed() || r.setInputs(w);
4662
+ setInputs: (_) => {
4663
+ r.isDisposed() || r.setInputs(_);
4653
4664
  },
4654
- setOutputs: (w) => {
4655
- r.isDisposed() || r.setOutputs(w);
4665
+ setOutputs: (_) => {
4666
+ r.isDisposed() || r.setOutputs(_);
4656
4667
  },
4657
4668
  dispose: () => {
4658
- a.forEach((w) => w()), r.dispose(), b.parentNode && b.parentNode.removeChild(b);
4669
+ a.forEach((_) => _()), r.dispose(), b.parentNode && b.parentNode.removeChild(b);
4659
4670
  }
4660
4671
  };
4661
4672
  }
@@ -4665,12 +4676,12 @@ const go = (t, e) => {
4665
4676
  if (!s || !n)
4666
4677
  throw new Error("No valid layout found in metapage definition");
4667
4678
  const i = /* @__PURE__ */ new Set(), o = n.map((l, c) => {
4668
- var p;
4669
- const f = (p = t == null ? void 0 : t.metaframes) == null ? void 0 : p[l.i];
4679
+ var h;
4680
+ const f = (h = t == null ? void 0 : t.metaframes) == null ? void 0 : h[l.i];
4670
4681
  return f && ys(f.url) ? { index: c, y: l.y, id: l.i } : null;
4671
4682
  }).filter((l) => l !== null);
4672
4683
  if (o.length > 0) {
4673
- const l = o.reduce((f, p) => p.y < f.y ? p : f), c = ((u = n.find((f) => f.i === l.id)) == null ? void 0 : u.y) ?? 0;
4684
+ const l = o.reduce((f, h) => h.y < f.y ? h : f), c = ((u = n.find((f) => f.i === l.id)) == null ? void 0 : u.y) ?? 0;
4674
4685
  n.forEach((f) => {
4675
4686
  f.y >= c && i.add(f.i);
4676
4687
  });
@@ -4726,18 +4737,18 @@ async function bo(t) {
4726
4737
  a.debug = o;
4727
4738
  try {
4728
4739
  await a.setDefinition(JSON.parse(JSON.stringify(r)));
4729
- } catch (p) {
4730
- throw a.dispose(), new Error(`Failed to set metapage definition: ${p}`);
4740
+ } catch (h) {
4741
+ throw a.dispose(), new Error(`Failed to set metapage definition: ${h}`);
4731
4742
  }
4732
4743
  const u = [];
4733
- if (s && u.push(a.addListenerReturnDisposer(I.Outputs, (p) => {
4734
- s(p[It] || {});
4744
+ if (s && u.push(a.addListenerReturnDisposer(I.Outputs, (h) => {
4745
+ s(h[It] || {});
4735
4746
  })), n) {
4736
- let p = e;
4737
- u.push(a.addListenerReturnDisposer(I.DefinitionUpdate, (g) => {
4738
- var b, _, M;
4739
- const y = (M = (_ = (b = g.definition) == null ? void 0 : b.metaframes) == null ? void 0 : _[It]) == null ? void 0 : M.url;
4740
- y && y !== p && (p = y, n(y));
4747
+ let h = e;
4748
+ u.push(a.addListenerReturnDisposer(I.DefinitionUpdate, (p) => {
4749
+ var b, w, A;
4750
+ const d = (A = (w = (b = p.definition) == null ? void 0 : b.metaframes) == null ? void 0 : w[It]) == null ? void 0 : A.url;
4751
+ d && d !== h && (h = d, n(d));
4741
4752
  }));
4742
4753
  }
4743
4754
  const l = a.getMetaframes()[It];
@@ -4746,14 +4757,14 @@ async function bo(t) {
4746
4757
  const c = await l.iframe, f = document.createElement("div");
4747
4758
  return f.style.width = "100%", f.style.height = "100%", f.style.margin = "0", f.style.padding = "0", f.style.overflow = "hidden", f.style.position = "relative", c.style.position = "absolute", c.style.top = "0", c.style.left = "0", c.style.width = "100%", c.style.height = "100%", c.style.border = "none", c.style.margin = "0", c.style.padding = "0", f.appendChild(c), i.appendChild(f), {
4748
4759
  metapage: a,
4749
- setInputs: (p) => {
4750
- a.isDisposed() || a.setInputs({ [It]: p });
4760
+ setInputs: (h) => {
4761
+ a.isDisposed() || a.setInputs({ [It]: h });
4751
4762
  },
4752
- setOutputs: (p) => {
4753
- a.isDisposed() || a.setOutputs({ [It]: p });
4763
+ setOutputs: (h) => {
4764
+ a.isDisposed() || a.setOutputs({ [It]: h });
4754
4765
  },
4755
4766
  dispose: () => {
4756
- u.forEach((p) => p()), a.dispose(), f.parentNode && f.parentNode.removeChild(f);
4767
+ u.forEach((h) => h()), a.dispose(), f.parentNode && f.parentNode.removeChild(f);
4757
4768
  }
4758
4769
  };
4759
4770
  }