brsh 3.7.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/Readme.md +128 -0
- package/dist/shell.es.js +633 -458
- package/dist/shell.es.js.map +1 -1
- package/dist/shell.min.js +18 -18
- package/dist/shell.min.js.map +1 -1
- package/dist/wbt.es.js +626 -451
- package/dist/wbt.es.js.map +1 -1
- package/dist/wbt.min.js +12 -12
- package/dist/wbt.min.js.map +1 -1
- package/lib/Command.js +3 -2
- package/lib/Readme.md +23 -1
- package/lib/TtyStream.js +12 -2
- package/lib/WasmCommand.js +380 -37
- package/package.json +1 -1
- package/test/wasm-cli.test.js +64 -0
- package/test/wbt.test.js +43 -4
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 (
|
|
99
|
+
if (fe(e, o) || e && fe(e.buffer, o) || s !== void 0 && (fe(e, s) || e && fe(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 (
|
|
140
|
+
if (fe(e, a)) {
|
|
141
141
|
let t = new a(e);
|
|
142
142
|
return b(t.buffer, t.byteOffset, t.byteLength);
|
|
143
143
|
}
|
|
@@ -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 (
|
|
170
|
+
if (fe(e, a) && (e = u.from(e, e.offset, e.byteLength)), fe(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 (
|
|
201
|
+
if (fe(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) ||
|
|
210
|
+
if (o.isView(e) || fe(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
|
|
220
|
+
case "utf-8": return se(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
|
|
226
|
+
case "base64": return ue(e).length;
|
|
227
227
|
default:
|
|
228
|
-
if (i) return r ? -1 :
|
|
228
|
+
if (i) return r ? -1 : se(e).length;
|
|
229
229
|
t = ("" + t).toLowerCase(), i = !0;
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -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 (
|
|
283
|
+
if (fe(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;
|
|
@@ -351,16 +351,16 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
351
351
|
return o;
|
|
352
352
|
}
|
|
353
353
|
function A(e, t, n, r) {
|
|
354
|
-
return
|
|
354
|
+
return de(se(t, e.length - n), e, n, r);
|
|
355
355
|
}
|
|
356
356
|
function j(e, t, n, r) {
|
|
357
|
-
return
|
|
357
|
+
return de(ce(t), e, n, r);
|
|
358
358
|
}
|
|
359
359
|
function M(e, t, n, r) {
|
|
360
|
-
return
|
|
360
|
+
return de(ue(t), e, n, r);
|
|
361
361
|
}
|
|
362
362
|
function N(e, t, n, r) {
|
|
363
|
-
return
|
|
363
|
+
return de(le(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;
|
|
@@ -483,15 +483,15 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
483
483
|
}, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(e, t) {
|
|
484
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
485
|
}, u.prototype.readBigUInt64LE = Z(function(e) {
|
|
486
|
-
e >>>= 0,
|
|
486
|
+
e >>>= 0, X(e, "offset");
|
|
487
487
|
let t = this[e], n = this[e + 7];
|
|
488
|
-
(t === void 0 || n === void 0) &&
|
|
488
|
+
(t === void 0 || n === void 0) && ie(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
491
|
}), u.prototype.readBigUInt64BE = Z(function(e) {
|
|
492
|
-
e >>>= 0,
|
|
492
|
+
e >>>= 0, X(e, "offset");
|
|
493
493
|
let t = this[e], n = this[e + 7];
|
|
494
|
-
(t === void 0 || n === void 0) &&
|
|
494
|
+
(t === void 0 || n === void 0) && ie(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) {
|
|
@@ -519,15 +519,15 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
519
519
|
}, u.prototype.readInt32BE = function(e, t) {
|
|
520
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
521
|
}, u.prototype.readBigInt64LE = Z(function(e) {
|
|
522
|
-
e >>>= 0,
|
|
522
|
+
e >>>= 0, X(e, "offset");
|
|
523
523
|
let t = this[e], n = this[e + 7];
|
|
524
|
-
(t === void 0 || n === void 0) &&
|
|
524
|
+
(t === void 0 || n === void 0) && ie(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
527
|
}), u.prototype.readBigInt64BE = Z(function(e) {
|
|
528
|
-
e >>>= 0,
|
|
528
|
+
e >>>= 0, X(e, "offset");
|
|
529
529
|
let t = this[e], n = this[e + 7];
|
|
530
|
-
(t === void 0 || n === void 0) &&
|
|
530
|
+
(t === void 0 || n === void 0) && ie(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) {
|
|
@@ -572,14 +572,14 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
572
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;
|
|
573
573
|
};
|
|
574
574
|
function U(e, t, n, r, i) {
|
|
575
|
-
|
|
575
|
+
re(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
581
|
function te(e, t, n, r, i) {
|
|
582
|
-
|
|
582
|
+
re(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));
|
|
@@ -631,13 +631,13 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
631
631
|
}, u.prototype.writeFloatBE = function(e, t, n) {
|
|
632
632
|
return ne(this, e, t, !1, n);
|
|
633
633
|
};
|
|
634
|
-
function
|
|
634
|
+
function G(e, t, r, i, a) {
|
|
635
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
|
|
638
|
+
return G(this, e, t, !0, n);
|
|
639
639
|
}, u.prototype.writeDoubleBE = function(e, t, n) {
|
|
640
|
-
return
|
|
640
|
+
return G(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
|
|
672
|
-
function
|
|
673
|
-
|
|
671
|
+
let K = {};
|
|
672
|
+
function q(e, t, n) {
|
|
673
|
+
K[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
|
-
|
|
697
|
+
q("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),
|
|
699
|
+
}, RangeError), q("ERR_INVALID_ARG_TYPE", function(e, t) {
|
|
700
700
|
return `The "${e}" argument must be of type number. Received type ${typeof t}`;
|
|
701
|
-
}, TypeError),
|
|
701
|
+
}, TypeError), q("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 =
|
|
703
|
+
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i = J(String(n)) : typeof n == "bigint" && (i = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (i = J(i)), i += "n"), r += ` It must be ${t}. Received ${i}`, r;
|
|
704
704
|
}, RangeError);
|
|
705
|
-
function
|
|
705
|
+
function J(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
|
|
711
|
-
|
|
710
|
+
function Y(e, t, n) {
|
|
711
|
+
X(t, "offset"), (e[t] === void 0 || e[t + n] === void 0) && ie(t, e.length - (n + 1));
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function re(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
|
|
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 K.ERR_OUT_OF_RANGE("value", i, e);
|
|
717
717
|
}
|
|
718
|
-
|
|
718
|
+
Y(r, i, a);
|
|
719
719
|
}
|
|
720
|
-
function
|
|
721
|
-
if (typeof e != "number") throw new
|
|
720
|
+
function X(e, t) {
|
|
721
|
+
if (typeof e != "number") throw new K.ERR_INVALID_ARG_TYPE(t, "number", e);
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
throw Math.floor(e) === e ? t < 0 ? new
|
|
723
|
+
function ie(e, t, n) {
|
|
724
|
+
throw Math.floor(e) === e ? t < 0 ? new K.ERR_BUFFER_OUT_OF_BOUNDS() : new K.ERR_OUT_OF_RANGE(n || "offset", `>= ${+!!n} and <= ${t}`, e) : (X(e, n), new K.ERR_OUT_OF_RANGE(n || "offset", "an integer", e));
|
|
725
725
|
}
|
|
726
|
-
let
|
|
727
|
-
function
|
|
728
|
-
if (e = e.split("=")[0], e = e.trim().replace(
|
|
726
|
+
let ae = /[^+/0-9A-Za-z-_]/g;
|
|
727
|
+
function oe(e) {
|
|
728
|
+
if (e = e.split("=")[0], e = e.trim().replace(ae, ""), e.length < 2) return "";
|
|
729
729
|
for (; e.length % 4 != 0;) e += "=";
|
|
730
730
|
return e;
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function se(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,25 +767,25 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
767
767
|
}
|
|
768
768
|
return a;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function ce(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
|
|
775
|
+
function le(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
|
|
781
|
-
return t.toByteArray(
|
|
780
|
+
function ue(e) {
|
|
781
|
+
return t.toByteArray(oe(e));
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function de(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
|
|
788
|
+
function fe(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
791
|
function pe(e) {
|
|
@@ -1240,10 +1240,24 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1240
1240
|
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;
|
|
1241
1241
|
}
|
|
1242
1242
|
write(e, t, n) {
|
|
1243
|
-
|
|
1243
|
+
if (e == null) return !0;
|
|
1244
|
+
typeof this._onWrite == "function" && this._onWrite(e), this._isPushing = !0;
|
|
1245
|
+
try {
|
|
1246
|
+
this.emit("data", this._formatChunk(e));
|
|
1247
|
+
} finally {
|
|
1248
|
+
this._isPushing = !1;
|
|
1249
|
+
}
|
|
1250
|
+
return typeof t == "function" ? t() : typeof n == "function" && n(), !0;
|
|
1244
1251
|
}
|
|
1245
1252
|
pushData(e) {
|
|
1246
|
-
e != null
|
|
1253
|
+
if (e != null) {
|
|
1254
|
+
this._isPushing = !0;
|
|
1255
|
+
try {
|
|
1256
|
+
this.emit("data", this._formatChunk(e));
|
|
1257
|
+
} finally {
|
|
1258
|
+
this._isPushing = !1;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1247
1261
|
}
|
|
1248
1262
|
_formatChunk(e) {
|
|
1249
1263
|
return this._encoding ? typeof e == "string" ? e : e instanceof Uint8Array || y !== void 0 && y.isBuffer(e) ? new TextDecoder().decode(e) : String(e) : e;
|
|
@@ -1304,11 +1318,11 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1304
1318
|
columns: n,
|
|
1305
1319
|
rows: o,
|
|
1306
1320
|
onWrite: (e) => this.emit("stderr", e)
|
|
1307
|
-
}), this.
|
|
1321
|
+
}), this._onStdinStreamData = (e) => {
|
|
1308
1322
|
if (!this.captureInput) return;
|
|
1309
1323
|
let t = a(e);
|
|
1310
1324
|
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);
|
|
1311
|
-
});
|
|
1325
|
+
}, this.stdinStream.on("data", this._onStdinStreamData);
|
|
1312
1326
|
}
|
|
1313
1327
|
get name() {
|
|
1314
1328
|
return "unnamed";
|
|
@@ -1366,7 +1380,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1366
1380
|
});
|
|
1367
1381
|
}
|
|
1368
1382
|
};
|
|
1369
|
-
})),
|
|
1383
|
+
})), G = /* @__PURE__ */ t(((e, t) => {
|
|
1370
1384
|
b(), B();
|
|
1371
1385
|
var { BinaryFile: n, SymlinkRef: r } = x(), i = new Uint8Array([
|
|
1372
1386
|
66,
|
|
@@ -1637,7 +1651,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1637
1651
|
}
|
|
1638
1652
|
}
|
|
1639
1653
|
};
|
|
1640
|
-
})),
|
|
1654
|
+
})), K = /* @__PURE__ */ t(((e, t) => {
|
|
1641
1655
|
b();
|
|
1642
1656
|
var n = x(), { BinaryFile: r, SymlinkRef: i } = n;
|
|
1643
1657
|
function a(e) {
|
|
@@ -1662,20 +1676,20 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1662
1676
|
t.exports = class extends n {
|
|
1663
1677
|
constructor(e = "/", t = {}, n = {}, r = null) {
|
|
1664
1678
|
if (super(), t instanceof Uint8Array || t instanceof ArrayBuffer) {
|
|
1665
|
-
let { deserializeBinaryFilesystem: e } =
|
|
1679
|
+
let { deserializeBinaryFilesystem: e } = G(), r = e(t);
|
|
1666
1680
|
t = r.filesystem, n = Object.assign({}, r.permissions, n);
|
|
1667
1681
|
} else if (t && typeof t == "object" && t.filesystem && (t.filesystem instanceof Uint8Array || typeof t.filesystem == "object") && (n = Object.assign({}, t.permissions || {}, n), t = t.filesystem, t instanceof Uint8Array || t instanceof ArrayBuffer)) {
|
|
1668
|
-
let { deserializeBinaryFilesystem: e } =
|
|
1682
|
+
let { deserializeBinaryFilesystem: e } = G(), r = e(t);
|
|
1669
1683
|
t = r.filesystem, n = Object.assign({}, r.permissions, n);
|
|
1670
1684
|
}
|
|
1671
1685
|
a(t), this.fileSystem = t, this.permissions = Object.assign({}, n), this.cwd = e.endsWith("/") ? e : e + "/", this._onChange = r, this._changeScheduled = !1;
|
|
1672
1686
|
}
|
|
1673
1687
|
toBinaryContainer(e = {}) {
|
|
1674
|
-
let { serializeBinaryFilesystem: t } =
|
|
1688
|
+
let { serializeBinaryFilesystem: t } = G();
|
|
1675
1689
|
return t(this.fileSystem, this.permissions, e);
|
|
1676
1690
|
}
|
|
1677
1691
|
static fromBinaryContainer(e, t = {}) {
|
|
1678
|
-
let { deserializeBinaryFilesystem: n } =
|
|
1692
|
+
let { deserializeBinaryFilesystem: n } = G();
|
|
1679
1693
|
return n(e, t);
|
|
1680
1694
|
}
|
|
1681
1695
|
getFileByPath(e) {
|
|
@@ -1853,9 +1867,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1853
1867
|
return null;
|
|
1854
1868
|
}
|
|
1855
1869
|
}, t.exports.BinaryFile = r, t.exports.SymlinkRef = i;
|
|
1856
|
-
})),
|
|
1870
|
+
})), q = /* @__PURE__ */ t(((e, t) => {
|
|
1857
1871
|
t.exports = null;
|
|
1858
|
-
})),
|
|
1872
|
+
})), J = /* @__PURE__ */ t(((e, t) => {
|
|
1859
1873
|
B();
|
|
1860
1874
|
function n(e) {
|
|
1861
1875
|
if (typeof e != "string") throw TypeError("Path must be a string. Received " + JSON.stringify(e));
|
|
@@ -2023,9 +2037,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2023
2037
|
posix: null
|
|
2024
2038
|
};
|
|
2025
2039
|
a.posix = a, t.exports = a;
|
|
2026
|
-
})),
|
|
2040
|
+
})), Y = /* @__PURE__ */ t(((e, t) => {
|
|
2027
2041
|
B();
|
|
2028
|
-
var n =
|
|
2042
|
+
var n = q(), r = J(), i = x();
|
|
2029
2043
|
t.exports = class extends i {
|
|
2030
2044
|
constructor(e, t = null) {
|
|
2031
2045
|
super(), this._onChange = t, this._changeScheduled = !1, this._virtualFiles = {}, this.cwd = this._normalizeCwd(e || z.cwd());
|
|
@@ -2232,8 +2246,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2232
2246
|
}
|
|
2233
2247
|
}
|
|
2234
2248
|
};
|
|
2235
|
-
})),
|
|
2236
|
-
var n =
|
|
2249
|
+
})), re = /* @__PURE__ */ t(((e, t) => {
|
|
2250
|
+
var n = K();
|
|
2237
2251
|
t.exports = class {
|
|
2238
2252
|
constructor(e) {
|
|
2239
2253
|
this.options = e;
|
|
@@ -2267,7 +2281,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2267
2281
|
return this.fs._getFileRaw(t) || null;
|
|
2268
2282
|
}
|
|
2269
2283
|
setNodeFilesystem(e) {
|
|
2270
|
-
let t =
|
|
2284
|
+
let t = Y(), n = this.fs._onChange;
|
|
2271
2285
|
this.fs = new t(e, n);
|
|
2272
2286
|
}
|
|
2273
2287
|
setFilesystem(e, t = {}) {
|
|
@@ -2287,15 +2301,15 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2287
2301
|
typeof this._destroyFn == "function" && this._destroyFn(e);
|
|
2288
2302
|
}
|
|
2289
2303
|
};
|
|
2290
|
-
})),
|
|
2304
|
+
})), X = /* @__PURE__ */ t(((e, t) => {
|
|
2291
2305
|
var n = W();
|
|
2292
2306
|
t.exports = class extends n {
|
|
2293
2307
|
constructor(e, t) {
|
|
2294
2308
|
super(e, t);
|
|
2295
2309
|
}
|
|
2296
2310
|
};
|
|
2297
|
-
})),
|
|
2298
|
-
var n =
|
|
2311
|
+
})), ie = /* @__PURE__ */ t(((e, t) => {
|
|
2312
|
+
var n = X();
|
|
2299
2313
|
function r(e) {
|
|
2300
2314
|
return /^#!\/(sh\.js|bin\/(sh|brsh))/.test(e);
|
|
2301
2315
|
}
|
|
@@ -2487,7 +2501,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2487
2501
|
}
|
|
2488
2502
|
_executeNode(e) {
|
|
2489
2503
|
if (e.type === "function") {
|
|
2490
|
-
let t = e.name, n = e.bodyLines, r = this, i =
|
|
2504
|
+
let t = e.name, n = e.bodyLines, r = this, i = X(), a = class extends i {
|
|
2491
2505
|
static get name() {
|
|
2492
2506
|
return t;
|
|
2493
2507
|
}
|
|
@@ -2687,9 +2701,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2687
2701
|
}
|
|
2688
2702
|
}
|
|
2689
2703
|
}, t.exports.isKnownInterpreter = r;
|
|
2690
|
-
})),
|
|
2704
|
+
})), ae = /* @__PURE__ */ t(((e, t) => {
|
|
2691
2705
|
b();
|
|
2692
|
-
var n =
|
|
2706
|
+
var n = ie(), { BinaryFile: r } = K(), i = 0, a = 6, o = 8, s = 20, c = 28, l = 31, u = 44, d = 54, f = 70, p = 0, m = 2, h = 3, g = 4, _ = 1, v = 2, x = 4, S = 8, C = 1, w = 4, T = class extends n {
|
|
2693
2707
|
get name() {
|
|
2694
2708
|
return "wasm";
|
|
2695
2709
|
}
|
|
@@ -2740,7 +2754,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2740
2754
|
return n[e] ? new TextEncoder().encode(n[e]) : new TextEncoder().encode(e);
|
|
2741
2755
|
}
|
|
2742
2756
|
onInput(e) {
|
|
2743
|
-
if (!this._handlingStreamData) {
|
|
2757
|
+
if (!this._handlingStreamData && !(this.stdinStream && this.stdinStream._isPushing)) {
|
|
2744
2758
|
if (typeof this._externalKeyHandler == "function") {
|
|
2745
2759
|
this._externalKeyHandler(e);
|
|
2746
2760
|
return;
|
|
@@ -2756,7 +2770,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2756
2770
|
run() {
|
|
2757
2771
|
let e = this.script, t = (() => {
|
|
2758
2772
|
try {
|
|
2759
|
-
return
|
|
2773
|
+
return q();
|
|
2760
2774
|
} catch {
|
|
2761
2775
|
return null;
|
|
2762
2776
|
}
|
|
@@ -2824,8 +2838,10 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2824
2838
|
let t = {
|
|
2825
2839
|
1: "",
|
|
2826
2840
|
2: ""
|
|
2827
|
-
}, n = new TextDecoder(), b = new TextEncoder(),
|
|
2828
|
-
|
|
2841
|
+
}, n = new TextDecoder(), b = new TextEncoder(), T = null, E = null, D = !1, O = 0, k = null, A = null, N = null, P = null, F = this.stdin === void 0 || this.stdin === null || this.stdin === this.stdinStream || this.stdin && this.stdin.isTTY, I = !!(this.interactive && F), L = () => {
|
|
2842
|
+
I || !F || (I = !0, this._isInteractive = !0, t[1] &&= (this.stdout && typeof this.stdout.write == "function" && this.stdout.write(t[1]), ""), t[2] &&= (this.stderr && typeof this.stderr.write == "function" && this.stderr.write(t[2]), ""), this.stdinStream && typeof this.stdinStream.setRawMode == "function" && this.stdinStream.setRawMode(!0));
|
|
2843
|
+
}, R = (e, n) => {
|
|
2844
|
+
if (I && (e === 1 || e === 2)) {
|
|
2829
2845
|
if (e === 1 && this.stdout) {
|
|
2830
2846
|
this.stdout.write(n);
|
|
2831
2847
|
return;
|
|
@@ -2839,57 +2855,61 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2839
2855
|
let r = t[e].split("\n");
|
|
2840
2856
|
t[e] = r.pop();
|
|
2841
2857
|
for (let t of r) e === 1 ? this.stdOut = t : this.stdErr = t;
|
|
2842
|
-
},
|
|
2843
|
-
t[1] &&= (
|
|
2844
|
-
},
|
|
2858
|
+
}, ee = () => {
|
|
2859
|
+
t[1] &&= (I && this.stdout ? this.stdout.write(t[1]) : this.stdOut = t[1], ""), t[2] &&= (I && this.stderr ? this.stderr.write(t[2]) : this.stdErr = t[2], "");
|
|
2860
|
+
}, z = [], B = (e) => {
|
|
2845
2861
|
if (!(!e || e.length === 0)) {
|
|
2846
|
-
for (let t = 0; t < e.length; t++)
|
|
2847
|
-
if (
|
|
2848
|
-
let e =
|
|
2849
|
-
|
|
2862
|
+
for (let t = 0; t < e.length; t++) z.push(e[t]);
|
|
2863
|
+
if (A) {
|
|
2864
|
+
let e = A;
|
|
2865
|
+
A = null, e();
|
|
2850
2866
|
}
|
|
2851
2867
|
}
|
|
2852
2868
|
};
|
|
2853
|
-
|
|
2869
|
+
P = (e) => {
|
|
2854
2870
|
this._handlingStreamData = !0;
|
|
2855
2871
|
try {
|
|
2856
|
-
|
|
2872
|
+
B(typeof e == "string" ? b.encode(e) : e instanceof Uint8Array ? e : y !== void 0 && y.isBuffer(e) ? new Uint8Array(e) : b.encode(String(e ?? "")));
|
|
2857
2873
|
} finally {
|
|
2858
2874
|
this._handlingStreamData = !1;
|
|
2859
2875
|
}
|
|
2860
2876
|
}, this._externalKeyHandler = (e) => {
|
|
2861
2877
|
if (this._handlingStreamData) return;
|
|
2862
2878
|
let t = this._keyToBytes(e);
|
|
2863
|
-
t &&
|
|
2864
|
-
},
|
|
2865
|
-
let
|
|
2879
|
+
t && B(t);
|
|
2880
|
+
}, this._onStdinStreamData && this.stdinStream && typeof this.stdinStream.off == "function" && this.stdinStream.off("data", this._onStdinStreamData), F && this.stdinStream && typeof this.stdinStream.on == "function" && this.stdinStream.on("data", P), F && this.stdin && this.stdin !== this.stdinStream && typeof this.stdin.on == "function" && this.stdin.on("data", P);
|
|
2881
|
+
let V = !F && typeof this.stdin == "string" ? b.encode(this.stdin) : !F && this.stdin instanceof Uint8Array ? this.stdin : !F && y !== void 0 && y.isBuffer(this.stdin) ? new Uint8Array(this.stdin) : new Uint8Array(), H = 0, U = this.context && this.context.fs ? this.context.fs : this.fs, te = this.context && this.context.fs && this.context.fs.cwd || this.fs && this.fs.cwd || this.context && typeof this.context.getVar == "function" && this.context.getVar("PWD") || U && U.cwd || "/", W = te.length > 1 && te.endsWith("/") ? te.slice(0, -1) : te, ne = 5, G = new Map([[3, {
|
|
2866
2882
|
type: "preopen",
|
|
2867
2883
|
path: "/",
|
|
2868
2884
|
guestName: "/"
|
|
2869
2885
|
}], [4, {
|
|
2870
2886
|
type: "preopen",
|
|
2871
|
-
path:
|
|
2887
|
+
path: W,
|
|
2872
2888
|
guestName: "."
|
|
2873
|
-
}]]),
|
|
2889
|
+
}]]), K = new Map([
|
|
2890
|
+
[0, 0],
|
|
2891
|
+
[1, 0],
|
|
2892
|
+
[2, 0]
|
|
2893
|
+
]), q = (e) => {
|
|
2874
2894
|
let t = e.split("/").filter(Boolean);
|
|
2875
2895
|
return t.pop(), "/" + t.join("/");
|
|
2876
|
-
},
|
|
2877
|
-
let n =
|
|
2896
|
+
}, J = (e, t) => {
|
|
2897
|
+
let n = G.get(e);
|
|
2878
2898
|
if (!n || n.type !== "preopen" && n.type !== "dir") return null;
|
|
2879
|
-
if (t.startsWith("/")) return
|
|
2880
|
-
if (!t || t === ".") return
|
|
2881
|
-
let r = n.path.endsWith("/") ? n.path : n.path + "/", i =
|
|
2899
|
+
if (t.startsWith("/")) return U.absolutePath(t);
|
|
2900
|
+
if (!t || t === ".") return U.absolutePath(n.path);
|
|
2901
|
+
let r = n.path.endsWith("/") ? n.path : n.path + "/", i = U.absolutePath(r + t), a = U.absolutePath("/" + t);
|
|
2882
2902
|
if (n.path !== "/") {
|
|
2883
|
-
if (
|
|
2884
|
-
if (
|
|
2885
|
-
let e =
|
|
2886
|
-
return
|
|
2887
|
-
}
|
|
2888
|
-
if (
|
|
2889
|
-
let o =
|
|
2890
|
-
return
|
|
2891
|
-
},
|
|
2892
|
-
if (!(!e || e.type !== "file" || !e.dirty || !
|
|
2903
|
+
if (U.exists(i)) return i;
|
|
2904
|
+
if (U.exists(a)) return a;
|
|
2905
|
+
let e = U.exists(q(i));
|
|
2906
|
+
return U.exists(q(a)) && !e ? a : i;
|
|
2907
|
+
}
|
|
2908
|
+
if (U.exists(i)) return i;
|
|
2909
|
+
let o = U.absolutePath(t);
|
|
2910
|
+
return U.exists(o) ? o : i;
|
|
2911
|
+
}, Y = (e) => {
|
|
2912
|
+
if (!(!e || e.type !== "file" || !e.dirty || !U)) try {
|
|
2893
2913
|
let t = !0;
|
|
2894
2914
|
for (let n = 0; n < e.bytes.length; n++) if (e.bytes[n] === 0) {
|
|
2895
2915
|
t = !1;
|
|
@@ -2897,10 +2917,10 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2897
2917
|
}
|
|
2898
2918
|
if (t) {
|
|
2899
2919
|
let t = n.decode(e.bytes);
|
|
2900
|
-
|
|
2920
|
+
U.setFileByPath(e.path, t, !0);
|
|
2901
2921
|
} else {
|
|
2902
2922
|
let t = new Uint8Array(e.bytes.length);
|
|
2903
|
-
t.set(e.bytes),
|
|
2923
|
+
t.set(e.bytes), U.setFileByPath(e.path, new r(t.buffer, "application/octet-stream"), !0);
|
|
2904
2924
|
}
|
|
2905
2925
|
e.dirty = !1;
|
|
2906
2926
|
} catch {}
|
|
@@ -2910,25 +2930,39 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2910
2930
|
COLUMNS: String(this.stdout && this.stdout.columns || this.context && typeof this.context.getVar == "function" && this.context.getVar("COLUMNS") || 80),
|
|
2911
2931
|
LINES: String(this.stdout && this.stdout.rows || this.context && typeof this.context.getVar == "function" && this.context.getVar("LINES") || 24),
|
|
2912
2932
|
...this.context && this.context.vars || {}
|
|
2913
|
-
},
|
|
2914
|
-
fd_write: (e, t, r,
|
|
2915
|
-
if (!
|
|
2916
|
-
let s = new DataView(
|
|
2933
|
+
}, X = Object.entries(re).map(([e, t]) => `${e}=${t}`), ie = new Proxy({
|
|
2934
|
+
fd_write: (e, t, r, a) => {
|
|
2935
|
+
if (!T) return o;
|
|
2936
|
+
let s = new DataView(T.buffer);
|
|
2917
2937
|
if (e === 1 || e === 2) {
|
|
2918
|
-
let
|
|
2938
|
+
let o = 0;
|
|
2939
|
+
for (let i = 0; i < r; i++) {
|
|
2940
|
+
let r = s.getUint32(t + i * 8, !0), a = s.getUint32(t + i * 8 + 4, !0);
|
|
2941
|
+
a > 0 && R(e, n.decode(new Uint8Array(T.buffer, r, a))), o += a;
|
|
2942
|
+
}
|
|
2943
|
+
return s.setUint32(a, o, !0), i;
|
|
2944
|
+
}
|
|
2945
|
+
let c = G.get(e);
|
|
2946
|
+
if (!c) return o;
|
|
2947
|
+
if (c.type === "dev_null" || c.type === "dev_zero") {
|
|
2948
|
+
let e = 0;
|
|
2949
|
+
for (let n = 0; n < r; n++) e += s.getUint32(t + n * 8 + 4, !0);
|
|
2950
|
+
return s.setUint32(a, e, !0), i;
|
|
2951
|
+
}
|
|
2952
|
+
if (c.type === "dev_tty") {
|
|
2953
|
+
let e = 0;
|
|
2919
2954
|
for (let i = 0; i < r; i++) {
|
|
2920
|
-
let r = s.getUint32(t + i * 8, !0),
|
|
2921
|
-
|
|
2955
|
+
let r = s.getUint32(t + i * 8, !0), a = s.getUint32(t + i * 8 + 4, !0);
|
|
2956
|
+
a > 0 && R(1, n.decode(new Uint8Array(T.buffer, r, a))), e += a;
|
|
2922
2957
|
}
|
|
2923
|
-
return s.setUint32(
|
|
2958
|
+
return s.setUint32(a, e, !0), i;
|
|
2924
2959
|
}
|
|
2925
|
-
|
|
2926
|
-
if (!c || c.type !== "file") return a;
|
|
2960
|
+
if (c.type !== "file") return o;
|
|
2927
2961
|
let l = 0;
|
|
2928
2962
|
for (let e = 0; e < r; e++) {
|
|
2929
2963
|
let n = s.getUint32(t + e * 8, !0), r = s.getUint32(t + e * 8 + 4, !0);
|
|
2930
2964
|
if (r > 0) {
|
|
2931
|
-
let e = new Uint8Array(
|
|
2965
|
+
let e = new Uint8Array(T.buffer, n, r), t = c.append ? c.bytes.length : c.pos, i = t + r;
|
|
2932
2966
|
if (i > c.bytes.length) {
|
|
2933
2967
|
let e = new Uint8Array(i);
|
|
2934
2968
|
e.set(c.bytes), c.bytes = e;
|
|
@@ -2936,202 +2970,277 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2936
2970
|
c.bytes.set(e, t), c.pos = t + r, c.dirty = !0, l += r;
|
|
2937
2971
|
}
|
|
2938
2972
|
}
|
|
2939
|
-
return s.setUint32(
|
|
2973
|
+
return s.setUint32(a, l, !0), i;
|
|
2940
2974
|
},
|
|
2941
2975
|
fd_read: (e, t, n, r) => {
|
|
2942
|
-
if (!
|
|
2943
|
-
let
|
|
2944
|
-
if (e === 0) {
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2976
|
+
if (!T) return o;
|
|
2977
|
+
let s = new DataView(T.buffer), c = G.get(e), l = !!(c && c.type === "dev_tty");
|
|
2978
|
+
if (e === 0 || I && e === 2 || l) {
|
|
2979
|
+
(l || e === 2) && L();
|
|
2980
|
+
let o = !!((K.get(e) || 0) & w);
|
|
2981
|
+
if (D) {
|
|
2982
|
+
if ((typeof E?.exports?.asyncify_get_state == "function" ? E.exports.asyncify_get_state() : 0) === 2) {
|
|
2983
|
+
E.exports.asyncify_stop_rewind();
|
|
2948
2984
|
let e = 0;
|
|
2949
|
-
for (let r = 0; r < n &&
|
|
2950
|
-
let n =
|
|
2951
|
-
new Uint8Array(
|
|
2985
|
+
for (let r = 0; r < n && z.length > 0; r++) {
|
|
2986
|
+
let n = s.getUint32(t + r * 8, !0), i = s.getUint32(t + r * 8 + 4, !0), a = Math.min(i, z.length), o = z.splice(0, a);
|
|
2987
|
+
new Uint8Array(T.buffer).set(o, n), e += a;
|
|
2952
2988
|
}
|
|
2953
|
-
return
|
|
2989
|
+
return s.setUint32(r, e, !0), i;
|
|
2954
2990
|
}
|
|
2955
|
-
if (
|
|
2991
|
+
if (z.length > 0) {
|
|
2956
2992
|
let e = 0;
|
|
2957
|
-
for (let r = 0; r < n &&
|
|
2958
|
-
let n =
|
|
2959
|
-
new Uint8Array(
|
|
2993
|
+
for (let r = 0; r < n && z.length > 0; r++) {
|
|
2994
|
+
let n = s.getUint32(t + r * 8, !0), i = s.getUint32(t + r * 8 + 4, !0), a = Math.min(i, z.length), o = z.splice(0, a);
|
|
2995
|
+
new Uint8Array(T.buffer).set(o, n), e += a;
|
|
2960
2996
|
}
|
|
2961
|
-
return
|
|
2997
|
+
return s.setUint32(r, e, !0), i;
|
|
2998
|
+
}
|
|
2999
|
+
return o ? (s.setUint32(r, 0, !0), a) : (E.exports.asyncify_start_unwind(O), k = new Promise((e) => {
|
|
3000
|
+
A = e;
|
|
3001
|
+
}), s.setUint32(r, 0, !0), i);
|
|
3002
|
+
}
|
|
3003
|
+
if (z.length > 0) {
|
|
3004
|
+
let e = 0;
|
|
3005
|
+
for (let r = 0; r < n && z.length > 0; r++) {
|
|
3006
|
+
let n = s.getUint32(t + r * 8, !0), i = s.getUint32(t + r * 8 + 4, !0), a = Math.min(i, z.length), o = z.splice(0, a);
|
|
3007
|
+
new Uint8Array(T.buffer).set(o, n), e += a;
|
|
2962
3008
|
}
|
|
2963
|
-
return
|
|
2964
|
-
|
|
2965
|
-
|
|
3009
|
+
return s.setUint32(r, e, !0), i;
|
|
3010
|
+
}
|
|
3011
|
+
let c = 0;
|
|
3012
|
+
for (let e = 0; e < n && H < V.length; e++) {
|
|
3013
|
+
let n = s.getUint32(t + e * 8, !0), r = s.getUint32(t + e * 8 + 4, !0), i = Math.min(r, V.length - H);
|
|
3014
|
+
new Uint8Array(T.buffer).set(V.slice(H, H + i), n), H += i, c += i;
|
|
3015
|
+
}
|
|
3016
|
+
return c === 0 && o && H >= V.length ? (s.setUint32(r, 0, !0), a) : (s.setUint32(r, c, !0), i);
|
|
3017
|
+
}
|
|
3018
|
+
if (!c) return o;
|
|
3019
|
+
if (c.type === "dev_null") return s.setUint32(r, 0, !0), i;
|
|
3020
|
+
if (c.type === "dev_zero") {
|
|
3021
|
+
let e = 0;
|
|
3022
|
+
for (let r = 0; r < n; r++) {
|
|
3023
|
+
let n = s.getUint32(t + r * 8, !0), i = s.getUint32(t + r * 8 + 4, !0);
|
|
3024
|
+
new Uint8Array(T.buffer, n, i).fill(0), e += i;
|
|
2966
3025
|
}
|
|
3026
|
+
return s.setUint32(r, e, !0), i;
|
|
3027
|
+
}
|
|
3028
|
+
if (c.type === "dev_urandom") {
|
|
2967
3029
|
let e = 0;
|
|
2968
|
-
for (let r = 0; r < n
|
|
2969
|
-
let n =
|
|
2970
|
-
|
|
3030
|
+
for (let r = 0; r < n; r++) {
|
|
3031
|
+
let n = s.getUint32(t + r * 8, !0), i = s.getUint32(t + r * 8 + 4, !0), a = new Uint8Array(T.buffer, n, i);
|
|
3032
|
+
if (typeof crypto < "u" && crypto.getRandomValues) crypto.getRandomValues(a);
|
|
3033
|
+
else for (let e = 0; e < i; e++) a[e] = Math.floor(Math.random() * 256);
|
|
3034
|
+
e += i;
|
|
2971
3035
|
}
|
|
2972
|
-
return
|
|
3036
|
+
return s.setUint32(r, e, !0), i;
|
|
2973
3037
|
}
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
let
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
new Uint8Array(C.buffer).set(s.bytes.subarray(s.pos, s.pos + i), n), s.pos += i, c += i;
|
|
3038
|
+
if (c.type !== "file") return o;
|
|
3039
|
+
let u = 0;
|
|
3040
|
+
for (let e = 0; e < n && c.pos < c.bytes.length; e++) {
|
|
3041
|
+
let n = s.getUint32(t + e * 8, !0), r = s.getUint32(t + e * 8 + 4, !0), i = Math.min(r, c.bytes.length - c.pos);
|
|
3042
|
+
new Uint8Array(T.buffer).set(c.bytes.subarray(c.pos, c.pos + i), n), c.pos += i, u += i;
|
|
2980
3043
|
}
|
|
2981
|
-
return
|
|
3044
|
+
return s.setUint32(r, u, !0), i;
|
|
2982
3045
|
},
|
|
2983
|
-
fd_seek: (e, t, n, r,
|
|
2984
|
-
if (!
|
|
2985
|
-
if (e <= 2) return
|
|
2986
|
-
let
|
|
2987
|
-
if (!
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
let
|
|
3046
|
+
fd_seek: (e, t, n, r, a) => {
|
|
3047
|
+
if (!T) return o;
|
|
3048
|
+
if (e <= 2) return f;
|
|
3049
|
+
let s = G.get(e);
|
|
3050
|
+
if (!s) return o;
|
|
3051
|
+
if (s.type === "dev_tty" || s.type === "dev_null" || s.type === "dev_zero" || s.type === "dev_urandom") return f;
|
|
3052
|
+
if (s.type !== "file") return o;
|
|
3053
|
+
let l, u, d;
|
|
3054
|
+
typeof t == "bigint" ? (l = Number(t), u = n, d = r) : (l = t, u = r, d = a);
|
|
3055
|
+
let p = s.pos;
|
|
2991
3056
|
if (u === 0) p = l;
|
|
2992
|
-
else if (u === 1) p =
|
|
2993
|
-
else if (u === 2) p =
|
|
2994
|
-
else return
|
|
2995
|
-
return p < 0 ?
|
|
3057
|
+
else if (u === 1) p = s.pos + l;
|
|
3058
|
+
else if (u === 2) p = s.bytes.length + l;
|
|
3059
|
+
else return c;
|
|
3060
|
+
return p < 0 ? c : (s.pos = p, d && new DataView(T.buffer).setBigUint64(d, BigInt(s.pos), !0), i);
|
|
2996
3061
|
},
|
|
2997
3062
|
fd_tell: (e, t) => {
|
|
2998
|
-
if (!
|
|
2999
|
-
let n =
|
|
3000
|
-
return !n || n.type !== "file" ?
|
|
3063
|
+
if (!T) return o;
|
|
3064
|
+
let n = G.get(e);
|
|
3065
|
+
return !n || n.type !== "file" ? o : (new DataView(T.buffer).setBigUint64(t, BigInt(n.pos), !0), i);
|
|
3001
3066
|
},
|
|
3002
3067
|
fd_close: (e) => {
|
|
3003
3068
|
if (e <= 2) return i;
|
|
3004
|
-
let t =
|
|
3005
|
-
return t ? (
|
|
3069
|
+
let t = G.get(e);
|
|
3070
|
+
return t ? (t.type === "file" && Y(t), G.delete(e), K.delete(e), i) : o;
|
|
3006
3071
|
},
|
|
3007
3072
|
fd_sync: (e) => {
|
|
3008
|
-
let t =
|
|
3009
|
-
return t &&
|
|
3073
|
+
let t = G.get(e);
|
|
3074
|
+
return t && Y(t), i;
|
|
3010
3075
|
},
|
|
3011
3076
|
fd_datasync: (e) => {
|
|
3012
|
-
let t =
|
|
3013
|
-
return t &&
|
|
3077
|
+
let t = G.get(e);
|
|
3078
|
+
return t && Y(t), i;
|
|
3014
3079
|
},
|
|
3015
3080
|
fd_prestat_get: (e, t) => {
|
|
3016
|
-
if (!
|
|
3017
|
-
let n =
|
|
3018
|
-
if (!n || n.type !== "preopen") return
|
|
3019
|
-
let r = new DataView(
|
|
3020
|
-
return r.setUint8(t, 0), r.setUint32(t + 4,
|
|
3081
|
+
if (!T) return o;
|
|
3082
|
+
let n = G.get(e);
|
|
3083
|
+
if (!n || n.type !== "preopen") return o;
|
|
3084
|
+
let r = new DataView(T.buffer), a = b.encode(n.guestName);
|
|
3085
|
+
return r.setUint8(t, 0), r.setUint32(t + 4, a.length, !0), i;
|
|
3021
3086
|
},
|
|
3022
3087
|
fd_prestat_dir_name: (e, t, n) => {
|
|
3023
|
-
if (!
|
|
3024
|
-
let r =
|
|
3025
|
-
if (!r || r.type !== "preopen") return
|
|
3026
|
-
let
|
|
3027
|
-
return new Uint8Array(
|
|
3088
|
+
if (!T) return o;
|
|
3089
|
+
let r = G.get(e);
|
|
3090
|
+
if (!r || r.type !== "preopen") return o;
|
|
3091
|
+
let a = b.encode(r.guestName);
|
|
3092
|
+
return new Uint8Array(T.buffer, t, Math.min(n, a.length)).set(a.subarray(0, n)), i;
|
|
3028
3093
|
},
|
|
3029
3094
|
fd_fdstat_get: (e, t) => {
|
|
3030
|
-
if (!
|
|
3031
|
-
let n = new DataView(
|
|
3032
|
-
if (e <= 2) r =
|
|
3095
|
+
if (!T) return o;
|
|
3096
|
+
let n = new DataView(T.buffer), r = p;
|
|
3097
|
+
if (e <= 2) r = m;
|
|
3033
3098
|
else {
|
|
3034
|
-
let t =
|
|
3035
|
-
if (!t) return
|
|
3036
|
-
r = t.type === "preopen" || t.type === "dir" ?
|
|
3099
|
+
let t = G.get(e);
|
|
3100
|
+
if (!t) return o;
|
|
3101
|
+
r = t.type === "dev_null" || t.type === "dev_zero" || t.type === "dev_urandom" || t.type === "dev_tty" ? m : t.type === "preopen" || t.type === "dir" ? h : g;
|
|
3037
3102
|
}
|
|
3038
3103
|
for (let e = 0; e < 24; e++) n.setUint8(t + e, 0);
|
|
3039
|
-
|
|
3104
|
+
n.setUint8(t, r);
|
|
3105
|
+
let a = K.get(e) || (G.get(e)?.append ? C : 0);
|
|
3106
|
+
return n.setUint16(t + 2, a, !0), n.setBigUint64(t + 8, 18446744073709551615n, !0), n.setBigUint64(t + 16, 18446744073709551615n, !0), i;
|
|
3107
|
+
},
|
|
3108
|
+
fd_fdstat_set_flags: (e, t) => {
|
|
3109
|
+
if (!T || e > 2 && !G.has(e)) return o;
|
|
3110
|
+
K.set(e, t);
|
|
3111
|
+
let n = G.get(e);
|
|
3112
|
+
return n && (n.append = !!(t & C)), (e === 0 || e === 2 || n && n.type === "dev_tty") && t & w && L(), i;
|
|
3040
3113
|
},
|
|
3041
|
-
fd_fdstat_set_flags: () => i,
|
|
3042
3114
|
fd_filestat_get: (e, t) => {
|
|
3043
|
-
if (!
|
|
3044
|
-
let n = new DataView(
|
|
3115
|
+
if (!T) return o;
|
|
3116
|
+
let n = new DataView(T.buffer);
|
|
3045
3117
|
for (let e = 0; e < 64; e++) n.setUint8(t + e, 0);
|
|
3046
|
-
if (e <= 2) return n.setUint8(t + 16,
|
|
3047
|
-
let r =
|
|
3048
|
-
if (!r) return
|
|
3049
|
-
|
|
3050
|
-
|
|
3118
|
+
if (e <= 2) return n.setUint8(t + 16, m), i;
|
|
3119
|
+
let r = G.get(e);
|
|
3120
|
+
if (!r) return o;
|
|
3121
|
+
if (r.type === "dev_null" || r.type === "dev_zero" || r.type === "dev_urandom" || r.type === "dev_tty") return n.setUint8(t + 16, m), n.setBigUint64(t + 24, 1n, !0), i;
|
|
3122
|
+
let a = r.type === "preopen" || r.type === "dir";
|
|
3123
|
+
return n.setUint8(t + 16, a ? h : g), n.setBigUint64(t + 24, 1n, !0), n.setBigUint64(t + 32, BigInt(r.bytes ? r.bytes.length : 0), !0), i;
|
|
3051
3124
|
},
|
|
3052
|
-
path_open: (e, t, r,
|
|
3053
|
-
if (!
|
|
3054
|
-
let
|
|
3055
|
-
if (!
|
|
3056
|
-
let
|
|
3057
|
-
if (
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3125
|
+
path_open: (e, t, r, a, c, f, p, m, h) => {
|
|
3126
|
+
if (!T || !U) return o;
|
|
3127
|
+
let g = J(e, n.decode(new Uint8Array(T.buffer, r, a)));
|
|
3128
|
+
if (!g) return o;
|
|
3129
|
+
let y = g.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
3130
|
+
if (y === "/dev/null") {
|
|
3131
|
+
let e = ne++;
|
|
3132
|
+
return G.set(e, {
|
|
3133
|
+
type: "dev_null",
|
|
3134
|
+
path: "/dev/null"
|
|
3135
|
+
}), new DataView(T.buffer).setUint32(h, e, !0), i;
|
|
3136
|
+
}
|
|
3137
|
+
if (y === "/dev/zero") {
|
|
3138
|
+
let e = ne++;
|
|
3139
|
+
return G.set(e, {
|
|
3140
|
+
type: "dev_zero",
|
|
3141
|
+
path: "/dev/zero"
|
|
3142
|
+
}), new DataView(T.buffer).setUint32(h, e, !0), i;
|
|
3143
|
+
}
|
|
3144
|
+
if (y === "/dev/urandom" || y === "/dev/random") {
|
|
3145
|
+
let e = ne++;
|
|
3146
|
+
return G.set(e, {
|
|
3147
|
+
type: "dev_urandom",
|
|
3064
3148
|
path: y
|
|
3065
|
-
}), new DataView(
|
|
3149
|
+
}), new DataView(T.buffer).setUint32(h, e, !0), i;
|
|
3150
|
+
}
|
|
3151
|
+
if (y === "/dev/tty") {
|
|
3152
|
+
L();
|
|
3153
|
+
let e = ne++;
|
|
3154
|
+
return G.set(e, {
|
|
3155
|
+
type: "dev_tty",
|
|
3156
|
+
path: "/dev/tty"
|
|
3157
|
+
}), new DataView(T.buffer).setUint32(h, e, !0), i;
|
|
3066
3158
|
}
|
|
3067
|
-
|
|
3068
|
-
if (
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
e
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3159
|
+
let w = U.stat(g), E = w !== null;
|
|
3160
|
+
if (c & x && c & _ && E) return s;
|
|
3161
|
+
if (c & v) {
|
|
3162
|
+
if (!E) return u;
|
|
3163
|
+
if (!w.isDirectory) return d;
|
|
3164
|
+
let e = ne++;
|
|
3165
|
+
return G.set(e, {
|
|
3166
|
+
type: "dir",
|
|
3167
|
+
path: g
|
|
3168
|
+
}), new DataView(T.buffer).setUint32(h, e, !0), i;
|
|
3169
|
+
}
|
|
3170
|
+
if (E && w.isDirectory) return l;
|
|
3171
|
+
if (!E && !(c & _)) return u;
|
|
3172
|
+
let D = new Uint8Array(), O = !1;
|
|
3173
|
+
if (E && !(c & S)) {
|
|
3174
|
+
let e = U.getFileByPath(g);
|
|
3175
|
+
e != null && (D = typeof e == "string" ? b.encode(e) : new Uint8Array(this._contentToBytes(e)));
|
|
3176
|
+
} else O = !0;
|
|
3177
|
+
let k = ne++;
|
|
3178
|
+
return G.set(k, {
|
|
3076
3179
|
type: "file",
|
|
3077
|
-
path:
|
|
3078
|
-
bytes:
|
|
3079
|
-
pos: m &
|
|
3080
|
-
append: !!(m &
|
|
3081
|
-
dirty:
|
|
3082
|
-
}), new DataView(
|
|
3180
|
+
path: g,
|
|
3181
|
+
bytes: D,
|
|
3182
|
+
pos: m & C ? D.length : 0,
|
|
3183
|
+
append: !!(m & C),
|
|
3184
|
+
dirty: O
|
|
3185
|
+
}), new DataView(T.buffer).setUint32(h, k, !0), i;
|
|
3083
3186
|
},
|
|
3084
|
-
path_filestat_get: (e, t, r,
|
|
3085
|
-
if (!
|
|
3086
|
-
let c =
|
|
3087
|
-
if (!c) return
|
|
3088
|
-
let
|
|
3089
|
-
if (
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3187
|
+
path_filestat_get: (e, t, r, a, s) => {
|
|
3188
|
+
if (!T || !U) return o;
|
|
3189
|
+
let c = J(e, n.decode(new Uint8Array(T.buffer, r, a)));
|
|
3190
|
+
if (!c) return o;
|
|
3191
|
+
let l = c.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
3192
|
+
if (l === "/dev/null" || l === "/dev/zero" || l === "/dev/urandom" || l === "/dev/random" || l === "/dev/tty") {
|
|
3193
|
+
let e = new DataView(T.buffer);
|
|
3194
|
+
for (let t = 0; t < 64; t++) e.setUint8(s + t, 0);
|
|
3195
|
+
return e.setUint8(s + 16, m), e.setBigUint64(s + 24, 1n, !0), i;
|
|
3196
|
+
}
|
|
3197
|
+
let d = U.stat(c);
|
|
3198
|
+
if (!d) return u;
|
|
3199
|
+
let f = new DataView(T.buffer);
|
|
3200
|
+
for (let e = 0; e < 64; e++) f.setUint8(s + e, 0);
|
|
3201
|
+
return f.setUint8(s + 16, d.isDirectory ? h : g), f.setBigUint64(s + 24, 1n, !0), f.setBigUint64(s + 32, BigInt(U.getSize(c) || 0), !0), i;
|
|
3093
3202
|
},
|
|
3094
3203
|
path_create_directory: (e, t, r) => {
|
|
3095
|
-
if (!
|
|
3096
|
-
let
|
|
3097
|
-
if (!
|
|
3204
|
+
if (!T || !U) return o;
|
|
3205
|
+
let a = J(e, n.decode(new Uint8Array(T.buffer, t, r)));
|
|
3206
|
+
if (!a) return o;
|
|
3098
3207
|
try {
|
|
3099
|
-
return
|
|
3208
|
+
return U.setFileByPath(a, {}, !0), i;
|
|
3100
3209
|
} catch {
|
|
3101
|
-
return
|
|
3210
|
+
return c;
|
|
3102
3211
|
}
|
|
3103
3212
|
},
|
|
3104
3213
|
path_unlink_file: (e, t, r) => {
|
|
3105
|
-
if (!
|
|
3106
|
-
let
|
|
3107
|
-
if (!
|
|
3214
|
+
if (!T || !U) return o;
|
|
3215
|
+
let a = J(e, n.decode(new Uint8Array(T.buffer, t, r)));
|
|
3216
|
+
if (!a || !U.exists(a)) return u;
|
|
3108
3217
|
try {
|
|
3109
|
-
return
|
|
3218
|
+
return U.deleteFileByPath(a), i;
|
|
3110
3219
|
} catch {
|
|
3111
|
-
return
|
|
3220
|
+
return c;
|
|
3112
3221
|
}
|
|
3113
3222
|
},
|
|
3114
3223
|
path_remove_directory: (e, t, r) => {
|
|
3115
|
-
if (!
|
|
3116
|
-
let
|
|
3117
|
-
if (!
|
|
3224
|
+
if (!T || !U) return o;
|
|
3225
|
+
let a = J(e, n.decode(new Uint8Array(T.buffer, t, r)));
|
|
3226
|
+
if (!a || !U.exists(a)) return u;
|
|
3118
3227
|
try {
|
|
3119
|
-
return
|
|
3228
|
+
return U.deleteFileByPath(a), i;
|
|
3120
3229
|
} catch {
|
|
3121
|
-
return
|
|
3230
|
+
return c;
|
|
3122
3231
|
}
|
|
3123
3232
|
},
|
|
3124
|
-
path_rename: (e, t, r,
|
|
3125
|
-
if (!
|
|
3126
|
-
let d = n.decode(new Uint8Array(
|
|
3127
|
-
if (!p || !m) return
|
|
3128
|
-
if (!
|
|
3129
|
-
for (let e of
|
|
3233
|
+
path_rename: (e, t, r, a, s, l) => {
|
|
3234
|
+
if (!T || !U) return o;
|
|
3235
|
+
let d = n.decode(new Uint8Array(T.buffer, t, r)), f = n.decode(new Uint8Array(T.buffer, s, l)), p = J(e, d), m = J(a, f);
|
|
3236
|
+
if (!p || !m) return o;
|
|
3237
|
+
if (!U.exists(p)) return u;
|
|
3238
|
+
for (let e of G.values()) e.path === p && (Y(e), e.path = m);
|
|
3130
3239
|
try {
|
|
3131
|
-
let e =
|
|
3132
|
-
return
|
|
3240
|
+
let e = U.getFileByPath(p);
|
|
3241
|
+
return U.setFileByPath(m, e, !0), U.deleteFileByPath(p), i;
|
|
3133
3242
|
} catch {
|
|
3134
|
-
return
|
|
3243
|
+
return c;
|
|
3135
3244
|
}
|
|
3136
3245
|
},
|
|
3137
3246
|
proc_exit: (e) => {
|
|
@@ -3141,88 +3250,156 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3141
3250
|
};
|
|
3142
3251
|
},
|
|
3143
3252
|
args_sizes_get: (e, t) => {
|
|
3144
|
-
if (!
|
|
3145
|
-
let n = [this.script, ...this.arguments || []], r = new DataView(
|
|
3253
|
+
if (!T) return c;
|
|
3254
|
+
let n = [this.script, ...this.arguments || []], r = new DataView(T.buffer);
|
|
3146
3255
|
return r.setUint32(e, n.length, !0), r.setUint32(t, n.reduce((e, t) => e + b.encode(t).length + 1, 0), !0), i;
|
|
3147
3256
|
},
|
|
3148
3257
|
args_get: (e, t) => {
|
|
3149
|
-
if (!
|
|
3150
|
-
let n = [this.script, ...this.arguments || []], r = new DataView(
|
|
3258
|
+
if (!T) return c;
|
|
3259
|
+
let n = [this.script, ...this.arguments || []], r = new DataView(T.buffer), a = t;
|
|
3151
3260
|
for (let t = 0; t < n.length; t++) {
|
|
3152
3261
|
r.setUint32(e + t * 4, a, !0);
|
|
3153
3262
|
let i = b.encode(n[t] + "\0");
|
|
3154
|
-
new Uint8Array(
|
|
3263
|
+
new Uint8Array(T.buffer).set(i, a), a += i.length;
|
|
3155
3264
|
}
|
|
3156
3265
|
return i;
|
|
3157
3266
|
},
|
|
3158
3267
|
environ_sizes_get: (e, t) => {
|
|
3159
|
-
if (!
|
|
3160
|
-
let n = new DataView(
|
|
3161
|
-
n.setUint32(e,
|
|
3162
|
-
let r =
|
|
3268
|
+
if (!T) return c;
|
|
3269
|
+
let n = new DataView(T.buffer);
|
|
3270
|
+
n.setUint32(e, X.length, !0);
|
|
3271
|
+
let r = X.reduce((e, t) => e + b.encode(t).length + 1, 0);
|
|
3163
3272
|
return n.setUint32(t, r, !0), i;
|
|
3164
3273
|
},
|
|
3165
3274
|
environ_get: (e, t) => {
|
|
3166
|
-
if (!
|
|
3167
|
-
let n = new DataView(
|
|
3168
|
-
for (let t = 0; t <
|
|
3275
|
+
if (!T) return c;
|
|
3276
|
+
let n = new DataView(T.buffer), r = t;
|
|
3277
|
+
for (let t = 0; t < X.length; t++) {
|
|
3169
3278
|
n.setUint32(e + t * 4, r, !0);
|
|
3170
|
-
let i = b.encode(
|
|
3171
|
-
new Uint8Array(
|
|
3279
|
+
let i = b.encode(X[t] + "\0");
|
|
3280
|
+
new Uint8Array(T.buffer).set(i, r), r += i.length;
|
|
3172
3281
|
}
|
|
3173
3282
|
return i;
|
|
3174
3283
|
},
|
|
3175
3284
|
clock_time_get: (e, t, n) => {
|
|
3176
|
-
if (
|
|
3285
|
+
if (T) {
|
|
3177
3286
|
let e = BigInt(Date.now()) * 1000000n;
|
|
3178
|
-
new DataView(
|
|
3287
|
+
new DataView(T.buffer).setBigUint64(n, e, !0);
|
|
3179
3288
|
}
|
|
3180
3289
|
return i;
|
|
3181
3290
|
},
|
|
3182
3291
|
random_get: (e, t) => {
|
|
3183
|
-
if (
|
|
3184
|
-
let n = new Uint8Array(
|
|
3292
|
+
if (T) {
|
|
3293
|
+
let n = new Uint8Array(T.buffer, e, t);
|
|
3185
3294
|
for (let e = 0; e < t; e++) n[e] = Math.random() * 256 | 0;
|
|
3186
3295
|
}
|
|
3187
3296
|
return i;
|
|
3297
|
+
},
|
|
3298
|
+
clock_nanosleep: (e, t, n, r, a) => {
|
|
3299
|
+
if (!T) return o;
|
|
3300
|
+
let s = new DataView(T.buffer).getBigUint64(n, !0), c = 0;
|
|
3301
|
+
if (t & 1) {
|
|
3302
|
+
let e = BigInt(Date.now()) * 1000000n;
|
|
3303
|
+
c = s > e ? Number((s - e) / 1000000n) : 0;
|
|
3304
|
+
} else c = Number(s / 1000000n);
|
|
3305
|
+
return D && c > 0 ? (typeof E?.exports?.asyncify_get_state == "function" ? E.exports.asyncify_get_state() : 0) === 2 ? (E.exports.asyncify_stop_rewind(), i) : (E.exports.asyncify_start_unwind(O), k = new Promise((e) => setTimeout(e, Math.max(1, c))), i) : i;
|
|
3306
|
+
},
|
|
3307
|
+
poll_oneoff: (e, t, n, r) => {
|
|
3308
|
+
if (!T) return o;
|
|
3309
|
+
let a = new DataView(T.buffer);
|
|
3310
|
+
if (D) {
|
|
3311
|
+
if ((typeof E?.exports?.asyncify_get_state == "function" ? E.exports.asyncify_get_state() : 0) === 2) {
|
|
3312
|
+
E.exports.asyncify_stop_rewind();
|
|
3313
|
+
let o = 0;
|
|
3314
|
+
for (let r = 0; r < n; r++) {
|
|
3315
|
+
let n = e + r * 48, s = a.getBigUint64(n, !0), c = a.getUint8(n + 8), l = t + o * 32;
|
|
3316
|
+
a.setBigUint64(l, s, !0), a.setUint16(l + 8, i, !0), a.setUint8(l + 10, c);
|
|
3317
|
+
for (let e = 11; e < 32; e++) a.setUint8(l + e, 0);
|
|
3318
|
+
c === 1 && a.setBigUint64(l + 16, BigInt(z.length), !0), o++;
|
|
3319
|
+
}
|
|
3320
|
+
return a.setUint32(r, o, !0), i;
|
|
3321
|
+
}
|
|
3322
|
+
let o = 0, s = Infinity;
|
|
3323
|
+
for (let t = 0; t < n; t++) {
|
|
3324
|
+
let n = e + t * 48, r = a.getUint8(n + 8);
|
|
3325
|
+
if (r === 0) {
|
|
3326
|
+
let e = a.getBigUint64(n + 24, !0), t = a.getUint16(n + 40, !0), r = 0;
|
|
3327
|
+
if (t & 1) {
|
|
3328
|
+
let t = BigInt(Date.now()) * 1000000n;
|
|
3329
|
+
r = e > t ? Number((e - t) / 1000000n) : 0;
|
|
3330
|
+
} else r = Number(e / 1000000n);
|
|
3331
|
+
r < s && (s = r);
|
|
3332
|
+
} else if (r === 1) {
|
|
3333
|
+
let e = a.getUint32(n + 16, !0), t = G.get(e), r = !!(t && t.type === "dev_tty");
|
|
3334
|
+
(e === 0 || e === 2 || r) && L(), (e === 0 || I && e === 2 || r) && z.length > 0 && o++;
|
|
3335
|
+
} else r === 2 && o++;
|
|
3336
|
+
}
|
|
3337
|
+
if (o > 0 || s === 0) {
|
|
3338
|
+
let o = 0;
|
|
3339
|
+
for (let r = 0; r < n; r++) {
|
|
3340
|
+
let n = e + r * 48, c = a.getBigUint64(n, !0), l = a.getUint8(n + 8), u = !1;
|
|
3341
|
+
if (l === 0 && s === 0) u = !0;
|
|
3342
|
+
else if (l === 1) {
|
|
3343
|
+
let e = a.getUint32(n + 16, !0), t = G.get(e), r = !!(t && t.type === "dev_tty");
|
|
3344
|
+
(e === 0 || I && e === 2 || r) && z.length > 0 && (u = !0);
|
|
3345
|
+
} else l === 2 && (u = !0);
|
|
3346
|
+
if (u) {
|
|
3347
|
+
let e = t + o * 32;
|
|
3348
|
+
a.setBigUint64(e, c, !0), a.setUint16(e + 8, i, !0), a.setUint8(e + 10, l);
|
|
3349
|
+
for (let t = 11; t < 32; t++) a.setUint8(e + t, 0);
|
|
3350
|
+
l === 1 && a.setBigUint64(e + 16, BigInt(z.length), !0), o++;
|
|
3351
|
+
}
|
|
3352
|
+
}
|
|
3353
|
+
return a.setUint32(r, o, !0), i;
|
|
3354
|
+
}
|
|
3355
|
+
return E.exports.asyncify_start_unwind(O), k = new Promise((e) => {
|
|
3356
|
+
let t = null;
|
|
3357
|
+
A = () => {
|
|
3358
|
+
t && clearTimeout(t), A = null, e();
|
|
3359
|
+
}, s !== Infinity && (t = setTimeout(() => {
|
|
3360
|
+
A = null, e();
|
|
3361
|
+
}, Math.max(1, s)));
|
|
3362
|
+
}), a.setUint32(r, 0, !0), i;
|
|
3363
|
+
}
|
|
3364
|
+
return a.setUint32(r, 0, !0), i;
|
|
3188
3365
|
}
|
|
3189
3366
|
}, { get(e, t) {
|
|
3190
3367
|
return t in e ? e[t] : () => 0;
|
|
3191
|
-
} }),
|
|
3192
|
-
if (!
|
|
3368
|
+
} }), ae = (e) => {
|
|
3369
|
+
if (!T || !e) return "";
|
|
3193
3370
|
try {
|
|
3194
|
-
let t = new DataView(
|
|
3371
|
+
let t = new DataView(T.buffer).getUint32(e - 4, !0), n = new Uint16Array(T.buffer, e, t >>> 1);
|
|
3195
3372
|
return String.fromCharCode(...n);
|
|
3196
3373
|
} catch {
|
|
3197
3374
|
return "";
|
|
3198
3375
|
}
|
|
3199
|
-
},
|
|
3200
|
-
wasi_snapshot_preview1:
|
|
3201
|
-
wasi_unstable:
|
|
3376
|
+
}, oe = {
|
|
3377
|
+
wasi_snapshot_preview1: ie,
|
|
3378
|
+
wasi_unstable: ie,
|
|
3202
3379
|
env: new Proxy({
|
|
3203
3380
|
print: (e, t) => {
|
|
3204
|
-
|
|
3381
|
+
T && R(1, n.decode(new Uint8Array(T.buffer, e, t)));
|
|
3205
3382
|
},
|
|
3206
3383
|
eprint: (e, t) => {
|
|
3207
|
-
|
|
3384
|
+
T && R(2, n.decode(new Uint8Array(T.buffer, e, t)));
|
|
3208
3385
|
},
|
|
3209
3386
|
log: (e) => {
|
|
3210
|
-
|
|
3387
|
+
R(1, ae(e) + "\n");
|
|
3211
3388
|
},
|
|
3212
3389
|
logi: (e) => {
|
|
3213
|
-
|
|
3390
|
+
R(1, String(e) + "\n");
|
|
3214
3391
|
},
|
|
3215
3392
|
logf: (e) => {
|
|
3216
|
-
|
|
3393
|
+
R(1, String(e) + "\n");
|
|
3217
3394
|
},
|
|
3218
3395
|
trace: (e, t, ...n) => {
|
|
3219
3396
|
let r = t > 0 ? " " + n.slice(0, t).join(", ") : "";
|
|
3220
|
-
|
|
3397
|
+
R(1, `trace: ${ae(e)}${r}\n`);
|
|
3221
3398
|
},
|
|
3222
3399
|
seed: () => Date.now() * Math.random(),
|
|
3223
3400
|
abort: (e, t, n, r) => {
|
|
3224
|
-
let i =
|
|
3225
|
-
throw (i || a) &&
|
|
3401
|
+
let i = ae(e), a = ae(t);
|
|
3402
|
+
throw (i || a) && R(2, `abort: ${i || "aborted"} at ${a || this.script}:${n || 0}:${r || 0}\n`), this.exitCode = 134, {
|
|
3226
3403
|
_wasmExit: !0,
|
|
3227
3404
|
code: 134
|
|
3228
3405
|
};
|
|
@@ -3238,66 +3415,64 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3238
3415
|
initial: 1,
|
|
3239
3416
|
maximum: 256
|
|
3240
3417
|
});
|
|
3241
|
-
|
|
3418
|
+
T = t, oe[e.module] || (oe[e.module] = {}), oe[e.module][e.name] = t;
|
|
3242
3419
|
}
|
|
3243
|
-
if (
|
|
3420
|
+
if (E = await WebAssembly.instantiate(t, oe), E.exports.memory && (T = E.exports.memory), D = !!(E.exports.asyncify_start_unwind && E.exports.asyncify_stop_unwind), D && T) {
|
|
3244
3421
|
try {
|
|
3245
|
-
|
|
3422
|
+
O = T.grow(1) * 65536;
|
|
3246
3423
|
} catch {
|
|
3247
|
-
|
|
3424
|
+
O = 16;
|
|
3248
3425
|
}
|
|
3249
|
-
let e =
|
|
3250
|
-
new Int32Array(
|
|
3426
|
+
let e = O + 8, t = O + 65536 - 8;
|
|
3427
|
+
new Int32Array(T.buffer, O, 2).set([e, t]);
|
|
3251
3428
|
}
|
|
3252
|
-
|
|
3253
|
-
|
|
3429
|
+
typeof E.exports.set_terminal_size == "function" && L(), I && this._enterAltScreen();
|
|
3430
|
+
let n = this.stdout && this.stdout.columns || this.context && typeof this.context.getVar == "function" && parseInt(this.context.getVar("COLUMNS"), 10) || 80, r = this.stdout && this.stdout.rows || this.context && typeof this.context.getVar == "function" && parseInt(this.context.getVar("LINES"), 10) || 24;
|
|
3431
|
+
if (typeof E.exports.set_terminal_size == "function") try {
|
|
3432
|
+
E.exports.set_terminal_size(n, r);
|
|
3433
|
+
} catch {}
|
|
3434
|
+
N = () => {
|
|
3254
3435
|
let e = this.stdout && this.stdout.columns || this.context && typeof this.context.getVar == "function" && parseInt(this.context.getVar("COLUMNS"), 10) || 80, t = this.stdout && this.stdout.rows || this.context && typeof this.context.getVar == "function" && parseInt(this.context.getVar("LINES"), 10) || 24;
|
|
3255
|
-
if (typeof
|
|
3256
|
-
|
|
3436
|
+
if (typeof E?.exports?.set_terminal_size == "function") try {
|
|
3437
|
+
E.exports.set_terminal_size(e, t);
|
|
3257
3438
|
} catch {}
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
}, this.stdout && typeof this.stdout.on == "function" && this.stdout.on("resize", j), this.stdinStream && typeof this.stdinStream.on == "function" && this.stdinStream.on("resize", j);
|
|
3264
|
-
}
|
|
3265
|
-
let n = w.exports._start || w.exports.__wasi_command || w.exports.main || w.exports.run;
|
|
3266
|
-
if (n) try {
|
|
3267
|
-
let e = n();
|
|
3268
|
-
for (e && typeof e.then == "function" && (e = await e); T && typeof w.exports.asyncify_get_state == "function" && w.exports.asyncify_get_state() === 1;) w.exports.asyncify_stop_unwind(), D &&= (await D, null), w.exports.asyncify_start_rewind(E), e = n(), e && typeof e.then == "function" && (e = await e);
|
|
3439
|
+
}, this.stdout && typeof this.stdout.on == "function" && this.stdout.on("resize", N), this.stdinStream && typeof this.stdinStream.on == "function" && this.stdinStream.on("resize", N);
|
|
3440
|
+
let i = E.exports._start || E.exports.__wasi_command || E.exports.main || E.exports.run;
|
|
3441
|
+
if (i) try {
|
|
3442
|
+
let e = i();
|
|
3443
|
+
for (e && typeof e.then == "function" && (e = await e); D && typeof E.exports.asyncify_get_state == "function" && E.exports.asyncify_get_state() === 1;) E.exports.asyncify_stop_unwind(), k &&= (await k, null), E.exports.asyncify_start_rewind(O), e = i(), e && typeof e.then == "function" && (e = await e);
|
|
3269
3444
|
} catch (e) {
|
|
3270
3445
|
(!e || !e._wasmExit) && (this.stdErr = `${this.script}: runtime error: ${e?.message || String(e)}`, this.exitCode = 1);
|
|
3271
3446
|
}
|
|
3272
3447
|
else {
|
|
3273
|
-
let e = Object.entries(
|
|
3448
|
+
let e = Object.entries(E.exports).filter(([, e]) => typeof e == "function").map(([e]) => e), t = e.length > 0 ? ` (module is a library exporting: ${e.join(", ")})` : "";
|
|
3274
3449
|
this.stdErr = `${this.script}: no CLI entry point found (expected _start, main, or run)${t}`, this.exitCode = 1;
|
|
3275
3450
|
}
|
|
3276
3451
|
} catch (e) {
|
|
3277
3452
|
(!e || !e._wasmExit) && (this.stdErr = `${this.script}: ${e?.message || String(e)}`, this.exitCode = 1);
|
|
3278
3453
|
} finally {
|
|
3279
|
-
|
|
3280
|
-
for (let e of
|
|
3454
|
+
I && this._exitAltScreen(), P && (this.stdinStream && typeof this.stdinStream.off == "function" && this.stdinStream.off("data", P), this.stdin && typeof this.stdin.off == "function" && this.stdin.off("data", P)), this._onStdinStreamData && this.stdinStream && typeof this.stdinStream.on == "function" && this.stdinStream.on("data", this._onStdinStreamData), N && (this.stdout && typeof this.stdout.off == "function" && this.stdout.off("resize", N), this.stdinStream && typeof this.stdinStream.off == "function" && this.stdinStream.off("resize", N)), this._externalKeyHandler = null;
|
|
3455
|
+
for (let e of G.values()) Y(e);
|
|
3281
3456
|
}
|
|
3282
|
-
|
|
3283
|
-
let
|
|
3457
|
+
ee();
|
|
3458
|
+
let se = this.arguments || [];
|
|
3284
3459
|
if (!(this.result && this.result.getStdOutput && this.result.getStdOutput().length > 0) && (this.exitCode === 0 || this.exitCode === void 0)) {
|
|
3285
3460
|
let t = (this.script || "wasm").split("/").pop(), n = Object.assign({
|
|
3286
3461
|
name: t,
|
|
3287
3462
|
version: "wasi",
|
|
3288
3463
|
description: `WebAssembly WASI binary (${this.script})`
|
|
3289
3464
|
}, this._pkgMeta || {});
|
|
3290
|
-
if (
|
|
3291
|
-
let r =
|
|
3292
|
-
for (let e of
|
|
3293
|
-
} else (
|
|
3465
|
+
if (se.includes("--help") || se.includes("-h")) {
|
|
3466
|
+
let r = j(e);
|
|
3467
|
+
for (let e of M(t, n, r)) this.stdOut = e;
|
|
3468
|
+
} else (se.includes("--version") || se.includes("-V") || se.includes("-v")) && (this.stdOut = `${t} (${n.name} ${n.version} wasm)`);
|
|
3294
3469
|
}
|
|
3295
3470
|
}
|
|
3296
|
-
},
|
|
3297
|
-
function
|
|
3471
|
+
}, E = /* @__PURE__ */ new Map();
|
|
3472
|
+
function D(e, t) {
|
|
3298
3473
|
if (!e || !e.exists(t)) return null;
|
|
3299
3474
|
if (e.isRealFilesystem) try {
|
|
3300
|
-
let n =
|
|
3475
|
+
let n = q();
|
|
3301
3476
|
return new Uint8Array(n.readFileSync(e.absolutePath(t)));
|
|
3302
3477
|
} catch {}
|
|
3303
3478
|
let n = e.getFileByPath(t);
|
|
@@ -3321,12 +3496,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3321
3496
|
}
|
|
3322
3497
|
return null;
|
|
3323
3498
|
}
|
|
3324
|
-
function
|
|
3499
|
+
function O(e, t, n, i = "application/octet-stream") {
|
|
3325
3500
|
let a = n instanceof Uint8Array ? n : new Uint8Array(n), o = new Uint8Array(a.byteLength);
|
|
3326
3501
|
o.set(a);
|
|
3327
3502
|
let s = new r(o.buffer, i);
|
|
3328
3503
|
if (e.isRealFilesystem) try {
|
|
3329
|
-
let n =
|
|
3504
|
+
let n = q(), r = J(), i = e.absolutePath(t);
|
|
3330
3505
|
n.mkdirSync(r.dirname(i), { recursive: !0 }), n.writeFileSync(i, y.from(a.buffer, a.byteOffset, a.byteLength));
|
|
3331
3506
|
return;
|
|
3332
3507
|
} catch {
|
|
@@ -3341,7 +3516,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3341
3516
|
}
|
|
3342
3517
|
e.setFileByPath(t, s, !0);
|
|
3343
3518
|
}
|
|
3344
|
-
async function
|
|
3519
|
+
async function k(e, t, n = null) {
|
|
3345
3520
|
if (typeof n == "function") {
|
|
3346
3521
|
let r = await n(e, t);
|
|
3347
3522
|
if (r) return r;
|
|
@@ -3369,7 +3544,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3369
3544
|
}
|
|
3370
3545
|
throw Error(`Package '${e}' could not be loaded`);
|
|
3371
3546
|
}
|
|
3372
|
-
function
|
|
3547
|
+
function A(e, t = !1) {
|
|
3373
3548
|
let n = {
|
|
3374
3549
|
usage: null,
|
|
3375
3550
|
options: []
|
|
@@ -3386,7 +3561,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3386
3561
|
}
|
|
3387
3562
|
return n;
|
|
3388
3563
|
}
|
|
3389
|
-
function
|
|
3564
|
+
function j(e) {
|
|
3390
3565
|
let t = {
|
|
3391
3566
|
usage: null,
|
|
3392
3567
|
options: [],
|
|
@@ -3407,12 +3582,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3407
3582
|
i >= 32 && i <= 126 || i === 9 || i === 10 ? r += String.fromCharCode(i) : (r.length >= 4 && n.push(r), r = "");
|
|
3408
3583
|
}
|
|
3409
3584
|
r.length >= 4 && n.push(r);
|
|
3410
|
-
let i =
|
|
3585
|
+
let i = A(n.join("\n"), !0);
|
|
3411
3586
|
t.usage = i.usage, t.options = i.options;
|
|
3412
3587
|
} catch {}
|
|
3413
3588
|
return t;
|
|
3414
3589
|
}
|
|
3415
|
-
function
|
|
3590
|
+
function M(e, t = {}, n = null) {
|
|
3416
3591
|
let r = t.name || e, i = t.version || "wasm", a = t.description || "WebAssembly binary", o = t && typeof t.repl == "object" ? t.repl : t.repl ? {} : null, s = n && n.usage || t.usage, c = s ? s.replace(/%s/g, e) : null, l = o ? `${e} [options] ${o.evalFlag ? `[${o.evalFlag} <code>] ` : ""}[file] [args...]` : `${e} [options] [args...]`, u = [`${e} (${r} ${i} wasm) — ${a}`, `Usage: ${c || l}`];
|
|
3417
3592
|
t.details && u.push("", t.details), u.push("", "Options:");
|
|
3418
3593
|
let d = n && n.options && n.options.length > 0 ? n.options : Array.isArray(t.options) ? t.options : [];
|
|
@@ -3420,8 +3595,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3420
3595
|
else o && (o.evalFlag && u.push(` ${o.evalFlag.padEnd(20)}Evaluate inline code and print result`), u.push(` (no arguments) Start interactive ${e} REPL shell`));
|
|
3421
3596
|
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;
|
|
3422
3597
|
}
|
|
3423
|
-
function
|
|
3424
|
-
let r =
|
|
3598
|
+
function N(e, t = {}, n = null) {
|
|
3599
|
+
let r = X(), i = (n || e.bin || e.name).toLowerCase();
|
|
3425
3600
|
class a extends r {
|
|
3426
3601
|
static get name() {
|
|
3427
3602
|
return i;
|
|
@@ -3434,7 +3609,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3434
3609
|
}
|
|
3435
3610
|
async run() {
|
|
3436
3611
|
let n = [...this.arguments || []], r = n.includes("--help") || n.includes("-h"), a = !r && (n.includes("--version") || n.includes("-V") || n.includes("-v"));
|
|
3437
|
-
this._inspectedWasm = null, this._persistedWasmBytes = e.wasmPath ?
|
|
3612
|
+
this._inspectedWasm = null, this._persistedWasmBytes = e.wasmPath ? D(this.context && this.context.fs || this.fs, e.wasmPath) : null, r && this._persistedWasmBytes && this._persistedWasmBytes.byteLength > 0 && (this._inspectedWasm = j(this._persistedWasmBytes));
|
|
3438
3613
|
try {
|
|
3439
3614
|
if ((e.type === "wasm" || e.type === "custom-wasm") && (this._persistedWasmBytes || e.wasmUrl)) {
|
|
3440
3615
|
let i = this._persistedWasmBytes;
|
|
@@ -3443,7 +3618,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3443
3618
|
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);
|
|
3444
3619
|
} catch {}
|
|
3445
3620
|
if (!i && e.wasmUrl && (i = await this._fetchWasmBytes(e.wasmUrl)), i) {
|
|
3446
|
-
r && (this._inspectedWasm =
|
|
3621
|
+
r && (this._inspectedWasm = j(i)), await this._runRawWasmBytes(i, n);
|
|
3447
3622
|
return;
|
|
3448
3623
|
}
|
|
3449
3624
|
} else {
|
|
@@ -3460,19 +3635,19 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3460
3635
|
}
|
|
3461
3636
|
let c, l;
|
|
3462
3637
|
try {
|
|
3463
|
-
c = await
|
|
3638
|
+
c = await k(e.name, o, t.moduleLoader), l = c && c.default !== void 0 ? c.default : c, l && typeof l.then == "function" && (l = await l);
|
|
3464
3639
|
} finally {
|
|
3465
3640
|
s && (globalThis.fetch = s);
|
|
3466
3641
|
}
|
|
3467
3642
|
if (l instanceof Uint8Array || l instanceof ArrayBuffer) {
|
|
3468
3643
|
let e = l instanceof Uint8Array ? l : new Uint8Array(l);
|
|
3469
|
-
r && (this._inspectedWasm =
|
|
3644
|
+
r && (this._inspectedWasm = j(e)), await this._runRawWasmBytes(e, n);
|
|
3470
3645
|
} else if (l && (l.wasmBytes instanceof Uint8Array || l.wasm instanceof Uint8Array)) {
|
|
3471
3646
|
let e = l.wasmBytes || l.wasm;
|
|
3472
|
-
r && (this._inspectedWasm =
|
|
3647
|
+
r && (this._inspectedWasm = j(e)), await this._runRawWasmBytes(e, n);
|
|
3473
3648
|
} else if (typeof l == "function") await this._runFunctionOrEmscripten(l, n, r);
|
|
3474
3649
|
else if (l && typeof l == "object") {
|
|
3475
|
-
l.ready && await l.ready, r && (l.HEAPU8 instanceof Uint8Array || l.wasmBinary instanceof Uint8Array) && (this._inspectedWasm =
|
|
3650
|
+
l.ready && await l.ready, r && (l.HEAPU8 instanceof Uint8Array || l.wasmBinary instanceof Uint8Array) && (this._inspectedWasm = j(l.wasmBinary || l.HEAPU8));
|
|
3476
3651
|
let t = l.main || l.run || l.callMain || l.exec;
|
|
3477
3652
|
if (typeof t == "function") await this._invokeCliFunction(t.bind(l), n);
|
|
3478
3653
|
else if (l.promised || typeof l.raw == "function" || typeof l.json == "function") {
|
|
@@ -3500,29 +3675,29 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3500
3675
|
}
|
|
3501
3676
|
}
|
|
3502
3677
|
if (r || a) {
|
|
3503
|
-
let t = this.result && this.result.getStdOutput ? this.result.getStdOutput() : [], n = t.map((e) => e.string).join("\n"), o = r ?
|
|
3678
|
+
let t = this.result && this.result.getStdOutput ? this.result.getStdOutput() : [], n = t.map((e) => e.string).join("\n"), o = r ? A(n) : null, s = r && !!(o && (o.usage || o.options.length > 0) || t.some((e) => /\b(usage|options):/i.test(e.string))), c = t.filter((e) => e.type === "out").map((e) => e.string), l = a && c.length > 0 && (this.exitCode === 0 || this.exitCode === void 0);
|
|
3504
3679
|
if (r) if (s) {
|
|
3505
3680
|
let e = t.map((e) => e.string);
|
|
3506
3681
|
this.result && Array.isArray(this.result.std) && (this.result.std.length = 0), this.exitCode = 0;
|
|
3507
3682
|
for (let t of e) this.stdOut = t;
|
|
3508
3683
|
} else {
|
|
3509
3684
|
this.result && Array.isArray(this.result.std) && (this.result.std.length = 0), this.exitCode = 0;
|
|
3510
|
-
for (let t of
|
|
3685
|
+
for (let t of M(i, e, this._inspectedWasm)) this.stdOut = t;
|
|
3511
3686
|
}
|
|
3512
3687
|
else a && !l ? (this.result && Array.isArray(this.result.std) && (this.result.std.length = 0), this.exitCode = 0, this.stdOut = `${i} (${e.name} ${e.version || "wasm"} wasm)`) : this.exitCode = 0;
|
|
3513
3688
|
}
|
|
3514
3689
|
}
|
|
3515
3690
|
async _fetchWasmBytes(e) {
|
|
3516
|
-
if (
|
|
3691
|
+
if (E.has(e)) return E.get(e);
|
|
3517
3692
|
let n = t.fetch || (typeof fetch == "function" ? fetch : null);
|
|
3518
3693
|
if (!n) throw Error("fetch is not available in this environment");
|
|
3519
3694
|
let r = await n(e);
|
|
3520
3695
|
if (!r || !r.ok) throw Error(`HTTP ${r ? r.status : "error"} fetching ${e}`);
|
|
3521
3696
|
let i = new Uint8Array(await r.arrayBuffer());
|
|
3522
|
-
return
|
|
3697
|
+
return E.set(e, i), i;
|
|
3523
3698
|
}
|
|
3524
3699
|
async _runRawWasmBytes(t, n) {
|
|
3525
|
-
let r = new
|
|
3700
|
+
let r = new T(i, n, this.context);
|
|
3526
3701
|
r.script = i, r.arguments = n, r.context = this.context, r.fs = this.fs, r._pkgMeta = e, this.stdin !== void 0 && (r.stdin = this.stdin), await r._runWasm(t);
|
|
3527
3702
|
for (let e of r.result.getStdOutput()) e.type === "out" ? this.stdOut = e.string : e.type === "err" && (this.stdErr = e.string);
|
|
3528
3703
|
this.exitCode = r.result.getExitCode();
|
|
@@ -3546,13 +3721,13 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3546
3721
|
let n = t && t !== "." && !e.startsWith("/") ? `${t.replace(/\/+$/, "")}/${e}` : e, r = this.fs.getFileByPath(n) ?? this.fs.getFileByPath(e);
|
|
3547
3722
|
return r == null ? null : typeof r == "string" ? r : new TextDecoder().decode(r);
|
|
3548
3723
|
},
|
|
3549
|
-
readBytes: (e) =>
|
|
3724
|
+
readBytes: (e) => D(this.fs, e),
|
|
3550
3725
|
writeFile: (e, t, n) => {
|
|
3551
3726
|
if (!this.fs) return;
|
|
3552
3727
|
let r = n && n !== "." && !e.startsWith("/") ? `${n.replace(/\/+$/, "")}/${e}` : e;
|
|
3553
3728
|
if (t instanceof Uint8Array || ArrayBuffer.isView(t)) {
|
|
3554
3729
|
let e = r.endsWith(".wasm") ? "application/wasm" : "application/octet-stream";
|
|
3555
|
-
|
|
3730
|
+
O(this.fs, r, t, e);
|
|
3556
3731
|
} else this.fs.setFileByPath(r, String(t), !0);
|
|
3557
3732
|
if (r.endsWith(".wasm") || r.endsWith(".wat")) try {
|
|
3558
3733
|
this.context && this.context.fs ? this.context.fs.setMode(r, 493) : this.fs.setMode(r, 493);
|
|
@@ -3588,7 +3763,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3588
3763
|
if (e && typeof e.status == "number") this.exitCode = e.status;
|
|
3589
3764
|
else throw e;
|
|
3590
3765
|
}
|
|
3591
|
-
if (d && typeof d == "object") if (r && (d.wasmBinary instanceof Uint8Array || d.HEAPU8 instanceof Uint8Array) && (this._inspectedWasm =
|
|
3766
|
+
if (d && typeof d == "object") if (r && (d.wasmBinary instanceof Uint8Array || d.HEAPU8 instanceof Uint8Array) && (this._inspectedWasm = j(d.wasmBinary || d.HEAPU8)), typeof d.callMain == "function") {
|
|
3592
3767
|
d.FS && c.size === 0 && (c = this._syncBrshToEmscriptenFs(d.FS, n));
|
|
3593
3768
|
try {
|
|
3594
3769
|
let e = await d.callMain(n);
|
|
@@ -3651,14 +3826,14 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3651
3826
|
}), !t.loaded && typeof t.load == "function" && await t.load(e.coreUrl ? { coreURL: e.coreUrl } : void 0);
|
|
3652
3827
|
let a = /* @__PURE__ */ new Set(), o = [];
|
|
3653
3828
|
for (let e of n) if (!e.startsWith("-") && (o.push(e), this.fs.exists(e))) {
|
|
3654
|
-
let n =
|
|
3829
|
+
let n = D(this.fs, e);
|
|
3655
3830
|
n && (await t.writeFile(e, n), a.add(e));
|
|
3656
3831
|
}
|
|
3657
3832
|
let s = await t.exec(n);
|
|
3658
3833
|
for (let e of o) if (!a.has(e)) try {
|
|
3659
3834
|
if (typeof t.readFile == "function") {
|
|
3660
3835
|
let n = await t.readFile(e);
|
|
3661
|
-
n &&
|
|
3836
|
+
n && O(this.fs, e, n);
|
|
3662
3837
|
}
|
|
3663
3838
|
} catch {}
|
|
3664
3839
|
typeof s == "number" && s !== 0 && (this.exitCode = s, i.length === 0 && r.length > 0 && i.push(...r.splice(0, r.length)));
|
|
@@ -3675,7 +3850,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3675
3850
|
let n = /* @__PURE__ */ new Set();
|
|
3676
3851
|
if (!this.fs || !e || typeof e.writeFile != "function") return n;
|
|
3677
3852
|
for (let r of t) if (!r.startsWith("-") && this.fs.exists(r)) {
|
|
3678
|
-
let t =
|
|
3853
|
+
let t = D(this.fs, r);
|
|
3679
3854
|
if (t) try {
|
|
3680
3855
|
e.writeFile(r, t), n.add(r);
|
|
3681
3856
|
} catch {}
|
|
@@ -3688,7 +3863,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3688
3863
|
let t = e.readFile(r);
|
|
3689
3864
|
if (t) {
|
|
3690
3865
|
let e = r.endsWith(".wasm") ? "application/wasm" : "application/octet-stream";
|
|
3691
|
-
if (
|
|
3866
|
+
if (O(this.fs, r, t, e), r.endsWith(".wasm") || r.endsWith(".wat")) try {
|
|
3692
3867
|
this.context && this.context.fs ? this.context.fs.setMode(r, 493) : this.fs.setMode(r, 493);
|
|
3693
3868
|
} catch {}
|
|
3694
3869
|
}
|
|
@@ -3698,8 +3873,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3698
3873
|
}
|
|
3699
3874
|
return a;
|
|
3700
3875
|
}
|
|
3701
|
-
|
|
3702
|
-
})),
|
|
3876
|
+
T.readBytesFromFs = D, T.writeBytesToFs = O, T.loadModule = k, T.extractHelpFromText = A, T.inspectWasmBytes = j, T.formatWasmHelp = M, T.createGenericWasmCommand = N, T.createCommand = N, t.exports = T;
|
|
3877
|
+
})), oe = /* @__PURE__ */ t(((e, t) => {
|
|
3703
3878
|
var n = W(), r = class extends n {
|
|
3704
3879
|
static get name() {
|
|
3705
3880
|
return "test";
|
|
@@ -3784,7 +3959,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3784
3959
|
}
|
|
3785
3960
|
}
|
|
3786
3961
|
};
|
|
3787
|
-
})),
|
|
3962
|
+
})), se = /* @__PURE__ */ t(((e, t) => {
|
|
3788
3963
|
var n = W();
|
|
3789
3964
|
t.exports = class extends n {
|
|
3790
3965
|
static get name() {
|
|
@@ -3825,7 +4000,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3825
4000
|
return o.forEach((e) => this.stdOut = e), Promise.resolve();
|
|
3826
4001
|
}
|
|
3827
4002
|
};
|
|
3828
|
-
})),
|
|
4003
|
+
})), ce = /* @__PURE__ */ t(((e, t) => {
|
|
3829
4004
|
function n(e) {
|
|
3830
4005
|
return typeof e == "object" && !!e;
|
|
3831
4006
|
}
|
|
@@ -3836,7 +4011,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3836
4011
|
return Array.isArray(e) ? e : e === void 0 ? [] : r(e) || e instanceof Set ? Array.from(e) : [e];
|
|
3837
4012
|
}
|
|
3838
4013
|
t.exports = i;
|
|
3839
|
-
})),
|
|
4014
|
+
})), le = /* @__PURE__ */ t(((e, t) => {
|
|
3840
4015
|
function n(e, t, ...n) {
|
|
3841
4016
|
let r = [];
|
|
3842
4017
|
if (!Array.isArray(e)) throw Error("Input must be an array");
|
|
@@ -3856,7 +4031,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3856
4031
|
return e;
|
|
3857
4032
|
}
|
|
3858
4033
|
t.exports = n;
|
|
3859
|
-
})),
|
|
4034
|
+
})), ue = /* @__PURE__ */ t(((e) => {
|
|
3860
4035
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
3861
4036
|
function t(e) {
|
|
3862
4037
|
return !isNaN(parseFloat(e));
|
|
@@ -3935,10 +4110,10 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3935
4110
|
isFunction: h,
|
|
3936
4111
|
isAsyncFunction: g
|
|
3937
4112
|
}, 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;
|
|
3938
|
-
})),
|
|
3939
|
-
|
|
4113
|
+
})), de, fe = e((() => {
|
|
4114
|
+
de = globalThis || self;
|
|
3940
4115
|
})), pe = /* @__PURE__ */ t(((e, t) => {
|
|
3941
|
-
|
|
4116
|
+
fe();
|
|
3942
4117
|
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 + "(?:" + [
|
|
3943
4118
|
O,
|
|
3944
4119
|
k,
|
|
@@ -3968,7 +4143,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3968
4143
|
j + "+" + I,
|
|
3969
4144
|
S,
|
|
3970
4145
|
B
|
|
3971
|
-
].join("|"), "g"), ne = RegExp("[" + M + o + s + c + g + "]"),
|
|
4146
|
+
].join("|"), "g"), ne = RegExp("[" + M + o + s + c + g + "]"), G = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, K = {
|
|
3972
4147
|
À: "A",
|
|
3973
4148
|
Á: "A",
|
|
3974
4149
|
Â: "A",
|
|
@@ -4159,40 +4334,40 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4159
4334
|
œ: "oe",
|
|
4160
4335
|
ʼn: "'n",
|
|
4161
4336
|
ſ: "ss"
|
|
4162
|
-
},
|
|
4163
|
-
function
|
|
4337
|
+
}, q = typeof de == "object" && de && de.Object === Object && de, J = typeof self == "object" && self && self.Object === Object && self, Y = q || J || Function("return this")();
|
|
4338
|
+
function re(e, t, n, r) {
|
|
4164
4339
|
var i = -1, a = e ? e.length : 0;
|
|
4165
4340
|
for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
|
|
4166
4341
|
return n;
|
|
4167
4342
|
}
|
|
4168
|
-
function
|
|
4343
|
+
function X(e) {
|
|
4169
4344
|
return e.split("");
|
|
4170
4345
|
}
|
|
4171
|
-
function
|
|
4346
|
+
function ie(e) {
|
|
4172
4347
|
return e.match(i) || [];
|
|
4173
4348
|
}
|
|
4174
|
-
function
|
|
4349
|
+
function ae(e) {
|
|
4175
4350
|
return function(t) {
|
|
4176
4351
|
return e?.[t];
|
|
4177
4352
|
};
|
|
4178
4353
|
}
|
|
4179
|
-
var
|
|
4180
|
-
function
|
|
4354
|
+
var oe = ae(K);
|
|
4355
|
+
function se(e) {
|
|
4181
4356
|
return ne.test(e);
|
|
4182
4357
|
}
|
|
4358
|
+
function ce(e) {
|
|
4359
|
+
return G.test(e);
|
|
4360
|
+
}
|
|
4183
4361
|
function le(e) {
|
|
4184
|
-
return
|
|
4362
|
+
return se(e) ? ue(e) : X(e);
|
|
4185
4363
|
}
|
|
4186
4364
|
function ue(e) {
|
|
4187
|
-
return ce(e) ? de(e) : Y(e);
|
|
4188
|
-
}
|
|
4189
|
-
function de(e) {
|
|
4190
4365
|
return e.match(te) || [];
|
|
4191
4366
|
}
|
|
4192
4367
|
function pe(e) {
|
|
4193
4368
|
return e.match(W) || [];
|
|
4194
4369
|
}
|
|
4195
|
-
var me = Object.prototype.toString, Z =
|
|
4370
|
+
var me = Object.prototype.toString, Z = Y.Symbol, he = Z ? Z.prototype : void 0, ge = he ? he.toString : void 0;
|
|
4196
4371
|
function _e(e, t, n) {
|
|
4197
4372
|
var r = -1, i = e.length;
|
|
4198
4373
|
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;
|
|
@@ -4212,13 +4387,13 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4212
4387
|
function be(e) {
|
|
4213
4388
|
return function(t) {
|
|
4214
4389
|
t = we(t);
|
|
4215
|
-
var n =
|
|
4390
|
+
var n = se(t) ? le(t) : void 0, r = n ? n[0] : t.charAt(0), i = n ? ye(n, 1).join("") : t.slice(1);
|
|
4216
4391
|
return r[e]() + i;
|
|
4217
4392
|
};
|
|
4218
4393
|
}
|
|
4219
4394
|
function xe(e) {
|
|
4220
4395
|
return function(t) {
|
|
4221
|
-
return
|
|
4396
|
+
return re(ke(De(t).replace(H, "")), e, "");
|
|
4222
4397
|
};
|
|
4223
4398
|
}
|
|
4224
4399
|
function Se(e) {
|
|
@@ -4237,16 +4412,16 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4237
4412
|
return Oe(we(e).toLowerCase());
|
|
4238
4413
|
}
|
|
4239
4414
|
function De(e) {
|
|
4240
|
-
return e = we(e), e && e.replace(a,
|
|
4415
|
+
return e = we(e), e && e.replace(a, oe).replace(U, "");
|
|
4241
4416
|
}
|
|
4242
4417
|
var Oe = be("toUpperCase");
|
|
4243
4418
|
function ke(e, t, n) {
|
|
4244
|
-
return e = we(e), t = n ? void 0 : t, t === void 0 ?
|
|
4419
|
+
return e = we(e), t = n ? void 0 : t, t === void 0 ? ce(e) ? pe(e) : ie(e) : e.match(t) || [];
|
|
4245
4420
|
}
|
|
4246
4421
|
t.exports = Te;
|
|
4247
4422
|
})), me = /* @__PURE__ */ t(((e, t) => {
|
|
4248
4423
|
B();
|
|
4249
|
-
var n =
|
|
4424
|
+
var n = ce(), r = le(), i = ue(), a = pe(), o = {
|
|
4250
4425
|
short: /^-([^\d-])$/,
|
|
4251
4426
|
long: /^--(\S+)/,
|
|
4252
4427
|
combinedShort: /^-[^\d-]{2,}$/,
|
|
@@ -4866,9 +5041,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4866
5041
|
}
|
|
4867
5042
|
};
|
|
4868
5043
|
})), be = /* @__PURE__ */ t(((e, t) => {
|
|
4869
|
-
var { Test: n, TestBracket: r } =
|
|
5044
|
+
var { Test: n, TestBracket: r } = oe();
|
|
4870
5045
|
t.exports = [
|
|
4871
|
-
|
|
5046
|
+
se(),
|
|
4872
5047
|
Z(),
|
|
4873
5048
|
he(),
|
|
4874
5049
|
ge(),
|
|
@@ -4879,7 +5054,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4879
5054
|
r
|
|
4880
5055
|
];
|
|
4881
5056
|
})), xe = /* @__PURE__ */ t(((e, t) => {
|
|
4882
|
-
var n =
|
|
5057
|
+
var n = X();
|
|
4883
5058
|
t.exports = class extends n {
|
|
4884
5059
|
static get name() {
|
|
4885
5060
|
return "alias";
|
|
@@ -4891,7 +5066,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4891
5066
|
}
|
|
4892
5067
|
};
|
|
4893
5068
|
})), Se = /* @__PURE__ */ t(((e, t) => {
|
|
4894
|
-
var n =
|
|
5069
|
+
var n = X();
|
|
4895
5070
|
t.exports = class extends n {
|
|
4896
5071
|
static get name() {
|
|
4897
5072
|
return "export";
|
|
@@ -4903,7 +5078,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4903
5078
|
}
|
|
4904
5079
|
};
|
|
4905
5080
|
})), Ce = /* @__PURE__ */ t(((e, t) => {
|
|
4906
|
-
var n =
|
|
5081
|
+
var n = X();
|
|
4907
5082
|
t.exports = class extends n {
|
|
4908
5083
|
static get name() {
|
|
4909
5084
|
return "cd";
|
|
@@ -4915,7 +5090,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4915
5090
|
}
|
|
4916
5091
|
};
|
|
4917
5092
|
})), we = /* @__PURE__ */ t(((e, t) => {
|
|
4918
|
-
var n =
|
|
5093
|
+
var n = X();
|
|
4919
5094
|
t.exports = class extends n {
|
|
4920
5095
|
static get name() {
|
|
4921
5096
|
return "chmod";
|
|
@@ -4971,7 +5146,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4971
5146
|
}
|
|
4972
5147
|
};
|
|
4973
5148
|
})), Te = /* @__PURE__ */ t(((e, t) => {
|
|
4974
|
-
var n =
|
|
5149
|
+
var n = X(), r = q();
|
|
4975
5150
|
t.exports = class extends n {
|
|
4976
5151
|
static get name() {
|
|
4977
5152
|
return "cp";
|
|
@@ -5067,9 +5242,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5067
5242
|
}
|
|
5068
5243
|
};
|
|
5069
5244
|
})), Ee = /* @__PURE__ */ t(((e, t) => {
|
|
5070
|
-
var n =
|
|
5245
|
+
var n = X(), r = (() => {
|
|
5071
5246
|
try {
|
|
5072
|
-
return
|
|
5247
|
+
return q();
|
|
5073
5248
|
} catch {
|
|
5074
5249
|
return null;
|
|
5075
5250
|
}
|
|
@@ -5140,7 +5315,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5140
5315
|
}
|
|
5141
5316
|
};
|
|
5142
5317
|
})), De = /* @__PURE__ */ t(((e, t) => {
|
|
5143
|
-
var n =
|
|
5318
|
+
var n = X();
|
|
5144
5319
|
t.exports = class extends n {
|
|
5145
5320
|
static get name() {
|
|
5146
5321
|
return "mkdir";
|
|
@@ -5167,7 +5342,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5167
5342
|
}
|
|
5168
5343
|
};
|
|
5169
5344
|
})), Oe = /* @__PURE__ */ t(((e, t) => {
|
|
5170
|
-
var n =
|
|
5345
|
+
var n = X(), r = q();
|
|
5171
5346
|
t.exports = class extends n {
|
|
5172
5347
|
static get name() {
|
|
5173
5348
|
return "mv";
|
|
@@ -5211,7 +5386,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5211
5386
|
continue;
|
|
5212
5387
|
}
|
|
5213
5388
|
try {
|
|
5214
|
-
let e =
|
|
5389
|
+
let e = J();
|
|
5215
5390
|
r.mkdirSync(e.dirname(i), { recursive: !0 }), r.renameSync(n, i);
|
|
5216
5391
|
} catch (n) {
|
|
5217
5392
|
this.stdErr = `mv: cannot move '${e}' to '${t}': ${n.message}`, this.exitCode = 1;
|
|
@@ -5240,7 +5415,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5240
5415
|
}
|
|
5241
5416
|
};
|
|
5242
5417
|
})), ke = /* @__PURE__ */ t(((e, t) => {
|
|
5243
|
-
var n =
|
|
5418
|
+
var n = X();
|
|
5244
5419
|
t.exports = class extends n {
|
|
5245
5420
|
static get name() {
|
|
5246
5421
|
return "pwd";
|
|
@@ -5251,7 +5426,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5251
5426
|
}
|
|
5252
5427
|
};
|
|
5253
5428
|
})), Ae = /* @__PURE__ */ t(((e, t) => {
|
|
5254
|
-
var n =
|
|
5429
|
+
var n = X(), r = q();
|
|
5255
5430
|
t.exports = class extends n {
|
|
5256
5431
|
static get name() {
|
|
5257
5432
|
return "rm";
|
|
@@ -5296,9 +5471,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5296
5471
|
}
|
|
5297
5472
|
};
|
|
5298
5473
|
})), je = /* @__PURE__ */ t(((e, t) => {
|
|
5299
|
-
var n =
|
|
5474
|
+
var n = X(), r = (() => {
|
|
5300
5475
|
try {
|
|
5301
|
-
return
|
|
5476
|
+
return q();
|
|
5302
5477
|
} catch {
|
|
5303
5478
|
return null;
|
|
5304
5479
|
}
|
|
@@ -5365,9 +5540,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5365
5540
|
}
|
|
5366
5541
|
};
|
|
5367
5542
|
})), Me = /* @__PURE__ */ t(((e, t) => {
|
|
5368
|
-
var n =
|
|
5543
|
+
var n = X(), r = (() => {
|
|
5369
5544
|
try {
|
|
5370
|
-
return
|
|
5545
|
+
return q();
|
|
5371
5546
|
} catch {
|
|
5372
5547
|
return null;
|
|
5373
5548
|
}
|
|
@@ -5406,7 +5581,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5406
5581
|
}
|
|
5407
5582
|
};
|
|
5408
5583
|
})), Ne = /* @__PURE__ */ t(((e, t) => {
|
|
5409
|
-
var n =
|
|
5584
|
+
var n = X();
|
|
5410
5585
|
t.exports = class extends n {
|
|
5411
5586
|
static get name() {
|
|
5412
5587
|
return "which";
|
|
@@ -5418,7 +5593,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5418
5593
|
}
|
|
5419
5594
|
};
|
|
5420
5595
|
})), Pe = /* @__PURE__ */ t(((e, t) => {
|
|
5421
|
-
var n =
|
|
5596
|
+
var n = ie(), r = X();
|
|
5422
5597
|
t.exports = class extends r {
|
|
5423
5598
|
static get name() {
|
|
5424
5599
|
return "source";
|
|
@@ -5447,7 +5622,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5447
5622
|
}
|
|
5448
5623
|
};
|
|
5449
5624
|
})), Fe = /* @__PURE__ */ t(((e, t) => {
|
|
5450
|
-
var n =
|
|
5625
|
+
var n = X();
|
|
5451
5626
|
t.exports = class extends n {
|
|
5452
5627
|
static get name() {
|
|
5453
5628
|
return "clear";
|
|
@@ -5457,7 +5632,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5457
5632
|
}
|
|
5458
5633
|
};
|
|
5459
5634
|
})), Ie = /* @__PURE__ */ t(((e, t) => {
|
|
5460
|
-
var n =
|
|
5635
|
+
var n = X();
|
|
5461
5636
|
t.exports = class extends n {
|
|
5462
5637
|
static get name() {
|
|
5463
5638
|
return "exit";
|
|
@@ -5468,7 +5643,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5468
5643
|
}
|
|
5469
5644
|
};
|
|
5470
5645
|
})), Le = /* @__PURE__ */ t(((e, t) => {
|
|
5471
|
-
var n =
|
|
5646
|
+
var n = X(), r = me();
|
|
5472
5647
|
t.exports = class extends n {
|
|
5473
5648
|
static get name() {
|
|
5474
5649
|
return "read";
|
|
@@ -5542,7 +5717,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5542
5717
|
}
|
|
5543
5718
|
};
|
|
5544
5719
|
})), Re = /* @__PURE__ */ t(((e, t) => {
|
|
5545
|
-
var n =
|
|
5720
|
+
var n = X(), r = W();
|
|
5546
5721
|
t.exports = class extends n {
|
|
5547
5722
|
static get name() {
|
|
5548
5723
|
return "jsfunction";
|
|
@@ -5578,7 +5753,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5578
5753
|
}
|
|
5579
5754
|
};
|
|
5580
5755
|
})), ze = /* @__PURE__ */ t(((e, t) => {
|
|
5581
|
-
var n =
|
|
5756
|
+
var n = X();
|
|
5582
5757
|
function r(e) {
|
|
5583
5758
|
return e >= 1048576 ? (e / 1048576).toFixed(1) + " MB" : e >= 1024 ? (e / 1024).toFixed(1) + " KB" : e + " B";
|
|
5584
5759
|
}
|
|
@@ -5676,7 +5851,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5676
5851
|
let e = new TextDecoder().decode(t);
|
|
5677
5852
|
this.fs.setFileByPath(s, e, !0);
|
|
5678
5853
|
} else {
|
|
5679
|
-
let { BinaryFile: e } =
|
|
5854
|
+
let { BinaryFile: e } = K(), r = e ? new e(t.buffer, n || "application/octet-stream") : t;
|
|
5680
5855
|
this.fs.setFileByPath(s, r, !0);
|
|
5681
5856
|
}
|
|
5682
5857
|
} catch (e) {
|
|
@@ -5699,7 +5874,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5699
5874
|
}
|
|
5700
5875
|
};
|
|
5701
5876
|
})), Be = /* @__PURE__ */ t(((e, t) => {
|
|
5702
|
-
var n =
|
|
5877
|
+
var n = X(), r = {
|
|
5703
5878
|
errexit: "e",
|
|
5704
5879
|
xtrace: "x",
|
|
5705
5880
|
nounset: "u",
|
|
@@ -6370,7 +6545,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6370
6545
|
})), Pt = /* @__PURE__ */ t(((e, t) => {
|
|
6371
6546
|
t.exports = {};
|
|
6372
6547
|
})), Ft = /* @__PURE__ */ t(((e, t) => {
|
|
6373
|
-
|
|
6548
|
+
fe();
|
|
6374
6549
|
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) {
|
|
6375
6550
|
return e.__proto__;
|
|
6376
6551
|
} : null);
|
|
@@ -6386,7 +6561,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6386
6561
|
}
|
|
6387
6562
|
return v.call(t, n, "$&_");
|
|
6388
6563
|
}
|
|
6389
|
-
var P = Pt(), F = P.custom, I =
|
|
6564
|
+
var P = Pt(), F = P.custom, I = K(F) ? F : null, L = {
|
|
6390
6565
|
__proto__: null,
|
|
6391
6566
|
double: "\"",
|
|
6392
6567
|
single: "'"
|
|
@@ -6397,12 +6572,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6397
6572
|
};
|
|
6398
6573
|
t.exports = function e(t, n, r, o) {
|
|
6399
6574
|
var s = n || {};
|
|
6400
|
-
if (
|
|
6401
|
-
if (
|
|
6402
|
-
var u =
|
|
6575
|
+
if (Y(s, "quoteStyle") && !Y(L, s.quoteStyle)) throw TypeError("option \"quoteStyle\" must be \"single\" or \"double\"");
|
|
6576
|
+
if (Y(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`");
|
|
6577
|
+
var u = Y(s, "customInspect") ? s.customInspect : !0;
|
|
6403
6578
|
if (typeof u != "boolean" && u !== "symbol") throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
|
|
6404
|
-
if (
|
|
6405
|
-
if (
|
|
6579
|
+
if (Y(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`");
|
|
6580
|
+
if (Y(s, "numericSeparator") && typeof s.numericSeparator != "boolean") throw TypeError("option \"numericSeparator\", if provided, must be `true` or `false`");
|
|
6406
6581
|
var d = s.numericSeparator;
|
|
6407
6582
|
if (t === void 0) return "undefined";
|
|
6408
6583
|
if (t === null) return "null";
|
|
@@ -6421,62 +6596,62 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6421
6596
|
if (r === void 0 && (r = 0), r >= h && h > 0 && typeof t == "object") return V(t) ? "[Array]" : "[Object]";
|
|
6422
6597
|
var g = ve(s, r);
|
|
6423
6598
|
if (o === void 0) o = [];
|
|
6424
|
-
else if (
|
|
6599
|
+
else if (ie(o, t) >= 0) return "[Circular]";
|
|
6425
6600
|
function y(t, n, i) {
|
|
6426
6601
|
if (n && (o = w.call(o), o.push(n)), i) {
|
|
6427
6602
|
var a = { depth: s.depth };
|
|
6428
|
-
return
|
|
6603
|
+
return Y(s, "quoteStyle") && (a.quoteStyle = s.quoteStyle), e(t, a, r + 1, o);
|
|
6429
6604
|
}
|
|
6430
6605
|
return e(t, s, r + 1, o);
|
|
6431
6606
|
}
|
|
6432
6607
|
if (typeof t == "function" && !U(t)) {
|
|
6433
|
-
var x =
|
|
6608
|
+
var x = X(t), T = be(t, y);
|
|
6434
6609
|
return "[Function" + (x ? ": " + x : " (anonymous)") + "]" + (T.length > 0 ? " { " + C.call(T, ", ") + " }" : "");
|
|
6435
6610
|
}
|
|
6436
|
-
if (
|
|
6611
|
+
if (K(t)) {
|
|
6437
6612
|
var D = k ? v.call(String(t), /^(Symbol\(.*\))_[^)]*$/, "$1") : O.call(t);
|
|
6438
6613
|
return typeof t == "object" && !k ? Z(D) : D;
|
|
6439
6614
|
}
|
|
6440
|
-
if (
|
|
6615
|
+
if (ue(t)) {
|
|
6441
6616
|
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);
|
|
6442
6617
|
return F += ">", t.childNodes && t.childNodes.length && (F += "..."), F += "</" + b.call(String(t.nodeName)) + ">", F;
|
|
6443
6618
|
}
|
|
6444
6619
|
if (V(t)) {
|
|
6445
6620
|
if (t.length === 0) return "[]";
|
|
6446
|
-
var
|
|
6447
|
-
return g && !_e(
|
|
6621
|
+
var J = be(t, y);
|
|
6622
|
+
return g && !_e(J) ? "[" + ye(J, g) + "]" : "[ " + C.call(J, ", ") + " ]";
|
|
6448
6623
|
}
|
|
6449
6624
|
if (te(t)) {
|
|
6450
|
-
var
|
|
6451
|
-
return !("cause" in Error.prototype) && "cause" in t && !j.call(t, "cause") ? "{ [" + String(t) + "] " + C.call(S.call("[cause]: " + y(t.cause),
|
|
6625
|
+
var fe = be(t, y);
|
|
6626
|
+
return !("cause" in Error.prototype) && "cause" in t && !j.call(t, "cause") ? "{ [" + String(t) + "] " + C.call(S.call("[cause]: " + y(t.cause), fe), ", ") + " }" : fe.length === 0 ? "[" + String(t) + "]" : "{ [" + String(t) + "] " + C.call(fe, ", ") + " }";
|
|
6452
6627
|
}
|
|
6453
6628
|
if (typeof t == "object" && u) {
|
|
6454
6629
|
if (I && typeof t[I] == "function" && P) return P(t, { depth: h - r });
|
|
6455
6630
|
if (u !== "symbol" && typeof t.inspect == "function") return t.inspect();
|
|
6456
6631
|
}
|
|
6457
|
-
if (
|
|
6632
|
+
if (ae(t)) {
|
|
6458
6633
|
var me = [];
|
|
6459
6634
|
return a && a.call(t, function(e, n) {
|
|
6460
6635
|
me.push(y(n, t, !0) + " => " + y(e, t));
|
|
6461
6636
|
}), ge("Map", i.call(t), me, g);
|
|
6462
6637
|
}
|
|
6463
|
-
if (
|
|
6638
|
+
if (ce(t)) {
|
|
6464
6639
|
var xe = [];
|
|
6465
6640
|
return l && l.call(t, function(e) {
|
|
6466
6641
|
xe.push(y(e, t));
|
|
6467
6642
|
}), ge("Set", c.call(t), xe, g);
|
|
6468
6643
|
}
|
|
6469
|
-
if (
|
|
6470
|
-
if (
|
|
6471
|
-
if (
|
|
6644
|
+
if (oe(t)) return he("WeakMap");
|
|
6645
|
+
if (le(t)) return he("WeakSet");
|
|
6646
|
+
if (se(t)) return he("WeakRef");
|
|
6472
6647
|
if (ne(t)) return Z(y(Number(t)));
|
|
6473
|
-
if (
|
|
6474
|
-
if (
|
|
6648
|
+
if (q(t)) return Z(y(E.call(t)));
|
|
6649
|
+
if (G(t)) return Z(p.call(t));
|
|
6475
6650
|
if (W(t)) return Z(y(String(t)));
|
|
6476
6651
|
if (typeof window < "u" && t === window) return "{ [object Window] }";
|
|
6477
|
-
if (typeof globalThis < "u" && t === globalThis ||
|
|
6652
|
+
if (typeof globalThis < "u" && t === globalThis || de !== void 0 && t === de) return "{ [object globalThis] }";
|
|
6478
6653
|
if (!H(t) && !U(t)) {
|
|
6479
|
-
var Se = be(t, y), Ce = M ? M(t) === Object.prototype : t instanceof Object || t.constructor === Object, we = t instanceof Object ? "" : "null prototype", Te = !Ce && A && Object(t) === t && A in t ? _.call(
|
|
6654
|
+
var Se = be(t, y), Ce = M ? M(t) === Object.prototype : t instanceof Object || t.constructor === Object, we = t instanceof Object ? "" : "null prototype", Te = !Ce && A && Object(t) === t && A in t ? _.call(re(t), 8, -1) : we ? "Object" : "", Ee = (Ce || typeof t.constructor != "function" ? "" : t.constructor.name ? t.constructor.name + " " : "") + (Te || we ? "[" + C.call(S.call([], Te || [], we || []), ": ") + "] " : "");
|
|
6480
6655
|
return Se.length === 0 ? Ee + "{}" : g ? Ee + "{" + ye(Se, g) + "}" : Ee + "{ " + C.call(Se, ", ") + " }";
|
|
6481
6656
|
}
|
|
6482
6657
|
return String(t);
|
|
@@ -6492,27 +6667,27 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6492
6667
|
return !A || !(typeof e == "object" && (A in e || e[A] !== void 0));
|
|
6493
6668
|
}
|
|
6494
6669
|
function V(e) {
|
|
6495
|
-
return
|
|
6670
|
+
return re(e) === "[object Array]" && B(e);
|
|
6496
6671
|
}
|
|
6497
6672
|
function H(e) {
|
|
6498
|
-
return
|
|
6673
|
+
return re(e) === "[object Date]" && B(e);
|
|
6499
6674
|
}
|
|
6500
6675
|
function U(e) {
|
|
6501
|
-
return
|
|
6676
|
+
return re(e) === "[object RegExp]" && B(e);
|
|
6502
6677
|
}
|
|
6503
6678
|
function te(e) {
|
|
6504
|
-
return
|
|
6679
|
+
return re(e) === "[object Error]" && B(e);
|
|
6505
6680
|
}
|
|
6506
6681
|
function W(e) {
|
|
6507
|
-
return
|
|
6682
|
+
return re(e) === "[object String]" && B(e);
|
|
6508
6683
|
}
|
|
6509
6684
|
function ne(e) {
|
|
6510
|
-
return
|
|
6511
|
-
}
|
|
6512
|
-
function re(e) {
|
|
6513
|
-
return J(e) === "[object Boolean]" && B(e);
|
|
6685
|
+
return re(e) === "[object Number]" && B(e);
|
|
6514
6686
|
}
|
|
6515
6687
|
function G(e) {
|
|
6688
|
+
return re(e) === "[object Boolean]" && B(e);
|
|
6689
|
+
}
|
|
6690
|
+
function K(e) {
|
|
6516
6691
|
if (k) return e && typeof e == "object" && e instanceof Symbol;
|
|
6517
6692
|
if (typeof e == "symbol") return !0;
|
|
6518
6693
|
if (!e || typeof e != "object" || !O) return !1;
|
|
@@ -6521,33 +6696,33 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6521
6696
|
} catch {}
|
|
6522
6697
|
return !1;
|
|
6523
6698
|
}
|
|
6524
|
-
function
|
|
6699
|
+
function q(e) {
|
|
6525
6700
|
if (!e || typeof e != "object" || !E) return !1;
|
|
6526
6701
|
try {
|
|
6527
6702
|
return E.call(e), !0;
|
|
6528
6703
|
} catch {}
|
|
6529
6704
|
return !1;
|
|
6530
6705
|
}
|
|
6531
|
-
var
|
|
6706
|
+
var J = Object.prototype.hasOwnProperty || function(e) {
|
|
6532
6707
|
return e in this;
|
|
6533
6708
|
};
|
|
6534
|
-
function
|
|
6535
|
-
return
|
|
6709
|
+
function Y(e, t) {
|
|
6710
|
+
return J.call(e, t);
|
|
6536
6711
|
}
|
|
6537
|
-
function
|
|
6712
|
+
function re(e) {
|
|
6538
6713
|
return m.call(e);
|
|
6539
6714
|
}
|
|
6540
|
-
function
|
|
6715
|
+
function X(e) {
|
|
6541
6716
|
if (e.name) return e.name;
|
|
6542
6717
|
var t = g.call(h.call(e), /^function\s*([\w$]+)/);
|
|
6543
6718
|
return t ? t[1] : null;
|
|
6544
6719
|
}
|
|
6545
|
-
function
|
|
6720
|
+
function ie(e, t) {
|
|
6546
6721
|
if (e.indexOf) return e.indexOf(t);
|
|
6547
6722
|
for (var n = 0, r = e.length; n < r; n++) if (e[n] === t) return n;
|
|
6548
6723
|
return -1;
|
|
6549
6724
|
}
|
|
6550
|
-
function
|
|
6725
|
+
function ae(e) {
|
|
6551
6726
|
if (!i || !e || typeof e != "object") return !1;
|
|
6552
6727
|
try {
|
|
6553
6728
|
i.call(e);
|
|
@@ -6560,7 +6735,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6560
6735
|
} catch {}
|
|
6561
6736
|
return !1;
|
|
6562
6737
|
}
|
|
6563
|
-
function
|
|
6738
|
+
function oe(e) {
|
|
6564
6739
|
if (!u || !e || typeof e != "object") return !1;
|
|
6565
6740
|
try {
|
|
6566
6741
|
u.call(e, u);
|
|
@@ -6573,14 +6748,14 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6573
6748
|
} catch {}
|
|
6574
6749
|
return !1;
|
|
6575
6750
|
}
|
|
6576
|
-
function
|
|
6751
|
+
function se(e) {
|
|
6577
6752
|
if (!f || !e || typeof e != "object") return !1;
|
|
6578
6753
|
try {
|
|
6579
6754
|
return f.call(e), !0;
|
|
6580
6755
|
} catch {}
|
|
6581
6756
|
return !1;
|
|
6582
6757
|
}
|
|
6583
|
-
function
|
|
6758
|
+
function ce(e) {
|
|
6584
6759
|
if (!c || !e || typeof e != "object") return !1;
|
|
6585
6760
|
try {
|
|
6586
6761
|
c.call(e);
|
|
@@ -6593,7 +6768,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6593
6768
|
} catch {}
|
|
6594
6769
|
return !1;
|
|
6595
6770
|
}
|
|
6596
|
-
function
|
|
6771
|
+
function le(e) {
|
|
6597
6772
|
if (!d || !e || typeof e != "object") return !1;
|
|
6598
6773
|
try {
|
|
6599
6774
|
d.call(e, d);
|
|
@@ -6606,7 +6781,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6606
6781
|
} catch {}
|
|
6607
6782
|
return !1;
|
|
6608
6783
|
}
|
|
6609
|
-
function
|
|
6784
|
+
function ue(e) {
|
|
6610
6785
|
return !e || typeof e != "object" ? !1 : typeof HTMLElement < "u" && e instanceof HTMLElement ? !0 : typeof e.nodeName == "string" && typeof e.getAttribute == "function";
|
|
6611
6786
|
}
|
|
6612
6787
|
function pe(e, t) {
|
|
@@ -6638,7 +6813,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6638
6813
|
return e + " (" + t + ") {" + i + "}";
|
|
6639
6814
|
}
|
|
6640
6815
|
function _e(e) {
|
|
6641
|
-
for (var t = 0; t < e.length; t++) if (
|
|
6816
|
+
for (var t = 0; t < e.length; t++) if (ie(e[t], "\n") >= 0) return !1;
|
|
6642
6817
|
return !0;
|
|
6643
6818
|
}
|
|
6644
6819
|
function ve(e, t) {
|
|
@@ -6660,14 +6835,14 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6660
6835
|
var n = V(e), r = [];
|
|
6661
6836
|
if (n) {
|
|
6662
6837
|
r.length = e.length;
|
|
6663
|
-
for (var i = 0; i < e.length; i++) r[i] =
|
|
6838
|
+
for (var i = 0; i < e.length; i++) r[i] = Y(e, i) ? t(e[i], e) : "";
|
|
6664
6839
|
}
|
|
6665
6840
|
var a = typeof D == "function" ? D(e) : [], o;
|
|
6666
6841
|
if (k) {
|
|
6667
6842
|
o = {};
|
|
6668
6843
|
for (var s = 0; s < a.length; s++) o["$" + a[s]] = a[s];
|
|
6669
6844
|
}
|
|
6670
|
-
for (var c in e)
|
|
6845
|
+
for (var c in e) Y(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))));
|
|
6671
6846
|
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));
|
|
6672
6847
|
return r;
|
|
6673
6848
|
}
|
|
@@ -7580,7 +7755,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
7580
7755
|
shim: o
|
|
7581
7756
|
}), t.exports = s;
|
|
7582
7757
|
})), sr = /* @__PURE__ */ t(((e, t) => {
|
|
7583
|
-
var n = ne(), { createGenericWasmCommand: r } =
|
|
7758
|
+
var n = ne(), { createGenericWasmCommand: r } = ae(), 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 {
|
|
7584
7759
|
get requiresFilesystem() {
|
|
7585
7760
|
return !0;
|
|
7586
7761
|
}
|
|
@@ -7851,7 +8026,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
7851
8026
|
f.createReplWasmCommand = p, f.createCommand = p, t.exports = f;
|
|
7852
8027
|
})), cr = /* @__PURE__ */ t(((e, t) => {
|
|
7853
8028
|
b();
|
|
7854
|
-
var r =
|
|
8029
|
+
var r = re(), i = X(), a = ie(), o = ae(), s = W(), c = ne(), { TtyStream: l } = te(), u = "/.brsh_history", d = be(), f = He(), p = V(), m = x(), { isAsyncFilesystemSource: h, resolveFilesystemSource: g } = G(), _ = /\$(?:\{([\w\d?#@*-]+)\}|([\w\d]+|[?#@*-]))/g, v = p.EventEmitter || p.default || p;
|
|
7855
8030
|
String.prototype.regexIndexOf = function(e, t) {
|
|
7856
8031
|
let n = this.substring(t || 0).search(e);
|
|
7857
8032
|
return n >= 0 ? n + (t || 0) : n;
|
|
@@ -8764,7 +8939,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
8764
8939
|
return e.create(Object.assign({}, n, { filesystem: t }));
|
|
8765
8940
|
}
|
|
8766
8941
|
};
|
|
8767
|
-
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 =
|
|
8942
|
+
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 = G(), S.Storage = S.BinaryContainer.FilesystemStorage, globalThis.shell = S, globalThis.Shell = S, t.exports = S;
|
|
8768
8943
|
}));
|
|
8769
8944
|
//#endregion
|
|
8770
8945
|
export default cr();
|