brsh 2.8.1 → 3.1.0

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.
Files changed (44) hide show
  1. package/.github/workflows/release.yml +3 -1
  2. package/CHANGELOG.md +32 -0
  3. package/POSIX-CHECKLIST.md +3 -3
  4. package/Readme.md +138 -223
  5. package/bin/Readme.md +70 -24
  6. package/bin/brsh-shell.js +16 -131
  7. package/bin/exportFileSystem.js +4 -0
  8. package/bin/zsh-server.js +261 -0
  9. package/dist/brsh.css +1 -1
  10. package/dist/shell.es.js +1020 -648
  11. package/dist/shell.es.js.map +1 -1
  12. package/dist/shell.min.js +34 -19
  13. package/dist/shell.min.js.map +1 -1
  14. package/dist/terminal.cjs.js +77 -100
  15. package/dist/terminal.cjs.js.map +1 -1
  16. package/dist/terminal.es.js +1382 -603
  17. package/dist/terminal.es.js.map +1 -1
  18. package/dist/terminal.min.js +77 -100
  19. package/dist/terminal.min.js.map +1 -1
  20. package/dist/wbt.es.js +410 -238
  21. package/dist/wbt.es.js.map +1 -1
  22. package/dist/wbt.min.js +10 -8
  23. package/dist/wbt.min.js.map +1 -1
  24. package/index.js +472 -0
  25. package/lib/Command.js +30 -0
  26. package/lib/InteractiveCommand.js +28 -0
  27. package/lib/Readme.md +111 -12
  28. package/lib/ReplCommand.js +15 -0
  29. package/lib/Terminal.js +769 -510
  30. package/lib/TtyStream.js +181 -0
  31. package/lib/WasmCommand.js +26 -5
  32. package/lib/builtins/cat.js +2 -2
  33. package/lib/builtins/grep.js +2 -2
  34. package/lib/local/clear.js +3 -0
  35. package/lib/terminal/DomRenderer.js +325 -0
  36. package/lib/terminal/PtyBridge.js +169 -0
  37. package/lib/terminal/ScreenBuffer.js +594 -0
  38. package/lib/terminal/VtParser.js +728 -0
  39. package/lib/wbt/index.js +3 -2
  40. package/lib/wbt/registry.js +15 -1
  41. package/package.json +4 -2
  42. package/styles/terminal.css +33 -4
  43. package/test/terminal.test.js +762 -40
  44. package/test/wbt.test.js +92 -0
package/dist/shell.es.js CHANGED
@@ -96,7 +96,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
96
96
  if (typeof e == "string") return g(e, t);
97
97
  if (o.isView(e)) return y(e);
98
98
  if (e == null) throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
99
- if (J(e, o) || e && J(e.buffer, o) || s !== void 0 && (J(e, s) || e && J(e.buffer, s))) return b(e, t, n);
99
+ if (Y(e, o) || e && Y(e.buffer, o) || s !== void 0 && (Y(e, s) || e && Y(e.buffer, s))) return b(e, t, n);
100
100
  if (typeof e == "number") throw TypeError("The \"value\" argument must not be of type number. Received type number");
101
101
  let r = e.valueOf && e.valueOf();
102
102
  if (r != null && r !== e) return u.from(r, t, n);
@@ -137,7 +137,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
137
137
  return n;
138
138
  }
139
139
  function y(e) {
140
- if (J(e, a)) {
140
+ if (Y(e, a)) {
141
141
  let t = new a(e);
142
142
  return b(t.buffer, t.byteOffset, t.byteLength);
143
143
  }
@@ -154,7 +154,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
154
154
  let t = S(e.length) | 0, n = l(t);
155
155
  return n.length === 0 || e.copy(n, 0, 0, t), n;
156
156
  }
157
- if (e.length !== void 0) return typeof e.length != "number" || he(e.length) ? l(0) : _(e);
157
+ if (e.length !== void 0) return typeof e.length != "number" || me(e.length) ? l(0) : _(e);
158
158
  if (e.type === "Buffer" && Array.isArray(e.data)) return _(e.data);
159
159
  }
160
160
  function S(e) {
@@ -167,7 +167,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
167
167
  u.isBuffer = function(e) {
168
168
  return e != null && e._isBuffer === !0 && e !== u.prototype;
169
169
  }, u.compare = function(e, t) {
170
- if (J(e, a) && (e = u.from(e, e.offset, e.byteLength)), J(t, a) && (t = u.from(t, t.offset, t.byteLength)), !u.isBuffer(e) || !u.isBuffer(t)) throw TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
170
+ if (Y(e, a) && (e = u.from(e, e.offset, e.byteLength)), Y(t, a) && (t = u.from(t, t.offset, t.byteLength)), !u.isBuffer(e) || !u.isBuffer(t)) throw TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
171
171
  if (e === t) return 0;
172
172
  let n = e.length, r = t.length;
173
173
  for (let i = 0, a = Math.min(n, r); i < a; ++i) if (e[i] !== t[i]) {
@@ -198,7 +198,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
198
198
  let r = u.allocUnsafe(t), i = 0;
199
199
  for (n = 0; n < e.length; ++n) {
200
200
  let t = e[n];
201
- if (J(t, a)) i + t.length > r.length ? (u.isBuffer(t) || (t = u.from(t)), t.copy(r, i)) : a.prototype.set.call(r, t, i);
201
+ if (Y(t, a)) i + t.length > r.length ? (u.isBuffer(t) || (t = u.from(t)), t.copy(r, i)) : a.prototype.set.call(r, t, i);
202
202
  else if (u.isBuffer(t)) t.copy(r, i);
203
203
  else throw TypeError("\"list\" argument must be an Array of Buffers");
204
204
  i += t.length;
@@ -207,7 +207,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
207
207
  };
208
208
  function w(e, t) {
209
209
  if (u.isBuffer(e)) return e.length;
210
- if (o.isView(e) || J(e, o)) return e.byteLength;
210
+ if (o.isView(e) || Y(e, o)) return e.byteLength;
211
211
  if (typeof e != "string") throw TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof e);
212
212
  let n = e.length, r = arguments.length > 2 && arguments[2] === !0;
213
213
  if (!r && n === 0) return 0;
@@ -217,15 +217,15 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
217
217
  case "latin1":
218
218
  case "binary": return n;
219
219
  case "utf8":
220
- case "utf-8": return ue(e).length;
220
+ case "utf-8": return le(e).length;
221
221
  case "ucs2":
222
222
  case "ucs-2":
223
223
  case "utf16le":
224
224
  case "utf-16le": return n * 2;
225
225
  case "hex": return n >>> 1;
226
- case "base64": return pe(e).length;
226
+ case "base64": return fe(e).length;
227
227
  default:
228
- if (i) return r ? -1 : ue(e).length;
228
+ if (i) return r ? -1 : le(e).length;
229
229
  t = ("" + t).toLowerCase(), i = !0;
230
230
  }
231
231
  }
@@ -234,17 +234,17 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
234
234
  let r = !1;
235
235
  if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((n === void 0 || n > this.length) && (n = this.length), n <= 0) || (n >>>= 0, t >>>= 0, n <= t)) return "";
236
236
  for (e ||= "utf8";;) switch (e) {
237
- case "hex": return z(this, t, n);
237
+ case "hex": return B(this, t, n);
238
238
  case "utf8":
239
239
  case "utf-8": return F(this, t, n);
240
240
  case "ascii": return R(this, t, n);
241
241
  case "latin1":
242
- case "binary": return ee(this, t, n);
242
+ case "binary": return z(this, t, n);
243
243
  case "base64": return P(this, t, n);
244
244
  case "ucs2":
245
245
  case "ucs-2":
246
246
  case "utf16le":
247
- case "utf-16le": return B(this, t, n);
247
+ case "utf-16le": return V(this, t, n);
248
248
  default:
249
249
  if (r) throw TypeError("Unknown encoding: " + e);
250
250
  e = (e + "").toLowerCase(), r = !0;
@@ -280,7 +280,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
280
280
  let t = "", n = e.INSPECT_MAX_BYTES;
281
281
  return t = this.toString("hex", 0, n).replace(/(.{2})/g, "$1 ").trim(), this.length > n && (t += " ... "), "<Buffer " + t + ">";
282
282
  }, r && (u.prototype[r] = u.prototype.inspect), u.prototype.compare = function(e, t, n, r, i) {
283
- if (J(e, a) && (e = u.from(e, e.offset, e.byteLength)), !u.isBuffer(e)) throw TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof e);
283
+ if (Y(e, a) && (e = u.from(e, e.offset, e.byteLength)), !u.isBuffer(e)) throw TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof e);
284
284
  if (t === void 0 && (t = 0), n === void 0 && (n = e ? e.length : 0), r === void 0 && (r = 0), i === void 0 && (i = this.length), t < 0 || n > e.length || r < 0 || i > this.length) throw RangeError("out of range index");
285
285
  if (r >= i && t >= n) return 0;
286
286
  if (r >= i) return -1;
@@ -295,7 +295,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
295
295
  };
