@gjsify/example-node-express-webserver 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.gjs.js +798 -158
- package/package.json +4 -4
package/dist/index.gjs.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
if(typeof globalThis.process==="undefined"){const _s=imports.system,_G=imports.gi.GLib;globalThis.process={platform:"linux",arch:"x64",version:"v20.0.0",env:new Proxy({},{get(_,p){return typeof p==="string"?(_G.getenv(p)??undefined):undefined},set(_,p,v){if(typeof p==="string")_G.setenv(p,String(v),true);return true},has(_,p){return typeof p==="string"&&_G.getenv(p)!==null},deleteProperty(_,p){if(typeof p==="string")_G.unsetenv(p);return true},ownKeys(){return _G.listenv()??[]},getOwnPropertyDescriptor(_,p){const v=_G.getenv(p);return v!==null?{value:v,writable:true,enumerable:true,configurable:true}:undefined}}),argv:_s?.programArgs?["gjs",_s.programInvocationName||"",..._s.programArgs]:["gjs"],versions:{},config:{},cwd(){return _G.get_current_dir()||"/"},exit(c){_s.exit(c??0)},stderr:{write(s){printerr(s)}},stdout:{write(s){print(s)}},stdin:null,exitCode:undefined,nextTick(fn,...a){Promise.resolve().then(()=>fn(...a))},hrtime(t){return t?[0,0]:[0,0]},};}
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -5153,6 +5154,24 @@ var init_esm5 = __esm({
|
|
|
5153
5154
|
}
|
|
5154
5155
|
});
|
|
5155
5156
|
|
|
5157
|
+
// ../../../packages/node/terminal-native/lib/esm/index.js
|
|
5158
|
+
var _mod, _gi, nativeTerminal;
|
|
5159
|
+
var init_esm6 = __esm({
|
|
5160
|
+
"../../../packages/node/terminal-native/lib/esm/index.js"() {
|
|
5161
|
+
init_console_gjs();
|
|
5162
|
+
init_auto_globals_c74cce974f();
|
|
5163
|
+
_mod = null;
|
|
5164
|
+
_gi = globalThis.imports?.gi;
|
|
5165
|
+
if (_gi) {
|
|
5166
|
+
try {
|
|
5167
|
+
_mod = _gi["GjsifyTerminal"];
|
|
5168
|
+
} catch {
|
|
5169
|
+
}
|
|
5170
|
+
}
|
|
5171
|
+
nativeTerminal = _mod;
|
|
5172
|
+
}
|
|
5173
|
+
});
|
|
5174
|
+
|
|
5156
5175
|
// ../../../packages/node/process/lib/esm/index.js
|
|
5157
5176
|
function getGjsGlobal() {
|
|
5158
5177
|
return globalThis;
|
|
@@ -5238,12 +5257,6 @@ function detectArch() {
|
|
|
5238
5257
|
if (typeof globalThis.process?.arch === "string") {
|
|
5239
5258
|
return globalThis.process.arch;
|
|
5240
5259
|
}
|
|
5241
|
-
try {
|
|
5242
|
-
const system = getGjsGlobal().imports?.system;
|
|
5243
|
-
if (system?.programInvocationName) {
|
|
5244
|
-
}
|
|
5245
|
-
} catch {
|
|
5246
|
-
}
|
|
5247
5260
|
return "x64";
|
|
5248
5261
|
}
|
|
5249
5262
|
function getCwd() {
|
|
@@ -5338,6 +5351,22 @@ function getPid() {
|
|
|
5338
5351
|
}
|
|
5339
5352
|
return 0;
|
|
5340
5353
|
}
|
|
5354
|
+
function getGioNamespace() {
|
|
5355
|
+
const _gi2 = globalThis.imports?.gi;
|
|
5356
|
+
if (!_gi2) return null;
|
|
5357
|
+
let gio = null;
|
|
5358
|
+
try {
|
|
5359
|
+
gio = _gi2["GioUnix"];
|
|
5360
|
+
} catch {
|
|
5361
|
+
}
|
|
5362
|
+
if (!gio) {
|
|
5363
|
+
try {
|
|
5364
|
+
gio = _gi2["Gio"];
|
|
5365
|
+
} catch {
|
|
5366
|
+
}
|
|
5367
|
+
}
|
|
5368
|
+
return gio;
|
|
5369
|
+
}
|
|
5341
5370
|
function getMonotonicTime() {
|
|
5342
5371
|
try {
|
|
5343
5372
|
const GLib2 = getGjsGlobal().imports?.gi?.GLib;
|
|
@@ -5351,14 +5380,246 @@ function getMonotonicTime() {
|
|
|
5351
5380
|
}
|
|
5352
5381
|
return BigInt(Date.now()) * 1000000n;
|
|
5353
5382
|
}
|
|
5354
|
-
var startTime, hrtimeBase, Process, process2, platform, arch, env, argv, argv0, execPath, pid, ppid, version, versions, cwd, chdir, exit, nextTick2, hrtime, uptime, memoryUsage, cpuUsage, kill, abort, umask, emitWarning, execArgv, config, stdout, stderr, stdin, index_default3;
|
|
5355
|
-
var
|
|
5383
|
+
var _encoder2, startTime, ProcessWriteStream, ProcessReadStream, hrtimeBase, Process, process2, platform, arch, env, argv, argv0, execPath, pid, ppid, version, versions, cwd, chdir, exit, nextTick2, hrtime, uptime, memoryUsage, cpuUsage, kill, abort, umask, emitWarning, execArgv, config, stdout, stderr, stdin, index_default3;
|
|
5384
|
+
var init_esm7 = __esm({
|
|
5356
5385
|
"../../../packages/node/process/lib/esm/index.js"() {
|
|
5357
5386
|
init_console_gjs();
|
|
5358
5387
|
init_auto_globals_c74cce974f();
|
|
5359
5388
|
init_esm5();
|
|
5360
5389
|
init_esm();
|
|
5390
|
+
init_esm6();
|
|
5391
|
+
_encoder2 = new TextEncoder();
|
|
5361
5392
|
startTime = Date.now();
|
|
5393
|
+
ProcessWriteStream = class extends EventEmitter2 {
|
|
5394
|
+
fd;
|
|
5395
|
+
// Required by Stream.pipe(): without this, pipe skips dest.write() entirely.
|
|
5396
|
+
writable = true;
|
|
5397
|
+
_outGio = null;
|
|
5398
|
+
constructor(fd) {
|
|
5399
|
+
super();
|
|
5400
|
+
this.fd = fd;
|
|
5401
|
+
const gio = getGioNamespace();
|
|
5402
|
+
if (gio) {
|
|
5403
|
+
const Cls = gio.UnixOutputStream ?? gio.OutputStream;
|
|
5404
|
+
if (Cls) {
|
|
5405
|
+
try {
|
|
5406
|
+
this._outGio = Cls.new(this.fd, false);
|
|
5407
|
+
} catch {
|
|
5408
|
+
}
|
|
5409
|
+
}
|
|
5410
|
+
}
|
|
5411
|
+
}
|
|
5412
|
+
write(data) {
|
|
5413
|
+
if (this._outGio) {
|
|
5414
|
+
try {
|
|
5415
|
+
const bytes = typeof data === "string" ? _encoder2.encode(data) : data;
|
|
5416
|
+
this._outGio.write_all(bytes, null);
|
|
5417
|
+
return true;
|
|
5418
|
+
} catch {
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5421
|
+
if (this.fd === 2) {
|
|
5422
|
+
console.error(data);
|
|
5423
|
+
} else {
|
|
5424
|
+
console.log(data);
|
|
5425
|
+
}
|
|
5426
|
+
return true;
|
|
5427
|
+
}
|
|
5428
|
+
get isTTY() {
|
|
5429
|
+
if (nativeTerminal) return nativeTerminal.Terminal.is_tty(this.fd);
|
|
5430
|
+
try {
|
|
5431
|
+
const GLib2 = getGjsGlobal().imports?.gi?.GLib;
|
|
5432
|
+
if (GLib2) return !!GLib2.log_writer_supports_color(this.fd);
|
|
5433
|
+
} catch {
|
|
5434
|
+
}
|
|
5435
|
+
return false;
|
|
5436
|
+
}
|
|
5437
|
+
get columns() {
|
|
5438
|
+
if (nativeTerminal) {
|
|
5439
|
+
const [ok, , cols] = nativeTerminal.Terminal.get_size(this.fd);
|
|
5440
|
+
if (ok && cols > 0) return cols;
|
|
5441
|
+
}
|
|
5442
|
+
try {
|
|
5443
|
+
const GLib2 = getGjsGlobal().imports?.gi?.GLib;
|
|
5444
|
+
if (GLib2) {
|
|
5445
|
+
const c = parseInt(GLib2.getenv("COLUMNS") ?? "0", 10);
|
|
5446
|
+
if (c > 0) return c;
|
|
5447
|
+
}
|
|
5448
|
+
} catch {
|
|
5449
|
+
}
|
|
5450
|
+
return 80;
|
|
5451
|
+
}
|
|
5452
|
+
// stdout/stderr must never be closed — the process owns the fds.
|
|
5453
|
+
// pipe() calls end() when its source emits 'end' (e.g. MuteStream); no-op here.
|
|
5454
|
+
end() {
|
|
5455
|
+
}
|
|
5456
|
+
destroy() {
|
|
5457
|
+
}
|
|
5458
|
+
get rows() {
|
|
5459
|
+
if (nativeTerminal) {
|
|
5460
|
+
const [ok, rows] = nativeTerminal.Terminal.get_size(this.fd);
|
|
5461
|
+
if (ok && rows > 0) return rows;
|
|
5462
|
+
}
|
|
5463
|
+
try {
|
|
5464
|
+
const GLib2 = getGjsGlobal().imports?.gi?.GLib;
|
|
5465
|
+
if (GLib2) {
|
|
5466
|
+
const r = parseInt(GLib2.getenv("LINES") ?? "0", 10);
|
|
5467
|
+
if (r > 0) return r;
|
|
5468
|
+
}
|
|
5469
|
+
} catch {
|
|
5470
|
+
}
|
|
5471
|
+
return 24;
|
|
5472
|
+
}
|
|
5473
|
+
};
|
|
5474
|
+
ProcessReadStream = class extends EventEmitter2 {
|
|
5475
|
+
fd;
|
|
5476
|
+
isRaw = false;
|
|
5477
|
+
// Do NOT expose `readableFlowing` as an instance property: @inquirer/core uses
|
|
5478
|
+
// `'readableFlowing' in input` to defer startCycle() via setImmediate. In GJS,
|
|
5479
|
+
// setImmediate fires as a microtask — the property must stay absent so
|
|
5480
|
+
// @inquirer/core calls startCycle() synchronously on its own schedule.
|
|
5481
|
+
_gio = null;
|
|
5482
|
+
_stdinGio = null;
|
|
5483
|
+
_reading = false;
|
|
5484
|
+
_flowing = false;
|
|
5485
|
+
_sttyCleanupRegistered = false;
|
|
5486
|
+
_mainLoopHeld = false;
|
|
5487
|
+
// True while a read_bytes_async is in-flight. Prevents a second concurrent
|
|
5488
|
+
// read from starting when pause()+resume() fires between GLib iterations.
|
|
5489
|
+
_pendingRead = false;
|
|
5490
|
+
constructor(fd) {
|
|
5491
|
+
super();
|
|
5492
|
+
this.fd = fd;
|
|
5493
|
+
this._gio = getGioNamespace();
|
|
5494
|
+
}
|
|
5495
|
+
get isTTY() {
|
|
5496
|
+
if (nativeTerminal) return nativeTerminal.Terminal.is_tty(this.fd);
|
|
5497
|
+
return false;
|
|
5498
|
+
}
|
|
5499
|
+
setRawMode(mode) {
|
|
5500
|
+
if (nativeTerminal) {
|
|
5501
|
+
const ok = nativeTerminal.Terminal.set_raw_mode(this.fd, mode);
|
|
5502
|
+
if (ok) {
|
|
5503
|
+
this.isRaw = mode;
|
|
5504
|
+
return this;
|
|
5505
|
+
}
|
|
5506
|
+
}
|
|
5507
|
+
this._setRawModeViaStty(mode);
|
|
5508
|
+
this.isRaw = mode;
|
|
5509
|
+
return this;
|
|
5510
|
+
}
|
|
5511
|
+
_setRawModeViaStty(mode) {
|
|
5512
|
+
try {
|
|
5513
|
+
const _gi2 = globalThis.imports?.gi;
|
|
5514
|
+
const Gio2 = _gi2?.Gio ?? _gi2?.["Gio"];
|
|
5515
|
+
if (!Gio2) return;
|
|
5516
|
+
const STDIN_INHERIT = Gio2.SubprocessFlags?.STDIN_INHERIT ?? 2;
|
|
5517
|
+
const argv2 = mode ? ["stty", "-icanon", "-echo", "-icrnl", "min", "1", "time", "0"] : ["stty", "icanon", "echo", "icrnl"];
|
|
5518
|
+
const launcher = new Gio2.SubprocessLauncher({ flags: STDIN_INHERIT });
|
|
5519
|
+
const proc = launcher.spawnv(argv2);
|
|
5520
|
+
proc.wait(null);
|
|
5521
|
+
if (mode && !this._sttyCleanupRegistered) {
|
|
5522
|
+
this._sttyCleanupRegistered = true;
|
|
5523
|
+
const proc_ = globalThis.process;
|
|
5524
|
+
if (proc_?.once && typeof proc_.once === "function") {
|
|
5525
|
+
proc_.once("exit", () => this._setRawModeViaStty(false));
|
|
5526
|
+
}
|
|
5527
|
+
}
|
|
5528
|
+
} catch {
|
|
5529
|
+
}
|
|
5530
|
+
}
|
|
5531
|
+
setEncoding(_enc) {
|
|
5532
|
+
return this;
|
|
5533
|
+
}
|
|
5534
|
+
resume() {
|
|
5535
|
+
this._flowing = true;
|
|
5536
|
+
if (this._gio && this.fd === 0 && !this._reading) {
|
|
5537
|
+
this._startReading();
|
|
5538
|
+
}
|
|
5539
|
+
return this;
|
|
5540
|
+
}
|
|
5541
|
+
pause() {
|
|
5542
|
+
this._flowing = false;
|
|
5543
|
+
this._reading = false;
|
|
5544
|
+
if (this._mainLoopHeld) {
|
|
5545
|
+
this._mainLoopHeld = false;
|
|
5546
|
+
const _gi2 = globalThis.imports?.gi;
|
|
5547
|
+
const GLib2 = _gi2?.GLib ?? _gi2?.["GLib"];
|
|
5548
|
+
if (GLib2?.idle_add) {
|
|
5549
|
+
GLib2.idle_add(300, () => {
|
|
5550
|
+
if (!this._mainLoopHeld) quitMainLoop();
|
|
5551
|
+
return false;
|
|
5552
|
+
});
|
|
5553
|
+
} else {
|
|
5554
|
+
quitMainLoop();
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
return this;
|
|
5558
|
+
}
|
|
5559
|
+
read() {
|
|
5560
|
+
return null;
|
|
5561
|
+
}
|
|
5562
|
+
_startReading() {
|
|
5563
|
+
if (!this._gio || this._reading) return;
|
|
5564
|
+
if (this._pendingRead) {
|
|
5565
|
+
this._reading = true;
|
|
5566
|
+
if (!this._mainLoopHeld) {
|
|
5567
|
+
this._mainLoopHeld = true;
|
|
5568
|
+
ensureMainLoop();
|
|
5569
|
+
}
|
|
5570
|
+
return;
|
|
5571
|
+
}
|
|
5572
|
+
this._reading = true;
|
|
5573
|
+
if (!this._mainLoopHeld) {
|
|
5574
|
+
this._mainLoopHeld = true;
|
|
5575
|
+
ensureMainLoop();
|
|
5576
|
+
}
|
|
5577
|
+
if (!this._stdinGio) {
|
|
5578
|
+
const Cls = this._gio.UnixInputStream ?? this._gio.InputStream;
|
|
5579
|
+
if (!Cls) {
|
|
5580
|
+
this._reading = false;
|
|
5581
|
+
return;
|
|
5582
|
+
}
|
|
5583
|
+
try {
|
|
5584
|
+
this._stdinGio = Cls.new(this.fd, false);
|
|
5585
|
+
} catch {
|
|
5586
|
+
this._reading = false;
|
|
5587
|
+
return;
|
|
5588
|
+
}
|
|
5589
|
+
}
|
|
5590
|
+
const loop = () => {
|
|
5591
|
+
if (!this._reading) {
|
|
5592
|
+
this._pendingRead = false;
|
|
5593
|
+
return;
|
|
5594
|
+
}
|
|
5595
|
+
this._pendingRead = true;
|
|
5596
|
+
this._stdinGio.read_bytes_async(
|
|
5597
|
+
4096,
|
|
5598
|
+
0,
|
|
5599
|
+
null,
|
|
5600
|
+
(src, res) => {
|
|
5601
|
+
this._pendingRead = false;
|
|
5602
|
+
try {
|
|
5603
|
+
const bytes = src.read_bytes_finish(res);
|
|
5604
|
+
const data = bytes?.get_data?.() ?? null;
|
|
5605
|
+
if (data && data.byteLength > 0) {
|
|
5606
|
+
this.emit("data", Buffer.from(data));
|
|
5607
|
+
} else if (data !== null && data.byteLength === 0) {
|
|
5608
|
+
this._reading = false;
|
|
5609
|
+
this.emit("end");
|
|
5610
|
+
return;
|
|
5611
|
+
}
|
|
5612
|
+
} catch {
|
|
5613
|
+
this._reading = false;
|
|
5614
|
+
return;
|
|
5615
|
+
}
|
|
5616
|
+
if (this._reading) loop();
|
|
5617
|
+
}
|
|
5618
|
+
);
|
|
5619
|
+
};
|
|
5620
|
+
loop();
|
|
5621
|
+
}
|
|
5622
|
+
};
|
|
5362
5623
|
hrtimeBase = getMonotonicTime();
|
|
5363
5624
|
Process = class extends EventEmitter2 {
|
|
5364
5625
|
platform;
|
|
@@ -5522,18 +5783,11 @@ var init_esm6 = __esm({
|
|
|
5522
5783
|
}
|
|
5523
5784
|
return { user: 0, system: 0 };
|
|
5524
5785
|
}
|
|
5525
|
-
// Stub: stdout/stderr/stdin — these need stream to be implemented fully
|
|
5526
5786
|
// Note: Cannot check globalThis.process.stdout here — on GJS globalThis.process
|
|
5527
5787
|
// IS this instance, so that would cause infinite recursion.
|
|
5528
|
-
stdout =
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
}, fd: 1 };
|
|
5532
|
-
stderr = { write: (data) => {
|
|
5533
|
-
console.error(data);
|
|
5534
|
-
return true;
|
|
5535
|
-
}, fd: 2 };
|
|
5536
|
-
stdin = { fd: 0 };
|
|
5788
|
+
stdout = new ProcessWriteStream(1);
|
|
5789
|
+
stderr = new ProcessWriteStream(2);
|
|
5790
|
+
stdin = new ProcessReadStream(0);
|
|
5537
5791
|
abort() {
|
|
5538
5792
|
this.exit(1);
|
|
5539
5793
|
}
|
|
@@ -5553,6 +5807,17 @@ var init_esm6 = __esm({
|
|
|
5553
5807
|
return getMonotonicTime() - hrtimeBase;
|
|
5554
5808
|
};
|
|
5555
5809
|
process2 = new Process();
|
|
5810
|
+
if (nativeTerminal) {
|
|
5811
|
+
try {
|
|
5812
|
+
const watcher = new nativeTerminal.ResizeWatcher();
|
|
5813
|
+
watcher.connect("resized", (_obj, _rows, _cols) => {
|
|
5814
|
+
process2.stdout.emit("resize");
|
|
5815
|
+
process2.stderr.emit("resize");
|
|
5816
|
+
});
|
|
5817
|
+
watcher.start();
|
|
5818
|
+
} catch {
|
|
5819
|
+
}
|
|
5820
|
+
}
|
|
5556
5821
|
platform = process2.platform;
|
|
5557
5822
|
arch = process2.arch;
|
|
5558
5823
|
env = process2.env;
|
|
@@ -5590,7 +5855,7 @@ var init_process = __esm({
|
|
|
5590
5855
|
init_console_gjs();
|
|
5591
5856
|
init_auto_globals_c74cce974f();
|
|
5592
5857
|
init_esm();
|
|
5593
|
-
|
|
5858
|
+
init_esm7();
|
|
5594
5859
|
if (typeof Promise.withResolvers !== "function") {
|
|
5595
5860
|
Promise.withResolvers = function() {
|
|
5596
5861
|
let resolve5;
|
|
@@ -5611,14 +5876,12 @@ var init_process = __esm({
|
|
|
5611
5876
|
configurable: true
|
|
5612
5877
|
});
|
|
5613
5878
|
}
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
});
|
|
5621
|
-
}
|
|
5879
|
+
Object.defineProperty(globalThis, "process", {
|
|
5880
|
+
value: index_default3,
|
|
5881
|
+
enumerable: false,
|
|
5882
|
+
writable: true,
|
|
5883
|
+
configurable: true
|
|
5884
|
+
});
|
|
5622
5885
|
}
|
|
5623
5886
|
});
|
|
5624
5887
|
|
|
@@ -5991,7 +6254,7 @@ function domainToUnicode(domain) {
|
|
|
5991
6254
|
}
|
|
5992
6255
|
}
|
|
5993
6256
|
var PARSE_FLAGS, URLSearchParams, URL2, index_default4;
|
|
5994
|
-
var
|
|
6257
|
+
var init_esm8 = __esm({
|
|
5995
6258
|
"../../../packages/node/url/lib/esm/index.js"() {
|
|
5996
6259
|
init_console_gjs();
|
|
5997
6260
|
init_auto_globals_c74cce974f();
|
|
@@ -6252,7 +6515,7 @@ var init_url = __esm({
|
|
|
6252
6515
|
"../../../packages/node/globals/lib/esm/register/url.js"() {
|
|
6253
6516
|
init_console_gjs();
|
|
6254
6517
|
init_auto_globals_c74cce974f();
|
|
6255
|
-
|
|
6518
|
+
init_esm8();
|
|
6256
6519
|
if (typeof globalThis.URL !== "function") {
|
|
6257
6520
|
Object.defineProperty(globalThis, "URL", {
|
|
6258
6521
|
value: URL2,
|
|
@@ -6274,7 +6537,7 @@ var init_url = __esm({
|
|
|
6274
6537
|
|
|
6275
6538
|
// ../../../packages/node/perf_hooks/lib/esm/index.js
|
|
6276
6539
|
var performance2, PerformanceObserverStub, PerformanceEntryStub, PerformanceObserverEntryListStub, PerformanceObserver, PerformanceEntry, PerformanceObserverEntryList, PerformanceMark, PerformanceMeasure;
|
|
6277
|
-
var
|
|
6540
|
+
var init_esm9 = __esm({
|
|
6278
6541
|
"../../../packages/node/perf_hooks/lib/esm/index.js"() {
|
|
6279
6542
|
init_console_gjs();
|
|
6280
6543
|
init_auto_globals_c74cce974f();
|
|
@@ -6397,7 +6660,7 @@ var init_performance = __esm({
|
|
|
6397
6660
|
"../../../packages/web/web-globals/lib/esm/register/performance.js"() {
|
|
6398
6661
|
init_console_gjs();
|
|
6399
6662
|
init_auto_globals_c74cce974f();
|
|
6400
|
-
|
|
6663
|
+
init_esm9();
|
|
6401
6664
|
if (typeof globalThis.performance === "undefined") {
|
|
6402
6665
|
globalThis.performance = performance2;
|
|
6403
6666
|
}
|
|
@@ -6409,7 +6672,7 @@ var init_performance = __esm({
|
|
|
6409
6672
|
|
|
6410
6673
|
// ../../../packages/web/abort-controller/lib/esm/index.js
|
|
6411
6674
|
var kAbort, kInternal, AbortSignal2, AbortController;
|
|
6412
|
-
var
|
|
6675
|
+
var init_esm10 = __esm({
|
|
6413
6676
|
"../../../packages/web/abort-controller/lib/esm/index.js"() {
|
|
6414
6677
|
init_console_gjs();
|
|
6415
6678
|
init_auto_globals_c74cce974f();
|
|
@@ -6502,7 +6765,7 @@ var init_register2 = __esm({
|
|
|
6502
6765
|
"../../../packages/web/abort-controller/lib/esm/register.js"() {
|
|
6503
6766
|
init_console_gjs();
|
|
6504
6767
|
init_auto_globals_c74cce974f();
|
|
6505
|
-
|
|
6768
|
+
init_esm10();
|
|
6506
6769
|
if (typeof globalThis.AbortController === "undefined") {
|
|
6507
6770
|
globalThis.AbortController = AbortController;
|
|
6508
6771
|
}
|
|
@@ -8893,7 +9156,7 @@ function isNativeStreamUsable(Ctor, method) {
|
|
|
8893
9156
|
}
|
|
8894
9157
|
}
|
|
8895
9158
|
var _ReadableStream, _WritableStream, _TransformStream, _ByteLengthQueuingStrategy, _CountQueuingStrategy, _TextEncoderStream, _TextDecoderStream;
|
|
8896
|
-
var
|
|
9159
|
+
var init_esm11 = __esm({
|
|
8897
9160
|
"../../../packages/web/streams/lib/esm/index.js"() {
|
|
8898
9161
|
init_console_gjs();
|
|
8899
9162
|
init_auto_globals_c74cce974f();
|
|
@@ -9107,7 +9370,7 @@ function isErrored(stream) {
|
|
|
9107
9370
|
return false;
|
|
9108
9371
|
}
|
|
9109
9372
|
var defaultHighWaterMark, defaultObjectHighWaterMark, Stream_, Readable_, Writable_, Duplex_, Transform_, PassThrough_, Stream, Readable, Writable, Duplex, Transform, PassThrough, _default2, index_default5;
|
|
9110
|
-
var
|
|
9373
|
+
var init_esm12 = __esm({
|
|
9111
9374
|
"../../../packages/node/stream/lib/esm/index.js"() {
|
|
9112
9375
|
init_console_gjs();
|
|
9113
9376
|
init_auto_globals_c74cce974f();
|
|
@@ -10320,7 +10583,7 @@ var init_transform_streams = __esm({
|
|
|
10320
10583
|
init_auto_globals_c74cce974f();
|
|
10321
10584
|
init_gio_2();
|
|
10322
10585
|
init_glib_2();
|
|
10323
|
-
|
|
10586
|
+
init_esm12();
|
|
10324
10587
|
ZlibTransform = class extends Transform {
|
|
10325
10588
|
_format;
|
|
10326
10589
|
_mode;
|
|
@@ -10654,7 +10917,7 @@ function brotliDecompressSync(_data, _options) {
|
|
|
10654
10917
|
throw new Error("brotliDecompressSync: Brotli is not supported in this environment");
|
|
10655
10918
|
}
|
|
10656
10919
|
var hasWebCompression, constants2, index_default6;
|
|
10657
|
-
var
|
|
10920
|
+
var init_esm13 = __esm({
|
|
10658
10921
|
"../../../packages/node/zlib/lib/esm/index.js"() {
|
|
10659
10922
|
init_console_gjs();
|
|
10660
10923
|
init_auto_globals_c74cce974f();
|
|
@@ -10731,7 +10994,7 @@ function validateFormat(format6) {
|
|
|
10731
10994
|
}
|
|
10732
10995
|
async function loadZlib() {
|
|
10733
10996
|
if (_zlibLoaded) return;
|
|
10734
|
-
const zlib = await Promise.resolve().then(() => (
|
|
10997
|
+
const zlib = await Promise.resolve().then(() => (init_esm13(), esm_exports5));
|
|
10735
10998
|
_gzipSync = zlib.gzipSync;
|
|
10736
10999
|
_gunzipSync = zlib.gunzipSync;
|
|
10737
11000
|
_deflateSync = zlib.deflateSync;
|
|
@@ -10761,11 +11024,11 @@ function getDecompressFn(format6) {
|
|
|
10761
11024
|
}
|
|
10762
11025
|
}
|
|
10763
11026
|
var VALID_FORMATS, hasNative, _zlibLoaded, _gzipSync, _gunzipSync, _deflateSync, _inflateSync, _deflateRawSync, _inflateRawSync, CompressionStreamImpl, DecompressionStreamImpl;
|
|
10764
|
-
var
|
|
11027
|
+
var init_esm14 = __esm({
|
|
10765
11028
|
"../../../packages/web/compression-streams/lib/esm/index.js"() {
|
|
10766
11029
|
init_console_gjs();
|
|
10767
11030
|
init_auto_globals_c74cce974f();
|
|
10768
|
-
|
|
11031
|
+
init_esm11();
|
|
10769
11032
|
VALID_FORMATS = /* @__PURE__ */ new Set(["gzip", "deflate", "deflate-raw"]);
|
|
10770
11033
|
hasNative = typeof globalThis.CompressionStream === "function" && typeof globalThis.DecompressionStream === "function";
|
|
10771
11034
|
_zlibLoaded = false;
|
|
@@ -10827,7 +11090,7 @@ var init_register3 = __esm({
|
|
|
10827
11090
|
"../../../packages/web/compression-streams/lib/esm/register.js"() {
|
|
10828
11091
|
init_console_gjs();
|
|
10829
11092
|
init_auto_globals_c74cce974f();
|
|
10830
|
-
|
|
11093
|
+
init_esm14();
|
|
10831
11094
|
if (typeof globalThis.CompressionStream === "undefined") {
|
|
10832
11095
|
globalThis.CompressionStream = CompressionStreamImpl;
|
|
10833
11096
|
}
|
|
@@ -10854,7 +11117,7 @@ var init_queuing = __esm({
|
|
|
10854
11117
|
"../../../packages/web/streams/lib/esm/register/queuing.js"() {
|
|
10855
11118
|
init_console_gjs();
|
|
10856
11119
|
init_auto_globals_c74cce974f();
|
|
10857
|
-
|
|
11120
|
+
init_esm11();
|
|
10858
11121
|
if (typeof globalThis.ByteLengthQueuingStrategy === "undefined") {
|
|
10859
11122
|
globalThis.ByteLengthQueuingStrategy = _ByteLengthQueuingStrategy;
|
|
10860
11123
|
}
|
|
@@ -10877,7 +11140,7 @@ var init_readable = __esm({
|
|
|
10877
11140
|
"../../../packages/web/streams/lib/esm/register/readable.js"() {
|
|
10878
11141
|
init_console_gjs();
|
|
10879
11142
|
init_auto_globals_c74cce974f();
|
|
10880
|
-
|
|
11143
|
+
init_esm11();
|
|
10881
11144
|
if (!isNativeStreamUsable2(globalThis.ReadableStream, "getReader")) {
|
|
10882
11145
|
globalThis.ReadableStream = _ReadableStream;
|
|
10883
11146
|
}
|
|
@@ -10889,7 +11152,7 @@ var init_text_streams = __esm({
|
|
|
10889
11152
|
"../../../packages/web/streams/lib/esm/register/text-streams.js"() {
|
|
10890
11153
|
init_console_gjs();
|
|
10891
11154
|
init_auto_globals_c74cce974f();
|
|
10892
|
-
|
|
11155
|
+
init_esm11();
|
|
10893
11156
|
if (typeof globalThis.TextEncoderStream === "undefined") {
|
|
10894
11157
|
globalThis.TextEncoderStream = _TextEncoderStream;
|
|
10895
11158
|
}
|
|
@@ -10912,7 +11175,7 @@ var init_transform = __esm({
|
|
|
10912
11175
|
"../../../packages/web/streams/lib/esm/register/transform.js"() {
|
|
10913
11176
|
init_console_gjs();
|
|
10914
11177
|
init_auto_globals_c74cce974f();
|
|
10915
|
-
|
|
11178
|
+
init_esm11();
|
|
10916
11179
|
if (!isNativeStreamUsable3(globalThis.TransformStream, "readable")) {
|
|
10917
11180
|
globalThis.TransformStream = _TransformStream;
|
|
10918
11181
|
}
|
|
@@ -10932,7 +11195,7 @@ var init_writable = __esm({
|
|
|
10932
11195
|
"../../../packages/web/streams/lib/esm/register/writable.js"() {
|
|
10933
11196
|
init_console_gjs();
|
|
10934
11197
|
init_auto_globals_c74cce974f();
|
|
10935
|
-
|
|
11198
|
+
init_esm11();
|
|
10936
11199
|
if (!isNativeStreamUsable4(globalThis.WritableStream, "getWriter")) {
|
|
10937
11200
|
globalThis.WritableStream = _WritableStream;
|
|
10938
11201
|
}
|
|
@@ -11160,7 +11423,7 @@ var init_hash = __esm({
|
|
|
11160
11423
|
init_console_gjs();
|
|
11161
11424
|
init_auto_globals_c74cce974f();
|
|
11162
11425
|
init_glib_2();
|
|
11163
|
-
|
|
11426
|
+
init_esm12();
|
|
11164
11427
|
init_esm4();
|
|
11165
11428
|
init_esm();
|
|
11166
11429
|
init_crypto_utils();
|
|
@@ -11247,7 +11510,7 @@ var init_hmac = __esm({
|
|
|
11247
11510
|
"../../../packages/node/crypto/lib/esm/hmac.js"() {
|
|
11248
11511
|
init_console_gjs();
|
|
11249
11512
|
init_auto_globals_c74cce974f();
|
|
11250
|
-
|
|
11513
|
+
init_esm12();
|
|
11251
11514
|
init_esm4();
|
|
11252
11515
|
init_esm();
|
|
11253
11516
|
init_hash();
|
|
@@ -15506,7 +15769,7 @@ var init_x509 = __esm({
|
|
|
15506
15769
|
init_esm4();
|
|
15507
15770
|
init_asn1();
|
|
15508
15771
|
init_key_object();
|
|
15509
|
-
|
|
15772
|
+
init_esm15();
|
|
15510
15773
|
X509Certificate = class {
|
|
15511
15774
|
_components;
|
|
15512
15775
|
_pem;
|
|
@@ -15747,7 +16010,7 @@ function createHmac(algorithm, key) {
|
|
|
15747
16010
|
return new Hmac(algorithm, key);
|
|
15748
16011
|
}
|
|
15749
16012
|
var index_default7;
|
|
15750
|
-
var
|
|
16013
|
+
var init_esm15 = __esm({
|
|
15751
16014
|
"../../../packages/node/crypto/lib/esm/index.js"() {
|
|
15752
16015
|
init_console_gjs();
|
|
15753
16016
|
init_auto_globals_c74cce974f();
|
|
@@ -15849,7 +16112,7 @@ var init_esm14 = __esm({
|
|
|
15849
16112
|
// ../../../packages/web/webcrypto/lib/esm/subtle.js
|
|
15850
16113
|
async function loadCrypto() {
|
|
15851
16114
|
if (_cryptoLoaded) return;
|
|
15852
|
-
const crypto = await Promise.resolve().then(() => (
|
|
16115
|
+
const crypto = await Promise.resolve().then(() => (init_esm15(), esm_exports6));
|
|
15853
16116
|
_createHash = crypto.createHash;
|
|
15854
16117
|
_createHmac = crypto.createHmac;
|
|
15855
16118
|
_createCipheriv = crypto.createCipheriv;
|
|
@@ -16424,7 +16687,7 @@ var init_subtle = __esm({
|
|
|
16424
16687
|
|
|
16425
16688
|
// ../../../packages/web/webcrypto/lib/esm/index.js
|
|
16426
16689
|
var _nativeCrypto, CryptoPolyfill, hasNativeSubtle, cryptoInstance, subtleInstance;
|
|
16427
|
-
var
|
|
16690
|
+
var init_esm16 = __esm({
|
|
16428
16691
|
"../../../packages/web/webcrypto/lib/esm/index.js"() {
|
|
16429
16692
|
init_console_gjs();
|
|
16430
16693
|
init_auto_globals_c74cce974f();
|
|
@@ -16472,7 +16735,7 @@ var init_register5 = __esm({
|
|
|
16472
16735
|
"../../../packages/web/webcrypto/lib/esm/register.js"() {
|
|
16473
16736
|
init_console_gjs();
|
|
16474
16737
|
init_auto_globals_c74cce974f();
|
|
16475
|
-
|
|
16738
|
+
init_esm16();
|
|
16476
16739
|
if (typeof globalThis.crypto === "undefined" || typeof globalThis.crypto.subtle === "undefined") {
|
|
16477
16740
|
globalThis.crypto = cryptoInstance;
|
|
16478
16741
|
}
|
|
@@ -17565,7 +17828,7 @@ __export(esm_exports7, {
|
|
|
17565
17828
|
win32: () => win32_exports
|
|
17566
17829
|
});
|
|
17567
17830
|
var resolve4, normalize3, isAbsolute3, join3, relative3, toNamespacedPath3, dirname3, basename3, extname3, format4, parse4, sep3, delimiter3, index_default8;
|
|
17568
|
-
var
|
|
17831
|
+
var init_esm17 = __esm({
|
|
17569
17832
|
"../../../packages/node/path/lib/esm/index.js"() {
|
|
17570
17833
|
init_console_gjs();
|
|
17571
17834
|
init_auto_globals_c74cce974f();
|
|
@@ -19071,7 +19334,7 @@ function decodeHex(buf) {
|
|
|
19071
19334
|
return result;
|
|
19072
19335
|
}
|
|
19073
19336
|
var StringDecoder, index_default9;
|
|
19074
|
-
var
|
|
19337
|
+
var init_esm18 = __esm({
|
|
19075
19338
|
"../../../packages/node/string_decoder/lib/esm/index.js"() {
|
|
19076
19339
|
init_console_gjs();
|
|
19077
19340
|
init_auto_globals_c74cce974f();
|
|
@@ -19176,7 +19439,7 @@ var require_internal = __commonJS({
|
|
|
19176
19439
|
}
|
|
19177
19440
|
InternalCodec.prototype.encoder = InternalEncoder;
|
|
19178
19441
|
InternalCodec.prototype.decoder = InternalDecoder;
|
|
19179
|
-
var StringDecoder3 = (
|
|
19442
|
+
var StringDecoder3 = (init_esm18(), __toCommonJS(esm_exports8)).StringDecoder;
|
|
19180
19443
|
function InternalDecoder(options, codec) {
|
|
19181
19444
|
this.decoder = new StringDecoder3(codec.enc);
|
|
19182
19445
|
}
|
|
@@ -22685,7 +22948,7 @@ var require_cjs_compat = __commonJS({
|
|
|
22685
22948
|
"../../../packages/node/stream/cjs-compat.cjs"(exports, module) {
|
|
22686
22949
|
init_console_gjs();
|
|
22687
22950
|
init_auto_globals_c74cce974f();
|
|
22688
|
-
var mod2 = (
|
|
22951
|
+
var mod2 = (init_esm12(), __toCommonJS(esm_exports4));
|
|
22689
22952
|
module.exports = mod2.default || mod2;
|
|
22690
22953
|
}
|
|
22691
22954
|
});
|
|
@@ -22891,7 +23154,7 @@ function createHook(_callbacks) {
|
|
|
22891
23154
|
};
|
|
22892
23155
|
}
|
|
22893
23156
|
var _id, AsyncResource, _allInstances, AsyncLocalStorage, index_default10;
|
|
22894
|
-
var
|
|
23157
|
+
var init_esm19 = __esm({
|
|
22895
23158
|
"../../../packages/node/async_hooks/lib/esm/index.js"() {
|
|
22896
23159
|
init_console_gjs();
|
|
22897
23160
|
init_auto_globals_c74cce974f();
|
|
@@ -23185,7 +23448,7 @@ var require_raw_body = __commonJS({
|
|
|
23185
23448
|
}
|
|
23186
23449
|
function tryRequireAsyncHooks() {
|
|
23187
23450
|
try {
|
|
23188
|
-
return
|
|
23451
|
+
return init_esm19(), __toCommonJS(esm_exports9);
|
|
23189
23452
|
} catch (e) {
|
|
23190
23453
|
return {};
|
|
23191
23454
|
}
|
|
@@ -23349,7 +23612,7 @@ var require_on_finished = __commonJS({
|
|
|
23349
23612
|
}
|
|
23350
23613
|
function tryRequireAsyncHooks() {
|
|
23351
23614
|
try {
|
|
23352
|
-
return
|
|
23615
|
+
return init_esm19(), __toCommonJS(esm_exports9);
|
|
23353
23616
|
} catch (e) {
|
|
23354
23617
|
return {};
|
|
23355
23618
|
}
|
|
@@ -32883,7 +33146,7 @@ var require_mime_types = __commonJS({
|
|
|
32883
33146
|
init_console_gjs();
|
|
32884
33147
|
init_auto_globals_c74cce974f();
|
|
32885
33148
|
var db = require_mime_db();
|
|
32886
|
-
var extname4 = (
|
|
33149
|
+
var extname4 = (init_esm17(), __toCommonJS(esm_exports7)).extname;
|
|
32887
33150
|
var mimeScore = require_mimeScore();
|
|
32888
33151
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
32889
33152
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
@@ -33215,7 +33478,7 @@ var require_read = __commonJS({
|
|
|
33215
33478
|
var getBody = require_raw_body();
|
|
33216
33479
|
var iconv = require_lib();
|
|
33217
33480
|
var onFinished = require_on_finished();
|
|
33218
|
-
var zlib = (
|
|
33481
|
+
var zlib = (init_esm13(), __toCommonJS(esm_exports5));
|
|
33219
33482
|
var hasBody = require_type_is().hasBody;
|
|
33220
33483
|
var { getCharset } = require_utils();
|
|
33221
33484
|
module.exports = read2;
|
|
@@ -34601,7 +34864,7 @@ function toUSVString(string) {
|
|
|
34601
34864
|
return string.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "\uFFFD");
|
|
34602
34865
|
}
|
|
34603
34866
|
var kCustomInspect, ANSI_REGEX, kCustomPromisify, TextDecoder2, TextEncoder2, index_default11;
|
|
34604
|
-
var
|
|
34867
|
+
var init_esm20 = __esm({
|
|
34605
34868
|
"../../../packages/node/util/lib/esm/index.js"() {
|
|
34606
34869
|
init_console_gjs();
|
|
34607
34870
|
init_auto_globals_c74cce974f();
|
|
@@ -34729,7 +34992,7 @@ var require_util_inspect = __commonJS({
|
|
|
34729
34992
|
"../../../node_modules/object-inspect/util.inspect.js"(exports, module) {
|
|
34730
34993
|
init_console_gjs();
|
|
34731
34994
|
init_auto_globals_c74cce974f();
|
|
34732
|
-
module.exports = (
|
|
34995
|
+
module.exports = (init_esm20(), __toCommonJS(esm_exports10)).inspect;
|
|
34733
34996
|
}
|
|
34734
34997
|
});
|
|
34735
34998
|
|
|
@@ -37813,7 +38076,7 @@ var require_parseurl = __commonJS({
|
|
|
37813
38076
|
"use strict";
|
|
37814
38077
|
init_console_gjs();
|
|
37815
38078
|
init_auto_globals_c74cce974f();
|
|
37816
|
-
var url = (
|
|
38079
|
+
var url = (init_esm8(), __toCommonJS(esm_exports3));
|
|
37817
38080
|
var parse6 = url.parse;
|
|
37818
38081
|
var Url = url.Url;
|
|
37819
38082
|
module.exports = parseurl;
|
|
@@ -38046,7 +38309,7 @@ var init_utils = __esm({
|
|
|
38046
38309
|
init_console_gjs();
|
|
38047
38310
|
init_auto_globals_c74cce974f();
|
|
38048
38311
|
init_sync();
|
|
38049
|
-
|
|
38312
|
+
init_esm8();
|
|
38050
38313
|
CHARS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
38051
38314
|
}
|
|
38052
38315
|
});
|
|
@@ -38273,7 +38536,7 @@ var init_read_stream = __esm({
|
|
|
38273
38536
|
init_gio_2();
|
|
38274
38537
|
init_glib_2();
|
|
38275
38538
|
init_esm4();
|
|
38276
|
-
|
|
38539
|
+
init_esm12();
|
|
38277
38540
|
init_utils();
|
|
38278
38541
|
ReadStream = class extends Readable {
|
|
38279
38542
|
bytesRead = 0;
|
|
@@ -38646,7 +38909,7 @@ var init_cp = __esm({
|
|
|
38646
38909
|
init_console_gjs();
|
|
38647
38910
|
init_auto_globals_c74cce974f();
|
|
38648
38911
|
init_gio_2();
|
|
38649
|
-
|
|
38912
|
+
init_esm17();
|
|
38650
38913
|
init_utils();
|
|
38651
38914
|
init_errors2();
|
|
38652
38915
|
}
|
|
@@ -38659,7 +38922,7 @@ var init_dirent = __esm({
|
|
|
38659
38922
|
init_console_gjs();
|
|
38660
38923
|
init_auto_globals_c74cce974f();
|
|
38661
38924
|
init_gio_2();
|
|
38662
|
-
|
|
38925
|
+
init_esm17();
|
|
38663
38926
|
S_IFMT = 61440;
|
|
38664
38927
|
S_IFSOCK = 49152;
|
|
38665
38928
|
S_IFBLK = 24576;
|
|
@@ -39461,7 +39724,7 @@ var init_stats = __esm({
|
|
|
39461
39724
|
init_auto_globals_c74cce974f();
|
|
39462
39725
|
init_gio_2();
|
|
39463
39726
|
init_dirent();
|
|
39464
|
-
|
|
39727
|
+
init_esm17();
|
|
39465
39728
|
STAT_ATTRIBUTES = "standard::*,time::*,unix::*";
|
|
39466
39729
|
Stats = class extends Dirent {
|
|
39467
39730
|
dev;
|
|
@@ -39969,7 +40232,7 @@ var init_promises = __esm({
|
|
|
39969
40232
|
init_auto_globals_c74cce974f();
|
|
39970
40233
|
init_gio_2();
|
|
39971
40234
|
init_glib_2();
|
|
39972
|
-
|
|
40235
|
+
init_esm17();
|
|
39973
40236
|
init_encoding3();
|
|
39974
40237
|
init_sync();
|
|
39975
40238
|
init_cp();
|
|
@@ -40382,7 +40645,7 @@ var init_write_stream = __esm({
|
|
|
40382
40645
|
"../../../packages/node/fs/lib/esm/write-stream.js"() {
|
|
40383
40646
|
init_console_gjs();
|
|
40384
40647
|
init_auto_globals_c74cce974f();
|
|
40385
|
-
|
|
40648
|
+
init_esm12();
|
|
40386
40649
|
init_callback();
|
|
40387
40650
|
init_utils();
|
|
40388
40651
|
kIsPerformingIO = /* @__PURE__ */ Symbol("kIsPerformingIO");
|
|
@@ -40494,18 +40757,353 @@ function createInterface(input, output, completer, terminal) {
|
|
|
40494
40757
|
}
|
|
40495
40758
|
return new Interface({ input, output, completer, terminal });
|
|
40496
40759
|
}
|
|
40497
|
-
|
|
40498
|
-
|
|
40760
|
+
function* emitKeys(stream) {
|
|
40761
|
+
while (true) {
|
|
40762
|
+
let ch = yield;
|
|
40763
|
+
let s = ch;
|
|
40764
|
+
let escaped = false;
|
|
40765
|
+
const key = { sequence: "", name: void 0, ctrl: false, meta: false, shift: false };
|
|
40766
|
+
if (ch === "\x1B") {
|
|
40767
|
+
escaped = true;
|
|
40768
|
+
s += ch = yield;
|
|
40769
|
+
if (ch === "\x1B") s += ch = yield;
|
|
40770
|
+
}
|
|
40771
|
+
if (escaped && (ch === "O" || ch === "[")) {
|
|
40772
|
+
let code = ch;
|
|
40773
|
+
let modifier = 0;
|
|
40774
|
+
if (ch === "O") {
|
|
40775
|
+
s += ch = yield;
|
|
40776
|
+
if (ch >= "0" && ch <= "9") {
|
|
40777
|
+
modifier = ch.charCodeAt(0) - 1;
|
|
40778
|
+
s += ch = yield;
|
|
40779
|
+
}
|
|
40780
|
+
code += ch;
|
|
40781
|
+
} else if (ch === "[") {
|
|
40782
|
+
s += ch = yield;
|
|
40783
|
+
if (ch === "[") {
|
|
40784
|
+
code += ch;
|
|
40785
|
+
s += ch = yield;
|
|
40786
|
+
}
|
|
40787
|
+
const cmdStart = s.length - 1;
|
|
40788
|
+
if (ch >= "0" && ch <= "9") {
|
|
40789
|
+
s += ch = yield;
|
|
40790
|
+
if (ch >= "0" && ch <= "9") {
|
|
40791
|
+
s += ch = yield;
|
|
40792
|
+
if (ch >= "0" && ch <= "9") s += ch = yield;
|
|
40793
|
+
}
|
|
40794
|
+
}
|
|
40795
|
+
if (ch === ";") {
|
|
40796
|
+
s += ch = yield;
|
|
40797
|
+
if (ch >= "0" && ch <= "9") s += yield;
|
|
40798
|
+
}
|
|
40799
|
+
const cmd = s.slice(cmdStart);
|
|
40800
|
+
let match;
|
|
40801
|
+
if (match = /^(?:(\d\d?)(?:;(\d))?([~^$])|(\d{3}~))$/.exec(cmd)) {
|
|
40802
|
+
if (match[4]) {
|
|
40803
|
+
code += match[4];
|
|
40804
|
+
} else {
|
|
40805
|
+
code += match[1] + match[3];
|
|
40806
|
+
modifier = (parseInt(match[2] ?? "1", 10) || 1) - 1;
|
|
40807
|
+
}
|
|
40808
|
+
} else if (match = /^((\d;)?(\d))?([A-Za-z])$/.exec(cmd)) {
|
|
40809
|
+
code += match[4];
|
|
40810
|
+
modifier = (parseInt(match[3] ?? "1", 10) || 1) - 1;
|
|
40811
|
+
} else {
|
|
40812
|
+
code += cmd;
|
|
40813
|
+
}
|
|
40814
|
+
}
|
|
40815
|
+
key.ctrl = !!(modifier & 4);
|
|
40816
|
+
key.meta = !!(modifier & 10);
|
|
40817
|
+
key.shift = !!(modifier & 1);
|
|
40818
|
+
key.code = code;
|
|
40819
|
+
switch (code) {
|
|
40820
|
+
case "[P":
|
|
40821
|
+
case "OP":
|
|
40822
|
+
case "[11~":
|
|
40823
|
+
case "[[A":
|
|
40824
|
+
key.name = "f1";
|
|
40825
|
+
break;
|
|
40826
|
+
case "[Q":
|
|
40827
|
+
case "OQ":
|
|
40828
|
+
case "[12~":
|
|
40829
|
+
case "[[B":
|
|
40830
|
+
key.name = "f2";
|
|
40831
|
+
break;
|
|
40832
|
+
case "[R":
|
|
40833
|
+
case "OR":
|
|
40834
|
+
case "[13~":
|
|
40835
|
+
case "[[C":
|
|
40836
|
+
key.name = "f3";
|
|
40837
|
+
break;
|
|
40838
|
+
case "[S":
|
|
40839
|
+
case "OS":
|
|
40840
|
+
case "[14~":
|
|
40841
|
+
case "[[D":
|
|
40842
|
+
key.name = "f4";
|
|
40843
|
+
break;
|
|
40844
|
+
case "[15~":
|
|
40845
|
+
case "[[E":
|
|
40846
|
+
key.name = "f5";
|
|
40847
|
+
break;
|
|
40848
|
+
case "[17~":
|
|
40849
|
+
key.name = "f6";
|
|
40850
|
+
break;
|
|
40851
|
+
case "[18~":
|
|
40852
|
+
key.name = "f7";
|
|
40853
|
+
break;
|
|
40854
|
+
case "[19~":
|
|
40855
|
+
key.name = "f8";
|
|
40856
|
+
break;
|
|
40857
|
+
case "[20~":
|
|
40858
|
+
key.name = "f9";
|
|
40859
|
+
break;
|
|
40860
|
+
case "[21~":
|
|
40861
|
+
key.name = "f10";
|
|
40862
|
+
break;
|
|
40863
|
+
case "[23~":
|
|
40864
|
+
key.name = "f11";
|
|
40865
|
+
break;
|
|
40866
|
+
case "[24~":
|
|
40867
|
+
key.name = "f12";
|
|
40868
|
+
break;
|
|
40869
|
+
case "[200~":
|
|
40870
|
+
key.name = "paste-start";
|
|
40871
|
+
break;
|
|
40872
|
+
case "[201~":
|
|
40873
|
+
key.name = "paste-end";
|
|
40874
|
+
break;
|
|
40875
|
+
case "[A":
|
|
40876
|
+
case "OA":
|
|
40877
|
+
key.name = "up";
|
|
40878
|
+
break;
|
|
40879
|
+
case "[B":
|
|
40880
|
+
case "OB":
|
|
40881
|
+
key.name = "down";
|
|
40882
|
+
break;
|
|
40883
|
+
case "[C":
|
|
40884
|
+
case "OC":
|
|
40885
|
+
key.name = "right";
|
|
40886
|
+
break;
|
|
40887
|
+
case "[D":
|
|
40888
|
+
case "OD":
|
|
40889
|
+
key.name = "left";
|
|
40890
|
+
break;
|
|
40891
|
+
case "[E":
|
|
40892
|
+
case "OE":
|
|
40893
|
+
key.name = "clear";
|
|
40894
|
+
break;
|
|
40895
|
+
case "[F":
|
|
40896
|
+
case "OF":
|
|
40897
|
+
key.name = "end";
|
|
40898
|
+
break;
|
|
40899
|
+
case "[H":
|
|
40900
|
+
case "OH":
|
|
40901
|
+
key.name = "home";
|
|
40902
|
+
break;
|
|
40903
|
+
case "[1~":
|
|
40904
|
+
key.name = "home";
|
|
40905
|
+
break;
|
|
40906
|
+
case "[2~":
|
|
40907
|
+
key.name = "insert";
|
|
40908
|
+
break;
|
|
40909
|
+
case "[3~":
|
|
40910
|
+
key.name = "delete";
|
|
40911
|
+
break;
|
|
40912
|
+
case "[4~":
|
|
40913
|
+
key.name = "end";
|
|
40914
|
+
break;
|
|
40915
|
+
case "[5~":
|
|
40916
|
+
case "[[5~":
|
|
40917
|
+
key.name = "pageup";
|
|
40918
|
+
break;
|
|
40919
|
+
case "[6~":
|
|
40920
|
+
case "[[6~":
|
|
40921
|
+
key.name = "pagedown";
|
|
40922
|
+
break;
|
|
40923
|
+
case "[7~":
|
|
40924
|
+
key.name = "home";
|
|
40925
|
+
break;
|
|
40926
|
+
case "[8~":
|
|
40927
|
+
key.name = "end";
|
|
40928
|
+
break;
|
|
40929
|
+
case "[a":
|
|
40930
|
+
key.name = "up";
|
|
40931
|
+
key.shift = true;
|
|
40932
|
+
break;
|
|
40933
|
+
case "[b":
|
|
40934
|
+
key.name = "down";
|
|
40935
|
+
key.shift = true;
|
|
40936
|
+
break;
|
|
40937
|
+
case "[c":
|
|
40938
|
+
key.name = "right";
|
|
40939
|
+
key.shift = true;
|
|
40940
|
+
break;
|
|
40941
|
+
case "[d":
|
|
40942
|
+
key.name = "left";
|
|
40943
|
+
key.shift = true;
|
|
40944
|
+
break;
|
|
40945
|
+
case "[2$":
|
|
40946
|
+
key.name = "insert";
|
|
40947
|
+
key.shift = true;
|
|
40948
|
+
break;
|
|
40949
|
+
case "[3$":
|
|
40950
|
+
key.name = "delete";
|
|
40951
|
+
key.shift = true;
|
|
40952
|
+
break;
|
|
40953
|
+
case "[5$":
|
|
40954
|
+
key.name = "pageup";
|
|
40955
|
+
key.shift = true;
|
|
40956
|
+
break;
|
|
40957
|
+
case "[6$":
|
|
40958
|
+
key.name = "pagedown";
|
|
40959
|
+
key.shift = true;
|
|
40960
|
+
break;
|
|
40961
|
+
case "[7$":
|
|
40962
|
+
key.name = "home";
|
|
40963
|
+
key.shift = true;
|
|
40964
|
+
break;
|
|
40965
|
+
case "[8$":
|
|
40966
|
+
key.name = "end";
|
|
40967
|
+
key.shift = true;
|
|
40968
|
+
break;
|
|
40969
|
+
case "Oa":
|
|
40970
|
+
key.name = "up";
|
|
40971
|
+
key.ctrl = true;
|
|
40972
|
+
break;
|
|
40973
|
+
case "Ob":
|
|
40974
|
+
key.name = "down";
|
|
40975
|
+
key.ctrl = true;
|
|
40976
|
+
break;
|
|
40977
|
+
case "Oc":
|
|
40978
|
+
key.name = "right";
|
|
40979
|
+
key.ctrl = true;
|
|
40980
|
+
break;
|
|
40981
|
+
case "Od":
|
|
40982
|
+
key.name = "left";
|
|
40983
|
+
key.ctrl = true;
|
|
40984
|
+
break;
|
|
40985
|
+
case "[2^":
|
|
40986
|
+
key.name = "insert";
|
|
40987
|
+
key.ctrl = true;
|
|
40988
|
+
break;
|
|
40989
|
+
case "[3^":
|
|
40990
|
+
key.name = "delete";
|
|
40991
|
+
key.ctrl = true;
|
|
40992
|
+
break;
|
|
40993
|
+
case "[5^":
|
|
40994
|
+
key.name = "pageup";
|
|
40995
|
+
key.ctrl = true;
|
|
40996
|
+
break;
|
|
40997
|
+
case "[6^":
|
|
40998
|
+
key.name = "pagedown";
|
|
40999
|
+
key.ctrl = true;
|
|
41000
|
+
break;
|
|
41001
|
+
case "[7^":
|
|
41002
|
+
key.name = "home";
|
|
41003
|
+
key.ctrl = true;
|
|
41004
|
+
break;
|
|
41005
|
+
case "[8^":
|
|
41006
|
+
key.name = "end";
|
|
41007
|
+
key.ctrl = true;
|
|
41008
|
+
break;
|
|
41009
|
+
case "[Z":
|
|
41010
|
+
key.name = "tab";
|
|
41011
|
+
key.shift = true;
|
|
41012
|
+
break;
|
|
41013
|
+
default:
|
|
41014
|
+
key.name = "undefined";
|
|
41015
|
+
break;
|
|
41016
|
+
}
|
|
41017
|
+
} else if (ch === "\r") {
|
|
41018
|
+
key.name = "return";
|
|
41019
|
+
key.meta = escaped;
|
|
41020
|
+
} else if (ch === "\n") {
|
|
41021
|
+
key.name = "enter";
|
|
41022
|
+
key.meta = escaped;
|
|
41023
|
+
} else if (ch === " ") {
|
|
41024
|
+
key.name = "tab";
|
|
41025
|
+
key.meta = escaped;
|
|
41026
|
+
} else if (ch === "\b" || ch === "\x7F") {
|
|
41027
|
+
key.name = "backspace";
|
|
41028
|
+
key.meta = escaped;
|
|
41029
|
+
} else if (ch === "\x1B") {
|
|
41030
|
+
key.name = "escape";
|
|
41031
|
+
key.meta = escaped;
|
|
41032
|
+
} else if (ch === " ") {
|
|
41033
|
+
key.name = "space";
|
|
41034
|
+
key.meta = escaped;
|
|
41035
|
+
} else if (!escaped && ch <= "") {
|
|
41036
|
+
key.name = String.fromCharCode(ch.charCodeAt(0) + "a".charCodeAt(0) - 1);
|
|
41037
|
+
key.ctrl = true;
|
|
41038
|
+
} else if (/^[0-9A-Za-z]$/.test(ch)) {
|
|
41039
|
+
key.name = ch.toLowerCase();
|
|
41040
|
+
key.shift = /^[A-Z]$/.test(ch);
|
|
41041
|
+
key.meta = escaped;
|
|
41042
|
+
} else if (escaped) {
|
|
41043
|
+
key.name = ch.length ? void 0 : "escape";
|
|
41044
|
+
key.meta = true;
|
|
41045
|
+
}
|
|
41046
|
+
key.sequence = s;
|
|
41047
|
+
if (s.length !== 0 && (key.name !== void 0 || escaped)) {
|
|
41048
|
+
stream.emit("keypress", escaped ? void 0 : s, key);
|
|
41049
|
+
} else if (s.length === 1) {
|
|
41050
|
+
stream.emit("keypress", s, key);
|
|
41051
|
+
}
|
|
41052
|
+
}
|
|
41053
|
+
}
|
|
41054
|
+
function emitKeypressEvents(stream, iface = {}) {
|
|
41055
|
+
if (stream[_KEYPRESS_DECODER]) return;
|
|
41056
|
+
stream[_KEYPRESS_DECODER] = new StringDecoder("utf8");
|
|
41057
|
+
stream[_ESCAPE_DECODER] = emitKeys(stream);
|
|
41058
|
+
stream[_ESCAPE_DECODER].next();
|
|
41059
|
+
const escTimeout = iface.escapeCodeTimeout ?? ESCAPE_CODE_TIMEOUT;
|
|
41060
|
+
let timeoutId;
|
|
41061
|
+
const triggerEscape = () => stream[_ESCAPE_DECODER].next("");
|
|
41062
|
+
function onData(input) {
|
|
41063
|
+
if (stream.listenerCount("keypress") > 0) {
|
|
41064
|
+
const str = stream[_KEYPRESS_DECODER].write(
|
|
41065
|
+
typeof input === "string" ? Buffer.from(input) : input
|
|
41066
|
+
);
|
|
41067
|
+
if (str) {
|
|
41068
|
+
clearTimeout(timeoutId);
|
|
41069
|
+
for (const ch of str) {
|
|
41070
|
+
try {
|
|
41071
|
+
stream[_ESCAPE_DECODER].next(ch);
|
|
41072
|
+
if (ch === "\x1B") timeoutId = setTimeout(triggerEscape, escTimeout);
|
|
41073
|
+
} catch {
|
|
41074
|
+
stream[_ESCAPE_DECODER] = emitKeys(stream);
|
|
41075
|
+
stream[_ESCAPE_DECODER].next();
|
|
41076
|
+
}
|
|
41077
|
+
}
|
|
41078
|
+
}
|
|
41079
|
+
} else {
|
|
41080
|
+
stream.removeListener("data", onData);
|
|
41081
|
+
delete stream[_KEYPRESS_DECODER];
|
|
41082
|
+
delete stream[_ESCAPE_DECODER];
|
|
41083
|
+
}
|
|
41084
|
+
}
|
|
41085
|
+
stream.on("data", onData);
|
|
41086
|
+
}
|
|
41087
|
+
var LINE_END, Interface, ESCAPE_CODE_TIMEOUT, _KEYPRESS_DECODER, _ESCAPE_DECODER;
|
|
41088
|
+
var init_esm21 = __esm({
|
|
40499
41089
|
"../../../packages/node/readline/lib/esm/index.js"() {
|
|
40500
41090
|
init_console_gjs();
|
|
40501
41091
|
init_auto_globals_c74cce974f();
|
|
40502
41092
|
init_esm5();
|
|
41093
|
+
init_esm18();
|
|
41094
|
+
LINE_END = /\r\n|\r|\n/;
|
|
40503
41095
|
Interface = class extends EventEmitter2 {
|
|
40504
41096
|
terminal;
|
|
40505
41097
|
line = "";
|
|
40506
41098
|
cursor = 0;
|
|
40507
41099
|
_input;
|
|
40508
41100
|
_output;
|
|
41101
|
+
get input() {
|
|
41102
|
+
return this._input;
|
|
41103
|
+
}
|
|
41104
|
+
get output() {
|
|
41105
|
+
return this._output;
|
|
41106
|
+
}
|
|
40509
41107
|
_prompt;
|
|
40510
41108
|
_closed = false;
|
|
40511
41109
|
_paused = false;
|
|
@@ -40514,6 +41112,12 @@ var init_esm20 = __esm({
|
|
|
40514
41112
|
_crlfDelay;
|
|
40515
41113
|
_lineBuffer = "";
|
|
40516
41114
|
_questionCallback = null;
|
|
41115
|
+
// Per-listener refs so close() removes only our listeners, not the keypress
|
|
41116
|
+
// parser's 'data' listener — which must survive across sequential prompts.
|
|
41117
|
+
_boundOnData = null;
|
|
41118
|
+
_boundOnEnd = null;
|
|
41119
|
+
_boundOnError = null;
|
|
41120
|
+
_boundOnKeypress = null;
|
|
40517
41121
|
constructor(input, output) {
|
|
40518
41122
|
super();
|
|
40519
41123
|
let opts;
|
|
@@ -40530,21 +41134,45 @@ var init_esm20 = __esm({
|
|
|
40530
41134
|
this.history = [];
|
|
40531
41135
|
this._crlfDelay = opts.crlfDelay ?? 100;
|
|
40532
41136
|
if (this._input) {
|
|
40533
|
-
this.
|
|
40534
|
-
this.
|
|
40535
|
-
this.
|
|
41137
|
+
this._boundOnData = (chunk) => this._onData(chunk);
|
|
41138
|
+
this._boundOnEnd = () => this._onEnd();
|
|
41139
|
+
this._boundOnError = (err) => this.emit("error", err);
|
|
41140
|
+
this._input.on("data", this._boundOnData);
|
|
41141
|
+
this._input.on("end", this._boundOnEnd);
|
|
41142
|
+
this._input.on("error", this._boundOnError);
|
|
40536
41143
|
if ("setEncoding" in this._input && typeof this._input.setEncoding === "function") {
|
|
40537
41144
|
this._input.setEncoding("utf8");
|
|
40538
41145
|
}
|
|
41146
|
+
if (this.terminal) {
|
|
41147
|
+
emitKeypressEvents(this._input, this);
|
|
41148
|
+
if ("setRawMode" in this._input && typeof this._input.setRawMode === "function") {
|
|
41149
|
+
if (!this._input.isRaw) this._input.setRawMode(true);
|
|
41150
|
+
}
|
|
41151
|
+
if ("resume" in this._input && typeof this._input.resume === "function") {
|
|
41152
|
+
this._input.resume();
|
|
41153
|
+
}
|
|
41154
|
+
this._boundOnKeypress = (str, key) => {
|
|
41155
|
+
if (!key) return;
|
|
41156
|
+
if (key.name === "backspace" || key.name === "delete") {
|
|
41157
|
+
if (this.cursor > 0) {
|
|
41158
|
+
this.line = this.line.slice(0, this.cursor - 1) + this.line.slice(this.cursor);
|
|
41159
|
+
this.cursor--;
|
|
41160
|
+
}
|
|
41161
|
+
} else if (str && str.length === 1 && !key.ctrl && !key.meta && key.name !== "return" && key.name !== "enter" && key.name !== "escape") {
|
|
41162
|
+
this.line = this.line.slice(0, this.cursor) + str + this.line.slice(this.cursor);
|
|
41163
|
+
this.cursor++;
|
|
41164
|
+
}
|
|
41165
|
+
};
|
|
41166
|
+
this._input.on("keypress", this._boundOnKeypress);
|
|
41167
|
+
}
|
|
40539
41168
|
}
|
|
40540
41169
|
}
|
|
40541
41170
|
_onData(chunk) {
|
|
40542
41171
|
if (this._closed || this._paused) return;
|
|
40543
41172
|
const str = typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
40544
41173
|
this._lineBuffer += str;
|
|
40545
|
-
const lineEnd = /\r\n|\r|\n/;
|
|
40546
41174
|
let m;
|
|
40547
|
-
while ((m =
|
|
41175
|
+
while ((m = LINE_END.exec(this._lineBuffer)) !== null) {
|
|
40548
41176
|
const line = this._lineBuffer.substring(0, m.index);
|
|
40549
41177
|
this._lineBuffer = this._lineBuffer.substring(m.index + m[0].length);
|
|
40550
41178
|
this._onLine(line);
|
|
@@ -40554,9 +41182,7 @@ var init_esm20 = __esm({
|
|
|
40554
41182
|
if (line.length > 0 && this._historySize > 0) {
|
|
40555
41183
|
if (this.history.length === 0 || this.history[0] !== line) {
|
|
40556
41184
|
this.history.unshift(line);
|
|
40557
|
-
if (this.history.length > this._historySize)
|
|
40558
|
-
this.history.pop();
|
|
40559
|
-
}
|
|
41185
|
+
if (this.history.length > this._historySize) this.history.pop();
|
|
40560
41186
|
}
|
|
40561
41187
|
}
|
|
40562
41188
|
if (this._questionCallback) {
|
|
@@ -40573,53 +41199,64 @@ var init_esm20 = __esm({
|
|
|
40573
41199
|
}
|
|
40574
41200
|
this.close();
|
|
40575
41201
|
}
|
|
40576
|
-
/** Set the prompt string. */
|
|
40577
41202
|
setPrompt(prompt) {
|
|
40578
41203
|
this._prompt = prompt;
|
|
40579
41204
|
}
|
|
40580
|
-
/** Get the current prompt string. */
|
|
40581
41205
|
getPrompt() {
|
|
40582
41206
|
return this._prompt;
|
|
40583
41207
|
}
|
|
40584
|
-
|
|
40585
|
-
|
|
40586
|
-
|
|
40587
|
-
throw new Error("readline was closed");
|
|
40588
|
-
}
|
|
40589
|
-
if (this._output) {
|
|
40590
|
-
this._output.write(this._prompt);
|
|
40591
|
-
}
|
|
41208
|
+
prompt(_preserveCursor) {
|
|
41209
|
+
if (this._closed) throw new Error("readline was closed");
|
|
41210
|
+
this._output?.write(this._prompt);
|
|
40592
41211
|
}
|
|
40593
41212
|
question(query, optionsOrCallback, callback) {
|
|
40594
|
-
if (this._closed)
|
|
40595
|
-
throw new Error("readline was closed");
|
|
40596
|
-
}
|
|
41213
|
+
if (this._closed) throw new Error("readline was closed");
|
|
40597
41214
|
const cb = typeof optionsOrCallback === "function" ? optionsOrCallback : callback;
|
|
40598
41215
|
this._questionCallback = cb;
|
|
40599
|
-
|
|
40600
|
-
|
|
40601
|
-
|
|
41216
|
+
this._output?.write(query);
|
|
41217
|
+
}
|
|
41218
|
+
clearLine(_dir, callback) {
|
|
41219
|
+
this.line = "";
|
|
41220
|
+
this.cursor = 0;
|
|
41221
|
+
if (callback) callback();
|
|
41222
|
+
return true;
|
|
40602
41223
|
}
|
|
40603
|
-
/** Write data to the output stream. */
|
|
40604
41224
|
write(data, key) {
|
|
40605
41225
|
if (this._closed) return;
|
|
41226
|
+
if (key) {
|
|
41227
|
+
if (this._input) this._input.emit("keypress", data ?? "", key);
|
|
41228
|
+
return;
|
|
41229
|
+
}
|
|
40606
41230
|
if (data !== null && data !== void 0) {
|
|
40607
|
-
|
|
40608
|
-
|
|
41231
|
+
const str = typeof data === "string" ? data : data.toString("utf8");
|
|
41232
|
+
if (str) {
|
|
41233
|
+
this.line = this.line.slice(0, this.cursor) + str + this.line.slice(this.cursor);
|
|
41234
|
+
this.cursor += str.length;
|
|
40609
41235
|
}
|
|
41236
|
+
this._output?.write(data);
|
|
40610
41237
|
}
|
|
40611
41238
|
}
|
|
40612
|
-
/** Close the interface. */
|
|
40613
41239
|
close() {
|
|
40614
41240
|
if (this._closed) return;
|
|
40615
41241
|
this._closed = true;
|
|
40616
41242
|
if (this._input) {
|
|
40617
|
-
this._input.
|
|
40618
|
-
this._input.
|
|
41243
|
+
if (this._boundOnData) this._input.removeListener("data", this._boundOnData);
|
|
41244
|
+
if (this._boundOnEnd) this._input.removeListener("end", this._boundOnEnd);
|
|
41245
|
+
if (this._boundOnError) this._input.removeListener("error", this._boundOnError);
|
|
41246
|
+
if (this._boundOnKeypress) this._input.removeListener("keypress", this._boundOnKeypress);
|
|
41247
|
+
this._boundOnData = null;
|
|
41248
|
+
this._boundOnEnd = null;
|
|
41249
|
+
this._boundOnError = null;
|
|
41250
|
+
this._boundOnKeypress = null;
|
|
41251
|
+
if (this.terminal && this._input.isRaw && "setRawMode" in this._input && typeof this._input.setRawMode === "function") {
|
|
41252
|
+
this._input.setRawMode(false);
|
|
41253
|
+
}
|
|
41254
|
+
if ("pause" in this._input && typeof this._input.pause === "function") {
|
|
41255
|
+
this._input.pause();
|
|
41256
|
+
}
|
|
40619
41257
|
}
|
|
40620
41258
|
this.emit("close");
|
|
40621
41259
|
}
|
|
40622
|
-
/** Pause the input stream. */
|
|
40623
41260
|
pause() {
|
|
40624
41261
|
if (this._closed) return this;
|
|
40625
41262
|
this._paused = true;
|
|
@@ -40629,7 +41266,6 @@ var init_esm20 = __esm({
|
|
|
40629
41266
|
this.emit("pause");
|
|
40630
41267
|
return this;
|
|
40631
41268
|
}
|
|
40632
|
-
/** Resume the input stream. */
|
|
40633
41269
|
resume() {
|
|
40634
41270
|
if (this._closed) return this;
|
|
40635
41271
|
this._paused = false;
|
|
@@ -40639,15 +41275,16 @@ var init_esm20 = __esm({
|
|
|
40639
41275
|
this.emit("resume");
|
|
40640
41276
|
return this;
|
|
40641
41277
|
}
|
|
40642
|
-
/** Get the current line content. */
|
|
40643
41278
|
getCursorPos() {
|
|
40644
|
-
|
|
41279
|
+
const columns = this._output?.columns ?? 80;
|
|
41280
|
+
const len = this._prompt.length + this.cursor;
|
|
41281
|
+
return { rows: Math.floor(len / columns), cols: len % columns };
|
|
40645
41282
|
}
|
|
40646
41283
|
[Symbol.asyncIterator]() {
|
|
40647
41284
|
const lines = [];
|
|
40648
41285
|
let resolve5 = null;
|
|
40649
41286
|
let done = false;
|
|
40650
|
-
|
|
41287
|
+
const onLine = (line) => {
|
|
40651
41288
|
if (resolve5) {
|
|
40652
41289
|
const r = resolve5;
|
|
40653
41290
|
resolve5 = null;
|
|
@@ -40655,29 +41292,29 @@ var init_esm20 = __esm({
|
|
|
40655
41292
|
} else {
|
|
40656
41293
|
lines.push(line);
|
|
40657
41294
|
}
|
|
40658
|
-
}
|
|
40659
|
-
|
|
41295
|
+
};
|
|
41296
|
+
const onClose = () => {
|
|
40660
41297
|
done = true;
|
|
40661
41298
|
if (resolve5) {
|
|
40662
41299
|
const r = resolve5;
|
|
40663
41300
|
resolve5 = null;
|
|
40664
41301
|
r({ value: void 0, done: true });
|
|
40665
41302
|
}
|
|
40666
|
-
}
|
|
41303
|
+
};
|
|
41304
|
+
this.on("line", onLine);
|
|
41305
|
+
this.on("close", onClose);
|
|
40667
41306
|
return {
|
|
40668
|
-
next() {
|
|
40669
|
-
if (lines.length > 0) {
|
|
40670
|
-
|
|
40671
|
-
}
|
|
40672
|
-
if (done) {
|
|
40673
|
-
return Promise.resolve({ value: void 0, done: true });
|
|
40674
|
-
}
|
|
41307
|
+
next: () => {
|
|
41308
|
+
if (lines.length > 0) return Promise.resolve({ value: lines.shift(), done: false });
|
|
41309
|
+
if (done) return Promise.resolve({ value: void 0, done: true });
|
|
40675
41310
|
return new Promise((r) => {
|
|
40676
41311
|
resolve5 = r;
|
|
40677
41312
|
});
|
|
40678
41313
|
},
|
|
40679
|
-
return() {
|
|
41314
|
+
return: () => {
|
|
40680
41315
|
done = true;
|
|
41316
|
+
this.removeListener("line", onLine);
|
|
41317
|
+
this.removeListener("close", onClose);
|
|
40681
41318
|
return Promise.resolve({ value: void 0, done: true });
|
|
40682
41319
|
},
|
|
40683
41320
|
[Symbol.asyncIterator]() {
|
|
@@ -40686,6 +41323,9 @@ var init_esm20 = __esm({
|
|
|
40686
41323
|
};
|
|
40687
41324
|
}
|
|
40688
41325
|
};
|
|
41326
|
+
ESCAPE_CODE_TIMEOUT = 500;
|
|
41327
|
+
_KEYPRESS_DECODER = /* @__PURE__ */ Symbol("keypress-decoder");
|
|
41328
|
+
_ESCAPE_DECODER = /* @__PURE__ */ Symbol("escape-decoder");
|
|
40689
41329
|
}
|
|
40690
41330
|
});
|
|
40691
41331
|
|
|
@@ -40746,7 +41386,7 @@ var init_file_handle = __esm({
|
|
|
40746
41386
|
init_sync();
|
|
40747
41387
|
init_glib_2();
|
|
40748
41388
|
init_gio_2();
|
|
40749
|
-
|
|
41389
|
+
init_esm21();
|
|
40750
41390
|
init_esm4();
|
|
40751
41391
|
O_WRONLY = 1;
|
|
40752
41392
|
O_RDWR = 2;
|
|
@@ -41729,7 +42369,7 @@ var init_sync = __esm({
|
|
|
41729
42369
|
init_gio_2();
|
|
41730
42370
|
init_esm();
|
|
41731
42371
|
init_esm4();
|
|
41732
|
-
|
|
42372
|
+
init_esm17();
|
|
41733
42373
|
init_fs_watcher();
|
|
41734
42374
|
init_encoding3();
|
|
41735
42375
|
init_file_handle();
|
|
@@ -41974,7 +42614,7 @@ __export(esm_exports11, {
|
|
|
41974
42614
|
writevSync: () => writevSync
|
|
41975
42615
|
});
|
|
41976
42616
|
var constants4, index_default12;
|
|
41977
|
-
var
|
|
42617
|
+
var init_esm22 = __esm({
|
|
41978
42618
|
"../../../packages/node/fs/lib/esm/index.js"() {
|
|
41979
42619
|
init_console_gjs();
|
|
41980
42620
|
init_auto_globals_c74cce974f();
|
|
@@ -42151,8 +42791,8 @@ var require_view = __commonJS({
|
|
|
42151
42791
|
init_console_gjs();
|
|
42152
42792
|
init_auto_globals_c74cce974f();
|
|
42153
42793
|
var debug2 = require_browser()("express:view");
|
|
42154
|
-
var path = (
|
|
42155
|
-
var fs = (
|
|
42794
|
+
var path = (init_esm17(), __toCommonJS(esm_exports7));
|
|
42795
|
+
var fs = (init_esm22(), __toCommonJS(esm_exports11));
|
|
42156
42796
|
var dirname4 = path.dirname;
|
|
42157
42797
|
var basename4 = path.basename;
|
|
42158
42798
|
var extname4 = path.extname;
|
|
@@ -42356,7 +42996,7 @@ var init_incoming_message = __esm({
|
|
|
42356
42996
|
"../../../packages/node/http/lib/esm/incoming-message.js"() {
|
|
42357
42997
|
init_console_gjs();
|
|
42358
42998
|
init_auto_globals_c74cce974f();
|
|
42359
|
-
|
|
42999
|
+
init_esm12();
|
|
42360
43000
|
init_esm4();
|
|
42361
43001
|
IncomingMessage = class extends Readable {
|
|
42362
43002
|
httpVersion = "1.1";
|
|
@@ -42430,7 +43070,7 @@ var init_socket = __esm({
|
|
|
42430
43070
|
init_auto_globals_c74cce974f();
|
|
42431
43071
|
init_gio_2();
|
|
42432
43072
|
init_glib_2();
|
|
42433
|
-
|
|
43073
|
+
init_esm12();
|
|
42434
43074
|
init_esm4();
|
|
42435
43075
|
init_esm();
|
|
42436
43076
|
Socket = class extends Duplex {
|
|
@@ -42813,7 +43453,7 @@ var init_socket = __esm({
|
|
|
42813
43453
|
// ../../../packages/node/http-soup-bridge/lib/esm/index.js
|
|
42814
43454
|
import GjsifyHttpSoupBridge from "gi://GjsifyHttpSoupBridge?version=1.0";
|
|
42815
43455
|
var Server, Request, Response;
|
|
42816
|
-
var
|
|
43456
|
+
var init_esm23 = __esm({
|
|
42817
43457
|
"../../../packages/node/http-soup-bridge/lib/esm/index.js"() {
|
|
42818
43458
|
init_console_gjs();
|
|
42819
43459
|
init_auto_globals_c74cce974f();
|
|
@@ -42829,7 +43469,7 @@ var init_server_request_socket = __esm({
|
|
|
42829
43469
|
"../../../packages/node/http/lib/esm/server-request-socket.js"() {
|
|
42830
43470
|
init_console_gjs();
|
|
42831
43471
|
init_auto_globals_c74cce974f();
|
|
42832
|
-
|
|
43472
|
+
init_esm12();
|
|
42833
43473
|
ServerRequestSocket = class extends Duplex {
|
|
42834
43474
|
remoteAddress;
|
|
42835
43475
|
remotePort;
|
|
@@ -42907,10 +43547,10 @@ var init_server = __esm({
|
|
|
42907
43547
|
init_console_gjs();
|
|
42908
43548
|
init_auto_globals_c74cce974f();
|
|
42909
43549
|
init_esm5();
|
|
42910
|
-
|
|
43550
|
+
init_esm12();
|
|
42911
43551
|
init_esm4();
|
|
42912
43552
|
init_socket();
|
|
42913
|
-
|
|
43553
|
+
init_esm23();
|
|
42914
43554
|
init_server_request_socket();
|
|
42915
43555
|
init_esm();
|
|
42916
43556
|
init_constants3();
|
|
@@ -43314,7 +43954,7 @@ var init_client_request = __esm({
|
|
|
43314
43954
|
init_soup_3();
|
|
43315
43955
|
init_gio_2();
|
|
43316
43956
|
init_esm4();
|
|
43317
|
-
|
|
43957
|
+
init_esm8();
|
|
43318
43958
|
init_esm();
|
|
43319
43959
|
init_server();
|
|
43320
43960
|
init_incoming_message();
|
|
@@ -43605,7 +44245,7 @@ function get(url, options, callback) {
|
|
|
43605
44245
|
function setMaxIdleHTTPParsers(_max) {
|
|
43606
44246
|
}
|
|
43607
44247
|
var Agent, globalAgent, maxHeaderSize, index_default13;
|
|
43608
|
-
var
|
|
44248
|
+
var init_esm24 = __esm({
|
|
43609
44249
|
"../../../packages/node/http/lib/esm/index.js"() {
|
|
43610
44250
|
init_console_gjs();
|
|
43611
44251
|
init_auto_globals_c74cce974f();
|
|
@@ -43616,7 +44256,7 @@ var init_esm23 = __esm({
|
|
|
43616
44256
|
init_incoming_message();
|
|
43617
44257
|
init_server();
|
|
43618
44258
|
init_client_request();
|
|
43619
|
-
|
|
44259
|
+
init_esm8();
|
|
43620
44260
|
init_constants3();
|
|
43621
44261
|
Agent = class {
|
|
43622
44262
|
defaultPort = 80;
|
|
@@ -43683,8 +44323,8 @@ var require_etag = __commonJS({
|
|
|
43683
44323
|
init_console_gjs();
|
|
43684
44324
|
init_auto_globals_c74cce974f();
|
|
43685
44325
|
module.exports = etag;
|
|
43686
|
-
var crypto = (
|
|
43687
|
-
var Stats2 = (
|
|
44326
|
+
var crypto = (init_esm15(), __toCommonJS(esm_exports6));
|
|
44327
|
+
var Stats2 = (init_esm22(), __toCommonJS(esm_exports11)).Stats;
|
|
43688
44328
|
var toString2 = Object.prototype.toString;
|
|
43689
44329
|
function entitytag(entity) {
|
|
43690
44330
|
if (entity.length === 0) {
|
|
@@ -44922,7 +45562,7 @@ function qsUnescape(s) {
|
|
|
44922
45562
|
}
|
|
44923
45563
|
}
|
|
44924
45564
|
var hexTable, ERR_INVALID_URI, decode2, encode, escape2, isHexTable, noEscape, unhexTable, unescape2, index_default14;
|
|
44925
|
-
var
|
|
45565
|
+
var init_esm25 = __esm({
|
|
44926
45566
|
"../../../packages/node/querystring/lib/esm/index.js"() {
|
|
44927
45567
|
init_console_gjs();
|
|
44928
45568
|
init_auto_globals_c74cce974f();
|
|
@@ -45633,13 +46273,13 @@ var require_utils3 = __commonJS({
|
|
|
45633
46273
|
"use strict";
|
|
45634
46274
|
init_console_gjs();
|
|
45635
46275
|
init_auto_globals_c74cce974f();
|
|
45636
|
-
var { METHODS: METHODS2 } = (
|
|
46276
|
+
var { METHODS: METHODS2 } = (init_esm24(), __toCommonJS(esm_exports12));
|
|
45637
46277
|
var contentType = require_content_type();
|
|
45638
46278
|
var etag = require_etag();
|
|
45639
46279
|
var mime = require_mime_types();
|
|
45640
46280
|
var proxyaddr = require_proxy_addr();
|
|
45641
46281
|
var qs = require_lib2();
|
|
45642
|
-
var querystring = (
|
|
46282
|
+
var querystring = (init_esm25(), __toCommonJS(esm_exports13));
|
|
45643
46283
|
var { Buffer: Buffer3 } = (init_esm4(), __toCommonJS(esm_exports));
|
|
45644
46284
|
exports.methods = METHODS2.map((method) => method.toLowerCase());
|
|
45645
46285
|
exports.etag = createETagGenerator({ weak: false });
|
|
@@ -46366,7 +47006,7 @@ var require_route = __commonJS({
|
|
|
46366
47006
|
init_auto_globals_c74cce974f();
|
|
46367
47007
|
var debug2 = require_browser()("router:route");
|
|
46368
47008
|
var Layer = require_layer();
|
|
46369
|
-
var { METHODS: METHODS2 } = (
|
|
47009
|
+
var { METHODS: METHODS2 } = (init_esm24(), __toCommonJS(esm_exports12));
|
|
46370
47010
|
var slice = Array.prototype.slice;
|
|
46371
47011
|
var flatten = Array.prototype.flat;
|
|
46372
47012
|
var methods = METHODS2.map((method) => method.toLowerCase());
|
|
@@ -46488,7 +47128,7 @@ var require_router = __commonJS({
|
|
|
46488
47128
|
init_auto_globals_c74cce974f();
|
|
46489
47129
|
var isPromise3 = (init_is_promise(), __toCommonJS(is_promise_exports));
|
|
46490
47130
|
var Layer = require_layer();
|
|
46491
|
-
var { METHODS: METHODS2 } = (
|
|
47131
|
+
var { METHODS: METHODS2 } = (init_esm24(), __toCommonJS(esm_exports12));
|
|
46492
47132
|
var parseUrl = require_parseurl();
|
|
46493
47133
|
var Route = require_route();
|
|
46494
47134
|
var debug2 = require_browser()("router");
|
|
@@ -46889,12 +47529,12 @@ var require_application = __commonJS({
|
|
|
46889
47529
|
var finalhandler = require_finalhandler();
|
|
46890
47530
|
var debug2 = require_browser()("express:application");
|
|
46891
47531
|
var View = require_view();
|
|
46892
|
-
var http = (
|
|
47532
|
+
var http = (init_esm24(), __toCommonJS(esm_exports12));
|
|
46893
47533
|
var methods = require_utils3().methods;
|
|
46894
47534
|
var compileETag = require_utils3().compileETag;
|
|
46895
47535
|
var compileQueryParser = require_utils3().compileQueryParser;
|
|
46896
47536
|
var compileTrust = require_utils3().compileTrust;
|
|
46897
|
-
var resolve5 = (
|
|
47537
|
+
var resolve5 = (init_esm17(), __toCommonJS(esm_exports7)).resolve;
|
|
46898
47538
|
var once2 = require_once();
|
|
46899
47539
|
var Router = require_router();
|
|
46900
47540
|
var slice = Array.prototype.slice;
|
|
@@ -47930,7 +48570,7 @@ function createServer2(optionsOrListener, connectionListener) {
|
|
|
47930
48570
|
return new Server3(optionsOrListener, connectionListener);
|
|
47931
48571
|
}
|
|
47932
48572
|
var connect, index_default15;
|
|
47933
|
-
var
|
|
48573
|
+
var init_esm26 = __esm({
|
|
47934
48574
|
"../../../packages/node/net/lib/esm/index.js"() {
|
|
47935
48575
|
init_console_gjs();
|
|
47936
48576
|
init_auto_globals_c74cce974f();
|
|
@@ -48117,9 +48757,9 @@ var require_request = __commonJS({
|
|
|
48117
48757
|
init_console_gjs();
|
|
48118
48758
|
init_auto_globals_c74cce974f();
|
|
48119
48759
|
var accepts = require_accepts();
|
|
48120
|
-
var isIP2 = (
|
|
48760
|
+
var isIP2 = (init_esm26(), __toCommonJS(esm_exports14)).isIP;
|
|
48121
48761
|
var typeis = require_type_is();
|
|
48122
|
-
var http = (
|
|
48762
|
+
var http = (init_esm24(), __toCommonJS(esm_exports12));
|
|
48123
48763
|
var fresh = require_fresh();
|
|
48124
48764
|
var parseRange = require_range_parser();
|
|
48125
48765
|
var parse6 = require_parseurl();
|
|
@@ -48268,7 +48908,7 @@ var require_content_disposition = __commonJS({
|
|
|
48268
48908
|
init_auto_globals_c74cce974f();
|
|
48269
48909
|
module.exports = contentDisposition;
|
|
48270
48910
|
module.exports.parse = parse6;
|
|
48271
|
-
var basename4 = (
|
|
48911
|
+
var basename4 = (init_esm17(), __toCommonJS(esm_exports7)).basename;
|
|
48272
48912
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
48273
48913
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
48274
48914
|
var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
|
|
@@ -48430,7 +49070,7 @@ var require_cookie_signature = __commonJS({
|
|
|
48430
49070
|
"../../../node_modules/cookie-signature/index.js"(exports) {
|
|
48431
49071
|
init_console_gjs();
|
|
48432
49072
|
init_auto_globals_c74cce974f();
|
|
48433
|
-
var crypto = (
|
|
49073
|
+
var crypto = (init_esm15(), __toCommonJS(esm_exports6));
|
|
48434
49074
|
exports.sign = function(val, secret) {
|
|
48435
49075
|
if ("string" != typeof val) throw new TypeError("Cookie value must be provided as a string.");
|
|
48436
49076
|
if (null == secret) throw new TypeError("Secret key must be provided.");
|
|
@@ -48625,15 +49265,15 @@ var require_send = __commonJS({
|
|
|
48625
49265
|
var escapeHtml2 = require_escape_html();
|
|
48626
49266
|
var etag = require_etag();
|
|
48627
49267
|
var fresh = require_fresh();
|
|
48628
|
-
var fs = (
|
|
49268
|
+
var fs = (init_esm22(), __toCommonJS(esm_exports11));
|
|
48629
49269
|
var mime = require_mime_types();
|
|
48630
49270
|
var ms = require_ms();
|
|
48631
49271
|
var onFinished = require_on_finished();
|
|
48632
49272
|
var parseRange = require_range_parser();
|
|
48633
|
-
var path = (
|
|
49273
|
+
var path = (init_esm17(), __toCommonJS(esm_exports7));
|
|
48634
49274
|
var statuses = require_statuses();
|
|
48635
49275
|
var Stream2 = require_cjs_compat();
|
|
48636
|
-
var util = (
|
|
49276
|
+
var util = (init_esm20(), __toCommonJS(esm_exports10));
|
|
48637
49277
|
var extname4 = path.extname;
|
|
48638
49278
|
var join4 = path.join;
|
|
48639
49279
|
var normalize4 = path.normalize;
|
|
@@ -49184,11 +49824,11 @@ var require_response = __commonJS({
|
|
|
49184
49824
|
var deprecate2 = require_browser2()("express");
|
|
49185
49825
|
var encodeUrl = require_encodeurl();
|
|
49186
49826
|
var escapeHtml2 = require_escape_html();
|
|
49187
|
-
var http = (
|
|
49827
|
+
var http = (init_esm24(), __toCommonJS(esm_exports12));
|
|
49188
49828
|
var onFinished = require_on_finished();
|
|
49189
49829
|
var mime = require_mime_types();
|
|
49190
|
-
var path = (
|
|
49191
|
-
var pathIsAbsolute = (
|
|
49830
|
+
var path = (init_esm17(), __toCommonJS(esm_exports7));
|
|
49831
|
+
var pathIsAbsolute = (init_esm17(), __toCommonJS(esm_exports7)).isAbsolute;
|
|
49192
49832
|
var statuses = require_statuses();
|
|
49193
49833
|
var sign = require_cookie_signature().sign;
|
|
49194
49834
|
var normalizeType = require_utils3().normalizeType;
|
|
@@ -49654,9 +50294,9 @@ var require_serve_static = __commonJS({
|
|
|
49654
50294
|
var encodeUrl = require_encodeurl();
|
|
49655
50295
|
var escapeHtml2 = require_escape_html();
|
|
49656
50296
|
var parseUrl = require_parseurl();
|
|
49657
|
-
var resolve5 = (
|
|
50297
|
+
var resolve5 = (init_esm17(), __toCommonJS(esm_exports7)).resolve;
|
|
49658
50298
|
var send = require_send();
|
|
49659
|
-
var url = (
|
|
50299
|
+
var url = (init_esm8(), __toCommonJS(esm_exports3));
|
|
49660
50300
|
module.exports = serveStatic;
|
|
49661
50301
|
function serveStatic(root, options) {
|
|
49662
50302
|
if (!root) {
|
|
@@ -49816,8 +50456,8 @@ var runtimeName = isGJS ? "GJS" : isNode ? "Node.js" : "Unknown";
|
|
|
49816
50456
|
var runtimeVersion = isGJS ? process.versions.gjs : isNode ? process.versions.node : void 0;
|
|
49817
50457
|
|
|
49818
50458
|
// src/index.ts
|
|
49819
|
-
|
|
49820
|
-
|
|
50459
|
+
init_esm17();
|
|
50460
|
+
init_esm8();
|
|
49821
50461
|
var import_express = __toESM(require_express2(), 1);
|
|
49822
50462
|
|
|
49823
50463
|
// src/data/posts.ts
|