@metapages/metapage 1.10.10 → 1.10.11

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
@@ -5,7 +5,7 @@ const ms = [
5
5
  "0.6",
6
6
  "1",
7
7
  "2"
8
- ], gs = ["0.2", "0.3", "1", "2"], _e = "2", we = "2", Xr = "metaframe.json", Yr = "metapage/definition", qr = "metapage/state", ks = gs[gs.length - 1], On = ms[ms.length - 1], Rn = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, bs = (t) => {
8
+ ], gs = ["0.2", "0.3", "1", "2"], _e = "2", we = "2", Xr = "metaframe.json", Yr = "metapage/definition", qr = "metapage/state", Ls = gs[gs.length - 1], On = ms[ms.length - 1], Rn = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, bs = (t) => {
9
9
  if (typeof t != "string")
10
10
  throw new TypeError("Invalid argument expected string");
11
11
  const e = t.match(Rn);
@@ -27,7 +27,7 @@ const ms = [
27
27
  return n;
28
28
  }
29
29
  return 0;
30
- }, z = (t, e) => {
30
+ }, V = (t, e) => {
31
31
  const s = bs(t), n = bs(e), i = s.pop(), o = n.pop(), r = vs(s, n);
32
32
  return r !== 0 ? r : i && o ? vs(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
33
33
  };
@@ -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, h = r.retryDelay, p = r.retryOn;
60
+ var f = r.retries, y = 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,7 +65,7 @@ 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
- h = c.retryDelay;
68
+ y = 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)
@@ -74,43 +74,43 @@ var Us = { exports: {} };
74
74
  else
75
75
  throw new i("retryOn property expects an array or function");
76
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($) {
77
+ var _ = function(w) {
78
+ var S = typeof Request < "u" && l instanceof Request ? l.clone() : l;
79
+ o(S, c).then(function($) {
80
80
  if (Array.isArray(p) && p.indexOf($.status) === -1)
81
81
  d($);
82
82
  else if (typeof p == "function")
83
83
  try {
84
- return Promise.resolve(p(S, null, $)).then(function(E) {
85
- E ? A(S, null, $) : d($);
84
+ return Promise.resolve(p(w, null, $)).then(function(R) {
85
+ R ? M(w, null, $) : d($);
86
86
  }).catch(b);
87
- } catch (E) {
88
- b(E);
87
+ } catch (R) {
88
+ b(R);
89
89
  }
90
90
  else
91
- S < f ? A(S, null, $) : d($);
91
+ w < f ? M(w, null, $) : d($);
92
92
  }).catch(function($) {
93
93
  if (typeof p == "function")
94
94
  try {
95
- Promise.resolve(p(S, $, null)).then(function(E) {
96
- E ? A(S, $, null) : b($);
97
- }).catch(function(E) {
98
- b(E);
95
+ Promise.resolve(p(w, $, null)).then(function(R) {
96
+ R ? M(w, $, null) : b($);
97
+ }).catch(function(R) {
98
+ b(R);
99
99
  });
100
- } catch (E) {
101
- b(E);
100
+ } catch (R) {
101
+ b(R);
102
102
  }
103
103
  else
104
- S < f ? A(S, $, null) : b($);
104
+ w < f ? M(w, $, null) : b($);
105
105
  });
106
106
  };
107
- function A(S, O, $) {
108
- var E = typeof h == "function" ? h(S, O, $) : h;
107
+ function M(w, S, $) {
108
+ var R = typeof y == "function" ? y(w, S, $) : y;
109
109
  setTimeout(function() {
110
- w(++S);
111
- }, E);
110
+ _(++w);
111
+ }, R);
112
112
  }
113
- w(0);
113
+ _(0);
114
114
  });
115
115
  };
116
116
  };
@@ -128,7 +128,7 @@ const Ge = /* @__PURE__ */ Je(In), J = {
128
128
  Remove: "remove",
129
129
  Replace: "replace",
130
130
  Add: "add"
131
- }, Hs = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Cn = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), ie = Symbol.iterator, nt = {
131
+ }, Hs = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Cn = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), ie = Symbol.iterator, rt = {
132
132
  mutable: "mutable",
133
133
  immutable: "immutable"
134
134
  }, Qe = {};