296
296
  function D(e, t, n, r, i) {
297
297
  if (e.length === 0) return -1;
298
- if (typeof n == "string" ? (r = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, he(n) && (n = i ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
298
+ if (typeof n == "string" ? (r = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, me(n) && (n = i ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
299
299
  if (i) return -1;
300
300
  n = e.length - 1;
301
301
  } else if (n < 0) if (i) n = 0;
@@ -345,22 +345,22 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
345
345
  let o;
346
346
  for (o = 0; o < r; ++o) {
347
347
  let r = parseInt(t.substr(o * 2, 2), 16);
348
- if (he(r)) return o;
348
+ if (me(r)) return o;
349
349
  e[n + o] = r;
350
350
  }
351
351
  return o;
352
352
  }
353
353
  function A(e, t, n, r) {
354
- return me(ue(t, e.length - n), e, n, r);
354
+ return pe(le(t, e.length - n), e, n, r);
355
355
  }
356
356
  function j(e, t, n, r) {
357
- return me(de(t), e, n, r);
357
+ return pe(ue(t), e, n, r);
358
358
  }
359
359
  function M(e, t, n, r) {
360
- return me(pe(t), e, n, r);
360
+ return pe(fe(t), e, n, r);
361
361
  }
362
362
  function N(e, t, n, r) {
363
- return me(fe(t, e.length - n), e, n, r);
363
+ return pe(de(t, e.length - n), e, n, r);
364
364
  }
365
365
  u.prototype.write = function(e, t, n, r) {
366
366
  if (t === void 0) r = "utf8", n = this.length, t = 0;
@@ -434,20 +434,20 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
434
434
  for (let i = t; i < n; ++i) r += String.fromCharCode(e[i] & 127);
435
435
  return r;
436
436
  }
437
- function ee(e, t, n) {
437
+ function z(e, t, n) {
438
438
  let r = "";
439
439
  n = Math.min(e.length, n);
440
440
  for (let i = t; i < n; ++i) r += String.fromCharCode(e[i]);
441
441
  return r;
442
442
  }
443
- function z(e, t, n) {
443
+ function B(e, t, n) {
444
444
  let r = e.length;
445
445
  (!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r);
446
446
  let i = "";
447
- for (let r = t; r < n; ++r) i += ge[e[r]];
447
+ for (let r = t; r < n; ++r) i += he[e[r]];
448
448
  return i;
449
449
  }
450
- function B(e, t, n) {
450
+ function V(e, t, n) {
451
451
  let r = e.slice(t, n), i = "";
452
452
  for (let e = 0; e < r.length - 1; e += 2) i += String.fromCharCode(r[e] + r[e + 1] * 256);
453
453
  return i;
@@ -458,88 +458,88 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
458
458
  let r = this.subarray(e, t);
459
459
  return Object.setPrototypeOf(r, u.prototype), r;
460
460
  };
461
- function V(e, t, n) {
461
+ function H(e, t, n) {
462
462
  if (e % 1 != 0 || e < 0) throw RangeError("offset is not uint");
463
463
  if (e + t > n) throw RangeError("Trying to access beyond buffer length");
464
464
  }
465
465
  u.prototype.readUintLE = u.prototype.readUIntLE = function(e, t, n) {
466
- e >>>= 0, t >>>= 0, n || V(e, t, this.length);
466
+ e >>>= 0, t >>>= 0, n || H(e, t, this.length);
467
467
  let r = this[e], i = 1, a = 0;
468
468
  for (; ++a < t && (i *= 256);) r += this[e + a] * i;
469
469
  return r;
470
470
  }, u.prototype.readUintBE = u.prototype.readUIntBE = function(e, t, n) {
471
- e >>>= 0, t >>>= 0, n || V(e, t, this.length);
471
+ e >>>= 0, t >>>= 0, n || H(e, t, this.length);
472
472
  let r = this[e + --t], i = 1;
473
473
  for (; t > 0 && (i *= 256);) r += this[e + --t] * i;
474
474
  return r;
475
475
  }, u.prototype.readUint8 = u.prototype.readUInt8 = function(e, t) {
476
- return e >>>= 0, t || V(e, 1, this.length), this[e];
476
+ return e >>>= 0, t || H(e, 1, this.length), this[e];
477
477
  }, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(e, t) {
478
- return e >>>= 0, t || V(e, 2, this.length), this[e] | this[e + 1] << 8;
478
+ return e >>>= 0, t || H(e, 2, this.length), this[e] | this[e + 1] << 8;
479
479
  }, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(e, t) {
480
- return e >>>= 0, t || V(e, 2, this.length), this[e] << 8 | this[e + 1];
480
+ return e >>>= 0, t || H(e, 2, this.length), this[e] << 8 | this[e + 1];
481
481
  }, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(e, t) {
482
- return e >>>= 0, t || V(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
482
+ return e >>>= 0, t || H(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
483
483
  }, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(e, t) {
484
- return e >>>= 0, t || V(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
485
- }, u.prototype.readBigUInt64LE = Y(function(e) {
486
- e >>>= 0, q(e, "offset");
484
+ return e >>>= 0, t || H(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
485
+ }, u.prototype.readBigUInt64LE = X(function(e) {
486
+ e >>>= 0, J(e, "offset");
487
487
  let t = this[e], n = this[e + 7];
488
- (t === void 0 || n === void 0) && se(e, this.length - 8);
488
+ (t === void 0 || n === void 0) && oe(e, this.length - 8);
489
489
  let r = t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24, i = this[++e] + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + n * 2 ** 24;
490
490
  return BigInt(r) + (BigInt(i) << BigInt(32));
491
- }), u.prototype.readBigUInt64BE = Y(function(e) {
492
- e >>>= 0, q(e, "offset");
491
+ }), u.prototype.readBigUInt64BE = X(function(e) {
492
+ e >>>= 0, J(e, "offset");
493
493
  let t = this[e], n = this[e + 7];
494
- (t === void 0 || n === void 0) && se(e, this.length - 8);
494
+ (t === void 0 || n === void 0) && oe(e, this.length - 8);
495
495
  let r = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], i = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n;
496
496
  return (BigInt(r) << BigInt(32)) + BigInt(i);
497
497
  }), u.prototype.readIntLE = function(e, t, n) {
498
- e >>>= 0, t >>>= 0, n || V(e, t, this.length);
498
+ e >>>= 0, t >>>= 0, n || H(e, t, this.length);
499
499
  let r = this[e], i = 1, a = 0;
500
500
  for (; ++a < t && (i *= 256);) r += this[e + a] * i;
501
501
  return i *= 128, r >= i && (r -= 2 ** (8 * t)), r;
502
502
  }, u.prototype.readIntBE = function(e, t, n) {
503
- e >>>= 0, t >>>= 0, n || V(e, t, this.length);
503
+ e >>>= 0, t >>>= 0, n || H(e, t, this.length);
504
504
  let r = t, i = 1, a = this[e + --r];
505
505
  for (; r > 0 && (i *= 256);) a += this[e + --r] * i;
506
506
  return i *= 128, a >= i && (a -= 2 ** (8 * t)), a;
507
507
  }, u.prototype.readInt8 = function(e, t) {
508
- return e >>>= 0, t || V(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
508
+ return e >>>= 0, t || H(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
509
509
  }, u.prototype.readInt16LE = function(e, t) {
510
- e >>>= 0, t || V(e, 2, this.length);
510
+ e >>>= 0, t || H(e, 2, this.length);
511
511
  let n = this[e] | this[e + 1] << 8;
512
512
  return n & 32768 ? n | 4294901760 : n;
513
513
  }, u.prototype.readInt16BE = function(e, t) {
514
- e >>>= 0, t || V(e, 2, this.length);
514
+ e >>>= 0, t || H(e, 2, this.length);
515
515
  let n = this[e + 1] | this[e] << 8;
516
516
  return n & 32768 ? n | 4294901760 : n;
517
517
  }, u.prototype.readInt32LE = function(e, t) {
518
- return e >>>= 0, t || V(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
518
+ return e >>>= 0, t || H(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
519
519
  }, u.prototype.readInt32BE = function(e, t) {
520
- return e >>>= 0, t || V(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
521
- }, u.prototype.readBigInt64LE = Y(function(e) {
522
- e >>>= 0, q(e, "offset");
520
+ return e >>>= 0, t || H(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
521
+ }, u.prototype.readBigInt64LE = X(function(e) {
522
+ e >>>= 0, J(e, "offset");
523
523
  let t = this[e], n = this[e + 7];
524
- (t === void 0 || n === void 0) && se(e, this.length - 8);
524
+ (t === void 0 || n === void 0) && oe(e, this.length - 8);
525
525
  let r = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (n << 24);
526
526
  return (BigInt(r) << BigInt(32)) + BigInt(t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
527
- }), u.prototype.readBigInt64BE = Y(function(e) {
528
- e >>>= 0, q(e, "offset");
527
+ }), u.prototype.readBigInt64BE = X(function(e) {
528
+ e >>>= 0, J(e, "offset");
529
529
  let t = this[e], n = this[e + 7];
530
- (t === void 0 || n === void 0) && se(e, this.length - 8);
530
+ (t === void 0 || n === void 0) && oe(e, this.length - 8);
531
531
  let r = (t << 24) + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
532
532
  return (BigInt(r) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n);
533
533
  }), u.prototype.readFloatLE = function(e, t) {
534
- return e >>>= 0, t || V(e, 4, this.length), n.read(this, e, !0, 23, 4);
534
+ return e >>>= 0, t || H(e, 4, this.length), n.read(this, e, !0, 23, 4);
535
535
  }, u.prototype.readFloatBE = function(e, t) {
536
- return e >>>= 0, t || V(e, 4, this.length), n.read(this, e, !1, 23, 4);
536
+ return e >>>= 0, t || H(e, 4, this.length), n.read(this, e, !1, 23, 4);
537
537
  }, u.prototype.readDoubleLE = function(e, t) {
538
- return e >>>= 0, t || V(e, 8, this.length), n.read(this, e, !0, 52, 8);
538
+ return e >>>= 0, t || H(e, 8, this.length), n.read(this, e, !0, 52, 8);
539
539
  }, u.prototype.readDoubleBE = function(e, t) {
540
- return e >>>= 0, t || V(e, 8, this.length), n.read(this, e, !1, 52, 8);
540
+ return e >>>= 0, t || H(e, 8, this.length), n.read(this, e, !1, 52, 8);
541
541
  };
542
- function H(e, t, n, r, i, a) {
542
+ function U(e, t, n, r, i, a) {
543
543
  if (!u.isBuffer(e)) throw TypeError("\"buffer\" argument must be a Buffer instance");
544
544
  if (t > i || t < a) throw RangeError("\"value\" argument is out of bounds");
545
545
  if (n + r > e.length) throw RangeError("Index out of range");
@@ -547,7 +547,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
547
547
  u.prototype.writeUintLE = u.prototype.writeUIntLE = function(e, t, n, r) {
548
548
  if (e = +e, t >>>= 0, n >>>= 0, !r) {
549
549
  let r = 2 ** (8 * n) - 1;
550
- H(this, e, t, n, r, 0);
550
+ U(this, e, t, n, r, 0);
551
551
  }
552
552
  let i = 1, a = 0;
553
553
  for (this[t] = e & 255; ++a < n && (i *= 256);) this[t + a] = e / i & 255;
@@ -555,44 +555,44 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
555
555
  }, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(e, t, n, r) {
556
556
  if (e = +e, t >>>= 0, n >>>= 0, !r) {
557
557
  let r = 2 ** (8 * n) - 1;
558
- H(this, e, t, n, r, 0);
558
+ U(this, e, t, n, r, 0);
559
559
  }
560
560
  let i = n - 1, a = 1;
561
561
  for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) this[t + i] = e / a & 255;
562
562
  return t + n;
563
563
  }, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(e, t, n) {
564
- return e = +e, t >>>= 0, n || H(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
564
+ return e = +e, t >>>= 0, n || U(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
565
565
  }, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(e, t, n) {
566
- return e = +e, t >>>= 0, n || H(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
566
+ return e = +e, t >>>= 0, n || U(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
567
567
  }, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(e, t, n) {
568
- return e = +e, t >>>= 0, n || H(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
568
+ return e = +e, t >>>= 0, n || U(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
569
569
  }, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(e, t, n) {
570
- return e = +e, t >>>= 0, n || H(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
570
+ return e = +e, t >>>= 0, n || U(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
571
571
  }, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(e, t, n) {
572
- return e = +e, t >>>= 0, n || H(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
572
+ return e = +e, t >>>= 0, n || U(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
573
573
  };
574
- function te(e, t, n, r, i) {
575
- K(t, r, i, e, n, 7);
574
+ function ee(e, t, n, r, i) {
575
+ ae(t, r, i, e, n, 7);
576
576
  let a = Number(t & BigInt(4294967295));
577
577
  e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a;
578
578
  let o = Number(t >> BigInt(32) & BigInt(4294967295));
579
579
  return e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, n;
580
580
  }
581
- function U(e, t, n, r, i) {
582
- K(t, r, i, e, n, 7);
581
+ function te(e, t, n, r, i) {
582
+ ae(t, r, i, e, n, 7);
583
583
  let a = Number(t & BigInt(4294967295));
584
584
  e[n + 7] = a, a >>= 8, e[n + 6] = a, a >>= 8, e[n + 5] = a, a >>= 8, e[n + 4] = a;
585
585
  let o = Number(t >> BigInt(32) & BigInt(4294967295));
586
586
  return e[n + 3] = o, o >>= 8, e[n + 2] = o, o >>= 8, e[n + 1] = o, o >>= 8, e[n] = o, n + 8;
587
587
  }
588
- u.prototype.writeBigUInt64LE = Y(function(e, t = 0) {
588
+ u.prototype.writeBigUInt64LE = X(function(e, t = 0) {
589
+ return ee(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
590
+ }), u.prototype.writeBigUInt64BE = X(function(e, t = 0) {
589
591
  return te(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
590
- }), u.prototype.writeBigUInt64BE = Y(function(e, t = 0) {
591
- return U(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
592
592
  }), u.prototype.writeIntLE = function(e, t, n, r) {
593
593
  if (e = +e, t >>>= 0, !r) {
594
594
  let r = 2 ** (8 * n - 1);
595
- H(this, e, t, n, r - 1, -r);
595
+ U(this, e, t, n, r - 1, -r);
596
596
  }
597
597
  let i = 0, a = 1, o = 0;
598
598
  for (this[t] = e & 255; ++i < n && (a *= 256);) e < 0 && o === 0 && this[t + i - 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
@@ -600,44 +600,44 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
600
600
  }, u.prototype.writeIntBE = function(e, t, n, r) {
601
601
  if (e = +e, t >>>= 0, !r) {
602
602
  let r = 2 ** (8 * n - 1);
603
- H(this, e, t, n, r - 1, -r);
603
+ U(this, e, t, n, r - 1, -r);
604
604
  }
605
605
  let i = n - 1, a = 1, o = 0;
606
606
  for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) e < 0 && o === 0 && this[t + i + 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
607
607
  return t + n;
608
608
  }, u.prototype.writeInt8 = function(e, t, n) {
609
- return e = +e, t >>>= 0, n || H(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
609
+ return e = +e, t >>>= 0, n || U(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
610
610
  }, u.prototype.writeInt16LE = function(e, t, n) {
611
- return e = +e, t >>>= 0, n || H(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
611
+ return e = +e, t >>>= 0, n || U(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
612
612
  }, u.prototype.writeInt16BE = function(e, t, n) {
613
- return e = +e, t >>>= 0, n || H(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
613
+ return e = +e, t >>>= 0, n || U(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
614
614
  }, u.prototype.writeInt32LE = function(e, t, n) {
615
- return e = +e, t >>>= 0, n || H(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
615
+ return e = +e, t >>>= 0, n || U(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
616
616
  }, u.prototype.writeInt32BE = function(e, t, n) {
617
- return e = +e, t >>>= 0, n || H(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
618
- }, u.prototype.writeBigInt64LE = Y(function(e, t = 0) {
617
+ return e = +e, t >>>= 0, n || U(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
618
+ }, u.prototype.writeBigInt64LE = X(function(e, t = 0) {
619
+ return ee(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
620
+ }), u.prototype.writeBigInt64BE = X(function(e, t = 0) {
619
621
  return te(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
620
- }), u.prototype.writeBigInt64BE = Y(function(e, t = 0) {
621
- return U(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
622
622
  });
623
- function ne(e, t, n, r, i, a) {
623
+ function W(e, t, n, r, i, a) {
624
624
  if (n + r > e.length || n < 0) throw RangeError("Index out of range");
625
625
  }
626
- function re(e, t, r, i, a) {
627
- return t = +t, r >>>= 0, a || ne(e, t, r, 4), n.write(e, t, r, i, 23, 4), r + 4;
626
+ function ne(e, t, r, i, a) {
627
+ return t = +t, r >>>= 0, a || W(e, t, r, 4), n.write(e, t, r, i, 23, 4), r + 4;
628
628
  }
629
629
  u.prototype.writeFloatLE = function(e, t, n) {
630
- return re(this, e, t, !0, n);
630
+ return ne(this, e, t, !0, n);
631
631
  }, u.prototype.writeFloatBE = function(e, t, n) {
632
- return re(this, e, t, !1, n);
632
+ return ne(this, e, t, !1, n);
633
633
  };
634
- function ie(e, t, r, i, a) {
635
- return t = +t, r >>>= 0, a || ne(e, t, r, 8), n.write(e, t, r, i, 52, 8), r + 8;
634
+ function re(e, t, r, i, a) {
635
+ return t = +t, r >>>= 0, a || W(e, t, r, 8), n.write(e, t, r, i, 52, 8), r + 8;
636
636
  }
637
637
  u.prototype.writeDoubleLE = function(e, t, n) {
638
- return ie(this, e, t, !0, n);
638
+ return re(this, e, t, !0, n);
639
639
  }, u.prototype.writeDoubleBE = function(e, t, n) {
640
- return ie(this, e, t, !1, n);
640
+ return re(this, e, t, !1, n);
641
641
  }, u.prototype.copy = function(e, t, n, r) {
642
642
  if (!u.isBuffer(e)) throw TypeError("argument should be a Buffer");
643
643
  if (n ||= 0, !r && r !== 0 && (r = this.length), t >= e.length && (t = e.length), t ||= 0, r > 0 && r < n && (r = n), r === n || e.length === 0 || this.length === 0) return 0;
@@ -668,9 +668,9 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
668
668
  }
669
669
  return this;
670
670
  };
671
- let W = {};
672
- function ae(e, t, n) {
673
- W[e] = class extends n {
671
+ let G = {};
672
+ function K(e, t, n) {
673
+ G[e] = class extends n {
674
674
  constructor() {
675
675
  super(), Object.defineProperty(this, "message", {
676
676
  value: t.apply(this, arguments),
@@ -694,42 +694,42 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
694
694
  }
695
695
  };
696
696
  }
697
- ae("ERR_BUFFER_OUT_OF_BOUNDS", function(e) {
697
+ K("ERR_BUFFER_OUT_OF_BOUNDS", function(e) {
698
698
  return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
699
- }, RangeError), ae("ERR_INVALID_ARG_TYPE", function(e, t) {
699
+ }, RangeError), K("ERR_INVALID_ARG_TYPE", function(e, t) {
700
700
  return `The "${e}" argument must be of type number. Received type ${typeof t}`;
701
- }, TypeError), ae("ERR_OUT_OF_RANGE", function(e, t, n) {
701
+ }, TypeError), K("ERR_OUT_OF_RANGE", function(e, t, n) {
702
702
  let r = `The value of "${e}" is out of range.`, i = n;
703
- return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i = oe(String(n)) : typeof n == "bigint" && (i = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (i = oe(i)), i += "n"), r += ` It must be ${t}. Received ${i}`, r;
703
+ return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i = ie(String(n)) : typeof n == "bigint" && (i = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (i = ie(i)), i += "n"), r += ` It must be ${t}. Received ${i}`, r;
704
704
  }, RangeError);
705
- function oe(e) {
705
+ function ie(e) {
706
706
  let t = "", n = e.length, r = +(e[0] === "-");
707
707
  for (; n >= r + 4; n -= 3) t = `_${e.slice(n - 3, n)}${t}`;
708
708
  return `${e.slice(0, n)}${t}`;
709
709
  }
710
- function G(e, t, n) {
711
- q(t, "offset"), (e[t] === void 0 || e[t + n] === void 0) && se(t, e.length - (n + 1));
710
+ function q(e, t, n) {
711
+ J(t, "offset"), (e[t] === void 0 || e[t + n] === void 0) && oe(t, e.length - (n + 1));
712
712
  }
713
- function K(e, t, n, r, i, a) {
713
+ function ae(e, t, n, r, i, a) {
714
714
  if (e > n || e < t) {
715
715
  let r = typeof t == "bigint" ? "n" : "", i;
716
- throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new W.ERR_OUT_OF_RANGE("value", i, e);
716
+ throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new G.ERR_OUT_OF_RANGE("value", i, e);
717
717
  }
718
- G(r, i, a);
718
+ q(r, i, a);
719
719
  }
720
- function q(e, t) {
721
- if (typeof e != "number") throw new W.ERR_INVALID_ARG_TYPE(t, "number", e);
720
+ function J(e, t) {
721
+ if (typeof e != "number") throw new G.ERR_INVALID_ARG_TYPE(t, "number", e);
722
722
  }
723
- function se(e, t, n) {
724
- throw Math.floor(e) === e ? t < 0 ? new W.ERR_BUFFER_OUT_OF_BOUNDS() : new W.ERR_OUT_OF_RANGE(n || "offset", `>= ${+!!n} and <= ${t}`, e) : (q(e, n), new W.ERR_OUT_OF_RANGE(n || "offset", "an integer", e));
723
+ function oe(e, t, n) {
724
+ throw Math.floor(e) === e ? t < 0 ? new G.ERR_BUFFER_OUT_OF_BOUNDS() : new G.ERR_OUT_OF_RANGE(n || "offset", `>= ${+!!n} and <= ${t}`, e) : (J(e, n), new G.ERR_OUT_OF_RANGE(n || "offset", "an integer", e));
725
725
  }
726
- let ce = /[^+/0-9A-Za-z-_]/g;
727
- function le(e) {
728
- if (e = e.split("=")[0], e = e.trim().replace(ce, ""), e.length < 2) return "";
726
+ let se = /[^+/0-9A-Za-z-_]/g;
727
+ function ce(e) {
728
+ if (e = e.split("=")[0], e = e.trim().replace(se, ""), e.length < 2) return "";
729
729
  for (; e.length % 4 != 0;) e += "=";
730
730
  return e;
731
731
  }
732
- function ue(e, t) {
732
+ function le(e, t) {
733
733
  t ||= Infinity;
734
734
  let n, r = e.length, i = null, a = [];
735
735
  for (let o = 0; o < r; ++o) {
@@ -767,31 +767,31 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
767
767
  }
768
768
  return a;
769
769
  }
770
- function de(e) {
770
+ function ue(e) {
771
771
  let t = [];
772
772
  for (let n = 0; n < e.length; ++n) t.push(e.charCodeAt(n) & 255);
773
773
  return t;
774
774
  }
775
- function fe(e, t) {
775
+ function de(e, t) {
776
776
  let n, r, i, a = [];
777
777
  for (let o = 0; o < e.length && !((t -= 2) < 0); ++o) n = e.charCodeAt(o), r = n >> 8, i = n % 256, a.push(i), a.push(r);
778
778
  return a;
779
779
  }
780
- function pe(e) {
781
- return t.toByteArray(le(e));
780
+ function fe(e) {
781
+ return t.toByteArray(ce(e));
782
782
  }
783
- function me(e, t, n, r) {
783
+ function pe(e, t, n, r) {
784
784
  let i;
785
785
  for (i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i];
786
786
  return i;
787
787
  }
788
- function J(e, t) {
788
+ function Y(e, t) {
789
789
  return e instanceof t || e != null && e.constructor != null && e.constructor.name != null && e.constructor.name === t.name;
790
790
  }
791
- function he(e) {
791
+ function me(e) {
792
792
  return e !== e;
793
793
  }
794
- let ge = (function() {
794
+ let he = (function() {
795
795
  let e = "0123456789abcdef", t = Array(256);
796
796
  for (let n = 0; n < 16; ++n) {
797
797
  let r = n * 16;
@@ -799,10 +799,10 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
799
799
  }
800
800
  return t;
801
801
  })();
802
- function Y(e) {
803
- return typeof BigInt > "u" ? _e : e;
802
+ function X(e) {
803
+ return typeof BigInt > "u" ? ge : e;
804
804
  }
805
- function _e() {
805
+ function ge() {
806
806
  throw Error("BigInt not supported");
807
807
  }
808
808
  })(u), y = u.Buffer, u.Blob, u.BlobOptions, u.Buffer, u.File, u.FileOptions, u.INSPECT_MAX_BYTES, u.SlowBuffer, u.TranscodeEncoding, u.atob, u.btoa, u.constants, u.isAscii, u.isUtf8, u.kMaxLength, u.kStringMaxLength, u.resolveObjectURL, u.transcode;
@@ -937,7 +937,7 @@ function k(e, t) {
937
937
  this.fun = e, this.array = t;
938
938
  }
939
939
  function A() {}
940
- var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
940
+ var j, M, N, P, F, I, L, R, z, B, V = e((() => {
941
941
  j = { exports: {} }, M = j.exports = {}, (function() {
942
942
  try {
943
943
  N = typeof setTimeout == "function" ? setTimeout : C;
@@ -965,8 +965,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
965
965
  throw Error("process.chdir is not supported");
966
966
  }, M.umask = function() {
967
967
  return 0;
968
- }, ee = j.exports, z = /* @__PURE__ */ S(ee);
969
- })), V = /* @__PURE__ */ t(((e, t) => {
968
+ }, z = j.exports, B = /* @__PURE__ */ S(z);
969
+ })), H = /* @__PURE__ */ t(((e, t) => {
970
970
  var n = typeof Reflect == "object" ? Reflect : null, r = n && typeof n.apply == "function" ? n.apply : function(e, t, n) {
971
971
  return Function.prototype.apply.call(e, t, n);
972
972
  }, i = n && typeof n.ownKeys == "function" ? n.ownKeys : Object.getOwnPropertySymbols ? function(e) {
@@ -1141,7 +1141,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1141
1141
  });
1142
1142
  else throw TypeError("The \"emitter\" argument must be of type EventEmitter. Received type " + typeof e);
1143
1143
  }
1144
- })), H = /* @__PURE__ */ t(((e, t) => {
1144
+ })), U = /* @__PURE__ */ t(((e, t) => {
1145
1145
  var n = ["out", "err"];
1146
1146
  t.exports = class {
1147
1147
  constructor(e, t) {
@@ -1149,8 +1149,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1149
1149
  this.type = e, this.string = t;
1150
1150
  }
1151
1151
  };
1152
- })), te = /* @__PURE__ */ t(((e, t) => {
1153
- var n = H();
1152
+ })), ee = /* @__PURE__ */ t(((e, t) => {
1153
+ var n = U();
1154
1154
  t.exports = class {
1155
1155
  constructor(e = [], t = 0) {
1156
1156
  if (typeof t != "number") throw Error("Command Result ExitCode must be a number");
@@ -1174,11 +1174,140 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1174
1174
  return this.std = [], e;
1175
1175
  }
1176
1176
  };
1177
- })), U = /* @__PURE__ */ t(((e, t) => {
1178
- var n = V(), r = te(), i = n.EventEmitter || n.default || n;
1179
- t.exports = class extends i {
1177
+ })), te = /* @__PURE__ */ t(((e, t) => {
1178
+ b();
1179
+ var n = H(), r = n.EventEmitter || n.default || n;
1180
+ function i(e) {
1181
+ if (!e) return [];
1182
+ let t = typeof e == "string" ? e : e instanceof Uint8Array || y !== void 0 && y.isBuffer(e) ? new TextDecoder().decode(e) : String(e), n = [], r = 0;
1183
+ for (; r < t.length;) {
1184
+ let e = t[r], i = t.charCodeAt(r);
1185
+ if (i === 27) {
1186
+ if (t.charCodeAt(r + 1) === 127 || t.charCodeAt(r + 1) === 8) {
1187
+ n.push("^W"), r += 2;
1188
+ continue;
1189
+ }
1190
+ if (t[r + 1] === "[" || t[r + 1] === "O") {
1191
+ let e = r + 2;
1192
+ for (; e < t.length && t.charCodeAt(e) >= 32 && t.charCodeAt(e) <= 63;) e++;
1193
+ if (e < t.length) {
1194
+ let i = t.slice(r + 2, e + 1), a = {
1195
+ A: "ArrowUp",
1196
+ B: "ArrowDown",
1197
+ C: "ArrowRight",
1198
+ D: "ArrowLeft",
1199
+ H: "Home",
1200
+ F: "End",
1201
+ "1~": "Home",
1202
+ "3~": "Delete",
1203
+ "4~": "End",
1204
+ "5~": "PageUp",
1205
+ "6~": "PageDown",
1206
+ "7~": "Home",
1207
+ "8~": "End"
1208
+ };
1209
+ a[i] && n.push(a[i]), r = e + 1;
1210
+ continue;
1211
+ }
1212
+ }
1213
+ n.push("Escape"), r++;
1214
+ continue;
1215
+ }
1216
+ if (i === 13 || i === 10) {
1217
+ n.push("Enter"), i === 13 && t[r + 1] === "\n" && r++, r++;
1218
+ continue;
1219
+ }
1220
+ if (i === 127 || i === 8) {
1221
+ n.push("Backspace"), r++;
1222
+ continue;
1223
+ }
1224
+ if (i === 9) {
1225
+ n.push("Tab"), r++;
1226
+ continue;
1227
+ }
1228
+ if (i >= 1 && i <= 26) {
1229
+ n.push("^" + String.fromCharCode(i + 64)), r++;
1230
+ continue;
1231
+ }
1232
+ n.push(e), r++;
1233
+ }
1234
+ return n;
1235
+ }
1236
+ t.exports = {
1237
+ TtyStream: class extends r {
1238
+ constructor(e = {}) {
1239
+ super(), this.isTTY = e.isTTY !== !1, this.readable = !0, this.writable = !0, this.columns = e.columns || 80, this.rows = e.rows || 24, this.isRaw = !1, this._encoding = null, this._onWrite = e.onWrite || null;
1240
+ }
1241
+ write(e, t, n) {
1242
+ return e == null ? !0 : (typeof this._onWrite == "function" && this._onWrite(e), this.emit("data", this._formatChunk(e)), typeof t == "function" ? t() : typeof n == "function" && n(), !0);
1243
+ }
1244
+ pushData(e) {
1245
+ e != null && this.emit("data", this._formatChunk(e));
1246
+ }
1247
+ _formatChunk(e) {
1248
+ return this._encoding ? typeof e == "string" ? e : e instanceof Uint8Array || y !== void 0 && y.isBuffer(e) ? new TextDecoder().decode(e) : String(e) : e;
1249
+ }
1250
+ setRawMode(e) {
1251
+ return this.isRaw = !!e, this;
1252
+ }
1253
+ setEncoding(e) {
1254
+ return this._encoding = e, this;
1255
+ }
1256
+ getWindowSize() {
1257
+ return [this.columns, this.rows];
1258
+ }
1259
+ resize(e, t) {
1260
+ this.columns = e, this.rows = t, this.emit("resize");
1261
+ }
1262
+ resume() {
1263
+ return this;
1264
+ }
1265
+ pause() {
1266
+ return this;
1267
+ }
1268
+ pipe(e) {
1269
+ return this.on("data", (t) => e.write(t)), e;
1270
+ }
1271
+ unpipe() {
1272
+ return this;
1273
+ }
1274
+ end(e, t, n) {
1275
+ return e != null && this.write(e, typeof t == "string" ? t : void 0), this.emit("end"), typeof t == "function" ? t() : typeof n == "function" && n(), this;
1276
+ }
1277
+ destroy() {
1278
+ this.removeAllListeners();
1279
+ }
1280
+ toString() {
1281
+ return "";
1282
+ }
1283
+ valueOf() {
1284
+ return "";
1285
+ }
1286
+ },
1287
+ parseVtKeys: i
1288
+ };
1289
+ })), W = /* @__PURE__ */ t(((e, t) => {
1290
+ var n = H(), r = ee(), { TtyStream: i, parseVtKeys: a } = te(), o = n.EventEmitter || n.default || n;
1291
+ t.exports = class extends o {
1180
1292
  constructor(e, t) {
1181
1293
  super(), this.arguments = e, this.result = new r(), this.context = t || null;
1294
+ let n = this.context && typeof this.context.getVar == "function" && parseInt(this.context.getVar("COLUMNS"), 10) || 80, o = this.context && typeof this.context.getVar == "function" && parseInt(this.context.getVar("LINES"), 10) || 24;
1295
+ this.stdinStream = new i({
1296
+ columns: n,
1297
+ rows: o
1298
+ }), this.stdin = this.stdinStream, this.stdout = new i({
1299
+ columns: n,
1300
+ rows: o,
1301
+ onWrite: (e) => this.emit("stdout", e)
1302
+ }), this.stderr = new i({
1303
+ columns: n,
1304
+ rows: o,
1305
+ onWrite: (e) => this.emit("stderr", e)
1306
+ }), this.stdinStream.on("data", (e) => {
1307
+ if (!this.captureInput) return;
1308
+ let t = a(e);
1309
+ for (let e of t) !this.interactive && !this.stdinStream.isRaw && (e === "Enter" ? this.stdout.write("\r\n") : e === "Backspace" ? this.stdout.write("\b \b") : e.length === 1 && this.stdout.write(e)), this.onInput(e);
1310
+ });
1182
1311
  }
1183
1312
  get name() {
1184
1313
  return "unnamed";
@@ -1207,7 +1336,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1207
1336
  }
1208
1337
  };
1209
1338
  })), ne = /* @__PURE__ */ t(((e, t) => {
1210
- var n = U();
1339
+ var n = W();
1211
1340
  t.exports = class extends n {
1212
1341
  get captureInput() {
1213
1342
  return !0;
@@ -1216,14 +1345,28 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1216
1345
  return !0;
1217
1346
  }
1218
1347
  get terminalSize() {
1219
- return {
1348
+ return this.stdout && this.stdout.columns && this.stdout.rows ? {
1349
+ cols: parseInt(this.context && this.context.getVar && this.context.getVar("COLUMNS"), 10) || this.stdout.columns || 80,
1350
+ rows: parseInt(this.context && this.context.getVar && this.context.getVar("LINES"), 10) || this.stdout.rows || 24
1351
+ } : {
1220
1352
  cols: parseInt(this.context.getVar("COLUMNS"), 10) || 80,
1221
1353
  rows: parseInt(this.context.getVar("LINES"), 10) || 24
1222
1354
  };
1223
1355
  }
1356
+ _enterAltScreen() {
1357
+ this._inAltScreen || (this._inAltScreen = !0, this.stdinStream && this.stdinStream.setRawMode(!0), this.stdout && this.stdout.write("\x1B[?1049h\x1B[2J\x1B[H"));
1358
+ }
1359
+ _exitAltScreen() {
1360
+ this._inAltScreen && (this._inAltScreen = !1, this.stdinStream && this.stdinStream.setRawMode(!1), this.stdout && this.stdout.write("\x1B[?1049l\x1B[?25h"));
1361
+ }
1362
+ runCommand() {
1363
+ return this.interactive && this._enterAltScreen(), super.runCommand().finally(() => {
1364
+ this._exitAltScreen();
1365
+ });
1366
+ }
1224
1367
  };
1225
1368
  })), re = /* @__PURE__ */ t(((e, t) => {
1226
- b(), B();
1369
+ b(), V();
1227
1370
  var { BinaryFile: n, SymlinkRef: r } = x(), i = new Uint8Array([
1228
1371
  66,
1229
1372
  82,
@@ -1328,7 +1471,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1328
1471
  let t = e.$c;
1329
1472
  if (m[t]) return m[t];
1330
1473
  if (f.inlineCommands && f.inlineCommands[t]) try {
1331
- let e = U(), n = ne();
1474
+ let e = W(), n = ne();
1332
1475
  return Function("Command", "InteractiveCommand", `return (${f.inlineCommands[t]});`)(e, n);
1333
1476
  } catch {
1334
1477
  return null;
@@ -1360,8 +1503,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1360
1503
  let t = new DecompressionStream("gzip"), n = new Blob([e]).stream().pipeThrough(t), r = await new Response(n).arrayBuffer();
1361
1504
  return new Uint8Array(r);
1362
1505
  }
1363
- if (z !== void 0 && typeof z.getBuiltinModule == "function") {
1364
- let t = z.getBuiltinModule("zlib");
1506
+ if (B !== void 0 && typeof B.getBuiltinModule == "function") {
1507
+ let t = B.getBuiltinModule("zlib");
1365
1508
  if (t) return new Uint8Array(t.gunzipSync(y.from(e.buffer, e.byteOffset, e.byteLength)));
1366
1509
  }
1367
1510
  throw Error("Gzip decompression is not supported in this environment");
@@ -1380,8 +1523,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1380
1523
  return f(new Uint8Array(n), t);
1381
1524
  }
1382
1525
  if (typeof e == "string") {
1383
- if (!/^https?:\/\//i.test(e) && z !== void 0 && typeof z.getBuiltinModule == "function" && typeof window > "u") try {
1384
- let n = z.getBuiltinModule("fs");
1526
+ if (!/^https?:\/\//i.test(e) && B !== void 0 && typeof B.getBuiltinModule == "function" && typeof window > "u") try {
1527
+ let n = B.getBuiltinModule("fs");
1385
1528
  if (n && n.existsSync(e)) {
1386
1529
  let r = await n.promises.readFile(e);
1387
1530
  return f(new Uint8Array(r.buffer, r.byteOffset, r.byteLength), t);
@@ -1493,7 +1636,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1493
1636
  }
1494
1637
  }
1495
1638
  };
1496
- })), ie = /* @__PURE__ */ t(((e, t) => {
1639
+ })), G = /* @__PURE__ */ t(((e, t) => {
1497
1640
  b();
1498
1641
  var n = x(), { BinaryFile: r, SymlinkRef: i } = n;
1499
1642
  function a(e) {
@@ -1709,10 +1852,10 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1709
1852
  return null;
1710
1853
  }
1711
1854
  }, t.exports.BinaryFile = r, t.exports.SymlinkRef = i;
1712
- })), W = /* @__PURE__ */ t(((e, t) => {
1855
+ })), K = /* @__PURE__ */ t(((e, t) => {
1713
1856
  t.exports = null;
1714
- })), ae = /* @__PURE__ */ t(((e, t) => {
1715
- B();
1857
+ })), ie = /* @__PURE__ */ t(((e, t) => {
1858
+ V();
1716
1859
  function n(e) {
1717
1860
  if (typeof e != "string") throw TypeError("Path must be a string. Received " + JSON.stringify(e));
1718
1861
  }
@@ -1750,7 +1893,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1750
1893
  resolve: function() {
1751
1894
  for (var e = "", t = !1, i, a = arguments.length - 1; a >= -1 && !t; a--) {
1752
1895
  var o;
1753
- a >= 0 ? o = arguments[a] : (i === void 0 && (i = z.cwd()), o = i), n(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
1896
+ a >= 0 ? o = arguments[a] : (i === void 0 && (i = B.cwd()), o = i), n(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
1754
1897
  }
1755
1898
  return e = r(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
1756
1899
  },
@@ -1879,12 +2022,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
1879
2022
  posix: null
1880
2023
  };
1881
2024
  a.posix = a, t.exports = a;
1882
- })), oe = /* @__PURE__ */ t(((e, t) => {
1883
- B();
1884
- var n = W(), r = ae(), i = x();
2025
+ })), q = /* @__PURE__ */ t(((e, t) => {
2026
+ V();
2027
+ var n = K(), r = ie(), i = x();
1885
2028
  t.exports = class extends i {
1886
2029
  constructor(e, t = null) {
1887
- super(), this._onChange = t, this._changeScheduled = !1, this._virtualFiles = {}, this.cwd = this._normalizeCwd(e || z.cwd());
2030
+ super(), this._onChange = t, this._changeScheduled = !1, this._virtualFiles = {}, this.cwd = this._normalizeCwd(e || B.cwd());
1888
2031
  }
1889
2032
  get isRealFilesystem() {
1890
2033
  return !0;
@@ -2088,8 +2231,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2088
2231
  }
2089
2232
  }
2090
2233
  };
2091
- })), G = /* @__PURE__ */ t(((e, t) => {
2092
- var n = ie();
2234
+ })), ae = /* @__PURE__ */ t(((e, t) => {
2235
+ var n = G();
2093
2236
  t.exports = class {
2094
2237
  constructor(e) {
2095
2238
  this.options = e;
@@ -2123,7 +2266,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2123
2266
  return this.fs._getFileRaw(t) || null;
2124
2267
  }
2125
2268
  setNodeFilesystem(e) {
2126
- let t = oe(), n = this.fs._onChange;
2269
+ let t = q(), n = this.fs._onChange;
2127
2270
  this.fs = new t(e, n);
2128
2271
  }
2129
2272
  setFilesystem(e, t = {}) {
@@ -2143,15 +2286,15 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2143
2286
  typeof this._destroyFn == "function" && this._destroyFn(e);
2144
2287
  }
2145
2288
  };
2146
- })), K = /* @__PURE__ */ t(((e, t) => {
2147
- var n = U();
2289
+ })), J = /* @__PURE__ */ t(((e, t) => {
2290
+ var n = W();
2148
2291
  t.exports = class extends n {
2149
2292
  constructor(e, t) {
2150
2293
  super(e, t);
2151
2294
  }
2152
2295
  };
2153
- })), q = /* @__PURE__ */ t(((e, t) => {
2154
- var n = K();
2296
+ })), oe = /* @__PURE__ */ t(((e, t) => {
2297
+ var n = J();
2155
2298
  function r(e) {
2156
2299
  return /^#!\/(sh\.js|bin\/(sh|brsh))/.test(e);
2157
2300
  }
@@ -2316,7 +2459,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2316
2459
  }
2317
2460
  _executeNode(e) {
2318
2461
  if (e.type === "function") {
2319
- let t = e.name, n = e.bodyLines, r = this, i = K(), a = class extends i {
2462
+ let t = e.name, n = e.bodyLines, r = this, i = J(), a = class extends i {
2320
2463
  static get name() {
2321
2464
  return t;
2322
2465
  }
@@ -2518,7 +2661,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2518
2661
  }, t.exports.isKnownInterpreter = r;
2519
2662
  })), se = /* @__PURE__ */ t(((e, t) => {
2520
2663
  b();
2521
- var n = q(), { BinaryFile: r } = ie(), i = 0, a = 8, o = 20, s = 28, c = 31, l = 44, u = 54, d = 70, f = 0, p = 2, m = 3, h = 4, g = 1, _ = 2, v = 4, x = 8, S = 1, C = class extends n {
2664
+ var n = oe(), { BinaryFile: r } = G(), i = 0, a = 8, o = 20, s = 28, c = 31, l = 44, u = 54, d = 70, f = 0, p = 2, m = 3, h = 4, g = 1, _ = 2, v = 4, x = 8, S = 1, C = class extends n {
2522
2665
  get name() {
2523
2666
  return "wasm";
2524
2667
  }
@@ -2528,7 +2671,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2528
2671
  run() {
2529
2672
  let e = this.script, t = (() => {
2530
2673
  try {
2531
- return W();
2674
+ return K();
2532
2675
  } catch {
2533
2676
  return null;
2534
2677
  }
@@ -2594,29 +2737,29 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2594
2737
  let t = {
2595
2738
  1: "",
2596
2739
  2: ""
2597
- }, n = new TextDecoder(), y = new TextEncoder(), b = null, C = (e, n) => {
2740
+ }, n = new TextDecoder(), b = new TextEncoder(), C = null, w = (e, n) => {
2598
2741
  t[e] = (t[e] || "") + n;
2599
2742
  let r = t[e].split("\n");
2600
2743
  t[e] = r.pop();
2601
2744
  for (let t of r) e === 1 ? this.stdOut = t : this.stdErr = t;
2602
- }, w = () => {
2745
+ }, T = () => {
2603
2746
  t[1] &&= (this.stdOut = t[1], ""), t[2] &&= (this.stdErr = t[2], "");
2604
- }, T = y.encode(this.stdin || ""), E = 0, D = this.context && this.context.fs ? this.context.fs : this.fs, O = 5, j = new Map([[3, {
2747
+ }, E = typeof this.stdin == "string" ? b.encode(this.stdin) : this.stdin instanceof Uint8Array ? this.stdin : y !== void 0 && y.isBuffer(this.stdin) ? new Uint8Array(this.stdin) : new Uint8Array(), D = 0, O = this.context && this.context.fs ? this.context.fs : this.fs, j = 5, M = new Map([[3, {
2605
2748
  type: "preopen",
2606
2749
  path: "/",
2607
2750
  guestName: "/"
2608
2751
  }], [4, {
2609
2752
  type: "preopen",
2610
- path: D && D.cwd || "/",
2753
+ path: O && O.cwd || "/",
2611
2754
  guestName: "."
2612
- }]]), M = (e, t) => {
2613
- let n = j.get(e);
2755
+ }]]), N = (e, t) => {
2756
+ let n = M.get(e);
2614
2757
  if (!n || n.type !== "preopen" && n.type !== "dir") return null;
2615
- if (t.startsWith("/")) return D.absolutePath(t);
2758
+ if (t.startsWith("/")) return O.absolutePath(t);
2616
2759
  let r = n.path.endsWith("/") ? n.path : n.path + "/";
2617
- return D.absolutePath(r + t);
2618
- }, N = (e) => {
2619
- if (!(!e || e.type !== "file" || !e.dirty || !D)) try {
2760
+ return O.absolutePath(r + t);
2761
+ }, P = (e) => {
2762
+ if (!(!e || e.type !== "file" || !e.dirty || !O)) try {
2620
2763
  let t = !0;
2621
2764
  for (let n = 0; n < e.bytes.length; n++) if (e.bytes[n] === 0) {
2622
2765
  t = !1;
@@ -2624,32 +2767,32 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2624
2767
  }
2625
2768
  if (t) {
2626
2769
  let t = n.decode(e.bytes);
2627
- D.setFileByPath(e.path, t, !0);
2770
+ O.setFileByPath(e.path, t, !0);
2628
2771
  } else {
2629
2772
  let t = new Uint8Array(e.bytes.length);
2630
- t.set(e.bytes), D.setFileByPath(e.path, new r(t.buffer, "application/octet-stream"), !0);
2773
+ t.set(e.bytes), O.setFileByPath(e.path, new r(t.buffer, "application/octet-stream"), !0);
2631
2774
  }
2632
2775
  e.dirty = !1;
2633
2776
  } catch {}
2634
- }, P = Object.entries(this.context && this.context.vars || {}).map(([e, t]) => `${e}=${t}`), F = new Proxy({
2777
+ }, F = Object.entries(this.context && this.context.vars || {}).map(([e, t]) => `${e}=${t}`), I = new Proxy({
2635
2778
  fd_write: (e, t, r, o) => {
2636
- if (!b) return a;
2637
- let s = new DataView(b.buffer);
2779
+ if (!C) return a;
2780
+ let s = new DataView(C.buffer);
2638
2781
  if (e === 1 || e === 2) {
2639
2782
  let a = 0;
2640
2783
  for (let i = 0; i < r; i++) {
2641
2784
  let r = s.getUint32(t + i * 8, !0), o = s.getUint32(t + i * 8 + 4, !0);
2642
- o > 0 && C(e, n.decode(new Uint8Array(b.buffer, r, o))), a += o;
2785
+ o > 0 && w(e, n.decode(new Uint8Array(C.buffer, r, o))), a += o;
2643
2786
  }
2644
2787
  return s.setUint32(o, a, !0), i;
2645
2788
  }
2646
- let c = j.get(e);
2789
+ let c = M.get(e);
2647
2790
  if (!c || c.type !== "file") return a;
2648
2791
  let l = 0;
2649
2792
  for (let e = 0; e < r; e++) {
2650
2793
  let n = s.getUint32(t + e * 8, !0), r = s.getUint32(t + e * 8 + 4, !0);
2651
2794
  if (r > 0) {
2652
- let e = new Uint8Array(b.buffer, n, r), t = c.append ? c.bytes.length : c.pos, i = t + r;
2795
+ let e = new Uint8Array(C.buffer, n, r), t = c.append ? c.bytes.length : c.pos, i = t + r;
2653
2796
  if (i > c.bytes.length) {
2654
2797
  let e = new Uint8Array(i);
2655
2798
  e.set(c.bytes), c.bytes = e;
@@ -2660,29 +2803,29 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2660
2803
  return s.setUint32(o, l, !0), i;
2661
2804
  },
2662
2805
  fd_read: (e, t, n, r) => {
2663
- if (!b) return a;
2664
- let o = new DataView(b.buffer);
2806
+ if (!C) return a;
2807
+ let o = new DataView(C.buffer);
2665
2808
  if (e === 0) {
2666
2809
  let e = 0;
2667
- for (let r = 0; r < n && E < T.length; r++) {
2668
- let n = o.getUint32(t + r * 8, !0), i = o.getUint32(t + r * 8 + 4, !0), a = Math.min(i, T.length - E);
2669
- new Uint8Array(b.buffer).set(T.slice(E, E + a), n), E += a, e += a;
2810
+ for (let r = 0; r < n && D < E.length; r++) {
2811
+ let n = o.getUint32(t + r * 8, !0), i = o.getUint32(t + r * 8 + 4, !0), a = Math.min(i, E.length - D);
2812
+ new Uint8Array(C.buffer).set(E.slice(D, D + a), n), D += a, e += a;
2670
2813
  }
2671
2814
  return o.setUint32(r, e, !0), i;
2672
2815
  }
2673
- let s = j.get(e);
2816
+ let s = M.get(e);
2674
2817
  if (!s || s.type !== "file") return a;
2675
2818
  let c = 0;
2676
2819
  for (let e = 0; e < n && s.pos < s.bytes.length; e++) {
2677
2820
  let n = o.getUint32(t + e * 8, !0), r = o.getUint32(t + e * 8 + 4, !0), i = Math.min(r, s.bytes.length - s.pos);
2678
- new Uint8Array(b.buffer).set(s.bytes.subarray(s.pos, s.pos + i), n), s.pos += i, c += i;
2821
+ new Uint8Array(C.buffer).set(s.bytes.subarray(s.pos, s.pos + i), n), s.pos += i, c += i;
2679
2822
  }
2680
2823
  return o.setUint32(r, c, !0), i;
2681
2824
  },
2682
2825
  fd_seek: (e, t, n, r, o) => {
2683
- if (!b) return a;
2826
+ if (!C) return a;
2684
2827
  if (e <= 2) return d;
2685
- let c = j.get(e);
2828
+ let c = M.get(e);
2686
2829
  if (!c || c.type !== "file") return a;
2687
2830
  let l, u, f;
2688
2831
  typeof t == "bigint" ? (l = Number(t), u = n, f = r) : (l = t, u = r, f = o);
@@ -2691,46 +2834,46 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2691
2834
  else if (u === 1) p = c.pos + l;
2692
2835
  else if (u === 2) p = c.bytes.length + l;
2693
2836
  else return s;
2694
- return p < 0 ? s : (c.pos = p, f && new DataView(b.buffer).setBigUint64(f, BigInt(c.pos), !0), i);
2837
+ return p < 0 ? s : (c.pos = p, f && new DataView(C.buffer).setBigUint64(f, BigInt(c.pos), !0), i);
2695
2838
  },
2696
2839
  fd_tell: (e, t) => {
2697
- if (!b) return a;
2698
- let n = j.get(e);
2699
- return !n || n.type !== "file" ? a : (new DataView(b.buffer).setBigUint64(t, BigInt(n.pos), !0), i);
2840
+ if (!C) return a;
2841
+ let n = M.get(e);
2842
+ return !n || n.type !== "file" ? a : (new DataView(C.buffer).setBigUint64(t, BigInt(n.pos), !0), i);
2700
2843
  },
2701
2844
  fd_close: (e) => {
2702
2845
  if (e <= 2) return i;
2703
- let t = j.get(e);
2704
- return t ? (N(t), j.delete(e), i) : a;
2846
+ let t = M.get(e);
2847
+ return t ? (P(t), M.delete(e), i) : a;
2705
2848
  },
2706
2849
  fd_sync: (e) => {
2707
- let t = j.get(e);
2708
- return t && N(t), i;
2850
+ let t = M.get(e);
2851
+ return t && P(t), i;
2709
2852
  },
2710
2853
  fd_datasync: (e) => {
2711
- let t = j.get(e);
2712
- return t && N(t), i;
2854
+ let t = M.get(e);
2855
+ return t && P(t), i;
2713
2856
  },
2714
2857
  fd_prestat_get: (e, t) => {
2715
- if (!b) return a;
2716
- let n = j.get(e);
2858
+ if (!C) return a;
2859
+ let n = M.get(e);
2717
2860
  if (!n || n.type !== "preopen") return a;
2718
- let r = new DataView(b.buffer), o = y.encode(n.guestName);
2861
+ let r = new DataView(C.buffer), o = b.encode(n.guestName);
2719
2862
  return r.setUint8(t, 0), r.setUint32(t + 4, o.length, !0), i;
2720
2863
  },
2721
2864
  fd_prestat_dir_name: (e, t, n) => {
2722
- if (!b) return a;
2723
- let r = j.get(e);
2865
+ if (!C) return a;
2866
+ let r = M.get(e);
2724
2867
  if (!r || r.type !== "preopen") return a;
2725
- let o = y.encode(r.guestName);
2726
- return new Uint8Array(b.buffer, t, Math.min(n, o.length)).set(o.subarray(0, n)), i;
2868
+ let o = b.encode(r.guestName);
2869
+ return new Uint8Array(C.buffer, t, Math.min(n, o.length)).set(o.subarray(0, n)), i;
2727
2870
  },
2728
2871
  fd_fdstat_get: (e, t) => {
2729
- if (!b) return a;
2730
- let n = new DataView(b.buffer), r = f;
2872
+ if (!C) return a;
2873
+ let n = new DataView(C.buffer), r = f;
2731
2874
  if (e <= 2) r = p;
2732
2875
  else {
2733
- let t = j.get(e);
2876
+ let t = M.get(e);
2734
2877
  if (!t) return a;
2735
2878
  r = t.type === "preopen" || t.type === "dir" ? m : h;
2736
2879
  }
@@ -2739,83 +2882,83 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2739
2882
  },
2740
2883
  fd_fdstat_set_flags: () => i,
2741
2884
  fd_filestat_get: (e, t) => {
2742
- if (!b) return a;
2743
- let n = new DataView(b.buffer);
2885
+ if (!C) return a;
2886
+ let n = new DataView(C.buffer);
2744
2887
  for (let e = 0; e < 64; e++) n.setUint8(t + e, 0);
2745
2888
  if (e <= 2) return n.setUint8(t + 16, p), i;
2746
- let r = j.get(e);
2889
+ let r = M.get(e);
2747
2890
  if (!r) return a;
2748
2891
  let o = r.type === "preopen" || r.type === "dir";
2749
2892
  return n.setUint8(t + 16, o ? m : h), n.setBigUint64(t + 24, 1n, !0), n.setBigUint64(t + 32, BigInt(r.bytes ? r.bytes.length : 0), !0), i;
2750
2893
  },
2751
2894
  path_open: (e, t, r, s, d, f, p, m, h) => {
2752
- if (!b || !D) return a;
2753
- let C = M(e, n.decode(new Uint8Array(b.buffer, r, s)));
2754
- if (!C) return a;
2755
- let w = D.stat(C), T = w !== null;
2895
+ if (!C || !O) return a;
2896
+ let y = N(e, n.decode(new Uint8Array(C.buffer, r, s)));
2897
+ if (!y) return a;
2898
+ let w = O.stat(y), T = w !== null;
2756
2899
  if (d & v && d & g && T) return o;
2757
2900
  if (d & _) {
2758
2901
  if (!T) return l;
2759
2902
  if (!w.isDirectory) return u;
2760
- let e = O++;
2761
- return j.set(e, {
2903
+ let e = j++;
2904
+ return M.set(e, {
2762
2905
  type: "dir",
2763
- path: C
2764
- }), new DataView(b.buffer).setUint32(h, e, !0), i;
2906
+ path: y
2907
+ }), new DataView(C.buffer).setUint32(h, e, !0), i;
2765
2908
  }
2766
2909
  if (T && w.isDirectory) return c;
2767
2910
  if (!T && !(d & g)) return l;
2768
- let E = new Uint8Array(), k = !1;
2911
+ let E = new Uint8Array(), D = !1;
2769
2912
  if (T && !(d & x)) {
2770
- let e = D.getFileByPath(C);
2771
- e != null && (E = typeof e == "string" ? y.encode(e) : new Uint8Array(this._contentToBytes(e)));
2772
- } else k = !0;
2773
- let A = O++;
2774
- return j.set(A, {
2913
+ let e = O.getFileByPath(y);
2914
+ e != null && (E = typeof e == "string" ? b.encode(e) : new Uint8Array(this._contentToBytes(e)));
2915
+ } else D = !0;
2916
+ let k = j++;
2917
+ return M.set(k, {
2775
2918
  type: "file",
2776
- path: C,
2919
+ path: y,
2777
2920
  bytes: E,
2778
2921
  pos: m & S ? E.length : 0,
2779
2922
  append: !!(m & S),
2780
- dirty: k
2781
- }), new DataView(b.buffer).setUint32(h, A, !0), i;
2923
+ dirty: D
2924
+ }), new DataView(C.buffer).setUint32(h, k, !0), i;
2782
2925
  },
2783
2926
  path_filestat_get: (e, t, r, o, s) => {
2784
- if (!b || !D) return a;
2785
- let c = M(e, n.decode(new Uint8Array(b.buffer, r, o)));
2927
+ if (!C || !O) return a;
2928
+ let c = N(e, n.decode(new Uint8Array(C.buffer, r, o)));
2786
2929
  if (!c) return a;
2787
- let u = D.stat(c);
2930
+ let u = O.stat(c);
2788
2931
  if (!u) return l;
2789
- let d = new DataView(b.buffer);
2932
+ let d = new DataView(C.buffer);
2790
2933
  for (let e = 0; e < 64; e++) d.setUint8(s + e, 0);
2791
- return d.setUint8(s + 16, u.isDirectory ? m : h), d.setBigUint64(s + 24, 1n, !0), d.setBigUint64(s + 32, BigInt(D.getSize(c) || 0), !0), i;
2934
+ return d.setUint8(s + 16, u.isDirectory ? m : h), d.setBigUint64(s + 24, 1n, !0), d.setBigUint64(s + 32, BigInt(O.getSize(c) || 0), !0), i;
2792
2935
  },
2793
2936
  path_create_directory: (e, t, r) => {
2794
- if (!b || !D) return a;
2795
- let o = M(e, n.decode(new Uint8Array(b.buffer, t, r)));
2937
+ if (!C || !O) return a;
2938
+ let o = N(e, n.decode(new Uint8Array(C.buffer, t, r)));
2796
2939
  if (!o) return a;
2797
2940
  try {
2798
- return D.setFileByPath(o, {}, !0), i;
2941
+ return O.setFileByPath(o, {}, !0), i;
2799
2942
  } catch {
2800
2943
  return s;
2801
2944
  }
2802
2945
  },
2803
2946
  path_unlink_file: (e, t, r) => {
2804
- if (!b || !D) return a;
2805
- let o = M(e, n.decode(new Uint8Array(b.buffer, t, r)));
2806
- if (!o || !D.exists(o)) return l;
2947
+ if (!C || !O) return a;
2948
+ let o = N(e, n.decode(new Uint8Array(C.buffer, t, r)));
2949
+ if (!o || !O.exists(o)) return l;
2807
2950
  try {
2808
- return D.deleteFileByPath(o), i;
2951
+ return O.deleteFileByPath(o), i;
2809
2952
  } catch {
2810
2953
  return s;
2811
2954
  }
2812
2955
  },
2813
2956
  path_remove_directory: (e, t, r) => {
2814
- if (!b || !D) return a;
2815
- let o = M(e, n.decode(new Uint8Array(b.buffer, t, r)));
2816
- if (!o || !D.exists(o)) return l;
2957
+ if (!C || !O) return a;
2958
+ let o = N(e, n.decode(new Uint8Array(C.buffer, t, r)));
2959
+ if (!o || !O.exists(o)) return l;
2817
2960
  try {
2818
- return D.deleteFileByPath(o), i;
2961
+ return O.deleteFileByPath(o), i;
2819
2962
  } catch {
2820
2963
  return s;
2821
2964
  }
@@ -2827,88 +2970,88 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2827
2970
  };
2828
2971
  },
2829
2972
  args_sizes_get: (e, t) => {
2830
- if (!b) return s;
2831
- let n = [this.script, ...this.arguments || []], r = new DataView(b.buffer);
2832
- return r.setUint32(e, n.length, !0), r.setUint32(t, n.reduce((e, t) => e + y.encode(t).length + 1, 0), !0), i;
2973
+ if (!C) return s;
2974
+ let n = [this.script, ...this.arguments || []], r = new DataView(C.buffer);
2975
+ return r.setUint32(e, n.length, !0), r.setUint32(t, n.reduce((e, t) => e + b.encode(t).length + 1, 0), !0), i;
2833
2976
  },
2834
2977
  args_get: (e, t) => {
2835
- if (!b) return s;
2836
- let n = [this.script, ...this.arguments || []], r = new DataView(b.buffer), a = t;
2978
+ if (!C) return s;
2979
+ let n = [this.script, ...this.arguments || []], r = new DataView(C.buffer), a = t;
2837
2980
  for (let t = 0; t < n.length; t++) {
2838
2981
  r.setUint32(e + t * 4, a, !0);
2839
- let i = y.encode(n[t] + "\0");
2840
- new Uint8Array(b.buffer).set(i, a), a += i.length;
2982
+ let i = b.encode(n[t] + "\0");
2983
+ new Uint8Array(C.buffer).set(i, a), a += i.length;
2841
2984
  }
2842
2985
  return i;
2843
2986
  },
2844
2987
  environ_sizes_get: (e, t) => {
2845
- if (!b) return s;
2846
- let n = new DataView(b.buffer);
2847
- n.setUint32(e, P.length, !0);
2848
- let r = P.reduce((e, t) => e + y.encode(t).length + 1, 0);
2988
+ if (!C) return s;
2989
+ let n = new DataView(C.buffer);
2990
+ n.setUint32(e, F.length, !0);
2991
+ let r = F.reduce((e, t) => e + b.encode(t).length + 1, 0);
2849
2992
  return n.setUint32(t, r, !0), i;
2850
2993
  },
2851
2994
  environ_get: (e, t) => {
2852
- if (!b) return s;
2853
- let n = new DataView(b.buffer), r = t;
2854
- for (let t = 0; t < P.length; t++) {
2995
+ if (!C) return s;
2996
+ let n = new DataView(C.buffer), r = t;
2997
+ for (let t = 0; t < F.length; t++) {
2855
2998
  n.setUint32(e + t * 4, r, !0);
2856
- let i = y.encode(P[t] + "\0");
2857
- new Uint8Array(b.buffer).set(i, r), r += i.length;
2999
+ let i = b.encode(F[t] + "\0");
3000
+ new Uint8Array(C.buffer).set(i, r), r += i.length;
2858
3001
  }
2859
3002
  return i;
2860
3003
  },
2861
3004
  clock_time_get: (e, t, n) => {
2862
- if (b) {
3005
+ if (C) {
2863
3006
  let e = BigInt(Date.now()) * 1000000n;
2864
- new DataView(b.buffer).setBigUint64(n, e, !0);
3007
+ new DataView(C.buffer).setBigUint64(n, e, !0);
2865
3008
  }
2866
3009
  return i;
2867
3010
  },
2868
3011
  random_get: (e, t) => {
2869
- if (b) {
2870
- let n = new Uint8Array(b.buffer, e, t);
3012
+ if (C) {
3013
+ let n = new Uint8Array(C.buffer, e, t);
2871
3014
  for (let e = 0; e < t; e++) n[e] = Math.random() * 256 | 0;
2872
3015
  }
2873
3016
  return i;
2874
3017
  }
2875
3018
  }, { get(e, t) {
2876
3019
  return t in e ? e[t] : () => 0;
2877
- } }), I = (e) => {
2878
- if (!b || !e) return "";
3020
+ } }), L = (e) => {
3021
+ if (!C || !e) return "";
2879
3022
  try {
2880
- let t = new DataView(b.buffer).getUint32(e - 4, !0), n = new Uint16Array(b.buffer, e, t >>> 1);
3023
+ let t = new DataView(C.buffer).getUint32(e - 4, !0), n = new Uint16Array(C.buffer, e, t >>> 1);
2881
3024
  return String.fromCharCode(...n);
2882
3025
  } catch {
2883
3026
  return "";
2884
3027
  }
2885
- }, L = {
2886
- wasi_snapshot_preview1: F,
2887
- wasi_unstable: F,
3028
+ }, R = {
3029
+ wasi_snapshot_preview1: I,
3030
+ wasi_unstable: I,
2888
3031
  env: new Proxy({
2889
3032
  print: (e, t) => {
2890
- b && C(1, n.decode(new Uint8Array(b.buffer, e, t)));
3033
+ C && w(1, n.decode(new Uint8Array(C.buffer, e, t)));
2891
3034
  },
2892
3035
  eprint: (e, t) => {
2893
- b && C(2, n.decode(new Uint8Array(b.buffer, e, t)));
3036
+ C && w(2, n.decode(new Uint8Array(C.buffer, e, t)));
2894
3037
  },
2895
3038
  log: (e) => {
2896
- C(1, I(e) + "\n");
3039
+ w(1, L(e) + "\n");
2897
3040
  },
2898
3041
  logi: (e) => {
2899
- C(1, String(e) + "\n");
3042
+ w(1, String(e) + "\n");
2900
3043
  },
2901
3044
  logf: (e) => {
2902
- C(1, String(e) + "\n");
3045
+ w(1, String(e) + "\n");
2903
3046
  },
2904
3047
  trace: (e, t, ...n) => {
2905
3048
  let r = t > 0 ? " " + n.slice(0, t).join(", ") : "";
2906
- C(1, `trace: ${I(e)}${r}\n`);
3049
+ w(1, `trace: ${L(e)}${r}\n`);
2907
3050
  },
2908
3051
  seed: () => Date.now() * Math.random(),
2909
3052
  abort: (e, t, n, r) => {
2910
- let i = I(e), a = I(t);
2911
- throw (i || a) && C(2, `abort: ${i || "aborted"} at ${a || this.script}:${n || 0}:${r || 0}\n`), this.exitCode = 134, {
3053
+ let i = L(e), a = L(t);
3054
+ throw (i || a) && w(2, `abort: ${i || "aborted"} at ${a || this.script}:${n || 0}:${r || 0}\n`), this.exitCode = 134, {
2912
3055
  _wasmExit: !0,
2913
3056
  code: 134
2914
3057
  };
@@ -2924,10 +3067,10 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2924
3067
  initial: 1,
2925
3068
  maximum: 256
2926
3069
  });
2927
- b = t, L[e.module] || (L[e.module] = {}), L[e.module][e.name] = t;
3070
+ C = t, R[e.module] || (R[e.module] = {}), R[e.module][e.name] = t;
2928
3071
  }
2929
- let n = await WebAssembly.instantiate(t, L);
2930
- n.exports.memory && (b = n.exports.memory);
3072
+ let n = await WebAssembly.instantiate(t, R);
3073
+ n.exports.memory && (C = n.exports.memory);
2931
3074
  let r = n.exports._start || n.exports.__wasi_command || n.exports.main || n.exports.run;
2932
3075
  if (r) try {
2933
3076
  await r();
@@ -2941,27 +3084,27 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2941
3084
  } catch (e) {
2942
3085
  (!e || !e._wasmExit) && (this.stdErr = `${this.script}: ${e?.message || String(e)}`, this.exitCode = 1);
2943
3086
  } finally {
2944
- for (let e of j.values()) N(e);
3087
+ for (let e of M.values()) P(e);
2945
3088
  }
2946
- w();
2947
- let R = this.arguments || [];
3089
+ T();
3090
+ let z = this.arguments || [];
2948
3091
  if (!(this.result && this.result.getStdOutput && this.result.getStdOutput().length > 0) && (this.exitCode === 0 || this.exitCode === void 0)) {
2949
3092
  let t = (this.script || "wasm").split("/").pop(), n = Object.assign({
2950
3093
  name: t,
2951
3094
  version: "wasi",
2952
3095
  description: `WebAssembly WASI binary (${this.script})`
2953
3096
  }, this._pkgMeta || {});
2954
- if (R.includes("--help") || R.includes("-h")) {
3097
+ if (z.includes("--help") || z.includes("-h")) {
2955
3098
  let r = k(e);
2956
3099
  for (let e of A(t, n, r)) this.stdOut = e;
2957
- } else (R.includes("--version") || R.includes("-V") || R.includes("-v")) && (this.stdOut = `${t} (${n.name} ${n.version} wasm)`);
3100
+ } else (z.includes("--version") || z.includes("-V") || z.includes("-v")) && (this.stdOut = `${t} (${n.name} ${n.version} wasm)`);
2958
3101
  }
2959
3102
  }
2960
3103
  }, w = /* @__PURE__ */ new Map();
2961
3104
  function T(e, t) {
2962
3105
  if (!e || !e.exists(t)) return null;
2963
3106
  if (e.isRealFilesystem) try {
2964
- let n = W();
3107
+ let n = K();
2965
3108
  return new Uint8Array(n.readFileSync(e.absolutePath(t)));
2966
3109
  } catch {}
2967
3110
  let n = e.getFileByPath(t);
@@ -2990,7 +3133,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
2990
3133
  o.set(a);
2991
3134
  let s = new r(o.buffer, i);
2992
3135
  if (e.isRealFilesystem) try {
2993
- let n = W(), r = ae(), i = e.absolutePath(t);
3136
+ let n = K(), r = ie(), i = e.absolutePath(t);
2994
3137
  n.mkdirSync(r.dirname(i), { recursive: !0 }), n.writeFileSync(i, y.from(a.buffer, a.byteOffset, a.byteLength));
2995
3138
  return;
2996
3139
  } catch {
@@ -3085,7 +3228,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
3085
3228
  return u.push(" -h, --help Show this help message and exit"), u.push(" -V, --version Show WebAssembly binary version and exit"), n && n.exports && n.exports.length > 0 && u.push("", `WASM Exports: ${n.exports.join(", ")}`), Array.isArray(t.aliases) && t.aliases.length > 0 && u.push("", `Aliases: ${t.aliases.join(", ")}`), (t.homepage || t.cdnUrl || t.wasmUrl) && u.push(`Source: ${t.homepage || t.cdnUrl || t.wasmUrl}`), u;
3086
3229
  }
3087
3230
  function j(e, t = {}, n = null) {
3088
- let r = K(), i = (n || e.bin || e.name).toLowerCase();
3231
+ let r = J(), i = (n || e.bin || e.name).toLowerCase();
3089
3232
  class a extends r {
3090
3233
  static get name() {
3091
3234
  return i;
@@ -3100,9 +3243,16 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
3100
3243
  let n = [...this.arguments || []], r = n.includes("--help") || n.includes("-h"), a = !r && (n.includes("--version") || n.includes("-V") || n.includes("-v"));
3101
3244
  this._inspectedWasm = null, this._persistedWasmBytes = e.wasmPath ? T(this.context && this.context.fs || this.fs, e.wasmPath) : null, r && this._persistedWasmBytes && this._persistedWasmBytes.byteLength > 0 && (this._inspectedWasm = k(this._persistedWasmBytes));
3102
3245
  try {
3103
- if (e.type === "wasm" && (this._persistedWasmBytes || e.wasmUrl) && !t.moduleLoader) {
3104
- let t = this._persistedWasmBytes || await this._fetchWasmBytes(e.wasmUrl);
3105
- r && (this._inspectedWasm = k(t)), await this._runRawWasmBytes(t, n);
3246
+ if ((e.type === "wasm" || e.type === "custom-wasm") && (this._persistedWasmBytes || e.wasmUrl)) {
3247
+ let i = this._persistedWasmBytes;
3248
+ if (!i && t.moduleLoader) try {
3249
+ let n = await t.moduleLoader(e.name, e.cdnUrl);
3250
+ n instanceof Uint8Array || n instanceof ArrayBuffer ? i = n instanceof Uint8Array ? n : new Uint8Array(n) : n && (n.wasmBytes || n.wasm || n.wasmBinary) && (i = n.wasmBytes || n.wasm || n.wasmBinary);
3251
+ } catch {}
3252
+ if (!i && e.wasmUrl && (i = await this._fetchWasmBytes(e.wasmUrl)), i) {
3253
+ r && (this._inspectedWasm = k(i)), await this._runRawWasmBytes(i, n);
3254
+ return;
3255
+ }
3106
3256
  } else {
3107
3257
  let o = e.cdnUrl || e.wasmUrl || `https://esm.sh/${e.name}`, s = typeof globalThis.fetch == "function" ? globalThis.fetch : null;
3108
3258
  if (s && this._persistedWasmBytes && this._persistedWasmBytes.byteLength > 0 && typeof Response < "u") {
@@ -3357,7 +3507,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
3357
3507
  }
3358
3508
  C.readBytesFromFs = T, C.writeBytesToFs = E, C.loadModule = D, C.extractHelpFromText = O, C.inspectWasmBytes = k, C.formatWasmHelp = A, C.createGenericWasmCommand = j, C.createCommand = j, t.exports = C;
3359
3509
  })), ce = /* @__PURE__ */ t(((e, t) => {
3360
- var n = U(), r = class extends n {
3510
+ var n = W(), r = class extends n {
3361
3511
  static get name() {
3362
3512
  return "test";
3363
3513
  }
@@ -3442,7 +3592,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
3442
3592
  }
3443
3593
  };
3444
3594
  })), le = /* @__PURE__ */ t(((e, t) => {
3445
- var n = U();
3595
+ var n = W();
3446
3596
  t.exports = class extends n {
3447
3597
  static get name() {
3448
3598
  return "cat";
@@ -3456,12 +3606,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
3456
3606
  else r.push(i);
3457
3607
  let i = [];
3458
3608
  if (r.length === 0) {
3459
- let e = this.stdin;
3609
+ let e = typeof this.stdin == "string" ? this.stdin : null;
3460
3610
  if (e == null) return this.stdErr = "cat: no file specified", this.exitCode = 1, Promise.resolve();
3461
3611
  i.push(e);
3462
3612
  } else for (let e of r) {
3463
3613
  if (e === "-") {
3464
- i.push(this.stdin || "");
3614
+ i.push(typeof this.stdin == "string" ? this.stdin : "");
3465
3615
  continue;
3466
3616
  }
3467
3617
  let t = this.fs.getFileByPath(e);
@@ -3592,25 +3742,25 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
3592
3742
  isFunction: h,
3593
3743
  isAsyncFunction: g
3594
3744
  }, e.isArrayLike = i, e.isAsyncFunction = g, e.isClass = u, e.isDefined = o, e.isDefinedValue = l, e.isFiniteNumber = n, e.isFunction = h, e.isIterable = p, e.isNull = c, e.isNumber = t, e.isObject = a, e.isPlainObject = r, e.isPrimitive = d, e.isPromise = f, e.isString = m, e.isUndefined = s;
3595
- })), pe, me = e((() => {
3745
+ })), pe, Y = e((() => {
3596
3746
  pe = globalThis || self;
3597
- })), J = /* @__PURE__ */ t(((e, t) => {
3598
- me();
3599
- var n = Infinity, r = "[object Symbol]", i = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, a = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, o = "\\ud800-\\udfff", s = "\\u0300-\\u036f\\ufe20-\\ufe23", c = "\\u20d0-\\u20f0", l = "\\u2700-\\u27bf", u = "a-z\\xdf-\\xf6\\xf8-\\xff", d = "\\xac\\xb1\\xd7\\xf7", f = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", p = "\\u2000-\\u206f", m = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", h = "A-Z\\xc0-\\xd6\\xd8-\\xde", g = "\\ufe0e\\ufe0f", _ = d + f + p + m, v = "['’]", y = "[" + o + "]", b = "[" + _ + "]", x = "[" + s + c + "]", S = "\\d+", C = "[" + l + "]", w = "[" + u + "]", T = "[^" + o + _ + S + l + u + h + "]", E = "\\ud83c[\\udffb-\\udfff]", D = "(?:" + x + "|" + E + ")", O = "[^" + o + "]", k = "(?:\\ud83c[\\udde6-\\uddff]){2}", A = "[\\ud800-\\udbff][\\udc00-\\udfff]", j = "[" + h + "]", M = "\\u200d", N = "(?:" + w + "|" + T + ")", P = "(?:" + j + "|" + T + ")", F = "(?:" + v + "(?:d|ll|m|re|s|t|ve))?", I = "(?:" + v + "(?:D|LL|M|RE|S|T|VE))?", L = D + "?", R = "[" + g + "]?", ee = "(?:" + M + "(?:" + [
3747
+ })), me = /* @__PURE__ */ t(((e, t) => {
3748
+ Y();
3749
+ var n = Infinity, r = "[object Symbol]", i = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, a = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, o = "\\ud800-\\udfff", s = "\\u0300-\\u036f\\ufe20-\\ufe23", c = "\\u20d0-\\u20f0", l = "\\u2700-\\u27bf", u = "a-z\\xdf-\\xf6\\xf8-\\xff", d = "\\xac\\xb1\\xd7\\xf7", f = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", p = "\\u2000-\\u206f", m = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", h = "A-Z\\xc0-\\xd6\\xd8-\\xde", g = "\\ufe0e\\ufe0f", _ = d + f + p + m, v = "['’]", y = "[" + o + "]", b = "[" + _ + "]", x = "[" + s + c + "]", S = "\\d+", C = "[" + l + "]", w = "[" + u + "]", T = "[^" + o + _ + S + l + u + h + "]", E = "\\ud83c[\\udffb-\\udfff]", D = "(?:" + x + "|" + E + ")", O = "[^" + o + "]", k = "(?:\\ud83c[\\udde6-\\uddff]){2}", A = "[\\ud800-\\udbff][\\udc00-\\udfff]", j = "[" + h + "]", M = "\\u200d", N = "(?:" + w + "|" + T + ")", P = "(?:" + j + "|" + T + ")", F = "(?:" + v + "(?:d|ll|m|re|s|t|ve))?", I = "(?:" + v + "(?:D|LL|M|RE|S|T|VE))?", L = D + "?", R = "[" + g + "]?", z = "(?:" + M + "(?:" + [
3600
3750
  O,
3601
3751
  k,
3602
3752
  A
3603
- ].join("|") + ")" + R + L + ")*", z = R + L + ee, B = "(?:" + [
3753
+ ].join("|") + ")" + R + L + ")*", B = R + L + z, V = "(?:" + [
3604
3754
  C,
3605
3755
  k,
3606
3756
  A
3607
- ].join("|") + ")" + z, V = "(?:" + [
3757
+ ].join("|") + ")" + B, H = "(?:" + [
3608
3758
  O + x + "?",
3609
3759
  x,
3610
3760
  k,
3611
3761
  A,
3612
3762
  y
3613
- ].join("|") + ")", H = RegExp(v, "g"), te = RegExp(x, "g"), U = RegExp(E + "(?=" + E + ")|" + V + z, "g"), ne = RegExp([
3763
+ ].join("|") + ")", U = RegExp(v, "g"), ee = RegExp(x, "g"), te = RegExp(E + "(?=" + E + ")|" + H + B, "g"), W = RegExp([
3614
3764
  j + "?" + w + "+" + F + "(?=" + [
3615
3765
  b,
3616
3766
  j,
@@ -3624,8 +3774,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
3624
3774
  j + "?" + N + "+" + F,
3625
3775
  j + "+" + I,
3626
3776
  S,
3627
- B
3628
- ].join("|"), "g"), re = RegExp("[" + M + o + s + c + g + "]"), ie = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, W = {
3777
+ V
3778
+ ].join("|"), "g"), ne = RegExp("[" + M + o + s + c + g + "]"), re = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, G = {
3629
3779
  À: "A",
3630
3780
  Á: "A",
3631
3781
  Â: "A",
@@ -3816,104 +3966,104 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
3816
3966
  œ: "oe",
3817
3967
  ʼn: "'n",
3818
3968
  ſ: "ss"
3819
- }, ae = typeof pe == "object" && pe && pe.Object === Object && pe, oe = typeof self == "object" && self && self.Object === Object && self, G = ae || oe || Function("return this")();
3820
- function K(e, t, n, r) {
3969
+ }, K = typeof pe == "object" && pe && pe.Object === Object && pe, ie = typeof self == "object" && self && self.Object === Object && self, q = K || ie || Function("return this")();
3970
+ function ae(e, t, n, r) {
3821
3971
  var i = -1, a = e ? e.length : 0;
3822
3972
  for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
3823
3973
  return n;
3824
3974
  }
3825
- function q(e) {
3975
+ function J(e) {
3826
3976
  return e.split("");
3827
3977
  }
3828
- function se(e) {
3978
+ function oe(e) {
3829
3979
  return e.match(i) || [];
3830
3980
  }
3831
- function ce(e) {
3981
+ function se(e) {
3832
3982
  return function(t) {
3833
3983
  return e?.[t];
3834
3984
  };
3835
3985
  }
3836
- var le = ce(W);
3986
+ var ce = se(G);
3987
+ function le(e) {
3988
+ return ne.test(e);
3989
+ }
3837
3990
  function ue(e) {
3838
3991
  return re.test(e);
3839
3992
  }
3840
3993
  function de(e) {
3841
- return ie.test(e);
3994
+ return le(e) ? fe(e) : J(e);
3842
3995
  }
3843
3996
  function fe(e) {
3844
- return ue(e) ? J(e) : q(e);
3997
+ return e.match(te) || [];
3845
3998
  }
3846
- function J(e) {
3847
- return e.match(U) || [];
3999
+ function me(e) {
4000
+ return e.match(W) || [];
3848
4001
  }
3849
- function he(e) {
3850
- return e.match(ne) || [];
3851
- }
3852
- var ge = Object.prototype.toString, Y = G.Symbol, _e = Y ? Y.prototype : void 0, ve = _e ? _e.toString : void 0;
3853
- function ye(e, t, n) {
4002
+ var he = Object.prototype.toString, X = q.Symbol, ge = X ? X.prototype : void 0, _e = ge ? ge.toString : void 0;
4003
+ function ve(e, t, n) {
3854
4004
  var r = -1, i = e.length;
3855
4005
  t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
3856
4006
  for (var a = Array(i); ++r < i;) a[r] = e[r + t];
3857
4007
  return a;
3858
4008
  }
3859
- function be(e) {
4009
+ function ye(e) {
3860
4010
  if (typeof e == "string") return e;
3861
- if (Te(e)) return ve ? ve.call(e) : "";
4011
+ if (we(e)) return _e ? _e.call(e) : "";
3862
4012
  var t = e + "";
3863
4013
  return t == "0" && 1 / e == -n ? "-0" : t;
3864
4014
  }
3865
- function xe(e, t, n) {
4015
+ function be(e, t, n) {
3866
4016
  var r = e.length;
3867
- return n = n === void 0 ? r : n, !t && n >= r ? e : ye(e, t, n);
4017
+ return n = n === void 0 ? r : n, !t && n >= r ? e : ve(e, t, n);
3868
4018
  }
3869
- function Se(e) {
4019
+ function xe(e) {
3870
4020
  return function(t) {
3871
- t = Ee(t);
3872
- var n = ue(t) ? fe(t) : void 0, r = n ? n[0] : t.charAt(0), i = n ? xe(n, 1).join("") : t.slice(1);
4021
+ t = Te(t);
4022
+ var n = le(t) ? de(t) : void 0, r = n ? n[0] : t.charAt(0), i = n ? be(n, 1).join("") : t.slice(1);
3873
4023
  return r[e]() + i;
3874
4024
  };
3875
4025
  }
3876
- function Ce(e) {
4026
+ function Se(e) {
3877
4027
  return function(t) {
3878
- return K(je(ke(t).replace(H, "")), e, "");
4028
+ return ae(Ae(Oe(t).replace(U, "")), e, "");
3879
4029
  };
3880
4030
  }
3881
- function we(e) {
4031
+ function Ce(e) {
3882
4032
  return !!e && typeof e == "object";
3883
4033
  }
3884
- function Te(e) {
3885
- return typeof e == "symbol" || we(e) && ge.call(e) == r;
4034
+ function we(e) {
4035
+ return typeof e == "symbol" || Ce(e) && he.call(e) == r;
3886
4036
  }
3887
- function Ee(e) {
3888
- return e == null ? "" : be(e);
4037
+ function Te(e) {
4038
+ return e == null ? "" : ye(e);
3889
4039
  }
3890
- var De = Ce(function(e, t, n) {
3891
- return t = t.toLowerCase(), e + (n ? Oe(t) : t);
4040
+ var Ee = Se(function(e, t, n) {
4041
+ return t = t.toLowerCase(), e + (n ? De(t) : t);
3892
4042
  });
3893
- function Oe(e) {
3894
- return Ae(Ee(e).toLowerCase());
4043
+ function De(e) {
4044
+ return ke(Te(e).toLowerCase());
3895
4045
  }
3896
- function ke(e) {
3897
- return e = Ee(e), e && e.replace(a, le).replace(te, "");
4046
+ function Oe(e) {
4047
+ return e = Te(e), e && e.replace(a, ce).replace(ee, "");
3898
4048
  }
3899
- var Ae = Se("toUpperCase");
3900
- function je(e, t, n) {
3901
- return e = Ee(e), t = n ? void 0 : t, t === void 0 ? de(e) ? he(e) : se(e) : e.match(t) || [];
4049
+ var ke = xe("toUpperCase");
4050
+ function Ae(e, t, n) {
4051
+ return e = Te(e), t = n ? void 0 : t, t === void 0 ? ue(e) ? me(e) : oe(e) : e.match(t) || [];
3902
4052
  }
3903
- t.exports = De;
4053
+ t.exports = Ee;
3904
4054
  })), he = /* @__PURE__ */ t(((e, t) => {
3905
- B();
3906
- var n = ue(), r = de(), i = fe(), a = J(), o = {
4055
+ V();
4056
+ var n = ue(), r = de(), i = fe(), a = me(), o = {
3907
4057
  short: /^-([^\d-])$/,
3908
4058
  long: /^--(\S+)/,
3909
4059
  combinedShort: /^-[^\d-]{2,}$/,
3910
4060
  optEquals: /^(--\S+?)=(.*)/
3911
4061
  }, s = class extends Array {
3912
4062
  load(e) {
3913
- if (this.clear(), e && e !== z.argv) e = n(e);
4063
+ if (this.clear(), e && e !== B.argv) e = n(e);
3914
4064
  else {
3915
- e = z.argv.slice(0);
3916
- let t = z.execArgv.some(m) ? 1 : 2;
4065
+ e = B.argv.slice(0);
4066
+ let t = B.execArgv.some(m) ? 1 : 2;
3917
4067
  e.splice(0, t);
3918
4068
  }
3919
4069
  e.forEach((e) => this.push(String(e)));
@@ -4168,8 +4318,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4168
4318
  });
4169
4319
  }
4170
4320
  t.exports = E;
4171
- })), ge = /* @__PURE__ */ t(((e, t) => {
4172
- var n = U(), r = he();
4321
+ })), X = /* @__PURE__ */ t(((e, t) => {
4322
+ var n = W(), r = he();
4173
4323
  t.exports = class extends n {
4174
4324
  static get name() {
4175
4325
  return "ls";
@@ -4269,8 +4419,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4269
4419
  ], { argv: e });
4270
4420
  }
4271
4421
  };
4272
- })), Y = /* @__PURE__ */ t(((e, t) => {
4273
- var n = U();
4422
+ })), ge = /* @__PURE__ */ t(((e, t) => {
4423
+ var n = W();
4274
4424
  t.exports = class extends n {
4275
4425
  static get name() {
4276
4426
  return "echo";
@@ -4286,7 +4436,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4286
4436
  }
4287
4437
  };
4288
4438
  })), _e = /* @__PURE__ */ t(((e, t) => {
4289
- var n = U();
4439
+ var n = W();
4290
4440
  t.exports = class extends n {
4291
4441
  static get name() {
4292
4442
  return "printf";
@@ -4305,7 +4455,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4305
4455
  }
4306
4456
  };
4307
4457
  })), ve = /* @__PURE__ */ t(((e, t) => {
4308
- var n = U();
4458
+ var n = W();
4309
4459
  t.exports = class extends n {
4310
4460
  static get name() {
4311
4461
  return "grep";
@@ -4385,7 +4535,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4385
4535
  for (; v < _.length;) g.push(_[v++]);
4386
4536
  if (p !== null) {
4387
4537
  let e = "";
4388
- if (p === "-") e = this.stdin || "";
4538
+ if (p === "-") e = typeof this.stdin == "string" ? this.stdin : "";
4389
4539
  else {
4390
4540
  let t = this.fs.getFileByPath(p);
4391
4541
  if (t == null) {
@@ -4415,7 +4565,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4415
4565
  return this.stdErr = `grep: invalid regex: ${e.message}`, this.exitCode = 2, Promise.resolve();
4416
4566
  }
4417
4567
  }
4418
- let x = [], S = !1, C = this.stdin || "", w = (e, t = !1) => {
4568
+ let x = [], S = !1, C = typeof this.stdin == "string" ? this.stdin : "", w = (e, t = !1) => {
4419
4569
  let n = this.fs.getFileByPath(e);
4420
4570
  if (n == null) {
4421
4571
  if (!f) {
@@ -4503,7 +4653,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4503
4653
  }
4504
4654
  };
4505
4655
  })), ye = /* @__PURE__ */ t(((e, t) => {
4506
- var n = U();
4656
+ var n = W();
4507
4657
  t.exports = class extends n {
4508
4658
  static get name() {
4509
4659
  return "true";
@@ -4513,7 +4663,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4513
4663
  }
4514
4664
  };
4515
4665
  })), be = /* @__PURE__ */ t(((e, t) => {
4516
- var n = U();
4666
+ var n = W();
4517
4667
  t.exports = class extends n {
4518
4668
  static get name() {
4519
4669
  return "false";
@@ -4526,8 +4676,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4526
4676
  var { Test: n, TestBracket: r } = ce();
4527
4677
  t.exports = [
4528
4678
  le(),
4679
+ X(),
4529
4680
  ge(),
4530
- Y(),
4531
4681
  _e(),
4532
4682
  ve(),
4533
4683
  ye(),
@@ -4536,7 +4686,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4536
4686
  r
4537
4687
  ];
4538
4688
  })), Se = /* @__PURE__ */ t(((e, t) => {
4539
- var n = K();
4689
+ var n = J();
4540
4690
  t.exports = class extends n {
4541
4691
  static get name() {
4542
4692
  return "alias";
@@ -4548,7 +4698,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4548
4698
  }
4549
4699
  };
4550
4700
  })), Ce = /* @__PURE__ */ t(((e, t) => {
4551
- var n = K();
4701
+ var n = J();
4552
4702
  t.exports = class extends n {
4553
4703
  static get name() {
4554
4704
  return "export";
@@ -4560,7 +4710,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4560
4710
  }
4561
4711
  };
4562
4712
  })), we = /* @__PURE__ */ t(((e, t) => {
4563
- var n = K();
4713
+ var n = J();
4564
4714
  t.exports = class extends n {
4565
4715
  static get name() {
4566
4716
  return "cd";
@@ -4572,7 +4722,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4572
4722
  }
4573
4723
  };
4574
4724
  })), Te = /* @__PURE__ */ t(((e, t) => {
4575
- var n = K();
4725
+ var n = J();
4576
4726
  t.exports = class extends n {
4577
4727
  static get name() {
4578
4728
  return "chmod";
@@ -4628,7 +4778,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4628
4778
  }
4629
4779
  };
4630
4780
  })), Ee = /* @__PURE__ */ t(((e, t) => {
4631
- var n = K(), r = W();
4781
+ var n = J(), r = K();
4632
4782
  t.exports = class extends n {
4633
4783
  static get name() {
4634
4784
  return "cp";
@@ -4724,9 +4874,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4724
4874
  }
4725
4875
  };
4726
4876
  })), De = /* @__PURE__ */ t(((e, t) => {
4727
- var n = K(), r = (() => {
4877
+ var n = J(), r = (() => {
4728
4878
  try {
4729
- return W();
4879
+ return K();
4730
4880
  } catch {
4731
4881
  return null;
4732
4882
  }
@@ -4797,7 +4947,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4797
4947
  }
4798
4948
  };
4799
4949
  })), Oe = /* @__PURE__ */ t(((e, t) => {
4800
- var n = K();
4950
+ var n = J();
4801
4951
  t.exports = class extends n {
4802
4952
  static get name() {
4803
4953
  return "mkdir";
@@ -4824,7 +4974,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4824
4974
  }
4825
4975
  };
4826
4976
  })), ke = /* @__PURE__ */ t(((e, t) => {
4827
- var n = K(), r = W();
4977
+ var n = J(), r = K();
4828
4978
  t.exports = class extends n {
4829
4979
  static get name() {
4830
4980
  return "mv";
@@ -4868,7 +5018,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4868
5018
  continue;
4869
5019
  }
4870
5020
  try {
4871
- let e = ae();
5021
+ let e = ie();
4872
5022
  r.mkdirSync(e.dirname(i), { recursive: !0 }), r.renameSync(n, i);
4873
5023
  } catch (n) {
4874
5024
  this.stdErr = `mv: cannot move '${e}' to '${t}': ${n.message}`, this.exitCode = 1;
@@ -4897,7 +5047,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4897
5047
  }
4898
5048
  };
4899
5049
  })), Ae = /* @__PURE__ */ t(((e, t) => {
4900
- var n = K();
5050
+ var n = J();
4901
5051
  t.exports = class extends n {
4902
5052
  static get name() {
4903
5053
  return "pwd";
@@ -4908,7 +5058,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4908
5058
  }
4909
5059
  };
4910
5060
  })), je = /* @__PURE__ */ t(((e, t) => {
4911
- var n = K(), r = W();
5061
+ var n = J(), r = K();
4912
5062
  t.exports = class extends n {
4913
5063
  static get name() {
4914
5064
  return "rm";
@@ -4953,9 +5103,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
4953
5103
  }
4954
5104
  };
4955
5105
  })), Me = /* @__PURE__ */ t(((e, t) => {
4956
- var n = K(), r = (() => {
5106
+ var n = J(), r = (() => {
4957
5107
  try {
4958
- return W();
5108
+ return K();
4959
5109
  } catch {
4960
5110
  return null;
4961
5111
  }
@@ -5022,9 +5172,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5022
5172
  }
5023
5173
  };
5024
5174
  })), Ne = /* @__PURE__ */ t(((e, t) => {
5025
- var n = K(), r = (() => {
5175
+ var n = J(), r = (() => {
5026
5176
  try {
5027
- return W();
5177
+ return K();
5028
5178
  } catch {
5029
5179
  return null;
5030
5180
  }
@@ -5063,7 +5213,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5063
5213
  }
5064
5214
  };
5065
5215
  })), Pe = /* @__PURE__ */ t(((e, t) => {
5066
- var n = K();
5216
+ var n = J();
5067
5217
  t.exports = class extends n {
5068
5218
  static get name() {
5069
5219
  return "which";
@@ -5075,7 +5225,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5075
5225
  }
5076
5226
  };
5077
5227
  })), Fe = /* @__PURE__ */ t(((e, t) => {
5078
- var n = q(), r = K();
5228
+ var n = oe(), r = J();
5079
5229
  t.exports = class extends r {
5080
5230
  static get name() {
5081
5231
  return "source";
@@ -5104,17 +5254,17 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5104
5254
  }
5105
5255
  };
5106
5256
  })), Ie = /* @__PURE__ */ t(((e, t) => {
5107
- var n = K();
5257
+ var n = J();
5108
5258
  t.exports = class extends n {
5109
5259
  static get name() {
5110
5260
  return "clear";
5111
5261
  }
5112
5262
  run() {
5113
- return this.arguments.length > 0 ? Promise.reject("clear does not require arguments") : (this.context.clear(), Promise.resolve());
5263
+ return this.arguments.length > 0 ? Promise.reject("clear does not require arguments") : (this.stdout && this.stdout.write("\x1B[2J\x1B[3J\x1B[H"), this.context.clear(), Promise.resolve());
5114
5264
  }
5115
5265
  };
5116
5266
  })), Le = /* @__PURE__ */ t(((e, t) => {
5117
- var n = K();
5267
+ var n = J();
5118
5268
  t.exports = class extends n {
5119
5269
  static get name() {
5120
5270
  return "exit";
@@ -5125,7 +5275,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5125
5275
  }
5126
5276
  };
5127
5277
  })), Re = /* @__PURE__ */ t(((e, t) => {
5128
- var n = K(), r = he();
5278
+ var n = J(), r = he();
5129
5279
  t.exports = class extends n {
5130
5280
  static get name() {
5131
5281
  return "read";
@@ -5199,7 +5349,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5199
5349
  }
5200
5350
  };
5201
5351
  })), ze = /* @__PURE__ */ t(((e, t) => {
5202
- var n = K(), r = U();
5352
+ var n = J(), r = W();
5203
5353
  t.exports = class extends n {
5204
5354
  static get name() {
5205
5355
  return "jsfunction";
@@ -5235,7 +5385,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5235
5385
  }
5236
5386
  };
5237
5387
  })), Be = /* @__PURE__ */ t(((e, t) => {
5238
- var n = K();
5388
+ var n = J();
5239
5389
  function r(e) {
5240
5390
  return e >= 1048576 ? (e / 1048576).toFixed(1) + " MB" : e >= 1024 ? (e / 1024).toFixed(1) + " KB" : e + " B";
5241
5391
  }
@@ -5333,7 +5483,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5333
5483
  let e = new TextDecoder().decode(t);
5334
5484
  this.fs.setFileByPath(s, e, !0);
5335
5485
  } else {
5336
- let { BinaryFile: e } = ie(), r = e ? new e(t.buffer, n || "application/octet-stream") : t;
5486
+ let { BinaryFile: e } = G(), r = e ? new e(t.buffer, n || "application/octet-stream") : t;
5337
5487
  this.fs.setFileByPath(s, r, !0);
5338
5488
  }
5339
5489
  } catch (e) {
@@ -5356,7 +5506,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5356
5506
  }
5357
5507
  };
5358
5508
  })), Ve = /* @__PURE__ */ t(((e, t) => {
5359
- var n = K(), r = {
5509
+ var n = J(), r = {
5360
5510
  errexit: "e",
5361
5511
  xtrace: "x",
5362
5512
  nounset: "u",
@@ -5455,7 +5605,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5455
5605
  t.exports = ReferenceError;
5456
5606
  })), Ye = /* @__PURE__ */ t(((e, t) => {
5457
5607
  t.exports = SyntaxError;
5458
- })), X = /* @__PURE__ */ t(((e, t) => {
5608
+ })), Z = /* @__PURE__ */ t(((e, t) => {
5459
5609
  t.exports = TypeError;
5460
5610
  })), Xe = /* @__PURE__ */ t(((e, t) => {
5461
5611
  t.exports = URIError;
@@ -5565,7 +5715,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5565
5715
  var n = pt(), r = ht(), i = mt();
5566
5716
  t.exports = gt() || n.call(i, r);
5567
5717
  })), vt = /* @__PURE__ */ t(((e, t) => {
5568
- var n = pt(), r = X(), i = mt(), a = _t();
5718
+ var n = pt(), r = Z(), i = mt(), a = _t();
5569
5719
  t.exports = function(e) {
5570
5720
  if (e.length < 1 || typeof e[0] != "function") throw new r("a function is required");
5571
5721
  return a(n, i, e);
@@ -5594,8 +5744,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5594
5744
  })), xt = /* @__PURE__ */ t(((e, t) => {
5595
5745
  var n = Function.prototype.call, r = Object.prototype.hasOwnProperty;
5596
5746
  t.exports = pt().call(n, r);
5597
- })), Z = /* @__PURE__ */ t(((e, t) => {
5598
- var n, r = We(), i = Ge(), a = Ke(), o = qe(), s = Je(), c = Ye(), l = X(), u = Xe(), d = Ze(), f = Qe(), p = $e(), m = et(), h = tt(), g = nt(), _ = it(), v = Function, y = function(e) {
5747
+ })), Q = /* @__PURE__ */ t(((e, t) => {
5748
+ var n, r = We(), i = Ge(), a = Ke(), o = qe(), s = Je(), c = Ye(), l = Z(), u = Xe(), d = Ze(), f = Qe(), p = $e(), m = et(), h = tt(), g = nt(), _ = it(), v = Function, y = function(e) {
5599
5749
  try {
5600
5750
  return v("\"use strict\"; return (" + e + ").constructor;")();
5601
5751
  } catch {}
@@ -5801,15 +5951,15 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5801
5951
  "%URIErrorPrototype%": ["URIError", "prototype"],
5802
5952
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
5803
5953
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
5804
- }, F = pt(), I = xt(), L = F.call(k, Array.prototype.concat), R = F.call(O, Array.prototype.splice), ee = F.call(k, String.prototype.replace), z = F.call(k, String.prototype.slice), B = F.call(k, RegExp.prototype.exec), V = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, H = /\\(\\)?/g, te = function(e) {
5805
- var t = z(e, 0, 1), n = z(e, -1);
5954
+ }, F = pt(), I = xt(), L = F.call(k, Array.prototype.concat), R = F.call(O, Array.prototype.splice), z = F.call(k, String.prototype.replace), B = F.call(k, String.prototype.slice), V = F.call(k, RegExp.prototype.exec), H = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, U = /\\(\\)?/g, ee = function(e) {
5955
+ var t = B(e, 0, 1), n = B(e, -1);
5806
5956
  if (t === "%" && n !== "%") throw new c("invalid intrinsic syntax, expected closing `%`");
5807
5957
  if (n === "%" && t !== "%") throw new c("invalid intrinsic syntax, expected opening `%`");
5808
5958
  var r = [];
5809
- return ee(e, V, function(e, t, n, i) {
5810
- r[r.length] = n ? ee(i, H, "$1") : t || e;
5959
+ return z(e, H, function(e, t, n, i) {
5960
+ r[r.length] = n ? z(i, U, "$1") : t || e;
5811
5961
  }), r;
5812
- }, U = function(e, t) {
5962
+ }, te = function(e, t) {
5813
5963
  var n = e, r;
5814
5964
  if (I(P, n) && (r = P[n], n = "%" + r[0] + "%"), I(M, n)) {
5815
5965
  var i = M[n];
@@ -5825,11 +5975,11 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5825
5975
  t.exports = function(e, t) {
5826
5976
  if (typeof e != "string" || e.length === 0) throw new l("intrinsic name must be a non-empty string");
5827
5977
  if (arguments.length > 1 && typeof t != "boolean") throw new l("\"allowMissing\" argument must be a boolean");
5828
- if (B(/^%?[^%]*%?$/, e) === null) throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
5829
- var n = te(e), r = n.length > 0 ? n[0] : "", i = U("%" + r + "%", t), a = i.name, o = i.value, s = !1, u = i.alias;
5978
+ if (V(/^%?[^%]*%?$/, e) === null) throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
5979
+ var n = ee(e), r = n.length > 0 ? n[0] : "", i = te("%" + r + "%", t), a = i.name, o = i.value, s = !1, u = i.alias;
5830
5980
  u && (r = u[0], R(n, L([0, 1], u)));
5831
5981
  for (var d = 1, f = !0; d < n.length; d += 1) {
5832
- var p = n[d], m = z(p, 0, 1), h = z(p, -1);
5982
+ var p = n[d], m = B(p, 0, 1), h = B(p, -1);
5833
5983
  if ((m === "\"" || m === "'" || m === "`" || h === "\"" || h === "'" || h === "`") && m !== h) throw new c("property names with quotes must have matching quotes");
5834
5984
  if ((p === "constructor" || !f) && (s = !0), r += "." + p, a = "%" + r + "%", I(M, a)) o = M[a];
5835
5985
  else if (o != null) {
@@ -5847,7 +5997,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5847
5997
  return o;
5848
5998
  };
5849
5999
  })), St = /* @__PURE__ */ t(((e, t) => {
5850
- var n = st(), r = Ye(), i = X(), a = ot();
6000
+ var n = st(), r = Ye(), i = Z(), a = ot();
5851
6001
  t.exports = function(e, t, o) {
5852
6002
  if (!e || typeof e != "object" && typeof e != "function") throw new i("`obj` must be an object or a function`");
5853
6003
  if (typeof t != "string" && typeof t != "symbol") throw new i("`property` must be a string or a symbol`");
@@ -5878,7 +6028,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
5878
6028
  }
5879
6029
  }, t.exports = r;
5880
6030
  })), wt = /* @__PURE__ */ t(((e, t) => {
5881
- var n = Z(), r = St(), i = Ct()(), a = ot(), o = X(), s = n("%Math.floor%");
6031
+ var n = Q(), r = St(), i = Ct()(), a = ot(), o = Z(), s = n("%Math.floor%");
5882
6032
  t.exports = function(e, t) {
5883
6033
  if (typeof e != "function") throw new o("`fn` is not a function");
5884
6034
  if (typeof t != "number" || t < 0 || t > 4294967295 || s(t) !== t) throw new o("`length` must be a positive 32-bit integer");
@@ -6004,21 +6154,21 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6004
6154
  for (var s = 0; s < o.length; s += 1) l(e, o[s], t[o[s]], i[o[s]]);
6005
6155
  };
6006
6156
  u.supportsDescriptors = !!c, t.exports = u;
6007
- })), Q = /* @__PURE__ */ t(((e, t) => {
6008
- var n = Z(), r = vt(), i = r([n("%String.prototype.indexOf%")]);
6157
+ })), $ = /* @__PURE__ */ t(((e, t) => {
6158
+ var n = Q(), r = vt(), i = r([n("%String.prototype.indexOf%")]);
6009
6159
  t.exports = function(e, t) {
6010
6160
  var a = n(e, !!t);
6011
6161
  return typeof a == "function" && i(e, ".prototype.") > -1 ? r([a]) : a;
6012
6162
  };
6013
6163
  })), jt = /* @__PURE__ */ t(((e, t) => {
6014
- var n = Z()("%Array%"), r = !n.isArray && Q()("Object.prototype.toString");
6164
+ var n = Q()("%Array%"), r = !n.isArray && $()("Object.prototype.toString");
6015
6165
  t.exports = n.isArray || function(e) {
6016
6166
  return r(e) === "[object Array]";
6017
6167
  };
6018
6168
  })), Mt = /* @__PURE__ */ t(((e, t) => {
6019
6169
  t.exports = jt();
6020
6170
  })), Nt = /* @__PURE__ */ t(((e, t) => {
6021
- var n = Z(), r = Q(), i = X(), a = Mt(), o = n("%Reflect.apply%", !0) || r("Function.prototype.apply");
6171
+ var n = Q(), r = $(), i = Z(), a = Mt(), o = n("%Reflect.apply%", !0) || r("Function.prototype.apply");
6022
6172
  t.exports = function(e, t) {
6023
6173
  var n = arguments.length > 2 ? arguments[2] : [];
6024
6174
  if (!a(n)) throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");
@@ -6027,7 +6177,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6027
6177
  })), Pt = /* @__PURE__ */ t(((e, t) => {
6028
6178
  t.exports = {};
6029
6179
  })), Ft = /* @__PURE__ */ t(((e, t) => {
6030
- me();
6180
+ Y();
6031
6181
  var n = typeof Map == "function" && Map.prototype, r = Object.getOwnPropertyDescriptor && n ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, i = n && r && typeof r.get == "function" ? r.get : null, a = n && Map.prototype.forEach, o = typeof Set == "function" && Set.prototype, s = Object.getOwnPropertyDescriptor && o ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, c = o && s && typeof s.get == "function" ? s.get : null, l = o && Set.prototype.forEach, u = typeof WeakMap == "function" && WeakMap.prototype ? WeakMap.prototype.has : null, d = typeof WeakSet == "function" && WeakSet.prototype ? WeakSet.prototype.has : null, f = typeof WeakRef == "function" && WeakRef.prototype ? WeakRef.prototype.deref : null, p = Boolean.prototype.valueOf, m = Object.prototype.toString, h = Function.prototype.toString, g = String.prototype.match, _ = String.prototype.slice, v = String.prototype.replace, y = String.prototype.toUpperCase, b = String.prototype.toLowerCase, x = RegExp.prototype.test, S = Array.prototype.concat, C = Array.prototype.join, w = Array.prototype.slice, T = Math.floor, E = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, D = Object.getOwnPropertySymbols, O = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, k = typeof Symbol == "function" && typeof Symbol.iterator == "object", A = typeof Symbol == "function" && Symbol.toStringTag ? Symbol.toStringTag : null, j = Object.prototype.propertyIsEnumerable, M = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(e) {
6032
6182
  return e.__proto__;
6033
6183
  } : null);
@@ -6043,7 +6193,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6043
6193
  }
6044
6194
  return v.call(t, n, "$&_");
6045
6195
  }
6046
- var P = Pt(), F = P.custom, I = W(F) ? F : null, L = {
6196
+ var P = Pt(), F = P.custom, I = G(F) ? F : null, L = {
6047
6197
  __proto__: null,
6048
6198
  double: "\"",
6049
6199
  single: "'"
@@ -6054,17 +6204,17 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6054
6204
  };
6055
6205
  t.exports = function e(t, n, r, o) {
6056
6206
  var s = n || {};
6057
- if (G(s, "quoteStyle") && !G(L, s.quoteStyle)) throw TypeError("option \"quoteStyle\" must be \"single\" or \"double\"");
6058
- if (G(s, "maxStringLength") && (typeof s.maxStringLength == "number" ? s.maxStringLength < 0 && s.maxStringLength !== Infinity : s.maxStringLength !== null)) throw TypeError("option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`");
6059
- var u = G(s, "customInspect") ? s.customInspect : !0;
6207
+ if (q(s, "quoteStyle") && !q(L, s.quoteStyle)) throw TypeError("option \"quoteStyle\" must be \"single\" or \"double\"");
6208
+ if (q(s, "maxStringLength") && (typeof s.maxStringLength == "number" ? s.maxStringLength < 0 && s.maxStringLength !== Infinity : s.maxStringLength !== null)) throw TypeError("option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`");
6209
+ var u = q(s, "customInspect") ? s.customInspect : !0;
6060
6210
  if (typeof u != "boolean" && u !== "symbol") throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
6061
- if (G(s, "indent") && s.indent !== null && s.indent !== " " && !(parseInt(s.indent, 10) === s.indent && s.indent > 0)) throw TypeError("option \"indent\" must be \"\\t\", an integer > 0, or `null`");
6062
- if (G(s, "numericSeparator") && typeof s.numericSeparator != "boolean") throw TypeError("option \"numericSeparator\", if provided, must be `true` or `false`");
6211
+ if (q(s, "indent") && s.indent !== null && s.indent !== " " && !(parseInt(s.indent, 10) === s.indent && s.indent > 0)) throw TypeError("option \"indent\" must be \"\\t\", an integer > 0, or `null`");
6212
+ if (q(s, "numericSeparator") && typeof s.numericSeparator != "boolean") throw TypeError("option \"numericSeparator\", if provided, must be `true` or `false`");
6063
6213
  var d = s.numericSeparator;
6064
6214
  if (t === void 0) return "undefined";
6065
6215
  if (t === null) return "null";
6066
6216
  if (typeof t == "boolean") return t ? "true" : "false";
6067
- if (typeof t == "string") return he(t, s);
6217
+ if (typeof t == "string") return me(t, s);
6068
6218
  if (typeof t == "number") {
6069
6219
  if (t === 0) return Infinity / t > 0 ? "0" : "-0";
6070
6220
  var f = String(t);
@@ -6075,101 +6225,101 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6075
6225
  return d ? N(t, m) : m;
6076
6226
  }
6077
6227
  var h = s.depth === void 0 ? 5 : s.depth;
6078
- if (r === void 0 && (r = 0), r >= h && h > 0 && typeof t == "object") return V(t) ? "[Array]" : "[Object]";
6079
- var g = be(s, r);
6228
+ if (r === void 0 && (r = 0), r >= h && h > 0 && typeof t == "object") return H(t) ? "[Array]" : "[Object]";
6229
+ var g = ye(s, r);
6080
6230
  if (o === void 0) o = [];
6081
- else if (se(o, t) >= 0) return "[Circular]";
6231
+ else if (oe(o, t) >= 0) return "[Circular]";
6082
6232
  function y(t, n, i) {
6083
6233
  if (n && (o = w.call(o), o.push(n)), i) {
6084
6234
  var a = { depth: s.depth };
6085
- return G(s, "quoteStyle") && (a.quoteStyle = s.quoteStyle), e(t, a, r + 1, o);
6235
+ return q(s, "quoteStyle") && (a.quoteStyle = s.quoteStyle), e(t, a, r + 1, o);
6086
6236
  }
6087
6237
  return e(t, s, r + 1, o);
6088
6238
  }
6089
- if (typeof t == "function" && !te(t)) {
6090
- var x = q(t), T = Se(t, y);
6239
+ if (typeof t == "function" && !ee(t)) {
6240
+ var x = J(t), T = xe(t, y);
6091
6241
  return "[Function" + (x ? ": " + x : " (anonymous)") + "]" + (T.length > 0 ? " { " + C.call(T, ", ") + " }" : "");
6092
6242
  }
6093
- if (W(t)) {
6243
+ if (G(t)) {
6094
6244
  var D = k ? v.call(String(t), /^(Symbol\(.*\))_[^)]*$/, "$1") : O.call(t);
6095
- return typeof t == "object" && !k ? Y(D) : D;
6245
+ return typeof t == "object" && !k ? X(D) : D;
6096
6246
  }
6097
- if (J(t)) {
6098
- for (var F = "<" + b.call(String(t.nodeName)), R = t.attributes || [], B = 0; B < R.length; B++) F += " " + R[B].name + "=" + ee(z(R[B].value), "double", s);
6247
+ if (fe(t)) {
6248
+ for (var F = "<" + b.call(String(t.nodeName)), R = t.attributes || [], V = 0; V < R.length; V++) F += " " + R[V].name + "=" + z(B(R[V].value), "double", s);
6099
6249
  return F += ">", t.childNodes && t.childNodes.length && (F += "..."), F += "</" + b.call(String(t.nodeName)) + ">", F;
6100
6250
  }
6101
- if (V(t)) {
6251
+ if (H(t)) {
6102
6252
  if (t.length === 0) return "[]";
6103
- var oe = Se(t, y);
6104
- return g && !ye(oe) ? "[" + xe(oe, g) + "]" : "[ " + C.call(oe, ", ") + " ]";
6253
+ var ie = xe(t, y);
6254
+ return g && !ve(ie) ? "[" + be(ie, g) + "]" : "[ " + C.call(ie, ", ") + " ]";
6105
6255
  }
6106
- if (U(t)) {
6107
- var me = Se(t, y);
6108
- return !("cause" in Error.prototype) && "cause" in t && !j.call(t, "cause") ? "{ [" + String(t) + "] " + C.call(S.call("[cause]: " + y(t.cause), me), ", ") + " }" : me.length === 0 ? "[" + String(t) + "]" : "{ [" + String(t) + "] " + C.call(me, ", ") + " }";
6256
+ if (te(t)) {
6257
+ var Y = xe(t, y);
6258
+ return !("cause" in Error.prototype) && "cause" in t && !j.call(t, "cause") ? "{ [" + String(t) + "] " + C.call(S.call("[cause]: " + y(t.cause), Y), ", ") + " }" : Y.length === 0 ? "[" + String(t) + "]" : "{ [" + String(t) + "] " + C.call(Y, ", ") + " }";
6109
6259
  }
6110
6260
  if (typeof t == "object" && u) {
6111
6261
  if (I && typeof t[I] == "function" && P) return P(t, { depth: h - r });
6112
6262
  if (u !== "symbol" && typeof t.inspect == "function") return t.inspect();
6113
6263
  }
6114
- if (ce(t)) {
6115
- var ge = [];
6264
+ if (se(t)) {
6265
+ var he = [];
6116
6266
  return a && a.call(t, function(e, n) {
6117
- ge.push(y(n, t, !0) + " => " + y(e, t));
6118
- }), ve("Map", i.call(t), ge, g);
6267
+ he.push(y(n, t, !0) + " => " + y(e, t));
6268
+ }), _e("Map", i.call(t), he, g);
6119
6269
  }
6120
- if (de(t)) {
6121
- var Ce = [];
6270
+ if (ue(t)) {
6271
+ var Se = [];
6122
6272
  return l && l.call(t, function(e) {
6123
- Ce.push(y(e, t));
6124
- }), ve("Set", c.call(t), Ce, g);
6125
- }
6126
- if (le(t)) return _e("WeakMap");
6127
- if (fe(t)) return _e("WeakSet");
6128
- if (ue(t)) return _e("WeakRef");
6129
- if (re(t)) return Y(y(Number(t)));
6130
- if (ae(t)) return Y(y(E.call(t)));
6131
- if (ie(t)) return Y(p.call(t));
6132
- if (ne(t)) return Y(y(String(t)));
6273
+ Se.push(y(e, t));
6274
+ }), _e("Set", c.call(t), Se, g);
6275
+ }
6276
+ if (ce(t)) return ge("WeakMap");
6277
+ if (de(t)) return ge("WeakSet");
6278
+ if (le(t)) return ge("WeakRef");
6279
+ if (ne(t)) return X(y(Number(t)));
6280
+ if (K(t)) return X(y(E.call(t)));
6281
+ if (re(t)) return X(p.call(t));
6282
+ if (W(t)) return X(y(String(t)));
6133
6283
  if (typeof window < "u" && t === window) return "{ [object Window] }";
6134
6284
  if (typeof globalThis < "u" && t === globalThis || pe !== void 0 && t === pe) return "{ [object globalThis] }";
6135
- if (!H(t) && !te(t)) {
6136
- var we = Se(t, y), Te = M ? M(t) === Object.prototype : t instanceof Object || t.constructor === Object, Ee = t instanceof Object ? "" : "null prototype", De = !Te && A && Object(t) === t && A in t ? _.call(K(t), 8, -1) : Ee ? "Object" : "", Oe = (Te || typeof t.constructor != "function" ? "" : t.constructor.name ? t.constructor.name + " " : "") + (De || Ee ? "[" + C.call(S.call([], De || [], Ee || []), ": ") + "] " : "");
6137
- return we.length === 0 ? Oe + "{}" : g ? Oe + "{" + xe(we, g) + "}" : Oe + "{ " + C.call(we, ", ") + " }";
6285
+ if (!U(t) && !ee(t)) {
6286
+ var Ce = xe(t, y), we = M ? M(t) === Object.prototype : t instanceof Object || t.constructor === Object, Te = t instanceof Object ? "" : "null prototype", Ee = !we && A && Object(t) === t && A in t ? _.call(ae(t), 8, -1) : Te ? "Object" : "", De = (we || typeof t.constructor != "function" ? "" : t.constructor.name ? t.constructor.name + " " : "") + (Ee || Te ? "[" + C.call(S.call([], Ee || [], Te || []), ": ") + "] " : "");
6287
+ return Ce.length === 0 ? De + "{}" : g ? De + "{" + be(Ce, g) + "}" : De + "{ " + C.call(Ce, ", ") + " }";
6138
6288
  }
6139
6289
  return String(t);
6140
6290
  };
6141
- function ee(e, t, n) {
6291
+ function z(e, t, n) {
6142
6292
  var r = L[n.quoteStyle || t];
6143
6293
  return r + e + r;
6144
6294
  }
6145
- function z(e) {
6146
- return v.call(String(e), /"/g, "&quot;");
6147
- }
6148
6295
  function B(e) {
6149
- return !A || !(typeof e == "object" && (A in e || e[A] !== void 0));
6296
+ return v.call(String(e), /"/g, "&quot;");
6150
6297
  }
6151
6298
  function V(e) {
6152
- return K(e) === "[object Array]" && B(e);
6299
+ return !A || !(typeof e == "object" && (A in e || e[A] !== void 0));
6153
6300
  }
6154
6301
  function H(e) {
6155
- return K(e) === "[object Date]" && B(e);
6302
+ return ae(e) === "[object Array]" && V(e);
6303
+ }
6304
+ function U(e) {
6305
+ return ae(e) === "[object Date]" && V(e);
6306
+ }
6307
+ function ee(e) {
6308
+ return ae(e) === "[object RegExp]" && V(e);
6156
6309
  }
6157
6310
  function te(e) {
6158
- return K(e) === "[object RegExp]" && B(e);
6311
+ return ae(e) === "[object Error]" && V(e);
6159
6312
  }
6160
- function U(e) {
6161
- return K(e) === "[object Error]" && B(e);
6313
+ function W(e) {
6314
+ return ae(e) === "[object String]" && V(e);
6162
6315
  }
6163
6316
  function ne(e) {
6164
- return K(e) === "[object String]" && B(e);
6317
+ return ae(e) === "[object Number]" && V(e);
6165
6318
  }
6166
6319
  function re(e) {
6167
- return K(e) === "[object Number]" && B(e);
6320
+ return ae(e) === "[object Boolean]" && V(e);
6168
6321
  }
6169
- function ie(e) {
6170
- return K(e) === "[object Boolean]" && B(e);
6171
- }
6172
- function W(e) {
6322
+ function G(e) {
6173
6323
  if (k) return e && typeof e == "object" && e instanceof Symbol;
6174
6324
  if (typeof e == "symbol") return !0;
6175
6325
  if (!e || typeof e != "object" || !O) return !1;
@@ -6178,33 +6328,33 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6178
6328
  } catch {}
6179
6329
  return !1;
6180
6330
  }
6181
- function ae(e) {
6331
+ function K(e) {
6182
6332
  if (!e || typeof e != "object" || !E) return !1;
6183
6333
  try {
6184
6334
  return E.call(e), !0;
6185
6335
  } catch {}
6186
6336
  return !1;
6187
6337
  }
6188
- var oe = Object.prototype.hasOwnProperty || function(e) {
6338
+ var ie = Object.prototype.hasOwnProperty || function(e) {
6189
6339
  return e in this;
6190
6340
  };
6191
- function G(e, t) {
6192
- return oe.call(e, t);
6341
+ function q(e, t) {
6342
+ return ie.call(e, t);
6193
6343
  }
6194
- function K(e) {
6344
+ function ae(e) {
6195
6345
  return m.call(e);
6196
6346
  }
6197
- function q(e) {
6347
+ function J(e) {
6198
6348
  if (e.name) return e.name;
6199
6349
  var t = g.call(h.call(e), /^function\s*([\w$]+)/);
6200
6350
  return t ? t[1] : null;
6201
6351
  }
6202
- function se(e, t) {
6352
+ function oe(e, t) {
6203
6353
  if (e.indexOf) return e.indexOf(t);
6204
6354
  for (var n = 0, r = e.length; n < r; n++) if (e[n] === t) return n;
6205
6355
  return -1;
6206
6356
  }
6207
- function ce(e) {
6357
+ function se(e) {
6208
6358
  if (!i || !e || typeof e != "object") return !1;
6209
6359
  try {
6210
6360
  i.call(e);
@@ -6217,7 +6367,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6217
6367
  } catch {}
6218
6368
  return !1;
6219
6369
  }
6220
- function le(e) {
6370
+ function ce(e) {
6221
6371
  if (!u || !e || typeof e != "object") return !1;
6222
6372
  try {
6223
6373
  u.call(e, u);
@@ -6230,14 +6380,14 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6230
6380
  } catch {}
6231
6381
  return !1;
6232
6382
  }
6233
- function ue(e) {
6383
+ function le(e) {
6234
6384
  if (!f || !e || typeof e != "object") return !1;
6235
6385
  try {
6236
6386
  return f.call(e), !0;
6237
6387
  } catch {}
6238
6388
  return !1;
6239
6389
  }
6240
- function de(e) {
6390
+ function ue(e) {
6241
6391
  if (!c || !e || typeof e != "object") return !1;
6242
6392
  try {
6243
6393
  c.call(e);
@@ -6250,7 +6400,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6250
6400
  } catch {}
6251
6401
  return !1;
6252
6402
  }
6253
- function fe(e) {
6403
+ function de(e) {
6254
6404
  if (!d || !e || typeof e != "object") return !1;
6255
6405
  try {
6256
6406
  d.call(e, d);
@@ -6263,18 +6413,18 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6263
6413
  } catch {}
6264
6414
  return !1;
6265
6415
  }
6266
- function J(e) {
6416
+ function fe(e) {
6267
6417
  return !e || typeof e != "object" ? !1 : typeof HTMLElement < "u" && e instanceof HTMLElement ? !0 : typeof e.nodeName == "string" && typeof e.getAttribute == "function";
6268
6418
  }
6269
- function he(e, t) {
6419
+ function me(e, t) {
6270
6420
  if (e.length > t.maxStringLength) {
6271
6421
  var n = e.length - t.maxStringLength, r = "... " + n + " more character" + (n > 1 ? "s" : "");
6272
- return he(_.call(e, 0, t.maxStringLength), t) + r;
6422
+ return me(_.call(e, 0, t.maxStringLength), t) + r;
6273
6423
  }
6274
6424
  var i = R[t.quoteStyle || "single"];
6275
- return i.lastIndex = 0, ee(v.call(v.call(e, i, "\\$1"), /[\x00-\x1f]/g, ge), "single", t);
6425
+ return i.lastIndex = 0, z(v.call(v.call(e, i, "\\$1"), /[\x00-\x1f]/g, he), "single", t);
6276
6426
  }
6277
- function ge(e) {
6427
+ function he(e) {
6278
6428
  var t = e.charCodeAt(0), n = {
6279
6429
  8: "b",
6280
6430
  9: "t",
@@ -6284,21 +6434,21 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6284
6434
  }[t];
6285
6435
  return n ? "\\" + n : "\\x" + (t < 16 ? "0" : "") + y.call(t.toString(16));
6286
6436
  }
6287
- function Y(e) {
6437
+ function X(e) {
6288
6438
  return "Object(" + e + ")";
6289
6439
  }
6290
- function _e(e) {
6440
+ function ge(e) {
6291
6441
  return e + " { ? }";
6292
6442
  }
6293
- function ve(e, t, n, r) {
6294
- var i = r ? xe(n, r) : C.call(n, ", ");
6443
+ function _e(e, t, n, r) {
6444
+ var i = r ? be(n, r) : C.call(n, ", ");
6295
6445
  return e + " (" + t + ") {" + i + "}";
6296
6446
  }
6297
- function ye(e) {
6298
- for (var t = 0; t < e.length; t++) if (se(e[t], "\n") >= 0) return !1;
6447
+ function ve(e) {
6448
+ for (var t = 0; t < e.length; t++) if (oe(e[t], "\n") >= 0) return !1;
6299
6449
  return !0;
6300
6450
  }
6301
- function be(e, t) {
6451
+ function ye(e, t) {
6302
6452
  var n;
6303
6453
  if (e.indent === " ") n = " ";
6304
6454
  else if (typeof e.indent == "number" && e.indent > 0) n = C.call(Array(e.indent + 1), " ");
@@ -6308,23 +6458,23 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6308
6458
  prev: C.call(Array(t + 1), n)
6309
6459
  };
6310
6460
  }
6311
- function xe(e, t) {
6461
+ function be(e, t) {
6312
6462
  if (e.length === 0) return "";
6313
6463
  var n = "\n" + t.prev + t.base;
6314
6464
  return n + C.call(e, "," + n) + "\n" + t.prev;
6315
6465
  }
6316
- function Se(e, t) {
6317
- var n = V(e), r = [];
6466
+ function xe(e, t) {
6467
+ var n = H(e), r = [];
6318
6468
  if (n) {
6319
6469
  r.length = e.length;
6320
- for (var i = 0; i < e.length; i++) r[i] = G(e, i) ? t(e[i], e) : "";
6470
+ for (var i = 0; i < e.length; i++) r[i] = q(e, i) ? t(e[i], e) : "";
6321
6471
  }
6322
6472
  var a = typeof D == "function" ? D(e) : [], o;
6323
6473
  if (k) {
6324
6474
  o = {};
6325
6475
  for (var s = 0; s < a.length; s++) o["$" + a[s]] = a[s];
6326
6476
  }
6327
- for (var c in e) G(e, c) && (n && String(Number(c)) === c && c < e.length || k && o["$" + c] instanceof Symbol || (x.call(/[^\w$]/, c) ? r.push(t(c, e) + ": " + t(e[c], e)) : r.push(c + ": " + t(e[c], e))));
6477
+ for (var c in e) q(e, c) && (n && String(Number(c)) === c && c < e.length || k && o["$" + c] instanceof Symbol || (x.call(/[^\w$]/, c) ? r.push(t(c, e) + ": " + t(e[c], e)) : r.push(c + ": " + t(e[c], e))));
6328
6478
  if (typeof D == "function") for (var l = 0; l < a.length; l++) j.call(e, a[l]) && r.push("[" + t(a[l]) + "]: " + t(e[a[l]], e));
6329
6479
  return r;
6330
6480
  }
@@ -6332,24 +6482,24 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6332
6482
  t.exports = function(e) {
6333
6483
  return typeof e == "string" || typeof e == "symbol";
6334
6484
  };
6335
- })), $ = /* @__PURE__ */ t(((e, t) => {
6485
+ })), Lt = /* @__PURE__ */ t(((e, t) => {
6336
6486
  t.exports = function(e) {
6337
6487
  return !!e && (typeof e == "function" || typeof e == "object");
6338
6488
  };
6339
- })), Lt = /* @__PURE__ */ t(((e, t) => {
6340
- var n = X(), r = Ft(), i = It(), a = $();
6489
+ })), Rt = /* @__PURE__ */ t(((e, t) => {
6490
+ var n = Z(), r = Ft(), i = It(), a = Lt();
6341
6491
  t.exports = function(e, t) {
6342
6492
  if (!a(e)) throw new n("Assertion failed: Type(O) is not Object");
6343
6493
  if (!i(t)) throw new n("Assertion failed: P is not a Property Key, got " + r(t));
6344
6494
  return e[t];
6345
6495
  };
6346
- })), Rt = /* @__PURE__ */ t(((e, t) => {
6347
- var n = X(), r = Ft(), i = It();
6496
+ })), zt = /* @__PURE__ */ t(((e, t) => {
6497
+ var n = Z(), r = Ft(), i = It();
6348
6498
  t.exports = function(e, t) {
6349
6499
  if (!i(t)) throw new n("Assertion failed: P is not a Property Key, got " + r(t));
6350
6500
  return e[t];
6351
6501
  };
6352
- })), zt = /* @__PURE__ */ t(((e, t) => {
6502
+ })), Bt = /* @__PURE__ */ t(((e, t) => {
6353
6503
  var n = Function.prototype.toString, r = typeof Reflect == "object" && Reflect !== null && Reflect.apply, i, a;
6354
6504
  if (typeof r == "function" && typeof Object.defineProperty == "function") try {
6355
6505
  i = Object.defineProperty({}, "length", { get: function() {
@@ -6404,10 +6554,10 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6404
6554
  var t = l.call(e);
6405
6555
  return t !== d && t !== f && !/^\[object HTML/.test(t) ? !1 : c(e);
6406
6556
  };
6407
- })), Bt = /* @__PURE__ */ t(((e, t) => {
6408
- t.exports = zt();
6409
6557
  })), Vt = /* @__PURE__ */ t(((e, t) => {
6410
- var n = X(), r = Rt(), i = Bt(), a = It(), o = Ft();
6558
+ t.exports = Bt();
6559
+ })), Ht = /* @__PURE__ */ t(((e, t) => {
6560
+ var n = Z(), r = zt(), i = Vt(), a = It(), o = Ft();
6411
6561
  t.exports = function(e, t) {
6412
6562
  if (!a(t)) throw new n("Assertion failed: P is not a Property Key");
6413
6563
  var s = r(e, t);
@@ -6416,13 +6566,13 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6416
6566
  return s;
6417
6567
  }
6418
6568
  };
6419
- })), Ht = /* @__PURE__ */ t(((e, t) => {
6569
+ })), Ut = /* @__PURE__ */ t(((e, t) => {
6420
6570
  var n = ct();
6421
6571
  t.exports = function() {
6422
6572
  return n() && !!Symbol.toStringTag;
6423
6573
  };
6424
- })), Ut = /* @__PURE__ */ t(((e, t) => {
6425
- var n = Q(), r = Ht()(), i = xt(), a = ot(), o;
6574
+ })), Wt = /* @__PURE__ */ t(((e, t) => {
6575
+ var n = $(), r = Ut()(), i = xt(), a = ot(), o;
6426
6576
  if (r) {
6427
6577
  var s = n("RegExp.prototype.exec"), c = {}, l = function() {
6428
6578
  throw c;
@@ -6447,12 +6597,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6447
6597
  };
6448
6598
  }
6449
6599
  t.exports = o;
6450
- })), Wt = /* @__PURE__ */ t(((e, t) => {
6600
+ })), Gt = /* @__PURE__ */ t(((e, t) => {
6451
6601
  t.exports = function(e) {
6452
6602
  return !!e;
6453
6603
  };
6454
- })), Gt = /* @__PURE__ */ t(((e, t) => {
6455
- var n = Z()("%Symbol.match%", !0), r = Ut(), i = $(), a = Wt();
6604
+ })), Kt = /* @__PURE__ */ t(((e, t) => {
6605
+ var n = Q()("%Symbol.match%", !0), r = Wt(), i = Lt(), a = Gt();
6456
6606
  t.exports = function(e) {
6457
6607
  if (!i(e)) return !1;
6458
6608
  if (n) {
@@ -6461,19 +6611,19 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6461
6611
  }
6462
6612
  return r(e);
6463
6613
  };
6464
- })), Kt = /* @__PURE__ */ t(((e, t) => {
6465
- var n = Z()("%String%"), r = X();
6614
+ })), qt = /* @__PURE__ */ t(((e, t) => {
6615
+ var n = Q()("%String%"), r = Z();
6466
6616
  t.exports = function(e) {
6467
6617
  if (typeof e == "symbol") throw new r("Cannot convert a Symbol value to a string");
6468
6618
  return n(e);
6469
6619
  };
6470
- })), qt = /* @__PURE__ */ t(((e, t) => {
6471
- var n = X();
6620
+ })), Jt = /* @__PURE__ */ t(((e, t) => {
6621
+ var n = Z();
6472
6622
  t.exports = function(e) {
6473
6623
  if (e == null) throw new n(arguments.length > 0 && arguments[1] || "Cannot call method on " + e);
6474
6624
  return e;
6475
6625
  };
6476
- })), Jt = /* @__PURE__ */ t(((e, t) => {
6626
+ })), Yt = /* @__PURE__ */ t(((e, t) => {
6477
6627
  var n = function() {
6478
6628
  return typeof function() {}.name == "string";
6479
6629
  }, r = Object.getOwnPropertyDescriptor;
@@ -6491,21 +6641,21 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6491
6641
  n.boundFunctionsHaveNames = function() {
6492
6642
  return n() && typeof i == "function" && function() {}.bind().name !== "";
6493
6643
  }, t.exports = n;
6494
- })), Yt = /* @__PURE__ */ t(((e, t) => {
6495
- var n = St(), r = Ct()(), i = Jt().functionsHaveConfigurableNames(), a = X();
6644
+ })), Xt = /* @__PURE__ */ t(((e, t) => {
6645
+ var n = St(), r = Ct()(), i = Yt().functionsHaveConfigurableNames(), a = Z();
6496
6646
  t.exports = function(e, t) {
6497
6647
  if (typeof e != "function") throw new a("`fn` is not a function");
6498
6648
  return (!(arguments.length > 2 && arguments[2]) || i) && (r ? n(e, "name", t, !0, !0) : n(e, "name", t)), e;
6499
6649
  };
6500
- })), Xt = /* @__PURE__ */ t(((e, t) => {
6501
- var n = Yt(), r = X(), i = Object;
6650
+ })), Zt = /* @__PURE__ */ t(((e, t) => {
6651
+ var n = Xt(), r = Z(), i = Object;
6502
6652
  t.exports = n(function() {
6503
6653
  if (this == null || this !== i(this)) throw new r("RegExp.prototype.flags getter called on non-object");
6504
6654
  var e = "";
6505
6655
  return this.hasIndices && (e += "d"), this.global && (e += "g"), this.ignoreCase && (e += "i"), this.multiline && (e += "m"), this.dotAll && (e += "s"), this.unicode && (e += "u"), this.unicodeSets && (e += "v"), this.sticky && (e += "y"), e;
6506
6656
  }, "get flags", !0);
6507
- })), Zt = /* @__PURE__ */ t(((e, t) => {
6508
- var n = Xt(), r = At().supportsDescriptors, i = Object.getOwnPropertyDescriptor;
6657
+ })), Qt = /* @__PURE__ */ t(((e, t) => {
6658
+ var n = Zt(), r = At().supportsDescriptors, i = Object.getOwnPropertyDescriptor;
6509
6659
  t.exports = function() {
6510
6660
  if (r && /a/gim.flags === "gim") {
6511
6661
  var e = i(RegExp.prototype, "flags");
@@ -6520,8 +6670,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6520
6670
  }
6521
6671
  return n;
6522
6672
  };
6523
- })), Qt = /* @__PURE__ */ t(((e, t) => {
6524
- var n = At().supportsDescriptors, r = Zt(), i = ot(), a = Object.defineProperty, o = Ge(), s = bt(), c = /a/;
6673
+ })), $t = /* @__PURE__ */ t(((e, t) => {
6674
+ var n = At().supportsDescriptors, r = Qt(), i = ot(), a = Object.defineProperty, o = Ge(), s = bt(), c = /a/;
6525
6675
  t.exports = function() {
6526
6676
  if (!n || !s) throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");
6527
6677
  var e = r(), t = s(c), l = i(t, "flags");
@@ -6531,29 +6681,29 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6531
6681
  get: e
6532
6682
  }), e;
6533
6683
  };
6534
- })), $t = /* @__PURE__ */ t(((e, t) => {
6535
- var n = At(), r = Et(), i = Xt(), a = Zt(), o = Qt(), s = r(a());
6684
+ })), en = /* @__PURE__ */ t(((e, t) => {
6685
+ var n = At(), r = Et(), i = Zt(), a = Qt(), o = $t(), s = r(a());
6536
6686
  n(s, {
6537
6687
  getPolyfill: a,
6538
6688
  implementation: i,
6539
6689
  shim: o
6540
6690
  }), t.exports = s;
6541
- })), en = /* @__PURE__ */ t(((e, t) => {
6691
+ })), tn = /* @__PURE__ */ t(((e, t) => {
6542
6692
  t.exports = function(e) {
6543
6693
  return typeof e == "number" && e >= 55296 && e <= 56319;
6544
6694
  };
6545
- })), tn = /* @__PURE__ */ t(((e, t) => {
6695
+ })), nn = /* @__PURE__ */ t(((e, t) => {
6546
6696
  t.exports = function(e) {
6547
6697
  return typeof e == "number" && e >= 56320 && e <= 57343;
6548
6698
  };
6549
- })), nn = /* @__PURE__ */ t(((e, t) => {
6550
- var n = Z(), r = X(), i = n("%String.fromCharCode%"), a = en(), o = tn();
6699
+ })), rn = /* @__PURE__ */ t(((e, t) => {
6700
+ var n = Q(), r = Z(), i = n("%String.fromCharCode%"), a = tn(), o = nn();
6551
6701
  t.exports = function(e, t) {
6552
6702
  if (!a(e) || !o(t)) throw new r("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");
6553
6703
  return i(e) + i(t);
6554
6704
  };
6555
- })), rn = /* @__PURE__ */ t(((e, t) => {
6556
- var n = X(), r = Q(), i = en(), a = tn(), o = nn(), s = r("String.prototype.charAt"), c = r("String.prototype.charCodeAt");
6705
+ })), an = /* @__PURE__ */ t(((e, t) => {
6706
+ var n = Z(), r = $(), i = tn(), a = nn(), o = rn(), s = r("String.prototype.charAt"), c = r("String.prototype.charCodeAt");
6557
6707
  t.exports = function(e, t) {
6558
6708
  if (typeof e != "string") throw new n("Assertion failed: `string` must be a String");
6559
6709
  var r = e.length;
@@ -6580,22 +6730,22 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6580
6730
  "[[IsUnpairedSurrogate]]": !0
6581
6731
  };
6582
6732
  };
6583
- })), an = /* @__PURE__ */ t(((e, t) => {
6733
+ })), on = /* @__PURE__ */ t(((e, t) => {
6584
6734
  var n = rt();
6585
6735
  t.exports = function(e) {
6586
6736
  return (typeof e == "number" || typeof e == "bigint") && !n(e) && e !== Infinity && e !== -Infinity;
6587
6737
  };
6588
- })), on = /* @__PURE__ */ t(((e, t) => {
6589
- var n = Ze(), r = Qe(), i = rt(), a = an();
6738
+ })), sn = /* @__PURE__ */ t(((e, t) => {
6739
+ var n = Ze(), r = Qe(), i = rt(), a = on();
6590
6740
  t.exports = function(e) {
6591
6741
  if (typeof e != "number" || i(e) || !a(e)) return !1;
6592
6742
  var t = n(e);
6593
6743
  return r(t) === t;
6594
6744
  };
6595
- })), sn = /* @__PURE__ */ t(((e, t) => {
6596
- t.exports = 2 ** 53 - 1 || 9007199254740991;
6597
6745
  })), cn = /* @__PURE__ */ t(((e, t) => {
6598
- var n = rn(), r = X(), i = on(), a = sn();
6746
+ t.exports = 2 ** 53 - 1 || 9007199254740991;
6747
+ })), ln = /* @__PURE__ */ t(((e, t) => {
6748
+ var n = an(), r = Z(), i = sn(), a = cn();
6599
6749
  t.exports = function(e, t, o) {
6600
6750
  if (typeof e != "string") throw new r("Assertion failed: `S` must be a String");
6601
6751
  if (!i(t) || t < 0 || t > a) throw new r("Assertion failed: `length` must be an integer >= 0 and <= 2**53");
@@ -6604,8 +6754,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6604
6754
  var s = e.length;
6605
6755
  return t + 1 >= s ? t + 1 : t + n(e, t)["[[CodeUnitCount]]"];
6606
6756
  };
6607
- })), ln = /* @__PURE__ */ t(((e, t) => {
6608
- var n = X();
6757
+ })), un = /* @__PURE__ */ t(((e, t) => {
6758
+ var n = Z();
6609
6759
  t.exports = function(e, t) {
6610
6760
  if (typeof t != "boolean") throw new n("Assertion failed: Type(done) is not Boolean");
6611
6761
  return {
@@ -6613,8 +6763,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6613
6763
  done: t
6614
6764
  };
6615
6765
  };
6616
- })), un = /* @__PURE__ */ t(((e, t) => {
6617
- var n = X(), r = xt(), i = {
6766
+ })), dn = /* @__PURE__ */ t(((e, t) => {
6767
+ var n = Z(), r = xt(), i = {
6618
6768
  __proto__: null,
6619
6769
  "[[Configurable]]": !0,
6620
6770
  "[[Enumerable]]": !0,
@@ -6630,8 +6780,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6630
6780
  if (a && o) throw new n("Property Descriptors may not be both accessor and data descriptors");
6631
6781
  return !0;
6632
6782
  };
6633
- })), dn = /* @__PURE__ */ t(((e, t) => {
6634
- var n = Ct(), r = st(), i = n.hasArrayLengthDefineBug(), a = i && jt(), o = Q()("Object.prototype.propertyIsEnumerable");
6783
+ })), fn = /* @__PURE__ */ t(((e, t) => {
6784
+ var n = Ct(), r = st(), i = n.hasArrayLengthDefineBug(), a = i && jt(), o = $()("Object.prototype.propertyIsEnumerable");
6635
6785
  t.exports = function(e, t, n, s, c, l) {
6636
6786
  if (!r) {
6637
6787
  if (!e(l) || !l["[[Configurable]]"] || !l["[[Writable]]"] || c in s && o(s, c) !== !!l["[[Enumerable]]"]) return !1;
@@ -6640,32 +6790,32 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6640
6790
  }
6641
6791
  return i && c === "length" && "[[Value]]" in l && a(s) && s.length !== l["[[Value]]"] ? (s.length = l["[[Value]]"], s.length === l["[[Value]]"]) : (r(s, c, n(l)), !0);
6642
6792
  };
6643
- })), fn = /* @__PURE__ */ t(((e, t) => {
6793
+ })), pn = /* @__PURE__ */ t(((e, t) => {
6644
6794
  t.exports = function(e) {
6645
6795
  if (e === void 0) return e;
6646
6796
  var t = {};
6647
6797
  return "[[Value]]" in e && (t.value = e["[[Value]]"]), "[[Writable]]" in e && (t.writable = !!e["[[Writable]]"]), "[[Get]]" in e && (t.get = e["[[Get]]"]), "[[Set]]" in e && (t.set = e["[[Set]]"]), "[[Enumerable]]" in e && (t.enumerable = !!e["[[Enumerable]]"]), "[[Configurable]]" in e && (t.configurable = !!e["[[Configurable]]"]), t;
6648
6798
  };
6649
- })), pn = /* @__PURE__ */ t(((e, t) => {
6650
- var n = X(), r = un(), i = fn();
6799
+ })), mn = /* @__PURE__ */ t(((e, t) => {
6800
+ var n = Z(), r = dn(), i = pn();
6651
6801
  t.exports = function(e) {
6652
6802
  if (e !== void 0 && !r(e)) throw new n("Assertion failed: `Desc` must be a Property Descriptor");
6653
6803
  return i(e);
6654
6804
  };
6655
- })), mn = /* @__PURE__ */ t(((e, t) => {
6656
- var n = X(), r = xt(), i = un();
6805
+ })), hn = /* @__PURE__ */ t(((e, t) => {
6806
+ var n = Z(), r = xt(), i = dn();
6657
6807
  t.exports = function(e) {
6658
6808
  if (e === void 0) return !1;
6659
6809
  if (!i(e)) throw new n("Assertion failed: `Desc` must be a Property Descriptor");
6660
6810
  return !(!r(e, "[[Value]]") && !r(e, "[[Writable]]"));
6661
6811
  };
6662
- })), hn = /* @__PURE__ */ t(((e, t) => {
6812
+ })), gn = /* @__PURE__ */ t(((e, t) => {
6663
6813
  var n = rt();
6664
6814
  t.exports = function(e, t) {
6665
6815
  return e === t ? e === 0 ? 1 / e == 1 / t : !0 : n(e) && n(t);
6666
6816
  };
6667
- })), gn = /* @__PURE__ */ t(((e, t) => {
6668
- var n = xt(), r = X(), i = $(), a = Bt(), o = Wt();
6817
+ })), _n = /* @__PURE__ */ t(((e, t) => {
6818
+ var n = xt(), r = Z(), i = Lt(), a = Vt(), o = Gt();
6669
6819
  t.exports = function(e) {
6670
6820
  if (!i(e)) throw new r("ToPropertyDescriptor requires an object");
6671
6821
  var t = {};
@@ -6682,8 +6832,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6682
6832
  if ((n(t, "[[Get]]") || n(t, "[[Set]]")) && (n(t, "[[Value]]") || n(t, "[[Writable]]"))) throw new r("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");
6683
6833
  return t;
6684
6834
  };
6685
- })), _n = /* @__PURE__ */ t(((e, t) => {
6686
- var n = X(), r = $(), i = un(), a = dn(), o = pn(), s = mn(), c = It(), l = hn(), u = gn();
6835
+ })), vn = /* @__PURE__ */ t(((e, t) => {
6836
+ var n = Z(), r = Lt(), i = dn(), a = fn(), o = mn(), s = hn(), c = It(), l = gn(), u = _n();
6687
6837
  t.exports = function(e, t, d) {
6688
6838
  if (!r(e)) throw new n("Assertion failed: Type(O) is not Object");
6689
6839
  if (!c(t)) throw new n("Assertion failed: P is not a Property Key");
@@ -6691,19 +6841,19 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6691
6841
  if (!i(f)) throw new n("Assertion failed: Desc is not a valid Property Descriptor");
6692
6842
  return a(s, l, o, e, t, f);
6693
6843
  };
6694
- })), vn = /* @__PURE__ */ t(((e, t) => {
6844
+ })), yn = /* @__PURE__ */ t(((e, t) => {
6695
6845
  t.exports = function(e) {
6696
6846
  return e === null || typeof e != "function" && typeof e != "object";
6697
6847
  };
6698
- })), yn = /* @__PURE__ */ t(((e, t) => {
6699
- var n = Z(), r = n("%Object.preventExtensions%", !0), i = n("%Object.isExtensible%", !0), a = vn();
6848
+ })), bn = /* @__PURE__ */ t(((e, t) => {
6849
+ var n = Q(), r = n("%Object.preventExtensions%", !0), i = n("%Object.isExtensible%", !0), a = yn();
6700
6850
  t.exports = r ? function(e) {
6701
6851
  return !a(e) && i(e);
6702
6852
  } : function(e) {
6703
6853
  return !a(e);
6704
6854
  };
6705
- })), bn = /* @__PURE__ */ t(((e, t) => {
6706
- var n = X(), r = $(), i = _n(), a = yn(), o = It();
6855
+ })), xn = /* @__PURE__ */ t(((e, t) => {
6856
+ var n = Z(), r = Lt(), i = vn(), a = bn(), o = It();
6707
6857
  t.exports = function(e, t, s, c) {
6708
6858
  if (!r(e)) throw new n("Assertion failed: `homeObject` is not an Object");
6709
6859
  if (!o(t)) throw new n("Assertion failed: `key` is not a Property Key or a Private Name");
@@ -6717,12 +6867,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6717
6867
  "[[Configurable]]": !0
6718
6868
  });
6719
6869
  };
6720
- })), xn = /* @__PURE__ */ t(((e, t) => {
6870
+ })), Sn = /* @__PURE__ */ t(((e, t) => {
6721
6871
  t.exports = function(e, t) {
6722
6872
  for (var n = 0; n < e.length; n += 1) t(e[n], n, e);
6723
6873
  };
6724
- })), Sn = /* @__PURE__ */ t(((e, t) => {
6725
- var n = Ft(), r = X(), i = function(e, t, n) {
6874
+ })), Cn = /* @__PURE__ */ t(((e, t) => {
6875
+ var n = Ft(), r = Z(), i = function(e, t, n) {
6726
6876
  for (var r = e, i; (i = r.next) != null; r = i) if (i.key === t) return r.next = i.next, n || (i.next = e.next, e.next = i), i;
6727
6877
  }, a = function(e, t) {
6728
6878
  if (e) {
@@ -6762,8 +6912,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6762
6912
  };
6763
6913
  return t;
6764
6914
  };
6765
- })), Cn = /* @__PURE__ */ t(((e, t) => {
6766
- var n = Z(), r = Q(), i = Ft(), a = X(), o = n("%Map%", !0), s = r("Map.prototype.get", !0), c = r("Map.prototype.set", !0), l = r("Map.prototype.has", !0), u = r("Map.prototype.delete", !0), d = r("Map.prototype.size", !0);
6915
+ })), wn = /* @__PURE__ */ t(((e, t) => {
6916
+ var n = Q(), r = $(), i = Ft(), a = Z(), o = n("%Map%", !0), s = r("Map.prototype.get", !0), c = r("Map.prototype.set", !0), l = r("Map.prototype.has", !0), u = r("Map.prototype.delete", !0), d = r("Map.prototype.size", !0);
6767
6917
  t.exports = !!o && function() {
6768
6918
  var e, t = {
6769
6919
  assert: function(e) {
@@ -6788,8 +6938,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6788
6938
  };
6789
6939
  return t;
6790
6940
  };
6791
- })), wn = /* @__PURE__ */ t(((e, t) => {
6792
- var n = Z(), r = Q(), i = Ft(), a = Cn(), o = X(), s = n("%WeakMap%", !0), c = r("WeakMap.prototype.get", !0), l = r("WeakMap.prototype.set", !0), u = r("WeakMap.prototype.has", !0), d = r("WeakMap.prototype.delete", !0);
6941
+ })), Tn = /* @__PURE__ */ t(((e, t) => {
6942
+ var n = Q(), r = $(), i = Ft(), a = wn(), o = Z(), s = n("%WeakMap%", !0), c = r("WeakMap.prototype.get", !0), l = r("WeakMap.prototype.set", !0), u = r("WeakMap.prototype.has", !0), d = r("WeakMap.prototype.delete", !0);
6793
6943
  t.exports = s ? function() {
6794
6944
  var e, t, n = {
6795
6945
  assert: function(e) {
@@ -6813,8 +6963,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6813
6963
  };
6814
6964
  return n;
6815
6965
  } : a;
6816
- })), Tn = /* @__PURE__ */ t(((e, t) => {
6817
- var n = X(), r = Ft(), i = Sn(), a = Cn(), o = wn() || a || i;
6966
+ })), En = /* @__PURE__ */ t(((e, t) => {
6967
+ var n = Z(), r = Ft(), i = Cn(), a = wn(), o = Tn() || a || i;
6818
6968
  t.exports = function() {
6819
6969
  var e, t = {
6820
6970
  assert: function(e) {
@@ -6835,8 +6985,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6835
6985
  };
6836
6986
  return t;
6837
6987
  };
6838
- })), En = /* @__PURE__ */ t(((e, t) => {
6839
- var n = xt(), r = Tn()(), i = X(), a = {
6988
+ })), Dn = /* @__PURE__ */ t(((e, t) => {
6989
+ var n = xt(), r = En()(), i = Z(), a = {
6840
6990
  assert: function(e, t) {
6841
6991
  if (!e || typeof e != "object" && typeof e != "function") throw new i("`O` is not an object");
6842
6992
  if (typeof t != "string") throw new i("`slot` must be a string");
@@ -6862,7 +7012,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6862
7012
  }
6863
7013
  };
6864
7014
  Object.freeze && Object.freeze(a), t.exports = a;
6865
- })), Dn = /* @__PURE__ */ t(((e, t) => {
7015
+ })), On = /* @__PURE__ */ t(((e, t) => {
6866
7016
  var n = {
6867
7017
  __proto__: null,
6868
7018
  foo: {}
@@ -6870,8 +7020,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6870
7020
  t.exports = function() {
6871
7021
  return r;
6872
7022
  };
6873
- })), On = /* @__PURE__ */ t(((e, t) => {
6874
- var n = Z()("%Object.create%", !0), r = X(), i = Ye(), a = $(), o = Mt(), s = xn(), c = En(), l = Dn()();
7023
+ })), kn = /* @__PURE__ */ t(((e, t) => {
7024
+ var n = Q()("%Object.create%", !0), r = Z(), i = Ye(), a = Lt(), o = Mt(), s = Sn(), c = Dn(), l = On()();
6875
7025
  t.exports = function(e) {
6876
7026
  if (e !== null && !a(e)) throw new r("Assertion failed: `proto` must be null or an object");
6877
7027
  var t = arguments.length < 2 ? [] : arguments[1];
@@ -6888,8 +7038,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6888
7038
  c.set(u, e, void 0);
6889
7039
  }), u;
6890
7040
  };
6891
- })), kn = /* @__PURE__ */ t(((e, t) => {
6892
- var n = X(), r = $(), i = Q()("RegExp.prototype.exec"), a = Nt(), o = Lt(), s = Bt();
7041
+ })), An = /* @__PURE__ */ t(((e, t) => {
7042
+ var n = Z(), r = Lt(), i = $()("RegExp.prototype.exec"), a = Nt(), o = Rt(), s = Vt();
6893
7043
  t.exports = function(e, t) {
6894
7044
  if (!r(e)) throw new n("Assertion failed: `R` must be an Object");
6895
7045
  if (typeof t != "string") throw new n("Assertion failed: `S` must be a String");
@@ -6901,8 +7051,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6901
7051
  }
6902
7052
  return i(e, t);
6903
7053
  };
6904
- })), An = /* @__PURE__ */ t(((e, t) => {
6905
- var n = X(), r = $(), i = It(), a = hn(), o = function() {
7054
+ })), jn = /* @__PURE__ */ t(((e, t) => {
7055
+ var n = Z(), r = Lt(), i = It(), a = gn(), o = function() {
6906
7056
  try {
6907
7057
  return delete 0, !0;
6908
7058
  } catch {
@@ -6923,31 +7073,31 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6923
7073
  return !1;
6924
7074
  }
6925
7075
  };
6926
- })), jn = /* @__PURE__ */ t(((e, t) => {
7076
+ })), Mn = /* @__PURE__ */ t(((e, t) => {
6927
7077
  t.exports = function(e) {
6928
7078
  return e === null || typeof e != "function" && typeof e != "object";
6929
7079
  };
6930
- })), Mn = /* @__PURE__ */ t(((e, t) => {
6931
- var n = Q(), r = n("Date.prototype.getDay"), i = function(e) {
7080
+ })), Nn = /* @__PURE__ */ t(((e, t) => {
7081
+ var n = $(), r = n("Date.prototype.getDay"), i = function(e) {
6932
7082
  try {
6933
7083
  return r(e), !0;
6934
7084
  } catch {
6935
7085
  return !1;
6936
7086
  }
6937
- }, a = n("Object.prototype.toString"), o = "[object Date]", s = Ht()();
7087
+ }, a = n("Object.prototype.toString"), o = "[object Date]", s = Ut()();
6938
7088
  t.exports = function(e) {
6939
7089
  return typeof e != "object" || !e ? !1 : s ? i(e) : a(e) === o;
6940
7090
  };
6941
- })), Nn = /* @__PURE__ */ t(((e, t) => {
6942
- var n = Q(), r = Ut(), i = n("RegExp.prototype.exec"), a = X();
7091
+ })), Pn = /* @__PURE__ */ t(((e, t) => {
7092
+ var n = $(), r = Wt(), i = n("RegExp.prototype.exec"), a = Z();
6943
7093
  t.exports = function(e) {
6944
7094
  if (!r(e)) throw new a("`regex` must be a RegExp");
6945
7095
  return function(t) {
6946
7096
  return i(e, t) !== null;
6947
7097
  };
6948
7098
  };
6949
- })), Pn = /* @__PURE__ */ t(((e, t) => {
6950
- var n = Q(), r = n("Object.prototype.toString"), i = lt()(), a = Nn();
7099
+ })), Fn = /* @__PURE__ */ t(((e, t) => {
7100
+ var n = $(), r = n("Object.prototype.toString"), i = lt()(), a = Pn();
6951
7101
  if (i) {
6952
7102
  var o = n("Symbol.prototype.toString"), s = a(/^Symbol\(.*\)$/), c = function(e) {
6953
7103
  return typeof e.valueOf() == "symbol" ? s(o(e)) : !1;
@@ -6964,8 +7114,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6964
7114
  } else t.exports = function(e) {
6965
7115
  return !1;
6966
7116
  };
6967
- })), Fn = /* @__PURE__ */ t(((e, t) => {
6968
- var n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol", r = jn(), i = zt(), a = Mn(), o = Pn(), s = function(e, t) {
7117
+ })), In = /* @__PURE__ */ t(((e, t) => {
7118
+ var n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol", r = Mn(), i = Bt(), a = Nn(), o = Fn(), s = function(e, t) {
6969
7119
  if (e == null) throw TypeError("Cannot call method on " + e);
6970
7120
  if (typeof t != "string" || t !== "number" && t !== "string") throw TypeError("hint must be \"string\" or \"number\"");
6971
7121
  var n = t === "string" ? ["toString", "valueOf"] : ["valueOf", "toString"], a, o, s;
@@ -6990,29 +7140,29 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
6990
7140
  }
6991
7141
  return t === "default" && (a(e) || o(e)) && (t = "string"), s(e, t === "default" ? "number" : t);
6992
7142
  };
6993
- })), In = /* @__PURE__ */ t(((e, t) => {
6994
- var n = Fn();
7143
+ })), Ln = /* @__PURE__ */ t(((e, t) => {
7144
+ var n = In();
6995
7145
  t.exports = function(e) {
6996
7146
  return arguments.length > 1 ? n(e, arguments[1]) : n(e);
6997
7147
  };
6998
- })), Ln = /* @__PURE__ */ t(((e, t) => {
6999
- var n = qt(), r = Kt(), i = Q()("String.prototype.replace"), a = /^\s$/.test("᠎"), o = a ? /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/ : /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/, s = a ? /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/ : /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;
7148
+ })), Rn = /* @__PURE__ */ t(((e, t) => {
7149
+ var n = Jt(), r = qt(), i = $()("String.prototype.replace"), a = /^\s$/.test("᠎"), o = a ? /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/ : /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/, s = a ? /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/ : /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;
7000
7150
  t.exports = function() {
7001
7151
  return i(i(r(n(this)), o, ""), s, "");
7002
7152
  };
7003
- })), Rn = /* @__PURE__ */ t(((e, t) => {
7004
- var n = Ln(), r = "​", i = "᠎";
7153
+ })), zn = /* @__PURE__ */ t(((e, t) => {
7154
+ var n = Rn(), r = "​", i = "᠎";
7005
7155
  t.exports = function() {
7006
7156
  return String.prototype.trim && r.trim() === r && i.trim() === i && ("_" + i).trim() === "_" + i && (i + "_").trim() === i + "_" ? String.prototype.trim : n;
7007
7157
  };
7008
- })), zn = /* @__PURE__ */ t(((e, t) => {
7009
- var n = Ct()(), r = St(), i = Rn();
7158
+ })), Bn = /* @__PURE__ */ t(((e, t) => {
7159
+ var n = Ct()(), r = St(), i = zn();
7010
7160
  t.exports = function() {
7011
7161
  var e = i();
7012
7162
  return String.prototype.trim !== e && (n ? r(String.prototype, "trim", e, !0) : r(String.prototype, "trim", e)), e;
7013
7163
  };
7014
- })), Bn = /* @__PURE__ */ t(((e, t) => {
7015
- var n = Et(), r = At(), i = qt(), a = Ln(), o = Rn(), s = zn(), c = n(o()), l = function(e) {
7164
+ })), Vn = /* @__PURE__ */ t(((e, t) => {
7165
+ var n = Et(), r = At(), i = Jt(), a = Rn(), o = zn(), s = Bn(), c = n(o()), l = function(e) {
7016
7166
  return i(e), c(e);
7017
7167
  };
7018
7168
  r(l, {
@@ -7020,12 +7170,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7020
7170
  implementation: a,
7021
7171
  shim: s
7022
7172
  }), t.exports = l;
7023
- })), Vn = /* @__PURE__ */ t(((e, t) => {
7024
- var n = Z(), r = n("%RegExp%"), i = X(), a = n("%parseInt%"), o = Q(), s = Nn(), c = o("String.prototype.slice"), l = s(/^0b[01]+$/i), u = s(/^0o[0-7]+$/i), d = s(/^[-+]0x[0-9a-f]+$/i), f = s(new r("[" + [
7173
+ })), Hn = /* @__PURE__ */ t(((e, t) => {
7174
+ var n = Q(), r = n("%RegExp%"), i = Z(), a = n("%parseInt%"), o = $(), s = Pn(), c = o("String.prototype.slice"), l = s(/^0b[01]+$/i), u = s(/^0o[0-7]+$/i), d = s(/^[-+]0x[0-9a-f]+$/i), f = s(new r("[" + [
7025
7175
  "…",
7026
7176
  "​",
7027
7177
  "￾"
7028
- ].join("") + "]", "g")), p = Bn();
7178
+ ].join("") + "]", "g")), p = Vn();
7029
7179
  t.exports = function e(t) {
7030
7180
  if (typeof t != "string") throw new i("Assertion failed: `argument` is not a String");
7031
7181
  if (l(t)) return +a(c(t, 2), 2);
@@ -7034,40 +7184,40 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7034
7184
  var n = p(t);
7035
7185
  return n === t ? +t : e(n);
7036
7186
  };
7037
- })), Hn = /* @__PURE__ */ t(((e, t) => {
7038
- var n = Z(), r = X(), i = n("%Number%"), a = vn(), o = In(), s = Vn();
7187
+ })), Un = /* @__PURE__ */ t(((e, t) => {
7188
+ var n = Q(), r = Z(), i = n("%Number%"), a = yn(), o = Ln(), s = Hn();
7039
7189
  t.exports = function(e) {
7040
7190
  var t = a(e) ? e : o(e, i);
7041
7191
  if (typeof t == "symbol") throw new r("Cannot convert a Symbol value to a number");
7042
7192
  if (typeof t == "bigint") throw new r("Conversion from 'BigInt' to 'number' is not allowed.");
7043
7193
  return typeof t == "string" ? s(t) : +t;
7044
7194
  };
7045
- })), Un = /* @__PURE__ */ t(((e, t) => {
7195
+ })), Wn = /* @__PURE__ */ t(((e, t) => {
7046
7196
  var n = Qe();
7047
7197
  t.exports = function(e) {
7048
7198
  return typeof e == "bigint" ? e : n(e);
7049
7199
  };
7050
- })), Wn = /* @__PURE__ */ t(((e, t) => {
7051
- var n = Un(), r = X();
7200
+ })), Gn = /* @__PURE__ */ t(((e, t) => {
7201
+ var n = Wn(), r = Z();
7052
7202
  t.exports = function(e) {
7053
7203
  if (typeof e != "number" && typeof e != "bigint") throw new r("argument must be a Number or a BigInt");
7054
7204
  var t = e < 0 ? -n(-e) : n(e);
7055
7205
  return t === 0 ? 0 : t;
7056
7206
  };
7057
- })), Gn = /* @__PURE__ */ t(((e, t) => {
7058
- var n = Hn(), r = Wn(), i = rt(), a = an();
7207
+ })), Kn = /* @__PURE__ */ t(((e, t) => {
7208
+ var n = Un(), r = Gn(), i = rt(), a = on();
7059
7209
  t.exports = function(e) {
7060
7210
  var t = n(e);
7061
7211
  return i(t) || t === 0 ? 0 : a(t) ? r(t) : t;
7062
7212
  };
7063
- })), Kn = /* @__PURE__ */ t(((e, t) => {
7064
- var n = sn(), r = Gn();
7213
+ })), qn = /* @__PURE__ */ t(((e, t) => {
7214
+ var n = cn(), r = Kn();
7065
7215
  t.exports = function(e) {
7066
7216
  var t = r(e);
7067
7217
  return t <= 0 ? 0 : t > n ? n : t;
7068
7218
  };
7069
- })), qn = /* @__PURE__ */ t(((e, t) => {
7070
- var n = Z()("%Object.defineProperty%", !0), r = Ht()(), i = xt(), a = X(), o = r ? Symbol.toStringTag : null;
7219
+ })), Jn = /* @__PURE__ */ t(((e, t) => {
7220
+ var n = Q()("%Object.defineProperty%", !0), r = Ut()(), i = xt(), a = Z(), o = r ? Symbol.toStringTag : null;
7071
7221
  t.exports = function(e, t) {
7072
7222
  var r = arguments.length > 2 && !!arguments[2] && arguments[2].force, s = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
7073
7223
  if (r !== void 0 && typeof r != "boolean" || s !== void 0 && typeof s != "boolean") throw new a("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");
@@ -7078,8 +7228,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7078
7228
  writable: !1
7079
7229
  }) : e[o] = t);
7080
7230
  };
7081
- })), Jn = /* @__PURE__ */ t(((e, t) => {
7082
- var n = Z(), r = lt()(), i = X(), a = $(), o = n("%IteratorPrototype%", !0), s = cn(), c = ln(), l = bn(), u = Lt(), d = On(), f = kn(), p = An(), m = Kn(), h = Kt(), g = En(), _ = qn(), v = function(e, t, n, r) {
7231
+ })), Yn = /* @__PURE__ */ t(((e, t) => {
7232
+ var n = Q(), r = lt()(), i = Z(), a = Lt(), o = n("%IteratorPrototype%", !0), s = ln(), c = un(), l = xn(), u = Rt(), d = kn(), f = An(), p = jn(), m = qn(), h = qt(), g = Dn(), _ = Jn(), v = function(e, t, n, r) {
7083
7233
  if (typeof t != "string") throw new i("`S` must be a string");
7084
7234
  if (typeof n != "boolean") throw new i("`global` must be a boolean");
7085
7235
  if (typeof r != "boolean") throw new i("`fullUnicode` must be a boolean");
@@ -7097,10 +7247,10 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7097
7247
  }, !1)), t.exports = function(e, t, n, r) {
7098
7248
  return new v(e, t, n, r);
7099
7249
  };
7100
- })), Yn = /* @__PURE__ */ t(((e, t) => {
7101
- t.exports = Z();
7102
7250
  })), Xn = /* @__PURE__ */ t(((e, t) => {
7103
- var n = Yn()("%Reflect.construct%", !0), r = _n();
7251
+ t.exports = Q();
7252
+ })), Zn = /* @__PURE__ */ t(((e, t) => {
7253
+ var n = Xn()("%Reflect.construct%", !0), r = vn();
7104
7254
  try {
7105
7255
  r({}, "", { "[[Get]]": function() {} });
7106
7256
  } catch {
@@ -7123,8 +7273,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7123
7273
  } else t.exports = function(e) {
7124
7274
  return typeof e == "function" && !!e.prototype;
7125
7275
  };
7126
- })), Zn = /* @__PURE__ */ t(((e, t) => {
7127
- var n = Z()("%Symbol.species%", !0), r = X(), i = $(), a = Xn();
7276
+ })), Qn = /* @__PURE__ */ t(((e, t) => {
7277
+ var n = Q()("%Symbol.species%", !0), r = Z(), i = Lt(), a = Zn();
7128
7278
  t.exports = function(e, t) {
7129
7279
  if (!i(e)) throw new r("Assertion failed: Type(O) is not Object");
7130
7280
  var o = e.constructor;
@@ -7135,8 +7285,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7135
7285
  if (a(s)) return s;
7136
7286
  throw new r("no constructor found");
7137
7287
  };
7138
- })), Qn = /* @__PURE__ */ t(((e, t) => {
7139
- var n = $();
7288
+ })), $n = /* @__PURE__ */ t(((e, t) => {
7289
+ var n = Lt();
7140
7290
  t.exports = function(e) {
7141
7291
  if (e === null) return "Null";
7142
7292
  if (e === void 0) return "Undefined";
@@ -7145,13 +7295,13 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7145
7295
  if (typeof e == "boolean") return "Boolean";
7146
7296
  if (typeof e == "string") return "String";
7147
7297
  };
7148
- })), $n = /* @__PURE__ */ t(((e, t) => {
7149
- var n = Qn();
7298
+ })), er = /* @__PURE__ */ t(((e, t) => {
7299
+ var n = $n();
7150
7300
  t.exports = function(e) {
7151
7301
  return typeof e == "symbol" ? "Symbol" : typeof e == "bigint" ? "BigInt" : n(e);
7152
7302
  };
7153
- })), er = /* @__PURE__ */ t(((e, t) => {
7154
- var n = Jn(), r = Lt(), i = An(), a = Zn(), o = Kn(), s = Kt(), c = $n(), l = $t(), u = Yt(), d = Q(), f = Z(), p = X(), m = d("String.prototype.indexOf"), h = f("%RegExp%"), g = "flags" in h.prototype, _ = function(e, t) {
7303
+ })), tr = /* @__PURE__ */ t(((e, t) => {
7304
+ var n = Yn(), r = Rt(), i = jn(), a = Qn(), o = qn(), s = qt(), c = er(), l = en(), u = Xt(), d = $(), f = Q(), p = Z(), m = d("String.prototype.indexOf"), h = f("%RegExp%"), g = "flags" in h.prototype, _ = function(e, t) {
7155
7305
  var n, i = "flags" in t ? r(t, "flags") : s(l(t));
7156
7306
  return n = g && typeof i == "string" ? new e(t, i) : e === h ? new e(t.source, i) : new e(t, i), {
7157
7307
  flags: i,
@@ -7164,13 +7314,13 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7164
7314
  var l = s(e), u = _(a(t, h), t), d = u.flags, f = u.matcher;
7165
7315
  return i(f, "lastIndex", o(r(t, "lastIndex")), !0), n(f, l, m(d, "g") > -1, m(d, "u") > -1);
7166
7316
  }, "[Symbol.matchAll]", !0);
7167
- })), tr = /* @__PURE__ */ t(((e, t) => {
7168
- var n = lt()(), r = er();
7317
+ })), nr = /* @__PURE__ */ t(((e, t) => {
7318
+ var n = lt()(), r = tr();
7169
7319
  t.exports = function() {
7170
7320
  return !n || typeof Symbol.matchAll != "symbol" || typeof RegExp.prototype[Symbol.matchAll] != "function" ? r : RegExp.prototype[Symbol.matchAll];
7171
7321
  };
7172
- })), nr = /* @__PURE__ */ t(((e, t) => {
7173
- var n = Nt(), r = Lt(), i = Vt(), a = Gt(), o = Kt(), s = qt(), c = Q(), l = lt()(), u = $t(), d = Z(), f = X(), p = d("%RegExp%"), m = c("String.prototype.indexOf"), h = tr(), g = function(e) {
7322
+ })), rr = /* @__PURE__ */ t(((e, t) => {
7323
+ var n = Nt(), r = Rt(), i = Ht(), a = Kt(), o = qt(), s = Jt(), c = $(), l = lt()(), u = en(), d = Q(), f = Z(), p = d("%RegExp%"), m = c("String.prototype.indexOf"), h = nr(), g = function(e) {
7174
7324
  var t = h();
7175
7325
  if (l && typeof Symbol.matchAll == "symbol") {
7176
7326
  var n = i(e, Symbol.matchAll);
@@ -7191,8 +7341,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7191
7341
  var l = o(t), d = new p(e, "g");
7192
7342
  return n(g(d), d, [l]);
7193
7343
  };
7194
- })), rr = /* @__PURE__ */ t(((e, t) => {
7195
- var n = nr();
7344
+ })), ir = /* @__PURE__ */ t(((e, t) => {
7345
+ var n = rr();
7196
7346
  t.exports = function() {
7197
7347
  if (String.prototype.matchAll) try {
7198
7348
  "".matchAll(RegExp.prototype);
@@ -7201,8 +7351,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7201
7351
  }
7202
7352
  return n;
7203
7353
  };
7204
- })), ir = /* @__PURE__ */ t(((e, t) => {
7205
- var n = At(), r = lt()(), i = ot(), a = rr(), o = tr(), s = Object.defineProperty;
7354
+ })), ar = /* @__PURE__ */ t(((e, t) => {
7355
+ var n = At(), r = lt()(), i = ot(), a = ir(), o = nr(), s = Object.defineProperty;
7206
7356
  t.exports = function() {
7207
7357
  var e = a();
7208
7358
  if (n(String.prototype, { matchAll: e }, { matchAll: function() {
@@ -7229,14 +7379,14 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7229
7379
  }
7230
7380
  return e;
7231
7381
  };
7232
- })), ar = /* @__PURE__ */ t(((e, t) => {
7233
- var n = Et(), r = At(), i = nr(), a = rr(), o = ir(), s = n(i);
7382
+ })), or = /* @__PURE__ */ t(((e, t) => {
7383
+ var n = Et(), r = At(), i = rr(), a = ir(), o = ar(), s = n(i);
7234
7384
  r(s, {
7235
7385
  getPolyfill: a,
7236
7386
  implementation: i,
7237
7387
  shim: o
7238
7388
  }), t.exports = s;
7239
- })), or = /* @__PURE__ */ t(((e, t) => {
7389
+ })), sr = /* @__PURE__ */ t(((e, t) => {
7240
7390
  var n = ne(), { createGenericWasmCommand: r } = se(), i = "\x1B[2J\x1B[H", a = "\x1B[0m", o = "\x1B[7m", s = "\x1B[1m", c = "\x1B[2m", l = "\x1B[36m", u = "\x1B[31m", d = "\x1B[32m", f = class extends n {
7241
7391
  get requiresFilesystem() {
7242
7392
  return !0;
@@ -7272,7 +7422,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7272
7422
  }
7273
7423
  async runNonInteractive() {}
7274
7424
  startRepl(e = {}) {
7275
- return this._dynamicReplActive = !0, this._dynamicReplOpts = e, this._dynamicReplBuffer = "", this._dynamicReplMultiline = !1, this._launchInteractiveReplLoop();
7425
+ return this._dynamicReplActive = !0, this._dynamicReplOpts = e, this._dynamicReplBuffer = "", this._dynamicReplMultiline = !1, typeof this._enterAltScreen == "function" && this._enterAltScreen(), this._launchInteractiveReplLoop();
7276
7426
  }
7277
7427
  run() {
7278
7428
  return this.shouldBeInteractive() ? this._launchInteractiveReplLoop() : Promise.resolve(this.runNonInteractive());
@@ -7347,6 +7497,13 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7347
7497
  this._replCursor > 0 && (this._replInput = this._replInput.slice(0, this._replCursor - 1) + this._replInput.slice(this._replCursor), this._replCursor--, this._renderRepl());
7348
7498
  return;
7349
7499
  }
7500
+ if (e === "^W") {
7501
+ let e = this._replCursor;
7502
+ for (; e > 0 && this._replInput[e - 1] === " ";) e--;
7503
+ for (; e > 0 && this._replInput[e - 1] !== " ";) e--;
7504
+ this._replInput = this._replInput.slice(0, e) + this._replInput.slice(this._replCursor), this._replCursor = e, this._renderRepl();
7505
+ return;
7506
+ }
7350
7507
  if (e === "Delete") {
7351
7508
  this._replCursor < this._replInput.length && (this._replInput = this._replInput.slice(0, this._replCursor) + this._replInput.slice(this._replCursor + 1), this._renderRepl());
7352
7509
  return;
@@ -7485,20 +7642,21 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7485
7642
  return s;
7486
7643
  }
7487
7644
  f.createReplWasmCommand = p, f.createCommand = p, t.exports = f;
7488
- })), sr = /* @__PURE__ */ t(((e, t) => {
7489
- var r = G(), i = K(), a = q(), o = se(), s = U(), c = ne(), l = xe(), u = Ue(), d = V(), f = x(), { isAsyncFilesystemSource: p, resolveFilesystemSource: m } = re(), h = /\$(?:\{([\w\d?#-]+)\}|([\w\d]+|[?#-]))/g, g = d.EventEmitter || d.default || d;
7645
+ })), cr = /* @__PURE__ */ t(((e, t) => {
7646
+ b();
7647
+ var r = ae(), i = J(), a = oe(), o = se(), s = W(), c = ne(), { TtyStream: l } = te(), u = "/.brsh_history", d = xe(), f = Ue(), p = H(), m = x(), { isAsyncFilesystemSource: h, resolveFilesystemSource: g } = re(), _ = /\$(?:\{([\w\d?#-]+)\}|([\w\d]+|[?#-]))/g, v = p.EventEmitter || p.default || p;
7490
7648
  String.prototype.regexIndexOf = function(e, t) {
7491
7649
  let n = this.substring(t || 0).search(e);
7492
7650
  return n >= 0 ? n + (t || 0) : n;
7493
- }, ar().shim();
7494
- var _ = class e extends g {
7651
+ }, or().shim();
7652
+ var S = class e extends v {
7495
7653
  constructor(e) {
7496
7654
  super();
7497
- let { path: t = "/bin", profile: n, motd: i, command: a, interactive: o = !0, subshell: s = !1, hostname: c = "browser", filesystem: l = {}, permissions: u = {}, cwd: d = "/", onFsChange: f, useRealFilesystem: m = !1 } = e;
7655
+ let { path: t = "/bin", profile: n, motd: i, command: a, interactive: o = !0, subshell: s = !1, hostname: c = "browser", filesystem: u = {}, permissions: d = {}, cwd: f = "/", onFsChange: p, useRealFilesystem: m = !1 } = e;
7498
7656
  if (this.context = new r(Object.assign({}, e, {
7499
7657
  clearFn: this.clear.bind(this),
7500
7658
  destroyFn: this.destroy.bind(this),
7501
- onFsChange: typeof f == "function" ? f : null
7659
+ onFsChange: typeof p == "function" ? p : null
7502
7660
  })), this._readonlyContext = Object.freeze({
7503
7661
  getVar: (e) => this.context.getVar(e),
7504
7662
  getAlias: (e) => this.context.getAlias(e),
@@ -7507,10 +7665,21 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7507
7665
  let e = (o ? "i" : "") + (a ? "c" : "");
7508
7666
  e && this.context.setVar("-", e);
7509
7667
  }
7510
- if (this._lastCode = 0, this._subshell = s, this._useRealFilesystem = m, this._profile = n, this._motd = i, this._initialCommand = a || null, this._suppressMotd = !!a, this._loadingFs = null, this._queuedWhileLoading = !1, m) this.context.setNodeFilesystem(d), this.context.setCwd(d), this._loadDefaultCommands(), this._loadBuiltinCommands(!0), this.ready = Promise.resolve(this), s ? this._initializing = !1 : (this._initializing = !0, setTimeout(() => this._init(), 0));
7511
- else if (p(l) || l && typeof l == "object" && p(l.filesystem)) this.context.setFilesystem({}, u), this._loadDefaultCommands(), this._loadBuiltinCommands(!1), this._initializing = !s, this._loadingFs = this._initAsyncFilesystem(l, u, d, n), this.ready = this._loadingFs;
7668
+ if (this._lastCode = 0, this._subshell = s, this._useRealFilesystem = m, this._profile = n, this._motd = i, this._initialCommand = a || null, this._suppressMotd = !!a, this._loadingFs = null, this._queuedWhileLoading = !1, this.stdinStream = new l({
7669
+ columns: 80,
7670
+ rows: 24
7671
+ }), this.stdout = new l({
7672
+ columns: 80,
7673
+ rows: 24,
7674
+ onWrite: (e) => this.emit("data", e)
7675
+ }), this.stderr = new l({
7676
+ columns: 80,
7677
+ rows: 24,
7678
+ onWrite: (e) => this.emit("data", e)
7679
+ }), this._lineBuffer = [], this._cursorPos = 0, this._history = [], this._historyPos = null, this._savedInput = null, this._historyLoaded = !1, this._working = !0, this._promptReady = !1, this._inProgressLine = !1, this._fromLineEditor = !1, this._lastPromptRowOffset = 0, this._pendingCommands = [], s || this._setupTtyStreams(), m) this.context.setNodeFilesystem(f), this.context.setCwd(f), this._loadDefaultCommands(), this._loadBuiltinCommands(!0), this.ready = Promise.resolve(this), s ? this._initializing = !1 : (this._initializing = !0, setTimeout(() => this._init(), 0));
7680
+ else if (h(u) || u && typeof u == "object" && h(u.filesystem)) this.context.setFilesystem({}, d), this._loadDefaultCommands(), this._loadBuiltinCommands(!1), this._initializing = !s, this._loadingFs = this._initAsyncFilesystem(u, d, f, n), this.ready = this._loadingFs;
7512
7681
  else {
7513
- this.context.setFilesystem(l, u), this.context.setCwd(d);
7682
+ this.context.setFilesystem(u, d), this.context.setCwd(f);
7514
7683
  let e = this.context.fs.exists(this.context.getVar("PATH"));
7515
7684
  this._loadDefaultCommands(), this._loadBuiltinCommands(e), this.ready = Promise.resolve(this), s ? this._initializing = !1 : (this._initializing = !0, setTimeout(() => this._init(), 0));
7516
7685
  }
@@ -7526,7 +7695,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7526
7695
  }
7527
7696
  }, o = a();
7528
7697
  try {
7529
- let e = await m(t, n), s = a(), c = [];
7698
+ let e = await g(t, n), s = a(), c = [];
7530
7699
  for (let [e, t] of Object.entries(s)) o[e] !== t && typeof t == "function" && c.push(t);
7531
7700
  let l = this.context._onFsChange;
7532
7701
  this.context._onFsChange = null, this.context.setFilesystem(e.filesystem, e.permissions);
@@ -7550,9 +7719,18 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7550
7719
  get lastCode() {
7551
7720
  return this._lastCode;
7552
7721
  }
7722
+ get stdin() {
7723
+ return this._stdin === void 0 ? this.stdinStream : this._stdin;
7724
+ }
7553
7725
  set stdin(e) {
7554
7726
  this._stdin = e;
7555
7727
  }
7728
+ write(e) {
7729
+ return this.stdinStream.pushData(e), !0;
7730
+ }
7731
+ resize(e, t) {
7732
+ this.setTerminalSize(e, t);
7733
+ }
7556
7734
  onInput(e) {
7557
7735
  if (this.runningCommand && this.runningCommand.onInput && this.runningCommand.captureInput) return this.runningCommand.onInput(e), !0;
7558
7736
  }
@@ -7560,7 +7738,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7560
7738
  this._terminalSize = {
7561
7739
  cols: e,
7562
7740
  rows: t
7563
- }, this.context.setVar("COLUMNS", String(e)), this.context.setVar("LINES", String(t)), this.emit("resize", {
7741
+ }, this.context.setVar("COLUMNS", String(e)), this.context.setVar("LINES", String(t)), this.stdinStream.resize(e, t), this.stdout.resize(e, t), this.stderr.resize(e, t), this.runningCommand && (this.runningCommand.stdinStream && this.runningCommand.stdinStream.resize(e, t), this.runningCommand.stdout && this.runningCommand.stdout.resize(e, t), this.runningCommand.stderr && this.runningCommand.stderr.resize(e, t)), this.emit("resize", {
7564
7742
  cols: e,
7565
7743
  rows: t
7566
7744
  });
@@ -7572,12 +7750,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7572
7750
  };
7573
7751
  }
7574
7752
  _loadDefaultCommands() {
7575
- u.forEach((e) => {
7753
+ f.forEach((e) => {
7576
7754
  this.context.setCommand(e);
7577
7755
  });
7578
7756
  }
7579
7757
  _loadBuiltinCommands(e = !1) {
7580
- l.forEach((e) => {
7758
+ d.forEach((e) => {
7581
7759
  this.context.setCommand(e);
7582
7760
  }), e || this.context.fs.setMode(this.context.getVar("PATH"), 365);
7583
7761
  }
@@ -7651,6 +7829,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7651
7829
  e && await this.onCommand(`source ${e}`, !1);
7652
7830
  }
7653
7831
  onCommand(t, n = !0) {
7832
+ n && !this._subshell && this._promptReady && !this._fromLineEditor && (this.stdout.write(`\r${this.getPrompt()} ${t}\x1b[K\r\n`), this._lineBuffer = [], this._cursorPos = 0), this._fromLineEditor = !1;
7654
7833
  let r = this._splitInput(t), i = this._groupPipes(r), a = !0;
7655
7834
  this._loadingFs && n && (this._queuedWhileLoading = !0);
7656
7835
  let o = this._loadingFs ? Promise.resolve(this._loadingFs) : Promise.resolve(), s = i.reduce((e, { commands: t, op: n }) => e.then(() => {
@@ -7708,9 +7887,13 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7708
7887
  this.emit("stdErr", `${r}: Command not found`), this.lastCode = 1, this.emit("exitCode", this.lastCode);
7709
7888
  return;
7710
7889
  }
7711
- return f.requiresFilesystem && (f.fs = this.context.fs.sandbox()), this._stdin !== void 0 && (f.stdin = this._stdin), this.runningCommand = f, this.runningCommand.on && this.runningCommand.on("flush", (e) => {
7890
+ return f.requiresFilesystem && (f.fs = this.context.fs.sandbox()), this._stdin !== void 0 && (f.stdin = this._stdin), this.runningCommand = f, this.runningCommand.on && (this.runningCommand.on("flush", (e) => {
7712
7891
  this._emitOutput(e);
7713
- }), f.interactive && this.emit("interactive"), f.runCommand().then((e) => {
7892
+ }), this.runningCommand.on("stdout", (e) => {
7893
+ o ? f.stdOut = String(e ?? "") : (this.stdout.write(e), this.emit("stdOutRaw", e));
7894
+ }), this.runningCommand.on("stderr", (e) => {
7895
+ this.stderr.write(e);
7896
+ })), f.interactive && this.emit("interactive"), f.runCommand().then((e) => {
7714
7897
  let t = e.getStdOutput();
7715
7898
  if (o) {
7716
7899
  let e = this.context.fs.absolutePath(o), n = t.filter((e) => e.type === "out").map((e) => e.string), r = s ? (() => {
@@ -7741,7 +7924,196 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7741
7924
  this.destroyed || (this.destroyed = !0, this.emit("status", e.STATUS_DESTROYED), this.emit("exit", t));
7742
7925
  }
7743
7926
  clear() {
7744
- this.emit("clear");
7927
+ this.stdout.write("\x1B[2J\x1B[3J\x1B[H"), this.emit("clear");
7928
+ }
7929
+ _setupTtyStreams() {
7930
+ this.on("stdOut", (e) => {
7931
+ if (this.runningCommand && (this.runningCommand.interactive || this.runningCommand._inAltScreen)) {
7932
+ this.stdout.write(String(e ?? ""));
7933
+ return;
7934
+ }
7935
+ if (typeof e == "string" && e.startsWith("\r")) {
7936
+ this._inProgressLine = !0, this.stdout.write("\r\x1B[K" + e.slice(1));
7937
+ return;
7938
+ }
7939
+ this._inProgressLine &&= (this.stdout.write("\r\n"), !1), this.stdout.write(String(e ?? "") + "\r\n");
7940
+ }), this.on("stdErr", (e) => {
7941
+ this.runningCommand && (this.runningCommand.interactive || this.runningCommand._inAltScreen) || (this._inProgressLine &&= (this.stdout.write("\r\n"), !1), this.stderr.write(String(e ?? "") + "\r\n"));
7942
+ }), this.on("status", (t) => {
7943
+ if (t === e.STATUS_READY) {
7944
+ if (this._inProgressLine &&= (this.stdout.write("\r\n"), !1), this._working = !1, this._promptReady = !0, this._historyLoaded ||= (this._loadHistory(), !0), this._redrawPromptLine(), this._pendingCommands.length > 0) {
7945
+ let e = this._pendingCommands.shift();
7946
+ if (this._pendingCommands.length === 0) {
7947
+ let e = this.context.getVar("-");
7948
+ e && e.includes("c") && this.context.setVar("-", e.replace(/c/g, ""));
7949
+ }
7950
+ this.sendCommand(e);
7951
+ }
7952
+ } else this._working = !0;
7953
+ }), this.stdinStream.on("data", (e) => this._handleStdinData(e)), this.stdinStream.on("end", () => {
7954
+ this.destroyed || this.destroy(0);
7955
+ });
7956
+ }
7957
+ sendCommand(e) {
7958
+ if (!this._promptReady) {
7959
+ this.suppressMotd(), this._pendingCommands.push(e);
7960
+ return;
7961
+ }
7962
+ this.onCommand(e);
7963
+ }
7964
+ _redrawPromptLine() {
7965
+ if (this._working || this.runningCommand && (this.runningCommand.interactive || this.runningCommand._inAltScreen)) return;
7966
+ let e = `${this.getPrompt()} `, t = this._lineBuffer.join(""), n = this._terminalSize && this._terminalSize.cols || 80, r = this._lastPromptRowOffset || 0, i = "";
7967
+ r > 0 && (i += `\x1b[${r}A`), i += `\r\x1b[J${e}${t}`;
7968
+ let a = Math.min(this._cursorPos, this._lineBuffer.length), o = e.length + this._lineBuffer.length, s = e.length + a, c = Math.floor(o / n), l = Math.floor(s / n), u = s % n;
7969
+ if (c > l) i += `\x1b[${c - l}A\r`, u > 0 && (i += `\x1b[${u}C`);
7970
+ else if (o > s) {
7971
+ let e = o - s;
7972
+ i += `\x1b[${e}D`;
7973
+ }
7974
+ this._lastPromptRowOffset = l, this.stdout.write(i);
7975
+ }
7976
+ _loadHistory() {
7977
+ try {
7978
+ let e = this.context.fs._getFileRaw(u);
7979
+ e && typeof e == "string" && e.length > 0 && (this._history = e.split("\n").filter((e) => e.length > 0));
7980
+ } catch {}
7981
+ }
7982
+ _saveHistory() {
7983
+ try {
7984
+ this.context.fs._setFileRaw(u, this._history.join("\n"), !0);
7985
+ } catch {}
7986
+ }
7987
+ _navigateHistory(e) {
7988
+ if (this._history.length !== 0) {
7989
+ if (e === -1) {
7990
+ if (this._historyPos === null) this._savedInput = [...this._lineBuffer], this._historyPos = this._history.length - 1;
7991
+ else if (this._historyPos > 0) this._historyPos--;
7992
+ else return;
7993
+ this._lineBuffer = Array.from(this._history[this._historyPos]);
7994
+ } else {
7995
+ if (this._historyPos === null) return;
7996
+ this._historyPos < this._history.length - 1 ? (this._historyPos++, this._lineBuffer = Array.from(this._history[this._historyPos])) : (this._historyPos = null, this._lineBuffer = this._savedInput ? [...this._savedInput] : [], this._savedInput = null);
7997
+ }
7998
+ this._cursorPos = this._lineBuffer.length, this._redrawPromptLine();
7999
+ }
8000
+ }
8001
+ _wordLeft() {
8002
+ let e = this._cursorPos;
8003
+ for (; e > 0 && this._lineBuffer[e - 1] === " ";) e--;
8004
+ for (; e > 0 && this._lineBuffer[e - 1] !== " ";) e--;
8005
+ return e;
8006
+ }
8007
+ _wordRight() {
8008
+ let e = this._cursorPos, t = this._lineBuffer.length;
8009
+ for (; e < t && this._lineBuffer[e] === " ";) e++;
8010
+ for (; e < t && this._lineBuffer[e] !== " ";) e++;
8011
+ return e;
8012
+ }
8013
+ _handleStdinData(e) {
8014
+ let t = typeof e == "string" ? e : e instanceof Uint8Array || y !== void 0 && y.isBuffer(e) ? new TextDecoder().decode(e) : String(e ?? "");
8015
+ if (this.runningCommand) {
8016
+ let t = this.runningCommand, n = t.stdinStream && t.stdinStream.listenerCount("data") > 1;
8017
+ if (t.captureInput || t.interactive || t._inAltScreen || n) {
8018
+ t.stdinStream.pushData(e);
8019
+ return;
8020
+ }
8021
+ }
8022
+ if (this._working) return;
8023
+ let n = 0;
8024
+ for (; n < t.length;) {
8025
+ let e = t[n], r = t.charCodeAt(n);
8026
+ if (r === 27) {
8027
+ if (t[n + 1] === "b") {
8028
+ this._cursorPos = this._wordLeft(), this._redrawPromptLine(), n += 2;
8029
+ continue;
8030
+ }
8031
+ if (t[n + 1] === "f") {
8032
+ this._cursorPos = this._wordRight(), this._redrawPromptLine(), n += 2;
8033
+ continue;
8034
+ }
8035
+ if (t.charCodeAt(n + 1) === 127 || t.charCodeAt(n + 1) === 8) {
8036
+ let e = this._wordLeft();
8037
+ this._lineBuffer.splice(e, this._cursorPos - e), this._cursorPos = e, this._redrawPromptLine(), n += 2;
8038
+ continue;
8039
+ }
8040
+ if (t[n + 1] === "d") {
8041
+ let e = this._wordRight();
8042
+ this._lineBuffer.splice(this._cursorPos, e - this._cursorPos), this._redrawPromptLine(), n += 2;
8043
+ continue;
8044
+ }
8045
+ if (t[n + 1] === "[" || t[n + 1] === "O") {
8046
+ let e = n + 2;
8047
+ for (; e < t.length && t.charCodeAt(e) >= 32 && t.charCodeAt(e) <= 63;) e++;
8048
+ if (e < t.length) {
8049
+ this._handleEscapeSeq(t.slice(n + 2, e + 1)), n = e + 1;
8050
+ continue;
8051
+ }
8052
+ }
8053
+ n++;
8054
+ continue;
8055
+ }
8056
+ if (r === 4) {
8057
+ if (this._lineBuffer.length === 0) {
8058
+ this.stdout.write("exit\r\n"), this.destroy(0);
8059
+ return;
8060
+ }
8061
+ this._cursorPos < this._lineBuffer.length && (this._lineBuffer.splice(this._cursorPos, 1), this._redrawPromptLine()), n++;
8062
+ continue;
8063
+ }
8064
+ if (r === 13 || r === 10) {
8065
+ let e = this._lineBuffer.join("");
8066
+ this._lineBuffer = [], this._cursorPos = 0, this._historyPos = null, this._savedInput = null, this.stdout.write("\r\n"), e.trim() && (this._history[this._history.length - 1] !== e && this._history.push(e), this._saveHistory()), this._fromLineEditor = !0, this.onCommand(e), r === 13 && t[n + 1] === "\n" && n++, n++;
8067
+ continue;
8068
+ }
8069
+ if (r === 127 || r === 8) {
8070
+ this._cursorPos > 0 && (this._lineBuffer.splice(this._cursorPos - 1, 1), this._cursorPos--, this._redrawPromptLine()), n++;
8071
+ continue;
8072
+ }
8073
+ if (r === 9) {
8074
+ this._handleTab(), n++;
8075
+ continue;
8076
+ }
8077
+ if (r === 1) {
8078
+ this._cursorPos = 0, this._redrawPromptLine(), n++;
8079
+ continue;
8080
+ }
8081
+ if (r === 5) {
8082
+ this._cursorPos = this._lineBuffer.length, this._redrawPromptLine(), n++;
8083
+ continue;
8084
+ }
8085
+ if (r === 21) {
8086
+ this._lineBuffer.splice(0, this._cursorPos), this._cursorPos = 0, this._redrawPromptLine(), n++;
8087
+ continue;
8088
+ }
8089
+ if (r === 11) {
8090
+ this._lineBuffer.splice(this._cursorPos), this._redrawPromptLine(), n++;
8091
+ continue;
8092
+ }
8093
+ if (r === 23) {
8094
+ let e = this._wordLeft();
8095
+ this._lineBuffer.splice(e, this._cursorPos - e), this._cursorPos = e, this._redrawPromptLine(), n++;
8096
+ continue;
8097
+ }
8098
+ if (r === 12) {
8099
+ this.stdout.write("\x1B[2J\x1B[H"), this._redrawPromptLine(), n++;
8100
+ continue;
8101
+ }
8102
+ if (r === 3) {
8103
+ this._lineBuffer = [], this._cursorPos = 0, this._historyPos = null, this._savedInput = null, this.stdout.write("^C\r\n"), this._redrawPromptLine(), n++;
8104
+ continue;
8105
+ }
8106
+ r >= 32 && (this._lineBuffer.splice(this._cursorPos, 0, e), this._cursorPos++, this._redrawPromptLine()), n++;
8107
+ }
8108
+ }
8109
+ _handleEscapeSeq(e) {
8110
+ e === "A" ? this._navigateHistory(-1) : e === "B" ? this._navigateHistory(1) : e === "C" ? this._cursorPos < this._lineBuffer.length && (this._cursorPos++, this._redrawPromptLine()) : e === "D" ? this._cursorPos > 0 && (this._cursorPos--, this._redrawPromptLine()) : e === "1;3D" || e === "1;5D" ? (this._cursorPos = this._wordLeft(), this._redrawPromptLine()) : e === "1;3C" || e === "1;5C" ? (this._cursorPos = this._wordRight(), this._redrawPromptLine()) : e === "H" || e === "1~" || e === "7~" ? (this._cursorPos = 0, this._redrawPromptLine()) : e === "F" || e === "4~" || e === "8~" ? (this._cursorPos = this._lineBuffer.length, this._redrawPromptLine()) : e === "3~" && this._cursorPos < this._lineBuffer.length && (this._lineBuffer.splice(this._cursorPos, 1), this._redrawPromptLine());
8111
+ }
8112
+ _handleTab() {
8113
+ let e = this._lineBuffer.join("").split(" "), t = e.pop(), n = this.tabCompletion(t);
8114
+ if (!n) return;
8115
+ let { options: r, path: i } = n;
8116
+ r.length === 1 ? (e.push(`${i == null ? "" : i.concat("/")}${r[0]}`), this._lineBuffer = e.join(" ").split(""), this._cursorPos = this._lineBuffer.length, this._redrawPromptLine()) : r.length > 1 && (this.stdout.write("\r\n" + r.join(" ") + "\r\n"), this._redrawPromptLine());
7745
8117
  }
7746
8118
  _splitInput(e) {
7747
8119
  let t = e.split("#")[0];
@@ -7853,7 +8225,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7853
8225
  let n = await this._runAndCapture(e[1]);
7854
8226
  t = t.replace(e[0], n);
7855
8227
  }
7856
- let i = t.matchAll(h), a = i.next();
8228
+ let i = t.matchAll(_), a = i.next();
7857
8229
  for (; !a.done;) {
7858
8230
  let n = a.value[1] || a.value[2], r = this.context.getVar(n);
7859
8231
  t = t.replace(new RegExp(e._escapeRegExp(a.value[0]), "g"), String(r)), a = i.next();
@@ -7959,8 +8331,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7959
8331
  }
7960
8332
  static async create(t = {}) {
7961
8333
  let { filesystem: n, permissions: r, ...i } = t;
7962
- if (p(n) || n && typeof n == "object" && p(n.filesystem)) {
7963
- let e = await m(n, r);
8334
+ if (h(n) || n && typeof n == "object" && h(n.filesystem)) {
8335
+ let e = await g(n, r);
7964
8336
  n = e.filesystem, r = e.permissions;
7965
8337
  }
7966
8338
  let a = new e(Object.assign({}, i, {
@@ -7973,9 +8345,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
7973
8345
  return e.create(Object.assign({}, n, { filesystem: t }));
7974
8346
  }
7975
8347
  };
7976
- _.STATUS_READY = "READY", _.STATUS_WORKING = "WORKING", _.STATUS_DESTROYED = "DESTROYED", _.Command = s, _.InteractiveCommand = c, _.WasmCommand = o, _.createWasmCommand = o.createGenericWasmCommand || o.createCommand, _.ReplCommand = or(), _.FS = f, _.BinaryContainer = re(), _.Storage = _.BinaryContainer.FilesystemStorage, globalThis.shell = _, globalThis.Shell = _, t.exports = _;
8348
+ S.STATUS_READY = "READY", S.STATUS_WORKING = "WORKING", S.STATUS_DESTROYED = "DESTROYED", S.Command = s, S.InteractiveCommand = c, S.WasmCommand = o, S.createWasmCommand = o.createGenericWasmCommand || o.createCommand, S.ReplCommand = sr(), S.FS = m, S.BinaryContainer = re(), S.Storage = S.BinaryContainer.FilesystemStorage, globalThis.shell = S, globalThis.Shell = S, t.exports = S;
7977
8349
  }));
7978
8350
  //#endregion
7979
- export default sr();
8351
+ export default cr();
7980
8352
 
7981
8353
  //# sourceMappingURL=shell.es.js.map