@metapages/metapage 1.8.17 → 1.8.19

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
@@ -1,4 +1,4 @@
1
- const It = ["0.3", "0.4", "0.5", "0.6", "1", "2"], Ct = ["0.2", "0.3", "1", "2"], We = "2", Le = "2", Mi = "metaframe.json", Ii = "metapage/definition", Ci = "metapage/state", Jt = Ct[Ct.length - 1], En = It[It.length - 1], Mn = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, $t = (t) => {
1
+ const It = ["0.3", "0.4", "0.5", "0.6", "1", "2"], Ct = ["0.2", "0.3", "1", "2"], We = "2", Le = "2", Mi = "metaframe.json", Ii = "metapage/definition", Ci = "metapage/state", Vt = Ct[Ct.length - 1], En = It[It.length - 1], Mn = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, $t = (t) => {
2
2
  if (typeof t != "string")
3
3
  throw new TypeError("Invalid argument expected string");
4
4
  const e = t.match(Mn);
@@ -50,7 +50,7 @@ var Wt = { exports: {} };
50
50
  retryOn: []
51
51
  };
52
52
  return r = Object.assign(a, r), function(l, c) {
53
- var d = r.retries, g = r.retryDelay, v = r.retryOn;
53
+ var d = r.retries, _ = r.retryDelay, v = r.retryOn;
54
54
  if (c && c.retries !== void 0)
55
55
  if (s(c.retries))
56
56
  d = c.retries;
@@ -58,7 +58,7 @@ var Wt = { exports: {} };
58
58
  throw new i("retries must be a positive integer");
59
59
  if (c && c.retryDelay !== void 0)
60
60
  if (s(c.retryDelay) || typeof c.retryDelay == "function")
61
- g = c.retryDelay;
61
+ _ = c.retryDelay;
62
62
  else
63
63
  throw new i("retryDelay must be a positive integer or a function returning a positive integer");
64
64
  if (c && c.retryOn)
@@ -66,42 +66,42 @@ var Wt = { exports: {} };
66
66
  v = c.retryOn;
67
67
  else
68
68
  throw new i("retryOn property expects an array or function");
69
- return new Promise(function(y, R) {
69
+ return new Promise(function(m, S) {
70
70
  var w = function(b) {
71
71
  var A = typeof Request < "u" && l instanceof Request ? l.clone() : l;
72
72
  o(A, c).then(function(E) {
73
73
  if (Array.isArray(v) && v.indexOf(E.status) === -1)
74
- y(E);
74
+ m(E);
75
75
  else if (typeof v == "function")
76
76
  try {
77
- return Promise.resolve(v(b, null, E)).then(function(O) {
78
- O ? $(b, null, E) : y(E);
79
- }).catch(R);
80
- } catch (O) {
81
- R(O);
77
+ return Promise.resolve(v(b, null, E)).then(function(R) {
78
+ R ? $(b, null, E) : m(E);
79
+ }).catch(S);
80
+ } catch (R) {
81
+ S(R);
82
82
  }
83
83
  else
84
- b < d ? $(b, null, E) : y(E);
84
+ b < d ? $(b, null, E) : m(E);
85
85
  }).catch(function(E) {
86
86
  if (typeof v == "function")
87
87
  try {
88
- Promise.resolve(v(b, E, null)).then(function(O) {
89
- O ? $(b, E, null) : R(E);
90
- }).catch(function(O) {
91
- R(O);
88
+ Promise.resolve(v(b, E, null)).then(function(R) {
89
+ R ? $(b, E, null) : S(E);
90
+ }).catch(function(R) {
91
+ S(R);
92
92
  });
93
- } catch (O) {
94
- R(O);
93
+ } catch (R) {
94
+ S(R);
95
95
  }
96
96
  else
97
- b < d ? $(b, E, null) : R(E);
97
+ b < d ? $(b, E, null) : S(E);
98
98
  });
99
99
  };
100
100
  function $(b, A, E) {
101
- var O = typeof g == "function" ? g(b, A, E) : g;
101
+ var R = typeof _ == "function" ? _(b, A, E) : _;
102
102
  setTimeout(function() {
103
103
  w(++b);
104
- }, O);
104
+ }, R);
105
105
  }
106
106
  w(0);
107
107
  });
@@ -117,7 +117,7 @@ var Wt = { exports: {} };
117
117
  });
118
118
  })(Wt);
119
119
  var xn = Wt.exports;
