diff options
23 files changed, 821 insertions, 722 deletions
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 29c6eabc6..01081421f 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -15,6 +15,7 @@ "${workspaceFolder}/src/bun.js/bindings/webcore/", "${workspaceFolder}/src/bun.js/bindings/sqlite/", "${workspaceFolder}/src/bun.js/bindings/webcrypto/", + "${workspaceFolder}/src/bun.js/modules/", "${workspaceFolder}/src/js/builtins/", "${workspaceFolder}/src/js/out", "${workspaceFolder}/src/deps/boringssl/include/", @@ -352,7 +352,7 @@ LINUX_INCLUDE_DIRS := $(ALL_JSC_INCLUDE_DIRS) \ UWS_INCLUDE_DIR := -I$(BUN_DEPS_DIR)/uws/uSockets/src -I$(BUN_DEPS_DIR)/uws/src -I$(BUN_DEPS_DIR) -INCLUDE_DIRS := $(UWS_INCLUDE_DIR) -I$(BUN_DEPS_DIR)/mimalloc/include -I$(BUN_DEPS_DIR)/zstd/include -Isrc/napi -I$(BUN_DEPS_DIR)/boringssl/include -I$(BUN_DEPS_DIR)/c-ares/include +INCLUDE_DIRS := $(UWS_INCLUDE_DIR) -I$(BUN_DEPS_DIR)/mimalloc/include -I$(BUN_DEPS_DIR)/zstd/include -Isrc/napi -I$(BUN_DEPS_DIR)/boringssl/include -I$(BUN_DEPS_DIR)/c-ares/include -Isrc/bun.js/modules ifeq ($(OS_NAME),linux) diff --git a/src/bun.js/bindings/Process.cpp b/src/bun.js/bindings/Process.cpp index 9a09eca66..5c9c03dd2 100644 --- a/src/bun.js/bindings/Process.cpp +++ b/src/bun.js/bindings/Process.cpp @@ -279,7 +279,7 @@ JSC_DEFINE_HOST_FUNCTION(Process_functionDlopen, } } - JSC::EncodedJSValue (*napi_register_module_v1)(JSC::JSGlobalObject * globalObject, + JSC::EncodedJSValue (*napi_register_module_v1)(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue exports); napi_register_module_v1 = reinterpret_cast<JSC::EncodedJSValue (*)(JSC::JSGlobalObject*, @@ -912,13 +912,10 @@ static JSValue constructStdioWriteStream(JSC::JSGlobalObject* globalObject, int { auto& vm = globalObject->vm(); auto scope = DECLARE_THROW_SCOPE(vm); - JSC::JSFunction* getWindowSizeFunction = JSC::JSFunction::create(vm, globalObject, 2, - String("getWindowSize"_s), Process_functionInternalGetWindowSize, ImplementationVisibility::Public); JSC::JSFunction* getStdioWriteStream = JSC::JSFunction::create(vm, processObjectInternalsGetStdioWriteStreamCodeGenerator(vm), globalObject); JSC::MarkedArgumentBuffer args; args.append(JSC::jsNumber(fd)); - args.append(getWindowSizeFunction); auto clientData = WebCore::clientData(vm); JSC::CallData callData = JSC::getCallData(getStdioWriteStream); diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index 016da0fd6..f8fc2ea2b 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -109,6 +109,7 @@ #include "NodeVMScript.h" #include "ProcessIdentifier.h" #include "SerializedScriptValue.h" +#include "NodeTTYModule.h" #include "ZigGeneratedClasses.h" #include "JavaScriptCore/DateInstance.h" @@ -1408,6 +1409,35 @@ JSC_DEFINE_HOST_FUNCTION(asyncHooksCleanupLater, (JSC::JSGlobalObject * globalOb return JSC::JSValue::encode(JSC::jsUndefined()); } +extern "C" int Bun__ttySetMode(int fd, int mode); + +JSC_DEFINE_HOST_FUNCTION(jsTTYSetMode, (JSC::JSGlobalObject * globalObject, CallFrame* callFrame)) +{ + auto& vm = globalObject->vm(); + auto scope = DECLARE_THROW_SCOPE(vm); + + if (callFrame->argumentCount() != 2) { + throwTypeError(globalObject, scope, "Expected 2 arguments"_s); + return JSValue::encode(jsUndefined()); + } + + JSValue fd = callFrame->argument(0); + if (!fd.isNumber()) { + throwTypeError(globalObject, scope, "fd must be a number"_s); + return JSValue::encode(jsUndefined()); + } + + JSValue mode = callFrame->argument(1); + if (!mode.isNumber()) { + throwTypeError(globalObject, scope, "mode must be a number"_s); + return JSValue::encode(jsUndefined()); + } + + // Nodejs does not throw when ttySetMode fails. An Error event is emitted instead. + int err = Bun__ttySetMode(fd.asNumber(), mode.asNumber()); + return JSValue::encode(jsNumber(err)); +} + JSC_DEFINE_CUSTOM_GETTER(noop_getter, (JSGlobalObject*, EncodedJSValue, PropertyName)) { return JSC::JSValue::encode(JSC::jsUndefined()); @@ -1484,6 +1514,8 @@ JSC_DEFINE_HOST_FUNCTION(jsReceiveMessageOnPort, (JSGlobalObject * lexicalGlobal return JSC::JSValue::encode(jsUndefined()); } +extern JSC::EncodedJSValue Process_functionInternalGetWindowSize(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame); + // we're trying out a new way to do this lazy loading // this is $lazy() in js code static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad, @@ -1660,6 +1692,18 @@ static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad, return JSValue::encode(obj); } + if (string == "tty"_s) { + auto* obj = constructEmptyObject(globalObject); + + obj->putDirect(vm, PropertyName(Identifier::fromString(vm, "ttySetMode"_s)), JSFunction::create(vm, globalObject, 0, "ttySetMode"_s, jsTTYSetMode, ImplementationVisibility::Public), 1); + + obj->putDirect(vm, PropertyName(Identifier::fromString(vm, "isatty"_s)), JSFunction::create(vm, globalObject, 0, "isatty"_s, jsFunctionTty_isatty, ImplementationVisibility::Public), 1); + + obj->putDirect(vm, PropertyName(Identifier::fromString(vm, "getWindowSize"_s)), JSFunction::create(vm, globalObject, 0, "getWindowSize"_s, Process_functionInternalGetWindowSize, ImplementationVisibility::Public), 2); + + return JSValue::encode(obj); + } + if (UNLIKELY(string == "noop"_s)) { auto* obj = constructEmptyObject(globalObject); obj->putDirectCustomAccessor(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "getterSetter"_s)), JSC::CustomGetterSetter::create(vm, noop_getter, noop_setter), 0); diff --git a/src/bun.js/bindings/exports.zig b/src/bun.js/bindings/exports.zig index faf14a56a..ac19b4458 100644 --- a/src/bun.js/bindings/exports.zig +++ b/src/bun.js/bindings/exports.zig @@ -1008,7 +1008,7 @@ pub const ZigConsoleClient = struct { if (message_type == .Trace) { writeTrace(Writer, writer, global); - buffered_writer.flush() catch unreachable; + buffered_writer.flush() catch {}; } } diff --git a/src/bun.js/bindings/wtf-bindings.cpp b/src/bun.js/bindings/wtf-bindings.cpp index ccf71f8eb..6fd10721a 100644 --- a/src/bun.js/bindings/wtf-bindings.cpp +++ b/src/bun.js/bindings/wtf-bindings.cpp @@ -2,6 +2,8 @@ #include "wtf/StackTrace.h" #include "wtf/dtoa.h" +#include "wtf/Lock.h" +#include "termios.h" extern "C" double WTF__parseDouble(const LChar* string, size_t length, size_t* position) { @@ -13,6 +15,138 @@ extern "C" void WTF__copyLCharsFromUCharSource(LChar* destination, const UChar* WTF::StringImpl::copyCharacters(destination, source, length); } +static int orig_termios_fd = -1; +static struct termios orig_termios; +static WTF::Lock orig_termios_lock; + +static int current_tty_mode = 0; +static struct termios orig_tty_termios; + +int uv__tcsetattr(int fd, int how, const struct termios* term) +{ + int rc; + + do + rc = tcsetattr(fd, how, term); + while (rc == -1 && errno == EINTR); + + if (rc == -1) + return errno; + + return 0; +} + +static void uv__tty_make_raw(struct termios* tio) +{ + assert(tio != NULL); + +#if defined __sun || defined __MVS__ + /* + * This implementation of cfmakeraw for Solaris and derivatives is taken from + * http://www.perkin.org.uk/posts/solaris-portability-cfmakeraw.html. + */ + tio->c_iflag &= ~(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); + tio->c_oflag &= ~OPOST; + tio->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + tio->c_cflag &= ~(CSIZE | PARENB); + tio->c_cflag |= CS8; + + /* + * By default, most software expects a pending read to block until at + * least one byte becomes available. As per termio(7I), this requires + * setting the MIN and TIME parameters appropriately. + * + * As a somewhat unfortunate artifact of history, the MIN and TIME slots + * in the control character array overlap with the EOF and EOL slots used + * for canonical mode processing. Because the EOF character needs to be + * the ASCII EOT value (aka Control-D), it has the byte value 4. When + * switching to raw mode, this is interpreted as a MIN value of 4; i.e., + * reads will block until at least four bytes have been input. + * + * Other platforms with a distinct MIN slot like Linux and FreeBSD appear + * to default to a MIN value of 1, so we'll force that value here: + */ + tio->c_cc[VMIN] = 1; + tio->c_cc[VTIME] = 0; +#else + cfmakeraw(tio); +#endif /* #ifdef __sun */ +} + +extern "C" int +Bun__ttySetMode(int fd, int mode) +{ + struct termios tmp; + int expected; + int rc; + + if (current_tty_mode == mode) + return 0; + + if (current_tty_mode == 0 && mode != 0) { + do { + rc = tcgetattr(fd, &orig_tty_termios); + } while (rc == -1 && errno == EINTR); + + if (rc == -1) + return errno; + + { + /* This is used for uv_tty_reset_mode() */ + LockHolder locker(orig_termios_lock); + + if (orig_termios_fd == -1) { + orig_termios = orig_termios; + orig_termios_fd = fd; + } + } + } + + tmp = orig_tty_termios; + switch (mode) { + case 0: // normal + break; + case 1: // raw + tmp.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); + tmp.c_oflag |= (ONLCR); + tmp.c_cflag |= (CS8); + tmp.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); + tmp.c_cc[VMIN] = 1; + tmp.c_cc[VTIME] = 0; + break; + case 2: // io + uv__tty_make_raw(&tmp); + break; + } + + /* Apply changes after draining */ + rc = uv__tcsetattr(fd, TCSADRAIN, &tmp); + if (rc == 0) + current_tty_mode = mode; + + return rc; +} + +int uv_tty_reset_mode(void) +{ + int saved_errno; + int err; + + saved_errno = errno; + + if (orig_termios_lock.tryLock()) + return 16; // UV_EBUSY; /* In uv_tty_set_mode(). */ + + err = 0; + if (orig_termios_fd != -1) + err = uv__tcsetattr(orig_termios_fd, TCSANOW, &orig_termios); + + orig_termios_lock.unlock(); + errno = saved_errno; + + return err; +} + extern "C" void Bun__crashReportWrite(void* ctx, const char* message, size_t length); extern "C" void Bun__crashReportDumpStackTrace(void* ctx) { diff --git a/src/bun.js/modules/_NativeModule.h b/src/bun.js/modules/_NativeModule.h index 485987e1c..b23906ad0 100644 --- a/src/bun.js/modules/_NativeModule.h +++ b/src/bun.js/modules/_NativeModule.h @@ -31,7 +31,6 @@ macro("node:module"_s, NodeModule) \ macro("node:process"_s, NodeProcess) \ macro("node:string_decoder"_s, NodeStringDecoder) \ - macro("node:tty"_s, NodeTTY) \ macro("node:util/types"_s, NodeUtilTypes) \ macro("utf-8-validate"_s, UTF8Validate) \ diff --git a/src/js/builtins/ProcessObjectInternals.ts b/src/js/builtins/ProcessObjectInternals.ts index 242b310fd..548a2d984 100644 --- a/src/js/builtins/ProcessObjectInternals.ts +++ b/src/js/builtins/ProcessObjectInternals.ts @@ -44,664 +44,152 @@ export function binding(bindingName) { ); } -export function getStdioWriteStream(fd_, getWindowSize) { - var EventEmitter = require("node:events"); +export function getStdioWriteStream(fd) { + const tty = require("node:tty"); - function createStdioWriteStream(fd_) { - var { Duplex, eos, destroy } = require("node:stream"); - var StdioWriteStream = class StdioWriteStream extends Duplex { - #writeStream; - #readStream; + const stream = tty.WriteStream(fd); - #readable = true; - #writable = true; - #fdPath; + process.on("SIGWINCH", () => { + stream._refreshSize(); + }); - #onClose; - #onDrain; - #onFinish; - #onReadable; - #isTTY; + if (fd === 1) { + stream.destroySoon = stream.destroy; + stream._destroy = function (err, cb) { + cb(err); + this._undestroy(); - get isTTY() { - return (this.#isTTY ??= require("node:tty").isatty(fd_)); - } - - get fd() { - return fd_; - } - - get writable() { - return this.#writable; - } - - get readable() { - return this.#readable; - } - - constructor(fd) { - super({ readable: true, writable: true }); - this.#fdPath = `/dev/fd/${fd}`; - } - - #onFinished(err) { - const cb = this.#onClose; - this.#onClose = null; - - if (cb) { - cb(err); - } else if (err) { - this.destroy(err); - } else if (!this.#readable && !this.#writable) { - this.destroy(); - } - } - - _destroy(err, callback) { - if (!err && this.#onClose !== null) { - var AbortError = class AbortError extends Error { - code: string; - name: string; - constructor(message = "The operation was aborted", options = void 0) { - if (options !== void 0 && typeof options !== "object") { - throw new Error(`Invalid AbortError options:\n\n${JSON.stringify(options, null, 2)}`); - } - super(message, options); - this.code = "ABORT_ERR"; - this.name = "AbortError"; - } - }; - err = new AbortError(); - } - - this.#onDrain = null; - this.#onFinish = null; - if (this.#onClose === null) { - callback(err); - } else { - this.#onClose = callback; - if (this.#writeStream) destroy(this.#writeStream, err); - if (this.#readStream) destroy(this.#readStream, err); - } - } - - _write(chunk, encoding, callback) { - if (!this.#writeStream) { - var { createWriteStream } = require("node:fs"); - var stream = (this.#writeStream = createWriteStream(this.#fdPath)); - - stream.on("finish", () => { - if (this.#onFinish) { - const cb = this.#onFinish; - this.#onFinish = null; - cb(); - } - }); - - stream.on("drain", () => { - if (this.#onDrain) { - const cb = this.#onDrain; - this.#onDrain = null; - cb(); - } - }); - - eos(stream, err => { - this.#writable = false; - if (err) { - destroy(stream, err); - } - this.#onFinished(err); - }); - } - - if (this.#writeStream.write(chunk, encoding)) { - callback(); - } else { - this.#onDrain = callback; - } - } - - _final(callback) { - this.#writeStream && this.#writeStream.end(); - this.#onFinish = callback; - } - - #loadReadStream() { - var { createReadStream } = require("node:fs"); - - var readStream = (this.#readStream = createReadStream(this.#fdPath)); - - readStream.on("readable", () => { - if (this.#onReadable) { - const cb = this.#onReadable; - this.#onReadable = null; - cb(); - } else { - this.read(); - } - }); - - readStream.on("end", () => { - this.push(null); + if (!this._writableState.emitClose) { + process.nextTick(() => { + this.emit("close"); }); - - eos(readStream, err => { - this.#readable = false; - if (err) { - destroy(readStream, err); - } - this.#onFinished(err); - }); - return readStream; - } - - _read() { - var stream = this.#readStream; - if (!stream) { - stream = this.#loadReadStream(); - } - - while (true) { - const buf = stream.read(); - if (buf === null || !this.push(buf)) { - return; - } - } } }; - return new StdioWriteStream(fd_); - } - - function isFastEncoding(encoding) { - if (!encoding) return true; - - var normalied = encoding.toLowerCase(); - return normalied === "utf8" || normalied === "utf-8" || normalied === "buffer" || normalied === "binary"; - } - - var readline; - var windowSizeArray = [0, 0]; - - var FastStdioWriteStreamInternal = class StdioWriteStream extends EventEmitter { - #fd; - #innerStream; - #writer; - #isTTY; - - bytesWritten = 0; - - setDefaultEncoding(encoding) { - if (this.#innerStream || !isFastEncoding(encoding)) { - this.#ensureInnerStream(); - return this.#innerStream.setDefaultEncoding(encoding); - } - } - - #createWriter() { - switch (this.#fd) { - case 1: { - var writer = Bun.stdout.writer({ highWaterMark: 0 }); - writer.unref(); - return writer; - } - - case 2: { - var writer = Bun.stderr.writer({ highWaterMark: 0 }); - writer.unref(); - return writer; - } - default: { - throw new Error("Unsupported writer"); - } - } - } - - #getWriter() { - return (this.#writer ??= this.#createWriter()); - } - - constructor(fd_) { - super(); - this.#fd = fd_; - } - - get fd() { - return this.#fd; - } - - ref() { - this.#getWriter().ref(); - } - - unref() { - this.#getWriter().unref(); - } - - on(event, listener) { - if (event === "close" || event === "finish") { - this.#ensureInnerStream(); - return this.#innerStream.on(event, listener); - } - - if (event === "drain") { - return super.on("drain", listener); - } - - if (event === "error") { - return super.on("error", listener); - } - - return super.on(event, listener); - } - - get _writableState() { - this.#ensureInnerStream(); - return this.#innerStream._writableState; - } - - get _readableState() { - this.#ensureInnerStream(); - return this.#innerStream._readableState; - } - - get writable() { - this.#ensureInnerStream(); - return this.#innerStream.writable; - } - - get readable() { - this.#ensureInnerStream(); - return this.#innerStream.readable; - } - - pipe(destination) { - this.#ensureInnerStream(); - return this.#innerStream.pipe(destination); - } - - unpipe(destination) { - this.#ensureInnerStream(); - return this.#innerStream.unpipe(destination); - } - - #ensureInnerStream() { - if (this.#innerStream) return; - this.#innerStream = createStdioWriteStream(this.#fd); - const events = this.eventNames(); - for (const event of events) { - this.#innerStream.on(event, (...args) => { - this.emit(event, ...args); + } else if (fd === 2) { + stream.destroySoon = stream.destroy; + stream._destroy = function (err, cb) { + cb(err); + this._undestroy(); + + if (!this._writableState.emitClose) { + process.nextTick(() => { + this.emit("close"); }); } - } - - #write1(chunk) { - var writer = this.#getWriter(); - const writeResult = writer.write(chunk); - this.bytesWritten += writeResult; - const flushResult = writer.flush(false); - return !!(writeResult || flushResult); - } - - #writeWithEncoding(chunk, encoding) { - if (!isFastEncoding(encoding)) { - this.#ensureInnerStream(); - return this.#innerStream.write(chunk, encoding); - } - - return this.#write1(chunk); - } - - #performCallback(cb, err?: any) { - if (err) { - this.emit("error", err); - } - - try { - cb(err ? err : null); - } catch (err2) { - this.emit("error", err2); - } - } - - #writeWithCallbackAndEncoding(chunk, encoding, callback) { - if (!isFastEncoding(encoding)) { - this.#ensureInnerStream(); - return this.#innerStream.write(chunk, encoding, callback); - } - - var writer = this.#getWriter(); - const writeResult = writer.write(chunk); - const flushResult = writer.flush(true); - if (flushResult?.then) { - flushResult.then( - () => { - this.#performCallback(callback); - this.emit("drain"); - }, - err => this.#performCallback(callback, err), - ); - return false; - } - - queueMicrotask(() => { - this.#performCallback(callback); - }); - - return !!(writeResult || flushResult); - } - - get isTTY() { - return false; - } - - write(chunk, encoding, callback) { - const result = this._write(chunk, encoding, callback); - - if (result) { - this.emit("drain"); - } - - return result; - } - - get hasColors() { - return Bun.tty[this.#fd].hasColors; - } - - _write(chunk, encoding, callback) { - var inner = this.#innerStream; - if (inner) { - return inner.write(chunk, encoding, callback); - } - - switch (arguments.length) { - case 0: { - var error = new Error("Invalid arguments"); - error.code = "ERR_INVALID_ARG_TYPE"; - throw error; - } - case 1: { - return this.#write1(chunk); - } - case 2: { - if (typeof encoding === "function") { - return this.#writeWithCallbackAndEncoding(chunk, "", encoding); - } else if (typeof encoding === "string") { - return this.#writeWithEncoding(chunk, encoding); - } - } - default: { - if ( - (typeof encoding !== "undefined" && typeof encoding !== "string") || - (typeof callback !== "undefined" && typeof callback !== "function") - ) { - var error = new Error("Invalid arguments"); - error.code = "ERR_INVALID_ARG_TYPE"; - throw error; - } - - if (typeof callback === "undefined") { - return this.#writeWithEncoding(chunk, encoding); - } - - return this.#writeWithCallbackAndEncoding(chunk, encoding, callback); - } - } - } - - destroy() { - return this; - } - - end() { - return this; - } - }; - if (getWindowSize(fd_, windowSizeArray)) { - var WriteStream = class WriteStream extends FastStdioWriteStreamInternal { - get isTTY() { - return true; - } - - cursorTo(x, y, callback) { - return (readline ??= require("node:readline")).cursorTo(this, x, y, callback); - } - - moveCursor(dx, dy, callback) { - return (readline ??= require("node:readline")).moveCursor(this, dx, dy, callback); - } - - clearLine(dir, callback) { - return (readline ??= require("node:readline")).clearLine(this, dir, callback); - } - - clearScreenDown(callback) { - return (readline ??= require("node:readline")).clearScreenDown(this, callback); - } - - getWindowSize() { - if (getWindowSize(fd_, windowSizeArray) === true) { - return [windowSizeArray[0], windowSizeArray[1]]; - } - } - - get columns() { - if (getWindowSize(fd_, windowSizeArray) === true) { - return windowSizeArray[0]; - } - } - - get rows() { - if (getWindowSize(fd_, windowSizeArray) === true) { - return windowSizeArray[1]; - } - } }; - - return new WriteStream(fd_); } - return new FastStdioWriteStreamInternal(fd_); -} - -export function getStdinStream(fd_) { - var { Duplex, eos, destroy } = require("node:stream"); + stream._type = "tty"; + stream._isStdio = true; + stream.fd = fd; - var StdinStream = class StdinStream extends Duplex { - #reader; - // TODO: investigate https://github.com/oven-sh/bun/issues/1607 - - #readRef; - #writeStream; - - #readable = true; - #unrefOnRead = false; - #writable = true; + return stream; +} - #onFinish; - #onClose; - #onDrain; +export function getStdinStream(fd) { + var { destroy } = require("node:stream"); + + var reader: ReadableStreamDefaultReader | undefined; + var readerRef; + var unrefOnRead = false; + function ref() { + reader ??= Bun.stdin.stream().getReader(); + // TODO: remove this. likely we are dereferencing the stream + // when there is still more data to be read. + readerRef ??= setInterval(() => {}, 1 << 30); + } - get isTTY() { - return require("node:tty").isatty(fd_); + function unref() { + if (readerRef) { + clearInterval(readerRef); + readerRef = undefined; } + } - get fd() { - return fd_; - } + const tty = require("node:tty"); + + const stream = new tty.ReadStream(fd); + + const originalOn = stream.on; + stream.on = function (event, listener) { + // Streams don't generally required to present any data when only + // `readable` events are present, i.e. `readableFlowing === false` + // + // However, Node.js has a this quirk whereby `process.stdin.read()` + // blocks under TTY mode, thus looping `.read()` in this particular + // case would not result in truncation. + // + // Therefore the following hack is only specific to `process.stdin` + // and does not apply to the underlying Stream implementation. + if (event === "readable") { + ref(); + unrefOnRead = true; + } + return originalOn.call(this, event, listener); + }; - constructor() { - super({ readable: true, writable: true }); - } + stream.fd = fd; - #onFinished(err?) { - const cb = this.#onClose; - this.#onClose = null; + const originalPause = stream.pause; + stream.pause = function () { + unref(); + return originalPause.call(this); + }; - if (cb) { - cb(err); - } else if (err) { - this.destroy(err); - } else if (!this.#readable && !this.#writable) { - this.destroy(); - } - } + const originalResume = stream.resume; + stream.resume = function () { + ref(); + return originalResume.call(this); + }; - _destroy(err, callback) { - if (!err && this.#onClose !== null) { - var AbortError = class AbortError extends Error { - constructor(message = "The operation was aborted", options = void 0) { - if (options !== void 0 && typeof options !== "object") { - throw new Error(`Invalid AbortError options:\n\n${JSON.stringify(options, null, 2)}`); - } - super(message, options); - this.code = "ABORT_ERR"; - this.name = "AbortError"; - } - }; - err = new AbortError(); - } + async function internalRead(stream) { + try { + var done: any, value: any; + const read = reader?.readMany(); - if (this.#onClose === null) { - callback(err); + if ($isPromise(read)) { + ({ done, value } = await read); } else { - this.#onClose = callback; - if (this.#writeStream) destroy(this.#writeStream, err); - } - } - - setRawMode(mode) {} - - on(name, callback) { - // Streams don't generally required to present any data when only - // `readable` events are present, i.e. `readableFlowing === false` - // - // However, Node.js has a this quirk whereby `process.stdin.read()` - // blocks under TTY mode, thus looping `.read()` in this particular - // case would not result in truncation. - // - // Therefore the following hack is only specific to `process.stdin` - // and does not apply to the underlying Stream implementation. - if (name === "readable") { - this.ref(); - this.#unrefOnRead = true; - } - return super.on(name, callback); - } - - pause() { - this.unref(); - return super.pause(); - } - - resume() { - this.ref(); - return super.resume(); - } - - ref() { - this.#reader ??= Bun.stdin.stream().getReader(); - this.#readRef ??= setInterval(() => {}, 1 << 30); - } - - unref() { - if (this.#readRef) { - clearInterval(this.#readRef); - this.#readRef = null; + // @ts-expect-error + ({ done, value } = read); } - } - - async #readInternal() { - try { - var done, value; - const read = this.#reader.readMany(); - - // read same-tick if possible - if (!read?.then) { - ({ done, value } = read); - } else { - ({ done, value } = await read); - } - - if (!done) { - this.push(value[0]); - - // shouldn't actually happen, but just in case - const length = value.length; - for (let i = 1; i < length; i++) { - this.push(value[i]); - } - } else { - this.push(null); - this.pause(); - this.#readable = false; - this.#onFinished(); - } - } catch (err) { - this.#readable = false; - this.#onFinished(err); - } - } - - _read(size) { - if (this.#unrefOnRead) { - this.unref(); - this.#unrefOnRead = false; - } - this.#readInternal(); - } - #constructWriteStream() { - var { createWriteStream } = require("node:fs"); - var writeStream = (this.#writeStream = createWriteStream("/dev/fd/0")); + if (!done) { + stream.push(value[0]); - writeStream.on("finish", () => { - if (this.#onFinish) { - const cb = this.#onFinish; - this.#onFinish = null; - cb(); + // shouldn't actually happen, but just in case + const length = value.length; + for (let i = 1; i < length; i++) { + stream.push(value[i]); } - }); - - writeStream.on("drain", () => { - if (this.#onDrain) { - const cb = this.#onDrain; - this.#onDrain = null; - cb(); - } - }); - - eos(writeStream, err => { - this.#writable = false; - if (err) { - destroy(writeStream, err); - } - this.#onFinished(err); - }); - - return writeStream; - } - - _write(chunk, encoding, callback) { - var writeStream = this.#writeStream; - if (!writeStream) { - writeStream = this.#constructWriteStream(); - } - - if (writeStream.write(chunk, encoding)) { - callback(); } else { - this.#onDrain = callback; + stream.push(null); + stream.pause(); } + } catch (err) { + stream.destroy(err); } + } - _final(callback) { - this.#writeStream.end(); - this.#onFinish = (...args) => callback(...args); + stream._read = function (size) { + if (unrefOnRead) { + unref(); + unrefOnRead = false; } + internalRead(this); }; - return new StdinStream(); + stream.on("pause", () => { + process.nextTick(() => { + destroy(stream); + }); + }); + + stream.on("close", () => { + process.nextTick(() => { + reader?.cancel(); + }); + }); + + return stream; } diff --git a/src/js/builtins/ReadableStreamInternals.ts b/src/js/builtins/ReadableStreamInternals.ts index 58fa4524a..e249aea0a 100644 --- a/src/js/builtins/ReadableStreamInternals.ts +++ b/src/js/builtins/ReadableStreamInternals.ts @@ -1504,7 +1504,12 @@ export function lazyLoadStream(stream, autoAllocateChunkSize) { function callClose(controller) { try { - controller.close(); + if ( + $getByIdDirectPrivate($getByIdDirectPrivate(controller, "controlledReadableStream"), "state") === + $streamReadable + ) { + controller.close(); + } } catch (e) { globalThis.reportError(e); } diff --git a/src/js/node/events.js b/src/js/node/events.js index da7cfd57c..87c7af01b 100644 --- a/src/js/node/events.js +++ b/src/js/node/events.js @@ -37,6 +37,8 @@ EventEmitterPrototype.setMaxListeners = function setMaxListeners(n) { return this; }; +EventEmitterPrototype.constructor = EventEmitter; + EventEmitterPrototype.getMaxListeners = function getMaxListeners() { return this._maxListeners ?? defaultMaxListeners; }; diff --git a/src/js/node/readline.js b/src/js/node/readline.js index 0811fb95f..681cbba62 100644 --- a/src/js/node/readline.js +++ b/src/js/node/readline.js @@ -1604,15 +1604,13 @@ var _Interface = class Interface extends InterfaceConstructor { return this[kPrompt]; } - [kSetRawMode](mode) { - var input = this.input; - var { setRawMode, wasInRawMode } = input; - - // TODO: Make this work, for now just stub this and print debug - debug("setRawMode", mode, "set!"); - // if (typeof setRawMode === "function") { - // setRawMode(mode); - // } + [kSetRawMode](flag) { + const mode = flag ? 1 : 0; + const wasInRawMode = this.input.isRaw; + + if (typeof this.input.setRawMode === "function") { + this.input.setRawMode(mode); + } return wasInRawMode; } diff --git a/src/js/node/tty.js b/src/js/node/tty.js new file mode 100644 index 000000000..09010e8fc --- /dev/null +++ b/src/js/node/tty.js @@ -0,0 +1,289 @@ +const { ttySetMode, isatty, getWindowSize: _getWindowSize } = $lazy("tty"); + +function ReadStream(fd) { + if (!(this instanceof ReadStream)) return new ReadStream(fd); + if (fd >> 0 !== fd || fd < 0) throw new RangeError("fd must be a positive integer"); + + const stream = require("node:fs").ReadStream.call(this, `/dev/fd/${fd}`); + + stream.isRaw = false; + stream.isTTY = isatty(stream.fd); + + return stream; +} + +Object.defineProperty(ReadStream, "prototype", { + get() { + const Real = require("node:fs").ReadStream.prototype; + + Object.defineProperty(ReadStream, "prototype", { value: Real }); + ReadStream.prototype.setRawMode = function (flag) { + const mode = flag ? 1 : 0; + const err = ttySetMode(this.fd, mode); + if (err) { + this.emit("error", new Error("setRawMode failed with errno:", err)); + return this; + } + this.isRaw = flag; + return this; + }; + + return Real; + }, + enumerable: true, + configurable: true, +}); + +let OSRelease; + +const COLORS_2 = 1; +const COLORS_16 = 4; +const COLORS_256 = 8; +const COLORS_16m = 24; + +// Some entries were taken from `dircolors` +// (https://linux.die.net/man/1/dircolors). The corresponding terminals might +// support more than 16 colors, but this was not tested for. +// +// Copyright (C) 1996-2016 Free Software Foundation, Inc. Copying and +// distribution of this file, with or without modification, are permitted +// provided the copyright notice and this notice are preserved. +const TERM_ENVS = { + "eterm": COLORS_16, + "cons25": COLORS_16, + "console": COLORS_16, + "cygwin": COLORS_16, + "dtterm": COLORS_16, + "gnome": COLORS_16, + "hurd": COLORS_16, + "jfbterm": COLORS_16, + "konsole": COLORS_16, + "kterm": COLORS_16, + "mlterm": COLORS_16, + "mosh": COLORS_16m, + "putty": COLORS_16, + "st": COLORS_16, + // https://github.com/da-x/rxvt-unicode/tree/v9.22-with-24bit-color + "rxvt-unicode-24bit": COLORS_16m, + // https://gist.github.com/XVilka/8346728#gistcomment-2823421 + "terminator": COLORS_16m, +}; + +const TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/]; + +let warned = false; +function warnOnDeactivatedColors(env) { + if (warned) return; + let name = ""; + if (env.NODE_DISABLE_COLORS !== undefined) name = "NODE_DISABLE_COLORS"; + if (env.NO_COLOR !== undefined) { + if (name !== "") { + name += "' and '"; + } + name += "NO_COLOR"; + } + + if (name !== "") { + process.emitWarning(`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, "Warning"); + warned = true; + } +} + +function WriteStream(fd) { + if (!(this instanceof WriteStream)) return new WriteStream(fd); + if (fd >> 0 !== fd || fd < 0) throw new RangeError("fd must be a positive integer"); + + const stream = require("node:fs").WriteStream.call(this, `/dev/fd/${fd}`); + + stream.columns = undefined; + stream.rows = undefined; + stream.isTTY = isatty(stream.fd); + + if (stream.isTTY) { + const windowSizeArray = [0, 0]; + if (_getWindowSize(fd, windowSizeArray) === true) { + stream.columns = windowSizeArray[0]; + stream.rows = windowSizeArray[1]; + } + } + + return stream; +} + +Object.defineProperty(WriteStream, "prototype", { + get() { + const Real = require("node:fs").WriteStream.prototype; + Object.defineProperty(WriteStream, "prototype", { value: Real }); + + WriteStream.prototype._refreshSize = function () { + const oldCols = this.columns; + const oldRows = this.rows; + const windowSizeArray = [0, 0]; + if (_getWindowSize(this.fd, windowSizeArray) === true) { + if (oldCols !== windowSizeArray[0] || oldRows !== windowSizeArray[1]) { + this.columns = windowSizeArray[0]; + this.rows = windowSizeArray[1]; + this.emit("resize"); + } + } + }; + + var readline = undefined; + WriteStream.prototype.clearLine = function (dir, cb) { + return (readline ??= require("node:readline")).clearLine(this, dir, cb); + }; + + WriteStream.prototype.clearScreenDown = function (cb) { + return (readline ??= require("node:readline")).clearScreenDown(this, cb); + }; + + WriteStream.prototype.cursorTo = function (x, y, cb) { + return (readline ??= require("node:readline")).cursorTo(this, x, y, cb); + }; + + // The `getColorDepth` API got inspired by multiple sources such as + // https://github.com/chalk/supports-color, + // https://github.com/isaacs/color-support. + WriteStream.prototype.getColorDepth = function (env = process.env) { + // Use level 0-3 to support the same levels as `chalk` does. This is done for + // consistency throughout the ecosystem. + if (env.FORCE_COLOR !== undefined) { + switch (env.FORCE_COLOR) { + case "": + case "1": + case "true": + warnOnDeactivatedColors(env); + return COLORS_16; + case "2": + warnOnDeactivatedColors(env); + return COLORS_256; + case "3": + warnOnDeactivatedColors(env); + return COLORS_16m; + default: + return COLORS_2; + } + } + + if ( + env.NODE_DISABLE_COLORS !== undefined || + // See https://no-color.org/ + env.NO_COLOR !== undefined || + // The "dumb" special terminal, as defined by terminfo, doesn't support + // ANSI color control codes. + // See https://invisible-island.net/ncurses/terminfo.ti.html#toc-_Specials + env.TERM === "dumb" + ) { + return COLORS_2; + } + + if (process.platform === "win32") { + // Lazy load for startup performance. + if (OSRelease === undefined) { + const { release } = require("node:os"); + OSRelease = StringPrototypeSplit(release(), "."); + } + // Windows 10 build 10586 is the first Windows release that supports 256 + // colors. Windows 10 build 14931 is the first release that supports + // 16m/TrueColor. + if (+OSRelease[0] >= 10) { + const build = +OSRelease[2]; + if (build >= 14931) return COLORS_16m; + if (build >= 10586) return COLORS_256; + } + + return COLORS_16; + } + + if (env.TMUX) { + return COLORS_256; + } + + if (env.CI) { + if ( + ["APPVEYOR", "BUILDKITE", "CIRCLECI", "DRONE", "GITHUB_ACTIONS", "GITLAB_CI", "TRAVIS"].some( + sign => sign in env, + ) || + env.CI_NAME === "codeship" + ) { + return COLORS_256; + } + return COLORS_2; + } + + if ("TEAMCITY_VERSION" in env) { + return RegExpPrototypeExec(/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/, env.TEAMCITY_VERSION) !== null + ? COLORS_16 + : COLORS_2; + } + + switch (env.TERM_PROGRAM) { + case "iTerm.app": + if (!env.TERM_PROGRAM_VERSION || RegExpPrototypeExec(/^[0-2]\./, env.TERM_PROGRAM_VERSION) !== null) { + return COLORS_256; + } + return COLORS_16m; + case "HyperTerm": + case "MacTerm": + return COLORS_16m; + case "Apple_Terminal": + return COLORS_256; + } + + if (env.COLORTERM === "truecolor" || env.COLORTERM === "24bit") { + return COLORS_16m; + } + + if (env.TERM) { + if (RegExpPrototypeExec(/^xterm-256/, env.TERM) !== null) { + return COLORS_256; + } + + const termEnv = StringPrototypeToLowerCase(env.TERM); + + if (TERM_ENVS[termEnv]) { + return TERM_ENVS[termEnv]; + } + if (ArrayPrototypeSome(TERM_ENVS_REG_EXP, term => RegExpPrototypeExec(term, termEnv) !== null)) { + return COLORS_16; + } + } + // Move 16 color COLORTERM below 16m and 256 + if (env.COLORTERM) { + return COLORS_16; + } + return COLORS_2; + }; + + WriteStream.prototype.getWindowSize = function () { + return [this.columns, this.rows]; + }; + + WriteStream.prototype.hasColors = function (count, env) { + if (env === undefined && (count === undefined || (typeof count === "object" && count !== null))) { + env = count; + count = 16; + } else { + validateInteger(count, "count", 2); + } + + return count <= 2 ** this.getColorDepth(env); + }; + + WriteStream.prototype.moveCursor = function (dx, dy, cb) { + return (readline ??= require("node:readline")).moveCursor(this, dx, dy, cb); + }; + + return Real; + }, + enumerable: true, + configurable: true, +}); + +var validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => { + if (typeof value !== "number") throw new ERR_INVALID_ARG_TYPE(name, "number", value); + if (!Number.isInteger(value)) throw new ERR_OUT_OF_RANGE(name, "an integer", value); + if (value < min || value > max) throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value); +}; + +export default { ReadStream, WriteStream, isatty }; diff --git a/src/js/out/InternalModuleRegistry+createInternalModuleById.h b/src/js/out/InternalModuleRegistry+createInternalModuleById.h index 55665b71e..771789fe9 100644 --- a/src/js/out/InternalModuleRegistry+createInternalModuleById.h +++ b/src/js/out/InternalModuleRegistry+createInternalModuleById.h @@ -129,6 +129,9 @@ JSValue InternalModuleRegistry::createInternalModuleById(JSGlobalObject* globalO case Field::NodeTraceEvents: { INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "node:trace_events"_s, "node/trace_events.js"_s, InternalModuleRegistryConstants::NodeTraceEventsCode, "builtin://node/trace/events"_s); } + case Field::NodeTty: { + INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "node:tty"_s, "node/tty.js"_s, InternalModuleRegistryConstants::NodeTtyCode, "builtin://node/tty"_s); + } case Field::NodeUrl: { INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "node:url"_s, "node/url.js"_s, InternalModuleRegistryConstants::NodeUrlCode, "builtin://node/url"_s); } diff --git a/src/js/out/InternalModuleRegistry+enum.h b/src/js/out/InternalModuleRegistry+enum.h index 105f70805..b54a91bda 100644 --- a/src/js/out/InternalModuleRegistry+enum.h +++ b/src/js/out/InternalModuleRegistry+enum.h @@ -40,19 +40,20 @@ NodeTimers = 38, NodeTimersPromises = 39, NodeTLS = 40, NodeTraceEvents = 41, -NodeUrl = 42, -NodeUtil = 43, -NodeV8 = 44, -NodeVM = 45, -NodeWasi = 46, -NodeWorkerThreads = 47, -NodeZlib = 48, -ThirdpartyDepd = 49, -ThirdpartyDetectLibc = 50, -ThirdpartyDetectLibcLinux = 51, -ThirdpartyIsomorphicFetch = 52, -ThirdpartyNodeFetch = 53, -ThirdpartyUndici = 54, -ThirdpartyVercelFetch = 55, -ThirdpartyWS = 56, +NodeTty = 42, +NodeUrl = 43, +NodeUtil = 44, +NodeV8 = 45, +NodeVM = 46, +NodeWasi = 47, +NodeWorkerThreads = 48, +NodeZlib = 49, +ThirdpartyDepd = 50, +ThirdpartyDetectLibc = 51, +ThirdpartyDetectLibcLinux = 52, +ThirdpartyIsomorphicFetch = 53, +ThirdpartyNodeFetch = 54, +ThirdpartyUndici = 55, +ThirdpartyVercelFetch = 56, +ThirdpartyWS = 57, diff --git a/src/js/out/InternalModuleRegistry+numberOfModules.h b/src/js/out/InternalModuleRegistry+numberOfModules.h index 517f9d237..7a302723f 100644 --- a/src/js/out/InternalModuleRegistry+numberOfModules.h +++ b/src/js/out/InternalModuleRegistry+numberOfModules.h @@ -1 +1 @@ -#define BUN_INTERNAL_MODULE_COUNT 57 +#define BUN_INTERNAL_MODULE_COUNT 58 diff --git a/src/js/out/InternalModuleRegistryConstants.h b/src/js/out/InternalModuleRegistryConstants.h index 0b6561e86..818d43ef9 100644 --- a/src/js/out/InternalModuleRegistryConstants.h +++ b/src/js/out/InternalModuleRegistryConstants.h @@ -22,7 +22,7 @@ static constexpr ASCIILiteral InternalSharedCode = "(function (){\"use strict\"; // // -static constexpr ASCIILiteral NodeAssertCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 43) || @createInternalModuleById(43), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"[34m\", green = \"[32m\", white = \"[39m\", red = \"[31m\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n"_s; +static constexpr ASCIILiteral NodeAssertCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"[34m\", green = \"[32m\", white = \"[39m\", red = \"[31m\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n"_s; // // @@ -34,7 +34,7 @@ static constexpr ASCIILiteral NodeAsyncHooksCode = "(function (){\"use strict\"; // // -static constexpr ASCIILiteral NodeChildProcessCode = "(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === void 0)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.call(_stdout, StringPrototypeSlice.apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === void 0)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || void 0,\n cwd: options.cwd || void 0,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, void 0, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), execArgv = options.execArgv || process.execArgv, validateArgumentsNullCheck(execArgv, \"options.execArgv\"), execArgv === process.execArgv && process._eval != null) {\n const index = ArrayPrototypeLastIndexOf.call(execArgv, process._eval);\n if (index > 0)\n execArgv = ArrayPrototypeSlice.call(execArgv), ArrayPrototypeSplice.call(execArgv, index - 1, 2);\n }\n if (args = [...execArgv, modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== void 0)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = void 0;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === void 0)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.call(args, options.argv0);\n else\n ArrayPrototypeUnshift.call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === void 0)\n throw new Error(\"Invalid stdio option\");\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(void 0, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== void 0)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 24) || @createInternalModuleById(24), { promisify } = @getInternalField(@internalModuleRegistry, 43) || @createInternalModuleById(43), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = Buffer.concat, BufferIsEncoding = Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = Array.prototype.push, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeUnshift = Array.prototype.unshift, ArrayPrototypeLastIndexOf = Array.prototype.lastIndexOf, ArrayPrototypeSplice = Array.prototype.splice, ArrayIsArray = Array.isArray, ArrayBufferIsView = ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSlice = String.prototype.slice, Uint8ArrayPrototypeIncludes = Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, void 0, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio);\n var env = options.envPairs || void 0;\n this.#encoding = options.encoding || void 0, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || void 0,\n env: env || process.env,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0\n }), this.pid = this.#handle.pid, onSpawnNT(this);\n }\n send() {\n console.log(\"ChildProcess.prototype.send() - Sorry! Not implemented yet\");\n }\n disconnect() {\n console.log(\"ChildProcess.prototype.disconnect() - Sorry! Not implemented yet\");\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === void 0 \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n"_s; +static constexpr ASCIILiteral NodeChildProcessCode = "(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === void 0)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.call(_stdout, StringPrototypeSlice.apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === void 0)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || void 0,\n cwd: options.cwd || void 0,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, void 0, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), execArgv = options.execArgv || process.execArgv, validateArgumentsNullCheck(execArgv, \"options.execArgv\"), execArgv === process.execArgv && process._eval != null) {\n const index = ArrayPrototypeLastIndexOf.call(execArgv, process._eval);\n if (index > 0)\n execArgv = ArrayPrototypeSlice.call(execArgv), ArrayPrototypeSplice.call(execArgv, index - 1, 2);\n }\n if (args = [...execArgv, modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== void 0)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = void 0;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === void 0)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.call(args, options.argv0);\n else\n ArrayPrototypeUnshift.call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === void 0)\n throw new Error(\"Invalid stdio option\");\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(void 0, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== void 0)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 24) || @createInternalModuleById(24), { promisify } = @getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = Buffer.concat, BufferIsEncoding = Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = Array.prototype.push, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeUnshift = Array.prototype.unshift, ArrayPrototypeLastIndexOf = Array.prototype.lastIndexOf, ArrayPrototypeSplice = Array.prototype.splice, ArrayIsArray = Array.isArray, ArrayBufferIsView = ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSlice = String.prototype.slice, Uint8ArrayPrototypeIncludes = Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, void 0, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio);\n var env = options.envPairs || void 0;\n this.#encoding = options.encoding || void 0, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || void 0,\n env: env || process.env,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0\n }), this.pid = this.#handle.pid, onSpawnNT(this);\n }\n send() {\n console.log(\"ChildProcess.prototype.send() - Sorry! Not implemented yet\");\n }\n disconnect() {\n console.log(\"ChildProcess.prototype.disconnect() - Sorry! Not implemented yet\");\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === void 0 \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n"_s; // // @@ -70,7 +70,7 @@ static constexpr ASCIILiteral NodeDomainCode = "(function (){\"use strict\";// s // // -static constexpr ASCIILiteral NodeEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.call(errorMonitor))\n handler.apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.call(handlers))\n handler.apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(void 0, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(void 0, { cause: signal\?.reason });\n return new Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(void 0, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = void 0, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === void 0 || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= void 0, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = void 0;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = void 0;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers])\n handler.apply(this, args);\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers]) {\n var result = handler.apply(this, args);\n if (result !== void 0 && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n"_s; +static constexpr ASCIILiteral NodeEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.call(errorMonitor))\n handler.apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.call(handlers))\n handler.apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(void 0, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(void 0, { cause: signal\?.reason });\n return new Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(void 0, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = void 0, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === void 0 || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= void 0, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = void 0;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = void 0;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.constructor = EventEmitter;\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers])\n handler.apply(this, args);\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers]) {\n var result = handler.apply(this, args);\n if (result !== void 0 && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n"_s; // // @@ -130,7 +130,7 @@ static constexpr ASCIILiteral NodeQuerystringCode = "(function (){\"use strict\" // // -static constexpr ASCIILiteral NodeReadlineCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new Promise((resolve, reject) => {\n ArrayPrototypePush.call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== void 0 && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.call(ch) + StringPrototypeCharCodeAt.call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.call(ch), keyShift = RegExpPrototypeExec.call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? void 0 : \"escape\", keyMeta = !0;\n if (keySeq = s, s.length !== 0 && (keyName !== void 0 || escaped))\n stream.emit(\"keypress\", escaped \? void 0 : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.call(ArrayPrototypeSlice.call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = void 0;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== void 0)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== void 0)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== void 0)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== void 0)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== void 0 && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === void 0)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === void 0)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === void 0 && !(output === null || output === void 0))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = void 0, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== void 0)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), { StringDecoder } = @requireNativeModule(\"node:string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = Array.from, ArrayIsArray = Array.isArray, ArrayPrototypeFilter = Array.prototype.filter, ArrayPrototypeSort = Array.prototype.sort, ArrayPrototypeIndexOf = Array.prototype.indexOf, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypePop = Array.prototype.pop, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeSplice = Array.prototype.splice, ArrayPrototypeReverse = Array.prototype.reverse, ArrayPrototypeShift = Array.prototype.shift, ArrayPrototypeUnshift = Array.prototype.unshift, RegExpPrototypeExec = RegExp.prototype.exec, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeCodePointAt = String.prototype.codePointAt, StringPrototypeSlice = String.prototype.slice, StringPrototypeToLowerCase = String.prototype.toLowerCase, StringPrototypeEndsWith = String.prototype.endsWith, StringPrototypeRepeat = String.prototype.repeat, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeTrim = String.prototype.trim, StringPrototypeNormalize = String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, MathMaxApply = Math.max.apply, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.call(iterable);\n }\n next() {\n return next.call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](mode) {\n var input = this.input, { setRawMode, wasInRawMode } = input;\n return debug(\"setRawMode\", mode, \"set!\"), wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== void 0)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === void 0)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.call(string) === 10)\n string = StringPrototypeSlice.call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, string)) !== null)\n ArrayPrototypePush.call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.call(this.line, 0, this.cursor), end = StringPrototypeSlice.call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.call(completions, (e) => getStringWidth(e)), width = MathMaxApply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"e\":\n this[kMoveCursor](Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n if (this.listenerCount(\"SIGTSTP\") > 0)\n this.emit(\"SIGTSTP\");\n else\n process.once(\"SIGCONT\", () => {\n if (!this.paused)\n this.pause(), this.emit(\"SIGCONT\");\n this[kSetRawMode](!0), this[kRefreshLine]();\n }), this[kSetRawMode](!1), process.kill(process.pid, \"SIGTSTP\");\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"end\":\n this[kMoveCursor](Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === void 0)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = void 0) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = void 0) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n }\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n"_s; +static constexpr ASCIILiteral NodeReadlineCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new Promise((resolve, reject) => {\n ArrayPrototypePush.call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== void 0 && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.call(ch) + StringPrototypeCharCodeAt.call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.call(ch), keyShift = RegExpPrototypeExec.call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? void 0 : \"escape\", keyMeta = !0;\n if (keySeq = s, s.length !== 0 && (keyName !== void 0 || escaped))\n stream.emit(\"keypress\", escaped \? void 0 : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.call(ArrayPrototypeSlice.call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = void 0;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== void 0)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== void 0)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== void 0)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== void 0)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== void 0 && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === void 0)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === void 0)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === void 0 && !(output === null || output === void 0))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = void 0, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== void 0)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), { StringDecoder } = @requireNativeModule(\"node:string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = Array.from, ArrayIsArray = Array.isArray, ArrayPrototypeFilter = Array.prototype.filter, ArrayPrototypeSort = Array.prototype.sort, ArrayPrototypeIndexOf = Array.prototype.indexOf, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypePop = Array.prototype.pop, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeSplice = Array.prototype.splice, ArrayPrototypeReverse = Array.prototype.reverse, ArrayPrototypeShift = Array.prototype.shift, ArrayPrototypeUnshift = Array.prototype.unshift, RegExpPrototypeExec = RegExp.prototype.exec, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeCodePointAt = String.prototype.codePointAt, StringPrototypeSlice = String.prototype.slice, StringPrototypeToLowerCase = String.prototype.toLowerCase, StringPrototypeEndsWith = String.prototype.endsWith, StringPrototypeRepeat = String.prototype.repeat, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeTrim = String.prototype.trim, StringPrototypeNormalize = String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, MathMaxApply = Math.max.apply, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.call(iterable);\n }\n next() {\n return next.call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](flag) {\n const mode = flag \? 1 : 0, wasInRawMode = this.input.isRaw;\n if (typeof this.input.setRawMode === \"function\")\n this.input.setRawMode(mode);\n return wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== void 0)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === void 0)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.call(string) === 10)\n string = StringPrototypeSlice.call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, string)) !== null)\n ArrayPrototypePush.call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.call(this.line, 0, this.cursor), end = StringPrototypeSlice.call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.call(completions, (e) => getStringWidth(e)), width = MathMaxApply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"e\":\n this[kMoveCursor](Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n if (this.listenerCount(\"SIGTSTP\") > 0)\n this.emit(\"SIGTSTP\");\n else\n process.once(\"SIGCONT\", () => {\n if (!this.paused)\n this.pause(), this.emit(\"SIGCONT\");\n this[kSetRawMode](!0), this[kRefreshLine]();\n }), this[kSetRawMode](!1), process.kill(process.pid, \"SIGTSTP\");\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"end\":\n this[kMoveCursor](Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === void 0)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = void 0) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = void 0) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n }\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n"_s; // // @@ -174,6 +174,10 @@ static constexpr ASCIILiteral NodeTraceEventsCode = "(function (){\"use strict\" // // +static constexpr ASCIILiteral NodeTtyCode = "(function (){\"use strict\";// src/js/out/tmp/node/tty.ts\nvar ReadStream = function(fd) {\n if (!(this instanceof ReadStream))\n return new ReadStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).ReadStream.call(this, `/dev/fd/${fd}`);\n return stream.isRaw = !1, stream.isTTY = isatty(stream.fd), stream;\n}, warnOnDeactivatedColors = function(env) {\n if (warned)\n return;\n let name = \"\";\n if (env.NODE_DISABLE_COLORS !== void 0)\n name = \"NODE_DISABLE_COLORS\";\n if (env.NO_COLOR !== void 0) {\n if (name !== \"\")\n name += \"' and '\";\n name += \"NO_COLOR\";\n }\n if (name !== \"\")\n process.emitWarning(`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, \"Warning\"), warned = !0;\n}, WriteStream = function(fd) {\n if (!(this instanceof WriteStream))\n return new WriteStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).WriteStream.call(this, `/dev/fd/${fd}`);\n if (stream.columns = void 0, stream.rows = void 0, stream.isTTY = isatty(stream.fd), stream.isTTY) {\n const windowSizeArray = [0, 0];\n if (_getWindowSize(fd, windowSizeArray) === !0)\n stream.columns = windowSizeArray[0], stream.rows = windowSizeArray[1];\n }\n return stream;\n}, { ttySetMode, isatty, getWindowSize: _getWindowSize } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"tty\");\nObject.defineProperty(ReadStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).ReadStream.prototype;\n return Object.defineProperty(ReadStream, \"prototype\", { value: Real }), ReadStream.prototype.setRawMode = function(flag) {\n const mode = flag \? 1 : 0, err = ttySetMode(this.fd, mode);\n if (err)\n return this.emit(\"error\", new Error(\"setRawMode failed with errno:\", err)), this;\n return this.isRaw = flag, this;\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar COLORS_2 = 1, COLORS_16 = 4, COLORS_256 = 8, COLORS_16m = 24, TERM_ENVS = {\n eterm: COLORS_16,\n cons25: COLORS_16,\n console: COLORS_16,\n cygwin: COLORS_16,\n dtterm: COLORS_16,\n gnome: COLORS_16,\n hurd: COLORS_16,\n jfbterm: COLORS_16,\n konsole: COLORS_16,\n kterm: COLORS_16,\n mlterm: COLORS_16,\n mosh: COLORS_16m,\n putty: COLORS_16,\n st: COLORS_16,\n \"rxvt-unicode-24bit\": COLORS_16m,\n terminator: COLORS_16m\n}, TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/], warned = !1;\nObject.defineProperty(WriteStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).WriteStream.prototype;\n Object.defineProperty(WriteStream, \"prototype\", { value: Real }), WriteStream.prototype._refreshSize = function() {\n const oldCols = this.columns, oldRows = this.rows, windowSizeArray = [0, 0];\n if (_getWindowSize(this.fd, windowSizeArray) === !0) {\n if (oldCols !== windowSizeArray[0] || oldRows !== windowSizeArray[1])\n this.columns = windowSizeArray[0], this.rows = windowSizeArray[1], this.emit(\"resize\");\n }\n };\n var readline = void 0;\n return WriteStream.prototype.clearLine = function(dir, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).clearLine(this, dir, cb);\n }, WriteStream.prototype.clearScreenDown = function(cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).clearScreenDown(this, cb);\n }, WriteStream.prototype.cursorTo = function(x, y, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).cursorTo(this, x, y, cb);\n }, WriteStream.prototype.getColorDepth = function(env = process.env) {\n if (env.FORCE_COLOR !== void 0)\n switch (env.FORCE_COLOR) {\n case \"\":\n case \"1\":\n case \"true\":\n return warnOnDeactivatedColors(env), COLORS_16;\n case \"2\":\n return warnOnDeactivatedColors(env), COLORS_256;\n case \"3\":\n return warnOnDeactivatedColors(env), COLORS_16m;\n default:\n return COLORS_2;\n }\n if (env.NODE_DISABLE_COLORS !== void 0 || env.NO_COLOR !== void 0 || env.TERM === \"dumb\")\n return COLORS_2;\n if (env.TMUX)\n return COLORS_256;\n if (env.CI) {\n if ([\"APPVEYOR\", \"BUILDKITE\", \"CIRCLECI\", \"DRONE\", \"GITHUB_ACTIONS\", \"GITLAB_CI\", \"TRAVIS\"].some((sign) => (sign in env)) || env.CI_NAME === \"codeship\")\n return COLORS_256;\n return COLORS_2;\n }\n if (\"TEAMCITY_VERSION\" in env)\n return RegExpPrototypeExec(/^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/, env.TEAMCITY_VERSION) !== null \? COLORS_16 : COLORS_2;\n switch (env.TERM_PROGRAM) {\n case \"iTerm.app\":\n if (!env.TERM_PROGRAM_VERSION || RegExpPrototypeExec(/^[0-2]\\./, env.TERM_PROGRAM_VERSION) !== null)\n return COLORS_256;\n return COLORS_16m;\n case \"HyperTerm\":\n case \"MacTerm\":\n return COLORS_16m;\n case \"Apple_Terminal\":\n return COLORS_256;\n }\n if (env.COLORTERM === \"truecolor\" || env.COLORTERM === \"24bit\")\n return COLORS_16m;\n if (env.TERM) {\n if (RegExpPrototypeExec(/^xterm-256/, env.TERM) !== null)\n return COLORS_256;\n const termEnv = StringPrototypeToLowerCase(env.TERM);\n if (TERM_ENVS[termEnv])\n return TERM_ENVS[termEnv];\n if (ArrayPrototypeSome(TERM_ENVS_REG_EXP, (term) => RegExpPrototypeExec(term, termEnv) !== null))\n return COLORS_16;\n }\n if (env.COLORTERM)\n return COLORS_16;\n return COLORS_2;\n }, WriteStream.prototype.getWindowSize = function() {\n return [this.columns, this.rows];\n }, WriteStream.prototype.hasColors = function(count, env) {\n if (env === void 0 && (count === void 0 || typeof count === \"object\" && count !== null))\n env = count, count = 16;\n else\n validateInteger(count, \"count\", 2);\n return count <= 2 ** this.getColorDepth(env);\n }, WriteStream.prototype.moveCursor = function(dx, dy, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).moveCursor(this, dx, dy, cb);\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!Number.isInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n};\nreturn { ReadStream, WriteStream, isatty }})\n"_s; +// + +// static constexpr ASCIILiteral NodeUrlCode = "(function (){\"use strict\";// src/js/out/tmp/node/url.ts\nvar Url = function() {\n this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;\n}, urlParse = function(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === \"object\" && url instanceof Url)\n return url;\n var u = new Url;\n return u.parse(url, parseQueryString, slashesDenoteHost), u;\n}, urlFormat = function(obj) {\n if (typeof obj === \"string\")\n obj = urlParse(obj);\n if (!(obj instanceof Url))\n return Url.prototype.format.call(obj);\n return obj.format();\n}, urlResolve = function(source, relative) {\n return urlParse(source, !1, !0).resolve(relative);\n}, urlResolveObject = function(source, relative) {\n if (!source)\n return relative;\n return urlParse(source, !1, !0).resolveObject(relative);\n}, urlToHttpOptions = function(url) {\n const options = {\n protocol: url.protocol,\n hostname: typeof url.hostname === \"string\" && url.hostname.startsWith(\"[\") \? url.hostname.slice(1, -1) : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname || \"\"}${url.search || \"\"}`,\n href: url.href\n };\n if (url.port !== \"\")\n options.port = Number(url.port);\n if (url.username || url.password)\n options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;\n return options;\n}, $, { URL, URLSearchParams } = globalThis;\nUrl.prototype = {};\nvar protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\\/\\/\?(\?!\\/)[^\?\\s]*)(\\\?[^\\s]*)\?$/, delims = [\"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\"], unwise = [\"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\"].concat(delims), autoEscape = [\"'\"].concat(unwise), nonHostChars = [\"%\", \"/\", \"\?\", \";\", \"#\"].concat(autoEscape), hostEndingChars = [\"/\", \"\?\", \"#\"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, hostlessProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, slashedProtocol = {\n http: !0,\n https: !0,\n ftp: !0,\n gopher: !0,\n file: !0,\n \"http:\": !0,\n \"https:\": !0,\n \"ftp:\": !0,\n \"gopher:\": !0,\n \"file:\": !0\n};\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== \"string\")\n @throwTypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n var queryIndex = url.indexOf(\"\?\"), splitter = queryIndex !== -1 && queryIndex < url.indexOf(\"#\") \? \"\?\" : \"#\", uSplit = url.split(splitter), slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, \"/\"), url = uSplit.join(splitter);\n var rest = url;\n if (rest = rest.trim(), !slashesDenoteHost && url.split(\"#\").length === 1) {\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n if (this.path = rest, this.href = rest, this.pathname = simplePath[1], simplePath[2])\n if (this.search = simplePath[2], parseQueryString)\n this.query = new URLSearchParams(this.search.substr(1)).toJSON();\n else\n this.query = this.search.substr(1);\n else if (parseQueryString)\n this.search = \"\", this.query = {};\n return this;\n }\n }\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto, rest = rest.substr(proto.length);\n }\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto]))\n rest = rest.substr(2), this.slashes = !0;\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n var hostEnd = -1;\n for (var i = 0;i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n var auth, atSign;\n if (hostEnd === -1)\n atSign = rest.lastIndexOf(\"@\");\n else\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n if (atSign !== -1)\n auth = rest.slice(0, atSign), rest = rest.slice(atSign + 1), this.auth = decodeURIComponent(auth);\n hostEnd = -1;\n for (var i = 0;i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n if (hostEnd === -1)\n hostEnd = rest.length;\n this.host = rest.slice(0, hostEnd), rest = rest.slice(hostEnd), this.parseHost(), this.hostname = this.hostname || \"\";\n var ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length;i < l; i++) {\n var part = hostparts[i];\n if (!part)\n continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = \"\";\n for (var j = 0, k = part.length;j < k; j++)\n if (part.charCodeAt(j) > 127)\n newpart += \"x\";\n else\n newpart += part[j];\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i), notHost = hostparts.slice(i + 1), bit = part.match(hostnamePartStart);\n if (bit)\n validParts.push(bit[1]), notHost.unshift(bit[2]);\n if (notHost.length)\n rest = \"/\" + notHost.join(\".\") + rest;\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen)\n this.hostname = \"\";\n else\n this.hostname = this.hostname.toLowerCase();\n if (!ipv6Hostname)\n this.hostname = new URL(\"http://\" + this.hostname).hostname;\n var p = this.port \? \":\" + this.port : \"\", h = this.hostname || \"\";\n if (this.host = h + p, this.href += this.host, ipv6Hostname) {\n if (this.hostname = this.hostname.substr(1, this.hostname.length - 2), rest[0] !== \"/\")\n rest = \"/\" + rest;\n }\n }\n if (!unsafeProtocol[lowerProto])\n for (var i = 0, l = autoEscape.length;i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae)\n esc = escape(ae);\n rest = rest.split(ae).join(esc);\n }\n var hash = rest.indexOf(\"#\");\n if (hash !== -1)\n this.hash = rest.substr(hash), rest = rest.slice(0, hash);\n var qm = rest.indexOf(\"\?\");\n if (qm !== -1) {\n if (this.search = rest.substr(qm), this.query = rest.substr(qm + 1), parseQueryString)\n this.query = new URLSearchParams(this.query);\n rest = rest.slice(0, qm);\n } else if (parseQueryString)\n this.search = \"\", this.query = {};\n if (rest)\n this.pathname = rest;\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname)\n this.pathname = \"/\";\n if (this.pathname || this.search) {\n var p = this.pathname || \"\", s = this.search || \"\";\n this.path = p + s;\n }\n return this.href = this.format(), this;\n};\nUrl.prototype.format = function() {\n var auth = this.auth || \"\";\n if (auth)\n auth = encodeURIComponent(auth), auth = auth.replace(/%3A/i, \":\"), auth += \"@\";\n var protocol = this.protocol || \"\", pathname = this.pathname || \"\", hash = this.hash || \"\", host = !1, query = \"\";\n if (this.host)\n host = auth + this.host;\n else if (this.hostname) {\n if (host = auth + (this.hostname.indexOf(\":\") === -1 \? this.hostname : \"[\" + this.hostname + \"]\"), this.port)\n host += \":\" + this.port;\n }\n if (this.query && typeof this.query === \"object\" && Object.keys(this.query).length)\n query = new URLSearchParams(this.query).toString();\n var search = this.search || query && \"\?\" + query || \"\";\n if (protocol && protocol.substr(-1) !== \":\")\n protocol += \":\";\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== !1) {\n if (host = \"//\" + (host || \"\"), pathname && pathname.charAt(0) !== \"/\")\n pathname = \"/\" + pathname;\n } else if (!host)\n host = \"\";\n if (hash && hash.charAt(0) !== \"#\")\n hash = \"#\" + hash;\n if (search && search.charAt(0) !== \"\?\")\n search = \"\?\" + search;\n return pathname = pathname.replace(/[\?#]/g, function(match) {\n return encodeURIComponent(match);\n }), search = search.replace(\"#\", \"%23\"), protocol + host + pathname + search + hash;\n};\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, !1, !0)).format();\n};\nUrl.prototype.resolveObject = function(relative) {\n if (typeof relative === \"string\") {\n var rel = new Url;\n rel.parse(relative, !1, !0), relative = rel;\n }\n var result = new Url, tkeys = Object.keys(this);\n for (var tk = 0;tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n if (result.hash = relative.hash, relative.href === \"\")\n return result.href = result.format(), result;\n if (relative.slashes && !relative.protocol) {\n var rkeys = Object.keys(relative);\n for (var rk = 0;rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== \"protocol\")\n result[rkey] = relative[rkey];\n }\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname)\n result.pathname = \"/\", result.path = result.pathname;\n return result.href = result.format(), result;\n }\n if (relative.protocol && relative.protocol !== result.protocol) {\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0;v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n return result.href = result.format(), result;\n }\n if (result.protocol = relative.protocol, !relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || \"\").split(\"/\");\n while (relPath.length && !(relative.host = relPath.shift()))\n ;\n if (!relative.host)\n relative.host = \"\";\n if (!relative.hostname)\n relative.hostname = \"\";\n if (relPath[0] !== \"\")\n relPath.unshift(\"\");\n if (relPath.length < 2)\n relPath.unshift(\"\");\n result.pathname = relPath.join(\"/\");\n } else\n result.pathname = relative.pathname;\n if (result.search = relative.search, result.query = relative.query, result.host = relative.host || \"\", result.auth = relative.auth, result.hostname = relative.hostname || relative.host, result.port = relative.port, result.pathname || result.search) {\n var p = result.pathname || \"\", s = result.search || \"\";\n result.path = p + s;\n }\n return result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n }\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === \"/\", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === \"/\", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split(\"/\") || [], relPath = relative.pathname && relative.pathname.split(\"/\") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];\n if (psychotic) {\n if (result.hostname = \"\", result.port = null, result.host)\n if (srcPath[0] === \"\")\n srcPath[0] = result.host;\n else\n srcPath.unshift(result.host);\n if (result.host = \"\", relative.protocol) {\n if (relative.hostname = null, relative.port = null, relative.host)\n if (relPath[0] === \"\")\n relPath[0] = relative.host;\n else\n relPath.unshift(relative.host);\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === \"\" || srcPath[0] === \"\");\n }\n if (isRelAbs)\n result.host = relative.host || relative.host === \"\" \? relative.host : result.host, result.hostname = relative.hostname || relative.hostname === \"\" \? relative.hostname : result.hostname, result.search = relative.search, result.query = relative.query, srcPath = relPath;\n else if (relPath.length) {\n if (!srcPath)\n srcPath = [];\n srcPath.pop(), srcPath = srcPath.concat(relPath), result.search = relative.search, result.query = relative.query;\n } else if (relative.search != null) {\n if (psychotic) {\n result.host = srcPath.shift(), result.hostname = result.host;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (result.search = relative.search, result.query = relative.query, result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.href = result.format(), result;\n }\n if (!srcPath.length) {\n if (result.pathname = null, result.search)\n result.path = \"/\" + result.search;\n else\n result.path = null;\n return result.href = result.format(), result;\n }\n var last = srcPath.slice(-1)[0], hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === \".\" || last === \"..\") || last === \"\", up = 0;\n for (var i = srcPath.length;i >= 0; i--)\n if (last = srcPath[i], last === \".\")\n srcPath.splice(i, 1);\n else if (last === \"..\")\n srcPath.splice(i, 1), up++;\n else if (up)\n srcPath.splice(i, 1), up--;\n if (!mustEndAbs && !removeAllDots)\n for (;up--; up)\n srcPath.unshift(\"..\");\n if (mustEndAbs && srcPath[0] !== \"\" && (!srcPath[0] || srcPath[0].charAt(0) !== \"/\"))\n srcPath.unshift(\"\");\n if (hasTrailingSlash && srcPath.join(\"/\").substr(-1) !== \"/\")\n srcPath.push(\"\");\n var isAbsolute = srcPath[0] === \"\" || srcPath[0] && srcPath[0].charAt(0) === \"/\";\n if (psychotic) {\n result.hostname = isAbsolute \? \"\" : srcPath.length \? srcPath.shift() : \"\", result.host = result.hostname;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (mustEndAbs = mustEndAbs || result.host && srcPath.length, mustEndAbs && !isAbsolute)\n srcPath.unshift(\"\");\n if (srcPath.length > 0)\n result.pathname = srcPath.join(\"/\");\n else\n result.pathname = null, result.path = null;\n if (result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.auth = relative.auth || result.auth, result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n};\nUrl.prototype.parseHost = function() {\n var host = this.host, port = portPattern.exec(host);\n if (port) {\n if (port = port[0], port !== \":\")\n this.port = port.substr(1);\n host = host.substr(0, host.length - port.length);\n }\n if (host)\n this.hostname = host;\n};\nvar pathToFileURL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"pathToFileURL\"), fileURLToPath = globalThis[globalThis.Symbol.for('Bun.lazy')](\"fileURLToPath\");\n$ = {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url,\n URLSearchParams,\n URL,\n pathToFileURL,\n fileURLToPath,\n urlToHttpOptions\n};\nreturn $})\n"_s; // @@ -190,7 +194,7 @@ static constexpr ASCIILiteral NodeVMCode = "(function (){\"use strict\";// src/j // // -static constexpr ASCIILiteral NodeWasiCode = "(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => @requireNativeModule(\"node:tty\").isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 26) || @createInternalModuleById(26)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n"_s; +static constexpr ASCIILiteral NodeWasiCode = "(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => (@getInternalField(@internalModuleRegistry, 42) || @createInternalModuleById(42)).isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 26) || @createInternalModuleById(26)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n"_s; // // @@ -198,7 +202,7 @@ static constexpr ASCIILiteral NodeWorkerThreadsCode = "(function (){\"use strict // // -static constexpr ASCIILiteral NodeZlibCode = "(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 4) || @createInternalModuleById(4), BufferModule = @requireNativeModule(\"node:buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), Util = @getInternalField(@internalModuleRegistry, 43) || @createInternalModuleById(43), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = Array, exports.Buf16 = Array, exports.Buf32 = Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n"_s; +static constexpr ASCIILiteral NodeZlibCode = "(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 4) || @createInternalModuleById(4), BufferModule = @requireNativeModule(\"node:buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), Util = @getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = Array, exports.Buf16 = Array, exports.Buf32 = Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n"_s; // // @@ -251,7 +255,7 @@ static constexpr ASCIILiteral InternalSharedCode = "(function (){\"use strict\"; // // -static constexpr ASCIILiteral NodeAssertCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 43) || @createInternalModuleById(43), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"[34m\", green = \"[32m\", white = \"[39m\", red = \"[31m\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n"_s; +static constexpr ASCIILiteral NodeAssertCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"[34m\", green = \"[32m\", white = \"[39m\", red = \"[31m\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n"_s; // // @@ -263,7 +267,7 @@ static constexpr ASCIILiteral NodeAsyncHooksCode = "(function (){\"use strict\"; // // -static constexpr ASCIILiteral NodeChildProcessCode = "(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === void 0)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.call(_stdout, StringPrototypeSlice.apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === void 0)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || void 0,\n cwd: options.cwd || void 0,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, void 0, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), execArgv = options.execArgv || process.execArgv, validateArgumentsNullCheck(execArgv, \"options.execArgv\"), execArgv === process.execArgv && process._eval != null) {\n const index = ArrayPrototypeLastIndexOf.call(execArgv, process._eval);\n if (index > 0)\n execArgv = ArrayPrototypeSlice.call(execArgv), ArrayPrototypeSplice.call(execArgv, index - 1, 2);\n }\n if (args = [...execArgv, modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== void 0)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = void 0;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === void 0)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.call(args, options.argv0);\n else\n ArrayPrototypeUnshift.call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === void 0)\n throw new Error(\"Invalid stdio option\");\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(void 0, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== void 0)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 24) || @createInternalModuleById(24), { promisify } = @getInternalField(@internalModuleRegistry, 43) || @createInternalModuleById(43), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = Buffer.concat, BufferIsEncoding = Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = Array.prototype.push, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeUnshift = Array.prototype.unshift, ArrayPrototypeLastIndexOf = Array.prototype.lastIndexOf, ArrayPrototypeSplice = Array.prototype.splice, ArrayIsArray = Array.isArray, ArrayBufferIsView = ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSlice = String.prototype.slice, Uint8ArrayPrototypeIncludes = Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, void 0, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio);\n var env = options.envPairs || void 0;\n this.#encoding = options.encoding || void 0, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || void 0,\n env: env || process.env,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0\n }), this.pid = this.#handle.pid, onSpawnNT(this);\n }\n send() {\n console.log(\"ChildProcess.prototype.send() - Sorry! Not implemented yet\");\n }\n disconnect() {\n console.log(\"ChildProcess.prototype.disconnect() - Sorry! Not implemented yet\");\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === void 0 \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n"_s; +static constexpr ASCIILiteral NodeChildProcessCode = "(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === void 0)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.call(_stdout, StringPrototypeSlice.apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === void 0)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || void 0,\n cwd: options.cwd || void 0,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, void 0, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), execArgv = options.execArgv || process.execArgv, validateArgumentsNullCheck(execArgv, \"options.execArgv\"), execArgv === process.execArgv && process._eval != null) {\n const index = ArrayPrototypeLastIndexOf.call(execArgv, process._eval);\n if (index > 0)\n execArgv = ArrayPrototypeSlice.call(execArgv), ArrayPrototypeSplice.call(execArgv, index - 1, 2);\n }\n if (args = [...execArgv, modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== void 0)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = void 0;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === void 0)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.call(args, options.argv0);\n else\n ArrayPrototypeUnshift.call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === void 0)\n throw new Error(\"Invalid stdio option\");\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(void 0, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== void 0)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 24) || @createInternalModuleById(24), { promisify } = @getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = Buffer.concat, BufferIsEncoding = Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = Array.prototype.push, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeUnshift = Array.prototype.unshift, ArrayPrototypeLastIndexOf = Array.prototype.lastIndexOf, ArrayPrototypeSplice = Array.prototype.splice, ArrayIsArray = Array.isArray, ArrayBufferIsView = ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSlice = String.prototype.slice, Uint8ArrayPrototypeIncludes = Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, void 0, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio);\n var env = options.envPairs || void 0;\n this.#encoding = options.encoding || void 0, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || void 0,\n env: env || process.env,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0\n }), this.pid = this.#handle.pid, onSpawnNT(this);\n }\n send() {\n console.log(\"ChildProcess.prototype.send() - Sorry! Not implemented yet\");\n }\n disconnect() {\n console.log(\"ChildProcess.prototype.disconnect() - Sorry! Not implemented yet\");\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === void 0 \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n"_s; // // @@ -299,7 +303,7 @@ static constexpr ASCIILiteral NodeDomainCode = "(function (){\"use strict\";// s // // -static constexpr ASCIILiteral NodeEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.call(errorMonitor))\n handler.apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.call(handlers))\n handler.apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(void 0, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(void 0, { cause: signal\?.reason });\n return new Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(void 0, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = void 0, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === void 0 || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= void 0, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = void 0;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = void 0;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers])\n handler.apply(this, args);\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers]) {\n var result = handler.apply(this, args);\n if (result !== void 0 && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n"_s; +static constexpr ASCIILiteral NodeEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.call(errorMonitor))\n handler.apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.call(handlers))\n handler.apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(void 0, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(void 0, { cause: signal\?.reason });\n return new Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(void 0, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = void 0, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === void 0 || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= void 0, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = void 0;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = void 0;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.constructor = EventEmitter;\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers])\n handler.apply(this, args);\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers]) {\n var result = handler.apply(this, args);\n if (result !== void 0 && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n"_s; // // @@ -359,7 +363,7 @@ static constexpr ASCIILiteral NodeQuerystringCode = "(function (){\"use strict\" // // -static constexpr ASCIILiteral NodeReadlineCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new Promise((resolve, reject) => {\n ArrayPrototypePush.call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== void 0 && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.call(ch) + StringPrototypeCharCodeAt.call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.call(ch), keyShift = RegExpPrototypeExec.call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? void 0 : \"escape\", keyMeta = !0;\n if (keySeq = s, s.length !== 0 && (keyName !== void 0 || escaped))\n stream.emit(\"keypress\", escaped \? void 0 : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.call(ArrayPrototypeSlice.call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = void 0;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== void 0)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== void 0)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== void 0)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== void 0)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== void 0 && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === void 0)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === void 0)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === void 0 && !(output === null || output === void 0))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = void 0, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== void 0)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), { StringDecoder } = @requireNativeModule(\"node:string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = Array.from, ArrayIsArray = Array.isArray, ArrayPrototypeFilter = Array.prototype.filter, ArrayPrototypeSort = Array.prototype.sort, ArrayPrototypeIndexOf = Array.prototype.indexOf, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypePop = Array.prototype.pop, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeSplice = Array.prototype.splice, ArrayPrototypeReverse = Array.prototype.reverse, ArrayPrototypeShift = Array.prototype.shift, ArrayPrototypeUnshift = Array.prototype.unshift, RegExpPrototypeExec = RegExp.prototype.exec, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeCodePointAt = String.prototype.codePointAt, StringPrototypeSlice = String.prototype.slice, StringPrototypeToLowerCase = String.prototype.toLowerCase, StringPrototypeEndsWith = String.prototype.endsWith, StringPrototypeRepeat = String.prototype.repeat, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeTrim = String.prototype.trim, StringPrototypeNormalize = String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, MathMaxApply = Math.max.apply, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.call(iterable);\n }\n next() {\n return next.call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](mode) {\n var input = this.input, { setRawMode, wasInRawMode } = input;\n return debug(\"setRawMode\", mode, \"set!\"), wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== void 0)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === void 0)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.call(string) === 10)\n string = StringPrototypeSlice.call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, string)) !== null)\n ArrayPrototypePush.call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.call(this.line, 0, this.cursor), end = StringPrototypeSlice.call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.call(completions, (e) => getStringWidth(e)), width = MathMaxApply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"e\":\n this[kMoveCursor](Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"end\":\n this[kMoveCursor](Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === void 0)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = void 0) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = void 0) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n }\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n"_s; +static constexpr ASCIILiteral NodeReadlineCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new Promise((resolve, reject) => {\n ArrayPrototypePush.call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== void 0 && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.call(ch) + StringPrototypeCharCodeAt.call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.call(ch), keyShift = RegExpPrototypeExec.call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? void 0 : \"escape\", keyMeta = !0;\n if (keySeq = s, s.length !== 0 && (keyName !== void 0 || escaped))\n stream.emit(\"keypress\", escaped \? void 0 : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.call(ArrayPrototypeSlice.call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = void 0;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== void 0)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== void 0)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== void 0)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== void 0)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== void 0 && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === void 0)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === void 0)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === void 0 && !(output === null || output === void 0))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = void 0, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== void 0)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), { StringDecoder } = @requireNativeModule(\"node:string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = Array.from, ArrayIsArray = Array.isArray, ArrayPrototypeFilter = Array.prototype.filter, ArrayPrototypeSort = Array.prototype.sort, ArrayPrototypeIndexOf = Array.prototype.indexOf, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypePop = Array.prototype.pop, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeSplice = Array.prototype.splice, ArrayPrototypeReverse = Array.prototype.reverse, ArrayPrototypeShift = Array.prototype.shift, ArrayPrototypeUnshift = Array.prototype.unshift, RegExpPrototypeExec = RegExp.prototype.exec, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeCodePointAt = String.prototype.codePointAt, StringPrototypeSlice = String.prototype.slice, StringPrototypeToLowerCase = String.prototype.toLowerCase, StringPrototypeEndsWith = String.prototype.endsWith, StringPrototypeRepeat = String.prototype.repeat, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeTrim = String.prototype.trim, StringPrototypeNormalize = String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, MathMaxApply = Math.max.apply, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.call(iterable);\n }\n next() {\n return next.call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](flag) {\n const mode = flag \? 1 : 0, wasInRawMode = this.input.isRaw;\n if (typeof this.input.setRawMode === \"function\")\n this.input.setRawMode(mode);\n return wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== void 0)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === void 0)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.call(string) === 10)\n string = StringPrototypeSlice.call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, string)) !== null)\n ArrayPrototypePush.call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.call(this.line, 0, this.cursor), end = StringPrototypeSlice.call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.call(completions, (e) => getStringWidth(e)), width = MathMaxApply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"e\":\n this[kMoveCursor](Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"end\":\n this[kMoveCursor](Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === void 0)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = void 0) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = void 0) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n }\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n"_s; // // @@ -403,6 +407,10 @@ static constexpr ASCIILiteral NodeTraceEventsCode = "(function (){\"use strict\" // // +static constexpr ASCIILiteral NodeTtyCode = "(function (){\"use strict\";// src/js/out/tmp/node/tty.ts\nvar ReadStream = function(fd) {\n if (!(this instanceof ReadStream))\n return new ReadStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).ReadStream.call(this, `/dev/fd/${fd}`);\n return stream.isRaw = !1, stream.isTTY = isatty(stream.fd), stream;\n}, warnOnDeactivatedColors = function(env) {\n if (warned)\n return;\n let name = \"\";\n if (env.NODE_DISABLE_COLORS !== void 0)\n name = \"NODE_DISABLE_COLORS\";\n if (env.NO_COLOR !== void 0) {\n if (name !== \"\")\n name += \"' and '\";\n name += \"NO_COLOR\";\n }\n if (name !== \"\")\n process.emitWarning(`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, \"Warning\"), warned = !0;\n}, WriteStream = function(fd) {\n if (!(this instanceof WriteStream))\n return new WriteStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).WriteStream.call(this, `/dev/fd/${fd}`);\n if (stream.columns = void 0, stream.rows = void 0, stream.isTTY = isatty(stream.fd), stream.isTTY) {\n const windowSizeArray = [0, 0];\n if (_getWindowSize(fd, windowSizeArray) === !0)\n stream.columns = windowSizeArray[0], stream.rows = windowSizeArray[1];\n }\n return stream;\n}, { ttySetMode, isatty, getWindowSize: _getWindowSize } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"tty\");\nObject.defineProperty(ReadStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).ReadStream.prototype;\n return Object.defineProperty(ReadStream, \"prototype\", { value: Real }), ReadStream.prototype.setRawMode = function(flag) {\n const mode = flag \? 1 : 0, err = ttySetMode(this.fd, mode);\n if (err)\n return this.emit(\"error\", new Error(\"setRawMode failed with errno:\", err)), this;\n return this.isRaw = flag, this;\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar OSRelease, COLORS_2 = 1, COLORS_16 = 4, COLORS_256 = 8, COLORS_16m = 24, TERM_ENVS = {\n eterm: COLORS_16,\n cons25: COLORS_16,\n console: COLORS_16,\n cygwin: COLORS_16,\n dtterm: COLORS_16,\n gnome: COLORS_16,\n hurd: COLORS_16,\n jfbterm: COLORS_16,\n konsole: COLORS_16,\n kterm: COLORS_16,\n mlterm: COLORS_16,\n mosh: COLORS_16m,\n putty: COLORS_16,\n st: COLORS_16,\n \"rxvt-unicode-24bit\": COLORS_16m,\n terminator: COLORS_16m\n}, TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/], warned = !1;\nObject.defineProperty(WriteStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).WriteStream.prototype;\n Object.defineProperty(WriteStream, \"prototype\", { value: Real }), WriteStream.prototype._refreshSize = function() {\n const oldCols = this.columns, oldRows = this.rows, windowSizeArray = [0, 0];\n if (_getWindowSize(this.fd, windowSizeArray) === !0) {\n if (oldCols !== windowSizeArray[0] || oldRows !== windowSizeArray[1])\n this.columns = windowSizeArray[0], this.rows = windowSizeArray[1], this.emit(\"resize\");\n }\n };\n var readline = void 0;\n return WriteStream.prototype.clearLine = function(dir, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).clearLine(this, dir, cb);\n }, WriteStream.prototype.clearScreenDown = function(cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).clearScreenDown(this, cb);\n }, WriteStream.prototype.cursorTo = function(x, y, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).cursorTo(this, x, y, cb);\n }, WriteStream.prototype.getColorDepth = function(env = process.env) {\n if (env.FORCE_COLOR !== void 0)\n switch (env.FORCE_COLOR) {\n case \"\":\n case \"1\":\n case \"true\":\n return warnOnDeactivatedColors(env), COLORS_16;\n case \"2\":\n return warnOnDeactivatedColors(env), COLORS_256;\n case \"3\":\n return warnOnDeactivatedColors(env), COLORS_16m;\n default:\n return COLORS_2;\n }\n if (env.NODE_DISABLE_COLORS !== void 0 || env.NO_COLOR !== void 0 || env.TERM === \"dumb\")\n return COLORS_2;\n if (OSRelease === void 0) {\n const { release } = @getInternalField(@internalModuleRegistry, 24) || @createInternalModuleById(24);\n OSRelease = StringPrototypeSplit(release(), \".\");\n }\n if (+OSRelease[0] >= 10) {\n const build = +OSRelease[2];\n if (build >= 14931)\n return COLORS_16m;\n if (build >= 10586)\n return COLORS_256;\n }\n return COLORS_16;\n switch (env.TERM_PROGRAM) {\n case \"iTerm.app\":\n if (!env.TERM_PROGRAM_VERSION || RegExpPrototypeExec(/^[0-2]\\./, env.TERM_PROGRAM_VERSION) !== null)\n return COLORS_256;\n return COLORS_16m;\n case \"HyperTerm\":\n case \"MacTerm\":\n return COLORS_16m;\n case \"Apple_Terminal\":\n return COLORS_256;\n }\n }, WriteStream.prototype.getWindowSize = function() {\n return [this.columns, this.rows];\n }, WriteStream.prototype.hasColors = function(count, env) {\n if (env === void 0 && (count === void 0 || typeof count === \"object\" && count !== null))\n env = count, count = 16;\n else\n validateInteger(count, \"count\", 2);\n return count <= 2 ** this.getColorDepth(env);\n }, WriteStream.prototype.moveCursor = function(dx, dy, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).moveCursor(this, dx, dy, cb);\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!Number.isInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n};\nreturn { ReadStream, WriteStream, isatty }})\n"_s; +// + +// static constexpr ASCIILiteral NodeUrlCode = "(function (){\"use strict\";// src/js/out/tmp/node/url.ts\nvar Url = function() {\n this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;\n}, urlParse = function(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === \"object\" && url instanceof Url)\n return url;\n var u = new Url;\n return u.parse(url, parseQueryString, slashesDenoteHost), u;\n}, urlFormat = function(obj) {\n if (typeof obj === \"string\")\n obj = urlParse(obj);\n if (!(obj instanceof Url))\n return Url.prototype.format.call(obj);\n return obj.format();\n}, urlResolve = function(source, relative) {\n return urlParse(source, !1, !0).resolve(relative);\n}, urlResolveObject = function(source, relative) {\n if (!source)\n return relative;\n return urlParse(source, !1, !0).resolveObject(relative);\n}, urlToHttpOptions = function(url) {\n const options = {\n protocol: url.protocol,\n hostname: typeof url.hostname === \"string\" && url.hostname.startsWith(\"[\") \? url.hostname.slice(1, -1) : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname || \"\"}${url.search || \"\"}`,\n href: url.href\n };\n if (url.port !== \"\")\n options.port = Number(url.port);\n if (url.username || url.password)\n options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;\n return options;\n}, $, { URL, URLSearchParams } = globalThis;\nUrl.prototype = {};\nvar protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\\/\\/\?(\?!\\/)[^\?\\s]*)(\\\?[^\\s]*)\?$/, delims = [\"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\"], unwise = [\"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\"].concat(delims), autoEscape = [\"'\"].concat(unwise), nonHostChars = [\"%\", \"/\", \"\?\", \";\", \"#\"].concat(autoEscape), hostEndingChars = [\"/\", \"\?\", \"#\"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, hostlessProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, slashedProtocol = {\n http: !0,\n https: !0,\n ftp: !0,\n gopher: !0,\n file: !0,\n \"http:\": !0,\n \"https:\": !0,\n \"ftp:\": !0,\n \"gopher:\": !0,\n \"file:\": !0\n};\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== \"string\")\n @throwTypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n var queryIndex = url.indexOf(\"\?\"), splitter = queryIndex !== -1 && queryIndex < url.indexOf(\"#\") \? \"\?\" : \"#\", uSplit = url.split(splitter), slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, \"/\"), url = uSplit.join(splitter);\n var rest = url;\n if (rest = rest.trim(), !slashesDenoteHost && url.split(\"#\").length === 1) {\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n if (this.path = rest, this.href = rest, this.pathname = simplePath[1], simplePath[2])\n if (this.search = simplePath[2], parseQueryString)\n this.query = new URLSearchParams(this.search.substr(1)).toJSON();\n else\n this.query = this.search.substr(1);\n else if (parseQueryString)\n this.search = \"\", this.query = {};\n return this;\n }\n }\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto, rest = rest.substr(proto.length);\n }\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto]))\n rest = rest.substr(2), this.slashes = !0;\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n var hostEnd = -1;\n for (var i = 0;i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n var auth, atSign;\n if (hostEnd === -1)\n atSign = rest.lastIndexOf(\"@\");\n else\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n if (atSign !== -1)\n auth = rest.slice(0, atSign), rest = rest.slice(atSign + 1), this.auth = decodeURIComponent(auth);\n hostEnd = -1;\n for (var i = 0;i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n if (hostEnd === -1)\n hostEnd = rest.length;\n this.host = rest.slice(0, hostEnd), rest = rest.slice(hostEnd), this.parseHost(), this.hostname = this.hostname || \"\";\n var ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length;i < l; i++) {\n var part = hostparts[i];\n if (!part)\n continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = \"\";\n for (var j = 0, k = part.length;j < k; j++)\n if (part.charCodeAt(j) > 127)\n newpart += \"x\";\n else\n newpart += part[j];\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i), notHost = hostparts.slice(i + 1), bit = part.match(hostnamePartStart);\n if (bit)\n validParts.push(bit[1]), notHost.unshift(bit[2]);\n if (notHost.length)\n rest = \"/\" + notHost.join(\".\") + rest;\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen)\n this.hostname = \"\";\n else\n this.hostname = this.hostname.toLowerCase();\n if (!ipv6Hostname)\n this.hostname = new URL(\"http://\" + this.hostname).hostname;\n var p = this.port \? \":\" + this.port : \"\", h = this.hostname || \"\";\n if (this.host = h + p, this.href += this.host, ipv6Hostname) {\n if (this.hostname = this.hostname.substr(1, this.hostname.length - 2), rest[0] !== \"/\")\n rest = \"/\" + rest;\n }\n }\n if (!unsafeProtocol[lowerProto])\n for (var i = 0, l = autoEscape.length;i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae)\n esc = escape(ae);\n rest = rest.split(ae).join(esc);\n }\n var hash = rest.indexOf(\"#\");\n if (hash !== -1)\n this.hash = rest.substr(hash), rest = rest.slice(0, hash);\n var qm = rest.indexOf(\"\?\");\n if (qm !== -1) {\n if (this.search = rest.substr(qm), this.query = rest.substr(qm + 1), parseQueryString)\n this.query = new URLSearchParams(this.query);\n rest = rest.slice(0, qm);\n } else if (parseQueryString)\n this.search = \"\", this.query = {};\n if (rest)\n this.pathname = rest;\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname)\n this.pathname = \"/\";\n if (this.pathname || this.search) {\n var p = this.pathname || \"\", s = this.search || \"\";\n this.path = p + s;\n }\n return this.href = this.format(), this;\n};\nUrl.prototype.format = function() {\n var auth = this.auth || \"\";\n if (auth)\n auth = encodeURIComponent(auth), auth = auth.replace(/%3A/i, \":\"), auth += \"@\";\n var protocol = this.protocol || \"\", pathname = this.pathname || \"\", hash = this.hash || \"\", host = !1, query = \"\";\n if (this.host)\n host = auth + this.host;\n else if (this.hostname) {\n if (host = auth + (this.hostname.indexOf(\":\") === -1 \? this.hostname : \"[\" + this.hostname + \"]\"), this.port)\n host += \":\" + this.port;\n }\n if (this.query && typeof this.query === \"object\" && Object.keys(this.query).length)\n query = new URLSearchParams(this.query).toString();\n var search = this.search || query && \"\?\" + query || \"\";\n if (protocol && protocol.substr(-1) !== \":\")\n protocol += \":\";\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== !1) {\n if (host = \"//\" + (host || \"\"), pathname && pathname.charAt(0) !== \"/\")\n pathname = \"/\" + pathname;\n } else if (!host)\n host = \"\";\n if (hash && hash.charAt(0) !== \"#\")\n hash = \"#\" + hash;\n if (search && search.charAt(0) !== \"\?\")\n search = \"\?\" + search;\n return pathname = pathname.replace(/[\?#]/g, function(match) {\n return encodeURIComponent(match);\n }), search = search.replace(\"#\", \"%23\"), protocol + host + pathname + search + hash;\n};\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, !1, !0)).format();\n};\nUrl.prototype.resolveObject = function(relative) {\n if (typeof relative === \"string\") {\n var rel = new Url;\n rel.parse(relative, !1, !0), relative = rel;\n }\n var result = new Url, tkeys = Object.keys(this);\n for (var tk = 0;tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n if (result.hash = relative.hash, relative.href === \"\")\n return result.href = result.format(), result;\n if (relative.slashes && !relative.protocol) {\n var rkeys = Object.keys(relative);\n for (var rk = 0;rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== \"protocol\")\n result[rkey] = relative[rkey];\n }\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname)\n result.pathname = \"/\", result.path = result.pathname;\n return result.href = result.format(), result;\n }\n if (relative.protocol && relative.protocol !== result.protocol) {\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0;v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n return result.href = result.format(), result;\n }\n if (result.protocol = relative.protocol, !relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || \"\").split(\"/\");\n while (relPath.length && !(relative.host = relPath.shift()))\n ;\n if (!relative.host)\n relative.host = \"\";\n if (!relative.hostname)\n relative.hostname = \"\";\n if (relPath[0] !== \"\")\n relPath.unshift(\"\");\n if (relPath.length < 2)\n relPath.unshift(\"\");\n result.pathname = relPath.join(\"/\");\n } else\n result.pathname = relative.pathname;\n if (result.search = relative.search, result.query = relative.query, result.host = relative.host || \"\", result.auth = relative.auth, result.hostname = relative.hostname || relative.host, result.port = relative.port, result.pathname || result.search) {\n var p = result.pathname || \"\", s = result.search || \"\";\n result.path = p + s;\n }\n return result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n }\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === \"/\", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === \"/\", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split(\"/\") || [], relPath = relative.pathname && relative.pathname.split(\"/\") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];\n if (psychotic) {\n if (result.hostname = \"\", result.port = null, result.host)\n if (srcPath[0] === \"\")\n srcPath[0] = result.host;\n else\n srcPath.unshift(result.host);\n if (result.host = \"\", relative.protocol) {\n if (relative.hostname = null, relative.port = null, relative.host)\n if (relPath[0] === \"\")\n relPath[0] = relative.host;\n else\n relPath.unshift(relative.host);\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === \"\" || srcPath[0] === \"\");\n }\n if (isRelAbs)\n result.host = relative.host || relative.host === \"\" \? relative.host : result.host, result.hostname = relative.hostname || relative.hostname === \"\" \? relative.hostname : result.hostname, result.search = relative.search, result.query = relative.query, srcPath = relPath;\n else if (relPath.length) {\n if (!srcPath)\n srcPath = [];\n srcPath.pop(), srcPath = srcPath.concat(relPath), result.search = relative.search, result.query = relative.query;\n } else if (relative.search != null) {\n if (psychotic) {\n result.host = srcPath.shift(), result.hostname = result.host;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (result.search = relative.search, result.query = relative.query, result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.href = result.format(), result;\n }\n if (!srcPath.length) {\n if (result.pathname = null, result.search)\n result.path = \"/\" + result.search;\n else\n result.path = null;\n return result.href = result.format(), result;\n }\n var last = srcPath.slice(-1)[0], hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === \".\" || last === \"..\") || last === \"\", up = 0;\n for (var i = srcPath.length;i >= 0; i--)\n if (last = srcPath[i], last === \".\")\n srcPath.splice(i, 1);\n else if (last === \"..\")\n srcPath.splice(i, 1), up++;\n else if (up)\n srcPath.splice(i, 1), up--;\n if (!mustEndAbs && !removeAllDots)\n for (;up--; up)\n srcPath.unshift(\"..\");\n if (mustEndAbs && srcPath[0] !== \"\" && (!srcPath[0] || srcPath[0].charAt(0) !== \"/\"))\n srcPath.unshift(\"\");\n if (hasTrailingSlash && srcPath.join(\"/\").substr(-1) !== \"/\")\n srcPath.push(\"\");\n var isAbsolute = srcPath[0] === \"\" || srcPath[0] && srcPath[0].charAt(0) === \"/\";\n if (psychotic) {\n result.hostname = isAbsolute \? \"\" : srcPath.length \? srcPath.shift() : \"\", result.host = result.hostname;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (mustEndAbs = mustEndAbs || result.host && srcPath.length, mustEndAbs && !isAbsolute)\n srcPath.unshift(\"\");\n if (srcPath.length > 0)\n result.pathname = srcPath.join(\"/\");\n else\n result.pathname = null, result.path = null;\n if (result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.auth = relative.auth || result.auth, result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n};\nUrl.prototype.parseHost = function() {\n var host = this.host, port = portPattern.exec(host);\n if (port) {\n if (port = port[0], port !== \":\")\n this.port = port.substr(1);\n host = host.substr(0, host.length - port.length);\n }\n if (host)\n this.hostname = host;\n};\nvar pathToFileURL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"pathToFileURL\"), fileURLToPath = globalThis[globalThis.Symbol.for('Bun.lazy')](\"fileURLToPath\");\n$ = {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url,\n URLSearchParams,\n URL,\n pathToFileURL,\n fileURLToPath,\n urlToHttpOptions\n};\nreturn $})\n"_s; // @@ -419,7 +427,7 @@ static constexpr ASCIILiteral NodeVMCode = "(function (){\"use strict\";// src/j // // -static constexpr ASCIILiteral NodeWasiCode = "(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => @requireNativeModule(\"node:tty\").isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 26) || @createInternalModuleById(26)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n"_s; +static constexpr ASCIILiteral NodeWasiCode = "(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => (@getInternalField(@internalModuleRegistry, 42) || @createInternalModuleById(42)).isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 26) || @createInternalModuleById(26)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n"_s; // // @@ -427,7 +435,7 @@ static constexpr ASCIILiteral NodeWorkerThreadsCode = "(function (){\"use strict // // -static constexpr ASCIILiteral NodeZlibCode = "(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 4) || @createInternalModuleById(4), BufferModule = @requireNativeModule(\"node:buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), Util = @getInternalField(@internalModuleRegistry, 43) || @createInternalModuleById(43), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = Array, exports.Buf16 = Array, exports.Buf32 = Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n"_s; +static constexpr ASCIILiteral NodeZlibCode = "(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 4) || @createInternalModuleById(4), BufferModule = @requireNativeModule(\"node:buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), Util = @getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = Array, exports.Buf16 = Array, exports.Buf32 = Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n"_s; // // @@ -481,7 +489,7 @@ static constexpr ASCIILiteral InternalSharedCode = "(function (){\"use strict\"; // // -static constexpr ASCIILiteral NodeAssertCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 43) || @createInternalModuleById(43), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"[34m\", green = \"[32m\", white = \"[39m\", red = \"[31m\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n"_s; +static constexpr ASCIILiteral NodeAssertCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"[34m\", green = \"[32m\", white = \"[39m\", red = \"[31m\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n"_s; // // @@ -493,7 +501,7 @@ static constexpr ASCIILiteral NodeAsyncHooksCode = "(function (){\"use strict\"; // // -static constexpr ASCIILiteral NodeChildProcessCode = "(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === void 0)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.call(_stdout, StringPrototypeSlice.apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === void 0)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || void 0,\n cwd: options.cwd || void 0,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, void 0, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), execArgv = options.execArgv || process.execArgv, validateArgumentsNullCheck(execArgv, \"options.execArgv\"), execArgv === process.execArgv && process._eval != null) {\n const index = ArrayPrototypeLastIndexOf.call(execArgv, process._eval);\n if (index > 0)\n execArgv = ArrayPrototypeSlice.call(execArgv), ArrayPrototypeSplice.call(execArgv, index - 1, 2);\n }\n if (args = [...execArgv, modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== void 0)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = void 0;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === void 0)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.call(args, options.argv0);\n else\n ArrayPrototypeUnshift.call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === void 0)\n throw new Error(\"Invalid stdio option\");\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(void 0, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== void 0)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 24) || @createInternalModuleById(24), { promisify } = @getInternalField(@internalModuleRegistry, 43) || @createInternalModuleById(43), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = Buffer.concat, BufferIsEncoding = Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = Array.prototype.push, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeUnshift = Array.prototype.unshift, ArrayPrototypeLastIndexOf = Array.prototype.lastIndexOf, ArrayPrototypeSplice = Array.prototype.splice, ArrayIsArray = Array.isArray, ArrayBufferIsView = ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSlice = String.prototype.slice, Uint8ArrayPrototypeIncludes = Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, void 0, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio);\n var env = options.envPairs || void 0;\n this.#encoding = options.encoding || void 0, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || void 0,\n env: env || process.env,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0\n }), this.pid = this.#handle.pid, onSpawnNT(this);\n }\n send() {\n console.log(\"ChildProcess.prototype.send() - Sorry! Not implemented yet\");\n }\n disconnect() {\n console.log(\"ChildProcess.prototype.disconnect() - Sorry! Not implemented yet\");\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === void 0 \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n"_s; +static constexpr ASCIILiteral NodeChildProcessCode = "(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === void 0)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.call(_stdout, StringPrototypeSlice.apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === void 0)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || void 0,\n cwd: options.cwd || void 0,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, void 0, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), execArgv = options.execArgv || process.execArgv, validateArgumentsNullCheck(execArgv, \"options.execArgv\"), execArgv === process.execArgv && process._eval != null) {\n const index = ArrayPrototypeLastIndexOf.call(execArgv, process._eval);\n if (index > 0)\n execArgv = ArrayPrototypeSlice.call(execArgv), ArrayPrototypeSplice.call(execArgv, index - 1, 2);\n }\n if (args = [...execArgv, modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== void 0)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = void 0;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === void 0)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.call(args, options.argv0);\n else\n ArrayPrototypeUnshift.call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === void 0)\n throw new Error(\"Invalid stdio option\");\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(void 0, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== void 0)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 24) || @createInternalModuleById(24), { promisify } = @getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = Buffer.concat, BufferIsEncoding = Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = Array.prototype.push, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeUnshift = Array.prototype.unshift, ArrayPrototypeLastIndexOf = Array.prototype.lastIndexOf, ArrayPrototypeSplice = Array.prototype.splice, ArrayIsArray = Array.isArray, ArrayBufferIsView = ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSlice = String.prototype.slice, Uint8ArrayPrototypeIncludes = Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, void 0, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio);\n var env = options.envPairs || void 0;\n this.#encoding = options.encoding || void 0, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || void 0,\n env: env || process.env,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0\n }), this.pid = this.#handle.pid, onSpawnNT(this);\n }\n send() {\n console.log(\"ChildProcess.prototype.send() - Sorry! Not implemented yet\");\n }\n disconnect() {\n console.log(\"ChildProcess.prototype.disconnect() - Sorry! Not implemented yet\");\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === void 0 \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n"_s; // // @@ -529,7 +537,7 @@ static constexpr ASCIILiteral NodeDomainCode = "(function (){\"use strict\";// s // // -static constexpr ASCIILiteral NodeEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.call(errorMonitor))\n handler.apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.call(handlers))\n handler.apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(void 0, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(void 0, { cause: signal\?.reason });\n return new Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(void 0, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = void 0, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === void 0 || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= void 0, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = void 0;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = void 0;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers])\n handler.apply(this, args);\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers]) {\n var result = handler.apply(this, args);\n if (result !== void 0 && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n"_s; +static constexpr ASCIILiteral NodeEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.call(errorMonitor))\n handler.apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.call(handlers))\n handler.apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(void 0, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(void 0, { cause: signal\?.reason });\n return new Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(void 0, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = void 0, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === void 0 || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= void 0, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = void 0;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = void 0;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.constructor = EventEmitter;\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers])\n handler.apply(this, args);\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers]) {\n var result = handler.apply(this, args);\n if (result !== void 0 && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n"_s; // // @@ -589,7 +597,7 @@ static constexpr ASCIILiteral NodeQuerystringCode = "(function (){\"use strict\" // // -static constexpr ASCIILiteral NodeReadlineCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new Promise((resolve, reject) => {\n ArrayPrototypePush.call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== void 0 && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.call(ch) + StringPrototypeCharCodeAt.call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.call(ch), keyShift = RegExpPrototypeExec.call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? void 0 : \"escape\", keyMeta = !0;\n if (keySeq = s, s.length !== 0 && (keyName !== void 0 || escaped))\n stream.emit(\"keypress\", escaped \? void 0 : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.call(ArrayPrototypeSlice.call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = void 0;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== void 0)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== void 0)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== void 0)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== void 0)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== void 0 && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === void 0)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === void 0)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === void 0 && !(output === null || output === void 0))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = void 0, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== void 0)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), { StringDecoder } = @requireNativeModule(\"node:string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = Array.from, ArrayIsArray = Array.isArray, ArrayPrototypeFilter = Array.prototype.filter, ArrayPrototypeSort = Array.prototype.sort, ArrayPrototypeIndexOf = Array.prototype.indexOf, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypePop = Array.prototype.pop, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeSplice = Array.prototype.splice, ArrayPrototypeReverse = Array.prototype.reverse, ArrayPrototypeShift = Array.prototype.shift, ArrayPrototypeUnshift = Array.prototype.unshift, RegExpPrototypeExec = RegExp.prototype.exec, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeCodePointAt = String.prototype.codePointAt, StringPrototypeSlice = String.prototype.slice, StringPrototypeToLowerCase = String.prototype.toLowerCase, StringPrototypeEndsWith = String.prototype.endsWith, StringPrototypeRepeat = String.prototype.repeat, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeTrim = String.prototype.trim, StringPrototypeNormalize = String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, MathMaxApply = Math.max.apply, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.call(iterable);\n }\n next() {\n return next.call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](mode) {\n var input = this.input, { setRawMode, wasInRawMode } = input;\n return debug(\"setRawMode\", mode, \"set!\"), wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== void 0)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === void 0)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.call(string) === 10)\n string = StringPrototypeSlice.call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, string)) !== null)\n ArrayPrototypePush.call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.call(this.line, 0, this.cursor), end = StringPrototypeSlice.call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.call(completions, (e) => getStringWidth(e)), width = MathMaxApply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"e\":\n this[kMoveCursor](Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n if (this.listenerCount(\"SIGTSTP\") > 0)\n this.emit(\"SIGTSTP\");\n else\n process.once(\"SIGCONT\", () => {\n if (!this.paused)\n this.pause(), this.emit(\"SIGCONT\");\n this[kSetRawMode](!0), this[kRefreshLine]();\n }), this[kSetRawMode](!1), process.kill(process.pid, \"SIGTSTP\");\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"end\":\n this[kMoveCursor](Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === void 0)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = void 0) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = void 0) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n }\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n"_s; +static constexpr ASCIILiteral NodeReadlineCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new Promise((resolve, reject) => {\n ArrayPrototypePush.call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== void 0 && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.call(ch) + StringPrototypeCharCodeAt.call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.call(ch), keyShift = RegExpPrototypeExec.call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? void 0 : \"escape\", keyMeta = !0;\n if (keySeq = s, s.length !== 0 && (keyName !== void 0 || escaped))\n stream.emit(\"keypress\", escaped \? void 0 : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.call(ArrayPrototypeSlice.call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = void 0;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== void 0)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== void 0)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== void 0)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== void 0)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== void 0 && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === void 0)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === void 0)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === void 0 && !(output === null || output === void 0))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = void 0, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== void 0)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 16) || @createInternalModuleById(16), { StringDecoder } = @requireNativeModule(\"node:string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = Array.from, ArrayIsArray = Array.isArray, ArrayPrototypeFilter = Array.prototype.filter, ArrayPrototypeSort = Array.prototype.sort, ArrayPrototypeIndexOf = Array.prototype.indexOf, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypePop = Array.prototype.pop, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeSplice = Array.prototype.splice, ArrayPrototypeReverse = Array.prototype.reverse, ArrayPrototypeShift = Array.prototype.shift, ArrayPrototypeUnshift = Array.prototype.unshift, RegExpPrototypeExec = RegExp.prototype.exec, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeCodePointAt = String.prototype.codePointAt, StringPrototypeSlice = String.prototype.slice, StringPrototypeToLowerCase = String.prototype.toLowerCase, StringPrototypeEndsWith = String.prototype.endsWith, StringPrototypeRepeat = String.prototype.repeat, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeTrim = String.prototype.trim, StringPrototypeNormalize = String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, MathMaxApply = Math.max.apply, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.call(iterable);\n }\n next() {\n return next.call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](flag) {\n const mode = flag \? 1 : 0, wasInRawMode = this.input.isRaw;\n if (typeof this.input.setRawMode === \"function\")\n this.input.setRawMode(mode);\n return wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== void 0)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === void 0)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.call(string) === 10)\n string = StringPrototypeSlice.call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, string)) !== null)\n ArrayPrototypePush.call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.call(this.line, 0, this.cursor), end = StringPrototypeSlice.call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.call(completions, (e) => getStringWidth(e)), width = MathMaxApply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"e\":\n this[kMoveCursor](Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n if (this.listenerCount(\"SIGTSTP\") > 0)\n this.emit(\"SIGTSTP\");\n else\n process.once(\"SIGCONT\", () => {\n if (!this.paused)\n this.pause(), this.emit(\"SIGCONT\");\n this[kSetRawMode](!0), this[kRefreshLine]();\n }), this[kSetRawMode](!1), process.kill(process.pid, \"SIGTSTP\");\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"end\":\n this[kMoveCursor](Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === void 0)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = void 0) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = void 0) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n }\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n"_s; // // @@ -633,6 +641,10 @@ static constexpr ASCIILiteral NodeTraceEventsCode = "(function (){\"use strict\" // // +static constexpr ASCIILiteral NodeTtyCode = "(function (){\"use strict\";// src/js/out/tmp/node/tty.ts\nvar ReadStream = function(fd) {\n if (!(this instanceof ReadStream))\n return new ReadStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).ReadStream.call(this, `/dev/fd/${fd}`);\n return stream.isRaw = !1, stream.isTTY = isatty(stream.fd), stream;\n}, warnOnDeactivatedColors = function(env) {\n if (warned)\n return;\n let name = \"\";\n if (env.NODE_DISABLE_COLORS !== void 0)\n name = \"NODE_DISABLE_COLORS\";\n if (env.NO_COLOR !== void 0) {\n if (name !== \"\")\n name += \"' and '\";\n name += \"NO_COLOR\";\n }\n if (name !== \"\")\n process.emitWarning(`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, \"Warning\"), warned = !0;\n}, WriteStream = function(fd) {\n if (!(this instanceof WriteStream))\n return new WriteStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).WriteStream.call(this, `/dev/fd/${fd}`);\n if (stream.columns = void 0, stream.rows = void 0, stream.isTTY = isatty(stream.fd), stream.isTTY) {\n const windowSizeArray = [0, 0];\n if (_getWindowSize(fd, windowSizeArray) === !0)\n stream.columns = windowSizeArray[0], stream.rows = windowSizeArray[1];\n }\n return stream;\n}, { ttySetMode, isatty, getWindowSize: _getWindowSize } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"tty\");\nObject.defineProperty(ReadStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).ReadStream.prototype;\n return Object.defineProperty(ReadStream, \"prototype\", { value: Real }), ReadStream.prototype.setRawMode = function(flag) {\n const mode = flag \? 1 : 0, err = ttySetMode(this.fd, mode);\n if (err)\n return this.emit(\"error\", new Error(\"setRawMode failed with errno:\", err)), this;\n return this.isRaw = flag, this;\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar COLORS_2 = 1, COLORS_16 = 4, COLORS_256 = 8, COLORS_16m = 24, TERM_ENVS = {\n eterm: COLORS_16,\n cons25: COLORS_16,\n console: COLORS_16,\n cygwin: COLORS_16,\n dtterm: COLORS_16,\n gnome: COLORS_16,\n hurd: COLORS_16,\n jfbterm: COLORS_16,\n konsole: COLORS_16,\n kterm: COLORS_16,\n mlterm: COLORS_16,\n mosh: COLORS_16m,\n putty: COLORS_16,\n st: COLORS_16,\n \"rxvt-unicode-24bit\": COLORS_16m,\n terminator: COLORS_16m\n}, TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/], warned = !1;\nObject.defineProperty(WriteStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).WriteStream.prototype;\n Object.defineProperty(WriteStream, \"prototype\", { value: Real }), WriteStream.prototype._refreshSize = function() {\n const oldCols = this.columns, oldRows = this.rows, windowSizeArray = [0, 0];\n if (_getWindowSize(this.fd, windowSizeArray) === !0) {\n if (oldCols !== windowSizeArray[0] || oldRows !== windowSizeArray[1])\n this.columns = windowSizeArray[0], this.rows = windowSizeArray[1], this.emit(\"resize\");\n }\n };\n var readline = void 0;\n return WriteStream.prototype.clearLine = function(dir, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).clearLine(this, dir, cb);\n }, WriteStream.prototype.clearScreenDown = function(cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).clearScreenDown(this, cb);\n }, WriteStream.prototype.cursorTo = function(x, y, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).cursorTo(this, x, y, cb);\n }, WriteStream.prototype.getColorDepth = function(env = process.env) {\n if (env.FORCE_COLOR !== void 0)\n switch (env.FORCE_COLOR) {\n case \"\":\n case \"1\":\n case \"true\":\n return warnOnDeactivatedColors(env), COLORS_16;\n case \"2\":\n return warnOnDeactivatedColors(env), COLORS_256;\n case \"3\":\n return warnOnDeactivatedColors(env), COLORS_16m;\n default:\n return COLORS_2;\n }\n if (env.NODE_DISABLE_COLORS !== void 0 || env.NO_COLOR !== void 0 || env.TERM === \"dumb\")\n return COLORS_2;\n if (env.TMUX)\n return COLORS_256;\n if (env.CI) {\n if ([\"APPVEYOR\", \"BUILDKITE\", \"CIRCLECI\", \"DRONE\", \"GITHUB_ACTIONS\", \"GITLAB_CI\", \"TRAVIS\"].some((sign) => (sign in env)) || env.CI_NAME === \"codeship\")\n return COLORS_256;\n return COLORS_2;\n }\n if (\"TEAMCITY_VERSION\" in env)\n return RegExpPrototypeExec(/^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/, env.TEAMCITY_VERSION) !== null \? COLORS_16 : COLORS_2;\n switch (env.TERM_PROGRAM) {\n case \"iTerm.app\":\n if (!env.TERM_PROGRAM_VERSION || RegExpPrototypeExec(/^[0-2]\\./, env.TERM_PROGRAM_VERSION) !== null)\n return COLORS_256;\n return COLORS_16m;\n case \"HyperTerm\":\n case \"MacTerm\":\n return COLORS_16m;\n case \"Apple_Terminal\":\n return COLORS_256;\n }\n if (env.COLORTERM === \"truecolor\" || env.COLORTERM === \"24bit\")\n return COLORS_16m;\n if (env.TERM) {\n if (RegExpPrototypeExec(/^xterm-256/, env.TERM) !== null)\n return COLORS_256;\n const termEnv = StringPrototypeToLowerCase(env.TERM);\n if (TERM_ENVS[termEnv])\n return TERM_ENVS[termEnv];\n if (ArrayPrototypeSome(TERM_ENVS_REG_EXP, (term) => RegExpPrototypeExec(term, termEnv) !== null))\n return COLORS_16;\n }\n if (env.COLORTERM)\n return COLORS_16;\n return COLORS_2;\n }, WriteStream.prototype.getWindowSize = function() {\n return [this.columns, this.rows];\n }, WriteStream.prototype.hasColors = function(count, env) {\n if (env === void 0 && (count === void 0 || typeof count === \"object\" && count !== null))\n env = count, count = 16;\n else\n validateInteger(count, \"count\", 2);\n return count <= 2 ** this.getColorDepth(env);\n }, WriteStream.prototype.moveCursor = function(dx, dy, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 31) || @createInternalModuleById(31)).moveCursor(this, dx, dy, cb);\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!Number.isInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n};\nreturn { ReadStream, WriteStream, isatty }})\n"_s; +// + +// static constexpr ASCIILiteral NodeUrlCode = "(function (){\"use strict\";// src/js/out/tmp/node/url.ts\nvar Url = function() {\n this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;\n}, urlParse = function(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === \"object\" && url instanceof Url)\n return url;\n var u = new Url;\n return u.parse(url, parseQueryString, slashesDenoteHost), u;\n}, urlFormat = function(obj) {\n if (typeof obj === \"string\")\n obj = urlParse(obj);\n if (!(obj instanceof Url))\n return Url.prototype.format.call(obj);\n return obj.format();\n}, urlResolve = function(source, relative) {\n return urlParse(source, !1, !0).resolve(relative);\n}, urlResolveObject = function(source, relative) {\n if (!source)\n return relative;\n return urlParse(source, !1, !0).resolveObject(relative);\n}, urlToHttpOptions = function(url) {\n const options = {\n protocol: url.protocol,\n hostname: typeof url.hostname === \"string\" && url.hostname.startsWith(\"[\") \? url.hostname.slice(1, -1) : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname || \"\"}${url.search || \"\"}`,\n href: url.href\n };\n if (url.port !== \"\")\n options.port = Number(url.port);\n if (url.username || url.password)\n options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;\n return options;\n}, $, { URL, URLSearchParams } = globalThis;\nUrl.prototype = {};\nvar protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\\/\\/\?(\?!\\/)[^\?\\s]*)(\\\?[^\\s]*)\?$/, delims = [\"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\"], unwise = [\"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\"].concat(delims), autoEscape = [\"'\"].concat(unwise), nonHostChars = [\"%\", \"/\", \"\?\", \";\", \"#\"].concat(autoEscape), hostEndingChars = [\"/\", \"\?\", \"#\"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, hostlessProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, slashedProtocol = {\n http: !0,\n https: !0,\n ftp: !0,\n gopher: !0,\n file: !0,\n \"http:\": !0,\n \"https:\": !0,\n \"ftp:\": !0,\n \"gopher:\": !0,\n \"file:\": !0\n};\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== \"string\")\n @throwTypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n var queryIndex = url.indexOf(\"\?\"), splitter = queryIndex !== -1 && queryIndex < url.indexOf(\"#\") \? \"\?\" : \"#\", uSplit = url.split(splitter), slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, \"/\"), url = uSplit.join(splitter);\n var rest = url;\n if (rest = rest.trim(), !slashesDenoteHost && url.split(\"#\").length === 1) {\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n if (this.path = rest, this.href = rest, this.pathname = simplePath[1], simplePath[2])\n if (this.search = simplePath[2], parseQueryString)\n this.query = new URLSearchParams(this.search.substr(1)).toJSON();\n else\n this.query = this.search.substr(1);\n else if (parseQueryString)\n this.search = \"\", this.query = {};\n return this;\n }\n }\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto, rest = rest.substr(proto.length);\n }\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto]))\n rest = rest.substr(2), this.slashes = !0;\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n var hostEnd = -1;\n for (var i = 0;i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n var auth, atSign;\n if (hostEnd === -1)\n atSign = rest.lastIndexOf(\"@\");\n else\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n if (atSign !== -1)\n auth = rest.slice(0, atSign), rest = rest.slice(atSign + 1), this.auth = decodeURIComponent(auth);\n hostEnd = -1;\n for (var i = 0;i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n if (hostEnd === -1)\n hostEnd = rest.length;\n this.host = rest.slice(0, hostEnd), rest = rest.slice(hostEnd), this.parseHost(), this.hostname = this.hostname || \"\";\n var ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length;i < l; i++) {\n var part = hostparts[i];\n if (!part)\n continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = \"\";\n for (var j = 0, k = part.length;j < k; j++)\n if (part.charCodeAt(j) > 127)\n newpart += \"x\";\n else\n newpart += part[j];\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i), notHost = hostparts.slice(i + 1), bit = part.match(hostnamePartStart);\n if (bit)\n validParts.push(bit[1]), notHost.unshift(bit[2]);\n if (notHost.length)\n rest = \"/\" + notHost.join(\".\") + rest;\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen)\n this.hostname = \"\";\n else\n this.hostname = this.hostname.toLowerCase();\n if (!ipv6Hostname)\n this.hostname = new URL(\"http://\" + this.hostname).hostname;\n var p = this.port \? \":\" + this.port : \"\", h = this.hostname || \"\";\n if (this.host = h + p, this.href += this.host, ipv6Hostname) {\n if (this.hostname = this.hostname.substr(1, this.hostname.length - 2), rest[0] !== \"/\")\n rest = \"/\" + rest;\n }\n }\n if (!unsafeProtocol[lowerProto])\n for (var i = 0, l = autoEscape.length;i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae)\n esc = escape(ae);\n rest = rest.split(ae).join(esc);\n }\n var hash = rest.indexOf(\"#\");\n if (hash !== -1)\n this.hash = rest.substr(hash), rest = rest.slice(0, hash);\n var qm = rest.indexOf(\"\?\");\n if (qm !== -1) {\n if (this.search = rest.substr(qm), this.query = rest.substr(qm + 1), parseQueryString)\n this.query = new URLSearchParams(this.query);\n rest = rest.slice(0, qm);\n } else if (parseQueryString)\n this.search = \"\", this.query = {};\n if (rest)\n this.pathname = rest;\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname)\n this.pathname = \"/\";\n if (this.pathname || this.search) {\n var p = this.pathname || \"\", s = this.search || \"\";\n this.path = p + s;\n }\n return this.href = this.format(), this;\n};\nUrl.prototype.format = function() {\n var auth = this.auth || \"\";\n if (auth)\n auth = encodeURIComponent(auth), auth = auth.replace(/%3A/i, \":\"), auth += \"@\";\n var protocol = this.protocol || \"\", pathname = this.pathname || \"\", hash = this.hash || \"\", host = !1, query = \"\";\n if (this.host)\n host = auth + this.host;\n else if (this.hostname) {\n if (host = auth + (this.hostname.indexOf(\":\") === -1 \? this.hostname : \"[\" + this.hostname + \"]\"), this.port)\n host += \":\" + this.port;\n }\n if (this.query && typeof this.query === \"object\" && Object.keys(this.query).length)\n query = new URLSearchParams(this.query).toString();\n var search = this.search || query && \"\?\" + query || \"\";\n if (protocol && protocol.substr(-1) !== \":\")\n protocol += \":\";\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== !1) {\n if (host = \"//\" + (host || \"\"), pathname && pathname.charAt(0) !== \"/\")\n pathname = \"/\" + pathname;\n } else if (!host)\n host = \"\";\n if (hash && hash.charAt(0) !== \"#\")\n hash = \"#\" + hash;\n if (search && search.charAt(0) !== \"\?\")\n search = \"\?\" + search;\n return pathname = pathname.replace(/[\?#]/g, function(match) {\n return encodeURIComponent(match);\n }), search = search.replace(\"#\", \"%23\"), protocol + host + pathname + search + hash;\n};\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, !1, !0)).format();\n};\nUrl.prototype.resolveObject = function(relative) {\n if (typeof relative === \"string\") {\n var rel = new Url;\n rel.parse(relative, !1, !0), relative = rel;\n }\n var result = new Url, tkeys = Object.keys(this);\n for (var tk = 0;tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n if (result.hash = relative.hash, relative.href === \"\")\n return result.href = result.format(), result;\n if (relative.slashes && !relative.protocol) {\n var rkeys = Object.keys(relative);\n for (var rk = 0;rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== \"protocol\")\n result[rkey] = relative[rkey];\n }\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname)\n result.pathname = \"/\", result.path = result.pathname;\n return result.href = result.format(), result;\n }\n if (relative.protocol && relative.protocol !== result.protocol) {\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0;v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n return result.href = result.format(), result;\n }\n if (result.protocol = relative.protocol, !relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || \"\").split(\"/\");\n while (relPath.length && !(relative.host = relPath.shift()))\n ;\n if (!relative.host)\n relative.host = \"\";\n if (!relative.hostname)\n relative.hostname = \"\";\n if (relPath[0] !== \"\")\n relPath.unshift(\"\");\n if (relPath.length < 2)\n relPath.unshift(\"\");\n result.pathname = relPath.join(\"/\");\n } else\n result.pathname = relative.pathname;\n if (result.search = relative.search, result.query = relative.query, result.host = relative.host || \"\", result.auth = relative.auth, result.hostname = relative.hostname || relative.host, result.port = relative.port, result.pathname || result.search) {\n var p = result.pathname || \"\", s = result.search || \"\";\n result.path = p + s;\n }\n return result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n }\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === \"/\", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === \"/\", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split(\"/\") || [], relPath = relative.pathname && relative.pathname.split(\"/\") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];\n if (psychotic) {\n if (result.hostname = \"\", result.port = null, result.host)\n if (srcPath[0] === \"\")\n srcPath[0] = result.host;\n else\n srcPath.unshift(result.host);\n if (result.host = \"\", relative.protocol) {\n if (relative.hostname = null, relative.port = null, relative.host)\n if (relPath[0] === \"\")\n relPath[0] = relative.host;\n else\n relPath.unshift(relative.host);\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === \"\" || srcPath[0] === \"\");\n }\n if (isRelAbs)\n result.host = relative.host || relative.host === \"\" \? relative.host : result.host, result.hostname = relative.hostname || relative.hostname === \"\" \? relative.hostname : result.hostname, result.search = relative.search, result.query = relative.query, srcPath = relPath;\n else if (relPath.length) {\n if (!srcPath)\n srcPath = [];\n srcPath.pop(), srcPath = srcPath.concat(relPath), result.search = relative.search, result.query = relative.query;\n } else if (relative.search != null) {\n if (psychotic) {\n result.host = srcPath.shift(), result.hostname = result.host;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (result.search = relative.search, result.query = relative.query, result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.href = result.format(), result;\n }\n if (!srcPath.length) {\n if (result.pathname = null, result.search)\n result.path = \"/\" + result.search;\n else\n result.path = null;\n return result.href = result.format(), result;\n }\n var last = srcPath.slice(-1)[0], hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === \".\" || last === \"..\") || last === \"\", up = 0;\n for (var i = srcPath.length;i >= 0; i--)\n if (last = srcPath[i], last === \".\")\n srcPath.splice(i, 1);\n else if (last === \"..\")\n srcPath.splice(i, 1), up++;\n else if (up)\n srcPath.splice(i, 1), up--;\n if (!mustEndAbs && !removeAllDots)\n for (;up--; up)\n srcPath.unshift(\"..\");\n if (mustEndAbs && srcPath[0] !== \"\" && (!srcPath[0] || srcPath[0].charAt(0) !== \"/\"))\n srcPath.unshift(\"\");\n if (hasTrailingSlash && srcPath.join(\"/\").substr(-1) !== \"/\")\n srcPath.push(\"\");\n var isAbsolute = srcPath[0] === \"\" || srcPath[0] && srcPath[0].charAt(0) === \"/\";\n if (psychotic) {\n result.hostname = isAbsolute \? \"\" : srcPath.length \? srcPath.shift() : \"\", result.host = result.hostname;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (mustEndAbs = mustEndAbs || result.host && srcPath.length, mustEndAbs && !isAbsolute)\n srcPath.unshift(\"\");\n if (srcPath.length > 0)\n result.pathname = srcPath.join(\"/\");\n else\n result.pathname = null, result.path = null;\n if (result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.auth = relative.auth || result.auth, result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n};\nUrl.prototype.parseHost = function() {\n var host = this.host, port = portPattern.exec(host);\n if (port) {\n if (port = port[0], port !== \":\")\n this.port = port.substr(1);\n host = host.substr(0, host.length - port.length);\n }\n if (host)\n this.hostname = host;\n};\nvar pathToFileURL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"pathToFileURL\"), fileURLToPath = globalThis[globalThis.Symbol.for('Bun.lazy')](\"fileURLToPath\");\n$ = {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url,\n URLSearchParams,\n URL,\n pathToFileURL,\n fileURLToPath,\n urlToHttpOptions\n};\nreturn $})\n"_s; // @@ -649,7 +661,7 @@ static constexpr ASCIILiteral NodeVMCode = "(function (){\"use strict\";// src/j // // -static constexpr ASCIILiteral NodeWasiCode = "(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => @requireNativeModule(\"node:tty\").isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 26) || @createInternalModuleById(26)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n"_s; +static constexpr ASCIILiteral NodeWasiCode = "(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => (@getInternalField(@internalModuleRegistry, 42) || @createInternalModuleById(42)).isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 26) || @createInternalModuleById(26)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n"_s; // // @@ -657,7 +669,7 @@ static constexpr ASCIILiteral NodeWorkerThreadsCode = "(function (){\"use strict // // -static constexpr ASCIILiteral NodeZlibCode = "(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 4) || @createInternalModuleById(4), BufferModule = @requireNativeModule(\"node:buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), Util = @getInternalField(@internalModuleRegistry, 43) || @createInternalModuleById(43), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = Array, exports.Buf16 = Array, exports.Buf32 = Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n"_s; +static constexpr ASCIILiteral NodeZlibCode = "(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 4) || @createInternalModuleById(4), BufferModule = @requireNativeModule(\"node:buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35), Util = @getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = Array, exports.Buf16 = Array, exports.Buf32 = Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n"_s; // // diff --git a/src/js/out/NativeModuleImpl.h b/src/js/out/NativeModuleImpl.h index 5a6881b7f..8bb70d5cb 100644 --- a/src/js/out/NativeModuleImpl.h +++ b/src/js/out/NativeModuleImpl.h @@ -5,6 +5,5 @@ #include "../../bun.js/modules/NodeModuleModule.h" #include "../../bun.js/modules/NodeProcessModule.h" #include "../../bun.js/modules/NodeStringDecoderModule.h" -#include "../../bun.js/modules/NodeTTYModule.h" #include "../../bun.js/modules/NodeUtilTypesModule.h" #include "../../bun.js/modules/UTF8ValidateModule.h" diff --git a/src/js/out/ResolvedSourceTag.zig b/src/js/out/ResolvedSourceTag.zig index 75277c890..80126ea6d 100644 --- a/src/js/out/ResolvedSourceTag.zig +++ b/src/js/out/ResolvedSourceTag.zig @@ -51,21 +51,22 @@ pub const ResolvedSourceTag = enum(u32) { @"node:timers/promises" = 551, @"node:tls" = 552, @"node:trace_events" = 553, - @"node:url" = 554, - @"node:util" = 555, - @"node:v8" = 556, - @"node:vm" = 557, - @"node:wasi" = 558, - @"node:worker_threads" = 559, - @"node:zlib" = 560, - @"depd" = 561, - @"detect-libc" = 562, - @"detect-libc/linux" = 563, - @"isomorphic-fetch" = 564, - @"node-fetch" = 565, - @"undici" = 566, - @"vercel_fetch" = 567, - @"ws" = 568, + @"node:tty" = 554, + @"node:url" = 555, + @"node:util" = 556, + @"node:v8" = 557, + @"node:vm" = 558, + @"node:wasi" = 559, + @"node:worker_threads" = 560, + @"node:zlib" = 561, + @"depd" = 562, + @"detect-libc" = 563, + @"detect-libc/linux" = 564, + @"isomorphic-fetch" = 565, + @"node-fetch" = 566, + @"undici" = 567, + @"vercel_fetch" = 568, + @"ws" = 569, // Native modules run through a different system using ESM registry. @"bun" = 1024, @"bun:jsc" = 1025, @@ -74,7 +75,6 @@ pub const ResolvedSourceTag = enum(u32) { @"node:module" = 1028, @"node:process" = 1029, @"node:string_decoder" = 1030, - @"node:tty" = 1031, - @"node:util/types" = 1032, - @"utf-8-validate" = 1033, + @"node:util/types" = 1031, + @"utf-8-validate" = 1032, }; diff --git a/src/js/out/SyntheticModuleType.h b/src/js/out/SyntheticModuleType.h index 46a6db363..5a94a02e6 100644 --- a/src/js/out/SyntheticModuleType.h +++ b/src/js/out/SyntheticModuleType.h @@ -51,21 +51,22 @@ enum SyntheticModuleType : uint32_t { NodeTimersPromises = 551, NodeTLS = 552, NodeTraceEvents = 553, - NodeUrl = 554, - NodeUtil = 555, - NodeV8 = 556, - NodeVM = 557, - NodeWasi = 558, - NodeWorkerThreads = 559, - NodeZlib = 560, - ThirdpartyDepd = 561, - ThirdpartyDetectLibc = 562, - ThirdpartyDetectLibcLinux = 563, - ThirdpartyIsomorphicFetch = 564, - ThirdpartyNodeFetch = 565, - ThirdpartyUndici = 566, - ThirdpartyVercelFetch = 567, - ThirdpartyWS = 568, + NodeTty = 554, + NodeUrl = 555, + NodeUtil = 556, + NodeV8 = 557, + NodeVM = 558, + NodeWasi = 559, + NodeWorkerThreads = 560, + NodeZlib = 561, + ThirdpartyDepd = 562, + ThirdpartyDetectLibc = 563, + ThirdpartyDetectLibcLinux = 564, + ThirdpartyIsomorphicFetch = 565, + ThirdpartyNodeFetch = 566, + ThirdpartyUndici = 567, + ThirdpartyVercelFetch = 568, + ThirdpartyWS = 569, // Native modules run through the same system, but with different underlying initializers. // They also have bit 10 set to differentiate them from JS builtins. @@ -77,8 +78,7 @@ enum SyntheticModuleType : uint32_t { NodeModule = 1028, NodeProcess = 1029, NodeStringDecoder = 1030, - NodeTTY = 1031, - NodeUtilTypes = 1032, - UTF8Validate = 1033, + NodeUtilTypes = 1031, + UTF8Validate = 1032, }; diff --git a/src/js/out/WebCoreJSBuiltins.cpp b/src/js/out/WebCoreJSBuiltins.cpp index 38114bab6..285c4b899 100644 --- a/src/js/out/WebCoreJSBuiltins.cpp +++ b/src/js/out/WebCoreJSBuiltins.cpp @@ -646,17 +646,17 @@ const char* const s_processObjectInternalsBindingCode = "(function (bindingName) const JSC::ConstructAbility s_processObjectInternalsGetStdioWriteStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; const JSC::ConstructorKind s_processObjectInternalsGetStdioWriteStreamCodeConstructorKind = JSC::ConstructorKind::None; const JSC::ImplementationVisibility s_processObjectInternalsGetStdioWriteStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_processObjectInternalsGetStdioWriteStreamCodeLength = 7764; +const int s_processObjectInternalsGetStdioWriteStreamCodeLength = 621; static const JSC::Intrinsic s_processObjectInternalsGetStdioWriteStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_processObjectInternalsGetStdioWriteStreamCode = "(function (fd_,getWindowSize){\"use strict\";var EventEmitter=@getInternalField(@internalModuleRegistry,16)||@createInternalModuleById(16);function createStdioWriteStream(fd_2){var{Duplex,eos,destroy}=@getInternalField(@internalModuleRegistry,35)||@createInternalModuleById(35),StdioWriteStream=class StdioWriteStream2 extends Duplex{#writeStream;#readStream;#readable=!0;#writable=!0;#fdPath;#onClose;#onDrain;#onFinish;#onReadable;#isTTY;get isTTY(){return this.#isTTY\?\?=@requireNativeModule(\"node:tty\").isatty(fd_2)}get fd(){return fd_2}get writable(){return this.#writable}get readable(){return this.#readable}constructor(fd){super({readable:!0,writable:!0});this.#fdPath=`/dev/fd/${fd}`}#onFinished(err){const cb=this.#onClose;if(this.#onClose=null,cb)cb(err);else if(err)this.destroy(err);else if(!this.#readable&&!this.#writable)this.destroy()}_destroy(err,callback){if(!err&&this.#onClose!==null){var AbortError=class AbortError2 extends Error{code;name;constructor(message=\"The operation was aborted\",options=void 0){if(options!==void 0&&typeof options!==\"object\")throw new Error(`Invalid AbortError options:\\n\\n${JSON.stringify(options,null,2)}`);super(message,options);this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};err=new AbortError}if(this.#onDrain=null,this.#onFinish=null,this.#onClose===null)callback(err);else{if(this.#onClose=callback,this.#writeStream)destroy(this.#writeStream,err);if(this.#readStream)destroy(this.#readStream,err)}}_write(chunk,encoding,callback){if(!this.#writeStream){var{createWriteStream}=@getInternalField(@internalModuleRegistry,17)||@createInternalModuleById(17),stream=this.#writeStream=createWriteStream(this.#fdPath);stream.on(\"finish\",()=>{if(this.#onFinish){const cb=this.#onFinish;this.#onFinish=null,cb()}}),stream.on(\"drain\",()=>{if(this.#onDrain){const cb=this.#onDrain;this.#onDrain=null,cb()}}),eos(stream,(err)=>{if(this.#writable=!1,err)destroy(stream,err);this.#onFinished(err)})}if(this.#writeStream.write(chunk,encoding))callback();else this.#onDrain=callback}_final(callback){this.#writeStream&&this.#writeStream.end(),this.#onFinish=callback}#loadReadStream(){var{createReadStream}=@getInternalField(@internalModuleRegistry,17)||@createInternalModuleById(17),readStream=this.#readStream=createReadStream(this.#fdPath);return readStream.on(\"readable\",()=>{if(this.#onReadable){const cb=this.#onReadable;this.#onReadable=null,cb()}else this.read()}),readStream.on(\"end\",()=>{this.push(null)}),eos(readStream,(err)=>{if(this.#readable=!1,err)destroy(readStream,err);this.#onFinished(err)}),readStream}_read(){var stream=this.#readStream;if(!stream)stream=this.#loadReadStream();while(!0){const buf=stream.read();if(buf===null||!this.push(buf))return}}};return new StdioWriteStream(fd_2)}function isFastEncoding(encoding){if(!encoding)return!0;var normalied=encoding.toLowerCase();return normalied===\"utf8\"||normalied===\"utf-8\"||normalied===\"buffer\"||normalied===\"binary\"}var readline,windowSizeArray=[0,0],FastStdioWriteStreamInternal=class StdioWriteStream extends EventEmitter{#fd;#innerStream;#writer;#isTTY;bytesWritten=0;setDefaultEncoding(encoding){if(this.#innerStream||!isFastEncoding(encoding))return this.#ensureInnerStream(),this.#innerStream.setDefaultEncoding(encoding)}#createWriter(){switch(this.#fd){case 1:{var writer=@Bun.stdout.writer({highWaterMark:0});return writer.unref(),writer}case 2:{var writer=@Bun.stderr.writer({highWaterMark:0});return writer.unref(),writer}default:throw new Error(\"Unsupported writer\")}}#getWriter(){return this.#writer\?\?=this.#createWriter()}constructor(fd_2){super();this.#fd=fd_2}get fd(){return this.#fd}ref(){this.#getWriter().ref()}unref(){this.#getWriter().unref()}on(event,listener){if(event===\"close\"||event===\"finish\")return this.#ensureInnerStream(),this.#innerStream.on(event,listener);if(event===\"drain\")return super.on(\"drain\",listener);if(event===\"error\")return super.on(\"error\",listener);return super.on(event,listener)}get _writableState(){return this.#ensureInnerStream(),this.#innerStream._writableState}get _readableState(){return this.#ensureInnerStream(),this.#innerStream._readableState}get writable(){return this.#ensureInnerStream(),this.#innerStream.writable}get readable(){return this.#ensureInnerStream(),this.#innerStream.readable}pipe(destination){return this.#ensureInnerStream(),this.#innerStream.pipe(destination)}unpipe(destination){return this.#ensureInnerStream(),this.#innerStream.unpipe(destination)}#ensureInnerStream(){if(this.#innerStream)return;this.#innerStream=createStdioWriteStream(this.#fd);const events=this.eventNames();for(let event of events)this.#innerStream.on(event,(...args)=>{this.emit(event,...args)})}#write1(chunk){var writer=this.#getWriter();const writeResult=writer.write(chunk);this.bytesWritten+=writeResult;const flushResult=writer.flush(!1);return!!(writeResult||flushResult)}#writeWithEncoding(chunk,encoding){if(!isFastEncoding(encoding))return this.#ensureInnerStream(),this.#innerStream.write(chunk,encoding);return this.#write1(chunk)}#performCallback(cb,err){if(err)this.emit(\"error\",err);try{cb(err\?err:null)}catch(err2){this.emit(\"error\",err2)}}#writeWithCallbackAndEncoding(chunk,encoding,callback){if(!isFastEncoding(encoding))return this.#ensureInnerStream(),this.#innerStream.write(chunk,encoding,callback);var writer=this.#getWriter();const writeResult=writer.write(chunk),flushResult=writer.flush(!0);if(flushResult\?.then)return flushResult.then(()=>{this.#performCallback(callback),this.emit(\"drain\")},(err)=>this.#performCallback(callback,err)),!1;return queueMicrotask(()=>{this.#performCallback(callback)}),!!(writeResult||flushResult)}get isTTY(){return!1}write(chunk,encoding,callback){const result=this._write(chunk,encoding,callback);if(result)this.emit(\"drain\");return result}get hasColors(){return @Bun.tty[this.#fd].hasColors}_write(chunk,encoding,callback){var inner=this.#innerStream;if(inner)return inner.write(chunk,encoding,callback);switch(arguments.length){case 0:{var error=new Error(\"Invalid arguments\");throw error.code=\"ERR_INVALID_ARG_TYPE\",error}case 1:return this.#write1(chunk);case 2:if(typeof encoding===\"function\")return this.#writeWithCallbackAndEncoding(chunk,\"\",encoding);else if(typeof encoding===\"string\")return this.#writeWithEncoding(chunk,encoding);default:{if(typeof encoding!==\"undefined\"&&typeof encoding!==\"string\"||typeof callback!==\"undefined\"&&typeof callback!==\"function\"){var error=new Error(\"Invalid arguments\");throw error.code=\"ERR_INVALID_ARG_TYPE\",error}if(typeof callback===\"undefined\")return this.#writeWithEncoding(chunk,encoding);return this.#writeWithCallbackAndEncoding(chunk,encoding,callback)}}}destroy(){return this}end(){return this}};if(getWindowSize(fd_,windowSizeArray)){var WriteStream=class WriteStream2 extends FastStdioWriteStreamInternal{get isTTY(){return!0}cursorTo(x,y,callback){return(readline\?\?=@getInternalField(@internalModuleRegistry,31)||@createInternalModuleById(31)).cursorTo(this,x,y,callback)}moveCursor(dx,dy,callback){return(readline\?\?=@getInternalField(@internalModuleRegistry,31)||@createInternalModuleById(31)).moveCursor(this,dx,dy,callback)}clearLine(dir,callback){return(readline\?\?=@getInternalField(@internalModuleRegistry,31)||@createInternalModuleById(31)).clearLine(this,dir,callback)}clearScreenDown(callback){return(readline\?\?=@getInternalField(@internalModuleRegistry,31)||@createInternalModuleById(31)).clearScreenDown(this,callback)}getWindowSize(){if(getWindowSize(fd_,windowSizeArray)===!0)return[windowSizeArray[0],windowSizeArray[1]]}get columns(){if(getWindowSize(fd_,windowSizeArray)===!0)return windowSizeArray[0]}get rows(){if(getWindowSize(fd_,windowSizeArray)===!0)return windowSizeArray[1]}};return new WriteStream(fd_)}return new FastStdioWriteStreamInternal(fd_)})\n"; +const char* const s_processObjectInternalsGetStdioWriteStreamCode = "(function (fd){\"use strict\";const stream=(@getInternalField(@internalModuleRegistry,42)||@createInternalModuleById(42)).WriteStream(fd);if(process.on(\"SIGWINCH\",()=>{stream._refreshSize()}),fd===1)stream.destroySoon=stream.destroy,stream._destroy=function(err,cb){if(cb(err),this._undestroy(),!this._writableState.emitClose)process.nextTick(()=>{this.emit(\"close\")})};else if(fd===2)stream.destroySoon=stream.destroy,stream._destroy=function(err,cb){if(cb(err),this._undestroy(),!this._writableState.emitClose)process.nextTick(()=>{this.emit(\"close\")})};return stream._type=\"tty\",stream._isStdio=!0,stream.fd=fd,stream})\n"; // getStdinStream const JSC::ConstructAbility s_processObjectInternalsGetStdinStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; const JSC::ConstructorKind s_processObjectInternalsGetStdinStreamCodeConstructorKind = JSC::ConstructorKind::None; const JSC::ImplementationVisibility s_processObjectInternalsGetStdinStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_processObjectInternalsGetStdinStreamCodeLength = 2702; +const int s_processObjectInternalsGetStdinStreamCodeLength = 1358; static const JSC::Intrinsic s_processObjectInternalsGetStdinStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_processObjectInternalsGetStdinStreamCode = "(function (fd_){\"use strict\";var{Duplex,eos,destroy}=@getInternalField(@internalModuleRegistry,35)||@createInternalModuleById(35),StdinStream=class StdinStream2 extends Duplex{#reader;#readRef;#writeStream;#readable=!0;#unrefOnRead=!1;#writable=!0;#onFinish;#onClose;#onDrain;get isTTY(){return @requireNativeModule(\"node:tty\").isatty(fd_)}get fd(){return fd_}constructor(){super({readable:!0,writable:!0})}#onFinished(err){const cb=this.#onClose;if(this.#onClose=null,cb)cb(err);else if(err)this.destroy(err);else if(!this.#readable&&!this.#writable)this.destroy()}_destroy(err,callback){if(!err&&this.#onClose!==null){var AbortError=class AbortError2 extends Error{constructor(message=\"The operation was aborted\",options=void 0){if(options!==void 0&&typeof options!==\"object\")throw new Error(`Invalid AbortError options:\\n\\n${JSON.stringify(options,null,2)}`);super(message,options);this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};err=new AbortError}if(this.#onClose===null)callback(err);else if(this.#onClose=callback,this.#writeStream)destroy(this.#writeStream,err)}setRawMode(mode){}on(name,callback){if(name===\"readable\")this.ref(),this.#unrefOnRead=!0;return super.on(name,callback)}pause(){return this.unref(),super.pause()}resume(){return this.ref(),super.resume()}ref(){this.#reader\?\?=@Bun.stdin.stream().getReader(),this.#readRef\?\?=setInterval(()=>{},1<<30)}unref(){if(this.#readRef)clearInterval(this.#readRef),this.#readRef=null}async#readInternal(){try{var done,value;const read=this.#reader.readMany();if(!read\?.then)({done,value}=read);else({done,value}=await read);if(!done){this.push(value[0]);const length=value.length;for(let i=1;i<length;i++)this.push(value[i])}else this.push(null),this.pause(),this.#readable=!1,this.#onFinished()}catch(err){this.#readable=!1,this.#onFinished(err)}}_read(size){if(this.#unrefOnRead)this.unref(),this.#unrefOnRead=!1;this.#readInternal()}#constructWriteStream(){var{createWriteStream}=@getInternalField(@internalModuleRegistry,17)||@createInternalModuleById(17),writeStream=this.#writeStream=createWriteStream(\"/dev/fd/0\");return writeStream.on(\"finish\",()=>{if(this.#onFinish){const cb=this.#onFinish;this.#onFinish=null,cb()}}),writeStream.on(\"drain\",()=>{if(this.#onDrain){const cb=this.#onDrain;this.#onDrain=null,cb()}}),eos(writeStream,(err)=>{if(this.#writable=!1,err)destroy(writeStream,err);this.#onFinished(err)}),writeStream}_write(chunk,encoding,callback){var writeStream=this.#writeStream;if(!writeStream)writeStream=this.#constructWriteStream();if(writeStream.write(chunk,encoding))callback();else this.#onDrain=callback}_final(callback){this.#writeStream.end(),this.#onFinish=(...args)=>callback(...args)}};return new StdinStream})\n"; +const char* const s_processObjectInternalsGetStdinStreamCode = "(function (fd){\"use strict\";var{destroy}=@getInternalField(@internalModuleRegistry,35)||@createInternalModuleById(35),reader,readerRef,unrefOnRead=!1;function ref(){reader\?\?=@Bun.stdin.stream().getReader(),readerRef\?\?=setInterval(()=>{},1<<30)}function unref(){if(readerRef)clearInterval(readerRef),readerRef=@undefined}const stream=new((@getInternalField(@internalModuleRegistry,42))||(@createInternalModuleById(42))).ReadStream(fd),originalOn=stream.on;stream.on=function(event,listener){if(event===\"readable\")ref(),unrefOnRead=!0;return originalOn.call(this,event,listener)},stream.fd=fd;const originalPause=stream.pause;stream.pause=function(){return unref(),originalPause.call(this)};const originalResume=stream.resume;stream.resume=function(){return ref(),originalResume.call(this)};async function internalRead(stream2){try{var done,value;const read=reader\?.readMany();if(@isPromise(read))({done,value}=await read);else({done,value}=read);if(!done){stream2.push(value[0]);const length=value.length;for(let i=1;i<length;i++)stream2.push(value[i])}else stream2.push(null),stream2.pause()}catch(err){stream2.destroy(err)}}return stream._read=function(size){if(unrefOnRead)unref(),unrefOnRead=!1;internalRead(this)},stream.on(\"pause\",()=>{process.nextTick(()=>{destroy(stream)})}),stream.on(\"close\",()=>{process.nextTick(()=>{reader\?.cancel()})}),stream})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ @@ -1852,9 +1852,9 @@ const char* const s_readableStreamInternalsReadableStreamDefaultControllerCanClo const JSC::ConstructAbility s_readableStreamInternalsLazyLoadStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructorKind = JSC::ConstructorKind::None; const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsLazyLoadStreamCodeLength = 2881; +const int s_readableStreamInternalsLazyLoadStreamCodeLength = 2994; static const JSC::Intrinsic s_readableStreamInternalsLazyLoadStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsLazyLoadStreamCode = "(function (stream,autoAllocateChunkSize){\"use strict\";var nativeType=@getByIdDirectPrivate(stream,\"bunNativeType\"),nativePtr=@getByIdDirectPrivate(stream,\"bunNativePtr\"),Prototype=@lazyStreamPrototypeMap.@get(nativeType);if(Prototype===@undefined){let handleNativeReadableStreamPromiseResult2=function(val){var{c,v}=this;this.c=@undefined,this.v=@undefined,handleResult(val,c,v)},callClose2=function(controller){try{controller.close()}catch(e){globalThis.reportError(e)}},createResult2=function(tag,controller,view,closer2){closer2[0]=!1;var result;try{result=pull(tag,view,closer2)}catch(err){return controller.error(err)}return handleResult(result,controller,view)};var handleNativeReadableStreamPromiseResult=handleNativeReadableStreamPromiseResult2,callClose=callClose2,createResult=createResult2,[pull,start,cancel,setClose,deinit,setRefOrUnref,drain]=@lazyLoad(nativeType),closer=[!1],handleResult;handleResult=function handleResult(result,controller,view){if(result&&@isPromise(result))return result.then(handleNativeReadableStreamPromiseResult2.bind({c:controller,v:view}),(err)=>controller.error(err));else if(typeof result===\"number\")if(view&&view.byteLength===result&&view.buffer===controller.byobRequest\?.view\?.buffer)controller.byobRequest.respondWithNewView(view);else controller.byobRequest.respond(result);else if(result.constructor===@Uint8Array)controller.enqueue(result);if(closer[0]||result===!1)@enqueueJob(callClose2,controller),closer[0]=!1};const registry=deinit\?new FinalizationRegistry(deinit):null;Prototype=class NativeReadableStreamSource{constructor(tag,autoAllocateChunkSize2,drainValue2){if(this.#tag=tag,this.#cancellationToken={},this.pull=this.#pull.bind(this),this.cancel=this.#cancel.bind(this),this.autoAllocateChunkSize=autoAllocateChunkSize2,drainValue2!==@undefined)this.start=(controller)=>{controller.enqueue(drainValue2)};if(registry)registry.register(this,tag,this.#cancellationToken)}#cancellationToken;pull;cancel;start;#tag;type=\"bytes\";autoAllocateChunkSize=0;static startSync=start;#pull(controller){var tag=this.#tag;if(!tag){controller.close();return}createResult2(tag,controller,controller.byobRequest.view,closer)}#cancel(reason){var tag=this.#tag;registry&®istry.unregister(this.#cancellationToken),setRefOrUnref&&setRefOrUnref(tag,!1),cancel(tag,reason)}static deinit=deinit;static drain=drain},@lazyStreamPrototypeMap.@set(nativeType,Prototype)}const chunkSize=Prototype.startSync(nativePtr,autoAllocateChunkSize);var drainValue;const{drain:drainFn,deinit:deinitFn}=Prototype;if(drainFn)drainValue=drainFn(nativePtr);if(chunkSize===0){if(deinit&&nativePtr&&@enqueueJob(deinit,nativePtr),(drainValue\?.byteLength\?\?0)>0)return{start(controller){controller.enqueue(drainValue),controller.close()},type:\"bytes\"};return{start(controller){controller.close()},type:\"bytes\"}}return new Prototype(nativePtr,chunkSize,drainValue)})\n"; +const char* const s_readableStreamInternalsLazyLoadStreamCode = "(function (stream,autoAllocateChunkSize){\"use strict\";var nativeType=@getByIdDirectPrivate(stream,\"bunNativeType\"),nativePtr=@getByIdDirectPrivate(stream,\"bunNativePtr\"),Prototype=@lazyStreamPrototypeMap.@get(nativeType);if(Prototype===@undefined){let handleNativeReadableStreamPromiseResult2=function(val){var{c,v}=this;this.c=@undefined,this.v=@undefined,handleResult(val,c,v)},callClose2=function(controller){try{if(@getByIdDirectPrivate(@getByIdDirectPrivate(controller,\"controlledReadableStream\"),\"state\")===@streamReadable)controller.close()}catch(e){globalThis.reportError(e)}},createResult2=function(tag,controller,view,closer2){closer2[0]=!1;var result;try{result=pull(tag,view,closer2)}catch(err){return controller.error(err)}return handleResult(result,controller,view)};var handleNativeReadableStreamPromiseResult=handleNativeReadableStreamPromiseResult2,callClose=callClose2,createResult=createResult2,[pull,start,cancel,setClose,deinit,setRefOrUnref,drain]=@lazyLoad(nativeType),closer=[!1],handleResult;handleResult=function handleResult(result,controller,view){if(result&&@isPromise(result))return result.then(handleNativeReadableStreamPromiseResult2.bind({c:controller,v:view}),(err)=>controller.error(err));else if(typeof result===\"number\")if(view&&view.byteLength===result&&view.buffer===controller.byobRequest\?.view\?.buffer)controller.byobRequest.respondWithNewView(view);else controller.byobRequest.respond(result);else if(result.constructor===@Uint8Array)controller.enqueue(result);if(closer[0]||result===!1)@enqueueJob(callClose2,controller),closer[0]=!1};const registry=deinit\?new FinalizationRegistry(deinit):null;Prototype=class NativeReadableStreamSource{constructor(tag,autoAllocateChunkSize2,drainValue2){if(this.#tag=tag,this.#cancellationToken={},this.pull=this.#pull.bind(this),this.cancel=this.#cancel.bind(this),this.autoAllocateChunkSize=autoAllocateChunkSize2,drainValue2!==@undefined)this.start=(controller)=>{controller.enqueue(drainValue2)};if(registry)registry.register(this,tag,this.#cancellationToken)}#cancellationToken;pull;cancel;start;#tag;type=\"bytes\";autoAllocateChunkSize=0;static startSync=start;#pull(controller){var tag=this.#tag;if(!tag){controller.close();return}createResult2(tag,controller,controller.byobRequest.view,closer)}#cancel(reason){var tag=this.#tag;registry&®istry.unregister(this.#cancellationToken),setRefOrUnref&&setRefOrUnref(tag,!1),cancel(tag,reason)}static deinit=deinit;static drain=drain},@lazyStreamPrototypeMap.@set(nativeType,Prototype)}const chunkSize=Prototype.startSync(nativePtr,autoAllocateChunkSize);var drainValue;const{drain:drainFn,deinit:deinitFn}=Prototype;if(drainFn)drainValue=drainFn(nativePtr);if(chunkSize===0){if(deinit&&nativePtr&&@enqueueJob(deinit,nativePtr),(drainValue\?.byteLength\?\?0)>0)return{start(controller){controller.enqueue(drainValue),controller.close()},type:\"bytes\"};return{start(controller){controller.close()},type:\"bytes\"}}return new Prototype(nativePtr,chunkSize,drainValue)})\n"; // readableStreamIntoArray const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; diff --git a/src/js/out/WebCoreJSBuiltins.h b/src/js/out/WebCoreJSBuiltins.h index e2ecb32d8..cf28fa82a 100644 --- a/src/js/out/WebCoreJSBuiltins.h +++ b/src/js/out/WebCoreJSBuiltins.h @@ -1181,7 +1181,7 @@ extern const JSC::ImplementationVisibility s_processObjectInternalsGetStdinStrea #define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_DATA(macro) \ macro(binding, processObjectInternalsBinding, 1) \ - macro(getStdioWriteStream, processObjectInternalsGetStdioWriteStream, 2) \ + macro(getStdioWriteStream, processObjectInternalsGetStdioWriteStream, 1) \ macro(getStdinStream, processObjectInternalsGetStdinStream, 1) \ #define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(macro) \ diff --git a/src/js/private.d.ts b/src/js/private.d.ts index 2667df631..854d07c2e 100644 --- a/src/js/private.d.ts +++ b/src/js/private.d.ts @@ -199,6 +199,11 @@ interface BunLazyModules { threadId: number, _receiveMessageOnPort: (port: MessagePort) => any, ]; + "tty": { + ttySetMode: (fd: number, mode: number) => number; + isatty: (fd: number) => boolean; + getWindowSize: (fd: number, out: number[2]) => boolean; + }; // ReadableStream related [1]: any; diff --git a/test/js/node/stream/node-stream.test.js b/test/js/node/stream/node-stream.test.js index 5f5b9d67a..44f3f4ff8 100644 --- a/test/js/node/stream/node-stream.test.js +++ b/test/js/node/stream/node-stream.test.js @@ -1,8 +1,10 @@ import { expect, describe, it } from "bun:test"; import { Readable, Writable, Duplex, Transform, PassThrough } from "node:stream"; import { createReadStream } from "node:fs"; +import { join } from "path"; +import { bunExe, bunEnv } from "harness"; import { tmpdir } from "node:os"; -import { writeFileSync } from "node:fs"; +import { writeFileSync, mkdirSync } from "node:fs"; describe("Readable", () => { it("should be able to be created without _construct method defined", done => { @@ -192,3 +194,123 @@ describe("PassThrough", () => { expect(subclass instanceof PassThrough).toBe(true); }); }); + +const ttyStreamsTest = ` +import tty from "tty"; + +import { dlopen } from "bun:ffi"; + +const suffix = process.platform === "darwin" ? "dylib" : "so.6"; + +var lazyOpenpty; +export function openpty() { + if (!lazyOpenpty) { + lazyOpenpty = dlopen(\`libc.\${suffix}\`, { + openpty: { + args: ["ptr", "ptr", "ptr", "ptr", "ptr"], + returns: "int", + }, + }).symbols.openpty; + } + + const parent_fd = new Int32Array(1).fill(0); + const child_fd = new Int32Array(1).fill(0); + const name_buf = new Int8Array(1000).fill(0); + const term_buf = new Uint8Array(1000).fill(0); + const win_buf = new Uint8Array(1000).fill(0); + + lazyOpenpty(parent_fd, child_fd, name_buf, term_buf, win_buf); + + return { + parent_fd: parent_fd[0], + child_fd: child_fd[0], + }; +} + +var lazyClose; +export function close(fd) { + if (!lazyClose) { + lazyClose = dlopen(\`libc.\${suffix}\`, { + close: { + args: ["int"], + returns: "int", + }, + }).symbols.close; + } + + lazyClose(fd); +} + +describe("TTY", () => { + it("ReadStream stdin", () => { + const { parent_fd, child_fd } = openpty(); + const rs = new tty.ReadStream(parent_fd); + const rs1 = tty.ReadStream(child_fd); + expect(rs1 instanceof tty.ReadStream).toBe(true); + expect(rs instanceof tty.ReadStream).toBe(true); + expect(tty.isatty(rs.fd)).toBe(true); + expect(tty.isatty(rs1.fd)).toBe(true); + expect(rs.isRaw).toBe(false); + expect(rs.isTTY).toBe(true); + expect(rs.setRawMode).toBeInstanceOf(Function); + expect(rs.setRawMode(true)).toBe(rs); + expect(rs.isRaw).toBe(true); + expect(rs.setRawMode(false)).toBe(rs); + expect(rs.isRaw).toBe(false); + close(parent_fd); + close(child_fd); + }); + it("WriteStream stdout", () => { + const { child_fd, parent_fd } = openpty(); + const ws = new tty.WriteStream(child_fd); + const ws1 = tty.WriteStream(parent_fd); + expect(ws1 instanceof tty.WriteStream).toBe(true); + expect(ws instanceof tty.WriteStream).toBe(true); + expect(tty.isatty(ws.fd)).toBe(true); + expect(ws.isTTY).toBe(true); + + // pseudo terminal, not the best test because cols and rows can be 0 + expect(ws.columns).toBeGreaterThanOrEqual(0); + expect(ws.rows).toBeGreaterThanOrEqual(0); + expect(ws.getColorDepth()).toBeGreaterThanOrEqual(0); + expect(ws.hasColors(2)).toBe(true); + close(parent_fd); + close(child_fd); + }); + it("process.stdio tty", () => { + expect(process.stdin instanceof tty.ReadStream).toBe(true); + expect(process.stdout instanceof tty.WriteStream).toBe(true); + expect(process.stderr instanceof tty.WriteStream).toBe(true); + expect(process.stdin.isTTY).toBeDefined(); + expect(process.stdout.isTTY).toBeDefined(); + expect(process.stderr.isTTY).toBeDefined(); + }); + it("read and write stream prototypes", () => { + expect(tty.ReadStream.prototype.setRawMode).toBeInstanceOf(Function); + expect(tty.WriteStream.prototype.clearLine).toBeInstanceOf(Function); + expect(tty.WriteStream.prototype.clearScreenDown).toBeInstanceOf(Function); + expect(tty.WriteStream.prototype.cursorTo).toBeInstanceOf(Function); + expect(tty.WriteStream.prototype.getColorDepth).toBeInstanceOf(Function); + expect(tty.WriteStream.prototype.getWindowSize).toBeInstanceOf(Function); + expect(tty.WriteStream.prototype.hasColors).toBeInstanceOf(Function); + expect(tty.WriteStream.prototype.hasColors).toBeInstanceOf(Function); + expect(tty.WriteStream.prototype.moveCursor).toBeInstanceOf(Function); + }); +}); +`; + +it("TTY streams", () => { + mkdirSync(join(tmpdir(), "tty-test"), { recursive: true }); + writeFileSync(join(tmpdir(), "tty-test/tty-streams.test.js"), ttyStreamsTest, {}); + + const { stdout, stderr, exitCode } = Bun.spawnSync({ + cmd: [bunExe(), "test", "tty-streams.test.js"], + env: bunEnv, + stdio: ["ignore", "pipe", "pipe"], + cwd: join(tmpdir(), "tty-test"), + }); + + expect(stdout.toString()).toBe(""); + expect(stderr.toString()).toContain("0 fail"); + expect(exitCode).toBe(0); +}); |