diff --git a/docs/Runtime/index.js b/docs/Runtime/index.js new file mode 100644 index 0000000..02dc938 --- /dev/null +++ b/docs/Runtime/index.js @@ -0,0 +1,438 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.JavaScriptKit = {})); +})(this, (function (exports) { 'use strict'; + + /// Memory lifetime of closures in Swift are managed by Swift side + class SwiftClosureDeallocator { + constructor(exports) { + if (typeof FinalizationRegistry === "undefined") { + throw new Error("The Swift part of JavaScriptKit was configured to require " + + "the availability of JavaScript WeakRefs. Please build " + + "with `-Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS` to " + + "disable features that use WeakRefs."); + } + this.functionRegistry = new FinalizationRegistry((id) => { + exports.swjs_free_host_function(id); + }); + } + track(func, func_ref) { + this.functionRegistry.register(func, func_ref); + } + } + + function assertNever(x, message) { + throw new Error(message); + } + + const decode = (kind, payload1, payload2, memory) => { + switch (kind) { + case 0 /* Boolean */: + switch (payload1) { + case 0: + return false; + case 1: + return true; + } + case 2 /* Number */: + return payload2; + case 1 /* String */: + case 3 /* Object */: + case 6 /* Function */: + case 7 /* Symbol */: + case 8 /* BigInt */: + return memory.getObject(payload1); + case 4 /* Null */: + return null; + case 5 /* Undefined */: + return undefined; + default: + assertNever(kind, `JSValue Type kind "${kind}" is not supported`); + } + }; + // Note: + // `decodeValues` assumes that the size of RawJSValue is 16. + const decodeArray = (ptr, length, memory) => { + // fast path for empty array + if (length === 0) { + return []; + } + let result = []; + // It's safe to hold DataView here because WebAssembly.Memory.buffer won't + // change within this function. + const view = memory.dataView(); + for (let index = 0; index < length; index++) { + const base = ptr + 16 * index; + const kind = view.getUint32(base, true); + const payload1 = view.getUint32(base + 4, true); + const payload2 = view.getFloat64(base + 8, true); + result.push(decode(kind, payload1, payload2, memory)); + } + return result; + }; + // A helper function to encode a RawJSValue into a pointers. + // Please prefer to use `writeAndReturnKindBits` to avoid unnecessary + // memory stores. + // This function should be used only when kind flag is stored in memory. + const write = (value, kind_ptr, payload1_ptr, payload2_ptr, is_exception, memory) => { + const kind = writeAndReturnKindBits(value, payload1_ptr, payload2_ptr, is_exception, memory); + memory.writeUint32(kind_ptr, kind); + }; + const writeAndReturnKindBits = (value, payload1_ptr, payload2_ptr, is_exception, memory) => { + const exceptionBit = (is_exception ? 1 : 0) << 31; + if (value === null) { + return exceptionBit | 4 /* Null */; + } + const writeRef = (kind) => { + memory.writeUint32(payload1_ptr, memory.retain(value)); + return exceptionBit | kind; + }; + const type = typeof value; + switch (type) { + case "boolean": { + memory.writeUint32(payload1_ptr, value ? 1 : 0); + return exceptionBit | 0 /* Boolean */; + } + case "number": { + memory.writeFloat64(payload2_ptr, value); + return exceptionBit | 2 /* Number */; + } + case "string": { + return writeRef(1 /* String */); + } + case "undefined": { + return exceptionBit | 5 /* Undefined */; + } + case "object": { + return writeRef(3 /* Object */); + } + case "function": { + return writeRef(6 /* Function */); + } + case "symbol": { + return writeRef(7 /* Symbol */); + } + case "bigint": { + return writeRef(8 /* BigInt */); + } + default: + assertNever(type, `Type "${type}" is not supported yet`); + } + throw new Error("Unreachable"); + }; + + let globalVariable; + if (typeof globalThis !== "undefined") { + globalVariable = globalThis; + } + else if (typeof window !== "undefined") { + globalVariable = window; + } + else if (typeof global !== "undefined") { + globalVariable = global; + } + else if (typeof self !== "undefined") { + globalVariable = self; + } + + class SwiftRuntimeHeap { + constructor() { + this._heapValueById = new Map(); + this._heapValueById.set(0, globalVariable); + this._heapEntryByValue = new Map(); + this._heapEntryByValue.set(globalVariable, { id: 0, rc: 1 }); + // Note: 0 is preserved for global + this._heapNextKey = 1; + } + retain(value) { + const entry = this._heapEntryByValue.get(value); + if (entry) { + entry.rc++; + return entry.id; + } + const id = this._heapNextKey++; + this._heapValueById.set(id, value); + this._heapEntryByValue.set(value, { id: id, rc: 1 }); + return id; + } + release(ref) { + const value = this._heapValueById.get(ref); + const entry = this._heapEntryByValue.get(value); + entry.rc--; + if (entry.rc != 0) + return; + this._heapEntryByValue.delete(value); + this._heapValueById.delete(ref); + } + referenceHeap(ref) { + const value = this._heapValueById.get(ref); + if (value === undefined) { + throw new ReferenceError("Attempted to read invalid reference " + ref); + } + return value; + } + } + + class Memory { + constructor(exports) { + this.heap = new SwiftRuntimeHeap(); + this.retain = (value) => this.heap.retain(value); + this.getObject = (ref) => this.heap.referenceHeap(ref); + this.release = (ref) => this.heap.release(ref); + this.bytes = () => new Uint8Array(this.rawMemory.buffer); + this.dataView = () => new DataView(this.rawMemory.buffer); + this.writeBytes = (ptr, bytes) => this.bytes().set(bytes, ptr); + this.readUint32 = (ptr) => this.dataView().getUint32(ptr, true); + this.readUint64 = (ptr) => this.dataView().getBigUint64(ptr, true); + this.readInt64 = (ptr) => this.dataView().getBigInt64(ptr, true); + this.readFloat64 = (ptr) => this.dataView().getFloat64(ptr, true); + this.writeUint32 = (ptr, value) => this.dataView().setUint32(ptr, value, true); + this.writeUint64 = (ptr, value) => this.dataView().setBigUint64(ptr, value, true); + this.writeInt64 = (ptr, value) => this.dataView().setBigInt64(ptr, value, true); + this.writeFloat64 = (ptr, value) => this.dataView().setFloat64(ptr, value, true); + this.rawMemory = exports.memory; + } + } + + class SwiftRuntime { + constructor() { + this.version = 708; + this.textDecoder = new TextDecoder("utf-8"); + this.textEncoder = new TextEncoder(); // Only support utf-8 + /** @deprecated Use `wasmImports` instead */ + this.importObjects = () => this.wasmImports; + this.wasmImports = { + swjs_set_prop: (ref, name, kind, payload1, payload2) => { + const memory = this.memory; + const obj = memory.getObject(ref); + const key = memory.getObject(name); + const value = decode(kind, payload1, payload2, memory); + obj[key] = value; + }, + swjs_get_prop: (ref, name, payload1_ptr, payload2_ptr) => { + const memory = this.memory; + const obj = memory.getObject(ref); + const key = memory.getObject(name); + const result = obj[key]; + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, memory); + }, + swjs_set_subscript: (ref, index, kind, payload1, payload2) => { + const memory = this.memory; + const obj = memory.getObject(ref); + const value = decode(kind, payload1, payload2, memory); + obj[index] = value; + }, + swjs_get_subscript: (ref, index, payload1_ptr, payload2_ptr) => { + const obj = this.memory.getObject(ref); + const result = obj[index]; + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, this.memory); + }, + swjs_encode_string: (ref, bytes_ptr_result) => { + const memory = this.memory; + const bytes = this.textEncoder.encode(memory.getObject(ref)); + const bytes_ptr = memory.retain(bytes); + memory.writeUint32(bytes_ptr_result, bytes_ptr); + return bytes.length; + }, + swjs_decode_string: (bytes_ptr, length) => { + const memory = this.memory; + const bytes = memory + .bytes() + .subarray(bytes_ptr, bytes_ptr + length); + const string = this.textDecoder.decode(bytes); + return memory.retain(string); + }, + swjs_load_string: (ref, buffer) => { + const memory = this.memory; + const bytes = memory.getObject(ref); + memory.writeBytes(buffer, bytes); + }, + swjs_call_function: (ref, argv, argc, payload1_ptr, payload2_ptr) => { + const memory = this.memory; + const func = memory.getObject(ref); + let result = undefined; + try { + const args = decodeArray(argv, argc, memory); + result = func(...args); + } + catch (error) { + return writeAndReturnKindBits(error, payload1_ptr, payload2_ptr, true, this.memory); + } + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, this.memory); + }, + swjs_call_function_no_catch: (ref, argv, argc, payload1_ptr, payload2_ptr) => { + const memory = this.memory; + const func = memory.getObject(ref); + const args = decodeArray(argv, argc, memory); + const result = func(...args); + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, this.memory); + }, + swjs_call_function_with_this: (obj_ref, func_ref, argv, argc, payload1_ptr, payload2_ptr) => { + const memory = this.memory; + const obj = memory.getObject(obj_ref); + const func = memory.getObject(func_ref); + let result; + try { + const args = decodeArray(argv, argc, memory); + result = func.apply(obj, args); + } + catch (error) { + return writeAndReturnKindBits(error, payload1_ptr, payload2_ptr, true, this.memory); + } + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, this.memory); + }, + swjs_call_function_with_this_no_catch: (obj_ref, func_ref, argv, argc, payload1_ptr, payload2_ptr) => { + const memory = this.memory; + const obj = memory.getObject(obj_ref); + const func = memory.getObject(func_ref); + let result = undefined; + const args = decodeArray(argv, argc, memory); + result = func.apply(obj, args); + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, this.memory); + }, + swjs_call_new: (ref, argv, argc) => { + const memory = this.memory; + const constructor = memory.getObject(ref); + const args = decodeArray(argv, argc, memory); + const instance = new constructor(...args); + return this.memory.retain(instance); + }, + swjs_call_throwing_new: (ref, argv, argc, exception_kind_ptr, exception_payload1_ptr, exception_payload2_ptr) => { + let memory = this.memory; + const constructor = memory.getObject(ref); + let result; + try { + const args = decodeArray(argv, argc, memory); + result = new constructor(...args); + } + catch (error) { + write(error, exception_kind_ptr, exception_payload1_ptr, exception_payload2_ptr, true, this.memory); + return -1; + } + memory = this.memory; + write(null, exception_kind_ptr, exception_payload1_ptr, exception_payload2_ptr, false, memory); + return memory.retain(result); + }, + swjs_instanceof: (obj_ref, constructor_ref) => { + const memory = this.memory; + const obj = memory.getObject(obj_ref); + const constructor = memory.getObject(constructor_ref); + return obj instanceof constructor; + }, + swjs_create_function: (host_func_id, line, file) => { + var _a; + const fileString = this.memory.getObject(file); + const func = (...args) => this.callHostFunction(host_func_id, line, fileString, args); + const func_ref = this.memory.retain(func); + (_a = this.closureDeallocator) === null || _a === void 0 ? void 0 : _a.track(func, func_ref); + return func_ref; + }, + swjs_create_typed_array: (constructor_ref, elementsPtr, length) => { + const ArrayType = this.memory.getObject(constructor_ref); + const array = new ArrayType(this.memory.rawMemory.buffer, elementsPtr, length); + // Call `.slice()` to copy the memory + return this.memory.retain(array.slice()); + }, + swjs_load_typed_array: (ref, buffer) => { + const memory = this.memory; + const typedArray = memory.getObject(ref); + const bytes = new Uint8Array(typedArray.buffer); + memory.writeBytes(buffer, bytes); + }, + swjs_release: (ref) => { + this.memory.release(ref); + }, + swjs_i64_to_bigint: (value, signed) => { + return this.memory.retain(signed ? value : BigInt.asUintN(64, value)); + }, + swjs_bigint_to_i64: (ref, signed) => { + const object = this.memory.getObject(ref); + if (typeof object !== "bigint") { + throw new Error(`Expected a BigInt, but got ${typeof object}`); + } + if (signed) { + return object; + } + else { + if (object < BigInt(0)) { + return BigInt(0); + } + return BigInt.asIntN(64, object); + } + }, + swjs_i64_to_bigint_slow: (lower, upper, signed) => { + const value = BigInt.asUintN(32, BigInt(lower)) + + (BigInt.asUintN(32, BigInt(upper)) << BigInt(32)); + return this.memory.retain(signed ? BigInt.asIntN(64, value) : BigInt.asUintN(64, value)); + }, + }; + this._instance = null; + this._memory = null; + this._closureDeallocator = null; + } + setInstance(instance) { + this._instance = instance; + if (typeof this.exports._start === "function") { + throw new Error(`JavaScriptKit supports only WASI reactor ABI. + Please make sure you are building with: + -Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor + `); + } + if (this.exports.swjs_library_version() != this.version) { + throw new Error(`The versions of JavaScriptKit are incompatible. + WebAssembly runtime ${this.exports.swjs_library_version()} != JS runtime ${this.version}`); + } + } + get instance() { + if (!this._instance) + throw new Error("WebAssembly instance is not set yet"); + return this._instance; + } + get exports() { + return this.instance.exports; + } + get memory() { + if (!this._memory) { + this._memory = new Memory(this.instance.exports); + } + return this._memory; + } + get closureDeallocator() { + if (this._closureDeallocator) + return this._closureDeallocator; + const features = this.exports.swjs_library_features(); + const librarySupportsWeakRef = (features & 1 /* WeakRefs */) != 0; + if (librarySupportsWeakRef) { + this._closureDeallocator = new SwiftClosureDeallocator(this.exports); + } + return this._closureDeallocator; + } + callHostFunction(host_func_id, line, file, args) { + const argc = args.length; + const argv = this.exports.swjs_prepare_host_function_call(argc); + const memory = this.memory; + for (let index = 0; index < args.length; index++) { + const argument = args[index]; + const base = argv + 16 * index; + write(argument, base, base + 4, base + 8, false, memory); + } + let output; + // This ref is released by the swjs_call_host_function implementation + const callback_func_ref = memory.retain((result) => { + output = result; + }); + const alreadyReleased = this.exports.swjs_call_host_function(host_func_id, argv, argc, callback_func_ref); + if (alreadyReleased) { + throw new Error(`The JSClosure has been already released by Swift side. The closure is created at ${file}:${line}`); + } + this.exports.swjs_cleanup_host_function_call(argv); + return output; + } + } + + exports.SwiftRuntime = SwiftRuntime; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/docs/Runtime/index.mjs b/docs/Runtime/index.mjs new file mode 100644 index 0000000..823ffca --- /dev/null +++ b/docs/Runtime/index.mjs @@ -0,0 +1,428 @@ +/// Memory lifetime of closures in Swift are managed by Swift side +class SwiftClosureDeallocator { + constructor(exports) { + if (typeof FinalizationRegistry === "undefined") { + throw new Error("The Swift part of JavaScriptKit was configured to require " + + "the availability of JavaScript WeakRefs. Please build " + + "with `-Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS` to " + + "disable features that use WeakRefs."); + } + this.functionRegistry = new FinalizationRegistry((id) => { + exports.swjs_free_host_function(id); + }); + } + track(func, func_ref) { + this.functionRegistry.register(func, func_ref); + } +} + +function assertNever(x, message) { + throw new Error(message); +} + +const decode = (kind, payload1, payload2, memory) => { + switch (kind) { + case 0 /* Boolean */: + switch (payload1) { + case 0: + return false; + case 1: + return true; + } + case 2 /* Number */: + return payload2; + case 1 /* String */: + case 3 /* Object */: + case 6 /* Function */: + case 7 /* Symbol */: + case 8 /* BigInt */: + return memory.getObject(payload1); + case 4 /* Null */: + return null; + case 5 /* Undefined */: + return undefined; + default: + assertNever(kind, `JSValue Type kind "${kind}" is not supported`); + } +}; +// Note: +// `decodeValues` assumes that the size of RawJSValue is 16. +const decodeArray = (ptr, length, memory) => { + // fast path for empty array + if (length === 0) { + return []; + } + let result = []; + // It's safe to hold DataView here because WebAssembly.Memory.buffer won't + // change within this function. + const view = memory.dataView(); + for (let index = 0; index < length; index++) { + const base = ptr + 16 * index; + const kind = view.getUint32(base, true); + const payload1 = view.getUint32(base + 4, true); + const payload2 = view.getFloat64(base + 8, true); + result.push(decode(kind, payload1, payload2, memory)); + } + return result; +}; +// A helper function to encode a RawJSValue into a pointers. +// Please prefer to use `writeAndReturnKindBits` to avoid unnecessary +// memory stores. +// This function should be used only when kind flag is stored in memory. +const write = (value, kind_ptr, payload1_ptr, payload2_ptr, is_exception, memory) => { + const kind = writeAndReturnKindBits(value, payload1_ptr, payload2_ptr, is_exception, memory); + memory.writeUint32(kind_ptr, kind); +}; +const writeAndReturnKindBits = (value, payload1_ptr, payload2_ptr, is_exception, memory) => { + const exceptionBit = (is_exception ? 1 : 0) << 31; + if (value === null) { + return exceptionBit | 4 /* Null */; + } + const writeRef = (kind) => { + memory.writeUint32(payload1_ptr, memory.retain(value)); + return exceptionBit | kind; + }; + const type = typeof value; + switch (type) { + case "boolean": { + memory.writeUint32(payload1_ptr, value ? 1 : 0); + return exceptionBit | 0 /* Boolean */; + } + case "number": { + memory.writeFloat64(payload2_ptr, value); + return exceptionBit | 2 /* Number */; + } + case "string": { + return writeRef(1 /* String */); + } + case "undefined": { + return exceptionBit | 5 /* Undefined */; + } + case "object": { + return writeRef(3 /* Object */); + } + case "function": { + return writeRef(6 /* Function */); + } + case "symbol": { + return writeRef(7 /* Symbol */); + } + case "bigint": { + return writeRef(8 /* BigInt */); + } + default: + assertNever(type, `Type "${type}" is not supported yet`); + } + throw new Error("Unreachable"); +}; + +let globalVariable; +if (typeof globalThis !== "undefined") { + globalVariable = globalThis; +} +else if (typeof window !== "undefined") { + globalVariable = window; +} +else if (typeof global !== "undefined") { + globalVariable = global; +} +else if (typeof self !== "undefined") { + globalVariable = self; +} + +class SwiftRuntimeHeap { + constructor() { + this._heapValueById = new Map(); + this._heapValueById.set(0, globalVariable); + this._heapEntryByValue = new Map(); + this._heapEntryByValue.set(globalVariable, { id: 0, rc: 1 }); + // Note: 0 is preserved for global + this._heapNextKey = 1; + } + retain(value) { + const entry = this._heapEntryByValue.get(value); + if (entry) { + entry.rc++; + return entry.id; + } + const id = this._heapNextKey++; + this._heapValueById.set(id, value); + this._heapEntryByValue.set(value, { id: id, rc: 1 }); + return id; + } + release(ref) { + const value = this._heapValueById.get(ref); + const entry = this._heapEntryByValue.get(value); + entry.rc--; + if (entry.rc != 0) + return; + this._heapEntryByValue.delete(value); + this._heapValueById.delete(ref); + } + referenceHeap(ref) { + const value = this._heapValueById.get(ref); + if (value === undefined) { + throw new ReferenceError("Attempted to read invalid reference " + ref); + } + return value; + } +} + +class Memory { + constructor(exports) { + this.heap = new SwiftRuntimeHeap(); + this.retain = (value) => this.heap.retain(value); + this.getObject = (ref) => this.heap.referenceHeap(ref); + this.release = (ref) => this.heap.release(ref); + this.bytes = () => new Uint8Array(this.rawMemory.buffer); + this.dataView = () => new DataView(this.rawMemory.buffer); + this.writeBytes = (ptr, bytes) => this.bytes().set(bytes, ptr); + this.readUint32 = (ptr) => this.dataView().getUint32(ptr, true); + this.readUint64 = (ptr) => this.dataView().getBigUint64(ptr, true); + this.readInt64 = (ptr) => this.dataView().getBigInt64(ptr, true); + this.readFloat64 = (ptr) => this.dataView().getFloat64(ptr, true); + this.writeUint32 = (ptr, value) => this.dataView().setUint32(ptr, value, true); + this.writeUint64 = (ptr, value) => this.dataView().setBigUint64(ptr, value, true); + this.writeInt64 = (ptr, value) => this.dataView().setBigInt64(ptr, value, true); + this.writeFloat64 = (ptr, value) => this.dataView().setFloat64(ptr, value, true); + this.rawMemory = exports.memory; + } +} + +class SwiftRuntime { + constructor() { + this.version = 708; + this.textDecoder = new TextDecoder("utf-8"); + this.textEncoder = new TextEncoder(); // Only support utf-8 + /** @deprecated Use `wasmImports` instead */ + this.importObjects = () => this.wasmImports; + this.wasmImports = { + swjs_set_prop: (ref, name, kind, payload1, payload2) => { + const memory = this.memory; + const obj = memory.getObject(ref); + const key = memory.getObject(name); + const value = decode(kind, payload1, payload2, memory); + obj[key] = value; + }, + swjs_get_prop: (ref, name, payload1_ptr, payload2_ptr) => { + const memory = this.memory; + const obj = memory.getObject(ref); + const key = memory.getObject(name); + const result = obj[key]; + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, memory); + }, + swjs_set_subscript: (ref, index, kind, payload1, payload2) => { + const memory = this.memory; + const obj = memory.getObject(ref); + const value = decode(kind, payload1, payload2, memory); + obj[index] = value; + }, + swjs_get_subscript: (ref, index, payload1_ptr, payload2_ptr) => { + const obj = this.memory.getObject(ref); + const result = obj[index]; + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, this.memory); + }, + swjs_encode_string: (ref, bytes_ptr_result) => { + const memory = this.memory; + const bytes = this.textEncoder.encode(memory.getObject(ref)); + const bytes_ptr = memory.retain(bytes); + memory.writeUint32(bytes_ptr_result, bytes_ptr); + return bytes.length; + }, + swjs_decode_string: (bytes_ptr, length) => { + const memory = this.memory; + const bytes = memory + .bytes() + .subarray(bytes_ptr, bytes_ptr + length); + const string = this.textDecoder.decode(bytes); + return memory.retain(string); + }, + swjs_load_string: (ref, buffer) => { + const memory = this.memory; + const bytes = memory.getObject(ref); + memory.writeBytes(buffer, bytes); + }, + swjs_call_function: (ref, argv, argc, payload1_ptr, payload2_ptr) => { + const memory = this.memory; + const func = memory.getObject(ref); + let result = undefined; + try { + const args = decodeArray(argv, argc, memory); + result = func(...args); + } + catch (error) { + return writeAndReturnKindBits(error, payload1_ptr, payload2_ptr, true, this.memory); + } + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, this.memory); + }, + swjs_call_function_no_catch: (ref, argv, argc, payload1_ptr, payload2_ptr) => { + const memory = this.memory; + const func = memory.getObject(ref); + const args = decodeArray(argv, argc, memory); + const result = func(...args); + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, this.memory); + }, + swjs_call_function_with_this: (obj_ref, func_ref, argv, argc, payload1_ptr, payload2_ptr) => { + const memory = this.memory; + const obj = memory.getObject(obj_ref); + const func = memory.getObject(func_ref); + let result; + try { + const args = decodeArray(argv, argc, memory); + result = func.apply(obj, args); + } + catch (error) { + return writeAndReturnKindBits(error, payload1_ptr, payload2_ptr, true, this.memory); + } + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, this.memory); + }, + swjs_call_function_with_this_no_catch: (obj_ref, func_ref, argv, argc, payload1_ptr, payload2_ptr) => { + const memory = this.memory; + const obj = memory.getObject(obj_ref); + const func = memory.getObject(func_ref); + let result = undefined; + const args = decodeArray(argv, argc, memory); + result = func.apply(obj, args); + return writeAndReturnKindBits(result, payload1_ptr, payload2_ptr, false, this.memory); + }, + swjs_call_new: (ref, argv, argc) => { + const memory = this.memory; + const constructor = memory.getObject(ref); + const args = decodeArray(argv, argc, memory); + const instance = new constructor(...args); + return this.memory.retain(instance); + }, + swjs_call_throwing_new: (ref, argv, argc, exception_kind_ptr, exception_payload1_ptr, exception_payload2_ptr) => { + let memory = this.memory; + const constructor = memory.getObject(ref); + let result; + try { + const args = decodeArray(argv, argc, memory); + result = new constructor(...args); + } + catch (error) { + write(error, exception_kind_ptr, exception_payload1_ptr, exception_payload2_ptr, true, this.memory); + return -1; + } + memory = this.memory; + write(null, exception_kind_ptr, exception_payload1_ptr, exception_payload2_ptr, false, memory); + return memory.retain(result); + }, + swjs_instanceof: (obj_ref, constructor_ref) => { + const memory = this.memory; + const obj = memory.getObject(obj_ref); + const constructor = memory.getObject(constructor_ref); + return obj instanceof constructor; + }, + swjs_create_function: (host_func_id, line, file) => { + var _a; + const fileString = this.memory.getObject(file); + const func = (...args) => this.callHostFunction(host_func_id, line, fileString, args); + const func_ref = this.memory.retain(func); + (_a = this.closureDeallocator) === null || _a === void 0 ? void 0 : _a.track(func, func_ref); + return func_ref; + }, + swjs_create_typed_array: (constructor_ref, elementsPtr, length) => { + const ArrayType = this.memory.getObject(constructor_ref); + const array = new ArrayType(this.memory.rawMemory.buffer, elementsPtr, length); + // Call `.slice()` to copy the memory + return this.memory.retain(array.slice()); + }, + swjs_load_typed_array: (ref, buffer) => { + const memory = this.memory; + const typedArray = memory.getObject(ref); + const bytes = new Uint8Array(typedArray.buffer); + memory.writeBytes(buffer, bytes); + }, + swjs_release: (ref) => { + this.memory.release(ref); + }, + swjs_i64_to_bigint: (value, signed) => { + return this.memory.retain(signed ? value : BigInt.asUintN(64, value)); + }, + swjs_bigint_to_i64: (ref, signed) => { + const object = this.memory.getObject(ref); + if (typeof object !== "bigint") { + throw new Error(`Expected a BigInt, but got ${typeof object}`); + } + if (signed) { + return object; + } + else { + if (object < BigInt(0)) { + return BigInt(0); + } + return BigInt.asIntN(64, object); + } + }, + swjs_i64_to_bigint_slow: (lower, upper, signed) => { + const value = BigInt.asUintN(32, BigInt(lower)) + + (BigInt.asUintN(32, BigInt(upper)) << BigInt(32)); + return this.memory.retain(signed ? BigInt.asIntN(64, value) : BigInt.asUintN(64, value)); + }, + }; + this._instance = null; + this._memory = null; + this._closureDeallocator = null; + } + setInstance(instance) { + this._instance = instance; + if (typeof this.exports._start === "function") { + throw new Error(`JavaScriptKit supports only WASI reactor ABI. + Please make sure you are building with: + -Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor + `); + } + if (this.exports.swjs_library_version() != this.version) { + throw new Error(`The versions of JavaScriptKit are incompatible. + WebAssembly runtime ${this.exports.swjs_library_version()} != JS runtime ${this.version}`); + } + } + get instance() { + if (!this._instance) + throw new Error("WebAssembly instance is not set yet"); + return this._instance; + } + get exports() { + return this.instance.exports; + } + get memory() { + if (!this._memory) { + this._memory = new Memory(this.instance.exports); + } + return this._memory; + } + get closureDeallocator() { + if (this._closureDeallocator) + return this._closureDeallocator; + const features = this.exports.swjs_library_features(); + const librarySupportsWeakRef = (features & 1 /* WeakRefs */) != 0; + if (librarySupportsWeakRef) { + this._closureDeallocator = new SwiftClosureDeallocator(this.exports); + } + return this._closureDeallocator; + } + callHostFunction(host_func_id, line, file, args) { + const argc = args.length; + const argv = this.exports.swjs_prepare_host_function_call(argc); + const memory = this.memory; + for (let index = 0; index < args.length; index++) { + const argument = args[index]; + const base = argv + 16 * index; + write(argument, base, base + 4, base + 8, false, memory); + } + let output; + // This ref is released by the swjs_call_host_function implementation + const callback_func_ref = memory.retain((result) => { + output = result; + }); + const alreadyReleased = this.exports.swjs_call_host_function(host_func_id, argv, argc, callback_func_ref); + if (alreadyReleased) { + throw new Error(`The JSClosure has been already released by Swift side. The closure is created at ${file}:${line}`); + } + this.exports.swjs_cleanup_host_function_call(argv); + return output; + } +} + +export { SwiftRuntime }; diff --git a/docs/app.js b/docs/app.js new file mode 100644 index 0000000..4768576 --- /dev/null +++ b/docs/app.js @@ -0,0 +1 @@ +(()=>{"use strict";var t={};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();class e{constructor(t){if("undefined"==typeof FinalizationRegistry)throw new Error("The Swift part of JavaScriptKit was configured to require the availability of JavaScript WeakRefs. Please build with `-Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS` to disable features that use WeakRefs.");this.functionRegistry=new FinalizationRegistry((e=>{t.swjs_free_host_function(e)}))}track(t,e){this.functionRegistry.register(t,e)}}function r(t,e){throw new Error(e)}const n=(t,e,n,i)=>{switch(t){case 0:switch(e){case 0:return!1;case 1:return!0}case 2:return n;case 1:case 3:case 6:case 7:case 8:return i.getObject(e);case 4:return null;case 5:return;default:r(0,`JSValue Type kind "${t}" is not supported`)}},i=(t,e,r)=>{if(0===e)return[];let i=[];const o=r.dataView();for(let s=0;s{const a=s(t,r,n,i,o);o.writeUint32(e,a)},s=(t,e,n,i,o)=>{const s=(i?1:0)<<31;if(null===t)return 4|s;const a=r=>(o.writeUint32(e,o.retain(t)),s|r),u=typeof t;switch(u){case"boolean":return o.writeUint32(e,t?1:0),0|s;case"number":return o.writeFloat64(n,t),2|s;case"string":return a(1);case"undefined":return 5|s;case"object":return a(3);case"function":return a(6);case"symbol":return a(7);case"bigint":return a(8);default:r(0,`Type "${u}" is not supported yet`)}throw new Error("Unreachable")};let a;"undefined"!=typeof globalThis?a=globalThis:"undefined"!=typeof window?a=window:"undefined"!=typeof global?a=global:"undefined"!=typeof self&&(a=self);class u{constructor(){this._heapValueById=new Map,this._heapValueById.set(0,a),this._heapEntryByValue=new Map,this._heapEntryByValue.set(a,{id:0,rc:1}),this._heapNextKey=1}retain(t){const e=this._heapEntryByValue.get(t);if(e)return e.rc++,e.id;const r=this._heapNextKey++;return this._heapValueById.set(r,t),this._heapEntryByValue.set(t,{id:r,rc:1}),r}release(t){const e=this._heapValueById.get(t),r=this._heapEntryByValue.get(e);r.rc--,0==r.rc&&(this._heapEntryByValue.delete(e),this._heapValueById.delete(t))}referenceHeap(t){const e=this._heapValueById.get(t);if(void 0===e)throw new ReferenceError("Attempted to read invalid reference "+t);return e}}class f{constructor(t){this.heap=new u,this.retain=t=>this.heap.retain(t),this.getObject=t=>this.heap.referenceHeap(t),this.release=t=>this.heap.release(t),this.bytes=()=>new Uint8Array(this.rawMemory.buffer),this.dataView=()=>new DataView(this.rawMemory.buffer),this.writeBytes=(t,e)=>this.bytes().set(e,t),this.readUint32=t=>this.dataView().getUint32(t,!0),this.readUint64=t=>this.dataView().getBigUint64(t,!0),this.readInt64=t=>this.dataView().getBigInt64(t,!0),this.readFloat64=t=>this.dataView().getFloat64(t,!0),this.writeUint32=(t,e)=>this.dataView().setUint32(t,e,!0),this.writeUint64=(t,e)=>this.dataView().setBigUint64(t,e,!0),this.writeInt64=(t,e)=>this.dataView().setBigInt64(t,e,!0),this.writeFloat64=(t,e)=>this.dataView().setFloat64(t,e,!0),this.rawMemory=t.memory}}function h(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},h(t,e)}function c(t,e){function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function l(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;t=r.call(t);var n,i=[];try{for(;(void 0===e||0t;++t)w[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t],_["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;_[45]=62,_[95]=63}function R(t,e,r){for(var n=[],i=e;i>18&63]+w[e>>12&63]+w[e>>6&63]+w[63&e]);return n.join("")}function O(t){E||S();for(var e=t.length,r=e%3,n="",i=[],o=0,s=e-r;os?s:o+16383));return 1===r?(t=t[e-1],n+=w[t>>2],n+=w[t<<4&63],n+="=="):2===r&&(t=(t[e-2]<<8)+t[e-1],n+=w[t>>10],n+=w[t>>4&63],n+=w[t<<2&63],n+="="),i.push(n),i.join("")}function T(t,e,r,n,i){var o=8*i-n-1,s=(1<>1,u=-7,f=r?-1:1,h=t[e+(i=r?i-1:0)];for(i+=f,r=h&(1<<-u)-1,h>>=-u,u+=o;0>=-u,u+=n;0>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0;o=n?0:o-1;var c=n?1:-1,l=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(e=isNaN(e)?1:0,n=u):(n=Math.floor(Math.log(e)/Math.LN2),1>e*(s=Math.pow(2,-n))&&(n--,s*=2),2<=(e=1<=n+f?e+h/s:e+h*Math.pow(2,1-f))*s&&(n++,s/=2),n+f>=u?(e=0,n=u):1<=n+f?(e=(e*s-1)*Math.pow(2,i),n+=f):(e=e*Math.pow(2,f-1)*Math.pow(2,i),n=0));8<=i;t[r+o]=255&e,o+=c,e/=256,i-=8);for(n=n<r||e.byteLengtht)throw new RangeError('"size" argument must not be negative')}function U(t,e){if(C(e),t=B(t,0>e?0:0|D(e)),!L.TYPED_ARRAY_SUPPORT)for(var r=0;re.length?0:0|D(e.length);t=B(t,r);for(var n=0;n=(L.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(L.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return 0|t}function M(t){return!(null==t||!t._isBuffer)}function x(t,e){if(M(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return tt(t).length;default:if(n)return Z(t).length;e=(""+e).toLowerCase(),n=!0}}function j(t,e,r){var n=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":for(t=e,e=r,r=this.length,(!t||0>t)&&(t=0),(!e||0>e||e>r)&&(e=r),n="",r=t;r(n=this[r])?"0"+n.toString(16):n.toString(16));return n;case"utf8":case"utf-8":return G(this,e,r);case"ascii":for(t="",r=Math.min(this.length,r);er&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),0>r&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(0>r){if(!i)return-1;r=0}if("string"==typeof e&&(e=L.from(e,n)),M(e))return 0===e.length?-1:V(t,e,r,n,i);if("number"==typeof e)return e&=255,L.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):V(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function V(t,e,r,n,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>e.length)return-1;s=2,a/=2,u/=2,r/=2}if(i)for(n=-1;ra&&(r=a-u);0<=r;r--){for(a=!0,n=0;ni&&(o=i);break;case 2:var a=t[e+1];128==(192&a)&&127<(i=(31&i)<<6|63&a)&&(o=i);break;case 3:a=t[e+1];var u=t[e+2];128==(192&a)&&128==(192&u)&&2047<(i=(15&i)<<12|(63&a)<<6|63&u)&&(55296>i||57343i&&(o=i)}null===o?(o=65533,s=1):65535>>10&1023|55296),o=56320|1023&o),n.push(o),e+=s}if((t=n.length)<=z)n=String.fromCharCode.apply(String,n);else{for(r="",e=0;e=t?B(null,t):void 0!==e?"string"==typeof r?B(null,t).fill(e,r):B(null,t).fill(e):B(null,t)},L.allocUnsafe=function(t){return U(null,t)},L.allocUnsafeSlow=function(t){return U(null,t)},L.isBuffer=rt,L.compare=function(t,e){if(!M(t)||!M(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i"},L.prototype.compare=function(t,e,r,n,i){if(!M(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),0>e||r>t.length||0>n||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s);for(n=this.slice(n,i),t=t.slice(e,r),e=0;ei)&&(r=i),0r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(n||(n="utf8"),i=!1;;)switch(n){case"hex":t:{if(e=Number(e)||0,n=this.length-e,r?(r=Number(r))>n&&(r=n):r=n,0!=(n=t.length)%2)throw new TypeError("Invalid hex string");for(r>n/2&&(r=n/2),n=0;n(i-=2));++s){var a=n.charCodeAt(s);t=a>>8,a%=256,o.push(a),o.push(t)}return et(o,this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},L.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var z=4096;function q(t,e,r){if(0!=t%1||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function K(t,e,r,n,i,o){if(!M(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function H(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function J(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function X(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}L.prototype.slice=function(t,e){var r=this.length;if(0>(t=~~t)?0>(t+=r)&&(t=0):t>r&&(t=r),0>(e=void 0===e?r:~~e)?0>(e+=r)&&(e=0):e>r&&(e=r),e=128*n&&(r-=Math.pow(2,8*e)),r},L.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||q(t,e,this.length),r=e;for(var n=1,i=this[t+--r];0=128*n&&(i-=Math.pow(2,8*e)),i},L.prototype.readInt8=function(t,e){return e||q(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},L.prototype.readInt16LE=function(t,e){return e||q(t,2,this.length),32768&(t=this[t]|this[t+1]<<8)?4294901760|t:t},L.prototype.readInt16BE=function(t,e){return e||q(t,2,this.length),32768&(t=this[t+1]|this[t]<<8)?4294901760|t:t},L.prototype.readInt32LE=function(t,e){return e||q(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},L.prototype.readInt32BE=function(t,e){return e||q(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},L.prototype.readFloatLE=function(t,e){return e||q(t,4,this.length),T(this,t,!0,23,4)},L.prototype.readFloatBE=function(t,e){return e||q(t,4,this.length),T(this,t,!1,23,4)},L.prototype.readDoubleLE=function(t,e){return e||q(t,8,this.length),T(this,t,!0,52,8)},L.prototype.readDoubleBE=function(t,e){return e||q(t,8,this.length),T(this,t,!1,52,8)},L.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||K(this,t,e,r,Math.pow(2,8*r)-1,0),n=1;var i=0;for(this[e]=255&t;++i>>8):H(this,t,e,!0),e+2},L.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||K(this,t,e,2,65535,0),L.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):H(this,t,e,!1),e+2},L.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||K(this,t,e,4,4294967295,0),L.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):J(this,t,e,!0),e+4},L.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||K(this,t,e,4,4294967295,0),L.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):J(this,t,e,!1),e+4},L.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||K(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n),n=0;var i=1,o=0;for(this[e]=255&t;++nt&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},L.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||K(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=1,o=0;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)0>t&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},L.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||K(this,t,e,1,127,-128),L.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},L.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||K(this,t,e,2,32767,-32768),L.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):H(this,t,e,!0),e+2},L.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||K(this,t,e,2,32767,-32768),L.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):H(this,t,e,!1),e+2},L.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||K(this,t,e,4,2147483647,-2147483648),L.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):J(this,t,e,!0),e+4},L.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||K(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),L.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):J(this,t,e,!1),e+4},L.prototype.writeFloatLE=function(t,e,r){return r||X(this,0,e,4),A(this,t,e,!0,23,4),e+4},L.prototype.writeFloatBE=function(t,e,r){return r||X(this,0,e,4),A(this,t,e,!1,23,4),e+4},L.prototype.writeDoubleLE=function(t,e,r){return r||X(this,0,e,8),A(this,t,e,!0,52,8),e+8},L.prototype.writeDoubleBE=function(t,e,r){return r||X(this,0,e,8),A(this,t,e,!1,52,8),e+8},L.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-ei||!L.TYPED_ARRAY_SUPPORT)for(n=0;ni&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!L.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>e||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;nr){if(!i){if(56319r){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,128>r){if(0>--e)break;o.push(r)}else if(2048>r){if(0>(e-=2))break;o.push(r>>6|192,63&r|128)}else if(65536>r){if(0>(e-=3))break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw Error("Invalid code point");if(0>(e-=4))break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Q(t){for(var e=[],r=0;r(t=(t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace($,"")).length)t="";else for(;0!=t.length%4;)t+="=";E||S();var e=t.length;if(0>16&255,n[o++]=s>>8&255,n[o++]=255&s}return 2===r?(s=_[t.charCodeAt(e)]<<2|_[t.charCodeAt(e+1)]>>4,n[o++]=255&s):1===r&&(s=_[t.charCodeAt(e)]<<10|_[t.charCodeAt(e+1)]<<4|_[t.charCodeAt(e+2)]>>2,n[o++]=s>>8&255,n[o++]=255&s),n}function et(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function rt(t){return null!=t&&(!!t._isBuffer||nt(t)||"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&nt(t.slice(0,0)))}function nt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var it=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:k,Buffer:L,SlowBuffer:function(t){return+t!=t&&(t=0),L.alloc(+t)},isBuffer:rt}),ot=L,st="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t.g?t.g:"undefined"!=typeof self?self:{};function at(t,e){return t(e={exports:{}},e.exports),e.exports}function ut(){throw Error("setTimeout has not been defined")}function ft(){throw Error("clearTimeout has not been defined")}var ht=ut,ct=ft;function lt(t){if(ht===setTimeout)return setTimeout(t,0);if((ht===ut||!ht)&&setTimeout)return ht=setTimeout,setTimeout(t,0);try{return ht(t,0)}catch(e){try{return ht.call(null,t,0)}catch(e){return ht.call(this,t,0)}}}"function"==typeof v.setTimeout&&(ht=setTimeout),"function"==typeof v.clearTimeout&&(ct=clearTimeout);var pt,dt=[],yt=!1,gt=-1;function mt(){yt&&pt&&(yt=!1,pt.length?dt=pt.concat(dt):gt=-1,dt.length&&vt())}function vt(){if(!yt){var t=lt(mt);yt=!0;for(var e=dt.length;e;){for(pt=dt,dt=[];++gt(e-=t[1])&&(r--,e+=1e9)),[r,e]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Rt)/1e3}},Tt=at((function(t,e){function r(t,e){for(var r in t)e[r]=t[r]}function n(t,e,r){return i(t,e,r)}var i=it.Buffer;i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=it:(r(it,e),e.Buffer=n),n.prototype=Object.create(i.prototype),r(i,n),n.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},n.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");return t=i(t),void 0!==e?"string"==typeof r?t.fill(e,r):t.fill(e):t.fill(0),t},n.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},n.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return it.SlowBuffer(t)}})),At=at((function(t,e){function r(){throw Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}function n(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>f||0>t)throw new TypeError("offset must be a uint32");if(t>a||t>e)throw new RangeError("offset out of range")}function i(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>f||0>t)throw new TypeError("size must be a uint32");if(t+e>r||t>a)throw new RangeError("buffer too small")}function o(t,e,r,n){if(e=new Uint8Array(t.buffer,e,r),u.getRandomValues(e),!n)return t;wt((function(){n(null,t)}))}var s=Tt.Buffer,a=Tt.kMaxLength,u=st.crypto||st.msCrypto,f=Math.pow(2,32)-1;u&&u.getRandomValues?(e.randomFill=function(t,e,r,a){if(!(s.isBuffer(t)||t instanceof st.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)a=e,e=0,r=t.length;else if("function"==typeof r)a=r,r=t.length-e;else if("function"!=typeof a)throw new TypeError('"cb" argument must be a function');return n(e,t.length),i(r,e,t.length),o(t,e,r,a)},e.randomFillSync=function(t,e,r){if(void 0===e&&(e=0),!(s.isBuffer(t)||t instanceof st.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return n(e,t.length),void 0===r&&(r=t.length-e),i(r,e,t.length),o(t,e,r)}):(e.randomFill=r,e.randomFillSync=r)})),It=at((function(t){t.exports=At})).randomFillSync,Nt=Math.floor(.001*(Date.now()-performance.now()));function kt(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function Bt(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(an.length||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(2a){if(47===e.charCodeAt(o+f))return e.slice(o+f+1);if(0===f)return e.slice(o+f)}else i>a&&(47===t.charCodeAt(r+f)?u=f:0===f&&(u=0));break}var h=t.charCodeAt(r+f);if(h!==e.charCodeAt(o+f))break;47===h&&(u=f)}for(i="",f=r+u+1;f<=n;++f)f!==n&&47!==t.charCodeAt(f)||(i=0===i.length?i+"..":i+"/..");return 0=i;--f)if(47===(r=t.charCodeAt(f))){if(!u){s=f+1;break}}else-1===a&&(u=!1,a=f+1),46===r?-1===o?o=f:1!==h&&(h=1):-1!==o&&(h=-1);return-1===o||-1===a||0===h||1===h&&o===a-1&&o===s+1?-1!==a&&(e.base=e.name=0===s&&n?t.slice(1,a):t.slice(s,a)):(0===s&&n?(e.name=t.slice(1,o),e.base=t.slice(1,a)):(e.name=t.slice(s,o),e.base=t.slice(s,a)),e.ext=t.slice(o,a)),0(e-=t[1])&&(r--,e+=1e9)),[r,e]}(t))[0]+t[1]},exit:function(t){throw new Ne(t)},kill:function(t){throw new ke(t)},randomFillSync:It,isTTY:function(){return!0},path:Object.freeze({__proto__:null,default:Ct,__moduleExports:Ct}),fs:null},Ft=g(1),Dt=g(2),Mt=g(4),xt=g(8),jt=g(16),Yt=g(32),Wt=g(64),Vt=g(128),Gt=g(256),zt=g(512),qt=g(1024),Kt=g(2048),Ht=g(4096),Jt=g(8192),Xt=g(16384),$t=g(32768),Zt=g(65536),Qt=g(131072),te=g(262144),ee=g(524288),re=g(1048576),ne=g(2097152),ie=g(4194304),oe=g(8388608),se=g(16777216),ae=g(33554432),ue=g(67108864),fe=g(134217728),he=g(268435456),ce=Ft|Dt|Mt|xt|jt|Yt|Wt|Vt|Gt|zt|qt|Kt|Ht|Jt|Xt|$t|Zt|Qt|te|ee|re|ne|oe|ie|se|ue|ae|fe|he,le=Ft|Dt|Mt|xt|jt|Yt|Wt|Vt|Gt|ne|ie|oe|fe,pe=g(0),de=xt|jt|Vt|zt|qt|Kt|Ht|Jt|Xt|$t|Zt|Qt|te|ee|re|ne|oe|se|ue|ae|fe,ye=de|le,ge=Dt|xt|Wt|ne|fe|he,me=Dt|xt|Wt|ne|fe,ve=g(0),we={E2BIG:1,EACCES:2,EADDRINUSE:3,EADDRNOTAVAIL:4,EAFNOSUPPORT:5,EALREADY:7,EAGAIN:6,EBADF:8,EBADMSG:9,EBUSY:10,ECANCELED:11,ECHILD:12,ECONNABORTED:13,ECONNREFUSED:14,ECONNRESET:15,EDEADLOCK:16,EDESTADDRREQ:17,EDOM:18,EDQUOT:19,EEXIST:20,EFAULT:21,EFBIG:22,EHOSTDOWN:23,EHOSTUNREACH:23,EIDRM:24,EILSEQ:25,EINPROGRESS:26,EINTR:27,EINVAL:28,EIO:29,EISCONN:30,EISDIR:31,ELOOP:32,EMFILE:33,EMLINK:34,EMSGSIZE:35,EMULTIHOP:36,ENAMETOOLONG:37,ENETDOWN:38,ENETRESET:39,ENETUNREACH:40,ENFILE:41,ENOBUFS:42,ENODEV:43,ENOENT:44,ENOEXEC:45,ENOLCK:46,ENOLINK:47,ENOMEM:48,ENOMSG:49,ENOPROTOOPT:50,ENOSPC:51,ENOSYS:52,ENOTCONN:53,ENOTDIR:54,ENOTEMPTY:55,ENOTRECOVERABLE:56,ENOTSOCK:57,ENOTTY:59,ENXIO:60,EOVERFLOW:61,EOWNERDEAD:62,EPERM:63,EPIPE:64,EPROTO:65,EPROTONOSUPPORT:66,EPROTOTYPE:67,ERANGE:68,EROFS:69,ESPIPE:70,ESRCH:71,ESTALE:72,ETIMEDOUT:73,ETXTBSY:74,EXDEV:75},_e=((Lt={})[6]="SIGHUP",Lt[8]="SIGINT",Lt[11]="SIGQUIT",Lt[7]="SIGILL",Lt[15]="SIGTRAP",Lt[0]="SIGABRT",Lt[2]="SIGBUS",Lt[5]="SIGFPE",Lt[9]="SIGKILL",Lt[20]="SIGUSR1",Lt[12]="SIGSEGV",Lt[21]="SIGUSR2",Lt[10]="SIGPIPE",Lt[1]="SIGALRM",Lt[14]="SIGTERM",Lt[3]="SIGCHLD",Lt[4]="SIGCONT",Lt[13]="SIGSTOP",Lt[16]="SIGTSTP",Lt[17]="SIGTTIN",Lt[18]="SIGTTOU",Lt[19]="SIGURG",Lt[23]="SIGXCPU",Lt[24]="SIGXFSZ",Lt[22]="SIGVTALRM",Lt),be=Ft|Dt|jt|Vt|ne|fe,Ee=Ft|Wt|jt|Vt|ne|fe;function Se(t){var e=Math.trunc(t);return t=g(Math.round(1e6*(t-e))),g(e)*g(1e6)+t}function Re(t){return"number"==typeof t&&(t=Math.trunc(t)),t=g(t),Number(t/g(1e6))}function Oe(t){return function(){for(var e=[],r=0;rt.rights.base||(t.rights.inheriting|n)>t.rights.inheriting?63:(t.rights.base=e,t.rights.inheriting=n,0)})),fd_filestat_get:Oe((function(t,e){t=r(t,ne);var n=h.fstatSync(t.real);return o.refreshMemory(),o.view.setBigUint64(e,g(n.dev),!0),e+=8,o.view.setBigUint64(e,g(n.ino),!0),e+=8,o.view.setUint8(e,t.filetype),e+=8,o.view.setBigUint64(e,g(n.nlink),!0),e+=8,o.view.setBigUint64(e,g(n.size),!0),e+=8,o.view.setBigUint64(e,Se(n.atimeMs),!0),e+=8,o.view.setBigUint64(e,Se(n.mtimeMs),!0),o.view.setBigUint64(e+8,Se(n.ctimeMs),!0),0})),fd_filestat_set_size:Oe((function(t,e){return t=r(t,ie),h.ftruncateSync(t.real,Number(e)),0})),fd_filestat_set_times:Oe((function(t,n,i,o){t=r(t,oe);var s=h.fstatSync(t.real),a=s.atime;s=s.mtime;var u=Re(e(0));return 3==(3&o)||12==(12&o)?28:(1==(1&o)?a=Re(n):2==(2&o)&&(a=u),4==(4&o)?s=Re(i):8==(8&o)&&(s=u),h.futimesSync(t.real,new Date(a),new Date(s)),0)})),fd_prestat_get:Oe((function(t,e){return(t=r(t,g(0))).path?(o.refreshMemory(),o.view.setUint8(e,0),o.view.setUint32(e+4,ot.byteLength(t.fakePath),!0),0):28})),fd_prestat_dir_name:Oe((function(t,e,n){return(t=r(t,g(0))).path?(o.refreshMemory(),ot.from(o.memory.buffer).write(t.fakePath,e,n,"utf8"),0):28})),fd_pwrite:Oe((function(t,e,i,s,a){var u=r(t,Wt|Mt),f=0;return n(e,i).forEach((function(t){for(var e=0;en)break;if(o.view.setBigUint64(e,g(i+1),!0),(e+=8)-u>n)break;var p=h.statSync(c.resolve(t.path,f.name));if(o.view.setBigUint64(e,g(p.ino),!0),(e+=8)-u>n)break;if(o.view.setUint32(e,l,!0),(e+=4)-u>n)break;switch(!0){case p.isBlockDevice():p=1;break;case p.isCharacterDevice():p=2;break;case p.isDirectory():p=3;break;case p.isFIFO():p=6;break;case p.isFile():p=4;break;case p.isSocket():p=6;break;case p.isSymbolicLink():p=7;break;default:p=0}if(o.view.setUint8(e,p),e+=1,(e+=3)+l>=u+n)break;ot.from(o.memory.buffer).write(f.name,e),e+=l}return o.view.setUint32(s,Math.min(e-u,n),!0),0})),fd_renumber:Oe((function(t,e){return r(t,g(0)),r(e,g(0)),h.closeSync(o.FD_MAP.get(t).real),o.FD_MAP.set(t,o.FD_MAP.get(e)),o.FD_MAP.delete(e),0})),fd_seek:Oe((function(t,e,n,i){switch(t=r(t,Mt),o.refreshMemory(),n){case 1:t.offset=(t.offset?t.offset:g(0))+g(e);break;case 2:n=h.fstatSync(t.real).size,t.offset=g(n)+g(e);break;case 0:t.offset=g(e)}return o.view.setBigUint64(i,t.offset,!0),0})),fd_tell:Oe((function(t,e){return t=r(t,Yt),o.refreshMemory(),t.offset||(t.offset=g(0)),o.view.setBigUint64(e,t.offset,!0),0})),fd_sync:Oe((function(t){return t=r(t,jt),h.fsyncSync(t.real),0})),path_create_directory:Oe((function(t,e,n){return(t=r(t,zt)).path?(o.refreshMemory(),e=ot.from(o.memory.buffer,e,n).toString(),h.mkdirSync(c.resolve(t.path,e)),0):28})),path_filestat_get:Oe((function(t,e,n,i,s){return(t=r(t,te)).path?(o.refreshMemory(),n=ot.from(o.memory.buffer,n,i).toString(),n=h.statSync(c.resolve(t.path,n)),o.view.setBigUint64(s,g(n.dev),!0),s+=8,o.view.setBigUint64(s,g(n.ino),!0),s+=8,o.view.setUint8(s,Ae(o,void 0,n).filetype),s+=8,o.view.setBigUint64(s,g(n.nlink),!0),s+=8,o.view.setBigUint64(s,g(n.size),!0),s+=8,o.view.setBigUint64(s,Se(n.atimeMs),!0),s+=8,o.view.setBigUint64(s,Se(n.mtimeMs),!0),o.view.setBigUint64(s+8,Se(n.ctimeMs),!0),0):28})),path_filestat_set_times:Oe((function(t,n,i,s,a,u,f){if(!(t=r(t,re)).path)return 28;o.refreshMemory();var l=h.fstatSync(t.real);n=l.atime,l=l.mtime;var p=Re(e(0));return 3==(3&f)||12==(12&f)?28:(1==(1&f)?n=Re(a):2==(2&f)&&(n=p),4==(4&f)?l=Re(u):8==(8&f)&&(l=p),i=ot.from(o.memory.buffer,i,s).toString(),h.utimesSync(c.resolve(t.path,i),new Date(n),new Date(l)),0)})),path_link:Oe((function(t,e,n,i,s,a,u){return t=r(t,Kt),s=r(s,Ht),t.path&&s.path?(o.refreshMemory(),n=ot.from(o.memory.buffer,n,i).toString(),a=ot.from(o.memory.buffer,a,u).toString(),h.linkSync(c.resolve(t.path,n),c.resolve(s.path,a)),0):28})),path_open:Oe((function(t,e,n,i,s,a,u,f,l){e=r(t,Jt),a=g(a),u=g(u),t=(a&(Dt|Xt))!==g(0);var p=(a&(Ft|Wt|Gt|ie))!==g(0);if(p&&t)var y=h.constants.O_RDWR;else t?y=h.constants.O_RDONLY:p&&(y=h.constants.O_WRONLY);if(t=a|Jt,a|=u,0!=(1&s)&&(y|=h.constants.O_CREAT,t|=qt),0!=(2&s)&&(y|=h.constants.O_DIRECTORY),0!=(4&s)&&(y|=h.constants.O_EXCL),0!=(8&s)&&(y|=h.constants.O_TRUNC,t|=ee),0!=(1&f)&&(y|=h.constants.O_APPEND),0!=(2&f)&&(y=h.constants.O_DSYNC?y|h.constants.O_DSYNC:y|h.constants.O_SYNC,a|=Ft),0!=(4&f)&&(y|=h.constants.O_NONBLOCK),0!=(8&f)&&(y=h.constants.O_RSYNC?y|h.constants.O_RSYNC:y|h.constants.O_SYNC,a|=jt),0!=(16&f)&&(y|=h.constants.O_SYNC,a|=jt),p&&0==(y&(h.constants.O_APPEND|h.constants.O_TRUNC))&&(a|=Mt),o.refreshMemory(),n=ot.from(o.memory.buffer,n,i).toString(),n=c.resolve(e.path,n),c.relative(e.path,n).startsWith(".."))return 76;try{var m=h.realpathSync(n);if(c.relative(e.path,m).startsWith(".."))return 76}catch(t){if("ENOENT"!==t.code)throw t;m=n}try{var v=h.statSync(m).isDirectory()}catch(t){}return y=!p&&v?h.openSync(m,h.constants.O_RDONLY):h.openSync(m,y),v=d(o.FD_MAP.keys()).reverse()[0]+1,o.FD_MAP.set(v,{real:y,filetype:void 0,rights:{base:t,inheriting:a},path:m}),Te(o,v),o.view.setUint32(l,v,!0),0})),path_readlink:Oe((function(t,e,n,i,s,a){return(t=r(t,$t)).path?(o.refreshMemory(),e=ot.from(o.memory.buffer,e,n).toString(),e=c.resolve(t.path,e),e=h.readlinkSync(e),i=ot.from(o.memory.buffer).write(e,i,s),o.view.setUint32(a,i,!0),0):28})),path_remove_directory:Oe((function(t,e,n){return(t=r(t,ae)).path?(o.refreshMemory(),e=ot.from(o.memory.buffer,e,n).toString(),h.rmdirSync(c.resolve(t.path,e)),0):28})),path_rename:Oe((function(t,e,n,i,s,a){return t=r(t,Zt),i=r(i,Qt),t.path&&i.path?(o.refreshMemory(),e=ot.from(o.memory.buffer,e,n).toString(),s=ot.from(o.memory.buffer,s,a).toString(),h.renameSync(c.resolve(t.path,e),c.resolve(i.path,s)),0):28})),path_symlink:Oe((function(t,e,n,i,s){return(n=r(n,se)).path?(o.refreshMemory(),t=ot.from(o.memory.buffer,t,e).toString(),i=ot.from(o.memory.buffer,i,s).toString(),h.symlinkSync(t,c.resolve(n.path,i)),0):28})),path_unlink_file:Oe((function(t,e,n){return(t=r(t,ue)).path?(o.refreshMemory(),e=ot.from(o.memory.buffer,e,n).toString(),h.unlinkSync(c.resolve(t.path,e)),0):28})),poll_oneoff:function(t,r,n,i){var s=0,a=0;o.refreshMemory();for(var u=0;ua?c:a,o.view.setBigUint64(r,h,!0),r+=8,o.view.setUint16(r,p,!0),r+=2,o.view.setUint8(r,0),r+=1,r+=5,s+=1;break;case 1:case 2:t+=3,o.view.getUint32(t,!0),t+=4,o.view.setBigUint64(r,h,!0),r+=8,o.view.setUint16(r,52,!0),r+=2,o.view.setUint8(r,c),r+=1,r+=5,s+=1;break;default:return 28}}for(o.view.setUint32(i,s,!0);f.hrtime() "+i),i}catch(t){throw console.log("Catched error: "+t),t}}}))}return t.prototype.refreshMemory=function(){this.view&&0!==this.view.buffer.byteLength||(this.view=new m(this.memory.buffer))},t.prototype.setMemory=function(t){this.memory=t},t.prototype.start=function(t){if(null===(t=t.exports)||"object"!=typeof t)throw Error("instance.exports must be an Object. Received "+t+".");var e=t.memory;if(!(e instanceof WebAssembly.Memory))throw Error("instance.exports.memory must be a WebAssembly.Memory. Recceived "+e+".");this.setMemory(e),t._start&&t._start()},t.prototype.getImportNamespace=function(t){var e,r=null;try{for(var n=l(WebAssembly.Module.imports(t)),i=n.next();!i.done;i=n.next()){var o=i.value;if("function"===o.kind&&o.module.startsWith("wasi_"))if(r){if(r!==o.module)throw Error("Multiple namespaces detected.")}else r=o.module}}catch(t){var s={error:t}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(s)throw s.error}}return r},t.prototype.getImports=function(t){switch(this.getImportNamespace(t)){case"wasi_unstable":return{wasi_unstable:this.wasiImport};case"wasi_snapshot_preview1":return{wasi_snapshot_preview1:this.wasiImport};default:throw Error("Can't detect a WASI namespace for the WebAssembly Module")}},t.defaultBindings=Ut,t}();function Le(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function Pe(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;t=r.call(t);var n,i=[];try{for(;(void 0===e||0t;++t)We[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t],Ve["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;Ve[45]=62,Ve[95]=63}function Ke(t,e,r){for(var n=[],i=e;i>18&63]+We[e>>12&63]+We[e>>6&63]+We[63&e]);return n.join("")}function He(t){ze||qe();for(var e=t.length,r=e%3,n="",i=[],o=0,s=e-r;os?s:o+16383));return 1===r?(t=t[e-1],n+=We[t>>2],n+=We[t<<4&63],n+="=="):2===r&&(t=(t[e-2]<<8)+t[e-1],n+=We[t>>10],n+=We[t>>4&63],n+=We[t<<2&63],n+="="),i.push(n),i.join("")}function Je(t,e,r,n,i){var o=8*i-n-1,s=(1<>1,u=-7,f=r?-1:1,h=t[e+(i=r?i-1:0)];for(i+=f,r=h&(1<<-u)-1,h>>=-u,u+=o;0>=-u,u+=n;0>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0;o=n?0:o-1;var c=n?1:-1,l=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(e=isNaN(e)?1:0,n=u):(n=Math.floor(Math.log(e)/Math.LN2),1>e*(s=Math.pow(2,-n))&&(n--,s*=2),2<=(e=1<=n+f?e+h/s:e+h*Math.pow(2,1-f))*s&&(n++,s/=2),n+f>=u?(e=0,n=u):1<=n+f?(e=(e*s-1)*Math.pow(2,i),n+=f):(e=e*Math.pow(2,f-1)*Math.pow(2,i),n=0));8<=i;t[r+o]=255&e,o+=c,e/=256,i-=8);for(n=n<r||e.byteLengtht)throw new RangeError('"size" argument must not be negative')}function ir(t,e){if(nr(e),t=tr(t,0>e?0:0|sr(e)),!er.TYPED_ARRAY_SUPPORT)for(var r=0;re.length?0:0|sr(e.length);t=tr(t,r);for(var n=0;n=(er.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(er.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return 0|t}function ar(t){return!(null==t||!t._isBuffer)}function ur(t,e){if(ar(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return br(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Sr(t).length;default:if(n)return br(t).length;e=(""+e).toLowerCase(),n=!0}}function fr(t,e,r){var n=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":for(t=e,e=r,r=this.length,(!t||0>t)&&(t=0),(!e||0>e||e>r)&&(e=r),n="",r=t;r(n=this[r])?"0"+n.toString(16):n.toString(16));return n;case"utf8":case"utf-8":return pr(this,e,r);case"ascii":for(t="",r=Math.min(this.length,r);er&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),0>r&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(0>r){if(!i)return-1;r=0}if("string"==typeof e&&(e=er.from(e,n)),ar(e))return 0===e.length?-1:lr(t,e,r,n,i);if("number"==typeof e)return e&=255,er.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):lr(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function lr(t,e,r,n,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>e.length)return-1;s=2,a/=2,u/=2,r/=2}if(i)for(n=-1;ra&&(r=a-u);0<=r;r--){for(a=!0,n=0;ni&&(o=i);break;case 2:var a=t[e+1];128==(192&a)&&127<(i=(31&i)<<6|63&a)&&(o=i);break;case 3:a=t[e+1];var u=t[e+2];128==(192&a)&&128==(192&u)&&2047<(i=(15&i)<<12|(63&a)<<6|63&u)&&(55296>i||57343i&&(o=i)}null===o?(o=65533,s=1):65535>>10&1023|55296),o=56320|1023&o),n.push(o),e+=s}if((t=n.length)<=dr)n=String.fromCharCode.apply(String,n);else{for(r="",e=0;e=t?tr(null,t):void 0!==e?"string"==typeof r?tr(null,t).fill(e,r):tr(null,t).fill(e):tr(null,t)},er.allocUnsafe=function(t){return ir(null,t)},er.allocUnsafeSlow=function(t){return ir(null,t)},er.isBuffer=Or,er.compare=function(t,e){if(!ar(t)||!ar(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i"},er.prototype.compare=function(t,e,r,n,i){if(!ar(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),0>e||r>t.length||0>n||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s);for(n=this.slice(n,i),t=t.slice(e,r),e=0;ei)&&(r=i),0r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(n||(n="utf8"),i=!1;;)switch(n){case"hex":t:{if(e=Number(e)||0,n=this.length-e,r?(r=Number(r))>n&&(r=n):r=n,0!=(n=t.length)%2)throw new TypeError("Invalid hex string");for(r>n/2&&(r=n/2),n=0;n(i-=2));++s){var a=n.charCodeAt(s);t=a>>8,a%=256,o.push(a),o.push(t)}return Rr(o,this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},er.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var dr=4096;function yr(t,e,r){if(0!=t%1||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function gr(t,e,r,n,i,o){if(!ar(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function mr(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function vr(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function wr(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}er.prototype.slice=function(t,e){var r=this.length;if(0>(t=~~t)?0>(t+=r)&&(t=0):t>r&&(t=r),0>(e=void 0===e?r:~~e)?0>(e+=r)&&(e=0):e>r&&(e=r),e=128*n&&(r-=Math.pow(2,8*e)),r},er.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||yr(t,e,this.length),r=e;for(var n=1,i=this[t+--r];0=128*n&&(i-=Math.pow(2,8*e)),i},er.prototype.readInt8=function(t,e){return e||yr(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},er.prototype.readInt16LE=function(t,e){return e||yr(t,2,this.length),32768&(t=this[t]|this[t+1]<<8)?4294901760|t:t},er.prototype.readInt16BE=function(t,e){return e||yr(t,2,this.length),32768&(t=this[t+1]|this[t]<<8)?4294901760|t:t},er.prototype.readInt32LE=function(t,e){return e||yr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},er.prototype.readInt32BE=function(t,e){return e||yr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},er.prototype.readFloatLE=function(t,e){return e||yr(t,4,this.length),Je(this,t,!0,23,4)},er.prototype.readFloatBE=function(t,e){return e||yr(t,4,this.length),Je(this,t,!1,23,4)},er.prototype.readDoubleLE=function(t,e){return e||yr(t,8,this.length),Je(this,t,!0,52,8)},er.prototype.readDoubleBE=function(t,e){return e||yr(t,8,this.length),Je(this,t,!1,52,8)},er.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||gr(this,t,e,r,Math.pow(2,8*r)-1,0),n=1;var i=0;for(this[e]=255&t;++i>>8):mr(this,t,e,!0),e+2},er.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||gr(this,t,e,2,65535,0),er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):mr(this,t,e,!1),e+2},er.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||gr(this,t,e,4,4294967295,0),er.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):vr(this,t,e,!0),e+4},er.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||gr(this,t,e,4,4294967295,0),er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):vr(this,t,e,!1),e+4},er.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||gr(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n),n=0;var i=1,o=0;for(this[e]=255&t;++nt&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},er.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||gr(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=1,o=0;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)0>t&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},er.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||gr(this,t,e,1,127,-128),er.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},er.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||gr(this,t,e,2,32767,-32768),er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):mr(this,t,e,!0),e+2},er.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||gr(this,t,e,2,32767,-32768),er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):mr(this,t,e,!1),e+2},er.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||gr(this,t,e,4,2147483647,-2147483648),er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):vr(this,t,e,!0),e+4},er.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||gr(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):vr(this,t,e,!1),e+4},er.prototype.writeFloatLE=function(t,e,r){return r||wr(this,0,e,4),Xe(this,t,e,!0,23,4),e+4},er.prototype.writeFloatBE=function(t,e,r){return r||wr(this,0,e,4),Xe(this,t,e,!1,23,4),e+4},er.prototype.writeDoubleLE=function(t,e,r){return r||wr(this,0,e,8),Xe(this,t,e,!0,52,8),e+8},er.prototype.writeDoubleBE=function(t,e,r){return r||wr(this,0,e,8),Xe(this,t,e,!1,52,8),e+8},er.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-ei||!er.TYPED_ARRAY_SUPPORT)for(n=0;ni&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!er.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>e||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;nr){if(!i){if(56319r){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,128>r){if(0>--e)break;o.push(r)}else if(2048>r){if(0>(e-=2))break;o.push(r>>6|192,63&r|128)}else if(65536>r){if(0>(e-=3))break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw Error("Invalid code point");if(0>(e-=4))break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Er(t){for(var e=[],r=0;r(t=(t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(_r,"")).length)t="";else for(;0!=t.length%4;)t+="=";ze||qe();var e=t.length;if(0>16&255,n[o++]=s>>8&255,n[o++]=255&s}return 2===r?(s=Ve[t.charCodeAt(e)]<<2|Ve[t.charCodeAt(e+1)]>>4,n[o++]=255&s):1===r&&(s=Ve[t.charCodeAt(e)]<<10|Ve[t.charCodeAt(e+1)]<<4|Ve[t.charCodeAt(e+2)]>>2,n[o++]=s>>8&255,n[o++]=255&s),n}function Rr(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Or(t){return null!=t&&(!!t._isBuffer||Tr(t)||"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Tr(t.slice(0,0)))}function Tr(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var Ar=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:Qe,Buffer:er,SlowBuffer:function(t){return+t!=t&&(t=0),er.alloc(+t)},isBuffer:Or}),Ir=De((function(t,e){function r(t){for(var e=[],r=1;r(e-=t[1])&&(r--,e+=1e9)),[r,e]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-zr)/1e3}},Kr="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t},Hr=/%[sdj%]/g;function Jr(t){if(!hn(t)){for(var e=[],r=0;r=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}));for(var o=n[r];rr?ln(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),i=s?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;st.seen.indexOf(e.value)?-1<(a=nn(t,e.value,null===r?null:r-1)).indexOf("\n")&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),cn(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function an(t){return Array.isArray(t)}function un(t){return"boolean"==typeof t}function fn(t){return"number"==typeof t}function hn(t){return"string"==typeof t}function cn(t){return void 0===t}function ln(t){return pn(t)&&"[object RegExp]"===Object.prototype.toString.call(t)}function pn(t){return"object"==typeof t&&null!==t}function dn(t){return pn(t)&&"[object Date]"===Object.prototype.toString.call(t)}function yn(t){return pn(t)&&("[object Error]"===Object.prototype.toString.call(t)||t instanceof Error)}function gn(t){return"function"==typeof t}function mn(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function vn(t){return 10>t?"0"+t.toString(10):t.toString(10)}tn.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},tn.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var wn="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");function _n(t,e){if(!e||!pn(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}var bn={inherits:Kr,_extend:_n,log:function(){var t,e;console.log("%s - %s",(e=[vn((t=new Date).getHours()),vn(t.getMinutes()),vn(t.getSeconds())].join(":"),[t.getDate(),wn[t.getMonth()],e].join(" ")),Jr.apply(null,arguments))},isBuffer:function(t){return Or(t)},isPrimitive:mn,isFunction:gn,isError:yn,isDate:dn,isObject:pn,isRegExp:ln,isUndefined:cn,isSymbol:function(t){return"symbol"==typeof t},isString:hn,isNumber:fn,isNullOrUndefined:function(t){return null==t},isNull:function(t){return null===t},isBoolean:un,isArray:an,inspect:tn,deprecate:Xr,format:Jr,debuglog:Qr};function En(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i 0 and < 65536"),i("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),i("ERR_SOCKET_CANNOT_SEND","Unable to send data"),i("ERR_SOCKET_CLOSED","Socket is closed"),i("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),i("ERR_STDERR_CLOSE","process.stderr cannot be closed"),i("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),i("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),i("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),i("ERR_TLS_DH_PARAM_SIZE",(function(t){return"DH parameter size "+t+" is less than 2048"})),i("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),i("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),i("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),i("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),i("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),i("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),i("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),i("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),i("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),i("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),i("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl")}));Fe(Yn);var Wn=De((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ENCODING_UTF8="utf8",e.assertEncoding=function(t){if(t&&!Ir.Buffer.isEncoding(t))throw new Yn.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",t)},e.strToEncoding=function(t,r){return r&&r!==e.ENCODING_UTF8?"buffer"===r?new Ir.Buffer(t):new Ir.Buffer(t).toString(r):t}}));Fe(Wn);var Vn=De((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=Me.constants.S_IFMT,n=Me.constants.S_IFDIR,i=Me.constants.S_IFREG,o=Me.constants.S_IFBLK,s=Me.constants.S_IFCHR,a=Me.constants.S_IFLNK,u=Me.constants.S_IFIFO,f=Me.constants.S_IFSOCK;t=function(){function t(){this.name="",this.mode=0}return t.build=function(e,r){var n=new t,i=e.getNode().mode;return n.name=Wn.strToEncoding(e.getName(),r),n.mode=i,n},t.prototype._checkModeProperty=function(t){return(this.mode&r)===t},t.prototype.isDirectory=function(){return this._checkModeProperty(n)},t.prototype.isFile=function(){return this._checkModeProperty(i)},t.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},t.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},t.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},t.prototype.isFIFO=function(){return this._checkModeProperty(u)},t.prototype.isSocket=function(){return this._checkModeProperty(f)},t}(),e.Dirent=t,e.default=t}));function Gn(){for(var t="",e=!1,r=arguments.length-1;-1<=r&&!e;r--){var n=0<=r?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(t=n+"/"+t,e="/"===n.charAt(0))}return(e?"/":"")+(t=function(t,e){for(var r=0,n=t.length-1;0<=n;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}(function(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;nr?[]:t.slice(e,r-e+1)}t=Gn(t).substr(1),e=Gn(e).substr(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),i=n,o=0;or&&(o.warned=!0,(r=Error("Possible EventEmitter memory leak detected. "+o.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",r.emitter=t,r.type=e,r.count=o.length,"function"==typeof console.warn?console.warn(r):console.log(r))):(i[e]=r,++t._eventsCount),t}function Qn(t,e,r){function n(){t.removeListener(e,n),i||(i=!0,r.apply(t,arguments))}var i=!1;return n.listener=r,n}function ti(t){var e=this._events;if(e){if("function"==typeof(t=e[t]))return 1;if(t)return t.length}return 0}function ei(t,e){for(var r=Array(e);e--;)r[e]=t[e];return r}Fe(Jn),Xn.prototype=Object.create(null),$n.EventEmitter=$n,$n.usingDomains=!1,$n.prototype.domain=void 0,$n.prototype._events=void 0,$n.prototype._maxListeners=void 0,$n.defaultMaxListeners=10,$n.init=function(){this.domain=null,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Xn,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},$n.prototype.setMaxListeners=function(t){if("number"!=typeof t||0>t||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},$n.prototype.getMaxListeners=function(){return void 0===this._maxListeners?$n.defaultMaxListeners:this._maxListeners},$n.prototype.emit=function(t){var e,r,n="error"===t;if(e=this._events)n=n&&null==e.error;else if(!n)return!1;var i=this.domain;if(n){if(e=arguments[1],!i){if(e instanceof Error)throw e;throw(i=Error('Uncaught, unspecified "error" event. ('+e+")")).context=e,i}return e||(e=Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=i,e.domainThrown=!1,i.emit("error",e),!1}if(!(i=e[t]))return!1;e="function"==typeof i;var o=arguments.length;switch(o){case 1:if(e)i.call(this);else for(i=ei(i,e=i.length),n=0;no)return this;if(1===i.length){if(i[0]=void 0,0==--this._eventsCount)return this._events=new Xn,this;delete n[t]}else{r=o+1;for(var a=i.length;rthis.buf.length){var i=Ir.bufferAllocUnsafe(n+r);this.buf.copy(i,0,0,this.buf.length),this.buf=i}return t.copy(this.buf,n,e,e+r),this.touch(),r},e.prototype.read=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.byteLength),void 0===n&&(n=0),this.buf||(this.buf=Ir.bufferAllocUnsafe(0)),r>t.byteLength&&(r=t.byteLength),r+n>this.buf.length&&(r=this.buf.length-n),this.buf.copy(t,e,n,n+r),r},e.prototype.truncate=function(t){if(void 0===t&&(t=0),t)if(this.buf||(this.buf=Ir.bufferAllocUnsafe(0)),t<=this.buf.length)this.buf=this.buf.slice(0,t);else{var e=Ir.bufferAllocUnsafe(0);this.buf.copy(e),e.fill(0,t)}else this.buf=Ir.bufferAllocUnsafe(0);this.touch()},e.prototype.chmod=function(t){this.perm=t,this.mode=-512&this.mode|t,this.touch()},e.prototype.chown=function(t,e){this.uid=t,this.gid=e,this.touch()},e.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},e.prototype.canRead=function(t,e){return void 0===t&&(t=Jn.default.getuid()),void 0===e&&(e=Jn.default.getgid()),!!(4&this.perm||e===this.gid&&32&this.perm||t===this.uid&&256&this.perm)},e.prototype.canWrite=function(t,e){return void 0===t&&(t=Jn.default.getuid()),void 0===e&&(e=Jn.default.getgid()),!!(2&this.perm||e===this.gid&&16&this.perm||t===this.uid&&128&this.perm)},e.prototype.del=function(){this.emit("delete",this)},e.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},e}($n.EventEmitter),e.Node=t,t=function(t){function n(e,r,n){var i=t.call(this)||this;return i.children={},i.steps=[],i.ino=0,i.length=0,i.vol=e,i.parent=r,i.steps=r?r.steps.concat([n]):[n],i}return r(n,t),n.prototype.setNode=function(t){this.node=t,this.ino=t.ino},n.prototype.getNode=function(){return this.node},n.prototype.createChild=function(t,e){void 0===e&&(e=this.vol.createNode());var r=new n(this.vol,this,t);return r.setNode(e),e.isDirectory(),this.setChild(t,r),r},n.prototype.setChild=function(t,e){return void 0===e&&(e=new n(this.vol,this,t)),this.children[t]=e,e.parent=this,this.length++,this.emit("child:add",e,this),e},n.prototype.deleteChild=function(t){delete this.children[t.getName()],this.length--,this.emit("child:delete",t,this)},n.prototype.getChild=function(t){if(Object.hasOwnProperty.call(this.children,t))return this.children[t]},n.prototype.getPath=function(){return this.steps.join(e.SEP)},n.prototype.getName=function(){return this.steps[this.steps.length-1]},n.prototype.walk=function(t,e,r){if(void 0===e&&(e=t.length),void 0===r&&(r=0),r>=t.length||r>=e)return this;var n=this.getChild(t[r]);return n?n.walk(t,e,r+1):null},n.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},n}($n.EventEmitter),e.Link=t,t=function(){function t(t,e,r,n){this.position=0,this.link=t,this.node=e,this.flags=r,this.fd=n}return t.prototype.getString=function(){return this.node.getString()},t.prototype.setString=function(t){this.node.setString(t)},t.prototype.getBuffer=function(){return this.node.getBuffer()},t.prototype.setBuffer=function(t){this.node.setBuffer(t)},t.prototype.getSize=function(){return this.node.getSize()},t.prototype.truncate=function(t){this.node.truncate(t)},t.prototype.seekTo=function(t){this.position=t},t.prototype.stats=function(){return je.default.build(this.node)},t.prototype.write=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.length),"number"!=typeof n&&(n=this.position),this.flags&a&&(n=this.getSize()),t=this.node.write(t,e,r,n),this.position=n+t,t},t.prototype.read=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.byteLength),"number"!=typeof n&&(n=this.position),t=this.node.read(t,e,r,n),this.position=n+t,t},t.prototype.chmod=function(t){this.node.chmod(t)},t.prototype.chown=function(t,e){this.node.chown(t,e)},t}(),e.File=t}));Fe(ri);var ni=ri.Node,ii=De((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){var n=setTimeout.apply(null,arguments);return n&&"object"==typeof n&&"function"==typeof n.unref&&n.unref(),n}}));function oi(){this.tail=this.head=null,this.length=0}Fe(ii),oi.prototype.push=function(t){t={data:t,next:null},0>>0);for(var e=this.head,r=0;e;)e.data.copy(t,r),r+=e.data.length,e=e.next;return t};var si=er.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function ai(t){if(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),t&&!si(t))throw Error("Unknown encoding: "+t);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=fi;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=hi;break;default:return void(this.write=ui)}this.charBuffer=new er(6),this.charLength=this.charReceived=0}function ui(t){return t.toString(this.encoding)}function fi(t){this.charLength=(this.charReceived=t.length%2)?2:0}function hi(t){this.charLength=(this.charReceived=t.length%3)?3:0}ai.prototype.write=function(t){for(var e="";this.charLength;){if(e=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length,t.copy(this.charBuffer,this.charReceived,0,e),this.charReceived+=e,this.charReceived=r)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;return this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),n=(e+=t.toString(this.encoding,0,n)).length-1,55296<=(r=e.charCodeAt(n))&&56319>=r?(r=this.surrogateSize,this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),t.copy(this.charBuffer,0,0,r),e.substring(0,n)):e},ai.prototype.detectIncompleteChar=function(t){for(var e=3<=t.length?3:t.length;0>5){this.charLength=2;break}if(2>=e&&14==r>>4){this.charLength=3;break}if(3>=e&&30==r>>3){this.charLength=4;break}}this.charReceived=e},ai.prototype.end=function(t){var e="";return t&&t.length&&(e=this.write(t)),this.charReceived&&(t=this.encoding,e+=this.charBuffer.slice(0,this.charReceived).toString(t)),e},pi.ReadableState=li;var ci=Qr("stream");function li(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof xi&&(this.objectMode=this.objectMode||!!t.readableObjectMode),e=t.highWaterMark;var r=this.objectMode?16:16384;this.highWaterMark=e||0===e?e:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new oi,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.reading=this.endEmitted=this.ended=!1,this.sync=!0,this.resumeScheduled=this.readableListening=this.emittedReadable=this.needReadable=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.encoding=this.decoder=null,t.encoding&&(this.decoder=new ai(t.encoding),this.encoding=t.encoding)}function pi(t){if(!(this instanceof pi))return new pi(t);this._readableState=new li(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),$n.call(this)}function di(t,e,r,n,i){var o=r,s=null;if(Or(o)||"string"==typeof o||null==o||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),o=s)t.emit("error",o);else if(null===r)e.reading=!1,e.ended||(e.decoder&&(r=e.decoder.end())&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length),e.ended=!0,gi(t));else if(e.objectMode||r&&0=t||0===e.length&&e.ended)return 0;if(e.objectMode)return 1;if(t!=t)return e.flowing&&e.length?e.buffer.head.data.length:e.length;if(t>e.highWaterMark){var r=t;8388608<=r?r=8388608:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r}return t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0)}function gi(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(ci("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?jr(mi,t):mi(t))}function mi(t){ci("emit readable"),t.emit("readable"),bi(t)}function vi(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length)r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear();else{if(r=e.buffer,e=e.decoder,to.length?o.length:t;if(i=s===o.length?i+o:i+o.slice(0,t),0==(t-=s)){s===o.length?(++n,r.head=e.next?e.next:r.tail=null):(r.head=e,e.data=o.slice(s));break}++n}r.length-=n,r=i}else{for(e=er.allocUnsafe(t),i=1,(n=r.head).data.copy(e),t-=n.data.length;n=n.next;){if(s=t>(o=n.data).length?o.length:t,o.copy(e,e.length-t,0,s),0==(t-=s)){s===o.length?(++i,r.head=n.next?n.next:r.tail=null):(r.head=n,n.data=o.slice(s));break}++i}r.length-=i,r=e}e=r}r=e}return r}function Si(t){var e=t._readableState;if(0=e.highWaterMark||e.ended))return ci("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Si(this):gi(this),null;if(0===(t=yi(t,e))&&e.ended)return 0===e.length&&Si(this),null;var n=e.needReadable;return ci("need readable",n),(0===e.length||e.length-targuments.length?e:t.apply(null,[e].concat(Ki.call(arguments,2)))},Ji=De((function(t,e){function r(t,e,r){return void 0===r&&(r=function(t){return t}),function(){for(var i=[],o=0;o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Qi=Math.floor,to=String.fromCharCode;function eo(t,e){return t+22+75*(26>t)-((0!=e)<<5)}var ro=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function no(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}function io(t,e){if(t.map)return t.map(e);for(var r=[],n=0;ne&&(n=e),e=0;e"` \r\n\t'.split("")),po=["'"].concat(lo),yo=["%","/","?",";","#"].concat(po),go=["/","?","#"],mo=255,vo=/^[+a-z0-9A-Z_-]{0,63}$/,wo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_o={javascript:!0,"javascript:":!0},bo={javascript:!0,"javascript:":!0},Eo={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function So(t,e,r){if(t&&pn(t)&&t instanceof uo)return t;var n=new uo;return n.parse(t,e,r),n}function Ro(t,e,r,n){if(!hn(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?");if(i=-1!==i&&imo?"":t.hostname.toLowerCase(),s||(t.hostname=function(t){return function(t,e){var r=t.split("@"),n="";1=o&&if&&r.push(to(f))}for((i=e=r.length)&&r.push("-");i=n&&fQi((2147483647-a)/c))throw new RangeError(Zi.overflow);for(a+=(h-n)*c,n=h,o=0;o=u+26?26:h-u));h+=36){var p=l-f;l=36-f,r.push(to(eo(f+p%l,0))),l=Qi(p/l)}for(r.push(to(eo(l,0))),u=c,h=0,a=i==e?Qi(a/700):a>>1,a+=Qi(a/u);455o.length&&o.unshift(""),e.pathname=o.join("/")}return e.search=t.search,e.query=t.query,e.host=t.host||"",e.auth=t.auth,e.hostname=t.hostname||t.host,e.port=t.port,(e.pathname||e.search)&&(e.path=(e.pathname||"")+(e.search||"")),e.slashes=e.slashes||t.slashes,e.href=e.format(),e}r=e.pathname&&"/"===e.pathname.charAt(0);var s=t.host||t.pathname&&"/"===t.pathname.charAt(0),a=r=s||r||e.host&&t.pathname;if(n=e.pathname&&e.pathname.split("/")||[],i=e.protocol&&!Eo[e.protocol],o=t.pathname&&t.pathname.split("/")||[],i&&(e.hostname="",e.port=null,e.host&&(""===n[0]?n[0]=e.host:n.unshift(e.host)),e.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===o[0]?o[0]=t.host:o.unshift(t.host)),t.host=null),r=r&&(""===o[0]||""===n[0])),s)e.host=t.host||""===t.host?t.host:e.host,e.hostname=t.hostname||""===t.hostname?t.hostname:e.hostname,e.search=t.search,e.query=t.query,n=o;else if(o.length)n||(n=[]),n.pop(),n=n.concat(o),e.search=t.search,e.query=t.query;else if(null!=t.search)return i&&(e.hostname=e.host=n.shift(),i=!!(e.host&&0(n=(e=n).length-1))n=e;else{for(;r(e,n);)n--;n=e.substr(0,n+1)}return n.replace(/^([a-zA-Z]+:|\.\/)/,"")}return t}Object.defineProperty(e,"__esModule",{value:!0}),e.unixify=n,e.correctPath=function(t){return n(t.replace(/^\\\\\?\\.:\\/,"\\"))};var i="win32"===qr.platform}));Fe(Ao);var Io=De((function(t,e){function r(t,e){return void 0===e&&(e=Jn.default.cwd()),B(e,t)}function n(t,e){return"function"==typeof t?[i(),t]:[i(t),h(e)]}function i(t){return void 0===t&&(t={}),k({},ut,t)}function o(t){return k({},it,"number"==typeof t?{mode:t}:t)}function s(t,e,r,n,i){return void 0===e&&(e=""),void 0===r&&(r=""),void 0===n&&(n=""),void 0===i&&(i=Error),e=new i(function(t,e,r,n){void 0===e&&(e=""),void 0===r&&(r=""),void 0===n&&(n="");var i="";switch(r&&(i=" '"+r+"'"),n&&(i+=" -> '"+n+"'"),t){case"ENOENT":return"ENOENT: no such file or directory, "+e+i;case"EBADF":return"EBADF: bad file descriptor, "+e+i;case"EINVAL":return"EINVAL: invalid argument, "+e+i;case"EPERM":return"EPERM: operation not permitted, "+e+i;case"EPROTO":return"EPROTO: protocol error, "+e+i;case"EEXIST":return"EEXIST: file already exists, "+e+i;case"ENOTDIR":return"ENOTDIR: not a directory, "+e+i;case"EISDIR":return"EISDIR: illegal operation on a directory, "+e+i;case"EACCES":return"EACCES: permission denied, "+e+i;case"ENOTEMPTY":return"ENOTEMPTY: directory not empty, "+e+i;case"EMFILE":return"EMFILE: too many open files, "+e+i;case"ENOSYS":return"ENOSYS: function not implemented, "+e+i;default:return t+": error occurred, "+e+i}}(t,e,r,n)),e.code=t,e}function a(t){if("number"==typeof t)return t;if("string"==typeof t){var e=N[t];if(void 0!==e)return e}throw new Yn.TypeError("ERR_INVALID_OPT_VALUE","flags",t)}function u(t,e){if(!e)return t;var r=typeof e;switch(r){case"string":t=k({},t,{encoding:e});break;case"object":t=k({},t,e);break;default:throw TypeError("Expected options to be either an object or a string, but got "+r+" instead")}return"buffer"!==t.encoding&&Wn.assertEncoding(t.encoding),t}function f(t){return function(e){return u(t,e)}}function h(t){if("function"!=typeof t)throw TypeError(K.CB);return t}function c(t){return function(e,r){return"function"==typeof e?[t(),e]:[t(e),h(r)]}}function l(t){if("string"!=typeof t&&!Ir.Buffer.isBuffer(t)){try{if(!(t instanceof ao.URL))throw new TypeError(K.PATH_STR)}catch(t){throw new TypeError(K.PATH_STR)}if(""!==t.hostname)throw new Yn.TypeError("ERR_INVALID_FILE_URL_HOST",Jn.default.platform);t=t.pathname;for(var e=0;e>>0!==t)throw TypeError(K.FD)}function _(t){if("string"==typeof t&&+t==t)return+t;if(t instanceof Date)return t.getTime()/1e3;if(isFinite(t))return 0>t?Date.now()/1e3:t;throw Error("Cannot parse time: "+t)}function b(t){if("number"!=typeof t)throw TypeError(K.UID)}function E(t){if("number"!=typeof t)throw TypeError(K.GID)}function S(t){t.emit("stop")}function R(t,e,r){if(!(this instanceof R))return new R(t,e,r);if(this._vol=t,void 0===(r=k({},u(r,{}))).highWaterMark&&(r.highWaterMark=65536),qi.Readable.call(this,r),this.path=l(e),this.fd=void 0===r.fd?null:r.fd,this.flags=void 0===r.flags?"r":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=void 0===r.autoClose||r.autoClose,this.pos=void 0,this.bytesRead=0,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError('"start" option must be a Number');if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw Error('"start" option must be <= "end" option');this.pos=this.start}"number"!=typeof this.fd&&this.open(),this.on("end",(function(){this.autoClose&&this.destroy&&this.destroy()}))}function O(){this.close()}function T(t,e,r){if(!(this instanceof T))return new T(t,e,r);if(this._vol=t,r=k({},u(r,{})),qi.Writable.call(this,r),this.path=l(e),this.fd=void 0===r.fd?null:r.fd,this.flags=void 0===r.flags?"w":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.autoClose=void 0===r.autoClose||!!r.autoClose,this.pos=void 0,this.bytesWritten=0,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError('"start" option must be a Number');if(0>this.start)throw Error('"start" must be >= zero');this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),"number"!=typeof this.fd&&this.open(),this.once("finish",(function(){this.autoClose&&this.close()}))}var A=Ue&&Ue.__extends||function(){function t(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)}return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),I=Ue&&Ue.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e>>0!==t)throw TypeError(K.FD);if(!(t=this.getFileByFd(t)))throw s("EBADF",e);return t},t.prototype.getNodeByIdOrCreate=function(t,e,r){if("number"==typeof t){if(!(t=this.getFileByFd(t)))throw Error("File nto found");return t.node}var n=d(t),i=this.getLink(n);if(i)return i.getNode();if(e&U&&(e=this.getLinkParent(n)))return(i=this.createLink(e,n[n.length-1],!1,r)).getNode();throw s("ENOENT","getNodeByIdOrCreate",l(t))},t.prototype.wrapAsync=function(t,e,r){var n=this;h(r),Hn.default((function(){try{r(null,t.apply(n,e))}catch(t){r(t)}}))},t.prototype._toJSON=function(t,e,r){var n;void 0===t&&(t=this.root),void 0===e&&(e={});var i=!0,o=t.children;for(var s in t.getNode().isFile()&&((n={})[t.getName()]=t.parent.getChild(t.getName()),o=n,t=t.parent),o){if(i=!1,!(o=t.getChild(s)))throw Error("_toJSON: unexpected undefined");(n=o.getNode()).isFile()?(o=o.getPath(),r&&(o=z(r,o)),e[o]=n.getString()):n.isDirectory()&&this._toJSON(o,e,r)}return t=t.getPath(),r&&(t=z(r,t)),t&&i&&(e[t]=null),e},t.prototype.toJSON=function(t,e,r){void 0===e&&(e={}),void 0===r&&(r=!1);var n=[];if(t){t instanceof Array||(t=[t]);for(var i=0;i=this.maxFiles)throw s("EMFILE","open",t.getPath());var n=t;if(r&&(n=this.resolveSymlinks(t)),!n)throw s("ENOENT","open",t.getPath());if((r=n.getNode()).isDirectory()){if((e&(L|C|P))!==L)throw s("EISDIR","open",t.getPath())}else if(e&j)throw s("ENOTDIR","open",t.getPath());if(!(e&P||r.canRead()))throw s("EACCES","open",t.getPath());return t=new this.props.File(t,r,e,this.newFdNumber()),this.fds[t.fd]=t,this.openFiles++,e&D&&t.truncate(),t},t.prototype.openFile=function(t,e,r,n){void 0===n&&(n=!0);var i=p(t),o=n?this.getResolvedLink(i):this.getLink(i);if(!o&&e&U){var a=this.getResolvedLink(i.slice(0,i.length-1));if(!a)throw s("ENOENT","open",G+i.join(G));e&U&&"number"==typeof r&&(o=this.createLink(a,i[i.length-1],!1,r))}if(o)return this.openLink(o,e,n);throw s("ENOENT","open",t)},t.prototype.openBase=function(t,e,r,n){if(void 0===n&&(n=!0),!(e=this.openFile(t,e,r,n)))throw s("ENOENT","open",t);return e.fd},t.prototype.openSync=function(t,e,r){return void 0===r&&(r=438),r=v(r),t=l(t),e=a(e),this.openBase(t,e,r)},t.prototype.open=function(t,e,r,n){var i=r;"function"==typeof r&&(i=438,n=r),r=v(i||438),t=l(t),e=a(e),this.wrapAsync(this.openBase,[t,e,r],n)},t.prototype.closeFile=function(t){this.fds[t.fd]&&(this.openFiles--,delete this.fds[t.fd],this.releasedFds.push(t.fd))},t.prototype.closeSync=function(t){w(t),t=this.getFileByFdOrThrow(t,"close"),this.closeFile(t)},t.prototype.close=function(t,e){w(t),this.wrapAsync(this.closeSync,[t],e)},t.prototype.openFileOrGetById=function(t,e,r){if("number"==typeof t){if(!(t=this.fds[t]))throw s("ENOENT");return t}return this.openFile(l(t),e,r)},t.prototype.readBase=function(t,e,r,n,i){return this.getFileByFdOrThrow(t).read(e,Number(r),Number(n),i)},t.prototype.readSync=function(t,e,r,n,i){return w(t),this.readBase(t,e,r,n,i)},t.prototype.read=function(t,e,r,n,i,o){var s=this;if(h(o),0===n)return Jn.default.nextTick((function(){o&&o(null,0,e)}));Hn.default((function(){try{var a=s.readBase(t,e,r,n,i);o(null,a,e)}catch(t){o(t)}}))},t.prototype.readFileBase=function(t,e,r){var n="number"==typeof t&&t>>>0===t;if(!n){var i=l(t);if(i=p(i),(i=this.getResolvedLink(i))&&i.getNode().isDirectory())throw s("EISDIR","open",i.getPath());t=this.openSync(t,e)}try{var o=g(this.getFileByFdOrThrow(t).getBuffer(),r)}finally{n||this.closeSync(t)}return o},t.prototype.readFileSync=function(t,e){var r=a((e=X(e)).flag);return this.readFileBase(t,r,e.encoding)},t.prototype.readFile=function(t,e,r){e=(r=c(X)(e,r))[0],r=r[1];var n=a(e.flag);this.wrapAsync(this.readFileBase,[t,n,e.encoding],r)},t.prototype.writeBase=function(t,e,r,n,i){return this.getFileByFdOrThrow(t,"write").write(e,r,n,i)},t.prototype.writeSync=function(t,e,r,n,i){w(t);var o="string"!=typeof e;if(o){var s=0|(r||0),a=n;r=i}else var u=n;return e=y(e,u),o?void 0===a&&(a=e.length):(s=0,a=e.length),this.writeBase(t,e,s,a,r)},t.prototype.write=function(t,e,r,n,i,o){var s=this;w(t);var a=typeof e,u=typeof r,f=typeof n,c=typeof i;if("string"!==a)if("function"===u)var l=r;else if("function"===f){var p=0|r;l=n}else if("function"===c){p=0|r;var d=n;l=i}else{p=0|r,d=n;var g=i;l=o}else if("function"===u)l=r;else if("function"===f)g=r,l=n;else if("function"===c){g=r;var m=n;l=i}var v=y(e,m);"string"!==a?void 0===d&&(d=v.length):(p=0,d=v.length);var _=h(l);Hn.default((function(){try{var r=s.writeBase(t,v,p,d,g);_(null,r,"string"!==a?v:e)}catch(t){_(t)}}))},t.prototype.writeFileBase=function(t,e,r,n){var i="number"==typeof t;t=i?t:this.openBase(l(t),r,n),n=0;var o=e.length;r=r&M?void 0:0;try{for(;0=t.nlink&&this.deleteNode(t)},t.prototype.unlinkSync=function(t){t=l(t),this.unlinkBase(t)},t.prototype.unlink=function(t,e){t=l(t),this.wrapAsync(this.unlinkBase,[t],e)},t.prototype.symlinkBase=function(t,e){var r=p(e),n=this.getLinkParent(r);if(!n)throw s("ENOENT","symlink",t,e);if(r=r[r.length-1],n.getChild(r))throw s("EEXIST","symlink",t,e);return(e=n.createChild(r)).getNode().makeSymlink(p(t)),e},t.prototype.symlinkSync=function(t,e){t=l(t),e=l(e),this.symlinkBase(t,e)},t.prototype.symlink=function(t,e,r,n){r=h("function"==typeof r?r:n),t=l(t),e=l(e),this.wrapAsync(this.symlinkBase,[t,e],r)},t.prototype.realpathBase=function(t,e){var r=p(t);if(!(r=this.getResolvedLink(r)))throw s("ENOENT","realpath",t);return Wn.strToEncoding(r.getPath(),e)},t.prototype.realpathSync=function(t,e){return this.realpathBase(l(t),rt(e).encoding)},t.prototype.realpath=function(t,e,r){e=(r=nt(e,r))[0],r=r[1],t=l(t),this.wrapAsync(this.realpathBase,[t,e.encoding],r)},t.prototype.lstatBase=function(t,e){void 0===e&&(e=!1);var r=this.getLink(p(t));if(!r)throw s("ENOENT","lstat",t);return je.default.build(r.getNode(),e)},t.prototype.lstatSync=function(t,e){return this.lstatBase(l(t),i(e).bigint)},t.prototype.lstat=function(t,e,r){e=(r=n(e,r))[0],r=r[1],this.wrapAsync(this.lstatBase,[l(t),e.bigint],r)},t.prototype.statBase=function(t,e){void 0===e&&(e=!1);var r=this.getResolvedLink(p(t));if(!r)throw s("ENOENT","stat",t);return je.default.build(r.getNode(),e)},t.prototype.statSync=function(t,e){return this.statBase(l(t),i(e).bigint)},t.prototype.stat=function(t,e,r){e=(r=n(e,r))[0],r=r[1],this.wrapAsync(this.statBase,[l(t),e.bigint],r)},t.prototype.fstatBase=function(t,e){if(void 0===e&&(e=!1),!(t=this.getFileByFd(t)))throw s("EBADF","fstat");return je.default.build(t.node,e)},t.prototype.fstatSync=function(t,e){return this.fstatBase(t,i(e).bigint)},t.prototype.fstat=function(t,e,r){e=n(e,r),this.wrapAsync(this.fstatBase,[t,e[0].bigint],e[1])},t.prototype.renameBase=function(t,e){var r=this.getLink(p(t));if(!r)throw s("ENOENT","rename",t,e);var n=p(e),i=this.getLinkParent(n);if(!i)throw s("ENOENT","rename",t,e);(t=r.parent)&&t.deleteChild(r),r.steps=I(i.steps,[n[n.length-1]]),i.setChild(r.getName(),r)},t.prototype.renameSync=function(t,e){t=l(t),e=l(e),this.renameBase(t,e)},t.prototype.rename=function(t,e,r){t=l(t),e=l(e),this.wrapAsync(this.renameBase,[t,e],r)},t.prototype.existsBase=function(t){return!!this.statBase(t)},t.prototype.existsSync=function(t){try{return this.existsBase(l(t))}catch(t){return!1}},t.prototype.exists=function(t,e){var r=this,n=l(t);if("function"!=typeof e)throw Error(K.CB);Hn.default((function(){try{e(r.existsBase(n))}catch(t){e(!1)}}))},t.prototype.accessBase=function(t){this.getLinkOrThrow(t,"access")},t.prototype.accessSync=function(t,e){void 0===e&&(e=Y),t=l(t),this.accessBase(t,0|e)},t.prototype.access=function(t,e,r){var n=Y;"function"!=typeof e&&(n=0|e,e=h(r)),t=l(t),this.wrapAsync(this.accessBase,[t,n],e)},t.prototype.appendFileSync=function(t,e,r){void 0===r&&(r=Q),(r=tt(r)).flag&&t>>>0!==t||(r.flag="a"),this.writeFileSync(t,e,r)},t.prototype.appendFile=function(t,e,r,n){r=(n=et(r,n))[0],n=n[1],r.flag&&t>>>0!==t||(r.flag="a"),this.writeFile(t,e,r,n)},t.prototype.readdirBase=function(t,e){var r=p(t);if(!(r=this.getResolvedLink(r)))throw s("ENOENT","readdir",t);if(!r.getNode().isDirectory())throw s("ENOTDIR","scandir",t);if(e.withFileTypes){var n=[];for(i in r.children)(t=r.getChild(i))&&n.push(Vn.default.build(t,e.encoding));return q||"buffer"===e.encoding||n.sort((function(t,e){return t.namee.name?1:0})),n}var i=[];for(n in r.children)i.push(Wn.strToEncoding(n,e.encoding));return q||"buffer"===e.encoding||i.sort(),i},t.prototype.readdirSync=function(t,e){return e=st(e),t=l(t),this.readdirBase(t,e)},t.prototype.readdir=function(t,e,r){e=(r=at(e,r))[0],r=r[1],t=l(t),this.wrapAsync(this.readdirBase,[t,e],r)},t.prototype.readlinkBase=function(t,e){var r=this.getLinkOrThrow(t,"readlink").getNode();if(!r.isSymlink())throw s("EINVAL","readlink",t);return t=G+r.symlink.join(G),Wn.strToEncoding(t,e)},t.prototype.readlinkSync=function(t,e){return e=H(e),t=l(t),this.readlinkBase(t,e.encoding)},t.prototype.readlink=function(t,e,r){e=(r=J(e,r))[0],r=r[1],t=l(t),this.wrapAsync(this.readlinkBase,[t,e.encoding],r)},t.prototype.fsyncBase=function(t){this.getFileByFdOrThrow(t,"fsync")},t.prototype.fsyncSync=function(t){this.fsyncBase(t)},t.prototype.fsync=function(t,e){this.wrapAsync(this.fsyncBase,[t],e)},t.prototype.fdatasyncBase=function(t){this.getFileByFdOrThrow(t,"fdatasync")},t.prototype.fdatasyncSync=function(t){this.fdatasyncBase(t)},t.prototype.fdatasync=function(t,e){this.wrapAsync(this.fdatasyncBase,[t],e)},t.prototype.ftruncateBase=function(t,e){this.getFileByFdOrThrow(t,"ftruncate").truncate(e)},t.prototype.ftruncateSync=function(t,e){this.ftruncateBase(t,e)},t.prototype.ftruncate=function(t,e,r){var n="number"==typeof e?e:0;e=h("number"==typeof e?r:e),this.wrapAsync(this.ftruncateBase,[t,n],e)},t.prototype.truncateBase=function(t,e){t=this.openSync(t,"r+");try{this.ftruncateSync(t,e)}finally{this.closeSync(t)}},t.prototype.truncateSync=function(t,e){if(t>>>0===t)return this.ftruncateSync(t,e);this.truncateBase(t,e)},t.prototype.truncate=function(t,e,r){var n="number"==typeof e?e:0;if(e=h("number"==typeof e?r:e),t>>>0===t)return this.ftruncate(t,n,e);this.wrapAsync(this.truncateBase,[t,n],e)},t.prototype.futimesBase=function(t,e,r){(t=this.getFileByFdOrThrow(t,"futimes").node).atime=new Date(1e3*e),t.mtime=new Date(1e3*r)},t.prototype.futimesSync=function(t,e,r){this.futimesBase(t,_(e),_(r))},t.prototype.futimes=function(t,e,r,n){this.wrapAsync(this.futimesBase,[t,_(e),_(r)],n)},t.prototype.utimesBase=function(t,e,r){t=this.openSync(t,"r+");try{this.futimesBase(t,e,r)}finally{this.closeSync(t)}},t.prototype.utimesSync=function(t,e,r){this.utimesBase(l(t),_(e),_(r))},t.prototype.utimes=function(t,e,r,n){this.wrapAsync(this.utimesBase,[l(t),_(e),_(r)],n)},t.prototype.mkdirBase=function(t,e){var r=p(t);if(!r.length)throw s("EISDIR","mkdir",t);var n=this.getLinkParentAsDirOrThrow(t,"mkdir");if(r=r[r.length-1],n.getChild(r))throw s("EEXIST","mkdir",t);n.createChild(r,this.createNode(!0,e))},t.prototype.mkdirpBase=function(t,e){t=p(t);for(var r=this.root,n=0;nthis.prev.mtimeMs||t.nlink!==this.prev.nlink},e.prototype.start=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=5007),this.filename=l(t),this.setTimeout=e?setTimeout:ii.default,this.interval=r,this.prev=this.vol.statSync(this.filename),this.loop()},e.prototype.stop=function(){clearTimeout(this.timeoutRef),Jn.default.nextTick(S,this)},e}($n.EventEmitter);e.StatWatcher=lt,bn.inherits(R,qi.Readable),e.ReadStream=R,R.prototype.open=function(){var t=this;this._vol.open(this.path,this.flags,this.mode,(function(e,r){e?(t.autoClose&&t.destroy&&t.destroy(),t.emit("error",e)):(t.fd=r,t.emit("open",r),t.read())}))},R.prototype._read=function(t){if("number"!=typeof this.fd)return this.once("open",(function(){this._read(t)}));if(!this.destroyed){(!ct||128>ct.length-ct.used)&&((ct=Ir.bufferAllocUnsafe(this._readableState.highWaterMark)).used=0);var e=ct,r=Math.min(ct.length-ct.used,t),n=ct.used;if(void 0!==this.pos&&(r=Math.min(this.end-this.pos+1,r)),0>=r)return this.push(null);var i=this;this._vol.read(this.fd,ct,ct.used,r,this.pos,(function(t,r){t?(i.autoClose&&i.destroy&&i.destroy(),i.emit("error",t)):(t=null,0s[0]&&r[1]this.wasmImports,this.wasmImports={swjs_set_prop:(t,e,r,i,o)=>{const s=this.memory,a=s.getObject(t),u=s.getObject(e),f=n(r,i,o,s);a[u]=f},swjs_get_prop:(t,e,r,n)=>{const i=this.memory,o=i.getObject(t)[i.getObject(e)];return s(o,r,n,!1,i)},swjs_set_subscript:(t,e,r,i,o)=>{const s=this.memory,a=s.getObject(t),u=n(r,i,o,s);a[e]=u},swjs_get_subscript:(t,e,r,n)=>{const i=this.memory.getObject(t)[e];return s(i,r,n,!1,this.memory)},swjs_encode_string:(t,e)=>{const r=this.memory,n=this.textEncoder.encode(r.getObject(t)),i=r.retain(n);return r.writeUint32(e,i),n.length},swjs_decode_string:(t,e)=>{const r=this.memory,n=r.bytes().subarray(t,t+e),i=this.textDecoder.decode(n);return r.retain(i)},swjs_load_string:(t,e)=>{const r=this.memory,n=r.getObject(t);r.writeBytes(e,n)},swjs_call_function:(t,e,r,n,o)=>{const a=this.memory,u=a.getObject(t);let f;try{f=u(...i(e,r,a))}catch(t){return s(t,n,o,!0,this.memory)}return s(f,n,o,!1,this.memory)},swjs_call_function_no_catch:(t,e,r,n,o)=>{const a=this.memory,u=a.getObject(t)(...i(e,r,a));return s(u,n,o,!1,this.memory)},swjs_call_function_with_this:(t,e,r,n,o,a)=>{const u=this.memory,f=u.getObject(t),h=u.getObject(e);let c;try{const t=i(r,n,u);c=h.apply(f,t)}catch(t){return s(t,o,a,!0,this.memory)}return s(c,o,a,!1,this.memory)},swjs_call_function_with_this_no_catch:(t,e,r,n,o,a)=>{const u=this.memory,f=u.getObject(t),h=u.getObject(e);let c;const l=i(r,n,u);return c=h.apply(f,l),s(c,o,a,!1,this.memory)},swjs_call_new:(t,e,r)=>{const n=this.memory,o=new(n.getObject(t))(...i(e,r,n));return this.memory.retain(o)},swjs_call_throwing_new:(t,e,r,n,s,a)=>{let u=this.memory;const f=u.getObject(t);let h;try{h=new f(...i(e,r,u))}catch(t){return o(t,n,s,a,!0,this.memory),-1}return u=this.memory,o(null,n,s,a,!1,u),u.retain(h)},swjs_instanceof:(t,e)=>{const r=this.memory;return r.getObject(t)instanceof r.getObject(e)},swjs_create_function:(t,e,r)=>{var n;const i=this.memory.getObject(r),o=(...r)=>this.callHostFunction(t,e,i,r),s=this.memory.retain(o);return null===(n=this.closureDeallocator)||void 0===n||n.track(o,s),s},swjs_create_typed_array:(t,e,r)=>{const n=new(this.memory.getObject(t))(this.memory.rawMemory.buffer,e,r);return this.memory.retain(n.slice())},swjs_load_typed_array:(t,e)=>{const r=this.memory,n=r.getObject(t),i=new Uint8Array(n.buffer);r.writeBytes(e,i)},swjs_release:t=>{this.memory.release(t)},swjs_i64_to_bigint:(t,e)=>this.memory.retain(e?t:BigInt.asUintN(64,t)),swjs_bigint_to_i64:(t,e)=>{const r=this.memory.getObject(t);if("bigint"!=typeof r)throw new Error("Expected a BigInt, but got "+typeof r);return e?r:r{const n=BigInt.asUintN(32,BigInt(t))+(BigInt.asUintN(32,BigInt(e))<{u=t}));if(this.exports.swjs_call_host_function(t,s,i,f))throw new Error(`The JSClosure has been already released by Swift side. The closure is created at ${r}:${e}`);return this.exports.swjs_cleanup_host_function_call(s),u}},Do=new Uo,Mo=Do.fs.writeSync;Do.fs.writeSync=(t,e,r,n,i)=>{const o=new TextDecoder("utf-8").decode(e);if("\n"!==o)switch(t){case 1:console.log(o);break;case 2:console.error(o)}return Mo(t,e,r,n,i)};const xo=new Be({args:[],env:{},bindings:{...Be.defaultBindings,fs:Do.fs}});function jo(t){console.error(t),t instanceof WebAssembly.RuntimeError&&console.log(t.stack)}try{(async()=>{const t=fetch("/app.wasm"),e=await t,r=e.body.getReader(),n=+e.headers.get("Content-Length");304==e.status?new Event("WASMLoadedFromCache"):200==e.status?n>0?(document.dispatchEvent(new Event("WASMLoadingStarted")),document.dispatchEvent(new CustomEvent("WASMLoadingProgress",{detail:0}))):document.dispatchEvent(new Event("WASMLoadingStartedWithoutProgress")):document.dispatchEvent(new Event("WASMLoadingError"));let i=0,o=[];for(;;){const{done:t,value:e}=await r.read();if(t)break;o.push(e),i+=e.length,n>0&&document.dispatchEvent(new CustomEvent("WASMLoadingProgress",{detail:Math.trunc(i/(n/100))}))}let s=new Uint8Array(i),a=0;for(let t of o)s.set(t,a),a+=t.length;const u=s.buffer;var f={};f.wasi_snapshot_preview1=function(t){const e=t.wasiImport.clock_res_get;return t.wasiImport.clock_res_get=(r,n)=>(t.refreshMemory(),e(r,n)),t.wasiImport}(xo),f.javascript_kit=Fo.wasmImports,f.__stack_sanitizer={report_stack_overflow:()=>{throw new Error("Detected stack buffer overflow.")}};const h=await WebAssembly.instantiate(u,f),c="instance"in h?h.instance:h;Fo&&c.exports.swjs_library_version&&Fo.setInstance(c),xo.start(c),c.exports._initialize&&(c.exports._initialize(),c.exports.main())})().catch(jo)}catch(t){jo(t)}})(); \ No newline at end of file diff --git a/docs/app.wasm b/docs/app.wasm new file mode 100755 index 0000000..6c13bd6 Binary files /dev/null and b/docs/app.wasm differ diff --git a/docs/images/app/dms.png b/docs/images/app/dms.png new file mode 100644 index 0000000..0adde39 Binary files /dev/null and b/docs/images/app/dms.png differ diff --git a/docs/images/app/gauth.svg b/docs/images/app/gauth.svg new file mode 100644 index 0000000..78dfc04 --- /dev/null +++ b/docs/images/app/gauth.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/app/gcms.png b/docs/images/app/gcms.png new file mode 100644 index 0000000..2abdfd0 Binary files /dev/null and b/docs/images/app/gcms.png differ diff --git a/docs/images/app/grig.png b/docs/images/app/grig.png new file mode 100644 index 0000000..e7e5fd9 Binary files /dev/null and b/docs/images/app/grig.png differ diff --git a/docs/images/app/gui.svg b/docs/images/app/gui.svg new file mode 100644 index 0000000..9e5e57c --- /dev/null +++ b/docs/images/app/gui.svg @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/app/justmemo.png b/docs/images/app/justmemo.png new file mode 100644 index 0000000..dedd19b Binary files /dev/null and b/docs/images/app/justmemo.png differ diff --git a/docs/images/app/moiza.png b/docs/images/app/moiza.png new file mode 100644 index 0000000..f0cdd29 Binary files /dev/null and b/docs/images/app/moiza.png differ diff --git a/docs/images/app/simtong.png b/docs/images/app/simtong.png new file mode 100644 index 0000000..83b4d3f Binary files /dev/null and b/docs/images/app/simtong.png differ diff --git a/docs/images/app/todaywhat.png b/docs/images/app/todaywhat.png new file mode 100644 index 0000000..08c0936 Binary files /dev/null and b/docs/images/app/todaywhat.png differ diff --git a/docs/images/dock/appstore.png b/docs/images/dock/appstore.png new file mode 100644 index 0000000..3c5d97f Binary files /dev/null and b/docs/images/dock/appstore.png differ diff --git a/docs/images/dock/call.png b/docs/images/dock/call.png new file mode 100644 index 0000000..cdd46e3 Binary files /dev/null and b/docs/images/dock/call.png differ diff --git a/docs/images/dock/github.png b/docs/images/dock/github.png new file mode 100644 index 0000000..519d256 Binary files /dev/null and b/docs/images/dock/github.png differ diff --git a/docs/images/dock/mail.png b/docs/images/dock/mail.png new file mode 100644 index 0000000..f9198d5 Binary files /dev/null and b/docs/images/dock/mail.png differ diff --git a/docs/images/favicon.ico b/docs/images/favicon.ico new file mode 100644 index 0000000..3efb8af Binary files /dev/null and b/docs/images/favicon.ico differ diff --git a/docs/images/phone.down.fill.svg b/docs/images/phone.down.fill.svg new file mode 100644 index 0000000..f9e0381 --- /dev/null +++ b/docs/images/phone.down.fill.svg @@ -0,0 +1,3 @@ + + + diff --git a/docs/images/phone.fill.svg b/docs/images/phone.fill.svg new file mode 100644 index 0000000..948be1c --- /dev/null +++ b/docs/images/phone.fill.svg @@ -0,0 +1,3 @@ + + + diff --git a/docs/images/statusBar/battery.75.svg b/docs/images/statusBar/battery.75.svg new file mode 100644 index 0000000..62e5799 --- /dev/null +++ b/docs/images/statusBar/battery.75.svg @@ -0,0 +1,4 @@ + + + + diff --git a/docs/images/statusBar/cellularbars.svg b/docs/images/statusBar/cellularbars.svg new file mode 100644 index 0000000..e4f5322 --- /dev/null +++ b/docs/images/statusBar/cellularbars.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/images/statusBar/wifi.svg b/docs/images/statusBar/wifi.svg new file mode 100644 index 0000000..c333666 --- /dev/null +++ b/docs/images/statusBar/wifi.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..3b208b0 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,92 @@ + + + + + + + + + + + +

Loading

+

+
+
+
+ + + \ No newline at end of file