120
- const yt = /* @__PURE__ */ mt(xn), G = {
120
+ const yt = /* @__PURE__ */ mt(xn), J = {
121
121
  Remove: "remove",
122
122
  Replace: "replace",
123
123
  Add: "add"
@@ -259,7 +259,7 @@ function qt(t, e) {
259
259
  } else
260
260
  throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
261
261
  }
262
- function X(t) {
262
+ function q(t) {
263
263
  t.copy || (t.copy = qt(t.original, t.options));
264
264
  }
265
265
  function Ae(t) {
@@ -353,7 +353,7 @@ function Qt(t, e, n) {
353
353
  var a;
354
354
  if (be(r)) {
355
355
  const u = P(r);
356
- X(u);
356
+ q(u);
357
357
  const l = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
358
358
  Te(s ? i : t, o, l);
359
359
  } else
@@ -404,12 +404,12 @@ function Hn(t, e, n, s, i) {
404
404
  if (r.get(l.toString()) && u[l] !== o[l]) {
405
405
  const c = e.concat([l]), d = _e(c, i);
406
406
  n.push({
407
- op: G.Replace,
407
+ op: J.Replace,
408
408
  path: d,
409
409
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
410
410
  value: Fe(u[l])
411
411
  }), s.push({
412
- op: G.Replace,
412
+ op: J.Replace,
413
413
  path: d,
414
414
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
415
415
  value: Fe(o[l])
@@ -418,7 +418,7 @@ function Hn(t, e, n, s, i) {
418
418
  for (let l = o.length; l < u.length; l += 1) {
419
419
  const c = e.concat([l]), d = _e(c, i);
420
420
  n.push({
421
- op: G.Add,
421
+ op: J.Add,
422
422
  path: d,
423
423
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
424
424
  value: Fe(u[l])
@@ -429,27 +429,27 @@ function Hn(t, e, n, s, i) {
429
429
  if (l) {
430
430
  const c = e.concat(["length"]), d = _e(c, i);
431
431
  s.push({
432
- op: G.Replace,
432
+ op: J.Replace,
433
433
  path: d,
434
434
  value: o.length
435
435
  });
436
436
  } else
437
437
  for (let c = u.length; o.length < c; c -= 1) {
438
- const d = e.concat([c - 1]), g = _e(d, i);
438
+ const d = e.concat([c - 1]), _ = _e(d, i);
439
439
  s.push({
440
- op: G.Remove,
441
- path: g
440
+ op: J.Remove,
441
+ path: _
442
442
  });
443
443
  }
444
444
  }
445
445
  }
446
446
  function Nn({ original: t, copy: e, assignedMap: n }, s, i, o, r) {
447
447
  n.forEach((a, u) => {
448
- const l = pe(t, u), c = Fe(pe(e, u)), d = a ? Ie(t, u) ? G.Replace : G.Add : G.Remove;
449
- if (fe(l, c) && d === G.Replace)
448
+ const l = pe(t, u), c = Fe(pe(e, u)), d = a ? Ie(t, u) ? J.Replace : J.Add : J.Remove;
449
+ if (fe(l, c) && d === J.Replace)
450
450
  return;
451
- const g = s.concat(u), v = _e(g, r);
452
- i.push(d === G.Remove ? { op: d, path: v } : { op: d, path: v, value: c }), o.push(d === G.Add ? { op: G.Remove, path: v } : d === G.Remove ? { op: G.Add, path: v, value: l } : { op: G.Replace, path: v, value: l });
451
+ const _ = s.concat(u), v = _e(_, r);
452
+ i.push(d === J.Remove ? { op: d, path: v } : { op: d, path: v, value: c }), o.push(d === J.Add ? { op: J.Remove, path: v } : d === J.Remove ? { op: J.Add, path: v, value: l } : { op: J.Replace, path: v, value: l });
453
453
  });
454
454
  }
455
455
  function jn({ original: t, copy: e }, n, s, i, o) {
@@ -458,11 +458,11 @@ function jn({ original: t, copy: e }, n, s, i, o) {
458
458
  if (!e.has(a)) {
459
459
  const u = n.concat([r]), l = _e(u, o);
460
460
  s.push({
461
- op: G.Remove,
461
+ op: J.Remove,
462
462
  path: l,
463
463
  value: a
464
464
  }), i.unshift({
465
- op: G.Add,
465
+ op: J.Add,
466
466
  path: l,
467
467
  value: a
468
468
  });
@@ -472,11 +472,11 @@ function jn({ original: t, copy: e }, n, s, i, o) {
472
472
  if (!t.has(a)) {
473
473
  const u = n.concat([r]), l = _e(u, o);
474
474
  s.push({
475
- op: G.Add,
475
+ op: J.Add,
476
476
  path: l,
477
477
  value: a
478
478
  }), i.unshift({
479
- op: G.Remove,
479
+ op: J.Remove,
480
480
  path: l,
481
481
  value: a
482
482
  });
@@ -509,18 +509,18 @@ const ze = (t, e, n = !1) => {
509
509
  },
510
510
  set(t, e) {
511
511
  const n = P(this), s = Y(n);
512
- return (!s.has(t) || !fe(s.get(t), e)) && (X(n), ue(n), n.assignedMap.set(t, !0), n.copy.set(t, e), wt(n, t, e, $e)), this;
512
+ return (!s.has(t) || !fe(s.get(t), e)) && (q(n), ue(n), n.assignedMap.set(t, !0), n.copy.set(t, e), wt(n, t, e, $e)), this;
513
513
  },
514
514
  delete(t) {
515
515
  if (!this.has(t))
516
516
  return !1;
517
517
  const e = P(this);
518
- return X(e), ue(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
518
+ return q(e), ue(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
519
519
  },
520
520
  clear() {
521
521
  const t = P(this);
522
522
  if (this.size) {
523
- X(t), ue(t), t.assignedMap = /* @__PURE__ */ new Map();
523
+ q(t), ue(t), t.assignedMap = /* @__PURE__ */ new Map();
524
524
  for (const [e] of t.original)
525
525
  t.assignedMap.set(e, !1);
526
526
  t.copy.clear();
@@ -544,7 +544,7 @@ const ze = (t, e, n = !1) => {
544
544
  finalities: s.finalities,
545
545
  options: s.options
546
546
  });
547
- return X(s), s.copy.set(t, r), r;
547
+ return q(s), s.copy.set(t, r), r;
548
548
  },
549
549
  keys() {
550
550
  return Y(P(this)).keys();
@@ -612,19 +612,19 @@ const ze = (t, e, n = !1) => {
612
612
  const e = P(this);
613
613
  if (e.setMap.has(t))
614
614
  return !0;
615
- X(e);
615
+ q(e);
616
616
  const n = P(t);
617
617
  return !!(n && e.setMap.has(n.original));
618
618
  },
619
619
  add(t) {
620
620
  const e = P(this);
621
- return this.has(t) || (X(e), ue(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), wt(e, t, t, $e)), this;
621
+ return this.has(t) || (q(e), ue(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), wt(e, t, t, $e)), this;
622
622
  },
623
623
  delete(t) {
624
624
  if (!this.has(t))
625
625
  return !1;
626
626
  const e = P(this);
627
- X(e), ue(e);
627
+ q(e), ue(e);
628
628
  const n = P(t);
629
629
  return n && e.setMap.has(n.original) ? (e.assignedMap.set(n.original, !1), e.setMap.delete(n.original)) : (!n && e.setMap.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.setMap.delete(t));
630
630
  },
@@ -632,14 +632,14 @@ const ze = (t, e, n = !1) => {
632
632
  if (!this.size)
633
633
  return;
634
634
  const t = P(this);
635
- X(t), ue(t);
635
+ q(t), ue(t);
636
636
  for (const e of t.original)
637
637
  t.assignedMap.set(e, !1);
638
638
  t.setMap.clear();
639
639
  },
640
640
  values() {
641
641
  const t = P(this);
642
- X(t);
642
+ q(t);
643
643
  const e = t.setMap.keys();
644
644
  return {
645
645
  [Symbol.iterator]: () => this.values(),
@@ -648,7 +648,7 @@ const ze = (t, e, n = !1) => {
648
648
  },
649
649
  entries() {
650
650
  const t = P(this);
651
- X(t);
651
+ q(t);
652
652
  const e = t.setMap.keys();
653
653
  return {
654
654
  [Symbol.iterator]: () => this.entries(),
@@ -709,7 +709,7 @@ const ze = (t, e, n = !1) => {
709
709
  if (t.options.strict && ze(u, t.options), t.finalized || !se(u, t.options))
710
710
  return u;
711
711
  if (u === et(t.original, e)) {
712
- if (X(t), t.copy[e] = vt({
712
+ if (q(t), t.copy[e] = vt({
713
713
  original: t.original[e],
714
714
  parentDraft: t,
715
715
  key: t.type === 1 ? Number(e) : e,
@@ -717,7 +717,7 @@ const ze = (t, e, n = !1) => {
717
717
  options: t.options
718
718
  }), typeof r == "function") {
719
719
  const l = P(t.copy[e]);
720
- return X(l), ue(l), l.copy;
720
+ return q(l), ue(l), l.copy;
721
721
  }
722
722
  return t.copy[e];
723
723
  }
@@ -734,7 +734,7 @@ const ze = (t, e, n = !1) => {
734
734
  if (o != null && o.set)
735
735
  return o.set.call(t.proxy, n), !0;
736
736
  const r = et(Y(t), e), a = P(r);
737
- return a && fe(a.original, n) ? (t.copy[e] = n, t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (fe(n, r) && (n !== void 0 || Ie(t.original, e)) || (X(t), ue(t), Ie(t.original, e) && fe(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, wt(t, e, n, $e)), !0);
737
+ return a && fe(a.original, n) ? (t.copy[e] = n, t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (fe(n, r) && (n !== void 0 || Ie(t.original, e)) || (q(t), ue(t), Ie(t.original, e) && fe(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, wt(t, e, n, $e)), !0);
738
738
  },
739
739
  has(t, e) {
740
740
  return e in Y(t);
@@ -762,7 +762,7 @@ const ze = (t, e, n = !1) => {
762
762
  },
763
763
  deleteProperty(t, e) {
764
764
  var n;
765
- return t.type === 1 ? Zt.set.call(this, t, e, void 0, t.proxy) : (et(t.original, e) !== void 0 || e in t.original ? (X(t), ue(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
765
+ return t.type === 1 ? Zt.set.call(this, t, e, void 0, t.proxy) : (et(t.original, e) !== void 0 || e in t.original ? (q(t), ue(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
766
766
  }
767
767
  };
768
768
  function vt(t) {
@@ -782,23 +782,23 @@ function vt(t) {
782
782
  const { proxy: u, revoke: l } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, Zt);
783
783
  if (i.revoke.push(l), Yt.add(u), a.proxy = u, n) {
784
784
  const c = n;
785
- c.finalities.draft.push((d, g) => {
786
- var v, y;
787
- const R = P(u);
785
+ c.finalities.draft.push((d, _) => {
786
+ var v, m;
787
+ const S = P(u);
788
788
  let w = c.type === 3 ? c.setMap : c.copy;
789
789
  const $ = pe(w, s), b = P($);
790
790
  if (b) {
791
791
  let A = b.original;
792
- b.operated && (A = _t($)), at(b), ut(b, $e, d, g), c.options.enableAutoFreeze && (c.options.updatedValues = (v = c.options.updatedValues) !== null && v !== void 0 ? v : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(A, b.original)), Te(w, s, A);
792
+ b.operated && (A = _t($)), at(b), ut(b, $e, d, _), c.options.enableAutoFreeze && (c.options.updatedValues = (v = c.options.updatedValues) !== null && v !== void 0 ? v : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(A, b.original)), Te(w, s, A);
793
793
  }
794
- (y = R.callbacks) === null || y === void 0 || y.forEach((A) => {
795
- A(d, g);
794
+ (m = S.callbacks) === null || m === void 0 || m.forEach((A) => {
795
+ A(d, _);
796
796
  });
797
797
  });
798
798
  } else {
799
799
  const c = P(u);
800
- c.finalities.draft.push((d, g) => {
801
- at(c), ut(c, $e, d, g);
800
+ c.finalities.draft.push((d, _) => {
801
+ at(c), ut(c, $e, d, _);
802
802
  });
803
803
  }
804
804
  return u;
@@ -813,11 +813,11 @@ function zn(t, e, n, s, i) {
813
813
  const l = u ? e[0] : r ? r.operated ? r.copy : r.original : t;
814
814
  return r && ot(r), i && Re(l, l, r == null ? void 0 : r.options.updatedValues), [
815
815
  l,
816
- n && u ? [{ op: G.Replace, path: [], value: e[0] }] : n,
817
- s && u ? [{ op: G.Replace, path: [], value: a }] : s
816
+ n && u ? [{ op: J.Replace, path: [], value: e[0] }] : n,
817
+ s && u ? [{ op: J.Replace, path: [], value: a }] : s
818
818
  ];
819
819
  }
820
- function Gn(t, e) {
820
+ function Jn(t, e) {
821
821
  var n;
822
822
  const s = {
823
823
  draft: [],
@@ -888,37 +888,37 @@ function Ht(t) {
888
888
  throw new Error(`current() is only used for Draft, parameter: ${t}`);
889
889
  return en(t);
890
890
  }
891
- const Vn = (t) => {
891
+ const Gn = (t) => {
892
892
  if (t !== void 0 && Object.prototype.toString.call(t) !== "[object Object]")
893
893
  throw new Error(`Invalid options: ${String(t)}, 'options' should be an object.`);
894
894
  return function e(n, s, i) {
895
895
  var o, r, a;
896
896
  if (typeof n == "function" && typeof s != "function")
897
- return function(O, ...H) {
898
- return e(O, (S) => n.call(this, S, ...H), s);
897
+ return function(R, ...H) {
898
+ return e(R, (O) => n.call(this, O, ...H), s);
899
899
  };
900
900
  const u = n, l = s;
901
901
  let c = i;
902
902
  if (typeof s != "function" && (c = s), c !== void 0 && Object.prototype.toString.call(c) !== "[object Object]")
903
903
  throw new Error(`Invalid options: ${c}, 'options' should be an object.`);
904
904
  c = Object.assign(Object.assign({}, t), c);
905
- const d = be(u) ? Ht(u) : u, g = Array.isArray(c.mark) ? (O, H) => {
906
- for (const S of c.mark) {
907
- if (typeof S != "function")
908
- throw new Error(`Invalid mark: ${S}, 'mark' should be a function.`);
909
- const L = S(O, H);
905
+ const d = be(u) ? Ht(u) : u, _ = Array.isArray(c.mark) ? (R, H) => {
906
+ for (const O of c.mark) {
907
+ if (typeof O != "function")
908
+ throw new Error(`Invalid mark: ${O}, 'mark' should be a function.`);
909
+ const L = O(R, H);
910
910
  if (L)
911
911
  return L;
912
912
  }
913
- } : c.mark, v = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, y = (r = c.strict) !== null && r !== void 0 ? r : !1, w = {
913
+ } : c.mark, v = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, m = (r = c.strict) !== null && r !== void 0 ? r : !1, w = {
914
914
  enableAutoFreeze: (a = c.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
915
- mark: g,
916
- strict: y,
915
+ mark: _,
916
+ strict: m,
917
917
  enablePatches: v
918
918
  };
919
919
  if (!se(d, w) && typeof d == "object" && d !== null)
920
920
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
921
- const [$, b] = Gn(d, w);
921
+ const [$, b] = Jn(d, w);
922
922
  if (typeof s != "function") {
923
923
  if (!se(d, w))
924
924
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
@@ -927,43 +927,43 @@ const Vn = (t) => {
927
927
  let A;
928
928
  try {
929
929
  A = l($);
930
- } catch (O) {
931
- throw ot(P($)), O;
930
+ } catch (R) {
931
+ throw ot(P($)), R;
932
932
  }
933
- const E = (O) => {
933
+ const E = (R) => {
934
934
  const H = P($);
935
- if (!be(O)) {
936
- if (O !== void 0 && !fe(O, $) && (H != null && H.operated))
935
+ if (!be(R)) {
936
+ if (R !== void 0 && !fe(R, $) && (H != null && H.operated))
937
937
  throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
938
- const L = O == null ? void 0 : O[Ln];
938
+ const L = R == null ? void 0 : R[Ln];
939
939
  if (L) {
940
940
  const U = L[0];
941
- return w.strict && typeof O == "object" && O !== null && ft({
941
+ return w.strict && typeof R == "object" && R !== null && ft({
942
942
  rootDraft: H,
943
- value: O,
943
+ value: R,
944
944
  useRawReturn: !0
945
945
  }), b([U]);
946
946
  }
947
- if (O !== void 0)
948
- return typeof O == "object" && O !== null && ft({ rootDraft: H, value: O }), b([O]);
947
+ if (R !== void 0)
948
+ return typeof R == "object" && R !== null && ft({ rootDraft: H, value: R }), b([R]);
949
949
  }
950
- if (O === $ || O === void 0)
950
+ if (R === $ || R === void 0)
951
951
  return b([]);
952
- const S = P(O);
953
- if (w === S.options) {
954
- if (S.operated)
952
+ const O = P(R);
953
+ if (w === O.options) {
954
+ if (O.operated)
955
955
  throw new Error("Cannot return a modified child draft.");
956
- return b([Ht(O)]);
956
+ return b([Ht(R)]);
957
957
  }
958
- return b([O]);
958
+ return b([R]);
959
959
  };
960
- return A instanceof Promise ? A.then(E, (O) => {
961
- throw ot(P($)), O;
960
+ return A instanceof Promise ? A.then(E, (R) => {
961
+ throw ot(P($)), R;
962
962
  }) : E(A);
963
963
  };
964
- }, C = Vn();
964
+ }, C = Gn();
965
965
  Object.prototype.constructor.toString();
966
- const Jn = yt(fetch), tn = async (t, e) => {
966
+ const Vn = yt(fetch), tn = async (t, e) => {
967
967
  if (!t)
968
968
  throw "Metapage definition null";
969
969
  if (t.version || (t = C(t, (s) => {
@@ -972,7 +972,7 @@ const Jn = yt(fetch), tn = async (t, e) => {
972
972
  throw 'Missing "version" argument';
973
973
  if (j(e, Le) > 0)
974
974
  try {
975
- return await (await Jn(`https://module.metapage.io/conversion/metapage/v${e}`, {
975
+ return await (await Vn(`https://module.metapage.io/conversion/metapage/v${e}`, {
976
976
  redirect: "follow",
977
977
  retries: 3,
978
978
  retryDelay: 1e3,
@@ -1330,10 +1330,10 @@ var x;
1330
1330
  (function(t) {
1331
1331
  t.Inputs = "inputs", t.Outputs = "outputs", t.State = "state", t.Definition = "definition", t.Error = "error", t.Warning = "warning", t.UrlHashUpdate = "urlhashupdate", t.Message = "Message";
1332
1332
  })(x || (x = {}));
1333
- var q;
1333
+ var X;
1334
1334
  (function(t) {
1335
1335
  t.InputsUpdate = "InputsUpdate", t.OutputsUpdate = "OutputsUpdate", t.SetupIframeClientRequest = "SetupIframeClientRequest", t.SetupIframeServerResponseAck = "SetupIframeServerResponseAck", t.HashParamsUpdate = "HashParamsUpdate";
1336
- })(q || (q = {}));
1336
+ })(X || (X = {}));
1337
1337
  var me;
1338
1338
  (function(t) {
1339
1339
  t.InputsUpdate = "InputsUpdate", t.MessageAck = "MessageAck", t.SetupIframeServerResponse = "SetupIframeServerResponse";
@@ -1360,11 +1360,11 @@ var rn = { exports: {} };
1360
1360
  function i(u, l, c) {
1361
1361
  this.fn = u, this.context = l, this.once = c || !1;
1362
1362
  }
1363
- function o(u, l, c, d, g) {
1363
+ function o(u, l, c, d, _) {
1364
1364
  if (typeof c != "function")
1365
1365
  throw new TypeError("The listener must be a function");
1366
- var v = new i(c, d || u, g), y = n ? n + l : l;
1367
- return u._events[y] ? u._events[y].fn ? u._events[y] = [u._events[y], v] : u._events[y].push(v) : (u._events[y] = v, u._eventsCount++), u;
1366
+ var v = new i(c, d || u, _), m = n ? n + l : l;
1367
+ return u._events[m] ? u._events[m].fn ? u._events[m] = [u._events[m], v] : u._events[m].push(v) : (u._events[m] = v, u._eventsCount++), u;
1368
1368
  }
1369
1369
  function r(u, l) {
1370
1370
  --u._eventsCount === 0 ? u._events = new s() : delete u._events[l];
@@ -1385,17 +1385,17 @@ var rn = { exports: {} };
1385
1385
  return [];
1386
1386
  if (d.fn)
1387
1387
  return [d.fn];
1388
- for (var g = 0, v = d.length, y = new Array(v); g < v; g++)
1389
- y[g] = d[g].fn;
1390
- return y;
1388
+ for (var _ = 0, v = d.length, m = new Array(v); _ < v; _++)
1389
+ m[_] = d[_].fn;
1390
+ return m;
1391
1391
  }, a.prototype.listenerCount = function(l) {
1392
1392
  var c = n ? n + l : l, d = this._events[c];
1393
1393
  return d ? d.fn ? 1 : d.length : 0;
1394
- }, a.prototype.emit = function(l, c, d, g, v, y) {
1395
- var R = n ? n + l : l;
1396
- if (!this._events[R])
1394
+ }, a.prototype.emit = function(l, c, d, _, v, m) {
1395
+ var S = n ? n + l : l;
1396
+ if (!this._events[S])
1397
1397
  return !1;
1398
- var w = this._events[R], $ = arguments.length, b, A;
1398
+ var w = this._events[S], $ = arguments.length, b, A;
1399
1399
  if (w.fn) {
1400
1400
  switch (w.once && this.removeListener(l, w.fn, void 0, !0), $) {
1401
1401
  case 1:
@@ -1405,17 +1405,17 @@ var rn = { exports: {} };
1405
1405
  case 3:
1406
1406
  return w.fn.call(w.context, c, d), !0;
1407
1407
  case 4:
1408
- return w.fn.call(w.context, c, d, g), !0;
1408
+ return w.fn.call(w.context, c, d, _), !0;
1409
1409
  case 5:
1410
- return w.fn.call(w.context, c, d, g, v), !0;
1410
+ return w.fn.call(w.context, c, d, _, v), !0;
1411
1411
  case 6:
1412
- return w.fn.call(w.context, c, d, g, v, y), !0;
1412
+ return w.fn.call(w.context, c, d, _, v, m), !0;
1413
1413
  }
1414
1414
  for (A = 1, b = new Array($ - 1); A < $; A++)
1415
1415
  b[A - 1] = arguments[A];
1416
1416
  w.fn.apply(w.context, b);
1417
1417
  } else {
1418
- var E = w.length, O;
1418
+ var E = w.length, R;
1419
1419
  for (A = 0; A < E; A++)
1420
1420
  switch (w[A].once && this.removeListener(l, w[A].fn, void 0, !0), $) {
1421
1421
  case 1:
@@ -1428,12 +1428,12 @@ var rn = { exports: {} };
1428
1428
  w[A].fn.call(w[A].context, c, d);
1429
1429
  break;
1430
1430
  case 4:
1431
- w[A].fn.call(w[A].context, c, d, g);
1431
+ w[A].fn.call(w[A].context, c, d, _);
1432
1432
  break;
1433
1433
  default:
1434
1434
  if (!b)
1435
- for (O = 1, b = new Array($ - 1); O < $; O++)
1436
- b[O - 1] = arguments[O];
1435
+ for (R = 1, b = new Array($ - 1); R < $; R++)
1436
+ b[R - 1] = arguments[R];
1437
1437
  w[A].fn.apply(w[A].context, b);
1438
1438
  }
1439
1439
  }
@@ -1442,18 +1442,18 @@ var rn = { exports: {} };
1442
1442
  return o(this, l, c, d, !1);
1443
1443
  }, a.prototype.once = function(l, c, d) {
1444
1444
  return o(this, l, c, d, !0);
1445
- }, a.prototype.removeListener = function(l, c, d, g) {
1445
+ }, a.prototype.removeListener = function(l, c, d, _) {
1446
1446
  var v = n ? n + l : l;
1447
1447
  if (!this._events[v])
1448
1448
  return this;
1449
1449
  if (!c)
1450
1450
  return r(this, v), this;
1451
- var y = this._events[v];
1452
- if (y.fn)
1453
- y.fn === c && (!g || y.once) && (!d || y.context === d) && r(this, v);
1451
+ var m = this._events[v];
1452
+ if (m.fn)
1453
+ m.fn === c && (!_ || m.once) && (!d || m.context === d) && r(this, v);
1454
1454
  else {
1455
- for (var R = 0, w = [], $ = y.length; R < $; R++)
1456
- (y[R].fn !== c || g && !y[R].once || d && y[R].context !== d) && w.push(y[R]);
1455
+ for (var S = 0, w = [], $ = m.length; S < $; S++)
1456
+ (m[S].fn !== c || _ && !m[S].once || d && m[S].context !== d) && w.push(m[S]);
1457
1457
  w.length ? this._events[v] = w.length === 1 ? w[0] : w : r(this, v);
1458
1458
  }
1459
1459
  return this;
@@ -1497,8 +1497,8 @@ var ys = function(t, e) {
1497
1497
  }
1498
1498
  var l = i.push(r) - 1, c = Object.keys(r).sort(s && s(r));
1499
1499
  for (u = "", a = 0; a < c.length; a++) {
1500
- var d = c[a], g = o(r[d]);
1501
- g && (u && (u += ","), u += JSON.stringify(d) + ":" + g);
1500
+ var d = c[a], _ = o(r[d]);
1501
+ _ && (u && (u += ","), u += JSON.stringify(d) + ":" + _);
1502
1502
  }
1503
1503
  return i.splice(l, 1), "{" + u + "}";
1504
1504
  }
@@ -1616,8 +1616,8 @@ var ks = function(t, e) {
1616
1616
  }
1617
1617
  var l = i.push(r) - 1, c = Object.keys(r).sort(s && s(r));
1618
1618
  for (u = "", a = 0; a < c.length; a++) {
1619
- var d = c[a], g = o(r[d]);
1620
- g && (u && (u += ","), u += JSON.stringify(d) + ":" + g);
1619
+ var d = c[a], _ = o(r[d]);
1620
+ _ && (u && (u += ","), u += JSON.stringify(d) + ":" + _);
1621
1621
  }
1622
1622
  return i.splice(l, 1), "{" + u + "}";
1623
1623
  }
@@ -1649,7 +1649,7 @@ class Ns extends Rt.EventEmitter {
1649
1649
  return this._definition;
1650
1650
  }
1651
1651
  }
1652
- const Ge = (t, e) => e ? C(t, (n) => {
1652
+ const Je = (t, e) => e ? C(t, (n) => {
1653
1653
  Object.keys(e).forEach((s) => {
1654
1654
  e[s] === void 0 ? delete n[s] : n[s] = e[s];
1655
1655
  });
@@ -1717,7 +1717,7 @@ class ie extends Rt.EventEmitter {
1717
1717
  }
1718
1718
  const n = this;
1719
1719
  Xe().then(() => {
1720
- this.log("pageLoaded"), window.addEventListener("message", this.onMessage), n.sendRpc(q.SetupIframeClientRequest, {
1720
+ this.log("pageLoaded"), window.addEventListener("message", this.onMessage), n.sendRpc(X.SetupIframeClientRequest, {
1721
1721
  version: ie.version
1722
1722
  }), n._state = ae.SentSetupIframeClientRequest;
1723
1723
  }), e && e.disableHashChangeEvent || window.addEventListener("hashchange", this._onHashUrlChange);
@@ -1725,9 +1725,9 @@ class ie extends Rt.EventEmitter {
1725
1725
  _resolveSetupIframeServerResponse(e) {
1726
1726
  if (this._state === ae.WaitingForPageLoad)
1727
1727
  throw "Got message but page has not finished loading, we should never get in this state";
1728
- (async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = e.version, this.color = hn(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 Ce(e.state.inputs) : this._inputPipeValues = e.state.inputs), this._state = ae.Ready, this.sendRpc(q.SetupIframeServerResponseAck, {
1728
+ (async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = e.version, this.color = hn(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 Ce(e.state.inputs) : this._inputPipeValues = e.state.inputs), this._state = ae.Ready, this.sendRpc(X.SetupIframeServerResponseAck, {
1729
1729
  version: ie.version
1730
- }), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(z.Inputs, this._inputPipeValues), this.listenerCount(z.Input) > 0 && Object.keys(this._inputPipeValues).forEach((n) => this.emit(z.Input, n, this._inputPipeValues[n]))), this.emit(z.Connected), this.sendRpc(q.OutputsUpdate, this._outputPipeValues)))();
1730
+ }), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(z.Inputs, this._inputPipeValues), this.listenerCount(z.Input) > 0 && Object.keys(this._inputPipeValues).forEach((n) => this.emit(z.Input, n, this._inputPipeValues[n]))), this.emit(z.Connected), this.sendRpc(X.OutputsUpdate, this._outputPipeValues)))();
1731
1731
  }
1732
1732
  isConnected() {
1733
1733
  return this._state === ae.Ready;
@@ -1783,12 +1783,12 @@ class ie extends Rt.EventEmitter {
1783
1783
  s[e] = n, this.setInputs(s);
1784
1784
  }
1785
1785
  async setInputs(e) {
1786
- this.isInputOutputBlobSerialization && (e = await Ce(e)), this.sendRpc(q.InputsUpdate, e);
1786
+ this.isInputOutputBlobSerialization && (e = await Ce(e)), this.sendRpc(X.InputsUpdate, e);
1787
1787
  }
1788
1788
  async setInternalInputsAndNotify(e) {
1789
1789
  this.isInputOutputBlobSerialization && (e = await Ce(e));
1790
1790
  const n = e;
1791
- if (this._inputPipeValues = Ge(this._inputPipeValues, e), this._inputPipeValues !== n) {
1791
+ if (this._inputPipeValues = Je(this._inputPipeValues, e), this._inputPipeValues !== n) {
1792
1792
  Object.keys(e).forEach((s) => {
1793
1793
  try {
1794
1794
  this.emit(z.Input, s, e[s]);
@@ -1817,7 +1817,7 @@ class ie extends Rt.EventEmitter {
1817
1817
  async setOutputs(e) {
1818
1818
  this.isInputOutputBlobSerialization && (e = await Ke(e));
1819
1819
  const n = e;
1820
- this._outputPipeValues = Ge(this._outputPipeValues, e), this._outputPipeValues !== n && this._state === ae.Ready && this.sendRpc(q.OutputsUpdate, e);
1820
+ this._outputPipeValues = Je(this._outputPipeValues, e), this._outputPipeValues !== n && this._state === ae.Ready && this.sendRpc(X.OutputsUpdate, e);
1821
1821
  }
1822
1822
  disableNotifyOnHashUrlChange() {
1823
1823
  window.removeEventListener("hashchange", this._onHashUrlChange);
@@ -1827,7 +1827,7 @@ class ie extends Rt.EventEmitter {
1827
1827
  hash: window.location.hash,
1828
1828
  metaframe: this.id
1829
1829
  };
1830
- this.sendRpc(q.HashParamsUpdate, n);
1830
+ this.sendRpc(X.HashParamsUpdate, n);
1831
1831
  }
1832
1832
  sendRpc(e, n) {
1833
1833
  if (this._isIframe) {
@@ -1921,17 +1921,17 @@ ie.MESSAGE = z.Message;
1921
1921
  ie.deserializeInputs = Ce;
1922
1922
  ie.serializeInputs = Ke;
1923
1923
  var qe = {};
1924
- const oe = "\\\\/", jt = `[^${oe}]`, le = "\\.", Fs = "\\+", zs = "\\?", Qe = "\\/", Gs = "(?=.)", mn = "[^/]", Et = `(?:${Qe}|$)`, yn = `(?:^|${Qe})`, Mt = `${le}{1,2}${Et}`, Vs = `(?!${le})`, Js = `(?!${yn}${Mt})`, Ws = `(?!${le}{0,1}${Et})`, Ks = `(?!${Mt})`, Xs = `[^.${Qe}]`, qs = `${mn}*?`, Qs = "/", gn = {
1924
+ const oe = "\\\\/", jt = `[^${oe}]`, le = "\\.", Fs = "\\+", zs = "\\?", Qe = "\\/", Js = "(?=.)", mn = "[^/]", Et = `(?:${Qe}|$)`, yn = `(?:^|${Qe})`, Mt = `${le}{1,2}${Et}`, Gs = `(?!${le})`, Vs = `(?!${yn}${Mt})`, Ws = `(?!${le}{0,1}${Et})`, Ks = `(?!${Mt})`, Xs = `[^.${Qe}]`, qs = `${mn}*?`, Qs = "/", gn = {
1925
1925
  DOT_LITERAL: le,
1926
1926
  PLUS_LITERAL: Fs,
1927
1927
  QMARK_LITERAL: zs,
1928
1928
  SLASH_LITERAL: Qe,
1929
- ONE_CHAR: Gs,
1929
+ ONE_CHAR: Js,
1930
1930
  QMARK: mn,
1931
1931
  END_ANCHOR: Et,
1932
1932
  DOTS_SLASH: Mt,
1933
- NO_DOT: Vs,
1934
- NO_DOTS: Js,
1933
+ NO_DOT: Gs,
1934
+ NO_DOTS: Vs,
1935
1935
  NO_DOT_SLASH: Ws,
1936
1936
  NO_DOTS_SLASH: Ks,
1937
1937
  QMARK_NO_DOT: Xs,
@@ -2145,41 +2145,41 @@ const Ut = qe, {
2145
2145
  /* ) */
2146
2146
  CHAR_RIGHT_SQUARE_BRACKET: ri
2147
2147
  /* ] */
2148
- } = Ye, Gt = (t) => t === _n || t === Me, Vt = (t) => {
2148
+ } = Ye, Jt = (t) => t === _n || t === Me, Gt = (t) => {
2149
2149
  t.isPrefix !== !0 && (t.depth = t.isGlobstar ? 1 / 0 : 1);
2150
2150
  }, oi = (t, e) => {
2151
2151
  const n = e || {}, s = t.length - 1, i = n.parts === !0 || n.scanToEnd === !0, o = [], r = [], a = [];
2152
- let u = t, l = -1, c = 0, d = 0, g = !1, v = !1, y = !1, R = !1, w = !1, $ = !1, b = !1, A = !1, E = !1, O = 0, H, S, L = { value: "", depth: 0, isGlob: !1 };
2153
- const U = () => l >= s, f = () => u.charCodeAt(l + 1), M = () => (H = S, u.charCodeAt(++l));
2152
+ let u = t, l = -1, c = 0, d = 0, _ = !1, v = !1, m = !1, S = !1, w = !1, $ = !1, b = !1, A = !1, E = !1, R = 0, H, O, L = { value: "", depth: 0, isGlob: !1 };
2153
+ const U = () => l >= s, f = () => u.charCodeAt(l + 1), M = () => (H = O, u.charCodeAt(++l));
2154
2154
  for (; l < s; ) {
2155
- S = M();
2155
+ O = M();
2156
2156
  let W;
2157
- if (S === Me) {
2158
- b = L.backslashes = !0, S = M(), S === it && ($ = !0);
2157
+ if (O === Me) {
2158
+ b = L.backslashes = !0, O = M(), O === it && ($ = !0);
2159
2159
  continue;
2160
2160
  }
2161
- if ($ === !0 || S === it) {
2162
- for (O++; U() !== !0 && (S = M()); ) {
2163
- if (S === Me) {
2161
+ if ($ === !0 || O === it) {
2162
+ for (R++; U() !== !0 && (O = M()); ) {
2163
+ if (O === Me) {
2164
2164
  b = L.backslashes = !0, M();
2165
2165
  continue;
2166
2166
  }
2167
- if (S === it) {
2168
- O++;
2167
+ if (O === it) {
2168
+ R++;
2169
2169
  continue;
2170
2170
  }
2171
- if ($ !== !0 && S === st && (S = M()) === st) {
2172
- if (g = L.isBrace = !0, y = L.isGlob = !0, E = !0, i === !0)
2171
+ if ($ !== !0 && O === st && (O = M()) === st) {
2172
+ if (_ = L.isBrace = !0, m = L.isGlob = !0, E = !0, i === !0)
2173
2173
  continue;
2174
2174
  break;
2175
2175
  }
2176
- if ($ !== !0 && S === ti) {
2177
- if (g = L.isBrace = !0, y = L.isGlob = !0, E = !0, i === !0)
2176
+ if ($ !== !0 && O === ti) {
2177
+ if (_ = L.isBrace = !0, m = L.isGlob = !0, E = !0, i === !0)
2178
2178
  continue;
2179
2179
  break;
2180
2180
  }
2181
- if (S === ii && (O--, O === 0)) {
2182
- $ = !1, g = L.isBrace = !0, E = !0;
2181
+ if (O === ii && (R--, R === 0)) {
2182
+ $ = !1, _ = L.isBrace = !0, E = !0;
2183
2183
  break;
2184
2184
  }
2185
2185
  }
@@ -2187,7 +2187,7 @@ const Ut = qe, {
2187
2187
  continue;
2188
2188
  break;
2189
2189
  }
2190
- if (S === _n) {
2190
+ if (O === _n) {
2191
2191
  if (o.push(l), r.push(L), L = { value: "", depth: 0, isGlob: !1 }, E === !0)
2192
2192
  continue;
2193
2193
  if (H === st && l === c + 1) {
@@ -2197,15 +2197,15 @@ const Ut = qe, {
2197
2197
  d = l + 1;
2198
2198
  continue;
2199
2199
  }
2200
- if (n.noext !== !0 && (S === si || S === ei || S === nt || S === Ft || S === Bt) === !0 && f() === rt) {
2201
- if (y = L.isGlob = !0, R = L.isExtglob = !0, E = !0, i === !0) {
2202
- for (; U() !== !0 && (S = M()); ) {
2203
- if (S === Me) {
2204
- b = L.backslashes = !0, S = M();
2200
+ if (n.noext !== !0 && (O === si || O === ei || O === nt || O === Ft || O === Bt) === !0 && f() === rt) {
2201
+ if (m = L.isGlob = !0, S = L.isExtglob = !0, E = !0, i === !0) {
2202
+ for (; U() !== !0 && (O = M()); ) {
2203
+ if (O === Me) {
2204
+ b = L.backslashes = !0, O = M();
2205
2205
  continue;
2206
2206
  }
2207
- if (S === zt) {
2208
- y = L.isGlob = !0, E = !0;
2207
+ if (O === zt) {
2208
+ m = L.isGlob = !0, E = !0;
2209
2209
  break;
2210
2210
  }
2211
2211
  }
@@ -2213,40 +2213,40 @@ const Ut = qe, {
2213
2213
  }
2214
2214
  break;
2215
2215
  }
2216
- if (S === nt) {
2217
- if (H === nt && (w = L.isGlobstar = !0), y = L.isGlob = !0, E = !0, i === !0)
2216
+ if (O === nt) {
2217
+ if (H === nt && (w = L.isGlobstar = !0), m = L.isGlob = !0, E = !0, i === !0)
2218
2218
  continue;
2219
2219
  break;
2220
2220
  }
2221
- if (S === Ft) {
2222
- if (y = L.isGlob = !0, E = !0, i === !0)
2221
+ if (O === Ft) {
2222
+ if (m = L.isGlob = !0, E = !0, i === !0)
2223
2223
  continue;
2224
2224
  break;
2225
2225
  }
2226
- if (S === ni)
2226
+ if (O === ni)
2227
2227
  for (; U() !== !0 && (W = M()); ) {
2228
2228
  if (W === Me) {
2229
2229
  b = L.backslashes = !0, M();
2230
2230
  continue;
2231
2231
  }
2232
2232
  if (W === ri) {
2233
- if (v = L.isBracket = !0, y = L.isGlob = !0, E = !0, i === !0)
2233
+ if (v = L.isBracket = !0, m = L.isGlob = !0, E = !0, i === !0)
2234
2234
  continue;
2235
2235
  break;
2236
2236
  }
2237
2237
  }
2238
- if (n.nonegate !== !0 && S === Bt && l === c) {
2238
+ if (n.nonegate !== !0 && O === Bt && l === c) {
2239
2239
  A = L.negated = !0, c++;
2240
2240
  continue;
2241
2241
  }
2242
- if (n.noparen !== !0 && S === rt) {
2243
- if (y = L.isGlob = !0, i === !0) {
2244
- for (; U() !== !0 && (S = M()); ) {
2245
- if (S === rt) {
2246
- b = L.backslashes = !0, S = M();
2242
+ if (n.noparen !== !0 && O === rt) {
2243
+ if (m = L.isGlob = !0, i === !0) {
2244
+ for (; U() !== !0 && (O = M()); ) {
2245
+ if (O === rt) {
2246
+ b = L.backslashes = !0, O = M();
2247
2247
  continue;
2248
2248
  }
2249
- if (S === zt) {
2249
+ if (O === zt) {
2250
2250
  E = !0;
2251
2251
  break;
2252
2252
  }
@@ -2255,50 +2255,50 @@ const Ut = qe, {
2255
2255
  }
2256
2256
  break;
2257
2257
  }
2258
- if (y === !0) {
2258
+ if (m === !0) {
2259
2259
  if (E = !0, i === !0)
2260
2260
  continue;
2261
2261
  break;
2262
2262
  }
2263
2263
  }
2264
- n.noext === !0 && (R = !1, y = !1);
2264
+ n.noext === !0 && (S = !1, m = !1);
2265
2265
  let I = u, B = "", h = "";
2266
- c > 0 && (B = u.slice(0, c), u = u.slice(c), d -= c), I && y === !0 && d > 0 ? (I = u.slice(0, d), h = u.slice(d)) : y === !0 ? (I = "", h = u) : I = u, I && I !== "" && I !== "/" && I !== u && Gt(I.charCodeAt(I.length - 1)) && (I = I.slice(0, -1)), n.unescape === !0 && (h && (h = Ut.removeBackslashes(h)), I && b === !0 && (I = Ut.removeBackslashes(I)));
2266
+ c > 0 && (B = u.slice(0, c), u = u.slice(c), d -= c), I && m === !0 && d > 0 ? (I = u.slice(0, d), h = u.slice(d)) : m === !0 ? (I = "", h = u) : I = u, I && I !== "" && I !== "/" && I !== u && Jt(I.charCodeAt(I.length - 1)) && (I = I.slice(0, -1)), n.unescape === !0 && (h && (h = Ut.removeBackslashes(h)), I && b === !0 && (I = Ut.removeBackslashes(I)));
2267
2267
  const p = {
2268
2268
  prefix: B,
2269
2269
  input: t,
2270
2270
  start: c,
2271
2271
  base: I,
2272
2272
  glob: h,
2273
- isBrace: g,
2273
+ isBrace: _,
2274
2274
  isBracket: v,
2275
- isGlob: y,
2276
- isExtglob: R,
2275
+ isGlob: m,
2276
+ isExtglob: S,
2277
2277
  isGlobstar: w,
2278
2278
  negated: A
2279
2279
  };
2280
- if (n.tokens === !0 && (p.maxDepth = 0, Gt(S) || r.push(L), p.tokens = r), n.parts === !0 || n.tokens === !0) {
2280
+ if (n.tokens === !0 && (p.maxDepth = 0, Jt(O) || r.push(L), p.tokens = r), n.parts === !0 || n.tokens === !0) {
2281
2281
  let W;
2282
2282
  for (let k = 0; k < o.length; k++) {
2283
2283
  const re = W ? W + 1 : c, ce = o[k], Q = t.slice(re, ce);
2284
- n.tokens && (k === 0 && c !== 0 ? (r[k].isPrefix = !0, r[k].value = B) : r[k].value = Q, Vt(r[k]), p.maxDepth += r[k].depth), (k !== 0 || Q !== "") && a.push(Q), W = ce;
2284
+ n.tokens && (k === 0 && c !== 0 ? (r[k].isPrefix = !0, r[k].value = B) : r[k].value = Q, Gt(r[k]), p.maxDepth += r[k].depth), (k !== 0 || Q !== "") && a.push(Q), W = ce;
2285
2285
  }
2286
2286
  if (W && W + 1 < t.length) {
2287
2287
  const k = t.slice(W + 1);
2288
- a.push(k), n.tokens && (r[r.length - 1].value = k, Vt(r[r.length - 1]), p.maxDepth += r[r.length - 1].depth);
2288
+ a.push(k), n.tokens && (r[r.length - 1].value = k, Gt(r[r.length - 1]), p.maxDepth += r[r.length - 1].depth);
2289
2289
  }
2290
2290
  p.slashes = o, p.parts = a;
2291
2291
  }
2292
2292
  return p;
2293
2293
  };
2294
2294
  var ai = oi;
2295
- const Ve = Ye, ne = qe, {
2296
- MAX_LENGTH: Je,
2295
+ const Ge = Ye, ne = qe, {
2296
+ MAX_LENGTH: Ve,
2297
2297
  POSIX_REGEX_SOURCE: ui,
2298
2298
  REGEX_NON_SPECIAL_CHARS: ci,
2299
2299
  REGEX_SPECIAL_CHARS_BACKREF: li,
2300
2300
  REPLACEMENTS: bn
2301
- } = Ve, fi = (t, e) => {
2301
+ } = Ge, fi = (t, e) => {
2302
2302
  if (typeof e.expandRange == "function")
2303
2303
  return e.expandRange(...t, e);
2304
2304
  t.sort();
@@ -2313,24 +2313,24 @@ const Ve = Ye, ne = qe, {
2313
2313
  if (typeof t != "string")
2314
2314
  throw new TypeError("Expected a string");
2315
2315
  t = bn[t] || t;
2316
- const n = { ...e }, s = typeof n.maxLength == "number" ? Math.min(Je, n.maxLength) : Je;
2316
+ const n = { ...e }, s = typeof n.maxLength == "number" ? Math.min(Ve, n.maxLength) : Ve;
2317
2317
  let i = t.length;
2318
2318
  if (i > s)
2319
2319
  throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${s}`);
2320
- const o = { type: "bos", value: "", output: n.prepend || "" }, r = [o], a = n.capture ? "" : "?:", u = Ve.globChars(n.windows), l = Ve.extglobChars(u), {
2320
+ const o = { type: "bos", value: "", output: n.prepend || "" }, r = [o], a = n.capture ? "" : "?:", u = Ge.globChars(n.windows), l = Ge.extglobChars(u), {
2321
2321
  DOT_LITERAL: c,
2322
2322
  PLUS_LITERAL: d,
2323
- SLASH_LITERAL: g,
2323
+ SLASH_LITERAL: _,
2324
2324
  ONE_CHAR: v,
2325
- DOTS_SLASH: y,
2326
- NO_DOT: R,
2325
+ DOTS_SLASH: m,
2326
+ NO_DOT: S,
2327
2327
  NO_DOT_SLASH: w,
2328
2328
  NO_DOTS_SLASH: $,
2329
2329
  QMARK: b,
2330
2330
  QMARK_NO_DOT: A,
2331
2331
  STAR: E,
2332
- START_ANCHOR: O
2333
- } = u, H = (_) => `(${a}(?:(?!${O}${_.dot ? y : c}).)*?)`, S = n.dot ? "" : R, L = n.dot ? b : A;
2332
+ START_ANCHOR: R
2333
+ } = u, H = (g) => `(${a}(?:(?!${R}${g.dot ? m : c}).)*?)`, O = n.dot ? "" : S, L = n.dot ? b : A;
2334
2334
  let U = n.bash === !0 ? H(n) : E;
2335
2335
  n.capture && (U = `(${U})`), typeof n.noext == "boolean" && (n.noextglob = n.noext);
2336
2336
  const f = {
@@ -2353,54 +2353,54 @@ const Ve = Ye, ne = qe, {
2353
2353
  t = ne.removePrefix(t, f), i = t.length;
2354
2354
  const M = [], I = [], B = [];
2355
2355
  let h = o, p;
2356
- const W = () => f.index === i - 1, k = f.peek = (_ = 1) => t[f.index + _], re = f.advance = () => t[++f.index], ce = () => t.slice(f.index + 1), Q = (_ = "", N = 0) => {
2357
- f.consumed += _, f.index += N;
2358
- }, De = (_) => {
2359
- f.output += _.output != null ? _.output : _.value, Q(_.value);
2356
+ const W = () => f.index === i - 1, k = f.peek = (g = 1) => t[f.index + g], re = f.advance = () => t[++f.index], ce = () => t.slice(f.index + 1), Q = (g = "", N = 0) => {
2357
+ f.consumed += g, f.index += N;
2358
+ }, De = (g) => {
2359
+ f.output += g.output != null ? g.output : g.value, Q(g.value);
2360
2360
  }, Sn = () => {
2361
- let _ = 1;
2361
+ let g = 1;
2362
2362
  for (; k() === "!" && (k(2) !== "(" || k(3) === "?"); )
2363
- re(), f.start++, _++;
2364
- return _ % 2 === 0 ? !1 : (f.negated = !0, f.start++, !0);
2365
- }, ke = (_) => {
2366
- f[_]++, B.push(_);
2367
- }, ye = (_) => {
2368
- f[_]--, B.pop();
2369
- }, T = (_) => {
2363
+ re(), f.start++, g++;
2364
+ return g % 2 === 0 ? !1 : (f.negated = !0, f.start++, !0);
2365
+ }, ke = (g) => {
2366
+ f[g]++, B.push(g);
2367
+ }, ye = (g) => {
2368
+ f[g]--, B.pop();
2369
+ }, T = (g) => {
2370
2370
  if (h.type === "globstar") {
2371
- const N = f.braces > 0 && (_.type === "comma" || _.type === "brace"), m = _.extglob === !0 || M.length && (_.type === "pipe" || _.type === "paren");
2372
- _.type !== "slash" && _.type !== "paren" && !N && !m && (f.output = f.output.slice(0, -h.output.length), h.type = "star", h.value = "*", h.output = U, f.output += h.output);
2371
+ const N = f.braces > 0 && (g.type === "comma" || g.type === "brace"), y = g.extglob === !0 || M.length && (g.type === "pipe" || g.type === "paren");
2372
+ g.type !== "slash" && g.type !== "paren" && !N && !y && (f.output = f.output.slice(0, -h.output.length), h.type = "star", h.value = "*", h.output = U, f.output += h.output);
2373
2373
  }
2374
- if (M.length && _.type !== "paren" && !l[_.value] && (M[M.length - 1].inner += _.value), (_.value || _.output) && De(_), h && h.type === "text" && _.type === "text") {
2375
- h.value += _.value, h.output = (h.output || "") + _.value;
2374
+ if (M.length && g.type !== "paren" && !l[g.value] && (M[M.length - 1].inner += g.value), (g.value || g.output) && De(g), h && h.type === "text" && g.type === "text") {
2375
+ h.value += g.value, h.output = (h.output || "") + g.value;
2376
2376
  return;
2377
2377
  }
2378
- _.prev = h, r.push(_), h = _;
2379
- }, He = (_, N) => {
2380
- const m = { ...l[N], conditions: 1, inner: "" };
2381
- m.prev = h, m.parens = f.parens, m.output = f.output;
2382
- const D = (n.capture ? "(" : "") + m.open;
2383
- ke("parens"), T({ type: _, value: N, output: f.output ? "" : v }), T({ type: "paren", extglob: !0, value: re(), output: D }), M.push(m);
2384
- }, An = (_) => {
2385
- let N = _.close + (n.capture ? ")" : "");
2386
- if (_.type === "negate") {
2387
- let m = U;
2388
- _.inner && _.inner.length > 1 && _.inner.includes("/") && (m = H(n)), (m !== U || W() || /^\)+$/.test(ce())) && (N = _.close = `)$))${m}`), _.prev.type === "bos" && W() && (f.negatedExtglob = !0);
2378
+ g.prev = h, r.push(g), h = g;
2379
+ }, He = (g, N) => {
2380
+ const y = { ...l[N], conditions: 1, inner: "" };
2381
+ y.prev = h, y.parens = f.parens, y.output = f.output;
2382
+ const D = (n.capture ? "(" : "") + y.open;
2383
+ ke("parens"), T({ type: g, value: N, output: f.output ? "" : v }), T({ type: "paren", extglob: !0, value: re(), output: D }), M.push(y);
2384
+ }, An = (g) => {
2385
+ let N = g.close + (n.capture ? ")" : "");
2386
+ if (g.type === "negate") {
2387
+ let y = U;
2388
+ g.inner && g.inner.length > 1 && g.inner.includes("/") && (y = H(n)), (y !== U || W() || /^\)+$/.test(ce())) && (N = g.close = `)$))${y}`), g.prev.type === "bos" && W() && (f.negatedExtglob = !0);
2389
2389
  }
2390
2390
  T({ type: "paren", extglob: !0, value: p, output: N }), ye("parens");
2391
2391
  };
2392
2392
  if (n.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(t)) {
2393
- let _ = !1, N = t.replace(li, (m, D, F, K, J, Ze) => K === "\\" ? (_ = !0, m) : K === "?" ? D ? D + K + (J ? b.repeat(J.length) : "") : Ze === 0 ? L + (J ? b.repeat(J.length) : "") : b.repeat(F.length) : K === "." ? c.repeat(F.length) : K === "*" ? D ? D + K + (J ? U : "") : U : D ? m : `\\${m}`);
2394
- return _ === !0 && (n.unescape === !0 ? N = N.replace(/\\/g, "") : N = N.replace(/\\+/g, (m) => m.length % 2 === 0 ? "\\\\" : m ? "\\" : "")), N === t && n.contains === !0 ? (f.output = t, f) : (f.output = ne.wrapOutput(N, f, e), f);
2393
+ let g = !1, N = t.replace(li, (y, D, F, K, V, Ze) => K === "\\" ? (g = !0, y) : K === "?" ? D ? D + K + (V ? b.repeat(V.length) : "") : Ze === 0 ? L + (V ? b.repeat(V.length) : "") : b.repeat(F.length) : K === "." ? c.repeat(F.length) : K === "*" ? D ? D + K + (V ? U : "") : U : D ? y : `\\${y}`);
2394
+ return g === !0 && (n.unescape === !0 ? N = N.replace(/\\/g, "") : N = N.replace(/\\+/g, (y) => y.length % 2 === 0 ? "\\\\" : y ? "\\" : "")), N === t && n.contains === !0 ? (f.output = t, f) : (f.output = ne.wrapOutput(N, f, e), f);
2395
2395
  }
2396
2396
  for (; !W(); ) {
2397
2397
  if (p = re(), p === "\0")
2398
2398
  continue;
2399
2399
  if (p === "\\") {
2400
- const m = k();
2401
- if (m === "/" && n.bash !== !0 || m === "." || m === ";")
2400
+ const y = k();
2401
+ if (y === "/" && n.bash !== !0 || y === "." || y === ";")
2402
2402
  continue;
2403
- if (!m) {
2403
+ if (!y) {
2404
2404
  p += "\\", T({ type: "text", value: p });
2405
2405
  continue;
2406
2406
  }
@@ -2413,11 +2413,11 @@ const Ve = Ye, ne = qe, {
2413
2413
  }
2414
2414
  if (f.brackets > 0 && (p !== "]" || h.value === "[" || h.value === "[^")) {
2415
2415
  if (n.posix !== !1 && p === ":") {
2416
- const m = h.value.slice(1);
2417
- if (m.includes("[") && (h.posix = !0, m.includes(":"))) {
2418
- const D = h.value.lastIndexOf("["), F = h.value.slice(0, D), K = h.value.slice(D + 2), J = ui[K];
2419
- if (J) {
2420
- h.value = F + J, f.backtrack = !0, re(), !o.output && r.indexOf(h) === 1 && (o.output = v);
2416
+ const y = h.value.slice(1);
2417
+ if (y.includes("[") && (h.posix = !0, y.includes(":"))) {
2418
+ const D = h.value.lastIndexOf("["), F = h.value.slice(0, D), K = h.value.slice(D + 2), V = ui[K];
2419
+ if (V) {
2420
+ h.value = F + V, f.backtrack = !0, re(), !o.output && r.indexOf(h) === 1 && (o.output = v);
2421
2421
  continue;
2422
2422
  }
2423
2423
  }
@@ -2440,8 +2440,8 @@ const Ve = Ye, ne = qe, {
2440
2440
  if (p === ")") {
2441
2441
  if (f.parens === 0 && n.strictBrackets === !0)
2442
2442
  throw new SyntaxError(ve("opening", "("));
2443
- const m = M[M.length - 1];
2444
- if (m && f.parens === m.parens + 1) {
2443
+ const y = M[M.length - 1];
2444
+ if (y && f.parens === y.parens + 1) {
2445
2445
  An(M.pop());
2446
2446
  continue;
2447
2447
  }
@@ -2470,8 +2470,8 @@ const Ve = Ye, ne = qe, {
2470
2470
  continue;
2471
2471
  }
2472
2472
  ye("brackets");
2473
- const m = h.value.slice(1);
2474
- if (h.posix !== !0 && m[0] === "^" && !m.includes("/") && (p = `/${p}`), h.value += p, De({ value: p }), n.literalBrackets === !1 || ne.hasRegexChars(m))
2473
+ const y = h.value.slice(1);
2474
+ if (h.posix !== !0 && y[0] === "^" && !y.includes("/") && (p = `/${p}`), h.value += p, De({ value: p }), n.literalBrackets === !1 || ne.hasRegexChars(y))
2475
2475
  continue;
2476
2476
  const D = ne.escapeRegex(h.value);
2477
2477
  if (f.output = f.output.slice(0, -h.value.length), n.literalBrackets === !0) {
@@ -2483,34 +2483,34 @@ const Ve = Ye, ne = qe, {
2483
2483
  }
2484
2484
  if (p === "{" && n.nobrace !== !0) {
2485
2485
  ke("braces");
2486
- const m = {
2486
+ const y = {
2487
2487
  type: "brace",
2488
2488
  value: p,
2489
2489
  output: "(",
2490
2490
  outputIndex: f.output.length,
2491
2491
  tokensIndex: f.tokens.length
2492
2492
  };
2493
- I.push(m), T(m);
2493
+ I.push(y), T(y);
2494
2494
  continue;
2495
2495
  }
2496
2496
  if (p === "}") {
2497
- const m = I[I.length - 1];
2498
- if (n.nobrace === !0 || !m) {
2497
+ const y = I[I.length - 1];
2498
+ if (n.nobrace === !0 || !y) {
2499
2499
  T({ type: "text", value: p, output: p });
2500
2500
  continue;
2501
2501
  }
2502
2502
  let D = ")";
2503
- if (m.dots === !0) {
2503
+ if (y.dots === !0) {
2504
2504
  const F = r.slice(), K = [];
2505
- for (let J = F.length - 1; J >= 0 && (r.pop(), F[J].type !== "brace"); J--)
2506
- F[J].type !== "dots" && K.unshift(F[J].value);
2505
+ for (let V = F.length - 1; V >= 0 && (r.pop(), F[V].type !== "brace"); V--)
2506
+ F[V].type !== "dots" && K.unshift(F[V].value);
2507
2507
  D = fi(K, n), f.backtrack = !0;
2508
2508
  }
2509
- if (m.comma !== !0 && m.dots !== !0) {
2510
- const F = f.output.slice(0, m.outputIndex), K = f.tokens.slice(m.tokensIndex);
2511
- m.value = m.output = "\\{", p = D = "\\}", f.output = F;
2512
- for (const J of K)
2513
- f.output += J.output || J.value;
2509
+ if (y.comma !== !0 && y.dots !== !0) {
2510
+ const F = f.output.slice(0, y.outputIndex), K = f.tokens.slice(y.tokensIndex);
2511
+ y.value = y.output = "\\{", p = D = "\\}", f.output = F;
2512
+ for (const V of K)
2513
+ f.output += V.output || V.value;
2514
2514
  }
2515
2515
  T({ type: "brace", value: p, output: D }), ye("braces"), I.pop();
2516
2516
  continue;
@@ -2520,9 +2520,9 @@ const Ve = Ye, ne = qe, {
2520
2520
  continue;
2521
2521
  }
2522
2522
  if (p === ",") {
2523
- let m = p;
2523
+ let y = p;
2524
2524
  const D = I[I.length - 1];
2525
- D && B[B.length - 1] === "braces" && (D.comma = !0, m = "|"), T({ type: "comma", value: p, output: m });
2525
+ D && B[B.length - 1] === "braces" && (D.comma = !0, y = "|"), T({ type: "comma", value: p, output: y });
2526
2526
  continue;
2527
2527
  }
2528
2528
  if (p === "/") {
@@ -2530,14 +2530,14 @@ const Ve = Ye, ne = qe, {
2530
2530
  f.start = f.index + 1, f.consumed = "", f.output = "", r.pop(), h = o;
2531
2531
  continue;
2532
2532
  }
2533
- T({ type: "slash", value: p, output: g });
2533
+ T({ type: "slash", value: p, output: _ });
2534
2534
  continue;
2535
2535
  }
2536
2536
  if (p === ".") {
2537
2537
  if (f.braces > 0 && h.type === "dot") {
2538
2538
  h.value === "." && (h.output = c);
2539
- const m = I[I.length - 1];
2540
- h.type = "dots", h.output += p, h.value += p, m.dots = !0;
2539
+ const y = I[I.length - 1];
2540
+ h.type = "dots", h.output += p, h.value += p, y.dots = !0;
2541
2541
  continue;
2542
2542
  }
2543
2543
  if (f.braces + f.parens === 0 && h.type !== "bos" && h.type !== "slash") {
@@ -2603,16 +2603,16 @@ const Ve = Ye, ne = qe, {
2603
2603
  }
2604
2604
  if (p !== "*") {
2605
2605
  (p === "$" || p === "^") && (p = `\\${p}`);
2606
- const m = ci.exec(ce());
2607
- m && (p += m[0], f.index += m[0].length), T({ type: "text", value: p });
2606
+ const y = ci.exec(ce());
2607
+ y && (p += y[0], f.index += y[0].length), T({ type: "text", value: p });
2608
2608
  continue;
2609
2609
  }
2610
2610
  if (h && (h.type === "globstar" || h.star === !0)) {
2611
2611
  h.type = "star", h.star = !0, h.value += p, h.output = U, f.backtrack = !0, f.globstar = !0, Q(p);
2612
2612
  continue;
2613
2613
  }
2614
- let _ = ce();
2615
- if (n.noextglob !== !0 && /^\([^?]/.test(_)) {
2614
+ let g = ce();
2615
+ if (n.noextglob !== !0 && /^\([^?]/.test(g)) {
2616
2616
  He("star", p);
2617
2617
  continue;
2618
2618
  }
@@ -2621,37 +2621,37 @@ const Ve = Ye, ne = qe, {
2621
2621
  Q(p);
2622
2622
  continue;
2623
2623
  }
2624
- const m = h.prev, D = m.prev, F = m.type === "slash" || m.type === "bos", K = D && (D.type === "star" || D.type === "globstar");
2625
- if (n.bash === !0 && (!F || _[0] && _[0] !== "/")) {
2624
+ const y = h.prev, D = y.prev, F = y.type === "slash" || y.type === "bos", K = D && (D.type === "star" || D.type === "globstar");
2625
+ if (n.bash === !0 && (!F || g[0] && g[0] !== "/")) {
2626
2626
  T({ type: "star", value: p, output: "" });
2627
2627
  continue;
2628
2628
  }
2629
- const J = f.braces > 0 && (m.type === "comma" || m.type === "brace"), Ze = M.length && (m.type === "pipe" || m.type === "paren");
2630
- if (!F && m.type !== "paren" && !J && !Ze) {
2629
+ const V = f.braces > 0 && (y.type === "comma" || y.type === "brace"), Ze = M.length && (y.type === "pipe" || y.type === "paren");
2630
+ if (!F && y.type !== "paren" && !V && !Ze) {
2631
2631
  T({ type: "star", value: p, output: "" });
2632
2632
  continue;
2633
2633
  }
2634
- for (; _.slice(0, 3) === "/**"; ) {
2634
+ for (; g.slice(0, 3) === "/**"; ) {
2635
2635
  const Ne = t[f.index + 4];
2636
2636
  if (Ne && Ne !== "/")
2637
2637
  break;
2638
- _ = _.slice(3), Q("/**", 3);
2638
+ g = g.slice(3), Q("/**", 3);
2639
2639
  }
2640
- if (m.type === "bos" && W()) {
2640
+ if (y.type === "bos" && W()) {
2641
2641
  h.type = "globstar", h.value += p, h.output = H(n), f.output = h.output, f.globstar = !0, Q(p);
2642
2642
  continue;
2643
2643
  }
2644
- if (m.type === "slash" && m.prev.type !== "bos" && !K && W()) {
2645
- f.output = f.output.slice(0, -(m.output + h.output).length), m.output = `(?:${m.output}`, h.type = "globstar", h.output = H(n) + (n.strictSlashes ? ")" : "|$)"), h.value += p, f.globstar = !0, f.output += m.output + h.output, Q(p);
2644
+ if (y.type === "slash" && y.prev.type !== "bos" && !K && W()) {
2645
+ f.output = f.output.slice(0, -(y.output + h.output).length), y.output = `(?:${y.output}`, h.type = "globstar", h.output = H(n) + (n.strictSlashes ? ")" : "|$)"), h.value += p, f.globstar = !0, f.output += y.output + h.output, Q(p);
2646
2646
  continue;
2647
2647
  }
2648
- if (m.type === "slash" && m.prev.type !== "bos" && _[0] === "/") {
2649
- const Ne = _[1] !== void 0 ? "|$" : "";
2650
- f.output = f.output.slice(0, -(m.output + h.output).length), m.output = `(?:${m.output}`, h.type = "globstar", h.output = `${H(n)}${g}|${g}${Ne})`, h.value += p, f.output += m.output + h.output, f.globstar = !0, Q(p + re()), T({ type: "slash", value: "/", output: "" });
2648
+ if (y.type === "slash" && y.prev.type !== "bos" && g[0] === "/") {
2649
+ const Ne = g[1] !== void 0 ? "|$" : "";
2650
+ f.output = f.output.slice(0, -(y.output + h.output).length), y.output = `(?:${y.output}`, h.type = "globstar", h.output = `${H(n)}${_}|${_}${Ne})`, h.value += p, f.output += y.output + h.output, f.globstar = !0, Q(p + re()), T({ type: "slash", value: "/", output: "" });
2651
2651
  continue;
2652
2652
  }
2653
- if (m.type === "bos" && _[0] === "/") {
2654
- h.type = "globstar", h.value += p, h.output = `(?:^|${g}|${H(n)}${g})`, f.output = h.output, f.globstar = !0, Q(p + re()), T({ type: "slash", value: "/", output: "" });
2653
+ if (y.type === "bos" && g[0] === "/") {
2654
+ h.type = "globstar", h.value += p, h.output = `(?:^|${_}|${H(n)}${_})`, f.output = h.output, f.globstar = !0, Q(p + re()), T({ type: "slash", value: "/", output: "" });
2655
2655
  continue;
2656
2656
  }
2657
2657
  f.output = f.output.slice(0, -h.output.length), h.type = "globstar", h.output = H(n), h.value += p, f.output += h.output, f.globstar = !0, Q(p);
@@ -2659,14 +2659,14 @@ const Ve = Ye, ne = qe, {
2659
2659
  }
2660
2660
  const N = { type: "star", value: p, output: U };
2661
2661
  if (n.bash === !0) {
2662
- N.output = ".*?", (h.type === "bos" || h.type === "slash") && (N.output = S + N.output), T(N);
2662
+ N.output = ".*?", (h.type === "bos" || h.type === "slash") && (N.output = O + N.output), T(N);
2663
2663
  continue;
2664
2664
  }
2665
2665
  if (h && (h.type === "bracket" || h.type === "paren") && n.regex === !0) {
2666
2666
  N.output = p, T(N);
2667
2667
  continue;
2668
2668
  }
2669
- (f.index === f.start || h.type === "slash" || h.type === "dot") && (h.type === "dot" ? (f.output += w, h.output += w) : n.dot === !0 ? (f.output += $, h.output += $) : (f.output += S, h.output += S), k() !== "*" && (f.output += v, h.output += v)), T(N);
2669
+ (f.index === f.start || h.type === "slash" || h.type === "dot") && (h.type === "dot" ? (f.output += w, h.output += w) : n.dot === !0 ? (f.output += $, h.output += $) : (f.output += O, h.output += O), k() !== "*" && (f.output += v, h.output += v)), T(N);
2670
2670
  }
2671
2671
  for (; f.brackets > 0; ) {
2672
2672
  if (n.strictBrackets === !0)
@@ -2683,15 +2683,15 @@ const Ve = Ye, ne = qe, {
2683
2683
  throw new SyntaxError(ve("closing", "}"));
2684
2684
  f.output = ne.escapeLast(f.output, "{"), ye("braces");
2685
2685
  }
2686
- if (n.strictSlashes !== !0 && (h.type === "star" || h.type === "bracket") && T({ type: "maybe_slash", value: "", output: `${g}?` }), f.backtrack === !0) {
2686
+ if (n.strictSlashes !== !0 && (h.type === "star" || h.type === "bracket") && T({ type: "maybe_slash", value: "", output: `${_}?` }), f.backtrack === !0) {
2687
2687
  f.output = "";
2688
- for (const _ of f.tokens)
2689
- f.output += _.output != null ? _.output : _.value, _.suffix && (f.output += _.suffix);
2688
+ for (const g of f.tokens)
2689
+ f.output += g.output != null ? g.output : g.value, g.suffix && (f.output += g.suffix);
2690
2690
  }
2691
2691
  return f;
2692
2692
  };
2693
2693
  wn.fastpaths = (t, e) => {
2694
- const n = { ...e }, s = typeof n.maxLength == "number" ? Math.min(Je, n.maxLength) : Je, i = t.length;
2694
+ const n = { ...e }, s = typeof n.maxLength == "number" ? Math.min(Ve, n.maxLength) : Ve, i = t.length;
2695
2695
  if (i > s)
2696
2696
  throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${s}`);
2697
2697
  t = bn[t] || t;
@@ -2703,50 +2703,50 @@ wn.fastpaths = (t, e) => {
2703
2703
  NO_DOT: l,
2704
2704
  NO_DOTS: c,
2705
2705
  NO_DOTS_SLASH: d,
2706
- STAR: g,
2706
+ STAR: _,
2707
2707
  START_ANCHOR: v
2708
- } = Ve.globChars(n.windows), y = n.dot ? c : l, R = n.dot ? d : l, w = n.capture ? "" : "?:", $ = { negated: !1, prefix: "" };
2709
- let b = n.bash === !0 ? ".*?" : g;
2708
+ } = Ge.globChars(n.windows), m = n.dot ? c : l, S = n.dot ? d : l, w = n.capture ? "" : "?:", $ = { negated: !1, prefix: "" };
2709
+ let b = n.bash === !0 ? ".*?" : _;
2710
2710
  n.capture && (b = `(${b})`);
2711
- const A = (S) => S.noglobstar === !0 ? b : `(${w}(?:(?!${v}${S.dot ? u : o}).)*?)`, E = (S) => {
2712
- switch (S) {
2711
+ const A = (O) => O.noglobstar === !0 ? b : `(${w}(?:(?!${v}${O.dot ? u : o}).)*?)`, E = (O) => {
2712
+ switch (O) {
2713
2713
  case "*":
2714
- return `${y}${a}${b}`;
2714
+ return `${m}${a}${b}`;
2715
2715
  case ".*":
2716
2716
  return `${o}${a}${b}`;
2717
2717
  case "*.*":
2718
- return `${y}${b}${o}${a}${b}`;
2718
+ return `${m}${b}${o}${a}${b}`;
2719
2719
  case "*/*":
2720
- return `${y}${b}${r}${a}${R}${b}`;
2720
+ return `${m}${b}${r}${a}${S}${b}`;
2721
2721
  case "**":
2722
- return y + A(n);
2722
+ return m + A(n);
2723
2723
  case "**/*":
2724
- return `(?:${y}${A(n)}${r})?${R}${a}${b}`;
2724
+ return `(?:${m}${A(n)}${r})?${S}${a}${b}`;
2725
2725
  case "**/*.*":
2726
- return `(?:${y}${A(n)}${r})?${R}${b}${o}${a}${b}`;
2726
+ return `(?:${m}${A(n)}${r})?${S}${b}${o}${a}${b}`;
2727
2727
  case "**/.*":
2728
- return `(?:${y}${A(n)}${r})?${o}${a}${b}`;
2728
+ return `(?:${m}${A(n)}${r})?${o}${a}${b}`;
2729
2729
  default: {
2730
- const L = /^(.*?)\.(\w+)$/.exec(S);
2730
+ const L = /^(.*?)\.(\w+)$/.exec(O);
2731
2731
  if (!L)
2732
2732
  return;
2733
2733
  const U = E(L[1]);
2734
2734
  return U ? U + o + L[2] : void 0;
2735
2735
  }
2736
2736
  }
2737
- }, O = ne.removePrefix(t, $);
2738
- let H = E(O);
2737
+ }, R = ne.removePrefix(t, $);
2738
+ let H = E(R);
2739
2739
  return H && n.strictSlashes !== !0 && (H += `${r}?`), H;
2740
2740
  };
2741
2741
  var pi = wn;
2742
- const hi = ai, dt = pi, vn = qe, di = Ye, mi = (t) => t && typeof t == "object" && !Array.isArray(t), V = (t, e, n = !1) => {
2742
+ const hi = ai, dt = pi, vn = qe, di = Ye, mi = (t) => t && typeof t == "object" && !Array.isArray(t), G = (t, e, n = !1) => {
2743
2743
  if (Array.isArray(t)) {
2744
- const c = t.map((g) => V(g, e, n));
2745
- return (g) => {
2744
+ const c = t.map((_) => G(_, e, n));
2745
+ return (_) => {
2746
2746
  for (const v of c) {
2747
- const y = v(g);
2748
- if (y)
2749
- return y;
2747
+ const m = v(_);
2748
+ if (m)
2749
+ return m;
2750
2750
  }
2751
2751
  return !1;
2752
2752
  };
@@ -2754,49 +2754,49 @@ const hi = ai, dt = pi, vn = qe, di = Ye, mi = (t) => t && typeof t == "object"
2754
2754
  const s = mi(t) && t.tokens && t.input;
2755
2755
  if (t === "" || typeof t != "string" && !s)
2756
2756
  throw new TypeError("Expected pattern to be a non-empty string");
2757
- const i = e || {}, o = i.windows, r = s ? V.compileRe(t, e) : V.makeRe(t, e, !1, !0), a = r.state;
2757
+ const i = e || {}, o = i.windows, r = s ? G.compileRe(t, e) : G.makeRe(t, e, !1, !0), a = r.state;
2758
2758
  delete r.state;
2759
2759
  let u = () => !1;
2760
2760
  if (i.ignore) {
2761
2761
  const c = { ...e, ignore: null, onMatch: null, onResult: null };
2762
- u = V(i.ignore, c, n);
2762
+ u = G(i.ignore, c, n);
2763
2763
  }
2764
2764
  const l = (c, d = !1) => {
2765
- const { isMatch: g, match: v, output: y } = V.test(c, r, e, { glob: t, posix: o }), R = { glob: t, state: a, regex: r, posix: o, input: c, output: y, match: v, isMatch: g };
2766
- return typeof i.onResult == "function" && i.onResult(R), g === !1 ? (R.isMatch = !1, d ? R : !1) : u(c) ? (typeof i.onIgnore == "function" && i.onIgnore(R), R.isMatch = !1, d ? R : !1) : (typeof i.onMatch == "function" && i.onMatch(R), d ? R : !0);
2765
+ const { isMatch: _, match: v, output: m } = G.test(c, r, e, { glob: t, posix: o }), S = { glob: t, state: a, regex: r, posix: o, input: c, output: m, match: v, isMatch: _ };
2766
+ return typeof i.onResult == "function" && i.onResult(S), _ === !1 ? (S.isMatch = !1, d ? S : !1) : u(c) ? (typeof i.onIgnore == "function" && i.onIgnore(S), S.isMatch = !1, d ? S : !1) : (typeof i.onMatch == "function" && i.onMatch(S), d ? S : !0);
2767
2767
  };
2768
2768
  return n && (l.state = a), l;
2769
2769
  };
2770
- V.test = (t, e, n, { glob: s, posix: i } = {}) => {
2770
+ G.test = (t, e, n, { glob: s, posix: i } = {}) => {
2771
2771
  if (typeof t != "string")
2772
2772
  throw new TypeError("Expected input to be a string");
2773
2773
  if (t === "")
2774
2774
  return { isMatch: !1, output: "" };
2775
2775
  const o = n || {}, r = o.format || (i ? vn.toPosixSlashes : null);
2776
2776
  let a = t === s, u = a && r ? r(t) : t;
2777
- return a === !1 && (u = r ? r(t) : t, a = u === s), (a === !1 || o.capture === !0) && (o.matchBase === !0 || o.basename === !0 ? a = V.matchBase(t, e, n, i) : a = e.exec(u)), { isMatch: !!a, match: a, output: u };
2777
+ return a === !1 && (u = r ? r(t) : t, a = u === s), (a === !1 || o.capture === !0) && (o.matchBase === !0 || o.basename === !0 ? a = G.matchBase(t, e, n, i) : a = e.exec(u)), { isMatch: !!a, match: a, output: u };
2778
2778
  };
2779
- V.matchBase = (t, e, n) => (e instanceof RegExp ? e : V.makeRe(e, n)).test(vn.basename(t));
2780
- V.isMatch = (t, e, n) => V(e, n)(t);
2781
- V.parse = (t, e) => Array.isArray(t) ? t.map((n) => V.parse(n, e)) : dt(t, { ...e, fastpaths: !1 });
2782
- V.scan = (t, e) => hi(t, e);
2783
- V.compileRe = (t, e, n = !1, s = !1) => {
2779
+ G.matchBase = (t, e, n) => (e instanceof RegExp ? e : G.makeRe(e, n)).test(vn.basename(t));
2780
+ G.isMatch = (t, e, n) => G(e, n)(t);
2781
+ G.parse = (t, e) => Array.isArray(t) ? t.map((n) => G.parse(n, e)) : dt(t, { ...e, fastpaths: !1 });
2782
+ G.scan = (t, e) => hi(t, e);
2783
+ G.compileRe = (t, e, n = !1, s = !1) => {
2784
2784
  if (n === !0)
2785
2785
  return t.output;
2786
2786
  const i = e || {}, o = i.contains ? "" : "^", r = i.contains ? "" : "$";
2787
2787
  let a = `${o}(?:${t.output})${r}`;
2788
2788
  t && t.negated === !0 && (a = `^(?!${a}).*$`);
2789
- const u = V.toRegex(a, e);
2789
+ const u = G.toRegex(a, e);
2790
2790
  return s === !0 && (u.state = t), u;
2791
2791
  };
2792
- V.makeRe = (t, e, n = !1, s = !1) => {
2792
+ G.makeRe = (t, e, n = !1, s = !1) => {
2793
2793
  if (!t || typeof t != "string")
2794
2794
  throw new TypeError("Expected a non-empty string");
2795
2795
  const i = e || {};
2796
2796
  let o = { negated: !1, fastpaths: !0 }, r = "", a;
2797
- return t.startsWith("./") && (t = t.slice(2), r = o.prefix = "./"), i.fastpaths !== !1 && (t[0] === "." || t[0] === "*") && (a = dt.fastpaths(t, e)), a === void 0 ? (o = dt(t, e), o.prefix = r + (o.prefix || "")) : o.output = a, V.compileRe(o, e, n, s);
2797
+ return t.startsWith("./") && (t = t.slice(2), r = o.prefix = "./"), i.fastpaths !== !1 && (t[0] === "." || t[0] === "*") && (a = dt.fastpaths(t, e)), a === void 0 ? (o = dt(t, e), o.prefix = r + (o.prefix || "")) : o.output = a, G.compileRe(o, e, n, s);
2798
2798
  };
2799
- V.toRegex = (t, e) => {
2799
+ G.toRegex = (t, e) => {
2800
2800
  try {
2801
2801
  const n = e || {};
2802
2802
  return new RegExp(t, n.flags || (n.nocase ? "i" : ""));
@@ -2806,8 +2806,8 @@ V.toRegex = (t, e) => {
2806
2806
  return /$^/;
2807
2807
  }
2808
2808
  };
2809
- V.constants = di;
2810
- var yi = V, gi = yi;
2809
+ G.constants = di;
2810
+ var yi = G, gi = yi;
2811
2811
  const _i = /* @__PURE__ */ mt(gi), Rn = yt(fetch), bi = async (t, e) => {
2812
2812
  const n = new URL(t);
2813
2813
  n.pathname = n.pathname + (n.pathname.endsWith("/") ? "metapage.json" : "/metapage.json");
@@ -2841,7 +2841,7 @@ const _i = /* @__PURE__ */ mt(gi), Rn = yt(fetch), bi = async (t, e) => {
2841
2841
  console.error(`Error fetching metaframe definition from ${n.href}: ${i}`);
2842
2842
  return;
2843
2843
  }
2844
- }, Gi = (t) => t ? !(t != null && t.inputs && Object.keys(t.inputs).length > 0 || t != null && t.outputs && Object.keys(t.outputs).length > 0 || t != null && t.allow || t != null && t.metadata && Object.keys(t.metadata).length > 0) : !0;
2844
+ }, Ji = (t) => t ? !(t != null && t.inputs && Object.keys(t.inputs).length > 0 || t != null && t.outputs && Object.keys(t.outputs).length > 0 || t != null && t.allow || t != null && t.metadata && Object.keys(t.metadata).length > 0) : !0;
2845
2845
  class vi extends Rt.EventEmitter {
2846
2846
  constructor(e, n, s, i, o, r = !1) {
2847
2847
  if (super(), this.inputs = {}, this.outputs = {}, this._disposables = [], this._rpcListeners = [], this._loaded = !1, this._onLoaded = [], this._sendInputsAfterRegistration = !1, this._cachedEventInputsUpdate = {
@@ -2863,21 +2863,21 @@ class vi extends Rt.EventEmitter {
2863
2863
  const u = this;
2864
2864
  this.iframe = new Promise((l) => {
2865
2865
  Xe().then(async () => {
2866
- var c, d, g, v;
2866
+ var c, d, _, v;
2867
2867
  if (u._iframe) {
2868
- if ((v = (g = (d = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : d.metaframes) == null ? void 0 : g[this.id]) != null && v.allow)
2868
+ if ((v = (_ = (d = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : d.metaframes) == null ? void 0 : _[this.id]) != null && v.allow)
2869
2869
  u._iframe.allow = this._metapage._definition.metaframes[this.id].allow, this._debug && this.log(`mf allow=${u._iframe.allow} from this._metapage?._definition`);
2870
2870
  else {
2871
- let y = Ot(this.url, "definition");
2872
- if (y = y && (y != null && y.version) ? await pt(y) : void 0, !u._iframe)
2871
+ let m = Ot(this.url, "definition");
2872
+ if (m = m && (m != null && m.version) ? await pt(m) : void 0, !u._iframe)
2873
2873
  return;
2874
- if (y != null && y.allow)
2875
- u._iframe.allow = y.allow;
2874
+ if (m != null && m.allow)
2875
+ u._iframe.allow = m.allow;
2876
2876
  else {
2877
- let R = await u.getDefinition();
2878
- if (this._debug && this.log(`mf metaframeDef=${JSON.stringify(R)}`), R = R && (R != null && R.version) ? await pt(R) : void 0, this._debug && this.log(`mf metaframeDef=${JSON.stringify(R)}`), !u._iframe)
2877
+ let S = await u.getDefinition();
2878
+ if (this._debug && this.log(`mf metaframeDef=${JSON.stringify(S)}`), S = S && (S != null && S.version) ? await pt(S) : void 0, this._debug && this.log(`mf metaframeDef=${JSON.stringify(S)}`), !u._iframe)
2879
2879
  return;
2880
- R && R.allow && (u._iframe.allow = R.allow);
2880
+ S && S.allow && (u._iframe.allow = S.allow);
2881
2881
  }
2882
2882
  }
2883
2883
  this._debug && this.log(`mf allow=${u._iframe.allow} from ${this.url}`), u._iframe.src = this.url, l(u._iframe);
@@ -2918,7 +2918,7 @@ Error: ${n != null && n.message ? n == null ? void 0 : n.message : n == null ? v
2918
2918
  setInputs(e) {
2919
2919
  this.log({ m: "MetapageIFrameRpcClient", inputs: e });
2920
2920
  const n = e;
2921
- if (this.inputs = Ge(this.inputs, e), this.inputs === n)
2921
+ if (this.inputs = Je(this.inputs, e), this.inputs === n)
2922
2922
  return this;
2923
2923
  if (this._loaded || (this._sendInputsAfterRegistration = !0), this._iframe.parentNode && this._loaded && this.sendInputs(e), this.emit(x.Inputs, this.inputs), this._metapage.listenerCount(x.Inputs) > 0) {
2924
2924
  var s = {};
@@ -2933,7 +2933,7 @@ Error: ${n != null && n.message ? n == null ? void 0 : n.message : n == null ? v
2933
2933
  }
2934
2934
  setOutputs(e) {
2935
2935
  const n = e;
2936
- if (this.outputs = Ge(this.outputs, e), this.outputs === n)
2936
+ if (this.outputs = Je(this.outputs, e), this.outputs === n)
2937
2937
  return this;
2938
2938
  if (this.emit(x.Outputs, e), this._metapage.listenerCount(x.Outputs) > 0) {
2939
2939
  var s = {};
@@ -2975,7 +2975,7 @@ Error: ${n != null && n.message ? n == null ? void 0 : n.message : n == null ? v
2975
2975
  state: {
2976
2976
  inputs: this.inputs
2977
2977
  },
2978
- version: Jt
2978
+ version: Vt
2979
2979
  };
2980
2980
  this.sendRpcInternal(me.SetupIframeServerResponse, e);
2981
2981
  }
@@ -3052,7 +3052,7 @@ const ge = C({
3052
3052
  inputs: {},
3053
3053
  outputs: {}
3054
3054
  }
3055
- }, (t) => t), Vi = (t) => he(t), Ri = (t, e) => !!(!e || e === "**" || t === e || _i.isMatch(t, e)), Oi = "bcbcbc";
3055
+ }, (t) => t), Gi = (t) => he(t), Ri = (t, e) => !!(!e || e === "**" || t === e || _i.isMatch(t, e)), Oi = "bcbcbc";
3056
3056
  class ee extends Ns {
3057
3057
  static async from(e, n) {
3058
3058
  if (e == null)
@@ -3067,7 +3067,7 @@ class ee extends Ns {
3067
3067
  return s.setDefinition(e);
3068
3068
  }
3069
3069
  constructor(e) {
3070
- super(), this._state = ge, this._metaframes = C({}, (n) => n), this.debug = ht(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = C({}, (n) => n), this._inputMap = {}, this._id = e && e.id ? e.id : js(), this._consoleBackgroundColor = e && e.color ? e.color : Oi, this.addPipe = this.addPipe.bind(this), this.dispose = this.dispose.bind(this), this.addMetaframe = this.addMetaframe.bind(this), this.getInputsFromOutput = this.getInputsFromOutput.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframeIds = this.getMetaframeIds.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframes = this.getMetaframes.bind(this), this.getState = this.getState.bind(this), this.getStateMetaframes = this.getStateMetaframes.bind(this), this.isValidJSONRpcMessage = this.isValidJSONRpcMessage.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.metaframeIds = this.metaframeIds.bind(this), this.metaframes = this.metaframes.bind(this), this.onMessage = this.onMessage.bind(this), this.removeAll = this.removeAll.bind(this), this.removeMetaframe = this.removeMetaframe.bind(this), this.setDebugFromUrlParams = this.setDebugFromUrlParams.bind(this), this.setDefinition = this.setDefinition.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInputStateOnlyMetaframeInputValue = this.setInputStateOnlyMetaframeInputValue.bind(this), this.setInputStateOnlyMetaframeInputMap = this.setInputStateOnlyMetaframeInputMap.bind(this), this.setInputStateOnlyMetapageInstanceInputs = this.setInputStateOnlyMetapageInstanceInputs.bind(this), this.setOutputStateOnlyMetaframeInputValue = this.setOutputStateOnlyMetaframeInputValue.bind(this), this.setOutputStateOnlyMetaframeInputMap = this.setOutputStateOnlyMetaframeInputMap.bind(this), this.setOutputStateOnlyMetapageInstanceInputs = this.setOutputStateOnlyMetapageInstanceInputs.bind(this), this.setMetadata = this.setMetadata.bind(this), this.setMetaframeClientInputAndSentClientEvent = this.setMetaframeClientInputAndSentClientEvent.bind(this), this.setState = this.setState.bind(this), this.isDisposed = this.isDisposed.bind(this), this._emitDefinitionEvent = this._emitDefinitionEvent.bind(this), Xe().then(() => {
3070
+ super(), this._state = ge, this._metaframes = C({}, (n) => n), this.debug = ht(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = C({}, (n) => n), this._inputMap = {}, this._id = e && e.id ? e.id : js(), this._consoleBackgroundColor = e && e.color ? e.color : Oi, this.addPipe = this.addPipe.bind(this), this.dispose = this.dispose.bind(this), this.addMetaframe = this.addMetaframe.bind(this), this.getInputsFromOutput = this.getInputsFromOutput.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframeIds = this.getMetaframeIds.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframes = this.getMetaframes.bind(this), this.getState = this.getState.bind(this), this.getStateMetaframes = this.getStateMetaframes.bind(this), this.isValidJSONRpcMessage = this.isValidJSONRpcMessage.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.metaframeIds = this.metaframeIds.bind(this), this.metaframes = this.metaframes.bind(this), this.onMessage = this.onMessage.bind(this), this.onMessageJsonRpc = this.onMessageJsonRpc.bind(this), this.removeAll = this.removeAll.bind(this), this.removeMetaframe = this.removeMetaframe.bind(this), this.setDebugFromUrlParams = this.setDebugFromUrlParams.bind(this), this.setDefinition = this.setDefinition.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInputStateOnlyMetaframeInputValue = this.setInputStateOnlyMetaframeInputValue.bind(this), this.setInputStateOnlyMetaframeInputMap = this.setInputStateOnlyMetaframeInputMap.bind(this), this.setInputStateOnlyMetapageInstanceInputs = this.setInputStateOnlyMetapageInstanceInputs.bind(this), this.setOutputStateOnlyMetaframeInputValue = this.setOutputStateOnlyMetaframeInputValue.bind(this), this.setOutputStateOnlyMetaframeInputMap = this.setOutputStateOnlyMetaframeInputMap.bind(this), this.setOutputStateOnlyMetapageInstanceInputs = this.setOutputStateOnlyMetapageInstanceInputs.bind(this), this.setMetadata = this.setMetadata.bind(this), this.setMetaframeClientInputAndSentClientEvent = this.setMetaframeClientInputAndSentClientEvent.bind(this), this.setState = this.setState.bind(this), this.isDisposed = this.isDisposed.bind(this), this._emitDefinitionEvent = this._emitDefinitionEvent.bind(this), Xe().then(() => {
3071
3071
  this.isDisposed() || (window.addEventListener("message", this.onMessage), this.log("Initialized"));
3072
3072
  });
3073
3073
  }
@@ -3224,7 +3224,7 @@ class ee extends Ns {
3224
3224
  if (e.jsonrpc !== "2.0")
3225
3225
  return !1;
3226
3226
  switch (e.method) {
3227
- case q.SetupIframeClientRequest:
3227
+ case X.SetupIframeClientRequest:
3228
3228
  return !0;
3229
3229
  default:
3230
3230
  var s = e.iframeId;
@@ -3313,67 +3313,80 @@ class ee extends Ns {
3313
3313
  });
3314
3314
  }));
3315
3315
  }
3316
+ setMetaframeOutputs(e, n) {
3317
+ this.onMessageJsonRpc({
3318
+ iframeId: e,
3319
+ parentId: this._id,
3320
+ jsonrpc: "2.0",
3321
+ method: X.OutputsUpdate,
3322
+ id: "_",
3323
+ params: n
3324
+ });
3325
+ }
3316
3326
  onMessage(e) {
3317
3327
  if (typeof e.data == "object") {
3318
- const r = e.data;
3319
- if (!this.isValidJSONRpcMessage(r))
3320
- return;
3321
- var n = r.method;
3322
- const a = r.iframeId;
3323
- if (!a || n !== "SetupIframeClientRequest" && r.parentId !== this._id)
3328
+ const n = e.data;
3329
+ if (!this.isValidJSONRpcMessage(n))
3324
3330
  return;
3325
- const u = this.getMetaframe(a);
3326
- if (!u)
3327
- return;
3328
- switch (r._messageCount = ++this._internalReceivedMessageCounter, this.debug && this.log(`processing ${JSON.stringify(r, null, " ").substring(0, 500)}`), n) {
3329
- case q.SetupIframeClientRequest:
3330
- u.register();
3331
+ this.onMessageJsonRpc(n);
3332
+ }
3333
+ }
3334
+ onMessageJsonRpc(e) {
3335
+ var n = e.method;
3336
+ const s = e.iframeId;
3337
+ if (!s || n !== "SetupIframeClientRequest" && e.parentId !== this._id)
3338
+ return;
3339
+ const i = this.getMetaframe(s);
3340
+ if (i) {
3341
+ switch (e._messageCount = ++this._internalReceivedMessageCounter, this.debug && this.log(`processing ${JSON.stringify(e, null, " ").substring(0, 500)}`), n) {
3342
+ case X.SetupIframeClientRequest:
3343
+ i.register();
3331
3344
  break;
3332
- case q.SetupIframeServerResponseAck:
3333
- if (u) {
3334
- const c = r.params;
3335
- u.registered(c.version);
3345
+ case X.SetupIframeServerResponseAck:
3346
+ if (i) {
3347
+ const l = e.params;
3348
+ i.registered(l.version);
3336
3349
  }
3337
3350
  break;
3338
- case q.OutputsUpdate:
3339
- const l = r.params;
3340
- if (!l || Object.keys(l).length === 0)
3351
+ case X.OutputsUpdate:
3352
+ const u = e.params;
3353
+ if (!u || Object.keys(u).length === 0)
3341
3354
  break;
3342
- if (this._metaframes[a]) {
3343
- var s = this._metaframes[a];
3344
- this.setOutputStateOnlyMetaframeInputMap(a, l), s.setOutputs(l);
3345
- var i = !1;
3346
- const c = Object.keys(l), d = {};
3347
- c.forEach((g, v) => {
3348
- const y = this.getInputsFromOutput(a, g);
3349
- y.length > 0 && y.forEach((R) => {
3350
- d[R.metaframe] || (d[R.metaframe] = {}), d[R.metaframe][R.pipe] = l[g], i = !0;
3355
+ if (this._metaframes[s]) {
3356
+ var o = this._metaframes[s];
3357
+ this.setOutputStateOnlyMetaframeInputMap(s, u), o.setOutputs(u);
3358
+ var r = !1;
3359
+ const l = Object.keys(u), c = {};
3360
+ l.forEach((d, _) => {
3361
+ const v = this.getInputsFromOutput(s, d);
3362
+ v.length > 0 && v.forEach((m) => {
3363
+ c[m.metaframe] || (c[m.metaframe] = {}), c[m.metaframe][m.pipe] = u[d], r = !0;
3351
3364
  });
3352
- }), i && (this.setInputStateOnlyMetapageInstanceInputs(d), Object.keys(d).forEach((g) => {
3353
- this._metaframes[g].setInputs(d[g]);
3354
- })), this.listenerCount(x.State) > 0 && ge !== this._state && this.emit(x.State, this._state), this.debug && s.ack({ jsonrpc: r, state: this._state });
3365
+ }), r && (this.setInputStateOnlyMetapageInstanceInputs(c), Object.keys(c).forEach((d) => {
3366
+ this._metaframes[d].setInputs(c[d]);
3367
+ })), this.listenerCount(x.State) > 0 && ge !== this._state && this.emit(x.State, this._state), this.debug && o.ack({ jsonrpc: e, state: this._state });
3355
3368
  } else
3356
- this.error(`missing metaframe=${a}`);
3369
+ this.error(`missing metaframe=${s}`);
3357
3370
  break;
3358
- case q.InputsUpdate:
3359
- var o = r.params;
3360
- this.debug && this.log(`inputs ${JSON.stringify(o)} from ${a}`), this._metaframes[a] ? (this.setInputStateOnlyMetaframeInputMap(a, o), this._metaframes[a].setInputs(o), this.listenerCount(x.State) > 0 && ge !== this._state && this.emit(x.State, this._state), this.debug && this._metaframes[a].ack({
3361
- jsonrpc: r,
3371
+ case X.InputsUpdate:
3372
+ var a = e.params;
3373
+ this.debug && this.log(`inputs ${JSON.stringify(a)} from ${s}`), this._metaframes[s] ? (this.setInputStateOnlyMetaframeInputMap(s, a), this._metaframes[s].setInputs(a), this.listenerCount(x.State) > 0 && ge !== this._state && this.emit(x.State, this._state), this.debug && this._metaframes[s].ack({
3374
+ jsonrpc: e,
3362
3375
  state: this._state
3363
- })) : (console.error(`InputsUpdate failed no metaframe id: "${a}"`), this.error(`InputsUpdate failed no metaframe id: "${a}"`));
3376
+ })) : (console.error(`InputsUpdate failed no metaframe id: "${s}"`), this.error(`InputsUpdate failed no metaframe id: "${s}"`));
3364
3377
  break;
3365
- case q.HashParamsUpdate:
3366
- if (u) {
3367
- const c = r.params, d = new URL(u.url);
3368
- d.hash = c.hash, u.url = d.href, this._definition = C(this._definition, (g) => {
3369
- g.metaframes[c.metaframe].url = d.href;
3378
+ case X.HashParamsUpdate:
3379
+ if (i) {
3380
+ const l = e.params, c = new URL(i.url);
3381
+ c.hash = l.hash, i.url = c.href, this._definition = C(this._definition, (d) => {
3382
+ d.metaframes[l.metaframe].url = c.href;
3370
3383
  }), this._emitDefinitionEvent();
3371
3384
  }
3372
3385
  break;
3373
3386
  default:
3374
3387
  this.debug && this.log(`Unknown RPC method: "${n}"`);
3375
3388
  }
3376
- this.listenerCount(x.Message) > 0 && this.emit(x.Message, r);
3389
+ this.listenerCount(x.Message) > 0 && this.emit(x.Message, e);
3377
3390
  }
3378
3391
  }
3379
3392
  logInternal(e, n, s) {
@@ -3382,7 +3395,7 @@ class ee extends Ns {
3382
3395
  typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), i = this._id ? `Metapage[${this._id}] ${i}` : i, At(i, n, s);
3383
3396
  }
3384
3397
  }
3385
- ee.version = Jt;
3398
+ ee.version = Vt;
3386
3399
  ee.DEFINITION = x.Definition;
3387
3400
  ee.ERROR = x.Error;
3388
3401
  ee.INPUTS = x.Inputs;
@@ -3427,8 +3440,8 @@ function Si(t) {
3427
3440
  }
3428
3441
  return e;
3429
3442
  }
3430
- async function Ji(t) {
3431
- var O, H, S, L, U;
3443
+ async function Vi(t) {
3444
+ var R, H, O, L, U;
3432
3445
  let { url: e, definition: n, onOutputs: s, rootDiv: i, options: o = {} } = t;
3433
3446
  if (!e && !n)
3434
3447
  throw new Error("Either url or definition must be provided");
@@ -3446,7 +3459,7 @@ async function Ji(t) {
3446
3459
  }
3447
3460
  const a = [];
3448
3461
  s && a.push(r.addListenerReturnDisposer(x.Outputs, s));
3449
- const u = (H = (O = n == null ? void 0 : n.meta) == null ? void 0 : O.layouts) == null ? void 0 : H["react-grid-layout"], l = u == null ? void 0 : u.layout;
3462
+ const u = (H = (R = n == null ? void 0 : n.meta) == null ? void 0 : R.layouts) == null ? void 0 : H["react-grid-layout"], l = u == null ? void 0 : u.layout;
3450
3463
  if (!u || !l)
3451
3464
  throw new Error("No valid layout found in metapage definition");
3452
3465
  const c = /* @__PURE__ */ new Set(), d = l.map((f, M) => {
@@ -3454,13 +3467,13 @@ async function Ji(t) {
3454
3467
  return I && On(I.url) ? { index: M, y: f.y, id: f.i } : null;
3455
3468
  }).filter((f) => f !== null);
3456
3469
  if (d.length > 0) {
3457
- const f = d.reduce((I, B) => B.y < I.y ? B : I), M = ((S = l.find((I) => I.i === f.id)) == null ? void 0 : S.y) ?? 0;
3470
+ const f = d.reduce((I, B) => B.y < I.y ? B : I), M = ((O = l.find((I) => I.i === f.id)) == null ? void 0 : O.y) ?? 0;
3458
3471
  l.forEach((I) => {
3459
3472
  I.y >= M && c.add(I.i);
3460
3473
  });
3461
3474
  }
3462
- const g = r.getMetaframeIds().filter((f) => !c.has(f));
3463
- let v = l.filter((f) => g.includes(f.i));
3475
+ const _ = r.getMetaframeIds().filter((f) => !c.has(f));
3476
+ let v = l.filter((f) => _.includes(f.i));
3464
3477
  if (v.length === 0)
3465
3478
  return {
3466
3479
  metapage: r,
@@ -3472,7 +3485,7 @@ async function Ji(t) {
3472
3485
  }
3473
3486
  };
3474
3487
  v.sort((f, M) => f.y !== M.y ? f.y - M.y : f.x - M.x);
3475
- const y = {
3488
+ const m = {
3476
3489
  display: "grid",
3477
3490
  gridTemplateColumns: "repeat(1, 1fr)",
3478
3491
  gridAutoRows: "1fr",
@@ -3485,7 +3498,7 @@ async function Ji(t) {
3485
3498
  alignContent: "start",
3486
3499
  alignItems: "start",
3487
3500
  overflow: "hidden"
3488
- }, R = {
3501
+ }, S = {
3489
3502
  width: "100%",
3490
3503
  height: "100%",
3491
3504
  overflow: "hidden",
@@ -3494,11 +3507,11 @@ async function Ji(t) {
3494
3507
  };
3495
3508
  i.innerHTML = "";
3496
3509
  const w = document.createElement("div");
3497
- Object.assign(w.style, R);
3510
+ Object.assign(w.style, S);
3498
3511
  const $ = document.createElement("div");
3499
- Object.assign($.style, y);
3512
+ Object.assign($.style, m);
3500
3513
  const b = [];
3501
- for (const f of g) {
3514
+ for (const f of _) {
3502
3515
  const M = l.find((W) => W.i === f);
3503
3516
  if (!M)
3504
3517
  continue;
@@ -3568,7 +3581,7 @@ export {
3568
3581
  ki as INTERNAL_ERROR,
3569
3582
  Di as INVALID_PARAMS,
3570
3583
  Ti as INVALID_REQUEST,
3571
- q as JsonRpcMethodsFromChild,
3584
+ X as JsonRpcMethodsFromChild,
3572
3585
  me as JsonRpcMethodsFromParent,
3573
3586
  Mi as METAFRAME_JSON_FILE,
3574
3587
  Ii as METAPAGE_KEY_DEFINITION,
@@ -3588,7 +3601,7 @@ export {
3588
3601
  Ct as MetapageVersionsAll,
3589
3602
  Li as PARSE_ERROR,
3590
3603
  En as VERSION_METAFRAME,
3591
- Jt as VERSION_METAPAGE,
3604
+ Vt as VERSION_METAPAGE,
3592
3605
  ns as convertMetaframeDefinitionToCurrentVersion,
3593
3606
  nn as convertMetaframeDefinitionToVersion,
3594
3607
  pt as convertMetaframeJsonToCurrentVersion,
@@ -3599,7 +3612,7 @@ export {
3599
3612
  Ui as generateMetaframeId,
3600
3613
  js as generateMetapageId,
3601
3614
  Bi as generateNonce,
3602
- Vi as getLibraryVersionMatching,
3615
+ Gi as getLibraryVersionMatching,
3603
3616
  te as getMatchingMetaframeVersion,
3604
3617
  he as getMatchingMetapageVersion,
3605
3618
  wi as getMetaframeDefinitionFromUrl,
@@ -3609,20 +3622,20 @@ export {
3609
3622
  Us as hashCode,
3610
3623
  Bs as intToRGB,
3611
3624
  ht as isDebugFromUrlsParams,
3612
- Gi as isEmptyMetaframeDefinition,
3625
+ Ji as isEmptyMetaframeDefinition,
3613
3626
  Hs as isIframe,
3614
3627
  Hi as isJsonRpcId,
3615
3628
  tt as isPageLoaded,
3616
3629
  At as log,
3617
3630
  Ri as matchPipe,
3618
- Ge as merge,
3631
+ Je as merge,
3619
3632
  Fi as metapageAllSha256Hash,
3620
3633
  zi as metapageOnlyEssentailSha256Hash,
3621
3634
  Xe as pageLoaded,
3622
3635
  xi as possiblyDeserializeDatarefToFile,
3623
3636
  sn as possiblyDeserializeDatarefToValue,
3624
3637
  ds as possiblySerializeValueToDataref,
3625
- Ji as renderMetapage,
3638
+ Vi as renderMetapage,
3626
3639
  Ke as serializeInputs,
3627
3640
  hn as stringToRgb,
3628
3641
  $i as valueToFile