@@ -152,30 +152,30 @@ function Ke(t) {
152
152
  function Xe(t) {
153
153
  return Object.getPrototypeOf(t) === Map.prototype;
154
154
  }
155
- function et(t) {
155
+ function nt(t) {
156
156
  var e;
157
157
  return (e = t.copy) !== null && e !== void 0 ? e : t.original;
158
158
  }
159
159
  function Rt(t) {
160
- return !!D(t);
160
+ return !!T(t);
161
161
  }
162
- function D(t) {
162
+ function T(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 = D(t);
167
+ const s = T(t);
168
168
  return s ? (e = s.copy) !== null && e !== void 0 ? e : s.original : t;
169
169
  }
170
- function ut(t, e) {
170
+ function ct(t, e) {
171
171
  if (!t || typeof t != "object")
172
172
  return !1;
173
173
  let s;
174
- return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((s = e.mark(t, nt)) === nt.immutable || typeof s == "function");
174
+ return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((s = e.mark(t, rt)) === rt.immutable || typeof s == "function");
175
175
  }
176
176
  function Ns(t, e = []) {
177
177
  if (Object.hasOwnProperty.call(t, "key")) {
178
- const s = t.parent.copy, n = D(bt(s, t.key));
178
+ const s = t.parent.copy, n = T(_t(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;
@@ -196,17 +196,17 @@ function Ns(t, e = []) {
196
196
  function xt(t) {
197
197
  return Array.isArray(t) ? 1 : t instanceof Map ? 2 : t instanceof Set ? 3 : 0;
198
198
  }
199
- function bt(t, e) {
199
+ function _t(t, e) {
200
200
  return xt(t) === 2 ? t.get(e) : t[e];
201
201
  }
202
202
  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 = D(t);
207
- return (s ? et(s) : t)[e];
206
+ const s = T(t);
207
+ return (s ? nt(s) : t)[e];
208
208
  }
209
- function gt(t, e) {
209
+ function bt(t, e) {
210
210
  return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
211
211
  }
212
212
  function je(t) {
@@ -223,7 +223,7 @@ function Ct(t, e) {
223
223
  function $n(t, e) {
224
224
  for (let s = 0; s < e.length - 1; s += 1) {
225
225
  const n = e[s];
226
- if (t = bt(xt(t) === 3 ? Array.from(t) : t, n), typeof t != "object")
226
+ if (t = _t(xt(t) === 3 ? Array.from(t) : t, n), typeof t != "object")
227
227
  throw new Error(`Cannot resolve patch at '${e.join("/")}'.`);
228
228
  }
229
229
  return t;
@@ -261,8 +261,8 @@ function Fs(t, e) {
261
261
  return new n(t);
262
262
  }
263
263
  return new Map(t);
264
- } else if (e != null && e.mark && (s = e.mark(t, nt), s !== void 0) && s !== nt.mutable) {
265
- if (s === nt.immutable)
264
+ } else if (e != null && e.mark && (s = e.mark(t, rt), s !== void 0) && s !== rt.mutable) {
265
+ if (s === rt.immutable)
266
266
  return Pn(t);
267
267
  if (typeof s == "function") {
268
268
  if (e.enablePatches || e.enableAutoFreeze)
@@ -280,11 +280,11 @@ function Fs(t, e) {
280
280
  } else
281
281
  throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
282
282
  }
283
- function q(t) {
283
+ function tt(t) {
284
284
  t.copy || (t.copy = Fs(t.original, t.options));
285
285
  }
286
286
  function Ut(t) {
287
- if (!ut(t))
287
+ if (!ct(t))
288
288
  return Ye(t);
289
289
  if (Array.isArray(t))
290
290
  return t.map(Ut);
@@ -315,9 +315,9 @@ function Ut(t) {
315
315
  function re(t) {
316
316
  return Rt(t) ? Ut(t) : t;
317
317
  }
318
- function ht(t) {
318
+ function yt(t) {
319
319
  var e;
320
- t.assignedMap = (e = t.assignedMap) !== null && e !== void 0 ? e : /* @__PURE__ */ new Map(), t.operated || (t.operated = !0, t.parent && ht(t.parent));
320
+ t.assignedMap = (e = t.assignedMap) !== null && e !== void 0 ? e : /* @__PURE__ */ new Map(), t.operated || (t.operated = !0, t.parent && yt(t.parent));
321
321
  }
322
322
  function Os() {
323
323
  throw new Error("Cannot modify frozen object");
@@ -382,14 +382,14 @@ function qe(t, e) {
382
382
  t.forEach((n, i) => e(i, n, t));
383
383
  }
384
384
  function Bs(t, e, s) {
385
- if (Rt(t) || !ut(t, s) || e.has(t) || Object.isFrozen(t))
385
+ if (Rt(t) || !ct(t, s) || e.has(t) || Object.isFrozen(t))
386
386
  return;
387
387
  const n = t instanceof Set, i = n ? /* @__PURE__ */ new Map() : void 0;
388
388
  if (e.add(t), qe(t, (o, r) => {
389
389
  var a;
390
390
  if (Rt(r)) {
391
- const u = D(r);
392
- q(u);
391
+ const u = T(r);
392
+ tt(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);
395
395
  } else
@@ -403,14 +403,14 @@ function Bs(t, e, s) {
403
403
  }
404
404
  function Dn(t, e) {
405
405
  const s = t.type === 3 ? t.setMap : t.copy;
406
- t.finalities.revoke.length > 1 && t.assignedMap.get(e) && s && Bs(bt(s, e), t.finalities.handledSet, t.options);
406
+ t.finalities.revoke.length > 1 && t.assignedMap.get(e) && s && Bs(_t(s, e), t.finalities.handledSet, t.options);
407
407
  }
408
408
  function Te(t) {
409
409
  t.type === 3 && t.copy && (t.copy.clear(), t.setMap.forEach((e) => {
410
410
  t.copy.add(Ye(e));
411
411
  }));
412
412
  }
413
- function Le(t, e, s, n) {
413
+ function ke(t, e, s, n) {
414
414
  if (t.operated && t.assignedMap && t.assignedMap.size > 0 && !t.finalized) {
415
415
  if (s && n) {
416
416
  const o = Ns(t);
@@ -420,17 +420,17 @@ function Le(t, e, s, n) {
420
420
  }
421
421
  }
422
422
  function Ze(t, e, s, n) {
423
- const i = D(s);
423
+ const i = T(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;
427
- if (gt(bt(u, e), s)) {
427
+ if (bt(_t(u, e), s)) {
428
428
  let l = i.original;
429
- i.copy && (l = i.copy), Te(t), Le(t, n, o, r), t.options.enableAutoFreeze && (t.options.updatedValues = (a = t.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(l, i.original)), Qt(u, e, l);
429
+ i.copy && (l = i.copy), Te(t), ke(t, n, o, r), t.options.enableAutoFreeze && (t.options.updatedValues = (a = t.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(l, i.original)), Qt(u, e, l);
430
430
  }
431
- }), t.options.enableAutoFreeze && i.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), ut(s, t.options) && t.finalities.draft.push(() => {
431
+ }), t.options.enableAutoFreeze && i.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), ct(s, t.options) && t.finalities.draft.push(() => {
432
432
  const o = t.type === 3 ? t.setMap : t.copy;
433
- gt(bt(o, e), s) && Dn(t, e);
433
+ bt(_t(o, e), s) && Dn(t, e);
434
434
  });
435
435
  }
436
436
  function jn(t, e, s, n, i) {
@@ -471,24 +471,24 @@ 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]), h = Ct(f, i);
474
+ const f = e.concat([c - 1]), y = Ct(f, i);
475
475
  n.push({
476
476
  op: J.Remove,
477
- path: h
477
+ path: y
478
478
  });
479
479
  }
480
480
  }
481
481
  }
482
482
  function Tn({ original: t, copy: e, assignedMap: s }, n, i, o, r) {
483
483
  s.forEach((a, u) => {
484
- const l = bt(t, u), c = re(bt(e, u)), f = a ? Bt(t, u) ? J.Replace : J.Add : J.Remove;
485
- if (gt(l, c) && f === J.Replace)
484
+ const l = _t(t, u), c = re(_t(e, u)), f = a ? Bt(t, u) ? J.Replace : J.Add : J.Remove;
485
+ if (bt(l, c) && f === J.Replace)
486
486
  return;
487
- const h = n.concat(u), p = Ct(h, r);
487
+ const y = n.concat(u), p = Ct(y, r);
488
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
- function Ln({ original: t, copy: e }, s, n, i, o) {
491
+ function kn({ original: t, copy: e }, s, n, i, o) {
492
492
  let r = 0;
493
493
  t.forEach((a) => {
494
494
  if (!e.has(a)) {
@@ -529,49 +529,49 @@ function Wt(t, e, s, n) {
529
529
  case 1:
530
530
  return jn(t, e, s, n, i);
531
531
  case 3:
532
- return Ln(t, e, s, n, i);
532
+ return kn(t, e, s, n, i);
533
533
  }
534
534
  }
535
- let kn = !1;
535
+ let Ln = !1;
536
536
  const ce = (t, e, s = !1) => {
537
- if (typeof t == "object" && t !== null && (!ut(t, e) || s) && !kn)
537
+ if (typeof t == "object" && t !== null && (!ct(t, e) || s) && !Ln)
538
538
  throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
539
- }, ke = {
539
+ }, Le = {
540
540
  get size() {
541
- return et(D(this)).size;
541
+ return nt(T(this)).size;
542
542
  },
543
543
  has(t) {
544
- return et(D(this)).has(t);
544
+ return nt(T(this)).has(t);
545
545
  },
546
546
  set(t, e) {
547
- const s = D(this), n = et(s);
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;
547
+ const s = T(this), n = nt(s);
548
+ return (!n.has(t) || !bt(n.get(t), e)) && (tt(s), yt(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 = D(this);
554
- return q(e), ht(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
553
+ const e = T(this);
554
+ return tt(e), yt(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 = D(this);
557
+ const t = T(this);
558
558
  if (this.size) {
559
- q(t), ht(t), t.assignedMap = /* @__PURE__ */ new Map();
559
+ tt(t), yt(t), t.assignedMap = /* @__PURE__ */ new Map();
560
560
  for (const [e] of t.original)
561
561
  t.assignedMap.set(e, !1);
562
562
  t.copy.clear();
563
563
  }
564
564
  },
565
565
  forEach(t, e) {
566
- const s = D(this);
567
- et(s).forEach((n, i) => {
566
+ const s = T(this);
567
+ nt(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 = 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
- if (n.options.strict && ce(i, n.options, o), o || n.finalized || !ut(i, n.options) || i !== n.original.get(t))
573
+ const n = T(this), i = nt(n).get(t), o = ((s = (e = n.options).mark) === null || s === void 0 ? void 0 : s.call(e, i, rt)) === rt.mutable;
574
+ if (n.options.strict && ce(i, n.options, o), o || n.finalized || !ct(i, n.options) || i !== n.original.get(t))
575
575
  return i;
576
576
  const r = Qe.createDraft({
577
577
  original: i,
@@ -580,10 +580,10 @@ const ce = (t, e, s = !1) => {
580
580
  finalities: n.finalities,
581
581
  options: n.options
582
582
  });
583
- return q(n), n.copy.set(t, r), r;
583
+ return tt(n), n.copy.set(t, r), r;
584
584
  },
585
585
  keys() {
586
- return et(D(this)).keys();
586
+ return nt(T(this)).keys();
587
587
  },
588
588
  values() {
589
589
  const t = this.keys();
@@ -617,15 +617,15 @@ const ce = (t, e, s = !1) => {
617
617
  [ie]() {
618
618
  return this.entries();
619
619
  }
620
- }, Un = Reflect.ownKeys(ke), Rs = (t, e, { isValuesIterator: s }) => () => {
620
+ }, Un = Reflect.ownKeys(Le), Rs = (t, e, { isValuesIterator: s }) => () => {
621
621
  var n, i;
622
622
  const o = e.next();
623
623
  if (o.done)
624
624
  return o;
625
625
  const r = o.value;
626
626
  let a = t.setMap.get(r);
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
- if (t.options.strict && ce(r, t.options, l), !l && !u && ut(r, t.options) && !t.finalized && t.original.has(r)) {
627
+ const u = T(a), l = ((i = (n = t.options).mark) === null || i === void 0 ? void 0 : i.call(n, a, rt)) === rt.mutable;
628
+ if (t.options.strict && ce(r, t.options, l), !l && !u && ct(r, t.options) && !t.finalized && t.original.has(r)) {
629
629
  const c = Qe.createDraft({
630
630
  original: r,
631
631
  parentDraft: t,
@@ -642,40 +642,40 @@ const ce = (t, e, s = !1) => {
642
642
  };
643
643
  }, le = {
644
644
  get size() {
645
- return D(this).setMap.size;
645
+ return T(this).setMap.size;
646
646
  },
647
647
  has(t) {
648
- const e = D(this);
648
+ const e = T(this);
649
649
  if (e.setMap.has(t))
650
650
  return !0;
651
- q(e);
652
- const s = D(t);
651
+ tt(e);
652
+ const s = T(t);
653
653
  return !!(s && e.setMap.has(s.original));
654
654
  },
655
655
  add(t) {
656
- const e = D(this);
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;
656
+ const e = T(this);
657
+ return this.has(t) || (tt(e), yt(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 = D(this);
663
- q(e), ht(e);
664
- const s = D(t);
662
+ const e = T(this);
663
+ tt(e), yt(e);
664
+ const s = T(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 = D(this);
671
- q(t), ht(t);
670
+ const t = T(this);
671
+ tt(t), yt(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 = D(this);
678
- q(t);
677
+ const t = T(this);
678
+ tt(t);
679
679
  const e = t.setMap.keys();
680
680
  return {
681
681
  [Symbol.iterator]: () => this.values(),
@@ -683,8 +683,8 @@ const ce = (t, e, s = !1) => {
683
683
  };
684
684
  },
685
685
  entries() {
686
- const t = D(this);
687
- q(t);
686
+ const t = T(this);
687
+ tt(t);
688
688
  const e = t.setMap.keys();
689
689
  return {
690
690
  [Symbol.iterator]: () => this.entries(),
@@ -740,12 +740,12 @@ const Hn = Reflect.ownKeys(le), zs = {
740
740
  let r;
741
741
  if (t.options.mark) {
742
742
  const l = e === "size" && (t.original instanceof Map || t.original instanceof Set) ? Reflect.get(t.original, e) : Reflect.get(t.original, e, s);
743
- if (r = t.options.mark(l, nt), r === nt.mutable)
743
+ if (r = t.options.mark(l, rt), r === rt.mutable)
744
744
  return t.options.strict && ce(l, t.options, !0), l;
745
745
  }
746
- const a = et(t);
746
+ const a = nt(t);
747
747
  if (a instanceof Map && Un.includes(e))
748
- return e === "size" ? Object.getOwnPropertyDescriptor(ke, "size").get.call(t.proxy) : ke[e].bind(t.proxy);
748
+ return e === "size" ? Object.getOwnPropertyDescriptor(Le, "size").get.call(t.proxy) : Le[e].bind(t.proxy);
749
749
  if (a instanceof Set && Hn.includes(e))
750
750
  return e === "size" ? Object.getOwnPropertyDescriptor(le, "size").get.call(t.proxy) : le[e].bind(t.proxy);
751
751
  if (!Bt(a, e)) {
@@ -756,18 +756,18 @@ const Hn = Reflect.ownKeys(le), zs = {
756
756
  ) : void 0;
757
757
  }
758
758
  const u = a[e];
759
- if (t.options.strict && ce(u, t.options), t.finalized || !ut(u, t.options))
759
+ if (t.options.strict && ce(u, t.options), t.finalized || !ct(u, t.options))
760
760
  return u;
761
761
  if (u === Me(t.original, e)) {
762
- if (q(t), t.copy[e] = ts({
762
+ if (tt(t), t.copy[e] = ts({
763
763
  original: t.original[e],
764
764
  parentDraft: t,
765
765
  key: t.type === 1 ? Number(e) : e,
766
766
  finalities: t.finalities,
767
767
  options: t.options
768
768
  }), typeof r == "function") {
769
- const l = D(t.copy[e]);
770
- return q(l), ht(l), l.copy;
769
+ const l = T(t.copy[e]);
770
+ return tt(l), yt(l), l.copy;
771
771
  }
772
772
  return t.copy[e];
773
773
  }
@@ -780,20 +780,20 @@ const Hn = Reflect.ownKeys(le), zs = {
780
780
  let i;
781
781
  if (t.type === 1 && e !== "length" && !(Number.isInteger(i = Number(e)) && i >= 0 && (e === 0 || i === 0 || String(i) === String(e))))
782
782
  throw new Error("Only supports setting array indices and the 'length' property.");
783
- const o = Ss(et(t), e);
783
+ const o = Ss(nt(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 = D(r);
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);
786
+ const r = Me(nt(t), e), a = T(r);
787
+ return a && bt(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) : (bt(s, r) && (s !== void 0 || Bt(t.original, e)) || (tt(t), yt(t), Bt(t.original, e) && bt(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) {
790
- return e in et(t);
790
+ return e in nt(t);
791
791
  },
792
792
  ownKeys(t) {
793
- return Reflect.ownKeys(et(t));
793
+ return Reflect.ownKeys(nt(t));
794
794
  },
795
795
  getOwnPropertyDescriptor(t, e) {
796
- const s = et(t), n = Reflect.getOwnPropertyDescriptor(s, e);
796
+ const s = nt(t), n = Reflect.getOwnPropertyDescriptor(s, e);
797
797
  return n && {
798
798
  writable: !0,
799
799
  configurable: t.type !== 1 || e !== "length",
@@ -812,7 +812,7 @@ const Hn = Reflect.ownKeys(le), zs = {
812
812
  },
813
813
  deleteProperty(t, e) {
814
814
  var s;
815
- return t.type === 1 ? zs.set.call(this, t, e, void 0, t.proxy) : (Me(t.original, e) !== void 0 || e in t.original ? (q(t), ht(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
815
+ return t.type === 1 ? zs.set.call(this, t, e, void 0, t.proxy) : (Me(t.original, e) !== void 0 || e in t.original ? (tt(t), yt(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
816
816
  }
817
817
  };
818
818
  function ts(t) {
@@ -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, h) => {
835
+ c.finalities.draft.push((f, y) => {
836
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);
837
+ const b = T(u);
838
+ let _ = c.type === 3 ? c.setMap : c.copy;
839
+ const M = _t(_, n), w = T(M);
840
+ if (w) {
841
+ let S = w.original;
842
+ w.operated && (S = Ye(M)), Te(w), ke(w, Wt, f, y), c.options.enableAutoFreeze && (c.options.updatedValues = (p = c.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(S, w.original)), Qt(_, n, S);
843
843
  }
844
- (d = b.callbacks) === null || d === void 0 || d.forEach((O) => {
845
- O(f, h);
844
+ (d = b.callbacks) === null || d === void 0 || d.forEach((S) => {
845
+ S(f, y);
846
846
  });
847
847
  });
848
848
  } else {
849
- const c = D(u);
850
- c.finalities.draft.push((f, h) => {
851
- Te(c), Le(c, Wt, f, h);
849
+ const c = T(u);
850
+ c.finalities.draft.push((f, y) => {
851
+ Te(c), ke(c, Wt, f, y);
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 = D(t), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : t, u = !!e.length;
859
+ const r = T(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);
@@ -877,7 +877,7 @@ function Fn(t, e) {
877
877
  };
878
878
  let i, o;
879
879
  e.enablePatches && (i = [], o = []);
880
- const a = ((s = e.mark) === null || s === void 0 ? void 0 : s.call(e, t, nt)) === nt.mutable || !ut(t, e) ? t : ts({
880
+ const a = ((s = e.mark) === null || s === void 0 ? void 0 : s.call(e, t, rt)) === rt.mutable || !ct(t, e) ? t : ts({
881
881
  original: t,
882
882
  parentDraft: null,
883
883
  finalities: 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 = D(r);
897
+ const u = T(r);
898
898
  if (u && e && u.finalities === e.finalities) {
899
899
  t.isContainDraft = !0;
900
900
  const l = u.original;
@@ -909,8 +909,8 @@ function Ue(t) {
909
909
  }
910
910
  function Vs(t) {
911
911
  var e;
912
- const s = D(t);
913
- if (!ut(t, s == null ? void 0 : s.options))
912
+ const s = T(t);
913
+ if (!ct(t, s == null ? void 0 : s.options))
914
914
  return t;
915
915
  const n = xt(t);
916
916
  if (s && !s.operated)
@@ -929,7 +929,7 @@ function Vs(t) {
929
929
  } else
930
930
  i = t;
931
931
  if (qe(i, (r, a) => {
932
- if (s && gt(bt(s.original, r), a))
932
+ if (s && bt(_t(s.original, r), a))
933
933
  return;
934
934
  const u = Vs(a);
935
935
  u !== a && (i === t && o(), Qt(i, r, u));
@@ -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(E, ...j) {
954
- return e(E, (T) => s.call(this, T, ...j), n);
953
+ return function(R, ...k) {
954
+ return e(R, (L) => s.call(this, L, ...k), 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, h = Array.isArray(c.mark) ? (E, j) => {
962
- for (const T of c.mark) {
963
- if (typeof T != "function")
964
- throw new Error(`Invalid mark: ${T}, 'mark' should be a function.`);
965
- const _ = T(E, j);
966
- if (_)
967
- return _;
961
+ const f = Rt(u) ? Es(u) : u, y = Array.isArray(c.mark) ? (R, k) => {
962
+ for (const L of c.mark) {
963
+ if (typeof L != "function")
964
+ throw new Error(`Invalid mark: ${L}, 'mark' should be a function.`);
965
+ const O = L(R, k);
966
+ if (O)
967
+ return O;
968
968
  }
969
- } : c.mark, p = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, d = (r = c.strict) !== null && r !== void 0 ? r : !1, w = {
969
+ } : c.mark, p = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, d = (r = c.strict) !== null && r !== void 0 ? r : !1, _ = {
970
970
  enableAutoFreeze: (a = c.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
971
- mark: h,
971
+ mark: y,
972
972
  strict: d,
973
973
  enablePatches: p
974
974
  };
975
- if (!ut(f, w) && typeof f == "object" && f !== null)
975
+ if (!ct(f, _) && 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 [A, S] = Fn(f, w);
977
+ const [M, w] = Fn(f, _);
978
978
  if (typeof n != "function") {
979
- if (!ut(f, w))
979
+ if (!ct(f, _))
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 [A, S];
981
+ return [M, w];
982
982
  }
983
- let O;
983
+ let S;
984
984
  try {
985
- O = l(A);
986
- } catch (E) {
987
- throw je(D(A)), E;
985
+ S = l(M);
986
+ } catch (R) {
987
+ throw je(T(M)), R;
988
988
  }
989
- const $ = (E) => {
990
- const j = D(A);
991
- if (!Rt(E)) {
992
- if (E !== void 0 && !gt(E, A) && (j != null && j.operated))
989
+ const $ = (R) => {
990
+ const k = T(M);
991
+ if (!Rt(R)) {
992
+ if (R !== void 0 && !bt(R, M) && (k != null && k.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 _ = 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,
994
+ const O = R == null ? void 0 : R[Cn];
995
+ if (O) {
996
+ const A = O[0];
997
+ return _.strict && typeof R == "object" && R !== null && Ue({
998
+ rootDraft: k,
999
+ value: R,
1000
1000
  useRawReturn: !0
1001
- }), S([M]);
1001
+ }), w([A]);
1002
1002
  }
1003
- if (E !== void 0)
1004
- return typeof E == "object" && E !== null && Ue({ rootDraft: j, value: E }), S([E]);
1003
+ if (R !== void 0)
1004
+ return typeof R == "object" && R !== null && Ue({ rootDraft: k, value: R }), w([R]);
1005
1005
  }
1006
- if (E === A || E === void 0)
1007
- return S([]);
1008
- const T = D(E);
1009
- if (w === T.options) {
1010
- if (T.operated)
1006
+ if (R === M || R === void 0)
1007
+ return w([]);
1008
+ const L = T(R);
1009
+ if (_ === L.options) {
1010
+ if (L.operated)
1011
1011
  throw new Error("Cannot return a modified child draft.");
1012
- return S([Es(E)]);
1012
+ return w([Es(R)]);
1013
1013
  }
1014
- return S([E]);
1014
+ return w([R]);
1015
1015
  };
1016
- return O instanceof Promise ? O.then($, (E) => {
1017
- throw je(D(A)), E;
1018
- }) : $(O);
1016
+ return S instanceof Promise ? S.then($, (R) => {
1017
+ throw je(T(M)), R;
1018
+ }) : $(S);
1019
1019
  };
1020
1020
  }, C = Bn();
1021
1021
  Object.prototype.constructor.toString();
@@ -1046,7 +1046,7 @@ const Ws = (t) => {
1046
1046
  }
1047
1047
  if (!e)
1048
1048
  throw 'Missing "version" argument';
1049
- if (z(e, we) > 0)
1049
+ if (V(e, we) > 0)
1050
1050
  try {
1051
1051
  return await (await zn(`https://module.metapage.io/conversion/metapage/v${e}`, {
1052
1052
  redirect: "follow",
@@ -1078,22 +1078,22 @@ const Ws = (t) => {
1078
1078
  for (; s !== e; )
1079
1079
  switch (s) {
1080
1080
  case "0.2": {
1081
- if (z(e, s) > 0)
1081
+ if (V(e, s) > 0)
1082
1082
  n = Jn(n), s = vt(n.version);
1083
1083
  else
1084
1084
  throw `Cannot convert from version ${s} to ${e}`;
1085
1085
  break;
1086
1086
  }
1087
1087
  case "0.3": {
1088
- z(e, s) > 0 ? (n = Qn(n), s = vt(n.version)) : (n = Gn(n), s = vt(n.version));
1088
+ V(e, s) > 0 ? (n = Qn(n), s = vt(n.version)) : (n = Gn(n), s = vt(n.version));
1089
1089
  break;
1090
1090
  }
1091
1091
  case "1": {
1092
- z(e, s) > 0 ? (n = Yn(n), s = vt(n.version)) : (n = Kn(n), s = vt(n.version));
1092
+ V(e, s) > 0 ? (n = Yn(n), s = vt(n.version)) : (n = Kn(n), s = vt(n.version));
1093
1093
  break;
1094
1094
  }
1095
1095
  case "2": {
1096
- if (z(e, s) > 0)
1096
+ if (V(e, s) > 0)
1097
1097
  throw `Cannot convert from version ${s} to ${e}, 1 is the latest version`;
1098
1098
  n = Xn(n), s = vt(n.version);
1099
1099
  break;
@@ -1120,13 +1120,13 @@ const Ws = (t) => {
1120
1120
  throw "Missing version";
1121
1121
  if (t === "latest")
1122
1122
  return we;
1123
- if (z(t, "0.2") < 0)
1123
+ if (V(t, "0.2") < 0)
1124
1124
  throw `Unknown version: ${t}`;
1125
- if (z(t, "0.2") <= 0 && z(t, "0.3") < 0)
1125
+ if (V(t, "0.2") <= 0 && V(t, "0.3") < 0)
1126
1126
  return "0.2";
1127
- if (z(t, "0.3") <= 0)
1127
+ if (V(t, "0.3") <= 0)
1128
1128
  return "0.3";
1129
- if (z(t, "1") <= 0)
1129
+ if (V(t, "1") <= 0)
1130
1130
  return "1";
1131
1131
  if (t === "2")
1132
1132
  return "2";
@@ -1152,7 +1152,7 @@ const Ws = (t) => {
1152
1152
  }
1153
1153
  if (!e)
1154
1154
  throw 'Missing "version" argument';
1155
- if (z(e, _e) > 0)
1155
+ if (V(e, _e) > 0)
1156
1156
  try {
1157
1157
  return await (await qn(`https://module.metapage.io/conversion/metaframe/v${e}`, {
1158
1158
  redirect: "follow",
@@ -1177,39 +1177,39 @@ const Ws = (t) => {
1177
1177
  o.version = i;
1178
1178
  });
1179
1179
  }
1180
- let s = ot(t.version);
1180
+ let s = at(t.version);
1181
1181
  if (s === e)
1182
1182
  return t;
1183
1183
  let n = t;
1184
1184
  for (; s !== e; )
1185
1185
  switch (s) {
1186
1186
  case "0.3": {
1187
- if (z(e, s) > 0)
1188
- n = ni(n), s = ot(n.version);
1187
+ if (V(e, s) > 0)
1188
+ n = ni(n), s = at(n.version);
1189
1189
  else
1190
1190
  throw `Cannot convert from version ${s} to ${e}`;
1191
1191
  break;
1192
1192
  }
1193
1193
  case "0.4": {
1194
- z(e, s) > 0 ? (n = ii(n), s = ot(n.version)) : (n = si(n), s = ot(n.version));
1194
+ V(e, s) > 0 ? (n = ii(n), s = at(n.version)) : (n = si(n), s = at(n.version));
1195
1195
  break;
1196
1196
  }
1197
1197
  case "0.5": {
1198
- z(e, s) > 0 ? (n = li(n), s = ot(n.version)) : (n = ri(n), s = ot(n.version));
1198
+ V(e, s) > 0 ? (n = li(n), s = at(n.version)) : (n = ri(n), s = at(n.version));
1199
1199
  break;
1200
1200
  }
1201
1201
  case "0.6": {
1202
- z(e, s) > 0 ? (n = oi(n), s = ot(n.version)) : (n = fi(n), s = ot(n.version));
1202
+ V(e, s) > 0 ? (n = oi(n), s = at(n.version)) : (n = fi(n), s = at(n.version));
1203
1203
  break;
1204
1204
  }
1205
1205
  case "1": {
1206
- z(e, s) > 0 ? (n = ci(n), s = ot(n.version)) : (n = ai(n), s = ot(n.version));
1206
+ V(e, s) > 0 ? (n = ci(n), s = at(n.version)) : (n = ai(n), s = at(n.version));
1207
1207
  break;
1208
1208
  }
1209
1209
  case "2": {
1210
- if (z(e, s) > 0)
1210
+ if (V(e, s) > 0)
1211
1211
  throw `Cannot convert from version ${s} to ${e}`;
1212
- n = ui(n), s = ot(n.version);
1212
+ n = ui(n), s = at(n.version);
1213
1213
  break;
1214
1214
  }
1215
1215
  default:
@@ -1263,22 +1263,22 @@ const Ws = (t) => {
1263
1263
  }), fi = (t) => C(t, (e) => {
1264
1264
  var s;
1265
1265
  e.version = "0.5", (s = e == null ? void 0 : e.metadata) != null && s.operations && delete e.metadata.operations;
1266
- }), ot = (t) => {
1266
+ }), at = (t) => {
1267
1267
  if (!t)
1268
1268
  throw "Missing version";
1269
1269
  if (t === "latest")
1270
1270
  return _e;
1271
- if (z(t, "0.3") < 0)
1271
+ if (V(t, "0.3") < 0)
1272
1272
  throw `Unknown version: ${t}`;
1273
- if (z(t, "0.3") <= 0)
1273
+ if (V(t, "0.3") <= 0)
1274
1274
  return "0.3";
1275
- if (z(t, "0.4") <= 0)
1275
+ if (V(t, "0.4") <= 0)
1276
1276
  return "0.4";
1277
- if (z(t, "0.5") <= 0)
1277
+ if (V(t, "0.5") <= 0)
1278
1278
  return "0.5";
1279
- if (z(t, "0.6") <= 0)
1279
+ if (V(t, "0.6") <= 0)
1280
1280
  return "0.6";
1281
- if (z(t, "1") <= 0)
1281
+ if (V(t, "1") <= 0)
1282
1282
  return "1";
1283
1283
  if (t === "2")
1284
1284
  return "2";
@@ -1307,7 +1307,7 @@ const Kt = {
1307
1307
  Remove: "remove",
1308
1308
  Replace: "replace",
1309
1309
  Add: "add"
1310
- }, Ks = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), oe = Symbol.iterator, at = {
1310
+ }, Ks = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), oe = Symbol.iterator, ut = {
1311
1311
  mutable: "mutable",
1312
1312
  immutable: "immutable"
1313
1313
  }, es = {};
@@ -1331,30 +1331,30 @@ function Xs(t) {
1331
1331
  function Ys(t) {
1332
1332
  return Object.getPrototypeOf(t) === Map.prototype;
1333
1333
  }
1334
- function st(t) {
1334
+ function it(t) {
1335
1335
  var e;
1336
1336
  return (e = t.copy) !== null && e !== void 0 ? e : t.original;
1337
1337
  }
1338
1338
  function fe(t) {
1339
- return !!k(t);
1339
+ return !!H(t);
1340
1340
  }
1341
- function k(t) {
1341
+ function H(t) {
1342
1342
  return typeof t != "object" ? null : t == null ? void 0 : t[Ks];
1343
1343
  }
1344
1344
  function ss(t) {
1345
1345
  var e;
1346
- const s = k(t);
1346
+ const s = H(t);
1347
1347
  return s ? (e = s.copy) !== null && e !== void 0 ? e : s.original : t;
1348
1348
  }
1349
1349
  function Dt(t, e) {
1350
1350
  if (!t || typeof t != "object")
1351
1351
  return !1;
1352
1352
  let s;
1353
- return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((s = e.mark(t, at)) === at.immutable || typeof s == "function");
1353
+ return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((s = e.mark(t, ut)) === ut.immutable || typeof s == "function");
1354
1354
  }
1355
1355
  function qs(t, e = []) {
1356
1356
  if (Object.hasOwnProperty.call(t, "key")) {
1357
- const s = t.parent.copy, n = k(Et(s, t.key));
1357
+ const s = t.parent.copy, n = H(Et(s, t.key));
1358
1358
  if (n !== null && (n == null ? void 0 : n.original) !== t.original)
1359
1359
  return null;
1360
1360
  const i = t.parent.type === 3, o = i ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
@@ -1382,8 +1382,8 @@ function ns(t, e, s) {
1382
1382
  Xt(t) === 2 ? t.set(e, s) : t[e] = s;
1383
1383
  }
1384
1384
  function Ae(t, e) {
1385
- const s = k(t);
1386
- return (s ? st(s) : t)[e];
1385
+ const s = H(t);
1386
+ return (s ? it(s) : t)[e];
1387
1387
  }
1388
1388
  function Pt(t, e) {
1389
1389
  return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
@@ -1435,8 +1435,8 @@ function yi(t, e) {
1435
1435
  return new n(t);
1436
1436
  }
1437
1437
  return new Map(t);
1438
- } else if (e != null && e.mark && (s = e.mark(t, at), s !== void 0) && s !== at.mutable) {
1439
- if (s === at.immutable)
1438
+ } else if (e != null && e.mark && (s = e.mark(t, ut), s !== void 0) && s !== ut.mutable) {
1439
+ if (s === ut.immutable)
1440
1440
  return hi(t);
1441
1441
  if (typeof s == "function") {
1442
1442
  if (e.enablePatches || e.enableAutoFreeze)
@@ -1454,7 +1454,7 @@ function yi(t, e) {
1454
1454
  } else
1455
1455
  throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
1456
1456
  }
1457
- function Z(t) {
1457
+ function et(t) {
1458
1458
  t.copy || (t.copy = yi(t.original, t.options));
1459
1459
  }
1460
1460
  function Nt(t) {
@@ -1489,9 +1489,9 @@ function Nt(t) {
1489
1489
  function ae(t) {
1490
1490
  return fe(t) ? Nt(t) : t;
1491
1491
  }
1492
- function dt(t) {
1492
+ function mt(t) {
1493
1493
  var e;
1494
- t.assignedMap = (e = t.assignedMap) !== null && e !== void 0 ? e : /* @__PURE__ */ new Map(), t.operated || (t.operated = !0, t.parent && dt(t.parent));
1494
+ t.assignedMap = (e = t.assignedMap) !== null && e !== void 0 ? e : /* @__PURE__ */ new Map(), t.operated || (t.operated = !0, t.parent && mt(t.parent));
1495
1495
  }
1496
1496
  function mi(t, e) {
1497
1497
  const s = Xt(t);
@@ -1513,8 +1513,8 @@ function Zs(t, e, s) {
1513
1513
  if (e.add(t), mi(t, (o, r) => {
1514
1514
  var a;
1515
1515
  if (fe(r)) {
1516
- const u = k(r);
1517
- Z(u);
1516
+ const u = H(r);
1517
+ et(u);
1518
1518
  const l = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
1519
1519
  ns(n ? i : t, o, l);
1520
1520
  } else
@@ -1545,7 +1545,7 @@ function Fe(t, e, s, n) {
1545
1545
  }
1546
1546
  }
1547
1547
  function is(t, e, s, n) {
1548
- const i = k(s);
1548
+ const i = H(s);
1549
1549
  i && (i.callbacks || (i.callbacks = []), i.callbacks.push((o, r) => {
1550
1550
  var a;
1551
1551
  const u = t.type === 3 ? t.setMap : t.copy;
@@ -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]), h = $t(f, i);
1599
+ const f = e.concat([c - 1]), y = $t(f, i);
1600
1600
  n.push({
1601
1601
  op: K.Remove,
1602
- path: h
1602
+ path: y
1603
1603
  });
1604
1604
  }
1605
1605
  }
@@ -1609,7 +1609,7 @@ 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 h = n.concat(u), p = $t(h, r);
1612
+ const y = n.concat(u), p = $t(y, r);
1613
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
  }
@@ -1663,39 +1663,39 @@ const pe = (t, e, s = !1) => {
1663
1663
  throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
1664
1664
  }, Be = {
1665
1665
  get size() {
1666
- return st(k(this)).size;
1666
+ return it(H(this)).size;
1667
1667
  },
1668
1668
  has(t) {
1669
- return st(k(this)).has(t);
1669
+ return it(H(this)).has(t);
1670
1670
  },
1671
1671
  set(t, e) {
1672
- const s = k(this), n = st(s);
1673
- return (!n.has(t) || !Pt(n.get(t), e)) && (Z(s), dt(s), s.assignedMap.set(t, !0), s.copy.set(t, e), is(s, t, e, Jt)), this;
1672
+ const s = H(this), n = it(s);
1673
+ return (!n.has(t) || !Pt(n.get(t), e)) && (et(s), mt(s), s.assignedMap.set(t, !0), s.copy.set(t, e), is(s, t, e, Jt)), this;
1674
1674
  },
1675
1675
  delete(t) {
1676
1676
  if (!this.has(t))
1677
1677
  return !1;
1678
- const e = k(this);
1679
- return Z(e), dt(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
1678
+ const e = H(this);
1679
+ return et(e), mt(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
1680
1680
  },
1681
1681
  clear() {
1682
- const t = k(this);
1682
+ const t = H(this);
1683
1683
  if (this.size) {
1684
- Z(t), dt(t), t.assignedMap = /* @__PURE__ */ new Map();
1684
+ et(t), mt(t), t.assignedMap = /* @__PURE__ */ new Map();
1685
1685
  for (const [e] of t.original)
1686
1686
  t.assignedMap.set(e, !1);
1687
1687
  t.copy.clear();
1688
1688
  }
1689
1689
  },
1690
1690
  forEach(t, e) {
1691
- const s = k(this);
1692
- st(s).forEach((n, i) => {
1691
+ const s = H(this);
1692
+ it(s).forEach((n, i) => {
1693
1693
  t.call(e, this.get(i), i, this);
1694
1694
  });
1695
1695
  },
1696
1696
  get(t) {
1697
1697
  var e, s;
1698
- const n = k(this), i = st(n).get(t), o = ((s = (e = n.options).mark) === null || s === void 0 ? void 0 : s.call(e, i, at)) === at.mutable;
1698
+ const n = H(this), i = it(n).get(t), o = ((s = (e = n.options).mark) === null || s === void 0 ? void 0 : s.call(e, i, ut)) === ut.mutable;
1699
1699
  if (n.options.strict && pe(i, n.options, o), o || n.finalized || !Dt(i, n.options) || i !== n.original.get(t))
1700
1700
  return i;
1701
1701
  const r = es.createDraft({
@@ -1705,10 +1705,10 @@ const pe = (t, e, s = !1) => {
1705
1705
  finalities: n.finalities,
1706
1706
  options: n.options
1707
1707
  });
1708
- return Z(n), n.copy.set(t, r), r;
1708
+ return et(n), n.copy.set(t, r), r;
1709
1709
  },
1710
1710
  keys() {
1711
- return st(k(this)).keys();
1711
+ return it(H(this)).keys();
1712
1712
  },
1713
1713
  values() {
1714
1714
  const t = this.keys();
@@ -1749,7 +1749,7 @@ const pe = (t, e, s = !1) => {
1749
1749
  return o;
1750
1750
  const r = o.value;
1751
1751
  let a = t.setMap.get(r);
1752
- const u = k(a), l = ((i = (n = t.options).mark) === null || i === void 0 ? void 0 : i.call(n, a, at)) === at.mutable;
1752
+ const u = H(a), l = ((i = (n = t.options).mark) === null || i === void 0 ? void 0 : i.call(n, a, ut)) === ut.mutable;
1753
1753
  if (t.options.strict && pe(r, t.options, l), !l && !u && Dt(r, t.options) && !t.finalized && t.original.has(r)) {
1754
1754
  const c = es.createDraft({
1755
1755
  original: r,
@@ -1767,40 +1767,40 @@ const pe = (t, e, s = !1) => {
1767
1767
  };
1768
1768
  }, he = {
1769
1769
  get size() {
1770
- return k(this).setMap.size;
1770
+ return H(this).setMap.size;
1771
1771
  },
1772
1772
  has(t) {
1773
- const e = k(this);
1773
+ const e = H(this);
1774
1774
  if (e.setMap.has(t))
1775
1775
  return !0;
1776
- Z(e);
1777
- const s = k(t);
1776
+ et(e);
1777
+ const s = H(t);
1778
1778
  return !!(s && e.setMap.has(s.original));
1779
1779
  },
1780
1780
  add(t) {
1781
- const e = k(this);
1782
- return this.has(t) || (Z(e), dt(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), is(e, t, t, Jt)), this;
1781
+ const e = H(this);
1782
+ return this.has(t) || (et(e), mt(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), is(e, t, t, Jt)), this;
1783
1783
  },
1784
1784
  delete(t) {
1785
1785
  if (!this.has(t))
1786
1786
  return !1;
1787
- const e = k(this);
1788
- Z(e), dt(e);
1789
- const s = k(t);
1787
+ const e = H(this);
1788
+ et(e), mt(e);
1789
+ const s = H(t);
1790
1790
  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));
1791
1791
  },
1792
1792
  clear() {
1793
1793
  if (!this.size)
1794
1794
  return;
1795
- const t = k(this);
1796
- Z(t), dt(t);
1795
+ const t = H(this);
1796
+ et(t), mt(t);
1797
1797
  for (const e of t.original)
1798
1798
  t.assignedMap.set(e, !1);
1799
1799
  t.setMap.clear();
1800
1800
  },
1801
1801
  values() {
1802
- const t = k(this);
1803
- Z(t);
1802
+ const t = H(this);
1803
+ et(t);
1804
1804
  const e = t.setMap.keys();
1805
1805
  return {
1806
1806
  [Symbol.iterator]: () => this.values(),
@@ -1808,8 +1808,8 @@ const pe = (t, e, s = !1) => {
1808
1808
  };
1809
1809
  },
1810
1810
  entries() {
1811
- const t = k(this);
1812
- Z(t);
1811
+ const t = H(this);
1812
+ et(t);
1813
1813
  const e = t.setMap.keys();
1814
1814
  return {
1815
1815
  [Symbol.iterator]: () => this.entries(),
@@ -1865,10 +1865,10 @@ const Oi = Reflect.ownKeys(he), tn = {
1865
1865
  let r;
1866
1866
  if (t.options.mark) {
1867
1867
  const l = e === "size" && (t.original instanceof Map || t.original instanceof Set) ? Reflect.get(t.original, e) : Reflect.get(t.original, e, s);
1868
- if (r = t.options.mark(l, at), r === at.mutable)
1868
+ if (r = t.options.mark(l, ut), r === ut.mutable)
1869
1869
  return t.options.strict && pe(l, t.options, !0), l;
1870
1870
  }
1871
- const a = st(t);
1871
+ const a = it(t);
1872
1872
  if (a instanceof Map && Si.includes(e))
1873
1873
  return e === "size" ? Object.getOwnPropertyDescriptor(Be, "size").get.call(t.proxy) : Be[e].bind(t.proxy);
1874
1874
  if (a instanceof Set && Oi.includes(e))
@@ -1884,15 +1884,15 @@ const Oi = Reflect.ownKeys(he), tn = {
1884
1884
  if (t.options.strict && pe(u, t.options), t.finalized || !Dt(u, t.options))
1885
1885
  return u;
1886
1886
  if (u === Ae(t.original, e)) {
1887
- if (Z(t), t.copy[e] = en({
1887
+ if (et(t), t.copy[e] = en({
1888
1888
  original: t.original[e],
1889
1889
  parentDraft: t,
1890
1890
  key: t.type === 1 ? Number(e) : e,
1891
1891
  finalities: t.finalities,
1892
1892
  options: t.options
1893
1893
  }), typeof r == "function") {
1894
- const l = k(t.copy[e]);
1895
- return Z(l), dt(l), l.copy;
1894
+ const l = H(t.copy[e]);
1895
+ return et(l), mt(l), l.copy;
1896
1896
  }
1897
1897
  return t.copy[e];
1898
1898
  }
@@ -1905,20 +1905,20 @@ const Oi = Reflect.ownKeys(he), tn = {
1905
1905
  let i;
1906
1906
  if (t.type === 1 && e !== "length" && !(Number.isInteger(i = Number(e)) && i >= 0 && (e === 0 || i === 0 || String(i) === String(e))))
1907
1907
  throw new Error("Only supports setting array indices and the 'length' property.");
1908
- const o = As(st(t), e);
1908
+ const o = As(it(t), e);
1909
1909
  if (o != null && o.set)
1910
1910
  return o.set.call(t.proxy, s), !0;
1911
- const r = Ae(st(t), e), a = k(r);
1912
- return a && Pt(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) : (Pt(s, r) && (s !== void 0 || zt(t.original, e)) || (Z(t), dt(t), zt(t.original, e) && Pt(s, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = s, is(t, e, s, Jt)), !0);
1911
+ const r = Ae(it(t), e), a = H(r);
1912
+ return a && Pt(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) : (Pt(s, r) && (s !== void 0 || zt(t.original, e)) || (et(t), mt(t), zt(t.original, e) && Pt(s, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = s, is(t, e, s, Jt)), !0);
1913
1913
  },
1914
1914
  has(t, e) {
1915
- return e in st(t);
1915
+ return e in it(t);
1916
1916
  },
1917
1917
  ownKeys(t) {
1918
- return Reflect.ownKeys(st(t));
1918
+ return Reflect.ownKeys(it(t));
1919
1919
  },
1920
1920
  getOwnPropertyDescriptor(t, e) {
1921
- const s = st(t), n = Reflect.getOwnPropertyDescriptor(s, e);
1921
+ const s = it(t), n = Reflect.getOwnPropertyDescriptor(s, e);
1922
1922
  return n && {
1923
1923
  writable: !0,
1924
1924
  configurable: t.type !== 1 || e !== "length",
@@ -1937,7 +1937,7 @@ const Oi = Reflect.ownKeys(he), tn = {
1937
1937
  },
1938
1938
  deleteProperty(t, e) {
1939
1939
  var s;
1940
- return t.type === 1 ? tn.set.call(this, t, e, void 0, t.proxy) : (Ae(t.original, e) !== void 0 || e in t.original ? (Z(t), dt(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
1940
+ return t.type === 1 ? tn.set.call(this, t, e, void 0, t.proxy) : (Ae(t.original, e) !== void 0 || e in t.original ? (et(t), mt(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
1941
1941
  }
1942
1942
  };
1943
1943
  function en(t) {
@@ -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, h) => {
1960
+ c.finalities.draft.push((f, y) => {
1961
1961
  var p, d;
1962
- const b = k(u);
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);
1962
+ const b = H(u);
1963
+ let _ = c.type === 3 ? c.setMap : c.copy;
1964
+ const M = Et(_, n), w = H(M);
1965
+ if (w) {
1966
+ let S = w.original;
1967
+ w.operated && (S = ss(M)), Ne(w), Fe(w, Jt, f, y), c.options.enableAutoFreeze && (c.options.updatedValues = (p = c.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(S, w.original)), ns(_, n, S);
1968
1968
  }
1969
- (d = b.callbacks) === null || d === void 0 || d.forEach((O) => {
1970
- O(f, h);
1969
+ (d = b.callbacks) === null || d === void 0 || d.forEach((S) => {
1970
+ S(f, y);
1971
1971
  });
1972
1972
  });
1973
1973
  } else {
1974
- const c = k(u);
1975
- c.finalities.draft.push((f, h) => {
1976
- Ne(c), Fe(c, Jt, f, h);
1974
+ const c = H(u);
1975
+ c.finalities.draft.push((f, y) => {
1976
+ Ne(c), Fe(c, Jt, f, y);
1977
1977
  });
1978
1978
  }
1979
1979
  return u;
@@ -2083,7 +2083,7 @@ const xi = (t) => t instanceof ArrayBuffer || t instanceof Blob || ArrayBuffer.i
2083
2083
  } else if (t instanceof ArrayBuffer)
2084
2084
  return Ei(t);
2085
2085
  return t;
2086
- }, os = async (t) => Ri(t) ? Ti(t) : !t || typeof t != "object" ? t : t._s === !0 && t._c ? Li(t) : t.ref === "base64" && t.c ? ki(t) : t, Zr = async (t) => {
2086
+ }, os = async (t) => Ri(t) ? Ti(t) : !t || typeof t != "object" ? t : t._s === !0 && t._c ? ki(t) : t.ref === "base64" && t.c ? Li(t) : t, Zr = async (t) => {
2087
2087
  const e = await os(t);
2088
2088
  if (e instanceof File)
2089
2089
  return e;
@@ -2133,7 +2133,7 @@ async function Ti(t) {
2133
2133
  }
2134
2134
  return t.startsWith("data:application/octet-stream;base64,") ? ue(t) : t;
2135
2135
  }
2136
- function Li(t) {
2136
+ function ki(t) {
2137
2137
  const e = t._c;
2138
2138
  if (e === "Blob") {
2139
2139
  const n = t;
@@ -2154,7 +2154,7 @@ function Li(t) {
2154
2154
  }
2155
2155
  return t;
2156
2156
  }
2157
- function ki(t) {
2157
+ function Li(t) {
2158
2158
  const e = t.c;
2159
2159
  if (e === "Blob")
2160
2160
  return new Blob([St(t.value)], {
@@ -2179,10 +2179,10 @@ var I;
2179
2179
  (function(t) {
2180
2180
  t.Inputs = "inputs", t.Outputs = "outputs", t.State = "state", t.Definition = "definition", t.DefinitionUpdate = "definitionupdate", t.Error = "error", t.Warning = "warning", t.UrlHashUpdate = "urlhashupdate", t.Message = "Message";
2181
2181
  })(I || (I = {}));
2182
- var Y;
2182
+ var Z;
2183
2183
  (function(t) {
2184
2184
  t.InputsUpdate = "InputsUpdate", t.OutputsUpdate = "OutputsUpdate", t.SetupIframeClientRequest = "SetupIframeClientRequest", t.SetupIframeServerResponseAck = "SetupIframeServerResponseAck", t.HashParamsUpdate = "HashParamsUpdate";
2185
- })(Y || (Y = {}));
2185
+ })(Z || (Z = {}));
2186
2186
  var Ot;
2187
2187
  (function(t) {
2188
2188
  t.InputsUpdate = "InputsUpdate", t.MessageAck = "MessageAck", t.SetupIframeServerResponse = "SetupIframeServerResponse";
@@ -2209,10 +2209,10 @@ 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, h) {
2212
+ function o(u, l, c, f, y) {
2213
2213
  if (typeof c != "function")
2214
2214
  throw new TypeError("The listener must be a function");
2215
- var p = new i(c, f || u, h), d = s ? s + l : l;
2215
+ var p = new i(c, f || u, y), d = s ? s + l : l;
2216
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) {
@@ -2234,56 +2234,56 @@ var nn = { exports: {} };
2234
2234
  return [];
2235
2235
  if (f.fn)
2236
2236
  return [f.fn];
2237
- for (var h = 0, p = f.length, d = new Array(p); h < p; h++)
2238
- d[h] = f[h].fn;
2237
+ for (var y = 0, p = f.length, d = new Array(p); y < p; y++)
2238
+ d[y] = f[y].fn;
2239
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, h, p, d) {
2243
+ }, a.prototype.emit = function(l, c, f, y, p, d) {
2244
2244
  var b = s ? s + l : l;
2245
2245
  if (!this._events[b])
2246
2246
  return !1;
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) {
2247
+ var _ = this._events[b], M = arguments.length, w, S;
2248
+ if (_.fn) {
2249
+ switch (_.once && this.removeListener(l, _.fn, void 0, !0), M) {
2250
2250
  case 1:
2251
- return w.fn.call(w.context), !0;
2251
+ return _.fn.call(_.context), !0;
2252
2252
  case 2:
2253
- return w.fn.call(w.context, c), !0;
2253
+ return _.fn.call(_.context, c), !0;
2254
2254
  case 3:
2255
- return w.fn.call(w.context, c, f), !0;
2255
+ return _.fn.call(_.context, c, f), !0;
2256
2256
  case 4:
2257
- return w.fn.call(w.context, c, f, h), !0;
2257
+ return _.fn.call(_.context, c, f, y), !0;
2258
2258
  case 5:
2259
- return w.fn.call(w.context, c, f, h, p), !0;
2259
+ return _.fn.call(_.context, c, f, y, p), !0;
2260
2260
  case 6:
2261
- return w.fn.call(w.context, c, f, h, p, d), !0;
2261
+ return _.fn.call(_.context, c, f, y, p, d), !0;
2262
2262
  }
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);
2263
+ for (S = 1, w = new Array(M - 1); S < M; S++)
2264
+ w[S - 1] = arguments[S];
2265
+ _.fn.apply(_.context, w);
2266
2266
  } else {
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) {
2267
+ var $ = _.length, R;
2268
+ for (S = 0; S < $; S++)
2269
+ switch (_[S].once && this.removeListener(l, _[S].fn, void 0, !0), M) {
2270
2270
  case 1:
2271
- w[O].fn.call(w[O].context);
2271
+ _[S].fn.call(_[S].context);
2272
2272
  break;
2273
2273
  case 2:
2274
- w[O].fn.call(w[O].context, c);
2274
+ _[S].fn.call(_[S].context, c);
2275
2275
  break;
2276
2276
  case 3:
2277
- w[O].fn.call(w[O].context, c, f);
2277
+ _[S].fn.call(_[S].context, c, f);
2278
2278
  break;
2279
2279
  case 4:
2280
- w[O].fn.call(w[O].context, c, f, h);
2280
+ _[S].fn.call(_[S].context, c, f, y);
2281
2281
  break;
2282
2282
  default:
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);
2283
+ if (!w)
2284
+ for (R = 1, w = new Array(M - 1); R < M; R++)
2285
+ w[R - 1] = arguments[R];
2286
+ _[S].fn.apply(_[S].context, w);
2287
2287
  }
2288
2288
  }
2289
2289
  return !0;
@@ -2291,7 +2291,7 @@ 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, h) {
2294
+ }, a.prototype.removeListener = function(l, c, f, y) {
2295
2295
  var p = s ? s + l : l;
2296
2296
  if (!this._events[p])
2297
2297
  return this;
@@ -2299,11 +2299,11 @@ var nn = { exports: {} };
2299
2299
  return r(this, p), this;
2300
2300
  var d = this._events[p];
2301
2301
  if (d.fn)
2302
- d.fn === c && (!h || d.once) && (!f || d.context === f) && r(this, p);
2302
+ d.fn === c && (!y || d.once) && (!f || d.context === f) && r(this, p);
2303
2303
  else {
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);
2304
+ for (var b = 0, _ = [], M = d.length; b < M; b++)
2305
+ (d[b].fn !== c || y && !d[b].once || f && d[b].context !== f) && _.push(d[b]);
2306
+ _.length ? this._events[p] = _.length === 1 ? _[0] : _ : 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], h = o(r[f]);
2350
- h && (u && (u += ","), u += JSON.stringify(f) + ":" + h);
2349
+ var f = c[a], y = o(r[f]);
2350
+ y && (u && (u += ","), u += JSON.stringify(f) + ":" + y);
2351
2351
  }
2352
2352
  return i.splice(l, 1), "{" + u + "}";
2353
2353
  }
@@ -2396,7 +2396,7 @@ const Ni = /* @__PURE__ */ Ui(Hi), Fi = (t) => us(Ni(t)), Bi = (t) => {
2396
2396
  }, Mt = () => typeof window < "u" && typeof globalThis.location < "u", zi = (t) => {
2397
2397
  if (Mt())
2398
2398
  return Vi()[1][t];
2399
- }, Vi = () => Mt() ? on(globalThis.location.href) : ["", {}], Lt = (t, e, s) => {
2399
+ }, Vi = () => Mt() ? on(globalThis.location.href) : ["", {}], kt = (t, e, s) => {
2400
2400
  if (!Mt())
2401
2401
  return;
2402
2402
  const n = globalThis.location.hash.startsWith("#") ? globalThis.location.hash.substring(1) : globalThis.location.hash, i = un(n, t, e);
@@ -2422,7 +2422,7 @@ const Ni = /* @__PURE__ */ Ui(Hi), Fi = (t) => us(Ni(t)), Bi = (t) => {
2422
2422
  return Bi(s);
2423
2423
  }, Ji = (t, e, s) => {
2424
2424
  const n = e ? Fi(e) : void 0;
2425
- Lt(t, n, s);
2425
+ kt(t, n, s);
2426
2426
  }, Gi = (t) => {
2427
2427
  if (Mt())
2428
2428
  return cs(globalThis.location.href, t);
@@ -2430,7 +2430,7 @@ const Ni = /* @__PURE__ */ Ui(Hi), Fi = (t) => us(Ni(t)), Bi = (t) => {
2430
2430
  const s = Yt(t, e);
2431
2431
  return s ? parseFloat(s) : void 0;
2432
2432
  }, cn = (t, e, s) => {
2433
- Lt(t, e != null ? e.toString() : void 0, s);
2433
+ kt(t, e != null ? e.toString() : void 0, s);
2434
2434
  }, Ki = (t) => {
2435
2435
  if (Mt())
2436
2436
  return Qi(globalThis.location.href, t);
@@ -2443,16 +2443,16 @@ const Ni = /* @__PURE__ */ Ui(Hi), Fi = (t) => us(Ni(t)), Bi = (t) => {
2443
2443
  if (Mt())
2444
2444
  return Xi(globalThis.location.href, t);
2445
2445
  }, Zi = (t, e) => Yt(t, e) === "true", tr = (t, e, s) => {
2446
- Lt(t, e ? "true" : void 0, s);
2446
+ kt(t, e ? "true" : void 0, s);
2447
2447
  }, er = (t) => {
2448
2448
  if (Mt())
2449
2449
  return Zi(globalThis.location.href, t);
2450
- }, kt = (t, e, s) => Wi(t, e, s == null ? void 0 : us(s)), ze = (t, e) => {
2450
+ }, Lt = (t, e, s) => Wi(t, e, s == null ? void 0 : us(s)), ze = (t, e) => {
2451
2451
  const s = Yt(t, e);
2452
2452
  return s && s !== "" ? rn(s) : void 0;
2453
2453
  }, sr = (t, e, s) => {
2454
2454
  const n = e == null ? void 0 : us(e);
2455
- Lt(t, n, s);
2455
+ kt(t, n, s);
2456
2456
  }, nr = (t) => {
2457
2457
  if (Mt())
2458
2458
  return ze(globalThis.location.href, t);
@@ -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], h = o(r[f]);
2492
- h && (u && (u += ","), u += JSON.stringify(f) + ":" + h);
2491
+ var f = c[a], y = o(r[f]);
2492
+ y && (u && (u += ","), u += JSON.stringify(f) + ":" + y);
2493
2493
  }
2494
2494
  return i.splice(l, 1), "{" + u + "}";
2495
2495
  }
@@ -2576,40 +2576,40 @@ async function hn(t) {
2576
2576
  const s = new TextEncoder().encode(t), n = await crypto.subtle.digest("SHA-256", s);
2577
2577
  return btoa(String.fromCharCode(...new Uint8Array(n)));
2578
2578
  }
2579
- var ft;
2579
+ var ht;
2580
2580
  (function(t) {
2581
2581
  t.WaitingForPageLoad = "WaitingForPageLoad", t.SentSetupIframeClientRequest = "SentSetupIframeClientRequest", t.Ready = "Ready";
2582
- })(ft || (ft = {}));
2582
+ })(ht || (ht = {}));
2583
2583
  var W;
2584
2584
  (function(t) {
2585
2585
  t.Connected = "connected", t.Error = "error", t.Input = "input", t.Inputs = "inputs", t.Message = "message";
2586
2586
  })(W || (W = {}));
2587
- class ct extends as.EventEmitter {
2587
+ class lt extends as.EventEmitter {
2588
2588
  constructor(e) {
2589
- if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = ft.WaitingForPageLoad, this._messageSendCount = 0, this.debug = Ve(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = Ve(), this._isIframe = rr(), this.addListener = this.addListener.bind(this), this.dispose = this.dispose.bind(this), this.error = this.error.bind(this), this.getInput = this.getInput.bind(this), this.getInputs = this.getInputs.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.onInput = this.onInput.bind(this), this.onInputs = this.onInputs.bind(this), this.onMessage = this.onMessage.bind(this), this.sendRpc = this.sendRpc.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInternalInputsAndNotify = this.setInternalInputsAndNotify.bind(this), this.setOutput = this.setOutput.bind(this), this.setOutputs = this.setOutputs.bind(this), this.warn = this.warn.bind(this), this._resolveSetupIframeServerResponse = this._resolveSetupIframeServerResponse.bind(this), this.addListenerReturnDisposer = this.addListenerReturnDisposer.bind(this), this.connected = this.connected.bind(this), this.isConnected = this.isConnected.bind(this), this.disableNotifyOnHashUrlChange = this.disableNotifyOnHashUrlChange.bind(this), this._onHashUrlChange = this._onHashUrlChange.bind(this), this.setParameter = this.setParameter.bind(this), this.setParameterBoolean = this.setParameterBoolean.bind(this), this.setParameterJson = this.setParameterJson.bind(this), this.setParameterBase64 = this.setParameterBase64.bind(this), this.setParameterFloat = this.setParameterFloat.bind(this), this.setParameterInt = this.setParameterInt.bind(this), this.getParameter = this.getParameter.bind(this), this.getParameterBoolean = this.getParameterBoolean.bind(this), this.getParameterJson = this.getParameterJson.bind(this), this.getParameterBase64 = this.getParameterBase64.bind(this), this.getParameterFloat = this.getParameterFloat.bind(this), this.getParameterInt = this.getParameterInt.bind(this), this.deleteParameter = this.deleteParameter.bind(this), !this._isIframe) {
2589
+ if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = ht.WaitingForPageLoad, this._messageSendCount = 0, this.debug = Ve(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = Ve(), this._isIframe = rr(), this.addListener = this.addListener.bind(this), this.dispose = this.dispose.bind(this), this.error = this.error.bind(this), this.getInput = this.getInput.bind(this), this.getInputs = this.getInputs.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.onInput = this.onInput.bind(this), this.onInputs = this.onInputs.bind(this), this.onMessage = this.onMessage.bind(this), this.sendRpc = this.sendRpc.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInternalInputsAndNotify = this.setInternalInputsAndNotify.bind(this), this.setOutput = this.setOutput.bind(this), this.setOutputs = this.setOutputs.bind(this), this.warn = this.warn.bind(this), this._resolveSetupIframeServerResponse = this._resolveSetupIframeServerResponse.bind(this), this.addListenerReturnDisposer = this.addListenerReturnDisposer.bind(this), this.connected = this.connected.bind(this), this.isConnected = this.isConnected.bind(this), this.disableNotifyOnHashUrlChange = this.disableNotifyOnHashUrlChange.bind(this), this._onHashUrlChange = this._onHashUrlChange.bind(this), this.setParameter = this.setParameter.bind(this), this.setParameterBoolean = this.setParameterBoolean.bind(this), this.setParameterJson = this.setParameterJson.bind(this), this.setParameterBase64 = this.setParameterBase64.bind(this), this.setParameterFloat = this.setParameterFloat.bind(this), this.setParameterInt = this.setParameterInt.bind(this), this.getParameter = this.getParameter.bind(this), this.getParameterBoolean = this.getParameterBoolean.bind(this), this.getParameterJson = this.getParameterJson.bind(this), this.getParameterBase64 = this.getParameterBase64.bind(this), this.getParameterFloat = this.getParameterFloat.bind(this), this.getParameterInt = this.getParameterInt.bind(this), this.deleteParameter = this.deleteParameter.bind(this), !this._isIframe) {
2590
2590
  this.log("Not an iframe, metaframe code disabled");
2591
2591
  return;
2592
2592
  }
2593
2593
  const s = this;
2594
2594
  qt().then(() => {
2595
- this.log("pageLoaded"), window.addEventListener("message", this.onMessage), s.sendRpc(Y.SetupIframeClientRequest, {
2596
- version: ct.version
2597
- }), s._state = ft.SentSetupIframeClientRequest;
2595
+ this.log("pageLoaded"), window.addEventListener("message", this.onMessage), s.sendRpc(Z.SetupIframeClientRequest, {
2596
+ version: lt.version
2597
+ }), s._state = ht.SentSetupIframeClientRequest;
2598
2598
  }), e && e.disableHashChangeEvent || window.addEventListener("hashchange", this._onHashUrlChange);
2599
2599
  }
2600
2600
  _resolveSetupIframeServerResponse(e) {
2601
- if (this._state === ft.WaitingForPageLoad)
2601
+ if (this._state === ht.WaitingForPageLoad)
2602
2602
  throw "Got message but page has not finished loading, we should never get in this state";
2603
- (async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = e.version, this.color = pn(this.id), this._parentId = e.parentId, this.log(`metapage[${this._parentId}](v${this._parentVersion ? this._parentVersion : "unknown"}) registered`), e.state && e.state.inputs && (this.isInputOutputBlobSerialization ? this._inputPipeValues = await Vt(e.state.inputs) : this._inputPipeValues = e.state.inputs), this._state = ft.Ready, this.sendRpc(Y.SetupIframeServerResponseAck, {
2604
- version: ct.version
2605
- }), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(W.Inputs, this._inputPipeValues), this.listenerCount(W.Input) > 0 && Object.keys(this._inputPipeValues).forEach((s) => this.emit(W.Input, s, this._inputPipeValues[s]))), this.emit(W.Connected), this.sendRpc(Y.OutputsUpdate, this._outputPipeValues)))();
2603
+ (async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = e.version, this.color = pn(this.id), this._parentId = e.parentId, this.log(`metapage[${this._parentId}](v${this._parentVersion ? this._parentVersion : "unknown"}) registered`), e.state && e.state.inputs && (this.isInputOutputBlobSerialization ? this._inputPipeValues = await Vt(e.state.inputs) : this._inputPipeValues = e.state.inputs), this._state = ht.Ready, this.sendRpc(Z.SetupIframeServerResponseAck, {
2604
+ version: lt.version
2605
+ }), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(W.Inputs, this._inputPipeValues), this.listenerCount(W.Input) > 0 && Object.keys(this._inputPipeValues).forEach((s) => this.emit(W.Input, s, this._inputPipeValues[s]))), this.emit(W.Connected), this.sendRpc(Z.OutputsUpdate, this._outputPipeValues)))();
2606
2606
  }
2607
2607
  isConnected() {
2608
- return this._state === ft.Ready;
2608
+ return this._state === ht.Ready;
2609
2609
  }
2610
2610
  async connected() {
2611
2611
  return new Promise((e, s) => {
2612
- if (this._state === ft.Ready) {
2612
+ if (this._state === ht.Ready) {
2613
2613
  e();
2614
2614
  return;
2615
2615
  }
@@ -2658,7 +2658,7 @@ class ct extends as.EventEmitter {
2658
2658
  n[e] = s, this.setInputs(n);
2659
2659
  }
2660
2660
  async setInputs(e) {
2661
- this.isInputOutputBlobSerialization && (e = await Vt(e)), this.sendRpc(Y.InputsUpdate, e);
2661
+ this.isInputOutputBlobSerialization && (e = await Vt(e)), this.sendRpc(Z.InputsUpdate, e);
2662
2662
  }
2663
2663
  async setInternalInputsAndNotify(e) {
2664
2664
  this.isInputOutputBlobSerialization && (e = await Vt(e));
@@ -2692,7 +2692,7 @@ class ct extends as.EventEmitter {
2692
2692
  async setOutputs(e) {
2693
2693
  this.isInputOutputBlobSerialization && (e = await ve(e));
2694
2694
  const s = e;
2695
- this._outputPipeValues = me(this._outputPipeValues, e), this._outputPipeValues !== s && this._state === ft.Ready && this.sendRpc(Y.OutputsUpdate, e);
2695
+ this._outputPipeValues = me(this._outputPipeValues, e), this._outputPipeValues !== s && this._state === ht.Ready && this.sendRpc(Z.OutputsUpdate, e);
2696
2696
  }
2697
2697
  disableNotifyOnHashUrlChange() {
2698
2698
  window.removeEventListener("hashchange", this._onHashUrlChange);
@@ -2702,7 +2702,7 @@ class ct extends as.EventEmitter {
2702
2702
  hash: window.location.hash,
2703
2703
  metaframe: this.id
2704
2704
  };
2705
- this.sendRpc(Y.HashParamsUpdate, s);
2705
+ this.sendRpc(Z.HashParamsUpdate, s);
2706
2706
  }
2707
2707
  sendRpc(e, s) {
2708
2708
  if (this._isIframe) {
@@ -2732,7 +2732,7 @@ class ct extends as.EventEmitter {
2732
2732
  this._resolveSetupIframeServerResponse(n.params);
2733
2733
  break;
2734
2734
  case Ot.InputsUpdate:
2735
- if (this._state !== ft.Ready)
2735
+ if (this._state !== ht.Ready)
2736
2736
  throw "Got InputsUpdate but metaframe is not MetaframeLoadingState.Ready";
2737
2737
  this.setInternalInputsAndNotify(n.params.inputs);
2738
2738
  break;
@@ -2748,7 +2748,7 @@ class ct extends as.EventEmitter {
2748
2748
  }
2749
2749
  }
2750
2750
  setParameter(e, s) {
2751
- Lt(e, s);
2751
+ kt(e, s);
2752
2752
  }
2753
2753
  getParameter(e) {
2754
2754
  return zi(e);
@@ -2784,20 +2784,20 @@ class ct extends as.EventEmitter {
2784
2784
  return qi(e);
2785
2785
  }
2786
2786
  deleteParameter(e) {
2787
- Lt(e, void 0);
2787
+ kt(e, void 0);
2788
2788
  }
2789
2789
  }
2790
- ct.version = On;
2791
- ct.ERROR = W.Error;
2792
- ct.CONNECTED = W.Connected;
2793
- ct.INPUT = W.Input;
2794
- ct.INPUTS = W.Inputs;
2795
- ct.MESSAGE = W.Message;
2796
- ct.deserializeInputs = Vt;
2797
- ct.serializeInputs = ve;
2790
+ lt.version = On;
2791
+ lt.ERROR = W.Error;
2792
+ lt.CONNECTED = W.Connected;
2793
+ lt.INPUT = W.Input;
2794
+ lt.INPUTS = W.Inputs;
2795
+ lt.MESSAGE = W.Message;
2796
+ lt.deserializeInputs = Vt;
2797
+ lt.serializeInputs = ve;
2798
2798
  var Se = {};
2799
- const lt = "\\\\/", Ps = `[^${lt}]`, mt = "\\.", lr = "\\+", fr = "\\?", Oe = "\\/", pr = "(?=.)", dn = "[^/]", ps = `(?:${Oe}|$)`, yn = `(?:^|${Oe})`, hs = `${mt}{1,2}${ps}`, hr = `(?!${mt})`, dr = `(?!${yn}${hs})`, yr = `(?!${mt}{0,1}${ps})`, mr = `(?!${hs})`, gr = `[^.${Oe}]`, br = `${dn}*?`, _r = "/", mn = {
2800
- DOT_LITERAL: mt,
2799
+ const pt = "\\\\/", Ps = `[^${pt}]`, gt = "\\.", lr = "\\+", fr = "\\?", Oe = "\\/", pr = "(?=.)", dn = "[^/]", ps = `(?:${Oe}|$)`, yn = `(?:^|${Oe})`, hs = `${gt}{1,2}${ps}`, hr = `(?!${gt})`, dr = `(?!${yn}${hs})`, yr = `(?!${gt}{0,1}${ps})`, mr = `(?!${hs})`, gr = `[^.${Oe}]`, br = `${dn}*?`, _r = "/", mn = {
2800
+ DOT_LITERAL: gt,
2801
2801
  PLUS_LITERAL: lr,
2802
2802
  QMARK_LITERAL: fr,
2803
2803
  SLASH_LITERAL: Oe,
@@ -2815,17 +2815,17 @@ const lt = "\\\\/", Ps = `[^${lt}]`, mt = "\\.", lr = "\\+", fr = "\\?", Oe = "\
2815
2815
  SEP: _r
2816
2816
  }, wr = {
2817
2817
  ...mn,
2818
- SLASH_LITERAL: `[${lt}]`,
2818
+ SLASH_LITERAL: `[${pt}]`,
2819
2819
  QMARK: Ps,
2820
2820
  STAR: `${Ps}*?`,
2821
- DOTS_SLASH: `${mt}{1,2}(?:[${lt}]|$)`,
2822
- NO_DOT: `(?!${mt})`,
2823
- NO_DOTS: `(?!(?:^|[${lt}])${mt}{1,2}(?:[${lt}]|$))`,
2824
- NO_DOT_SLASH: `(?!${mt}{0,1}(?:[${lt}]|$))`,
2825
- NO_DOTS_SLASH: `(?!${mt}{1,2}(?:[${lt}]|$))`,
2826
- QMARK_NO_DOT: `[^.${lt}]`,
2827
- START_ANCHOR: `(?:^|[${lt}])`,
2828
- END_ANCHOR: `(?:[${lt}]|$)`,
2821
+ DOTS_SLASH: `${gt}{1,2}(?:[${pt}]|$)`,
2822
+ NO_DOT: `(?!${gt})`,
2823
+ NO_DOTS: `(?!(?:^|[${pt}])${gt}{1,2}(?:[${pt}]|$))`,
2824
+ NO_DOT_SLASH: `(?!${gt}{0,1}(?:[${pt}]|$))`,
2825
+ NO_DOTS_SLASH: `(?!${gt}{1,2}(?:[${pt}]|$))`,
2826
+ QMARK_NO_DOT: `[^.${pt}]`,
2827
+ START_ANCHOR: `(?:^|[${pt}])`,
2828
+ END_ANCHOR: `(?:[${pt}]|$)`,
2829
2829
  SEP: "\\"
2830
2830
  }, vr = {
2831
2831
  alnum: "a-zA-Z0-9",
@@ -3027,41 +3027,41 @@ const xs = Se, {
3027
3027
  /* ) */
3028
3028
  CHAR_RIGHT_SQUARE_BRACKET: Ar
3029
3029
  /* ] */
3030
- } = Re, Ts = (t) => t === gn || t === Ft, Ls = (t) => {
3030
+ } = Re, Ts = (t) => t === gn || t === Ft, ks = (t) => {
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, 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));
3034
+ let u = t, l = -1, c = 0, f = 0, y = !1, p = !1, d = !1, b = !1, _ = !1, M = !1, w = !1, S = !1, $ = !1, R = !1, k = 0, L, O, A = { value: "", depth: 0, isGlob: !1 };
3035
+ const m = () => l >= n, X = () => u.charCodeAt(l + 1), B = () => (L = O, u.charCodeAt(++l));
3036
3036
  for (; l < n; ) {
3037
- _ = V();
3038
- let U;
3039
- if (_ === Ft) {
3040
- S = M.backslashes = !0, _ = V(), _ === xe && (A = !0);
3037
+ O = B();
3038
+ let x;
3039
+ if (O === Ft) {
3040
+ w = A.backslashes = !0, O = B(), O === xe && (M = !0);
3041
3041
  continue;
3042
3042
  }
3043
- if (A === !0 || _ === xe) {
3044
- for (j++; y() !== !0 && (_ = V()); ) {
3045
- if (_ === Ft) {
3046
- S = M.backslashes = !0, V();
3043
+ if (M === !0 || O === xe) {
3044
+ for (k++; m() !== !0 && (O = B()); ) {
3045
+ if (O === Ft) {
3046
+ w = A.backslashes = !0, B();
3047
3047
  continue;
3048
3048
  }
3049
- if (_ === xe) {
3050
- j++;
3049
+ if (O === xe) {
3050
+ k++;
3051
3051
  continue;
3052
3052
  }
3053
- if (A !== !0 && _ === $e && (_ = V()) === $e) {
3054
- if (h = M.isBrace = !0, d = M.isGlob = !0, E = !0, i === !0)
3053
+ if (M !== !0 && O === $e && (O = B()) === $e) {
3054
+ if (y = A.isBrace = !0, d = A.isGlob = !0, R = !0, i === !0)
3055
3055
  continue;
3056
3056
  break;
3057
3057
  }
3058
- if (A !== !0 && _ === Or) {
3059
- if (h = M.isBrace = !0, d = M.isGlob = !0, E = !0, i === !0)
3058
+ if (M !== !0 && O === Or) {
3059
+ if (y = A.isBrace = !0, d = A.isGlob = !0, R = !0, i === !0)
3060
3060
  continue;
3061
3061
  break;
3062
3062
  }
3063
- if (_ === Mr && (j--, j === 0)) {
3064
- A = !1, h = M.isBrace = !0, E = !0;
3063
+ if (O === Mr && (k--, k === 0)) {
3064
+ M = !1, y = A.isBrace = !0, R = !0;
3065
3065
  break;
3066
3066
  }
3067
3067
  }
@@ -3069,25 +3069,25 @@ const xs = Se, {
3069
3069
  continue;
3070
3070
  break;
3071
3071
  }
3072
- if (_ === gn) {
3073
- if (o.push(l), r.push(M), M = { value: "", depth: 0, isGlob: !1 }, E === !0)
3072
+ if (O === gn) {
3073
+ if (o.push(l), r.push(A), A = { value: "", depth: 0, isGlob: !1 }, R === !0)
3074
3074
  continue;
3075
- if (T === $e && l === c + 1) {
3075
+ if (L === $e && l === c + 1) {
3076
3076
  c += 2;
3077
3077
  continue;
3078
3078
  }
3079
3079
  f = l + 1;
3080
3080
  continue;
3081
3081
  }
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();
3082
+ if (s.noext !== !0 && (O === Er || O === Sr || O === Ce || O === Ds || O === Pe) === !0 && X() === De) {
3083
+ if (d = A.isGlob = !0, b = A.isExtglob = !0, R = !0, O === Pe && l === c && ($ = !0), i === !0) {
3084
+ for (; m() !== !0 && (O = B()); ) {
3085
+ if (O === Ft) {
3086
+ w = A.backslashes = !0, O = B();
3087
3087
  continue;
3088
3088
  }
3089
- if (_ === js) {
3090
- d = M.isGlob = !0, E = !0;
3089
+ if (O === js) {
3090
+ d = A.isGlob = !0, R = !0;
3091
3091
  break;
3092
3092
  }
3093
3093
  }
@@ -3095,24 +3095,24 @@ const xs = Se, {
3095
3095
  }
3096
3096
  break;
3097
3097
  }
3098
- if (_ === Ce) {
3099
- if (T === Ce && (w = M.isGlobstar = !0), d = M.isGlob = !0, E = !0, i === !0)
3098
+ if (O === Ce) {
3099
+ if (L === Ce && (_ = A.isGlobstar = !0), d = A.isGlob = !0, R = !0, i === !0)
3100
3100
  continue;
3101
3101
  break;
3102
3102
  }
3103
- if (_ === Ds) {
3104
- if (d = M.isGlob = !0, E = !0, i === !0)
3103
+ if (O === Ds) {
3104
+ if (d = A.isGlob = !0, R = !0, i === !0)
3105
3105
  continue;
3106
3106
  break;
3107
3107
  }
3108
- if (_ === Rr) {
3109
- for (; y() !== !0 && (U = V()); ) {
3110
- if (U === Ft) {
3111
- S = M.backslashes = !0, V();
3108
+ if (O === Rr) {
3109
+ for (; m() !== !0 && (x = B()); ) {
3110
+ if (x === Ft) {
3111
+ w = A.backslashes = !0, B();
3112
3112
  continue;
3113
3113
  }
3114
- if (U === Ar) {
3115
- p = M.isBracket = !0, d = M.isGlob = !0, E = !0;
3114
+ if (x === Ar) {
3115
+ p = A.isBracket = !0, d = A.isGlob = !0, R = !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 && _ === Pe && l === c) {
3124
- O = M.negated = !0, c++;
3123
+ if (s.nonegate !== !0 && O === Pe && l === c) {
3124
+ S = A.negated = !0, c++;
3125
3125
  continue;
3126
3126
  }
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();
3127
+ if (s.noparen !== !0 && O === De) {
3128
+ if (d = A.isGlob = !0, i === !0) {
3129
+ for (; m() !== !0 && (O = B()); ) {
3130
+ if (O === De) {
3131
+ w = A.backslashes = !0, O = B();
3132
3132
  continue;
3133
3133
  }
3134
- if (_ === js) {
3135
- E = !0;
3134
+ if (O === js) {
3135
+ R = !0;
3136
3136
  break;
3137
3137
  }
3138
3138
  }
@@ -3141,44 +3141,44 @@ const xs = Se, {
3141
3141
  break;
3142
3142
  }
3143
3143
  if (d === !0) {
3144
- if (E = !0, i === !0)
3144
+ if (R = !0, i === !0)
3145
3145
  continue;
3146
3146
  break;
3147
3147
  }
3148
3148
  }
3149
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
- const it = {
3153
- prefix: m,
3150
+ let F = u, g = "", h = "";
3151
+ c > 0 && (g = u.slice(0, c), u = u.slice(c), f -= c), F && d === !0 && f > 0 ? (F = u.slice(0, f), h = u.slice(f)) : d === !0 ? (F = "", h = u) : F = u, F && F !== "" && F !== "/" && F !== u && Ts(F.charCodeAt(F.length - 1)) && (F = F.slice(0, -1)), s.unescape === !0 && (h && (h = xs.removeBackslashes(h)), F && w === !0 && (F = xs.removeBackslashes(F)));
3152
+ const U = {
3153
+ prefix: g,
3154
3154
  input: t,
3155
3155
  start: c,
3156
- base: H,
3157
- glob: g,
3158
- isBrace: h,
3156
+ base: F,
3157
+ glob: h,
3158
+ isBrace: y,
3159
3159
  isBracket: p,
3160
3160
  isGlob: d,
3161
3161
  isExtglob: b,
3162
- isGlobstar: w,
3163
- negated: O,
3162
+ isGlobstar: _,
3163
+ negated: S,
3164
3164
  negatedExtglob: $
3165
3165
  };
3166
- if (s.tokens === !0 && (it.maxDepth = 0, Ts(_) || r.push(M), it.tokens = r), s.parts === !0 || s.tokens === !0) {
3167
- let U;
3168
- for (let F = 0; F < o.length; F++) {
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 = m) : r[F].value = _t, Ls(r[F]), it.maxDepth += r[F].depth), (F !== 0 || _t !== "") && a.push(_t), U = rt;
3166
+ if (s.tokens === !0 && (U.maxDepth = 0, Ts(O) || r.push(A), U.tokens = r), s.parts === !0 || s.tokens === !0) {
3167
+ let x;
3168
+ for (let P = 0; P < o.length; P++) {
3169
+ const ot = x ? x + 1 : c, Y = o[P], ft = t.slice(ot, Y);
3170
+ s.tokens && (P === 0 && c !== 0 ? (r[P].isPrefix = !0, r[P].value = g) : r[P].value = ft, ks(r[P]), U.maxDepth += r[P].depth), (P !== 0 || ft !== "") && a.push(ft), x = Y;
3171
3171
  }
3172
- if (U && U + 1 < t.length) {
3173
- const F = t.slice(U + 1);
3174
- a.push(F), s.tokens && (r[r.length - 1].value = F, Ls(r[r.length - 1]), it.maxDepth += r[r.length - 1].depth);
3172
+ if (x && x + 1 < t.length) {
3173
+ const P = t.slice(x + 1);
3174
+ a.push(P), s.tokens && (r[r.length - 1].value = P, ks(r[r.length - 1]), U.maxDepth += r[r.length - 1].depth);
3175
3175
  }
3176
- it.slashes = o, it.parts = a;
3176
+ U.slashes = o, U.parts = a;
3177
3177
  }
3178
- return it;
3178
+ return U;
3179
3179
  };
3180
3180
  var Cr = Ir;
3181
- const ge = Re, pt = Se, {
3181
+ const ge = Re, dt = Se, {
3182
3182
  MAX_LENGTH: be,
3183
3183
  POSIX_REGEX_SOURCE: $r,
3184
3184
  REGEX_NON_SPECIAL_CHARS: Pr,
@@ -3192,7 +3192,7 @@ const ge = Re, pt = Se, {
3192
3192
  try {
3193
3193
  new RegExp(s);
3194
3194
  } catch {
3195
- return t.map((i) => pt.escapeRegex(i)).join("..");
3195
+ return t.map((i) => dt.escapeRegex(i)).join("..");
3196
3196
  }
3197
3197
  return s;
3198
3198
  }, jt = (t, e) => `Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`, ds = (t, e) => {
@@ -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: h,
3209
+ SLASH_LITERAL: y,
3210
3210
  ONE_CHAR: p,
3211
3211
  DOTS_SLASH: d,
3212
3212
  NO_DOT: b,
3213
- NO_DOT_SLASH: w,
3214
- NO_DOTS_SLASH: A,
3215
- QMARK: S,
3216
- QMARK_NO_DOT: O,
3213
+ NO_DOT_SLASH: _,
3214
+ NO_DOTS_SLASH: M,
3215
+ QMARK: w,
3216
+ QMARK_NO_DOT: S,
3217
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 = {
3218
+ START_ANCHOR: R
3219
+ } = u, k = (E) => `(${a}(?:(?!${R}${E.dot ? d : c}).)*?)`, L = s.dot ? "" : b, O = s.dot ? w : S;
3220
+ let A = s.bash === !0 ? k(s) : $;
3221
+ s.capture && (A = `(${A})`), typeof s.noext == "boolean" && (s.noextglob = s.noext);
3222
+ const m = {
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, y), i = t.length;
3240
- const L = [], V = [], H = [];
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
- }, _t = (R) => {
3245
- y.output += R.output != null ? R.output : R.value, rt(R.value);
3239
+ t = dt.removePrefix(t, m), i = t.length;
3240
+ const X = [], B = [], F = [];
3241
+ let g = o, h;
3242
+ const U = () => m.index === i - 1, x = m.peek = (E = 1) => t[m.index + E], P = m.advance = () => t[++m.index] || "", ot = () => t.slice(m.index + 1), Y = (E = "", N = 0) => {
3243
+ m.consumed += E, m.index += N;
3244
+ }, ft = (E) => {
3245
+ m.output += E.output != null ? E.output : E.value, Y(E.value);
3246
3246
  }, vn = () => {
3247
- let R = 1;
3248
- for (; U() === "!" && (U(2) !== "(" || U(3) === "?"); )
3249
- F(), y.start++, R++;
3250
- return R % 2 === 0 ? !1 : (y.negated = !0, y.start++, !0);
3251
- }, Zt = (R) => {
3252
- y[R]++, H.push(R);
3253
- }, At = (R) => {
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);
3247
+ let E = 1;
3248
+ for (; x() === "!" && (x(2) !== "(" || x(3) === "?"); )
3249
+ P(), m.start++, E++;
3250
+ return E % 2 === 0 ? !1 : (m.negated = !0, m.start++, !0);
3251
+ }, Zt = (E) => {
3252
+ m[E]++, F.push(E);
3253
+ }, At = (E) => {
3254
+ m[E]--, F.pop();
3255
+ }, j = (E) => {
3256
+ if (g.type === "globstar") {
3257
+ const N = m.braces > 0 && (E.type === "comma" || E.type === "brace"), v = E.extglob === !0 || X.length && (E.type === "pipe" || E.type === "paren");
3258
+ E.type !== "slash" && E.type !== "paren" && !N && !v && (m.output = m.output.slice(0, -g.output.length), g.type = "star", g.value = "*", g.output = A, m.output += g.output);
3259
3259
  }
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;
3260
+ if (X.length && E.type !== "paren" && (X[X.length - 1].inner += E.value), (E.value || E.output) && ft(E), g && g.type === "text" && E.type === "text") {
3261
+ g.output = (g.output || g.value) + E.value, g.value += E.value;
3262
3262
  return;
3263
3263
  }
3264
- R.prev = m, r.push(R), m = R;
3265
- }, te = (R, N) => {
3264
+ E.prev = g, r.push(E), g = E;
3265
+ }, te = (E, N) => {
3266
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
- }, Sn = (R) => {
3271
- let N = R.close + (s.capture ? ")" : ""), v;
3272
- if (R.type === "negate") {
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})`;
3267
+ v.prev = g, v.parens = m.parens, v.output = m.output;
3268
+ const D = (s.capture ? "(" : "") + v.open;
3269
+ Zt("parens"), j({ type: E, value: N, output: m.output ? "" : p }), j({ type: "paren", extglob: !0, value: P(), output: D }), X.push(v);
3270
+ }, Sn = (E) => {
3271
+ let N = E.close + (s.capture ? ")" : ""), v;
3272
+ if (E.type === "negate") {
3273
+ let D = A;
3274
+ if (E.inner && E.inner.length > 1 && E.inner.includes("/") && (D = k(s)), (D !== A || U() || /^\)+$/.test(ot())) && (N = E.close = `)$))${D}`), E.inner.includes("*") && (v = ot()) && /^\.[^\\/.]+$/.test(v)) {
3275
+ const z = ds(v, { ...e, fastpaths: !1 }).output;
3276
+ N = E.close = `)${z})${D})`;
3277
3277
  }
3278
- R.prev.type === "bos" && (y.negatedExtglob = !0);
3278
+ E.prev.type === "bos" && (m.negatedExtglob = !0);
3279
3279
  }
3280
- x({ type: "paren", extglob: !0, value: g, output: N }), At("parens");
3280
+ j({ type: "paren", extglob: !0, value: h, output: N }), At("parens");
3281
3281
  };
3282
3282
  if (s.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(t)) {
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);
3283
+ let E = !1, N = t.replace(xr, (v, D, z, q, Q, Ee) => q === "\\" ? (E = !0, v) : q === "?" ? D ? D + q + (Q ? w.repeat(Q.length) : "") : Ee === 0 ? O + (Q ? w.repeat(Q.length) : "") : w.repeat(z.length) : q === "." ? c.repeat(z.length) : q === "*" ? D ? D + q + (Q ? A : "") : A : D ? v : `\\${v}`);
3284
+ return E === !0 && (s.unescape === !0 ? N = N.replace(/\\/g, "") : N = N.replace(/\\+/g, (v) => v.length % 2 === 0 ? "\\\\" : v ? "\\" : "")), N === t && s.contains === !0 ? (m.output = t, m) : (m.output = dt.wrapOutput(N, m, e), m);
3285
3285
  }
3286
- for (; !it(); ) {
3287
- if (g = F(), g === "\0")
3286
+ for (; !U(); ) {
3287
+ if (h = P(), h === "\0")
3288
3288
  continue;
3289
- if (g === "\\") {
3290
- const v = U();
3289
+ if (h === "\\") {
3290
+ const v = x();
3291
3291
  if (v === "/" && s.bash !== !0 || v === "." || v === ";")
3292
3292
  continue;
3293
3293
  if (!v) {
3294
- g += "\\", x({ type: "text", value: g });
3294
+ h += "\\", j({ type: "text", value: h });
3295
3295
  continue;
3296
3296
  }
3297
- const P = /^\\+/.exec(yt());
3298
- let B = 0;
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 });
3297
+ const D = /^\\+/.exec(ot());
3298
+ let z = 0;
3299
+ if (D && D[0].length > 2 && (z = D[0].length, m.index += z, z % 2 !== 0 && (h += "\\")), s.unescape === !0 ? h = P() : h += P(), m.brackets === 0) {
3300
+ j({ type: "text", value: h });
3301
3301
  continue;
3302
3302
  }
3303
3303
  }
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];
3304
+ if (m.brackets > 0 && (h !== "]" || g.value === "[" || g.value === "[^")) {
3305
+ if (s.posix !== !1 && h === ":") {
3306
+ const v = g.value.slice(1);
3307
+ if (v.includes("[") && (g.posix = !0, v.includes(":"))) {
3308
+ const D = g.value.lastIndexOf("["), z = g.value.slice(0, D), q = g.value.slice(D + 2), Q = $r[q];
3309
3309
  if (Q) {
3310
- m.value = B + Q, y.backtrack = !0, F(), !o.output && r.indexOf(m) === 1 && (o.output = p);
3310
+ g.value = z + Q, m.backtrack = !0, P(), !o.output && r.indexOf(g) === 1 && (o.output = p);
3311
3311
  continue;
3312
3312
  }
3313
3313
  }
3314
3314
  }
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 });
3315
+ (h === "[" && x() !== ":" || h === "-" && x() === "]") && (h = `\\${h}`), h === "]" && (g.value === "[" || g.value === "[^") && (h = `\\${h}`), s.posix === !0 && h === "!" && g.value === "[" && (h = "^"), g.value += h, ft({ value: h });
3316
3316
  continue;
3317
3317
  }
3318
- if (y.quotes === 1 && g !== '"') {
3319
- g = pt.escapeRegex(g), m.value += g, _t({ value: g });
3318
+ if (m.quotes === 1 && h !== '"') {
3319
+ h = dt.escapeRegex(h), g.value += h, ft({ value: h });
3320
3320
  continue;
3321
3321
  }
3322
- if (g === '"') {
3323
- y.quotes = y.quotes === 1 ? 0 : 1, s.keepQuotes === !0 && x({ type: "text", value: g });
3322
+ if (h === '"') {
3323
+ m.quotes = m.quotes === 1 ? 0 : 1, s.keepQuotes === !0 && j({ type: "text", value: h });
3324
3324
  continue;
3325
3325
  }
3326
- if (g === "(") {
3327
- Zt("parens"), x({ type: "paren", value: g });
3326
+ if (h === "(") {
3327
+ Zt("parens"), j({ type: "paren", value: h });
3328
3328
  continue;
3329
3329
  }
3330
- if (g === ")") {
3331
- if (y.parens === 0 && s.strictBrackets === !0)
3330
+ if (h === ")") {
3331
+ if (m.parens === 0 && s.strictBrackets === !0)
3332
3332
  throw new SyntaxError(jt("opening", "("));
3333
- const v = L[L.length - 1];
3334
- if (v && y.parens === v.parens + 1) {
3335
- Sn(L.pop());
3333
+ const v = X[X.length - 1];
3334
+ if (v && m.parens === v.parens + 1) {
3335
+ Sn(X.pop());
3336
3336
  continue;
3337
3337
  }
3338
- x({ type: "paren", value: g, output: y.parens ? ")" : "\\)" }), At("parens");
3338
+ j({ type: "paren", value: h, output: m.parens ? ")" : "\\)" }), At("parens");
3339
3339
  continue;
3340
3340
  }
3341
- if (g === "[") {
3342
- if (s.nobracket === !0 || !yt().includes("]")) {
3341
+ if (h === "[") {
3342
+ if (s.nobracket === !0 || !ot().includes("]")) {
3343
3343
  if (s.nobracket !== !0 && s.strictBrackets === !0)
3344
3344
  throw new SyntaxError(jt("closing", "]"));
3345
- g = `\\${g}`;
3345
+ h = `\\${h}`;
3346
3346
  } else
3347
3347
  Zt("brackets");
3348
- x({ type: "bracket", value: g });
3348
+ j({ type: "bracket", value: h });
3349
3349
  continue;
3350
3350
  }
3351
- if (g === "]") {
3352
- if (s.nobracket === !0 || m && m.type === "bracket" && m.value.length === 1) {
3353
- x({ type: "text", value: g, output: `\\${g}` });
3351
+ if (h === "]") {
3352
+ if (s.nobracket === !0 || g && g.type === "bracket" && g.value.length === 1) {
3353
+ j({ type: "text", value: h, output: `\\${h}` });
3354
3354
  continue;
3355
3355
  }
3356
- if (y.brackets === 0) {
3356
+ if (m.brackets === 0) {
3357
3357
  if (s.strictBrackets === !0)
3358
3358
  throw new SyntaxError(jt("opening", "["));
3359
- x({ type: "text", value: g, output: `\\${g}` });
3359
+ j({ type: "text", value: h, output: `\\${h}` });
3360
3360
  continue;
3361
3361
  }
3362
3362
  At("brackets");
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))
3363
+ const v = g.value.slice(1);
3364
+ if (g.posix !== !0 && v[0] === "^" && !v.includes("/") && (h = `/${h}`), g.value += h, ft({ value: h }), s.literalBrackets === !1 || dt.hasRegexChars(v))
3365
3365
  continue;
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;
3366
+ const D = dt.escapeRegex(g.value);
3367
+ if (m.output = m.output.slice(0, -g.value.length), s.literalBrackets === !0) {
3368
+ m.output += D, g.value = D;
3369
3369
  continue;
3370
3370
  }
3371
- m.value = `(${a}${P}|${m.value})`, y.output += m.value;
3371
+ g.value = `(${a}${D}|${g.value})`, m.output += g.value;
3372
3372
  continue;
3373
3373
  }
3374
- if (g === "{" && s.nobrace !== !0) {
3374
+ if (h === "{" && s.nobrace !== !0) {
3375
3375
  Zt("braces");
3376
3376
  const v = {
3377
3377
  type: "brace",
3378
- value: g,
3378
+ value: h,
3379
3379
  output: "(",
3380
- outputIndex: y.output.length,
3381
- tokensIndex: y.tokens.length
3380
+ outputIndex: m.output.length,
3381
+ tokensIndex: m.tokens.length
3382
3382
  };
3383
- V.push(v), x(v);
3383
+ B.push(v), j(v);
3384
3384
  continue;
3385
3385
  }
3386
- if (g === "}") {
3387
- const v = V[V.length - 1];
3386
+ if (h === "}") {
3387
+ const v = B[B.length - 1];
3388
3388
  if (s.nobrace === !0 || !v) {
3389
- x({ type: "text", value: g, output: g });
3389
+ j({ type: "text", value: h, output: h });
3390
3390
  continue;
3391
3391
  }
3392
- let P = ")";
3392
+ let D = ")";
3393
3393
  if (v.dots === !0) {
3394
- const B = r.slice(), X = [];
3395
- for (let Q = B.length - 1; Q >= 0 && (r.pop(), B[Q].type !== "brace"); Q--)
3396
- B[Q].type !== "dots" && X.unshift(B[Q].value);
3397
- P = Dr(X, s), y.backtrack = !0;
3394
+ const z = r.slice(), q = [];
3395
+ for (let Q = z.length - 1; Q >= 0 && (r.pop(), z[Q].type !== "brace"); Q--)
3396
+ z[Q].type !== "dots" && q.unshift(z[Q].value);
3397
+ D = Dr(q, s), m.backtrack = !0;
3398
3398
  }
3399
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
- for (const Q of X)
3403
- y.output += Q.output || Q.value;
3400
+ const z = m.output.slice(0, v.outputIndex), q = m.tokens.slice(v.tokensIndex);
3401
+ v.value = v.output = "\\{", h = D = "\\}", m.output = z;
3402
+ for (const Q of q)
3403
+ m.output += Q.output || Q.value;
3404
3404
  }
3405
- x({ type: "brace", value: g, output: P }), At("braces"), V.pop();
3405
+ j({ type: "brace", value: h, output: D }), At("braces"), B.pop();
3406
3406
  continue;
3407
3407
  }
3408
- if (g === "|") {
3409
- L.length > 0 && L[L.length - 1].conditions++, x({ type: "text", value: g });
3408
+ if (h === "|") {
3409
+ X.length > 0 && X[X.length - 1].conditions++, j({ type: "text", value: h });
3410
3410
  continue;
3411
3411
  }
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 });
3412
+ if (h === ",") {
3413
+ let v = h;
3414
+ const D = B[B.length - 1];
3415
+ D && F[F.length - 1] === "braces" && (D.comma = !0, v = "|"), j({ type: "comma", value: h, output: v });
3416
3416
  continue;
3417
3417
  }
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;
3418
+ if (h === "/") {
3419
+ if (g.type === "dot" && m.index === m.start + 1) {
3420
+ m.start = m.index + 1, m.consumed = "", m.output = "", r.pop(), g = o;
3421
3421
  continue;
3422
3422
  }
3423
- x({ type: "slash", value: g, output: h });
3423
+ j({ type: "slash", value: h, output: y });
3424
3424
  continue;
3425
3425
  }
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;
3426
+ if (h === ".") {
3427
+ if (m.braces > 0 && g.type === "dot") {
3428
+ g.value === "." && (g.output = c);
3429
+ const v = B[B.length - 1];
3430
+ g.type = "dots", g.output += h, g.value += h, v.dots = !0;
3431
3431
  continue;
3432
3432
  }
3433
- if (y.braces + y.parens === 0 && m.type !== "bos" && m.type !== "slash") {
3434
- x({ type: "text", value: g, output: c });
3433
+ if (m.braces + m.parens === 0 && g.type !== "bos" && g.type !== "slash") {
3434
+ j({ type: "text", value: h, output: c });
3435
3435
  continue;
3436
3436
  }
3437
- x({ type: "dot", value: g, output: c });
3437
+ j({ type: "dot", value: h, output: c });
3438
3438
  continue;
3439
3439
  }
3440
- if (g === "?") {
3441
- if (!(m && m.value === "(") && s.noextglob !== !0 && U() === "(" && U(2) !== "?") {
3442
- te("qmark", g);
3440
+ if (h === "?") {
3441
+ if (!(g && g.value === "(") && s.noextglob !== !0 && x() === "(" && x(2) !== "?") {
3442
+ te("qmark", h);
3443
3443
  continue;
3444
3444
  }
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 });
3445
+ if (g && g.type === "paren") {
3446
+ const D = x();
3447
+ let z = h;
3448
+ (g.value === "(" && !/[!=<:]/.test(D) || D === "<" && !/<([!=]|\w+>)/.test(ot())) && (z = `\\${h}`), j({ type: "text", value: h, output: z });
3449
3449
  continue;
3450
3450
  }
3451
- if (s.dot !== !0 && (m.type === "slash" || m.type === "bos")) {
3452
- x({ type: "qmark", value: g, output: O });
3451
+ if (s.dot !== !0 && (g.type === "slash" || g.type === "bos")) {
3452
+ j({ type: "qmark", value: h, output: S });
3453
3453
  continue;
3454
3454
  }
3455
- x({ type: "qmark", value: g, output: S });
3455
+ j({ type: "qmark", value: h, output: w });
3456
3456
  continue;
3457
3457
  }
3458
- if (g === "!") {
3459
- if (s.noextglob !== !0 && U() === "(" && (U(2) !== "?" || !/[!=<:]/.test(U(3)))) {
3460
- te("negate", g);
3458
+ if (h === "!") {
3459
+ if (s.noextglob !== !0 && x() === "(" && (x(2) !== "?" || !/[!=<:]/.test(x(3)))) {
3460
+ te("negate", h);
3461
3461
  continue;
3462
3462
  }
3463
- if (s.nonegate !== !0 && y.index === 0) {
3463
+ if (s.nonegate !== !0 && m.index === 0) {
3464
3464
  vn();
3465
3465
  continue;
3466
3466
  }
3467
3467
  }
3468
- if (g === "+") {
3469
- if (s.noextglob !== !0 && U() === "(" && U(2) !== "?") {
3470
- te("plus", g);
3468
+ if (h === "+") {
3469
+ if (s.noextglob !== !0 && x() === "(" && x(2) !== "?") {
3470
+ te("plus", h);
3471
3471
  continue;
3472
3472
  }
3473
- if (m && m.value === "(" || s.regex === !1) {
3474
- x({ type: "plus", value: g, output: f });
3473
+ if (g && g.value === "(" || s.regex === !1) {
3474
+ j({ type: "plus", value: h, output: f });
3475
3475
  continue;
3476
3476
  }
3477
- if (m && (m.type === "bracket" || m.type === "paren" || m.type === "brace") || y.parens > 0) {
3478
- x({ type: "plus", value: g });
3477
+ if (g && (g.type === "bracket" || g.type === "paren" || g.type === "brace") || m.parens > 0) {
3478
+ j({ type: "plus", value: h });
3479
3479
  continue;
3480
3480
  }
3481
- x({ type: "plus", value: f });
3481
+ j({ type: "plus", value: f });
3482
3482
  continue;
3483
3483
  }
3484
- if (g === "@") {
3485
- if (s.noextglob !== !0 && U() === "(" && U(2) !== "?") {
3486
- x({ type: "at", extglob: !0, value: g, output: "" });
3484
+ if (h === "@") {
3485
+ if (s.noextglob !== !0 && x() === "(" && x(2) !== "?") {
3486
+ j({ type: "at", extglob: !0, value: h, output: "" });
3487
3487
  continue;
3488
3488
  }
3489
- x({ type: "text", value: g });
3489
+ j({ type: "text", value: h });
3490
3490
  continue;
3491
3491
  }
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 });
3492
+ if (h !== "*") {
3493
+ (h === "$" || h === "^") && (h = `\\${h}`);
3494
+ const v = Pr.exec(ot());
3495
+ v && (h += v[0], m.index += v[0].length), j({ type: "text", value: h });
3496
3496
  continue;
3497
3497
  }
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);
3498
+ if (g && (g.type === "globstar" || g.star === !0)) {
3499
+ g.type = "star", g.star = !0, g.value += h, g.output = A, m.backtrack = !0, m.globstar = !0, Y(h);
3500
3500
  continue;
3501
3501
  }
3502
- let R = yt();
3503
- if (s.noextglob !== !0 && /^\([^?]/.test(R)) {
3504
- te("star", g);
3502
+ let E = ot();
3503
+ if (s.noextglob !== !0 && /^\([^?]/.test(E)) {
3504
+ te("star", h);
3505
3505
  continue;
3506
3506
  }
3507
- if (m.type === "star") {
3507
+ if (g.type === "star") {
3508
3508
  if (s.noglobstar === !0) {
3509
- rt(g);
3509
+ Y(h);
3510
3510
  continue;
3511
3511
  }
3512
- const v = m.prev, P = v.prev, B = v.type === "slash" || v.type === "bos", X = P && (P.type === "star" || P.type === "globstar");
3513
- if (s.bash === !0 && (!B || R[0] && R[0] !== "/")) {
3514
- x({ type: "star", value: g, output: "" });
3512
+ const v = g.prev, D = v.prev, z = v.type === "slash" || v.type === "bos", q = D && (D.type === "star" || D.type === "globstar");
3513
+ if (s.bash === !0 && (!z || E[0] && E[0] !== "/")) {
3514
+ j({ type: "star", value: h, output: "" });
3515
3515
  continue;
3516
3516
  }
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: "" });
3517
+ const Q = m.braces > 0 && (v.type === "comma" || v.type === "brace"), Ee = X.length && (v.type === "pipe" || v.type === "paren");
3518
+ if (!z && v.type !== "paren" && !Q && !Ee) {
3519
+ j({ type: "star", value: h, output: "" });
3520
3520
  continue;
3521
3521
  }
3522
- for (; R.slice(0, 3) === "/**"; ) {
3523
- const ee = t[y.index + 4];
3522
+ for (; E.slice(0, 3) === "/**"; ) {
3523
+ const ee = t[m.index + 4];
3524
3524
  if (ee && ee !== "/")
3525
3525
  break;
3526
- R = R.slice(3), rt("/**", 3);
3526
+ E = E.slice(3), Y("/**", 3);
3527
3527
  }
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);
3528
+ if (v.type === "bos" && U()) {
3529
+ g.type = "globstar", g.value += h, g.output = k(s), m.output = g.output, m.globstar = !0, Y(h);
3530
3530
  continue;
3531
3531
  }
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);
3532
+ if (v.type === "slash" && v.prev.type !== "bos" && !q && U()) {
3533
+ m.output = m.output.slice(0, -(v.output + g.output).length), v.output = `(?:${v.output}`, g.type = "globstar", g.output = k(s) + (s.strictSlashes ? ")" : "|$)"), g.value += h, m.globstar = !0, m.output += v.output + g.output, Y(h);
3534
3534
  continue;
3535
3535
  }
3536
- if (v.type === "slash" && v.prev.type !== "bos" && R[0] === "/") {
3537
- const ee = R[1] !== void 0 ? "|$" : "";
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: "" });
3536
+ if (v.type === "slash" && v.prev.type !== "bos" && E[0] === "/") {
3537
+ const ee = E[1] !== void 0 ? "|$" : "";
3538
+ m.output = m.output.slice(0, -(v.output + g.output).length), v.output = `(?:${v.output}`, g.type = "globstar", g.output = `${k(s)}${y}|${y}${ee})`, g.value += h, m.output += v.output + g.output, m.globstar = !0, Y(h + P()), j({ type: "slash", value: "/", output: "" });
3539
3539
  continue;
3540
3540
  }
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: "" });
3541
+ if (v.type === "bos" && E[0] === "/") {
3542
+ g.type = "globstar", g.value += h, g.output = `(?:^|${y}|${k(s)}${y})`, m.output = g.output, m.globstar = !0, Y(h + P()), j({ type: "slash", value: "/", output: "" });
3543
3543
  continue;
3544
3544
  }
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);
3545
+ m.output = m.output.slice(0, -g.output.length), g.type = "globstar", g.output = k(s), g.value += h, m.output += g.output, m.globstar = !0, Y(h);
3546
3546
  continue;
3547
3547
  }
3548
- const N = { type: "star", value: g, output: M };
3548
+ const N = { type: "star", value: h, output: A };
3549
3549
  if (s.bash === !0) {
3550
- N.output = ".*?", (m.type === "bos" || m.type === "slash") && (N.output = T + N.output), x(N);
3550
+ N.output = ".*?", (g.type === "bos" || g.type === "slash") && (N.output = L + N.output), j(N);
3551
3551
  continue;
3552
3552
  }
3553
- if (m && (m.type === "bracket" || m.type === "paren") && s.regex === !0) {
3554
- N.output = g, x(N);
3553
+ if (g && (g.type === "bracket" || g.type === "paren") && s.regex === !0) {
3554
+ N.output = h, j(N);
3555
3555
  continue;
3556
3556
  }
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);
3557
+ (m.index === m.start || g.type === "slash" || g.type === "dot") && (g.type === "dot" ? (m.output += _, g.output += _) : s.dot === !0 ? (m.output += M, g.output += M) : (m.output += L, g.output += L), x() !== "*" && (m.output += p, g.output += p)), j(N);
3558
3558
  }
3559
- for (; y.brackets > 0; ) {
3559
+ for (; m.brackets > 0; ) {
3560
3560
  if (s.strictBrackets === !0)
3561
3561
  throw new SyntaxError(jt("closing", "]"));
3562
- y.output = pt.escapeLast(y.output, "["), At("brackets");
3562
+ m.output = dt.escapeLast(m.output, "["), At("brackets");
3563
3563
  }
3564
- for (; y.parens > 0; ) {
3564
+ for (; m.parens > 0; ) {
3565
3565
  if (s.strictBrackets === !0)
3566
3566
  throw new SyntaxError(jt("closing", ")"));
3567
- y.output = pt.escapeLast(y.output, "("), At("parens");
3567
+ m.output = dt.escapeLast(m.output, "("), At("parens");
3568
3568
  }
3569
- for (; y.braces > 0; ) {
3569
+ for (; m.braces > 0; ) {
3570
3570
  if (s.strictBrackets === !0)
3571
3571
  throw new SyntaxError(jt("closing", "}"));
3572
- y.output = pt.escapeLast(y.output, "{"), At("braces");
3572
+ m.output = dt.escapeLast(m.output, "{"), At("braces");
3573
3573
  }
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);
3574
+ if (s.strictSlashes !== !0 && (g.type === "star" || g.type === "bracket") && j({ type: "maybe_slash", value: "", output: `${y}?` }), m.backtrack === !0) {
3575
+ m.output = "";
3576
+ for (const E of m.tokens)
3577
+ m.output += E.output != null ? E.output : E.value, E.suffix && (m.output += E.suffix);
3578
3578
  }
3579
- return y;
3579
+ return m;
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,55 +3591,55 @@ ds.fastpaths = (t, e) => {
3591
3591
  NO_DOT: l,
3592
3592
  NO_DOTS: c,
3593
3593
  NO_DOTS_SLASH: f,
3594
- STAR: h,
3594
+ STAR: y,
3595
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
- switch (T) {
3596
+ } = ge.globChars(s.windows), d = s.dot ? c : l, b = s.dot ? f : l, _ = s.capture ? "" : "?:", M = { negated: !1, prefix: "" };
3597
+ let w = s.bash === !0 ? ".*?" : y;
3598
+ s.capture && (w = `(${w})`);
3599
+ const S = (L) => L.noglobstar === !0 ? w : `(${_}(?:(?!${p}${L.dot ? u : o}).)*?)`, $ = (L) => {
3600
+ switch (L) {
3601
3601
  case "*":
3602
- return `${d}${a}${S}`;
3602
+ return `${d}${a}${w}`;
3603
3603
  case ".*":
3604
- return `${o}${a}${S}`;
3604
+ return `${o}${a}${w}`;
3605
3605
  case "*.*":
3606
- return `${d}${S}${o}${a}${S}`;
3606
+ return `${d}${w}${o}${a}${w}`;
3607
3607
  case "*/*":
3608
- return `${d}${S}${r}${a}${b}${S}`;
3608
+ return `${d}${w}${r}${a}${b}${w}`;
3609
3609
  case "**":
3610
- return d + O(s);
3610
+ return d + S(s);
3611
3611
  case "**/*":
3612
- return `(?:${d}${O(s)}${r})?${b}${a}${S}`;
3612
+ return `(?:${d}${S(s)}${r})?${b}${a}${w}`;
3613
3613
  case "**/*.*":
3614
- return `(?:${d}${O(s)}${r})?${b}${S}${o}${a}${S}`;
3614
+ return `(?:${d}${S(s)}${r})?${b}${w}${o}${a}${w}`;
3615
3615
  case "**/.*":
3616
- return `(?:${d}${O(s)}${r})?${o}${a}${S}`;
3616
+ return `(?:${d}${S(s)}${r})?${o}${a}${w}`;
3617
3617
  default: {
3618
- const _ = /^(.*?)\.(\w+)$/.exec(T);
3619
- if (!_)
3618
+ const O = /^(.*?)\.(\w+)$/.exec(L);
3619
+ if (!O)
3620
3620
  return;
3621
- const M = $(_[1]);
3622
- return M ? M + o + _[2] : void 0;
3621
+ const A = $(O[1]);
3622
+ return A ? A + o + O[2] : void 0;
3623
3623
  }
3624
3624
  }
3625
- }, E = pt.removePrefix(t, A);
3626
- let j = $(E);
3627
- return j && s.strictSlashes !== !0 && (j += `${r}?`), j;
3625
+ }, R = dt.removePrefix(t, M);
3626
+ let k = $(R);
3627
+ return k && s.strictSlashes !== !0 && (k += `${r}?`), k;
3628
3628
  };
3629
3629
  var jr = ds;
3630
- const Tr = Cr, We = jr, _n = Se, Lr = Re, kr = (t) => t && typeof t == "object" && !Array.isArray(t), G = (t, e, s = !1) => {
3630
+ const Tr = Cr, We = jr, _n = Se, kr = Re, Lr = (t) => t && typeof t == "object" && !Array.isArray(t), G = (t, e, s = !1) => {
3631
3631
  if (Array.isArray(t)) {
3632
- const c = t.map((h) => G(h, e, s));
3633
- return (h) => {
3632
+ const c = t.map((y) => G(y, e, s));
3633
+ return (y) => {
3634
3634
  for (const p of c) {
3635
- const d = p(h);
3635
+ const d = p(y);
3636
3636
  if (d)
3637
3637
  return d;
3638
3638
  }
3639
3639
  return !1;
3640
3640
  };
3641
3641
  }
3642
- const n = kr(t) && t.tokens && t.input;
3642
+ const n = Lr(t) && t.tokens && t.input;
3643
3643
  if (t === "" || typeof t != "string" && !n)
3644
3644
  throw new TypeError("Expected pattern to be a non-empty string");
3645
3645
  const i = e || {}, o = i.windows, r = n ? G.compileRe(t, e) : G.makeRe(t, e, !1, !0), a = r.state;
@@ -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: 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);
3653
+ const { isMatch: y, 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: y };
3654
+ return typeof i.onResult == "function" && i.onResult(b), y === !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
  };
@@ -3693,7 +3693,7 @@ G.toRegex = (t, e) => {
3693
3693
  return /$^/;
3694
3694
  }
3695
3695
  };
3696
- G.constants = Lr;
3696
+ G.constants = kr;
3697
3697
  var Ur = G, Hr = Ur;
3698
3698
  const Nr = /* @__PURE__ */ Je(Hr), wn = Ge(fetch), Fr = async (t, e) => {
3699
3699
  const s = new URL(t);
@@ -3750,9 +3750,9 @@ 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, h, p;
3753
+ var c, f, y, p;
3754
3754
  if (u._iframe) {
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)
3755
+ if ((p = (y = (f = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : f.metaframes) == null ? void 0 : y[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
3758
  let d = cs(this.url, "definition");
@@ -3862,7 +3862,7 @@ Error: ${s != null && s.message ? s == null ? void 0 : s.message : s == null ? v
3862
3862
  state: {
3863
3863
  inputs: this.inputs
3864
3864
  },
3865
- version: ks
3865
+ version: Ls
3866
3866
  };
3867
3867
  this.sendRpcInternal(Ot.SetupIframeServerResponse, e);
3868
3868
  }
@@ -3940,7 +3940,7 @@ const wt = C({
3940
3940
  outputs: {}
3941
3941
  }
3942
3942
  }, (t) => t), yo = (t) => vt(t), Vr = (t, e) => !!(!e || e === "**" || t === e || Nr.isMatch(t, e)), Wr = "bcbcbc";
3943
- class tt extends or {
3943
+ class st extends or {
3944
3944
  static async from(e, s) {
3945
3945
  if (e == null)
3946
3946
  throw "Metapage definition cannot be null";
@@ -3950,7 +3950,7 @@ class tt extends or {
3950
3950
  } catch {
3951
3951
  throw "Cannot parse into JSON:\n${metaPageDef}";
3952
3952
  }
3953
- var n = new tt();
3953
+ var n = new st();
3954
3954
  return n.debug = (s == null ? void 0 : s.debug) || !1, n.setDefinition(e);
3955
3955
  }
3956
3956
  constructor(e) {
@@ -4021,7 +4021,7 @@ class tt extends or {
4021
4021
  });
4022
4022
  let r = new URL(i.url);
4023
4023
  Object.entries(this._injectedSecrets[s]).forEach(([l, c]) => {
4024
- r = new URL(kt(r.href, l, c));
4024
+ r = new URL(Lt(r.href, l, c));
4025
4025
  }), Object.entries(this._injectedQuerySecrets[s]).forEach(([l, c]) => {
4026
4026
  const f = btoa(encodeURIComponent(c));
4027
4027
  r.searchParams.set(l, f);
@@ -4045,30 +4045,30 @@ 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 h = a[f];
4049
- if (h === void 0) {
4048
+ const y = a[f];
4049
+ if (y === void 0) {
4050
4050
  const p = new URL(o);
4051
4051
  let d = p.hash.startsWith("#?") ? p.hash.slice(2) : p.hash.slice(1);
4052
4052
  d = d.replace(/\?/g, "&");
4053
4053
  const b = new URLSearchParams(d);
4054
4054
  b.delete(f);
4055
- const w = b.toString();
4056
- p.hash = w ? p.hash.startsWith("#?") ? `?${w}` : w : "", o = p.href;
4055
+ const _ = b.toString();
4056
+ p.hash = _ ? p.hash.startsWith("#?") ? `?${_}` : _ : "", o = p.href;
4057
4057
  } else {
4058
- const p = kt(o, f, h);
4058
+ const p = Lt(o, f, y);
4059
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 h = l[f], p = new URL(o);
4065
- h === void 0 ? p.searchParams.delete(f) : p.searchParams.set(f, h), o = p.href;
4064
+ const y = l[f], p = new URL(o);
4065
+ y === void 0 ? p.searchParams.delete(f) : p.searchParams.set(f, y), 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
+ var y;
4072
4072
  const n = await Vn(e);
4073
4073
  if (this.isDisposed())
4074
4074
  return { newDefinition: n, added: {}, removed: {} };
@@ -4080,7 +4080,7 @@ class tt extends or {
4080
4080
  throw this.emitErrorMessage(`Metaframe "${p}" missing field: url`), `Metaframe "${p}" missing field: url`;
4081
4081
  });
4082
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) => {
4083
+ (y = this._definition) != null && y.metaframes && Object.keys(this._definition.metaframes).forEach((p) => {
4084
4084
  u[p] = this._definition.metaframes[p].url;
4085
4085
  }), this._definition = n;
4086
4086
  const l = {};
@@ -4101,8 +4101,8 @@ class tt extends or {
4101
4101
  const d = this._metaframes[p];
4102
4102
  if (!d)
4103
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));
4104
+ const b = n.metaframes[p].url, _ = u[p];
4105
+ b && _ !== b && (d.url = b, d._iframe && (d._iframe.src = b));
4106
4106
  }), n.metaframes && (Object.keys(n.metaframes).forEach((p) => {
4107
4107
  if (c[p])
4108
4108
  return;
@@ -4115,33 +4115,33 @@ class tt extends or {
4115
4115
  ...Object.keys(i),
4116
4116
  ...Object.keys(o)
4117
4117
  ])).forEach((p) => {
4118
- var d, b, w, A, S;
4118
+ var d, b, _, M, w;
4119
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:"))
4120
+ const S = i[p] || {}, $ = o[p] || {}, R = this._metaframes[p], k = (_ = (b = (d = this._definition) == null ? void 0 : d.metaframes) == null ? void 0 : b[p]) == null ? void 0 : _.url;
4121
+ if (!k || k.startsWith("data:"))
4122
4122
  return;
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] = _;
4123
+ let L = new URL(k);
4124
+ if (Object.keys(S).length > 0) {
4125
+ const O = r[p] || {};
4126
+ Object.keys(S).forEach((A) => {
4127
+ const m = ze(L.href, A);
4128
+ O[A] = m;
4129
+ }), this._injectedSecrets[p] = S, this._originalSecretHashParams[p] = O;
4130
4130
  }
4131
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] = _;
4132
+ const O = a[p] || {};
4133
+ Object.keys($).forEach((A) => {
4134
+ const m = L.searchParams.get(A);
4135
+ O[A] = m || void 0;
4136
+ }), this._injectedQuerySecrets[p] = $, this._originalSecretQueryParams[p] = O;
4137
4137
  }
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;
4138
+ Object.entries(S).forEach(([O, A]) => {
4139
+ L = new URL(Lt(L.href, O, A));
4140
+ }), Object.entries($).forEach(([O, A]) => {
4141
+ const m = btoa(encodeURIComponent(A));
4142
+ L.searchParams.set(O, m);
4143
+ }), R.url = L.href, (w = (M = this._definition) == null ? void 0 : M.metaframes) != null && w[p] && (this._definition = C(this._definition, (O) => {
4144
+ O.metaframes[p].url = L.href;
4145
4145
  }));
4146
4146
  }
4147
4147
  }), { newDefinition: n, added: c, removed: l };
@@ -4278,7 +4278,7 @@ class tt extends or {
4278
4278
  if (e.jsonrpc !== "2.0")
4279
4279
  return !1;
4280
4280
  switch (e.method) {
4281
- case Y.SetupIframeClientRequest:
4281
+ case Z.SetupIframeClientRequest:
4282
4282
  return !0;
4283
4283
  default:
4284
4284
  var n = e.iframeId;
@@ -4372,7 +4372,7 @@ class tt extends or {
4372
4372
  iframeId: e,
4373
4373
  parentId: this._id,
4374
4374
  jsonrpc: "2.0",
4375
- method: Y.OutputsUpdate,
4375
+ method: Z.OutputsUpdate,
4376
4376
  id: "_",
4377
4377
  params: s
4378
4378
  });
@@ -4398,16 +4398,16 @@ class tt extends or {
4398
4398
  const i = this.getMetaframe(n);
4399
4399
  if (i) {
4400
4400
  switch (e._messageCount = ++this._internalReceivedMessageCounter, this.debug && this.log(`processing ${JSON.stringify(e, null, " ").substring(0, 500)}`), s) {
4401
- case Y.SetupIframeClientRequest:
4401
+ case Z.SetupIframeClientRequest:
4402
4402
  i.register();
4403
4403
  break;
4404
- case Y.SetupIframeServerResponseAck:
4404
+ case Z.SetupIframeServerResponseAck:
4405
4405
  if (i) {
4406
4406
  const l = e.params;
4407
4407
  i.registered(l.version);
4408
4408
  }
4409
4409
  break;
4410
- case Y.OutputsUpdate:
4410
+ case Z.OutputsUpdate:
4411
4411
  const u = e.params;
4412
4412
  if (!u || Object.keys(u).length === 0)
4413
4413
  break;
@@ -4416,7 +4416,7 @@ class tt extends or {
4416
4416
  this.setOutputStateOnlyMetaframeInputMap(n, u), o.setOutputs(u);
4417
4417
  var r = !1;
4418
4418
  const l = Object.keys(u), c = {};
4419
- l.forEach((f, h) => {
4419
+ l.forEach((f, y) => {
4420
4420
  const p = this.getInputsFromOutput(n, f);
4421
4421
  p.length > 0 && p.forEach((d) => {
4422
4422
  c[d.metaframe] || (c[d.metaframe] = {}), c[d.metaframe][d.pipe] = u[f], r = !0;
@@ -4427,52 +4427,52 @@ class tt extends or {
4427
4427
  } else
4428
4428
  this.error(`missing metaframe=${n}`);
4429
4429
  break;
4430
- case Y.InputsUpdate:
4430
+ case Z.InputsUpdate:
4431
4431
  var a = e.params;
4432
4432
  this.debug && this.log(`inputs ${JSON.stringify(a)} from ${n}`), this._metaframes[n] ? (this.setInputStateOnlyMetaframeInputMap(n, a), this._metaframes[n].setInputs(a), this.listenerCount(I.State) > 0 && wt !== this._state && this.emit(I.State, this._state), this.debug && this._metaframes[n].ack({
4433
4433
  jsonrpc: e,
4434
4434
  state: this._state
4435
4435
  })) : (console.error(`InputsUpdate failed no metaframe id: "${n}"`), this.error(`InputsUpdate failed no metaframe id: "${n}"`));
4436
4436
  break;
4437
- case Y.HashParamsUpdate:
4437
+ case Z.HashParamsUpdate:
4438
4438
  if (i) {
4439
4439
  if (i.url.startsWith("data:"))
4440
4440
  break;
4441
4441
  const l = e.params, c = l.metaframe;
4442
4442
  let f = new URL(i.url);
4443
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));
4444
+ f = new URL(Lt(f.href, d, b));
4445
4445
  }), this._injectedQuerySecrets[c] && Object.entries(this._injectedQuerySecrets[c]).forEach(([d, b]) => {
4446
- const w = btoa(encodeURIComponent(b));
4447
- f.searchParams.set(d, w);
4446
+ const _ = btoa(encodeURIComponent(b));
4447
+ f.searchParams.set(d, _);
4448
4448
  }), i.url = f.href;
4449
- let h = f.href;
4449
+ let y = f.href;
4450
4450
  if (this._injectedSecrets[c]) {
4451
4451
  const d = this._originalSecretHashParams[c] || {};
4452
4452
  Object.keys(this._injectedSecrets[c]).forEach((b) => {
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;
4453
+ const _ = d[b];
4454
+ if (_ === void 0) {
4455
+ const M = new URL(y);
4456
+ let w = M.hash.startsWith("#?") ? M.hash.slice(2) : M.hash.slice(1);
4457
+ w = w.replace(/\?/g, "&");
4458
+ const S = new URLSearchParams(w);
4459
+ S.delete(b);
4460
+ const $ = S.toString();
4461
+ M.hash = $ ? M.hash.startsWith("#?") ? `?${$}` : $ : "", y = M.href;
4462
4462
  } else {
4463
- const A = kt(h, b, w);
4464
- h = typeof A == "string" ? A : A.href;
4463
+ const M = Lt(y, b, _);
4464
+ y = typeof M == "string" ? M : M.href;
4465
4465
  }
4466
4466
  });
4467
4467
  }
4468
4468
  if (this._injectedQuerySecrets[c]) {
4469
4469
  const d = this._originalSecretQueryParams[c] || {};
4470
4470
  Object.keys(this._injectedQuerySecrets[c]).forEach((b) => {
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;
4471
+ const _ = d[b], M = new URL(y);
4472
+ _ === void 0 ? M.searchParams.delete(b) : M.searchParams.set(b, _), y = M.href;
4473
4473
  });
4474
4474
  }
4475
- const p = new URL(h);
4475
+ const p = new URL(y);
4476
4476
  this._definition = C(this._definition, (d) => {
4477
4477
  d.metaframes[c].url = p.href;
4478
4478
  }), this._emitDefinitionEvent();
@@ -4490,16 +4490,16 @@ class tt extends or {
4490
4490
  typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), i = this._id ? `Metapage[${this._id}] ${i}` : i, fs(i, s, n);
4491
4491
  }
4492
4492
  }
4493
- tt.version = ks;
4494
- tt.DEFINITION = I.Definition;
4495
- tt.DEFINITION_UPDATE = I.DefinitionUpdate;
4496
- tt.ERROR = I.Error;
4497
- tt.INPUTS = I.Inputs;
4498
- tt.MESSAGE = I.Message;
4499
- tt.OUTPUTS = I.Outputs;
4500
- tt.STATE = I.State;
4501
- tt.deserializeInputs = Vt;
4502
- tt.serializeInputs = ve;
4493
+ st.version = Ls;
4494
+ st.DEFINITION = I.Definition;
4495
+ st.DEFINITION_UPDATE = I.DefinitionUpdate;
4496
+ st.ERROR = I.Error;
4497
+ st.INPUTS = I.Inputs;
4498
+ st.MESSAGE = I.Message;
4499
+ st.OUTPUTS = I.Outputs;
4500
+ st.STATE = I.State;
4501
+ st.deserializeInputs = Vt;
4502
+ st.serializeInputs = ve;
4503
4503
  function ys(t) {
4504
4504
  return t.startsWith("data:") ? t.includes("type=metapage-divider") : !1;
4505
4505
  }
@@ -4541,20 +4541,20 @@ const Gr = (t) => {
4541
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;
4542
4542
  if (!e || !s)
4543
4543
  throw new Error("No valid layout found in metapage definition");
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);
4544
+ const n = /* @__PURE__ */ new Set(), i = s.map((y, p) => {
4545
+ const d = t.metaframes[y.i];
4546
+ return d && ys(d.url) ? { index: p, y: y.y, id: y.i } : null;
4547
+ }).filter((y) => y !== null);
4548
4548
  if (i.length > 0) {
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;
4549
+ const y = i.reduce((d, b) => b.y < d.y ? b : d), p = ((f = s.find((d) => d.i === y.id)) == null ? void 0 : f.y) ?? 0;
4550
4550
  s.forEach((d) => {
4551
4551
  d.y >= p && n.add(d.i);
4552
4552
  });
4553
4553
  }
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);
4554
+ const o = Object.keys(t.metaframes).filter((y) => !n.has(y)), r = Object.keys(t.metaframes).filter((y) => n.has(y));
4555
+ let a = s.filter((y) => o.includes(y.i));
4556
+ a.sort((y, p) => y.y !== p.y ? y.y - p.y : y.x - p.x);
4557
+ const u = a.reduce((y, p) => Math.max(y, p.y + p.h), 0);
4558
4558
  return {
4559
4559
  visibleLayoutItems: a,
4560
4560
  hiddenMetaframeIds: new Set(r),
@@ -4563,7 +4563,7 @@ const Gr = (t) => {
4563
4563
  };
4564
4564
  };
4565
4565
  async function mo(t) {
4566
- var $, E, j, T;
4566
+ var A, m, X, B, F, g;
4567
4567
  let { url: e, definition: s, onOutputs: n, rootDiv: i, options: o = {} } = t;
4568
4568
  if (!e && !s)
4569
4569
  throw new Error("Either url or definition must be provided");
@@ -4572,42 +4572,42 @@ async function mo(t) {
4572
4572
  if (e && (s = await Fr(e)), !s)
4573
4573
  throw new Error("Failed to fetch metapage definition");
4574
4574
  s = Jr(s), s = await Kr(s), await qt();
4575
- const r = new tt();
4575
+ const r = new st();
4576
4576
  r.debug = o.debug || !1;
4577
4577
  try {
4578
4578
  await r.setDefinition(JSON.parse(JSON.stringify(s)));
4579
- } catch (_) {
4580
- throw r.dispose(), new Error(`Failed to set metapage definition: ${_}`);
4579
+ } catch (h) {
4580
+ throw r.dispose(), new Error(`Failed to set metapage definition: ${h}`);
4581
4581
  }
4582
4582
  const a = [];
4583
4583
  n && a.push(r.addListenerReturnDisposer(I.Outputs, n));
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;
4584
+ const u = (m = (A = s == null ? void 0 : s.meta) == null ? void 0 : A.layouts) == null ? void 0 : m["react-grid-layout"], l = u == null ? void 0 : u.layout;
4585
4585
  if (!u || !l)
4586
4586
  throw new Error("No valid layout found in metapage definition");
4587
- let { visibleLayoutItems: c, hiddenMetaframeIds: f, visibleMetaframeIds: h } = Gr(r.getDefinition());
4587
+ let { visibleLayoutItems: c, hiddenMetaframeIds: f, visibleMetaframeIds: y } = Gr(r.getDefinition());
4588
4588
  if (c.length === 0)
4589
4589
  return {
4590
4590
  metapage: r,
4591
- setInputs: (_) => {
4592
- r.isDisposed() || r.setInputs(_);
4591
+ setInputs: (h) => {
4592
+ r.isDisposed() || r.setInputs(h);
4593
4593
  },
4594
- setOutputs: (_) => {
4595
- r.isDisposed() || r.setOutputs(_);
4594
+ setOutputs: (h) => {
4595
+ r.isDisposed() || r.setOutputs(h);
4596
4596
  },
4597
4597
  dispose: () => {
4598
- a.forEach((_) => _()), r.dispose();
4598
+ a.forEach((h) => h()), r.dispose();
4599
4599
  }
4600
4600
  };
4601
- c.sort((_, M) => _.y !== M.y ? _.y - M.y : _.x - M.x);
4601
+ c.sort((h, U) => h.y !== U.y ? h.y - U.y : h.x - U.x);
4602
4602
  const p = {
4603
4603
  display: "grid",
4604
4604
  gridTemplateColumns: "repeat(1, 1fr)",
4605
4605
  gridAutoRows: "1fr",
4606
- gap: `${((j = u.props.margin) == null ? void 0 : j[0]) || 10}px`,
4606
+ gap: `${((X = u.props.margin) == null ? void 0 : X[0]) || 10}px`,
4607
4607
  width: "100%",
4608
4608
  height: "100%",
4609
4609
  maxHeight: "100%",
4610
- padding: ((T = u.props.containerPadding) == null ? void 0 : T[0]) || 0,
4610
+ padding: ((B = u.props.containerPadding) == null ? void 0 : B[0]) || 0,
4611
4611
  minHeight: 0,
4612
4612
  alignContent: "start",
4613
4613
  alignItems: "start",
@@ -4620,20 +4620,20 @@ async function mo(t) {
4620
4620
  flexDirection: "column"
4621
4621
  }, b = document.createElement("div");
4622
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)
4623
+ const _ = document.createElement("div");
4624
+ Object.assign(_.style, p);
4625
+ const M = [];
4626
+ for (const h of y) {
4627
+ const U = l.find((ft) => ft.i === h);
4628
+ if (!U)
4629
4629
  continue;
4630
- const y = r.getMetaframes()[_], L = await y.iframe;
4631
- if (!y)
4630
+ const x = r.getMetaframes()[h], P = await x.iframe;
4631
+ if (!x)
4632
4632
  continue;
4633
- A.push(M);
4634
- const V = {
4635
- gridColumn: `${M.x + 1} / span ${M.w}`,
4636
- gridRow: `${M.y + 1} / span ${M.h}`,
4633
+ M.push(U);
4634
+ const ot = {
4635
+ gridColumn: `${U.x + 1} / span ${U.w}`,
4636
+ gridRow: `${U.y + 1} / span ${U.h}`,
4637
4637
  position: "relative",
4638
4638
  overflowY: "hidden",
4639
4639
  width: "100%",
@@ -4641,32 +4641,34 @@ async function mo(t) {
4641
4641
  border: o.hideFrameBorders ? "none" : "1px solid #e0e0e0",
4642
4642
  alignSelf: "stretch",
4643
4643
  justifySelf: "stretch"
4644
- }, H = document.createElement("div");
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);
4644
+ }, Y = document.createElement("div");
4645
+ Y.classList.add("metaframe-container"), Object.assign(Y.style, ot), P.classList.add("metaframe"), P.style.position = "absolute", P.style.top = "0", P.style.left = "0", P.style.width = "100%", P.style.height = "100%", P.style.border = "0", P.style.overflow = "hidden", Y.appendChild(P), _.appendChild(Y);
4646
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)`;
4647
+ const w = Math.max(...M.map((h) => h.x + h.w)), S = Math.max(...M.map((h) => h.y + h.h));
4648
+ _.style.gridTemplateColumns = `repeat(${Math.max(1, w)}, 1fr)`;
4649
+ const $ = u.props.rowHeight || 100, R = ((F = u.props.margin) == null ? void 0 : F[0]) || 10, k = ((g = u.props.containerPadding) == null ? void 0 : g[0]) || 0, L = S * $ + Math.max(0, S - 1) * R + 2 * k;
4650
+ _.style.minHeight = `${L}px`;
4649
4651
  const O = document.createElement("div");
4650
4652
  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)
4653
+ for (const h of Object.keys(r.getMetaframes()).filter((U) => f.has(U))) {
4654
+ const U = r.getMetaframes()[h];
4655
+ if (!U)
4654
4656
  continue;
4655
- const y = document.createElement("div");
4656
- y.setAttribute("data-metaframe-id", _), y.style.width = "100px", y.style.height = "100px";
4657
- let L;
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);
4657
+ const x = document.createElement("div");
4658
+ x.setAttribute("data-metaframe-id", h), x.style.width = "100px", x.style.height = "100px";
4659
+ let P;
4660
+ U.iframe ? P = await U.iframe : (P = document.createElement("iframe"), P.src = U.url, P.style.border = "none", P.style.width = "100%", P.style.height = "100%"), x.appendChild(P), O.appendChild(x);
4659
4661
  }
4660
- return b.appendChild(w), b.appendChild(O), i.appendChild(b), {
4662
+ return b.appendChild(_), b.appendChild(O), i.appendChild(b), {
4661
4663
  metapage: r,
4662
- setInputs: (_) => {
4663
- r.isDisposed() || r.setInputs(_);
4664
+ setInputs: (h) => {
4665
+ r.isDisposed() || r.setInputs(h);
4664
4666
  },
4665
- setOutputs: (_) => {
4666
- r.isDisposed() || r.setOutputs(_);
4667
+ setOutputs: (h) => {
4668
+ r.isDisposed() || r.setOutputs(h);
4667
4669
  },
4668
4670
  dispose: () => {
4669
- a.forEach((_) => _()), r.dispose(), b.parentNode && b.parentNode.removeChild(b);
4671
+ a.forEach((h) => h()), r.dispose(), b.parentNode && b.parentNode.removeChild(b);
4670
4672
  }
4671
4673
  };
4672
4674
  }
@@ -4676,12 +4678,12 @@ const go = (t, e) => {
4676
4678
  if (!s || !n)
4677
4679
  throw new Error("No valid layout found in metapage definition");
4678
4680
  const i = /* @__PURE__ */ new Set(), o = n.map((l, c) => {
4679
- var h;
4680
- const f = (h = t == null ? void 0 : t.metaframes) == null ? void 0 : h[l.i];
4681
+ var y;
4682
+ const f = (y = t == null ? void 0 : t.metaframes) == null ? void 0 : y[l.i];
4681
4683
  return f && ys(f.url) ? { index: c, y: l.y, id: l.i } : null;
4682
4684
  }).filter((l) => l !== null);
4683
4685
  if (o.length > 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;
4686
+ const l = o.reduce((f, y) => y.y < f.y ? y : f), c = ((u = n.find((f) => f.i === l.id)) == null ? void 0 : u.y) ?? 0;
4685
4687
  n.forEach((f) => {
4686
4688
  f.y >= c && i.add(f.i);
4687
4689
  });
@@ -4709,6 +4711,7 @@ const go = (t, e) => {
4709
4711
  return t;
4710
4712
  }, It = "mf";
4711
4713
  async function bo(t) {
4714
+ var d, b, _, M, w;
4712
4715
  const { url: e, onOutputs: s, onUrlChange: n, rootDiv: i, debug: o = !1 } = t;
4713
4716
  if (!e)
4714
4717
  throw new Error("url must be provided");
@@ -4733,38 +4736,40 @@ async function bo(t) {
4733
4736
  }
4734
4737
  };
4735
4738
  await qt();
4736
- const a = new tt();
4739
+ const a = new st();
4737
4740
  a.debug = o;
4738
4741
  try {
4739
4742
  await a.setDefinition(JSON.parse(JSON.stringify(r)));
4740
- } catch (h) {
4741
- throw a.dispose(), new Error(`Failed to set metapage definition: ${h}`);
4743
+ } catch (S) {
4744
+ throw a.dispose(), new Error(`Failed to set metapage definition: ${S}`);
4742
4745
  }
4743
4746
  const u = [];
4744
- if (s && u.push(a.addListenerReturnDisposer(I.Outputs, (h) => {
4745
- s(h[It] || {});
4747
+ if (s && u.push(a.addListenerReturnDisposer(I.Outputs, (S) => {
4748
+ s(S[It] || {});
4746
4749
  })), n) {
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));
4750
+ let S = e;
4751
+ u.push(a.addListenerReturnDisposer(I.DefinitionUpdate, ($) => {
4752
+ var k, L, O;
4753
+ const R = (O = (L = (k = $.definition) == null ? void 0 : k.metaframes) == null ? void 0 : L[It]) == null ? void 0 : O.url;
4754
+ R && R !== S && (S = R, n(R));
4752
4755
  }));
4753
4756
  }
4754
4757
  const l = a.getMetaframes()[It];
4755
4758
  if (!l)
4756
4759
  throw a.dispose(), new Error("Failed to create metaframe");
4757
4760
  const c = await l.iframe, f = document.createElement("div");
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), {
4761
+ f.style.width = "100%", f.style.height = "100%", f.style.margin = "0", f.style.padding = "0", f.style.overflow = "hidden", f.style.position = "relative";
4762
+ const y = (b = (d = r.meta) == null ? void 0 : d.layouts) == null ? void 0 : b["react-grid-layout"], p = (((_ = y == null ? void 0 : y.props) == null ? void 0 : _.rowHeight) || 100) * (((w = (M = y == null ? void 0 : y.layout) == null ? void 0 : M[0]) == null ? void 0 : w.h) || 1);
4763
+ return f.style.minHeight = `${p}px`, 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), {
4759
4764
  metapage: a,
4760
- setInputs: (h) => {
4761
- a.isDisposed() || a.setInputs({ [It]: h });
4765
+ setInputs: (S) => {
4766
+ a.isDisposed() || a.setInputs({ [It]: S });
4762
4767
  },
4763
- setOutputs: (h) => {
4764
- a.isDisposed() || a.setOutputs({ [It]: h });
4768
+ setOutputs: (S) => {
4769
+ a.isDisposed() || a.setOutputs({ [It]: S });
4765
4770
  },
4766
4771
  dispose: () => {
4767
- u.forEach((h) => h()), a.dispose(), f.parentNode && f.parentNode.removeChild(f);
4772
+ u.forEach((S) => S()), a.dispose(), f.parentNode && f.parentNode.removeChild(f);
4768
4773
  }
4769
4774
  };
4770
4775
  }
@@ -4773,18 +4778,18 @@ export {
4773
4778
  ro as INTERNAL_ERROR,
4774
4779
  io as INVALID_PARAMS,
4775
4780
  so as INVALID_REQUEST,
4776
- Y as JsonRpcMethodsFromChild,
4781
+ Z as JsonRpcMethodsFromChild,
4777
4782
  Ot as JsonRpcMethodsFromParent,
4778
4783
  Xr as METAFRAME_JSON_FILE,
4779
4784
  Yr as METAPAGE_KEY_DEFINITION,
4780
4785
  qr as METAPAGE_KEY_STATE,
4781
4786
  no as METHOD_NOT_FOUND,
4782
- ct as Metaframe,
4787
+ lt as Metaframe,
4783
4788
  W as MetaframeEvents,
4784
- ft as MetaframeLoadingState,
4789
+ ht as MetaframeLoadingState,
4785
4790
  _e as MetaframeVersionCurrent,
4786
4791
  ms as MetaframeVersionsAll,
4787
- tt as Metapage,
4792
+ st as Metapage,
4788
4793
  I as MetapageEvents,
4789
4794
  Gt as MetapageHashParams,
4790
4795
  zr as MetapageIFrameRpcClient,
@@ -4793,7 +4798,7 @@ export {
4793
4798
  gs as MetapageVersionsAll,
4794
4799
  eo as PARSE_ERROR,
4795
4800
  On as VERSION_METAFRAME,
4796
- ks as VERSION_METAPAGE,
4801
+ Ls as VERSION_METAPAGE,
4797
4802
  ti as convertMetaframeDefinitionToCurrentVersion,
4798
4803
  Qs as convertMetaframeDefinitionToVersion,
4799
4804
  He as convertMetaframeJsonToCurrentVersion,
@@ -4807,7 +4812,7 @@ export {
4807
4812
  ar as generateMetapageId,
4808
4813
  lo as generateNonce,
4809
4814
  yo as getLibraryVersionMatching,
4810
- ot as getMatchingMetaframeVersion,
4815
+ at as getMatchingMetaframeVersion,
4811
4816
  vt as getMatchingMetapageVersion,
4812
4817
  Br as getMetaframeDefinitionFromUrl,
4813
4818
  Fr as getMetapageDefinitionFromUrl,