brsh 2.1.0 → 2.1.2
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/.github/workflows/pages.yml +5 -2
- package/.nvmrc +1 -0
- package/CHANGELOG.md +14 -0
- package/bin/brsh-shell.js +65 -0
- package/dist/brsh.css +1 -1
- package/dist/shell.es.js +585 -495
- package/dist/shell.es.js.map +1 -1
- package/dist/shell.min.js +6 -6
- package/dist/shell.min.js.map +1 -1
- package/dist/terminal.es.js +598 -499
- package/dist/terminal.es.js.map +1 -1
- package/dist/terminal.min.js +8 -8
- package/dist/terminal.min.js.map +1 -1
- package/index.js +9 -4
- package/lib/Command.js +3 -1
- package/lib/Context.js +1 -0
- package/lib/NodeFileSystem.js +5 -1
- package/lib/Terminal.js +29 -2
- package/lib/WasmCommand.js +14 -7
- package/lib/buildFilesystemStructure.js +9 -4
- package/lib/local/curl.js +133 -0
- package/lib/local/index.js +2 -1
- package/lib/local/source.js +1 -3
- package/package.json +6 -3
- package/styles/terminal.css +8 -1
- package/test/exportFileSystem.test.js +28 -8
- package/test/scripts.test.js +57 -0
- package/vite.config.js +34 -0
package/dist/terminal.es.js
CHANGED
|
@@ -1,185 +1,7 @@
|
|
|
1
1
|
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = (e, t) => () => (e && (t = e(e = 0)), t), t = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), n =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}), r, i = e((() => {
|
|
6
|
-
r = globalThis || self;
|
|
7
|
-
})), a = /* @__PURE__ */ t(((e, t) => {
|
|
8
|
-
var n = typeof Reflect == "object" ? Reflect : null, r = n && typeof n.apply == "function" ? n.apply : function(e, t, n) {
|
|
9
|
-
return Function.prototype.apply.call(e, t, n);
|
|
10
|
-
}, i = n && typeof n.ownKeys == "function" ? n.ownKeys : Object.getOwnPropertySymbols ? function(e) {
|
|
11
|
-
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
12
|
-
} : function(e) {
|
|
13
|
-
return Object.getOwnPropertyNames(e);
|
|
14
|
-
};
|
|
15
|
-
function a(e) {
|
|
16
|
-
console && console.warn && console.warn(e);
|
|
17
|
-
}
|
|
18
|
-
var o = Number.isNaN || function(e) {
|
|
19
|
-
return e !== e;
|
|
20
|
-
};
|
|
21
|
-
function s() {
|
|
22
|
-
s.init.call(this);
|
|
23
|
-
}
|
|
24
|
-
t.exports = s, t.exports.once = y, s.EventEmitter = s, s.prototype._events = void 0, s.prototype._eventsCount = 0, s.prototype._maxListeners = void 0;
|
|
25
|
-
var c = 10;
|
|
26
|
-
function l(e) {
|
|
27
|
-
if (typeof e != "function") throw TypeError("The \"listener\" argument must be of type Function. Received type " + typeof e);
|
|
28
|
-
}
|
|
29
|
-
Object.defineProperty(s, "defaultMaxListeners", {
|
|
30
|
-
enumerable: !0,
|
|
31
|
-
get: function() {
|
|
32
|
-
return c;
|
|
33
|
-
},
|
|
34
|
-
set: function(e) {
|
|
35
|
-
if (typeof e != "number" || e < 0 || o(e)) throw RangeError("The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received " + e + ".");
|
|
36
|
-
c = e;
|
|
37
|
-
}
|
|
38
|
-
}), s.init = function() {
|
|
39
|
-
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
40
|
-
}, s.prototype.setMaxListeners = function(e) {
|
|
41
|
-
if (typeof e != "number" || e < 0 || o(e)) throw RangeError("The value of \"n\" is out of range. It must be a non-negative number. Received " + e + ".");
|
|
42
|
-
return this._maxListeners = e, this;
|
|
43
|
-
};
|
|
44
|
-
function u(e) {
|
|
45
|
-
return e._maxListeners === void 0 ? s.defaultMaxListeners : e._maxListeners;
|
|
46
|
-
}
|
|
47
|
-
s.prototype.getMaxListeners = function() {
|
|
48
|
-
return u(this);
|
|
49
|
-
}, s.prototype.emit = function(e) {
|
|
50
|
-
for (var t = [], n = 1; n < arguments.length; n++) t.push(arguments[n]);
|
|
51
|
-
var i = e === "error", a = this._events;
|
|
52
|
-
if (a !== void 0) i &&= a.error === void 0;
|
|
53
|
-
else if (!i) return !1;
|
|
54
|
-
if (i) {
|
|
55
|
-
var o;
|
|
56
|
-
if (t.length > 0 && (o = t[0]), o instanceof Error) throw o;
|
|
57
|
-
var s = /* @__PURE__ */ Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
|
|
58
|
-
throw s.context = o, s;
|
|
59
|
-
}
|
|
60
|
-
var c = a[e];
|
|
61
|
-
if (c === void 0) return !1;
|
|
62
|
-
if (typeof c == "function") r(c, this, t);
|
|
63
|
-
else for (var l = c.length, u = g(c, l), n = 0; n < l; ++n) r(u[n], this, t);
|
|
64
|
-
return !0;
|
|
65
|
-
};
|
|
66
|
-
function d(e, t, n, r) {
|
|
67
|
-
var i, o, s;
|
|
68
|
-
if (l(n), o = e._events, o === void 0 ? (o = e._events = Object.create(null), e._eventsCount = 0) : (o.newListener !== void 0 && (e.emit("newListener", t, n.listener ? n.listener : n), o = e._events), s = o[t]), s === void 0) s = o[t] = n, ++e._eventsCount;
|
|
69
|
-
else if (typeof s == "function" ? s = o[t] = r ? [n, s] : [s, n] : r ? s.unshift(n) : s.push(n), i = u(e), i > 0 && s.length > i && !s.warned) {
|
|
70
|
-
s.warned = !0;
|
|
71
|
-
var c = /* @__PURE__ */ Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
72
|
-
c.name = "MaxListenersExceededWarning", c.emitter = e, c.type = t, c.count = s.length, a(c);
|
|
73
|
-
}
|
|
74
|
-
return e;
|
|
75
|
-
}
|
|
76
|
-
s.prototype.addListener = function(e, t) {
|
|
77
|
-
return d(this, e, t, !1);
|
|
78
|
-
}, s.prototype.on = s.prototype.addListener, s.prototype.prependListener = function(e, t) {
|
|
79
|
-
return d(this, e, t, !0);
|
|
80
|
-
};
|
|
81
|
-
function f() {
|
|
82
|
-
if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
83
|
-
}
|
|
84
|
-
function p(e, t, n) {
|
|
85
|
-
var r = {
|
|
86
|
-
fired: !1,
|
|
87
|
-
wrapFn: void 0,
|
|
88
|
-
target: e,
|
|
89
|
-
type: t,
|
|
90
|
-
listener: n
|
|
91
|
-
}, i = f.bind(r);
|
|
92
|
-
return i.listener = n, r.wrapFn = i, i;
|
|
93
|
-
}
|
|
94
|
-
s.prototype.once = function(e, t) {
|
|
95
|
-
return l(t), this.on(e, p(this, e, t)), this;
|
|
96
|
-
}, s.prototype.prependOnceListener = function(e, t) {
|
|
97
|
-
return l(t), this.prependListener(e, p(this, e, t)), this;
|
|
98
|
-
}, s.prototype.removeListener = function(e, t) {
|
|
99
|
-
var n, r, i, a, o;
|
|
100
|
-
if (l(t), r = this._events, r === void 0 || (n = r[e], n === void 0)) return this;
|
|
101
|
-
if (n === t || n.listener === t) --this._eventsCount === 0 ? this._events = Object.create(null) : (delete r[e], r.removeListener && this.emit("removeListener", e, n.listener || t));
|
|
102
|
-
else if (typeof n != "function") {
|
|
103
|
-
for (i = -1, a = n.length - 1; a >= 0; a--) if (n[a] === t || n[a].listener === t) {
|
|
104
|
-
o = n[a].listener, i = a;
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
if (i < 0) return this;
|
|
108
|
-
i === 0 ? n.shift() : _(n, i), n.length === 1 && (r[e] = n[0]), r.removeListener !== void 0 && this.emit("removeListener", e, o || t);
|
|
109
|
-
}
|
|
110
|
-
return this;
|
|
111
|
-
}, s.prototype.off = s.prototype.removeListener, s.prototype.removeAllListeners = function(e) {
|
|
112
|
-
var t, n = this._events, r;
|
|
113
|
-
if (n === void 0) return this;
|
|
114
|
-
if (n.removeListener === void 0) return arguments.length === 0 ? (this._events = Object.create(null), this._eventsCount = 0) : n[e] !== void 0 && (--this._eventsCount === 0 ? this._events = Object.create(null) : delete n[e]), this;
|
|
115
|
-
if (arguments.length === 0) {
|
|
116
|
-
var i = Object.keys(n), a;
|
|
117
|
-
for (r = 0; r < i.length; ++r) a = i[r], a !== "removeListener" && this.removeAllListeners(a);
|
|
118
|
-
return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this;
|
|
119
|
-
}
|
|
120
|
-
if (t = n[e], typeof t == "function") this.removeListener(e, t);
|
|
121
|
-
else if (t !== void 0) for (r = t.length - 1; r >= 0; r--) this.removeListener(e, t[r]);
|
|
122
|
-
return this;
|
|
123
|
-
};
|
|
124
|
-
function m(e, t, n) {
|
|
125
|
-
var r = e._events;
|
|
126
|
-
if (r === void 0) return [];
|
|
127
|
-
var i = r[t];
|
|
128
|
-
return i === void 0 ? [] : typeof i == "function" ? n ? [i.listener || i] : [i] : n ? v(i) : g(i, i.length);
|
|
129
|
-
}
|
|
130
|
-
s.prototype.listeners = function(e) {
|
|
131
|
-
return m(this, e, !0);
|
|
132
|
-
}, s.prototype.rawListeners = function(e) {
|
|
133
|
-
return m(this, e, !1);
|
|
134
|
-
}, s.listenerCount = function(e, t) {
|
|
135
|
-
return typeof e.listenerCount == "function" ? e.listenerCount(t) : h.call(e, t);
|
|
136
|
-
}, s.prototype.listenerCount = h;
|
|
137
|
-
function h(e) {
|
|
138
|
-
var t = this._events;
|
|
139
|
-
if (t !== void 0) {
|
|
140
|
-
var n = t[e];
|
|
141
|
-
if (typeof n == "function") return 1;
|
|
142
|
-
if (n !== void 0) return n.length;
|
|
143
|
-
}
|
|
144
|
-
return 0;
|
|
145
|
-
}
|
|
146
|
-
s.prototype.eventNames = function() {
|
|
147
|
-
return this._eventsCount > 0 ? i(this._events) : [];
|
|
148
|
-
};
|
|
149
|
-
function g(e, t) {
|
|
150
|
-
for (var n = Array(t), r = 0; r < t; ++r) n[r] = e[r];
|
|
151
|
-
return n;
|
|
152
|
-
}
|
|
153
|
-
function _(e, t) {
|
|
154
|
-
for (; t + 1 < e.length; t++) e[t] = e[t + 1];
|
|
155
|
-
e.pop();
|
|
156
|
-
}
|
|
157
|
-
function v(e) {
|
|
158
|
-
for (var t = Array(e.length), n = 0; n < t.length; ++n) t[n] = e[n].listener || e[n];
|
|
159
|
-
return t;
|
|
160
|
-
}
|
|
161
|
-
function y(e, t) {
|
|
162
|
-
return new Promise(function(n, r) {
|
|
163
|
-
function i(n) {
|
|
164
|
-
e.removeListener(t, a), r(n);
|
|
165
|
-
}
|
|
166
|
-
function a() {
|
|
167
|
-
typeof e.removeListener == "function" && e.removeListener("error", i), n([].slice.call(arguments));
|
|
168
|
-
}
|
|
169
|
-
x(e, t, a, { once: !0 }), t !== "error" && b(e, i, { once: !0 });
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
function b(e, t, n) {
|
|
173
|
-
typeof e.on == "function" && x(e, "error", t, n);
|
|
174
|
-
}
|
|
175
|
-
function x(e, t, n, r) {
|
|
176
|
-
if (typeof e.on == "function") r.once ? e.once(t, n) : e.on(t, n);
|
|
177
|
-
else if (typeof e.addEventListener == "function") e.addEventListener(t, function i(a) {
|
|
178
|
-
r.once && e.removeEventListener(t, i), n(a);
|
|
179
|
-
});
|
|
180
|
-
else throw TypeError("The \"emitter\" argument must be of type EventEmitter. Received type " + typeof e);
|
|
181
|
-
}
|
|
182
|
-
})), o = /* @__PURE__ */ t(((e, t) => {
|
|
2
|
+
var e = (e, t) => () => (e && (t = e(e = 0)), t), t = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), n, r = e((() => {
|
|
3
|
+
n = globalThis || self;
|
|
4
|
+
})), i = /* @__PURE__ */ t(((e, t) => {
|
|
183
5
|
t.exports = class {
|
|
184
6
|
constructor(e = "/", t = {}, n = {}, r = null) {
|
|
185
7
|
this.fileSystem = t, this.permissions = Object.assign({}, n), this.cwd = e, this._onChange = r, this._changeScheduled = !1;
|
|
@@ -296,92 +118,92 @@ var e = (e, t) => () => (e && (t = e(e = 0)), t), t = (e, t) => () => (t || (e((
|
|
|
296
118
|
}));
|
|
297
119
|
//#endregion
|
|
298
120
|
//#region node_modules/vite-plugin-node-polyfills/shims/process/dist/index.js
|
|
299
|
-
function
|
|
121
|
+
function a(e) {
|
|
300
122
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
301
123
|
}
|
|
302
|
-
function
|
|
124
|
+
function o() {
|
|
303
125
|
throw Error("setTimeout has not been defined");
|
|
304
126
|
}
|
|
305
|
-
function
|
|
127
|
+
function s() {
|
|
306
128
|
throw Error("clearTimeout has not been defined");
|
|
307
129
|
}
|
|
308
|
-
function
|
|
309
|
-
if (
|
|
310
|
-
if ((
|
|
130
|
+
function c(e) {
|
|
131
|
+
if (g === setTimeout) return setTimeout(e, 0);
|
|
132
|
+
if ((g === o || !g) && setTimeout) return g = setTimeout, setTimeout(e, 0);
|
|
311
133
|
try {
|
|
312
|
-
return
|
|
134
|
+
return g(e, 0);
|
|
313
135
|
} catch {
|
|
314
136
|
try {
|
|
315
|
-
return
|
|
137
|
+
return g.call(null, e, 0);
|
|
316
138
|
} catch {
|
|
317
|
-
return
|
|
139
|
+
return g.call(this, e, 0);
|
|
318
140
|
}
|
|
319
141
|
}
|
|
320
142
|
}
|
|
321
|
-
function
|
|
322
|
-
if (
|
|
323
|
-
if ((
|
|
143
|
+
function l(e) {
|
|
144
|
+
if (_ === clearTimeout) return clearTimeout(e);
|
|
145
|
+
if ((_ === s || !_) && clearTimeout) return _ = clearTimeout, clearTimeout(e);
|
|
324
146
|
try {
|
|
325
|
-
return
|
|
147
|
+
return _(e);
|
|
326
148
|
} catch {
|
|
327
149
|
try {
|
|
328
|
-
return
|
|
150
|
+
return _.call(null, e);
|
|
329
151
|
} catch {
|
|
330
|
-
return
|
|
152
|
+
return _.call(this, e);
|
|
331
153
|
}
|
|
332
154
|
}
|
|
333
155
|
}
|
|
334
|
-
function
|
|
335
|
-
!
|
|
156
|
+
function u() {
|
|
157
|
+
!y || !b || (y = !1, b.length ? v = b.concat(v) : x = -1, v.length && d());
|
|
336
158
|
}
|
|
337
|
-
function
|
|
338
|
-
if (!
|
|
339
|
-
var e = u
|
|
340
|
-
|
|
341
|
-
for (var t =
|
|
342
|
-
for (
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
|
|
159
|
+
function d() {
|
|
160
|
+
if (!y) {
|
|
161
|
+
var e = c(u);
|
|
162
|
+
y = !0;
|
|
163
|
+
for (var t = v.length; t;) {
|
|
164
|
+
for (b = v, v = []; ++x < t;) b && b[x].run();
|
|
165
|
+
x = -1, t = v.length;
|
|
166
|
+
}
|
|
167
|
+
b = null, y = !1, l(e);
|
|
346
168
|
}
|
|
347
169
|
}
|
|
348
|
-
function
|
|
170
|
+
function f(e, t) {
|
|
349
171
|
this.fun = e, this.array = t;
|
|
350
172
|
}
|
|
351
|
-
function
|
|
352
|
-
var g, _, v, y, b, x, S, C, w
|
|
353
|
-
|
|
173
|
+
function p() {}
|
|
174
|
+
var m, h, g, _, v, y, b, x, S, C, w = e((() => {
|
|
175
|
+
m = { exports: {} }, h = m.exports = {}, (function() {
|
|
354
176
|
try {
|
|
355
|
-
|
|
177
|
+
g = typeof setTimeout == "function" ? setTimeout : o;
|
|
356
178
|
} catch {
|
|
357
|
-
|
|
179
|
+
g = o;
|
|
358
180
|
}
|
|
359
181
|
try {
|
|
360
|
-
|
|
182
|
+
_ = typeof clearTimeout == "function" ? clearTimeout : s;
|
|
361
183
|
} catch {
|
|
362
|
-
|
|
184
|
+
_ = s;
|
|
363
185
|
}
|
|
364
|
-
})(),
|
|
186
|
+
})(), v = [], y = !1, x = -1, h.nextTick = function(e) {
|
|
365
187
|
var t = Array(arguments.length - 1);
|
|
366
188
|
if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
|
|
367
|
-
|
|
368
|
-
},
|
|
189
|
+
v.push(new f(e, t)), v.length === 1 && !y && c(d);
|
|
190
|
+
}, f.prototype.run = function() {
|
|
369
191
|
this.fun.apply(null, this.array);
|
|
370
|
-
},
|
|
192
|
+
}, h.title = "browser", h.browser = !0, h.env = {}, h.argv = [], h.version = "", h.versions = {}, h.on = p, h.addListener = p, h.once = p, h.off = p, h.removeListener = p, h.removeAllListeners = p, h.emit = p, h.prependListener = p, h.prependOnceListener = p, h.listeners = function(e) {
|
|
371
193
|
return [];
|
|
372
|
-
},
|
|
194
|
+
}, h.binding = function(e) {
|
|
373
195
|
throw Error("process.binding is not supported");
|
|
374
|
-
},
|
|
196
|
+
}, h.cwd = function() {
|
|
375
197
|
return "/";
|
|
376
|
-
},
|
|
198
|
+
}, h.chdir = function(e) {
|
|
377
199
|
throw Error("process.chdir is not supported");
|
|
378
|
-
},
|
|
200
|
+
}, h.umask = function() {
|
|
379
201
|
return 0;
|
|
380
|
-
},
|
|
381
|
-
})),
|
|
202
|
+
}, S = m.exports, C = /* @__PURE__ */ a(S);
|
|
203
|
+
})), T = /* @__PURE__ */ t(((e, t) => {
|
|
382
204
|
t.exports = null;
|
|
383
|
-
})),
|
|
384
|
-
|
|
205
|
+
})), E = /* @__PURE__ */ t(((e, t) => {
|
|
206
|
+
w();
|
|
385
207
|
function n(e) {
|
|
386
208
|
if (typeof e != "string") throw TypeError("Path must be a string. Received " + JSON.stringify(e));
|
|
387
209
|
}
|
|
@@ -419,7 +241,7 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
419
241
|
resolve: function() {
|
|
420
242
|
for (var e = "", t = !1, i, a = arguments.length - 1; a >= -1 && !t; a--) {
|
|
421
243
|
var o;
|
|
422
|
-
a >= 0 ? o = arguments[a] : (i === void 0 && (i =
|
|
244
|
+
a >= 0 ? o = arguments[a] : (i === void 0 && (i = C.cwd()), o = i), n(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
|
|
423
245
|
}
|
|
424
246
|
return e = r(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
425
247
|
},
|
|
@@ -548,12 +370,12 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
548
370
|
posix: null
|
|
549
371
|
};
|
|
550
372
|
a.posix = a, t.exports = a;
|
|
551
|
-
})),
|
|
552
|
-
|
|
553
|
-
var n =
|
|
373
|
+
})), D = /* @__PURE__ */ t(((e, t) => {
|
|
374
|
+
w();
|
|
375
|
+
var n = T(), r = E();
|
|
554
376
|
t.exports = class {
|
|
555
377
|
constructor(e, t = null) {
|
|
556
|
-
this._onChange = t, this._changeScheduled = !1, this._virtualFiles = {}, this.cwd = this._normalizeCwd(e ||
|
|
378
|
+
this._onChange = t, this._changeScheduled = !1, this._virtualFiles = {}, this.cwd = this._normalizeCwd(e || C.cwd());
|
|
557
379
|
}
|
|
558
380
|
get isRealFilesystem() {
|
|
559
381
|
return !0;
|
|
@@ -633,7 +455,8 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
633
455
|
}
|
|
634
456
|
}
|
|
635
457
|
setMode(e, t) {
|
|
636
|
-
|
|
458
|
+
let r = this.absolutePath(e);
|
|
459
|
+
this._virtualFiles[r] === void 0 && (n.chmodSync(r, t), this._triggerChange());
|
|
637
460
|
}
|
|
638
461
|
isExecutable(e) {
|
|
639
462
|
let t = this.getMode(e);
|
|
@@ -718,8 +541,8 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
718
541
|
}));
|
|
719
542
|
}
|
|
720
543
|
};
|
|
721
|
-
})),
|
|
722
|
-
var n =
|
|
544
|
+
})), O = /* @__PURE__ */ t(((e, t) => {
|
|
545
|
+
var n = i();
|
|
723
546
|
t.exports = class {
|
|
724
547
|
constructor(e) {
|
|
725
548
|
this.options = e;
|
|
@@ -746,14 +569,14 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
746
569
|
}
|
|
747
570
|
setCommand(e) {
|
|
748
571
|
let t = `${this.getVar("PATH")}/${e.name.toLowerCase()}`;
|
|
749
|
-
this.fs.addFiles({ [t]: e });
|
|
572
|
+
this.fs.addFiles({ [t]: e }), this.fs.setMode(t, 365);
|
|
750
573
|
}
|
|
751
574
|
getCommand(e) {
|
|
752
575
|
let t = `${this.getVar("PATH")}/${e}`;
|
|
753
576
|
return this.fs.getFileByPath(t) || null;
|
|
754
577
|
}
|
|
755
578
|
setNodeFilesystem(e) {
|
|
756
|
-
let t =
|
|
579
|
+
let t = D(), n = this.fs._onChange;
|
|
757
580
|
this.fs = new t(e, n);
|
|
758
581
|
}
|
|
759
582
|
setFilesystem(e, t = {}) {
|
|
@@ -773,7 +596,182 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
773
596
|
typeof this._destroyFn == "function" && this._destroyFn(e);
|
|
774
597
|
}
|
|
775
598
|
};
|
|
776
|
-
})),
|
|
599
|
+
})), k = /* @__PURE__ */ t(((e, t) => {
|
|
600
|
+
var n = typeof Reflect == "object" ? Reflect : null, r = n && typeof n.apply == "function" ? n.apply : function(e, t, n) {
|
|
601
|
+
return Function.prototype.apply.call(e, t, n);
|
|
602
|
+
}, i = n && typeof n.ownKeys == "function" ? n.ownKeys : Object.getOwnPropertySymbols ? function(e) {
|
|
603
|
+
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
604
|
+
} : function(e) {
|
|
605
|
+
return Object.getOwnPropertyNames(e);
|
|
606
|
+
};
|
|
607
|
+
function a(e) {
|
|
608
|
+
console && console.warn && console.warn(e);
|
|
609
|
+
}
|
|
610
|
+
var o = Number.isNaN || function(e) {
|
|
611
|
+
return e !== e;
|
|
612
|
+
};
|
|
613
|
+
function s() {
|
|
614
|
+
s.init.call(this);
|
|
615
|
+
}
|
|
616
|
+
t.exports = s, t.exports.once = y, s.EventEmitter = s, s.prototype._events = void 0, s.prototype._eventsCount = 0, s.prototype._maxListeners = void 0;
|
|
617
|
+
var c = 10;
|
|
618
|
+
function l(e) {
|
|
619
|
+
if (typeof e != "function") throw TypeError("The \"listener\" argument must be of type Function. Received type " + typeof e);
|
|
620
|
+
}
|
|
621
|
+
Object.defineProperty(s, "defaultMaxListeners", {
|
|
622
|
+
enumerable: !0,
|
|
623
|
+
get: function() {
|
|
624
|
+
return c;
|
|
625
|
+
},
|
|
626
|
+
set: function(e) {
|
|
627
|
+
if (typeof e != "number" || e < 0 || o(e)) throw RangeError("The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received " + e + ".");
|
|
628
|
+
c = e;
|
|
629
|
+
}
|
|
630
|
+
}), s.init = function() {
|
|
631
|
+
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
632
|
+
}, s.prototype.setMaxListeners = function(e) {
|
|
633
|
+
if (typeof e != "number" || e < 0 || o(e)) throw RangeError("The value of \"n\" is out of range. It must be a non-negative number. Received " + e + ".");
|
|
634
|
+
return this._maxListeners = e, this;
|
|
635
|
+
};
|
|
636
|
+
function u(e) {
|
|
637
|
+
return e._maxListeners === void 0 ? s.defaultMaxListeners : e._maxListeners;
|
|
638
|
+
}
|
|
639
|
+
s.prototype.getMaxListeners = function() {
|
|
640
|
+
return u(this);
|
|
641
|
+
}, s.prototype.emit = function(e) {
|
|
642
|
+
for (var t = [], n = 1; n < arguments.length; n++) t.push(arguments[n]);
|
|
643
|
+
var i = e === "error", a = this._events;
|
|
644
|
+
if (a !== void 0) i &&= a.error === void 0;
|
|
645
|
+
else if (!i) return !1;
|
|
646
|
+
if (i) {
|
|
647
|
+
var o;
|
|
648
|
+
if (t.length > 0 && (o = t[0]), o instanceof Error) throw o;
|
|
649
|
+
var s = /* @__PURE__ */ Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
|
|
650
|
+
throw s.context = o, s;
|
|
651
|
+
}
|
|
652
|
+
var c = a[e];
|
|
653
|
+
if (c === void 0) return !1;
|
|
654
|
+
if (typeof c == "function") r(c, this, t);
|
|
655
|
+
else for (var l = c.length, u = g(c, l), n = 0; n < l; ++n) r(u[n], this, t);
|
|
656
|
+
return !0;
|
|
657
|
+
};
|
|
658
|
+
function d(e, t, n, r) {
|
|
659
|
+
var i, o, s;
|
|
660
|
+
if (l(n), o = e._events, o === void 0 ? (o = e._events = Object.create(null), e._eventsCount = 0) : (o.newListener !== void 0 && (e.emit("newListener", t, n.listener ? n.listener : n), o = e._events), s = o[t]), s === void 0) s = o[t] = n, ++e._eventsCount;
|
|
661
|
+
else if (typeof s == "function" ? s = o[t] = r ? [n, s] : [s, n] : r ? s.unshift(n) : s.push(n), i = u(e), i > 0 && s.length > i && !s.warned) {
|
|
662
|
+
s.warned = !0;
|
|
663
|
+
var c = /* @__PURE__ */ Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
664
|
+
c.name = "MaxListenersExceededWarning", c.emitter = e, c.type = t, c.count = s.length, a(c);
|
|
665
|
+
}
|
|
666
|
+
return e;
|
|
667
|
+
}
|
|
668
|
+
s.prototype.addListener = function(e, t) {
|
|
669
|
+
return d(this, e, t, !1);
|
|
670
|
+
}, s.prototype.on = s.prototype.addListener, s.prototype.prependListener = function(e, t) {
|
|
671
|
+
return d(this, e, t, !0);
|
|
672
|
+
};
|
|
673
|
+
function f() {
|
|
674
|
+
if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
675
|
+
}
|
|
676
|
+
function p(e, t, n) {
|
|
677
|
+
var r = {
|
|
678
|
+
fired: !1,
|
|
679
|
+
wrapFn: void 0,
|
|
680
|
+
target: e,
|
|
681
|
+
type: t,
|
|
682
|
+
listener: n
|
|
683
|
+
}, i = f.bind(r);
|
|
684
|
+
return i.listener = n, r.wrapFn = i, i;
|
|
685
|
+
}
|
|
686
|
+
s.prototype.once = function(e, t) {
|
|
687
|
+
return l(t), this.on(e, p(this, e, t)), this;
|
|
688
|
+
}, s.prototype.prependOnceListener = function(e, t) {
|
|
689
|
+
return l(t), this.prependListener(e, p(this, e, t)), this;
|
|
690
|
+
}, s.prototype.removeListener = function(e, t) {
|
|
691
|
+
var n, r, i, a, o;
|
|
692
|
+
if (l(t), r = this._events, r === void 0 || (n = r[e], n === void 0)) return this;
|
|
693
|
+
if (n === t || n.listener === t) --this._eventsCount === 0 ? this._events = Object.create(null) : (delete r[e], r.removeListener && this.emit("removeListener", e, n.listener || t));
|
|
694
|
+
else if (typeof n != "function") {
|
|
695
|
+
for (i = -1, a = n.length - 1; a >= 0; a--) if (n[a] === t || n[a].listener === t) {
|
|
696
|
+
o = n[a].listener, i = a;
|
|
697
|
+
break;
|
|
698
|
+
}
|
|
699
|
+
if (i < 0) return this;
|
|
700
|
+
i === 0 ? n.shift() : _(n, i), n.length === 1 && (r[e] = n[0]), r.removeListener !== void 0 && this.emit("removeListener", e, o || t);
|
|
701
|
+
}
|
|
702
|
+
return this;
|
|
703
|
+
}, s.prototype.off = s.prototype.removeListener, s.prototype.removeAllListeners = function(e) {
|
|
704
|
+
var t, n = this._events, r;
|
|
705
|
+
if (n === void 0) return this;
|
|
706
|
+
if (n.removeListener === void 0) return arguments.length === 0 ? (this._events = Object.create(null), this._eventsCount = 0) : n[e] !== void 0 && (--this._eventsCount === 0 ? this._events = Object.create(null) : delete n[e]), this;
|
|
707
|
+
if (arguments.length === 0) {
|
|
708
|
+
var i = Object.keys(n), a;
|
|
709
|
+
for (r = 0; r < i.length; ++r) a = i[r], a !== "removeListener" && this.removeAllListeners(a);
|
|
710
|
+
return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this;
|
|
711
|
+
}
|
|
712
|
+
if (t = n[e], typeof t == "function") this.removeListener(e, t);
|
|
713
|
+
else if (t !== void 0) for (r = t.length - 1; r >= 0; r--) this.removeListener(e, t[r]);
|
|
714
|
+
return this;
|
|
715
|
+
};
|
|
716
|
+
function m(e, t, n) {
|
|
717
|
+
var r = e._events;
|
|
718
|
+
if (r === void 0) return [];
|
|
719
|
+
var i = r[t];
|
|
720
|
+
return i === void 0 ? [] : typeof i == "function" ? n ? [i.listener || i] : [i] : n ? v(i) : g(i, i.length);
|
|
721
|
+
}
|
|
722
|
+
s.prototype.listeners = function(e) {
|
|
723
|
+
return m(this, e, !0);
|
|
724
|
+
}, s.prototype.rawListeners = function(e) {
|
|
725
|
+
return m(this, e, !1);
|
|
726
|
+
}, s.listenerCount = function(e, t) {
|
|
727
|
+
return typeof e.listenerCount == "function" ? e.listenerCount(t) : h.call(e, t);
|
|
728
|
+
}, s.prototype.listenerCount = h;
|
|
729
|
+
function h(e) {
|
|
730
|
+
var t = this._events;
|
|
731
|
+
if (t !== void 0) {
|
|
732
|
+
var n = t[e];
|
|
733
|
+
if (typeof n == "function") return 1;
|
|
734
|
+
if (n !== void 0) return n.length;
|
|
735
|
+
}
|
|
736
|
+
return 0;
|
|
737
|
+
}
|
|
738
|
+
s.prototype.eventNames = function() {
|
|
739
|
+
return this._eventsCount > 0 ? i(this._events) : [];
|
|
740
|
+
};
|
|
741
|
+
function g(e, t) {
|
|
742
|
+
for (var n = Array(t), r = 0; r < t; ++r) n[r] = e[r];
|
|
743
|
+
return n;
|
|
744
|
+
}
|
|
745
|
+
function _(e, t) {
|
|
746
|
+
for (; t + 1 < e.length; t++) e[t] = e[t + 1];
|
|
747
|
+
e.pop();
|
|
748
|
+
}
|
|
749
|
+
function v(e) {
|
|
750
|
+
for (var t = Array(e.length), n = 0; n < t.length; ++n) t[n] = e[n].listener || e[n];
|
|
751
|
+
return t;
|
|
752
|
+
}
|
|
753
|
+
function y(e, t) {
|
|
754
|
+
return new Promise(function(n, r) {
|
|
755
|
+
function i(n) {
|
|
756
|
+
e.removeListener(t, a), r(n);
|
|
757
|
+
}
|
|
758
|
+
function a() {
|
|
759
|
+
typeof e.removeListener == "function" && e.removeListener("error", i), n([].slice.call(arguments));
|
|
760
|
+
}
|
|
761
|
+
x(e, t, a, { once: !0 }), t !== "error" && b(e, i, { once: !0 });
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
function b(e, t, n) {
|
|
765
|
+
typeof e.on == "function" && x(e, "error", t, n);
|
|
766
|
+
}
|
|
767
|
+
function x(e, t, n, r) {
|
|
768
|
+
if (typeof e.on == "function") r.once ? e.once(t, n) : e.on(t, n);
|
|
769
|
+
else if (typeof e.addEventListener == "function") e.addEventListener(t, function i(a) {
|
|
770
|
+
r.once && e.removeEventListener(t, i), n(a);
|
|
771
|
+
});
|
|
772
|
+
else throw TypeError("The \"emitter\" argument must be of type EventEmitter. Received type " + typeof e);
|
|
773
|
+
}
|
|
774
|
+
})), A = /* @__PURE__ */ t(((e, t) => {
|
|
777
775
|
var n = ["out", "err"];
|
|
778
776
|
t.exports = class {
|
|
779
777
|
constructor(e, t) {
|
|
@@ -781,8 +779,8 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
781
779
|
this.type = e, this.string = t;
|
|
782
780
|
}
|
|
783
781
|
};
|
|
784
|
-
})),
|
|
785
|
-
var n =
|
|
782
|
+
})), j = /* @__PURE__ */ t(((e, t) => {
|
|
783
|
+
var n = A();
|
|
786
784
|
t.exports = class {
|
|
787
785
|
constructor(e = [], t = 0) {
|
|
788
786
|
if (typeof t != "number") throw Error("Command Result ExitCode must be a number");
|
|
@@ -806,9 +804,9 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
806
804
|
return this.std = [], e;
|
|
807
805
|
}
|
|
808
806
|
};
|
|
809
|
-
})),
|
|
810
|
-
var n =
|
|
811
|
-
t.exports = class extends
|
|
807
|
+
})), M = /* @__PURE__ */ t(((e, t) => {
|
|
808
|
+
var n = k(), r = j(), i = n.EventEmitter || n.default || n;
|
|
809
|
+
t.exports = class extends i {
|
|
812
810
|
constructor(e) {
|
|
813
811
|
super(), this.arguments = e, this.result = new r();
|
|
814
812
|
}
|
|
@@ -835,17 +833,17 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
835
833
|
console.log("flush now"), this.emit("flush", this.result.flush());
|
|
836
834
|
}
|
|
837
835
|
};
|
|
838
|
-
})),
|
|
839
|
-
var n =
|
|
836
|
+
})), N = /* @__PURE__ */ t(((e, t) => {
|
|
837
|
+
var n = M();
|
|
840
838
|
t.exports = class extends n {
|
|
841
839
|
constructor(e, t) {
|
|
842
840
|
super(e), this.context = t;
|
|
843
841
|
}
|
|
844
842
|
};
|
|
845
|
-
})),
|
|
846
|
-
|
|
847
|
-
var
|
|
848
|
-
t.exports = class extends
|
|
843
|
+
})), P = /* @__PURE__ */ t(((e, t) => {
|
|
844
|
+
r();
|
|
845
|
+
var i = N();
|
|
846
|
+
t.exports = class extends i {
|
|
849
847
|
constructor(e, t, n, r = !1) {
|
|
850
848
|
super(t, n), this.script = e, this.source = r;
|
|
851
849
|
}
|
|
@@ -854,14 +852,14 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
854
852
|
filesystem: this.context.fs.getRaw(),
|
|
855
853
|
permissions: this.context.fs.getRawPermissions()
|
|
856
854
|
};
|
|
857
|
-
this.sandbox = new
|
|
855
|
+
this.sandbox = new n.shell({
|
|
858
856
|
cwd: this.context.fs.cwd,
|
|
859
857
|
...e
|
|
860
858
|
}), this.sandbox.context.source(this.context), this.sandbox.on("stdOut", (e) => this.stdOut = e), this.sandbox.on("stdErr", (e) => this.stdErr = e);
|
|
861
859
|
let t = this.script.split(/\r?\n/);
|
|
862
860
|
if (!t[0].startsWith("#!")) return Promise.reject("no interpreter set");
|
|
863
|
-
let
|
|
864
|
-
return this._executeNodes(
|
|
861
|
+
let r = this._parseLines(t.slice(1));
|
|
862
|
+
return this._executeNodes(r).then(() => {
|
|
865
863
|
this.exitCode = this.sandbox.lastCode, this.source && this.context.source(this.sandbox.context);
|
|
866
864
|
});
|
|
867
865
|
}
|
|
@@ -989,7 +987,7 @@ var g, _, v, y, b, x, S, C, w, T, E = e((() => {
|
|
|
989
987
|
}));
|
|
990
988
|
//#endregion
|
|
991
989
|
//#region node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js
|
|
992
|
-
function
|
|
990
|
+
function F(e) {
|
|
993
991
|
var t = e.length;
|
|
994
992
|
if (t % 4 > 0) throw Error("Invalid string. Length must be a multiple of 4");
|
|
995
993
|
var n = e.indexOf("=");
|
|
@@ -997,32 +995,32 @@ function I(e) {
|
|
|
997
995
|
var r = n === t ? 0 : 4 - n % 4;
|
|
998
996
|
return [n, r];
|
|
999
997
|
}
|
|
1000
|
-
function
|
|
1001
|
-
var t =
|
|
998
|
+
function I(e) {
|
|
999
|
+
var t = F(e), n = t[0], r = t[1];
|
|
1002
1000
|
return (n + r) * 3 / 4 - r;
|
|
1003
1001
|
}
|
|
1004
|
-
function
|
|
1002
|
+
function L(e, t, n) {
|
|
1005
1003
|
return (t + n) * 3 / 4 - n;
|
|
1006
1004
|
}
|
|
1007
|
-
function
|
|
1008
|
-
var t, n =
|
|
1009
|
-
for (c = 0; c < s; c += 4) t =
|
|
1010
|
-
return i === 2 && (t =
|
|
1005
|
+
function ee(e) {
|
|
1006
|
+
var t, n = F(e), r = n[0], i = n[1], a = new te(L(e, r, i)), o = 0, s = i > 0 ? r - 4 : r, c;
|
|
1007
|
+
for (c = 0; c < s; c += 4) t = W[e.charCodeAt(c)] << 18 | W[e.charCodeAt(c + 1)] << 12 | W[e.charCodeAt(c + 2)] << 6 | W[e.charCodeAt(c + 3)], a[o++] = t >> 16 & 255, a[o++] = t >> 8 & 255, a[o++] = t & 255;
|
|
1008
|
+
return i === 2 && (t = W[e.charCodeAt(c)] << 2 | W[e.charCodeAt(c + 1)] >> 4, a[o++] = t & 255), i === 1 && (t = W[e.charCodeAt(c)] << 10 | W[e.charCodeAt(c + 1)] << 4 | W[e.charCodeAt(c + 2)] >> 2, a[o++] = t >> 8 & 255, a[o++] = t & 255), a;
|
|
1011
1009
|
}
|
|
1012
1010
|
function R(e) {
|
|
1013
|
-
return
|
|
1011
|
+
return U[e >> 18 & 63] + U[e >> 12 & 63] + U[e >> 6 & 63] + U[e & 63];
|
|
1014
1012
|
}
|
|
1015
1013
|
function z(e, t, n) {
|
|
1016
1014
|
for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(R(r));
|
|
1017
1015
|
return i.join("");
|
|
1018
1016
|
}
|
|
1019
|
-
function
|
|
1017
|
+
function B(e) {
|
|
1020
1018
|
for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(z(e, o, o + a > s ? s : o + a));
|
|
1021
|
-
return r === 1 ? (t = e[n - 1], i.push(
|
|
1019
|
+
return r === 1 ? (t = e[n - 1], i.push(U[t >> 2] + U[t << 4 & 63] + "==")) : r === 2 && (t = (e[n - 2] << 8) + e[n - 1], i.push(U[t >> 10] + U[t >> 4 & 63] + U[t << 2 & 63] + "=")), i.join("");
|
|
1022
1020
|
}
|
|
1023
|
-
var
|
|
1024
|
-
for (
|
|
1025
|
-
|
|
1021
|
+
var V, H, U, W, te, ne, G, re, ie, ae, oe = e((() => {
|
|
1022
|
+
for (V = {}, H = {}, H.byteLength = I, H.toByteArray = ee, H.fromByteArray = B, U = [], W = [], te = typeof Uint8Array < "u" ? Uint8Array : Array, ne = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", G = 0, re = ne.length; G < re; ++G) U[G] = ne[G], W[ne.charCodeAt(G)] = G;
|
|
1023
|
+
W[45] = 62, W[95] = 63, ie = {}, ie.read = function(e, t, n, r, i) {
|
|
1026
1024
|
var a, o, s = i * 8 - r - 1, c = (1 << s) - 1, l = c >> 1, u = -7, d = n ? i - 1 : 0, f = n ? -1 : 1, p = e[t + d];
|
|
1027
1025
|
for (d += f, a = p & (1 << -u) - 1, p >>= -u, u += s; u > 0; a = a * 256 + e[t + d], d += f, u -= 8);
|
|
1028
1026
|
for (o = a & (1 << -u) - 1, a >>= -u, u += r; u > 0; o = o * 256 + e[t + d], d += f, u -= 8);
|
|
@@ -1030,13 +1028,13 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1030
1028
|
else if (a === c) return o ? NaN : (p ? -1 : 1) * Infinity;
|
|
1031
1029
|
else o += 2 ** r, a -= l;
|
|
1032
1030
|
return (p ? -1 : 1) * o * 2 ** (a - r);
|
|
1033
|
-
},
|
|
1031
|
+
}, ie.write = function(e, t, n, r, i, a) {
|
|
1034
1032
|
var o, s, c, l = a * 8 - i - 1, u = (1 << l) - 1, d = u >> 1, f = i === 23 ? 2 ** -24 - 2 ** -77 : 0, p = r ? 0 : a - 1, m = r ? 1 : -1, h = +(t < 0 || t === 0 && 1 / t < 0);
|
|
1035
1033
|
for (t = Math.abs(t), isNaN(t) || t === Infinity ? (s = +!!isNaN(t), o = u) : (o = Math.floor(Math.log(t) / Math.LN2), t * (c = 2 ** -o) < 1 && (o--, c *= 2), o + d >= 1 ? t += f / c : t += f * 2 ** (1 - d), t * c >= 2 && (o++, c /= 2), o + d >= u ? (s = 0, o = u) : o + d >= 1 ? (s = (t * c - 1) * 2 ** i, o += d) : (s = t * 2 ** (d - 1) * 2 ** i, o = 0)); i >= 8; e[n + p] = s & 255, p += m, s /= 256, i -= 8);
|
|
1036
1034
|
for (o = o << i | s, l += i; l > 0; e[n + p] = o & 255, p += m, o /= 256, l -= 8);
|
|
1037
1035
|
e[n + p - m] |= h * 128;
|
|
1038
1036
|
}, (function(e) {
|
|
1039
|
-
let t =
|
|
1037
|
+
let t = H, n = ie, r = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
1040
1038
|
e.Buffer = u, e.SlowBuffer = x, e.INSPECT_MAX_BYTES = 50;
|
|
1041
1039
|
let i = 2147483647;
|
|
1042
1040
|
e.kMaxLength = i;
|
|
@@ -1228,7 +1226,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1228
1226
|
case "ucs2":
|
|
1229
1227
|
case "ucs-2":
|
|
1230
1228
|
case "utf16le":
|
|
1231
|
-
case "utf-16le": return
|
|
1229
|
+
case "utf-16le": return R(this, t, n);
|
|
1232
1230
|
default:
|
|
1233
1231
|
if (r) throw TypeError("Unknown encoding: " + e);
|
|
1234
1232
|
e = (e + "").toLowerCase(), r = !0;
|
|
@@ -1431,7 +1429,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1431
1429
|
for (let r = t; r < n; ++r) i += ge[e[r]];
|
|
1432
1430
|
return i;
|
|
1433
1431
|
}
|
|
1434
|
-
function
|
|
1432
|
+
function R(e, t, n) {
|
|
1435
1433
|
let r = e.slice(t, n), i = "";
|
|
1436
1434
|
for (let e = 0; e < r.length - 1; e += 2) i += String.fromCharCode(r[e] + r[e + 1] * 256);
|
|
1437
1435
|
return i;
|
|
@@ -1442,30 +1440,30 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1442
1440
|
let r = this.subarray(e, t);
|
|
1443
1441
|
return Object.setPrototypeOf(r, u.prototype), r;
|
|
1444
1442
|
};
|
|
1445
|
-
function
|
|
1443
|
+
function z(e, t, n) {
|
|
1446
1444
|
if (e % 1 != 0 || e < 0) throw RangeError("offset is not uint");
|
|
1447
1445
|
if (e + t > n) throw RangeError("Trying to access beyond buffer length");
|
|
1448
1446
|
}
|
|
1449
1447
|
u.prototype.readUintLE = u.prototype.readUIntLE = function(e, t, n) {
|
|
1450
|
-
e >>>= 0, t >>>= 0, n ||
|
|
1448
|
+
e >>>= 0, t >>>= 0, n || z(e, t, this.length);
|
|
1451
1449
|
let r = this[e], i = 1, a = 0;
|
|
1452
1450
|
for (; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
1453
1451
|
return r;
|
|
1454
1452
|
}, u.prototype.readUintBE = u.prototype.readUIntBE = function(e, t, n) {
|
|
1455
|
-
e >>>= 0, t >>>= 0, n ||
|
|
1453
|
+
e >>>= 0, t >>>= 0, n || z(e, t, this.length);
|
|
1456
1454
|
let r = this[e + --t], i = 1;
|
|
1457
1455
|
for (; t > 0 && (i *= 256);) r += this[e + --t] * i;
|
|
1458
1456
|
return r;
|
|
1459
1457
|
}, u.prototype.readUint8 = u.prototype.readUInt8 = function(e, t) {
|
|
1460
|
-
return e >>>= 0, t ||
|
|
1458
|
+
return e >>>= 0, t || z(e, 1, this.length), this[e];
|
|
1461
1459
|
}, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(e, t) {
|
|
1462
|
-
return e >>>= 0, t ||
|
|
1460
|
+
return e >>>= 0, t || z(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
1463
1461
|
}, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(e, t) {
|
|
1464
|
-
return e >>>= 0, t ||
|
|
1462
|
+
return e >>>= 0, t || z(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
1465
1463
|
}, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(e, t) {
|
|
1466
|
-
return e >>>= 0, t ||
|
|
1464
|
+
return e >>>= 0, t || z(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
1467
1465
|
}, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(e, t) {
|
|
1468
|
-
return e >>>= 0, t ||
|
|
1466
|
+
return e >>>= 0, t || z(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
1469
1467
|
}, u.prototype.readBigUInt64LE = Y(function(e) {
|
|
1470
1468
|
e >>>= 0, K(e, "offset");
|
|
1471
1469
|
let t = this[e], n = this[e + 7];
|
|
@@ -1479,29 +1477,29 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1479
1477
|
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;
|
|
1480
1478
|
return (BigInt(r) << BigInt(32)) + BigInt(i);
|
|
1481
1479
|
}), u.prototype.readIntLE = function(e, t, n) {
|
|
1482
|
-
e >>>= 0, t >>>= 0, n ||
|
|
1480
|
+
e >>>= 0, t >>>= 0, n || z(e, t, this.length);
|
|
1483
1481
|
let r = this[e], i = 1, a = 0;
|
|
1484
1482
|
for (; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
1485
1483
|
return i *= 128, r >= i && (r -= 2 ** (8 * t)), r;
|
|
1486
1484
|
}, u.prototype.readIntBE = function(e, t, n) {
|
|
1487
|
-
e >>>= 0, t >>>= 0, n ||
|
|
1485
|
+
e >>>= 0, t >>>= 0, n || z(e, t, this.length);
|
|
1488
1486
|
let r = t, i = 1, a = this[e + --r];
|
|
1489
1487
|
for (; r > 0 && (i *= 256);) a += this[e + --r] * i;
|
|
1490
1488
|
return i *= 128, a >= i && (a -= 2 ** (8 * t)), a;
|
|
1491
1489
|
}, u.prototype.readInt8 = function(e, t) {
|
|
1492
|
-
return e >>>= 0, t ||
|
|
1490
|
+
return e >>>= 0, t || z(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
1493
1491
|
}, u.prototype.readInt16LE = function(e, t) {
|
|
1494
|
-
e >>>= 0, t ||
|
|
1492
|
+
e >>>= 0, t || z(e, 2, this.length);
|
|
1495
1493
|
let n = this[e] | this[e + 1] << 8;
|
|
1496
1494
|
return n & 32768 ? n | 4294901760 : n;
|
|
1497
1495
|
}, u.prototype.readInt16BE = function(e, t) {
|
|
1498
|
-
e >>>= 0, t ||
|
|
1496
|
+
e >>>= 0, t || z(e, 2, this.length);
|
|
1499
1497
|
let n = this[e + 1] | this[e] << 8;
|
|
1500
1498
|
return n & 32768 ? n | 4294901760 : n;
|
|
1501
1499
|
}, u.prototype.readInt32LE = function(e, t) {
|
|
1502
|
-
return e >>>= 0, t ||
|
|
1500
|
+
return e >>>= 0, t || z(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
1503
1501
|
}, u.prototype.readInt32BE = function(e, t) {
|
|
1504
|
-
return e >>>= 0, t ||
|
|
1502
|
+
return e >>>= 0, t || z(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
1505
1503
|
}, u.prototype.readBigInt64LE = Y(function(e) {
|
|
1506
1504
|
e >>>= 0, K(e, "offset");
|
|
1507
1505
|
let t = this[e], n = this[e + 7];
|
|
@@ -1515,15 +1513,15 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1515
1513
|
let r = (t << 24) + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
|
|
1516
1514
|
return (BigInt(r) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n);
|
|
1517
1515
|
}), u.prototype.readFloatLE = function(e, t) {
|
|
1518
|
-
return e >>>= 0, t ||
|
|
1516
|
+
return e >>>= 0, t || z(e, 4, this.length), n.read(this, e, !0, 23, 4);
|
|
1519
1517
|
}, u.prototype.readFloatBE = function(e, t) {
|
|
1520
|
-
return e >>>= 0, t ||
|
|
1518
|
+
return e >>>= 0, t || z(e, 4, this.length), n.read(this, e, !1, 23, 4);
|
|
1521
1519
|
}, u.prototype.readDoubleLE = function(e, t) {
|
|
1522
|
-
return e >>>= 0, t ||
|
|
1520
|
+
return e >>>= 0, t || z(e, 8, this.length), n.read(this, e, !0, 52, 8);
|
|
1523
1521
|
}, u.prototype.readDoubleBE = function(e, t) {
|
|
1524
|
-
return e >>>= 0, t ||
|
|
1522
|
+
return e >>>= 0, t || z(e, 8, this.length), n.read(this, e, !1, 52, 8);
|
|
1525
1523
|
};
|
|
1526
|
-
function
|
|
1524
|
+
function B(e, t, n, r, i, a) {
|
|
1527
1525
|
if (!u.isBuffer(e)) throw TypeError("\"buffer\" argument must be a Buffer instance");
|
|
1528
1526
|
if (t > i || t < a) throw RangeError("\"value\" argument is out of bounds");
|
|
1529
1527
|
if (n + r > e.length) throw RangeError("Index out of range");
|
|
@@ -1531,7 +1529,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1531
1529
|
u.prototype.writeUintLE = u.prototype.writeUIntLE = function(e, t, n, r) {
|
|
1532
1530
|
if (e = +e, t >>>= 0, n >>>= 0, !r) {
|
|
1533
1531
|
let r = 2 ** (8 * n) - 1;
|
|
1534
|
-
|
|
1532
|
+
B(this, e, t, n, r, 0);
|
|
1535
1533
|
}
|
|
1536
1534
|
let i = 1, a = 0;
|
|
1537
1535
|
for (this[t] = e & 255; ++a < n && (i *= 256);) this[t + a] = e / i & 255;
|
|
@@ -1539,30 +1537,30 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1539
1537
|
}, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(e, t, n, r) {
|
|
1540
1538
|
if (e = +e, t >>>= 0, n >>>= 0, !r) {
|
|
1541
1539
|
let r = 2 ** (8 * n) - 1;
|
|
1542
|
-
|
|
1540
|
+
B(this, e, t, n, r, 0);
|
|
1543
1541
|
}
|
|
1544
1542
|
let i = n - 1, a = 1;
|
|
1545
1543
|
for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) this[t + i] = e / a & 255;
|
|
1546
1544
|
return t + n;
|
|
1547
1545
|
}, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(e, t, n) {
|
|
1548
|
-
return e = +e, t >>>= 0, n ||
|
|
1546
|
+
return e = +e, t >>>= 0, n || B(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
|
|
1549
1547
|
}, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(e, t, n) {
|
|
1550
|
-
return e = +e, t >>>= 0, n ||
|
|
1548
|
+
return e = +e, t >>>= 0, n || B(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
1551
1549
|
}, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(e, t, n) {
|
|
1552
|
-
return e = +e, t >>>= 0, n ||
|
|
1550
|
+
return e = +e, t >>>= 0, n || B(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
1553
1551
|
}, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(e, t, n) {
|
|
1554
|
-
return e = +e, t >>>= 0, n ||
|
|
1552
|
+
return e = +e, t >>>= 0, n || B(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
|
|
1555
1553
|
}, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(e, t, n) {
|
|
1556
|
-
return e = +e, t >>>= 0, n ||
|
|
1554
|
+
return e = +e, t >>>= 0, n || B(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;
|
|
1557
1555
|
};
|
|
1558
|
-
function
|
|
1556
|
+
function V(e, t, n, r, i) {
|
|
1559
1557
|
se(t, r, i, e, n, 7);
|
|
1560
1558
|
let a = Number(t & BigInt(4294967295));
|
|
1561
1559
|
e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a;
|
|
1562
1560
|
let o = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
1563
1561
|
return e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, n;
|
|
1564
1562
|
}
|
|
1565
|
-
function
|
|
1563
|
+
function U(e, t, n, r, i) {
|
|
1566
1564
|
se(t, r, i, e, n, 7);
|
|
1567
1565
|
let a = Number(t & BigInt(4294967295));
|
|
1568
1566
|
e[n + 7] = a, a >>= 8, e[n + 6] = a, a >>= 8, e[n + 5] = a, a >>= 8, e[n + 4] = a;
|
|
@@ -1570,13 +1568,13 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1570
1568
|
return e[n + 3] = o, o >>= 8, e[n + 2] = o, o >>= 8, e[n + 1] = o, o >>= 8, e[n] = o, n + 8;
|
|
1571
1569
|
}
|
|
1572
1570
|
u.prototype.writeBigUInt64LE = Y(function(e, t = 0) {
|
|
1573
|
-
return
|
|
1571
|
+
return V(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1574
1572
|
}), u.prototype.writeBigUInt64BE = Y(function(e, t = 0) {
|
|
1575
|
-
return
|
|
1573
|
+
return U(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1576
1574
|
}), u.prototype.writeIntLE = function(e, t, n, r) {
|
|
1577
1575
|
if (e = +e, t >>>= 0, !r) {
|
|
1578
1576
|
let r = 2 ** (8 * n - 1);
|
|
1579
|
-
|
|
1577
|
+
B(this, e, t, n, r - 1, -r);
|
|
1580
1578
|
}
|
|
1581
1579
|
let i = 0, a = 1, o = 0;
|
|
1582
1580
|
for (this[t] = e & 255; ++i < n && (a *= 256);) e < 0 && o === 0 && this[t + i - 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
|
|
@@ -1584,44 +1582,44 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1584
1582
|
}, u.prototype.writeIntBE = function(e, t, n, r) {
|
|
1585
1583
|
if (e = +e, t >>>= 0, !r) {
|
|
1586
1584
|
let r = 2 ** (8 * n - 1);
|
|
1587
|
-
|
|
1585
|
+
B(this, e, t, n, r - 1, -r);
|
|
1588
1586
|
}
|
|
1589
1587
|
let i = n - 1, a = 1, o = 0;
|
|
1590
1588
|
for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) e < 0 && o === 0 && this[t + i + 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
|
|
1591
1589
|
return t + n;
|
|
1592
1590
|
}, u.prototype.writeInt8 = function(e, t, n) {
|
|
1593
|
-
return e = +e, t >>>= 0, n ||
|
|
1591
|
+
return e = +e, t >>>= 0, n || B(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
|
|
1594
1592
|
}, u.prototype.writeInt16LE = function(e, t, n) {
|
|
1595
|
-
return e = +e, t >>>= 0, n ||
|
|
1593
|
+
return e = +e, t >>>= 0, n || B(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
1596
1594
|
}, u.prototype.writeInt16BE = function(e, t, n) {
|
|
1597
|
-
return e = +e, t >>>= 0, n ||
|
|
1595
|
+
return e = +e, t >>>= 0, n || B(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
1598
1596
|
}, u.prototype.writeInt32LE = function(e, t, n) {
|
|
1599
|
-
return e = +e, t >>>= 0, n ||
|
|
1597
|
+
return e = +e, t >>>= 0, n || B(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
|
|
1600
1598
|
}, u.prototype.writeInt32BE = function(e, t, n) {
|
|
1601
|
-
return e = +e, t >>>= 0, n ||
|
|
1599
|
+
return e = +e, t >>>= 0, n || B(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
1602
1600
|
}, u.prototype.writeBigInt64LE = Y(function(e, t = 0) {
|
|
1603
|
-
return
|
|
1601
|
+
return V(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1604
1602
|
}), u.prototype.writeBigInt64BE = Y(function(e, t = 0) {
|
|
1605
|
-
return
|
|
1603
|
+
return U(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1606
1604
|
});
|
|
1607
|
-
function
|
|
1605
|
+
function W(e, t, n, r, i, a) {
|
|
1608
1606
|
if (n + r > e.length || n < 0) throw RangeError("Index out of range");
|
|
1609
1607
|
}
|
|
1610
|
-
function
|
|
1611
|
-
return t = +t, r >>>= 0, a ||
|
|
1608
|
+
function te(e, t, r, i, a) {
|
|
1609
|
+
return t = +t, r >>>= 0, a || W(e, t, r, 4), n.write(e, t, r, i, 23, 4), r + 4;
|
|
1612
1610
|
}
|
|
1613
1611
|
u.prototype.writeFloatLE = function(e, t, n) {
|
|
1614
|
-
return
|
|
1612
|
+
return te(this, e, t, !0, n);
|
|
1615
1613
|
}, u.prototype.writeFloatBE = function(e, t, n) {
|
|
1616
|
-
return
|
|
1614
|
+
return te(this, e, t, !1, n);
|
|
1617
1615
|
};
|
|
1618
|
-
function
|
|
1619
|
-
return t = +t, r >>>= 0, a ||
|
|
1616
|
+
function ne(e, t, r, i, a) {
|
|
1617
|
+
return t = +t, r >>>= 0, a || W(e, t, r, 8), n.write(e, t, r, i, 52, 8), r + 8;
|
|
1620
1618
|
}
|
|
1621
1619
|
u.prototype.writeDoubleLE = function(e, t, n) {
|
|
1622
|
-
return
|
|
1620
|
+
return ne(this, e, t, !0, n);
|
|
1623
1621
|
}, u.prototype.writeDoubleBE = function(e, t, n) {
|
|
1624
|
-
return
|
|
1622
|
+
return ne(this, e, t, !1, n);
|
|
1625
1623
|
}, u.prototype.copy = function(e, t, n, r) {
|
|
1626
1624
|
if (!u.isBuffer(e)) throw TypeError("argument should be a Buffer");
|
|
1627
1625
|
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;
|
|
@@ -1652,9 +1650,9 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1652
1650
|
}
|
|
1653
1651
|
return this;
|
|
1654
1652
|
};
|
|
1655
|
-
let
|
|
1656
|
-
function
|
|
1657
|
-
|
|
1653
|
+
let G = {};
|
|
1654
|
+
function re(e, t, n) {
|
|
1655
|
+
G[e] = class extends n {
|
|
1658
1656
|
constructor() {
|
|
1659
1657
|
super(), Object.defineProperty(this, "message", {
|
|
1660
1658
|
value: t.apply(this, arguments),
|
|
@@ -1678,15 +1676,15 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1678
1676
|
}
|
|
1679
1677
|
};
|
|
1680
1678
|
}
|
|
1681
|
-
|
|
1679
|
+
re("ERR_BUFFER_OUT_OF_BOUNDS", function(e) {
|
|
1682
1680
|
return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
1683
|
-
}, RangeError),
|
|
1681
|
+
}, RangeError), re("ERR_INVALID_ARG_TYPE", function(e, t) {
|
|
1684
1682
|
return `The "${e}" argument must be of type number. Received type ${typeof t}`;
|
|
1685
|
-
}, TypeError),
|
|
1683
|
+
}, TypeError), re("ERR_OUT_OF_RANGE", function(e, t, n) {
|
|
1686
1684
|
let r = `The value of "${e}" is out of range.`, i = n;
|
|
1687
|
-
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i =
|
|
1685
|
+
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i = ae(String(n)) : typeof n == "bigint" && (i = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (i = ae(i)), i += "n"), r += ` It must be ${t}. Received ${i}`, r;
|
|
1688
1686
|
}, RangeError);
|
|
1689
|
-
function
|
|
1687
|
+
function ae(e) {
|
|
1690
1688
|
let t = "", n = e.length, r = +(e[0] === "-");
|
|
1691
1689
|
for (; n >= r + 4; n -= 3) t = `_${e.slice(n - 3, n)}${t}`;
|
|
1692
1690
|
return `${e.slice(0, n)}${t}`;
|
|
@@ -1697,15 +1695,15 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1697
1695
|
function se(e, t, n, r, i, a) {
|
|
1698
1696
|
if (e > n || e < t) {
|
|
1699
1697
|
let r = typeof t == "bigint" ? "n" : "", i;
|
|
1700
|
-
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
|
|
1698
|
+
throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new G.ERR_OUT_OF_RANGE("value", i, e);
|
|
1701
1699
|
}
|
|
1702
1700
|
oe(r, i, a);
|
|
1703
1701
|
}
|
|
1704
1702
|
function K(e, t) {
|
|
1705
|
-
if (typeof e != "number") throw new
|
|
1703
|
+
if (typeof e != "number") throw new G.ERR_INVALID_ARG_TYPE(t, "number", e);
|
|
1706
1704
|
}
|
|
1707
1705
|
function q(e, t, n) {
|
|
1708
|
-
throw Math.floor(e) === e ? t < 0 ? new
|
|
1706
|
+
throw Math.floor(e) === e ? t < 0 ? new G.ERR_BUFFER_OUT_OF_BOUNDS() : new G.ERR_OUT_OF_RANGE(n || "offset", `>= ${+!!n} and <= ${t}`, e) : (K(e, n), new G.ERR_OUT_OF_RANGE(n || "offset", "an integer", e));
|
|
1709
1707
|
}
|
|
1710
1708
|
let ce = /[^+/0-9A-Za-z-_]/g;
|
|
1711
1709
|
function le(e) {
|
|
@@ -1789,11 +1787,11 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1789
1787
|
function _e() {
|
|
1790
1788
|
throw Error("BigInt not supported");
|
|
1791
1789
|
}
|
|
1792
|
-
})(
|
|
1793
|
-
})),
|
|
1794
|
-
|
|
1795
|
-
var
|
|
1796
|
-
t.exports = class extends
|
|
1790
|
+
})(V), ae = V.Buffer, V.Blob, V.BlobOptions, V.Buffer, V.File, V.FileOptions, V.INSPECT_MAX_BYTES, V.SlowBuffer, V.TranscodeEncoding, V.atob, V.btoa, V.constants, V.isAscii, V.isUtf8, V.kMaxLength, V.kStringMaxLength, V.resolveObjectURL, V.transcode;
|
|
1791
|
+
})), se = /* @__PURE__ */ t(((e, t) => {
|
|
1792
|
+
oe();
|
|
1793
|
+
var n = P();
|
|
1794
|
+
t.exports = class extends n {
|
|
1797
1795
|
get name() {
|
|
1798
1796
|
return "wasm";
|
|
1799
1797
|
}
|
|
@@ -1803,7 +1801,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1803
1801
|
run() {
|
|
1804
1802
|
let e = this.script, t = (() => {
|
|
1805
1803
|
try {
|
|
1806
|
-
return
|
|
1804
|
+
return T();
|
|
1807
1805
|
} catch {
|
|
1808
1806
|
return null;
|
|
1809
1807
|
}
|
|
@@ -1835,22 +1833,31 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1835
1833
|
}
|
|
1836
1834
|
_contentToBytes(e) {
|
|
1837
1835
|
if (e instanceof Uint8Array) return e;
|
|
1838
|
-
if (
|
|
1836
|
+
if (ae !== void 0 && ae.isBuffer(e)) return new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
1839
1837
|
if (e instanceof ArrayBuffer) return new Uint8Array(e);
|
|
1840
1838
|
let t = new Uint8Array(e.length);
|
|
1841
1839
|
for (let n = 0; n < e.length; n++) t[n] = e.charCodeAt(n) & 255;
|
|
1842
1840
|
return t;
|
|
1843
1841
|
}
|
|
1844
1842
|
async _runWat(e) {
|
|
1845
|
-
let t = new TextDecoder().decode(e), r;
|
|
1843
|
+
let t = new TextDecoder().decode(e), n, r;
|
|
1846
1844
|
try {
|
|
1847
|
-
|
|
1848
|
-
|
|
1845
|
+
r = await import(
|
|
1846
|
+
/* @vite-ignore */
|
|
1847
|
+
"wabt"
|
|
1848
|
+
);
|
|
1849
|
+
} catch {
|
|
1850
|
+
this.stdErr = `${this.script}: WAT execution requires the 'wabt' package\nInstall it with: npm install wabt`, this.exitCode = 1;
|
|
1851
|
+
return;
|
|
1852
|
+
}
|
|
1853
|
+
try {
|
|
1854
|
+
let e = r.default ?? r, { buffer: i } = (typeof e == "function" ? await e() : e).parseWat(this.script, t, { mutable_globals: !0 }).toBinary({});
|
|
1855
|
+
n = new Uint8Array(i);
|
|
1849
1856
|
} catch (e) {
|
|
1850
|
-
|
|
1857
|
+
this.stdErr = `${this.script}: WAT compilation error: ${e.message}`, this.exitCode = 1;
|
|
1851
1858
|
return;
|
|
1852
1859
|
}
|
|
1853
|
-
return this._runWasm(
|
|
1860
|
+
return this._runWasm(n);
|
|
1854
1861
|
}
|
|
1855
1862
|
async _runWasm(e) {
|
|
1856
1863
|
if (typeof WebAssembly > "u") {
|
|
@@ -1980,8 +1987,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
1980
1987
|
a();
|
|
1981
1988
|
}
|
|
1982
1989
|
};
|
|
1983
|
-
})),
|
|
1984
|
-
var n =
|
|
1990
|
+
})), K = /* @__PURE__ */ t(((e, t) => {
|
|
1991
|
+
var n = M(), r = class extends n {
|
|
1985
1992
|
get name() {
|
|
1986
1993
|
return "test";
|
|
1987
1994
|
}
|
|
@@ -2065,8 +2072,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2065
2072
|
Test: r,
|
|
2066
2073
|
TestBracket: i
|
|
2067
2074
|
};
|
|
2068
|
-
})),
|
|
2069
|
-
var n =
|
|
2075
|
+
})), q = /* @__PURE__ */ t(((e, t) => {
|
|
2076
|
+
var n = M();
|
|
2070
2077
|
t.exports = class extends n {
|
|
2071
2078
|
get requiresFilesystem() {
|
|
2072
2079
|
return !0;
|
|
@@ -2100,7 +2107,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2100
2107
|
return o.forEach((e) => this.stdOut = e), Promise.resolve();
|
|
2101
2108
|
}
|
|
2102
2109
|
};
|
|
2103
|
-
})),
|
|
2110
|
+
})), ce = /* @__PURE__ */ t(((e, t) => {
|
|
2104
2111
|
function n(e) {
|
|
2105
2112
|
return typeof e == "object" && !!e;
|
|
2106
2113
|
}
|
|
@@ -2111,7 +2118,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2111
2118
|
return Array.isArray(e) ? e : e === void 0 ? [] : r(e) || e instanceof Set ? Array.from(e) : [e];
|
|
2112
2119
|
}
|
|
2113
2120
|
t.exports = i;
|
|
2114
|
-
})),
|
|
2121
|
+
})), le = /* @__PURE__ */ t(((e, t) => {
|
|
2115
2122
|
function n(e, t, ...n) {
|
|
2116
2123
|
let r = [];
|
|
2117
2124
|
if (!Array.isArray(e)) throw Error("Input must be an array");
|
|
@@ -2131,7 +2138,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2131
2138
|
return e;
|
|
2132
2139
|
}
|
|
2133
2140
|
t.exports = n;
|
|
2134
|
-
})),
|
|
2141
|
+
})), ue = /* @__PURE__ */ t(((e) => {
|
|
2135
2142
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
2136
2143
|
function t(e) {
|
|
2137
2144
|
return !isNaN(parseFloat(e));
|
|
@@ -2210,23 +2217,23 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2210
2217
|
isFunction: h,
|
|
2211
2218
|
isAsyncFunction: g
|
|
2212
2219
|
}, 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;
|
|
2213
|
-
})),
|
|
2214
|
-
|
|
2215
|
-
var
|
|
2220
|
+
})), de = /* @__PURE__ */ t(((e, t) => {
|
|
2221
|
+
r();
|
|
2222
|
+
var i = Infinity, a = "[object Symbol]", o = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, s = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, c = "\\ud800-\\udfff", l = "\\u0300-\\u036f\\ufe20-\\ufe23", u = "\\u20d0-\\u20f0", d = "\\u2700-\\u27bf", f = "a-z\\xdf-\\xf6\\xf8-\\xff", p = "\\xac\\xb1\\xd7\\xf7", m = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", h = "\\u2000-\\u206f", g = " \\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", _ = "A-Z\\xc0-\\xd6\\xd8-\\xde", v = "\\ufe0e\\ufe0f", y = p + m + h + g, b = "['’]", x = "[" + c + "]", S = "[" + y + "]", C = "[" + l + u + "]", w = "\\d+", T = "[" + d + "]", E = "[" + f + "]", D = "[^" + c + y + w + d + f + _ + "]", O = "\\ud83c[\\udffb-\\udfff]", k = "(?:" + C + "|" + O + ")", A = "[^" + c + "]", j = "(?:\\ud83c[\\udde6-\\uddff]){2}", M = "[\\ud800-\\udbff][\\udc00-\\udfff]", N = "[" + _ + "]", P = "\\u200d", F = "(?:" + E + "|" + D + ")", I = "(?:" + N + "|" + D + ")", L = "(?:" + b + "(?:d|ll|m|re|s|t|ve))?", ee = "(?:" + b + "(?:D|LL|M|RE|S|T|VE))?", R = k + "?", z = "[" + v + "]?", B = "(?:" + P + "(?:" + [
|
|
2216
2223
|
A,
|
|
2217
2224
|
j,
|
|
2218
2225
|
M
|
|
2219
|
-
].join("|") + ")" +
|
|
2226
|
+
].join("|") + ")" + z + R + ")*", V = z + R + B, H = "(?:" + [
|
|
2220
2227
|
T,
|
|
2221
2228
|
j,
|
|
2222
2229
|
M
|
|
2223
|
-
].join("|") + ")" +
|
|
2230
|
+
].join("|") + ")" + V, U = "(?:" + [
|
|
2224
2231
|
A + C + "?",
|
|
2225
2232
|
C,
|
|
2226
2233
|
j,
|
|
2227
2234
|
M,
|
|
2228
2235
|
x
|
|
2229
|
-
].join("|") + ")",
|
|
2236
|
+
].join("|") + ")", W = RegExp(b, "g"), te = RegExp(C, "g"), ne = RegExp(O + "(?=" + O + ")|" + U + V, "g"), G = RegExp([
|
|
2230
2237
|
N + "?" + E + "+" + L + "(?=" + [
|
|
2231
2238
|
S,
|
|
2232
2239
|
N,
|
|
@@ -2240,8 +2247,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2240
2247
|
N + "?" + F + "+" + L,
|
|
2241
2248
|
N + "+" + ee,
|
|
2242
2249
|
w,
|
|
2243
|
-
|
|
2244
|
-
].join("|"), "g"),
|
|
2250
|
+
H
|
|
2251
|
+
].join("|"), "g"), re = RegExp("[" + P + c + l + u + v + "]"), ie = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, ae = {
|
|
2245
2252
|
À: "A",
|
|
2246
2253
|
Á: "A",
|
|
2247
2254
|
Â: "A",
|
|
@@ -2432,7 +2439,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2432
2439
|
œ: "oe",
|
|
2433
2440
|
ʼn: "'n",
|
|
2434
2441
|
ſ: "ss"
|
|
2435
|
-
}, oe = typeof
|
|
2442
|
+
}, oe = typeof n == "object" && n && n.Object === Object && n, se = typeof self == "object" && self && self.Object === Object && self, K = oe || se || Function("return this")();
|
|
2436
2443
|
function q(e, t, n, r) {
|
|
2437
2444
|
var i = -1, a = e ? e.length : 0;
|
|
2438
2445
|
for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
|
|
@@ -2451,7 +2458,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2451
2458
|
}
|
|
2452
2459
|
var de = ue(ae);
|
|
2453
2460
|
function fe(e) {
|
|
2454
|
-
return
|
|
2461
|
+
return re.test(e);
|
|
2455
2462
|
}
|
|
2456
2463
|
function pe(e) {
|
|
2457
2464
|
return ie.test(e);
|
|
@@ -2460,10 +2467,10 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2460
2467
|
return fe(e) ? J(e) : ce(e);
|
|
2461
2468
|
}
|
|
2462
2469
|
function J(e) {
|
|
2463
|
-
return e.match(
|
|
2470
|
+
return e.match(ne) || [];
|
|
2464
2471
|
}
|
|
2465
2472
|
function he(e) {
|
|
2466
|
-
return e.match(
|
|
2473
|
+
return e.match(G) || [];
|
|
2467
2474
|
}
|
|
2468
2475
|
var ge = Object.prototype.toString, Y = K.Symbol, _e = Y ? Y.prototype : void 0, ve = _e ? _e.toString : void 0;
|
|
2469
2476
|
function ye(e, t, n) {
|
|
@@ -2476,7 +2483,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2476
2483
|
if (typeof e == "string") return e;
|
|
2477
2484
|
if (Te(e)) return ve ? ve.call(e) : "";
|
|
2478
2485
|
var t = e + "";
|
|
2479
|
-
return t == "0" && 1 / e == -
|
|
2486
|
+
return t == "0" && 1 / e == -i ? "-0" : t;
|
|
2480
2487
|
}
|
|
2481
2488
|
function xe(e, t, n) {
|
|
2482
2489
|
var r = e.length;
|
|
@@ -2491,7 +2498,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2491
2498
|
}
|
|
2492
2499
|
function Ce(e) {
|
|
2493
2500
|
return function(t) {
|
|
2494
|
-
return q(je(ke(t).replace(
|
|
2501
|
+
return q(je(ke(t).replace(W, "")), e, "");
|
|
2495
2502
|
};
|
|
2496
2503
|
}
|
|
2497
2504
|
function we(e) {
|
|
@@ -2510,26 +2517,26 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2510
2517
|
return Ae(Ee(e).toLowerCase());
|
|
2511
2518
|
}
|
|
2512
2519
|
function ke(e) {
|
|
2513
|
-
return e = Ee(e), e && e.replace(s, de).replace(
|
|
2520
|
+
return e = Ee(e), e && e.replace(s, de).replace(te, "");
|
|
2514
2521
|
}
|
|
2515
2522
|
var Ae = Se("toUpperCase");
|
|
2516
2523
|
function je(e, t, n) {
|
|
2517
2524
|
return e = Ee(e), t = n ? void 0 : t, t === void 0 ? pe(e) ? he(e) : le(e) : e.match(t) || [];
|
|
2518
2525
|
}
|
|
2519
2526
|
t.exports = De;
|
|
2520
|
-
})),
|
|
2521
|
-
|
|
2522
|
-
var n =
|
|
2527
|
+
})), fe = /* @__PURE__ */ t(((e, t) => {
|
|
2528
|
+
w();
|
|
2529
|
+
var n = ce(), r = le(), i = ue(), a = de(), o = {
|
|
2523
2530
|
short: /^-([^\d-])$/,
|
|
2524
2531
|
long: /^--(\S+)/,
|
|
2525
2532
|
combinedShort: /^-[^\d-]{2,}$/,
|
|
2526
2533
|
optEquals: /^(--\S+?)=(.*)/
|
|
2527
2534
|
}, s = class extends Array {
|
|
2528
2535
|
load(e) {
|
|
2529
|
-
if (this.clear(), e && e !==
|
|
2536
|
+
if (this.clear(), e && e !== C.argv) e = n(e);
|
|
2530
2537
|
else {
|
|
2531
|
-
e =
|
|
2532
|
-
let t =
|
|
2538
|
+
e = C.argv.slice(0);
|
|
2539
|
+
let t = C.execArgv.some(m) ? 1 : 2;
|
|
2533
2540
|
e.splice(0, t);
|
|
2534
2541
|
}
|
|
2535
2542
|
e.forEach((e) => this.push(String(e)));
|
|
@@ -2717,16 +2724,16 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2717
2724
|
i.isDefined(this.definition.defaultValue) ? this.definition.isMultiple() ? x.set(this, n(this.definition.defaultValue).slice()) : x.set(this, this.definition.defaultValue) : this.definition.isMultiple() ? x.set(this, []) : x.set(this, null), this.state = "default";
|
|
2718
2725
|
}
|
|
2719
2726
|
static create(e) {
|
|
2720
|
-
return e = new h(e), e.isBoolean() ?
|
|
2727
|
+
return e = new h(e), e.isBoolean() ? T.create(e) : new this(e);
|
|
2721
2728
|
}
|
|
2722
|
-
},
|
|
2729
|
+
}, T = class extends S {
|
|
2723
2730
|
set(e) {
|
|
2724
2731
|
super.set(!0);
|
|
2725
2732
|
}
|
|
2726
2733
|
static create(e) {
|
|
2727
2734
|
return new this(e);
|
|
2728
2735
|
}
|
|
2729
|
-
},
|
|
2736
|
+
}, E = class extends Map {
|
|
2730
2737
|
constructor(e) {
|
|
2731
2738
|
super(), this.definitions = g.from(e), this.set("_unknown", S.create({
|
|
2732
2739
|
name: "_unknown",
|
|
@@ -2743,7 +2750,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2743
2750
|
}
|
|
2744
2751
|
return e.skipUnknown && delete t._unknown, t;
|
|
2745
2752
|
}
|
|
2746
|
-
}, D = class extends
|
|
2753
|
+
}, D = class extends E {
|
|
2747
2754
|
toObject(e) {
|
|
2748
2755
|
let t = super.toObject({ skipUnknown: e.skipUnknown }), r = super.toObject(e), o = r._unknown;
|
|
2749
2756
|
delete r._unknown;
|
|
@@ -2763,7 +2770,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2763
2770
|
argv: t.argv,
|
|
2764
2771
|
stopAtFirstUnknown: t.stopAtFirstUnknown,
|
|
2765
2772
|
caseInsensitive: t.caseInsensitive
|
|
2766
|
-
}), r = new (e.isGrouped() ? D :
|
|
2773
|
+
}), r = new (e.isGrouped() ? D : E)(e);
|
|
2767
2774
|
for (let e of n) {
|
|
2768
2775
|
let n = e.subArg || e.arg;
|
|
2769
2776
|
if (!t.partial) {
|
|
@@ -2784,8 +2791,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2784
2791
|
});
|
|
2785
2792
|
}
|
|
2786
2793
|
t.exports = O;
|
|
2787
|
-
})),
|
|
2788
|
-
var n =
|
|
2794
|
+
})), pe = /* @__PURE__ */ t(((e, t) => {
|
|
2795
|
+
var n = M(), r = fe();
|
|
2789
2796
|
t.exports = class extends n {
|
|
2790
2797
|
get requiresFilesystem() {
|
|
2791
2798
|
return !0;
|
|
@@ -2878,8 +2885,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2878
2885
|
], { argv: e });
|
|
2879
2886
|
}
|
|
2880
2887
|
};
|
|
2881
|
-
})),
|
|
2882
|
-
var n =
|
|
2888
|
+
})), me = /* @__PURE__ */ t(((e, t) => {
|
|
2889
|
+
var n = M();
|
|
2883
2890
|
t.exports = class extends n {
|
|
2884
2891
|
run() {
|
|
2885
2892
|
let e = [...this.arguments], t = !1, n = !1;
|
|
@@ -2891,8 +2898,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
2891
2898
|
return n && (r = r.replace(/\\c.*$/s, () => (t = !0, "")).replace(/\\0([0-7]{1,3})/g, (e, t) => String.fromCharCode(parseInt(t, 8))).replace(/\\x([0-9a-fA-F]{1,2})/g, (e, t) => String.fromCharCode(parseInt(t, 16))).replace(/\\n/g, "\n").replace(/\\t/g, " ").replace(/\\r/g, "\r").replace(/\\a/g, "\x07").replace(/\\b/g, "\b").replace(/\\e/g, "\x1B").replace(/\\f/g, "\f").replace(/\\v/g, "\v").replace(/\\\\/g, "\\")), t ? (r.split(/\r?\n/).forEach((e) => this.stdOut = e), Promise.resolve()) : Promise.resolve(r);
|
|
2892
2899
|
}
|
|
2893
2900
|
};
|
|
2894
|
-
})),
|
|
2895
|
-
var n =
|
|
2901
|
+
})), J = /* @__PURE__ */ t(((e, t) => {
|
|
2902
|
+
var n = M();
|
|
2896
2903
|
t.exports = class extends n {
|
|
2897
2904
|
get requiresFilesystem() {
|
|
2898
2905
|
return !0;
|
|
@@ -3076,8 +3083,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3076
3083
|
return S && !(o && E) ? this.exitCode = 2 : E || (this.exitCode = 1), Promise.resolve();
|
|
3077
3084
|
}
|
|
3078
3085
|
};
|
|
3079
|
-
})),
|
|
3080
|
-
var n =
|
|
3086
|
+
})), he = /* @__PURE__ */ t(((e, t) => {
|
|
3087
|
+
var n = M();
|
|
3081
3088
|
t.exports = class extends n {
|
|
3082
3089
|
get name() {
|
|
3083
3090
|
return "true";
|
|
@@ -3086,8 +3093,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3086
3093
|
return Promise.resolve();
|
|
3087
3094
|
}
|
|
3088
3095
|
};
|
|
3089
|
-
})),
|
|
3090
|
-
var n =
|
|
3096
|
+
})), ge = /* @__PURE__ */ t(((e, t) => {
|
|
3097
|
+
var n = M();
|
|
3091
3098
|
t.exports = class extends n {
|
|
3092
3099
|
get name() {
|
|
3093
3100
|
return "false";
|
|
@@ -3096,20 +3103,20 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3096
3103
|
return this.exitCode = 1, Promise.resolve();
|
|
3097
3104
|
}
|
|
3098
3105
|
};
|
|
3099
|
-
})),
|
|
3100
|
-
var { Test: n, TestBracket: r } =
|
|
3106
|
+
})), Y = /* @__PURE__ */ t(((e, t) => {
|
|
3107
|
+
var { Test: n, TestBracket: r } = K();
|
|
3101
3108
|
t.exports = [
|
|
3102
|
-
|
|
3109
|
+
q(),
|
|
3110
|
+
pe(),
|
|
3103
3111
|
me(),
|
|
3104
3112
|
J(),
|
|
3105
3113
|
he(),
|
|
3106
3114
|
ge(),
|
|
3107
|
-
Y(),
|
|
3108
3115
|
n,
|
|
3109
3116
|
r
|
|
3110
3117
|
];
|
|
3111
|
-
})),
|
|
3112
|
-
var n =
|
|
3118
|
+
})), _e = /* @__PURE__ */ t(((e, t) => {
|
|
3119
|
+
var n = N();
|
|
3113
3120
|
t.exports = class extends n {
|
|
3114
3121
|
run() {
|
|
3115
3122
|
if (this.arguments.length !== 1) return Promise.reject("alias requires a single argument");
|
|
@@ -3117,8 +3124,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3117
3124
|
return e.length === 2 ? (this.context.setAlias(e[0], e[1]), Promise.resolve()) : Promise.reject("alias requires a key and value delimited by '=' ie: key=value");
|
|
3118
3125
|
}
|
|
3119
3126
|
};
|
|
3120
|
-
})),
|
|
3121
|
-
var n =
|
|
3127
|
+
})), ve = /* @__PURE__ */ t(((e, t) => {
|
|
3128
|
+
var n = N();
|
|
3122
3129
|
t.exports = class extends n {
|
|
3123
3130
|
run() {
|
|
3124
3131
|
if (this.arguments.length !== 1) return Promise.reject("export requires a single argument");
|
|
@@ -3126,8 +3133,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3126
3133
|
return e.length !== 2 && Promise.reject("export requires a key and value delimited by '=' ie: key=value"), this.context.setVar(e[0], e[1]), Promise.resolve();
|
|
3127
3134
|
}
|
|
3128
3135
|
};
|
|
3129
|
-
})),
|
|
3130
|
-
var n =
|
|
3136
|
+
})), ye = /* @__PURE__ */ t(((e, t) => {
|
|
3137
|
+
var n = N();
|
|
3131
3138
|
t.exports = class extends n {
|
|
3132
3139
|
run() {
|
|
3133
3140
|
if (this.arguments.length !== 1) return Promise.reject("cd requires a single argument");
|
|
@@ -3135,8 +3142,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3135
3142
|
return e ? e.constructor === Object ? (this.context.setCwd(this.arguments[0]), Promise.resolve()) : Promise.reject(`${this.arguments[0]}: Not a directory`) : Promise.reject("file or directory not found");
|
|
3136
3143
|
}
|
|
3137
3144
|
};
|
|
3138
|
-
})),
|
|
3139
|
-
var n =
|
|
3145
|
+
})), be = /* @__PURE__ */ t(((e, t) => {
|
|
3146
|
+
var n = N();
|
|
3140
3147
|
t.exports = class extends n {
|
|
3141
3148
|
get name() {
|
|
3142
3149
|
return "chmod";
|
|
@@ -3191,8 +3198,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3191
3198
|
return null;
|
|
3192
3199
|
}
|
|
3193
3200
|
};
|
|
3194
|
-
})),
|
|
3195
|
-
var n =
|
|
3201
|
+
})), xe = /* @__PURE__ */ t(((e, t) => {
|
|
3202
|
+
var n = N(), r = T();
|
|
3196
3203
|
t.exports = class extends n {
|
|
3197
3204
|
get name() {
|
|
3198
3205
|
return "cp";
|
|
@@ -3283,8 +3290,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3283
3290
|
return null;
|
|
3284
3291
|
}
|
|
3285
3292
|
};
|
|
3286
|
-
})),
|
|
3287
|
-
var n =
|
|
3293
|
+
})), Se = /* @__PURE__ */ t(((e, t) => {
|
|
3294
|
+
var n = N();
|
|
3288
3295
|
t.exports = class extends n {
|
|
3289
3296
|
get name() {
|
|
3290
3297
|
return "mkdir";
|
|
@@ -3310,8 +3317,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3310
3317
|
return Promise.resolve();
|
|
3311
3318
|
}
|
|
3312
3319
|
};
|
|
3313
|
-
})),
|
|
3314
|
-
var n =
|
|
3320
|
+
})), Ce = /* @__PURE__ */ t(((e, t) => {
|
|
3321
|
+
var n = N(), r = T();
|
|
3315
3322
|
t.exports = class extends n {
|
|
3316
3323
|
get name() {
|
|
3317
3324
|
return "mv";
|
|
@@ -3355,7 +3362,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3355
3362
|
continue;
|
|
3356
3363
|
}
|
|
3357
3364
|
try {
|
|
3358
|
-
let e =
|
|
3365
|
+
let e = E();
|
|
3359
3366
|
r.mkdirSync(e.dirname(i), { recursive: !0 }), r.renameSync(n, i);
|
|
3360
3367
|
} catch (n) {
|
|
3361
3368
|
this.stdErr = `mv: cannot move '${e}' to '${t}': ${n.message}`, this.exitCode = 1;
|
|
@@ -3378,16 +3385,16 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3378
3385
|
return t;
|
|
3379
3386
|
}
|
|
3380
3387
|
};
|
|
3381
|
-
})),
|
|
3382
|
-
var n =
|
|
3388
|
+
})), we = /* @__PURE__ */ t(((e, t) => {
|
|
3389
|
+
var n = N();
|
|
3383
3390
|
t.exports = class extends n {
|
|
3384
3391
|
run() {
|
|
3385
3392
|
let e = this.context.fs.cwd;
|
|
3386
3393
|
return this.stdOut = e.endsWith("/") && e !== "/" ? e.slice(0, -1) : e, Promise.resolve();
|
|
3387
3394
|
}
|
|
3388
3395
|
};
|
|
3389
|
-
})),
|
|
3390
|
-
var n =
|
|
3396
|
+
})), Te = /* @__PURE__ */ t(((e, t) => {
|
|
3397
|
+
var n = N(), r = T();
|
|
3391
3398
|
t.exports = class extends n {
|
|
3392
3399
|
get name() {
|
|
3393
3400
|
return "rm";
|
|
@@ -3431,8 +3438,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3431
3438
|
this.fs.deleteFileByPath(e);
|
|
3432
3439
|
}
|
|
3433
3440
|
};
|
|
3434
|
-
})),
|
|
3435
|
-
var n =
|
|
3441
|
+
})), Ee = /* @__PURE__ */ t(((e, t) => {
|
|
3442
|
+
var n = N();
|
|
3436
3443
|
t.exports = class extends n {
|
|
3437
3444
|
run() {
|
|
3438
3445
|
if (this.arguments.length !== 1) return Promise.reject("which requires a single argument");
|
|
@@ -3440,9 +3447,9 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3440
3447
|
return !e || e.constructor === Object || e.constructor === String ? Promise.reject() : Promise.resolve(`${this.context.getVar("PATH")}/${this.arguments[0]}`);
|
|
3441
3448
|
}
|
|
3442
3449
|
};
|
|
3443
|
-
})),
|
|
3444
|
-
var n =
|
|
3445
|
-
|
|
3450
|
+
})), De = /* @__PURE__ */ t(((e, t) => {
|
|
3451
|
+
var n = P(), r = N();
|
|
3452
|
+
t.exports = class extends r {
|
|
3446
3453
|
constructor(e, t) {
|
|
3447
3454
|
if (super(e, t), this.arguments.length !== 1) return Promise.reject("source requires a single argument");
|
|
3448
3455
|
let r = this.arguments[0];
|
|
@@ -3457,29 +3464,29 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3457
3464
|
let t = this.context.fs.getFileByPath(e);
|
|
3458
3465
|
if (!t) return Promise.reject(`${e}: No such file or directory`);
|
|
3459
3466
|
if (t.constructor === Object) return Promise.reject(`${e}: is a directory`);
|
|
3460
|
-
if (t.prototype && t.prototype
|
|
3467
|
+
if (t.prototype && typeof t.prototype.run == "function" && typeof t.prototype.runCommand == "function") return Promise.reject(`${e}: command not found`);
|
|
3461
3468
|
if (t.constructor === String && t.startsWith("#!")) return Promise.reject("FATAL: should not get here");
|
|
3462
3469
|
}
|
|
3463
3470
|
return Promise.reject(`${e}: permission denied`);
|
|
3464
3471
|
}
|
|
3465
3472
|
};
|
|
3466
|
-
})),
|
|
3467
|
-
var n =
|
|
3473
|
+
})), Oe = /* @__PURE__ */ t(((e, t) => {
|
|
3474
|
+
var n = N();
|
|
3468
3475
|
t.exports = class extends n {
|
|
3469
3476
|
run() {
|
|
3470
3477
|
return this.arguments.length > 0 ? Promise.reject("clear does not require arguments") : (this.context.clear(), Promise.resolve());
|
|
3471
3478
|
}
|
|
3472
3479
|
};
|
|
3473
|
-
})),
|
|
3474
|
-
var n =
|
|
3480
|
+
})), ke = /* @__PURE__ */ t(((e, t) => {
|
|
3481
|
+
var n = N();
|
|
3475
3482
|
t.exports = class extends n {
|
|
3476
3483
|
run() {
|
|
3477
3484
|
let e = parseInt(this.arguments[0]) || 0;
|
|
3478
3485
|
return this.exitCode = e, this.context.destroy(e), Promise.resolve();
|
|
3479
3486
|
}
|
|
3480
3487
|
};
|
|
3481
|
-
})),
|
|
3482
|
-
var n =
|
|
3488
|
+
})), Ae = /* @__PURE__ */ t(((e, t) => {
|
|
3489
|
+
var n = N(), r = fe();
|
|
3483
3490
|
t.exports = class extends n {
|
|
3484
3491
|
get requiresFilesystem() {
|
|
3485
3492
|
return !1;
|
|
@@ -3545,8 +3552,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3545
3552
|
], { argv: this.arguments });
|
|
3546
3553
|
}
|
|
3547
3554
|
};
|
|
3548
|
-
})),
|
|
3549
|
-
var n =
|
|
3555
|
+
})), je = /* @__PURE__ */ t(((e, t) => {
|
|
3556
|
+
var n = N(), r = M();
|
|
3550
3557
|
t.exports = class extends n {
|
|
3551
3558
|
get name() {
|
|
3552
3559
|
return "jsfunction";
|
|
@@ -3581,8 +3588,88 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3581
3588
|
}), this.context.setCommand(a), Promise.resolve();
|
|
3582
3589
|
}
|
|
3583
3590
|
};
|
|
3591
|
+
})), Me = /* @__PURE__ */ t(((e, t) => {
|
|
3592
|
+
var n = N();
|
|
3593
|
+
t.exports = class extends n {
|
|
3594
|
+
get name() {
|
|
3595
|
+
return "curl";
|
|
3596
|
+
}
|
|
3597
|
+
get requiresFilesystem() {
|
|
3598
|
+
return !0;
|
|
3599
|
+
}
|
|
3600
|
+
run() {
|
|
3601
|
+
let e = [...this.arguments], t = null, n = {}, r = null, i = !1, a = !1, o = null, s = null, c = 0;
|
|
3602
|
+
for (; c < e.length;) {
|
|
3603
|
+
let l = e[c];
|
|
3604
|
+
switch (l) {
|
|
3605
|
+
case "-X":
|
|
3606
|
+
case "--request":
|
|
3607
|
+
t = e[++c];
|
|
3608
|
+
break;
|
|
3609
|
+
case "-H":
|
|
3610
|
+
case "--header": {
|
|
3611
|
+
let t = e[++c] || "", r = t.indexOf(":");
|
|
3612
|
+
r > 0 && (n[t.slice(0, r).trim()] = t.slice(r + 1).trim());
|
|
3613
|
+
break;
|
|
3614
|
+
}
|
|
3615
|
+
case "-d":
|
|
3616
|
+
case "--data":
|
|
3617
|
+
case "--data-raw":
|
|
3618
|
+
r = e[++c], t ||= "POST";
|
|
3619
|
+
break;
|
|
3620
|
+
case "-u":
|
|
3621
|
+
case "--user": {
|
|
3622
|
+
let t = e[++c] || "";
|
|
3623
|
+
n.Authorization = "Basic " + btoa(t);
|
|
3624
|
+
break;
|
|
3625
|
+
}
|
|
3626
|
+
case "-o":
|
|
3627
|
+
case "--output":
|
|
3628
|
+
o = e[++c];
|
|
3629
|
+
break;
|
|
3630
|
+
case "-i":
|
|
3631
|
+
case "--include":
|
|
3632
|
+
i = !0;
|
|
3633
|
+
break;
|
|
3634
|
+
case "-s":
|
|
3635
|
+
case "--silent":
|
|
3636
|
+
a = !0;
|
|
3637
|
+
break;
|
|
3638
|
+
case "-L":
|
|
3639
|
+
case "--location": break;
|
|
3640
|
+
default: l.startsWith("-") ? a || (this.stdErr = `curl: unknown option '${l}'`) : s = l;
|
|
3641
|
+
}
|
|
3642
|
+
c++;
|
|
3643
|
+
}
|
|
3644
|
+
if (!s) return this.stdErr = "curl: no URL specified", this.exitCode = 1, Promise.resolve();
|
|
3645
|
+
if (!/^https?:\/\//i.test(s)) return this.stdErr = `curl: unsupported protocol in URL: ${s}`, this.exitCode = 1, Promise.resolve();
|
|
3646
|
+
let l = {
|
|
3647
|
+
method: t || "GET",
|
|
3648
|
+
headers: n
|
|
3649
|
+
};
|
|
3650
|
+
return r !== null && (l.body = r), fetch(s, l).then(async (e) => {
|
|
3651
|
+
i && (this.stdOut = `HTTP/1.1 ${e.status} ${e.statusText}`, e.headers.forEach((e, t) => {
|
|
3652
|
+
this.stdOut = `${t}: ${e}`;
|
|
3653
|
+
}), this.stdOut = "");
|
|
3654
|
+
let t = await e.text();
|
|
3655
|
+
o ? this.fs.setFileByPath(o, t, !1) : t.split(/\r?\n/).forEach((e) => {
|
|
3656
|
+
this.stdOut = e;
|
|
3657
|
+
}), e.ok || (this.exitCode = 22);
|
|
3658
|
+
}).catch((e) => {
|
|
3659
|
+
if (!a) {
|
|
3660
|
+
let t = e && e.message ? e.message : String(e);
|
|
3661
|
+
if (e instanceof TypeError && /failed to fetch|networkerror|load failed|fetch is aborted/i.test(t)) {
|
|
3662
|
+
let e = /^https:\/\//i.test(s), t = typeof location < "u" && location.protocol === "https:";
|
|
3663
|
+
!e && t ? this.stdErr = "curl: (35) Mixed content blocked — the page is served over HTTPS but the target URL is HTTP. Browsers block insecure requests from secure pages." : (this.stdErr = `curl: (6) Network request failed — this is likely a CORS error. The server at ${s} did not include the required 'Access-Control-Allow-Origin' response header. You can only fetch cross-origin resources that explicitly allow it.`, this.stdErr = " Hint: try a public CORS proxy, or ensure the server sends 'Access-Control-Allow-Origin: *'.");
|
|
3664
|
+
} else this.stdErr = `curl: (6) Could not connect: ${t}`;
|
|
3665
|
+
}
|
|
3666
|
+
this.exitCode = 6;
|
|
3667
|
+
});
|
|
3668
|
+
}
|
|
3669
|
+
};
|
|
3584
3670
|
})), Ne = /* @__PURE__ */ t(((e, t) => {
|
|
3585
3671
|
t.exports = [
|
|
3672
|
+
_e(),
|
|
3586
3673
|
ve(),
|
|
3587
3674
|
ye(),
|
|
3588
3675
|
be(),
|
|
@@ -3957,15 +4044,15 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3957
4044
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
3958
4045
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
3959
4046
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
3960
|
-
}, F = rt(), I = dt(), L = F.call(k, Array.prototype.concat), ee = F.call(O, Array.prototype.splice),
|
|
3961
|
-
var t =
|
|
4047
|
+
}, F = rt(), I = dt(), L = F.call(k, Array.prototype.concat), ee = F.call(O, Array.prototype.splice), R = F.call(k, String.prototype.replace), z = F.call(k, String.prototype.slice), B = F.call(k, RegExp.prototype.exec), V = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, H = /\\(\\)?/g, U = function(e) {
|
|
4048
|
+
var t = z(e, 0, 1), n = z(e, -1);
|
|
3962
4049
|
if (t === "%" && n !== "%") throw new c("invalid intrinsic syntax, expected closing `%`");
|
|
3963
4050
|
if (n === "%" && t !== "%") throw new c("invalid intrinsic syntax, expected opening `%`");
|
|
3964
4051
|
var r = [];
|
|
3965
|
-
return
|
|
3966
|
-
r[r.length] = n ?
|
|
4052
|
+
return R(e, V, function(e, t, n, i) {
|
|
4053
|
+
r[r.length] = n ? R(i, H, "$1") : t || e;
|
|
3967
4054
|
}), r;
|
|
3968
|
-
},
|
|
4055
|
+
}, W = function(e, t) {
|
|
3969
4056
|
var n = e, r;
|
|
3970
4057
|
if (I(P, n) && (r = P[n], n = "%" + r[0] + "%"), I(M, n)) {
|
|
3971
4058
|
var i = M[n];
|
|
@@ -3981,11 +4068,11 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
3981
4068
|
t.exports = function(e, t) {
|
|
3982
4069
|
if (typeof e != "string" || e.length === 0) throw new l("intrinsic name must be a non-empty string");
|
|
3983
4070
|
if (arguments.length > 1 && typeof t != "boolean") throw new l("\"allowMissing\" argument must be a boolean");
|
|
3984
|
-
if (
|
|
3985
|
-
var n =
|
|
4071
|
+
if (B(/^%?[^%]*%?$/, e) === null) throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
4072
|
+
var n = U(e), r = n.length > 0 ? n[0] : "", i = W("%" + r + "%", t), a = i.name, o = i.value, s = !1, u = i.alias;
|
|
3986
4073
|
u && (r = u[0], ee(n, L([0, 1], u)));
|
|
3987
4074
|
for (var d = 1, f = !0; d < n.length; d += 1) {
|
|
3988
|
-
var p = n[d], m =
|
|
4075
|
+
var p = n[d], m = z(p, 0, 1), h = z(p, -1);
|
|
3989
4076
|
if ((m === "\"" || m === "'" || m === "`" || h === "\"" || h === "'" || h === "`") && m !== h) throw new c("property names with quotes must have matching quotes");
|
|
3990
4077
|
if ((p === "constructor" || !f) && (s = !0), r += "." + p, a = "%" + r + "%", I(M, a)) o = M[a];
|
|
3991
4078
|
else if (o != null) {
|
|
@@ -4053,8 +4140,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
4053
4140
|
})), gt = /* @__PURE__ */ t(((e, t) => {
|
|
4054
4141
|
var n = mt(), r = Ze(), i = ct(), a = ht();
|
|
4055
4142
|
t.exports = function(e) {
|
|
4056
|
-
var t = i(arguments), r = e.length - (arguments.length - 1);
|
|
4057
|
-
return n(t,
|
|
4143
|
+
var t = i(arguments), r = 1 + e.length - (arguments.length - 1);
|
|
4144
|
+
return n(t, r > 0 ? r : 0, !0);
|
|
4058
4145
|
}, r ? r(t.exports, "apply", { value: a }) : t.exports.apply = a;
|
|
4059
4146
|
})), _t = /* @__PURE__ */ t(((e, t) => {
|
|
4060
4147
|
var n = Object.prototype.toString;
|
|
@@ -4183,8 +4270,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
4183
4270
|
})), wt = /* @__PURE__ */ t(((e, t) => {
|
|
4184
4271
|
t.exports = {};
|
|
4185
4272
|
})), Tt = /* @__PURE__ */ t(((e, t) => {
|
|
4186
|
-
|
|
4187
|
-
var
|
|
4273
|
+
r();
|
|
4274
|
+
var i = typeof Map == "function" && Map.prototype, a = Object.getOwnPropertyDescriptor && i ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, o = i && a && typeof a.get == "function" ? a.get : null, s = i && Map.prototype.forEach, c = typeof Set == "function" && Set.prototype, l = Object.getOwnPropertyDescriptor && c ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, u = c && l && typeof l.get == "function" ? l.get : null, d = c && Set.prototype.forEach, f = typeof WeakMap == "function" && WeakMap.prototype ? WeakMap.prototype.has : null, p = typeof WeakSet == "function" && WeakSet.prototype ? WeakSet.prototype.has : null, m = typeof WeakRef == "function" && WeakRef.prototype ? WeakRef.prototype.deref : null, h = Boolean.prototype.valueOf, g = Object.prototype.toString, _ = Function.prototype.toString, v = String.prototype.match, y = String.prototype.slice, b = String.prototype.replace, x = String.prototype.toUpperCase, S = String.prototype.toLowerCase, C = RegExp.prototype.test, w = Array.prototype.concat, T = Array.prototype.join, E = Array.prototype.slice, D = Math.floor, O = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, k = Object.getOwnPropertySymbols, A = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, j = typeof Symbol == "function" && typeof Symbol.iterator == "object", M = typeof Symbol == "function" && Symbol.toStringTag ? Symbol.toStringTag : null, N = Object.prototype.propertyIsEnumerable, P = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(e) {
|
|
4188
4275
|
return e.__proto__;
|
|
4189
4276
|
} : null);
|
|
4190
4277
|
function F(e, t) {
|
|
@@ -4199,18 +4286,18 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
4199
4286
|
}
|
|
4200
4287
|
return b.call(t, n, "$&_");
|
|
4201
4288
|
}
|
|
4202
|
-
var I = wt(), L = I.custom, ee = ae(L) ? L : null,
|
|
4289
|
+
var I = wt(), L = I.custom, ee = ae(L) ? L : null, R = {
|
|
4203
4290
|
__proto__: null,
|
|
4204
4291
|
double: "\"",
|
|
4205
4292
|
single: "'"
|
|
4206
|
-
},
|
|
4293
|
+
}, z = {
|
|
4207
4294
|
__proto__: null,
|
|
4208
4295
|
double: /(["\\])/g,
|
|
4209
4296
|
single: /(['\\])/g
|
|
4210
4297
|
};
|
|
4211
|
-
t.exports = function e(t,
|
|
4212
|
-
var c =
|
|
4213
|
-
if (K(c, "quoteStyle") && !K(
|
|
4298
|
+
t.exports = function e(t, r, i, a) {
|
|
4299
|
+
var c = r || {};
|
|
4300
|
+
if (K(c, "quoteStyle") && !K(R, c.quoteStyle)) throw TypeError("option \"quoteStyle\" must be \"single\" or \"double\"");
|
|
4214
4301
|
if (K(c, "maxStringLength") && (typeof c.maxStringLength == "number" ? c.maxStringLength < 0 && c.maxStringLength !== Infinity : c.maxStringLength !== null)) throw TypeError("option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`");
|
|
4215
4302
|
var l = K(c, "customInspect") ? c.customInspect : !0;
|
|
4216
4303
|
if (typeof l != "boolean" && l !== "symbol") throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
|
|
@@ -4231,7 +4318,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
4231
4318
|
return f ? F(t, m) : m;
|
|
4232
4319
|
}
|
|
4233
4320
|
var g = c.depth === void 0 ? 5 : c.depth;
|
|
4234
|
-
if (i === void 0 && (i = 0), i >= g && g > 0 && typeof t == "object") return
|
|
4321
|
+
if (i === void 0 && (i = 0), i >= g && g > 0 && typeof t == "object") return U(t) ? "[Array]" : "[Object]";
|
|
4235
4322
|
var _ = be(c, i);
|
|
4236
4323
|
if (a === void 0) a = [];
|
|
4237
4324
|
else if (le(a, t) >= 0) return "[Circular]";
|
|
@@ -4242,7 +4329,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
4242
4329
|
}
|
|
4243
4330
|
return e(t, c, i + 1, a);
|
|
4244
4331
|
}
|
|
4245
|
-
if (typeof t == "function" && !
|
|
4332
|
+
if (typeof t == "function" && !te(t)) {
|
|
4246
4333
|
var x = ce(t), C = Se(t, v);
|
|
4247
4334
|
return "[Function" + (x ? ": " + x : " (anonymous)") + "]" + (C.length > 0 ? " { " + T.call(C, ", ") + " }" : "");
|
|
4248
4335
|
}
|
|
@@ -4251,15 +4338,15 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
4251
4338
|
return typeof t == "object" && !j ? Y(D) : D;
|
|
4252
4339
|
}
|
|
4253
4340
|
if (J(t)) {
|
|
4254
|
-
for (var k = "<" + S.call(String(t.nodeName)), L = t.attributes || [],
|
|
4341
|
+
for (var k = "<" + S.call(String(t.nodeName)), L = t.attributes || [], z = 0; z < L.length; z++) k += " " + L[z].name + "=" + B(V(L[z].value), "double", c);
|
|
4255
4342
|
return k += ">", t.childNodes && t.childNodes.length && (k += "..."), k += "</" + S.call(String(t.nodeName)) + ">", k;
|
|
4256
4343
|
}
|
|
4257
|
-
if (
|
|
4344
|
+
if (U(t)) {
|
|
4258
4345
|
if (t.length === 0) return "[]";
|
|
4259
|
-
var
|
|
4260
|
-
return _ && !ye(
|
|
4346
|
+
var H = Se(t, v);
|
|
4347
|
+
return _ && !ye(H) ? "[" + xe(H, _) + "]" : "[ " + T.call(H, ", ") + " ]";
|
|
4261
4348
|
}
|
|
4262
|
-
if (
|
|
4349
|
+
if (ne(t)) {
|
|
4263
4350
|
var se = Se(t, v);
|
|
4264
4351
|
return !("cause" in Error.prototype) && "cause" in t && !N.call(t, "cause") ? "{ [" + String(t) + "] " + T.call(w.call("[cause]: " + v(t.cause), se), ", ") + " }" : se.length === 0 ? "[" + String(t) + "]" : "{ [" + String(t) + "] " + T.call(se, ", ") + " }";
|
|
4265
4352
|
}
|
|
@@ -4282,48 +4369,48 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
4282
4369
|
if (de(t)) return _e("WeakMap");
|
|
4283
4370
|
if (me(t)) return _e("WeakSet");
|
|
4284
4371
|
if (fe(t)) return _e("WeakRef");
|
|
4285
|
-
if (
|
|
4372
|
+
if (re(t)) return Y(v(Number(t)));
|
|
4286
4373
|
if (oe(t)) return Y(v(O.call(t)));
|
|
4287
4374
|
if (ie(t)) return Y(h.call(t));
|
|
4288
|
-
if (
|
|
4375
|
+
if (G(t)) return Y(v(String(t)));
|
|
4289
4376
|
if (typeof window < "u" && t === window) return "{ [object Window] }";
|
|
4290
|
-
if (typeof globalThis < "u" && t === globalThis ||
|
|
4291
|
-
if (!
|
|
4377
|
+
if (typeof globalThis < "u" && t === globalThis || n !== void 0 && t === n) return "{ [object globalThis] }";
|
|
4378
|
+
if (!W(t) && !te(t)) {
|
|
4292
4379
|
var we = Se(t, v), Te = P ? P(t) === Object.prototype : t instanceof Object || t.constructor === Object, Ee = t instanceof Object ? "" : "null prototype", De = !Te && M && Object(t) === t && M in t ? y.call(q(t), 8, -1) : Ee ? "Object" : "", Oe = (Te || typeof t.constructor != "function" ? "" : t.constructor.name ? t.constructor.name + " " : "") + (De || Ee ? "[" + T.call(w.call([], De || [], Ee || []), ": ") + "] " : "");
|
|
4293
4380
|
return we.length === 0 ? Oe + "{}" : _ ? Oe + "{" + xe(we, _) + "}" : Oe + "{ " + T.call(we, ", ") + " }";
|
|
4294
4381
|
}
|
|
4295
4382
|
return String(t);
|
|
4296
4383
|
};
|
|
4297
|
-
function
|
|
4298
|
-
var r =
|
|
4384
|
+
function B(e, t, n) {
|
|
4385
|
+
var r = R[n.quoteStyle || t];
|
|
4299
4386
|
return r + e + r;
|
|
4300
4387
|
}
|
|
4301
|
-
function ne(e) {
|
|
4302
|
-
return b.call(String(e), /"/g, """);
|
|
4303
|
-
}
|
|
4304
|
-
function B(e) {
|
|
4305
|
-
return !M || !(typeof e == "object" && (M in e || e[M] !== void 0));
|
|
4306
|
-
}
|
|
4307
4388
|
function V(e) {
|
|
4308
|
-
return
|
|
4389
|
+
return b.call(String(e), /"/g, """);
|
|
4309
4390
|
}
|
|
4310
4391
|
function H(e) {
|
|
4311
|
-
return
|
|
4392
|
+
return !M || !(typeof e == "object" && (M in e || e[M] !== void 0));
|
|
4312
4393
|
}
|
|
4313
4394
|
function U(e) {
|
|
4314
|
-
return q(e) === "[object
|
|
4315
|
-
}
|
|
4316
|
-
function re(e) {
|
|
4317
|
-
return q(e) === "[object Error]" && B(e);
|
|
4395
|
+
return q(e) === "[object Array]" && H(e);
|
|
4318
4396
|
}
|
|
4319
4397
|
function W(e) {
|
|
4320
|
-
return q(e) === "[object
|
|
4398
|
+
return q(e) === "[object Date]" && H(e);
|
|
4399
|
+
}
|
|
4400
|
+
function te(e) {
|
|
4401
|
+
return q(e) === "[object RegExp]" && H(e);
|
|
4402
|
+
}
|
|
4403
|
+
function ne(e) {
|
|
4404
|
+
return q(e) === "[object Error]" && H(e);
|
|
4321
4405
|
}
|
|
4322
4406
|
function G(e) {
|
|
4323
|
-
return q(e) === "[object
|
|
4407
|
+
return q(e) === "[object String]" && H(e);
|
|
4408
|
+
}
|
|
4409
|
+
function re(e) {
|
|
4410
|
+
return q(e) === "[object Number]" && H(e);
|
|
4324
4411
|
}
|
|
4325
4412
|
function ie(e) {
|
|
4326
|
-
return q(e) === "[object Boolean]" &&
|
|
4413
|
+
return q(e) === "[object Boolean]" && H(e);
|
|
4327
4414
|
}
|
|
4328
4415
|
function ae(e) {
|
|
4329
4416
|
if (j) return e && typeof e == "object" && e instanceof Symbol;
|
|
@@ -4427,8 +4514,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
4427
4514
|
var n = e.length - t.maxStringLength, r = "... " + n + " more character" + (n > 1 ? "s" : "");
|
|
4428
4515
|
return he(y.call(e, 0, t.maxStringLength), t) + r;
|
|
4429
4516
|
}
|
|
4430
|
-
var i =
|
|
4431
|
-
return i.lastIndex = 0,
|
|
4517
|
+
var i = z[t.quoteStyle || "single"];
|
|
4518
|
+
return i.lastIndex = 0, B(b.call(b.call(e, i, "\\$1"), /[\x00-\x1f]/g, ge), "single", t);
|
|
4432
4519
|
}
|
|
4433
4520
|
function ge(e) {
|
|
4434
4521
|
var t = e.charCodeAt(0), n = {
|
|
@@ -4470,7 +4557,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
4470
4557
|
return n + T.call(e, "," + n) + "\n" + t.prev;
|
|
4471
4558
|
}
|
|
4472
4559
|
function Se(e, t) {
|
|
4473
|
-
var n =
|
|
4560
|
+
var n = U(e), r = [];
|
|
4474
4561
|
if (n) {
|
|
4475
4562
|
r.length = e.length;
|
|
4476
4563
|
for (var i = 0; i < e.length; i++) r[i] = K(e, i) ? t(e[i], e) : "";
|
|
@@ -4903,8 +4990,8 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
4903
4990
|
if (!t.has(e)) throw new r("Side channel does not contain " + n(e));
|
|
4904
4991
|
},
|
|
4905
4992
|
delete: function(t) {
|
|
4906
|
-
var n =
|
|
4907
|
-
return
|
|
4993
|
+
var n = c(e, t);
|
|
4994
|
+
return n && e && !e.next && (e = void 0), !!n;
|
|
4908
4995
|
},
|
|
4909
4996
|
get: function(t) {
|
|
4910
4997
|
return a(e, t);
|
|
@@ -5393,21 +5480,21 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
5393
5480
|
shim: o
|
|
5394
5481
|
}), t.exports = s;
|
|
5395
5482
|
})), Xn = /* @__PURE__ */ t(((e, t) => {
|
|
5396
|
-
|
|
5397
|
-
var
|
|
5483
|
+
r();
|
|
5484
|
+
var i = O(), a = N(), o = P(), s = se(), c = M(), l = Y(), u = Ne(), d = k(), f = /\${?([\w\d]+)}?/g, p = d.EventEmitter || d.default || d;
|
|
5398
5485
|
String.prototype.regexIndexOf = function(e, t) {
|
|
5399
5486
|
let n = this.substring(t || 0).search(e);
|
|
5400
5487
|
return n >= 0 ? n + (t || 0) : n;
|
|
5401
5488
|
}, Yn().shim();
|
|
5402
|
-
var m = class e extends
|
|
5489
|
+
var m = class e extends p {
|
|
5403
5490
|
constructor(t) {
|
|
5404
5491
|
super();
|
|
5405
|
-
let { path: n = "/bin", profile: r, hostname:
|
|
5406
|
-
this.context = new
|
|
5492
|
+
let { path: n = "/bin", profile: r, hostname: a = "browser", filesystem: o = {}, permissions: s = {}, cwd: c = "/", onFsChange: l, useRealFilesystem: u = !1 } = t;
|
|
5493
|
+
this.context = new i(Object.assign({}, t, {
|
|
5407
5494
|
clearFn: this.clear.bind(this),
|
|
5408
5495
|
destroyFn: this.destroy.bind(this),
|
|
5409
5496
|
onFsChange: typeof l == "function" ? l : null
|
|
5410
|
-
})), this.context.setVar("PATH", n), this.context.setVar("HOST",
|
|
5497
|
+
})), this.context.setVar("PATH", n), this.context.setVar("HOST", a), u ? this.context.setNodeFilesystem(c) : this.context.setFilesystem(o, s), this.context.setCwd(c), this._loadDefaultCommands(), this._loadBuiltinCommands(), this._lastCode = 0, r ? this._loadProfile(r) : setTimeout(() => this.emit("status", e.STATUS_READY), 0);
|
|
5411
5498
|
}
|
|
5412
5499
|
get path() {
|
|
5413
5500
|
return this.context.getVar("PATH");
|
|
@@ -5425,12 +5512,12 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
5425
5512
|
if (this.runningCommand && this.runningCommand.onInput && this.runningCommand.captureInput) return this.runningCommand.onInput(e), !0;
|
|
5426
5513
|
}
|
|
5427
5514
|
_loadDefaultCommands() {
|
|
5428
|
-
|
|
5515
|
+
u.forEach((e) => {
|
|
5429
5516
|
this.context.setCommand(e);
|
|
5430
5517
|
});
|
|
5431
5518
|
}
|
|
5432
5519
|
_loadBuiltinCommands() {
|
|
5433
|
-
|
|
5520
|
+
l.forEach((e) => {
|
|
5434
5521
|
this.context.setCommand(e);
|
|
5435
5522
|
});
|
|
5436
5523
|
}
|
|
@@ -5467,23 +5554,23 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
5467
5554
|
if (!n.length) return;
|
|
5468
5555
|
let r = n.shift(), i = this.context.getAlias(r);
|
|
5469
5556
|
if (i) return this.onCommand(i, !1);
|
|
5470
|
-
let
|
|
5557
|
+
let s;
|
|
5471
5558
|
try {
|
|
5472
|
-
|
|
5559
|
+
s = this._parseCommand(r.startsWith("/") || r.startsWith("./") ? r : r.toLowerCase());
|
|
5473
5560
|
} catch (e) {
|
|
5474
5561
|
this.emit("stdErr", e.message), this.lastCode = 1, this.emit("exitCode", this.lastCode);
|
|
5475
5562
|
return;
|
|
5476
5563
|
}
|
|
5477
|
-
let
|
|
5478
|
-
if (
|
|
5479
|
-
else if (
|
|
5564
|
+
let c = (e) => typeof e == "function" && typeof e.prototype.run == "function" && typeof e.prototype.runCommand == "function", l;
|
|
5565
|
+
if (s.prototype instanceof a || new s() instanceof o) l = new s(n, this.context);
|
|
5566
|
+
else if (c(s)) l = new s(n);
|
|
5480
5567
|
else {
|
|
5481
5568
|
this.emit("stdErr", `${r}: Command not found`), this.lastCode = 1, this.emit("exitCode", this.lastCode);
|
|
5482
5569
|
return;
|
|
5483
5570
|
}
|
|
5484
|
-
return
|
|
5571
|
+
return l.requiresFilesystem && (l.fs = this.context.fs), this._stdin !== void 0 && (l.stdin = this._stdin), this.runningCommand = l, this.runningCommand.on && this.runningCommand.on("flush", (e) => {
|
|
5485
5572
|
this._emitOutput(e);
|
|
5486
|
-
}),
|
|
5573
|
+
}), l.runCommand().then((e) => {
|
|
5487
5574
|
this._emitOutput(e.getStdOutput()), this.lastCode = e.getExitCode(), this.emit("exitCode", this.lastCode), delete this.runningCommand;
|
|
5488
5575
|
});
|
|
5489
5576
|
}
|
|
@@ -5553,14 +5640,17 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
5553
5640
|
let t = this.context.fs.getFileByPath(e);
|
|
5554
5641
|
if (!t) throw Error(`${e}: No such file or directory`);
|
|
5555
5642
|
if (t.constructor === Object) throw Error(`${e}: is a directory`);
|
|
5556
|
-
if (t.prototype && t.prototype
|
|
5643
|
+
if (t.prototype && typeof t.prototype.run == "function" && typeof t.prototype.runCommand == "function") {
|
|
5644
|
+
if (!this.context.fs.isExecutable(e)) throw Error(`${e}: permission denied`);
|
|
5645
|
+
return t;
|
|
5646
|
+
}
|
|
5557
5647
|
if (t.constructor === String && t.startsWith("#!")) {
|
|
5558
5648
|
if (!this.context.fs.isExecutable(e)) throw Error(`${e}: permission denied`);
|
|
5559
|
-
return
|
|
5649
|
+
return o.bind(this, t);
|
|
5560
5650
|
}
|
|
5561
5651
|
if (this._isWasmFile(e, t)) {
|
|
5562
5652
|
if (!this.context.fs.isExecutable(e)) throw Error(`${e}: permission denied`);
|
|
5563
|
-
return
|
|
5653
|
+
return s.bind(null, e);
|
|
5564
5654
|
}
|
|
5565
5655
|
throw Error(`${e}: permission denied`);
|
|
5566
5656
|
}
|
|
@@ -5589,7 +5679,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
5589
5679
|
let n = await this._runAndCapture(e[1]);
|
|
5590
5680
|
t = t.replace(e[0], n);
|
|
5591
5681
|
}
|
|
5592
|
-
let i = t.matchAll(
|
|
5682
|
+
let i = t.matchAll(f), a = i.next();
|
|
5593
5683
|
for (; !a.done;) {
|
|
5594
5684
|
let n = this.context.getVar(a.value[1]);
|
|
5595
5685
|
t = t.replace(new RegExp(e._escapeRegExp(a.value[0]), "g"), String(n)), a = i.next();
|
|
@@ -5606,14 +5696,14 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
5606
5696
|
}
|
|
5607
5697
|
}
|
|
5608
5698
|
async _runAndCapture(e) {
|
|
5609
|
-
let t = new
|
|
5699
|
+
let t = new n.shell({
|
|
5610
5700
|
cwd: this.context.fs.cwd,
|
|
5611
5701
|
filesystem: this.context.fs.getRaw(),
|
|
5612
5702
|
permissions: this.context.fs.getRawPermissions()
|
|
5613
5703
|
});
|
|
5614
5704
|
t.context.source(this.context);
|
|
5615
|
-
let
|
|
5616
|
-
return t.on("stdOut", (e) =>
|
|
5705
|
+
let r = [];
|
|
5706
|
+
return t.on("stdOut", (e) => r.push(e)), await t.onCommand(e, !1), r.join("\n").trimEnd();
|
|
5617
5707
|
}
|
|
5618
5708
|
static _splitCommand(e) {
|
|
5619
5709
|
let t = /\s/g, n = !1, r = !1, i = 0, a = [], o = !1, s = [];
|
|
@@ -5659,7 +5749,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
5659
5749
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
5660
5750
|
}
|
|
5661
5751
|
};
|
|
5662
|
-
m.STATUS_READY = "READY", m.STATUS_WORKING = "WORKING", m.STATUS_DESTROYED = "DESTROYED", m.Command =
|
|
5752
|
+
m.STATUS_READY = "READY", m.STATUS_WORKING = "WORKING", m.STATUS_DESTROYED = "DESTROYED", m.Command = c, n.shell = m, t.exports = m;
|
|
5663
5753
|
})), Zn = /* @__PURE__ */ t(((e) => {
|
|
5664
5754
|
(function(t, n) {
|
|
5665
5755
|
if (typeof define == "function" && define.amd) define(["exports"], n);
|
|
@@ -6005,7 +6095,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
6005
6095
|
var n = Xn(), r = Zn(), i = "/.brsh_history";
|
|
6006
6096
|
t.exports = class {
|
|
6007
6097
|
constructor(e) {
|
|
6008
|
-
let { el: t, font: i = "Roboto Mono", cursor: a = "none", outputAnimation: o = "none", animateSpeed: s = 1, onExit: c = null, mobileInput: l = "click" } = e;
|
|
6098
|
+
let { el: t, font: i = "Roboto Mono", cursor: a = "none", outputAnimation: o = "none", animateSpeed: s = 1, onExit: c = null, mobileInput: l = "click", lineWrap: u = !1 } = e;
|
|
6009
6099
|
if (!t) throw Error("you must set `el` option");
|
|
6010
6100
|
if (![
|
|
6011
6101
|
"none",
|
|
@@ -6014,7 +6104,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
6014
6104
|
].includes(a)) throw Error("cursor value must be one of: 'none', 'block', 'blink'");
|
|
6015
6105
|
if (!["none", "type"].includes(o)) throw Error("outputAnimation value must be one of: 'none', 'type'");
|
|
6016
6106
|
if (!Number.isInteger(s) || s < 1 || s > 20) throw Error("animateSpeed value must be between 1 and 20");
|
|
6017
|
-
this._exitFn = c, this._cursor = a, this._outputAnimation = o, this._animateSpeed = s, this._working = !1, this.cli = new n(e), this._buffer = [], this._cursorPos = 0, this._history = [], this._historyPos = null, this._savedInput = null, this._historyLoaded = !1, this._el = t, this._ansi = new r
|
|
6107
|
+
this._exitFn = c, this._cursor = a, this._outputAnimation = o, this._animateSpeed = s, this._lineWrap = u, this._working = !1, this.cli = new n(e), this._buffer = [], this._cursorPos = 0, this._history = [], this._historyPos = null, this._savedInput = null, this._historyLoaded = !1, this._el = t, this._ansi = new r(), this._ansi.use_classes = !0, this._ansi.url_whitelist = {
|
|
6018
6108
|
http: !0,
|
|
6019
6109
|
https: !0,
|
|
6020
6110
|
tel: !0,
|
|
@@ -6068,7 +6158,7 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
6068
6158
|
}
|
|
6069
6159
|
_setupDom(e, t = "Roboto Mono") {
|
|
6070
6160
|
let n = document.createElement("link");
|
|
6071
|
-
n.href = `https://fonts.googleapis.com/css?family=${encodeURIComponent(t)}:ital,wght@0,400;0,700;1,400;1,700&display=swap`, n.rel = "stylesheet", document.head.appendChild(n), this._cmdList = document.createElement("ul"), this._cmdList.style.fontFamily = `'${t}', monospace`, this._cmdList.style.listStyle = "none", this._cmdList.style.padding = "0", e.appendChild(this._cmdList);
|
|
6161
|
+
n.href = `https://fonts.googleapis.com/css?family=${encodeURIComponent(t)}:ital,wght@0,400;0,700;1,400;1,700&display=swap`, n.rel = "stylesheet", document.head.appendChild(n), this._cmdList = document.createElement("ul"), this._cmdList.style.fontFamily = `'${t}', monospace`, this._cmdList.style.listStyle = "none", this._cmdList.style.padding = "0", this._lineWrap && this._cmdList.classList.add("terminal--wrap"), e.appendChild(this._cmdList);
|
|
6072
6162
|
}
|
|
6073
6163
|
_newPrompt(e) {
|
|
6074
6164
|
this._clearCursor(), this._currentLine = document.createElement("li"), this._cmdList.appendChild(this._currentLine), e && e(), this._autoScroll();
|
|
@@ -6185,7 +6275,16 @@ var B, V, H, U, re, W, G, ie, ae, oe, se = e((() => {
|
|
|
6185
6275
|
"u",
|
|
6186
6276
|
"k"
|
|
6187
6277
|
].includes(t.key.toLowerCase()) && (t.preventDefault(), this._navKeyEvent(e, t));
|
|
6188
|
-
}), t.addEventListener("keyup", (t) => this._keyEvent(e, t.key))
|
|
6278
|
+
}), t.addEventListener("keyup", (t) => this._keyEvent(e, t.key)), window.addEventListener("paste", (t) => {
|
|
6279
|
+
t.preventDefault();
|
|
6280
|
+
let n = (t.clipboardData || window.clipboardData).getData("text");
|
|
6281
|
+
if (!n) return;
|
|
6282
|
+
let r = n.split(/\r?\n/);
|
|
6283
|
+
r.forEach((t, n) => {
|
|
6284
|
+
let i = t.split("");
|
|
6285
|
+
this._buffer.splice(this._cursorPos, 0, ...i), this._cursorPos += i.length, n < r.length - 1 && this._keyEvent(e, "Enter");
|
|
6286
|
+
}), e(this._buffer);
|
|
6287
|
+
});
|
|
6189
6288
|
}
|
|
6190
6289
|
_wordLeft() {
|
|
6191
6290
|
let e = this._cursorPos;
|