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AAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;aACzC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC","file":"adapters.js","sourcesContent":["// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\nimport {\n toUint8Array,\n joinUint8Arrays,\n ArrayBufferViewInput,\n toUint8ArrayIterator,\n toUint8ArrayAsyncIterator\n} from '../util/buffer';\n\nimport { ReadableDOMStreamOptions } from './interfaces';\n\n/** @ignore */\nexport default {\n fromIterable(source: Iterable | T): IterableIterator {\n return pump(fromIterable(source));\n },\n fromAsyncIterable(source: AsyncIterable | PromiseLike): AsyncIterableIterator {\n return pump(fromAsyncIterable(source));\n },\n fromDOMStream(source: ReadableStream): AsyncIterableIterator {\n return pump(fromDOMStream(source));\n },\n fromNodeStream(stream: NodeJS.ReadableStream): AsyncIterableIterator {\n return pump(fromNodeStream(stream));\n },\n // @ts-ignore\n toDOMStream(source: Iterable | AsyncIterable, options?: ReadableDOMStreamOptions): ReadableStream {\n throw new Error(`\"toDOMStream\" not available in this environment`);\n },\n // @ts-ignore\n toNodeStream(source: Iterable | AsyncIterable, options?: import('stream').ReadableOptions): import('stream').Readable {\n throw new Error(`\"toNodeStream\" not available in this environment`);\n },\n};\n\n/** @ignore */\nconst pump = | AsyncIterator>(iterator: T) => { iterator.next(); return iterator; };\n\n/** @ignore */\nfunction* fromIterable(source: Iterable | T): IterableIterator {\n\n let done: boolean, threw = false;\n let buffers: Uint8Array[] = [], buffer: Uint8Array;\n let cmd: 'peek' | 'read', size: number, bufferLength = 0;\n\n function byteRange() {\n if (cmd === 'peek') {\n return joinUint8Arrays(buffers, size)[0];\n }\n [buffer, buffers, bufferLength] = joinUint8Arrays(buffers, size);\n return buffer;\n }\n\n // Yield so the caller can inject the read command before creating the source Iterator\n ({ cmd, size } = yield null);\n\n // initialize the iterator\n let it = toUint8ArrayIterator(source)[Symbol.iterator]();\n\n try {\n do {\n // read the next value\n ({ done, value: buffer } = isNaN(size - bufferLength) ?\n it.next(undefined) : it.next(size - bufferLength));\n // if chunk is not null or empty, push it onto the queue\n if (!done && buffer.byteLength > 0) {\n buffers.push(buffer);\n bufferLength += buffer.byteLength;\n }\n // If we have enough bytes in our buffer, yield chunks until we don't\n if (done || size <= bufferLength) {\n do {\n ({ cmd, size } = yield byteRange());\n } while (size < bufferLength);\n }\n } while (!done);\n } catch (e) {\n (threw = true) && (typeof it.throw === 'function') && (it.throw(e));\n } finally {\n (threw === false) && (typeof it.return === 'function') && (it.return());\n }\n}\n\n/** @ignore */\nasync function* fromAsyncIterable(source: AsyncIterable | PromiseLike): AsyncIterableIterator {\n\n let done: boolean, threw = false;\n let buffers: Uint8Array[] = [], buffer: Uint8Array;\n let cmd: 'peek' | 'read', size: number, bufferLength = 0;\n\n function byteRange() {\n if (cmd === 'peek') {\n return joinUint8Arrays(buffers, size)[0];\n }\n [buffer, buffers, bufferLength] = joinUint8Arrays(buffers, size);\n return buffer;\n }\n\n // Yield so the caller can inject the read command before creating the source AsyncIterator\n ({ cmd, size } = yield null);\n\n // initialize the iterator\n let it = toUint8ArrayAsyncIterator(source)[Symbol.asyncIterator]();\n\n try {\n do {\n // read the next value\n ({ done, value: buffer } = isNaN(size - bufferLength)\n ? await it.next(undefined)\n : await it.next(size - bufferLength));\n // if chunk is not null or empty, push it onto the queue\n if (!done && buffer.byteLength > 0) {\n buffers.push(buffer);\n bufferLength += buffer.byteLength;\n }\n // If we have enough bytes in our buffer, yield chunks until we don't\n if (done || size <= bufferLength) {\n do {\n ({ cmd, size } = yield byteRange());\n } while (size < bufferLength);\n }\n } while (!done);\n } catch (e) {\n (threw = true) && (typeof it.throw === 'function') && (await it.throw(e));\n } finally {\n (threw === false) && (typeof it.return === 'function') && (await it.return());\n }\n}\n\n// All this manual Uint8Array chunk management can be avoided if/when engines\n// add support for ArrayBuffer.transfer() or ArrayBuffer.prototype.realloc():\n// https://github.com/domenic/proposal-arraybuffer-transfer\n/** @ignore */\nasync function* fromDOMStream(source: ReadableStream): AsyncIterableIterator {\n\n let done = false, threw = false;\n let buffers: Uint8Array[] = [], buffer: Uint8Array;\n let cmd: 'peek' | 'read', size: number, bufferLength = 0;\n\n function byteRange() {\n if (cmd === 'peek') {\n return joinUint8Arrays(buffers, size)[0];\n }\n [buffer, buffers, bufferLength] = joinUint8Arrays(buffers, size);\n return buffer;\n }\n\n // Yield so the caller can inject the read command before we establish the ReadableStream lock\n ({ cmd, size } = yield null);\n\n // initialize the reader and lock the stream\n let it = new AdaptiveByteReader(source);\n\n try {\n do {\n // read the next value\n ({ done, value: buffer } = isNaN(size - bufferLength)\n ? await it['read'](undefined)\n : await it['read'](size - bufferLength));\n // if chunk is not null or empty, push it onto the queue\n if (!done && buffer.byteLength > 0) {\n buffers.push(toUint8Array(buffer));\n bufferLength += buffer.byteLength;\n }\n // If we have enough bytes in our buffer, yield chunks until we don't\n if (done || size <= bufferLength) {\n do {\n ({ cmd, size } = yield byteRange());\n } while (size < bufferLength);\n }\n } while (!done);\n } catch (e) {\n (threw = true) && (await it['cancel'](e));\n } finally {\n (threw === false) ? (await it['cancel']())\n : source['locked'] && it.releaseLock();\n }\n}\n\n/** @ignore */\nclass AdaptiveByteReader {\n\n private supportsBYOB: boolean;\n private byobReader: ReadableStreamBYOBReader | null = null;\n private defaultReader: ReadableStreamDefaultReader | null = null;\n private reader: ReadableStreamBYOBReader | ReadableStreamDefaultReader | null;\n\n constructor(private source: ReadableStream) {\n try {\n this.supportsBYOB = !!(this.reader = this.getBYOBReader());\n } catch (e) {\n this.supportsBYOB = !!!(this.reader = this.getDefaultReader());\n }\n }\n\n get closed(): Promise {\n return this.reader ? this.reader['closed'].catch(() => {}) : Promise.resolve();\n }\n\n releaseLock(): void {\n if (this.reader) {\n this.reader.releaseLock();\n }\n this.reader = this.byobReader = this.defaultReader = null;\n }\n\n async cancel(reason?: any): Promise {\n const { reader, source } = this;\n reader && (await reader['cancel'](reason).catch(() => {}));\n source && (source['locked'] && this.releaseLock());\n }\n\n async read(size?: number): Promise> {\n if (size === 0) {\n return { done: this.reader == null, value: new Uint8Array(0) };\n }\n const result = !this.supportsBYOB || typeof size !== 'number'\n ? await this.getDefaultReader().read()\n : await this.readFromBYOBReader(size);\n !result.done && (result.value = toUint8Array(result as ReadableStreamReadResult));\n return result as ReadableStreamReadResult;\n }\n\n private getDefaultReader() {\n if (this.byobReader) { this.releaseLock(); }\n if (!this.defaultReader) {\n this.defaultReader = this.source['getReader']();\n // We have to catch and swallow errors here to avoid uncaught promise rejection exceptions\n // that seem to be raised when we call `releaseLock()` on this reader. I'm still mystified\n // about why these errors are raised, but I'm sure there's some important spec reason that\n // I haven't considered. I hate to employ such an anti-pattern here, but it seems like the\n // only solution in this case :/\n this.defaultReader['closed'].catch(() => {});\n }\n return (this.reader = this.defaultReader);\n }\n\n private getBYOBReader() {\n if (this.defaultReader) { this.releaseLock(); }\n if (!this.byobReader) {\n this.byobReader = this.source['getReader']({ mode: 'byob' });\n // We have to catch and swallow errors here to avoid uncaught promise rejection exceptions\n // that seem to be raised when we call `releaseLock()` on this reader. I'm still mystified\n // about why these errors are raised, but I'm sure there's some important spec reason that\n // I haven't considered. I hate to employ such an anti-pattern here, but it seems like the\n // only solution in this case :/\n this.byobReader['closed'].catch(() => {});\n }\n return (this.reader = this.byobReader);\n }\n\n // This strategy plucked from the example in the streams spec:\n // https://streams.spec.whatwg.org/#example-manual-read-bytes\n private async readFromBYOBReader(size: number) {\n return await readInto(this.getBYOBReader(), new ArrayBuffer(size), 0, size);\n }\n}\n\n/** @ignore */\nasync function readInto(reader: ReadableStreamBYOBReader, buffer: ArrayBufferLike, offset: number, size: number): Promise> {\n if (offset >= size) {\n return { done: false, value: new Uint8Array(buffer, 0, size) };\n }\n const { done, value } = await reader.read(new Uint8Array(buffer, offset, size - offset));\n if (((offset += value.byteLength) < size) && !done) {\n return await readInto(reader, value.buffer, offset, size);\n }\n return { done, value: new Uint8Array(value.buffer, 0, offset) };\n}\n\n/** @ignore */\ntype EventName = 'end' | 'error' | 'readable';\n/** @ignore */\ntype Event = [EventName, (_: any) => void, Promise<[EventName, Error | null]>];\n/** @ignore */\nconst onEvent = (stream: NodeJS.ReadableStream, event: T) => {\n let handler = (_: any) => resolve([event, _]);\n let resolve: (value?: [T, any] | PromiseLike<[T, any]>) => void;\n return [event, handler, new Promise<[T, any]>(\n (r) => (resolve = r) && stream['once'](event, handler)\n )] as Event;\n};\n\n/** @ignore */\nasync function* fromNodeStream(stream: NodeJS.ReadableStream): AsyncIterableIterator {\n\n let events: Event[] = [];\n let event: EventName = 'error';\n let done = false, err: Error | null = null;\n let cmd: 'peek' | 'read', size: number, bufferLength = 0;\n let buffers: Uint8Array[] = [], buffer: Uint8Array | Buffer | string;\n\n function byteRange() {\n if (cmd === 'peek') {\n return joinUint8Arrays(buffers, size)[0];\n }\n [buffer, buffers, bufferLength] = joinUint8Arrays(buffers, size);\n return buffer;\n }\n\n // Yield so the caller can inject the read command before we\n // add the listener for the source stream's 'readable' event.\n ({ cmd, size } = yield null);\n\n // ignore stdin if it's a TTY\n if ((stream as any)['isTTY']) { return yield new Uint8Array(0); }\n\n try {\n // initialize the stream event handlers\n events[0] = onEvent(stream, 'end');\n events[1] = onEvent(stream, 'error');\n\n do {\n events[2] = onEvent(stream, 'readable');\n\n // wait on the first message event from the stream\n [event, err] = await Promise.race(events.map((x) => x[2]));\n\n // if the stream emitted an Error, rethrow it\n if (event === 'error') { break; }\n if (!(done = event === 'end')) {\n // If the size is NaN, request to read everything in the stream's internal buffer\n if (!isFinite(size - bufferLength)) {\n buffer = toUint8Array(stream['read'](undefined));\n } else {\n buffer = toUint8Array(stream['read'](size - bufferLength));\n // If the byteLength is 0, then the requested amount is more than the stream has\n // in its internal buffer. In this case the stream needs a \"kick\" to tell it to\n // continue emitting readable events, so request to read everything the stream\n // has in its internal buffer right now.\n if (buffer.byteLength < (size - bufferLength)) {\n buffer = toUint8Array(stream['read'](undefined));\n }\n }\n // if chunk is not null or empty, push it onto the queue\n if (buffer.byteLength > 0) {\n buffers.push(buffer);\n bufferLength += buffer.byteLength;\n }\n }\n // If we have enough bytes in our buffer, yield chunks until we don't\n if (done || size <= bufferLength) {\n do {\n ({ cmd, size } = yield byteRange());\n } while (size < bufferLength);\n }\n } while (!done);\n } finally {\n await cleanup(events, event === 'error' ? err : null);\n }\n\n function cleanup(events: Event[], err?: T) {\n buffer = buffers = null;\n return new Promise(async (resolve, reject) => {\n for (const [evt, fn] of events) {\n stream['off'](evt, fn);\n }\n try {\n // Some stream implementations don't call the destroy callback,\n // because it's really a node-internal API. Just calling `destroy`\n // here should be enough to conform to the ReadableStream contract\n const destroy = (stream as any)['destroy'];\n destroy && destroy.call(stream, err);\n err = undefined;\n } catch (e) { err = e || err; } finally {\n err != null ? reject(err) : resolve();\n }\n });\n }\n}\n"]}