{
  "version": 3,
  "sources": ["../src/iobuffer.ts"],
  "sourcesContent": ["import { decode, encode } from './text.js'\n\nconst defaultByteLength = 1024 * 8\n\nconst hostBigEndian = (() => {\n    const array = new Uint8Array(4)\n    const view = new Uint32Array(array.buffer)\n    return !((view[0] = 1) & (array[0] as number))\n})()\n\nexport type InputData = number | ArrayBufferLike | ArrayBufferView | IOBuffer;\n\nconst typedArrays = {\n    int8: globalThis.Int8Array,\n    uint8: globalThis.Uint8Array,\n    int16: globalThis.Int16Array,\n    uint16: globalThis.Uint16Array,\n    int32: globalThis.Int32Array,\n    uint32: globalThis.Uint32Array,\n    uint64: globalThis.BigUint64Array,\n    int64: globalThis.BigInt64Array,\n    float32: globalThis.Float32Array,\n    float64: globalThis.Float64Array,\n}\n\ntype TypedArrays = typeof typedArrays;\n\nexport interface IOBufferOptions {\n  /**\n   * Ignore the first n bytes of the ArrayBuffer.\n   */\n  offset?:number;\n}\n\nexport class IOBuffer {\n    /**\n   * Reference to the internal ArrayBuffer object.\n   */\n    public buffer:ArrayBufferLike\n\n    /**\n   * Byte length of the internal ArrayBuffer.\n   */\n    public byteLength:number\n\n    /**\n   * Byte offset of the internal ArrayBuffer.\n   */\n    public byteOffset:number\n\n    /**\n   * Byte length of the internal ArrayBuffer.\n   */\n    public length:number\n\n    /**\n   * The current offset of the buffer's pointer.\n   */\n    public offset:number\n\n    private lastWrittenByte:number\n    private littleEndian:boolean\n\n    private _data:DataView\n    private _mark:number\n    private _marks:number[]\n\n    /**\n   * Create a new IOBuffer.\n   * @param data - The data to construct the IOBuffer with.\n   * If data is a number, it will be the new buffer's length<br>\n   * If data is `undefined`, the buffer will be initialized with a default length of 8Kb<br>\n   * If data is an ArrayBuffer, SharedArrayBuffer, an ArrayBufferView (Typed Array), an IOBuffer instance,\n   * or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.\n   * @param options - An object for the options.\n   * @returns A new IOBuffer instance.\n   */\n    public constructor (\n        data:InputData = defaultByteLength,\n        options:IOBufferOptions = {},\n    ) {\n        let dataIsGiven = false\n        if (typeof data === 'number') {\n            data = new ArrayBuffer(data)\n        } else {\n            dataIsGiven = true\n            this.lastWrittenByte = data.byteLength\n        }\n        const offset = options.offset ? options.offset >>> 0 : 0\n        const byteLength = data.byteLength - offset\n        let dvOffset = offset\n        if (ArrayBuffer.isView(data) || data instanceof IOBuffer) {\n            if (data.byteLength !== data.buffer.byteLength) {\n                dvOffset = data.byteOffset + offset\n            }\n            data = data.buffer\n        }\n        if (dataIsGiven) {\n            this.lastWrittenByte = byteLength\n        } else {\n            this.lastWrittenByte = 0\n        }\n        this.buffer = data\n        this.length = byteLength\n        this.byteLength = byteLength\n        this.byteOffset = dvOffset\n        this.offset = 0\n        this.littleEndian = true\n        this._data = new DataView(this.buffer, dvOffset, byteLength)\n        this._mark = 0\n        this._marks = []\n    }\n\n    /**\n   * Checks if the memory allocated to the buffer is sufficient to store more\n   * bytes after the offset.\n   * @param byteLength - The needed memory in bytes.\n   * @returns `true` if there is sufficient space and `false` otherwise.\n   */\n    public available (byteLength = 1):boolean {\n        return this.offset + byteLength <= this.length\n    }\n\n    /**\n   * Check if little-endian mode is used for reading and writing multi-byte\n   * values.\n   * @returns `true` if little-endian mode is used, `false` otherwise.\n   */\n    public isLittleEndian ():boolean {\n        return this.littleEndian\n    }\n\n    /**\n   * Set little-endian mode for reading and writing multi-byte values.\n   * @returns This.\n   */\n    public setLittleEndian ():this {\n        this.littleEndian = true\n        return this\n    }\n\n    /**\n   * Check if big-endian mode is used for reading and writing multi-byte values.\n   * @returns `true` if big-endian mode is used, `false` otherwise.\n   */\n    public isBigEndian ():boolean {\n        return !this.littleEndian\n    }\n\n    /**\n   * Switches to big-endian mode for reading and writing multi-byte values.\n   * @returns This.\n   */\n    public setBigEndian ():this {\n        this.littleEndian = false\n        return this\n    }\n\n    /**\n   * Move the pointer n bytes forward.\n   * @param n - Number of bytes to skip.\n   * @returns This.\n   */\n    public skip (n = 1): this {\n        this.offset += n\n        return this\n    }\n\n    /**\n   * Move the pointer n bytes backward.\n   * @param n - Number of bytes to move back.\n   * @returns This.\n   */\n    public back (n = 1): this {\n        this.offset -= n\n        return this\n    }\n\n    /**\n   * Move the pointer to the given offset.\n   * @param offset - The offset to move to.\n   * @returns This.\n   */\n    public seek (offset: number): this {\n        this.offset = offset\n        return this\n    }\n\n    /**\n   * Store the current pointer offset.\n   * @see {@link IOBuffer#reset}\n   * @returns This.\n   */\n    public mark (): this {\n        this._mark = this.offset\n        return this\n    }\n\n    /**\n   * Move the pointer back to the last pointer offset set by mark.\n   * @see {@link IOBuffer#mark}\n   * @returns This.\n   */\n    public reset (): this {\n        this.offset = this._mark\n        return this\n    }\n\n    /**\n   * Push the current pointer offset to the mark stack.\n   * @see {@link IOBuffer#popMark}\n   * @returns This.\n   */\n    public pushMark (): this {\n        this._marks.push(this.offset)\n        return this\n    }\n\n    /**\n   * Pop the last pointer offset from the mark stack, and set the current\n   * pointer offset to the popped value.\n   * @see {@link IOBuffer#pushMark}\n   * @returns This.\n   */\n    public popMark (): this {\n        const offset = this._marks.pop()\n        if (offset === undefined) {\n            throw new Error('Mark stack empty')\n        }\n        this.seek(offset)\n        return this\n    }\n\n    /**\n   * Move the pointer offset back to 0.\n   * @returns This.\n   */\n    public rewind (): this {\n        this.offset = 0\n        return this\n    }\n\n    /**\n   * Make sure the buffer has sufficient memory to write a given byteLength at\n   * the current pointer offset.\n   * If the buffer's memory is insufficient, this method will create a new\n   * buffer (a copy) with a length that is twice (byteLength + current offset).\n   * @param byteLength - The needed memory in bytes.\n   * @returns This.\n   */\n    public ensureAvailable (byteLength = 1): this {\n        if (!this.available(byteLength)) {\n            const lengthNeeded = this.offset + byteLength\n            const newLength = lengthNeeded * 2\n            const newArray = new Uint8Array(newLength)\n            newArray.set(new Uint8Array(this.buffer))\n            this.buffer = newArray.buffer\n            this.length = newLength\n            this.byteLength = newLength\n            this._data = new DataView(this.buffer)\n        }\n        return this\n    }\n\n    /**\n   * Read a byte and return false if the byte's value is 0, or true otherwise.\n   * Moves pointer forward by one byte.\n   * @returns The read boolean.\n   */\n    public readBoolean (): boolean {\n        return this.readUint8() !== 0\n    }\n\n    /**\n   * Read a signed 8-bit integer and move pointer forward by 1 byte.\n   * @returns The read byte.\n   */\n    public readInt8 (): number {\n        return this._data.getInt8(this.offset++)\n    }\n\n    /**\n   * Read an unsigned 8-bit integer and move pointer forward by 1 byte.\n   * @returns The read byte.\n   */\n    public readUint8 (): number {\n        return this._data.getUint8(this.offset++)\n    }\n\n    /**\n   * Alias for {@link IOBuffer#readUint8}.\n   * @returns The read byte.\n   */\n    public readByte (): number {\n        return this.readUint8()\n    }\n\n    /**\n   * Read `n` bytes and move pointer forward by `n` bytes.\n   * @param n - Number of bytes to read.\n   * @returns The read bytes.\n   */\n    public readBytes (n = 1): Uint8Array {\n        return this.readArray(n, 'uint8')\n    }\n\n    /**\n   * Creates an array of corresponding to the type `type` and size `size`.\n   * For example, type `uint8` will create a `Uint8Array`.\n   * @param size - size of the resulting array\n   * @param type - number type of elements to read\n   * @returns The read array.\n   */\n    public readArray<T extends keyof typeof typedArrays> (\n        size: number,\n        type: T,\n    ): InstanceType<TypedArrays[T]> {\n        const bytes = typedArrays[type].BYTES_PER_ELEMENT * size\n        const offset = this.byteOffset + this.offset\n        const slice = this.buffer.slice(offset, offset + bytes)\n        if (\n            this.littleEndian === hostBigEndian &&\n      type !== 'uint8' &&\n      type !== 'int8'\n        ) {\n            const slice = new Uint8Array(this.buffer.slice(offset, offset + bytes))\n            slice.reverse()\n            const returnArray = new typedArrays[type](slice.buffer as ArrayBuffer)\n            this.offset += bytes\n            returnArray.reverse()\n            return returnArray as InstanceType<TypedArrays[T]>\n        }\n        const returnArray = new typedArrays[type](slice as ArrayBuffer)\n        this.offset += bytes\n        return returnArray as InstanceType<TypedArrays[T]>\n    }\n\n    /**\n   * Read a 16-bit signed integer and move pointer forward by 2 bytes.\n   * @returns The read value.\n   */\n    public readInt16 (): number {\n        const value = this._data.getInt16(this.offset, this.littleEndian)\n        this.offset += 2\n        return value\n    }\n\n    /**\n   * Read a 16-bit unsigned integer and move pointer forward by 2 bytes.\n   * @returns The read value.\n   */\n    public readUint16 (): number {\n        const value = this._data.getUint16(this.offset, this.littleEndian)\n        this.offset += 2\n        return value\n    }\n\n    /**\n   * Read a 32-bit signed integer and move pointer forward by 4 bytes.\n   * @returns The read value.\n   */\n    public readInt32 (): number {\n        const value = this._data.getInt32(this.offset, this.littleEndian)\n        this.offset += 4\n        return value\n    }\n\n    /**\n   * Read a 32-bit unsigned integer and move pointer forward by 4 bytes.\n   * @returns The read value.\n   */\n    public readUint32 (): number {\n        const value = this._data.getUint32(this.offset, this.littleEndian)\n        this.offset += 4\n        return value\n    }\n\n    /**\n   * Read a 32-bit floating number and move pointer forward by 4 bytes.\n   * @returns The read value.\n   */\n    public readFloat32 (): number {\n        const value = this._data.getFloat32(this.offset, this.littleEndian)\n        this.offset += 4\n        return value\n    }\n\n    /**\n   * Read a 64-bit floating number and move pointer forward by 8 bytes.\n   * @returns The read value.\n   */\n    public readFloat64 (): number {\n        const value = this._data.getFloat64(this.offset, this.littleEndian)\n        this.offset += 8\n        return value\n    }\n\n    /**\n   * Read a 64-bit signed integer number and move pointer forward by 8 bytes.\n   * @returns The read value.\n   */\n    public readBigInt64 (): bigint {\n        const value = this._data.getBigInt64(this.offset, this.littleEndian)\n        this.offset += 8\n        return value\n    }\n\n    /**\n   * Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.\n   * @returns The read value.\n   */\n    public readBigUint64 (): bigint {\n        const value = this._data.getBigUint64(this.offset, this.littleEndian)\n        this.offset += 8\n        return value\n    }\n\n    /**\n   * Read a 1-byte ASCII character and move pointer forward by 1 byte.\n   * @returns The read character.\n   */\n    public readChar (): string {\n        return String.fromCharCode(this.readInt8())\n    }\n\n    /**\n   * Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes.\n   * @param n - Number of characters to read.\n   * @returns The read characters.\n   */\n    public readChars (n = 1): string {\n        let result = ''\n        for (let i = 0; i < n; i++) {\n            result += this.readChar()\n        }\n        return result\n    }\n\n    /**\n   * Read the next `n` bytes, return a UTF-8 decoded string and move pointer\n   * forward by `n` bytes.\n   * @param n - Number of bytes to read.\n   * @returns The decoded string.\n   */\n    public readUtf8 (n = 1): string {\n        return decode(this.readBytes(n))\n    }\n\n    /**\n   * Read the next `n` bytes, return a string decoded with `encoding` and move pointer\n   * forward by `n` bytes.\n   * If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}\n   * @param n - Number of bytes to read.\n   * @param encoding - The encoding to use. Default is 'utf8'.\n   * @returns The decoded string.\n   */\n    public decodeText (n = 1, encoding = 'utf8'): string {\n        return decode(this.readBytes(n), encoding)\n    }\n\n    /**\n   * Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer\n   * forward by 1 byte.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeBoolean (value: unknown): this {\n        this.writeUint8(value ? 0xff : 0x00)\n        return this\n    }\n\n    /**\n   * Write `value` as an 8-bit signed integer and move pointer forward by 1 byte.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeInt8 (value: number): this {\n        this.ensureAvailable(1)\n        this._data.setInt8(this.offset++, value)\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as an 8-bit unsigned integer and move pointer forward by 1\n   * byte.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeUint8 (value: number): this {\n        this.ensureAvailable(1)\n        this._data.setUint8(this.offset++, value)\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * An alias for {@link IOBuffer#writeUint8}.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeByte (value: number): this {\n        return this.writeUint8(value)\n    }\n\n    /**\n   * Write all elements of `bytes` as uint8 values and move pointer forward by\n   * `bytes.length` bytes.\n   * @param bytes - The array of bytes to write.\n   * @returns This.\n   */\n    public writeBytes (bytes: ArrayLike<number>): this {\n        this.ensureAvailable(bytes.length)\n        // eslint-disable-next-line @typescript-eslint/prefer-for-of\n        for (let i = 0; i < bytes.length; i++) {\n            this._data.setUint8(this.offset++, bytes[i] as number)\n        }\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 16-bit signed integer and move pointer forward by 2\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeInt16 (value: number): this {\n        this.ensureAvailable(2)\n        this._data.setInt16(this.offset, value, this.littleEndian)\n        this.offset += 2\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 16-bit unsigned integer and move pointer forward by 2\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeUint16 (value: number): this {\n        this.ensureAvailable(2)\n        this._data.setUint16(this.offset, value, this.littleEndian)\n        this.offset += 2\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 32-bit signed integer and move pointer forward by 4\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeInt32 (value: number): this {\n        this.ensureAvailable(4)\n        this._data.setInt32(this.offset, value, this.littleEndian)\n        this.offset += 4\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 32-bit unsigned integer and move pointer forward by 4\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeUint32 (value: number): this {\n        this.ensureAvailable(4)\n        this._data.setUint32(this.offset, value, this.littleEndian)\n        this.offset += 4\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 32-bit floating number and move pointer forward by 4\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeFloat32 (value: number): this {\n        this.ensureAvailable(4)\n        this._data.setFloat32(this.offset, value, this.littleEndian)\n        this.offset += 4\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 64-bit floating number and move pointer forward by 8\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeFloat64 (value: number): this {\n        this.ensureAvailable(8)\n        this._data.setFloat64(this.offset, value, this.littleEndian)\n        this.offset += 8\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 64-bit signed bigint and move pointer forward by 8\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeBigInt64 (value: bigint): this {\n        this.ensureAvailable(8)\n        this._data.setBigInt64(this.offset, value, this.littleEndian)\n        this.offset += 8\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 64-bit unsigned bigint and move pointer forward by 8\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeBigUint64 (value: bigint): this {\n        this.ensureAvailable(8)\n        this._data.setBigUint64(this.offset, value, this.littleEndian)\n        this.offset += 8\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write the charCode of `str`'s first character as an 8-bit unsigned integer\n   * and move pointer forward by 1 byte.\n   * @param str - The character to write.\n   * @returns This.\n   */\n    public writeChar (str: string): this {\n        return this.writeUint8(str.charCodeAt(0))\n    }\n\n    /**\n   * Write the charCodes of all `str`'s characters as 8-bit unsigned integers\n   * and move pointer forward by `str.length` bytes.\n   * @param str - The characters to write.\n   * @returns This.\n   */\n    public writeChars (str: string): this {\n        for (let i = 0; i < str.length; i++) {\n            this.writeUint8(str.charCodeAt(i))\n        }\n        return this\n    }\n\n    /**\n   * UTF-8 encode and write `str` to the current pointer offset and move pointer\n   * forward according to the encoded length.\n   * @param str - The string to write.\n   * @returns This.\n   */\n    public writeUtf8 (str: string): this {\n        return this.writeBytes(encode(str))\n    }\n\n    /**\n   * Export a Uint8Array view of the internal buffer.\n   * The view starts at the byte offset and its length\n   * is calculated to stop at the last written byte or the original length.\n   * @returns A new Uint8Array view.\n   */\n    public toArray (): Uint8Array {\n        return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte)\n    }\n\n    /**\n   *  Get the total number of bytes written so far, regardless of the current offset.\n   * @returns - Total number of bytes.\n   */\n    public getWrittenByteLength () {\n        return this.lastWrittenByte - this.byteOffset\n    }\n\n    /**\n   * Update the last written byte offset\n   * @private\n   */\n    private _updateLastWrittenByte (): void {\n        if (this.offset > this.lastWrittenByte) {\n            this.lastWrittenByte = this.offset\n        }\n    }\n}\n"],
  "mappings": "4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA+B,qBAE/B,MAAMC,EAAoB,KAAO,EAE3BC,GAAiB,IAAM,CACzB,MAAMC,EAAQ,IAAI,WAAW,CAAC,EACxBC,EAAO,IAAI,YAAYD,EAAM,MAAM,EACzC,MAAO,GAAGC,EAAK,CAAC,EAAI,GAAMD,EAAM,CAAC,EACrC,GAAG,EAIGE,EAAc,CAChB,KAAM,WAAW,UACjB,MAAO,WAAW,WAClB,MAAO,WAAW,WAClB,OAAQ,WAAW,YACnB,MAAO,WAAW,WAClB,OAAQ,WAAW,YACnB,OAAQ,WAAW,eACnB,MAAO,WAAW,cAClB,QAAS,WAAW,aACpB,QAAS,WAAW,YACxB,EAWO,MAAMC,CAAS,CAlCtB,MAkCsB,CAAAC,EAAA,iBAIX,OAKA,WAKA,WAKA,OAKA,OAEC,gBACA,aAEA,MACA,MACA,OAYD,YACHC,EAAiBP,EACjBQ,EAA0B,CAAC,EAC7B,CACE,IAAIC,EAAc,GACd,OAAOF,GAAS,SAChBA,EAAO,IAAI,YAAYA,CAAI,GAE3BE,EAAc,GACd,KAAK,gBAAkBF,EAAK,YAEhC,MAAMG,EAASF,EAAQ,OAASA,EAAQ,SAAW,EAAI,EACjDG,EAAaJ,EAAK,WAAaG,EACrC,IAAIE,EAAWF,GACX,YAAY,OAAOH,CAAI,GAAKA,aAAgBF,KACxCE,EAAK,aAAeA,EAAK,OAAO,aAChCK,EAAWL,EAAK,WAAaG,GAEjCH,EAAOA,EAAK,QAEZE,EACA,KAAK,gBAAkBE,EAEvB,KAAK,gBAAkB,EAE3B,KAAK,OAASJ,EACd,K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B,KAAK,MAAM,aAAa,KAAK,OAAQA,EAAO,KAAK,YAAY,EAC7D,KAAK,QAAU,EACf,KAAK,uBAAuB,EACrB,IACX,CAQO,UAAWI,EAAmB,CACjC,OAAO,KAAK,WAAWA,EAAI,WAAW,CAAC,CAAC,CAC5C,CAQO,WAAYA,EAAmB,CAClC,QAASD,EAAI,EAAGA,EAAIC,EAAI,OAAQD,IAC5B,KAAK,WAAWC,EAAI,WAAWD,CAAC,CAAC,EAErC,OAAO,IACX,CAQO,UAAWC,EAAmB,CACjC,OAAO,KAAK,cAAW,UAAOA,CAAG,CAAC,CACtC,CAQO,SAAuB,CAC1B,OAAO,IAAI,WAAW,KAAK,OAAQ,KAAK,WAAY,KAAK,eAAe,CAC5E,CAMO,sBAAwB,CAC3B,OAAO,KAAK,gBAAkB,KAAK,UACvC,CAMQ,wBAAgC,CAChC,KAAK,OAAS,KAAK,kBACnB,KAAK,gBAAkB,KAAK,OAEpC,CACJ",
  "names": ["iobuffer_exports", "__export", "IOBuffer", "__toCommonJS", "import_text", "defaultByteLength", "hostBigEndian", "array", "view", "typedArrays", "IOBuffer", "__name", "data", "options", "dataIsGiven", "offset", "byteLength", "dvOffset", "n", "newLength", "newArray", "size", "type", "bytes", "slice", "returnArray", "value", "result", "encoding", "i", "str"]
}
