"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __esm = (fn2, res) => function __init() { return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res; }; var __commonJS = (cb, mod2) => function __require() { return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, mod2 )); var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); // ../node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js var require_es_object_atoms = __commonJS({ "../node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(exports2, module2) { module2.exports = Object; } }); // ../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js var require_es_errors = __commonJS({ "../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(exports2, module2) { module2.exports = Error; } }); // ../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js var require_eval = __commonJS({ "../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(exports2, module2) { module2.exports = EvalError; } }); // ../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js var require_range = __commonJS({ "../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(exports2, module2) { module2.exports = RangeError; } }); // ../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js var require_ref = __commonJS({ "../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(exports2, module2) { module2.exports = ReferenceError; } }); // ../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js var require_syntax = __commonJS({ "../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(exports2, module2) { module2.exports = SyntaxError; } }); // ../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js var require_type = __commonJS({ "../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(exports2, module2) { module2.exports = TypeError; } }); // ../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js var require_uri = __commonJS({ "../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(exports2, module2) { module2.exports = URIError; } }); // ../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js var require_abs = __commonJS({ "../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(exports2, module2) { module2.exports = Math.abs; } }); // ../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js var require_floor = __commonJS({ "../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(exports2, module2) { module2.exports = Math.floor; } }); // ../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js var require_max = __commonJS({ "../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(exports2, module2) { module2.exports = Math.max; } }); // ../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js var require_min = __commonJS({ "../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(exports2, module2) { module2.exports = Math.min; } }); // ../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js var require_pow = __commonJS({ "../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(exports2, module2) { module2.exports = Math.pow; } }); // ../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js var require_round = __commonJS({ "../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(exports2, module2) { module2.exports = Math.round; } }); // ../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js var require_isNaN = __commonJS({ "../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(exports2, module2) { module2.exports = Number.isNaN || function isNaN2(a) { return a !== a; }; } }); // ../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js var require_sign = __commonJS({ "../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(exports2, module2) { var $isNaN = require_isNaN(); module2.exports = function sign(number) { if ($isNaN(number) || number === 0) { return number; } return number < 0 ? -1 : 1; }; } }); // ../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js var require_gOPD = __commonJS({ "../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(exports2, module2) { module2.exports = Object.getOwnPropertyDescriptor; } }); // ../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js var require_gopd = __commonJS({ "../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(exports2, module2) { var $gOPD = require_gOPD(); if ($gOPD) { try { $gOPD([], "length"); } catch (e2) { $gOPD = null; } } module2.exports = $gOPD; } }); // ../node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js var require_es_define_property = __commonJS({ "../node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(exports2, module2) { var $defineProperty = Object.defineProperty || false; if ($defineProperty) { try { $defineProperty({}, "a", { value: 1 }); } catch (e2) { $defineProperty = false; } } module2.exports = $defineProperty; } }); // ../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js var require_shams = __commonJS({ "../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(exports2, module2) { module2.exports = function hasSymbols() { if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { return false; } if (typeof Symbol.iterator === "symbol") { return true; } var obj = {}; var sym = Symbol("test"); var symObj = Object(sym); if (typeof sym === "string") { return false; } if (Object.prototype.toString.call(sym) !== "[object Symbol]") { return false; } if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { return false; } var symVal = 42; obj[sym] = symVal; for (var _ in obj) { return false; } if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { return false; } var syms = Object.getOwnPropertySymbols(obj); if (syms.length !== 1 || syms[0] !== sym) { return false; } if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } if (typeof Object.getOwnPropertyDescriptor === "function") { var descriptor = ( /** @type {PropertyDescriptor} */ Object.getOwnPropertyDescriptor(obj, sym) ); if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } } return true; }; } }); // ../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js var require_has_symbols = __commonJS({ "../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(exports2, module2) { var origSymbol = typeof Symbol !== "undefined" && Symbol; var hasSymbolSham = require_shams(); module2.exports = function hasNativeSymbols() { if (typeof origSymbol !== "function") { return false; } if (typeof Symbol !== "function") { return false; } if (typeof origSymbol("foo") !== "symbol") { return false; } if (typeof Symbol("bar") !== "symbol") { return false; } return hasSymbolSham(); }; } }); // ../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js var require_Reflect_getPrototypeOf = __commonJS({ "../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(exports2, module2) { module2.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null; } }); // ../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js var require_Object_getPrototypeOf = __commonJS({ "../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(exports2, module2) { var $Object = require_es_object_atoms(); module2.exports = $Object.getPrototypeOf || null; } }); // ../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js var require_implementation = __commonJS({ "../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports2, module2) { var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; var toStr = Object.prototype.toString; var max = Math.max; var funcType = "[object Function]"; var concatty = function concatty2(a, b) { var arr = []; for (var i2 = 0; i2 < a.length; i2 += 1) { arr[i2] = a[i2]; } for (var j = 0; j < b.length; j += 1) { arr[j + a.length] = b[j]; } return arr; }; var slicy = function slicy2(arrLike, offset) { var arr = []; for (var i2 = offset || 0, j = 0; i2 < arrLike.length; i2 += 1, j += 1) { arr[j] = arrLike[i2]; } return arr; }; var joiny = function(arr, joiner) { var str = ""; for (var i2 = 0; i2 < arr.length; i2 += 1) { str += arr[i2]; if (i2 + 1 < arr.length) { str += joiner; } } return str; }; module2.exports = function bind(that) { var target = this; if (typeof target !== "function" || toStr.apply(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } var args2 = slicy(arguments, 1); var bound; var binder = function() { if (this instanceof bound) { var result = target.apply( this, concatty(args2, arguments) ); if (Object(result) === result) { return result; } return this; } return target.apply( that, concatty(args2, arguments) ); }; var boundLength = max(0, target.length - args2.length); var boundArgs = []; for (var i2 = 0; i2 < boundLength; i2++) { boundArgs[i2] = "$" + i2; } bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); if (target.prototype) { var Empty = function Empty2() { }; Empty.prototype = target.prototype; bound.prototype = new Empty(); Empty.prototype = null; } return bound; }; } }); // ../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js var require_function_bind = __commonJS({ "../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports2, module2) { var implementation = require_implementation(); module2.exports = Function.prototype.bind || implementation; } }); // ../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js var require_functionCall = __commonJS({ "../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(exports2, module2) { module2.exports = Function.prototype.call; } }); // ../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js var require_functionApply = __commonJS({ "../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(exports2, module2) { module2.exports = Function.prototype.apply; } }); // ../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js var require_reflectApply = __commonJS({ "../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(exports2, module2) { module2.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply; } }); // ../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js var require_actualApply = __commonJS({ "../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(exports2, module2) { var bind = require_function_bind(); var $apply = require_functionApply(); var $call = require_functionCall(); var $reflectApply = require_reflectApply(); module2.exports = $reflectApply || bind.call($call, $apply); } }); // ../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js var require_call_bind_apply_helpers = __commonJS({ "../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(exports2, module2) { var bind = require_function_bind(); var $TypeError = require_type(); var $call = require_functionCall(); var $actualApply = require_actualApply(); module2.exports = function callBindBasic(args2) { if (args2.length < 1 || typeof args2[0] !== "function") { throw new $TypeError("a function is required"); } return $actualApply(bind, $call, args2); }; } }); // ../node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js var require_get = __commonJS({ "../node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(exports2, module2) { var callBind = require_call_bind_apply_helpers(); var gOPD = require_gopd(); var hasProtoAccessor; try { hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ [].__proto__ === Array.prototype; } catch (e2) { if (!e2 || typeof e2 !== "object" || !("code" in e2) || e2.code !== "ERR_PROTO_ACCESS") { throw e2; } } var desc = !!hasProtoAccessor && gOPD && gOPD( Object.prototype, /** @type {keyof typeof Object.prototype} */ "__proto__" ); var $Object = Object; var $getPrototypeOf = $Object.getPrototypeOf; module2.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? ( /** @type {import('./get')} */ function getDunder(value) { return $getPrototypeOf(value == null ? value : $Object(value)); } ) : false; } }); // ../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js var require_get_proto = __commonJS({ "../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(exports2, module2) { var reflectGetProto = require_Reflect_getPrototypeOf(); var originalGetProto = require_Object_getPrototypeOf(); var getDunderProto = require_get(); module2.exports = reflectGetProto ? function getProto(O) { return reflectGetProto(O); } : originalGetProto ? function getProto(O) { if (!O || typeof O !== "object" && typeof O !== "function") { throw new TypeError("getProto: not an object"); } return originalGetProto(O); } : getDunderProto ? function getProto(O) { return getDunderProto(O); } : null; } }); // ../node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js var require_hasown = __commonJS({ "../node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(exports2, module2) { var call = Function.prototype.call; var $hasOwn = Object.prototype.hasOwnProperty; var bind = require_function_bind(); module2.exports = bind.call(call, $hasOwn); } }); // ../node_modules/.pnpm/get-intrinsic@1.2.7/node_modules/get-intrinsic/index.js var require_get_intrinsic = __commonJS({ "../node_modules/.pnpm/get-intrinsic@1.2.7/node_modules/get-intrinsic/index.js"(exports2, module2) { var undefined2; var $Object = require_es_object_atoms(); var $Error = require_es_errors(); var $EvalError = require_eval(); var $RangeError = require_range(); var $ReferenceError = require_ref(); var $SyntaxError = require_syntax(); var $TypeError = require_type(); var $URIError = require_uri(); var abs = require_abs(); var floor = require_floor(); var max = require_max(); var min = require_min(); var pow = require_pow(); var round = require_round(); var sign = require_sign(); var $Function = Function; var getEvalledConstructor = function(expressionSyntax) { try { return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); } catch (e2) { } }; var $gOPD = require_gopd(); var $defineProperty = require_es_define_property(); var throwTypeError = function() { throw new $TypeError(); }; var ThrowTypeError = $gOPD ? function() { try { arguments.callee; return throwTypeError; } catch (calleeThrows) { try { return $gOPD(arguments, "callee").get; } catch (gOPDthrows) { return throwTypeError; } } }() : throwTypeError; var hasSymbols = require_has_symbols()(); var getProto = require_get_proto(); var $ObjectGPO = require_Object_getPrototypeOf(); var $ReflectGPO = require_Reflect_getPrototypeOf(); var $apply = require_functionApply(); var $call = require_functionCall(); var needsEval = {}; var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); var INTRINSICS = { __proto__: null, "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, "%Array%": Array, "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, "%AsyncFromSyncIteratorPrototype%": undefined2, "%AsyncFunction%": needsEval, "%AsyncGenerator%": needsEval, "%AsyncGeneratorFunction%": needsEval, "%AsyncIteratorPrototype%": needsEval, "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, "%Boolean%": Boolean, "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, "%Date%": Date, "%decodeURI%": decodeURI, "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, "%Error%": $Error, "%eval%": eval, // eslint-disable-line no-eval "%EvalError%": $EvalError, "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, "%Function%": $Function, "%GeneratorFunction%": needsEval, "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, "%isFinite%": isFinite, "%isNaN%": isNaN, "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, "%JSON%": typeof JSON === "object" ? JSON : undefined2, "%Map%": typeof Map === "undefined" ? undefined2 : Map, "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), "%Math%": Math, "%Number%": Number, "%Object%": $Object, "%Object.getOwnPropertyDescriptor%": $gOPD, "%parseFloat%": parseFloat, "%parseInt%": parseInt, "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, "%RangeError%": $RangeError, "%ReferenceError%": $ReferenceError, "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, "%RegExp%": RegExp, "%Set%": typeof Set === "undefined" ? undefined2 : Set, "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, "%String%": String, "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, "%Symbol%": hasSymbols ? Symbol : undefined2, "%SyntaxError%": $SyntaxError, "%ThrowTypeError%": ThrowTypeError, "%TypedArray%": TypedArray, "%TypeError%": $TypeError, "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, "%URIError%": $URIError, "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet, "%Function.prototype.call%": $call, "%Function.prototype.apply%": $apply, "%Object.defineProperty%": $defineProperty, "%Object.getPrototypeOf%": $ObjectGPO, "%Math.abs%": abs, "%Math.floor%": floor, "%Math.max%": max, "%Math.min%": min, "%Math.pow%": pow, "%Math.round%": round, "%Math.sign%": sign, "%Reflect.getPrototypeOf%": $ReflectGPO }; if (getProto) { try { null.error; } catch (e2) { errorProto = getProto(getProto(e2)); INTRINSICS["%Error.prototype%"] = errorProto; } } var errorProto; var doEval = function doEval2(name) { var value; if (name === "%AsyncFunction%") { value = getEvalledConstructor("async function () {}"); } else if (name === "%GeneratorFunction%") { value = getEvalledConstructor("function* () {}"); } else if (name === "%AsyncGeneratorFunction%") { value = getEvalledConstructor("async function* () {}"); } else if (name === "%AsyncGenerator%") { var fn2 = doEval2("%AsyncGeneratorFunction%"); if (fn2) { value = fn2.prototype; } } else if (name === "%AsyncIteratorPrototype%") { var gen = doEval2("%AsyncGenerator%"); if (gen && getProto) { value = getProto(gen.prototype); } } INTRINSICS[name] = value; return value; }; var LEGACY_ALIASES = { __proto__: null, "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], "%ArrayPrototype%": ["Array", "prototype"], "%ArrayProto_entries%": ["Array", "prototype", "entries"], "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], "%ArrayProto_keys%": ["Array", "prototype", "keys"], "%ArrayProto_values%": ["Array", "prototype", "values"], "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], "%BooleanPrototype%": ["Boolean", "prototype"], "%DataViewPrototype%": ["DataView", "prototype"], "%DatePrototype%": ["Date", "prototype"], "%ErrorPrototype%": ["Error", "prototype"], "%EvalErrorPrototype%": ["EvalError", "prototype"], "%Float32ArrayPrototype%": ["Float32Array", "prototype"], "%Float64ArrayPrototype%": ["Float64Array", "prototype"], "%FunctionPrototype%": ["Function", "prototype"], "%Generator%": ["GeneratorFunction", "prototype"], "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], "%Int8ArrayPrototype%": ["Int8Array", "prototype"], "%Int16ArrayPrototype%": ["Int16Array", "prototype"], "%Int32ArrayPrototype%": ["Int32Array", "prototype"], "%JSONParse%": ["JSON", "parse"], "%JSONStringify%": ["JSON", "stringify"], "%MapPrototype%": ["Map", "prototype"], "%NumberPrototype%": ["Number", "prototype"], "%ObjectPrototype%": ["Object", "prototype"], "%ObjProto_toString%": ["Object", "prototype", "toString"], "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], "%PromisePrototype%": ["Promise", "prototype"], "%PromiseProto_then%": ["Promise", "prototype", "then"], "%Promise_all%": ["Promise", "all"], "%Promise_reject%": ["Promise", "reject"], "%Promise_resolve%": ["Promise", "resolve"], "%RangeErrorPrototype%": ["RangeError", "prototype"], "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], "%RegExpPrototype%": ["RegExp", "prototype"], "%SetPrototype%": ["Set", "prototype"], "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], "%StringPrototype%": ["String", "prototype"], "%SymbolPrototype%": ["Symbol", "prototype"], "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], "%TypedArrayPrototype%": ["TypedArray", "prototype"], "%TypeErrorPrototype%": ["TypeError", "prototype"], "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], "%URIErrorPrototype%": ["URIError", "prototype"], "%WeakMapPrototype%": ["WeakMap", "prototype"], "%WeakSetPrototype%": ["WeakSet", "prototype"] }; var bind = require_function_bind(); var hasOwn = require_hasown(); var $concat = bind.call($call, Array.prototype.concat); var $spliceApply = bind.call($apply, Array.prototype.splice); var $replace = bind.call($call, String.prototype.replace); var $strSlice = bind.call($call, String.prototype.slice); var $exec = bind.call($call, RegExp.prototype.exec); var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; var stringToPath = function stringToPath2(string) { var first = $strSlice(string, 0, 1); var last = $strSlice(string, -1); if (first === "%" && last !== "%") { throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); } else if (last === "%" && first !== "%") { throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); } var result = []; $replace(string, rePropName, function(match, number, quote, subString) { result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; }); return result; }; var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { var intrinsicName = name; var alias; if (hasOwn(LEGACY_ALIASES, intrinsicName)) { alias = LEGACY_ALIASES[intrinsicName]; intrinsicName = "%" + alias[0] + "%"; } if (hasOwn(INTRINSICS, intrinsicName)) { var value = INTRINSICS[intrinsicName]; if (value === needsEval) { value = doEval(intrinsicName); } if (typeof value === "undefined" && !allowMissing) { throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); } return { alias, name: intrinsicName, value }; } throw new $SyntaxError("intrinsic " + name + " does not exist!"); }; module2.exports = function GetIntrinsic(name, allowMissing) { if (typeof name !== "string" || name.length === 0) { throw new $TypeError("intrinsic name must be a non-empty string"); } if (arguments.length > 1 && typeof allowMissing !== "boolean") { throw new $TypeError('"allowMissing" argument must be a boolean'); } if ($exec(/^%?[^%]*%?$/, name) === null) { throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); } var parts = stringToPath(name); var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); var intrinsicRealName = intrinsic.name; var value = intrinsic.value; var skipFurtherCaching = false; var alias = intrinsic.alias; if (alias) { intrinsicBaseName = alias[0]; $spliceApply(parts, $concat([0, 1], alias)); } for (var i2 = 1, isOwn = true; i2 < parts.length; i2 += 1) { var part = parts[i2]; var first = $strSlice(part, 0, 1); var last = $strSlice(part, -1); if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) { throw new $SyntaxError("property names with quotes must have matching quotes"); } if (part === "constructor" || !isOwn) { skipFurtherCaching = true; } intrinsicBaseName += "." + part; intrinsicRealName = "%" + intrinsicBaseName + "%"; if (hasOwn(INTRINSICS, intrinsicRealName)) { value = INTRINSICS[intrinsicRealName]; } else if (value != null) { if (!(part in value)) { if (!allowMissing) { throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); } return void 0; } if ($gOPD && i2 + 1 >= parts.length) { var desc = $gOPD(value, part); isOwn = !!desc; if (isOwn && "get" in desc && !("originalValue" in desc.get)) { value = desc.get; } else { value = value[part]; } } else { isOwn = hasOwn(value, part); value = value[part]; } if (isOwn && !skipFurtherCaching) { INTRINSICS[intrinsicRealName] = value; } } } return value; }; } }); // ../node_modules/.pnpm/call-bound@1.0.3/node_modules/call-bound/index.js var require_call_bound = __commonJS({ "../node_modules/.pnpm/call-bound@1.0.3/node_modules/call-bound/index.js"(exports2, module2) { var GetIntrinsic = require_get_intrinsic(); var callBindBasic = require_call_bind_apply_helpers(); var $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]); module2.exports = function callBoundIntrinsic(name, allowMissing) { var intrinsic = ( /** @type {Parameters[0][0]} */ GetIntrinsic(name, !!allowMissing) ); if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) { return callBindBasic([intrinsic]); } return intrinsic; }; } }); // ../node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js var require_shams2 = __commonJS({ "../node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(exports2, module2) { var hasSymbols = require_shams(); module2.exports = function hasToStringTagShams() { return hasSymbols() && !!Symbol.toStringTag; }; } }); // ../node_modules/.pnpm/is-regex@1.2.1/node_modules/is-regex/index.js var require_is_regex = __commonJS({ "../node_modules/.pnpm/is-regex@1.2.1/node_modules/is-regex/index.js"(exports2, module2) { var callBound = require_call_bound(); var hasToStringTag = require_shams2()(); var hasOwn = require_hasown(); var gOPD = require_gopd(); var fn2; if (hasToStringTag) { $exec = callBound("RegExp.prototype.exec"); isRegexMarker = {}; throwRegexMarker = function() { throw isRegexMarker; }; badStringifier = { toString: throwRegexMarker, valueOf: throwRegexMarker }; if (typeof Symbol.toPrimitive === "symbol") { badStringifier[Symbol.toPrimitive] = throwRegexMarker; } fn2 = function isRegex(value) { if (!value || typeof value !== "object") { return false; } var descriptor = ( /** @type {NonNullable} */ gOPD( /** @type {{ lastIndex?: unknown }} */ value, "lastIndex" ) ); var hasLastIndexDataProperty = descriptor && hasOwn(descriptor, "value"); if (!hasLastIndexDataProperty) { return false; } try { $exec( value, /** @type {string} */ /** @type {unknown} */ badStringifier ); } catch (e2) { return e2 === isRegexMarker; } }; } else { $toString = callBound("Object.prototype.toString"); regexClass = "[object RegExp]"; fn2 = function isRegex(value) { if (!value || typeof value !== "object" && typeof value !== "function") { return false; } return $toString(value) === regexClass; }; } var $exec; var isRegexMarker; var throwRegexMarker; var badStringifier; var $toString; var regexClass; module2.exports = fn2; } }); // ../node_modules/.pnpm/safe-regex-test@1.1.0/node_modules/safe-regex-test/index.js var require_safe_regex_test = __commonJS({ "../node_modules/.pnpm/safe-regex-test@1.1.0/node_modules/safe-regex-test/index.js"(exports2, module2) { var callBound = require_call_bound(); var isRegex = require_is_regex(); var $exec = callBound("RegExp.prototype.exec"); var $TypeError = require_type(); module2.exports = function regexTester(regex) { if (!isRegex(regex)) { throw new $TypeError("`regex` must be a RegExp"); } return function test(s2) { return $exec(regex, s2) !== null; }; }; } }); // ../node_modules/.pnpm/is-generator-function@1.1.0/node_modules/is-generator-function/index.js var require_is_generator_function = __commonJS({ "../node_modules/.pnpm/is-generator-function@1.1.0/node_modules/is-generator-function/index.js"(exports2, module2) { var callBound = require_call_bound(); var safeRegexTest = require_safe_regex_test(); var isFnRegex = safeRegexTest(/^\s*(?:function)?\*/); var hasToStringTag = require_shams2()(); var getProto = require_get_proto(); var toStr = callBound("Object.prototype.toString"); var fnToStr = callBound("Function.prototype.toString"); var getGeneratorFunc = function() { if (!hasToStringTag) { return false; } try { return Function("return function*() {}")(); } catch (e2) { } }; var GeneratorFunction; module2.exports = function isGeneratorFunction(fn2) { if (typeof fn2 !== "function") { return false; } if (isFnRegex(fnToStr(fn2))) { return true; } if (!hasToStringTag) { var str = toStr(fn2); return str === "[object GeneratorFunction]"; } if (!getProto) { return false; } if (typeof GeneratorFunction === "undefined") { var generatorFunc = getGeneratorFunc(); GeneratorFunction = generatorFunc ? ( /** @type {GeneratorFunctionConstructor} */ getProto(generatorFunc) ) : false; } return getProto(fn2) === GeneratorFunction; }; } }); // ../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js var require_ms = __commonJS({ "../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) { var s2 = 1e3; var m2 = s2 * 60; var h2 = m2 * 60; var d = h2 * 24; var w = d * 7; var y = d * 365.25; module2.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === "string" && val.length > 0) { return parse(val); } else if (type === "number" && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) ); }; function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || "ms").toLowerCase(); switch (type) { case "years": case "year": case "yrs": case "yr": case "y": return n * y; case "weeks": case "week": case "w": return n * w; case "days": case "day": case "d": return n * d; case "hours": case "hour": case "hrs": case "hr": case "h": return n * h2; case "minutes": case "minute": case "mins": case "min": case "m": return n * m2; case "seconds": case "second": case "secs": case "sec": case "s": return n * s2; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return n; default: return void 0; } } function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + "d"; } if (msAbs >= h2) { return Math.round(ms / h2) + "h"; } if (msAbs >= m2) { return Math.round(ms / m2) + "m"; } if (msAbs >= s2) { return Math.round(ms / s2) + "s"; } return ms + "ms"; } function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, "day"); } if (msAbs >= h2) { return plural(ms, msAbs, h2, "hour"); } if (msAbs >= m2) { return plural(ms, msAbs, m2, "minute"); } if (msAbs >= s2) { return plural(ms, msAbs, s2, "second"); } return ms + " ms"; } function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } } }); // ../node_modules/.pnpm/debug@4.3.7/node_modules/debug/src/common.js var require_common = __commonJS({ "../node_modules/.pnpm/debug@4.3.7/node_modules/debug/src/common.js"(exports2, module2) { function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require_ms(); createDebug.destroy = destroy; Object.keys(env).forEach((key) => { createDebug[key] = env[key]; }); createDebug.names = []; createDebug.skips = []; createDebug.formatters = {}; function selectColor(namespace) { let hash = 0; for (let i2 = 0; i2 < namespace.length; i2++) { hash = (hash << 5) - hash + namespace.charCodeAt(i2); hash |= 0; } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args2) { if (!debug.enabled) { return; } const self2 = debug; const curr = Number(/* @__PURE__ */ new Date()); const ms = curr - (prevTime || curr); self2.diff = ms; self2.prev = prevTime; self2.curr = curr; prevTime = curr; args2[0] = createDebug.coerce(args2[0]); if (typeof args2[0] !== "string") { args2.unshift("%O"); } let index = 0; args2[0] = args2[0].replace(/%([a-zA-Z%])/g, (match, format) => { if (match === "%%") { return "%"; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === "function") { const val = args2[index]; match = formatter.call(self2, val); args2.splice(index, 1); index--; } return match; }); createDebug.formatArgs.call(self2, args2); const logFn = self2.log || createDebug.log; logFn.apply(self2, args2); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; Object.defineProperty(debug, "enabled", { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: (v) => { enableOverride = v; } }); if (typeof createDebug.init === "function") { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); newDebug.log = this.log; return newDebug; } function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; let i2; const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); const len = split.length; for (i2 = 0; i2 < len; i2++) { if (!split[i2]) { continue; } namespaces = split[i2].replace(/\*/g, ".*?"); if (namespaces[0] === "-") { createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); } else { createDebug.names.push(new RegExp("^" + namespaces + "$")); } } } function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) ].join(","); createDebug.enable(""); return namespaces; } function enabled(name) { if (name[name.length - 1] === "*") { return true; } let i2; let len; for (i2 = 0, len = createDebug.skips.length; i2 < len; i2++) { if (createDebug.skips[i2].test(name)) { return false; } } for (i2 = 0, len = createDebug.names.length; i2 < len; i2++) { if (createDebug.names[i2].test(name)) { return true; } } return false; } function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); } function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } function destroy() { console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } createDebug.enable(createDebug.load()); return createDebug; } module2.exports = setup; } }); // ../node_modules/.pnpm/debug@4.3.7/node_modules/debug/src/browser.js var require_browser = __commonJS({ "../node_modules/.pnpm/debug@4.3.7/node_modules/debug/src/browser.js"(exports2, module2) { exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.storage = localstorage(); exports2.destroy = /* @__PURE__ */ (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } }; })(); exports2.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ]; function useColors() { if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { return true; } if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } let m2; return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== "undefined" && navigator.userAgent && (m2 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m2[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } function formatArgs(args2) { args2[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args2[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); if (!this.useColors) { return; } const c = "color: " + this.color; args2.splice(1, 0, c, "color: inherit"); let index = 0; let lastC = 0; args2[0].replace(/%[a-zA-Z%]/g, (match) => { if (match === "%%") { return; } index++; if (match === "%c") { lastC = index; } }); args2.splice(lastC, 0, c); } exports2.log = console.debug || console.log || (() => { }); function save(namespaces) { try { if (namespaces) { exports2.storage.setItem("debug", namespaces); } else { exports2.storage.removeItem("debug"); } } catch (error) { } } function load() { let r2; try { r2 = exports2.storage.getItem("debug"); } catch (error) { } if (!r2 && typeof process !== "undefined" && "env" in process) { r2 = process.env.DEBUG; } return r2; } function localstorage() { try { return localStorage; } catch (error) { } } module2.exports = require_common()(exports2); var { formatters } = module2.exports; formatters.j = function(v) { try { return JSON.stringify(v); } catch (error) { return "[UnexpectedJSONParseError]: " + error.message; } }; } }); // ../node_modules/.pnpm/debug@4.3.7/node_modules/debug/src/node.js var require_node = __commonJS({ "../node_modules/.pnpm/debug@4.3.7/node_modules/debug/src/node.js"(exports2, module2) { var tty = require("tty"); var util = require("util"); exports2.init = init; exports2.log = log2; exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.destroy = util.deprecate( () => { }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." ); exports2.colors = [6, 2, 3, 4, 5, 1]; try { const supportsColor = require("supports-color"); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports2.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { } exports2.inspectOpts = Object.keys(process.env).filter((key) => { return /^debug_/i.test(key); }).reduce((obj, key) => { const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === "null") { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); function useColors() { return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd); } function formatArgs(args2) { const { namespace: name, useColors: useColors2 } = this; if (useColors2) { const c = this.color; const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); const prefix = ` ${colorCode};1m${name} \x1B[0m`; args2[0] = prefix + args2[0].split("\n").join("\n" + prefix); args2.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); } else { args2[0] = getDate() + name + " " + args2[0]; } } function getDate() { if (exports2.inspectOpts.hideDate) { return ""; } return (/* @__PURE__ */ new Date()).toISOString() + " "; } function log2(...args2) { return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args2) + "\n"); } function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { delete process.env.DEBUG; } } function load() { return process.env.DEBUG; } function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports2.inspectOpts); for (let i2 = 0; i2 < keys.length; i2++) { debug.inspectOpts[keys[i2]] = exports2.inspectOpts[keys[i2]]; } } module2.exports = require_common()(exports2); var { formatters } = module2.exports; formatters.o = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); }; formatters.O = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; } }); // ../node_modules/.pnpm/debug@4.3.7/node_modules/debug/src/index.js var require_src = __commonJS({ "../node_modules/.pnpm/debug@4.3.7/node_modules/debug/src/index.js"(exports2, module2) { if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { module2.exports = require_browser(); } else { module2.exports = require_node(); } } }); // ../node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/index.js var require_ee_first = __commonJS({ "../node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/index.js"(exports2, module2) { module2.exports = first; function first(stuff, done) { if (!Array.isArray(stuff)) throw new TypeError("arg must be an array of [ee, events...] arrays"); var cleanups = []; for (var i2 = 0; i2 < stuff.length; i2++) { var arr = stuff[i2]; if (!Array.isArray(arr) || arr.length < 2) throw new TypeError("each array member must be [ee, events...]"); var ee = arr[0]; for (var j = 1; j < arr.length; j++) { var event = arr[j]; var fn2 = listener(event, callback); ee.on(event, fn2); cleanups.push({ ee, event, fn: fn2 }); } } function callback() { cleanup(); done.apply(null, arguments); } function cleanup() { var x2; for (var i3 = 0; i3 < cleanups.length; i3++) { x2 = cleanups[i3]; x2.ee.removeListener(x2.event, x2.fn); } } function thunk(fn3) { done = fn3; } thunk.cancel = cleanup; return thunk; } function listener(event, done) { return function onevent(arg1) { var args2 = new Array(arguments.length); var ee = this; var err = event === "error" ? arg1 : null; for (var i2 = 0; i2 < args2.length; i2++) { args2[i2] = arguments[i2]; } done(err, ee, event, args2); }; } } }); // ../node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js var require_on_finished = __commonJS({ "../node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js"(exports2, module2) { module2.exports = onFinished; module2.exports.isFinished = isFinished; var asyncHooks = tryRequireAsyncHooks(); var first = require_ee_first(); var defer = typeof setImmediate === "function" ? setImmediate : function(fn2) { process.nextTick(fn2.bind.apply(fn2, arguments)); }; function onFinished(msg, listener) { if (isFinished(msg) !== false) { defer(listener, null, msg); return msg; } attachListener(msg, wrap(listener)); return msg; } function isFinished(msg) { var socket = msg.socket; if (typeof msg.finished === "boolean") { return Boolean(msg.finished || socket && !socket.writable); } if (typeof msg.complete === "boolean") { return Boolean(msg.upgrade || !socket || !socket.readable || msg.complete && !msg.readable); } return void 0; } function attachFinishedListener(msg, callback) { var eeMsg; var eeSocket; var finished = false; function onFinish(error) { eeMsg.cancel(); eeSocket.cancel(); finished = true; callback(error); } eeMsg = eeSocket = first([[msg, "end", "finish"]], onFinish); function onSocket(socket) { msg.removeListener("socket", onSocket); if (finished) return; if (eeMsg !== eeSocket) return; eeSocket = first([[socket, "error", "close"]], onFinish); } if (msg.socket) { onSocket(msg.socket); return; } msg.on("socket", onSocket); if (msg.socket === void 0) { patchAssignSocket(msg, onSocket); } } function attachListener(msg, listener) { var attached = msg.__onFinished; if (!attached || !attached.queue) { attached = msg.__onFinished = createListener(msg); attachFinishedListener(msg, attached); } attached.queue.push(listener); } function createListener(msg) { function listener(err) { if (msg.__onFinished === listener) msg.__onFinished = null; if (!listener.queue) return; var queue = listener.queue; listener.queue = null; for (var i2 = 0; i2 < queue.length; i2++) { queue[i2](err, msg); } } listener.queue = []; return listener; } function patchAssignSocket(res, callback) { var assignSocket = res.assignSocket; if (typeof assignSocket !== "function") return; res.assignSocket = function _assignSocket(socket) { assignSocket.call(this, socket); callback(socket); }; } function tryRequireAsyncHooks() { try { return require("async_hooks"); } catch (e2) { return {}; } } function wrap(fn2) { var res; if (asyncHooks.AsyncResource) { res = new asyncHooks.AsyncResource(fn2.name || "bound-anonymous-fn"); } if (!res || !res.runInAsyncScope) { return fn2; } return res.runInAsyncScope.bind(res, fn2, null); } } }); // ../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js var require_safe_buffer = __commonJS({ "../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports2, module2) { var buffer2 = require("buffer"); var Buffer4 = buffer2.Buffer; function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { module2.exports = buffer2; } else { copyProps(buffer2, exports2); exports2.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { return Buffer4(arg, encodingOrOffset, length); } SafeBuffer.prototype = Object.create(Buffer4.prototype); copyProps(Buffer4, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } return Buffer4(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } var buf = Buffer4(size); if (fill !== void 0) { if (typeof encoding === "string") { buf.fill(fill, encoding); } else { buf.fill(fill); } } else { buf.fill(0); } return buf; }; SafeBuffer.allocUnsafe = function(size) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } return Buffer4(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } return buffer2.SlowBuffer(size); }; } }); // ../node_modules/.pnpm/content-disposition@0.5.4/node_modules/content-disposition/index.js var require_content_disposition = __commonJS({ "../node_modules/.pnpm/content-disposition@0.5.4/node_modules/content-disposition/index.js"(exports2, module2) { module2.exports = contentDisposition; module2.exports.parse = parse; var basename = require("path").basename; var Buffer4 = require_safe_buffer().Buffer; var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g; var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/; var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g; var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g; var QESC_REGEXP = /\\([\u0000-\u007f])/g; var QUOTE_REGEXP = /([\\"])/g; var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g; var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/; var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/; var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/; var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/; function contentDisposition(filename, options) { var opts = options || {}; var type = opts.type || "attachment"; var params = createparams(filename, opts.fallback); return format(new ContentDisposition(type, params)); } function createparams(filename, fallback) { if (filename === void 0) { return; } var params = {}; if (typeof filename !== "string") { throw new TypeError("filename must be a string"); } if (fallback === void 0) { fallback = true; } if (typeof fallback !== "string" && typeof fallback !== "boolean") { throw new TypeError("fallback must be a string or boolean"); } if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) { throw new TypeError("fallback must be ISO-8859-1 string"); } var name = basename(filename); var isQuotedString = TEXT_REGEXP.test(name); var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name) : basename(fallback); var hasFallback = typeof fallbackName === "string" && fallbackName !== name; if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) { params["filename*"] = name; } if (isQuotedString || hasFallback) { params.filename = hasFallback ? fallbackName : name; } return params; } function format(obj) { var parameters = obj.parameters; var type = obj.type; if (!type || typeof type !== "string" || !TOKEN_REGEXP.test(type)) { throw new TypeError("invalid type"); } var string = String(type).toLowerCase(); if (parameters && typeof parameters === "object") { var param; var params = Object.keys(parameters).sort(); for (var i2 = 0; i2 < params.length; i2++) { param = params[i2]; var val = param.substr(-1) === "*" ? ustring(parameters[param]) : qstring(parameters[param]); string += "; " + param + "=" + val; } } return string; } function decodefield(str) { var match = EXT_VALUE_REGEXP.exec(str); if (!match) { throw new TypeError("invalid extended field value"); } var charset = match[1].toLowerCase(); var encoded = match[2]; var value; var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode); switch (charset) { case "iso-8859-1": value = getlatin1(binary); break; case "utf-8": value = Buffer4.from(binary, "binary").toString("utf8"); break; default: throw new TypeError("unsupported charset in extended field"); } return value; } function getlatin1(val) { return String(val).replace(NON_LATIN1_REGEXP, "?"); } function parse(string) { if (!string || typeof string !== "string") { throw new TypeError("argument string is required"); } var match = DISPOSITION_TYPE_REGEXP.exec(string); if (!match) { throw new TypeError("invalid type format"); } var index = match[0].length; var type = match[1].toLowerCase(); var key; var names = []; var params = {}; var value; index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ";" ? index - 1 : index; while (match = PARAM_REGEXP.exec(string)) { if (match.index !== index) { throw new TypeError("invalid parameter format"); } index += match[0].length; key = match[1].toLowerCase(); value = match[2]; if (names.indexOf(key) !== -1) { throw new TypeError("invalid duplicate parameter"); } names.push(key); if (key.indexOf("*") + 1 === key.length) { key = key.slice(0, -1); value = decodefield(value); params[key] = value; continue; } if (typeof params[key] === "string") { continue; } if (value[0] === '"') { value = value.substr(1, value.length - 2).replace(QESC_REGEXP, "$1"); } params[key] = value; } if (index !== -1 && index !== string.length) { throw new TypeError("invalid parameter format"); } return new ContentDisposition(type, params); } function pdecode(str, hex) { return String.fromCharCode(parseInt(hex, 16)); } function pencode(char) { return "%" + String(char).charCodeAt(0).toString(16).toUpperCase(); } function qstring(val) { var str = String(val); return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"'; } function ustring(val) { var str = String(val); var encoded = encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode); return "UTF-8''" + encoded; } function ContentDisposition(type, parameters) { this.type = type; this.parameters = parameters; } } }); // ../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json var require_db = __commonJS({ "../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json"(exports2, module2) { module2.exports = { "application/1d-interleaved-parityfec": { source: "iana" }, "application/3gpdash-qoe-report+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/3gpp-ims+xml": { source: "iana", compressible: true }, "application/3gpphal+json": { source: "iana", compressible: true }, "application/3gpphalforms+json": { source: "iana", compressible: true }, "application/a2l": { source: "iana" }, "application/ace+cbor": { source: "iana" }, "application/activemessage": { source: "iana" }, "application/activity+json": { source: "iana", compressible: true }, "application/alto-costmap+json": { source: "iana", compressible: true }, "application/alto-costmapfilter+json": { source: "iana", compressible: true }, "application/alto-directory+json": { source: "iana", compressible: true }, "application/alto-endpointcost+json": { source: "iana", compressible: true }, "application/alto-endpointcostparams+json": { source: "iana", compressible: true }, "application/alto-endpointprop+json": { source: "iana", compressible: true }, "application/alto-endpointpropparams+json": { source: "iana", compressible: true }, "application/alto-error+json": { source: "iana", compressible: true }, "application/alto-networkmap+json": { source: "iana", compressible: true }, "application/alto-networkmapfilter+json": { source: "iana", compressible: true }, "application/alto-updatestreamcontrol+json": { source: "iana", compressible: true }, "application/alto-updatestreamparams+json": { source: "iana", compressible: true }, "application/aml": { source: "iana" }, "application/andrew-inset": { source: "iana", extensions: ["ez"] }, "application/applefile": { source: "iana" }, "application/applixware": { source: "apache", extensions: ["aw"] }, "application/at+jwt": { source: "iana" }, "application/atf": { source: "iana" }, "application/atfx": { source: "iana" }, "application/atom+xml": { source: "iana", compressible: true, extensions: ["atom"] }, "application/atomcat+xml": { source: "iana", compressible: true, extensions: ["atomcat"] }, "application/atomdeleted+xml": { source: "iana", compressible: true, extensions: ["atomdeleted"] }, "application/atomicmail": { source: "iana" }, "application/atomsvc+xml": { source: "iana", compressible: true, extensions: ["atomsvc"] }, "application/atsc-dwd+xml": { source: "iana", compressible: true, extensions: ["dwd"] }, "application/atsc-dynamic-event-message": { source: "iana" }, "application/atsc-held+xml": { source: "iana", compressible: true, extensions: ["held"] }, "application/atsc-rdt+json": { source: "iana", compressible: true }, "application/atsc-rsat+xml": { source: "iana", compressible: true, extensions: ["rsat"] }, "application/atxml": { source: "iana" }, "application/auth-policy+xml": { source: "iana", compressible: true }, "application/bacnet-xdd+zip": { source: "iana", compressible: false }, "application/batch-smtp": { source: "iana" }, "application/bdoc": { compressible: false, extensions: ["bdoc"] }, "application/beep+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/calendar+json": { source: "iana", compressible: true }, "application/calendar+xml": { source: "iana", compressible: true, extensions: ["xcs"] }, "application/call-completion": { source: "iana" }, "application/cals-1840": { source: "iana" }, "application/captive+json": { source: "iana", compressible: true }, "application/cbor": { source: "iana" }, "application/cbor-seq": { source: "iana" }, "application/cccex": { source: "iana" }, "application/ccmp+xml": { source: "iana", compressible: true }, "application/ccxml+xml": { source: "iana", compressible: true, extensions: ["ccxml"] }, "application/cdfx+xml": { source: "iana", compressible: true, extensions: ["cdfx"] }, "application/cdmi-capability": { source: "iana", extensions: ["cdmia"] }, "application/cdmi-container": { source: "iana", extensions: ["cdmic"] }, "application/cdmi-domain": { source: "iana", extensions: ["cdmid"] }, "application/cdmi-object": { source: "iana", extensions: ["cdmio"] }, "application/cdmi-queue": { source: "iana", extensions: ["cdmiq"] }, "application/cdni": { source: "iana" }, "application/cea": { source: "iana" }, "application/cea-2018+xml": { source: "iana", compressible: true }, "application/cellml+xml": { source: "iana", compressible: true }, "application/cfw": { source: "iana" }, "application/city+json": { source: "iana", compressible: true }, "application/clr": { source: "iana" }, "application/clue+xml": { source: "iana", compressible: true }, "application/clue_info+xml": { source: "iana", compressible: true }, "application/cms": { source: "iana" }, "application/cnrp+xml": { source: "iana", compressible: true }, "application/coap-group+json": { source: "iana", compressible: true }, "application/coap-payload": { source: "iana" }, "application/commonground": { source: "iana" }, "application/conference-info+xml": { source: "iana", compressible: true }, "application/cose": { source: "iana" }, "application/cose-key": { source: "iana" }, "application/cose-key-set": { source: "iana" }, "application/cpl+xml": { source: "iana", compressible: true, extensions: ["cpl"] }, "application/csrattrs": { source: "iana" }, "application/csta+xml": { source: "iana", compressible: true }, "application/cstadata+xml": { source: "iana", compressible: true }, "application/csvm+json": { source: "iana", compressible: true }, "application/cu-seeme": { source: "apache", extensions: ["cu"] }, "application/cwt": { source: "iana" }, "application/cybercash": { source: "iana" }, "application/dart": { compressible: true }, "application/dash+xml": { source: "iana", compressible: true, extensions: ["mpd"] }, "application/dash-patch+xml": { source: "iana", compressible: true, extensions: ["mpp"] }, "application/dashdelta": { source: "iana" }, "application/davmount+xml": { source: "iana", compressible: true, extensions: ["davmount"] }, "application/dca-rft": { source: "iana" }, "application/dcd": { source: "iana" }, "application/dec-dx": { source: "iana" }, "application/dialog-info+xml": { source: "iana", compressible: true }, "application/dicom": { source: "iana" }, "application/dicom+json": { source: "iana", compressible: true }, "application/dicom+xml": { source: "iana", compressible: true }, "application/dii": { source: "iana" }, "application/dit": { source: "iana" }, "application/dns": { source: "iana" }, "application/dns+json": { source: "iana", compressible: true }, "application/dns-message": { source: "iana" }, "application/docbook+xml": { source: "apache", compressible: true, extensions: ["dbk"] }, "application/dots+cbor": { source: "iana" }, "application/dskpp+xml": { source: "iana", compressible: true }, "application/dssc+der": { source: "iana", extensions: ["dssc"] }, "application/dssc+xml": { source: "iana", compressible: true, extensions: ["xdssc"] }, "application/dvcs": { source: "iana" }, "application/ecmascript": { source: "iana", compressible: true, extensions: ["es", "ecma"] }, "application/edi-consent": { source: "iana" }, "application/edi-x12": { source: "iana", compressible: false }, "application/edifact": { source: "iana", compressible: false }, "application/efi": { source: "iana" }, "application/elm+json": { source: "iana", charset: "UTF-8", compressible: true }, "application/elm+xml": { source: "iana", compressible: true }, "application/emergencycalldata.cap+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/emergencycalldata.comment+xml": { source: "iana", compressible: true }, "application/emergencycalldata.control+xml": { source: "iana", compressible: true }, "application/emergencycalldata.deviceinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.ecall.msd": { source: "iana" }, "application/emergencycalldata.providerinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.serviceinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.subscriberinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.veds+xml": { source: "iana", compressible: true }, "application/emma+xml": { source: "iana", compressible: true, extensions: ["emma"] }, "application/emotionml+xml": { source: "iana", compressible: true, extensions: ["emotionml"] }, "application/encaprtp": { source: "iana" }, "application/epp+xml": { source: "iana", compressible: true }, "application/epub+zip": { source: "iana", compressible: false, extensions: ["epub"] }, "application/eshop": { source: "iana" }, "application/exi": { source: "iana", extensions: ["exi"] }, "application/expect-ct-report+json": { source: "iana", compressible: true }, "application/express": { source: "iana", extensions: ["exp"] }, "application/fastinfoset": { source: "iana" }, "application/fastsoap": { source: "iana" }, "application/fdt+xml": { source: "iana", compressible: true, extensions: ["fdt"] }, "application/fhir+json": { source: "iana", charset: "UTF-8", compressible: true }, "application/fhir+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/fido.trusted-apps+json": { compressible: true }, "application/fits": { source: "iana" }, "application/flexfec": { source: "iana" }, "application/font-sfnt": { source: "iana" }, "application/font-tdpfr": { source: "iana", extensions: ["pfr"] }, "application/font-woff": { source: "iana", compressible: false }, "application/framework-attributes+xml": { source: "iana", compressible: true }, "application/geo+json": { source: "iana", compressible: true, extensions: ["geojson"] }, "application/geo+json-seq": { source: "iana" }, "application/geopackage+sqlite3": { source: "iana" }, "application/geoxacml+xml": { source: "iana", compressible: true }, "application/gltf-buffer": { source: "iana" }, "application/gml+xml": { source: "iana", compressible: true, extensions: ["gml"] }, "application/gpx+xml": { source: "apache", compressible: true, extensions: ["gpx"] }, "application/gxf": { source: "apache", extensions: ["gxf"] }, "application/gzip": { source: "iana", compressible: false, extensions: ["gz"] }, "application/h224": { source: "iana" }, "application/held+xml": { source: "iana", compressible: true }, "application/hjson": { extensions: ["hjson"] }, "application/http": { source: "iana" }, "application/hyperstudio": { source: "iana", extensions: ["stk"] }, "application/ibe-key-request+xml": { source: "iana", compressible: true }, "application/ibe-pkg-reply+xml": { source: "iana", compressible: true }, "application/ibe-pp-data": { source: "iana" }, "application/iges": { source: "iana" }, "application/im-iscomposing+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/index": { source: "iana" }, "application/index.cmd": { source: "iana" }, "application/index.obj": { source: "iana" }, "application/index.response": { source: "iana" }, "application/index.vnd": { source: "iana" }, "application/inkml+xml": { source: "iana", compressible: true, extensions: ["ink", "inkml"] }, "application/iotp": { source: "iana" }, "application/ipfix": { source: "iana", extensions: ["ipfix"] }, "application/ipp": { source: "iana" }, "application/isup": { source: "iana" }, "application/its+xml": { source: "iana", compressible: true, extensions: ["its"] }, "application/java-archive": { source: "apache", compressible: false, extensions: ["jar", "war", "ear"] }, "application/java-serialized-object": { source: "apache", compressible: false, extensions: ["ser"] }, "application/java-vm": { source: "apache", compressible: false, extensions: ["class"] }, "application/javascript": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["js", "mjs"] }, "application/jf2feed+json": { source: "iana", compressible: true }, "application/jose": { source: "iana" }, "application/jose+json": { source: "iana", compressible: true }, "application/jrd+json": { source: "iana", compressible: true }, "application/jscalendar+json": { source: "iana", compressible: true }, "application/json": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["json", "map"] }, "application/json-patch+json": { source: "iana", compressible: true }, "application/json-seq": { source: "iana" }, "application/json5": { extensions: ["json5"] }, "application/jsonml+json": { source: "apache", compressible: true, extensions: ["jsonml"] }, "application/jwk+json": { source: "iana", compressible: true }, "application/jwk-set+json": { source: "iana", compressible: true }, "application/jwt": { source: "iana" }, "application/kpml-request+xml": { source: "iana", compressible: true }, "application/kpml-response+xml": { source: "iana", compressible: true }, "application/ld+json": { source: "iana", compressible: true, extensions: ["jsonld"] }, "application/lgr+xml": { source: "iana", compressible: true, extensions: ["lgr"] }, "application/link-format": { source: "iana" }, "application/load-control+xml": { source: "iana", compressible: true }, "application/lost+xml": { source: "iana", compressible: true, extensions: ["lostxml"] }, "application/lostsync+xml": { source: "iana", compressible: true }, "application/lpf+zip": { source: "iana", compressible: false }, "application/lxf": { source: "iana" }, "application/mac-binhex40": { source: "iana", extensions: ["hqx"] }, "application/mac-compactpro": { source: "apache", extensions: ["cpt"] }, "application/macwriteii": { source: "iana" }, "application/mads+xml": { source: "iana", compressible: true, extensions: ["mads"] }, "application/manifest+json": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["webmanifest"] }, "application/marc": { source: "iana", extensions: ["mrc"] }, "application/marcxml+xml": { source: "iana", compressible: true, extensions: ["mrcx"] }, "application/mathematica": { source: "iana", extensions: ["ma", "nb", "mb"] }, "application/mathml+xml": { source: "iana", compressible: true, extensions: ["mathml"] }, "application/mathml-content+xml": { source: "iana", compressible: true }, "application/mathml-presentation+xml": { source: "iana", compressible: true }, "application/mbms-associated-procedure-description+xml": { source: "iana", compressible: true }, "application/mbms-deregister+xml": { source: "iana", compressible: true }, "application/mbms-envelope+xml": { source: "iana", compressible: true }, "application/mbms-msk+xml": { source: "iana", compressible: true }, "application/mbms-msk-response+xml": { source: "iana", compressible: true }, "application/mbms-protection-description+xml": { source: "iana", compressible: true }, "application/mbms-reception-report+xml": { source: "iana", compressible: true }, "application/mbms-register+xml": { source: "iana", compressible: true }, "application/mbms-register-response+xml": { source: "iana", compressible: true }, "application/mbms-schedule+xml": { source: "iana", compressible: true }, "application/mbms-user-service-description+xml": { source: "iana", compressible: true }, "application/mbox": { source: "iana", extensions: ["mbox"] }, "application/media-policy-dataset+xml": { source: "iana", compressible: true, extensions: ["mpf"] }, "application/media_control+xml": { source: "iana", compressible: true }, "application/mediaservercontrol+xml": { source: "iana", compressible: true, extensions: ["mscml"] }, "application/merge-patch+json": { source: "iana", compressible: true }, "application/metalink+xml": { source: "apache", compressible: true, extensions: ["metalink"] }, "application/metalink4+xml": { source: "iana", compressible: true, extensions: ["meta4"] }, "application/mets+xml": { source: "iana", compressible: true, extensions: ["mets"] }, "application/mf4": { source: "iana" }, "application/mikey": { source: "iana" }, "application/mipc": { source: "iana" }, "application/missing-blocks+cbor-seq": { source: "iana" }, "application/mmt-aei+xml": { source: "iana", compressible: true, extensions: ["maei"] }, "application/mmt-usd+xml": { source: "iana", compressible: true, extensions: ["musd"] }, "application/mods+xml": { source: "iana", compressible: true, extensions: ["mods"] }, "application/moss-keys": { source: "iana" }, "application/moss-signature": { source: "iana" }, "application/mosskey-data": { source: "iana" }, "application/mosskey-request": { source: "iana" }, "application/mp21": { source: "iana", extensions: ["m21", "mp21"] }, "application/mp4": { source: "iana", extensions: ["mp4s", "m4p"] }, "application/mpeg4-generic": { source: "iana" }, "application/mpeg4-iod": { source: "iana" }, "application/mpeg4-iod-xmt": { source: "iana" }, "application/mrb-consumer+xml": { source: "iana", compressible: true }, "application/mrb-publish+xml": { source: "iana", compressible: true }, "application/msc-ivr+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/msc-mixer+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/msword": { source: "iana", compressible: false, extensions: ["doc", "dot"] }, "application/mud+json": { source: "iana", compressible: true }, "application/multipart-core": { source: "iana" }, "application/mxf": { source: "iana", extensions: ["mxf"] }, "application/n-quads": { source: "iana", extensions: ["nq"] }, "application/n-triples": { source: "iana", extensions: ["nt"] }, "application/nasdata": { source: "iana" }, "application/news-checkgroups": { source: "iana", charset: "US-ASCII" }, "application/news-groupinfo": { source: "iana", charset: "US-ASCII" }, "application/news-transmission": { source: "iana" }, "application/nlsml+xml": { source: "iana", compressible: true }, "application/node": { source: "iana", extensions: ["cjs"] }, "application/nss": { source: "iana" }, "application/oauth-authz-req+jwt": { source: "iana" }, "application/oblivious-dns-message": { source: "iana" }, "application/ocsp-request": { source: "iana" }, "application/ocsp-response": { source: "iana" }, "application/octet-stream": { source: "iana", compressible: false, extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] }, "application/oda": { source: "iana", extensions: ["oda"] }, "application/odm+xml": { source: "iana", compressible: true }, "application/odx": { source: "iana" }, "application/oebps-package+xml": { source: "iana", compressible: true, extensions: ["opf"] }, "application/ogg": { source: "iana", compressible: false, extensions: ["ogx"] }, "application/omdoc+xml": { source: "apache", compressible: true, extensions: ["omdoc"] }, "application/onenote": { source: "apache", extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] }, "application/opc-nodeset+xml": { source: "iana", compressible: true }, "application/oscore": { source: "iana" }, "application/oxps": { source: "iana", extensions: ["oxps"] }, "application/p21": { source: "iana" }, "application/p21+zip": { source: "iana", compressible: false }, "application/p2p-overlay+xml": { source: "iana", compressible: true, extensions: ["relo"] }, "application/parityfec": { source: "iana" }, "application/passport": { source: "iana" }, "application/patch-ops-error+xml": { source: "iana", compressible: true, extensions: ["xer"] }, "application/pdf": { source: "iana", compressible: false, extensions: ["pdf"] }, "application/pdx": { source: "iana" }, "application/pem-certificate-chain": { source: "iana" }, "application/pgp-encrypted": { source: "iana", compressible: false, extensions: ["pgp"] }, "application/pgp-keys": { source: "iana", extensions: ["asc"] }, "application/pgp-signature": { source: "iana", extensions: ["asc", "sig"] }, "application/pics-rules": { source: "apache", extensions: ["prf"] }, "application/pidf+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/pidf-diff+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/pkcs10": { source: "iana", extensions: ["p10"] }, "application/pkcs12": { source: "iana" }, "application/pkcs7-mime": { source: "iana", extensions: ["p7m", "p7c"] }, "application/pkcs7-signature": { source: "iana", extensions: ["p7s"] }, "application/pkcs8": { source: "iana", extensions: ["p8"] }, "application/pkcs8-encrypted": { source: "iana" }, "application/pkix-attr-cert": { source: "iana", extensions: ["ac"] }, "application/pkix-cert": { source: "iana", extensions: ["cer"] }, "application/pkix-crl": { source: "iana", extensions: ["crl"] }, "application/pkix-pkipath": { source: "iana", extensions: ["pkipath"] }, "application/pkixcmp": { source: "iana", extensions: ["pki"] }, "application/pls+xml": { source: "iana", compressible: true, extensions: ["pls"] }, "application/poc-settings+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/postscript": { source: "iana", compressible: true, extensions: ["ai", "eps", "ps"] }, "application/ppsp-tracker+json": { source: "iana", compressible: true }, "application/problem+json": { source: "iana", compressible: true }, "application/problem+xml": { source: "iana", compressible: true }, "application/provenance+xml": { source: "iana", compressible: true, extensions: ["provx"] }, "application/prs.alvestrand.titrax-sheet": { source: "iana" }, "application/prs.cww": { source: "iana", extensions: ["cww"] }, "application/prs.cyn": { source: "iana", charset: "7-BIT" }, "application/prs.hpub+zip": { source: "iana", compressible: false }, "application/prs.nprend": { source: "iana" }, "application/prs.plucker": { source: "iana" }, "application/prs.rdf-xml-crypt": { source: "iana" }, "application/prs.xsf+xml": { source: "iana", compressible: true }, "application/pskc+xml": { source: "iana", compressible: true, extensions: ["pskcxml"] }, "application/pvd+json": { source: "iana", compressible: true }, "application/qsig": { source: "iana" }, "application/raml+yaml": { compressible: true, extensions: ["raml"] }, "application/raptorfec": { source: "iana" }, "application/rdap+json": { source: "iana", compressible: true }, "application/rdf+xml": { source: "iana", compressible: true, extensions: ["rdf", "owl"] }, "application/reginfo+xml": { source: "iana", compressible: true, extensions: ["rif"] }, "application/relax-ng-compact-syntax": { source: "iana", extensions: ["rnc"] }, "application/remote-printing": { source: "iana" }, "application/reputon+json": { source: "iana", compressible: true }, "application/resource-lists+xml": { source: "iana", compressible: true, extensions: ["rl"] }, "application/resource-lists-diff+xml": { source: "iana", compressible: true, extensions: ["rld"] }, "application/rfc+xml": { source: "iana", compressible: true }, "application/riscos": { source: "iana" }, "application/rlmi+xml": { source: "iana", compressible: true }, "application/rls-services+xml": { source: "iana", compressible: true, extensions: ["rs"] }, "application/route-apd+xml": { source: "iana", compressible: true, extensions: ["rapd"] }, "application/route-s-tsid+xml": { source: "iana", compressible: true, extensions: ["sls"] }, "application/route-usd+xml": { source: "iana", compressible: true, extensions: ["rusd"] }, "application/rpki-ghostbusters": { source: "iana", extensions: ["gbr"] }, "application/rpki-manifest": { source: "iana", extensions: ["mft"] }, "application/rpki-publication": { source: "iana" }, "application/rpki-roa": { source: "iana", extensions: ["roa"] }, "application/rpki-updown": { source: "iana" }, "application/rsd+xml": { source: "apache", compressible: true, extensions: ["rsd"] }, "application/rss+xml": { source: "apache", compressible: true, extensions: ["rss"] }, "application/rtf": { source: "iana", compressible: true, extensions: ["rtf"] }, "application/rtploopback": { source: "iana" }, "application/rtx": { source: "iana" }, "application/samlassertion+xml": { source: "iana", compressible: true }, "application/samlmetadata+xml": { source: "iana", compressible: true }, "application/sarif+json": { source: "iana", compressible: true }, "application/sarif-external-properties+json": { source: "iana", compressible: true }, "application/sbe": { source: "iana" }, "application/sbml+xml": { source: "iana", compressible: true, extensions: ["sbml"] }, "application/scaip+xml": { source: "iana", compressible: true }, "application/scim+json": { source: "iana", compressible: true }, "application/scvp-cv-request": { source: "iana", extensions: ["scq"] }, "application/scvp-cv-response": { source: "iana", extensions: ["scs"] }, "application/scvp-vp-request": { source: "iana", extensions: ["spq"] }, "application/scvp-vp-response": { source: "iana", extensions: ["spp"] }, "application/sdp": { source: "iana", extensions: ["sdp"] }, "application/secevent+jwt": { source: "iana" }, "application/senml+cbor": { source: "iana" }, "application/senml+json": { source: "iana", compressible: true }, "application/senml+xml": { source: "iana", compressible: true, extensions: ["senmlx"] }, "application/senml-etch+cbor": { source: "iana" }, "application/senml-etch+json": { source: "iana", compressible: true }, "application/senml-exi": { source: "iana" }, "application/sensml+cbor": { source: "iana" }, "application/sensml+json": { source: "iana", compressible: true }, "application/sensml+xml": { source: "iana", compressible: true, extensions: ["sensmlx"] }, "application/sensml-exi": { source: "iana" }, "application/sep+xml": { source: "iana", compressible: true }, "application/sep-exi": { source: "iana" }, "application/session-info": { source: "iana" }, "application/set-payment": { source: "iana" }, "application/set-payment-initiation": { source: "iana", extensions: ["setpay"] }, "application/set-registration": { source: "iana" }, "application/set-registration-initiation": { source: "iana", extensions: ["setreg"] }, "application/sgml": { source: "iana" }, "application/sgml-open-catalog": { source: "iana" }, "application/shf+xml": { source: "iana", compressible: true, extensions: ["shf"] }, "application/sieve": { source: "iana", extensions: ["siv", "sieve"] }, "application/simple-filter+xml": { source: "iana", compressible: true }, "application/simple-message-summary": { source: "iana" }, "application/simplesymbolcontainer": { source: "iana" }, "application/sipc": { source: "iana" }, "application/slate": { source: "iana" }, "application/smil": { source: "iana" }, "application/smil+xml": { source: "iana", compressible: true, extensions: ["smi", "smil"] }, "application/smpte336m": { source: "iana" }, "application/soap+fastinfoset": { source: "iana" }, "application/soap+xml": { source: "iana", compressible: true }, "application/sparql-query": { source: "iana", extensions: ["rq"] }, "application/sparql-results+xml": { source: "iana", compressible: true, extensions: ["srx"] }, "application/spdx+json": { source: "iana", compressible: true }, "application/spirits-event+xml": { source: "iana", compressible: true }, "application/sql": { source: "iana" }, "application/srgs": { source: "iana", extensions: ["gram"] }, "application/srgs+xml": { source: "iana", compressible: true, extensions: ["grxml"] }, "application/sru+xml": { source: "iana", compressible: true, extensions: ["sru"] }, "application/ssdl+xml": { source: "apache", compressible: true, extensions: ["ssdl"] }, "application/ssml+xml": { source: "iana", compressible: true, extensions: ["ssml"] }, "application/stix+json": { source: "iana", compressible: true }, "application/swid+xml": { source: "iana", compressible: true, extensions: ["swidtag"] }, "application/tamp-apex-update": { source: "iana" }, "application/tamp-apex-update-confirm": { source: "iana" }, "application/tamp-community-update": { source: "iana" }, "application/tamp-community-update-confirm": { source: "iana" }, "application/tamp-error": { source: "iana" }, "application/tamp-sequence-adjust": { source: "iana" }, "application/tamp-sequence-adjust-confirm": { source: "iana" }, "application/tamp-status-query": { source: "iana" }, "application/tamp-status-response": { source: "iana" }, "application/tamp-update": { source: "iana" }, "application/tamp-update-confirm": { source: "iana" }, "application/tar": { compressible: true }, "application/taxii+json": { source: "iana", compressible: true }, "application/td+json": { source: "iana", compressible: true }, "application/tei+xml": { source: "iana", compressible: true, extensions: ["tei", "teicorpus"] }, "application/tetra_isi": { source: "iana" }, "application/thraud+xml": { source: "iana", compressible: true, extensions: ["tfi"] }, "application/timestamp-query": { source: "iana" }, "application/timestamp-reply": { source: "iana" }, "application/timestamped-data": { source: "iana", extensions: ["tsd"] }, "application/tlsrpt+gzip": { source: "iana" }, "application/tlsrpt+json": { source: "iana", compressible: true }, "application/tnauthlist": { source: "iana" }, "application/token-introspection+jwt": { source: "iana" }, "application/toml": { compressible: true, extensions: ["toml"] }, "application/trickle-ice-sdpfrag": { source: "iana" }, "application/trig": { source: "iana", extensions: ["trig"] }, "application/ttml+xml": { source: "iana", compressible: true, extensions: ["ttml"] }, "application/tve-trigger": { source: "iana" }, "application/tzif": { source: "iana" }, "application/tzif-leap": { source: "iana" }, "application/ubjson": { compressible: false, extensions: ["ubj"] }, "application/ulpfec": { source: "iana" }, "application/urc-grpsheet+xml": { source: "iana", compressible: true }, "application/urc-ressheet+xml": { source: "iana", compressible: true, extensions: ["rsheet"] }, "application/urc-targetdesc+xml": { source: "iana", compressible: true, extensions: ["td"] }, "application/urc-uisocketdesc+xml": { source: "iana", compressible: true }, "application/vcard+json": { source: "iana", compressible: true }, "application/vcard+xml": { source: "iana", compressible: true }, "application/vemmi": { source: "iana" }, "application/vividence.scriptfile": { source: "apache" }, "application/vnd.1000minds.decision-model+xml": { source: "iana", compressible: true, extensions: ["1km"] }, "application/vnd.3gpp-prose+xml": { source: "iana", compressible: true }, "application/vnd.3gpp-prose-pc3ch+xml": { source: "iana", compressible: true }, "application/vnd.3gpp-v2x-local-service-information": { source: "iana" }, "application/vnd.3gpp.5gnas": { source: "iana" }, "application/vnd.3gpp.access-transfer-events+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.bsf+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.gmop+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.gtpc": { source: "iana" }, "application/vnd.3gpp.interworking-data": { source: "iana" }, "application/vnd.3gpp.lpp": { source: "iana" }, "application/vnd.3gpp.mc-signalling-ear": { source: "iana" }, "application/vnd.3gpp.mcdata-affiliation-command+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcdata-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcdata-payload": { source: "iana" }, "application/vnd.3gpp.mcdata-service-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcdata-signalling": { source: "iana" }, "application/vnd.3gpp.mcdata-ue-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcdata-user-profile+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-affiliation-command+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-floor-request+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-location-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-service-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-signed+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-ue-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-ue-init-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-user-profile+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-affiliation-command+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-affiliation-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-location-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-service-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-transmission-request+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-ue-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-user-profile+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mid-call+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.ngap": { source: "iana" }, "application/vnd.3gpp.pfcp": { source: "iana" }, "application/vnd.3gpp.pic-bw-large": { source: "iana", extensions: ["plb"] }, "application/vnd.3gpp.pic-bw-small": { source: "iana", extensions: ["psb"] }, "application/vnd.3gpp.pic-bw-var": { source: "iana", extensions: ["pvb"] }, "application/vnd.3gpp.s1ap": { source: "iana" }, "application/vnd.3gpp.sms": { source: "iana" }, "application/vnd.3gpp.sms+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.srvcc-ext+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.srvcc-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.state-and-event-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.ussd+xml": { source: "iana", compressible: true }, "application/vnd.3gpp2.bcmcsinfo+xml": { source: "iana", compressible: true }, "application/vnd.3gpp2.sms": { source: "iana" }, "application/vnd.3gpp2.tcap": { source: "iana", extensions: ["tcap"] }, "application/vnd.3lightssoftware.imagescal": { source: "iana" }, "application/vnd.3m.post-it-notes": { source: "iana", extensions: ["pwn"] }, "application/vnd.accpac.simply.aso": { source: "iana", extensions: ["aso"] }, "application/vnd.accpac.simply.imp": { source: "iana", extensions: ["imp"] }, "application/vnd.acucobol": { source: "iana", extensions: ["acu"] }, "application/vnd.acucorp": { source: "iana", extensions: ["atc", "acutc"] }, "application/vnd.adobe.air-application-installer-package+zip": { source: "apache", compressible: false, extensions: ["air"] }, "application/vnd.adobe.flash.movie": { source: "iana" }, "application/vnd.adobe.formscentral.fcdt": { source: "iana", extensions: ["fcdt"] }, "application/vnd.adobe.fxp": { source: "iana", extensions: ["fxp", "fxpl"] }, "application/vnd.adobe.partial-upload": { source: "iana" }, "application/vnd.adobe.xdp+xml": { source: "iana", compressible: true, extensions: ["xdp"] }, "application/vnd.adobe.xfdf": { source: "iana", extensions: ["xfdf"] }, "application/vnd.aether.imp": { source: "iana" }, "application/vnd.afpc.afplinedata": { source: "iana" }, "application/vnd.afpc.afplinedata-pagedef": { source: "iana" }, "application/vnd.afpc.cmoca-cmresource": { source: "iana" }, "application/vnd.afpc.foca-charset": { source: "iana" }, "application/vnd.afpc.foca-codedfont": { source: "iana" }, "application/vnd.afpc.foca-codepage": { source: "iana" }, "application/vnd.afpc.modca": { source: "iana" }, "application/vnd.afpc.modca-cmtable": { source: "iana" }, "application/vnd.afpc.modca-formdef": { source: "iana" }, "application/vnd.afpc.modca-mediummap": { source: "iana" }, "application/vnd.afpc.modca-objectcontainer": { source: "iana" }, "application/vnd.afpc.modca-overlay": { source: "iana" }, "application/vnd.afpc.modca-pagesegment": { source: "iana" }, "application/vnd.age": { source: "iana", extensions: ["age"] }, "application/vnd.ah-barcode": { source: "iana" }, "application/vnd.ahead.space": { source: "iana", extensions: ["ahead"] }, "application/vnd.airzip.filesecure.azf": { source: "iana", extensions: ["azf"] }, "application/vnd.airzip.filesecure.azs": { source: "iana", extensions: ["azs"] }, "application/vnd.amadeus+json": { source: "iana", compressible: true }, "application/vnd.amazon.ebook": { source: "apache", extensions: ["azw"] }, "application/vnd.amazon.mobi8-ebook": { source: "iana" }, "application/vnd.americandynamics.acc": { source: "iana", extensions: ["acc"] }, "application/vnd.amiga.ami": { source: "iana", extensions: ["ami"] }, "application/vnd.amundsen.maze+xml": { source: "iana", compressible: true }, "application/vnd.android.ota": { source: "iana" }, "application/vnd.android.package-archive": { source: "apache", compressible: false, extensions: ["apk"] }, "application/vnd.anki": { source: "iana" }, "application/vnd.anser-web-certificate-issue-initiation": { source: "iana", extensions: ["cii"] }, "application/vnd.anser-web-funds-transfer-initiation": { source: "apache", extensions: ["fti"] }, "application/vnd.antix.game-component": { source: "iana", extensions: ["atx"] }, "application/vnd.apache.arrow.file": { source: "iana" }, "application/vnd.apache.arrow.stream": { source: "iana" }, "application/vnd.apache.thrift.binary": { source: "iana" }, "application/vnd.apache.thrift.compact": { source: "iana" }, "application/vnd.apache.thrift.json": { source: "iana" }, "application/vnd.api+json": { source: "iana", compressible: true }, "application/vnd.aplextor.warrp+json": { source: "iana", compressible: true }, "application/vnd.apothekende.reservation+json": { source: "iana", compressible: true }, "application/vnd.apple.installer+xml": { source: "iana", compressible: true, extensions: ["mpkg"] }, "application/vnd.apple.keynote": { source: "iana", extensions: ["key"] }, "application/vnd.apple.mpegurl": { source: "iana", extensions: ["m3u8"] }, "application/vnd.apple.numbers": { source: "iana", extensions: ["numbers"] }, "application/vnd.apple.pages": { source: "iana", extensions: ["pages"] }, "application/vnd.apple.pkpass": { compressible: false, extensions: ["pkpass"] }, "application/vnd.arastra.swi": { source: "iana" }, "application/vnd.aristanetworks.swi": { source: "iana", extensions: ["swi"] }, "application/vnd.artisan+json": { source: "iana", compressible: true }, "application/vnd.artsquare": { source: "iana" }, "application/vnd.astraea-software.iota": { source: "iana", extensions: ["iota"] }, "application/vnd.audiograph": { source: "iana", extensions: ["aep"] }, "application/vnd.autopackage": { source: "iana" }, "application/vnd.avalon+json": { source: "iana", compressible: true }, "application/vnd.avistar+xml": { source: "iana", compressible: true }, "application/vnd.balsamiq.bmml+xml": { source: "iana", compressible: true, extensions: ["bmml"] }, "application/vnd.balsamiq.bmpr": { source: "iana" }, "application/vnd.banana-accounting": { source: "iana" }, "application/vnd.bbf.usp.error": { source: "iana" }, "application/vnd.bbf.usp.msg": { source: "iana" }, "application/vnd.bbf.usp.msg+json": { source: "iana", compressible: true }, "application/vnd.bekitzur-stech+json": { source: "iana", compressible: true }, "application/vnd.bint.med-content": { source: "iana" }, "application/vnd.biopax.rdf+xml": { source: "iana", compressible: true }, "application/vnd.blink-idb-value-wrapper": { source: "iana" }, "application/vnd.blueice.multipass": { source: "iana", extensions: ["mpm"] }, "application/vnd.bluetooth.ep.oob": { source: "iana" }, "application/vnd.bluetooth.le.oob": { source: "iana" }, "application/vnd.bmi": { source: "iana", extensions: ["bmi"] }, "application/vnd.bpf": { source: "iana" }, "application/vnd.bpf3": { source: "iana" }, "application/vnd.businessobjects": { source: "iana", extensions: ["rep"] }, "application/vnd.byu.uapi+json": { source: "iana", compressible: true }, "application/vnd.cab-jscript": { source: "iana" }, "application/vnd.canon-cpdl": { source: "iana" }, "application/vnd.canon-lips": { source: "iana" }, "application/vnd.capasystems-pg+json": { source: "iana", compressible: true }, "application/vnd.cendio.thinlinc.clientconf": { source: "iana" }, "application/vnd.century-systems.tcp_stream": { source: "iana" }, "application/vnd.chemdraw+xml": { source: "iana", compressible: true, extensions: ["cdxml"] }, "application/vnd.chess-pgn": { source: "iana" }, "application/vnd.chipnuts.karaoke-mmd": { source: "iana", extensions: ["mmd"] }, "application/vnd.ciedi": { source: "iana" }, "application/vnd.cinderella": { source: "iana", extensions: ["cdy"] }, "application/vnd.cirpack.isdn-ext": { source: "iana" }, "application/vnd.citationstyles.style+xml": { source: "iana", compressible: true, extensions: ["csl"] }, "application/vnd.claymore": { source: "iana", extensions: ["cla"] }, "application/vnd.cloanto.rp9": { source: "iana", extensions: ["rp9"] }, "application/vnd.clonk.c4group": { source: "iana", extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] }, "application/vnd.cluetrust.cartomobile-config": { source: "iana", extensions: ["c11amc"] }, "application/vnd.cluetrust.cartomobile-config-pkg": { source: "iana", extensions: ["c11amz"] }, "application/vnd.coffeescript": { source: "iana" }, "application/vnd.collabio.xodocuments.document": { source: "iana" }, "application/vnd.collabio.xodocuments.document-template": { source: "iana" }, "application/vnd.collabio.xodocuments.presentation": { source: "iana" }, "application/vnd.collabio.xodocuments.presentation-template": { source: "iana" }, "application/vnd.collabio.xodocuments.spreadsheet": { source: "iana" }, "application/vnd.collabio.xodocuments.spreadsheet-template": { source: "iana" }, "application/vnd.collection+json": { source: "iana", compressible: true }, "application/vnd.collection.doc+json": { source: "iana", compressible: true }, "application/vnd.collection.next+json": { source: "iana", compressible: true }, "application/vnd.comicbook+zip": { source: "iana", compressible: false }, "application/vnd.comicbook-rar": { source: "iana" }, "application/vnd.commerce-battelle": { source: "iana" }, "application/vnd.commonspace": { source: "iana", extensions: ["csp"] }, "application/vnd.contact.cmsg": { source: "iana", extensions: ["cdbcmsg"] }, "application/vnd.coreos.ignition+json": { source: "iana", compressible: true }, "application/vnd.cosmocaller": { source: "iana", extensions: ["cmc"] }, "application/vnd.crick.clicker": { source: "iana", extensions: ["clkx"] }, "application/vnd.crick.clicker.keyboard": { source: "iana", extensions: ["clkk"] }, "application/vnd.crick.clicker.palette": { source: "iana", extensions: ["clkp"] }, "application/vnd.crick.clicker.template": { source: "iana", extensions: ["clkt"] }, "application/vnd.crick.clicker.wordbank": { source: "iana", extensions: ["clkw"] }, "application/vnd.criticaltools.wbs+xml": { source: "iana", compressible: true, extensions: ["wbs"] }, "application/vnd.cryptii.pipe+json": { source: "iana", compressible: true }, "application/vnd.crypto-shade-file": { source: "iana" }, "application/vnd.cryptomator.encrypted": { source: "iana" }, "application/vnd.cryptomator.vault": { source: "iana" }, "application/vnd.ctc-posml": { source: "iana", extensions: ["pml"] }, "application/vnd.ctct.ws+xml": { source: "iana", compressible: true }, "application/vnd.cups-pdf": { source: "iana" }, "application/vnd.cups-postscript": { source: "iana" }, "application/vnd.cups-ppd": { source: "iana", extensions: ["ppd"] }, "application/vnd.cups-raster": { source: "iana" }, "application/vnd.cups-raw": { source: "iana" }, "application/vnd.curl": { source: "iana" }, "application/vnd.curl.car": { source: "apache", extensions: ["car"] }, "application/vnd.curl.pcurl": { source: "apache", extensions: ["pcurl"] }, "application/vnd.cyan.dean.root+xml": { source: "iana", compressible: true }, "application/vnd.cybank": { source: "iana" }, "application/vnd.cyclonedx+json": { source: "iana", compressible: true }, "application/vnd.cyclonedx+xml": { source: "iana", compressible: true }, "application/vnd.d2l.coursepackage1p0+zip": { source: "iana", compressible: false }, "application/vnd.d3m-dataset": { source: "iana" }, "application/vnd.d3m-problem": { source: "iana" }, "application/vnd.dart": { source: "iana", compressible: true, extensions: ["dart"] }, "application/vnd.data-vision.rdz": { source: "iana", extensions: ["rdz"] }, "application/vnd.datapackage+json": { source: "iana", compressible: true }, "application/vnd.dataresource+json": { source: "iana", compressible: true }, "application/vnd.dbf": { source: "iana", extensions: ["dbf"] }, "application/vnd.debian.binary-package": { source: "iana" }, "application/vnd.dece.data": { source: "iana", extensions: ["uvf", "uvvf", "uvd", "uvvd"] }, "application/vnd.dece.ttml+xml": { source: "iana", compressible: true, extensions: ["uvt", "uvvt"] }, "application/vnd.dece.unspecified": { source: "iana", extensions: ["uvx", "uvvx"] }, "application/vnd.dece.zip": { source: "iana", extensions: ["uvz", "uvvz"] }, "application/vnd.denovo.fcselayout-link": { source: "iana", extensions: ["fe_launch"] }, "application/vnd.desmume.movie": { source: "iana" }, "application/vnd.dir-bi.plate-dl-nosuffix": { source: "iana" }, "application/vnd.dm.delegation+xml": { source: "iana", compressible: true }, "application/vnd.dna": { source: "iana", extensions: ["dna"] }, "application/vnd.document+json": { source: "iana", compressible: true }, "application/vnd.dolby.mlp": { source: "apache", extensions: ["mlp"] }, "application/vnd.dolby.mobile.1": { source: "iana" }, "application/vnd.dolby.mobile.2": { source: "iana" }, "application/vnd.doremir.scorecloud-binary-document": { source: "iana" }, "application/vnd.dpgraph": { source: "iana", extensions: ["dpg"] }, "application/vnd.dreamfactory": { source: "iana", extensions: ["dfac"] }, "application/vnd.drive+json": { source: "iana", compressible: true }, "application/vnd.ds-keypoint": { source: "apache", extensions: ["kpxx"] }, "application/vnd.dtg.local": { source: "iana" }, "application/vnd.dtg.local.flash": { source: "iana" }, "application/vnd.dtg.local.html": { source: "iana" }, "application/vnd.dvb.ait": { source: "iana", extensions: ["ait"] }, "application/vnd.dvb.dvbisl+xml": { source: "iana", compressible: true }, "application/vnd.dvb.dvbj": { source: "iana" }, "application/vnd.dvb.esgcontainer": { source: "iana" }, "application/vnd.dvb.ipdcdftnotifaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess2": { source: "iana" }, "application/vnd.dvb.ipdcesgpdd": { source: "iana" }, "application/vnd.dvb.ipdcroaming": { source: "iana" }, "application/vnd.dvb.iptv.alfec-base": { source: "iana" }, "application/vnd.dvb.iptv.alfec-enhancement": { source: "iana" }, "application/vnd.dvb.notif-aggregate-root+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-container+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-generic+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-ia-msglist+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-ia-registration-request+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-ia-registration-response+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-init+xml": { source: "iana", compressible: true }, "application/vnd.dvb.pfr": { source: "iana" }, "application/vnd.dvb.service": { source: "iana", extensions: ["svc"] }, "application/vnd.dxr": { source: "iana" }, "application/vnd.dynageo": { source: "iana", extensions: ["geo"] }, "application/vnd.dzr": { source: "iana" }, "application/vnd.easykaraoke.cdgdownload": { source: "iana" }, "application/vnd.ecdis-update": { source: "iana" }, "application/vnd.ecip.rlp": { source: "iana" }, "application/vnd.eclipse.ditto+json": { source: "iana", compressible: true }, "application/vnd.ecowin.chart": { source: "iana", extensions: ["mag"] }, "application/vnd.ecowin.filerequest": { source: "iana" }, "application/vnd.ecowin.fileupdate": { source: "iana" }, "application/vnd.ecowin.series": { source: "iana" }, "application/vnd.ecowin.seriesrequest": { source: "iana" }, "application/vnd.ecowin.seriesupdate": { source: "iana" }, "application/vnd.efi.img": { source: "iana" }, "application/vnd.efi.iso": { source: "iana" }, "application/vnd.emclient.accessrequest+xml": { source: "iana", compressible: true }, "application/vnd.enliven": { source: "iana", extensions: ["nml"] }, "application/vnd.enphase.envoy": { source: "iana" }, "application/vnd.eprints.data+xml": { source: "iana", compressible: true }, "application/vnd.epson.esf": { source: "iana", extensions: ["esf"] }, "application/vnd.epson.msf": { source: "iana", extensions: ["msf"] }, "application/vnd.epson.quickanime": { source: "iana", extensions: ["qam"] }, "application/vnd.epson.salt": { source: "iana", extensions: ["slt"] }, "application/vnd.epson.ssf": { source: "iana", extensions: ["ssf"] }, "application/vnd.ericsson.quickcall": { source: "iana" }, "application/vnd.espass-espass+zip": { source: "iana", compressible: false }, "application/vnd.eszigno3+xml": { source: "iana", compressible: true, extensions: ["es3", "et3"] }, "application/vnd.etsi.aoc+xml": { source: "iana", compressible: true }, "application/vnd.etsi.asic-e+zip": { source: "iana", compressible: false }, "application/vnd.etsi.asic-s+zip": { source: "iana", compressible: false }, "application/vnd.etsi.cug+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvcommand+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvdiscovery+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvprofile+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvsad-bc+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvsad-cod+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvsad-npvr+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvservice+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvsync+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvueprofile+xml": { source: "iana", compressible: true }, "application/vnd.etsi.mcid+xml": { source: "iana", compressible: true }, "application/vnd.etsi.mheg5": { source: "iana" }, "application/vnd.etsi.overload-control-policy-dataset+xml": { source: "iana", compressible: true }, "application/vnd.etsi.pstn+xml": { source: "iana", compressible: true }, "application/vnd.etsi.sci+xml": { source: "iana", compressible: true }, "application/vnd.etsi.simservs+xml": { source: "iana", compressible: true }, "application/vnd.etsi.timestamp-token": { source: "iana" }, "application/vnd.etsi.tsl+xml": { source: "iana", compressible: true }, "application/vnd.etsi.tsl.der": { source: "iana" }, "application/vnd.eu.kasparian.car+json": { source: "iana", compressible: true }, "application/vnd.eudora.data": { source: "iana" }, "application/vnd.evolv.ecig.profile": { source: "iana" }, "application/vnd.evolv.ecig.settings": { source: "iana" }, "application/vnd.evolv.ecig.theme": { source: "iana" }, "application/vnd.exstream-empower+zip": { source: "iana", compressible: false }, "application/vnd.exstream-package": { source: "iana" }, "application/vnd.ezpix-album": { source: "iana", extensions: ["ez2"] }, "application/vnd.ezpix-package": { source: "iana", extensions: ["ez3"] }, "application/vnd.f-secure.mobile": { source: "iana" }, "application/vnd.familysearch.gedcom+zip": { source: "iana", compressible: false }, "application/vnd.fastcopy-disk-image": { source: "iana" }, "application/vnd.fdf": { source: "iana", extensions: ["fdf"] }, "application/vnd.fdsn.mseed": { source: "iana", extensions: ["mseed"] }, "application/vnd.fdsn.seed": { source: "iana", extensions: ["seed", "dataless"] }, "application/vnd.ffsns": { source: "iana" }, "application/vnd.ficlab.flb+zip": { source: "iana", compressible: false }, "application/vnd.filmit.zfc": { source: "iana" }, "application/vnd.fints": { source: "iana" }, "application/vnd.firemonkeys.cloudcell": { source: "iana" }, "application/vnd.flographit": { source: "iana", extensions: ["gph"] }, "application/vnd.fluxtime.clip": { source: "iana", extensions: ["ftc"] }, "application/vnd.font-fontforge-sfd": { source: "iana" }, "application/vnd.framemaker": { source: "iana", extensions: ["fm", "frame", "maker", "book"] }, "application/vnd.frogans.fnc": { source: "iana", extensions: ["fnc"] }, "application/vnd.frogans.ltf": { source: "iana", extensions: ["ltf"] }, "application/vnd.fsc.weblaunch": { source: "iana", extensions: ["fsc"] }, "application/vnd.fujifilm.fb.docuworks": { source: "iana" }, "application/vnd.fujifilm.fb.docuworks.binder": { source: "iana" }, "application/vnd.fujifilm.fb.docuworks.container": { source: "iana" }, "application/vnd.fujifilm.fb.jfi+xml": { source: "iana", compressible: true }, "application/vnd.fujitsu.oasys": { source: "iana", extensions: ["oas"] }, "application/vnd.fujitsu.oasys2": { source: "iana", extensions: ["oa2"] }, "application/vnd.fujitsu.oasys3": { source: "iana", extensions: ["oa3"] }, "application/vnd.fujitsu.oasysgp": { source: "iana", extensions: ["fg5"] }, "application/vnd.fujitsu.oasysprs": { source: "iana", extensions: ["bh2"] }, "application/vnd.fujixerox.art-ex": { source: "iana" }, "application/vnd.fujixerox.art4": { source: "iana" }, "application/vnd.fujixerox.ddd": { source: "iana", extensions: ["ddd"] }, "application/vnd.fujixerox.docuworks": { source: "iana", extensions: ["xdw"] }, "application/vnd.fujixerox.docuworks.binder": { source: "iana", extensions: ["xbd"] }, "application/vnd.fujixerox.docuworks.container": { source: "iana" }, "application/vnd.fujixerox.hbpl": { source: "iana" }, "application/vnd.fut-misnet": { source: "iana" }, "application/vnd.futoin+cbor": { source: "iana" }, "application/vnd.futoin+json": { source: "iana", compressible: true }, "application/vnd.fuzzysheet": { source: "iana", extensions: ["fzs"] }, "application/vnd.genomatix.tuxedo": { source: "iana", extensions: ["txd"] }, "application/vnd.gentics.grd+json": { source: "iana", compressible: true }, "application/vnd.geo+json": { source: "iana", compressible: true }, "application/vnd.geocube+xml": { source: "iana", compressible: true }, "application/vnd.geogebra.file": { source: "iana", extensions: ["ggb"] }, "application/vnd.geogebra.slides": { source: "iana" }, "application/vnd.geogebra.tool": { source: "iana", extensions: ["ggt"] }, "application/vnd.geometry-explorer": { source: "iana", extensions: ["gex", "gre"] }, "application/vnd.geonext": { source: "iana", extensions: ["gxt"] }, "application/vnd.geoplan": { source: "iana", extensions: ["g2w"] }, "application/vnd.geospace": { source: "iana", extensions: ["g3w"] }, "application/vnd.gerber": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt-response": { source: "iana" }, "application/vnd.gmx": { source: "iana", extensions: ["gmx"] }, "application/vnd.google-apps.document": { compressible: false, extensions: ["gdoc"] }, "application/vnd.google-apps.presentation": { compressible: false, extensions: ["gslides"] }, "application/vnd.google-apps.spreadsheet": { compressible: false, extensions: ["gsheet"] }, "application/vnd.google-earth.kml+xml": { source: "iana", compressible: true, extensions: ["kml"] }, "application/vnd.google-earth.kmz": { source: "iana", compressible: false, extensions: ["kmz"] }, "application/vnd.gov.sk.e-form+xml": { source: "iana", compressible: true }, "application/vnd.gov.sk.e-form+zip": { source: "iana", compressible: false }, "application/vnd.gov.sk.xmldatacontainer+xml": { source: "iana", compressible: true }, "application/vnd.grafeq": { source: "iana", extensions: ["gqf", "gqs"] }, "application/vnd.gridmp": { source: "iana" }, "application/vnd.groove-account": { source: "iana", extensions: ["gac"] }, "application/vnd.groove-help": { source: "iana", extensions: ["ghf"] }, "application/vnd.groove-identity-message": { source: "iana", extensions: ["gim"] }, "application/vnd.groove-injector": { source: "iana", extensions: ["grv"] }, "application/vnd.groove-tool-message": { source: "iana", extensions: ["gtm"] }, "application/vnd.groove-tool-template": { source: "iana", extensions: ["tpl"] }, "application/vnd.groove-vcard": { source: "iana", extensions: ["vcg"] }, "application/vnd.hal+json": { source: "iana", compressible: true }, "application/vnd.hal+xml": { source: "iana", compressible: true, extensions: ["hal"] }, "application/vnd.handheld-entertainment+xml": { source: "iana", compressible: true, extensions: ["zmm"] }, "application/vnd.hbci": { source: "iana", extensions: ["hbci"] }, "application/vnd.hc+json": { source: "iana", compressible: true }, "application/vnd.hcl-bireports": { source: "iana" }, "application/vnd.hdt": { source: "iana" }, "application/vnd.heroku+json": { source: "iana", compressible: true }, "application/vnd.hhe.lesson-player": { source: "iana", extensions: ["les"] }, "application/vnd.hl7cda+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.hl7v2+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.hp-hpgl": { source: "iana", extensions: ["hpgl"] }, "application/vnd.hp-hpid": { source: "iana", extensions: ["hpid"] }, "application/vnd.hp-hps": { source: "iana", extensions: ["hps"] }, "application/vnd.hp-jlyt": { source: "iana", extensions: ["jlt"] }, "application/vnd.hp-pcl": { source: "iana", extensions: ["pcl"] }, "application/vnd.hp-pclxl": { source: "iana", extensions: ["pclxl"] }, "application/vnd.httphone": { source: "iana" }, "application/vnd.hydrostatix.sof-data": { source: "iana", extensions: ["sfd-hdstx"] }, "application/vnd.hyper+json": { source: "iana", compressible: true }, "application/vnd.hyper-item+json": { source: "iana", compressible: true }, "application/vnd.hyperdrive+json": { source: "iana", compressible: true }, "application/vnd.hzn-3d-crossword": { source: "iana" }, "application/vnd.ibm.afplinedata": { source: "iana" }, "application/vnd.ibm.electronic-media": { source: "iana" }, "application/vnd.ibm.minipay": { source: "iana", extensions: ["mpy"] }, "application/vnd.ibm.modcap": { source: "iana", extensions: ["afp", "listafp", "list3820"] }, "application/vnd.ibm.rights-management": { source: "iana", extensions: ["irm"] }, "application/vnd.ibm.secure-container": { source: "iana", extensions: ["sc"] }, "application/vnd.iccprofile": { source: "iana", extensions: ["icc", "icm"] }, "application/vnd.ieee.1905": { source: "iana" }, "application/vnd.igloader": { source: "iana", extensions: ["igl"] }, "application/vnd.imagemeter.folder+zip": { source: "iana", compressible: false }, "application/vnd.imagemeter.image+zip": { source: "iana", compressible: false }, "application/vnd.immervision-ivp": { source: "iana", extensions: ["ivp"] }, "application/vnd.immervision-ivu": { source: "iana", extensions: ["ivu"] }, "application/vnd.ims.imsccv1p1": { source: "iana" }, "application/vnd.ims.imsccv1p2": { source: "iana" }, "application/vnd.ims.imsccv1p3": { source: "iana" }, "application/vnd.ims.lis.v2.result+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolconsumerprofile+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolproxy+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolproxy.id+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolsettings+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolsettings.simple+json": { source: "iana", compressible: true }, "application/vnd.informedcontrol.rms+xml": { source: "iana", compressible: true }, "application/vnd.informix-visionary": { source: "iana" }, "application/vnd.infotech.project": { source: "iana" }, "application/vnd.infotech.project+xml": { source: "iana", compressible: true }, "application/vnd.innopath.wamp.notification": { source: "iana" }, "application/vnd.insors.igm": { source: "iana", extensions: ["igm"] }, "application/vnd.intercon.formnet": { source: "iana", extensions: ["xpw", "xpx"] }, "application/vnd.intergeo": { source: "iana", extensions: ["i2g"] }, "application/vnd.intertrust.digibox": { source: "iana" }, "application/vnd.intertrust.nncp": { source: "iana" }, "application/vnd.intu.qbo": { source: "iana", extensions: ["qbo"] }, "application/vnd.intu.qfx": { source: "iana", extensions: ["qfx"] }, "application/vnd.iptc.g2.catalogitem+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.conceptitem+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.knowledgeitem+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.newsitem+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.newsmessage+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.packageitem+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.planningitem+xml": { source: "iana", compressible: true }, "application/vnd.ipunplugged.rcprofile": { source: "iana", extensions: ["rcprofile"] }, "application/vnd.irepository.package+xml": { source: "iana", compressible: true, extensions: ["irp"] }, "application/vnd.is-xpr": { source: "iana", extensions: ["xpr"] }, "application/vnd.isac.fcs": { source: "iana", extensions: ["fcs"] }, "application/vnd.iso11783-10+zip": { source: "iana", compressible: false }, "application/vnd.jam": { source: "iana", extensions: ["jam"] }, "application/vnd.japannet-directory-service": { source: "iana" }, "application/vnd.japannet-jpnstore-wakeup": { source: "iana" }, "application/vnd.japannet-payment-wakeup": { source: "iana" }, "application/vnd.japannet-registration": { source: "iana" }, "application/vnd.japannet-registration-wakeup": { source: "iana" }, "application/vnd.japannet-setstore-wakeup": { source: "iana" }, "application/vnd.japannet-verification": { source: "iana" }, "application/vnd.japannet-verification-wakeup": { source: "iana" }, "application/vnd.jcp.javame.midlet-rms": { source: "iana", extensions: ["rms"] }, "application/vnd.jisp": { source: "iana", extensions: ["jisp"] }, "application/vnd.joost.joda-archive": { source: "iana", extensions: ["joda"] }, "application/vnd.jsk.isdn-ngn": { source: "iana" }, "application/vnd.kahootz": { source: "iana", extensions: ["ktz", "ktr"] }, "application/vnd.kde.karbon": { source: "iana", extensions: ["karbon"] }, "application/vnd.kde.kchart": { source: "iana", extensions: ["chrt"] }, "application/vnd.kde.kformula": { source: "iana", extensions: ["kfo"] }, "application/vnd.kde.kivio": { source: "iana", extensions: ["flw"] }, "application/vnd.kde.kontour": { source: "iana", extensions: ["kon"] }, "application/vnd.kde.kpresenter": { source: "iana", extensions: ["kpr", "kpt"] }, "application/vnd.kde.kspread": { source: "iana", extensions: ["ksp"] }, "application/vnd.kde.kword": { source: "iana", extensions: ["kwd", "kwt"] }, "application/vnd.kenameaapp": { source: "iana", extensions: ["htke"] }, "application/vnd.kidspiration": { source: "iana", extensions: ["kia"] }, "application/vnd.kinar": { source: "iana", extensions: ["kne", "knp"] }, "application/vnd.koan": { source: "iana", extensions: ["skp", "skd", "skt", "skm"] }, "application/vnd.kodak-descriptor": { source: "iana", extensions: ["sse"] }, "application/vnd.las": { source: "iana" }, "application/vnd.las.las+json": { source: "iana", compressible: true }, "application/vnd.las.las+xml": { source: "iana", compressible: true, extensions: ["lasxml"] }, "application/vnd.laszip": { source: "iana" }, "application/vnd.leap+json": { source: "iana", compressible: true }, "application/vnd.liberty-request+xml": { source: "iana", compressible: true }, "application/vnd.llamagraphics.life-balance.desktop": { source: "iana", extensions: ["lbd"] }, "application/vnd.llamagraphics.life-balance.exchange+xml": { source: "iana", compressible: true, extensions: ["lbe"] }, "application/vnd.logipipe.circuit+zip": { source: "iana", compressible: false }, "application/vnd.loom": { source: "iana" }, "application/vnd.lotus-1-2-3": { source: "iana", extensions: ["123"] }, "application/vnd.lotus-approach": { source: "iana", extensions: ["apr"] }, "application/vnd.lotus-freelance": { source: "iana", extensions: ["pre"] }, "application/vnd.lotus-notes": { source: "iana", extensions: ["nsf"] }, "application/vnd.lotus-organizer": { source: "iana", extensions: ["org"] }, "application/vnd.lotus-screencam": { source: "iana", extensions: ["scm"] }, "application/vnd.lotus-wordpro": { source: "iana", extensions: ["lwp"] }, "application/vnd.macports.portpkg": { source: "iana", extensions: ["portpkg"] }, "application/vnd.mapbox-vector-tile": { source: "iana", extensions: ["mvt"] }, "application/vnd.marlin.drm.actiontoken+xml": { source: "iana", compressible: true }, "application/vnd.marlin.drm.conftoken+xml": { source: "iana", compressible: true }, "application/vnd.marlin.drm.license+xml": { source: "iana", compressible: true }, "application/vnd.marlin.drm.mdcf": { source: "iana" }, "application/vnd.mason+json": { source: "iana", compressible: true }, "application/vnd.maxar.archive.3tz+zip": { source: "iana", compressible: false }, "application/vnd.maxmind.maxmind-db": { source: "iana" }, "application/vnd.mcd": { source: "iana", extensions: ["mcd"] }, "application/vnd.medcalcdata": { source: "iana", extensions: ["mc1"] }, "application/vnd.mediastation.cdkey": { source: "iana", extensions: ["cdkey"] }, "application/vnd.meridian-slingshot": { source: "iana" }, "application/vnd.mfer": { source: "iana", extensions: ["mwf"] }, "application/vnd.mfmp": { source: "iana", extensions: ["mfm"] }, "application/vnd.micro+json": { source: "iana", compressible: true }, "application/vnd.micrografx.flo": { source: "iana", extensions: ["flo"] }, "application/vnd.micrografx.igx": { source: "iana", extensions: ["igx"] }, "application/vnd.microsoft.portable-executable": { source: "iana" }, "application/vnd.microsoft.windows.thumbnail-cache": { source: "iana" }, "application/vnd.miele+json": { source: "iana", compressible: true }, "application/vnd.mif": { source: "iana", extensions: ["mif"] }, "application/vnd.minisoft-hp3000-save": { source: "iana" }, "application/vnd.mitsubishi.misty-guard.trustweb": { source: "iana" }, "application/vnd.mobius.daf": { source: "iana", extensions: ["daf"] }, "application/vnd.mobius.dis": { source: "iana", extensions: ["dis"] }, "application/vnd.mobius.mbk": { source: "iana", extensions: ["mbk"] }, "application/vnd.mobius.mqy": { source: "iana", extensions: ["mqy"] }, "application/vnd.mobius.msl": { source: "iana", extensions: ["msl"] }, "application/vnd.mobius.plc": { source: "iana", extensions: ["plc"] }, "application/vnd.mobius.txf": { source: "iana", extensions: ["txf"] }, "application/vnd.mophun.application": { source: "iana", extensions: ["mpn"] }, "application/vnd.mophun.certificate": { source: "iana", extensions: ["mpc"] }, "application/vnd.motorola.flexsuite": { source: "iana" }, "application/vnd.motorola.flexsuite.adsi": { source: "iana" }, "application/vnd.motorola.flexsuite.fis": { source: "iana" }, "application/vnd.motorola.flexsuite.gotap": { source: "iana" }, "application/vnd.motorola.flexsuite.kmr": { source: "iana" }, "application/vnd.motorola.flexsuite.ttc": { source: "iana" }, "application/vnd.motorola.flexsuite.wem": { source: "iana" }, "application/vnd.motorola.iprm": { source: "iana" }, "application/vnd.mozilla.xul+xml": { source: "iana", compressible: true, extensions: ["xul"] }, "application/vnd.ms-3mfdocument": { source: "iana" }, "application/vnd.ms-artgalry": { source: "iana", extensions: ["cil"] }, "application/vnd.ms-asf": { source: "iana" }, "application/vnd.ms-cab-compressed": { source: "iana", extensions: ["cab"] }, "application/vnd.ms-color.iccprofile": { source: "apache" }, "application/vnd.ms-excel": { source: "iana", compressible: false, extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] }, "application/vnd.ms-excel.addin.macroenabled.12": { source: "iana", extensions: ["xlam"] }, "application/vnd.ms-excel.sheet.binary.macroenabled.12": { source: "iana", extensions: ["xlsb"] }, "application/vnd.ms-excel.sheet.macroenabled.12": { source: "iana", extensions: ["xlsm"] }, "application/vnd.ms-excel.template.macroenabled.12": { source: "iana", extensions: ["xltm"] }, "application/vnd.ms-fontobject": { source: "iana", compressible: true, extensions: ["eot"] }, "application/vnd.ms-htmlhelp": { source: "iana", extensions: ["chm"] }, "application/vnd.ms-ims": { source: "iana", extensions: ["ims"] }, "application/vnd.ms-lrm": { source: "iana", extensions: ["lrm"] }, "application/vnd.ms-office.activex+xml": { source: "iana", compressible: true }, "application/vnd.ms-officetheme": { source: "iana", extensions: ["thmx"] }, "application/vnd.ms-opentype": { source: "apache", compressible: true }, "application/vnd.ms-outlook": { compressible: false, extensions: ["msg"] }, "application/vnd.ms-package.obfuscated-opentype": { source: "apache" }, "application/vnd.ms-pki.seccat": { source: "apache", extensions: ["cat"] }, "application/vnd.ms-pki.stl": { source: "apache", extensions: ["stl"] }, "application/vnd.ms-playready.initiator+xml": { source: "iana", compressible: true }, "application/vnd.ms-powerpoint": { source: "iana", compressible: false, extensions: ["ppt", "pps", "pot"] }, "application/vnd.ms-powerpoint.addin.macroenabled.12": { source: "iana", extensions: ["ppam"] }, "application/vnd.ms-powerpoint.presentation.macroenabled.12": { source: "iana", extensions: ["pptm"] }, "application/vnd.ms-powerpoint.slide.macroenabled.12": { source: "iana", extensions: ["sldm"] }, "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { source: "iana", extensions: ["ppsm"] }, "application/vnd.ms-powerpoint.template.macroenabled.12": { source: "iana", extensions: ["potm"] }, "application/vnd.ms-printdevicecapabilities+xml": { source: "iana", compressible: true }, "application/vnd.ms-printing.printticket+xml": { source: "apache", compressible: true }, "application/vnd.ms-printschematicket+xml": { source: "iana", compressible: true }, "application/vnd.ms-project": { source: "iana", extensions: ["mpp", "mpt"] }, "application/vnd.ms-tnef": { source: "iana" }, "application/vnd.ms-windows.devicepairing": { source: "iana" }, "application/vnd.ms-windows.nwprinting.oob": { source: "iana" }, "application/vnd.ms-windows.printerpairing": { source: "iana" }, "application/vnd.ms-windows.wsd.oob": { source: "iana" }, "application/vnd.ms-wmdrm.lic-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.lic-resp": { source: "iana" }, "application/vnd.ms-wmdrm.meter-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.meter-resp": { source: "iana" }, "application/vnd.ms-word.document.macroenabled.12": { source: "iana", extensions: ["docm"] }, "application/vnd.ms-word.template.macroenabled.12": { source: "iana", extensions: ["dotm"] }, "application/vnd.ms-works": { source: "iana", extensions: ["wps", "wks", "wcm", "wdb"] }, "application/vnd.ms-wpl": { source: "iana", extensions: ["wpl"] }, "application/vnd.ms-xpsdocument": { source: "iana", compressible: false, extensions: ["xps"] }, "application/vnd.msa-disk-image": { source: "iana" }, "application/vnd.mseq": { source: "iana", extensions: ["mseq"] }, "application/vnd.msign": { source: "iana" }, "application/vnd.multiad.creator": { source: "iana" }, "application/vnd.multiad.creator.cif": { source: "iana" }, "application/vnd.music-niff": { source: "iana" }, "application/vnd.musician": { source: "iana", extensions: ["mus"] }, "application/vnd.muvee.style": { source: "iana", extensions: ["msty"] }, "application/vnd.mynfc": { source: "iana", extensions: ["taglet"] }, "application/vnd.nacamar.ybrid+json": { source: "iana", compressible: true }, "application/vnd.ncd.control": { source: "iana" }, "application/vnd.ncd.reference": { source: "iana" }, "application/vnd.nearst.inv+json": { source: "iana", compressible: true }, "application/vnd.nebumind.line": { source: "iana" }, "application/vnd.nervana": { source: "iana" }, "application/vnd.netfpx": { source: "iana" }, "application/vnd.neurolanguage.nlu": { source: "iana", extensions: ["nlu"] }, "application/vnd.nimn": { source: "iana" }, "application/vnd.nintendo.nitro.rom": { source: "iana" }, "application/vnd.nintendo.snes.rom": { source: "iana" }, "application/vnd.nitf": { source: "iana", extensions: ["ntf", "nitf"] }, "application/vnd.noblenet-directory": { source: "iana", extensions: ["nnd"] }, "application/vnd.noblenet-sealer": { source: "iana", extensions: ["nns"] }, "application/vnd.noblenet-web": { source: "iana", extensions: ["nnw"] }, "application/vnd.nokia.catalogs": { source: "iana" }, "application/vnd.nokia.conml+wbxml": { source: "iana" }, "application/vnd.nokia.conml+xml": { source: "iana", compressible: true }, "application/vnd.nokia.iptv.config+xml": { source: "iana", compressible: true }, "application/vnd.nokia.isds-radio-presets": { source: "iana" }, "application/vnd.nokia.landmark+wbxml": { source: "iana" }, "application/vnd.nokia.landmark+xml": { source: "iana", compressible: true }, "application/vnd.nokia.landmarkcollection+xml": { source: "iana", compressible: true }, "application/vnd.nokia.n-gage.ac+xml": { source: "iana", compressible: true, extensions: ["ac"] }, "application/vnd.nokia.n-gage.data": { source: "iana", extensions: ["ngdat"] }, "application/vnd.nokia.n-gage.symbian.install": { source: "iana", extensions: ["n-gage"] }, "application/vnd.nokia.ncd": { source: "iana" }, "application/vnd.nokia.pcd+wbxml": { source: "iana" }, "application/vnd.nokia.pcd+xml": { source: "iana", compressible: true }, "application/vnd.nokia.radio-preset": { source: "iana", extensions: ["rpst"] }, "application/vnd.nokia.radio-presets": { source: "iana", extensions: ["rpss"] }, "application/vnd.novadigm.edm": { source: "iana", extensions: ["edm"] }, "application/vnd.novadigm.edx": { source: "iana", extensions: ["edx"] }, "application/vnd.novadigm.ext": { source: "iana", extensions: ["ext"] }, "application/vnd.ntt-local.content-share": { source: "iana" }, "application/vnd.ntt-local.file-transfer": { source: "iana" }, "application/vnd.ntt-local.ogw_remote-access": { source: "iana" }, "application/vnd.ntt-local.sip-ta_remote": { source: "iana" }, "application/vnd.ntt-local.sip-ta_tcp_stream": { source: "iana" }, "application/vnd.oasis.opendocument.chart": { source: "iana", extensions: ["odc"] }, "application/vnd.oasis.opendocument.chart-template": { source: "iana", extensions: ["otc"] }, "application/vnd.oasis.opendocument.database": { source: "iana", extensions: ["odb"] }, "application/vnd.oasis.opendocument.formula": { source: "iana", extensions: ["odf"] }, "application/vnd.oasis.opendocument.formula-template": { source: "iana", extensions: ["odft"] }, "application/vnd.oasis.opendocument.graphics": { source: "iana", compressible: false, extensions: ["odg"] }, "application/vnd.oasis.opendocument.graphics-template": { source: "iana", extensions: ["otg"] }, "application/vnd.oasis.opendocument.image": { source: "iana", extensions: ["odi"] }, "application/vnd.oasis.opendocument.image-template": { source: "iana", extensions: ["oti"] }, "application/vnd.oasis.opendocument.presentation": { source: "iana", compressible: false, extensions: ["odp"] }, "application/vnd.oasis.opendocument.presentation-template": { source: "iana", extensions: ["otp"] }, "application/vnd.oasis.opendocument.spreadsheet": { source: "iana", compressible: false, extensions: ["ods"] }, "application/vnd.oasis.opendocument.spreadsheet-template": { source: "iana", extensions: ["ots"] }, "application/vnd.oasis.opendocument.text": { source: "iana", compressible: false, extensions: ["odt"] }, "application/vnd.oasis.opendocument.text-master": { source: "iana", extensions: ["odm"] }, "application/vnd.oasis.opendocument.text-template": { source: "iana", extensions: ["ott"] }, "application/vnd.oasis.opendocument.text-web": { source: "iana", extensions: ["oth"] }, "application/vnd.obn": { source: "iana" }, "application/vnd.ocf+cbor": { source: "iana" }, "application/vnd.oci.image.manifest.v1+json": { source: "iana", compressible: true }, "application/vnd.oftn.l10n+json": { source: "iana", compressible: true }, "application/vnd.oipf.contentaccessdownload+xml": { source: "iana", compressible: true }, "application/vnd.oipf.contentaccessstreaming+xml": { source: "iana", compressible: true }, "application/vnd.oipf.cspg-hexbinary": { source: "iana" }, "application/vnd.oipf.dae.svg+xml": { source: "iana", compressible: true }, "application/vnd.oipf.dae.xhtml+xml": { source: "iana", compressible: true }, "application/vnd.oipf.mippvcontrolmessage+xml": { source: "iana", compressible: true }, "application/vnd.oipf.pae.gem": { source: "iana" }, "application/vnd.oipf.spdiscovery+xml": { source: "iana", compressible: true }, "application/vnd.oipf.spdlist+xml": { source: "iana", compressible: true }, "application/vnd.oipf.ueprofile+xml": { source: "iana", compressible: true }, "application/vnd.oipf.userprofile+xml": { source: "iana", compressible: true }, "application/vnd.olpc-sugar": { source: "iana", extensions: ["xo"] }, "application/vnd.oma-scws-config": { source: "iana" }, "application/vnd.oma-scws-http-request": { source: "iana" }, "application/vnd.oma-scws-http-response": { source: "iana" }, "application/vnd.oma.bcast.associated-procedure-parameter+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.drm-trigger+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.imd+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.ltkm": { source: "iana" }, "application/vnd.oma.bcast.notification+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.provisioningtrigger": { source: "iana" }, "application/vnd.oma.bcast.sgboot": { source: "iana" }, "application/vnd.oma.bcast.sgdd+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.sgdu": { source: "iana" }, "application/vnd.oma.bcast.simple-symbol-container": { source: "iana" }, "application/vnd.oma.bcast.smartcard-trigger+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.sprov+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.stkm": { source: "iana" }, "application/vnd.oma.cab-address-book+xml": { source: "iana", compressible: true }, "application/vnd.oma.cab-feature-handler+xml": { source: "iana", compressible: true }, "application/vnd.oma.cab-pcc+xml": { source: "iana", compressible: true }, "application/vnd.oma.cab-subs-invite+xml": { source: "iana", compressible: true }, "application/vnd.oma.cab-user-prefs+xml": { source: "iana", compressible: true }, "application/vnd.oma.dcd": { source: "iana" }, "application/vnd.oma.dcdc": { source: "iana" }, "application/vnd.oma.dd2+xml": { source: "iana", compressible: true, extensions: ["dd2"] }, "application/vnd.oma.drm.risd+xml": { source: "iana", compressible: true }, "application/vnd.oma.group-usage-list+xml": { source: "iana", compressible: true }, "application/vnd.oma.lwm2m+cbor": { source: "iana" }, "application/vnd.oma.lwm2m+json": { source: "iana", compressible: true }, "application/vnd.oma.lwm2m+tlv": { source: "iana" }, "application/vnd.oma.pal+xml": { source: "iana", compressible: true }, "application/vnd.oma.poc.detailed-progress-report+xml": { source: "iana", compressible: true }, "application/vnd.oma.poc.final-report+xml": { source: "iana", compressible: true }, "application/vnd.oma.poc.groups+xml": { source: "iana", compressible: true }, "application/vnd.oma.poc.invocation-descriptor+xml": { source: "iana", compressible: true }, "application/vnd.oma.poc.optimized-progress-report+xml": { source: "iana", compressible: true }, "application/vnd.oma.push": { source: "iana" }, "application/vnd.oma.scidm.messages+xml": { source: "iana", compressible: true }, "application/vnd.oma.xcap-directory+xml": { source: "iana", compressible: true }, "application/vnd.omads-email+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.omads-file+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.omads-folder+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.omaloc-supl-init": { source: "iana" }, "application/vnd.onepager": { source: "iana" }, "application/vnd.onepagertamp": { source: "iana" }, "application/vnd.onepagertamx": { source: "iana" }, "application/vnd.onepagertat": { source: "iana" }, "application/vnd.onepagertatp": { source: "iana" }, "application/vnd.onepagertatx": { source: "iana" }, "application/vnd.openblox.game+xml": { source: "iana", compressible: true, extensions: ["obgx"] }, "application/vnd.openblox.game-binary": { source: "iana" }, "application/vnd.openeye.oeb": { source: "iana" }, "application/vnd.openofficeorg.extension": { source: "apache", extensions: ["oxt"] }, "application/vnd.openstreetmap.data+xml": { source: "iana", compressible: true, extensions: ["osm"] }, "application/vnd.opentimestamps.ots": { source: "iana" }, "application/vnd.openxmlformats-officedocument.custom-properties+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawing+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.extended-properties+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.presentation": { source: "iana", compressible: false, extensions: ["pptx"] }, "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.slide": { source: "iana", extensions: ["sldx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { source: "iana", extensions: ["ppsx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.template": { source: "iana", extensions: ["potx"] }, "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { source: "iana", compressible: false, extensions: ["xlsx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { source: "iana", extensions: ["xltx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.theme+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.themeoverride+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.vmldrawing": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { source: "iana", compressible: false, extensions: ["docx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { source: "iana", extensions: ["dotx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-package.core-properties+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-package.relationships+xml": { source: "iana", compressible: true }, "application/vnd.oracle.resource+json": { source: "iana", compressible: true }, "application/vnd.orange.indata": { source: "iana" }, "application/vnd.osa.netdeploy": { source: "iana" }, "application/vnd.osgeo.mapguide.package": { source: "iana", extensions: ["mgp"] }, "application/vnd.osgi.bundle": { source: "iana" }, "application/vnd.osgi.dp": { source: "iana", extensions: ["dp"] }, "application/vnd.osgi.subsystem": { source: "iana", extensions: ["esa"] }, "application/vnd.otps.ct-kip+xml": { source: "iana", compressible: true }, "application/vnd.oxli.countgraph": { source: "iana" }, "application/vnd.pagerduty+json": { source: "iana", compressible: true }, "application/vnd.palm": { source: "iana", extensions: ["pdb", "pqa", "oprc"] }, "application/vnd.panoply": { source: "iana" }, "application/vnd.paos.xml": { source: "iana" }, "application/vnd.patentdive": { source: "iana" }, "application/vnd.patientecommsdoc": { source: "iana" }, "application/vnd.pawaafile": { source: "iana", extensions: ["paw"] }, "application/vnd.pcos": { source: "iana" }, "application/vnd.pg.format": { source: "iana", extensions: ["str"] }, "application/vnd.pg.osasli": { source: "iana", extensions: ["ei6"] }, "application/vnd.piaccess.application-licence": { source: "iana" }, "application/vnd.picsel": { source: "iana", extensions: ["efif"] }, "application/vnd.pmi.widget": { source: "iana", extensions: ["wg"] }, "application/vnd.poc.group-advertisement+xml": { source: "iana", compressible: true }, "application/vnd.pocketlearn": { source: "iana", extensions: ["plf"] }, "application/vnd.powerbuilder6": { source: "iana", extensions: ["pbd"] }, "application/vnd.powerbuilder6-s": { source: "iana" }, "application/vnd.powerbuilder7": { source: "iana" }, "application/vnd.powerbuilder7-s": { source: "iana" }, "application/vnd.powerbuilder75": { source: "iana" }, "application/vnd.powerbuilder75-s": { source: "iana" }, "application/vnd.preminet": { source: "iana" }, "application/vnd.previewsystems.box": { source: "iana", extensions: ["box"] }, "application/vnd.proteus.magazine": { source: "iana", extensions: ["mgz"] }, "application/vnd.psfs": { source: "iana" }, "application/vnd.publishare-delta-tree": { source: "iana", extensions: ["qps"] }, "application/vnd.pvi.ptid1": { source: "iana", extensions: ["ptid"] }, "application/vnd.pwg-multiplexed": { source: "iana" }, "application/vnd.pwg-xhtml-print+xml": { source: "iana", compressible: true }, "application/vnd.qualcomm.brew-app-res": { source: "iana" }, "application/vnd.quarantainenet": { source: "iana" }, "application/vnd.quark.quarkxpress": { source: "iana", extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] }, "application/vnd.quobject-quoxdocument": { source: "iana" }, "application/vnd.radisys.moml+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-audit+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-audit-conf+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-audit-conn+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-audit-dialog+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-audit-stream+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-conf+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-base+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-fax-detect+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-group+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-speech+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-transform+xml": { source: "iana", compressible: true }, "application/vnd.rainstor.data": { source: "iana" }, "application/vnd.rapid": { source: "iana" }, "application/vnd.rar": { source: "iana", extensions: ["rar"] }, "application/vnd.realvnc.bed": { source: "iana", extensions: ["bed"] }, "application/vnd.recordare.musicxml": { source: "iana", extensions: ["mxl"] }, "application/vnd.recordare.musicxml+xml": { source: "iana", compressible: true, extensions: ["musicxml"] }, "application/vnd.renlearn.rlprint": { source: "iana" }, "application/vnd.resilient.logic": { source: "iana" }, "application/vnd.restful+json": { source: "iana", compressible: true }, "application/vnd.rig.cryptonote": { source: "iana", extensions: ["cryptonote"] }, "application/vnd.rim.cod": { source: "apache", extensions: ["cod"] }, "application/vnd.rn-realmedia": { source: "apache", extensions: ["rm"] }, "application/vnd.rn-realmedia-vbr": { source: "apache", extensions: ["rmvb"] }, "application/vnd.route66.link66+xml": { source: "iana", compressible: true, extensions: ["link66"] }, "application/vnd.rs-274x": { source: "iana" }, "application/vnd.ruckus.download": { source: "iana" }, "application/vnd.s3sms": { source: "iana" }, "application/vnd.sailingtracker.track": { source: "iana", extensions: ["st"] }, "application/vnd.sar": { source: "iana" }, "application/vnd.sbm.cid": { source: "iana" }, "application/vnd.sbm.mid2": { source: "iana" }, "application/vnd.scribus": { source: "iana" }, "application/vnd.sealed.3df": { source: "iana" }, "application/vnd.sealed.csf": { source: "iana" }, "application/vnd.sealed.doc": { source: "iana" }, "application/vnd.sealed.eml": { source: "iana" }, "application/vnd.sealed.mht": { source: "iana" }, "application/vnd.sealed.net": { source: "iana" }, "application/vnd.sealed.ppt": { source: "iana" }, "application/vnd.sealed.tiff": { source: "iana" }, "application/vnd.sealed.xls": { source: "iana" }, "application/vnd.sealedmedia.softseal.html": { source: "iana" }, "application/vnd.sealedmedia.softseal.pdf": { source: "iana" }, "application/vnd.seemail": { source: "iana", extensions: ["see"] }, "application/vnd.seis+json": { source: "iana", compressible: true }, "application/vnd.sema": { source: "iana", extensions: ["sema"] }, "application/vnd.semd": { source: "iana", extensions: ["semd"] }, "application/vnd.semf": { source: "iana", extensions: ["semf"] }, "application/vnd.shade-save-file": { source: "iana" }, "application/vnd.shana.informed.formdata": { source: "iana", extensions: ["ifm"] }, "application/vnd.shana.informed.formtemplate": { source: "iana", extensions: ["itp"] }, "application/vnd.shana.informed.interchange": { source: "iana", extensions: ["iif"] }, "application/vnd.shana.informed.package": { source: "iana", extensions: ["ipk"] }, "application/vnd.shootproof+json": { source: "iana", compressible: true }, "application/vnd.shopkick+json": { source: "iana", compressible: true }, "application/vnd.shp": { source: "iana" }, "application/vnd.shx": { source: "iana" }, "application/vnd.sigrok.session": { source: "iana" }, "application/vnd.simtech-mindmapper": { source: "iana", extensions: ["twd", "twds"] }, "application/vnd.siren+json": { source: "iana", compressible: true }, "application/vnd.smaf": { source: "iana", extensions: ["mmf"] }, "application/vnd.smart.notebook": { source: "iana" }, "application/vnd.smart.teacher": { source: "iana", extensions: ["teacher"] }, "application/vnd.snesdev-page-table": { source: "iana" }, "application/vnd.software602.filler.form+xml": { source: "iana", compressible: true, extensions: ["fo"] }, "application/vnd.software602.filler.form-xml-zip": { source: "iana" }, "application/vnd.solent.sdkm+xml": { source: "iana", compressible: true, extensions: ["sdkm", "sdkd"] }, "application/vnd.spotfire.dxp": { source: "iana", extensions: ["dxp"] }, "application/vnd.spotfire.sfs": { source: "iana", extensions: ["sfs"] }, "application/vnd.sqlite3": { source: "iana" }, "application/vnd.sss-cod": { source: "iana" }, "application/vnd.sss-dtf": { source: "iana" }, "application/vnd.sss-ntf": { source: "iana" }, "application/vnd.stardivision.calc": { source: "apache", extensions: ["sdc"] }, "application/vnd.stardivision.draw": { source: "apache", extensions: ["sda"] }, "application/vnd.stardivision.impress": { source: "apache", extensions: ["sdd"] }, "application/vnd.stardivision.math": { source: "apache", extensions: ["smf"] }, "application/vnd.stardivision.writer": { source: "apache", extensions: ["sdw", "vor"] }, "application/vnd.stardivision.writer-global": { source: "apache", extensions: ["sgl"] }, "application/vnd.stepmania.package": { source: "iana", extensions: ["smzip"] }, "application/vnd.stepmania.stepchart": { source: "iana", extensions: ["sm"] }, "application/vnd.street-stream": { source: "iana" }, "application/vnd.sun.wadl+xml": { source: "iana", compressible: true, extensions: ["wadl"] }, "application/vnd.sun.xml.calc": { source: "apache", extensions: ["sxc"] }, "application/vnd.sun.xml.calc.template": { source: "apache", extensions: ["stc"] }, "application/vnd.sun.xml.draw": { source: "apache", extensions: ["sxd"] }, "application/vnd.sun.xml.draw.template": { source: "apache", extensions: ["std"] }, "application/vnd.sun.xml.impress": { source: "apache", extensions: ["sxi"] }, "application/vnd.sun.xml.impress.template": { source: "apache", extensions: ["sti"] }, "application/vnd.sun.xml.math": { source: "apache", extensions: ["sxm"] }, "application/vnd.sun.xml.writer": { source: "apache", extensions: ["sxw"] }, "application/vnd.sun.xml.writer.global": { source: "apache", extensions: ["sxg"] }, "application/vnd.sun.xml.writer.template": { source: "apache", extensions: ["stw"] }, "application/vnd.sus-calendar": { source: "iana", extensions: ["sus", "susp"] }, "application/vnd.svd": { source: "iana", extensions: ["svd"] }, "application/vnd.swiftview-ics": { source: "iana" }, "application/vnd.sycle+xml": { source: "iana", compressible: true }, "application/vnd.syft+json": { source: "iana", compressible: true }, "application/vnd.symbian.install": { source: "apache", extensions: ["sis", "sisx"] }, "application/vnd.syncml+xml": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["xsm"] }, "application/vnd.syncml.dm+wbxml": { source: "iana", charset: "UTF-8", extensions: ["bdm"] }, "application/vnd.syncml.dm+xml": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["xdm"] }, "application/vnd.syncml.dm.notification": { source: "iana" }, "application/vnd.syncml.dmddf+wbxml": { source: "iana" }, "application/vnd.syncml.dmddf+xml": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["ddf"] }, "application/vnd.syncml.dmtnds+wbxml": { source: "iana" }, "application/vnd.syncml.dmtnds+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.syncml.ds.notification": { source: "iana" }, "application/vnd.tableschema+json": { source: "iana", compressible: true }, "application/vnd.tao.intent-module-archive": { source: "iana", extensions: ["tao"] }, "application/vnd.tcpdump.pcap": { source: "iana", extensions: ["pcap", "cap", "dmp"] }, "application/vnd.think-cell.ppttc+json": { source: "iana", compressible: true }, "application/vnd.tmd.mediaflex.api+xml": { source: "iana", compressible: true }, "application/vnd.tml": { source: "iana" }, "application/vnd.tmobile-livetv": { source: "iana", extensions: ["tmo"] }, "application/vnd.tri.onesource": { source: "iana" }, "application/vnd.trid.tpt": { source: "iana", extensions: ["tpt"] }, "application/vnd.triscape.mxs": { source: "iana", extensions: ["mxs"] }, "application/vnd.trueapp": { source: "iana", extensions: ["tra"] }, "application/vnd.truedoc": { source: "iana" }, "application/vnd.ubisoft.webplayer": { source: "iana" }, "application/vnd.ufdl": { source: "iana", extensions: ["ufd", "ufdl"] }, "application/vnd.uiq.theme": { source: "iana", extensions: ["utz"] }, "application/vnd.umajin": { source: "iana", extensions: ["umj"] }, "application/vnd.unity": { source: "iana", extensions: ["unityweb"] }, "application/vnd.uoml+xml": { source: "iana", compressible: true, extensions: ["uoml"] }, "application/vnd.uplanet.alert": { source: "iana" }, "application/vnd.uplanet.alert-wbxml": { source: "iana" }, "application/vnd.uplanet.bearer-choice": { source: "iana" }, "application/vnd.uplanet.bearer-choice-wbxml": { source: "iana" }, "application/vnd.uplanet.cacheop": { source: "iana" }, "application/vnd.uplanet.cacheop-wbxml": { source: "iana" }, "application/vnd.uplanet.channel": { source: "iana" }, "application/vnd.uplanet.channel-wbxml": { source: "iana" }, "application/vnd.uplanet.list": { source: "iana" }, "application/vnd.uplanet.list-wbxml": { source: "iana" }, "application/vnd.uplanet.listcmd": { source: "iana" }, "application/vnd.uplanet.listcmd-wbxml": { source: "iana" }, "application/vnd.uplanet.signal": { source: "iana" }, "application/vnd.uri-map": { source: "iana" }, "application/vnd.valve.source.material": { source: "iana" }, "application/vnd.vcx": { source: "iana", extensions: ["vcx"] }, "application/vnd.vd-study": { source: "iana" }, "application/vnd.vectorworks": { source: "iana" }, "application/vnd.vel+json": { source: "iana", compressible: true }, "application/vnd.verimatrix.vcas": { source: "iana" }, "application/vnd.veritone.aion+json": { source: "iana", compressible: true }, "application/vnd.veryant.thin": { source: "iana" }, "application/vnd.ves.encrypted": { source: "iana" }, "application/vnd.vidsoft.vidconference": { source: "iana" }, "application/vnd.visio": { source: "iana", extensions: ["vsd", "vst", "vss", "vsw"] }, "application/vnd.visionary": { source: "iana", extensions: ["vis"] }, "application/vnd.vividence.scriptfile": { source: "iana" }, "application/vnd.vsf": { source: "iana", extensions: ["vsf"] }, "application/vnd.wap.sic": { source: "iana" }, "application/vnd.wap.slc": { source: "iana" }, "application/vnd.wap.wbxml": { source: "iana", charset: "UTF-8", extensions: ["wbxml"] }, "application/vnd.wap.wmlc": { source: "iana", extensions: ["wmlc"] }, "application/vnd.wap.wmlscriptc": { source: "iana", extensions: ["wmlsc"] }, "application/vnd.webturbo": { source: "iana", extensions: ["wtb"] }, "application/vnd.wfa.dpp": { source: "iana" }, "application/vnd.wfa.p2p": { source: "iana" }, "application/vnd.wfa.wsc": { source: "iana" }, "application/vnd.windows.devicepairing": { source: "iana" }, "application/vnd.wmc": { source: "iana" }, "application/vnd.wmf.bootstrap": { source: "iana" }, "application/vnd.wolfram.mathematica": { source: "iana" }, "application/vnd.wolfram.mathematica.package": { source: "iana" }, "application/vnd.wolfram.player": { source: "iana", extensions: ["nbp"] }, "application/vnd.wordperfect": { source: "iana", extensions: ["wpd"] }, "application/vnd.wqd": { source: "iana", extensions: ["wqd"] }, "application/vnd.wrq-hp3000-labelled": { source: "iana" }, "application/vnd.wt.stf": { source: "iana", extensions: ["stf"] }, "application/vnd.wv.csp+wbxml": { source: "iana" }, "application/vnd.wv.csp+xml": { source: "iana", compressible: true }, "application/vnd.wv.ssp+xml": { source: "iana", compressible: true }, "application/vnd.xacml+json": { source: "iana", compressible: true }, "application/vnd.xara": { source: "iana", extensions: ["xar"] }, "application/vnd.xfdl": { source: "iana", extensions: ["xfdl"] }, "application/vnd.xfdl.webform": { source: "iana" }, "application/vnd.xmi+xml": { source: "iana", compressible: true }, "application/vnd.xmpie.cpkg": { source: "iana" }, "application/vnd.xmpie.dpkg": { source: "iana" }, "application/vnd.xmpie.plan": { source: "iana" }, "application/vnd.xmpie.ppkg": { source: "iana" }, "application/vnd.xmpie.xlim": { source: "iana" }, "application/vnd.yamaha.hv-dic": { source: "iana", extensions: ["hvd"] }, "application/vnd.yamaha.hv-script": { source: "iana", extensions: ["hvs"] }, "application/vnd.yamaha.hv-voice": { source: "iana", extensions: ["hvp"] }, "application/vnd.yamaha.openscoreformat": { source: "iana", extensions: ["osf"] }, "application/vnd.yamaha.openscoreformat.osfpvg+xml": { source: "iana", compressible: true, extensions: ["osfpvg"] }, "application/vnd.yamaha.remote-setup": { source: "iana" }, "application/vnd.yamaha.smaf-audio": { source: "iana", extensions: ["saf"] }, "application/vnd.yamaha.smaf-phrase": { source: "iana", extensions: ["spf"] }, "application/vnd.yamaha.through-ngn": { source: "iana" }, "application/vnd.yamaha.tunnel-udpencap": { source: "iana" }, "application/vnd.yaoweme": { source: "iana" }, "application/vnd.yellowriver-custom-menu": { source: "iana", extensions: ["cmp"] }, "application/vnd.youtube.yt": { source: "iana" }, "application/vnd.zul": { source: "iana", extensions: ["zir", "zirz"] }, "application/vnd.zzazz.deck+xml": { source: "iana", compressible: true, extensions: ["zaz"] }, "application/voicexml+xml": { source: "iana", compressible: true, extensions: ["vxml"] }, "application/voucher-cms+json": { source: "iana", compressible: true }, "application/vq-rtcpxr": { source: "iana" }, "application/wasm": { source: "iana", compressible: true, extensions: ["wasm"] }, "application/watcherinfo+xml": { source: "iana", compressible: true, extensions: ["wif"] }, "application/webpush-options+json": { source: "iana", compressible: true }, "application/whoispp-query": { source: "iana" }, "application/whoispp-response": { source: "iana" }, "application/widget": { source: "iana", extensions: ["wgt"] }, "application/winhlp": { source: "apache", extensions: ["hlp"] }, "application/wita": { source: "iana" }, "application/wordperfect5.1": { source: "iana" }, "application/wsdl+xml": { source: "iana", compressible: true, extensions: ["wsdl"] }, "application/wspolicy+xml": { source: "iana", compressible: true, extensions: ["wspolicy"] }, "application/x-7z-compressed": { source: "apache", compressible: false, extensions: ["7z"] }, "application/x-abiword": { source: "apache", extensions: ["abw"] }, "application/x-ace-compressed": { source: "apache", extensions: ["ace"] }, "application/x-amf": { source: "apache" }, "application/x-apple-diskimage": { source: "apache", extensions: ["dmg"] }, "application/x-arj": { compressible: false, extensions: ["arj"] }, "application/x-authorware-bin": { source: "apache", extensions: ["aab", "x32", "u32", "vox"] }, "application/x-authorware-map": { source: "apache", extensions: ["aam"] }, "application/x-authorware-seg": { source: "apache", extensions: ["aas"] }, "application/x-bcpio": { source: "apache", extensions: ["bcpio"] }, "application/x-bdoc": { compressible: false, extensions: ["bdoc"] }, "application/x-bittorrent": { source: "apache", extensions: ["torrent"] }, "application/x-blorb": { source: "apache", extensions: ["blb", "blorb"] }, "application/x-bzip": { source: "apache", compressible: false, extensions: ["bz"] }, "application/x-bzip2": { source: "apache", compressible: false, extensions: ["bz2", "boz"] }, "application/x-cbr": { source: "apache", extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] }, "application/x-cdlink": { source: "apache", extensions: ["vcd"] }, "application/x-cfs-compressed": { source: "apache", extensions: ["cfs"] }, "application/x-chat": { source: "apache", extensions: ["chat"] }, "application/x-chess-pgn": { source: "apache", extensions: ["pgn"] }, "application/x-chrome-extension": { extensions: ["crx"] }, "application/x-cocoa": { source: "nginx", extensions: ["cco"] }, "application/x-compress": { source: "apache" }, "application/x-conference": { source: "apache", extensions: ["nsc"] }, "application/x-cpio": { source: "apache", extensions: ["cpio"] }, "application/x-csh": { source: "apache", extensions: ["csh"] }, "application/x-deb": { compressible: false }, "application/x-debian-package": { source: "apache", extensions: ["deb", "udeb"] }, "application/x-dgc-compressed": { source: "apache", extensions: ["dgc"] }, "application/x-director": { source: "apache", extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] }, "application/x-doom": { source: "apache", extensions: ["wad"] }, "application/x-dtbncx+xml": { source: "apache", compressible: true, extensions: ["ncx"] }, "application/x-dtbook+xml": { source: "apache", compressible: true, extensions: ["dtb"] }, "application/x-dtbresource+xml": { source: "apache", compressible: true, extensions: ["res"] }, "application/x-dvi": { source: "apache", compressible: false, extensions: ["dvi"] }, "application/x-envoy": { source: "apache", extensions: ["evy"] }, "application/x-eva": { source: "apache", extensions: ["eva"] }, "application/x-font-bdf": { source: "apache", extensions: ["bdf"] }, "application/x-font-dos": { source: "apache" }, "application/x-font-framemaker": { source: "apache" }, "application/x-font-ghostscript": { source: "apache", extensions: ["gsf"] }, "application/x-font-libgrx": { source: "apache" }, "application/x-font-linux-psf": { source: "apache", extensions: ["psf"] }, "application/x-font-pcf": { source: "apache", extensions: ["pcf"] }, "application/x-font-snf": { source: "apache", extensions: ["snf"] }, "application/x-font-speedo": { source: "apache" }, "application/x-font-sunos-news": { source: "apache" }, "application/x-font-type1": { source: "apache", extensions: ["pfa", "pfb", "pfm", "afm"] }, "application/x-font-vfont": { source: "apache" }, "application/x-freearc": { source: "apache", extensions: ["arc"] }, "application/x-futuresplash": { source: "apache", extensions: ["spl"] }, "application/x-gca-compressed": { source: "apache", extensions: ["gca"] }, "application/x-glulx": { source: "apache", extensions: ["ulx"] }, "application/x-gnumeric": { source: "apache", extensions: ["gnumeric"] }, "application/x-gramps-xml": { source: "apache", extensions: ["gramps"] }, "application/x-gtar": { source: "apache", extensions: ["gtar"] }, "application/x-gzip": { source: "apache" }, "application/x-hdf": { source: "apache", extensions: ["hdf"] }, "application/x-httpd-php": { compressible: true, extensions: ["php"] }, "application/x-install-instructions": { source: "apache", extensions: ["install"] }, "application/x-iso9660-image": { source: "apache", extensions: ["iso"] }, "application/x-iwork-keynote-sffkey": { extensions: ["key"] }, "application/x-iwork-numbers-sffnumbers": { extensions: ["numbers"] }, "application/x-iwork-pages-sffpages": { extensions: ["pages"] }, "application/x-java-archive-diff": { source: "nginx", extensions: ["jardiff"] }, "application/x-java-jnlp-file": { source: "apache", compressible: false, extensions: ["jnlp"] }, "application/x-javascript": { compressible: true }, "application/x-keepass2": { extensions: ["kdbx"] }, "application/x-latex": { source: "apache", compressible: false, extensions: ["latex"] }, "application/x-lua-bytecode": { extensions: ["luac"] }, "application/x-lzh-compressed": { source: "apache", extensions: ["lzh", "lha"] }, "application/x-makeself": { source: "nginx", extensions: ["run"] }, "application/x-mie": { source: "apache", extensions: ["mie"] }, "application/x-mobipocket-ebook": { source: "apache", extensions: ["prc", "mobi"] }, "application/x-mpegurl": { compressible: false }, "application/x-ms-application": { source: "apache", extensions: ["application"] }, "application/x-ms-shortcut": { source: "apache", extensions: ["lnk"] }, "application/x-ms-wmd": { source: "apache", extensions: ["wmd"] }, "application/x-ms-wmz": { source: "apache", extensions: ["wmz"] }, "application/x-ms-xbap": { source: "apache", extensions: ["xbap"] }, "application/x-msaccess": { source: "apache", extensions: ["mdb"] }, "application/x-msbinder": { source: "apache", extensions: ["obd"] }, "application/x-mscardfile": { source: "apache", extensions: ["crd"] }, "application/x-msclip": { source: "apache", extensions: ["clp"] }, "application/x-msdos-program": { extensions: ["exe"] }, "application/x-msdownload": { source: "apache", extensions: ["exe", "dll", "com", "bat", "msi"] }, "application/x-msmediaview": { source: "apache", extensions: ["mvb", "m13", "m14"] }, "application/x-msmetafile": { source: "apache", extensions: ["wmf", "wmz", "emf", "emz"] }, "application/x-msmoney": { source: "apache", extensions: ["mny"] }, "application/x-mspublisher": { source: "apache", extensions: ["pub"] }, "application/x-msschedule": { source: "apache", extensions: ["scd"] }, "application/x-msterminal": { source: "apache", extensions: ["trm"] }, "application/x-mswrite": { source: "apache", extensions: ["wri"] }, "application/x-netcdf": { source: "apache", extensions: ["nc", "cdf"] }, "application/x-ns-proxy-autoconfig": { compressible: true, extensions: ["pac"] }, "application/x-nzb": { source: "apache", extensions: ["nzb"] }, "application/x-perl": { source: "nginx", extensions: ["pl", "pm"] }, "application/x-pilot": { source: "nginx", extensions: ["prc", "pdb"] }, "application/x-pkcs12": { source: "apache", compressible: false, extensions: ["p12", "pfx"] }, "application/x-pkcs7-certificates": { source: "apache", extensions: ["p7b", "spc"] }, "application/x-pkcs7-certreqresp": { source: "apache", extensions: ["p7r"] }, "application/x-pki-message": { source: "iana" }, "application/x-rar-compressed": { source: "apache", compressible: false, extensions: ["rar"] }, "application/x-redhat-package-manager": { source: "nginx", extensions: ["rpm"] }, "application/x-research-info-systems": { source: "apache", extensions: ["ris"] }, "application/x-sea": { source: "nginx", extensions: ["sea"] }, "application/x-sh": { source: "apache", compressible: true, extensions: ["sh"] }, "application/x-shar": { source: "apache", extensions: ["shar"] }, "application/x-shockwave-flash": { source: "apache", compressible: false, extensions: ["swf"] }, "application/x-silverlight-app": { source: "apache", extensions: ["xap"] }, "application/x-sql": { source: "apache", extensions: ["sql"] }, "application/x-stuffit": { source: "apache", compressible: false, extensions: ["sit"] }, "application/x-stuffitx": { source: "apache", extensions: ["sitx"] }, "application/x-subrip": { source: "apache", extensions: ["srt"] }, "application/x-sv4cpio": { source: "apache", extensions: ["sv4cpio"] }, "application/x-sv4crc": { source: "apache", extensions: ["sv4crc"] }, "application/x-t3vm-image": { source: "apache", extensions: ["t3"] }, "application/x-tads": { source: "apache", extensions: ["gam"] }, "application/x-tar": { source: "apache", compressible: true, extensions: ["tar"] }, "application/x-tcl": { source: "apache", extensions: ["tcl", "tk"] }, "application/x-tex": { source: "apache", extensions: ["tex"] }, "application/x-tex-tfm": { source: "apache", extensions: ["tfm"] }, "application/x-texinfo": { source: "apache", extensions: ["texinfo", "texi"] }, "application/x-tgif": { source: "apache", extensions: ["obj"] }, "application/x-ustar": { source: "apache", extensions: ["ustar"] }, "application/x-virtualbox-hdd": { compressible: true, extensions: ["hdd"] }, "application/x-virtualbox-ova": { compressible: true, extensions: ["ova"] }, "application/x-virtualbox-ovf": { compressible: true, extensions: ["ovf"] }, "application/x-virtualbox-vbox": { compressible: true, extensions: ["vbox"] }, "application/x-virtualbox-vbox-extpack": { compressible: false, extensions: ["vbox-extpack"] }, "application/x-virtualbox-vdi": { compressible: true, extensions: ["vdi"] }, "application/x-virtualbox-vhd": { compressible: true, extensions: ["vhd"] }, "application/x-virtualbox-vmdk": { compressible: true, extensions: ["vmdk"] }, "application/x-wais-source": { source: "apache", extensions: ["src"] }, "application/x-web-app-manifest+json": { compressible: true, extensions: ["webapp"] }, "application/x-www-form-urlencoded": { source: "iana", compressible: true }, "application/x-x509-ca-cert": { source: "iana", extensions: ["der", "crt", "pem"] }, "application/x-x509-ca-ra-cert": { source: "iana" }, "application/x-x509-next-ca-cert": { source: "iana" }, "application/x-xfig": { source: "apache", extensions: ["fig"] }, "application/x-xliff+xml": { source: "apache", compressible: true, extensions: ["xlf"] }, "application/x-xpinstall": { source: "apache", compressible: false, extensions: ["xpi"] }, "application/x-xz": { source: "apache", extensions: ["xz"] }, "application/x-zmachine": { source: "apache", extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] }, "application/x400-bp": { source: "iana" }, "application/xacml+xml": { source: "iana", compressible: true }, "application/xaml+xml": { source: "apache", compressible: true, extensions: ["xaml"] }, "application/xcap-att+xml": { source: "iana", compressible: true, extensions: ["xav"] }, "application/xcap-caps+xml": { source: "iana", compressible: true, extensions: ["xca"] }, "application/xcap-diff+xml": { source: "iana", compressible: true, extensions: ["xdf"] }, "application/xcap-el+xml": { source: "iana", compressible: true, extensions: ["xel"] }, "application/xcap-error+xml": { source: "iana", compressible: true }, "application/xcap-ns+xml": { source: "iana", compressible: true, extensions: ["xns"] }, "application/xcon-conference-info+xml": { source: "iana", compressible: true }, "application/xcon-conference-info-diff+xml": { source: "iana", compressible: true }, "application/xenc+xml": { source: "iana", compressible: true, extensions: ["xenc"] }, "application/xhtml+xml": { source: "iana", compressible: true, extensions: ["xhtml", "xht"] }, "application/xhtml-voice+xml": { source: "apache", compressible: true }, "application/xliff+xml": { source: "iana", compressible: true, extensions: ["xlf"] }, "application/xml": { source: "iana", compressible: true, extensions: ["xml", "xsl", "xsd", "rng"] }, "application/xml-dtd": { source: "iana", compressible: true, extensions: ["dtd"] }, "application/xml-external-parsed-entity": { source: "iana" }, "application/xml-patch+xml": { source: "iana", compressible: true }, "application/xmpp+xml": { source: "iana", compressible: true }, "application/xop+xml": { source: "iana", compressible: true, extensions: ["xop"] }, "application/xproc+xml": { source: "apache", compressible: true, extensions: ["xpl"] }, "application/xslt+xml": { source: "iana", compressible: true, extensions: ["xsl", "xslt"] }, "application/xspf+xml": { source: "apache", compressible: true, extensions: ["xspf"] }, "application/xv+xml": { source: "iana", compressible: true, extensions: ["mxml", "xhvml", "xvml", "xvm"] }, "application/yang": { source: "iana", extensions: ["yang"] }, "application/yang-data+json": { source: "iana", compressible: true }, "application/yang-data+xml": { source: "iana", compressible: true }, "application/yang-patch+json": { source: "iana", compressible: true }, "application/yang-patch+xml": { source: "iana", compressible: true }, "application/yin+xml": { source: "iana", compressible: true, extensions: ["yin"] }, "application/zip": { source: "iana", compressible: false, extensions: ["zip"] }, "application/zlib": { source: "iana" }, "application/zstd": { source: "iana" }, "audio/1d-interleaved-parityfec": { source: "iana" }, "audio/32kadpcm": { source: "iana" }, "audio/3gpp": { source: "iana", compressible: false, extensions: ["3gpp"] }, "audio/3gpp2": { source: "iana" }, "audio/aac": { source: "iana" }, "audio/ac3": { source: "iana" }, "audio/adpcm": { source: "apache", extensions: ["adp"] }, "audio/amr": { source: "iana", extensions: ["amr"] }, "audio/amr-wb": { source: "iana" }, "audio/amr-wb+": { source: "iana" }, "audio/aptx": { source: "iana" }, "audio/asc": { source: "iana" }, "audio/atrac-advanced-lossless": { source: "iana" }, "audio/atrac-x": { source: "iana" }, "audio/atrac3": { source: "iana" }, "audio/basic": { source: "iana", compressible: false, extensions: ["au", "snd"] }, "audio/bv16": { source: "iana" }, "audio/bv32": { source: "iana" }, "audio/clearmode": { source: "iana" }, "audio/cn": { source: "iana" }, "audio/dat12": { source: "iana" }, "audio/dls": { source: "iana" }, "audio/dsr-es201108": { source: "iana" }, "audio/dsr-es202050": { source: "iana" }, "audio/dsr-es202211": { source: "iana" }, "audio/dsr-es202212": { source: "iana" }, "audio/dv": { source: "iana" }, "audio/dvi4": { source: "iana" }, "audio/eac3": { source: "iana" }, "audio/encaprtp": { source: "iana" }, "audio/evrc": { source: "iana" }, "audio/evrc-qcp": { source: "iana" }, "audio/evrc0": { source: "iana" }, "audio/evrc1": { source: "iana" }, "audio/evrcb": { source: "iana" }, "audio/evrcb0": { source: "iana" }, "audio/evrcb1": { source: "iana" }, "audio/evrcnw": { source: "iana" }, "audio/evrcnw0": { source: "iana" }, "audio/evrcnw1": { source: "iana" }, "audio/evrcwb": { source: "iana" }, "audio/evrcwb0": { source: "iana" }, "audio/evrcwb1": { source: "iana" }, "audio/evs": { source: "iana" }, "audio/flexfec": { source: "iana" }, "audio/fwdred": { source: "iana" }, "audio/g711-0": { source: "iana" }, "audio/g719": { source: "iana" }, "audio/g722": { source: "iana" }, "audio/g7221": { source: "iana" }, "audio/g723": { source: "iana" }, "audio/g726-16": { source: "iana" }, "audio/g726-24": { source: "iana" }, "audio/g726-32": { source: "iana" }, "audio/g726-40": { source: "iana" }, "audio/g728": { source: "iana" }, "audio/g729": { source: "iana" }, "audio/g7291": { source: "iana" }, "audio/g729d": { source: "iana" }, "audio/g729e": { source: "iana" }, "audio/gsm": { source: "iana" }, "audio/gsm-efr": { source: "iana" }, "audio/gsm-hr-08": { source: "iana" }, "audio/ilbc": { source: "iana" }, "audio/ip-mr_v2.5": { source: "iana" }, "audio/isac": { source: "apache" }, "audio/l16": { source: "iana" }, "audio/l20": { source: "iana" }, "audio/l24": { source: "iana", compressible: false }, "audio/l8": { source: "iana" }, "audio/lpc": { source: "iana" }, "audio/melp": { source: "iana" }, "audio/melp1200": { source: "iana" }, "audio/melp2400": { source: "iana" }, "audio/melp600": { source: "iana" }, "audio/mhas": { source: "iana" }, "audio/midi": { source: "apache", extensions: ["mid", "midi", "kar", "rmi"] }, "audio/mobile-xmf": { source: "iana", extensions: ["mxmf"] }, "audio/mp3": { compressible: false, extensions: ["mp3"] }, "audio/mp4": { source: "iana", compressible: false, extensions: ["m4a", "mp4a"] }, "audio/mp4a-latm": { source: "iana" }, "audio/mpa": { source: "iana" }, "audio/mpa-robust": { source: "iana" }, "audio/mpeg": { source: "iana", compressible: false, extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] }, "audio/mpeg4-generic": { source: "iana" }, "audio/musepack": { source: "apache" }, "audio/ogg": { source: "iana", compressible: false, extensions: ["oga", "ogg", "spx", "opus"] }, "audio/opus": { source: "iana" }, "audio/parityfec": { source: "iana" }, "audio/pcma": { source: "iana" }, "audio/pcma-wb": { source: "iana" }, "audio/pcmu": { source: "iana" }, "audio/pcmu-wb": { source: "iana" }, "audio/prs.sid": { source: "iana" }, "audio/qcelp": { source: "iana" }, "audio/raptorfec": { source: "iana" }, "audio/red": { source: "iana" }, "audio/rtp-enc-aescm128": { source: "iana" }, "audio/rtp-midi": { source: "iana" }, "audio/rtploopback": { source: "iana" }, "audio/rtx": { source: "iana" }, "audio/s3m": { source: "apache", extensions: ["s3m"] }, "audio/scip": { source: "iana" }, "audio/silk": { source: "apache", extensions: ["sil"] }, "audio/smv": { source: "iana" }, "audio/smv-qcp": { source: "iana" }, "audio/smv0": { source: "iana" }, "audio/sofa": { source: "iana" }, "audio/sp-midi": { source: "iana" }, "audio/speex": { source: "iana" }, "audio/t140c": { source: "iana" }, "audio/t38": { source: "iana" }, "audio/telephone-event": { source: "iana" }, "audio/tetra_acelp": { source: "iana" }, "audio/tetra_acelp_bb": { source: "iana" }, "audio/tone": { source: "iana" }, "audio/tsvcis": { source: "iana" }, "audio/uemclip": { source: "iana" }, "audio/ulpfec": { source: "iana" }, "audio/usac": { source: "iana" }, "audio/vdvi": { source: "iana" }, "audio/vmr-wb": { source: "iana" }, "audio/vnd.3gpp.iufp": { source: "iana" }, "audio/vnd.4sb": { source: "iana" }, "audio/vnd.audiokoz": { source: "iana" }, "audio/vnd.celp": { source: "iana" }, "audio/vnd.cisco.nse": { source: "iana" }, "audio/vnd.cmles.radio-events": { source: "iana" }, "audio/vnd.cns.anp1": { source: "iana" }, "audio/vnd.cns.inf1": { source: "iana" }, "audio/vnd.dece.audio": { source: "iana", extensions: ["uva", "uvva"] }, "audio/vnd.digital-winds": { source: "iana", extensions: ["eol"] }, "audio/vnd.dlna.adts": { source: "iana" }, "audio/vnd.dolby.heaac.1": { source: "iana" }, "audio/vnd.dolby.heaac.2": { source: "iana" }, "audio/vnd.dolby.mlp": { source: "iana" }, "audio/vnd.dolby.mps": { source: "iana" }, "audio/vnd.dolby.pl2": { source: "iana" }, "audio/vnd.dolby.pl2x": { source: "iana" }, "audio/vnd.dolby.pl2z": { source: "iana" }, "audio/vnd.dolby.pulse.1": { source: "iana" }, "audio/vnd.dra": { source: "iana", extensions: ["dra"] }, "audio/vnd.dts": { source: "iana", extensions: ["dts"] }, "audio/vnd.dts.hd": { source: "iana", extensions: ["dtshd"] }, "audio/vnd.dts.uhd": { source: "iana" }, "audio/vnd.dvb.file": { source: "iana" }, "audio/vnd.everad.plj": { source: "iana" }, "audio/vnd.hns.audio": { source: "iana" }, "audio/vnd.lucent.voice": { source: "iana", extensions: ["lvp"] }, "audio/vnd.ms-playready.media.pya": { source: "iana", extensions: ["pya"] }, "audio/vnd.nokia.mobile-xmf": { source: "iana" }, "audio/vnd.nortel.vbk": { source: "iana" }, "audio/vnd.nuera.ecelp4800": { source: "iana", extensions: ["ecelp4800"] }, "audio/vnd.nuera.ecelp7470": { source: "iana", extensions: ["ecelp7470"] }, "audio/vnd.nuera.ecelp9600": { source: "iana", extensions: ["ecelp9600"] }, "audio/vnd.octel.sbc": { source: "iana" }, "audio/vnd.presonus.multitrack": { source: "iana" }, "audio/vnd.qcelp": { source: "iana" }, "audio/vnd.rhetorex.32kadpcm": { source: "iana" }, "audio/vnd.rip": { source: "iana", extensions: ["rip"] }, "audio/vnd.rn-realaudio": { compressible: false }, "audio/vnd.sealedmedia.softseal.mpeg": { source: "iana" }, "audio/vnd.vmx.cvsd": { source: "iana" }, "audio/vnd.wave": { compressible: false }, "audio/vorbis": { source: "iana", compressible: false }, "audio/vorbis-config": { source: "iana" }, "audio/wav": { compressible: false, extensions: ["wav"] }, "audio/wave": { compressible: false, extensions: ["wav"] }, "audio/webm": { source: "apache", compressible: false, extensions: ["weba"] }, "audio/x-aac": { source: "apache", compressible: false, extensions: ["aac"] }, "audio/x-aiff": { source: "apache", extensions: ["aif", "aiff", "aifc"] }, "audio/x-caf": { source: "apache", compressible: false, extensions: ["caf"] }, "audio/x-flac": { source: "apache", extensions: ["flac"] }, "audio/x-m4a": { source: "nginx", extensions: ["m4a"] }, "audio/x-matroska": { source: "apache", extensions: ["mka"] }, "audio/x-mpegurl": { source: "apache", extensions: ["m3u"] }, "audio/x-ms-wax": { source: "apache", extensions: ["wax"] }, "audio/x-ms-wma": { source: "apache", extensions: ["wma"] }, "audio/x-pn-realaudio": { source: "apache", extensions: ["ram", "ra"] }, "audio/x-pn-realaudio-plugin": { source: "apache", extensions: ["rmp"] }, "audio/x-realaudio": { source: "nginx", extensions: ["ra"] }, "audio/x-tta": { source: "apache" }, "audio/x-wav": { source: "apache", extensions: ["wav"] }, "audio/xm": { source: "apache", extensions: ["xm"] }, "chemical/x-cdx": { source: "apache", extensions: ["cdx"] }, "chemical/x-cif": { source: "apache", extensions: ["cif"] }, "chemical/x-cmdf": { source: "apache", extensions: ["cmdf"] }, "chemical/x-cml": { source: "apache", extensions: ["cml"] }, "chemical/x-csml": { source: "apache", extensions: ["csml"] }, "chemical/x-pdb": { source: "apache" }, "chemical/x-xyz": { source: "apache", extensions: ["xyz"] }, "font/collection": { source: "iana", extensions: ["ttc"] }, "font/otf": { source: "iana", compressible: true, extensions: ["otf"] }, "font/sfnt": { source: "iana" }, "font/ttf": { source: "iana", compressible: true, extensions: ["ttf"] }, "font/woff": { source: "iana", extensions: ["woff"] }, "font/woff2": { source: "iana", extensions: ["woff2"] }, "image/aces": { source: "iana", extensions: ["exr"] }, "image/apng": { compressible: false, extensions: ["apng"] }, "image/avci": { source: "iana", extensions: ["avci"] }, "image/avcs": { source: "iana", extensions: ["avcs"] }, "image/avif": { source: "iana", compressible: false, extensions: ["avif"] }, "image/bmp": { source: "iana", compressible: true, extensions: ["bmp"] }, "image/cgm": { source: "iana", extensions: ["cgm"] }, "image/dicom-rle": { source: "iana", extensions: ["drle"] }, "image/emf": { source: "iana", extensions: ["emf"] }, "image/fits": { source: "iana", extensions: ["fits"] }, "image/g3fax": { source: "iana", extensions: ["g3"] }, "image/gif": { source: "iana", compressible: false, extensions: ["gif"] }, "image/heic": { source: "iana", extensions: ["heic"] }, "image/heic-sequence": { source: "iana", extensions: ["heics"] }, "image/heif": { source: "iana", extensions: ["heif"] }, "image/heif-sequence": { source: "iana", extensions: ["heifs"] }, "image/hej2k": { source: "iana", extensions: ["hej2"] }, "image/hsj2": { source: "iana", extensions: ["hsj2"] }, "image/ief": { source: "iana", extensions: ["ief"] }, "image/jls": { source: "iana", extensions: ["jls"] }, "image/jp2": { source: "iana", compressible: false, extensions: ["jp2", "jpg2"] }, "image/jpeg": { source: "iana", compressible: false, extensions: ["jpeg", "jpg", "jpe"] }, "image/jph": { source: "iana", extensions: ["jph"] }, "image/jphc": { source: "iana", extensions: ["jhc"] }, "image/jpm": { source: "iana", compressible: false, extensions: ["jpm"] }, "image/jpx": { source: "iana", compressible: false, extensions: ["jpx", "jpf"] }, "image/jxr": { source: "iana", extensions: ["jxr"] }, "image/jxra": { source: "iana", extensions: ["jxra"] }, "image/jxrs": { source: "iana", extensions: ["jxrs"] }, "image/jxs": { source: "iana", extensions: ["jxs"] }, "image/jxsc": { source: "iana", extensions: ["jxsc"] }, "image/jxsi": { source: "iana", extensions: ["jxsi"] }, "image/jxss": { source: "iana", extensions: ["jxss"] }, "image/ktx": { source: "iana", extensions: ["ktx"] }, "image/ktx2": { source: "iana", extensions: ["ktx2"] }, "image/naplps": { source: "iana" }, "image/pjpeg": { compressible: false }, "image/png": { source: "iana", compressible: false, extensions: ["png"] }, "image/prs.btif": { source: "iana", extensions: ["btif"] }, "image/prs.pti": { source: "iana", extensions: ["pti"] }, "image/pwg-raster": { source: "iana" }, "image/sgi": { source: "apache", extensions: ["sgi"] }, "image/svg+xml": { source: "iana", compressible: true, extensions: ["svg", "svgz"] }, "image/t38": { source: "iana", extensions: ["t38"] }, "image/tiff": { source: "iana", compressible: false, extensions: ["tif", "tiff"] }, "image/tiff-fx": { source: "iana", extensions: ["tfx"] }, "image/vnd.adobe.photoshop": { source: "iana", compressible: true, extensions: ["psd"] }, "image/vnd.airzip.accelerator.azv": { source: "iana", extensions: ["azv"] }, "image/vnd.cns.inf2": { source: "iana" }, "image/vnd.dece.graphic": { source: "iana", extensions: ["uvi", "uvvi", "uvg", "uvvg"] }, "image/vnd.djvu": { source: "iana", extensions: ["djvu", "djv"] }, "image/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] }, "image/vnd.dwg": { source: "iana", extensions: ["dwg"] }, "image/vnd.dxf": { source: "iana", extensions: ["dxf"] }, "image/vnd.fastbidsheet": { source: "iana", extensions: ["fbs"] }, "image/vnd.fpx": { source: "iana", extensions: ["fpx"] }, "image/vnd.fst": { source: "iana", extensions: ["fst"] }, "image/vnd.fujixerox.edmics-mmr": { source: "iana", extensions: ["mmr"] }, "image/vnd.fujixerox.edmics-rlc": { source: "iana", extensions: ["rlc"] }, "image/vnd.globalgraphics.pgb": { source: "iana" }, "image/vnd.microsoft.icon": { source: "iana", compressible: true, extensions: ["ico"] }, "image/vnd.mix": { source: "iana" }, "image/vnd.mozilla.apng": { source: "iana" }, "image/vnd.ms-dds": { compressible: true, extensions: ["dds"] }, "image/vnd.ms-modi": { source: "iana", extensions: ["mdi"] }, "image/vnd.ms-photo": { source: "apache", extensions: ["wdp"] }, "image/vnd.net-fpx": { source: "iana", extensions: ["npx"] }, "image/vnd.pco.b16": { source: "iana", extensions: ["b16"] }, "image/vnd.radiance": { source: "iana" }, "image/vnd.sealed.png": { source: "iana" }, "image/vnd.sealedmedia.softseal.gif": { source: "iana" }, "image/vnd.sealedmedia.softseal.jpg": { source: "iana" }, "image/vnd.svf": { source: "iana" }, "image/vnd.tencent.tap": { source: "iana", extensions: ["tap"] }, "image/vnd.valve.source.texture": { source: "iana", extensions: ["vtf"] }, "image/vnd.wap.wbmp": { source: "iana", extensions: ["wbmp"] }, "image/vnd.xiff": { source: "iana", extensions: ["xif"] }, "image/vnd.zbrush.pcx": { source: "iana", extensions: ["pcx"] }, "image/webp": { source: "apache", extensions: ["webp"] }, "image/wmf": { source: "iana", extensions: ["wmf"] }, "image/x-3ds": { source: "apache", extensions: ["3ds"] }, "image/x-cmu-raster": { source: "apache", extensions: ["ras"] }, "image/x-cmx": { source: "apache", extensions: ["cmx"] }, "image/x-freehand": { source: "apache", extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] }, "image/x-icon": { source: "apache", compressible: true, extensions: ["ico"] }, "image/x-jng": { source: "nginx", extensions: ["jng"] }, "image/x-mrsid-image": { source: "apache", extensions: ["sid"] }, "image/x-ms-bmp": { source: "nginx", compressible: true, extensions: ["bmp"] }, "image/x-pcx": { source: "apache", extensions: ["pcx"] }, "image/x-pict": { source: "apache", extensions: ["pic", "pct"] }, "image/x-portable-anymap": { source: "apache", extensions: ["pnm"] }, "image/x-portable-bitmap": { source: "apache", extensions: ["pbm"] }, "image/x-portable-graymap": { source: "apache", extensions: ["pgm"] }, "image/x-portable-pixmap": { source: "apache", extensions: ["ppm"] }, "image/x-rgb": { source: "apache", extensions: ["rgb"] }, "image/x-tga": { source: "apache", extensions: ["tga"] }, "image/x-xbitmap": { source: "apache", extensions: ["xbm"] }, "image/x-xcf": { compressible: false }, "image/x-xpixmap": { source: "apache", extensions: ["xpm"] }, "image/x-xwindowdump": { source: "apache", extensions: ["xwd"] }, "message/cpim": { source: "iana" }, "message/delivery-status": { source: "iana" }, "message/disposition-notification": { source: "iana", extensions: [ "disposition-notification" ] }, "message/external-body": { source: "iana" }, "message/feedback-report": { source: "iana" }, "message/global": { source: "iana", extensions: ["u8msg"] }, "message/global-delivery-status": { source: "iana", extensions: ["u8dsn"] }, "message/global-disposition-notification": { source: "iana", extensions: ["u8mdn"] }, "message/global-headers": { source: "iana", extensions: ["u8hdr"] }, "message/http": { source: "iana", compressible: false }, "message/imdn+xml": { source: "iana", compressible: true }, "message/news": { source: "iana" }, "message/partial": { source: "iana", compressible: false }, "message/rfc822": { source: "iana", compressible: true, extensions: ["eml", "mime"] }, "message/s-http": { source: "iana" }, "message/sip": { source: "iana" }, "message/sipfrag": { source: "iana" }, "message/tracking-status": { source: "iana" }, "message/vnd.si.simp": { source: "iana" }, "message/vnd.wfa.wsc": { source: "iana", extensions: ["wsc"] }, "model/3mf": { source: "iana", extensions: ["3mf"] }, "model/e57": { source: "iana" }, "model/gltf+json": { source: "iana", compressible: true, extensions: ["gltf"] }, "model/gltf-binary": { source: "iana", compressible: true, extensions: ["glb"] }, "model/iges": { source: "iana", compressible: false, extensions: ["igs", "iges"] }, "model/mesh": { source: "iana", compressible: false, extensions: ["msh", "mesh", "silo"] }, "model/mtl": { source: "iana", extensions: ["mtl"] }, "model/obj": { source: "iana", extensions: ["obj"] }, "model/step": { source: "iana" }, "model/step+xml": { source: "iana", compressible: true, extensions: ["stpx"] }, "model/step+zip": { source: "iana", compressible: false, extensions: ["stpz"] }, "model/step-xml+zip": { source: "iana", compressible: false, extensions: ["stpxz"] }, "model/stl": { source: "iana", extensions: ["stl"] }, "model/vnd.collada+xml": { source: "iana", compressible: true, extensions: ["dae"] }, "model/vnd.dwf": { source: "iana", extensions: ["dwf"] }, "model/vnd.flatland.3dml": { source: "iana" }, "model/vnd.gdl": { source: "iana", extensions: ["gdl"] }, "model/vnd.gs-gdl": { source: "apache" }, "model/vnd.gs.gdl": { source: "iana" }, "model/vnd.gtw": { source: "iana", extensions: ["gtw"] }, "model/vnd.moml+xml": { source: "iana", compressible: true }, "model/vnd.mts": { source: "iana", extensions: ["mts"] }, "model/vnd.opengex": { source: "iana", extensions: ["ogex"] }, "model/vnd.parasolid.transmit.binary": { source: "iana", extensions: ["x_b"] }, "model/vnd.parasolid.transmit.text": { source: "iana", extensions: ["x_t"] }, "model/vnd.pytha.pyox": { source: "iana" }, "model/vnd.rosette.annotated-data-model": { source: "iana" }, "model/vnd.sap.vds": { source: "iana", extensions: ["vds"] }, "model/vnd.usdz+zip": { source: "iana", compressible: false, extensions: ["usdz"] }, "model/vnd.valve.source.compiled-map": { source: "iana", extensions: ["bsp"] }, "model/vnd.vtu": { source: "iana", extensions: ["vtu"] }, "model/vrml": { source: "iana", compressible: false, extensions: ["wrl", "vrml"] }, "model/x3d+binary": { source: "apache", compressible: false, extensions: ["x3db", "x3dbz"] }, "model/x3d+fastinfoset": { source: "iana", extensions: ["x3db"] }, "model/x3d+vrml": { source: "apache", compressible: false, extensions: ["x3dv", "x3dvz"] }, "model/x3d+xml": { source: "iana", compressible: true, extensions: ["x3d", "x3dz"] }, "model/x3d-vrml": { source: "iana", extensions: ["x3dv"] }, "multipart/alternative": { source: "iana", compressible: false }, "multipart/appledouble": { source: "iana" }, "multipart/byteranges": { source: "iana" }, "multipart/digest": { source: "iana" }, "multipart/encrypted": { source: "iana", compressible: false }, "multipart/form-data": { source: "iana", compressible: false }, "multipart/header-set": { source: "iana" }, "multipart/mixed": { source: "iana" }, "multipart/multilingual": { source: "iana" }, "multipart/parallel": { source: "iana" }, "multipart/related": { source: "iana", compressible: false }, "multipart/report": { source: "iana" }, "multipart/signed": { source: "iana", compressible: false }, "multipart/vnd.bint.med-plus": { source: "iana" }, "multipart/voice-message": { source: "iana" }, "multipart/x-mixed-replace": { source: "iana" }, "text/1d-interleaved-parityfec": { source: "iana" }, "text/cache-manifest": { source: "iana", compressible: true, extensions: ["appcache", "manifest"] }, "text/calendar": { source: "iana", extensions: ["ics", "ifb"] }, "text/calender": { compressible: true }, "text/cmd": { compressible: true }, "text/coffeescript": { extensions: ["coffee", "litcoffee"] }, "text/cql": { source: "iana" }, "text/cql-expression": { source: "iana" }, "text/cql-identifier": { source: "iana" }, "text/css": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["css"] }, "text/csv": { source: "iana", compressible: true, extensions: ["csv"] }, "text/csv-schema": { source: "iana" }, "text/directory": { source: "iana" }, "text/dns": { source: "iana" }, "text/ecmascript": { source: "iana" }, "text/encaprtp": { source: "iana" }, "text/enriched": { source: "iana" }, "text/fhirpath": { source: "iana" }, "text/flexfec": { source: "iana" }, "text/fwdred": { source: "iana" }, "text/gff3": { source: "iana" }, "text/grammar-ref-list": { source: "iana" }, "text/html": { source: "iana", compressible: true, extensions: ["html", "htm", "shtml"] }, "text/jade": { extensions: ["jade"] }, "text/javascript": { source: "iana", compressible: true }, "text/jcr-cnd": { source: "iana" }, "text/jsx": { compressible: true, extensions: ["jsx"] }, "text/less": { compressible: true, extensions: ["less"] }, "text/markdown": { source: "iana", compressible: true, extensions: ["markdown", "md"] }, "text/mathml": { source: "nginx", extensions: ["mml"] }, "text/mdx": { compressible: true, extensions: ["mdx"] }, "text/mizar": { source: "iana" }, "text/n3": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["n3"] }, "text/parameters": { source: "iana", charset: "UTF-8" }, "text/parityfec": { source: "iana" }, "text/plain": { source: "iana", compressible: true, extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] }, "text/provenance-notation": { source: "iana", charset: "UTF-8" }, "text/prs.fallenstein.rst": { source: "iana" }, "text/prs.lines.tag": { source: "iana", extensions: ["dsc"] }, "text/prs.prop.logic": { source: "iana" }, "text/raptorfec": { source: "iana" }, "text/red": { source: "iana" }, "text/rfc822-headers": { source: "iana" }, "text/richtext": { source: "iana", compressible: true, extensions: ["rtx"] }, "text/rtf": { source: "iana", compressible: true, extensions: ["rtf"] }, "text/rtp-enc-aescm128": { source: "iana" }, "text/rtploopback": { source: "iana" }, "text/rtx": { source: "iana" }, "text/sgml": { source: "iana", extensions: ["sgml", "sgm"] }, "text/shaclc": { source: "iana" }, "text/shex": { source: "iana", extensions: ["shex"] }, "text/slim": { extensions: ["slim", "slm"] }, "text/spdx": { source: "iana", extensions: ["spdx"] }, "text/strings": { source: "iana" }, "text/stylus": { extensions: ["stylus", "styl"] }, "text/t140": { source: "iana" }, "text/tab-separated-values": { source: "iana", compressible: true, extensions: ["tsv"] }, "text/troff": { source: "iana", extensions: ["t", "tr", "roff", "man", "me", "ms"] }, "text/turtle": { source: "iana", charset: "UTF-8", extensions: ["ttl"] }, "text/ulpfec": { source: "iana" }, "text/uri-list": { source: "iana", compressible: true, extensions: ["uri", "uris", "urls"] }, "text/vcard": { source: "iana", compressible: true, extensions: ["vcard"] }, "text/vnd.a": { source: "iana" }, "text/vnd.abc": { source: "iana" }, "text/vnd.ascii-art": { source: "iana" }, "text/vnd.curl": { source: "iana", extensions: ["curl"] }, "text/vnd.curl.dcurl": { source: "apache", extensions: ["dcurl"] }, "text/vnd.curl.mcurl": { source: "apache", extensions: ["mcurl"] }, "text/vnd.curl.scurl": { source: "apache", extensions: ["scurl"] }, "text/vnd.debian.copyright": { source: "iana", charset: "UTF-8" }, "text/vnd.dmclientscript": { source: "iana" }, "text/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] }, "text/vnd.esmertec.theme-descriptor": { source: "iana", charset: "UTF-8" }, "text/vnd.familysearch.gedcom": { source: "iana", extensions: ["ged"] }, "text/vnd.ficlab.flt": { source: "iana" }, "text/vnd.fly": { source: "iana", extensions: ["fly"] }, "text/vnd.fmi.flexstor": { source: "iana", extensions: ["flx"] }, "text/vnd.gml": { source: "iana" }, "text/vnd.graphviz": { source: "iana", extensions: ["gv"] }, "text/vnd.hans": { source: "iana" }, "text/vnd.hgl": { source: "iana" }, "text/vnd.in3d.3dml": { source: "iana", extensions: ["3dml"] }, "text/vnd.in3d.spot": { source: "iana", extensions: ["spot"] }, "text/vnd.iptc.newsml": { source: "iana" }, "text/vnd.iptc.nitf": { source: "iana" }, "text/vnd.latex-z": { source: "iana" }, "text/vnd.motorola.reflex": { source: "iana" }, "text/vnd.ms-mediapackage": { source: "iana" }, "text/vnd.net2phone.commcenter.command": { source: "iana" }, "text/vnd.radisys.msml-basic-layout": { source: "iana" }, "text/vnd.senx.warpscript": { source: "iana" }, "text/vnd.si.uricatalogue": { source: "iana" }, "text/vnd.sosi": { source: "iana" }, "text/vnd.sun.j2me.app-descriptor": { source: "iana", charset: "UTF-8", extensions: ["jad"] }, "text/vnd.trolltech.linguist": { source: "iana", charset: "UTF-8" }, "text/vnd.wap.si": { source: "iana" }, "text/vnd.wap.sl": { source: "iana" }, "text/vnd.wap.wml": { source: "iana", extensions: ["wml"] }, "text/vnd.wap.wmlscript": { source: "iana", extensions: ["wmls"] }, "text/vtt": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["vtt"] }, "text/x-asm": { source: "apache", extensions: ["s", "asm"] }, "text/x-c": { source: "apache", extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] }, "text/x-component": { source: "nginx", extensions: ["htc"] }, "text/x-fortran": { source: "apache", extensions: ["f", "for", "f77", "f90"] }, "text/x-gwt-rpc": { compressible: true }, "text/x-handlebars-template": { extensions: ["hbs"] }, "text/x-java-source": { source: "apache", extensions: ["java"] }, "text/x-jquery-tmpl": { compressible: true }, "text/x-lua": { extensions: ["lua"] }, "text/x-markdown": { compressible: true, extensions: ["mkd"] }, "text/x-nfo": { source: "apache", extensions: ["nfo"] }, "text/x-opml": { source: "apache", extensions: ["opml"] }, "text/x-org": { compressible: true, extensions: ["org"] }, "text/x-pascal": { source: "apache", extensions: ["p", "pas"] }, "text/x-processing": { compressible: true, extensions: ["pde"] }, "text/x-sass": { extensions: ["sass"] }, "text/x-scss": { extensions: ["scss"] }, "text/x-setext": { source: "apache", extensions: ["etx"] }, "text/x-sfv": { source: "apache", extensions: ["sfv"] }, "text/x-suse-ymp": { compressible: true, extensions: ["ymp"] }, "text/x-uuencode": { source: "apache", extensions: ["uu"] }, "text/x-vcalendar": { source: "apache", extensions: ["vcs"] }, "text/x-vcard": { source: "apache", extensions: ["vcf"] }, "text/xml": { source: "iana", compressible: true, extensions: ["xml"] }, "text/xml-external-parsed-entity": { source: "iana" }, "text/yaml": { compressible: true, extensions: ["yaml", "yml"] }, "video/1d-interleaved-parityfec": { source: "iana" }, "video/3gpp": { source: "iana", extensions: ["3gp", "3gpp"] }, "video/3gpp-tt": { source: "iana" }, "video/3gpp2": { source: "iana", extensions: ["3g2"] }, "video/av1": { source: "iana" }, "video/bmpeg": { source: "iana" }, "video/bt656": { source: "iana" }, "video/celb": { source: "iana" }, "video/dv": { source: "iana" }, "video/encaprtp": { source: "iana" }, "video/ffv1": { source: "iana" }, "video/flexfec": { source: "iana" }, "video/h261": { source: "iana", extensions: ["h261"] }, "video/h263": { source: "iana", extensions: ["h263"] }, "video/h263-1998": { source: "iana" }, "video/h263-2000": { source: "iana" }, "video/h264": { source: "iana", extensions: ["h264"] }, "video/h264-rcdo": { source: "iana" }, "video/h264-svc": { source: "iana" }, "video/h265": { source: "iana" }, "video/iso.segment": { source: "iana", extensions: ["m4s"] }, "video/jpeg": { source: "iana", extensions: ["jpgv"] }, "video/jpeg2000": { source: "iana" }, "video/jpm": { source: "apache", extensions: ["jpm", "jpgm"] }, "video/jxsv": { source: "iana" }, "video/mj2": { source: "iana", extensions: ["mj2", "mjp2"] }, "video/mp1s": { source: "iana" }, "video/mp2p": { source: "iana" }, "video/mp2t": { source: "iana", extensions: ["ts"] }, "video/mp4": { source: "iana", compressible: false, extensions: ["mp4", "mp4v", "mpg4"] }, "video/mp4v-es": { source: "iana" }, "video/mpeg": { source: "iana", compressible: false, extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] }, "video/mpeg4-generic": { source: "iana" }, "video/mpv": { source: "iana" }, "video/nv": { source: "iana" }, "video/ogg": { source: "iana", compressible: false, extensions: ["ogv"] }, "video/parityfec": { source: "iana" }, "video/pointer": { source: "iana" }, "video/quicktime": { source: "iana", compressible: false, extensions: ["qt", "mov"] }, "video/raptorfec": { source: "iana" }, "video/raw": { source: "iana" }, "video/rtp-enc-aescm128": { source: "iana" }, "video/rtploopback": { source: "iana" }, "video/rtx": { source: "iana" }, "video/scip": { source: "iana" }, "video/smpte291": { source: "iana" }, "video/smpte292m": { source: "iana" }, "video/ulpfec": { source: "iana" }, "video/vc1": { source: "iana" }, "video/vc2": { source: "iana" }, "video/vnd.cctv": { source: "iana" }, "video/vnd.dece.hd": { source: "iana", extensions: ["uvh", "uvvh"] }, "video/vnd.dece.mobile": { source: "iana", extensions: ["uvm", "uvvm"] }, "video/vnd.dece.mp4": { source: "iana" }, "video/vnd.dece.pd": { source: "iana", extensions: ["uvp", "uvvp"] }, "video/vnd.dece.sd": { source: "iana", extensions: ["uvs", "uvvs"] }, "video/vnd.dece.video": { source: "iana", extensions: ["uvv", "uvvv"] }, "video/vnd.directv.mpeg": { source: "iana" }, "video/vnd.directv.mpeg-tts": { source: "iana" }, "video/vnd.dlna.mpeg-tts": { source: "iana" }, "video/vnd.dvb.file": { source: "iana", extensions: ["dvb"] }, "video/vnd.fvt": { source: "iana", extensions: ["fvt"] }, "video/vnd.hns.video": { source: "iana" }, "video/vnd.iptvforum.1dparityfec-1010": { source: "iana" }, "video/vnd.iptvforum.1dparityfec-2005": { source: "iana" }, "video/vnd.iptvforum.2dparityfec-1010": { source: "iana" }, "video/vnd.iptvforum.2dparityfec-2005": { source: "iana" }, "video/vnd.iptvforum.ttsavc": { source: "iana" }, "video/vnd.iptvforum.ttsmpeg2": { source: "iana" }, "video/vnd.motorola.video": { source: "iana" }, "video/vnd.motorola.videop": { source: "iana" }, "video/vnd.mpegurl": { source: "iana", extensions: ["mxu", "m4u"] }, "video/vnd.ms-playready.media.pyv": { source: "iana", extensions: ["pyv"] }, "video/vnd.nokia.interleaved-multimedia": { source: "iana" }, "video/vnd.nokia.mp4vr": { source: "iana" }, "video/vnd.nokia.videovoip": { source: "iana" }, "video/vnd.objectvideo": { source: "iana" }, "video/vnd.radgamettools.bink": { source: "iana" }, "video/vnd.radgamettools.smacker": { source: "iana" }, "video/vnd.sealed.mpeg1": { source: "iana" }, "video/vnd.sealed.mpeg4": { source: "iana" }, "video/vnd.sealed.swf": { source: "iana" }, "video/vnd.sealedmedia.softseal.mov": { source: "iana" }, "video/vnd.uvvu.mp4": { source: "iana", extensions: ["uvu", "uvvu"] }, "video/vnd.vivo": { source: "iana", extensions: ["viv"] }, "video/vnd.youtube.yt": { source: "iana" }, "video/vp8": { source: "iana" }, "video/vp9": { source: "iana" }, "video/webm": { source: "apache", compressible: false, extensions: ["webm"] }, "video/x-f4v": { source: "apache", extensions: ["f4v"] }, "video/x-fli": { source: "apache", extensions: ["fli"] }, "video/x-flv": { source: "apache", compressible: false, extensions: ["flv"] }, "video/x-m4v": { source: "apache", extensions: ["m4v"] }, "video/x-matroska": { source: "apache", compressible: false, extensions: ["mkv", "mk3d", "mks"] }, "video/x-mng": { source: "apache", extensions: ["mng"] }, "video/x-ms-asf": { source: "apache", extensions: ["asf", "asx"] }, "video/x-ms-vob": { source: "apache", extensions: ["vob"] }, "video/x-ms-wm": { source: "apache", extensions: ["wm"] }, "video/x-ms-wmv": { source: "apache", compressible: false, extensions: ["wmv"] }, "video/x-ms-wmx": { source: "apache", extensions: ["wmx"] }, "video/x-ms-wvx": { source: "apache", extensions: ["wvx"] }, "video/x-msvideo": { source: "apache", extensions: ["avi"] }, "video/x-sgi-movie": { source: "apache", extensions: ["movie"] }, "video/x-smv": { source: "apache", extensions: ["smv"] }, "x-conference/x-cooltalk": { source: "apache", extensions: ["ice"] }, "x-shader/x-fragment": { compressible: true }, "x-shader/x-vertex": { compressible: true } }; } }); // ../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js var require_mime_db = __commonJS({ "../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js"(exports2, module2) { module2.exports = require_db(); } }); // ../node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js var require_mime_types = __commonJS({ "../node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js"(exports2) { var db = require_mime_db(); var extname = require("path").extname; var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; var TEXT_TYPE_REGEXP = /^text\//i; exports2.charset = charset; exports2.charsets = { lookup: charset }; exports2.contentType = contentType; exports2.extension = extension; exports2.extensions = /* @__PURE__ */ Object.create(null); exports2.lookup = lookup; exports2.types = /* @__PURE__ */ Object.create(null); populateMaps(exports2.extensions, exports2.types); function charset(type) { if (!type || typeof type !== "string") { return false; } var match = EXTRACT_TYPE_REGEXP.exec(type); var mime = match && db[match[1].toLowerCase()]; if (mime && mime.charset) { return mime.charset; } if (match && TEXT_TYPE_REGEXP.test(match[1])) { return "UTF-8"; } return false; } function contentType(str) { if (!str || typeof str !== "string") { return false; } var mime = str.indexOf("/") === -1 ? exports2.lookup(str) : str; if (!mime) { return false; } if (mime.indexOf("charset") === -1) { var charset2 = exports2.charset(mime); if (charset2) mime += "; charset=" + charset2.toLowerCase(); } return mime; } function extension(type) { if (!type || typeof type !== "string") { return false; } var match = EXTRACT_TYPE_REGEXP.exec(type); var exts = match && exports2.extensions[match[1].toLowerCase()]; if (!exts || !exts.length) { return false; } return exts[0]; } function lookup(path) { if (!path || typeof path !== "string") { return false; } var extension2 = extname("x." + path).toLowerCase().substr(1); if (!extension2) { return false; } return exports2.types[extension2] || false; } function populateMaps(extensions, types3) { var preference = ["nginx", "apache", void 0, "iana"]; Object.keys(db).forEach(function forEachMimeType(type) { var mime = db[type]; var exts = mime.extensions; if (!exts || !exts.length) { return; } extensions[type] = exts; for (var i2 = 0; i2 < exts.length; i2++) { var extension2 = exts[i2]; if (types3[extension2]) { var from = preference.indexOf(db[types3[extension2]].source); var to = preference.indexOf(mime.source); if (types3[extension2] !== "application/octet-stream" && (from > to || from === to && types3[extension2].substr(0, 12) === "application/")) { continue; } } types3[extension2] = type; } }); } } }); // ../node_modules/.pnpm/ylru@1.4.0/node_modules/ylru/index.js var require_ylru = __commonJS({ "../node_modules/.pnpm/ylru@1.4.0/node_modules/ylru/index.js"(exports2, module2) { var LRU = class { constructor(max) { this.max = max; this.size = 0; this.cache = /* @__PURE__ */ new Map(); this._cache = /* @__PURE__ */ new Map(); } get(key, options) { let item = this.cache.get(key); const maxAge = options && options.maxAge; let now; function getNow() { now = now || Date.now(); return now; } if (item) { if (item.expired && getNow() > item.expired) { item.expired = 0; item.value = void 0; } else { if (maxAge !== void 0) { const expired = maxAge ? getNow() + maxAge : 0; item.expired = expired; } } return item.value; } item = this._cache.get(key); if (item) { if (item.expired && getNow() > item.expired) { item.expired = 0; item.value = void 0; } else { this._update(key, item); if (maxAge !== void 0) { const expired = maxAge ? getNow() + maxAge : 0; item.expired = expired; } } return item.value; } } set(key, value, options) { const maxAge = options && options.maxAge; const expired = maxAge ? Date.now() + maxAge : 0; let item = this.cache.get(key); if (item) { item.expired = expired; item.value = value; } else { item = { value, expired }; this._update(key, item); } } keys() { const cacheKeys = /* @__PURE__ */ new Set(); const now = Date.now(); for (const entry of this.cache.entries()) { checkEntry(entry); } for (const entry of this._cache.entries()) { checkEntry(entry); } function checkEntry(entry) { const key = entry[0]; const item = entry[1]; if (entry[1].value && !entry[1].expired || item.expired >= now) { cacheKeys.add(key); } } return Array.from(cacheKeys.keys()); } reset() { this.size = 0; this.cache.clear(); this._cache.clear(); } _update(key, item) { this.cache.set(key, item); this.size++; if (this.size >= this.max) { this.size = 0; this._cache = this.cache; this.cache = /* @__PURE__ */ new Map(); } } }; module2.exports = LRU; } }); // ../node_modules/.pnpm/cache-content-type@1.0.1/node_modules/cache-content-type/index.js var require_cache_content_type = __commonJS({ "../node_modules/.pnpm/cache-content-type@1.0.1/node_modules/cache-content-type/index.js"(exports2, module2) { var mimeTypes = require_mime_types(); var LRU = require_ylru(); var typeLRUCache = new LRU(100); module2.exports = (type) => { let mimeType = typeLRUCache.get(type); if (!mimeType) { mimeType = mimeTypes.contentType(type); typeLRUCache.set(type, mimeType); } return mimeType; }; } }); // ../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js var require_escape_html = __commonJS({ "../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js"(exports2, module2) { var matchHtmlRegExp = /["'&<>]/; module2.exports = escapeHtml; function escapeHtml(string) { var str = "" + string; var match = matchHtmlRegExp.exec(str); if (!match) { return str; } var escape; var html = ""; var index = 0; var lastIndex = 0; for (index = match.index; index < str.length; index++) { switch (str.charCodeAt(index)) { case 34: escape = """; break; case 38: escape = "&"; break; case 39: escape = "'"; break; case 60: escape = "<"; break; case 62: escape = ">"; break; default: continue; } if (lastIndex !== index) { html += str.substring(lastIndex, index); } lastIndex = index + 1; html += escape; } return lastIndex !== index ? html + str.substring(lastIndex, index) : html; } } }); // ../node_modules/.pnpm/media-typer@0.3.0/node_modules/media-typer/index.js var require_media_typer = __commonJS({ "../node_modules/.pnpm/media-typer@0.3.0/node_modules/media-typer/index.js"(exports2) { var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g; var textRegExp = /^[\u0020-\u007e\u0080-\u00ff]+$/; var tokenRegExp = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/; var qescRegExp = /\\([\u0000-\u007f])/g; var quoteRegExp = /([\\"])/g; var subtypeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/; var typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/; var typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/; exports2.format = format; exports2.parse = parse; function format(obj) { if (!obj || typeof obj !== "object") { throw new TypeError("argument obj is required"); } var parameters = obj.parameters; var subtype = obj.subtype; var suffix = obj.suffix; var type = obj.type; if (!type || !typeNameRegExp.test(type)) { throw new TypeError("invalid type"); } if (!subtype || !subtypeNameRegExp.test(subtype)) { throw new TypeError("invalid subtype"); } var string = type + "/" + subtype; if (suffix) { if (!typeNameRegExp.test(suffix)) { throw new TypeError("invalid suffix"); } string += "+" + suffix; } if (parameters && typeof parameters === "object") { var param; var params = Object.keys(parameters).sort(); for (var i2 = 0; i2 < params.length; i2++) { param = params[i2]; if (!tokenRegExp.test(param)) { throw new TypeError("invalid parameter name"); } string += "; " + param + "=" + qstring(parameters[param]); } } return string; } function parse(string) { if (!string) { throw new TypeError("argument string is required"); } if (typeof string === "object") { string = getcontenttype(string); } if (typeof string !== "string") { throw new TypeError("argument string is required to be a string"); } var index = string.indexOf(";"); var type = index !== -1 ? string.substr(0, index) : string; var key; var match; var obj = splitType(type); var params = {}; var value; paramRegExp.lastIndex = index; while (match = paramRegExp.exec(string)) { if (match.index !== index) { throw new TypeError("invalid parameter format"); } index += match[0].length; key = match[1].toLowerCase(); value = match[2]; if (value[0] === '"') { value = value.substr(1, value.length - 2).replace(qescRegExp, "$1"); } params[key] = value; } if (index !== -1 && index !== string.length) { throw new TypeError("invalid parameter format"); } obj.parameters = params; return obj; } function getcontenttype(obj) { if (typeof obj.getHeader === "function") { return obj.getHeader("content-type"); } if (typeof obj.headers === "object") { return obj.headers && obj.headers["content-type"]; } } function qstring(val) { var str = String(val); if (tokenRegExp.test(str)) { return str; } if (str.length > 0 && !textRegExp.test(str)) { throw new TypeError("invalid parameter value"); } return '"' + str.replace(quoteRegExp, "\\$1") + '"'; } function splitType(string) { var match = typeRegExp.exec(string.toLowerCase()); if (!match) { throw new TypeError("invalid media type"); } var type = match[1]; var subtype = match[2]; var suffix; var index = subtype.lastIndexOf("+"); if (index !== -1) { suffix = subtype.substr(index + 1); subtype = subtype.substr(0, index); } var obj = { type, subtype, suffix }; return obj; } } }); // ../node_modules/.pnpm/type-is@1.6.18/node_modules/type-is/index.js var require_type_is = __commonJS({ "../node_modules/.pnpm/type-is@1.6.18/node_modules/type-is/index.js"(exports2, module2) { var typer = require_media_typer(); var mime = require_mime_types(); module2.exports = typeofrequest; module2.exports.is = typeis; module2.exports.hasBody = hasbody; module2.exports.normalize = normalize; module2.exports.match = mimeMatch; function typeis(value, types_) { var i2; var types3 = types_; var val = tryNormalizeType(value); if (!val) { return false; } if (types3 && !Array.isArray(types3)) { types3 = new Array(arguments.length - 1); for (i2 = 0; i2 < types3.length; i2++) { types3[i2] = arguments[i2 + 1]; } } if (!types3 || !types3.length) { return val; } var type; for (i2 = 0; i2 < types3.length; i2++) { if (mimeMatch(normalize(type = types3[i2]), val)) { return type[0] === "+" || type.indexOf("*") !== -1 ? val : type; } } return false; } function hasbody(req) { return req.headers["transfer-encoding"] !== void 0 || !isNaN(req.headers["content-length"]); } function typeofrequest(req, types_) { var types3 = types_; if (!hasbody(req)) { return null; } if (arguments.length > 2) { types3 = new Array(arguments.length - 1); for (var i2 = 0; i2 < types3.length; i2++) { types3[i2] = arguments[i2 + 1]; } } var value = req.headers["content-type"]; return typeis(value, types3); } function normalize(type) { if (typeof type !== "string") { return false; } switch (type) { case "urlencoded": return "application/x-www-form-urlencoded"; case "multipart": return "multipart/*"; } if (type[0] === "+") { return "*/*" + type; } return type.indexOf("/") === -1 ? mime.lookup(type) : type; } function mimeMatch(expected, actual) { if (expected === false) { return false; } var actualParts = actual.split("/"); var expectedParts = expected.split("/"); if (actualParts.length !== 2 || expectedParts.length !== 2) { return false; } if (expectedParts[0] !== "*" && expectedParts[0] !== actualParts[0]) { return false; } if (expectedParts[1].substr(0, 2) === "*+") { return expectedParts[1].length <= actualParts[1].length + 1 && expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length); } if (expectedParts[1] !== "*" && expectedParts[1] !== actualParts[1]) { return false; } return true; } function normalizeType(value) { var type = typer.parse(value); type.parameters = void 0; return typer.format(type); } function tryNormalizeType(value) { if (!value) { return null; } try { return normalizeType(value); } catch (err) { return null; } } } }); // ../node_modules/.pnpm/statuses@1.5.0/node_modules/statuses/codes.json var require_codes = __commonJS({ "../node_modules/.pnpm/statuses@1.5.0/node_modules/statuses/codes.json"(exports2, module2) { module2.exports = { "100": "Continue", "101": "Switching Protocols", "102": "Processing", "103": "Early Hints", "200": "OK", "201": "Created", "202": "Accepted", "203": "Non-Authoritative Information", "204": "No Content", "205": "Reset Content", "206": "Partial Content", "207": "Multi-Status", "208": "Already Reported", "226": "IM Used", "300": "Multiple Choices", "301": "Moved Permanently", "302": "Found", "303": "See Other", "304": "Not Modified", "305": "Use Proxy", "306": "(Unused)", "307": "Temporary Redirect", "308": "Permanent Redirect", "400": "Bad Request", "401": "Unauthorized", "402": "Payment Required", "403": "Forbidden", "404": "Not Found", "405": "Method Not Allowed", "406": "Not Acceptable", "407": "Proxy Authentication Required", "408": "Request Timeout", "409": "Conflict", "410": "Gone", "411": "Length Required", "412": "Precondition Failed", "413": "Payload Too Large", "414": "URI Too Long", "415": "Unsupported Media Type", "416": "Range Not Satisfiable", "417": "Expectation Failed", "418": "I'm a teapot", "421": "Misdirected Request", "422": "Unprocessable Entity", "423": "Locked", "424": "Failed Dependency", "425": "Unordered Collection", "426": "Upgrade Required", "428": "Precondition Required", "429": "Too Many Requests", "431": "Request Header Fields Too Large", "451": "Unavailable For Legal Reasons", "500": "Internal Server Error", "501": "Not Implemented", "502": "Bad Gateway", "503": "Service Unavailable", "504": "Gateway Timeout", "505": "HTTP Version Not Supported", "506": "Variant Also Negotiates", "507": "Insufficient Storage", "508": "Loop Detected", "509": "Bandwidth Limit Exceeded", "510": "Not Extended", "511": "Network Authentication Required" }; } }); // ../node_modules/.pnpm/statuses@1.5.0/node_modules/statuses/index.js var require_statuses = __commonJS({ "../node_modules/.pnpm/statuses@1.5.0/node_modules/statuses/index.js"(exports2, module2) { var codes = require_codes(); module2.exports = status; status.STATUS_CODES = codes; status.codes = populateStatusesMap(status, codes); status.redirect = { 300: true, 301: true, 302: true, 303: true, 305: true, 307: true, 308: true }; status.empty = { 204: true, 205: true, 304: true }; status.retry = { 502: true, 503: true, 504: true }; function populateStatusesMap(statuses, codes2) { var arr = []; Object.keys(codes2).forEach(function forEachCode(code) { var message2 = codes2[code]; var status2 = Number(code); statuses[status2] = message2; statuses[message2] = status2; statuses[message2.toLowerCase()] = status2; arr.push(status2); }); return arr; } function status(code) { if (typeof code === "number") { if (!status[code]) throw new Error("invalid status code: " + code); return code; } if (typeof code !== "string") { throw new TypeError("code must be a number or string"); } var n = parseInt(code, 10); if (!isNaN(n)) { if (!status[n]) throw new Error("invalid status code: " + n); return n; } n = status[code.toLowerCase()]; if (!n) throw new Error('invalid status message: "' + code + '"'); return n; } } }); // ../node_modules/.pnpm/destroy@1.2.0/node_modules/destroy/index.js var require_destroy = __commonJS({ "../node_modules/.pnpm/destroy@1.2.0/node_modules/destroy/index.js"(exports2, module2) { var EventEmitter = require("events").EventEmitter; var ReadStream = require("fs").ReadStream; var Stream3 = require("stream"); var Zlib = require("zlib"); module2.exports = destroy; function destroy(stream, suppress) { if (isFsReadStream(stream)) { destroyReadStream(stream); } else if (isZlibStream(stream)) { destroyZlibStream(stream); } else if (hasDestroy(stream)) { stream.destroy(); } if (isEventEmitter(stream) && suppress) { stream.removeAllListeners("error"); stream.addListener("error", noop2); } return stream; } function destroyReadStream(stream) { stream.destroy(); if (typeof stream.close === "function") { stream.on("open", onOpenClose); } } function closeZlibStream(stream) { if (stream._hadError === true) { var prop = stream._binding === null ? "_binding" : "_handle"; stream[prop] = { close: function() { this[prop] = null; } }; } stream.close(); } function destroyZlibStream(stream) { if (typeof stream.destroy === "function") { if (stream._binding) { stream.destroy(); if (stream._processing) { stream._needDrain = true; stream.once("drain", onDrainClearBinding); } else { stream._binding.clear(); } } else if (stream._destroy && stream._destroy !== Stream3.Transform.prototype._destroy) { stream.destroy(); } else if (stream._destroy && typeof stream.close === "function") { stream.destroyed = true; stream.close(); } else { stream.destroy(); } } else if (typeof stream.close === "function") { closeZlibStream(stream); } } function hasDestroy(stream) { return stream instanceof Stream3 && typeof stream.destroy === "function"; } function isEventEmitter(val) { return val instanceof EventEmitter; } function isFsReadStream(stream) { return stream instanceof ReadStream; } function isZlibStream(stream) { return stream instanceof Zlib.Gzip || stream instanceof Zlib.Gunzip || stream instanceof Zlib.Deflate || stream instanceof Zlib.DeflateRaw || stream instanceof Zlib.Inflate || stream instanceof Zlib.InflateRaw || stream instanceof Zlib.Unzip; } function noop2() { } function onDrainClearBinding() { this._binding.clear(); } function onOpenClose() { if (typeof this.fd === "number") { this.close(); } } } }); // ../node_modules/.pnpm/vary@1.1.2/node_modules/vary/index.js var require_vary = __commonJS({ "../node_modules/.pnpm/vary@1.1.2/node_modules/vary/index.js"(exports2, module2) { module2.exports = vary; module2.exports.append = append; var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; function append(header, field) { if (typeof header !== "string") { throw new TypeError("header argument is required"); } if (!field) { throw new TypeError("field argument is required"); } var fields = !Array.isArray(field) ? parse(String(field)) : field; for (var j = 0; j < fields.length; j++) { if (!FIELD_NAME_REGEXP.test(fields[j])) { throw new TypeError("field argument contains an invalid header name"); } } if (header === "*") { return header; } var val = header; var vals = parse(header.toLowerCase()); if (fields.indexOf("*") !== -1 || vals.indexOf("*") !== -1) { return "*"; } for (var i2 = 0; i2 < fields.length; i2++) { var fld = fields[i2].toLowerCase(); if (vals.indexOf(fld) === -1) { vals.push(fld); val = val ? val + ", " + fields[i2] : fields[i2]; } } return val; } function parse(header) { var end = 0; var list = []; var start = 0; for (var i2 = 0, len = header.length; i2 < len; i2++) { switch (header.charCodeAt(i2)) { case 32: if (start === end) { start = end = i2 + 1; } break; case 44: list.push(header.substring(start, end)); start = end = i2 + 1; break; default: end = i2 + 1; break; } } list.push(header.substring(start, end)); return list; } function vary(res, field) { if (!res || !res.getHeader || !res.setHeader) { throw new TypeError("res argument is required"); } var val = res.getHeader("Vary") || ""; var header = Array.isArray(val) ? val.join(", ") : String(val); if (val = append(header, field)) { res.setHeader("Vary", val); } } } }); // ../node_modules/.pnpm/only@0.0.2/node_modules/only/index.js var require_only = __commonJS({ "../node_modules/.pnpm/only@0.0.2/node_modules/only/index.js"(exports2, module2) { module2.exports = function(obj, keys) { obj = obj || {}; if ("string" == typeof keys) keys = keys.split(/ +/); return keys.reduce(function(ret, key) { if (null == obj[key]) return ret; ret[key] = obj[key]; return ret; }, {}); }; } }); // ../node_modules/.pnpm/encodeurl@1.0.2/node_modules/encodeurl/index.js var require_encodeurl = __commonJS({ "../node_modules/.pnpm/encodeurl@1.0.2/node_modules/encodeurl/index.js"(exports2, module2) { module2.exports = encodeUrl; var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g; var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g; var UNMATCHED_SURROGATE_PAIR_REPLACE = "$1\uFFFD$2"; function encodeUrl(url) { return String(url).replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE).replace(ENCODE_CHARS_REGEXP, encodeURI); } } }); // ../node_modules/.pnpm/koa@2.15.4/node_modules/koa/lib/response.js var require_response = __commonJS({ "../node_modules/.pnpm/koa@2.15.4/node_modules/koa/lib/response.js"(exports2, module2) { var contentDisposition = require_content_disposition(); var getType = require_cache_content_type(); var onFinish = require_on_finished(); var escape = require_escape_html(); var typeis = require_type_is().is; var statuses = require_statuses(); var destroy = require_destroy(); var assert = require("assert"); var extname = require("path").extname; var vary = require_vary(); var only = require_only(); var util = require("util"); var encodeUrl = require_encodeurl(); var Stream3 = require("stream"); var URL2 = require("url").URL; module2.exports = { /** * Return the request socket. * * @return {Connection} * @api public */ get socket() { return this.res.socket; }, /** * Return response header. * * @return {Object} * @api public */ get header() { const { res } = this; return typeof res.getHeaders === "function" ? res.getHeaders() : res._headers || {}; }, /** * Return response header, alias as response.header * * @return {Object} * @api public */ get headers() { return this.header; }, /** * Get response status code. * * @return {Number} * @api public */ get status() { return this.res.statusCode; }, /** * Set response status code. * * @param {Number} code * @api public */ set status(code) { if (this.headerSent) return; assert(Number.isInteger(code), "status code must be a number"); assert(code >= 100 && code <= 999, `invalid status code: ${code}`); this._explicitStatus = true; this.res.statusCode = code; if (this.req.httpVersionMajor < 2) this.res.statusMessage = statuses[code]; if (this.body && statuses.empty[code]) this.body = null; }, /** * Get response status message * * @return {String} * @api public */ get message() { return this.res.statusMessage || statuses[this.status]; }, /** * Set response status message * * @param {String} msg * @api public */ set message(msg) { this.res.statusMessage = msg; }, /** * Get response body. * * @return {Mixed} * @api public */ get body() { return this._body; }, /** * Set response body. * * @param {String|Buffer|Object|Stream} val * @api public */ set body(val) { const original = this._body; this._body = val; if (null == val) { if (!statuses.empty[this.status]) this.status = 204; if (val === null) this._explicitNullBody = true; this.remove("Content-Type"); this.remove("Content-Length"); this.remove("Transfer-Encoding"); return; } if (!this._explicitStatus) this.status = 200; const setType = !this.has("Content-Type"); if ("string" === typeof val) { if (setType) this.type = /^\s* this.ctx.onerror(err)); if (null != original) this.remove("Content-Length"); } if (setType) this.type = "bin"; return; } this.remove("Content-Length"); this.type = "json"; }, /** * Set Content-Length field to `n`. * * @param {Number} n * @api public */ set length(n) { if (!this.has("Transfer-Encoding")) { this.set("Content-Length", n); } }, /** * Return parsed response Content-Length when present. * * @return {Number} * @api public */ get length() { if (this.has("Content-Length")) { return parseInt(this.get("Content-Length"), 10) || 0; } const { body } = this; if (!body || body instanceof Stream3) return void 0; if ("string" === typeof body) return Buffer.byteLength(body); if (Buffer.isBuffer(body)) return body.length; return Buffer.byteLength(JSON.stringify(body)); }, /** * Check if a header has been written to the socket. * * @return {Boolean} * @api public */ get headerSent() { return this.res.headersSent; }, /** * Vary on `field`. * * @param {String} field * @api public */ vary(field) { if (this.headerSent) return; vary(this.res, field); }, /** * Perform a 302 redirect to `url`. * * The string "back" is special-cased * to provide Referrer support, when Referrer * is not present `alt` or "/" is used. * * Examples: * * this.redirect('back'); * this.redirect('back', '/index.html'); * this.redirect('/login'); * this.redirect('http://google.com'); * * @param {String} url * @param {String} [alt] * @api public */ redirect(url, alt) { if ("back" === url) url = this.ctx.get("Referrer") || alt || "/"; if (/^https?:\/\//i.test(url)) { url = new URL2(url).toString(); } this.set("Location", encodeUrl(url)); if (!statuses.redirect[this.status]) this.status = 302; if (this.ctx.accepts("html")) { url = escape(url); this.type = "text/html; charset=utf-8"; this.body = `Redirecting to ${url}.`; return; } this.type = "text/plain; charset=utf-8"; this.body = `Redirecting to ${url}.`; }, /** * Set Content-Disposition header to "attachment" with optional `filename`. * * @param {String} filename * @api public */ attachment(filename, options) { if (filename) this.type = extname(filename); this.set("Content-Disposition", contentDisposition(filename, options)); }, /** * Set Content-Type response header with `type` through `mime.lookup()` * when it does not contain a charset. * * Examples: * * this.type = '.html'; * this.type = 'html'; * this.type = 'json'; * this.type = 'application/json'; * this.type = 'png'; * * @param {String} type * @api public */ set type(type) { type = getType(type); if (type) { this.set("Content-Type", type); } else { this.remove("Content-Type"); } }, /** * Set the Last-Modified date using a string or a Date. * * this.response.lastModified = new Date(); * this.response.lastModified = '2013-09-13'; * * @param {String|Date} type * @api public */ set lastModified(val) { if ("string" === typeof val) val = new Date(val); this.set("Last-Modified", val.toUTCString()); }, /** * Get the Last-Modified date in Date form, if it exists. * * @return {Date} * @api public */ get lastModified() { const date = this.get("last-modified"); if (date) return new Date(date); }, /** * Set the ETag of a response. * This will normalize the quotes if necessary. * * this.response.etag = 'md5hashsum'; * this.response.etag = '"md5hashsum"'; * this.response.etag = 'W/"123456789"'; * * @param {String} etag * @api public */ set etag(val) { if (!/^(W\/)?"/.test(val)) val = `"${val}"`; this.set("ETag", val); }, /** * Get the ETag of a response. * * @return {String} * @api public */ get etag() { return this.get("ETag"); }, /** * Return the response mime type void of * parameters such as "charset". * * @return {String} * @api public */ get type() { const type = this.get("Content-Type"); if (!type) return ""; return type.split(";", 1)[0]; }, /** * Check whether the response is one of the listed types. * Pretty much the same as `this.request.is()`. * * @param {String|String[]} [type] * @param {String[]} [types] * @return {String|false} * @api public */ is(type, ...types3) { return typeis(this.type, type, ...types3); }, /** * Return response header. * * Examples: * * this.get('Content-Type'); * // => "text/plain" * * this.get('content-type'); * // => "text/plain" * * @param {String} field * @return {String} * @api public */ get(field) { return this.header[field.toLowerCase()] || ""; }, /** * Returns true if the header identified by name is currently set in the outgoing headers. * The header name matching is case-insensitive. * * Examples: * * this.has('Content-Type'); * // => true * * this.get('content-type'); * // => true * * @param {String} field * @return {boolean} * @api public */ has(field) { return typeof this.res.hasHeader === "function" ? this.res.hasHeader(field) : field.toLowerCase() in this.headers; }, /** * Set header `field` to `val` or pass * an object of header fields. * * Examples: * * this.set('Foo', ['bar', 'baz']); * this.set('Accept', 'application/json'); * this.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' }); * * @param {String|Object|Array} field * @param {String} val * @api public */ set(field, val) { if (this.headerSent) return; if (2 === arguments.length) { if (Array.isArray(val)) val = val.map((v) => typeof v === "string" ? v : String(v)); else if (typeof val !== "string") val = String(val); this.res.setHeader(field, val); } else { for (const key in field) { this.set(key, field[key]); } } }, /** * Append additional header `field` with value `val`. * * Examples: * * ``` * this.append('Link', ['', '']); * this.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly'); * this.append('Warning', '199 Miscellaneous warning'); * ``` * * @param {String} field * @param {String|Array} val * @api public */ append(field, val) { const prev = this.get(field); if (prev) { val = Array.isArray(prev) ? prev.concat(val) : [prev].concat(val); } return this.set(field, val); }, /** * Remove header `field`. * * @param {String} name * @api public */ remove(field) { if (this.headerSent) return; this.res.removeHeader(field); }, /** * Checks if the request is writable. * Tests for the existence of the socket * as node sometimes does not set it. * * @return {Boolean} * @api private */ get writable() { if (this.res.writableEnded || this.res.finished) return false; const socket = this.res.socket; if (!socket) return true; return socket.writable; }, /** * Inspect implementation. * * @return {Object} * @api public */ inspect() { if (!this.res) return; const o = this.toJSON(); o.body = this.body; return o; }, /** * Return JSON representation. * * @return {Object} * @api public */ toJSON() { return only(this, [ "status", "message", "header" ]); }, /** * Flush any set headers and begin the body */ flushHeaders() { this.res.flushHeaders(); } }; if (util.inspect.custom) { module2.exports[util.inspect.custom] = module2.exports.inspect; } } }); // ../node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js var require_koa_compose = __commonJS({ "../node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js"(exports2, module2) { module2.exports = compose; function compose(middleware) { if (!Array.isArray(middleware)) throw new TypeError("Middleware stack must be an array!"); for (const fn2 of middleware) { if (typeof fn2 !== "function") throw new TypeError("Middleware must be composed of functions!"); } return function(context, next) { let index = -1; return dispatch(0); function dispatch(i2) { if (i2 <= index) return Promise.reject(new Error("next() called multiple times")); index = i2; let fn2 = middleware[i2]; if (i2 === middleware.length) fn2 = next; if (!fn2) return Promise.resolve(); try { return Promise.resolve(fn2(context, dispatch.bind(null, i2 + 1))); } catch (err) { return Promise.reject(err); } } }; } } }); // ../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/callsite-tostring.js var require_callsite_tostring = __commonJS({ "../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/callsite-tostring.js"(exports2, module2) { module2.exports = callSiteToString2; function callSiteFileLocation(callSite) { var fileName; var fileLocation = ""; if (callSite.isNative()) { fileLocation = "native"; } else if (callSite.isEval()) { fileName = callSite.getScriptNameOrSourceURL(); if (!fileName) { fileLocation = callSite.getEvalOrigin(); } } else { fileName = callSite.getFileName(); } if (fileName) { fileLocation += fileName; var lineNumber = callSite.getLineNumber(); if (lineNumber != null) { fileLocation += ":" + lineNumber; var columnNumber = callSite.getColumnNumber(); if (columnNumber) { fileLocation += ":" + columnNumber; } } } return fileLocation || "unknown source"; } function callSiteToString2(callSite) { var addSuffix = true; var fileLocation = callSiteFileLocation(callSite); var functionName = callSite.getFunctionName(); var isConstructor = callSite.isConstructor(); var isMethodCall = !(callSite.isToplevel() || isConstructor); var line = ""; if (isMethodCall) { var methodName = callSite.getMethodName(); var typeName = getConstructorName(callSite); if (functionName) { if (typeName && functionName.indexOf(typeName) !== 0) { line += typeName + "."; } line += functionName; if (methodName && functionName.lastIndexOf("." + methodName) !== functionName.length - methodName.length - 1) { line += " [as " + methodName + "]"; } } else { line += typeName + "." + (methodName || ""); } } else if (isConstructor) { line += "new " + (functionName || ""); } else if (functionName) { line += functionName; } else { addSuffix = false; line += fileLocation; } if (addSuffix) { line += " (" + fileLocation + ")"; } return line; } function getConstructorName(obj) { var receiver = obj.receiver; return receiver.constructor && receiver.constructor.name || null; } } }); // ../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/event-listener-count.js var require_event_listener_count = __commonJS({ "../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/event-listener-count.js"(exports2, module2) { module2.exports = eventListenerCount2; function eventListenerCount2(emitter, type) { return emitter.listeners(type).length; } } }); // ../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/index.js var require_compat = __commonJS({ "../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/index.js"(exports2, module2) { var EventEmitter = require("events").EventEmitter; lazyProperty(module2.exports, "callSiteToString", function callSiteToString2() { var limit = Error.stackTraceLimit; var obj = {}; var prep = Error.prepareStackTrace; function prepareObjectStackTrace2(obj2, stack3) { return stack3; } Error.prepareStackTrace = prepareObjectStackTrace2; Error.stackTraceLimit = 2; Error.captureStackTrace(obj); var stack2 = obj.stack.slice(); Error.prepareStackTrace = prep; Error.stackTraceLimit = limit; return stack2[0].toString ? toString : require_callsite_tostring(); }); lazyProperty(module2.exports, "eventListenerCount", function eventListenerCount2() { return EventEmitter.listenerCount || require_event_listener_count(); }); function lazyProperty(obj, prop, getter) { function get() { var val = getter(); Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: val }); return val; } Object.defineProperty(obj, prop, { configurable: true, enumerable: true, get }); } function toString(obj) { return obj.toString(); } } }); // ../node_modules/.pnpm/depd@1.1.2/node_modules/depd/index.js var require_depd = __commonJS({ "../node_modules/.pnpm/depd@1.1.2/node_modules/depd/index.js"(exports, module) { var __dirname = "/home/runner/work/screencapture/screencapture/node_modules/.pnpm/depd@1.1.2/node_modules/depd"; var __filename = "/home/runner/work/screencapture/screencapture/node_modules/.pnpm/depd@1.1.2/node_modules/depd/index.js"; var callSiteToString = require_compat().callSiteToString; var eventListenerCount = require_compat().eventListenerCount; var relative = require("path").relative; module.exports = depd; var basePath = process.cwd(); function containsNamespace(str, namespace) { var vals = str.split(/[ ,]+/); var ns = String(namespace).toLowerCase(); for (var i2 = 0; i2 < vals.length; i2++) { var val = vals[i2]; if (val && (val === "*" || val.toLowerCase() === ns)) { return true; } } return false; } function convertDataDescriptorToAccessor(obj, prop, message2) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop); var value = descriptor.value; descriptor.get = function getter() { return value; }; if (descriptor.writable) { descriptor.set = function setter(val) { return value = val; }; } delete descriptor.value; delete descriptor.writable; Object.defineProperty(obj, prop, descriptor); return descriptor; } function createArgumentsString(arity) { var str = ""; for (var i2 = 0; i2 < arity; i2++) { str += ", arg" + i2; } return str.substr(2); } function createStackString(stack2) { var str = this.name + ": " + this.namespace; if (this.message) { str += " deprecated " + this.message; } for (var i2 = 0; i2 < stack2.length; i2++) { str += "\n at " + callSiteToString(stack2[i2]); } return str; } function depd(namespace) { if (!namespace) { throw new TypeError("argument namespace is required"); } var stack2 = getStack(); var site2 = callSiteLocation(stack2[1]); var file = site2[0]; function deprecate4(message2) { log.call(deprecate4, message2); } deprecate4._file = file; deprecate4._ignored = isignored(namespace); deprecate4._namespace = namespace; deprecate4._traced = istraced(namespace); deprecate4._warned = /* @__PURE__ */ Object.create(null); deprecate4.function = wrapfunction; deprecate4.property = wrapproperty; return deprecate4; } function isignored(namespace) { if (process.noDeprecation) { return true; } var str = process.env.NO_DEPRECATION || ""; return containsNamespace(str, namespace); } function istraced(namespace) { if (process.traceDeprecation) { return true; } var str = process.env.TRACE_DEPRECATION || ""; return containsNamespace(str, namespace); } function log(message2, site2) { var haslisteners = eventListenerCount(process, "deprecation") !== 0; if (!haslisteners && this._ignored) { return; } var caller; var callFile; var callSite; var depSite; var i2 = 0; var seen = false; var stack2 = getStack(); var file = this._file; if (site2) { depSite = site2; callSite = callSiteLocation(stack2[1]); callSite.name = depSite.name; file = callSite[0]; } else { i2 = 2; depSite = callSiteLocation(stack2[i2]); callSite = depSite; } for (; i2 < stack2.length; i2++) { caller = callSiteLocation(stack2[i2]); callFile = caller[0]; if (callFile === file) { seen = true; } else if (callFile === this._file) { file = this._file; } else if (seen) { break; } } var key = caller ? depSite.join(":") + "__" + caller.join(":") : void 0; if (key !== void 0 && key in this._warned) { return; } this._warned[key] = true; var msg = message2; if (!msg) { msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite); } if (haslisteners) { var err = DeprecationError(this._namespace, msg, stack2.slice(i2)); process.emit("deprecation", err); return; } var format = process.stderr.isTTY ? formatColor : formatPlain; var output = format.call(this, msg, caller, stack2.slice(i2)); process.stderr.write(output + "\n", "utf8"); } function callSiteLocation(callSite) { var file = callSite.getFileName() || ""; var line = callSite.getLineNumber(); var colm = callSite.getColumnNumber(); if (callSite.isEval()) { file = callSite.getEvalOrigin() + ", " + file; } var site2 = [file, line, colm]; site2.callSite = callSite; site2.name = callSite.getFunctionName(); return site2; } function defaultMessage(site2) { var callSite = site2.callSite; var funcName = site2.name; if (!funcName) { funcName = ""; } var context = callSite.getThis(); var typeName = context && callSite.getTypeName(); if (typeName === "Object") { typeName = void 0; } if (typeName === "Function") { typeName = context.name || typeName; } return typeName && callSite.getMethodName() ? typeName + "." + funcName : funcName; } function formatPlain(msg, caller, stack2) { var timestamp = (/* @__PURE__ */ new Date()).toUTCString(); var formatted = timestamp + " " + this._namespace + " deprecated " + msg; if (this._traced) { for (var i2 = 0; i2 < stack2.length; i2++) { formatted += "\n at " + callSiteToString(stack2[i2]); } return formatted; } if (caller) { formatted += " at " + formatLocation(caller); } return formatted; } function formatColor(msg, caller, stack2) { var formatted = "\x1B[36;1m" + this._namespace + "\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m" + msg + "\x1B[39m"; if (this._traced) { for (var i2 = 0; i2 < stack2.length; i2++) { formatted += "\n \x1B[36mat " + callSiteToString(stack2[i2]) + "\x1B[39m"; } return formatted; } if (caller) { formatted += " \x1B[36m" + formatLocation(caller) + "\x1B[39m"; } return formatted; } function formatLocation(callSite) { return relative(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2]; } function getStack() { var limit = Error.stackTraceLimit; var obj = {}; var prep = Error.prepareStackTrace; Error.prepareStackTrace = prepareObjectStackTrace; Error.stackTraceLimit = Math.max(10, limit); Error.captureStackTrace(obj); var stack2 = obj.stack.slice(1); Error.prepareStackTrace = prep; Error.stackTraceLimit = limit; return stack2; } function prepareObjectStackTrace(obj, stack2) { return stack2; } function wrapfunction(fn, message) { if (typeof fn !== "function") { throw new TypeError("argument fn must be a function"); } var args = createArgumentsString(fn.length); var deprecate = this; var stack = getStack(); var site = callSiteLocation(stack[1]); site.name = fn.name; var deprecatedfn = eval("(function (" + args + ') {\n"use strict"\nlog.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n})'); return deprecatedfn; } function wrapproperty(obj, prop, message2) { if (!obj || typeof obj !== "object" && typeof obj !== "function") { throw new TypeError("argument obj must be object"); } var descriptor = Object.getOwnPropertyDescriptor(obj, prop); if (!descriptor) { throw new TypeError("must call property on owner object"); } if (!descriptor.configurable) { throw new TypeError("property must be configurable"); } var deprecate4 = this; var stack2 = getStack(); var site2 = callSiteLocation(stack2[1]); site2.name = prop; if ("value" in descriptor) { descriptor = convertDataDescriptorToAccessor(obj, prop, message2); } var get = descriptor.get; var set = descriptor.set; if (typeof get === "function") { descriptor.get = function getter() { log.call(deprecate4, message2, site2); return get.apply(this, arguments); }; } if (typeof set === "function") { descriptor.set = function setter() { log.call(deprecate4, message2, site2); return set.apply(this, arguments); }; } Object.defineProperty(obj, prop, descriptor); } function DeprecationError(namespace, message2, stack2) { var error = new Error(); var stackString; Object.defineProperty(error, "constructor", { value: DeprecationError }); Object.defineProperty(error, "message", { configurable: true, enumerable: false, value: message2, writable: true }); Object.defineProperty(error, "name", { enumerable: false, configurable: true, value: "DeprecationError", writable: true }); Object.defineProperty(error, "namespace", { configurable: true, enumerable: false, value: namespace, writable: true }); Object.defineProperty(error, "stack", { configurable: true, enumerable: false, get: function() { if (stackString !== void 0) { return stackString; } return stackString = createStackString.call(this, stack2); }, set: function setter(val) { stackString = val; } }); return error; } } }); // ../node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.js var require_setprototypeof = __commonJS({ "../node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.js"(exports2, module2) { module2.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); function setProtoOf(obj, proto) { obj.__proto__ = proto; return obj; } function mixinProperties(obj, proto) { for (var prop in proto) { if (!Object.prototype.hasOwnProperty.call(obj, prop)) { obj[prop] = proto[prop]; } } return obj; } } }); // ../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js var require_inherits_browser = __commonJS({ "../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(exports2, module2) { if (typeof Object.create === "function") { module2.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); } }; } else { module2.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor; var TempCtor = function() { }; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; } }; } } }); // ../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js var require_inherits = __commonJS({ "../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"(exports2, module2) { try { util = require("util"); if (typeof util.inherits !== "function") throw ""; module2.exports = util.inherits; } catch (e2) { module2.exports = require_inherits_browser(); } var util; } }); // ../node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/index.js var require_toidentifier = __commonJS({ "../node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/index.js"(exports2, module2) { module2.exports = toIdentifier; function toIdentifier(str) { return str.split(" ").map(function(token) { return token.slice(0, 1).toUpperCase() + token.slice(1); }).join("").replace(/[^ _0-9a-z]/gi, ""); } } }); // ../node_modules/.pnpm/http-errors@1.8.1/node_modules/http-errors/index.js var require_http_errors = __commonJS({ "../node_modules/.pnpm/http-errors@1.8.1/node_modules/http-errors/index.js"(exports2, module2) { var deprecate4 = require_depd()("http-errors"); var setPrototypeOf = require_setprototypeof(); var statuses = require_statuses(); var inherits = require_inherits(); var toIdentifier = require_toidentifier(); module2.exports = createError; module2.exports.HttpError = createHttpErrorConstructor(); module2.exports.isHttpError = createIsHttpErrorFunction(module2.exports.HttpError); populateConstructorExports(module2.exports, statuses.codes, module2.exports.HttpError); function codeClass(status) { return Number(String(status).charAt(0) + "00"); } function createError() { var err; var msg; var status = 500; var props = {}; for (var i2 = 0; i2 < arguments.length; i2++) { var arg = arguments[i2]; if (arg instanceof Error) { err = arg; status = err.status || err.statusCode || status; continue; } switch (typeof arg) { case "string": msg = arg; break; case "number": status = arg; if (i2 !== 0) { deprecate4("non-first-argument status code; replace with createError(" + arg + ", ...)"); } break; case "object": props = arg; break; } } if (typeof status === "number" && (status < 400 || status >= 600)) { deprecate4("non-error status code; use only 4xx or 5xx status codes"); } if (typeof status !== "number" || !statuses[status] && (status < 400 || status >= 600)) { status = 500; } var HttpError2 = createError[status] || createError[codeClass(status)]; if (!err) { err = HttpError2 ? new HttpError2(msg) : new Error(msg || statuses[status]); Error.captureStackTrace(err, createError); } if (!HttpError2 || !(err instanceof HttpError2) || err.status !== status) { err.expose = status < 500; err.status = err.statusCode = status; } for (var key in props) { if (key !== "status" && key !== "statusCode") { err[key] = props[key]; } } return err; } function createHttpErrorConstructor() { function HttpError2() { throw new TypeError("cannot construct abstract class"); } inherits(HttpError2, Error); return HttpError2; } function createClientErrorConstructor(HttpError2, name, code) { var className = toClassName(name); function ClientError(message2) { var msg = message2 != null ? message2 : statuses[code]; var err = new Error(msg); Error.captureStackTrace(err, ClientError); setPrototypeOf(err, ClientError.prototype); Object.defineProperty(err, "message", { enumerable: true, configurable: true, value: msg, writable: true }); Object.defineProperty(err, "name", { enumerable: false, configurable: true, value: className, writable: true }); return err; } inherits(ClientError, HttpError2); nameFunc(ClientError, className); ClientError.prototype.status = code; ClientError.prototype.statusCode = code; ClientError.prototype.expose = true; return ClientError; } function createIsHttpErrorFunction(HttpError2) { return function isHttpError(val) { if (!val || typeof val !== "object") { return false; } if (val instanceof HttpError2) { return true; } return val instanceof Error && typeof val.expose === "boolean" && typeof val.statusCode === "number" && val.status === val.statusCode; }; } function createServerErrorConstructor(HttpError2, name, code) { var className = toClassName(name); function ServerError(message2) { var msg = message2 != null ? message2 : statuses[code]; var err = new Error(msg); Error.captureStackTrace(err, ServerError); setPrototypeOf(err, ServerError.prototype); Object.defineProperty(err, "message", { enumerable: true, configurable: true, value: msg, writable: true }); Object.defineProperty(err, "name", { enumerable: false, configurable: true, value: className, writable: true }); return err; } inherits(ServerError, HttpError2); nameFunc(ServerError, className); ServerError.prototype.status = code; ServerError.prototype.statusCode = code; ServerError.prototype.expose = false; return ServerError; } function nameFunc(func, name) { var desc = Object.getOwnPropertyDescriptor(func, "name"); if (desc && desc.configurable) { desc.value = name; Object.defineProperty(func, "name", desc); } } function populateConstructorExports(exports3, codes, HttpError2) { codes.forEach(function forEachCode(code) { var CodeError; var name = toIdentifier(statuses[code]); switch (codeClass(code)) { case 400: CodeError = createClientErrorConstructor(HttpError2, name, code); break; case 500: CodeError = createServerErrorConstructor(HttpError2, name, code); break; } if (CodeError) { exports3[code] = CodeError; exports3[name] = CodeError; } }); exports3["I'mateapot"] = deprecate4.function( exports3.ImATeapot, `"I'mateapot"; use "ImATeapot" instead` ); } function toClassName(name) { return name.substr(-5) !== "Error" ? name + "Error" : name; } } }); // ../node_modules/.pnpm/deep-equal@1.0.1/node_modules/deep-equal/lib/keys.js var require_keys = __commonJS({ "../node_modules/.pnpm/deep-equal@1.0.1/node_modules/deep-equal/lib/keys.js"(exports2, module2) { exports2 = module2.exports = typeof Object.keys === "function" ? Object.keys : shim; exports2.shim = shim; function shim(obj) { var keys = []; for (var key in obj) keys.push(key); return keys; } } }); // ../node_modules/.pnpm/deep-equal@1.0.1/node_modules/deep-equal/lib/is_arguments.js var require_is_arguments = __commonJS({ "../node_modules/.pnpm/deep-equal@1.0.1/node_modules/deep-equal/lib/is_arguments.js"(exports2, module2) { var supportsArgumentsClass = function() { return Object.prototype.toString.call(arguments); }() == "[object Arguments]"; exports2 = module2.exports = supportsArgumentsClass ? supported : unsupported; exports2.supported = supported; function supported(object) { return Object.prototype.toString.call(object) == "[object Arguments]"; } exports2.unsupported = unsupported; function unsupported(object) { return object && typeof object == "object" && typeof object.length == "number" && Object.prototype.hasOwnProperty.call(object, "callee") && !Object.prototype.propertyIsEnumerable.call(object, "callee") || false; } } }); // ../node_modules/.pnpm/deep-equal@1.0.1/node_modules/deep-equal/index.js var require_deep_equal = __commonJS({ "../node_modules/.pnpm/deep-equal@1.0.1/node_modules/deep-equal/index.js"(exports2, module2) { var pSlice = Array.prototype.slice; var objectKeys = require_keys(); var isArguments = require_is_arguments(); var deepEqual = module2.exports = function(actual, expected, opts) { if (!opts) opts = {}; if (actual === expected) { return true; } else if (actual instanceof Date && expected instanceof Date) { return actual.getTime() === expected.getTime(); } else if (!actual || !expected || typeof actual != "object" && typeof expected != "object") { return opts.strict ? actual === expected : actual == expected; } else { return objEquiv(actual, expected, opts); } }; function isUndefinedOrNull(value) { return value === null || value === void 0; } function isBuffer(x2) { if (!x2 || typeof x2 !== "object" || typeof x2.length !== "number") return false; if (typeof x2.copy !== "function" || typeof x2.slice !== "function") { return false; } if (x2.length > 0 && typeof x2[0] !== "number") return false; return true; } function objEquiv(a, b, opts) { var i2, key; if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) return false; if (a.prototype !== b.prototype) return false; if (isArguments(a)) { if (!isArguments(b)) { return false; } a = pSlice.call(a); b = pSlice.call(b); return deepEqual(a, b, opts); } if (isBuffer(a)) { if (!isBuffer(b)) { return false; } if (a.length !== b.length) return false; for (i2 = 0; i2 < a.length; i2++) { if (a[i2] !== b[i2]) return false; } return true; } try { var ka = objectKeys(a), kb = objectKeys(b); } catch (e2) { return false; } if (ka.length != kb.length) return false; ka.sort(); kb.sort(); for (i2 = ka.length - 1; i2 >= 0; i2--) { if (ka[i2] != kb[i2]) return false; } for (i2 = ka.length - 1; i2 >= 0; i2--) { key = ka[i2]; if (!deepEqual(a[key], b[key], opts)) return false; } return typeof a === typeof b; } } }); // ../node_modules/.pnpm/http-assert@1.5.0/node_modules/http-assert/index.js var require_http_assert = __commonJS({ "../node_modules/.pnpm/http-assert@1.5.0/node_modules/http-assert/index.js"(exports2, module2) { var createError = require_http_errors(); var eql = require_deep_equal(); module2.exports = assert; function assert(value, status, msg, opts) { if (value) return; throw createError(status, msg, opts); } assert.fail = function(status, msg, opts) { assert(false, status, msg, opts); }; assert.equal = function(a, b, status, msg, opts) { assert(a == b, status, msg, opts); }; assert.notEqual = function(a, b, status, msg, opts) { assert(a != b, status, msg, opts); }; assert.ok = function(value, status, msg, opts) { assert(value, status, msg, opts); }; assert.strictEqual = function(a, b, status, msg, opts) { assert(a === b, status, msg, opts); }; assert.notStrictEqual = function(a, b, status, msg, opts) { assert(a !== b, status, msg, opts); }; assert.deepEqual = function(a, b, status, msg, opts) { assert(eql(a, b), status, msg, opts); }; assert.notDeepEqual = function(a, b, status, msg, opts) { assert(!eql(a, b), status, msg, opts); }; } }); // ../node_modules/.pnpm/delegates@1.0.0/node_modules/delegates/index.js var require_delegates = __commonJS({ "../node_modules/.pnpm/delegates@1.0.0/node_modules/delegates/index.js"(exports2, module2) { module2.exports = Delegator; function Delegator(proto, target) { if (!(this instanceof Delegator)) return new Delegator(proto, target); this.proto = proto; this.target = target; this.methods = []; this.getters = []; this.setters = []; this.fluents = []; } Delegator.prototype.method = function(name) { var proto = this.proto; var target = this.target; this.methods.push(name); proto[name] = function() { return this[target][name].apply(this[target], arguments); }; return this; }; Delegator.prototype.access = function(name) { return this.getter(name).setter(name); }; Delegator.prototype.getter = function(name) { var proto = this.proto; var target = this.target; this.getters.push(name); proto.__defineGetter__(name, function() { return this[target][name]; }); return this; }; Delegator.prototype.setter = function(name) { var proto = this.proto; var target = this.target; this.setters.push(name); proto.__defineSetter__(name, function(val) { return this[target][name] = val; }); return this; }; Delegator.prototype.fluent = function(name) { var proto = this.proto; var target = this.target; this.fluents.push(name); proto[name] = function(val) { if ("undefined" != typeof val) { this[target][name] = val; return this; } else { return this[target][name]; } }; return this; }; } }); // ../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js var require_depd2 = __commonJS({ "../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js"(exports2, module2) { var relative2 = require("path").relative; module2.exports = depd2; var basePath2 = process.cwd(); function containsNamespace2(str, namespace) { var vals = str.split(/[ ,]+/); var ns = String(namespace).toLowerCase(); for (var i2 = 0; i2 < vals.length; i2++) { var val = vals[i2]; if (val && (val === "*" || val.toLowerCase() === ns)) { return true; } } return false; } function convertDataDescriptorToAccessor2(obj, prop, message2) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop); var value = descriptor.value; descriptor.get = function getter() { return value; }; if (descriptor.writable) { descriptor.set = function setter(val) { return value = val; }; } delete descriptor.value; delete descriptor.writable; Object.defineProperty(obj, prop, descriptor); return descriptor; } function createArgumentsString2(arity) { var str = ""; for (var i2 = 0; i2 < arity; i2++) { str += ", arg" + i2; } return str.substr(2); } function createStackString2(stack2) { var str = this.name + ": " + this.namespace; if (this.message) { str += " deprecated " + this.message; } for (var i2 = 0; i2 < stack2.length; i2++) { str += "\n at " + stack2[i2].toString(); } return str; } function depd2(namespace) { if (!namespace) { throw new TypeError("argument namespace is required"); } var stack2 = getStack2(); var site2 = callSiteLocation2(stack2[1]); var file = site2[0]; function deprecate4(message2) { log2.call(deprecate4, message2); } deprecate4._file = file; deprecate4._ignored = isignored2(namespace); deprecate4._namespace = namespace; deprecate4._traced = istraced2(namespace); deprecate4._warned = /* @__PURE__ */ Object.create(null); deprecate4.function = wrapfunction2; deprecate4.property = wrapproperty2; return deprecate4; } function eehaslisteners(emitter, type) { var count = typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type); return count > 0; } function isignored2(namespace) { if (process.noDeprecation) { return true; } var str = process.env.NO_DEPRECATION || ""; return containsNamespace2(str, namespace); } function istraced2(namespace) { if (process.traceDeprecation) { return true; } var str = process.env.TRACE_DEPRECATION || ""; return containsNamespace2(str, namespace); } function log2(message2, site2) { var haslisteners = eehaslisteners(process, "deprecation"); if (!haslisteners && this._ignored) { return; } var caller; var callFile; var callSite; var depSite; var i2 = 0; var seen = false; var stack2 = getStack2(); var file = this._file; if (site2) { depSite = site2; callSite = callSiteLocation2(stack2[1]); callSite.name = depSite.name; file = callSite[0]; } else { i2 = 2; depSite = callSiteLocation2(stack2[i2]); callSite = depSite; } for (; i2 < stack2.length; i2++) { caller = callSiteLocation2(stack2[i2]); callFile = caller[0]; if (callFile === file) { seen = true; } else if (callFile === this._file) { file = this._file; } else if (seen) { break; } } var key = caller ? depSite.join(":") + "__" + caller.join(":") : void 0; if (key !== void 0 && key in this._warned) { return; } this._warned[key] = true; var msg = message2; if (!msg) { msg = callSite === depSite || !callSite.name ? defaultMessage2(depSite) : defaultMessage2(callSite); } if (haslisteners) { var err = DeprecationError2(this._namespace, msg, stack2.slice(i2)); process.emit("deprecation", err); return; } var format = process.stderr.isTTY ? formatColor2 : formatPlain2; var output = format.call(this, msg, caller, stack2.slice(i2)); process.stderr.write(output + "\n", "utf8"); } function callSiteLocation2(callSite) { var file = callSite.getFileName() || ""; var line = callSite.getLineNumber(); var colm = callSite.getColumnNumber(); if (callSite.isEval()) { file = callSite.getEvalOrigin() + ", " + file; } var site2 = [file, line, colm]; site2.callSite = callSite; site2.name = callSite.getFunctionName(); return site2; } function defaultMessage2(site2) { var callSite = site2.callSite; var funcName = site2.name; if (!funcName) { funcName = ""; } var context = callSite.getThis(); var typeName = context && callSite.getTypeName(); if (typeName === "Object") { typeName = void 0; } if (typeName === "Function") { typeName = context.name || typeName; } return typeName && callSite.getMethodName() ? typeName + "." + funcName : funcName; } function formatPlain2(msg, caller, stack2) { var timestamp = (/* @__PURE__ */ new Date()).toUTCString(); var formatted = timestamp + " " + this._namespace + " deprecated " + msg; if (this._traced) { for (var i2 = 0; i2 < stack2.length; i2++) { formatted += "\n at " + stack2[i2].toString(); } return formatted; } if (caller) { formatted += " at " + formatLocation2(caller); } return formatted; } function formatColor2(msg, caller, stack2) { var formatted = "\x1B[36;1m" + this._namespace + "\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m" + msg + "\x1B[39m"; if (this._traced) { for (var i2 = 0; i2 < stack2.length; i2++) { formatted += "\n \x1B[36mat " + stack2[i2].toString() + "\x1B[39m"; } return formatted; } if (caller) { formatted += " \x1B[36m" + formatLocation2(caller) + "\x1B[39m"; } return formatted; } function formatLocation2(callSite) { return relative2(basePath2, callSite[0]) + ":" + callSite[1] + ":" + callSite[2]; } function getStack2() { var limit = Error.stackTraceLimit; var obj = {}; var prep = Error.prepareStackTrace; Error.prepareStackTrace = prepareObjectStackTrace2; Error.stackTraceLimit = Math.max(10, limit); Error.captureStackTrace(obj); var stack2 = obj.stack.slice(1); Error.prepareStackTrace = prep; Error.stackTraceLimit = limit; return stack2; } function prepareObjectStackTrace2(obj, stack2) { return stack2; } function wrapfunction2(fn2, message2) { if (typeof fn2 !== "function") { throw new TypeError("argument fn must be a function"); } var args2 = createArgumentsString2(fn2.length); var stack2 = getStack2(); var site2 = callSiteLocation2(stack2[1]); site2.name = fn2.name; var deprecatedfn2 = new Function( "fn", "log", "deprecate", "message", "site", '"use strict"\nreturn function (' + args2 + ") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}" )(fn2, log2, this, message2, site2); return deprecatedfn2; } function wrapproperty2(obj, prop, message2) { if (!obj || typeof obj !== "object" && typeof obj !== "function") { throw new TypeError("argument obj must be object"); } var descriptor = Object.getOwnPropertyDescriptor(obj, prop); if (!descriptor) { throw new TypeError("must call property on owner object"); } if (!descriptor.configurable) { throw new TypeError("property must be configurable"); } var deprecate4 = this; var stack2 = getStack2(); var site2 = callSiteLocation2(stack2[1]); site2.name = prop; if ("value" in descriptor) { descriptor = convertDataDescriptorToAccessor2(obj, prop, message2); } var get = descriptor.get; var set = descriptor.set; if (typeof get === "function") { descriptor.get = function getter() { log2.call(deprecate4, message2, site2); return get.apply(this, arguments); }; } if (typeof set === "function") { descriptor.set = function setter() { log2.call(deprecate4, message2, site2); return set.apply(this, arguments); }; } Object.defineProperty(obj, prop, descriptor); } function DeprecationError2(namespace, message2, stack2) { var error = new Error(); var stackString; Object.defineProperty(error, "constructor", { value: DeprecationError2 }); Object.defineProperty(error, "message", { configurable: true, enumerable: false, value: message2, writable: true }); Object.defineProperty(error, "name", { enumerable: false, configurable: true, value: "DeprecationError", writable: true }); Object.defineProperty(error, "namespace", { configurable: true, enumerable: false, value: namespace, writable: true }); Object.defineProperty(error, "stack", { configurable: true, enumerable: false, get: function() { if (stackString !== void 0) { return stackString; } return stackString = createStackString2.call(this, stack2); }, set: function setter(val) { stackString = val; } }); return error; } } }); // ../node_modules/.pnpm/tsscmp@1.0.6/node_modules/tsscmp/lib/index.js var require_lib = __commonJS({ "../node_modules/.pnpm/tsscmp@1.0.6/node_modules/tsscmp/lib/index.js"(exports2, module2) { var crypto2 = require("crypto"); function bufferEqual(a, b) { if (a.length !== b.length) { return false; } if (crypto2.timingSafeEqual) { return crypto2.timingSafeEqual(a, b); } for (var i2 = 0; i2 < a.length; i2++) { if (a[i2] !== b[i2]) { return false; } } return true; } function timeSafeCompare(a, b) { var sa = String(a); var sb = String(b); var key = crypto2.pseudoRandomBytes(32); var ah = crypto2.createHmac("sha256", key).update(sa).digest(); var bh = crypto2.createHmac("sha256", key).update(sb).digest(); return bufferEqual(ah, bh) && a === b; } module2.exports = timeSafeCompare; } }); // ../node_modules/.pnpm/keygrip@1.1.0/node_modules/keygrip/index.js var require_keygrip = __commonJS({ "../node_modules/.pnpm/keygrip@1.1.0/node_modules/keygrip/index.js"(exports2, module2) { var compare = require_lib(); var crypto2 = require("crypto"); function Keygrip(keys, algorithm, encoding) { if (!algorithm) algorithm = "sha1"; if (!encoding) encoding = "base64"; if (!(this instanceof Keygrip)) return new Keygrip(keys, algorithm, encoding); if (!keys || !(0 in keys)) { throw new Error("Keys must be provided."); } function sign(data, key) { return crypto2.createHmac(algorithm, key).update(data).digest(encoding).replace(/\/|\+|=/g, function(x2) { return { "/": "_", "+": "-", "=": "" }[x2]; }); } this.sign = function(data) { return sign(data, keys[0]); }; this.verify = function(data, digest) { return this.index(data, digest) > -1; }; this.index = function(data, digest) { for (var i2 = 0, l = keys.length; i2 < l; i2++) { if (compare(digest, sign(data, keys[i2]))) { return i2; } } return -1; }; } Keygrip.sign = Keygrip.verify = Keygrip.index = function() { throw new Error("Usage: require('keygrip')()"); }; module2.exports = Keygrip; } }); // ../node_modules/.pnpm/cookies@0.9.1/node_modules/cookies/index.js var require_cookies = __commonJS({ "../node_modules/.pnpm/cookies@0.9.1/node_modules/cookies/index.js"(exports2, module2) { var deprecate4 = require_depd2()("cookies"); var Keygrip = require_keygrip(); var http3 = require("http"); var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; var PRIORITY_REGEXP = /^(?:low|medium|high)$/i; var REGEXP_CACHE = /* @__PURE__ */ Object.create(null); var REGEXP_ESCAPE_CHARS_REGEXP = /[\^$\\.*+?()[\]{}|]/g; var RESTRICTED_NAME_CHARS_REGEXP = /[;=]/; var RESTRICTED_VALUE_CHARS_REGEXP = /[;]/; var SAME_SITE_REGEXP = /^(?:lax|none|strict)$/i; function Cookies(request, response, options) { if (!(this instanceof Cookies)) return new Cookies(request, response, options); this.secure = void 0; this.request = request; this.response = response; if (options) { if (Array.isArray(options)) { deprecate4('"keys" argument; provide using options {"keys": [...]}'); this.keys = new Keygrip(options); } else if (options.constructor && options.constructor.name === "Keygrip") { deprecate4('"keys" argument; provide using options {"keys": keygrip}'); this.keys = options; } else { this.keys = Array.isArray(options.keys) ? new Keygrip(options.keys) : options.keys; this.secure = options.secure; } } } Cookies.prototype.get = function(name, opts) { var sigName = name + ".sig", header, match, value, remote, data, index, signed = opts && opts.signed !== void 0 ? opts.signed : !!this.keys; header = this.request.headers["cookie"]; if (!header) return; match = header.match(getPattern(name)); if (!match) return; value = match[1]; if (value[0] === '"') value = value.slice(1, -1); if (!opts || !signed) return value; remote = this.get(sigName); if (!remote) return; data = name + "=" + value; if (!this.keys) throw new Error(".keys required for signed cookies"); index = this.keys.index(data, remote); if (index < 0) { this.set(sigName, null, { path: "/", signed: false }); } else { index && this.set(sigName, this.keys.sign(data), { signed: false }); return value; } }; Cookies.prototype.set = function(name, value, opts) { var res = this.response, req = this.request, headers = res.getHeader("Set-Cookie") || [], cookie = new Cookie(name, value, opts), signed = opts && opts.signed !== void 0 ? opts.signed : !!this.keys; var secure = this.secure === void 0 ? req.protocol === "https" || isRequestEncrypted(req) : Boolean(this.secure); if (typeof headers == "string") headers = [headers]; if (!secure && opts && opts.secure) { throw new Error("Cannot send secure cookie over unencrypted connection"); } cookie.secure = opts && opts.secure !== void 0 ? opts.secure : secure; if (opts && "secureProxy" in opts) { deprecate4('"secureProxy" option; use "secure" option, provide "secure" to constructor if needed'); cookie.secure = opts.secureProxy; } pushCookie(headers, cookie); if (opts && signed) { if (!this.keys) throw new Error(".keys required for signed cookies"); cookie.value = this.keys.sign(cookie.toString()); cookie.name += ".sig"; pushCookie(headers, cookie); } var setHeader = res.set ? http3.OutgoingMessage.prototype.setHeader : res.setHeader; setHeader.call(res, "Set-Cookie", headers); return this; }; function Cookie(name, value, attrs) { if (!fieldContentRegExp.test(name) || RESTRICTED_NAME_CHARS_REGEXP.test(name)) { throw new TypeError("argument name is invalid"); } if (value && (!fieldContentRegExp.test(value) || RESTRICTED_VALUE_CHARS_REGEXP.test(value))) { throw new TypeError("argument value is invalid"); } this.name = name; this.value = value || ""; for (var name in attrs) { this[name] = attrs[name]; } if (!this.value) { this.expires = /* @__PURE__ */ new Date(0); this.maxAge = null; } if (this.path && !fieldContentRegExp.test(this.path)) { throw new TypeError("option path is invalid"); } if (this.domain && !fieldContentRegExp.test(this.domain)) { throw new TypeError("option domain is invalid"); } if (typeof this.maxAge === "number" ? isNaN(this.maxAge) || !isFinite(this.maxAge) : this.maxAge) { throw new TypeError("option maxAge is invalid"); } if (this.priority && !PRIORITY_REGEXP.test(this.priority)) { throw new TypeError("option priority is invalid"); } if (this.sameSite && this.sameSite !== true && !SAME_SITE_REGEXP.test(this.sameSite)) { throw new TypeError("option sameSite is invalid"); } } Cookie.prototype.path = "/"; Cookie.prototype.expires = void 0; Cookie.prototype.domain = void 0; Cookie.prototype.httpOnly = true; Cookie.prototype.partitioned = false; Cookie.prototype.priority = void 0; Cookie.prototype.sameSite = false; Cookie.prototype.secure = false; Cookie.prototype.overwrite = false; Cookie.prototype.toString = function() { return this.name + "=" + this.value; }; Cookie.prototype.toHeader = function() { var header = this.toString(); if (this.maxAge) this.expires = new Date(Date.now() + this.maxAge); if (this.path) header += "; path=" + this.path; if (this.expires) header += "; expires=" + this.expires.toUTCString(); if (this.domain) header += "; domain=" + this.domain; if (this.priority) header += "; priority=" + this.priority.toLowerCase(); if (this.sameSite) header += "; samesite=" + (this.sameSite === true ? "strict" : this.sameSite.toLowerCase()); if (this.secure) header += "; secure"; if (this.httpOnly) header += "; httponly"; if (this.partitioned) header += "; partitioned"; return header; }; Object.defineProperty(Cookie.prototype, "maxage", { configurable: true, enumerable: true, get: function() { return this.maxAge; }, set: function(val) { return this.maxAge = val; } }); deprecate4.property(Cookie.prototype, "maxage", '"maxage"; use "maxAge" instead'); function getPattern(name) { if (!REGEXP_CACHE[name]) { REGEXP_CACHE[name] = new RegExp( "(?:^|;) *" + name.replace(REGEXP_ESCAPE_CHARS_REGEXP, "\\$&") + "=([^;]*)" ); } return REGEXP_CACHE[name]; } function isRequestEncrypted(req) { return req.socket ? req.socket.encrypted : req.connection.encrypted; } function pushCookie(headers, cookie) { if (cookie.overwrite) { for (var i2 = headers.length - 1; i2 >= 0; i2--) { if (headers[i2].indexOf(cookie.name + "=") === 0) { headers.splice(i2, 1); } } } headers.push(cookie.toHeader()); } Cookies.connect = Cookies.express = function(keys) { return function(req, res, next) { req.cookies = res.cookies = new Cookies(req, res, { keys }); next(); }; }; Cookies.Cookie = Cookie; module2.exports = Cookies; } }); // ../node_modules/.pnpm/koa@2.15.4/node_modules/koa/lib/context.js var require_context = __commonJS({ "../node_modules/.pnpm/koa@2.15.4/node_modules/koa/lib/context.js"(exports2, module2) { var util = require("util"); var createError = require_http_errors(); var httpAssert = require_http_assert(); var delegate = require_delegates(); var statuses = require_statuses(); var Cookies = require_cookies(); var COOKIES = Symbol("context#cookies"); var proto = module2.exports = { /** * util.inspect() implementation, which * just returns the JSON output. * * @return {Object} * @api public */ inspect() { if (this === proto) return this; return this.toJSON(); }, /** * Return JSON representation. * * Here we explicitly invoke .toJSON() on each * object, as iteration will otherwise fail due * to the getters and cause utilities such as * clone() to fail. * * @return {Object} * @api public */ toJSON() { return { request: this.request.toJSON(), response: this.response.toJSON(), app: this.app.toJSON(), originalUrl: this.originalUrl, req: "", res: "", socket: "" }; }, /** * Similar to .throw(), adds assertion. * * this.assert(this.user, 401, 'Please login!'); * * See: https://github.com/jshttp/http-assert * * @param {Mixed} test * @param {Number} status * @param {String} message * @api public */ assert: httpAssert, /** * Throw an error with `status` (default 500) and * `msg`. Note that these are user-level * errors, and the message may be exposed to the client. * * this.throw(403) * this.throw(400, 'name required') * this.throw('something exploded') * this.throw(new Error('invalid')) * this.throw(400, new Error('invalid')) * * See: https://github.com/jshttp/http-errors * * Note: `status` should only be passed as the first parameter. * * @param {String|Number|Error} err, msg or status * @param {String|Number|Error} [err, msg or status] * @param {Object} [props] * @api public */ throw(...args2) { throw createError(...args2); }, /** * Default error handling. * * @param {Error} err * @api private */ onerror(err) { if (null == err) return; const isNativeError = Object.prototype.toString.call(err) === "[object Error]" || err instanceof Error; if (!isNativeError) err = new Error(util.format("non-error thrown: %j", err)); let headerSent = false; if (this.headerSent || !this.writable) { headerSent = err.headerSent = true; } this.app.emit("error", err, this); if (headerSent) { return; } const { res } = this; if (typeof res.getHeaderNames === "function") { res.getHeaderNames().forEach((name) => res.removeHeader(name)); } else { res._headers = {}; } this.set(err.headers); this.type = "text"; let statusCode = err.status || err.statusCode; if ("ENOENT" === err.code) statusCode = 404; if ("number" !== typeof statusCode || !statuses[statusCode]) statusCode = 500; const code = statuses[statusCode]; const msg = err.expose ? err.message : code; this.status = err.status = statusCode; this.length = Buffer.byteLength(msg); res.end(msg); }, get cookies() { if (!this[COOKIES]) { this[COOKIES] = new Cookies(this.req, this.res, { keys: this.app.keys, secure: this.request.secure }); } return this[COOKIES]; }, set cookies(_cookies) { this[COOKIES] = _cookies; } }; if (util.inspect.custom) { module2.exports[util.inspect.custom] = module2.exports.inspect; } delegate(proto, "response").method("attachment").method("redirect").method("remove").method("vary").method("has").method("set").method("append").method("flushHeaders").access("status").access("message").access("body").access("length").access("type").access("lastModified").access("etag").getter("headerSent").getter("writable"); delegate(proto, "request").method("acceptsLanguages").method("acceptsEncodings").method("acceptsCharsets").method("accepts").method("get").method("is").access("querystring").access("idempotent").access("socket").access("search").access("method").access("query").access("path").access("url").access("accept").getter("origin").getter("href").getter("subdomains").getter("protocol").getter("host").getter("hostname").getter("URL").getter("header").getter("headers").getter("secure").getter("stale").getter("fresh").getter("ips").getter("ip"); } }); // ../node_modules/.pnpm/negotiator@0.6.3/node_modules/negotiator/lib/charset.js var require_charset = __commonJS({ "../node_modules/.pnpm/negotiator@0.6.3/node_modules/negotiator/lib/charset.js"(exports2, module2) { module2.exports = preferredCharsets; module2.exports.preferredCharsets = preferredCharsets; var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; function parseAcceptCharset(accept) { var accepts = accept.split(","); for (var i2 = 0, j = 0; i2 < accepts.length; i2++) { var charset = parseCharset(accepts[i2].trim(), i2); if (charset) { accepts[j++] = charset; } } accepts.length = j; return accepts; } function parseCharset(str, i2) { var match = simpleCharsetRegExp.exec(str); if (!match) return null; var charset = match[1]; var q = 1; if (match[2]) { var params = match[2].split(";"); for (var j = 0; j < params.length; j++) { var p = params[j].trim().split("="); if (p[0] === "q") { q = parseFloat(p[1]); break; } } } return { charset, q, i: i2 }; } function getCharsetPriority(charset, accepted, index) { var priority = { o: -1, q: 0, s: 0 }; for (var i2 = 0; i2 < accepted.length; i2++) { var spec = specify(charset, accepted[i2], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } function specify(charset, spec, index) { var s2 = 0; if (spec.charset.toLowerCase() === charset.toLowerCase()) { s2 |= 1; } else if (spec.charset !== "*") { return null; } return { i: index, o: spec.i, q: spec.q, s: s2 }; } function preferredCharsets(accept, provided) { var accepts = parseAcceptCharset(accept === void 0 ? "*" : accept || ""); if (!provided) { return accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset); } var priorities = provided.map(function getPriority(type, index) { return getCharsetPriority(type, accepts, index); }); return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) { return provided[priorities.indexOf(priority)]; }); } function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } function getFullCharset(spec) { return spec.charset; } function isQuality(spec) { return spec.q > 0; } } }); // ../node_modules/.pnpm/negotiator@0.6.3/node_modules/negotiator/lib/encoding.js var require_encoding = __commonJS({ "../node_modules/.pnpm/negotiator@0.6.3/node_modules/negotiator/lib/encoding.js"(exports2, module2) { module2.exports = preferredEncodings; module2.exports.preferredEncodings = preferredEncodings; var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; function parseAcceptEncoding(accept) { var accepts = accept.split(","); var hasIdentity = false; var minQuality = 1; for (var i2 = 0, j = 0; i2 < accepts.length; i2++) { var encoding = parseEncoding(accepts[i2].trim(), i2); if (encoding) { accepts[j++] = encoding; hasIdentity = hasIdentity || specify("identity", encoding); minQuality = Math.min(minQuality, encoding.q || 1); } } if (!hasIdentity) { accepts[j++] = { encoding: "identity", q: minQuality, i: i2 }; } accepts.length = j; return accepts; } function parseEncoding(str, i2) { var match = simpleEncodingRegExp.exec(str); if (!match) return null; var encoding = match[1]; var q = 1; if (match[2]) { var params = match[2].split(";"); for (var j = 0; j < params.length; j++) { var p = params[j].trim().split("="); if (p[0] === "q") { q = parseFloat(p[1]); break; } } } return { encoding, q, i: i2 }; } function getEncodingPriority(encoding, accepted, index) { var priority = { o: -1, q: 0, s: 0 }; for (var i2 = 0; i2 < accepted.length; i2++) { var spec = specify(encoding, accepted[i2], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } function specify(encoding, spec, index) { var s2 = 0; if (spec.encoding.toLowerCase() === encoding.toLowerCase()) { s2 |= 1; } else if (spec.encoding !== "*") { return null; } return { i: index, o: spec.i, q: spec.q, s: s2 }; } function preferredEncodings(accept, provided) { var accepts = parseAcceptEncoding(accept || ""); if (!provided) { return accepts.filter(isQuality).sort(compareSpecs).map(getFullEncoding); } var priorities = provided.map(function getPriority(type, index) { return getEncodingPriority(type, accepts, index); }); return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) { return provided[priorities.indexOf(priority)]; }); } function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } function getFullEncoding(spec) { return spec.encoding; } function isQuality(spec) { return spec.q > 0; } } }); // ../node_modules/.pnpm/negotiator@0.6.3/node_modules/negotiator/lib/language.js var require_language = __commonJS({ "../node_modules/.pnpm/negotiator@0.6.3/node_modules/negotiator/lib/language.js"(exports2, module2) { module2.exports = preferredLanguages; module2.exports.preferredLanguages = preferredLanguages; var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; function parseAcceptLanguage(accept) { var accepts = accept.split(","); for (var i2 = 0, j = 0; i2 < accepts.length; i2++) { var language = parseLanguage(accepts[i2].trim(), i2); if (language) { accepts[j++] = language; } } accepts.length = j; return accepts; } function parseLanguage(str, i2) { var match = simpleLanguageRegExp.exec(str); if (!match) return null; var prefix = match[1]; var suffix = match[2]; var full = prefix; if (suffix) full += "-" + suffix; var q = 1; if (match[3]) { var params = match[3].split(";"); for (var j = 0; j < params.length; j++) { var p = params[j].split("="); if (p[0] === "q") q = parseFloat(p[1]); } } return { prefix, suffix, q, i: i2, full }; } function getLanguagePriority(language, accepted, index) { var priority = { o: -1, q: 0, s: 0 }; for (var i2 = 0; i2 < accepted.length; i2++) { var spec = specify(language, accepted[i2], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } function specify(language, spec, index) { var p = parseLanguage(language); if (!p) return null; var s2 = 0; if (spec.full.toLowerCase() === p.full.toLowerCase()) { s2 |= 4; } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) { s2 |= 2; } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) { s2 |= 1; } else if (spec.full !== "*") { return null; } return { i: index, o: spec.i, q: spec.q, s: s2 }; } function preferredLanguages(accept, provided) { var accepts = parseAcceptLanguage(accept === void 0 ? "*" : accept || ""); if (!provided) { return accepts.filter(isQuality).sort(compareSpecs).map(getFullLanguage); } var priorities = provided.map(function getPriority(type, index) { return getLanguagePriority(type, accepts, index); }); return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) { return provided[priorities.indexOf(priority)]; }); } function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } function getFullLanguage(spec) { return spec.full; } function isQuality(spec) { return spec.q > 0; } } }); // ../node_modules/.pnpm/negotiator@0.6.3/node_modules/negotiator/lib/mediaType.js var require_mediaType = __commonJS({ "../node_modules/.pnpm/negotiator@0.6.3/node_modules/negotiator/lib/mediaType.js"(exports2, module2) { module2.exports = preferredMediaTypes; module2.exports.preferredMediaTypes = preferredMediaTypes; var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; function parseAccept(accept) { var accepts = splitMediaTypes(accept); for (var i2 = 0, j = 0; i2 < accepts.length; i2++) { var mediaType = parseMediaType(accepts[i2].trim(), i2); if (mediaType) { accepts[j++] = mediaType; } } accepts.length = j; return accepts; } function parseMediaType(str, i2) { var match = simpleMediaTypeRegExp.exec(str); if (!match) return null; var params = /* @__PURE__ */ Object.create(null); var q = 1; var subtype = match[2]; var type = match[1]; if (match[3]) { var kvps = splitParameters(match[3]).map(splitKeyValuePair); for (var j = 0; j < kvps.length; j++) { var pair = kvps[j]; var key = pair[0].toLowerCase(); var val = pair[1]; var value = val && val[0] === '"' && val[val.length - 1] === '"' ? val.substr(1, val.length - 2) : val; if (key === "q") { q = parseFloat(value); break; } params[key] = value; } } return { type, subtype, params, q, i: i2 }; } function getMediaTypePriority(type, accepted, index) { var priority = { o: -1, q: 0, s: 0 }; for (var i2 = 0; i2 < accepted.length; i2++) { var spec = specify(type, accepted[i2], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } function specify(type, spec, index) { var p = parseMediaType(type); var s2 = 0; if (!p) { return null; } if (spec.type.toLowerCase() == p.type.toLowerCase()) { s2 |= 4; } else if (spec.type != "*") { return null; } if (spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { s2 |= 2; } else if (spec.subtype != "*") { return null; } var keys = Object.keys(spec.params); if (keys.length > 0) { if (keys.every(function(k) { return spec.params[k] == "*" || (spec.params[k] || "").toLowerCase() == (p.params[k] || "").toLowerCase(); })) { s2 |= 1; } else { return null; } } return { i: index, o: spec.i, q: spec.q, s: s2 }; } function preferredMediaTypes(accept, provided) { var accepts = parseAccept(accept === void 0 ? "*/*" : accept || ""); if (!provided) { return accepts.filter(isQuality).sort(compareSpecs).map(getFullType); } var priorities = provided.map(function getPriority(type, index) { return getMediaTypePriority(type, accepts, index); }); return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { return provided[priorities.indexOf(priority)]; }); } function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } function getFullType(spec) { return spec.type + "/" + spec.subtype; } function isQuality(spec) { return spec.q > 0; } function quoteCount(string) { var count = 0; var index = 0; while ((index = string.indexOf('"', index)) !== -1) { count++; index++; } return count; } function splitKeyValuePair(str) { var index = str.indexOf("="); var key; var val; if (index === -1) { key = str; } else { key = str.substr(0, index); val = str.substr(index + 1); } return [key, val]; } function splitMediaTypes(accept) { var accepts = accept.split(","); for (var i2 = 1, j = 0; i2 < accepts.length; i2++) { if (quoteCount(accepts[j]) % 2 == 0) { accepts[++j] = accepts[i2]; } else { accepts[j] += "," + accepts[i2]; } } accepts.length = j + 1; return accepts; } function splitParameters(str) { var parameters = str.split(";"); for (var i2 = 1, j = 0; i2 < parameters.length; i2++) { if (quoteCount(parameters[j]) % 2 == 0) { parameters[++j] = parameters[i2]; } else { parameters[j] += ";" + parameters[i2]; } } parameters.length = j + 1; for (var i2 = 0; i2 < parameters.length; i2++) { parameters[i2] = parameters[i2].trim(); } return parameters; } } }); // ../node_modules/.pnpm/negotiator@0.6.3/node_modules/negotiator/index.js var require_negotiator = __commonJS({ "../node_modules/.pnpm/negotiator@0.6.3/node_modules/negotiator/index.js"(exports2, module2) { var preferredCharsets = require_charset(); var preferredEncodings = require_encoding(); var preferredLanguages = require_language(); var preferredMediaTypes = require_mediaType(); module2.exports = Negotiator; module2.exports.Negotiator = Negotiator; function Negotiator(request) { if (!(this instanceof Negotiator)) { return new Negotiator(request); } this.request = request; } Negotiator.prototype.charset = function charset(available) { var set = this.charsets(available); return set && set[0]; }; Negotiator.prototype.charsets = function charsets(available) { return preferredCharsets(this.request.headers["accept-charset"], available); }; Negotiator.prototype.encoding = function encoding(available) { var set = this.encodings(available); return set && set[0]; }; Negotiator.prototype.encodings = function encodings(available) { return preferredEncodings(this.request.headers["accept-encoding"], available); }; Negotiator.prototype.language = function language(available) { var set = this.languages(available); return set && set[0]; }; Negotiator.prototype.languages = function languages(available) { return preferredLanguages(this.request.headers["accept-language"], available); }; Negotiator.prototype.mediaType = function mediaType(available) { var set = this.mediaTypes(available); return set && set[0]; }; Negotiator.prototype.mediaTypes = function mediaTypes(available) { return preferredMediaTypes(this.request.headers.accept, available); }; Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; } }); // ../node_modules/.pnpm/accepts@1.3.8/node_modules/accepts/index.js var require_accepts = __commonJS({ "../node_modules/.pnpm/accepts@1.3.8/node_modules/accepts/index.js"(exports2, module2) { var Negotiator = require_negotiator(); var mime = require_mime_types(); module2.exports = Accepts; function Accepts(req) { if (!(this instanceof Accepts)) { return new Accepts(req); } this.headers = req.headers; this.negotiator = new Negotiator(req); } Accepts.prototype.type = Accepts.prototype.types = function(types_) { var types3 = types_; if (types3 && !Array.isArray(types3)) { types3 = new Array(arguments.length); for (var i2 = 0; i2 < types3.length; i2++) { types3[i2] = arguments[i2]; } } if (!types3 || types3.length === 0) { return this.negotiator.mediaTypes(); } if (!this.headers.accept) { return types3[0]; } var mimes = types3.map(extToMime); var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)); var first = accepts[0]; return first ? types3[mimes.indexOf(first)] : false; }; Accepts.prototype.encoding = Accepts.prototype.encodings = function(encodings_) { var encodings = encodings_; if (encodings && !Array.isArray(encodings)) { encodings = new Array(arguments.length); for (var i2 = 0; i2 < encodings.length; i2++) { encodings[i2] = arguments[i2]; } } if (!encodings || encodings.length === 0) { return this.negotiator.encodings(); } return this.negotiator.encodings(encodings)[0] || false; }; Accepts.prototype.charset = Accepts.prototype.charsets = function(charsets_) { var charsets = charsets_; if (charsets && !Array.isArray(charsets)) { charsets = new Array(arguments.length); for (var i2 = 0; i2 < charsets.length; i2++) { charsets[i2] = arguments[i2]; } } if (!charsets || charsets.length === 0) { return this.negotiator.charsets(); } return this.negotiator.charsets(charsets)[0] || false; }; Accepts.prototype.lang = Accepts.prototype.langs = Accepts.prototype.language = Accepts.prototype.languages = function(languages_) { var languages = languages_; if (languages && !Array.isArray(languages)) { languages = new Array(arguments.length); for (var i2 = 0; i2 < languages.length; i2++) { languages[i2] = arguments[i2]; } } if (!languages || languages.length === 0) { return this.negotiator.languages(); } return this.negotiator.languages(languages)[0] || false; }; function extToMime(type) { return type.indexOf("/") === -1 ? mime.lookup(type) : type; } function validMime(type) { return typeof type === "string"; } } }); // ../node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js var require_content_type = __commonJS({ "../node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js"(exports2) { var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g; var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/; var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g; var QUOTE_REGEXP = /([\\"])/g; var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; exports2.format = format; exports2.parse = parse; function format(obj) { if (!obj || typeof obj !== "object") { throw new TypeError("argument obj is required"); } var parameters = obj.parameters; var type = obj.type; if (!type || !TYPE_REGEXP.test(type)) { throw new TypeError("invalid type"); } var string = type; if (parameters && typeof parameters === "object") { var param; var params = Object.keys(parameters).sort(); for (var i2 = 0; i2 < params.length; i2++) { param = params[i2]; if (!TOKEN_REGEXP.test(param)) { throw new TypeError("invalid parameter name"); } string += "; " + param + "=" + qstring(parameters[param]); } } return string; } function parse(string) { if (!string) { throw new TypeError("argument string is required"); } var header = typeof string === "object" ? getcontenttype(string) : string; if (typeof header !== "string") { throw new TypeError("argument string is required to be a string"); } var index = header.indexOf(";"); var type = index !== -1 ? header.slice(0, index).trim() : header.trim(); if (!TYPE_REGEXP.test(type)) { throw new TypeError("invalid media type"); } var obj = new ContentType(type.toLowerCase()); if (index !== -1) { var key; var match; var value; PARAM_REGEXP.lastIndex = index; while (match = PARAM_REGEXP.exec(header)) { if (match.index !== index) { throw new TypeError("invalid parameter format"); } index += match[0].length; key = match[1].toLowerCase(); value = match[2]; if (value.charCodeAt(0) === 34) { value = value.slice(1, -1); if (value.indexOf("\\") !== -1) { value = value.replace(QESC_REGEXP, "$1"); } } obj.parameters[key] = value; } if (index !== header.length) { throw new TypeError("invalid parameter format"); } } return obj; } function getcontenttype(obj) { var header; if (typeof obj.getHeader === "function") { header = obj.getHeader("content-type"); } else if (typeof obj.headers === "object") { header = obj.headers && obj.headers["content-type"]; } if (typeof header !== "string") { throw new TypeError("content-type header is missing from object"); } return header; } function qstring(val) { var str = String(val); if (TOKEN_REGEXP.test(str)) { return str; } if (str.length > 0 && !TEXT_REGEXP.test(str)) { throw new TypeError("invalid parameter value"); } return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"'; } function ContentType(type) { this.parameters = /* @__PURE__ */ Object.create(null); this.type = type; } } }); // ../node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/index.js var require_parseurl = __commonJS({ "../node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/index.js"(exports2, module2) { var url = require("url"); var parse = url.parse; var Url = url.Url; module2.exports = parseurl; module2.exports.original = originalurl; function parseurl(req) { var url2 = req.url; if (url2 === void 0) { return void 0; } var parsed = req._parsedUrl; if (fresh(url2, parsed)) { return parsed; } parsed = fastparse(url2); parsed._raw = url2; return req._parsedUrl = parsed; } function originalurl(req) { var url2 = req.originalUrl; if (typeof url2 !== "string") { return parseurl(req); } var parsed = req._parsedOriginalUrl; if (fresh(url2, parsed)) { return parsed; } parsed = fastparse(url2); parsed._raw = url2; return req._parsedOriginalUrl = parsed; } function fastparse(str) { if (typeof str !== "string" || str.charCodeAt(0) !== 47) { return parse(str); } var pathname = str; var query = null; var search = null; for (var i2 = 1; i2 < str.length; i2++) { switch (str.charCodeAt(i2)) { case 63: if (search === null) { pathname = str.substring(0, i2); query = str.substring(i2 + 1); search = str.substring(i2); } break; case 9: /* \t */ case 10: /* \n */ case 12: /* \f */ case 13: /* \r */ case 32: /* */ case 35: /* # */ case 160: case 65279: return parse(str); } } var url2 = Url !== void 0 ? new Url() : {}; url2.path = str; url2.href = str; url2.pathname = pathname; if (search !== null) { url2.query = query; url2.search = search; } return url2; } function fresh(url2, parsedUrl) { return typeof parsedUrl === "object" && parsedUrl !== null && (Url === void 0 || parsedUrl instanceof Url) && parsedUrl._raw === url2; } } }); // ../node_modules/.pnpm/fresh@0.5.2/node_modules/fresh/index.js var require_fresh = __commonJS({ "../node_modules/.pnpm/fresh@0.5.2/node_modules/fresh/index.js"(exports2, module2) { var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/; module2.exports = fresh; function fresh(reqHeaders, resHeaders) { var modifiedSince = reqHeaders["if-modified-since"]; var noneMatch = reqHeaders["if-none-match"]; if (!modifiedSince && !noneMatch) { return false; } var cacheControl = reqHeaders["cache-control"]; if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) { return false; } if (noneMatch && noneMatch !== "*") { var etag = resHeaders["etag"]; if (!etag) { return false; } var etagStale = true; var matches = parseTokenList(noneMatch); for (var i2 = 0; i2 < matches.length; i2++) { var match = matches[i2]; if (match === etag || match === "W/" + etag || "W/" + match === etag) { etagStale = false; break; } } if (etagStale) { return false; } } if (modifiedSince) { var lastModified = resHeaders["last-modified"]; var modifiedStale = !lastModified || !(parseHttpDate(lastModified) <= parseHttpDate(modifiedSince)); if (modifiedStale) { return false; } } return true; } function parseHttpDate(date) { var timestamp = date && Date.parse(date); return typeof timestamp === "number" ? timestamp : NaN; } function parseTokenList(str) { var end = 0; var list = []; var start = 0; for (var i2 = 0, len = str.length; i2 < len; i2++) { switch (str.charCodeAt(i2)) { case 32: if (start === end) { start = end = i2 + 1; } break; case 44: list.push(str.substring(start, end)); start = end = i2 + 1; break; default: end = i2 + 1; break; } } list.push(str.substring(start, end)); return list; } } }); // ../node_modules/.pnpm/koa@2.15.4/node_modules/koa/lib/request.js var require_request = __commonJS({ "../node_modules/.pnpm/koa@2.15.4/node_modules/koa/lib/request.js"(exports2, module2) { var URL2 = require("url").URL; var net = require("net"); var accepts = require_accepts(); var contentType = require_content_type(); var stringify = require("url").format; var parse = require_parseurl(); var qs = require("querystring"); var typeis = require_type_is(); var fresh = require_fresh(); var only = require_only(); var util = require("util"); var IP = Symbol("context#ip"); module2.exports = { /** * Return request header. * * @return {Object} * @api public */ get header() { return this.req.headers; }, /** * Set request header. * * @api public */ set header(val) { this.req.headers = val; }, /** * Return request header, alias as request.header * * @return {Object} * @api public */ get headers() { return this.req.headers; }, /** * Set request header, alias as request.header * * @api public */ set headers(val) { this.req.headers = val; }, /** * Get request URL. * * @return {String} * @api public */ get url() { return this.req.url; }, /** * Set request URL. * * @api public */ set url(val) { this.req.url = val; }, /** * Get origin of URL. * * @return {String} * @api public */ get origin() { return `${this.protocol}://${this.host}`; }, /** * Get full request URL. * * @return {String} * @api public */ get href() { if (/^https?:\/\//i.test(this.originalUrl)) return this.originalUrl; return this.origin + this.originalUrl; }, /** * Get request method. * * @return {String} * @api public */ get method() { return this.req.method; }, /** * Set request method. * * @param {String} val * @api public */ set method(val) { this.req.method = val; }, /** * Get request pathname. * * @return {String} * @api public */ get path() { return parse(this.req).pathname; }, /** * Set pathname, retaining the query string when present. * * @param {String} path * @api public */ set path(path) { const url = parse(this.req); if (url.pathname === path) return; url.pathname = path; url.path = null; this.url = stringify(url); }, /** * Get parsed query string. * * @return {Object} * @api public */ get query() { const str = this.querystring; const c = this._querycache = this._querycache || {}; return c[str] || (c[str] = qs.parse(str)); }, /** * Set query string as an object. * * @param {Object} obj * @api public */ set query(obj) { this.querystring = qs.stringify(obj); }, /** * Get query string. * * @return {String} * @api public */ get querystring() { if (!this.req) return ""; return parse(this.req).query || ""; }, /** * Set query string. * * @param {String} str * @api public */ set querystring(str) { const url = parse(this.req); if (url.search === `?${str}`) return; url.search = str; url.path = null; this.url = stringify(url); }, /** * Get the search string. Same as the query string * except it includes the leading ?. * * @return {String} * @api public */ get search() { if (!this.querystring) return ""; return `?${this.querystring}`; }, /** * Set the search string. Same as * request.querystring= but included for ubiquity. * * @param {String} str * @api public */ set search(str) { this.querystring = str; }, /** * Parse the "Host" header field host * and support X-Forwarded-Host when a * proxy is enabled. * * @return {String} hostname:port * @api public */ get host() { const proxy = this.app.proxy; let host = proxy && this.get("X-Forwarded-Host"); if (!host) { if (this.req.httpVersionMajor >= 2) host = this.get(":authority"); if (!host) host = this.get("Host"); } if (!host) return ""; return splitCommaSeparatedValues(host, 1)[0]; }, /** * Parse the "Host" header field hostname * and support X-Forwarded-Host when a * proxy is enabled. * * @return {String} hostname * @api public */ get hostname() { const host = this.host; if (!host) return ""; if ("[" === host[0]) return this.URL.hostname || ""; return host.split(":", 1)[0]; }, /** * Get WHATWG parsed URL. * Lazily memoized. * * @return {URL|Object} * @api public */ get URL() { if (!this.memoizedURL) { const originalUrl = this.originalUrl || ""; try { this.memoizedURL = new URL2(`${this.origin}${originalUrl}`); } catch (err) { this.memoizedURL = /* @__PURE__ */ Object.create(null); } } return this.memoizedURL; }, /** * Check if the request is fresh, aka * Last-Modified and/or the ETag * still match. * * @return {Boolean} * @api public */ get fresh() { const method = this.method; const s2 = this.ctx.status; if ("GET" !== method && "HEAD" !== method) return false; if (s2 >= 200 && s2 < 300 || 304 === s2) { return fresh(this.header, this.response.header); } return false; }, /** * Check if the request is stale, aka * "Last-Modified" and / or the "ETag" for the * resource has changed. * * @return {Boolean} * @api public */ get stale() { return !this.fresh; }, /** * Check if the request is idempotent. * * @return {Boolean} * @api public */ get idempotent() { const methods = ["GET", "HEAD", "PUT", "DELETE", "OPTIONS", "TRACE"]; return !!~methods.indexOf(this.method); }, /** * Return the request socket. * * @return {Connection} * @api public */ get socket() { return this.req.socket; }, /** * Get the charset when present or undefined. * * @return {String} * @api public */ get charset() { try { const { parameters } = contentType.parse(this.req); return parameters.charset || ""; } catch (e2) { return ""; } }, /** * Return parsed Content-Length when present. * * @return {Number} * @api public */ get length() { const len = this.get("Content-Length"); if (len === "") return; return ~~len; }, /** * Return the protocol string "http" or "https" * when requested with TLS. When the proxy setting * is enabled the "X-Forwarded-Proto" header * field will be trusted. If you're running behind * a reverse proxy that supplies https for you this * may be enabled. * * @return {String} * @api public */ get protocol() { if (this.socket.encrypted) return "https"; if (!this.app.proxy) return "http"; const proto = this.get("X-Forwarded-Proto"); return proto ? splitCommaSeparatedValues(proto, 1)[0] : "http"; }, /** * Shorthand for: * * this.protocol == 'https' * * @return {Boolean} * @api public */ get secure() { return "https" === this.protocol; }, /** * When `app.proxy` is `true`, parse * the "X-Forwarded-For" ip address list. * * For example if the value was "client, proxy1, proxy2" * you would receive the array `["client", "proxy1", "proxy2"]` * where "proxy2" is the furthest down-stream. * * @return {Array} * @api public */ get ips() { const proxy = this.app.proxy; const val = this.get(this.app.proxyIpHeader); let ips = proxy && val ? splitCommaSeparatedValues(val) : []; if (this.app.maxIpsCount > 0) { ips = ips.slice(-this.app.maxIpsCount); } return ips; }, /** * Return request's remote address * When `app.proxy` is `true`, parse * the "X-Forwarded-For" ip address list and return the first one * * @return {String} * @api public */ get ip() { if (!this[IP]) { this[IP] = this.ips[0] || this.socket.remoteAddress || ""; } return this[IP]; }, set ip(_ip) { this[IP] = _ip; }, /** * Return subdomains as an array. * * Subdomains are the dot-separated parts of the host before the main domain * of the app. By default, the domain of the app is assumed to be the last two * parts of the host. This can be changed by setting `app.subdomainOffset`. * * For example, if the domain is "tobi.ferrets.example.com": * If `app.subdomainOffset` is not set, this.subdomains is * `["ferrets", "tobi"]`. * If `app.subdomainOffset` is 3, this.subdomains is `["tobi"]`. * * @return {Array} * @api public */ get subdomains() { const offset = this.app.subdomainOffset; const hostname = this.hostname; if (net.isIP(hostname)) return []; return hostname.split(".").reverse().slice(offset); }, /** * Get accept object. * Lazily memoized. * * @return {Object} * @api private */ get accept() { return this._accept || (this._accept = accepts(this.req)); }, /** * Set accept object. * * @param {Object} * @api private */ set accept(obj) { this._accept = obj; }, /** * Check if the given `type(s)` is acceptable, returning * the best match when true, otherwise `false`, in which * case you should respond with 406 "Not Acceptable". * * The `type` value may be a single mime type string * such as "application/json", the extension name * such as "json" or an array `["json", "html", "text/plain"]`. When a list * or array is given the _best_ match, if any is returned. * * Examples: * * // Accept: text/html * this.accepts('html'); * // => "html" * * // Accept: text/*, application/json * this.accepts('html'); * // => "html" * this.accepts('text/html'); * // => "text/html" * this.accepts('json', 'text'); * // => "json" * this.accepts('application/json'); * // => "application/json" * * // Accept: text/*, application/json * this.accepts('image/png'); * this.accepts('png'); * // => false * * // Accept: text/*;q=.5, application/json * this.accepts(['html', 'json']); * this.accepts('html', 'json'); * // => "json" * * @param {String|Array} type(s)... * @return {String|Array|false} * @api public */ accepts(...args2) { return this.accept.types(...args2); }, /** * Return accepted encodings or best fit based on `encodings`. * * Given `Accept-Encoding: gzip, deflate` * an array sorted by quality is returned: * * ['gzip', 'deflate'] * * @param {String|Array} encoding(s)... * @return {String|Array} * @api public */ acceptsEncodings(...args2) { return this.accept.encodings(...args2); }, /** * Return accepted charsets or best fit based on `charsets`. * * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` * an array sorted by quality is returned: * * ['utf-8', 'utf-7', 'iso-8859-1'] * * @param {String|Array} charset(s)... * @return {String|Array} * @api public */ acceptsCharsets(...args2) { return this.accept.charsets(...args2); }, /** * Return accepted languages or best fit based on `langs`. * * Given `Accept-Language: en;q=0.8, es, pt` * an array sorted by quality is returned: * * ['es', 'pt', 'en'] * * @param {String|Array} lang(s)... * @return {Array|String} * @api public */ acceptsLanguages(...args2) { return this.accept.languages(...args2); }, /** * Check if the incoming request contains the "Content-Type" * header field and if it contains any of the given mime `type`s. * If there is no request body, `null` is returned. * If there is no content type, `false` is returned. * Otherwise, it returns the first `type` that matches. * * Examples: * * // With Content-Type: text/html; charset=utf-8 * this.is('html'); // => 'html' * this.is('text/html'); // => 'text/html' * this.is('text/*', 'application/json'); // => 'text/html' * * // When Content-Type is application/json * this.is('json', 'urlencoded'); // => 'json' * this.is('application/json'); // => 'application/json' * this.is('html', 'application/*'); // => 'application/json' * * this.is('html'); // => false * * @param {String|String[]} [type] * @param {String[]} [types] * @return {String|false|null} * @api public */ is(type, ...types3) { return typeis(this.req, type, ...types3); }, /** * Return the request mime type void of * parameters such as "charset". * * @return {String} * @api public */ get type() { const type = this.get("Content-Type"); if (!type) return ""; return type.split(";")[0]; }, /** * Return request header. * * The `Referrer` header field is special-cased, * both `Referrer` and `Referer` are interchangeable. * * Examples: * * this.get('Content-Type'); * // => "text/plain" * * this.get('content-type'); * // => "text/plain" * * this.get('Something'); * // => '' * * @param {String} field * @return {String} * @api public */ get(field) { const req = this.req; switch (field = field.toLowerCase()) { case "referer": case "referrer": return req.headers.referrer || req.headers.referer || ""; default: return req.headers[field] || ""; } }, /** * Inspect implementation. * * @return {Object} * @api public */ inspect() { if (!this.req) return; return this.toJSON(); }, /** * Return JSON representation. * * @return {Object} * @api public */ toJSON() { return only(this, [ "method", "url", "header" ]); } }; if (util.inspect.custom) { module2.exports[util.inspect.custom] = module2.exports.inspect; } function splitCommaSeparatedValues(value, limit) { return value.split(",", limit).map((v) => v.trim()); } } }); // ../node_modules/.pnpm/co@4.6.0/node_modules/co/index.js var require_co = __commonJS({ "../node_modules/.pnpm/co@4.6.0/node_modules/co/index.js"(exports2, module2) { var slice = Array.prototype.slice; module2.exports = co["default"] = co.co = co; co.wrap = function(fn2) { createPromise.__generatorFunction__ = fn2; return createPromise; function createPromise() { return co.call(this, fn2.apply(this, arguments)); } }; function co(gen) { var ctx = this; var args2 = slice.call(arguments, 1); return new Promise(function(resolve, reject) { if (typeof gen === "function") gen = gen.apply(ctx, args2); if (!gen || typeof gen.next !== "function") return resolve(gen); onFulfilled(); function onFulfilled(res) { var ret; try { ret = gen.next(res); } catch (e2) { return reject(e2); } next(ret); } function onRejected(err) { var ret; try { ret = gen.throw(err); } catch (e2) { return reject(e2); } next(ret); } function next(ret) { if (ret.done) return resolve(ret.value); var value = toPromise.call(ctx, ret.value); if (value && isPromise(value)) return value.then(onFulfilled, onRejected); return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "' + String(ret.value) + '"')); } }); } function toPromise(obj) { if (!obj) return obj; if (isPromise(obj)) return obj; if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj); if ("function" == typeof obj) return thunkToPromise.call(this, obj); if (Array.isArray(obj)) return arrayToPromise.call(this, obj); if (isObject(obj)) return objectToPromise.call(this, obj); return obj; } function thunkToPromise(fn2) { var ctx = this; return new Promise(function(resolve, reject) { fn2.call(ctx, function(err, res) { if (err) return reject(err); if (arguments.length > 2) res = slice.call(arguments, 1); resolve(res); }); }); } function arrayToPromise(obj) { return Promise.all(obj.map(toPromise, this)); } function objectToPromise(obj) { var results = new obj.constructor(); var keys = Object.keys(obj); var promises = []; for (var i2 = 0; i2 < keys.length; i2++) { var key = keys[i2]; var promise = toPromise.call(this, obj[key]); if (promise && isPromise(promise)) defer(promise, key); else results[key] = obj[key]; } return Promise.all(promises).then(function() { return results; }); function defer(promise2, key2) { results[key2] = void 0; promises.push(promise2.then(function(res) { results[key2] = res; })); } } function isPromise(obj) { return "function" == typeof obj.then; } function isGenerator(obj) { return "function" == typeof obj.next && "function" == typeof obj.throw; } function isGeneratorFunction(obj) { var constructor = obj.constructor; if (!constructor) return false; if ("GeneratorFunction" === constructor.name || "GeneratorFunction" === constructor.displayName) return true; return isGenerator(constructor.prototype); } function isObject(val) { return Object == val.constructor; } } }); // ../node_modules/.pnpm/koa-convert@2.0.0/node_modules/koa-convert/index.js var require_koa_convert = __commonJS({ "../node_modules/.pnpm/koa-convert@2.0.0/node_modules/koa-convert/index.js"(exports2, module2) { var co = require_co(); var compose = require_koa_compose(); module2.exports = convert; function convert(mw) { if (typeof mw !== "function") { throw new TypeError("middleware must be a function"); } if (mw.constructor.name !== "GeneratorFunction" && mw.constructor.name !== "AsyncGeneratorFunction") { return mw; } const converted = function(ctx, next) { return co.call( ctx, mw.call( ctx, function* (next2) { return yield next2(); }(next) ) ); }; converted._name = mw._name || mw.name; return converted; } convert.compose = function(arr) { if (!Array.isArray(arr)) { arr = Array.from(arguments); } return compose(arr.map(convert)); }; convert.back = function(mw) { if (typeof mw !== "function") { throw new TypeError("middleware must be a function"); } if (mw.constructor.name === "GeneratorFunction" || mw.constructor.name === "AsyncGeneratorFunction") { return mw; } const converted = function* (next) { const ctx = this; let called = false; yield mw(ctx, function() { if (called) { throw new Error("next() called multiple times"); } called = true; return co.call(ctx, next); }); }; converted._name = mw._name || mw.name; return converted; }; } }); // ../node_modules/.pnpm/koa@2.15.4/node_modules/koa/lib/application.js var require_application = __commonJS({ "../node_modules/.pnpm/koa@2.15.4/node_modules/koa/lib/application.js"(exports2, module2) { var isGeneratorFunction = require_is_generator_function(); var debug = require_src()("koa:application"); var onFinished = require_on_finished(); var assert = require("assert"); var response = require_response(); var compose = require_koa_compose(); var context = require_context(); var request = require_request(); var statuses = require_statuses(); var Emitter = require("events"); var util = require("util"); var Stream3 = require("stream"); var http3 = require("http"); var only = require_only(); var convert = require_koa_convert(); var deprecate4 = require_depd2()("koa"); var { HttpError: HttpError2 } = require_http_errors(); module2.exports = class Application extends Emitter { /** * Initialize a new `Application`. * * @api public */ /** * * @param {object} [options] Application options * @param {string} [options.env='development'] Environment * @param {string[]} [options.keys] Signed cookie keys * @param {boolean} [options.proxy] Trust proxy headers * @param {number} [options.subdomainOffset] Subdomain offset * @param {string} [options.proxyIpHeader] Proxy IP header, defaults to X-Forwarded-For * @param {number} [options.maxIpsCount] Max IPs read from proxy IP header, default to 0 (means infinity) * */ constructor(options) { super(); options = options || {}; this.proxy = options.proxy || false; this.subdomainOffset = options.subdomainOffset || 2; this.proxyIpHeader = options.proxyIpHeader || "X-Forwarded-For"; this.maxIpsCount = options.maxIpsCount || 0; this.env = options.env || process.env.NODE_ENV || "development"; if (options.keys) this.keys = options.keys; this.middleware = []; this.context = Object.create(context); this.request = Object.create(request); this.response = Object.create(response); if (util.inspect.custom) { this[util.inspect.custom] = this.inspect; } if (options.asyncLocalStorage) { const { AsyncLocalStorage } = require("async_hooks"); assert(AsyncLocalStorage, "Requires node 12.17.0 or higher to enable asyncLocalStorage"); this.ctxStorage = new AsyncLocalStorage(); } } /** * Shorthand for: * * http.createServer(app.callback()).listen(...) * * @param {Mixed} ... * @return {Server} * @api public */ listen(...args2) { debug("listen"); const server = http3.createServer(this.callback()); return server.listen(...args2); } /** * Return JSON representation. * We only bother showing settings. * * @return {Object} * @api public */ toJSON() { return only(this, [ "subdomainOffset", "proxy", "env" ]); } /** * Inspect implementation. * * @return {Object} * @api public */ inspect() { return this.toJSON(); } /** * Use the given middleware `fn`. * * Old-style middleware will be converted. * * @param {Function} fn * @return {Application} self * @api public */ use(fn2) { if (typeof fn2 !== "function") throw new TypeError("middleware must be a function!"); if (isGeneratorFunction(fn2)) { deprecate4("Support for generators will be removed in v3. See the documentation for examples of how to convert old middleware https://github.com/koajs/koa/blob/master/docs/migration.md"); fn2 = convert(fn2); } debug("use %s", fn2._name || fn2.name || "-"); this.middleware.push(fn2); return this; } /** * Return a request handler callback * for node's native http server. * * @return {Function} * @api public */ callback() { const fn2 = compose(this.middleware); if (!this.listenerCount("error")) this.on("error", this.onerror); const handleRequest = (req, res) => { const ctx = this.createContext(req, res); if (!this.ctxStorage) { return this.handleRequest(ctx, fn2); } return this.ctxStorage.run(ctx, async () => { return await this.handleRequest(ctx, fn2); }); }; return handleRequest; } /** * return currnect contenxt from async local storage */ get currentContext() { if (this.ctxStorage) return this.ctxStorage.getStore(); } /** * Handle request in callback. * * @api private */ handleRequest(ctx, fnMiddleware) { const res = ctx.res; res.statusCode = 404; const onerror = (err) => ctx.onerror(err); const handleResponse = () => respond(ctx); onFinished(res, onerror); return fnMiddleware(ctx).then(handleResponse).catch(onerror); } /** * Initialize a new context. * * @api private */ createContext(req, res) { const context2 = Object.create(this.context); const request2 = context2.request = Object.create(this.request); const response2 = context2.response = Object.create(this.response); context2.app = request2.app = response2.app = this; context2.req = request2.req = response2.req = req; context2.res = request2.res = response2.res = res; request2.ctx = response2.ctx = context2; request2.response = response2; response2.request = request2; context2.originalUrl = request2.originalUrl = req.url; context2.state = {}; return context2; } /** * Default error handler. * * @param {Error} err * @api private */ onerror(err) { const isNativeError = Object.prototype.toString.call(err) === "[object Error]" || err instanceof Error; if (!isNativeError) throw new TypeError(util.format("non-error thrown: %j", err)); if (404 === err.status || err.expose) return; if (this.silent) return; const msg = err.stack || err.toString(); console.error(` ${msg.replace(/^/gm, " ")} `); } /** * Help TS users comply to CommonJS, ESM, bundler mismatch. * @see https://github.com/koajs/koa/issues/1513 */ static get default() { return Application; } createAsyncCtxStorageMiddleware() { const app = this; return async function asyncCtxStorage(ctx, next) { await app.ctxStorage.run(ctx, async () => { return await next(); }); }; } }; function respond(ctx) { if (false === ctx.respond) return; if (!ctx.writable) return; const res = ctx.res; let body = ctx.body; const code = ctx.status; if (statuses.empty[code]) { ctx.body = null; return res.end(); } if ("HEAD" === ctx.method) { if (!res.headersSent && !ctx.response.has("Content-Length")) { const { length } = ctx.response; if (Number.isInteger(length)) ctx.length = length; } return res.end(); } if (null == body) { if (ctx.response._explicitNullBody) { ctx.response.remove("Content-Type"); ctx.response.remove("Transfer-Encoding"); return res.end(); } if (ctx.req.httpVersionMajor >= 2) { body = String(code); } else { body = ctx.message || String(code); } if (!res.headersSent) { ctx.type = "text"; ctx.length = Buffer.byteLength(body); } return res.end(body); } if (Buffer.isBuffer(body)) return res.end(body); if ("string" === typeof body) return res.end(body); if (body instanceof Stream3) return body.pipe(res); body = JSON.stringify(body); if (!res.headersSent) { ctx.length = Buffer.byteLength(body); } res.end(body); } module2.exports.HttpError = HttpError2; } }); // ../node_modules/.pnpm/statuses@2.0.1/node_modules/statuses/codes.json var require_codes2 = __commonJS({ "../node_modules/.pnpm/statuses@2.0.1/node_modules/statuses/codes.json"(exports2, module2) { module2.exports = { "100": "Continue", "101": "Switching Protocols", "102": "Processing", "103": "Early Hints", "200": "OK", "201": "Created", "202": "Accepted", "203": "Non-Authoritative Information", "204": "No Content", "205": "Reset Content", "206": "Partial Content", "207": "Multi-Status", "208": "Already Reported", "226": "IM Used", "300": "Multiple Choices", "301": "Moved Permanently", "302": "Found", "303": "See Other", "304": "Not Modified", "305": "Use Proxy", "307": "Temporary Redirect", "308": "Permanent Redirect", "400": "Bad Request", "401": "Unauthorized", "402": "Payment Required", "403": "Forbidden", "404": "Not Found", "405": "Method Not Allowed", "406": "Not Acceptable", "407": "Proxy Authentication Required", "408": "Request Timeout", "409": "Conflict", "410": "Gone", "411": "Length Required", "412": "Precondition Failed", "413": "Payload Too Large", "414": "URI Too Long", "415": "Unsupported Media Type", "416": "Range Not Satisfiable", "417": "Expectation Failed", "418": "I'm a Teapot", "421": "Misdirected Request", "422": "Unprocessable Entity", "423": "Locked", "424": "Failed Dependency", "425": "Too Early", "426": "Upgrade Required", "428": "Precondition Required", "429": "Too Many Requests", "431": "Request Header Fields Too Large", "451": "Unavailable For Legal Reasons", "500": "Internal Server Error", "501": "Not Implemented", "502": "Bad Gateway", "503": "Service Unavailable", "504": "Gateway Timeout", "505": "HTTP Version Not Supported", "506": "Variant Also Negotiates", "507": "Insufficient Storage", "508": "Loop Detected", "509": "Bandwidth Limit Exceeded", "510": "Not Extended", "511": "Network Authentication Required" }; } }); // ../node_modules/.pnpm/statuses@2.0.1/node_modules/statuses/index.js var require_statuses2 = __commonJS({ "../node_modules/.pnpm/statuses@2.0.1/node_modules/statuses/index.js"(exports2, module2) { var codes = require_codes2(); module2.exports = status; status.message = codes; status.code = createMessageToStatusCodeMap(codes); status.codes = createStatusCodeList(codes); status.redirect = { 300: true, 301: true, 302: true, 303: true, 305: true, 307: true, 308: true }; status.empty = { 204: true, 205: true, 304: true }; status.retry = { 502: true, 503: true, 504: true }; function createMessageToStatusCodeMap(codes2) { var map = {}; Object.keys(codes2).forEach(function forEachCode(code) { var message2 = codes2[code]; var status2 = Number(code); map[message2.toLowerCase()] = status2; }); return map; } function createStatusCodeList(codes2) { return Object.keys(codes2).map(function mapCode(code) { return Number(code); }); } function getStatusCode(message2) { var msg = message2.toLowerCase(); if (!Object.prototype.hasOwnProperty.call(status.code, msg)) { throw new Error('invalid status message: "' + message2 + '"'); } return status.code[msg]; } function getStatusMessage(code) { if (!Object.prototype.hasOwnProperty.call(status.message, code)) { throw new Error("invalid status code: " + code); } return status.message[code]; } function status(code) { if (typeof code === "number") { return getStatusMessage(code); } if (typeof code !== "string") { throw new TypeError("code must be a number or string"); } var n = parseInt(code, 10); if (!isNaN(n)) { return getStatusMessage(n); } return getStatusCode(code); } } }); // ../node_modules/.pnpm/http-errors@2.0.0/node_modules/http-errors/index.js var require_http_errors2 = __commonJS({ "../node_modules/.pnpm/http-errors@2.0.0/node_modules/http-errors/index.js"(exports2, module2) { var deprecate4 = require_depd2()("http-errors"); var setPrototypeOf = require_setprototypeof(); var statuses = require_statuses2(); var inherits = require_inherits(); var toIdentifier = require_toidentifier(); module2.exports = createError; module2.exports.HttpError = createHttpErrorConstructor(); module2.exports.isHttpError = createIsHttpErrorFunction(module2.exports.HttpError); populateConstructorExports(module2.exports, statuses.codes, module2.exports.HttpError); function codeClass(status) { return Number(String(status).charAt(0) + "00"); } function createError() { var err; var msg; var status = 500; var props = {}; for (var i2 = 0; i2 < arguments.length; i2++) { var arg = arguments[i2]; var type = typeof arg; if (type === "object" && arg instanceof Error) { err = arg; status = err.status || err.statusCode || status; } else if (type === "number" && i2 === 0) { status = arg; } else if (type === "string") { msg = arg; } else if (type === "object") { props = arg; } else { throw new TypeError("argument #" + (i2 + 1) + " unsupported type " + type); } } if (typeof status === "number" && (status < 400 || status >= 600)) { deprecate4("non-error status code; use only 4xx or 5xx status codes"); } if (typeof status !== "number" || !statuses.message[status] && (status < 400 || status >= 600)) { status = 500; } var HttpError2 = createError[status] || createError[codeClass(status)]; if (!err) { err = HttpError2 ? new HttpError2(msg) : new Error(msg || statuses.message[status]); Error.captureStackTrace(err, createError); } if (!HttpError2 || !(err instanceof HttpError2) || err.status !== status) { err.expose = status < 500; err.status = err.statusCode = status; } for (var key in props) { if (key !== "status" && key !== "statusCode") { err[key] = props[key]; } } return err; } function createHttpErrorConstructor() { function HttpError2() { throw new TypeError("cannot construct abstract class"); } inherits(HttpError2, Error); return HttpError2; } function createClientErrorConstructor(HttpError2, name, code) { var className = toClassName(name); function ClientError(message2) { var msg = message2 != null ? message2 : statuses.message[code]; var err = new Error(msg); Error.captureStackTrace(err, ClientError); setPrototypeOf(err, ClientError.prototype); Object.defineProperty(err, "message", { enumerable: true, configurable: true, value: msg, writable: true }); Object.defineProperty(err, "name", { enumerable: false, configurable: true, value: className, writable: true }); return err; } inherits(ClientError, HttpError2); nameFunc(ClientError, className); ClientError.prototype.status = code; ClientError.prototype.statusCode = code; ClientError.prototype.expose = true; return ClientError; } function createIsHttpErrorFunction(HttpError2) { return function isHttpError(val) { if (!val || typeof val !== "object") { return false; } if (val instanceof HttpError2) { return true; } return val instanceof Error && typeof val.expose === "boolean" && typeof val.statusCode === "number" && val.status === val.statusCode; }; } function createServerErrorConstructor(HttpError2, name, code) { var className = toClassName(name); function ServerError(message2) { var msg = message2 != null ? message2 : statuses.message[code]; var err = new Error(msg); Error.captureStackTrace(err, ServerError); setPrototypeOf(err, ServerError.prototype); Object.defineProperty(err, "message", { enumerable: true, configurable: true, value: msg, writable: true }); Object.defineProperty(err, "name", { enumerable: false, configurable: true, value: className, writable: true }); return err; } inherits(ServerError, HttpError2); nameFunc(ServerError, className); ServerError.prototype.status = code; ServerError.prototype.statusCode = code; ServerError.prototype.expose = false; return ServerError; } function nameFunc(func, name) { var desc = Object.getOwnPropertyDescriptor(func, "name"); if (desc && desc.configurable) { desc.value = name; Object.defineProperty(func, "name", desc); } } function populateConstructorExports(exports3, codes, HttpError2) { codes.forEach(function forEachCode(code) { var CodeError; var name = toIdentifier(statuses.message[code]); switch (codeClass(code)) { case 400: CodeError = createClientErrorConstructor(HttpError2, name, code); break; case 500: CodeError = createServerErrorConstructor(HttpError2, name, code); break; } if (CodeError) { exports3[code] = CodeError; exports3[name] = CodeError; } }); } function toClassName(name) { return name.substr(-5) !== "Error" ? name + "Error" : name; } } }); // ../node_modules/.pnpm/path-to-regexp@6.3.0/node_modules/path-to-regexp/dist/index.js var require_dist = __commonJS({ "../node_modules/.pnpm/path-to-regexp@6.3.0/node_modules/path-to-regexp/dist/index.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.pathToRegexp = exports2.tokensToRegexp = exports2.regexpToFunction = exports2.match = exports2.tokensToFunction = exports2.compile = exports2.parse = void 0; function lexer(str) { var tokens = []; var i2 = 0; while (i2 < str.length) { var char = str[i2]; if (char === "*" || char === "+" || char === "?") { tokens.push({ type: "MODIFIER", index: i2, value: str[i2++] }); continue; } if (char === "\\") { tokens.push({ type: "ESCAPED_CHAR", index: i2++, value: str[i2++] }); continue; } if (char === "{") { tokens.push({ type: "OPEN", index: i2, value: str[i2++] }); continue; } if (char === "}") { tokens.push({ type: "CLOSE", index: i2, value: str[i2++] }); continue; } if (char === ":") { var name = ""; var j = i2 + 1; while (j < str.length) { var code = str.charCodeAt(j); if ( // `0-9` code >= 48 && code <= 57 || // `A-Z` code >= 65 && code <= 90 || // `a-z` code >= 97 && code <= 122 || // `_` code === 95 ) { name += str[j++]; continue; } break; } if (!name) throw new TypeError("Missing parameter name at ".concat(i2)); tokens.push({ type: "NAME", index: i2, value: name }); i2 = j; continue; } if (char === "(") { var count = 1; var pattern = ""; var j = i2 + 1; if (str[j] === "?") { throw new TypeError('Pattern cannot start with "?" at '.concat(j)); } while (j < str.length) { if (str[j] === "\\") { pattern += str[j++] + str[j++]; continue; } if (str[j] === ")") { count--; if (count === 0) { j++; break; } } else if (str[j] === "(") { count++; if (str[j + 1] !== "?") { throw new TypeError("Capturing groups are not allowed at ".concat(j)); } } pattern += str[j++]; } if (count) throw new TypeError("Unbalanced pattern at ".concat(i2)); if (!pattern) throw new TypeError("Missing pattern at ".concat(i2)); tokens.push({ type: "PATTERN", index: i2, value: pattern }); i2 = j; continue; } tokens.push({ type: "CHAR", index: i2, value: str[i2++] }); } tokens.push({ type: "END", index: i2, value: "" }); return tokens; } function parse(str, options) { if (options === void 0) { options = {}; } var tokens = lexer(str); var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a, _b = options.delimiter, delimiter = _b === void 0 ? "/#?" : _b; var result = []; var key = 0; var i2 = 0; var path = ""; var tryConsume = function(type) { if (i2 < tokens.length && tokens[i2].type === type) return tokens[i2++].value; }; var mustConsume = function(type) { var value2 = tryConsume(type); if (value2 !== void 0) return value2; var _a2 = tokens[i2], nextType = _a2.type, index = _a2.index; throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type)); }; var consumeText = function() { var result2 = ""; var value2; while (value2 = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR")) { result2 += value2; } return result2; }; var isSafe = function(value2) { for (var _i = 0, delimiter_1 = delimiter; _i < delimiter_1.length; _i++) { var char2 = delimiter_1[_i]; if (value2.indexOf(char2) > -1) return true; } return false; }; var safePattern = function(prefix2) { var prev = result[result.length - 1]; var prevText = prefix2 || (prev && typeof prev === "string" ? prev : ""); if (prev && !prevText) { throw new TypeError('Must have text between two parameters, missing text after "'.concat(prev.name, '"')); } if (!prevText || isSafe(prevText)) return "[^".concat(escapeString(delimiter), "]+?"); return "(?:(?!".concat(escapeString(prevText), ")[^").concat(escapeString(delimiter), "])+?"); }; while (i2 < tokens.length) { var char = tryConsume("CHAR"); var name = tryConsume("NAME"); var pattern = tryConsume("PATTERN"); if (name || pattern) { var prefix = char || ""; if (prefixes.indexOf(prefix) === -1) { path += prefix; prefix = ""; } if (path) { result.push(path); path = ""; } result.push({ name: name || key++, prefix, suffix: "", pattern: pattern || safePattern(prefix), modifier: tryConsume("MODIFIER") || "" }); continue; } var value = char || tryConsume("ESCAPED_CHAR"); if (value) { path += value; continue; } if (path) { result.push(path); path = ""; } var open = tryConsume("OPEN"); if (open) { var prefix = consumeText(); var name_1 = tryConsume("NAME") || ""; var pattern_1 = tryConsume("PATTERN") || ""; var suffix = consumeText(); mustConsume("CLOSE"); result.push({ name: name_1 || (pattern_1 ? key++ : ""), pattern: name_1 && !pattern_1 ? safePattern(prefix) : pattern_1, prefix, suffix, modifier: tryConsume("MODIFIER") || "" }); continue; } mustConsume("END"); } return result; } exports2.parse = parse; function compile(str, options) { return tokensToFunction(parse(str, options), options); } exports2.compile = compile; function tokensToFunction(tokens, options) { if (options === void 0) { options = {}; } var reFlags = flags(options); var _a = options.encode, encode = _a === void 0 ? function(x2) { return x2; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b; var matches = tokens.map(function(token) { if (typeof token === "object") { return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags); } }); return function(data) { var path = ""; for (var i2 = 0; i2 < tokens.length; i2++) { var token = tokens[i2]; if (typeof token === "string") { path += token; continue; } var value = data ? data[token.name] : void 0; var optional = token.modifier === "?" || token.modifier === "*"; var repeat = token.modifier === "*" || token.modifier === "+"; if (Array.isArray(value)) { if (!repeat) { throw new TypeError('Expected "'.concat(token.name, '" to not repeat, but got an array')); } if (value.length === 0) { if (optional) continue; throw new TypeError('Expected "'.concat(token.name, '" to not be empty')); } for (var j = 0; j < value.length; j++) { var segment = encode(value[j], token); if (validate && !matches[i2].test(segment)) { throw new TypeError('Expected all "'.concat(token.name, '" to match "').concat(token.pattern, '", but got "').concat(segment, '"')); } path += token.prefix + segment + token.suffix; } continue; } if (typeof value === "string" || typeof value === "number") { var segment = encode(String(value), token); if (validate && !matches[i2].test(segment)) { throw new TypeError('Expected "'.concat(token.name, '" to match "').concat(token.pattern, '", but got "').concat(segment, '"')); } path += token.prefix + segment + token.suffix; continue; } if (optional) continue; var typeOfMessage = repeat ? "an array" : "a string"; throw new TypeError('Expected "'.concat(token.name, '" to be ').concat(typeOfMessage)); } return path; }; } exports2.tokensToFunction = tokensToFunction; function match(str, options) { var keys = []; var re = pathToRegexp(str, keys, options); return regexpToFunction(re, keys, options); } exports2.match = match; function regexpToFunction(re, keys, options) { if (options === void 0) { options = {}; } var _a = options.decode, decode = _a === void 0 ? function(x2) { return x2; } : _a; return function(pathname) { var m2 = re.exec(pathname); if (!m2) return false; var path = m2[0], index = m2.index; var params = /* @__PURE__ */ Object.create(null); var _loop_1 = function(i3) { if (m2[i3] === void 0) return "continue"; var key = keys[i3 - 1]; if (key.modifier === "*" || key.modifier === "+") { params[key.name] = m2[i3].split(key.prefix + key.suffix).map(function(value) { return decode(value, key); }); } else { params[key.name] = decode(m2[i3], key); } }; for (var i2 = 1; i2 < m2.length; i2++) { _loop_1(i2); } return { path, index, params }; }; } exports2.regexpToFunction = regexpToFunction; function escapeString(str) { return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); } function flags(options) { return options && options.sensitive ? "" : "i"; } function regexpToRegexp(path, keys) { if (!keys) return path; var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g; var index = 0; var execResult = groupsRegex.exec(path.source); while (execResult) { keys.push({ // Use parenthesized substring match if available, index otherwise name: execResult[1] || index++, prefix: "", suffix: "", modifier: "", pattern: "" }); execResult = groupsRegex.exec(path.source); } return path; } function arrayToRegexp(paths, keys, options) { var parts = paths.map(function(path) { return pathToRegexp(path, keys, options).source; }); return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options)); } function stringToRegexp(path, keys, options) { return tokensToRegexp(parse(path, options), keys, options); } function tokensToRegexp(tokens, keys, options) { if (options === void 0) { options = {}; } var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function(x2) { return x2; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f; var endsWithRe = "[".concat(escapeString(endsWith), "]|$"); var delimiterRe = "[".concat(escapeString(delimiter), "]"); var route = start ? "^" : ""; for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { var token = tokens_1[_i]; if (typeof token === "string") { route += escapeString(encode(token)); } else { var prefix = escapeString(encode(token.prefix)); var suffix = escapeString(encode(token.suffix)); if (token.pattern) { if (keys) keys.push(token); if (prefix || suffix) { if (token.modifier === "+" || token.modifier === "*") { var mod2 = token.modifier === "*" ? "?" : ""; route += "(?:".concat(prefix, "((?:").concat(token.pattern, ")(?:").concat(suffix).concat(prefix, "(?:").concat(token.pattern, "))*)").concat(suffix, ")").concat(mod2); } else { route += "(?:".concat(prefix, "(").concat(token.pattern, ")").concat(suffix, ")").concat(token.modifier); } } else { if (token.modifier === "+" || token.modifier === "*") { throw new TypeError('Can not repeat "'.concat(token.name, '" without a prefix and suffix')); } route += "(".concat(token.pattern, ")").concat(token.modifier); } } else { route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier); } } } if (end) { if (!strict) route += "".concat(delimiterRe, "?"); route += !options.endsWith ? "$" : "(?=".concat(endsWithRe, ")"); } else { var endToken = tokens[tokens.length - 1]; var isEndDelimited = typeof endToken === "string" ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1 : endToken === void 0; if (!strict) { route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?"); } if (!isEndDelimited) { route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")"); } } return new RegExp(route, flags(options)); } exports2.tokensToRegexp = tokensToRegexp; function pathToRegexp(path, keys, options) { if (path instanceof RegExp) return regexpToRegexp(path, keys); if (Array.isArray(path)) return arrayToRegexp(path, keys, options); return stringToRegexp(path, keys, options); } exports2.pathToRegexp = pathToRegexp; } }); // ../node_modules/.pnpm/@koa+router@13.1.0/node_modules/@koa/router/lib/layer.js var require_layer = __commonJS({ "../node_modules/.pnpm/@koa+router@13.1.0/node_modules/@koa/router/lib/layer.js"(exports2, module2) { var { parse: parseUrl, format: formatUrl2 } = require("node:url"); var { pathToRegexp, compile, parse } = require_dist(); module2.exports = class Layer { /** * Initialize a new routing Layer with given `method`, `path`, and `middleware`. * * @param {String|RegExp} path Path string or regular expression. * @param {Array} methods Array of HTTP verbs. * @param {Array} middleware Layer callback/middleware or series of. * @param {Object=} opts * @param {String=} opts.name route name * @param {String=} opts.sensitive case sensitive (default: false) * @param {String=} opts.strict require the trailing slash (default: false) * @returns {Layer} * @private */ constructor(path, methods, middleware, opts = {}) { this.opts = opts; this.name = this.opts.name || null; this.methods = []; this.paramNames = []; this.stack = Array.isArray(middleware) ? middleware : [middleware]; for (const method of methods) { const l = this.methods.push(method.toUpperCase()); if (this.methods[l - 1] === "GET") this.methods.unshift("HEAD"); } for (let i2 = 0; i2 < this.stack.length; i2++) { const fn2 = this.stack[i2]; const type = typeof fn2; if (type !== "function") throw new Error( `${methods.toString()} \`${this.opts.name || path}\`: \`middleware\` must be a function, not \`${type}\`` ); } this.path = path; this.regexp = pathToRegexp(path, this.paramNames, this.opts); } /** * Returns whether request `path` matches route. * * @param {String} path * @returns {Boolean} * @private */ match(path) { return this.regexp.test(path); } /** * Returns map of URL parameters for given `path` and `paramNames`. * * @param {String} path * @param {Array.} captures * @param {Object=} params * @returns {Object} * @private */ params(path, captures, params = {}) { for (let len = captures.length, i2 = 0; i2 < len; i2++) { if (this.paramNames[i2]) { const c = captures[i2]; if (c && c.length > 0) params[this.paramNames[i2].name] = c ? safeDecodeURIComponent(c) : c; } } return params; } /** * Returns array of regexp url path captures. * * @param {String} path * @returns {Array.} * @private */ captures(path) { return this.opts.ignoreCaptures ? [] : path.match(this.regexp).slice(1); } /** * Generate URL for route using given `params`. * * @example * * ```javascript * const route = new Layer('/users/:id', ['GET'], fn); * * route.url({ id: 123 }); // => "/users/123" * ``` * * @param {Object} params url parameters * @returns {String} * @private */ url(params, options) { let args2 = params; const url = this.path.replace(/\(\.\*\)/g, ""); if (typeof params !== "object") { args2 = Array.prototype.slice.call(arguments); if (typeof args2[args2.length - 1] === "object") { options = args2[args2.length - 1]; args2 = args2.slice(0, -1); } } const toPath = compile(url, { encode: encodeURIComponent, ...options }); let replaced; const tokens = parse(url); let replace = {}; if (Array.isArray(args2)) { for (let len = tokens.length, i2 = 0, j = 0; i2 < len; i2++) { if (tokens[i2].name) replace[tokens[i2].name] = args2[j++]; } } else if (tokens.some((token) => token.name)) { replace = params; } else if (!options) { options = params; } replaced = toPath(replace); if (options && options.query) { replaced = parseUrl(replaced); if (typeof options.query === "string") { replaced.search = options.query; } else { replaced.search = void 0; replaced.query = options.query; } return formatUrl2(replaced); } return replaced; } /** * Run validations on route named parameters. * * @example * * ```javascript * router * .param('user', function (id, ctx, next) { * ctx.user = users[id]; * if (!ctx.user) return ctx.status = 404; * next(); * }) * .get('/users/:user', function (ctx, next) { * ctx.body = ctx.user; * }); * ``` * * @param {String} param * @param {Function} middleware * @returns {Layer} * @private */ param(param, fn2) { const { stack: stack2 } = this; const params = this.paramNames; const middleware = function(ctx, next) { return fn2.call(this, ctx.params[param], ctx, next); }; middleware.param = param; const names = params.map(function(p) { return p.name; }); const x2 = names.indexOf(param); if (x2 > -1) { stack2.some((fn3, i2) => { if (!fn3.param || names.indexOf(fn3.param) > x2) { stack2.splice(i2, 0, middleware); return true; } }); } return this; } /** * Prefix route path. * * @param {String} prefix * @returns {Layer} * @private */ setPrefix(prefix) { if (this.path) { this.path = this.path !== "/" || this.opts.strict === true ? `${prefix}${this.path}` : prefix; this.paramNames = []; this.regexp = pathToRegexp(this.path, this.paramNames, this.opts); } return this; } }; function safeDecodeURIComponent(text) { try { return decodeURIComponent(text.replace(/\+/g, " ")); } catch { return text; } } } }); // ../node_modules/.pnpm/@koa+router@13.1.0/node_modules/@koa/router/lib/router.js var require_router = __commonJS({ "../node_modules/.pnpm/@koa+router@13.1.0/node_modules/@koa/router/lib/router.js"(exports2, module2) { var http3 = require("node:http"); var util = require("node:util"); var debug = util.debuglog("koa-router"); var compose = require_koa_compose(); var HttpError2 = require_http_errors2(); var { pathToRegexp } = require_dist(); var Layer = require_layer(); var methods = http3.METHODS.map((method) => method.toLowerCase()); var Router2 = class _Router { /** * Create a new router. * * @example * * Basic usage: * * ```javascript * const Koa = require('koa'); * const Router = require('@koa/router'); * * const app = new Koa(); * const router = new Router(); * * router.get('/', (ctx, next) => { * // ctx.router available * }); * * app * .use(router.routes()) * .use(router.allowedMethods()); * ``` * * @alias module:koa-router * @param {Object=} opts * @param {Boolean=false} opts.exclusive only run last matched route's controller when there are multiple matches * @param {String=} opts.prefix prefix router paths * @param {String|RegExp=} opts.host host for router match * @constructor */ constructor(opts = {}) { if (!(this instanceof _Router)) return new _Router(opts); this.opts = opts; this.methods = this.opts.methods || [ "HEAD", "OPTIONS", "GET", "PUT", "PATCH", "POST", "DELETE" ]; this.exclusive = Boolean(this.opts.exclusive); this.params = {}; this.stack = []; this.host = this.opts.host; } /** * Generate URL from url pattern and given `params`. * * @example * * ```javascript * const url = Router.url('/users/:id', {id: 1}); * // => "/users/1" * ``` * * @param {String} path url pattern * @param {Object} params url parameters * @returns {String} */ static url(path, ...args2) { return Layer.prototype.url.apply({ path }, args2); } /** * Use given middleware. * * Middleware run in the order they are defined by `.use()`. They are invoked * sequentially, requests start at the first middleware and work their way * "down" the middleware stack. * * @example * * ```javascript * // session middleware will run before authorize * router * .use(session()) * .use(authorize()); * * // use middleware only with given path * router.use('/users', userAuth()); * * // or with an array of paths * router.use(['/users', '/admin'], userAuth()); * * app.use(router.routes()); * ``` * * @param {String=} path * @param {Function} middleware * @param {Function=} ... * @returns {Router} */ use(...middleware) { const router = this; let path; if (Array.isArray(middleware[0]) && typeof middleware[0][0] === "string") { const arrPaths = middleware[0]; for (const p of arrPaths) { router.use.apply(router, [p, ...middleware.slice(1)]); } return this; } const hasPath = typeof middleware[0] === "string"; if (hasPath) path = middleware.shift(); for (const m2 of middleware) { if (m2.router) { const cloneRouter = Object.assign( Object.create(_Router.prototype), m2.router, { stack: [...m2.router.stack] } ); for (let j = 0; j < cloneRouter.stack.length; j++) { const nestedLayer = cloneRouter.stack[j]; const cloneLayer = Object.assign( Object.create(Layer.prototype), nestedLayer ); if (path) cloneLayer.setPrefix(path); if (router.opts.prefix) cloneLayer.setPrefix(router.opts.prefix); router.stack.push(cloneLayer); cloneRouter.stack[j] = cloneLayer; } if (router.params) { const routerParams = Object.keys(router.params); for (const key of routerParams) { cloneRouter.param(key, router.params[key]); } } } else { const keys = []; pathToRegexp(router.opts.prefix || "", keys); const routerPrefixHasParam = Boolean( router.opts.prefix && keys.length > 0 ); router.register(path || "([^/]*)", [], m2, { end: false, ignoreCaptures: !hasPath && !routerPrefixHasParam }); } } return this; } /** * Set the path prefix for a Router instance that was already initialized. * * @example * * ```javascript * router.prefix('/things/:thing_id') * ``` * * @param {String} prefix * @returns {Router} */ prefix(prefix) { prefix = prefix.replace(/\/$/, ""); this.opts.prefix = prefix; for (let i2 = 0; i2 < this.stack.length; i2++) { const route = this.stack[i2]; route.setPrefix(prefix); } return this; } /** * Returns router middleware which dispatches a route matching the request. * * @returns {Function} */ middleware() { const router = this; const dispatch = (ctx, next) => { debug("%s %s", ctx.method, ctx.path); const hostMatched = router.matchHost(ctx.host); if (!hostMatched) { return next(); } const path = router.opts.routerPath || ctx.newRouterPath || ctx.path || ctx.routerPath; const matched = router.match(path, ctx.method); if (ctx.matched) { ctx.matched.push.apply(ctx.matched, matched.path); } else { ctx.matched = matched.path; } ctx.router = router; if (!matched.route) return next(); const matchedLayers = matched.pathAndMethod; const mostSpecificLayer = matchedLayers[matchedLayers.length - 1]; ctx._matchedRoute = mostSpecificLayer.path; if (mostSpecificLayer.name) { ctx._matchedRouteName = mostSpecificLayer.name; } const layerChain = (router.exclusive ? [mostSpecificLayer] : matchedLayers).reduce((memo, layer) => { memo.push((ctx2, next2) => { ctx2.captures = layer.captures(path, ctx2.captures); ctx2.request.params = layer.params(path, ctx2.captures, ctx2.params); ctx2.params = ctx2.request.params; ctx2.routerPath = layer.path; ctx2.routerName = layer.name; ctx2._matchedRoute = layer.path; if (layer.name) { ctx2._matchedRouteName = layer.name; } return next2(); }); return [...memo, ...layer.stack]; }, []); return compose(layerChain)(ctx, next); }; dispatch.router = this; return dispatch; } routes() { return this.middleware(); } /** * Returns separate middleware for responding to `OPTIONS` requests with * an `Allow` header containing the allowed methods, as well as responding * with `405 Method Not Allowed` and `501 Not Implemented` as appropriate. * * @example * * ```javascript * const Koa = require('koa'); * const Router = require('@koa/router'); * * const app = new Koa(); * const router = new Router(); * * app.use(router.routes()); * app.use(router.allowedMethods()); * ``` * * **Example with [Boom](https://github.com/hapijs/boom)** * * ```javascript * const Koa = require('koa'); * const Router = require('@koa/router'); * const Boom = require('boom'); * * const app = new Koa(); * const router = new Router(); * * app.use(router.routes()); * app.use(router.allowedMethods({ * throw: true, * notImplemented: () => new Boom.notImplemented(), * methodNotAllowed: () => new Boom.methodNotAllowed() * })); * ``` * * @param {Object=} options * @param {Boolean=} options.throw throw error instead of setting status and header * @param {Function=} options.notImplemented throw the returned value in place of the default NotImplemented error * @param {Function=} options.methodNotAllowed throw the returned value in place of the default MethodNotAllowed error * @returns {Function} */ allowedMethods(options = {}) { const implemented = this.methods; return (ctx, next) => { return next().then(() => { const allowed = {}; if (ctx.matched && (!ctx.status || ctx.status === 404)) { for (let i2 = 0; i2 < ctx.matched.length; i2++) { const route = ctx.matched[i2]; for (let j = 0; j < route.methods.length; j++) { const method = route.methods[j]; allowed[method] = method; } } const allowedArr = Object.keys(allowed); if (!implemented.includes(ctx.method)) { if (options.throw) { const notImplementedThrowable = typeof options.notImplemented === "function" ? options.notImplemented() : new HttpError2.NotImplemented(); throw notImplementedThrowable; } else { ctx.status = 501; ctx.set("Allow", allowedArr.join(", ")); } } else if (allowedArr.length > 0) { if (ctx.method === "OPTIONS") { ctx.status = 200; ctx.body = ""; ctx.set("Allow", allowedArr.join(", ")); } else if (!allowed[ctx.method]) { if (options.throw) { const notAllowedThrowable = typeof options.methodNotAllowed === "function" ? options.methodNotAllowed() : new HttpError2.MethodNotAllowed(); throw notAllowedThrowable; } else { ctx.status = 405; ctx.set("Allow", allowedArr.join(", ")); } } } } }); }; } /** * Register route with all methods. * * @param {String} name Optional. * @param {String} path * @param {Function=} middleware You may also pass multiple middleware. * @param {Function} callback * @returns {Router} */ all(name, path, middleware) { if (typeof path === "string") { middleware = Array.prototype.slice.call(arguments, 2); } else { middleware = Array.prototype.slice.call(arguments, 1); path = name; name = null; } if (typeof path !== "string" && !(path instanceof RegExp) && (!Array.isArray(path) || path.length === 0)) throw new Error("You have to provide a path when adding an all handler"); this.register(path, methods, middleware, { name }); return this; } /** * Redirect `source` to `destination` URL with optional 30x status `code`. * * Both `source` and `destination` can be route names. * * ```javascript * router.redirect('/login', 'sign-in'); * ``` * * This is equivalent to: * * ```javascript * router.all('/login', ctx => { * ctx.redirect('/sign-in'); * ctx.status = 301; * }); * ``` * * @param {String} source URL or route name. * @param {String} destination URL or route name. * @param {Number=} code HTTP status code (default: 301). * @returns {Router} */ redirect(source, destination, code) { if (typeof source === "symbol" || source[0] !== "/") { source = this.url(source); if (source instanceof Error) throw source; } if (typeof destination === "symbol" || destination[0] !== "/" && !destination.includes("://")) { destination = this.url(destination); if (destination instanceof Error) throw destination; } return this.all(source, (ctx) => { ctx.redirect(destination); ctx.status = code || 301; }); } /** * Create and register a route. * * @param {String} path Path string. * @param {Array.} methods Array of HTTP verbs. * @param {Function} middleware Multiple middleware also accepted. * @returns {Layer} * @private */ register(path, methods2, middleware, opts = {}) { const router = this; const { stack: stack2 } = this; if (Array.isArray(path)) { for (const curPath of path) { router.register.call(router, curPath, methods2, middleware, opts); } return this; } const route = new Layer(path, methods2, middleware, { end: opts.end === false ? opts.end : true, name: opts.name, sensitive: opts.sensitive || this.opts.sensitive || false, strict: opts.strict || this.opts.strict || false, prefix: opts.prefix || this.opts.prefix || "", ignoreCaptures: opts.ignoreCaptures }); if (this.opts.prefix) { route.setPrefix(this.opts.prefix); } for (let i2 = 0; i2 < Object.keys(this.params).length; i2++) { const param = Object.keys(this.params)[i2]; route.param(param, this.params[param]); } stack2.push(route); debug("defined route %s %s", route.methods, route.path); return route; } /** * Lookup route with given `name`. * * @param {String} name * @returns {Layer|false} */ route(name) { const routes = this.stack; for (let len = routes.length, i2 = 0; i2 < len; i2++) { if (routes[i2].name && routes[i2].name === name) return routes[i2]; } return false; } /** * Generate URL for route. Takes a route name and map of named `params`. * * @example * * ```javascript * router.get('user', '/users/:id', (ctx, next) => { * // ... * }); * * router.url('user', 3); * // => "/users/3" * * router.url('user', { id: 3 }); * // => "/users/3" * * router.use((ctx, next) => { * // redirect to named route * ctx.redirect(ctx.router.url('sign-in')); * }) * * router.url('user', { id: 3 }, { query: { limit: 1 } }); * // => "/users/3?limit=1" * * router.url('user', { id: 3 }, { query: "limit=1" }); * // => "/users/3?limit=1" * ``` * * @param {String} name route name * @param {Object} params url parameters * @param {Object} [options] options parameter * @param {Object|String} [options.query] query options * @returns {String|Error} */ url(name, ...args2) { const route = this.route(name); if (route) return route.url.apply(route, args2); return new Error(`No route found for name: ${String(name)}`); } /** * Match given `path` and return corresponding routes. * * @param {String} path * @param {String} method * @returns {Object.} returns layers that matched path and * path and method. * @private */ match(path, method) { const layers = this.stack; let layer; const matched = { path: [], pathAndMethod: [], route: false }; for (let len = layers.length, i2 = 0; i2 < len; i2++) { layer = layers[i2]; debug("test %s %s", layer.path, layer.regexp); if (layer.match(path)) { matched.path.push(layer); if (layer.methods.length === 0 || layer.methods.includes(method)) { matched.pathAndMethod.push(layer); if (layer.methods.length > 0) matched.route = true; } } } return matched; } /** * Match given `input` to allowed host * @param {String} input * @returns {boolean} */ matchHost(input) { const { host } = this; if (!host) { return true; } if (!input) { return false; } if (typeof host === "string") { return input === host; } if (typeof host === "object" && host instanceof RegExp) { return host.test(input); } } /** * Run middleware for named route parameters. Useful for auto-loading or * validation. * * @example * * ```javascript * router * .param('user', (id, ctx, next) => { * ctx.user = users[id]; * if (!ctx.user) return ctx.status = 404; * return next(); * }) * .get('/users/:user', ctx => { * ctx.body = ctx.user; * }) * .get('/users/:user/friends', ctx => { * return ctx.user.getFriends().then(function(friends) { * ctx.body = friends; * }); * }) * // /users/3 => {"id": 3, "name": "Alex"} * // /users/3/friends => [{"id": 4, "name": "TJ"}] * ``` * * @param {String} param * @param {Function} middleware * @returns {Router} */ param(param, middleware) { this.params[param] = middleware; for (let i2 = 0; i2 < this.stack.length; i2++) { const route = this.stack[i2]; route.param(param, middleware); } return this; } }; for (const method of methods) { Router2.prototype[method] = function(name, path, middleware) { if (typeof path === "string" || path instanceof RegExp) { middleware = Array.prototype.slice.call(arguments, 2); } else { middleware = Array.prototype.slice.call(arguments, 1); path = name; name = null; } if (typeof path !== "string" && !(path instanceof RegExp) && (!Array.isArray(path) || path.length === 0)) throw new Error( `You have to provide a path when adding a ${method} handler` ); this.register(path, [method], middleware, { name }); return this; }; } Router2.prototype.del = Router2.prototype["delete"]; module2.exports = Router2; } }); // ../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/utils.js var require_utils = __commonJS({ "../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/utils.js"(exports2, module2) { function parseContentType(str) { if (str.length === 0) return; const params = /* @__PURE__ */ Object.create(null); let i2 = 0; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (TOKEN[code] !== 1) { if (code !== 47 || i2 === 0) return; break; } } if (i2 === str.length) return; const type = str.slice(0, i2).toLowerCase(); const subtypeStart = ++i2; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (TOKEN[code] !== 1) { if (i2 === subtypeStart) return; if (parseContentTypeParams(str, i2, params) === void 0) return; break; } } if (i2 === subtypeStart) return; const subtype = str.slice(subtypeStart, i2).toLowerCase(); return { type, subtype, params }; } function parseContentTypeParams(str, i2, params) { while (i2 < str.length) { for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (code !== 32 && code !== 9) break; } if (i2 === str.length) break; if (str.charCodeAt(i2++) !== 59) return; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (code !== 32 && code !== 9) break; } if (i2 === str.length) return; let name; const nameStart = i2; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (TOKEN[code] !== 1) { if (code !== 61) return; break; } } if (i2 === str.length) return; name = str.slice(nameStart, i2); ++i2; if (i2 === str.length) return; let value = ""; let valueStart; if (str.charCodeAt(i2) === 34) { valueStart = ++i2; let escaping = false; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (code === 92) { if (escaping) { valueStart = i2; escaping = false; } else { value += str.slice(valueStart, i2); escaping = true; } continue; } if (code === 34) { if (escaping) { valueStart = i2; escaping = false; continue; } value += str.slice(valueStart, i2); break; } if (escaping) { valueStart = i2 - 1; escaping = false; } if (QDTEXT[code] !== 1) return; } if (i2 === str.length) return; ++i2; } else { valueStart = i2; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (TOKEN[code] !== 1) { if (i2 === valueStart) return; break; } } value = str.slice(valueStart, i2); } name = name.toLowerCase(); if (params[name] === void 0) params[name] = value; } return params; } function parseDisposition(str, defDecoder) { if (str.length === 0) return; const params = /* @__PURE__ */ Object.create(null); let i2 = 0; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (TOKEN[code] !== 1) { if (parseDispositionParams(str, i2, params, defDecoder) === void 0) return; break; } } const type = str.slice(0, i2).toLowerCase(); return { type, params }; } function parseDispositionParams(str, i2, params, defDecoder) { while (i2 < str.length) { for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (code !== 32 && code !== 9) break; } if (i2 === str.length) break; if (str.charCodeAt(i2++) !== 59) return; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (code !== 32 && code !== 9) break; } if (i2 === str.length) return; let name; const nameStart = i2; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (TOKEN[code] !== 1) { if (code === 61) break; return; } } if (i2 === str.length) return; let value = ""; let valueStart; let charset; name = str.slice(nameStart, i2); if (name.charCodeAt(name.length - 1) === 42) { const charsetStart = ++i2; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (CHARSET[code] !== 1) { if (code !== 39) return; break; } } if (i2 === str.length) return; charset = str.slice(charsetStart, i2); ++i2; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (code === 39) break; } if (i2 === str.length) return; ++i2; if (i2 === str.length) return; valueStart = i2; let encode = 0; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (EXTENDED_VALUE[code] !== 1) { if (code === 37) { let hexUpper; let hexLower; if (i2 + 2 < str.length && (hexUpper = HEX_VALUES[str.charCodeAt(i2 + 1)]) !== -1 && (hexLower = HEX_VALUES[str.charCodeAt(i2 + 2)]) !== -1) { const byteVal = (hexUpper << 4) + hexLower; value += str.slice(valueStart, i2); value += String.fromCharCode(byteVal); i2 += 2; valueStart = i2 + 1; if (byteVal >= 128) encode = 2; else if (encode === 0) encode = 1; continue; } return; } break; } } value += str.slice(valueStart, i2); value = convertToUTF8(value, charset, encode); if (value === void 0) return; } else { ++i2; if (i2 === str.length) return; if (str.charCodeAt(i2) === 34) { valueStart = ++i2; let escaping = false; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (code === 92) { if (escaping) { valueStart = i2; escaping = false; } else { value += str.slice(valueStart, i2); escaping = true; } continue; } if (code === 34) { if (escaping) { valueStart = i2; escaping = false; continue; } value += str.slice(valueStart, i2); break; } if (escaping) { valueStart = i2 - 1; escaping = false; } if (QDTEXT[code] !== 1) return; } if (i2 === str.length) return; ++i2; } else { valueStart = i2; for (; i2 < str.length; ++i2) { const code = str.charCodeAt(i2); if (TOKEN[code] !== 1) { if (i2 === valueStart) return; break; } } value = str.slice(valueStart, i2); } value = defDecoder(value, 2); if (value === void 0) return; } name = name.toLowerCase(); if (params[name] === void 0) params[name] = value; } return params; } function getDecoder(charset) { let lc; while (true) { switch (charset) { case "utf-8": case "utf8": return decoders.utf8; case "latin1": case "ascii": // TODO: Make these a separate, strict decoder? case "us-ascii": case "iso-8859-1": case "iso8859-1": case "iso88591": case "iso_8859-1": case "windows-1252": case "iso_8859-1:1987": case "cp1252": case "x-cp1252": return decoders.latin1; case "utf16le": case "utf-16le": case "ucs2": case "ucs-2": return decoders.utf16le; case "base64": return decoders.base64; default: if (lc === void 0) { lc = true; charset = charset.toLowerCase(); continue; } return decoders.other.bind(charset); } } } var decoders = { utf8: (data, hint) => { if (data.length === 0) return ""; if (typeof data === "string") { if (hint < 2) return data; data = Buffer.from(data, "latin1"); } return data.utf8Slice(0, data.length); }, latin1: (data, hint) => { if (data.length === 0) return ""; if (typeof data === "string") return data; return data.latin1Slice(0, data.length); }, utf16le: (data, hint) => { if (data.length === 0) return ""; if (typeof data === "string") data = Buffer.from(data, "latin1"); return data.ucs2Slice(0, data.length); }, base64: (data, hint) => { if (data.length === 0) return ""; if (typeof data === "string") data = Buffer.from(data, "latin1"); return data.base64Slice(0, data.length); }, other: (data, hint) => { if (data.length === 0) return ""; if (typeof data === "string") data = Buffer.from(data, "latin1"); try { const decoder = new TextDecoder(exports2); return decoder.decode(data); } catch { } } }; function convertToUTF8(data, charset, hint) { const decode = getDecoder(charset); if (decode) return decode(data, hint); } function basename(path) { if (typeof path !== "string") return ""; for (let i2 = path.length - 1; i2 >= 0; --i2) { switch (path.charCodeAt(i2)) { case 47: // '/' case 92: path = path.slice(i2 + 1); return path === ".." || path === "." ? "" : path; } } return path === ".." || path === "." ? "" : path; } var TOKEN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; var QDTEXT = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; var CHARSET = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; var EXTENDED_VALUE = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; var HEX_VALUES = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ]; module2.exports = { basename, convertToUTF8, getDecoder, parseContentType, parseDisposition }; } }); // ../node_modules/.pnpm/streamsearch@1.1.0/node_modules/streamsearch/lib/sbmh.js var require_sbmh = __commonJS({ "../node_modules/.pnpm/streamsearch@1.1.0/node_modules/streamsearch/lib/sbmh.js"(exports2, module2) { function memcmp(buf1, pos1, buf2, pos2, num) { for (let i2 = 0; i2 < num; ++i2) { if (buf1[pos1 + i2] !== buf2[pos2 + i2]) return false; } return true; } var SBMH = class { constructor(needle, cb) { if (typeof cb !== "function") throw new Error("Missing match callback"); if (typeof needle === "string") needle = Buffer.from(needle); else if (!Buffer.isBuffer(needle)) throw new Error(`Expected Buffer for needle, got ${typeof needle}`); const needleLen = needle.length; this.maxMatches = Infinity; this.matches = 0; this._cb = cb; this._lookbehindSize = 0; this._needle = needle; this._bufPos = 0; this._lookbehind = Buffer.allocUnsafe(needleLen); this._occ = [ needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen, needleLen ]; if (needleLen > 1) { for (let i2 = 0; i2 < needleLen - 1; ++i2) this._occ[needle[i2]] = needleLen - 1 - i2; } } reset() { this.matches = 0; this._lookbehindSize = 0; this._bufPos = 0; } push(chunk, pos) { let result; if (!Buffer.isBuffer(chunk)) chunk = Buffer.from(chunk, "latin1"); const chunkLen = chunk.length; this._bufPos = pos || 0; while (result !== chunkLen && this.matches < this.maxMatches) result = feed(this, chunk); return result; } destroy() { const lbSize = this._lookbehindSize; if (lbSize) this._cb(false, this._lookbehind, 0, lbSize, false); this.reset(); } }; function feed(self2, data) { const len = data.length; const needle = self2._needle; const needleLen = needle.length; let pos = -self2._lookbehindSize; const lastNeedleCharPos = needleLen - 1; const lastNeedleChar = needle[lastNeedleCharPos]; const end = len - needleLen; const occ = self2._occ; const lookbehind = self2._lookbehind; if (pos < 0) { while (pos < 0 && pos <= end) { const nextPos = pos + lastNeedleCharPos; const ch = nextPos < 0 ? lookbehind[self2._lookbehindSize + nextPos] : data[nextPos]; if (ch === lastNeedleChar && matchNeedle(self2, data, pos, lastNeedleCharPos)) { self2._lookbehindSize = 0; ++self2.matches; if (pos > -self2._lookbehindSize) self2._cb(true, lookbehind, 0, self2._lookbehindSize + pos, false); else self2._cb(true, void 0, 0, 0, true); return self2._bufPos = pos + needleLen; } pos += occ[ch]; } while (pos < 0 && !matchNeedle(self2, data, pos, len - pos)) ++pos; if (pos < 0) { const bytesToCutOff = self2._lookbehindSize + pos; if (bytesToCutOff > 0) { self2._cb(false, lookbehind, 0, bytesToCutOff, false); } self2._lookbehindSize -= bytesToCutOff; lookbehind.copy(lookbehind, 0, bytesToCutOff, self2._lookbehindSize); lookbehind.set(data, self2._lookbehindSize); self2._lookbehindSize += len; self2._bufPos = len; return len; } self2._cb(false, lookbehind, 0, self2._lookbehindSize, false); self2._lookbehindSize = 0; } pos += self2._bufPos; const firstNeedleChar = needle[0]; while (pos <= end) { const ch = data[pos + lastNeedleCharPos]; if (ch === lastNeedleChar && data[pos] === firstNeedleChar && memcmp(needle, 0, data, pos, lastNeedleCharPos)) { ++self2.matches; if (pos > 0) self2._cb(true, data, self2._bufPos, pos, true); else self2._cb(true, void 0, 0, 0, true); return self2._bufPos = pos + needleLen; } pos += occ[ch]; } while (pos < len) { if (data[pos] !== firstNeedleChar || !memcmp(data, pos, needle, 0, len - pos)) { ++pos; continue; } data.copy(lookbehind, 0, pos, len); self2._lookbehindSize = len - pos; break; } if (pos > 0) self2._cb(false, data, self2._bufPos, pos < len ? pos : len, true); self2._bufPos = len; return len; } function matchNeedle(self2, data, pos, len) { const lb = self2._lookbehind; const lbSize = self2._lookbehindSize; const needle = self2._needle; for (let i2 = 0; i2 < len; ++i2, ++pos) { const ch = pos < 0 ? lb[lbSize + pos] : data[pos]; if (ch !== needle[i2]) return false; } return true; } module2.exports = SBMH; } }); // ../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/types/multipart.js var require_multipart = __commonJS({ "../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/types/multipart.js"(exports2, module2) { var { Readable, Writable } = require("stream"); var StreamSearch = require_sbmh(); var { basename, convertToUTF8, getDecoder, parseContentType, parseDisposition } = require_utils(); var BUF_CRLF = Buffer.from("\r\n"); var BUF_CR = Buffer.from("\r"); var BUF_DASH = Buffer.from("-"); function noop2() { } var MAX_HEADER_PAIRS = 2e3; var MAX_HEADER_SIZE = 16 * 1024; var HPARSER_NAME = 0; var HPARSER_PRE_OWS = 1; var HPARSER_VALUE = 2; var HeaderParser = class { constructor(cb) { this.header = /* @__PURE__ */ Object.create(null); this.pairCount = 0; this.byteCount = 0; this.state = HPARSER_NAME; this.name = ""; this.value = ""; this.crlf = 0; this.cb = cb; } reset() { this.header = /* @__PURE__ */ Object.create(null); this.pairCount = 0; this.byteCount = 0; this.state = HPARSER_NAME; this.name = ""; this.value = ""; this.crlf = 0; } push(chunk, pos, end) { let start = pos; while (pos < end) { switch (this.state) { case HPARSER_NAME: { let done = false; for (; pos < end; ++pos) { if (this.byteCount === MAX_HEADER_SIZE) return -1; ++this.byteCount; const code = chunk[pos]; if (TOKEN[code] !== 1) { if (code !== 58) return -1; this.name += chunk.latin1Slice(start, pos); if (this.name.length === 0) return -1; ++pos; done = true; this.state = HPARSER_PRE_OWS; break; } } if (!done) { this.name += chunk.latin1Slice(start, pos); break; } } case HPARSER_PRE_OWS: { let done = false; for (; pos < end; ++pos) { if (this.byteCount === MAX_HEADER_SIZE) return -1; ++this.byteCount; const code = chunk[pos]; if (code !== 32 && code !== 9) { start = pos; done = true; this.state = HPARSER_VALUE; break; } } if (!done) break; } case HPARSER_VALUE: switch (this.crlf) { case 0: for (; pos < end; ++pos) { if (this.byteCount === MAX_HEADER_SIZE) return -1; ++this.byteCount; const code = chunk[pos]; if (FIELD_VCHAR[code] !== 1) { if (code !== 13) return -1; ++this.crlf; break; } } this.value += chunk.latin1Slice(start, pos++); break; case 1: if (this.byteCount === MAX_HEADER_SIZE) return -1; ++this.byteCount; if (chunk[pos++] !== 10) return -1; ++this.crlf; break; case 2: { if (this.byteCount === MAX_HEADER_SIZE) return -1; ++this.byteCount; const code = chunk[pos]; if (code === 32 || code === 9) { start = pos; this.crlf = 0; } else { if (++this.pairCount < MAX_HEADER_PAIRS) { this.name = this.name.toLowerCase(); if (this.header[this.name] === void 0) this.header[this.name] = [this.value]; else this.header[this.name].push(this.value); } if (code === 13) { ++this.crlf; ++pos; } else { start = pos; this.crlf = 0; this.state = HPARSER_NAME; this.name = ""; this.value = ""; } } break; } case 3: { if (this.byteCount === MAX_HEADER_SIZE) return -1; ++this.byteCount; if (chunk[pos++] !== 10) return -1; const header = this.header; this.reset(); this.cb(header); return pos; } } break; } } return pos; } }; var FileStream = class extends Readable { constructor(opts, owner) { super(opts); this.truncated = false; this._readcb = null; this.once("end", () => { this._read(); if (--owner._fileEndsLeft === 0 && owner._finalcb) { const cb = owner._finalcb; owner._finalcb = null; process.nextTick(cb); } }); } _read(n) { const cb = this._readcb; if (cb) { this._readcb = null; cb(); } } }; var ignoreData = { push: (chunk, pos) => { }, destroy: () => { } }; function callAndUnsetCb(self2, err) { const cb = self2._writecb; self2._writecb = null; if (err) self2.destroy(err); else if (cb) cb(); } function nullDecoder(val, hint) { return val; } var Multipart = class extends Writable { constructor(cfg) { const streamOpts = { autoDestroy: true, emitClose: true, highWaterMark: typeof cfg.highWaterMark === "number" ? cfg.highWaterMark : void 0 }; super(streamOpts); if (!cfg.conType.params || typeof cfg.conType.params.boundary !== "string") throw new Error("Multipart: Boundary not found"); const boundary = cfg.conType.params.boundary; const paramDecoder = typeof cfg.defParamCharset === "string" && cfg.defParamCharset ? getDecoder(cfg.defParamCharset) : nullDecoder; const defCharset = cfg.defCharset || "utf8"; const preservePath = cfg.preservePath; const fileOpts = { autoDestroy: true, emitClose: true, highWaterMark: typeof cfg.fileHwm === "number" ? cfg.fileHwm : void 0 }; const limits = cfg.limits; const fieldSizeLimit = limits && typeof limits.fieldSize === "number" ? limits.fieldSize : 1 * 1024 * 1024; const fileSizeLimit = limits && typeof limits.fileSize === "number" ? limits.fileSize : Infinity; const filesLimit = limits && typeof limits.files === "number" ? limits.files : Infinity; const fieldsLimit = limits && typeof limits.fields === "number" ? limits.fields : Infinity; const partsLimit = limits && typeof limits.parts === "number" ? limits.parts : Infinity; let parts = -1; let fields = 0; let files = 0; let skipPart = false; this._fileEndsLeft = 0; this._fileStream = void 0; this._complete = false; let fileSize = 0; let field; let fieldSize = 0; let partCharset; let partEncoding; let partType; let partName; let partTruncated = false; let hitFilesLimit = false; let hitFieldsLimit = false; this._hparser = null; const hparser = new HeaderParser((header) => { this._hparser = null; skipPart = false; partType = "text/plain"; partCharset = defCharset; partEncoding = "7bit"; partName = void 0; partTruncated = false; let filename; if (!header["content-disposition"]) { skipPart = true; return; } const disp = parseDisposition( header["content-disposition"][0], paramDecoder ); if (!disp || disp.type !== "form-data") { skipPart = true; return; } if (disp.params) { if (disp.params.name) partName = disp.params.name; if (disp.params["filename*"]) filename = disp.params["filename*"]; else if (disp.params.filename) filename = disp.params.filename; if (filename !== void 0 && !preservePath) filename = basename(filename); } if (header["content-type"]) { const conType = parseContentType(header["content-type"][0]); if (conType) { partType = `${conType.type}/${conType.subtype}`; if (conType.params && typeof conType.params.charset === "string") partCharset = conType.params.charset.toLowerCase(); } } if (header["content-transfer-encoding"]) partEncoding = header["content-transfer-encoding"][0].toLowerCase(); if (partType === "application/octet-stream" || filename !== void 0) { if (files === filesLimit) { if (!hitFilesLimit) { hitFilesLimit = true; this.emit("filesLimit"); } skipPart = true; return; } ++files; if (this.listenerCount("file") === 0) { skipPart = true; return; } fileSize = 0; this._fileStream = new FileStream(fileOpts, this); ++this._fileEndsLeft; this.emit( "file", partName, this._fileStream, { filename, encoding: partEncoding, mimeType: partType } ); } else { if (fields === fieldsLimit) { if (!hitFieldsLimit) { hitFieldsLimit = true; this.emit("fieldsLimit"); } skipPart = true; return; } ++fields; if (this.listenerCount("field") === 0) { skipPart = true; return; } field = []; fieldSize = 0; } }); let matchPostBoundary = 0; const ssCb = (isMatch, data, start, end, isDataSafe) => { retrydata: while (data) { if (this._hparser !== null) { const ret = this._hparser.push(data, start, end); if (ret === -1) { this._hparser = null; hparser.reset(); this.emit("error", new Error("Malformed part header")); break; } start = ret; } if (start === end) break; if (matchPostBoundary !== 0) { if (matchPostBoundary === 1) { switch (data[start]) { case 45: matchPostBoundary = 2; ++start; break; case 13: matchPostBoundary = 3; ++start; break; default: matchPostBoundary = 0; } if (start === end) return; } if (matchPostBoundary === 2) { matchPostBoundary = 0; if (data[start] === 45) { this._complete = true; this._bparser = ignoreData; return; } const writecb = this._writecb; this._writecb = noop2; ssCb(false, BUF_DASH, 0, 1, false); this._writecb = writecb; } else if (matchPostBoundary === 3) { matchPostBoundary = 0; if (data[start] === 10) { ++start; if (parts >= partsLimit) break; this._hparser = hparser; if (start === end) break; continue retrydata; } else { const writecb = this._writecb; this._writecb = noop2; ssCb(false, BUF_CR, 0, 1, false); this._writecb = writecb; } } } if (!skipPart) { if (this._fileStream) { let chunk; const actualLen = Math.min(end - start, fileSizeLimit - fileSize); if (!isDataSafe) { chunk = Buffer.allocUnsafe(actualLen); data.copy(chunk, 0, start, start + actualLen); } else { chunk = data.slice(start, start + actualLen); } fileSize += chunk.length; if (fileSize === fileSizeLimit) { if (chunk.length > 0) this._fileStream.push(chunk); this._fileStream.emit("limit"); this._fileStream.truncated = true; skipPart = true; } else if (!this._fileStream.push(chunk)) { if (this._writecb) this._fileStream._readcb = this._writecb; this._writecb = null; } } else if (field !== void 0) { let chunk; const actualLen = Math.min( end - start, fieldSizeLimit - fieldSize ); if (!isDataSafe) { chunk = Buffer.allocUnsafe(actualLen); data.copy(chunk, 0, start, start + actualLen); } else { chunk = data.slice(start, start + actualLen); } fieldSize += actualLen; field.push(chunk); if (fieldSize === fieldSizeLimit) { skipPart = true; partTruncated = true; } } } break; } if (isMatch) { matchPostBoundary = 1; if (this._fileStream) { this._fileStream.push(null); this._fileStream = null; } else if (field !== void 0) { let data2; switch (field.length) { case 0: data2 = ""; break; case 1: data2 = convertToUTF8(field[0], partCharset, 0); break; default: data2 = convertToUTF8( Buffer.concat(field, fieldSize), partCharset, 0 ); } field = void 0; fieldSize = 0; this.emit( "field", partName, data2, { nameTruncated: false, valueTruncated: partTruncated, encoding: partEncoding, mimeType: partType } ); } if (++parts === partsLimit) this.emit("partsLimit"); } }; this._bparser = new StreamSearch(`\r --${boundary}`, ssCb); this._writecb = null; this._finalcb = null; this.write(BUF_CRLF); } static detect(conType) { return conType.type === "multipart" && conType.subtype === "form-data"; } _write(chunk, enc, cb) { this._writecb = cb; this._bparser.push(chunk, 0); if (this._writecb) callAndUnsetCb(this); } _destroy(err, cb) { this._hparser = null; this._bparser = ignoreData; if (!err) err = checkEndState(this); const fileStream = this._fileStream; if (fileStream) { this._fileStream = null; fileStream.destroy(err); } cb(err); } _final(cb) { this._bparser.destroy(); if (!this._complete) return cb(new Error("Unexpected end of form")); if (this._fileEndsLeft) this._finalcb = finalcb.bind(null, this, cb); else finalcb(this, cb); } }; function finalcb(self2, cb, err) { if (err) return cb(err); err = checkEndState(self2); cb(err); } function checkEndState(self2) { if (self2._hparser) return new Error("Malformed part header"); const fileStream = self2._fileStream; if (fileStream) { self2._fileStream = null; fileStream.destroy(new Error("Unexpected end of file")); } if (!self2._complete) return new Error("Unexpected end of form"); } var TOKEN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; var FIELD_VCHAR = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; module2.exports = Multipart; } }); // ../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/types/urlencoded.js var require_urlencoded = __commonJS({ "../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/types/urlencoded.js"(exports2, module2) { var { Writable } = require("stream"); var { getDecoder } = require_utils(); var URLEncoded = class extends Writable { constructor(cfg) { const streamOpts = { autoDestroy: true, emitClose: true, highWaterMark: typeof cfg.highWaterMark === "number" ? cfg.highWaterMark : void 0 }; super(streamOpts); let charset = cfg.defCharset || "utf8"; if (cfg.conType.params && typeof cfg.conType.params.charset === "string") charset = cfg.conType.params.charset; this.charset = charset; const limits = cfg.limits; this.fieldSizeLimit = limits && typeof limits.fieldSize === "number" ? limits.fieldSize : 1 * 1024 * 1024; this.fieldsLimit = limits && typeof limits.fields === "number" ? limits.fields : Infinity; this.fieldNameSizeLimit = limits && typeof limits.fieldNameSize === "number" ? limits.fieldNameSize : 100; this._inKey = true; this._keyTrunc = false; this._valTrunc = false; this._bytesKey = 0; this._bytesVal = 0; this._fields = 0; this._key = ""; this._val = ""; this._byte = -2; this._lastPos = 0; this._encode = 0; this._decoder = getDecoder(charset); } static detect(conType) { return conType.type === "application" && conType.subtype === "x-www-form-urlencoded"; } _write(chunk, enc, cb) { if (this._fields >= this.fieldsLimit) return cb(); let i2 = 0; const len = chunk.length; this._lastPos = 0; if (this._byte !== -2) { i2 = readPctEnc(this, chunk, i2, len); if (i2 === -1) return cb(new Error("Malformed urlencoded form")); if (i2 >= len) return cb(); if (this._inKey) ++this._bytesKey; else ++this._bytesVal; } main: while (i2 < len) { if (this._inKey) { i2 = skipKeyBytes(this, chunk, i2, len); while (i2 < len) { switch (chunk[i2]) { case 61: if (this._lastPos < i2) this._key += chunk.latin1Slice(this._lastPos, i2); this._lastPos = ++i2; this._key = this._decoder(this._key, this._encode); this._encode = 0; this._inKey = false; continue main; case 38: if (this._lastPos < i2) this._key += chunk.latin1Slice(this._lastPos, i2); this._lastPos = ++i2; this._key = this._decoder(this._key, this._encode); this._encode = 0; if (this._bytesKey > 0) { this.emit( "field", this._key, "", { nameTruncated: this._keyTrunc, valueTruncated: false, encoding: this.charset, mimeType: "text/plain" } ); } this._key = ""; this._val = ""; this._keyTrunc = false; this._valTrunc = false; this._bytesKey = 0; this._bytesVal = 0; if (++this._fields >= this.fieldsLimit) { this.emit("fieldsLimit"); return cb(); } continue; case 43: if (this._lastPos < i2) this._key += chunk.latin1Slice(this._lastPos, i2); this._key += " "; this._lastPos = i2 + 1; break; case 37: if (this._encode === 0) this._encode = 1; if (this._lastPos < i2) this._key += chunk.latin1Slice(this._lastPos, i2); this._lastPos = i2 + 1; this._byte = -1; i2 = readPctEnc(this, chunk, i2 + 1, len); if (i2 === -1) return cb(new Error("Malformed urlencoded form")); if (i2 >= len) return cb(); ++this._bytesKey; i2 = skipKeyBytes(this, chunk, i2, len); continue; } ++i2; ++this._bytesKey; i2 = skipKeyBytes(this, chunk, i2, len); } if (this._lastPos < i2) this._key += chunk.latin1Slice(this._lastPos, i2); } else { i2 = skipValBytes(this, chunk, i2, len); while (i2 < len) { switch (chunk[i2]) { case 38: if (this._lastPos < i2) this._val += chunk.latin1Slice(this._lastPos, i2); this._lastPos = ++i2; this._inKey = true; this._val = this._decoder(this._val, this._encode); this._encode = 0; if (this._bytesKey > 0 || this._bytesVal > 0) { this.emit( "field", this._key, this._val, { nameTruncated: this._keyTrunc, valueTruncated: this._valTrunc, encoding: this.charset, mimeType: "text/plain" } ); } this._key = ""; this._val = ""; this._keyTrunc = false; this._valTrunc = false; this._bytesKey = 0; this._bytesVal = 0; if (++this._fields >= this.fieldsLimit) { this.emit("fieldsLimit"); return cb(); } continue main; case 43: if (this._lastPos < i2) this._val += chunk.latin1Slice(this._lastPos, i2); this._val += " "; this._lastPos = i2 + 1; break; case 37: if (this._encode === 0) this._encode = 1; if (this._lastPos < i2) this._val += chunk.latin1Slice(this._lastPos, i2); this._lastPos = i2 + 1; this._byte = -1; i2 = readPctEnc(this, chunk, i2 + 1, len); if (i2 === -1) return cb(new Error("Malformed urlencoded form")); if (i2 >= len) return cb(); ++this._bytesVal; i2 = skipValBytes(this, chunk, i2, len); continue; } ++i2; ++this._bytesVal; i2 = skipValBytes(this, chunk, i2, len); } if (this._lastPos < i2) this._val += chunk.latin1Slice(this._lastPos, i2); } } cb(); } _final(cb) { if (this._byte !== -2) return cb(new Error("Malformed urlencoded form")); if (!this._inKey || this._bytesKey > 0 || this._bytesVal > 0) { if (this._inKey) this._key = this._decoder(this._key, this._encode); else this._val = this._decoder(this._val, this._encode); this.emit( "field", this._key, this._val, { nameTruncated: this._keyTrunc, valueTruncated: this._valTrunc, encoding: this.charset, mimeType: "text/plain" } ); } cb(); } }; function readPctEnc(self2, chunk, pos, len) { if (pos >= len) return len; if (self2._byte === -1) { const hexUpper = HEX_VALUES[chunk[pos++]]; if (hexUpper === -1) return -1; if (hexUpper >= 8) self2._encode = 2; if (pos < len) { const hexLower = HEX_VALUES[chunk[pos++]]; if (hexLower === -1) return -1; if (self2._inKey) self2._key += String.fromCharCode((hexUpper << 4) + hexLower); else self2._val += String.fromCharCode((hexUpper << 4) + hexLower); self2._byte = -2; self2._lastPos = pos; } else { self2._byte = hexUpper; } } else { const hexLower = HEX_VALUES[chunk[pos++]]; if (hexLower === -1) return -1; if (self2._inKey) self2._key += String.fromCharCode((self2._byte << 4) + hexLower); else self2._val += String.fromCharCode((self2._byte << 4) + hexLower); self2._byte = -2; self2._lastPos = pos; } return pos; } function skipKeyBytes(self2, chunk, pos, len) { if (self2._bytesKey > self2.fieldNameSizeLimit) { if (!self2._keyTrunc) { if (self2._lastPos < pos) self2._key += chunk.latin1Slice(self2._lastPos, pos - 1); } self2._keyTrunc = true; for (; pos < len; ++pos) { const code = chunk[pos]; if (code === 61 || code === 38) break; ++self2._bytesKey; } self2._lastPos = pos; } return pos; } function skipValBytes(self2, chunk, pos, len) { if (self2._bytesVal > self2.fieldSizeLimit) { if (!self2._valTrunc) { if (self2._lastPos < pos) self2._val += chunk.latin1Slice(self2._lastPos, pos - 1); } self2._valTrunc = true; for (; pos < len; ++pos) { if (chunk[pos] === 38) break; ++self2._bytesVal; } self2._lastPos = pos; } return pos; } var HEX_VALUES = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ]; module2.exports = URLEncoded; } }); // ../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/index.js var require_lib2 = __commonJS({ "../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/index.js"(exports2, module2) { var { parseContentType } = require_utils(); function getInstance(cfg) { const headers = cfg.headers; const conType = parseContentType(headers["content-type"]); if (!conType) throw new Error("Malformed content type"); for (const type of TYPES) { const matched = type.detect(conType); if (!matched) continue; const instanceCfg = { limits: cfg.limits, headers, conType, highWaterMark: void 0, fileHwm: void 0, defCharset: void 0, defParamCharset: void 0, preservePath: false }; if (cfg.highWaterMark) instanceCfg.highWaterMark = cfg.highWaterMark; if (cfg.fileHwm) instanceCfg.fileHwm = cfg.fileHwm; instanceCfg.defCharset = cfg.defCharset; instanceCfg.defParamCharset = cfg.defParamCharset; instanceCfg.preservePath = cfg.preservePath; return new type(instanceCfg); } throw new Error(`Unsupported content type: ${headers["content-type"]}`); } var TYPES = [ require_multipart(), require_urlencoded() ].filter(function(typemod) { return typeof typemod.detect === "function"; }); module2.exports = (cfg) => { if (typeof cfg !== "object" || cfg === null) cfg = {}; if (typeof cfg.headers !== "object" || cfg.headers === null || typeof cfg.headers["content-type"] !== "string") { throw new Error("Missing Content-Type"); } return getInstance(cfg); }; } }); // ../node_modules/.pnpm/xtend@4.0.2/node_modules/xtend/immutable.js var require_immutable = __commonJS({ "../node_modules/.pnpm/xtend@4.0.2/node_modules/xtend/immutable.js"(exports2, module2) { module2.exports = extend; var hasOwnProperty = Object.prototype.hasOwnProperty; function extend() { var target = {}; for (var i2 = 0; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; } } }); // ../node_modules/.pnpm/append-field@1.0.0/node_modules/append-field/lib/parse-path.js var require_parse_path = __commonJS({ "../node_modules/.pnpm/append-field@1.0.0/node_modules/append-field/lib/parse-path.js"(exports2, module2) { var reFirstKey = /^[^\[]*/; var reDigitPath = /^\[(\d+)\]/; var reNormalPath = /^\[([^\]]+)\]/; function parsePath(key) { function failure() { return [{ type: "object", key, last: true }]; } var firstKey = reFirstKey.exec(key)[0]; if (!firstKey) return failure(); var len = key.length; var pos = firstKey.length; var tail = { type: "object", key: firstKey }; var steps = [tail]; while (pos < len) { var m2; if (key[pos] === "[" && key[pos + 1] === "]") { pos += 2; tail.append = true; if (pos !== len) return failure(); continue; } m2 = reDigitPath.exec(key.substring(pos)); if (m2 !== null) { pos += m2[0].length; tail.nextType = "array"; tail = { type: "array", key: parseInt(m2[1], 10) }; steps.push(tail); continue; } m2 = reNormalPath.exec(key.substring(pos)); if (m2 !== null) { pos += m2[0].length; tail.nextType = "object"; tail = { type: "object", key: m2[1] }; steps.push(tail); continue; } return failure(); } tail.last = true; return steps; } module2.exports = parsePath; } }); // ../node_modules/.pnpm/append-field@1.0.0/node_modules/append-field/lib/set-value.js var require_set_value = __commonJS({ "../node_modules/.pnpm/append-field@1.0.0/node_modules/append-field/lib/set-value.js"(exports2, module2) { function valueType(value) { if (value === void 0) return "undefined"; if (Array.isArray(value)) return "array"; if (typeof value === "object") return "object"; return "scalar"; } function setLastValue(context, step, currentValue, entryValue) { switch (valueType(currentValue)) { case "undefined": if (step.append) { context[step.key] = [entryValue]; } else { context[step.key] = entryValue; } break; case "array": context[step.key].push(entryValue); break; case "object": return setLastValue(currentValue, { type: "object", key: "", last: true }, currentValue[""], entryValue); case "scalar": context[step.key] = [context[step.key], entryValue]; break; } return context; } function setValue(context, step, currentValue, entryValue) { if (step.last) return setLastValue(context, step, currentValue, entryValue); var obj; switch (valueType(currentValue)) { case "undefined": if (step.nextType === "array") { context[step.key] = []; } else { context[step.key] = /* @__PURE__ */ Object.create(null); } return context[step.key]; case "object": return context[step.key]; case "array": if (step.nextType === "array") { return currentValue; } obj = /* @__PURE__ */ Object.create(null); context[step.key] = obj; currentValue.forEach(function(item, i2) { if (item !== void 0) obj["" + i2] = item; }); return obj; case "scalar": obj = /* @__PURE__ */ Object.create(null); obj[""] = currentValue; context[step.key] = obj; return obj; } } module2.exports = setValue; } }); // ../node_modules/.pnpm/append-field@1.0.0/node_modules/append-field/index.js var require_append_field = __commonJS({ "../node_modules/.pnpm/append-field@1.0.0/node_modules/append-field/index.js"(exports2, module2) { var parsePath = require_parse_path(); var setValue = require_set_value(); function appendField(store, key, value) { var steps = parsePath(key); steps.reduce(function(context, step) { return setValue(context, step, context[step.key], value); }, store); } module2.exports = appendField; } }); // ../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/lib/counter.js var require_counter = __commonJS({ "../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/lib/counter.js"(exports2, module2) { var EventEmitter = require("events").EventEmitter; function Counter() { EventEmitter.call(this); this.value = 0; } Counter.prototype = Object.create(EventEmitter.prototype); Counter.prototype.increment = function increment() { this.value++; }; Counter.prototype.decrement = function decrement() { if (--this.value === 0) this.emit("zero"); }; Counter.prototype.isZero = function isZero() { return this.value === 0; }; Counter.prototype.onceZero = function onceZero(fn2) { if (this.isZero()) return fn2(); this.once("zero", fn2); }; module2.exports = Counter; } }); // ../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/lib/multer-error.js var require_multer_error = __commonJS({ "../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/lib/multer-error.js"(exports2, module2) { var util = require("util"); var errorMessages = { LIMIT_PART_COUNT: "Too many parts", LIMIT_FILE_SIZE: "File too large", LIMIT_FILE_COUNT: "Too many files", LIMIT_FIELD_KEY: "Field name too long", LIMIT_FIELD_VALUE: "Field value too long", LIMIT_FIELD_COUNT: "Too many fields", LIMIT_UNEXPECTED_FILE: "Unexpected field", MISSING_FIELD_NAME: "Field name missing" }; function MulterError(code, field) { Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; this.message = errorMessages[code]; this.code = code; if (field) this.field = field; } util.inherits(MulterError, Error); module2.exports = MulterError; } }); // ../node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js var require_object_assign = __commonJS({ "../node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js"(exports2, module2) { var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === void 0) { throw new TypeError("Object.assign cannot be called with null or undefined"); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } var test1 = new String("abc"); test1[5] = "de"; if (Object.getOwnPropertyNames(test1)[0] === "5") { return false; } var test2 = {}; for (var i2 = 0; i2 < 10; i2++) { test2["_" + String.fromCharCode(i2)] = i2; } var order2 = Object.getOwnPropertyNames(test2).map(function(n) { return test2[n]; }); if (order2.join("") !== "0123456789") { return false; } var test3 = {}; "abcdefghijklmnopqrst".split("").forEach(function(letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { return false; } return true; } catch (err) { return false; } } module2.exports = shouldUseNative() ? Object.assign : function(target, source) { var from; var to = toObject(target); var symbols; for (var s2 = 1; s2 < arguments.length; s2++) { from = Object(arguments[s2]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i2 = 0; i2 < symbols.length; i2++) { if (propIsEnumerable.call(from, symbols[i2])) { to[symbols[i2]] = from[symbols[i2]]; } } } } return to; }; } }); // ../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/lib/file-appender.js var require_file_appender = __commonJS({ "../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/lib/file-appender.js"(exports2, module2) { var objectAssign = require_object_assign(); function arrayRemove(arr, item) { var idx = arr.indexOf(item); if (~idx) arr.splice(idx, 1); } function FileAppender(strategy, req) { this.strategy = strategy; this.req = req; switch (strategy) { case "NONE": break; case "VALUE": break; case "ARRAY": req.files = []; break; case "OBJECT": req.files = /* @__PURE__ */ Object.create(null); break; default: throw new Error("Unknown file strategy: " + strategy); } } FileAppender.prototype.insertPlaceholder = function(file) { var placeholder = { fieldname: file.fieldname }; switch (this.strategy) { case "NONE": break; case "VALUE": break; case "ARRAY": this.req.files.push(placeholder); break; case "OBJECT": if (this.req.files[file.fieldname]) { this.req.files[file.fieldname].push(placeholder); } else { this.req.files[file.fieldname] = [placeholder]; } break; } return placeholder; }; FileAppender.prototype.removePlaceholder = function(placeholder) { switch (this.strategy) { case "NONE": break; case "VALUE": break; case "ARRAY": arrayRemove(this.req.files, placeholder); break; case "OBJECT": if (this.req.files[placeholder.fieldname].length === 1) { delete this.req.files[placeholder.fieldname]; } else { arrayRemove(this.req.files[placeholder.fieldname], placeholder); } break; } }; FileAppender.prototype.replacePlaceholder = function(placeholder, file) { if (this.strategy === "VALUE") { this.req.file = file; return; } delete placeholder.fieldname; objectAssign(placeholder, file); }; module2.exports = FileAppender; } }); // ../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/lib/remove-uploaded-files.js var require_remove_uploaded_files = __commonJS({ "../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/lib/remove-uploaded-files.js"(exports2, module2) { function removeUploadedFiles(uploadedFiles, remove, cb) { var length = uploadedFiles.length; var errors = []; if (length === 0) return cb(null, errors); function handleFile(idx) { var file = uploadedFiles[idx]; remove(file, function(err) { if (err) { err.file = file; err.field = file.fieldname; errors.push(err); } if (idx < length - 1) { handleFile(idx + 1); } else { cb(null, errors); } }); } handleFile(0); } module2.exports = removeUploadedFiles; } }); // ../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/lib/make-middleware.js var require_make_middleware = __commonJS({ "../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/lib/make-middleware.js"(exports2, module2) { var is = require_type_is(); var Busboy = require_lib2(); var extend = require_immutable(); var appendField = require_append_field(); var Counter = require_counter(); var MulterError = require_multer_error(); var FileAppender = require_file_appender(); var removeUploadedFiles = require_remove_uploaded_files(); function makeMiddleware(setup) { return function multerMiddleware(req, res, next) { if (!is(req, ["multipart"])) return next(); var options = setup(); var limits = options.limits; var storage = options.storage; var fileFilter = options.fileFilter; var fileStrategy = options.fileStrategy; var preservePath = options.preservePath; req.body = /* @__PURE__ */ Object.create(null); var busboy; try { busboy = Busboy({ headers: req.headers, limits, preservePath }); } catch (err) { return next(err); } var appender = new FileAppender(fileStrategy, req); var isDone = false; var readFinished = false; var errorOccured = false; var pendingWrites = new Counter(); var uploadedFiles = []; function done(err) { if (isDone) return; isDone = true; req.unpipe(busboy); busboy.removeAllListeners(); next(err); } function indicateDone() { if (readFinished && pendingWrites.isZero() && !errorOccured) done(); } function abortWithError(uploadError) { if (errorOccured) return; errorOccured = true; pendingWrites.onceZero(function() { function remove(file, cb) { storage._removeFile(req, file, cb); } removeUploadedFiles(uploadedFiles, remove, function(err, storageErrors) { if (err) return done(err); uploadError.storageErrors = storageErrors; done(uploadError); }); }); } function abortWithCode(code, optionalField) { abortWithError(new MulterError(code, optionalField)); } busboy.on("field", function(fieldname, value, { nameTruncated, valueTruncated }) { if (fieldname == null) return abortWithCode("MISSING_FIELD_NAME"); if (nameTruncated) return abortWithCode("LIMIT_FIELD_KEY"); if (valueTruncated) return abortWithCode("LIMIT_FIELD_VALUE", fieldname); if (limits && Object.prototype.hasOwnProperty.call(limits, "fieldNameSize")) { if (fieldname.length > limits.fieldNameSize) return abortWithCode("LIMIT_FIELD_KEY"); } appendField(req.body, fieldname, value); }); busboy.on("file", function(fieldname, fileStream, { filename, encoding, mimeType }) { if (!filename) return fileStream.resume(); if (limits && Object.prototype.hasOwnProperty.call(limits, "fieldNameSize")) { if (fieldname.length > limits.fieldNameSize) return abortWithCode("LIMIT_FIELD_KEY"); } var file = { fieldname, originalname: filename, encoding, mimetype: mimeType }; var placeholder = appender.insertPlaceholder(file); fileFilter(req, file, function(err, includeFile) { if (err) { appender.removePlaceholder(placeholder); return abortWithError(err); } if (!includeFile) { appender.removePlaceholder(placeholder); return fileStream.resume(); } var aborting = false; pendingWrites.increment(); Object.defineProperty(file, "stream", { configurable: true, enumerable: false, value: fileStream }); fileStream.on("error", function(err2) { pendingWrites.decrement(); abortWithError(err2); }); fileStream.on("limit", function() { aborting = true; abortWithCode("LIMIT_FILE_SIZE", fieldname); }); storage._handleFile(req, file, function(err2, info) { if (aborting) { appender.removePlaceholder(placeholder); uploadedFiles.push(extend(file, info)); return pendingWrites.decrement(); } if (err2) { appender.removePlaceholder(placeholder); pendingWrites.decrement(); return abortWithError(err2); } var fileInfo = extend(file, info); appender.replacePlaceholder(placeholder, fileInfo); uploadedFiles.push(fileInfo); pendingWrites.decrement(); indicateDone(); }); }); }); busboy.on("error", function(err) { abortWithError(err); }); busboy.on("partsLimit", function() { abortWithCode("LIMIT_PART_COUNT"); }); busboy.on("filesLimit", function() { abortWithCode("LIMIT_FILE_COUNT"); }); busboy.on("fieldsLimit", function() { abortWithCode("LIMIT_FIELD_COUNT"); }); busboy.on("close", function() { readFinished = true; indicateDone(); }); req.pipe(busboy); }; } module2.exports = makeMiddleware; } }); // ../node_modules/.pnpm/mkdirp@0.5.6/node_modules/mkdirp/index.js var require_mkdirp = __commonJS({ "../node_modules/.pnpm/mkdirp@0.5.6/node_modules/mkdirp/index.js"(exports2, module2) { var path = require("path"); var fs2 = require("fs"); var _0777 = parseInt("0777", 8); module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP(p, opts, f3, made) { if (typeof opts === "function") { f3 = opts; opts = {}; } else if (!opts || typeof opts !== "object") { opts = { mode: opts }; } var mode = opts.mode; var xfs = opts.fs || fs2; if (mode === void 0) { mode = _0777; } if (!made) made = null; var cb = f3 || /* istanbul ignore next */ function() { }; p = path.resolve(p); xfs.mkdir(p, mode, function(er) { if (!er) { made = made || p; return cb(null, made); } switch (er.code) { case "ENOENT": if (path.dirname(p) === p) return cb(er); mkdirP(path.dirname(p), opts, function(er2, made2) { if (er2) cb(er2, made2); else mkdirP(p, opts, cb, made2); }); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: xfs.stat(p, function(er2, stat2) { if (er2 || !stat2.isDirectory()) cb(er, made); else cb(null, made); }); break; } }); } mkdirP.sync = function sync(p, opts, made) { if (!opts || typeof opts !== "object") { opts = { mode: opts }; } var mode = opts.mode; var xfs = opts.fs || fs2; if (mode === void 0) { mode = _0777; } if (!made) made = null; p = path.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case "ENOENT": made = sync(path.dirname(p), opts, made); sync(p, opts, made); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: var stat2; try { stat2 = xfs.statSync(p); } catch (err1) { throw err0; } if (!stat2.isDirectory()) throw err0; break; } } return made; }; } }); // ../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/storage/disk.js var require_disk = __commonJS({ "../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/storage/disk.js"(exports2, module2) { var fs2 = require("fs"); var os = require("os"); var path = require("path"); var crypto2 = require("crypto"); var mkdirp = require_mkdirp(); function getFilename(req, file, cb) { crypto2.randomBytes(16, function(err, raw) { cb(err, err ? void 0 : raw.toString("hex")); }); } function getDestination(req, file, cb) { cb(null, os.tmpdir()); } function DiskStorage(opts) { this.getFilename = opts.filename || getFilename; if (typeof opts.destination === "string") { mkdirp.sync(opts.destination); this.getDestination = function($0, $1, cb) { cb(null, opts.destination); }; } else { this.getDestination = opts.destination || getDestination; } } DiskStorage.prototype._handleFile = function _handleFile(req, file, cb) { var that = this; that.getDestination(req, file, function(err, destination) { if (err) return cb(err); that.getFilename(req, file, function(err2, filename) { if (err2) return cb(err2); var finalPath = path.join(destination, filename); var outStream = fs2.createWriteStream(finalPath); file.stream.pipe(outStream); outStream.on("error", cb); outStream.on("finish", function() { cb(null, { destination, filename, path: finalPath, size: outStream.bytesWritten }); }); }); }); }; DiskStorage.prototype._removeFile = function _removeFile(req, file, cb) { var path2 = file.path; delete file.destination; delete file.filename; delete file.path; fs2.unlink(path2, cb); }; module2.exports = function(opts) { return new DiskStorage(opts); }; } }); // ../node_modules/.pnpm/process-nextick-args@2.0.1/node_modules/process-nextick-args/index.js var require_process_nextick_args = __commonJS({ "../node_modules/.pnpm/process-nextick-args@2.0.1/node_modules/process-nextick-args/index.js"(exports2, module2) { if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) { module2.exports = { nextTick }; } else { module2.exports = process; } function nextTick(fn2, arg1, arg2, arg3) { if (typeof fn2 !== "function") { throw new TypeError('"callback" argument must be a function'); } var len = arguments.length; var args2, i2; switch (len) { case 0: case 1: return process.nextTick(fn2); case 2: return process.nextTick(function afterTickOne() { fn2.call(null, arg1); }); case 3: return process.nextTick(function afterTickTwo() { fn2.call(null, arg1, arg2); }); case 4: return process.nextTick(function afterTickThree() { fn2.call(null, arg1, arg2, arg3); }); default: args2 = new Array(len - 1); i2 = 0; while (i2 < args2.length) { args2[i2++] = arguments[i2]; } return process.nextTick(function afterTick() { fn2.apply(null, args2); }); } } } }); // ../node_modules/.pnpm/isarray@1.0.0/node_modules/isarray/index.js var require_isarray = __commonJS({ "../node_modules/.pnpm/isarray@1.0.0/node_modules/isarray/index.js"(exports2, module2) { var toString = {}.toString; module2.exports = Array.isArray || function(arr) { return toString.call(arr) == "[object Array]"; }; } }); // ../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/internal/streams/stream.js var require_stream = __commonJS({ "../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) { module2.exports = require("stream"); } }); // ../node_modules/.pnpm/safe-buffer@5.1.2/node_modules/safe-buffer/index.js var require_safe_buffer2 = __commonJS({ "../node_modules/.pnpm/safe-buffer@5.1.2/node_modules/safe-buffer/index.js"(exports2, module2) { var buffer2 = require("buffer"); var Buffer4 = buffer2.Buffer; function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { module2.exports = buffer2; } else { copyProps(buffer2, exports2); exports2.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { return Buffer4(arg, encodingOrOffset, length); } copyProps(Buffer4, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } return Buffer4(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } var buf = Buffer4(size); if (fill !== void 0) { if (typeof encoding === "string") { buf.fill(fill, encoding); } else { buf.fill(fill); } } else { buf.fill(0); } return buf; }; SafeBuffer.allocUnsafe = function(size) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } return Buffer4(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } return buffer2.SlowBuffer(size); }; } }); // ../node_modules/.pnpm/core-util-is@1.0.3/node_modules/core-util-is/lib/util.js var require_util = __commonJS({ "../node_modules/.pnpm/core-util-is@1.0.3/node_modules/core-util-is/lib/util.js"(exports2) { function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === "[object Array]"; } exports2.isArray = isArray; function isBoolean(arg) { return typeof arg === "boolean"; } exports2.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports2.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports2.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === "number"; } exports2.isNumber = isNumber; function isString(arg) { return typeof arg === "string"; } exports2.isString = isString; function isSymbol(arg) { return typeof arg === "symbol"; } exports2.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports2.isUndefined = isUndefined; function isRegExp(re) { return objectToString(re) === "[object RegExp]"; } exports2.isRegExp = isRegExp; function isObject(arg) { return typeof arg === "object" && arg !== null; } exports2.isObject = isObject; function isDate(d) { return objectToString(d) === "[object Date]"; } exports2.isDate = isDate; function isError(e2) { return objectToString(e2) === "[object Error]" || e2 instanceof Error; } exports2.isError = isError; function isFunction(arg) { return typeof arg === "function"; } exports2.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol typeof arg === "undefined"; } exports2.isPrimitive = isPrimitive; exports2.isBuffer = require("buffer").Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } } }); // ../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/internal/streams/BufferList.js var require_BufferList = __commonJS({ "../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports2, module2) { function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Buffer4 = require_safe_buffer2().Buffer; var util = require("util"); function copyBuffer(src, target, offset) { src.copy(target, offset); } module2.exports = function() { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } BufferList.prototype.push = function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry; else this.head = entry; this.tail = entry; ++this.length; }; BufferList.prototype.unshift = function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; }; BufferList.prototype.shift = function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null; else this.head = this.head.next; --this.length; return ret; }; BufferList.prototype.clear = function clear() { this.head = this.tail = null; this.length = 0; }; BufferList.prototype.join = function join(s2) { if (this.length === 0) return ""; var p = this.head; var ret = "" + p.data; while (p = p.next) { ret += s2 + p.data; } return ret; }; BufferList.prototype.concat = function concat(n) { if (this.length === 0) return Buffer4.alloc(0); var ret = Buffer4.allocUnsafe(n >>> 0); var p = this.head; var i2 = 0; while (p) { copyBuffer(p.data, ret, i2); i2 += p.data.length; p = p.next; } return ret; }; return BufferList; }(); if (util && util.inspect && util.inspect.custom) { module2.exports.prototype[util.inspect.custom] = function() { var obj = util.inspect({ length: this.length }); return this.constructor.name + " " + obj; }; } } }); // ../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/internal/streams/destroy.js var require_destroy2 = __commonJS({ "../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) { var pna = require_process_nextick_args(); function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { pna.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; pna.nextTick(emitErrorNT, this, err); } } return this; } if (this._readableState) { this._readableState.destroyed = true; } if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function(err2) { if (!cb && err2) { if (!_this._writableState) { pna.nextTick(emitErrorNT, _this, err2); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; pna.nextTick(emitErrorNT, _this, err2); } } else if (cb) { cb(err2); } }); return this; } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self2, err) { self2.emit("error", err); } module2.exports = { destroy, undestroy }; } }); // ../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js var require_node2 = __commonJS({ "../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js"(exports2, module2) { module2.exports = require("util").deprecate; } }); // ../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/_stream_writable.js var require_stream_writable = __commonJS({ "../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) { var pna = require_process_nextick_args(); module2.exports = Writable; function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function() { onCorkedFinish(_this, state); }; } var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; var Duplex; Writable.WritableState = WritableState; var util = Object.create(require_util()); util.inherits = require_inherits(); var internalUtil = { deprecate: require_node2() }; var Stream3 = require_stream(); var Buffer4 = require_safe_buffer2().Buffer; var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { }; function _uint8ArrayToBuffer(chunk) { return Buffer4.from(chunk); } function _isUint8Array(obj) { return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = require_destroy2(); util.inherits(Writable, Stream3); function nop() { } function WritableState(options, stream) { Duplex = Duplex || require_stream_duplex(); options = options || {}; var isDuplex = stream instanceof Duplex; this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; var hwm = options.highWaterMark; var writableHwm = options.writableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; if (hwm || hwm === 0) this.highWaterMark = hwm; else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm; else this.highWaterMark = defaultHwm; this.highWaterMark = Math.floor(this.highWaterMark); this.finalCalled = false; this.needDrain = false; this.ending = false; this.ended = false; this.finished = false; this.destroyed = false; var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; this.defaultEncoding = options.defaultEncoding || "utf8"; this.length = 0; this.writing = false; this.corked = 0; this.sync = true; this.bufferProcessing = false; this.onwrite = function(er) { onwrite(stream, er); }; this.writecb = null; this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; this.pendingcb = 0; this.prefinished = false; this.errorEmitted = false; this.bufferedRequestCount = 0; this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function() { try { Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate(function() { return this.getBuffer(); }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); } catch (_) { } })(); var realHasInstance; if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function(object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function(object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || require_stream_duplex(); if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { return new Writable(options); } this._writableState = new WritableState(options, this); this.writable = true; if (options) { if (typeof options.write === "function") this._write = options.write; if (typeof options.writev === "function") this._writev = options.writev; if (typeof options.destroy === "function") this._destroy = options.destroy; if (typeof options.final === "function") this._final = options.final; } Stream3.call(this); } Writable.prototype.pipe = function() { this.emit("error", new Error("Cannot pipe, not readable")); }; function writeAfterEnd(stream, cb) { var er = new Error("write after end"); stream.emit("error", er); pna.nextTick(cb, er); } function validChunk(stream, state, chunk, cb) { var valid = true; var er = false; if (chunk === null) { er = new TypeError("May not write null values to stream"); } else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { er = new TypeError("Invalid non-string/buffer chunk"); } if (er) { stream.emit("error", er); pna.nextTick(cb, er); valid = false; } return valid; } Writable.prototype.write = function(chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer4.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === "function") { cb = encoding; encoding = null; } if (isBuf) encoding = "buffer"; else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== "function") cb = nop; if (state.ended) writeAfterEnd(this, cb); else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function() { var state = this._writableState; state.corked++; }; Writable.prototype.uncork = function() { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { if (typeof encoding === "string") encoding = encoding.toLowerCase(); if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding); this._writableState.defaultEncoding = encoding; return this; }; function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") { chunk = Buffer4.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, "writableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function() { return this._writableState.highWaterMark; } }); function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = "buffer"; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk, encoding, isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (writev) stream._writev(chunk, state.onwrite); else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { pna.nextTick(cb, er); pna.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; stream.emit("error", er); } else { cb(er); stream._writableState.errorEmitted = true; stream.emit("error", er); finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb); else { var finished = needFinish(state); if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { asyncWrite(afterWrite, stream, state, finished, cb); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit("drain"); } } function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { var l = state.bufferedRequestCount; var buffer2 = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer2[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer2.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer2, "", holder.finish); state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function(chunk, encoding, cb) { cb(new Error("_write() is not implemented")); }; Writable.prototype._writev = null; Writable.prototype.end = function(chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === "function") { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === "function") { cb = encoding; encoding = null; } if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); if (state.corked) { state.corked = 1; this.uncork(); } if (!state.ending) endWritable(this, state, cb); }; function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function(err) { state.pendingcb--; if (err) { stream.emit("error", err); } state.prefinished = true; stream.emit("prefinish"); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === "function") { state.pendingcb++; state.finalCalled = true; pna.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit("prefinish"); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit("finish"); } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) pna.nextTick(cb); else stream.once("finish", cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } state.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, "destroyed", { get: function() { if (this._writableState === void 0) { return false; } return this._writableState.destroyed; }, set: function(value) { if (!this._writableState) { return; } this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function(err, cb) { this.end(); cb(err); }; } }); // ../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/_stream_duplex.js var require_stream_duplex = __commonJS({ "../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) { var pna = require_process_nextick_args(); var objectKeys = Object.keys || function(obj) { var keys2 = []; for (var key in obj) { keys2.push(key); } return keys2; }; module2.exports = Duplex; var util = Object.create(require_util()); util.inherits = require_inherits(); var Readable = require_stream_readable(); var Writable = require_stream_writable(); util.inherits(Duplex, Readable); { keys = objectKeys(Writable.prototype); for (v = 0; v < keys.length; v++) { method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } var keys; var method; var v; function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); if (options && options.readable === false) this.readable = false; if (options && options.writable === false) this.writable = false; this.allowHalfOpen = true; if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; this.once("end", onend); } Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function() { return this._writableState.highWaterMark; } }); function onend() { if (this.allowHalfOpen || this._writableState.ended) return; pna.nextTick(onEndNT, this); } function onEndNT(self2) { self2.end(); } Object.defineProperty(Duplex.prototype, "destroyed", { get: function() { if (this._readableState === void 0 || this._writableState === void 0) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function(value) { if (this._readableState === void 0 || this._writableState === void 0) { return; } this._readableState.destroyed = value; this._writableState.destroyed = value; } }); Duplex.prototype._destroy = function(err, cb) { this.push(null); this.end(); pna.nextTick(cb, err); }; } }); // ../node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js var require_string_decoder = __commonJS({ "../node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js"(exports2) { var Buffer4 = require_safe_buffer2().Buffer; var isEncoding = Buffer4.isEncoding || function(encoding) { encoding = "" + encoding; switch (encoding && encoding.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 true; default: return false; } }; function _normalizeEncoding(enc) { if (!enc) return "utf8"; var retried; while (true) { switch (enc) { case "utf8": case "utf-8": return "utf8"; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return "utf16le"; case "latin1": case "binary": return "latin1"; case "base64": case "ascii": case "hex": return enc; default: if (retried) return; enc = ("" + enc).toLowerCase(); retried = true; } } } function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== "string" && (Buffer4.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); return nenc || enc; } exports2.StringDecoder = StringDecoder; function StringDecoder(encoding) { this.encoding = normalizeEncoding(encoding); var nb; switch (this.encoding) { case "utf16le": this.text = utf16Text; this.end = utf16End; nb = 4; break; case "utf8": this.fillLast = utf8FillLast; nb = 4; break; case "base64": this.text = base64Text; this.end = base64End; nb = 3; break; default: this.write = simpleWrite; this.end = simpleEnd; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = Buffer4.allocUnsafe(nb); } StringDecoder.prototype.write = function(buf) { if (buf.length === 0) return ""; var r2; var i2; if (this.lastNeed) { r2 = this.fillLast(buf); if (r2 === void 0) return ""; i2 = this.lastNeed; this.lastNeed = 0; } else { i2 = 0; } if (i2 < buf.length) return r2 ? r2 + this.text(buf, i2) : this.text(buf, i2); return r2 || ""; }; StringDecoder.prototype.end = utf8End; StringDecoder.prototype.text = utf8Text; StringDecoder.prototype.fillLast = function(buf) { if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); this.lastNeed -= buf.length; }; function utf8CheckByte(byte) { if (byte <= 127) return 0; else if (byte >> 5 === 6) return 2; else if (byte >> 4 === 14) return 3; else if (byte >> 3 === 30) return 4; return byte >> 6 === 2 ? -1 : -2; } function utf8CheckIncomplete(self2, buf, i2) { var j = buf.length - 1; if (j < i2) return 0; var nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self2.lastNeed = nb - 1; return nb; } if (--j < i2 || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self2.lastNeed = nb - 2; return nb; } if (--j < i2 || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) { if (nb === 2) nb = 0; else self2.lastNeed = nb - 3; } return nb; } return 0; } function utf8CheckExtraBytes(self2, buf, p) { if ((buf[0] & 192) !== 128) { self2.lastNeed = 0; return "\uFFFD"; } if (self2.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 192) !== 128) { self2.lastNeed = 1; return "\uFFFD"; } if (self2.lastNeed > 2 && buf.length > 2) { if ((buf[2] & 192) !== 128) { self2.lastNeed = 2; return "\uFFFD"; } } } } function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed; var r2 = utf8CheckExtraBytes(this, buf, p); if (r2 !== void 0) return r2; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, p, 0, buf.length); this.lastNeed -= buf.length; } function utf8Text(buf, i2) { var total = utf8CheckIncomplete(this, buf, i2); if (!this.lastNeed) return buf.toString("utf8", i2); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString("utf8", i2, end); } function utf8End(buf) { var r2 = buf && buf.length ? this.write(buf) : ""; if (this.lastNeed) return r2 + "\uFFFD"; return r2; } function utf16Text(buf, i2) { if ((buf.length - i2) % 2 === 0) { var r2 = buf.toString("utf16le", i2); if (r2) { var c = r2.charCodeAt(r2.length - 1); if (c >= 55296 && c <= 56319) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; return r2.slice(0, -1); } } return r2; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = buf[buf.length - 1]; return buf.toString("utf16le", i2, buf.length - 1); } function utf16End(buf) { var r2 = buf && buf.length ? this.write(buf) : ""; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r2 + this.lastChar.toString("utf16le", 0, end); } return r2; } function base64Text(buf, i2) { var n = (buf.length - i2) % 3; if (n === 0) return buf.toString("base64", i2); this.lastNeed = 3 - n; this.lastTotal = 3; if (n === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } return buf.toString("base64", i2, buf.length - n); } function base64End(buf) { var r2 = buf && buf.length ? this.write(buf) : ""; if (this.lastNeed) return r2 + this.lastChar.toString("base64", 0, 3 - this.lastNeed); return r2; } function simpleWrite(buf) { return buf.toString(this.encoding); } function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ""; } } }); // ../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/_stream_readable.js var require_stream_readable = __commonJS({ "../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) { var pna = require_process_nextick_args(); module2.exports = Readable; var isArray = require_isarray(); var Duplex; Readable.ReadableState = ReadableState; var EE = require("events").EventEmitter; var EElistenerCount = function(emitter, type) { return emitter.listeners(type).length; }; var Stream3 = require_stream(); var Buffer4 = require_safe_buffer2().Buffer; var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { }; function _uint8ArrayToBuffer(chunk) { return Buffer4.from(chunk); } function _isUint8Array(obj) { return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; } var util = Object.create(require_util()); util.inherits = require_inherits(); var debugUtil = require("util"); var debug = void 0; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog("stream"); } else { debug = function() { }; } var BufferList = require_BufferList(); var destroyImpl = require_destroy2(); var StringDecoder; util.inherits(Readable, Stream3); var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; function prependListener(emitter, event, fn2) { if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn2); if (!emitter._events || !emitter._events[event]) emitter.on(event, fn2); else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn2); else emitter._events[event] = [fn2, emitter._events[event]]; } function ReadableState(options, stream) { Duplex = Duplex || require_stream_duplex(); options = options || {}; var isDuplex = stream instanceof Duplex; this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; var hwm = options.highWaterMark; var readableHwm = options.readableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; if (hwm || hwm === 0) this.highWaterMark = hwm; else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm; else this.highWaterMark = defaultHwm; this.highWaterMark = Math.floor(this.highWaterMark); this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; this.sync = true; this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.destroyed = false; this.defaultEncoding = options.defaultEncoding || "utf8"; this.awaitDrain = 0; this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || require_stream_duplex(); if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); this.readable = true; if (options) { if (typeof options.read === "function") this._read = options.read; if (typeof options.destroy === "function") this._destroy = options.destroy; } Stream3.call(this); } Object.defineProperty(Readable.prototype, "destroyed", { get: function() { if (this._readableState === void 0) { return false; } return this._readableState.destroyed; }, set: function(value) { if (!this._readableState) { return; } this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function(err, cb) { this.push(null); cb(err); }; Readable.prototype.push = function(chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === "string") { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer4.from(chunk, encoding); encoding = ""; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; Readable.prototype.unshift = function(chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { stream.emit("error", er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer4.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) stream.emit("error", new Error("stream.unshift() after end event")); else addChunk(stream, state, chunk, true); } else if (state.ended) { stream.emit("error", new Error("stream.push() after EOF")); } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; } } return needMoreData(state); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { stream.emit("data", chunk); stream.read(0); } else { state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { er = new TypeError("Invalid non-string/buffer chunk"); } return er; } function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } Readable.prototype.isPaused = function() { return this._readableState.flowing === false; }; Readable.prototype.setEncoding = function(enc) { if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; return this; }; var MAX_HWM = 8388608; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { if (state.flowing && state.length) return state.buffer.head.data.length; else return state.length; } if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; if (!state.ended) { state.needReadable = true; return 0; } return state.length; } Readable.prototype.read = function(n) { debug("read", n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { debug("read: emitReadable", state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this); else emitReadable(this); return null; } n = howMuchToRead(n, state); if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } var doRead = state.needReadable; debug("need readable", doRead); if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug("length less than watermark", doRead); } if (state.ended || state.reading) { doRead = false; debug("reading or ended", doRead); } else if (doRead) { debug("do read"); state.reading = true; state.sync = true; if (state.length === 0) state.needReadable = true; this._read(state.highWaterMark); state.sync = false; if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state); else ret = null; if (ret === null) { state.needReadable = true; n = 0; } else { state.length -= n; } if (state.length === 0) { if (!state.ended) state.needReadable = true; if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit("data", ret); return ret; }; function onEofChunk(stream, state) { if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; emitReadable(stream); } function emitReadable(stream) { var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug("emitReadable", state.flowing); state.emittedReadable = true; if (state.sync) pna.nextTick(emitReadable_, stream); else emitReadable_(stream); } } function emitReadable_(stream) { debug("emit readable"); stream.emit("readable"); flow(stream); } function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; pna.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { var len = state.length; while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug("maybeReadMore read 0"); stream.read(0); if (len === state.length) break; else len = state.length; } state.readingMore = false; } Readable.prototype._read = function(n) { this.emit("error", new Error("_read() is not implemented")); }; Readable.prototype.pipe = function(dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) pna.nextTick(endFn); else src.once("end", endFn); dest.on("unpipe", onunpipe); function onunpipe(readable, unpipeInfo) { debug("onunpipe"); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug("onend"); dest.end(); } var ondrain = pipeOnDrain(src); dest.on("drain", ondrain); var cleanedUp = false; function cleanup() { debug("cleanup"); dest.removeListener("close", onclose); dest.removeListener("finish", onfinish); dest.removeListener("drain", ondrain); dest.removeListener("error", onerror); dest.removeListener("unpipe", onunpipe); src.removeListener("end", onend); src.removeListener("end", unpipe); src.removeListener("data", ondata); cleanedUp = true; if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } var increasedAwaitDrain = false; src.on("data", ondata); function ondata(chunk) { debug("ondata"); increasedAwaitDrain = false; var ret = dest.write(chunk); if (false === ret && !increasedAwaitDrain) { if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug("false write response, pause", state.awaitDrain); state.awaitDrain++; increasedAwaitDrain = true; } src.pause(); } } function onerror(er) { debug("onerror", er); unpipe(); dest.removeListener("error", onerror); if (EElistenerCount(dest, "error") === 0) dest.emit("error", er); } prependListener(dest, "error", onerror); function onclose() { dest.removeListener("finish", onfinish); unpipe(); } dest.once("close", onclose); function onfinish() { debug("onfinish"); dest.removeListener("close", onclose); unpipe(); } dest.once("finish", onfinish); function unpipe() { debug("unpipe"); src.unpipe(dest); } dest.emit("pipe", src); if (!state.flowing) { debug("pipe resume"); src.resume(); } return dest; }; function pipeOnDrain(src) { return function() { var state = src._readableState; debug("pipeOnDrain", state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function(dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; if (state.pipesCount === 0) return this; if (state.pipesCount === 1) { if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit("unpipe", this, unpipeInfo); return this; } if (!dest) { var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i2 = 0; i2 < len; i2++) { dests[i2].emit("unpipe", this, { hasUnpiped: false }); } return this; } var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit("unpipe", this, unpipeInfo); return this; }; Readable.prototype.on = function(ev, fn2) { var res = Stream3.prototype.on.call(this, ev, fn2); if (ev === "data") { if (this._readableState.flowing !== false) this.resume(); } else if (ev === "readable") { var state = this._readableState; if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.emittedReadable = false; if (!state.reading) { pna.nextTick(nReadingNextTick, this); } else if (state.length) { emitReadable(this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; function nReadingNextTick(self2) { debug("readable nexttick read 0"); self2.read(0); } Readable.prototype.resume = function() { var state = this._readableState; if (!state.flowing) { debug("resume"); state.flowing = true; resume(this, state); } return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; pna.nextTick(resume_, stream, state); } } function resume_(stream, state) { if (!state.reading) { debug("resume read 0"); stream.read(0); } state.resumeScheduled = false; state.awaitDrain = 0; stream.emit("resume"); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function() { debug("call pause flowing=%j", this._readableState.flowing); if (false !== this._readableState.flowing) { debug("pause"); this._readableState.flowing = false; this.emit("pause"); } return this; }; function flow(stream) { var state = stream._readableState; debug("flow", state.flowing); while (state.flowing && stream.read() !== null) { } } Readable.prototype.wrap = function(stream) { var _this = this; var state = this._readableState; var paused = false; stream.on("end", function() { debug("wrapped end"); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on("data", function(chunk) { debug("wrapped data"); if (state.decoder) chunk = state.decoder.write(chunk); if (state.objectMode && (chunk === null || chunk === void 0)) return; else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); for (var i2 in stream) { if (this[i2] === void 0 && typeof stream[i2] === "function") { this[i2] = /* @__PURE__ */ function(method) { return function() { return stream[method].apply(stream, arguments); }; }(i2); } } for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } this._read = function(n2) { debug("wrapped _read", n2); if (paused) { paused = false; stream.resume(); } }; return this; }; Object.defineProperty(Readable.prototype, "readableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function() { return this._readableState.highWaterMark; } }); Readable._fromList = fromList; function fromList(n, state) { if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift(); else if (!n || n >= state.length) { if (state.decoder) ret = state.buffer.join(""); else if (state.buffer.length === 1) ret = state.buffer.head.data; else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { ret = fromListPartial(n, state.buffer, state.decoder); } return ret; } function fromListPartial(n, list, hasStrings) { var ret; if (n < list.head.data.length) { ret = list.head.data.slice(0, n); list.head.data = list.head.data.slice(n); } else if (n === list.head.data.length) { ret = list.shift(); } else { ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); } return ret; } function copyFromBufferString(n, list) { var p = list.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str; else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) list.head = p.next; else list.head = list.tail = null; } else { list.head = p; p.data = str.slice(nb); } break; } ++c; } list.length -= c; return ret; } function copyFromBuffer(n, list) { var ret = Buffer4.allocUnsafe(n); var p = list.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) list.head = p.next; else list.head = list.tail = null; } else { list.head = p; p.data = buf.slice(nb); } break; } ++c; } list.length -= c; return ret; } function endReadable(stream) { var state = stream._readableState; if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); if (!state.endEmitted) { state.ended = true; pna.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit("end"); } } function indexOf(xs, x2) { for (var i2 = 0, l = xs.length; i2 < l; i2++) { if (xs[i2] === x2) return i2; } return -1; } } }); // ../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/_stream_transform.js var require_stream_transform = __commonJS({ "../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/_stream_transform.js"(exports2, module2) { module2.exports = Transform; var Duplex = require_stream_duplex(); var util = Object.create(require_util()); util.inherits = require_inherits(); util.inherits(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (!cb) { return this.emit("error", new Error("write callback called multiple times")); } ts.writechunk = null; ts.writecb = null; if (data != null) this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; this._readableState.needReadable = true; this._readableState.sync = false; if (options) { if (typeof options.transform === "function") this._transform = options.transform; if (typeof options.flush === "function") this._flush = options.flush; } this.on("prefinish", prefinish); } function prefinish() { var _this = this; if (typeof this._flush === "function") { this._flush(function(er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function(chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; Transform.prototype._transform = function(chunk, encoding, cb) { throw new Error("_transform() is not implemented"); }; Transform.prototype._write = function(chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; Transform.prototype._read = function(n) { var ts = this._transformState; if (ts.writechunk !== null && ts.writecb && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { ts.needTransform = true; } }; Transform.prototype._destroy = function(err, cb) { var _this2 = this; Duplex.prototype._destroy.call(this, err, function(err2) { cb(err2); _this2.emit("close"); }); }; function done(stream, er, data) { if (er) return stream.emit("error", er); if (data != null) stream.push(data); if (stream._writableState.length) throw new Error("Calling transform done when ws.length != 0"); if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming"); return stream.push(null); } } }); // ../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/_stream_passthrough.js var require_stream_passthrough = __commonJS({ "../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/lib/_stream_passthrough.js"(exports2, module2) { module2.exports = PassThrough3; var Transform = require_stream_transform(); var util = Object.create(require_util()); util.inherits = require_inherits(); util.inherits(PassThrough3, Transform); function PassThrough3(options) { if (!(this instanceof PassThrough3)) return new PassThrough3(options); Transform.call(this, options); } PassThrough3.prototype._transform = function(chunk, encoding, cb) { cb(null, chunk); }; } }); // ../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/readable.js var require_readable = __commonJS({ "../node_modules/.pnpm/readable-stream@2.3.8/node_modules/readable-stream/readable.js"(exports2, module2) { var Stream3 = require("stream"); if (process.env.READABLE_STREAM === "disable" && Stream3) { module2.exports = Stream3; exports2 = module2.exports = Stream3.Readable; exports2.Readable = Stream3.Readable; exports2.Writable = Stream3.Writable; exports2.Duplex = Stream3.Duplex; exports2.Transform = Stream3.Transform; exports2.PassThrough = Stream3.PassThrough; exports2.Stream = Stream3; } else { exports2 = module2.exports = require_stream_readable(); exports2.Stream = Stream3 || exports2; exports2.Readable = exports2; exports2.Writable = require_stream_writable(); exports2.Duplex = require_stream_duplex(); exports2.Transform = require_stream_transform(); exports2.PassThrough = require_stream_passthrough(); } } }); // ../node_modules/.pnpm/buffer-from@1.1.2/node_modules/buffer-from/index.js var require_buffer_from = __commonJS({ "../node_modules/.pnpm/buffer-from@1.1.2/node_modules/buffer-from/index.js"(exports2, module2) { var toString = Object.prototype.toString; var isModern = typeof Buffer !== "undefined" && typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function"; function isArrayBuffer(input) { return toString.call(input).slice(8, -1) === "ArrayBuffer"; } function fromArrayBuffer(obj, byteOffset, length) { byteOffset >>>= 0; var maxLength = obj.byteLength - byteOffset; if (maxLength < 0) { throw new RangeError("'offset' is out of bounds"); } if (length === void 0) { length = maxLength; } else { length >>>= 0; if (length > maxLength) { throw new RangeError("'length' is out of bounds"); } } return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))); } function fromString(string, encoding) { if (typeof encoding !== "string" || encoding === "") { encoding = "utf8"; } if (!Buffer.isEncoding(encoding)) { throw new TypeError('"encoding" must be a valid string encoding'); } return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding); } function bufferFrom(value, encodingOrOffset, length) { if (typeof value === "number") { throw new TypeError('"value" argument must not be a number'); } if (isArrayBuffer(value)) { return fromArrayBuffer(value, encodingOrOffset, length); } if (typeof value === "string") { return fromString(value, encodingOrOffset); } return isModern ? Buffer.from(value) : new Buffer(value); } module2.exports = bufferFrom; } }); // ../node_modules/.pnpm/typedarray@0.0.6/node_modules/typedarray/index.js var require_typedarray = __commonJS({ "../node_modules/.pnpm/typedarray@0.0.6/node_modules/typedarray/index.js"(exports2) { var undefined2 = void 0; var MAX_ARRAY_LENGTH = 1e5; var ECMAScript = /* @__PURE__ */ function() { var opts = Object.prototype.toString, ophop = Object.prototype.hasOwnProperty; return { // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues: Class: function(v) { return opts.call(v).replace(/^\[object *|\]$/g, ""); }, HasProperty: function(o, p) { return p in o; }, HasOwnProperty: function(o, p) { return ophop.call(o, p); }, IsCallable: function(o) { return typeof o === "function"; }, ToInt32: function(v) { return v >> 0; }, ToUint32: function(v) { return v >>> 0; } }; }(); var LN2 = Math.LN2; var abs = Math.abs; var floor = Math.floor; var log2 = Math.log; var min = Math.min; var pow = Math.pow; var round = Math.round; function configureProperties(obj) { if (getOwnPropNames && defineProp) { var props = getOwnPropNames(obj), i2; for (i2 = 0; i2 < props.length; i2 += 1) { defineProp(obj, props[i2], { value: obj[props[i2]], writable: false, enumerable: false, configurable: false }); } } } var defineProp; if (Object.defineProperty && function() { try { Object.defineProperty({}, "x", {}); return true; } catch (e2) { return false; } }()) { defineProp = Object.defineProperty; } else { defineProp = function(o, p, desc) { if (!o === Object(o)) throw new TypeError("Object.defineProperty called on non-object"); if (ECMAScript.HasProperty(desc, "get") && Object.prototype.__defineGetter__) { Object.prototype.__defineGetter__.call(o, p, desc.get); } if (ECMAScript.HasProperty(desc, "set") && Object.prototype.__defineSetter__) { Object.prototype.__defineSetter__.call(o, p, desc.set); } if (ECMAScript.HasProperty(desc, "value")) { o[p] = desc.value; } return o; }; } var getOwnPropNames = Object.getOwnPropertyNames || function(o) { if (o !== Object(o)) throw new TypeError("Object.getOwnPropertyNames called on non-object"); var props = [], p; for (p in o) { if (ECMAScript.HasOwnProperty(o, p)) { props.push(p); } } return props; }; function makeArrayAccessors(obj) { if (!defineProp) { return; } if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError("Array too large for polyfill"); function makeArrayAccessor(index) { defineProp(obj, index, { "get": function() { return obj._getter(index); }, "set": function(v) { obj._setter(index, v); }, enumerable: true, configurable: false }); } var i2; for (i2 = 0; i2 < obj.length; i2 += 1) { makeArrayAccessor(i2); } } function as_signed(value, bits) { var s2 = 32 - bits; return value << s2 >> s2; } function as_unsigned(value, bits) { var s2 = 32 - bits; return value << s2 >>> s2; } function packI8(n) { return [n & 255]; } function unpackI8(bytes) { return as_signed(bytes[0], 8); } function packU8(n) { return [n & 255]; } function unpackU8(bytes) { return as_unsigned(bytes[0], 8); } function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 255 ? 255 : n & 255]; } function packI16(n) { return [n >> 8 & 255, n & 255]; } function unpackI16(bytes) { return as_signed(bytes[0] << 8 | bytes[1], 16); } function packU16(n) { return [n >> 8 & 255, n & 255]; } function unpackU16(bytes) { return as_unsigned(bytes[0] << 8 | bytes[1], 16); } function packI32(n) { return [n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255]; } function unpackI32(bytes) { return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } function packU32(n) { return [n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255]; } function unpackU32(bytes) { return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } function packIEEE754(v, ebits, fbits) { var bias = (1 << ebits - 1) - 1, s2, e2, f3, ln, i2, bits, str, bytes; function roundToEven(n) { var w = floor(n), f4 = n - w; if (f4 < 0.5) return w; if (f4 > 0.5) return w + 1; return w % 2 ? w + 1 : w; } if (v !== v) { e2 = (1 << ebits) - 1; f3 = pow(2, fbits - 1); s2 = 0; } else if (v === Infinity || v === -Infinity) { e2 = (1 << ebits) - 1; f3 = 0; s2 = v < 0 ? 1 : 0; } else if (v === 0) { e2 = 0; f3 = 0; s2 = 1 / v === -Infinity ? 1 : 0; } else { s2 = v < 0; v = abs(v); if (v >= pow(2, 1 - bias)) { e2 = min(floor(log2(v) / LN2), 1023); f3 = roundToEven(v / pow(2, e2) * pow(2, fbits)); if (f3 / pow(2, fbits) >= 2) { e2 = e2 + 1; f3 = 1; } if (e2 > bias) { e2 = (1 << ebits) - 1; f3 = 0; } else { e2 = e2 + bias; f3 = f3 - pow(2, fbits); } } else { e2 = 0; f3 = roundToEven(v / pow(2, 1 - bias - fbits)); } } bits = []; for (i2 = fbits; i2; i2 -= 1) { bits.push(f3 % 2 ? 1 : 0); f3 = floor(f3 / 2); } for (i2 = ebits; i2; i2 -= 1) { bits.push(e2 % 2 ? 1 : 0); e2 = floor(e2 / 2); } bits.push(s2 ? 1 : 0); bits.reverse(); str = bits.join(""); bytes = []; while (str.length) { bytes.push(parseInt(str.substring(0, 8), 2)); str = str.substring(8); } return bytes; } function unpackIEEE754(bytes, ebits, fbits) { var bits = [], i2, j, b, str, bias, s2, e2, f3; for (i2 = bytes.length; i2; i2 -= 1) { b = bytes[i2 - 1]; for (j = 8; j; j -= 1) { bits.push(b % 2 ? 1 : 0); b = b >> 1; } } bits.reverse(); str = bits.join(""); bias = (1 << ebits - 1) - 1; s2 = parseInt(str.substring(0, 1), 2) ? -1 : 1; e2 = parseInt(str.substring(1, 1 + ebits), 2); f3 = parseInt(str.substring(1 + ebits), 2); if (e2 === (1 << ebits) - 1) { return f3 !== 0 ? NaN : s2 * Infinity; } else if (e2 > 0) { return s2 * pow(2, e2 - bias) * (1 + f3 / pow(2, fbits)); } else if (f3 !== 0) { return s2 * pow(2, -(bias - 1)) * (f3 / pow(2, fbits)); } else { return s2 < 0 ? -0 : 0; } } function unpackF64(b) { return unpackIEEE754(b, 11, 52); } function packF64(v) { return packIEEE754(v, 11, 52); } function unpackF32(b) { return unpackIEEE754(b, 8, 23); } function packF32(v) { return packIEEE754(v, 8, 23); } (function() { var ArrayBuffer2 = function ArrayBuffer3(length) { length = ECMAScript.ToInt32(length); if (length < 0) throw new RangeError("ArrayBuffer size is not a small enough positive integer"); this.byteLength = length; this._bytes = []; this._bytes.length = length; var i2; for (i2 = 0; i2 < this.byteLength; i2 += 1) { this._bytes[i2] = 0; } configureProperties(this); }; exports2.ArrayBuffer = exports2.ArrayBuffer || ArrayBuffer2; var ArrayBufferView = function ArrayBufferView2() { }; function makeConstructor(bytesPerElement, pack, unpack) { var ctor; ctor = function(buffer2, byteOffset, length) { var array, sequence, i2, s2; if (!arguments.length || typeof arguments[0] === "number") { this.length = ECMAScript.ToInt32(arguments[0]); if (length < 0) throw new RangeError("ArrayBufferView size is not a small enough positive integer"); this.byteLength = this.length * this.BYTES_PER_ELEMENT; this.buffer = new ArrayBuffer2(this.byteLength); this.byteOffset = 0; } else if (typeof arguments[0] === "object" && arguments[0].constructor === ctor) { array = arguments[0]; this.length = array.length; this.byteLength = this.length * this.BYTES_PER_ELEMENT; this.buffer = new ArrayBuffer2(this.byteLength); this.byteOffset = 0; for (i2 = 0; i2 < this.length; i2 += 1) { this._setter(i2, array._getter(i2)); } } else if (typeof arguments[0] === "object" && !(arguments[0] instanceof ArrayBuffer2 || ECMAScript.Class(arguments[0]) === "ArrayBuffer")) { sequence = arguments[0]; this.length = ECMAScript.ToUint32(sequence.length); this.byteLength = this.length * this.BYTES_PER_ELEMENT; this.buffer = new ArrayBuffer2(this.byteLength); this.byteOffset = 0; for (i2 = 0; i2 < this.length; i2 += 1) { s2 = sequence[i2]; this._setter(i2, Number(s2)); } } else if (typeof arguments[0] === "object" && (arguments[0] instanceof ArrayBuffer2 || ECMAScript.Class(arguments[0]) === "ArrayBuffer")) { this.buffer = buffer2; this.byteOffset = ECMAScript.ToUint32(byteOffset); if (this.byteOffset > this.buffer.byteLength) { throw new RangeError("byteOffset out of range"); } if (this.byteOffset % this.BYTES_PER_ELEMENT) { throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size."); } if (arguments.length < 3) { this.byteLength = this.buffer.byteLength - this.byteOffset; if (this.byteLength % this.BYTES_PER_ELEMENT) { throw new RangeError("length of buffer minus byteOffset not a multiple of the element size"); } this.length = this.byteLength / this.BYTES_PER_ELEMENT; } else { this.length = ECMAScript.ToUint32(length); this.byteLength = this.length * this.BYTES_PER_ELEMENT; } if (this.byteOffset + this.byteLength > this.buffer.byteLength) { throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); } } else { throw new TypeError("Unexpected argument type(s)"); } this.constructor = ctor; configureProperties(this); makeArrayAccessors(this); }; ctor.prototype = new ArrayBufferView(); ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement; ctor.prototype._pack = pack; ctor.prototype._unpack = unpack; ctor.BYTES_PER_ELEMENT = bytesPerElement; ctor.prototype._getter = function(index) { if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); index = ECMAScript.ToUint32(index); if (index >= this.length) { return undefined2; } var bytes = [], i2, o; for (i2 = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i2 < this.BYTES_PER_ELEMENT; i2 += 1, o += 1) { bytes.push(this.buffer._bytes[o]); } return this._unpack(bytes); }; ctor.prototype.get = ctor.prototype._getter; ctor.prototype._setter = function(index, value) { if (arguments.length < 2) throw new SyntaxError("Not enough arguments"); index = ECMAScript.ToUint32(index); if (index >= this.length) { return undefined2; } var bytes = this._pack(value), i2, o; for (i2 = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i2 < this.BYTES_PER_ELEMENT; i2 += 1, o += 1) { this.buffer._bytes[o] = bytes[i2]; } }; ctor.prototype.set = function(index, value) { if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); var array, sequence, offset, len, i2, s2, d, byteOffset, byteLength, tmp; if (typeof arguments[0] === "object" && arguments[0].constructor === this.constructor) { array = arguments[0]; offset = ECMAScript.ToUint32(arguments[1]); if (offset + array.length > this.length) { throw new RangeError("Offset plus length of array is out of range"); } byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT; byteLength = array.length * this.BYTES_PER_ELEMENT; if (array.buffer === this.buffer) { tmp = []; for (i2 = 0, s2 = array.byteOffset; i2 < byteLength; i2 += 1, s2 += 1) { tmp[i2] = array.buffer._bytes[s2]; } for (i2 = 0, d = byteOffset; i2 < byteLength; i2 += 1, d += 1) { this.buffer._bytes[d] = tmp[i2]; } } else { for (i2 = 0, s2 = array.byteOffset, d = byteOffset; i2 < byteLength; i2 += 1, s2 += 1, d += 1) { this.buffer._bytes[d] = array.buffer._bytes[s2]; } } } else if (typeof arguments[0] === "object" && typeof arguments[0].length !== "undefined") { sequence = arguments[0]; len = ECMAScript.ToUint32(sequence.length); offset = ECMAScript.ToUint32(arguments[1]); if (offset + len > this.length) { throw new RangeError("Offset plus length of array is out of range"); } for (i2 = 0; i2 < len; i2 += 1) { s2 = sequence[i2]; this._setter(offset + i2, Number(s2)); } } else { throw new TypeError("Unexpected argument type(s)"); } }; ctor.prototype.subarray = function(start, end) { function clamp(v, min2, max) { return v < min2 ? min2 : v > max ? max : v; } start = ECMAScript.ToInt32(start); end = ECMAScript.ToInt32(end); if (arguments.length < 1) { start = 0; } if (arguments.length < 2) { end = this.length; } if (start < 0) { start = this.length + start; } if (end < 0) { end = this.length + end; } start = clamp(start, 0, this.length); end = clamp(end, 0, this.length); var len = end - start; if (len < 0) { len = 0; } return new this.constructor( this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len ); }; return ctor; } var Int8Array2 = makeConstructor(1, packI8, unpackI8); var Uint8Array2 = makeConstructor(1, packU8, unpackU8); var Uint8ClampedArray2 = makeConstructor(1, packU8Clamped, unpackU8); var Int16Array2 = makeConstructor(2, packI16, unpackI16); var Uint16Array2 = makeConstructor(2, packU16, unpackU16); var Int32Array2 = makeConstructor(4, packI32, unpackI32); var Uint32Array2 = makeConstructor(4, packU32, unpackU32); var Float32Array2 = makeConstructor(4, packF32, unpackF32); var Float64Array2 = makeConstructor(8, packF64, unpackF64); exports2.Int8Array = exports2.Int8Array || Int8Array2; exports2.Uint8Array = exports2.Uint8Array || Uint8Array2; exports2.Uint8ClampedArray = exports2.Uint8ClampedArray || Uint8ClampedArray2; exports2.Int16Array = exports2.Int16Array || Int16Array2; exports2.Uint16Array = exports2.Uint16Array || Uint16Array2; exports2.Int32Array = exports2.Int32Array || Int32Array2; exports2.Uint32Array = exports2.Uint32Array || Uint32Array2; exports2.Float32Array = exports2.Float32Array || Float32Array2; exports2.Float64Array = exports2.Float64Array || Float64Array2; })(); (function() { function r2(array, index) { return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index]; } var IS_BIG_ENDIAN = function() { var u16array = new exports2.Uint16Array([4660]), u8array = new exports2.Uint8Array(u16array.buffer); return r2(u8array, 0) === 18; }(); var DataView2 = function DataView3(buffer2, byteOffset, byteLength) { if (arguments.length === 0) { buffer2 = new exports2.ArrayBuffer(0); } else if (!(buffer2 instanceof exports2.ArrayBuffer || ECMAScript.Class(buffer2) === "ArrayBuffer")) { throw new TypeError("TypeError"); } this.buffer = buffer2 || new exports2.ArrayBuffer(0); this.byteOffset = ECMAScript.ToUint32(byteOffset); if (this.byteOffset > this.buffer.byteLength) { throw new RangeError("byteOffset out of range"); } if (arguments.length < 3) { this.byteLength = this.buffer.byteLength - this.byteOffset; } else { this.byteLength = ECMAScript.ToUint32(byteLength); } if (this.byteOffset + this.byteLength > this.buffer.byteLength) { throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); } configureProperties(this); }; function makeGetter(arrayType) { return function(byteOffset, littleEndian) { byteOffset = ECMAScript.ToUint32(byteOffset); if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { throw new RangeError("Array index out of range"); } byteOffset += this.byteOffset; var uint8Array = new exports2.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), bytes = [], i2; for (i2 = 0; i2 < arrayType.BYTES_PER_ELEMENT; i2 += 1) { bytes.push(r2(uint8Array, i2)); } if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { bytes.reverse(); } return r2(new arrayType(new exports2.Uint8Array(bytes).buffer), 0); }; } DataView2.prototype.getUint8 = makeGetter(exports2.Uint8Array); DataView2.prototype.getInt8 = makeGetter(exports2.Int8Array); DataView2.prototype.getUint16 = makeGetter(exports2.Uint16Array); DataView2.prototype.getInt16 = makeGetter(exports2.Int16Array); DataView2.prototype.getUint32 = makeGetter(exports2.Uint32Array); DataView2.prototype.getInt32 = makeGetter(exports2.Int32Array); DataView2.prototype.getFloat32 = makeGetter(exports2.Float32Array); DataView2.prototype.getFloat64 = makeGetter(exports2.Float64Array); function makeSetter(arrayType) { return function(byteOffset, value, littleEndian) { byteOffset = ECMAScript.ToUint32(byteOffset); if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { throw new RangeError("Array index out of range"); } var typeArray = new arrayType([value]), byteArray = new exports2.Uint8Array(typeArray.buffer), bytes = [], i2, byteView; for (i2 = 0; i2 < arrayType.BYTES_PER_ELEMENT; i2 += 1) { bytes.push(r2(byteArray, i2)); } if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { bytes.reverse(); } byteView = new exports2.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT); byteView.set(bytes); }; } DataView2.prototype.setUint8 = makeSetter(exports2.Uint8Array); DataView2.prototype.setInt8 = makeSetter(exports2.Int8Array); DataView2.prototype.setUint16 = makeSetter(exports2.Uint16Array); DataView2.prototype.setInt16 = makeSetter(exports2.Int16Array); DataView2.prototype.setUint32 = makeSetter(exports2.Uint32Array); DataView2.prototype.setInt32 = makeSetter(exports2.Int32Array); DataView2.prototype.setFloat32 = makeSetter(exports2.Float32Array); DataView2.prototype.setFloat64 = makeSetter(exports2.Float64Array); exports2.DataView = exports2.DataView || DataView2; })(); } }); // ../node_modules/.pnpm/concat-stream@1.6.2/node_modules/concat-stream/index.js var require_concat_stream = __commonJS({ "../node_modules/.pnpm/concat-stream@1.6.2/node_modules/concat-stream/index.js"(exports2, module2) { var Writable = require_readable().Writable; var inherits = require_inherits(); var bufferFrom = require_buffer_from(); if (typeof Uint8Array === "undefined") { U8 = require_typedarray().Uint8Array; } else { U8 = Uint8Array; } var U8; function ConcatStream(opts, cb) { if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb); if (typeof opts === "function") { cb = opts; opts = {}; } if (!opts) opts = {}; var encoding = opts.encoding; var shouldInferEncoding = false; if (!encoding) { shouldInferEncoding = true; } else { encoding = String(encoding).toLowerCase(); if (encoding === "u8" || encoding === "uint8") { encoding = "uint8array"; } } Writable.call(this, { objectMode: true }); this.encoding = encoding; this.shouldInferEncoding = shouldInferEncoding; if (cb) this.on("finish", function() { cb(this.getBody()); }); this.body = []; } module2.exports = ConcatStream; inherits(ConcatStream, Writable); ConcatStream.prototype._write = function(chunk, enc, next) { this.body.push(chunk); next(); }; ConcatStream.prototype.inferEncoding = function(buff) { var firstBuffer = buff === void 0 ? this.body[0] : buff; if (Buffer.isBuffer(firstBuffer)) return "buffer"; if (typeof Uint8Array !== "undefined" && firstBuffer instanceof Uint8Array) return "uint8array"; if (Array.isArray(firstBuffer)) return "array"; if (typeof firstBuffer === "string") return "string"; if (Object.prototype.toString.call(firstBuffer) === "[object Object]") return "object"; return "buffer"; }; ConcatStream.prototype.getBody = function() { if (!this.encoding && this.body.length === 0) return []; if (this.shouldInferEncoding) this.encoding = this.inferEncoding(); if (this.encoding === "array") return arrayConcat(this.body); if (this.encoding === "string") return stringConcat(this.body); if (this.encoding === "buffer") return bufferConcat(this.body); if (this.encoding === "uint8array") return u8Concat(this.body); return this.body; }; var isArray = Array.isArray || function(arr) { return Object.prototype.toString.call(arr) == "[object Array]"; }; function isArrayish(arr) { return /Array\]$/.test(Object.prototype.toString.call(arr)); } function isBufferish(p) { return typeof p === "string" || isArrayish(p) || p && typeof p.subarray === "function"; } function stringConcat(parts) { var strings = []; var needsToString = false; for (var i2 = 0; i2 < parts.length; i2++) { var p = parts[i2]; if (typeof p === "string") { strings.push(p); } else if (Buffer.isBuffer(p)) { strings.push(p); } else if (isBufferish(p)) { strings.push(bufferFrom(p)); } else { strings.push(bufferFrom(String(p))); } } if (Buffer.isBuffer(parts[0])) { strings = Buffer.concat(strings); strings = strings.toString("utf8"); } else { strings = strings.join(""); } return strings; } function bufferConcat(parts) { var bufs = []; for (var i2 = 0; i2 < parts.length; i2++) { var p = parts[i2]; if (Buffer.isBuffer(p)) { bufs.push(p); } else if (isBufferish(p)) { bufs.push(bufferFrom(p)); } else { bufs.push(bufferFrom(String(p))); } } return Buffer.concat(bufs); } function arrayConcat(parts) { var res = []; for (var i2 = 0; i2 < parts.length; i2++) { res.push.apply(res, parts[i2]); } return res; } function u8Concat(parts) { var len = 0; for (var i2 = 0; i2 < parts.length; i2++) { if (typeof parts[i2] === "string") { parts[i2] = bufferFrom(parts[i2]); } len += parts[i2].length; } var u8 = new U8(len); for (var i2 = 0, offset = 0; i2 < parts.length; i2++) { var part = parts[i2]; for (var j = 0; j < part.length; j++) { u8[offset++] = part[j]; } } return u8; } } }); // ../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/storage/memory.js var require_memory = __commonJS({ "../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/storage/memory.js"(exports2, module2) { var concat = require_concat_stream(); function MemoryStorage(opts) { } MemoryStorage.prototype._handleFile = function _handleFile(req, file, cb) { file.stream.pipe(concat({ encoding: "buffer" }, function(data) { cb(null, { buffer: data, size: data.length }); })); }; MemoryStorage.prototype._removeFile = function _removeFile(req, file, cb) { delete file.buffer; cb(null); }; module2.exports = function(opts) { return new MemoryStorage(opts); }; } }); // ../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/index.js var require_multer = __commonJS({ "../node_modules/.pnpm/multer@1.4.5-lts.1/node_modules/multer/index.js"(exports2, module2) { var makeMiddleware = require_make_middleware(); var diskStorage = require_disk(); var memoryStorage = require_memory(); var MulterError = require_multer_error(); function allowAll(req, file, cb) { cb(null, true); } function Multer2(options) { if (options.storage) { this.storage = options.storage; } else if (options.dest) { this.storage = diskStorage({ destination: options.dest }); } else { this.storage = memoryStorage(); } this.limits = options.limits; this.preservePath = options.preservePath; this.fileFilter = options.fileFilter || allowAll; } Multer2.prototype._makeMiddleware = function(fields, fileStrategy) { function setup() { var fileFilter = this.fileFilter; var filesLeft = /* @__PURE__ */ Object.create(null); fields.forEach(function(field) { if (typeof field.maxCount === "number") { filesLeft[field.name] = field.maxCount; } else { filesLeft[field.name] = Infinity; } }); function wrappedFileFilter(req, file, cb) { if ((filesLeft[file.fieldname] || 0) <= 0) { return cb(new MulterError("LIMIT_UNEXPECTED_FILE", file.fieldname)); } filesLeft[file.fieldname] -= 1; fileFilter(req, file, cb); } return { limits: this.limits, preservePath: this.preservePath, storage: this.storage, fileFilter: wrappedFileFilter, fileStrategy }; } return makeMiddleware(setup.bind(this)); }; Multer2.prototype.single = function(name) { return this._makeMiddleware([{ name, maxCount: 1 }], "VALUE"); }; Multer2.prototype.array = function(name, maxCount) { return this._makeMiddleware([{ name, maxCount }], "ARRAY"); }; Multer2.prototype.fields = function(fields) { return this._makeMiddleware(fields, "OBJECT"); }; Multer2.prototype.none = function() { return this._makeMiddleware([], "NONE"); }; Multer2.prototype.any = function() { function setup() { return { limits: this.limits, preservePath: this.preservePath, storage: this.storage, fileFilter: this.fileFilter, fileStrategy: "ARRAY" }; } return makeMiddleware(setup.bind(this)); }; function multer2(options) { if (options === void 0) { return new Multer2({}); } if (typeof options === "object" && options !== null) { return new Multer2(options); } throw new TypeError("Expected object for argument options"); } module2.exports = multer2; module2.exports.diskStorage = diskStorage; module2.exports.memoryStorage = memoryStorage; module2.exports.MulterError = MulterError; } }); // ../node_modules/.pnpm/@citizenfx+http-wrapper@0.2.2/node_modules/@citizenfx/http-wrapper/index.js var require_http_wrapper = __commonJS({ "../node_modules/.pnpm/@citizenfx+http-wrapper@0.2.2/node_modules/@citizenfx/http-wrapper/index.js"(exports2, module2) { var { Readable, Writable } = require("stream"); var http3 = require("http"); var objectify = (obj, [k, v]) => ({ ...obj, [k]: v }); var IncomingMessage = class extends Readable { constructor(cfxReq, cfxRes) { super(); this.headers = Object.entries(cfxReq.headers).map(([k, v]) => [k.toLowerCase(), v]).reduce(objectify, {}); this.httpVersion = "1.1"; this.httpVersionMajor = 1; this.httpVersionMinor = 1; this.method = cfxReq.method; this.rawHeaders = Object.entries(this.headers).flatMap((x2) => x2); this.rawTrailers = []; this.setTimeout = (ms, cb) => { global.setTimeout(cb, ms); return this; }; this.trailers = {}; this.url = cfxReq.path; this.aborted = false; try { let addrParts = cfxReq.address.split(":"); if (addrParts.length != 2 || !addrParts[0].length || !addrParts[1].length) { throw new Error("Invalid IP:PORT"); } this.connection = { remoteAddress: addrParts[0], remotePort: addrParts[1] }; } catch (error) { console.error(`requestHandler parsing ip:port error: ${error.message}`); this.connection = { remoteAddress: "0.0.0.0", remotePort: 0 }; } this.socket = this.connection; cfxReq.setDataHandler((data) => { if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) { this.push(Buffer.from(data)); } else { this.push(data, "utf8"); } this.push(null); }, "binary"); } _read(len) { } destroy(err) { } }; var ServerResponse = class extends Writable { constructor(cfxReq, cfxRes) { super(); this.cfxReq = cfxReq; this.cfxRes = cfxRes; this.connection = { remoteAddress: cfxReq.address, remotePort: 0, writable: true, on(...args2) { } }; this.socket = this.connection; this.finished = false; this.headersSent = false; this.sendDate = true; this.statusCode = 200; this.statusMessage = "OK"; this.headers = {}; } addTrailers(headers) { } end(chunk, encoding, callback) { if (this.finished) { return; } if (typeof chunk === "function") { callback = chunk; chunk = null; } else if (typeof encoding === "function") { callback = encoding; encoding = null; } if (chunk) { this.write(chunk, encoding); } this.cfxRes.send(); if (callback) { callback(); } this.finished = true; this.cfxReq = null; this.cfxRes = null; } getHeader(name) { return this.headers[name.toLowerCase()]; } getHeaderNames() { return Object.entries(this.headers).map(([name]) => name); } getHeaders() { return Object.assign({}, this.headers); } hasHeader(name) { return this.headers[name.toLowerCase()] !== void 0; } removeHeader(name) { delete this.headers[name.toLowerCase()]; } setHeader(name, value) { this.headers[name.toLowerCase()] = value; } setTimeout(ms, cb) { } _write(chunk, encoding, callback) { if (!this.headersSent) { this.writeHead(this.statusCode, this.statusMessage, this.headers); } this.cfxRes.write(chunk.buffer.slice(chunk.byteOffset, chunk.byteOffset + chunk.byteLength)); callback(); } writeContinue() { } writeHead(statusCode, reason, obj) { if (this.headersSent) { return; } this.headersSent = true; var originalStatusCode = statusCode; statusCode |= 0; if (statusCode < 100 || statusCode > 999) { throw new Error(`invalid status code ${originalStatusCode}`); } if (typeof reason === "string") { this.statusMessage = reason; } else { if (!this.statusMessage) this.statusMessage = http3.STATUS_CODES[statusCode] || "unknown"; obj = reason; } this.statusCode = statusCode; let headers; if (this._headers) { var k; if (obj) { var keys = Object.keys(obj); for (var i2 = 0; i2 < keys.length; i2++) { k = keys[i2]; if (k) this.setHeader(k, obj[k]); } } if (k === void 0 && this._header) { throw new Error(`invalid header`); } headers = this._headers; } else { headers = obj; } const headerList = {}; for (const [key, value] of Object.entries(headers)) { if (Array.isArray(value)) { headerList[key] = value.map((a) => a.toString()); } else { headerList[key] = value.toString(); } } this.cfxRes.writeHead(this.statusCode, headerList); } _final(callback) { } }; var setHttpCallback2 = (requestHandler) => { global.SetHttpHandler((req, res) => { requestHandler(new IncomingMessage(req, res), new ServerResponse(req, res)); }); }; module2.exports.IncomingMessage = IncomingMessage; module2.exports.ServerResponse = ServerResponse; module2.exports.setHttpCallback = setHttpCallback2; } }); // ../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js var require_delayed_stream = __commonJS({ "../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js"(exports2, module2) { var Stream3 = require("stream").Stream; var util = require("util"); module2.exports = DelayedStream; function DelayedStream() { this.source = null; this.dataSize = 0; this.maxDataSize = 1024 * 1024; this.pauseStream = true; this._maxDataSizeExceeded = false; this._released = false; this._bufferedEvents = []; } util.inherits(DelayedStream, Stream3); DelayedStream.create = function(source, options) { var delayedStream = new this(); options = options || {}; for (var option in options) { delayedStream[option] = options[option]; } delayedStream.source = source; var realEmit = source.emit; source.emit = function() { delayedStream._handleEmit(arguments); return realEmit.apply(source, arguments); }; source.on("error", function() { }); if (delayedStream.pauseStream) { source.pause(); } return delayedStream; }; Object.defineProperty(DelayedStream.prototype, "readable", { configurable: true, enumerable: true, get: function() { return this.source.readable; } }); DelayedStream.prototype.setEncoding = function() { return this.source.setEncoding.apply(this.source, arguments); }; DelayedStream.prototype.resume = function() { if (!this._released) { this.release(); } this.source.resume(); }; DelayedStream.prototype.pause = function() { this.source.pause(); }; DelayedStream.prototype.release = function() { this._released = true; this._bufferedEvents.forEach(function(args2) { this.emit.apply(this, args2); }.bind(this)); this._bufferedEvents = []; }; DelayedStream.prototype.pipe = function() { var r2 = Stream3.prototype.pipe.apply(this, arguments); this.resume(); return r2; }; DelayedStream.prototype._handleEmit = function(args2) { if (this._released) { this.emit.apply(this, args2); return; } if (args2[0] === "data") { this.dataSize += args2[1].length; this._checkIfMaxDataSizeExceeded(); } this._bufferedEvents.push(args2); }; DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { if (this._maxDataSizeExceeded) { return; } if (this.dataSize <= this.maxDataSize) { return; } this._maxDataSizeExceeded = true; var message2 = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; this.emit("error", new Error(message2)); }; } }); // ../node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js var require_combined_stream = __commonJS({ "../node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js"(exports2, module2) { var util = require("util"); var Stream3 = require("stream").Stream; var DelayedStream = require_delayed_stream(); module2.exports = CombinedStream; function CombinedStream() { this.writable = false; this.readable = true; this.dataSize = 0; this.maxDataSize = 2 * 1024 * 1024; this.pauseStreams = true; this._released = false; this._streams = []; this._currentStream = null; this._insideLoop = false; this._pendingNext = false; } util.inherits(CombinedStream, Stream3); CombinedStream.create = function(options) { var combinedStream = new this(); options = options || {}; for (var option in options) { combinedStream[option] = options[option]; } return combinedStream; }; CombinedStream.isStreamLike = function(stream) { return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream); }; CombinedStream.prototype.append = function(stream) { var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { if (!(stream instanceof DelayedStream)) { var newStream = DelayedStream.create(stream, { maxDataSize: Infinity, pauseStream: this.pauseStreams }); stream.on("data", this._checkDataSize.bind(this)); stream = newStream; } this._handleErrors(stream); if (this.pauseStreams) { stream.pause(); } } this._streams.push(stream); return this; }; CombinedStream.prototype.pipe = function(dest, options) { Stream3.prototype.pipe.call(this, dest, options); this.resume(); return dest; }; CombinedStream.prototype._getNext = function() { this._currentStream = null; if (this._insideLoop) { this._pendingNext = true; return; } this._insideLoop = true; try { do { this._pendingNext = false; this._realGetNext(); } while (this._pendingNext); } finally { this._insideLoop = false; } }; CombinedStream.prototype._realGetNext = function() { var stream = this._streams.shift(); if (typeof stream == "undefined") { this.end(); return; } if (typeof stream !== "function") { this._pipeNext(stream); return; } var getStream = stream; getStream(function(stream2) { var isStreamLike = CombinedStream.isStreamLike(stream2); if (isStreamLike) { stream2.on("data", this._checkDataSize.bind(this)); this._handleErrors(stream2); } this._pipeNext(stream2); }.bind(this)); }; CombinedStream.prototype._pipeNext = function(stream) { this._currentStream = stream; var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { stream.on("end", this._getNext.bind(this)); stream.pipe(this, { end: false }); return; } var value = stream; this.write(value); this._getNext(); }; CombinedStream.prototype._handleErrors = function(stream) { var self2 = this; stream.on("error", function(err) { self2._emitError(err); }); }; CombinedStream.prototype.write = function(data) { this.emit("data", data); }; CombinedStream.prototype.pause = function() { if (!this.pauseStreams) { return; } if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause(); this.emit("pause"); }; CombinedStream.prototype.resume = function() { if (!this._released) { this._released = true; this.writable = true; this._getNext(); } if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume(); this.emit("resume"); }; CombinedStream.prototype.end = function() { this._reset(); this.emit("end"); }; CombinedStream.prototype.destroy = function() { this._reset(); this.emit("close"); }; CombinedStream.prototype._reset = function() { this.writable = false; this._streams = []; this._currentStream = null; }; CombinedStream.prototype._checkDataSize = function() { this._updateDataSize(); if (this.dataSize <= this.maxDataSize) { return; } var message2 = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; this._emitError(new Error(message2)); }; CombinedStream.prototype._updateDataSize = function() { this.dataSize = 0; var self2 = this; this._streams.forEach(function(stream) { if (!stream.dataSize) { return; } self2.dataSize += stream.dataSize; }); if (this._currentStream && this._currentStream.dataSize) { this.dataSize += this._currentStream.dataSize; } }; CombinedStream.prototype._emitError = function(err) { this._reset(); this.emit("error", err); }; } }); // ../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js var require_defer = __commonJS({ "../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js"(exports2, module2) { module2.exports = defer; function defer(fn2) { var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null; if (nextTick) { nextTick(fn2); } else { setTimeout(fn2, 0); } } } }); // ../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js var require_async = __commonJS({ "../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js"(exports2, module2) { var defer = require_defer(); module2.exports = async; function async(callback) { var isAsync = false; defer(function() { isAsync = true; }); return function async_callback(err, result) { if (isAsync) { callback(err, result); } else { defer(function nextTick_callback() { callback(err, result); }); } }; } } }); // ../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js var require_abort = __commonJS({ "../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js"(exports2, module2) { module2.exports = abort; function abort(state) { Object.keys(state.jobs).forEach(clean.bind(state)); state.jobs = {}; } function clean(key) { if (typeof this.jobs[key] == "function") { this.jobs[key](); } } } }); // ../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js var require_iterate = __commonJS({ "../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js"(exports2, module2) { var async = require_async(); var abort = require_abort(); module2.exports = iterate; function iterate(list, iterator, state, callback) { var key = state["keyedList"] ? state["keyedList"][state.index] : state.index; state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { if (!(key in state.jobs)) { return; } delete state.jobs[key]; if (error) { abort(state); } else { state.results[key] = output; } callback(error, state.results); }); } function runJob(iterator, key, item, callback) { var aborter; if (iterator.length == 2) { aborter = iterator(item, async(callback)); } else { aborter = iterator(item, key, async(callback)); } return aborter; } } }); // ../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js var require_state = __commonJS({ "../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js"(exports2, module2) { module2.exports = state; function state(list, sortMethod) { var isNamedList = !Array.isArray(list), initState = { index: 0, keyedList: isNamedList || sortMethod ? Object.keys(list) : null, jobs: {}, results: isNamedList ? {} : [], size: isNamedList ? Object.keys(list).length : list.length }; if (sortMethod) { initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { return sortMethod(list[a], list[b]); }); } return initState; } } }); // ../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js var require_terminator = __commonJS({ "../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js"(exports2, module2) { var abort = require_abort(); var async = require_async(); module2.exports = terminator; function terminator(callback) { if (!Object.keys(this.jobs).length) { return; } this.index = this.size; abort(this); async(callback)(null, this.results); } } }); // ../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js var require_parallel = __commonJS({ "../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js"(exports2, module2) { var iterate = require_iterate(); var initState = require_state(); var terminator = require_terminator(); module2.exports = parallel; function parallel(list, iterator, callback) { var state = initState(list); while (state.index < (state["keyedList"] || list).length) { iterate(list, iterator, state, function(error, result) { if (error) { callback(error, result); return; } if (Object.keys(state.jobs).length === 0) { callback(null, state.results); return; } }); state.index++; } return terminator.bind(state, callback); } } }); // ../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js var require_serialOrdered = __commonJS({ "../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js"(exports2, module2) { var iterate = require_iterate(); var initState = require_state(); var terminator = require_terminator(); module2.exports = serialOrdered; module2.exports.ascending = ascending; module2.exports.descending = descending; function serialOrdered(list, iterator, sortMethod, callback) { var state = initState(list, sortMethod); iterate(list, iterator, state, function iteratorHandler(error, result) { if (error) { callback(error, result); return; } state.index++; if (state.index < (state["keyedList"] || list).length) { iterate(list, iterator, state, iteratorHandler); return; } callback(null, state.results); }); return terminator.bind(state, callback); } function ascending(a, b) { return a < b ? -1 : a > b ? 1 : 0; } function descending(a, b) { return -1 * ascending(a, b); } } }); // ../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js var require_serial = __commonJS({ "../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js"(exports2, module2) { var serialOrdered = require_serialOrdered(); module2.exports = serial; function serial(list, iterator, callback) { return serialOrdered(list, iterator, null, callback); } } }); // ../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js var require_asynckit = __commonJS({ "../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js"(exports2, module2) { module2.exports = { parallel: require_parallel(), serial: require_serial(), serialOrdered: require_serialOrdered() }; } }); // ../node_modules/.pnpm/form-data@4.0.1/node_modules/form-data/lib/populate.js var require_populate = __commonJS({ "../node_modules/.pnpm/form-data@4.0.1/node_modules/form-data/lib/populate.js"(exports2, module2) { module2.exports = function(dst, src) { Object.keys(src).forEach(function(prop) { dst[prop] = dst[prop] || src[prop]; }); return dst; }; } }); // ../node_modules/.pnpm/form-data@4.0.1/node_modules/form-data/lib/form_data.js var require_form_data = __commonJS({ "../node_modules/.pnpm/form-data@4.0.1/node_modules/form-data/lib/form_data.js"(exports2, module2) { var CombinedStream = require_combined_stream(); var util = require("util"); var path = require("path"); var http3 = require("http"); var https2 = require("https"); var parseUrl = require("url").parse; var fs2 = require("fs"); var Stream3 = require("stream").Stream; var mime = require_mime_types(); var asynckit = require_asynckit(); var populate = require_populate(); module2.exports = FormData4; util.inherits(FormData4, CombinedStream); function FormData4(options) { if (!(this instanceof FormData4)) { return new FormData4(options); } this._overheadLength = 0; this._valueLength = 0; this._valuesToMeasure = []; CombinedStream.call(this); options = options || {}; for (var option in options) { this[option] = options[option]; } } FormData4.LINE_BREAK = "\r\n"; FormData4.DEFAULT_CONTENT_TYPE = "application/octet-stream"; FormData4.prototype.append = function(field, value, options) { options = options || {}; if (typeof options == "string") { options = { filename: options }; } var append = CombinedStream.prototype.append.bind(this); if (typeof value == "number") { value = "" + value; } if (Array.isArray(value)) { this._error(new Error("Arrays are not supported.")); return; } var header = this._multiPartHeader(field, value, options); var footer = this._multiPartFooter(); append(header); append(value); append(footer); this._trackLength(header, value, options); }; FormData4.prototype._trackLength = function(header, value, options) { var valueLength = 0; if (options.knownLength != null) { valueLength += +options.knownLength; } else if (Buffer.isBuffer(value)) { valueLength = value.length; } else if (typeof value === "string") { valueLength = Buffer.byteLength(value); } this._valueLength += valueLength; this._overheadLength += Buffer.byteLength(header) + FormData4.LINE_BREAK.length; if (!value || !value.path && !(value.readable && value.hasOwnProperty("httpVersion")) && !(value instanceof Stream3)) { return; } if (!options.knownLength) { this._valuesToMeasure.push(value); } }; FormData4.prototype._lengthRetriever = function(value, callback) { if (value.hasOwnProperty("fd")) { if (value.end != void 0 && value.end != Infinity && value.start != void 0) { callback(null, value.end + 1 - (value.start ? value.start : 0)); } else { fs2.stat(value.path, function(err, stat2) { var fileSize; if (err) { callback(err); return; } fileSize = stat2.size - (value.start ? value.start : 0); callback(null, fileSize); }); } } else if (value.hasOwnProperty("httpVersion")) { callback(null, +value.headers["content-length"]); } else if (value.hasOwnProperty("httpModule")) { value.on("response", function(response) { value.pause(); callback(null, +response.headers["content-length"]); }); value.resume(); } else { callback("Unknown stream"); } }; FormData4.prototype._multiPartHeader = function(field, value, options) { if (typeof options.header == "string") { return options.header; } var contentDisposition = this._getContentDisposition(value, options); var contentType = this._getContentType(value, options); var contents = ""; var headers = { // add custom disposition as third element or keep it two elements if not "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []), // if no content type. allow it to be empty array "Content-Type": [].concat(contentType || []) }; if (typeof options.header == "object") { populate(headers, options.header); } var header; for (var prop in headers) { if (!headers.hasOwnProperty(prop)) continue; header = headers[prop]; if (header == null) { continue; } if (!Array.isArray(header)) { header = [header]; } if (header.length) { contents += prop + ": " + header.join("; ") + FormData4.LINE_BREAK; } } return "--" + this.getBoundary() + FormData4.LINE_BREAK + contents + FormData4.LINE_BREAK; }; FormData4.prototype._getContentDisposition = function(value, options) { var filename, contentDisposition; if (typeof options.filepath === "string") { filename = path.normalize(options.filepath).replace(/\\/g, "/"); } else if (options.filename || value.name || value.path) { filename = path.basename(options.filename || value.name || value.path); } else if (value.readable && value.hasOwnProperty("httpVersion")) { filename = path.basename(value.client._httpMessage.path || ""); } if (filename) { contentDisposition = 'filename="' + filename + '"'; } return contentDisposition; }; FormData4.prototype._getContentType = function(value, options) { var contentType = options.contentType; if (!contentType && value.name) { contentType = mime.lookup(value.name); } if (!contentType && value.path) { contentType = mime.lookup(value.path); } if (!contentType && value.readable && value.hasOwnProperty("httpVersion")) { contentType = value.headers["content-type"]; } if (!contentType && (options.filepath || options.filename)) { contentType = mime.lookup(options.filepath || options.filename); } if (!contentType && typeof value == "object") { contentType = FormData4.DEFAULT_CONTENT_TYPE; } return contentType; }; FormData4.prototype._multiPartFooter = function() { return function(next) { var footer = FormData4.LINE_BREAK; var lastPart = this._streams.length === 0; if (lastPart) { footer += this._lastBoundary(); } next(footer); }.bind(this); }; FormData4.prototype._lastBoundary = function() { return "--" + this.getBoundary() + "--" + FormData4.LINE_BREAK; }; FormData4.prototype.getHeaders = function(userHeaders) { var header; var formHeaders = { "content-type": "multipart/form-data; boundary=" + this.getBoundary() }; for (header in userHeaders) { if (userHeaders.hasOwnProperty(header)) { formHeaders[header.toLowerCase()] = userHeaders[header]; } } return formHeaders; }; FormData4.prototype.setBoundary = function(boundary) { this._boundary = boundary; }; FormData4.prototype.getBoundary = function() { if (!this._boundary) { this._generateBoundary(); } return this._boundary; }; FormData4.prototype.getBuffer = function() { var dataBuffer = new Buffer.alloc(0); var boundary = this.getBoundary(); for (var i2 = 0, len = this._streams.length; i2 < len; i2++) { if (typeof this._streams[i2] !== "function") { if (Buffer.isBuffer(this._streams[i2])) { dataBuffer = Buffer.concat([dataBuffer, this._streams[i2]]); } else { dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i2])]); } if (typeof this._streams[i2] !== "string" || this._streams[i2].substring(2, boundary.length + 2) !== boundary) { dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData4.LINE_BREAK)]); } } } return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); }; FormData4.prototype._generateBoundary = function() { var boundary = "--------------------------"; for (var i2 = 0; i2 < 24; i2++) { boundary += Math.floor(Math.random() * 10).toString(16); } this._boundary = boundary; }; FormData4.prototype.getLengthSync = function() { var knownLength = this._overheadLength + this._valueLength; if (this._streams.length) { knownLength += this._lastBoundary().length; } if (!this.hasKnownLength()) { this._error(new Error("Cannot calculate proper length in synchronous way.")); } return knownLength; }; FormData4.prototype.hasKnownLength = function() { var hasKnownLength = true; if (this._valuesToMeasure.length) { hasKnownLength = false; } return hasKnownLength; }; FormData4.prototype.getLength = function(cb) { var knownLength = this._overheadLength + this._valueLength; if (this._streams.length) { knownLength += this._lastBoundary().length; } if (!this._valuesToMeasure.length) { process.nextTick(cb.bind(this, null, knownLength)); return; } asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { if (err) { cb(err); return; } values.forEach(function(length) { knownLength += length; }); cb(null, knownLength); }); }; FormData4.prototype.submit = function(params, cb) { var request, options, defaults = { method: "post" }; if (typeof params == "string") { params = parseUrl(params); options = populate({ port: params.port, path: params.pathname, host: params.hostname, protocol: params.protocol }, defaults); } else { options = populate(params, defaults); if (!options.port) { options.port = options.protocol == "https:" ? 443 : 80; } } options.headers = this.getHeaders(params.headers); if (options.protocol == "https:") { request = https2.request(options); } else { request = http3.request(options); } this.getLength(function(err, length) { if (err && err !== "Unknown stream") { this._error(err); return; } if (length) { request.setHeader("Content-Length", length); } this.pipe(request); if (cb) { var onResponse; var callback = function(error, responce) { request.removeListener("error", callback); request.removeListener("response", onResponse); return cb.call(this, error, responce); }; onResponse = callback.bind(this, null); request.on("error", callback); request.on("response", onResponse); } }.bind(this)); return request; }; FormData4.prototype._error = function(err) { if (!this.error) { this.error = err; this.pause(); this.emit("error", err); } }; FormData4.prototype.toString = function() { return "[object FormData]"; }; } }); // ../node_modules/.pnpm/web-streams-polyfill@3.3.3/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js var require_ponyfill_es2018 = __commonJS({ "../node_modules/.pnpm/web-streams-polyfill@3.3.3/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js"(exports2, module2) { (function(global2, factory) { typeof exports2 === "object" && typeof module2 !== "undefined" ? factory(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.WebStreamsPolyfill = {})); })(exports2, function(exports3) { "use strict"; function noop2() { return void 0; } function typeIsObject(x2) { return typeof x2 === "object" && x2 !== null || typeof x2 === "function"; } const rethrowAssertionErrorRejection = noop2; function setFunctionName(fn2, name) { try { Object.defineProperty(fn2, "name", { value: name, configurable: true }); } catch (_a2) { } } const originalPromise = Promise; const originalPromiseThen = Promise.prototype.then; const originalPromiseReject = Promise.reject.bind(originalPromise); function newPromise(executor) { return new originalPromise(executor); } function promiseResolvedWith(value) { return newPromise((resolve) => resolve(value)); } function promiseRejectedWith(reason) { return originalPromiseReject(reason); } function PerformPromiseThen(promise, onFulfilled, onRejected) { return originalPromiseThen.call(promise, onFulfilled, onRejected); } function uponPromise(promise, onFulfilled, onRejected) { PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), void 0, rethrowAssertionErrorRejection); } function uponFulfillment(promise, onFulfilled) { uponPromise(promise, onFulfilled); } function uponRejection(promise, onRejected) { uponPromise(promise, void 0, onRejected); } function transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) { return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler); } function setPromiseIsHandledToTrue(promise) { PerformPromiseThen(promise, void 0, rethrowAssertionErrorRejection); } let _queueMicrotask = (callback) => { if (typeof queueMicrotask === "function") { _queueMicrotask = queueMicrotask; } else { const resolvedPromise = promiseResolvedWith(void 0); _queueMicrotask = (cb) => PerformPromiseThen(resolvedPromise, cb); } return _queueMicrotask(callback); }; function reflectCall(F2, V, args2) { if (typeof F2 !== "function") { throw new TypeError("Argument is not a function"); } return Function.prototype.apply.call(F2, V, args2); } function promiseCall(F2, V, args2) { try { return promiseResolvedWith(reflectCall(F2, V, args2)); } catch (value) { return promiseRejectedWith(value); } } const QUEUE_MAX_ARRAY_SIZE = 16384; class SimpleQueue { constructor() { this._cursor = 0; this._size = 0; this._front = { _elements: [], _next: void 0 }; this._back = this._front; this._cursor = 0; this._size = 0; } get length() { return this._size; } // For exception safety, this method is structured in order: // 1. Read state // 2. Calculate required state mutations // 3. Perform state mutations push(element) { const oldBack = this._back; let newBack = oldBack; if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) { newBack = { _elements: [], _next: void 0 }; } oldBack._elements.push(element); if (newBack !== oldBack) { this._back = newBack; oldBack._next = newBack; } ++this._size; } // Like push(), shift() follows the read -> calculate -> mutate pattern for // exception safety. shift() { const oldFront = this._front; let newFront = oldFront; const oldCursor = this._cursor; let newCursor = oldCursor + 1; const elements = oldFront._elements; const element = elements[oldCursor]; if (newCursor === QUEUE_MAX_ARRAY_SIZE) { newFront = oldFront._next; newCursor = 0; } --this._size; this._cursor = newCursor; if (oldFront !== newFront) { this._front = newFront; } elements[oldCursor] = void 0; return element; } // The tricky thing about forEach() is that it can be called // re-entrantly. The queue may be mutated inside the callback. It is easy to // see that push() within the callback has no negative effects since the end // of the queue is checked for on every iteration. If shift() is called // repeatedly within the callback then the next iteration may return an // element that has been removed. In this case the callback will be called // with undefined values until we either "catch up" with elements that still // exist or reach the back of the queue. forEach(callback) { let i2 = this._cursor; let node = this._front; let elements = node._elements; while (i2 !== elements.length || node._next !== void 0) { if (i2 === elements.length) { node = node._next; elements = node._elements; i2 = 0; if (elements.length === 0) { break; } } callback(elements[i2]); ++i2; } } // Return the element that would be returned if shift() was called now, // without modifying the queue. peek() { const front = this._front; const cursor = this._cursor; return front._elements[cursor]; } } const AbortSteps = Symbol("[[AbortSteps]]"); const ErrorSteps = Symbol("[[ErrorSteps]]"); const CancelSteps = Symbol("[[CancelSteps]]"); const PullSteps = Symbol("[[PullSteps]]"); const ReleaseSteps = Symbol("[[ReleaseSteps]]"); function ReadableStreamReaderGenericInitialize(reader, stream) { reader._ownerReadableStream = stream; stream._reader = reader; if (stream._state === "readable") { defaultReaderClosedPromiseInitialize(reader); } else if (stream._state === "closed") { defaultReaderClosedPromiseInitializeAsResolved(reader); } else { defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError); } } function ReadableStreamReaderGenericCancel(reader, reason) { const stream = reader._ownerReadableStream; return ReadableStreamCancel(stream, reason); } function ReadableStreamReaderGenericRelease(reader) { const stream = reader._ownerReadableStream; if (stream._state === "readable") { defaultReaderClosedPromiseReject(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`)); } else { defaultReaderClosedPromiseResetToRejected(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`)); } stream._readableStreamController[ReleaseSteps](); stream._reader = void 0; reader._ownerReadableStream = void 0; } function readerLockException(name) { return new TypeError("Cannot " + name + " a stream using a released reader"); } function defaultReaderClosedPromiseInitialize(reader) { reader._closedPromise = newPromise((resolve, reject) => { reader._closedPromise_resolve = resolve; reader._closedPromise_reject = reject; }); } function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) { defaultReaderClosedPromiseInitialize(reader); defaultReaderClosedPromiseReject(reader, reason); } function defaultReaderClosedPromiseInitializeAsResolved(reader) { defaultReaderClosedPromiseInitialize(reader); defaultReaderClosedPromiseResolve(reader); } function defaultReaderClosedPromiseReject(reader, reason) { if (reader._closedPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(reader._closedPromise); reader._closedPromise_reject(reason); reader._closedPromise_resolve = void 0; reader._closedPromise_reject = void 0; } function defaultReaderClosedPromiseResetToRejected(reader, reason) { defaultReaderClosedPromiseInitializeAsRejected(reader, reason); } function defaultReaderClosedPromiseResolve(reader) { if (reader._closedPromise_resolve === void 0) { return; } reader._closedPromise_resolve(void 0); reader._closedPromise_resolve = void 0; reader._closedPromise_reject = void 0; } const NumberIsFinite = Number.isFinite || function(x2) { return typeof x2 === "number" && isFinite(x2); }; const MathTrunc = Math.trunc || function(v) { return v < 0 ? Math.ceil(v) : Math.floor(v); }; function isDictionary(x2) { return typeof x2 === "object" || typeof x2 === "function"; } function assertDictionary(obj, context) { if (obj !== void 0 && !isDictionary(obj)) { throw new TypeError(`${context} is not an object.`); } } function assertFunction(x2, context) { if (typeof x2 !== "function") { throw new TypeError(`${context} is not a function.`); } } function isObject(x2) { return typeof x2 === "object" && x2 !== null || typeof x2 === "function"; } function assertObject(x2, context) { if (!isObject(x2)) { throw new TypeError(`${context} is not an object.`); } } function assertRequiredArgument(x2, position, context) { if (x2 === void 0) { throw new TypeError(`Parameter ${position} is required in '${context}'.`); } } function assertRequiredField(x2, field, context) { if (x2 === void 0) { throw new TypeError(`${field} is required in '${context}'.`); } } function convertUnrestrictedDouble(value) { return Number(value); } function censorNegativeZero(x2) { return x2 === 0 ? 0 : x2; } function integerPart(x2) { return censorNegativeZero(MathTrunc(x2)); } function convertUnsignedLongLongWithEnforceRange(value, context) { const lowerBound = 0; const upperBound = Number.MAX_SAFE_INTEGER; let x2 = Number(value); x2 = censorNegativeZero(x2); if (!NumberIsFinite(x2)) { throw new TypeError(`${context} is not a finite number`); } x2 = integerPart(x2); if (x2 < lowerBound || x2 > upperBound) { throw new TypeError(`${context} is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`); } if (!NumberIsFinite(x2) || x2 === 0) { return 0; } return x2; } function assertReadableStream(x2, context) { if (!IsReadableStream(x2)) { throw new TypeError(`${context} is not a ReadableStream.`); } } function AcquireReadableStreamDefaultReader(stream) { return new ReadableStreamDefaultReader(stream); } function ReadableStreamAddReadRequest(stream, readRequest) { stream._reader._readRequests.push(readRequest); } function ReadableStreamFulfillReadRequest(stream, chunk, done) { const reader = stream._reader; const readRequest = reader._readRequests.shift(); if (done) { readRequest._closeSteps(); } else { readRequest._chunkSteps(chunk); } } function ReadableStreamGetNumReadRequests(stream) { return stream._reader._readRequests.length; } function ReadableStreamHasDefaultReader(stream) { const reader = stream._reader; if (reader === void 0) { return false; } if (!IsReadableStreamDefaultReader(reader)) { return false; } return true; } class ReadableStreamDefaultReader { constructor(stream) { assertRequiredArgument(stream, 1, "ReadableStreamDefaultReader"); assertReadableStream(stream, "First parameter"); if (IsReadableStreamLocked(stream)) { throw new TypeError("This stream has already been locked for exclusive reading by another reader"); } ReadableStreamReaderGenericInitialize(this, stream); this._readRequests = new SimpleQueue(); } /** * Returns a promise that will be fulfilled when the stream becomes closed, * or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing. */ get closed() { if (!IsReadableStreamDefaultReader(this)) { return promiseRejectedWith(defaultReaderBrandCheckException("closed")); } return this._closedPromise; } /** * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}. */ cancel(reason = void 0) { if (!IsReadableStreamDefaultReader(this)) { return promiseRejectedWith(defaultReaderBrandCheckException("cancel")); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException("cancel")); } return ReadableStreamReaderGenericCancel(this, reason); } /** * Returns a promise that allows access to the next chunk from the stream's internal queue, if available. * * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source. */ read() { if (!IsReadableStreamDefaultReader(this)) { return promiseRejectedWith(defaultReaderBrandCheckException("read")); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException("read from")); } let resolvePromise; let rejectPromise; const promise = newPromise((resolve, reject) => { resolvePromise = resolve; rejectPromise = reject; }); const readRequest = { _chunkSteps: (chunk) => resolvePromise({ value: chunk, done: false }), _closeSteps: () => resolvePromise({ value: void 0, done: true }), _errorSteps: (e2) => rejectPromise(e2) }; ReadableStreamDefaultReaderRead(this, readRequest); return promise; } /** * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active. * If the associated stream is errored when the lock is released, the reader will appear errored in the same way * from now on; otherwise, the reader will appear closed. * * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by * the reader's {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to * do so will throw a `TypeError` and leave the reader locked to the stream. */ releaseLock() { if (!IsReadableStreamDefaultReader(this)) { throw defaultReaderBrandCheckException("releaseLock"); } if (this._ownerReadableStream === void 0) { return; } ReadableStreamDefaultReaderRelease(this); } } Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }); setFunctionName(ReadableStreamDefaultReader.prototype.cancel, "cancel"); setFunctionName(ReadableStreamDefaultReader.prototype.read, "read"); setFunctionName(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableStreamDefaultReader.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true }); } function IsReadableStreamDefaultReader(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_readRequests")) { return false; } return x2 instanceof ReadableStreamDefaultReader; } function ReadableStreamDefaultReaderRead(reader, readRequest) { const stream = reader._ownerReadableStream; stream._disturbed = true; if (stream._state === "closed") { readRequest._closeSteps(); } else if (stream._state === "errored") { readRequest._errorSteps(stream._storedError); } else { stream._readableStreamController[PullSteps](readRequest); } } function ReadableStreamDefaultReaderRelease(reader) { ReadableStreamReaderGenericRelease(reader); const e2 = new TypeError("Reader was released"); ReadableStreamDefaultReaderErrorReadRequests(reader, e2); } function ReadableStreamDefaultReaderErrorReadRequests(reader, e2) { const readRequests = reader._readRequests; reader._readRequests = new SimpleQueue(); readRequests.forEach((readRequest) => { readRequest._errorSteps(e2); }); } function defaultReaderBrandCheckException(name) { return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`); } const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () { }).prototype); class ReadableStreamAsyncIteratorImpl { constructor(reader, preventCancel) { this._ongoingPromise = void 0; this._isFinished = false; this._reader = reader; this._preventCancel = preventCancel; } next() { const nextSteps = () => this._nextSteps(); this._ongoingPromise = this._ongoingPromise ? transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) : nextSteps(); return this._ongoingPromise; } return(value) { const returnSteps = () => this._returnSteps(value); return this._ongoingPromise ? transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) : returnSteps(); } _nextSteps() { if (this._isFinished) { return Promise.resolve({ value: void 0, done: true }); } const reader = this._reader; let resolvePromise; let rejectPromise; const promise = newPromise((resolve, reject) => { resolvePromise = resolve; rejectPromise = reject; }); const readRequest = { _chunkSteps: (chunk) => { this._ongoingPromise = void 0; _queueMicrotask(() => resolvePromise({ value: chunk, done: false })); }, _closeSteps: () => { this._ongoingPromise = void 0; this._isFinished = true; ReadableStreamReaderGenericRelease(reader); resolvePromise({ value: void 0, done: true }); }, _errorSteps: (reason) => { this._ongoingPromise = void 0; this._isFinished = true; ReadableStreamReaderGenericRelease(reader); rejectPromise(reason); } }; ReadableStreamDefaultReaderRead(reader, readRequest); return promise; } _returnSteps(value) { if (this._isFinished) { return Promise.resolve({ value, done: true }); } this._isFinished = true; const reader = this._reader; if (!this._preventCancel) { const result = ReadableStreamReaderGenericCancel(reader, value); ReadableStreamReaderGenericRelease(reader); return transformPromiseWith(result, () => ({ value, done: true })); } ReadableStreamReaderGenericRelease(reader); return promiseResolvedWith({ value, done: true }); } } const ReadableStreamAsyncIteratorPrototype = { next() { if (!IsReadableStreamAsyncIterator(this)) { return promiseRejectedWith(streamAsyncIteratorBrandCheckException("next")); } return this._asyncIteratorImpl.next(); }, return(value) { if (!IsReadableStreamAsyncIterator(this)) { return promiseRejectedWith(streamAsyncIteratorBrandCheckException("return")); } return this._asyncIteratorImpl.return(value); } }; Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype); function AcquireReadableStreamAsyncIterator(stream, preventCancel) { const reader = AcquireReadableStreamDefaultReader(stream); const impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel); const iterator = Object.create(ReadableStreamAsyncIteratorPrototype); iterator._asyncIteratorImpl = impl; return iterator; } function IsReadableStreamAsyncIterator(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_asyncIteratorImpl")) { return false; } try { return x2._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl; } catch (_a2) { return false; } } function streamAsyncIteratorBrandCheckException(name) { return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`); } const NumberIsNaN = Number.isNaN || function(x2) { return x2 !== x2; }; var _a, _b, _c; function CreateArrayFromList(elements) { return elements.slice(); } function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) { new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset); } let TransferArrayBuffer = (O) => { if (typeof O.transfer === "function") { TransferArrayBuffer = (buffer2) => buffer2.transfer(); } else if (typeof structuredClone === "function") { TransferArrayBuffer = (buffer2) => structuredClone(buffer2, { transfer: [buffer2] }); } else { TransferArrayBuffer = (buffer2) => buffer2; } return TransferArrayBuffer(O); }; let IsDetachedBuffer = (O) => { if (typeof O.detached === "boolean") { IsDetachedBuffer = (buffer2) => buffer2.detached; } else { IsDetachedBuffer = (buffer2) => buffer2.byteLength === 0; } return IsDetachedBuffer(O); }; function ArrayBufferSlice(buffer2, begin, end) { if (buffer2.slice) { return buffer2.slice(begin, end); } const length = end - begin; const slice = new ArrayBuffer(length); CopyDataBlockBytes(slice, 0, buffer2, begin, length); return slice; } function GetMethod(receiver, prop) { const func = receiver[prop]; if (func === void 0 || func === null) { return void 0; } if (typeof func !== "function") { throw new TypeError(`${String(prop)} is not a function`); } return func; } function CreateAsyncFromSyncIterator(syncIteratorRecord) { const syncIterable = { [Symbol.iterator]: () => syncIteratorRecord.iterator }; const asyncIterator = async function* () { return yield* syncIterable; }(); const nextMethod = asyncIterator.next; return { iterator: asyncIterator, nextMethod, done: false }; } const SymbolAsyncIterator = (_c = (_a = Symbol.asyncIterator) !== null && _a !== void 0 ? _a : (_b = Symbol.for) === null || _b === void 0 ? void 0 : _b.call(Symbol, "Symbol.asyncIterator")) !== null && _c !== void 0 ? _c : "@@asyncIterator"; function GetIterator(obj, hint = "sync", method) { if (method === void 0) { if (hint === "async") { method = GetMethod(obj, SymbolAsyncIterator); if (method === void 0) { const syncMethod = GetMethod(obj, Symbol.iterator); const syncIteratorRecord = GetIterator(obj, "sync", syncMethod); return CreateAsyncFromSyncIterator(syncIteratorRecord); } } else { method = GetMethod(obj, Symbol.iterator); } } if (method === void 0) { throw new TypeError("The object is not iterable"); } const iterator = reflectCall(method, obj, []); if (!typeIsObject(iterator)) { throw new TypeError("The iterator method must return an object"); } const nextMethod = iterator.next; return { iterator, nextMethod, done: false }; } function IteratorNext(iteratorRecord) { const result = reflectCall(iteratorRecord.nextMethod, iteratorRecord.iterator, []); if (!typeIsObject(result)) { throw new TypeError("The iterator.next() method must return an object"); } return result; } function IteratorComplete(iterResult) { return Boolean(iterResult.done); } function IteratorValue(iterResult) { return iterResult.value; } function IsNonNegativeNumber(v) { if (typeof v !== "number") { return false; } if (NumberIsNaN(v)) { return false; } if (v < 0) { return false; } return true; } function CloneAsUint8Array(O) { const buffer2 = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength); return new Uint8Array(buffer2); } function DequeueValue(container) { const pair = container._queue.shift(); container._queueTotalSize -= pair.size; if (container._queueTotalSize < 0) { container._queueTotalSize = 0; } return pair.value; } function EnqueueValueWithSize(container, value, size) { if (!IsNonNegativeNumber(size) || size === Infinity) { throw new RangeError("Size must be a finite, non-NaN, non-negative number."); } container._queue.push({ value, size }); container._queueTotalSize += size; } function PeekQueueValue(container) { const pair = container._queue.peek(); return pair.value; } function ResetQueue(container) { container._queue = new SimpleQueue(); container._queueTotalSize = 0; } function isDataViewConstructor(ctor) { return ctor === DataView; } function isDataView(view) { return isDataViewConstructor(view.constructor); } function arrayBufferViewElementSize(ctor) { if (isDataViewConstructor(ctor)) { return 1; } return ctor.BYTES_PER_ELEMENT; } class ReadableStreamBYOBRequest { constructor() { throw new TypeError("Illegal constructor"); } /** * Returns the view for writing in to, or `null` if the BYOB request has already been responded to. */ get view() { if (!IsReadableStreamBYOBRequest(this)) { throw byobRequestBrandCheckException("view"); } return this._view; } respond(bytesWritten) { if (!IsReadableStreamBYOBRequest(this)) { throw byobRequestBrandCheckException("respond"); } assertRequiredArgument(bytesWritten, 1, "respond"); bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, "First parameter"); if (this._associatedReadableByteStreamController === void 0) { throw new TypeError("This BYOB request has been invalidated"); } if (IsDetachedBuffer(this._view.buffer)) { throw new TypeError(`The BYOB request's buffer has been detached and so cannot be used as a response`); } ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten); } respondWithNewView(view) { if (!IsReadableStreamBYOBRequest(this)) { throw byobRequestBrandCheckException("respondWithNewView"); } assertRequiredArgument(view, 1, "respondWithNewView"); if (!ArrayBuffer.isView(view)) { throw new TypeError("You can only respond with array buffer views"); } if (this._associatedReadableByteStreamController === void 0) { throw new TypeError("This BYOB request has been invalidated"); } if (IsDetachedBuffer(view.buffer)) { throw new TypeError("The given view's buffer has been detached and so cannot be used as a response"); } ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view); } } Object.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }); setFunctionName(ReadableStreamBYOBRequest.prototype.respond, "respond"); setFunctionName(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableStreamBYOBRequest.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true }); } class ReadableByteStreamController { constructor() { throw new TypeError("Illegal constructor"); } /** * Returns the current BYOB pull request, or `null` if there isn't one. */ get byobRequest() { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException("byobRequest"); } return ReadableByteStreamControllerGetBYOBRequest(this); } /** * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure. */ get desiredSize() { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException("desiredSize"); } return ReadableByteStreamControllerGetDesiredSize(this); } /** * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from * the stream, but once those are read, the stream will become closed. */ close() { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException("close"); } if (this._closeRequested) { throw new TypeError("The stream has already been closed; do not close it again!"); } const state = this._controlledReadableByteStream._state; if (state !== "readable") { throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be closed`); } ReadableByteStreamControllerClose(this); } enqueue(chunk) { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException("enqueue"); } assertRequiredArgument(chunk, 1, "enqueue"); if (!ArrayBuffer.isView(chunk)) { throw new TypeError("chunk must be an array buffer view"); } if (chunk.byteLength === 0) { throw new TypeError("chunk must have non-zero byteLength"); } if (chunk.buffer.byteLength === 0) { throw new TypeError(`chunk's buffer must have non-zero byteLength`); } if (this._closeRequested) { throw new TypeError("stream is closed or draining"); } const state = this._controlledReadableByteStream._state; if (state !== "readable") { throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be enqueued to`); } ReadableByteStreamControllerEnqueue(this, chunk); } /** * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`. */ error(e2 = void 0) { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException("error"); } ReadableByteStreamControllerError(this, e2); } /** @internal */ [CancelSteps](reason) { ReadableByteStreamControllerClearPendingPullIntos(this); ResetQueue(this); const result = this._cancelAlgorithm(reason); ReadableByteStreamControllerClearAlgorithms(this); return result; } /** @internal */ [PullSteps](readRequest) { const stream = this._controlledReadableByteStream; if (this._queueTotalSize > 0) { ReadableByteStreamControllerFillReadRequestFromQueue(this, readRequest); return; } const autoAllocateChunkSize = this._autoAllocateChunkSize; if (autoAllocateChunkSize !== void 0) { let buffer2; try { buffer2 = new ArrayBuffer(autoAllocateChunkSize); } catch (bufferE) { readRequest._errorSteps(bufferE); return; } const pullIntoDescriptor = { buffer: buffer2, bufferByteLength: autoAllocateChunkSize, byteOffset: 0, byteLength: autoAllocateChunkSize, bytesFilled: 0, minimumFill: 1, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" }; this._pendingPullIntos.push(pullIntoDescriptor); } ReadableStreamAddReadRequest(stream, readRequest); ReadableByteStreamControllerCallPullIfNeeded(this); } /** @internal */ [ReleaseSteps]() { if (this._pendingPullIntos.length > 0) { const firstPullInto = this._pendingPullIntos.peek(); firstPullInto.readerType = "none"; this._pendingPullIntos = new SimpleQueue(); this._pendingPullIntos.push(firstPullInto); } } } Object.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }); setFunctionName(ReadableByteStreamController.prototype.close, "close"); setFunctionName(ReadableByteStreamController.prototype.enqueue, "enqueue"); setFunctionName(ReadableByteStreamController.prototype.error, "error"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableByteStreamController.prototype, Symbol.toStringTag, { value: "ReadableByteStreamController", configurable: true }); } function IsReadableByteStreamController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_controlledReadableByteStream")) { return false; } return x2 instanceof ReadableByteStreamController; } function IsReadableStreamBYOBRequest(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_associatedReadableByteStreamController")) { return false; } return x2 instanceof ReadableStreamBYOBRequest; } function ReadableByteStreamControllerCallPullIfNeeded(controller) { const shouldPull = ReadableByteStreamControllerShouldCallPull(controller); if (!shouldPull) { return; } if (controller._pulling) { controller._pullAgain = true; return; } controller._pulling = true; const pullPromise = controller._pullAlgorithm(); uponPromise(pullPromise, () => { controller._pulling = false; if (controller._pullAgain) { controller._pullAgain = false; ReadableByteStreamControllerCallPullIfNeeded(controller); } return null; }, (e2) => { ReadableByteStreamControllerError(controller, e2); return null; }); } function ReadableByteStreamControllerClearPendingPullIntos(controller) { ReadableByteStreamControllerInvalidateBYOBRequest(controller); controller._pendingPullIntos = new SimpleQueue(); } function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) { let done = false; if (stream._state === "closed") { done = true; } const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); if (pullIntoDescriptor.readerType === "default") { ReadableStreamFulfillReadRequest(stream, filledView, done); } else { ReadableStreamFulfillReadIntoRequest(stream, filledView, done); } } function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) { const bytesFilled = pullIntoDescriptor.bytesFilled; const elementSize = pullIntoDescriptor.elementSize; return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize); } function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer2, byteOffset, byteLength) { controller._queue.push({ buffer: buffer2, byteOffset, byteLength }); controller._queueTotalSize += byteLength; } function ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, buffer2, byteOffset, byteLength) { let clonedChunk; try { clonedChunk = ArrayBufferSlice(buffer2, byteOffset, byteOffset + byteLength); } catch (cloneE) { ReadableByteStreamControllerError(controller, cloneE); throw cloneE; } ReadableByteStreamControllerEnqueueChunkToQueue(controller, clonedChunk, 0, byteLength); } function ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstDescriptor) { if (firstDescriptor.bytesFilled > 0) { ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, firstDescriptor.buffer, firstDescriptor.byteOffset, firstDescriptor.bytesFilled); } ReadableByteStreamControllerShiftPendingPullInto(controller); } function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) { const maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled); const maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy; let totalBytesToCopyRemaining = maxBytesToCopy; let ready = false; const remainderBytes = maxBytesFilled % pullIntoDescriptor.elementSize; const maxAlignedBytes = maxBytesFilled - remainderBytes; if (maxAlignedBytes >= pullIntoDescriptor.minimumFill) { totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled; ready = true; } const queue = controller._queue; while (totalBytesToCopyRemaining > 0) { const headOfQueue = queue.peek(); const bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength); const destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy); if (headOfQueue.byteLength === bytesToCopy) { queue.shift(); } else { headOfQueue.byteOffset += bytesToCopy; headOfQueue.byteLength -= bytesToCopy; } controller._queueTotalSize -= bytesToCopy; ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor); totalBytesToCopyRemaining -= bytesToCopy; } return ready; } function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) { pullIntoDescriptor.bytesFilled += size; } function ReadableByteStreamControllerHandleQueueDrain(controller) { if (controller._queueTotalSize === 0 && controller._closeRequested) { ReadableByteStreamControllerClearAlgorithms(controller); ReadableStreamClose(controller._controlledReadableByteStream); } else { ReadableByteStreamControllerCallPullIfNeeded(controller); } } function ReadableByteStreamControllerInvalidateBYOBRequest(controller) { if (controller._byobRequest === null) { return; } controller._byobRequest._associatedReadableByteStreamController = void 0; controller._byobRequest._view = null; controller._byobRequest = null; } function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) { while (controller._pendingPullIntos.length > 0) { if (controller._queueTotalSize === 0) { return; } const pullIntoDescriptor = controller._pendingPullIntos.peek(); if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) { ReadableByteStreamControllerShiftPendingPullInto(controller); ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor); } } } function ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller) { const reader = controller._controlledReadableByteStream._reader; while (reader._readRequests.length > 0) { if (controller._queueTotalSize === 0) { return; } const readRequest = reader._readRequests.shift(); ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest); } } function ReadableByteStreamControllerPullInto(controller, view, min, readIntoRequest) { const stream = controller._controlledReadableByteStream; const ctor = view.constructor; const elementSize = arrayBufferViewElementSize(ctor); const { byteOffset, byteLength } = view; const minimumFill = min * elementSize; let buffer2; try { buffer2 = TransferArrayBuffer(view.buffer); } catch (e2) { readIntoRequest._errorSteps(e2); return; } const pullIntoDescriptor = { buffer: buffer2, bufferByteLength: buffer2.byteLength, byteOffset, byteLength, bytesFilled: 0, minimumFill, elementSize, viewConstructor: ctor, readerType: "byob" }; if (controller._pendingPullIntos.length > 0) { controller._pendingPullIntos.push(pullIntoDescriptor); ReadableStreamAddReadIntoRequest(stream, readIntoRequest); return; } if (stream._state === "closed") { const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0); readIntoRequest._closeSteps(emptyView); return; } if (controller._queueTotalSize > 0) { if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) { const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); ReadableByteStreamControllerHandleQueueDrain(controller); readIntoRequest._chunkSteps(filledView); return; } if (controller._closeRequested) { const e2 = new TypeError("Insufficient bytes to fill elements in the given buffer"); ReadableByteStreamControllerError(controller, e2); readIntoRequest._errorSteps(e2); return; } } controller._pendingPullIntos.push(pullIntoDescriptor); ReadableStreamAddReadIntoRequest(stream, readIntoRequest); ReadableByteStreamControllerCallPullIfNeeded(controller); } function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) { if (firstDescriptor.readerType === "none") { ReadableByteStreamControllerShiftPendingPullInto(controller); } const stream = controller._controlledReadableByteStream; if (ReadableStreamHasBYOBReader(stream)) { while (ReadableStreamGetNumReadIntoRequests(stream) > 0) { const pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller); ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor); } } } function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) { ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor); if (pullIntoDescriptor.readerType === "none") { ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, pullIntoDescriptor); ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); return; } if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.minimumFill) { return; } ReadableByteStreamControllerShiftPendingPullInto(controller); const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize; if (remainderSize > 0) { const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, pullIntoDescriptor.buffer, end - remainderSize, remainderSize); } pullIntoDescriptor.bytesFilled -= remainderSize; ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor); ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); } function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) { const firstDescriptor = controller._pendingPullIntos.peek(); ReadableByteStreamControllerInvalidateBYOBRequest(controller); const state = controller._controlledReadableByteStream._state; if (state === "closed") { ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor); } else { ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor); } ReadableByteStreamControllerCallPullIfNeeded(controller); } function ReadableByteStreamControllerShiftPendingPullInto(controller) { const descriptor = controller._pendingPullIntos.shift(); return descriptor; } function ReadableByteStreamControllerShouldCallPull(controller) { const stream = controller._controlledReadableByteStream; if (stream._state !== "readable") { return false; } if (controller._closeRequested) { return false; } if (!controller._started) { return false; } if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) { return true; } if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) { return true; } const desiredSize = ReadableByteStreamControllerGetDesiredSize(controller); if (desiredSize > 0) { return true; } return false; } function ReadableByteStreamControllerClearAlgorithms(controller) { controller._pullAlgorithm = void 0; controller._cancelAlgorithm = void 0; } function ReadableByteStreamControllerClose(controller) { const stream = controller._controlledReadableByteStream; if (controller._closeRequested || stream._state !== "readable") { return; } if (controller._queueTotalSize > 0) { controller._closeRequested = true; return; } if (controller._pendingPullIntos.length > 0) { const firstPendingPullInto = controller._pendingPullIntos.peek(); if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) { const e2 = new TypeError("Insufficient bytes to fill elements in the given buffer"); ReadableByteStreamControllerError(controller, e2); throw e2; } } ReadableByteStreamControllerClearAlgorithms(controller); ReadableStreamClose(stream); } function ReadableByteStreamControllerEnqueue(controller, chunk) { const stream = controller._controlledReadableByteStream; if (controller._closeRequested || stream._state !== "readable") { return; } const { buffer: buffer2, byteOffset, byteLength } = chunk; if (IsDetachedBuffer(buffer2)) { throw new TypeError("chunk's buffer is detached and so cannot be enqueued"); } const transferredBuffer = TransferArrayBuffer(buffer2); if (controller._pendingPullIntos.length > 0) { const firstPendingPullInto = controller._pendingPullIntos.peek(); if (IsDetachedBuffer(firstPendingPullInto.buffer)) { throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk"); } ReadableByteStreamControllerInvalidateBYOBRequest(controller); firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer); if (firstPendingPullInto.readerType === "none") { ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstPendingPullInto); } } if (ReadableStreamHasDefaultReader(stream)) { ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller); if (ReadableStreamGetNumReadRequests(stream) === 0) { ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); } else { if (controller._pendingPullIntos.length > 0) { ReadableByteStreamControllerShiftPendingPullInto(controller); } const transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength); ReadableStreamFulfillReadRequest(stream, transferredView, false); } } else if (ReadableStreamHasBYOBReader(stream)) { ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); } else { ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); } ReadableByteStreamControllerCallPullIfNeeded(controller); } function ReadableByteStreamControllerError(controller, e2) { const stream = controller._controlledReadableByteStream; if (stream._state !== "readable") { return; } ReadableByteStreamControllerClearPendingPullIntos(controller); ResetQueue(controller); ReadableByteStreamControllerClearAlgorithms(controller); ReadableStreamError(stream, e2); } function ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest) { const entry = controller._queue.shift(); controller._queueTotalSize -= entry.byteLength; ReadableByteStreamControllerHandleQueueDrain(controller); const view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength); readRequest._chunkSteps(view); } function ReadableByteStreamControllerGetBYOBRequest(controller) { if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) { const firstDescriptor = controller._pendingPullIntos.peek(); const view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled); const byobRequest = Object.create(ReadableStreamBYOBRequest.prototype); SetUpReadableStreamBYOBRequest(byobRequest, controller, view); controller._byobRequest = byobRequest; } return controller._byobRequest; } function ReadableByteStreamControllerGetDesiredSize(controller) { const state = controller._controlledReadableByteStream._state; if (state === "errored") { return null; } if (state === "closed") { return 0; } return controller._strategyHWM - controller._queueTotalSize; } function ReadableByteStreamControllerRespond(controller, bytesWritten) { const firstDescriptor = controller._pendingPullIntos.peek(); const state = controller._controlledReadableByteStream._state; if (state === "closed") { if (bytesWritten !== 0) { throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream"); } } else { if (bytesWritten === 0) { throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream"); } if (firstDescriptor.bytesFilled + bytesWritten > firstDescriptor.byteLength) { throw new RangeError("bytesWritten out of range"); } } firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer); ReadableByteStreamControllerRespondInternal(controller, bytesWritten); } function ReadableByteStreamControllerRespondWithNewView(controller, view) { const firstDescriptor = controller._pendingPullIntos.peek(); const state = controller._controlledReadableByteStream._state; if (state === "closed") { if (view.byteLength !== 0) { throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream"); } } else { if (view.byteLength === 0) { throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream"); } } if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) { throw new RangeError("The region specified by view does not match byobRequest"); } if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) { throw new RangeError("The buffer of view has different capacity than byobRequest"); } if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) { throw new RangeError("The region specified by view is larger than byobRequest"); } const viewByteLength = view.byteLength; firstDescriptor.buffer = TransferArrayBuffer(view.buffer); ReadableByteStreamControllerRespondInternal(controller, viewByteLength); } function SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) { controller._controlledReadableByteStream = stream; controller._pullAgain = false; controller._pulling = false; controller._byobRequest = null; controller._queue = controller._queueTotalSize = void 0; ResetQueue(controller); controller._closeRequested = false; controller._started = false; controller._strategyHWM = highWaterMark; controller._pullAlgorithm = pullAlgorithm; controller._cancelAlgorithm = cancelAlgorithm; controller._autoAllocateChunkSize = autoAllocateChunkSize; controller._pendingPullIntos = new SimpleQueue(); stream._readableStreamController = controller; const startResult = startAlgorithm(); uponPromise(promiseResolvedWith(startResult), () => { controller._started = true; ReadableByteStreamControllerCallPullIfNeeded(controller); return null; }, (r2) => { ReadableByteStreamControllerError(controller, r2); return null; }); } function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) { const controller = Object.create(ReadableByteStreamController.prototype); let startAlgorithm; let pullAlgorithm; let cancelAlgorithm; if (underlyingByteSource.start !== void 0) { startAlgorithm = () => underlyingByteSource.start(controller); } else { startAlgorithm = () => void 0; } if (underlyingByteSource.pull !== void 0) { pullAlgorithm = () => underlyingByteSource.pull(controller); } else { pullAlgorithm = () => promiseResolvedWith(void 0); } if (underlyingByteSource.cancel !== void 0) { cancelAlgorithm = (reason) => underlyingByteSource.cancel(reason); } else { cancelAlgorithm = () => promiseResolvedWith(void 0); } const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize; if (autoAllocateChunkSize === 0) { throw new TypeError("autoAllocateChunkSize must be greater than 0"); } SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize); } function SetUpReadableStreamBYOBRequest(request, controller, view) { request._associatedReadableByteStreamController = controller; request._view = view; } function byobRequestBrandCheckException(name) { return new TypeError(`ReadableStreamBYOBRequest.prototype.${name} can only be used on a ReadableStreamBYOBRequest`); } function byteStreamControllerBrandCheckException(name) { return new TypeError(`ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`); } function convertReaderOptions(options, context) { assertDictionary(options, context); const mode = options === null || options === void 0 ? void 0 : options.mode; return { mode: mode === void 0 ? void 0 : convertReadableStreamReaderMode(mode, `${context} has member 'mode' that`) }; } function convertReadableStreamReaderMode(mode, context) { mode = `${mode}`; if (mode !== "byob") { throw new TypeError(`${context} '${mode}' is not a valid enumeration value for ReadableStreamReaderMode`); } return mode; } function convertByobReadOptions(options, context) { var _a2; assertDictionary(options, context); const min = (_a2 = options === null || options === void 0 ? void 0 : options.min) !== null && _a2 !== void 0 ? _a2 : 1; return { min: convertUnsignedLongLongWithEnforceRange(min, `${context} has member 'min' that`) }; } function AcquireReadableStreamBYOBReader(stream) { return new ReadableStreamBYOBReader(stream); } function ReadableStreamAddReadIntoRequest(stream, readIntoRequest) { stream._reader._readIntoRequests.push(readIntoRequest); } function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) { const reader = stream._reader; const readIntoRequest = reader._readIntoRequests.shift(); if (done) { readIntoRequest._closeSteps(chunk); } else { readIntoRequest._chunkSteps(chunk); } } function ReadableStreamGetNumReadIntoRequests(stream) { return stream._reader._readIntoRequests.length; } function ReadableStreamHasBYOBReader(stream) { const reader = stream._reader; if (reader === void 0) { return false; } if (!IsReadableStreamBYOBReader(reader)) { return false; } return true; } class ReadableStreamBYOBReader { constructor(stream) { assertRequiredArgument(stream, 1, "ReadableStreamBYOBReader"); assertReadableStream(stream, "First parameter"); if (IsReadableStreamLocked(stream)) { throw new TypeError("This stream has already been locked for exclusive reading by another reader"); } if (!IsReadableByteStreamController(stream._readableStreamController)) { throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source"); } ReadableStreamReaderGenericInitialize(this, stream); this._readIntoRequests = new SimpleQueue(); } /** * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or * the reader's lock is released before the stream finishes closing. */ get closed() { if (!IsReadableStreamBYOBReader(this)) { return promiseRejectedWith(byobReaderBrandCheckException("closed")); } return this._closedPromise; } /** * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}. */ cancel(reason = void 0) { if (!IsReadableStreamBYOBReader(this)) { return promiseRejectedWith(byobReaderBrandCheckException("cancel")); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException("cancel")); } return ReadableStreamReaderGenericCancel(this, reason); } read(view, rawOptions = {}) { if (!IsReadableStreamBYOBReader(this)) { return promiseRejectedWith(byobReaderBrandCheckException("read")); } if (!ArrayBuffer.isView(view)) { return promiseRejectedWith(new TypeError("view must be an array buffer view")); } if (view.byteLength === 0) { return promiseRejectedWith(new TypeError("view must have non-zero byteLength")); } if (view.buffer.byteLength === 0) { return promiseRejectedWith(new TypeError(`view's buffer must have non-zero byteLength`)); } if (IsDetachedBuffer(view.buffer)) { return promiseRejectedWith(new TypeError("view's buffer has been detached")); } let options; try { options = convertByobReadOptions(rawOptions, "options"); } catch (e2) { return promiseRejectedWith(e2); } const min = options.min; if (min === 0) { return promiseRejectedWith(new TypeError("options.min must be greater than 0")); } if (!isDataView(view)) { if (min > view.length) { return promiseRejectedWith(new RangeError("options.min must be less than or equal to view's length")); } } else if (min > view.byteLength) { return promiseRejectedWith(new RangeError("options.min must be less than or equal to view's byteLength")); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException("read from")); } let resolvePromise; let rejectPromise; const promise = newPromise((resolve, reject) => { resolvePromise = resolve; rejectPromise = reject; }); const readIntoRequest = { _chunkSteps: (chunk) => resolvePromise({ value: chunk, done: false }), _closeSteps: (chunk) => resolvePromise({ value: chunk, done: true }), _errorSteps: (e2) => rejectPromise(e2) }; ReadableStreamBYOBReaderRead(this, view, min, readIntoRequest); return promise; } /** * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active. * If the associated stream is errored when the lock is released, the reader will appear errored in the same way * from now on; otherwise, the reader will appear closed. * * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by * the reader's {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to * do so will throw a `TypeError` and leave the reader locked to the stream. */ releaseLock() { if (!IsReadableStreamBYOBReader(this)) { throw byobReaderBrandCheckException("releaseLock"); } if (this._ownerReadableStream === void 0) { return; } ReadableStreamBYOBReaderRelease(this); } } Object.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }); setFunctionName(ReadableStreamBYOBReader.prototype.cancel, "cancel"); setFunctionName(ReadableStreamBYOBReader.prototype.read, "read"); setFunctionName(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableStreamBYOBReader.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true }); } function IsReadableStreamBYOBReader(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_readIntoRequests")) { return false; } return x2 instanceof ReadableStreamBYOBReader; } function ReadableStreamBYOBReaderRead(reader, view, min, readIntoRequest) { const stream = reader._ownerReadableStream; stream._disturbed = true; if (stream._state === "errored") { readIntoRequest._errorSteps(stream._storedError); } else { ReadableByteStreamControllerPullInto(stream._readableStreamController, view, min, readIntoRequest); } } function ReadableStreamBYOBReaderRelease(reader) { ReadableStreamReaderGenericRelease(reader); const e2 = new TypeError("Reader was released"); ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e2); } function ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e2) { const readIntoRequests = reader._readIntoRequests; reader._readIntoRequests = new SimpleQueue(); readIntoRequests.forEach((readIntoRequest) => { readIntoRequest._errorSteps(e2); }); } function byobReaderBrandCheckException(name) { return new TypeError(`ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`); } function ExtractHighWaterMark(strategy, defaultHWM) { const { highWaterMark } = strategy; if (highWaterMark === void 0) { return defaultHWM; } if (NumberIsNaN(highWaterMark) || highWaterMark < 0) { throw new RangeError("Invalid highWaterMark"); } return highWaterMark; } function ExtractSizeAlgorithm(strategy) { const { size } = strategy; if (!size) { return () => 1; } return size; } function convertQueuingStrategy(init, context) { assertDictionary(init, context); const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark; const size = init === null || init === void 0 ? void 0 : init.size; return { highWaterMark: highWaterMark === void 0 ? void 0 : convertUnrestrictedDouble(highWaterMark), size: size === void 0 ? void 0 : convertQueuingStrategySize(size, `${context} has member 'size' that`) }; } function convertQueuingStrategySize(fn2, context) { assertFunction(fn2, context); return (chunk) => convertUnrestrictedDouble(fn2(chunk)); } function convertUnderlyingSink(original, context) { assertDictionary(original, context); const abort = original === null || original === void 0 ? void 0 : original.abort; const close = original === null || original === void 0 ? void 0 : original.close; const start = original === null || original === void 0 ? void 0 : original.start; const type = original === null || original === void 0 ? void 0 : original.type; const write = original === null || original === void 0 ? void 0 : original.write; return { abort: abort === void 0 ? void 0 : convertUnderlyingSinkAbortCallback(abort, original, `${context} has member 'abort' that`), close: close === void 0 ? void 0 : convertUnderlyingSinkCloseCallback(close, original, `${context} has member 'close' that`), start: start === void 0 ? void 0 : convertUnderlyingSinkStartCallback(start, original, `${context} has member 'start' that`), write: write === void 0 ? void 0 : convertUnderlyingSinkWriteCallback(write, original, `${context} has member 'write' that`), type }; } function convertUnderlyingSinkAbortCallback(fn2, original, context) { assertFunction(fn2, context); return (reason) => promiseCall(fn2, original, [reason]); } function convertUnderlyingSinkCloseCallback(fn2, original, context) { assertFunction(fn2, context); return () => promiseCall(fn2, original, []); } function convertUnderlyingSinkStartCallback(fn2, original, context) { assertFunction(fn2, context); return (controller) => reflectCall(fn2, original, [controller]); } function convertUnderlyingSinkWriteCallback(fn2, original, context) { assertFunction(fn2, context); return (chunk, controller) => promiseCall(fn2, original, [chunk, controller]); } function assertWritableStream(x2, context) { if (!IsWritableStream(x2)) { throw new TypeError(`${context} is not a WritableStream.`); } } function isAbortSignal2(value) { if (typeof value !== "object" || value === null) { return false; } try { return typeof value.aborted === "boolean"; } catch (_a2) { return false; } } const supportsAbortController = typeof AbortController === "function"; function createAbortController() { if (supportsAbortController) { return new AbortController(); } return void 0; } class WritableStream { constructor(rawUnderlyingSink = {}, rawStrategy = {}) { if (rawUnderlyingSink === void 0) { rawUnderlyingSink = null; } else { assertObject(rawUnderlyingSink, "First parameter"); } const strategy = convertQueuingStrategy(rawStrategy, "Second parameter"); const underlyingSink = convertUnderlyingSink(rawUnderlyingSink, "First parameter"); InitializeWritableStream(this); const type = underlyingSink.type; if (type !== void 0) { throw new RangeError("Invalid type is specified"); } const sizeAlgorithm = ExtractSizeAlgorithm(strategy); const highWaterMark = ExtractHighWaterMark(strategy, 1); SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm); } /** * Returns whether or not the writable stream is locked to a writer. */ get locked() { if (!IsWritableStream(this)) { throw streamBrandCheckException$2("locked"); } return IsWritableStreamLocked(this); } /** * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort * mechanism of the underlying sink. * * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel * the stream) if the stream is currently locked. */ abort(reason = void 0) { if (!IsWritableStream(this)) { return promiseRejectedWith(streamBrandCheckException$2("abort")); } if (IsWritableStreamLocked(this)) { return promiseRejectedWith(new TypeError("Cannot abort a stream that already has a writer")); } return WritableStreamAbort(this, reason); } /** * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its * close behavior. During this time any further attempts to write will fail (without erroring the stream). * * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked. */ close() { if (!IsWritableStream(this)) { return promiseRejectedWith(streamBrandCheckException$2("close")); } if (IsWritableStreamLocked(this)) { return promiseRejectedWith(new TypeError("Cannot close a stream that already has a writer")); } if (WritableStreamCloseQueuedOrInFlight(this)) { return promiseRejectedWith(new TypeError("Cannot close an already-closing stream")); } return WritableStreamClose(this); } /** * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream * is locked, no other writer can be acquired until this one is released. * * This functionality is especially useful for creating abstractions that desire the ability to write to a stream * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at * the same time, which would cause the resulting written data to be unpredictable and probably useless. */ getWriter() { if (!IsWritableStream(this)) { throw streamBrandCheckException$2("getWriter"); } return AcquireWritableStreamDefaultWriter(this); } } Object.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }); setFunctionName(WritableStream.prototype.abort, "abort"); setFunctionName(WritableStream.prototype.close, "close"); setFunctionName(WritableStream.prototype.getWriter, "getWriter"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(WritableStream.prototype, Symbol.toStringTag, { value: "WritableStream", configurable: true }); } function AcquireWritableStreamDefaultWriter(stream) { return new WritableStreamDefaultWriter(stream); } function CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) { const stream = Object.create(WritableStream.prototype); InitializeWritableStream(stream); const controller = Object.create(WritableStreamDefaultController.prototype); SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm); return stream; } function InitializeWritableStream(stream) { stream._state = "writable"; stream._storedError = void 0; stream._writer = void 0; stream._writableStreamController = void 0; stream._writeRequests = new SimpleQueue(); stream._inFlightWriteRequest = void 0; stream._closeRequest = void 0; stream._inFlightCloseRequest = void 0; stream._pendingAbortRequest = void 0; stream._backpressure = false; } function IsWritableStream(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_writableStreamController")) { return false; } return x2 instanceof WritableStream; } function IsWritableStreamLocked(stream) { if (stream._writer === void 0) { return false; } return true; } function WritableStreamAbort(stream, reason) { var _a2; if (stream._state === "closed" || stream._state === "errored") { return promiseResolvedWith(void 0); } stream._writableStreamController._abortReason = reason; (_a2 = stream._writableStreamController._abortController) === null || _a2 === void 0 ? void 0 : _a2.abort(reason); const state = stream._state; if (state === "closed" || state === "errored") { return promiseResolvedWith(void 0); } if (stream._pendingAbortRequest !== void 0) { return stream._pendingAbortRequest._promise; } let wasAlreadyErroring = false; if (state === "erroring") { wasAlreadyErroring = true; reason = void 0; } const promise = newPromise((resolve, reject) => { stream._pendingAbortRequest = { _promise: void 0, _resolve: resolve, _reject: reject, _reason: reason, _wasAlreadyErroring: wasAlreadyErroring }; }); stream._pendingAbortRequest._promise = promise; if (!wasAlreadyErroring) { WritableStreamStartErroring(stream, reason); } return promise; } function WritableStreamClose(stream) { const state = stream._state; if (state === "closed" || state === "errored") { return promiseRejectedWith(new TypeError(`The stream (in ${state} state) is not in the writable state and cannot be closed`)); } const promise = newPromise((resolve, reject) => { const closeRequest = { _resolve: resolve, _reject: reject }; stream._closeRequest = closeRequest; }); const writer = stream._writer; if (writer !== void 0 && stream._backpressure && state === "writable") { defaultWriterReadyPromiseResolve(writer); } WritableStreamDefaultControllerClose(stream._writableStreamController); return promise; } function WritableStreamAddWriteRequest(stream) { const promise = newPromise((resolve, reject) => { const writeRequest = { _resolve: resolve, _reject: reject }; stream._writeRequests.push(writeRequest); }); return promise; } function WritableStreamDealWithRejection(stream, error) { const state = stream._state; if (state === "writable") { WritableStreamStartErroring(stream, error); return; } WritableStreamFinishErroring(stream); } function WritableStreamStartErroring(stream, reason) { const controller = stream._writableStreamController; stream._state = "erroring"; stream._storedError = reason; const writer = stream._writer; if (writer !== void 0) { WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason); } if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) { WritableStreamFinishErroring(stream); } } function WritableStreamFinishErroring(stream) { stream._state = "errored"; stream._writableStreamController[ErrorSteps](); const storedError = stream._storedError; stream._writeRequests.forEach((writeRequest) => { writeRequest._reject(storedError); }); stream._writeRequests = new SimpleQueue(); if (stream._pendingAbortRequest === void 0) { WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return; } const abortRequest = stream._pendingAbortRequest; stream._pendingAbortRequest = void 0; if (abortRequest._wasAlreadyErroring) { abortRequest._reject(storedError); WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return; } const promise = stream._writableStreamController[AbortSteps](abortRequest._reason); uponPromise(promise, () => { abortRequest._resolve(); WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return null; }, (reason) => { abortRequest._reject(reason); WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return null; }); } function WritableStreamFinishInFlightWrite(stream) { stream._inFlightWriteRequest._resolve(void 0); stream._inFlightWriteRequest = void 0; } function WritableStreamFinishInFlightWriteWithError(stream, error) { stream._inFlightWriteRequest._reject(error); stream._inFlightWriteRequest = void 0; WritableStreamDealWithRejection(stream, error); } function WritableStreamFinishInFlightClose(stream) { stream._inFlightCloseRequest._resolve(void 0); stream._inFlightCloseRequest = void 0; const state = stream._state; if (state === "erroring") { stream._storedError = void 0; if (stream._pendingAbortRequest !== void 0) { stream._pendingAbortRequest._resolve(); stream._pendingAbortRequest = void 0; } } stream._state = "closed"; const writer = stream._writer; if (writer !== void 0) { defaultWriterClosedPromiseResolve(writer); } } function WritableStreamFinishInFlightCloseWithError(stream, error) { stream._inFlightCloseRequest._reject(error); stream._inFlightCloseRequest = void 0; if (stream._pendingAbortRequest !== void 0) { stream._pendingAbortRequest._reject(error); stream._pendingAbortRequest = void 0; } WritableStreamDealWithRejection(stream, error); } function WritableStreamCloseQueuedOrInFlight(stream) { if (stream._closeRequest === void 0 && stream._inFlightCloseRequest === void 0) { return false; } return true; } function WritableStreamHasOperationMarkedInFlight(stream) { if (stream._inFlightWriteRequest === void 0 && stream._inFlightCloseRequest === void 0) { return false; } return true; } function WritableStreamMarkCloseRequestInFlight(stream) { stream._inFlightCloseRequest = stream._closeRequest; stream._closeRequest = void 0; } function WritableStreamMarkFirstWriteRequestInFlight(stream) { stream._inFlightWriteRequest = stream._writeRequests.shift(); } function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) { if (stream._closeRequest !== void 0) { stream._closeRequest._reject(stream._storedError); stream._closeRequest = void 0; } const writer = stream._writer; if (writer !== void 0) { defaultWriterClosedPromiseReject(writer, stream._storedError); } } function WritableStreamUpdateBackpressure(stream, backpressure) { const writer = stream._writer; if (writer !== void 0 && backpressure !== stream._backpressure) { if (backpressure) { defaultWriterReadyPromiseReset(writer); } else { defaultWriterReadyPromiseResolve(writer); } } stream._backpressure = backpressure; } class WritableStreamDefaultWriter { constructor(stream) { assertRequiredArgument(stream, 1, "WritableStreamDefaultWriter"); assertWritableStream(stream, "First parameter"); if (IsWritableStreamLocked(stream)) { throw new TypeError("This stream has already been locked for exclusive writing by another writer"); } this._ownerWritableStream = stream; stream._writer = this; const state = stream._state; if (state === "writable") { if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) { defaultWriterReadyPromiseInitialize(this); } else { defaultWriterReadyPromiseInitializeAsResolved(this); } defaultWriterClosedPromiseInitialize(this); } else if (state === "erroring") { defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError); defaultWriterClosedPromiseInitialize(this); } else if (state === "closed") { defaultWriterReadyPromiseInitializeAsResolved(this); defaultWriterClosedPromiseInitializeAsResolved(this); } else { const storedError = stream._storedError; defaultWriterReadyPromiseInitializeAsRejected(this, storedError); defaultWriterClosedPromiseInitializeAsRejected(this, storedError); } } /** * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or * the writer’s lock is released before the stream finishes closing. */ get closed() { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException("closed")); } return this._closedPromise; } /** * Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full. * A producer can use this information to determine the right amount of data to write. * * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when * the writer’s lock is released. */ get desiredSize() { if (!IsWritableStreamDefaultWriter(this)) { throw defaultWriterBrandCheckException("desiredSize"); } if (this._ownerWritableStream === void 0) { throw defaultWriterLockException("desiredSize"); } return WritableStreamDefaultWriterGetDesiredSize(this); } /** * Returns a promise that will be fulfilled when the desired size to fill the stream’s internal queue transitions * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips * back to zero or below, the getter will return a new promise that stays pending until the next transition. * * If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become * rejected. */ get ready() { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException("ready")); } return this._readyPromise; } /** * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}. */ abort(reason = void 0) { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException("abort")); } if (this._ownerWritableStream === void 0) { return promiseRejectedWith(defaultWriterLockException("abort")); } return WritableStreamDefaultWriterAbort(this, reason); } /** * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}. */ close() { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException("close")); } const stream = this._ownerWritableStream; if (stream === void 0) { return promiseRejectedWith(defaultWriterLockException("close")); } if (WritableStreamCloseQueuedOrInFlight(stream)) { return promiseRejectedWith(new TypeError("Cannot close an already-closing stream")); } return WritableStreamDefaultWriterClose(this); } /** * Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active. * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from * now on; otherwise, the writer will appear closed. * * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled). * It’s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents * other producers from writing in an interleaved manner. */ releaseLock() { if (!IsWritableStreamDefaultWriter(this)) { throw defaultWriterBrandCheckException("releaseLock"); } const stream = this._ownerWritableStream; if (stream === void 0) { return; } WritableStreamDefaultWriterRelease(this); } write(chunk = void 0) { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException("write")); } if (this._ownerWritableStream === void 0) { return promiseRejectedWith(defaultWriterLockException("write to")); } return WritableStreamDefaultWriterWrite(this, chunk); } } Object.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }); setFunctionName(WritableStreamDefaultWriter.prototype.abort, "abort"); setFunctionName(WritableStreamDefaultWriter.prototype.close, "close"); setFunctionName(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"); setFunctionName(WritableStreamDefaultWriter.prototype.write, "write"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(WritableStreamDefaultWriter.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true }); } function IsWritableStreamDefaultWriter(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_ownerWritableStream")) { return false; } return x2 instanceof WritableStreamDefaultWriter; } function WritableStreamDefaultWriterAbort(writer, reason) { const stream = writer._ownerWritableStream; return WritableStreamAbort(stream, reason); } function WritableStreamDefaultWriterClose(writer) { const stream = writer._ownerWritableStream; return WritableStreamClose(stream); } function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) { const stream = writer._ownerWritableStream; const state = stream._state; if (WritableStreamCloseQueuedOrInFlight(stream) || state === "closed") { return promiseResolvedWith(void 0); } if (state === "errored") { return promiseRejectedWith(stream._storedError); } return WritableStreamDefaultWriterClose(writer); } function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) { if (writer._closedPromiseState === "pending") { defaultWriterClosedPromiseReject(writer, error); } else { defaultWriterClosedPromiseResetToRejected(writer, error); } } function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) { if (writer._readyPromiseState === "pending") { defaultWriterReadyPromiseReject(writer, error); } else { defaultWriterReadyPromiseResetToRejected(writer, error); } } function WritableStreamDefaultWriterGetDesiredSize(writer) { const stream = writer._ownerWritableStream; const state = stream._state; if (state === "errored" || state === "erroring") { return null; } if (state === "closed") { return 0; } return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController); } function WritableStreamDefaultWriterRelease(writer) { const stream = writer._ownerWritableStream; const releasedError = new TypeError(`Writer was released and can no longer be used to monitor the stream's closedness`); WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError); WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError); stream._writer = void 0; writer._ownerWritableStream = void 0; } function WritableStreamDefaultWriterWrite(writer, chunk) { const stream = writer._ownerWritableStream; const controller = stream._writableStreamController; const chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk); if (stream !== writer._ownerWritableStream) { return promiseRejectedWith(defaultWriterLockException("write to")); } const state = stream._state; if (state === "errored") { return promiseRejectedWith(stream._storedError); } if (WritableStreamCloseQueuedOrInFlight(stream) || state === "closed") { return promiseRejectedWith(new TypeError("The stream is closing or closed and cannot be written to")); } if (state === "erroring") { return promiseRejectedWith(stream._storedError); } const promise = WritableStreamAddWriteRequest(stream); WritableStreamDefaultControllerWrite(controller, chunk, chunkSize); return promise; } const closeSentinel = {}; class WritableStreamDefaultController { constructor() { throw new TypeError("Illegal constructor"); } /** * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted. * * @deprecated * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177. * Use {@link WritableStreamDefaultController.signal}'s `reason` instead. */ get abortReason() { if (!IsWritableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$2("abortReason"); } return this._abortReason; } /** * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted. */ get signal() { if (!IsWritableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$2("signal"); } if (this._abortController === void 0) { throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported"); } return this._abortController.signal; } /** * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`. * * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying * sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the * normal lifecycle of interactions with the underlying sink. */ error(e2 = void 0) { if (!IsWritableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$2("error"); } const state = this._controlledWritableStream._state; if (state !== "writable") { return; } WritableStreamDefaultControllerError(this, e2); } /** @internal */ [AbortSteps](reason) { const result = this._abortAlgorithm(reason); WritableStreamDefaultControllerClearAlgorithms(this); return result; } /** @internal */ [ErrorSteps]() { ResetQueue(this); } } Object.defineProperties(WritableStreamDefaultController.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(WritableStreamDefaultController.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultController", configurable: true }); } function IsWritableStreamDefaultController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_controlledWritableStream")) { return false; } return x2 instanceof WritableStreamDefaultController; } function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) { controller._controlledWritableStream = stream; stream._writableStreamController = controller; controller._queue = void 0; controller._queueTotalSize = void 0; ResetQueue(controller); controller._abortReason = void 0; controller._abortController = createAbortController(); controller._started = false; controller._strategySizeAlgorithm = sizeAlgorithm; controller._strategyHWM = highWaterMark; controller._writeAlgorithm = writeAlgorithm; controller._closeAlgorithm = closeAlgorithm; controller._abortAlgorithm = abortAlgorithm; const backpressure = WritableStreamDefaultControllerGetBackpressure(controller); WritableStreamUpdateBackpressure(stream, backpressure); const startResult = startAlgorithm(); const startPromise = promiseResolvedWith(startResult); uponPromise(startPromise, () => { controller._started = true; WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); return null; }, (r2) => { controller._started = true; WritableStreamDealWithRejection(stream, r2); return null; }); } function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) { const controller = Object.create(WritableStreamDefaultController.prototype); let startAlgorithm; let writeAlgorithm; let closeAlgorithm; let abortAlgorithm; if (underlyingSink.start !== void 0) { startAlgorithm = () => underlyingSink.start(controller); } else { startAlgorithm = () => void 0; } if (underlyingSink.write !== void 0) { writeAlgorithm = (chunk) => underlyingSink.write(chunk, controller); } else { writeAlgorithm = () => promiseResolvedWith(void 0); } if (underlyingSink.close !== void 0) { closeAlgorithm = () => underlyingSink.close(); } else { closeAlgorithm = () => promiseResolvedWith(void 0); } if (underlyingSink.abort !== void 0) { abortAlgorithm = (reason) => underlyingSink.abort(reason); } else { abortAlgorithm = () => promiseResolvedWith(void 0); } SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm); } function WritableStreamDefaultControllerClearAlgorithms(controller) { controller._writeAlgorithm = void 0; controller._closeAlgorithm = void 0; controller._abortAlgorithm = void 0; controller._strategySizeAlgorithm = void 0; } function WritableStreamDefaultControllerClose(controller) { EnqueueValueWithSize(controller, closeSentinel, 0); WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); } function WritableStreamDefaultControllerGetChunkSize(controller, chunk) { try { return controller._strategySizeAlgorithm(chunk); } catch (chunkSizeE) { WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE); return 1; } } function WritableStreamDefaultControllerGetDesiredSize(controller) { return controller._strategyHWM - controller._queueTotalSize; } function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) { try { EnqueueValueWithSize(controller, chunk, chunkSize); } catch (enqueueE) { WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE); return; } const stream = controller._controlledWritableStream; if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === "writable") { const backpressure = WritableStreamDefaultControllerGetBackpressure(controller); WritableStreamUpdateBackpressure(stream, backpressure); } WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); } function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) { const stream = controller._controlledWritableStream; if (!controller._started) { return; } if (stream._inFlightWriteRequest !== void 0) { return; } const state = stream._state; if (state === "erroring") { WritableStreamFinishErroring(stream); return; } if (controller._queue.length === 0) { return; } const value = PeekQueueValue(controller); if (value === closeSentinel) { WritableStreamDefaultControllerProcessClose(controller); } else { WritableStreamDefaultControllerProcessWrite(controller, value); } } function WritableStreamDefaultControllerErrorIfNeeded(controller, error) { if (controller._controlledWritableStream._state === "writable") { WritableStreamDefaultControllerError(controller, error); } } function WritableStreamDefaultControllerProcessClose(controller) { const stream = controller._controlledWritableStream; WritableStreamMarkCloseRequestInFlight(stream); DequeueValue(controller); const sinkClosePromise = controller._closeAlgorithm(); WritableStreamDefaultControllerClearAlgorithms(controller); uponPromise(sinkClosePromise, () => { WritableStreamFinishInFlightClose(stream); return null; }, (reason) => { WritableStreamFinishInFlightCloseWithError(stream, reason); return null; }); } function WritableStreamDefaultControllerProcessWrite(controller, chunk) { const stream = controller._controlledWritableStream; WritableStreamMarkFirstWriteRequestInFlight(stream); const sinkWritePromise = controller._writeAlgorithm(chunk); uponPromise(sinkWritePromise, () => { WritableStreamFinishInFlightWrite(stream); const state = stream._state; DequeueValue(controller); if (!WritableStreamCloseQueuedOrInFlight(stream) && state === "writable") { const backpressure = WritableStreamDefaultControllerGetBackpressure(controller); WritableStreamUpdateBackpressure(stream, backpressure); } WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); return null; }, (reason) => { if (stream._state === "writable") { WritableStreamDefaultControllerClearAlgorithms(controller); } WritableStreamFinishInFlightWriteWithError(stream, reason); return null; }); } function WritableStreamDefaultControllerGetBackpressure(controller) { const desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller); return desiredSize <= 0; } function WritableStreamDefaultControllerError(controller, error) { const stream = controller._controlledWritableStream; WritableStreamDefaultControllerClearAlgorithms(controller); WritableStreamStartErroring(stream, error); } function streamBrandCheckException$2(name) { return new TypeError(`WritableStream.prototype.${name} can only be used on a WritableStream`); } function defaultControllerBrandCheckException$2(name) { return new TypeError(`WritableStreamDefaultController.prototype.${name} can only be used on a WritableStreamDefaultController`); } function defaultWriterBrandCheckException(name) { return new TypeError(`WritableStreamDefaultWriter.prototype.${name} can only be used on a WritableStreamDefaultWriter`); } function defaultWriterLockException(name) { return new TypeError("Cannot " + name + " a stream using a released writer"); } function defaultWriterClosedPromiseInitialize(writer) { writer._closedPromise = newPromise((resolve, reject) => { writer._closedPromise_resolve = resolve; writer._closedPromise_reject = reject; writer._closedPromiseState = "pending"; }); } function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) { defaultWriterClosedPromiseInitialize(writer); defaultWriterClosedPromiseReject(writer, reason); } function defaultWriterClosedPromiseInitializeAsResolved(writer) { defaultWriterClosedPromiseInitialize(writer); defaultWriterClosedPromiseResolve(writer); } function defaultWriterClosedPromiseReject(writer, reason) { if (writer._closedPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(writer._closedPromise); writer._closedPromise_reject(reason); writer._closedPromise_resolve = void 0; writer._closedPromise_reject = void 0; writer._closedPromiseState = "rejected"; } function defaultWriterClosedPromiseResetToRejected(writer, reason) { defaultWriterClosedPromiseInitializeAsRejected(writer, reason); } function defaultWriterClosedPromiseResolve(writer) { if (writer._closedPromise_resolve === void 0) { return; } writer._closedPromise_resolve(void 0); writer._closedPromise_resolve = void 0; writer._closedPromise_reject = void 0; writer._closedPromiseState = "resolved"; } function defaultWriterReadyPromiseInitialize(writer) { writer._readyPromise = newPromise((resolve, reject) => { writer._readyPromise_resolve = resolve; writer._readyPromise_reject = reject; }); writer._readyPromiseState = "pending"; } function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) { defaultWriterReadyPromiseInitialize(writer); defaultWriterReadyPromiseReject(writer, reason); } function defaultWriterReadyPromiseInitializeAsResolved(writer) { defaultWriterReadyPromiseInitialize(writer); defaultWriterReadyPromiseResolve(writer); } function defaultWriterReadyPromiseReject(writer, reason) { if (writer._readyPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(writer._readyPromise); writer._readyPromise_reject(reason); writer._readyPromise_resolve = void 0; writer._readyPromise_reject = void 0; writer._readyPromiseState = "rejected"; } function defaultWriterReadyPromiseReset(writer) { defaultWriterReadyPromiseInitialize(writer); } function defaultWriterReadyPromiseResetToRejected(writer, reason) { defaultWriterReadyPromiseInitializeAsRejected(writer, reason); } function defaultWriterReadyPromiseResolve(writer) { if (writer._readyPromise_resolve === void 0) { return; } writer._readyPromise_resolve(void 0); writer._readyPromise_resolve = void 0; writer._readyPromise_reject = void 0; writer._readyPromiseState = "fulfilled"; } function getGlobals() { if (typeof globalThis !== "undefined") { return globalThis; } else if (typeof self !== "undefined") { return self; } else if (typeof global !== "undefined") { return global; } return void 0; } const globals = getGlobals(); function isDOMExceptionConstructor(ctor) { if (!(typeof ctor === "function" || typeof ctor === "object")) { return false; } if (ctor.name !== "DOMException") { return false; } try { new ctor(); return true; } catch (_a2) { return false; } } function getFromGlobal() { const ctor = globals === null || globals === void 0 ? void 0 : globals.DOMException; return isDOMExceptionConstructor(ctor) ? ctor : void 0; } function createPolyfill() { const ctor = function DOMException3(message2, name) { this.message = message2 || ""; this.name = name || "Error"; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } }; setFunctionName(ctor, "DOMException"); ctor.prototype = Object.create(Error.prototype); Object.defineProperty(ctor.prototype, "constructor", { value: ctor, writable: true, configurable: true }); return ctor; } const DOMException2 = getFromGlobal() || createPolyfill(); function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) { const reader = AcquireReadableStreamDefaultReader(source); const writer = AcquireWritableStreamDefaultWriter(dest); source._disturbed = true; let shuttingDown = false; let currentWrite = promiseResolvedWith(void 0); return newPromise((resolve, reject) => { let abortAlgorithm; if (signal !== void 0) { abortAlgorithm = () => { const error = signal.reason !== void 0 ? signal.reason : new DOMException2("Aborted", "AbortError"); const actions = []; if (!preventAbort) { actions.push(() => { if (dest._state === "writable") { return WritableStreamAbort(dest, error); } return promiseResolvedWith(void 0); }); } if (!preventCancel) { actions.push(() => { if (source._state === "readable") { return ReadableStreamCancel(source, error); } return promiseResolvedWith(void 0); }); } shutdownWithAction(() => Promise.all(actions.map((action) => action())), true, error); }; if (signal.aborted) { abortAlgorithm(); return; } signal.addEventListener("abort", abortAlgorithm); } function pipeLoop() { return newPromise((resolveLoop, rejectLoop) => { function next(done) { if (done) { resolveLoop(); } else { PerformPromiseThen(pipeStep(), next, rejectLoop); } } next(false); }); } function pipeStep() { if (shuttingDown) { return promiseResolvedWith(true); } return PerformPromiseThen(writer._readyPromise, () => { return newPromise((resolveRead, rejectRead) => { ReadableStreamDefaultReaderRead(reader, { _chunkSteps: (chunk) => { currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), void 0, noop2); resolveRead(false); }, _closeSteps: () => resolveRead(true), _errorSteps: rejectRead }); }); }); } isOrBecomesErrored(source, reader._closedPromise, (storedError) => { if (!preventAbort) { shutdownWithAction(() => WritableStreamAbort(dest, storedError), true, storedError); } else { shutdown(true, storedError); } return null; }); isOrBecomesErrored(dest, writer._closedPromise, (storedError) => { if (!preventCancel) { shutdownWithAction(() => ReadableStreamCancel(source, storedError), true, storedError); } else { shutdown(true, storedError); } return null; }); isOrBecomesClosed(source, reader._closedPromise, () => { if (!preventClose) { shutdownWithAction(() => WritableStreamDefaultWriterCloseWithErrorPropagation(writer)); } else { shutdown(); } return null; }); if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === "closed") { const destClosed = new TypeError("the destination writable stream closed before all data could be piped to it"); if (!preventCancel) { shutdownWithAction(() => ReadableStreamCancel(source, destClosed), true, destClosed); } else { shutdown(true, destClosed); } } setPromiseIsHandledToTrue(pipeLoop()); function waitForWritesToFinish() { const oldCurrentWrite = currentWrite; return PerformPromiseThen(currentWrite, () => oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : void 0); } function isOrBecomesErrored(stream, promise, action) { if (stream._state === "errored") { action(stream._storedError); } else { uponRejection(promise, action); } } function isOrBecomesClosed(stream, promise, action) { if (stream._state === "closed") { action(); } else { uponFulfillment(promise, action); } } function shutdownWithAction(action, originalIsError, originalError) { if (shuttingDown) { return; } shuttingDown = true; if (dest._state === "writable" && !WritableStreamCloseQueuedOrInFlight(dest)) { uponFulfillment(waitForWritesToFinish(), doTheRest); } else { doTheRest(); } function doTheRest() { uponPromise(action(), () => finalize(originalIsError, originalError), (newError) => finalize(true, newError)); return null; } } function shutdown(isError, error) { if (shuttingDown) { return; } shuttingDown = true; if (dest._state === "writable" && !WritableStreamCloseQueuedOrInFlight(dest)) { uponFulfillment(waitForWritesToFinish(), () => finalize(isError, error)); } else { finalize(isError, error); } } function finalize(isError, error) { WritableStreamDefaultWriterRelease(writer); ReadableStreamReaderGenericRelease(reader); if (signal !== void 0) { signal.removeEventListener("abort", abortAlgorithm); } if (isError) { reject(error); } else { resolve(void 0); } return null; } }); } class ReadableStreamDefaultController { constructor() { throw new TypeError("Illegal constructor"); } /** * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is * over-full. An underlying source ought to use this information to determine when and how to apply backpressure. */ get desiredSize() { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1("desiredSize"); } return ReadableStreamDefaultControllerGetDesiredSize(this); } /** * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from * the stream, but once those are read, the stream will become closed. */ close() { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1("close"); } if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) { throw new TypeError("The stream is not in a state that permits close"); } ReadableStreamDefaultControllerClose(this); } enqueue(chunk = void 0) { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1("enqueue"); } if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) { throw new TypeError("The stream is not in a state that permits enqueue"); } return ReadableStreamDefaultControllerEnqueue(this, chunk); } /** * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`. */ error(e2 = void 0) { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1("error"); } ReadableStreamDefaultControllerError(this, e2); } /** @internal */ [CancelSteps](reason) { ResetQueue(this); const result = this._cancelAlgorithm(reason); ReadableStreamDefaultControllerClearAlgorithms(this); return result; } /** @internal */ [PullSteps](readRequest) { const stream = this._controlledReadableStream; if (this._queue.length > 0) { const chunk = DequeueValue(this); if (this._closeRequested && this._queue.length === 0) { ReadableStreamDefaultControllerClearAlgorithms(this); ReadableStreamClose(stream); } else { ReadableStreamDefaultControllerCallPullIfNeeded(this); } readRequest._chunkSteps(chunk); } else { ReadableStreamAddReadRequest(stream, readRequest); ReadableStreamDefaultControllerCallPullIfNeeded(this); } } /** @internal */ [ReleaseSteps]() { } } Object.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }); setFunctionName(ReadableStreamDefaultController.prototype.close, "close"); setFunctionName(ReadableStreamDefaultController.prototype.enqueue, "enqueue"); setFunctionName(ReadableStreamDefaultController.prototype.error, "error"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableStreamDefaultController.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultController", configurable: true }); } function IsReadableStreamDefaultController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_controlledReadableStream")) { return false; } return x2 instanceof ReadableStreamDefaultController; } function ReadableStreamDefaultControllerCallPullIfNeeded(controller) { const shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller); if (!shouldPull) { return; } if (controller._pulling) { controller._pullAgain = true; return; } controller._pulling = true; const pullPromise = controller._pullAlgorithm(); uponPromise(pullPromise, () => { controller._pulling = false; if (controller._pullAgain) { controller._pullAgain = false; ReadableStreamDefaultControllerCallPullIfNeeded(controller); } return null; }, (e2) => { ReadableStreamDefaultControllerError(controller, e2); return null; }); } function ReadableStreamDefaultControllerShouldCallPull(controller) { const stream = controller._controlledReadableStream; if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { return false; } if (!controller._started) { return false; } if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) { return true; } const desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller); if (desiredSize > 0) { return true; } return false; } function ReadableStreamDefaultControllerClearAlgorithms(controller) { controller._pullAlgorithm = void 0; controller._cancelAlgorithm = void 0; controller._strategySizeAlgorithm = void 0; } function ReadableStreamDefaultControllerClose(controller) { if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { return; } const stream = controller._controlledReadableStream; controller._closeRequested = true; if (controller._queue.length === 0) { ReadableStreamDefaultControllerClearAlgorithms(controller); ReadableStreamClose(stream); } } function ReadableStreamDefaultControllerEnqueue(controller, chunk) { if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { return; } const stream = controller._controlledReadableStream; if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) { ReadableStreamFulfillReadRequest(stream, chunk, false); } else { let chunkSize; try { chunkSize = controller._strategySizeAlgorithm(chunk); } catch (chunkSizeE) { ReadableStreamDefaultControllerError(controller, chunkSizeE); throw chunkSizeE; } try { EnqueueValueWithSize(controller, chunk, chunkSize); } catch (enqueueE) { ReadableStreamDefaultControllerError(controller, enqueueE); throw enqueueE; } } ReadableStreamDefaultControllerCallPullIfNeeded(controller); } function ReadableStreamDefaultControllerError(controller, e2) { const stream = controller._controlledReadableStream; if (stream._state !== "readable") { return; } ResetQueue(controller); ReadableStreamDefaultControllerClearAlgorithms(controller); ReadableStreamError(stream, e2); } function ReadableStreamDefaultControllerGetDesiredSize(controller) { const state = controller._controlledReadableStream._state; if (state === "errored") { return null; } if (state === "closed") { return 0; } return controller._strategyHWM - controller._queueTotalSize; } function ReadableStreamDefaultControllerHasBackpressure(controller) { if (ReadableStreamDefaultControllerShouldCallPull(controller)) { return false; } return true; } function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) { const state = controller._controlledReadableStream._state; if (!controller._closeRequested && state === "readable") { return true; } return false; } function SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) { controller._controlledReadableStream = stream; controller._queue = void 0; controller._queueTotalSize = void 0; ResetQueue(controller); controller._started = false; controller._closeRequested = false; controller._pullAgain = false; controller._pulling = false; controller._strategySizeAlgorithm = sizeAlgorithm; controller._strategyHWM = highWaterMark; controller._pullAlgorithm = pullAlgorithm; controller._cancelAlgorithm = cancelAlgorithm; stream._readableStreamController = controller; const startResult = startAlgorithm(); uponPromise(promiseResolvedWith(startResult), () => { controller._started = true; ReadableStreamDefaultControllerCallPullIfNeeded(controller); return null; }, (r2) => { ReadableStreamDefaultControllerError(controller, r2); return null; }); } function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) { const controller = Object.create(ReadableStreamDefaultController.prototype); let startAlgorithm; let pullAlgorithm; let cancelAlgorithm; if (underlyingSource.start !== void 0) { startAlgorithm = () => underlyingSource.start(controller); } else { startAlgorithm = () => void 0; } if (underlyingSource.pull !== void 0) { pullAlgorithm = () => underlyingSource.pull(controller); } else { pullAlgorithm = () => promiseResolvedWith(void 0); } if (underlyingSource.cancel !== void 0) { cancelAlgorithm = (reason) => underlyingSource.cancel(reason); } else { cancelAlgorithm = () => promiseResolvedWith(void 0); } SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm); } function defaultControllerBrandCheckException$1(name) { return new TypeError(`ReadableStreamDefaultController.prototype.${name} can only be used on a ReadableStreamDefaultController`); } function ReadableStreamTee(stream, cloneForBranch2) { if (IsReadableByteStreamController(stream._readableStreamController)) { return ReadableByteStreamTee(stream); } return ReadableStreamDefaultTee(stream); } function ReadableStreamDefaultTee(stream, cloneForBranch2) { const reader = AcquireReadableStreamDefaultReader(stream); let reading = false; let readAgain = false; let canceled1 = false; let canceled2 = false; let reason1; let reason2; let branch1; let branch2; let resolveCancelPromise; const cancelPromise = newPromise((resolve) => { resolveCancelPromise = resolve; }); function pullAlgorithm() { if (reading) { readAgain = true; return promiseResolvedWith(void 0); } reading = true; const readRequest = { _chunkSteps: (chunk) => { _queueMicrotask(() => { readAgain = false; const chunk1 = chunk; const chunk2 = chunk; if (!canceled1) { ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1); } if (!canceled2) { ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2); } reading = false; if (readAgain) { pullAlgorithm(); } }); }, _closeSteps: () => { reading = false; if (!canceled1) { ReadableStreamDefaultControllerClose(branch1._readableStreamController); } if (!canceled2) { ReadableStreamDefaultControllerClose(branch2._readableStreamController); } if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } }, _errorSteps: () => { reading = false; } }; ReadableStreamDefaultReaderRead(reader, readRequest); return promiseResolvedWith(void 0); } function cancel1Algorithm(reason) { canceled1 = true; reason1 = reason; if (canceled2) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function cancel2Algorithm(reason) { canceled2 = true; reason2 = reason; if (canceled1) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function startAlgorithm() { } branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm); branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm); uponRejection(reader._closedPromise, (r2) => { ReadableStreamDefaultControllerError(branch1._readableStreamController, r2); ReadableStreamDefaultControllerError(branch2._readableStreamController, r2); if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } return null; }); return [branch1, branch2]; } function ReadableByteStreamTee(stream) { let reader = AcquireReadableStreamDefaultReader(stream); let reading = false; let readAgainForBranch1 = false; let readAgainForBranch2 = false; let canceled1 = false; let canceled2 = false; let reason1; let reason2; let branch1; let branch2; let resolveCancelPromise; const cancelPromise = newPromise((resolve) => { resolveCancelPromise = resolve; }); function forwardReaderError(thisReader) { uponRejection(thisReader._closedPromise, (r2) => { if (thisReader !== reader) { return null; } ReadableByteStreamControllerError(branch1._readableStreamController, r2); ReadableByteStreamControllerError(branch2._readableStreamController, r2); if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } return null; }); } function pullWithDefaultReader() { if (IsReadableStreamBYOBReader(reader)) { ReadableStreamReaderGenericRelease(reader); reader = AcquireReadableStreamDefaultReader(stream); forwardReaderError(reader); } const readRequest = { _chunkSteps: (chunk) => { _queueMicrotask(() => { readAgainForBranch1 = false; readAgainForBranch2 = false; const chunk1 = chunk; let chunk2 = chunk; if (!canceled1 && !canceled2) { try { chunk2 = CloneAsUint8Array(chunk); } catch (cloneE) { ReadableByteStreamControllerError(branch1._readableStreamController, cloneE); ReadableByteStreamControllerError(branch2._readableStreamController, cloneE); resolveCancelPromise(ReadableStreamCancel(stream, cloneE)); return; } } if (!canceled1) { ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1); } if (!canceled2) { ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2); } reading = false; if (readAgainForBranch1) { pull1Algorithm(); } else if (readAgainForBranch2) { pull2Algorithm(); } }); }, _closeSteps: () => { reading = false; if (!canceled1) { ReadableByteStreamControllerClose(branch1._readableStreamController); } if (!canceled2) { ReadableByteStreamControllerClose(branch2._readableStreamController); } if (branch1._readableStreamController._pendingPullIntos.length > 0) { ReadableByteStreamControllerRespond(branch1._readableStreamController, 0); } if (branch2._readableStreamController._pendingPullIntos.length > 0) { ReadableByteStreamControllerRespond(branch2._readableStreamController, 0); } if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } }, _errorSteps: () => { reading = false; } }; ReadableStreamDefaultReaderRead(reader, readRequest); } function pullWithBYOBReader(view, forBranch2) { if (IsReadableStreamDefaultReader(reader)) { ReadableStreamReaderGenericRelease(reader); reader = AcquireReadableStreamBYOBReader(stream); forwardReaderError(reader); } const byobBranch = forBranch2 ? branch2 : branch1; const otherBranch = forBranch2 ? branch1 : branch2; const readIntoRequest = { _chunkSteps: (chunk) => { _queueMicrotask(() => { readAgainForBranch1 = false; readAgainForBranch2 = false; const byobCanceled = forBranch2 ? canceled2 : canceled1; const otherCanceled = forBranch2 ? canceled1 : canceled2; if (!otherCanceled) { let clonedChunk; try { clonedChunk = CloneAsUint8Array(chunk); } catch (cloneE) { ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE); ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE); resolveCancelPromise(ReadableStreamCancel(stream, cloneE)); return; } if (!byobCanceled) { ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); } ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk); } else if (!byobCanceled) { ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); } reading = false; if (readAgainForBranch1) { pull1Algorithm(); } else if (readAgainForBranch2) { pull2Algorithm(); } }); }, _closeSteps: (chunk) => { reading = false; const byobCanceled = forBranch2 ? canceled2 : canceled1; const otherCanceled = forBranch2 ? canceled1 : canceled2; if (!byobCanceled) { ReadableByteStreamControllerClose(byobBranch._readableStreamController); } if (!otherCanceled) { ReadableByteStreamControllerClose(otherBranch._readableStreamController); } if (chunk !== void 0) { if (!byobCanceled) { ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); } if (!otherCanceled && otherBranch._readableStreamController._pendingPullIntos.length > 0) { ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0); } } if (!byobCanceled || !otherCanceled) { resolveCancelPromise(void 0); } }, _errorSteps: () => { reading = false; } }; ReadableStreamBYOBReaderRead(reader, view, 1, readIntoRequest); } function pull1Algorithm() { if (reading) { readAgainForBranch1 = true; return promiseResolvedWith(void 0); } reading = true; const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController); if (byobRequest === null) { pullWithDefaultReader(); } else { pullWithBYOBReader(byobRequest._view, false); } return promiseResolvedWith(void 0); } function pull2Algorithm() { if (reading) { readAgainForBranch2 = true; return promiseResolvedWith(void 0); } reading = true; const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController); if (byobRequest === null) { pullWithDefaultReader(); } else { pullWithBYOBReader(byobRequest._view, true); } return promiseResolvedWith(void 0); } function cancel1Algorithm(reason) { canceled1 = true; reason1 = reason; if (canceled2) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function cancel2Algorithm(reason) { canceled2 = true; reason2 = reason; if (canceled1) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function startAlgorithm() { return; } branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm); branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm); forwardReaderError(reader); return [branch1, branch2]; } function isReadableStreamLike(stream) { return typeIsObject(stream) && typeof stream.getReader !== "undefined"; } function ReadableStreamFrom(source) { if (isReadableStreamLike(source)) { return ReadableStreamFromDefaultReader(source.getReader()); } return ReadableStreamFromIterable(source); } function ReadableStreamFromIterable(asyncIterable) { let stream; const iteratorRecord = GetIterator(asyncIterable, "async"); const startAlgorithm = noop2; function pullAlgorithm() { let nextResult; try { nextResult = IteratorNext(iteratorRecord); } catch (e2) { return promiseRejectedWith(e2); } const nextPromise = promiseResolvedWith(nextResult); return transformPromiseWith(nextPromise, (iterResult) => { if (!typeIsObject(iterResult)) { throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object"); } const done = IteratorComplete(iterResult); if (done) { ReadableStreamDefaultControllerClose(stream._readableStreamController); } else { const value = IteratorValue(iterResult); ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value); } }); } function cancelAlgorithm(reason) { const iterator = iteratorRecord.iterator; let returnMethod; try { returnMethod = GetMethod(iterator, "return"); } catch (e2) { return promiseRejectedWith(e2); } if (returnMethod === void 0) { return promiseResolvedWith(void 0); } let returnResult; try { returnResult = reflectCall(returnMethod, iterator, [reason]); } catch (e2) { return promiseRejectedWith(e2); } const returnPromise = promiseResolvedWith(returnResult); return transformPromiseWith(returnPromise, (iterResult) => { if (!typeIsObject(iterResult)) { throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object"); } return void 0; }); } stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0); return stream; } function ReadableStreamFromDefaultReader(reader) { let stream; const startAlgorithm = noop2; function pullAlgorithm() { let readPromise; try { readPromise = reader.read(); } catch (e2) { return promiseRejectedWith(e2); } return transformPromiseWith(readPromise, (readResult) => { if (!typeIsObject(readResult)) { throw new TypeError("The promise returned by the reader.read() method must fulfill with an object"); } if (readResult.done) { ReadableStreamDefaultControllerClose(stream._readableStreamController); } else { const value = readResult.value; ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value); } }); } function cancelAlgorithm(reason) { try { return promiseResolvedWith(reader.cancel(reason)); } catch (e2) { return promiseRejectedWith(e2); } } stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0); return stream; } function convertUnderlyingDefaultOrByteSource(source, context) { assertDictionary(source, context); const original = source; const autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize; const cancel = original === null || original === void 0 ? void 0 : original.cancel; const pull = original === null || original === void 0 ? void 0 : original.pull; const start = original === null || original === void 0 ? void 0 : original.start; const type = original === null || original === void 0 ? void 0 : original.type; return { autoAllocateChunkSize: autoAllocateChunkSize === void 0 ? void 0 : convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, `${context} has member 'autoAllocateChunkSize' that`), cancel: cancel === void 0 ? void 0 : convertUnderlyingSourceCancelCallback(cancel, original, `${context} has member 'cancel' that`), pull: pull === void 0 ? void 0 : convertUnderlyingSourcePullCallback(pull, original, `${context} has member 'pull' that`), start: start === void 0 ? void 0 : convertUnderlyingSourceStartCallback(start, original, `${context} has member 'start' that`), type: type === void 0 ? void 0 : convertReadableStreamType(type, `${context} has member 'type' that`) }; } function convertUnderlyingSourceCancelCallback(fn2, original, context) { assertFunction(fn2, context); return (reason) => promiseCall(fn2, original, [reason]); } function convertUnderlyingSourcePullCallback(fn2, original, context) { assertFunction(fn2, context); return (controller) => promiseCall(fn2, original, [controller]); } function convertUnderlyingSourceStartCallback(fn2, original, context) { assertFunction(fn2, context); return (controller) => reflectCall(fn2, original, [controller]); } function convertReadableStreamType(type, context) { type = `${type}`; if (type !== "bytes") { throw new TypeError(`${context} '${type}' is not a valid enumeration value for ReadableStreamType`); } return type; } function convertIteratorOptions(options, context) { assertDictionary(options, context); const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel; return { preventCancel: Boolean(preventCancel) }; } function convertPipeOptions(options, context) { assertDictionary(options, context); const preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort; const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel; const preventClose = options === null || options === void 0 ? void 0 : options.preventClose; const signal = options === null || options === void 0 ? void 0 : options.signal; if (signal !== void 0) { assertAbortSignal(signal, `${context} has member 'signal' that`); } return { preventAbort: Boolean(preventAbort), preventCancel: Boolean(preventCancel), preventClose: Boolean(preventClose), signal }; } function assertAbortSignal(signal, context) { if (!isAbortSignal2(signal)) { throw new TypeError(`${context} is not an AbortSignal.`); } } function convertReadableWritablePair(pair, context) { assertDictionary(pair, context); const readable = pair === null || pair === void 0 ? void 0 : pair.readable; assertRequiredField(readable, "readable", "ReadableWritablePair"); assertReadableStream(readable, `${context} has member 'readable' that`); const writable = pair === null || pair === void 0 ? void 0 : pair.writable; assertRequiredField(writable, "writable", "ReadableWritablePair"); assertWritableStream(writable, `${context} has member 'writable' that`); return { readable, writable }; } class ReadableStream2 { constructor(rawUnderlyingSource = {}, rawStrategy = {}) { if (rawUnderlyingSource === void 0) { rawUnderlyingSource = null; } else { assertObject(rawUnderlyingSource, "First parameter"); } const strategy = convertQueuingStrategy(rawStrategy, "Second parameter"); const underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, "First parameter"); InitializeReadableStream(this); if (underlyingSource.type === "bytes") { if (strategy.size !== void 0) { throw new RangeError("The strategy for a byte stream cannot have a size function"); } const highWaterMark = ExtractHighWaterMark(strategy, 0); SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark); } else { const sizeAlgorithm = ExtractSizeAlgorithm(strategy); const highWaterMark = ExtractHighWaterMark(strategy, 1); SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm); } } /** * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}. */ get locked() { if (!IsReadableStream(this)) { throw streamBrandCheckException$1("locked"); } return IsReadableStreamLocked(this); } /** * Cancels the stream, signaling a loss of interest in the stream by a consumer. * * The supplied `reason` argument will be given to the underlying source's {@link UnderlyingSource.cancel | cancel()} * method, which might or might not use it. */ cancel(reason = void 0) { if (!IsReadableStream(this)) { return promiseRejectedWith(streamBrandCheckException$1("cancel")); } if (IsReadableStreamLocked(this)) { return promiseRejectedWith(new TypeError("Cannot cancel a stream that already has a reader")); } return ReadableStreamCancel(this, reason); } getReader(rawOptions = void 0) { if (!IsReadableStream(this)) { throw streamBrandCheckException$1("getReader"); } const options = convertReaderOptions(rawOptions, "First parameter"); if (options.mode === void 0) { return AcquireReadableStreamDefaultReader(this); } return AcquireReadableStreamBYOBReader(this); } pipeThrough(rawTransform, rawOptions = {}) { if (!IsReadableStream(this)) { throw streamBrandCheckException$1("pipeThrough"); } assertRequiredArgument(rawTransform, 1, "pipeThrough"); const transform = convertReadableWritablePair(rawTransform, "First parameter"); const options = convertPipeOptions(rawOptions, "Second parameter"); if (IsReadableStreamLocked(this)) { throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream"); } if (IsWritableStreamLocked(transform.writable)) { throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream"); } const promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal); setPromiseIsHandledToTrue(promise); return transform.readable; } pipeTo(destination, rawOptions = {}) { if (!IsReadableStream(this)) { return promiseRejectedWith(streamBrandCheckException$1("pipeTo")); } if (destination === void 0) { return promiseRejectedWith(`Parameter 1 is required in 'pipeTo'.`); } if (!IsWritableStream(destination)) { return promiseRejectedWith(new TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`)); } let options; try { options = convertPipeOptions(rawOptions, "Second parameter"); } catch (e2) { return promiseRejectedWith(e2); } if (IsReadableStreamLocked(this)) { return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")); } if (IsWritableStreamLocked(destination)) { return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")); } return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal); } /** * Tees this readable stream, returning a two-element array containing the two resulting branches as * new {@link ReadableStream} instances. * * Teeing a stream will lock it, preventing any other consumer from acquiring a reader. * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be * propagated to the stream's underlying source. * * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable, * this could allow interference between the two branches. */ tee() { if (!IsReadableStream(this)) { throw streamBrandCheckException$1("tee"); } const branches = ReadableStreamTee(this); return CreateArrayFromList(branches); } values(rawOptions = void 0) { if (!IsReadableStream(this)) { throw streamBrandCheckException$1("values"); } const options = convertIteratorOptions(rawOptions, "First parameter"); return AcquireReadableStreamAsyncIterator(this, options.preventCancel); } [SymbolAsyncIterator](options) { return this.values(options); } /** * Creates a new ReadableStream wrapping the provided iterable or async iterable. * * This can be used to adapt various kinds of objects into a readable stream, * such as an array, an async generator, or a Node.js readable stream. */ static from(asyncIterable) { return ReadableStreamFrom(asyncIterable); } } Object.defineProperties(ReadableStream2, { from: { enumerable: true } }); Object.defineProperties(ReadableStream2.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }); setFunctionName(ReadableStream2.from, "from"); setFunctionName(ReadableStream2.prototype.cancel, "cancel"); setFunctionName(ReadableStream2.prototype.getReader, "getReader"); setFunctionName(ReadableStream2.prototype.pipeThrough, "pipeThrough"); setFunctionName(ReadableStream2.prototype.pipeTo, "pipeTo"); setFunctionName(ReadableStream2.prototype.tee, "tee"); setFunctionName(ReadableStream2.prototype.values, "values"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableStream2.prototype, Symbol.toStringTag, { value: "ReadableStream", configurable: true }); } Object.defineProperty(ReadableStream2.prototype, SymbolAsyncIterator, { value: ReadableStream2.prototype.values, writable: true, configurable: true }); function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) { const stream = Object.create(ReadableStream2.prototype); InitializeReadableStream(stream); const controller = Object.create(ReadableStreamDefaultController.prototype); SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm); return stream; } function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) { const stream = Object.create(ReadableStream2.prototype); InitializeReadableStream(stream); const controller = Object.create(ReadableByteStreamController.prototype); SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, void 0); return stream; } function InitializeReadableStream(stream) { stream._state = "readable"; stream._reader = void 0; stream._storedError = void 0; stream._disturbed = false; } function IsReadableStream(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_readableStreamController")) { return false; } return x2 instanceof ReadableStream2; } function IsReadableStreamLocked(stream) { if (stream._reader === void 0) { return false; } return true; } function ReadableStreamCancel(stream, reason) { stream._disturbed = true; if (stream._state === "closed") { return promiseResolvedWith(void 0); } if (stream._state === "errored") { return promiseRejectedWith(stream._storedError); } ReadableStreamClose(stream); const reader = stream._reader; if (reader !== void 0 && IsReadableStreamBYOBReader(reader)) { const readIntoRequests = reader._readIntoRequests; reader._readIntoRequests = new SimpleQueue(); readIntoRequests.forEach((readIntoRequest) => { readIntoRequest._closeSteps(void 0); }); } const sourceCancelPromise = stream._readableStreamController[CancelSteps](reason); return transformPromiseWith(sourceCancelPromise, noop2); } function ReadableStreamClose(stream) { stream._state = "closed"; const reader = stream._reader; if (reader === void 0) { return; } defaultReaderClosedPromiseResolve(reader); if (IsReadableStreamDefaultReader(reader)) { const readRequests = reader._readRequests; reader._readRequests = new SimpleQueue(); readRequests.forEach((readRequest) => { readRequest._closeSteps(); }); } } function ReadableStreamError(stream, e2) { stream._state = "errored"; stream._storedError = e2; const reader = stream._reader; if (reader === void 0) { return; } defaultReaderClosedPromiseReject(reader, e2); if (IsReadableStreamDefaultReader(reader)) { ReadableStreamDefaultReaderErrorReadRequests(reader, e2); } else { ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e2); } } function streamBrandCheckException$1(name) { return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`); } function convertQueuingStrategyInit(init, context) { assertDictionary(init, context); const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark; assertRequiredField(highWaterMark, "highWaterMark", "QueuingStrategyInit"); return { highWaterMark: convertUnrestrictedDouble(highWaterMark) }; } const byteLengthSizeFunction = (chunk) => { return chunk.byteLength; }; setFunctionName(byteLengthSizeFunction, "size"); class ByteLengthQueuingStrategy { constructor(options) { assertRequiredArgument(options, 1, "ByteLengthQueuingStrategy"); options = convertQueuingStrategyInit(options, "First parameter"); this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark; } /** * Returns the high water mark provided to the constructor. */ get highWaterMark() { if (!IsByteLengthQueuingStrategy(this)) { throw byteLengthBrandCheckException("highWaterMark"); } return this._byteLengthQueuingStrategyHighWaterMark; } /** * Measures the size of `chunk` by returning the value of its `byteLength` property. */ get size() { if (!IsByteLengthQueuingStrategy(this)) { throw byteLengthBrandCheckException("size"); } return byteLengthSizeFunction; } } Object.defineProperties(ByteLengthQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ByteLengthQueuingStrategy.prototype, Symbol.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true }); } function byteLengthBrandCheckException(name) { return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`); } function IsByteLengthQueuingStrategy(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_byteLengthQueuingStrategyHighWaterMark")) { return false; } return x2 instanceof ByteLengthQueuingStrategy; } const countSizeFunction = () => { return 1; }; setFunctionName(countSizeFunction, "size"); class CountQueuingStrategy { constructor(options) { assertRequiredArgument(options, 1, "CountQueuingStrategy"); options = convertQueuingStrategyInit(options, "First parameter"); this._countQueuingStrategyHighWaterMark = options.highWaterMark; } /** * Returns the high water mark provided to the constructor. */ get highWaterMark() { if (!IsCountQueuingStrategy(this)) { throw countBrandCheckException("highWaterMark"); } return this._countQueuingStrategyHighWaterMark; } /** * Measures the size of `chunk` by always returning 1. * This ensures that the total queue size is a count of the number of chunks in the queue. */ get size() { if (!IsCountQueuingStrategy(this)) { throw countBrandCheckException("size"); } return countSizeFunction; } } Object.defineProperties(CountQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(CountQueuingStrategy.prototype, Symbol.toStringTag, { value: "CountQueuingStrategy", configurable: true }); } function countBrandCheckException(name) { return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`); } function IsCountQueuingStrategy(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_countQueuingStrategyHighWaterMark")) { return false; } return x2 instanceof CountQueuingStrategy; } function convertTransformer(original, context) { assertDictionary(original, context); const cancel = original === null || original === void 0 ? void 0 : original.cancel; const flush = original === null || original === void 0 ? void 0 : original.flush; const readableType = original === null || original === void 0 ? void 0 : original.readableType; const start = original === null || original === void 0 ? void 0 : original.start; const transform = original === null || original === void 0 ? void 0 : original.transform; const writableType = original === null || original === void 0 ? void 0 : original.writableType; return { cancel: cancel === void 0 ? void 0 : convertTransformerCancelCallback(cancel, original, `${context} has member 'cancel' that`), flush: flush === void 0 ? void 0 : convertTransformerFlushCallback(flush, original, `${context} has member 'flush' that`), readableType, start: start === void 0 ? void 0 : convertTransformerStartCallback(start, original, `${context} has member 'start' that`), transform: transform === void 0 ? void 0 : convertTransformerTransformCallback(transform, original, `${context} has member 'transform' that`), writableType }; } function convertTransformerFlushCallback(fn2, original, context) { assertFunction(fn2, context); return (controller) => promiseCall(fn2, original, [controller]); } function convertTransformerStartCallback(fn2, original, context) { assertFunction(fn2, context); return (controller) => reflectCall(fn2, original, [controller]); } function convertTransformerTransformCallback(fn2, original, context) { assertFunction(fn2, context); return (chunk, controller) => promiseCall(fn2, original, [chunk, controller]); } function convertTransformerCancelCallback(fn2, original, context) { assertFunction(fn2, context); return (reason) => promiseCall(fn2, original, [reason]); } class TransformStream { constructor(rawTransformer = {}, rawWritableStrategy = {}, rawReadableStrategy = {}) { if (rawTransformer === void 0) { rawTransformer = null; } const writableStrategy = convertQueuingStrategy(rawWritableStrategy, "Second parameter"); const readableStrategy = convertQueuingStrategy(rawReadableStrategy, "Third parameter"); const transformer = convertTransformer(rawTransformer, "First parameter"); if (transformer.readableType !== void 0) { throw new RangeError("Invalid readableType specified"); } if (transformer.writableType !== void 0) { throw new RangeError("Invalid writableType specified"); } const readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0); const readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy); const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1); const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy); let startPromise_resolve; const startPromise = newPromise((resolve) => { startPromise_resolve = resolve; }); InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm); SetUpTransformStreamDefaultControllerFromTransformer(this, transformer); if (transformer.start !== void 0) { startPromise_resolve(transformer.start(this._transformStreamController)); } else { startPromise_resolve(void 0); } } /** * The readable side of the transform stream. */ get readable() { if (!IsTransformStream(this)) { throw streamBrandCheckException("readable"); } return this._readable; } /** * The writable side of the transform stream. */ get writable() { if (!IsTransformStream(this)) { throw streamBrandCheckException("writable"); } return this._writable; } } Object.defineProperties(TransformStream.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(TransformStream.prototype, Symbol.toStringTag, { value: "TransformStream", configurable: true }); } function InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) { function startAlgorithm() { return startPromise; } function writeAlgorithm(chunk) { return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk); } function abortAlgorithm(reason) { return TransformStreamDefaultSinkAbortAlgorithm(stream, reason); } function closeAlgorithm() { return TransformStreamDefaultSinkCloseAlgorithm(stream); } stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm); function pullAlgorithm() { return TransformStreamDefaultSourcePullAlgorithm(stream); } function cancelAlgorithm(reason) { return TransformStreamDefaultSourceCancelAlgorithm(stream, reason); } stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm); stream._backpressure = void 0; stream._backpressureChangePromise = void 0; stream._backpressureChangePromise_resolve = void 0; TransformStreamSetBackpressure(stream, true); stream._transformStreamController = void 0; } function IsTransformStream(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_transformStreamController")) { return false; } return x2 instanceof TransformStream; } function TransformStreamError(stream, e2) { ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e2); TransformStreamErrorWritableAndUnblockWrite(stream, e2); } function TransformStreamErrorWritableAndUnblockWrite(stream, e2) { TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController); WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e2); TransformStreamUnblockWrite(stream); } function TransformStreamUnblockWrite(stream) { if (stream._backpressure) { TransformStreamSetBackpressure(stream, false); } } function TransformStreamSetBackpressure(stream, backpressure) { if (stream._backpressureChangePromise !== void 0) { stream._backpressureChangePromise_resolve(); } stream._backpressureChangePromise = newPromise((resolve) => { stream._backpressureChangePromise_resolve = resolve; }); stream._backpressure = backpressure; } class TransformStreamDefaultController { constructor() { throw new TypeError("Illegal constructor"); } /** * Returns the desired size to fill the readable side’s internal queue. It can be negative, if the queue is over-full. */ get desiredSize() { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException("desiredSize"); } const readableController = this._controlledTransformStream._readable._readableStreamController; return ReadableStreamDefaultControllerGetDesiredSize(readableController); } enqueue(chunk = void 0) { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException("enqueue"); } TransformStreamDefaultControllerEnqueue(this, chunk); } /** * Errors both the readable side and the writable side of the controlled transform stream, making all future * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded. */ error(reason = void 0) { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException("error"); } TransformStreamDefaultControllerError(this, reason); } /** * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the * transformer only needs to consume a portion of the chunks written to the writable side. */ terminate() { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException("terminate"); } TransformStreamDefaultControllerTerminate(this); } } Object.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }); setFunctionName(TransformStreamDefaultController.prototype.enqueue, "enqueue"); setFunctionName(TransformStreamDefaultController.prototype.error, "error"); setFunctionName(TransformStreamDefaultController.prototype.terminate, "terminate"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(TransformStreamDefaultController.prototype, Symbol.toStringTag, { value: "TransformStreamDefaultController", configurable: true }); } function IsTransformStreamDefaultController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_controlledTransformStream")) { return false; } return x2 instanceof TransformStreamDefaultController; } function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm) { controller._controlledTransformStream = stream; stream._transformStreamController = controller; controller._transformAlgorithm = transformAlgorithm; controller._flushAlgorithm = flushAlgorithm; controller._cancelAlgorithm = cancelAlgorithm; controller._finishPromise = void 0; controller._finishPromise_resolve = void 0; controller._finishPromise_reject = void 0; } function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) { const controller = Object.create(TransformStreamDefaultController.prototype); let transformAlgorithm; let flushAlgorithm; let cancelAlgorithm; if (transformer.transform !== void 0) { transformAlgorithm = (chunk) => transformer.transform(chunk, controller); } else { transformAlgorithm = (chunk) => { try { TransformStreamDefaultControllerEnqueue(controller, chunk); return promiseResolvedWith(void 0); } catch (transformResultE) { return promiseRejectedWith(transformResultE); } }; } if (transformer.flush !== void 0) { flushAlgorithm = () => transformer.flush(controller); } else { flushAlgorithm = () => promiseResolvedWith(void 0); } if (transformer.cancel !== void 0) { cancelAlgorithm = (reason) => transformer.cancel(reason); } else { cancelAlgorithm = () => promiseResolvedWith(void 0); } SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm); } function TransformStreamDefaultControllerClearAlgorithms(controller) { controller._transformAlgorithm = void 0; controller._flushAlgorithm = void 0; controller._cancelAlgorithm = void 0; } function TransformStreamDefaultControllerEnqueue(controller, chunk) { const stream = controller._controlledTransformStream; const readableController = stream._readable._readableStreamController; if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) { throw new TypeError("Readable side is not in a state that permits enqueue"); } try { ReadableStreamDefaultControllerEnqueue(readableController, chunk); } catch (e2) { TransformStreamErrorWritableAndUnblockWrite(stream, e2); throw stream._readable._storedError; } const backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController); if (backpressure !== stream._backpressure) { TransformStreamSetBackpressure(stream, true); } } function TransformStreamDefaultControllerError(controller, e2) { TransformStreamError(controller._controlledTransformStream, e2); } function TransformStreamDefaultControllerPerformTransform(controller, chunk) { const transformPromise = controller._transformAlgorithm(chunk); return transformPromiseWith(transformPromise, void 0, (r2) => { TransformStreamError(controller._controlledTransformStream, r2); throw r2; }); } function TransformStreamDefaultControllerTerminate(controller) { const stream = controller._controlledTransformStream; const readableController = stream._readable._readableStreamController; ReadableStreamDefaultControllerClose(readableController); const error = new TypeError("TransformStream terminated"); TransformStreamErrorWritableAndUnblockWrite(stream, error); } function TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) { const controller = stream._transformStreamController; if (stream._backpressure) { const backpressureChangePromise = stream._backpressureChangePromise; return transformPromiseWith(backpressureChangePromise, () => { const writable = stream._writable; const state = writable._state; if (state === "erroring") { throw writable._storedError; } return TransformStreamDefaultControllerPerformTransform(controller, chunk); }); } return TransformStreamDefaultControllerPerformTransform(controller, chunk); } function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) { const controller = stream._transformStreamController; if (controller._finishPromise !== void 0) { return controller._finishPromise; } const readable = stream._readable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; }); const cancelPromise = controller._cancelAlgorithm(reason); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(cancelPromise, () => { if (readable._state === "errored") { defaultControllerFinishPromiseReject(controller, readable._storedError); } else { ReadableStreamDefaultControllerError(readable._readableStreamController, reason); defaultControllerFinishPromiseResolve(controller); } return null; }, (r2) => { ReadableStreamDefaultControllerError(readable._readableStreamController, r2); defaultControllerFinishPromiseReject(controller, r2); return null; }); return controller._finishPromise; } function TransformStreamDefaultSinkCloseAlgorithm(stream) { const controller = stream._transformStreamController; if (controller._finishPromise !== void 0) { return controller._finishPromise; } const readable = stream._readable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; }); const flushPromise = controller._flushAlgorithm(); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(flushPromise, () => { if (readable._state === "errored") { defaultControllerFinishPromiseReject(controller, readable._storedError); } else { ReadableStreamDefaultControllerClose(readable._readableStreamController); defaultControllerFinishPromiseResolve(controller); } return null; }, (r2) => { ReadableStreamDefaultControllerError(readable._readableStreamController, r2); defaultControllerFinishPromiseReject(controller, r2); return null; }); return controller._finishPromise; } function TransformStreamDefaultSourcePullAlgorithm(stream) { TransformStreamSetBackpressure(stream, false); return stream._backpressureChangePromise; } function TransformStreamDefaultSourceCancelAlgorithm(stream, reason) { const controller = stream._transformStreamController; if (controller._finishPromise !== void 0) { return controller._finishPromise; } const writable = stream._writable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; }); const cancelPromise = controller._cancelAlgorithm(reason); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(cancelPromise, () => { if (writable._state === "errored") { defaultControllerFinishPromiseReject(controller, writable._storedError); } else { WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason); TransformStreamUnblockWrite(stream); defaultControllerFinishPromiseResolve(controller); } return null; }, (r2) => { WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r2); TransformStreamUnblockWrite(stream); defaultControllerFinishPromiseReject(controller, r2); return null; }); return controller._finishPromise; } function defaultControllerBrandCheckException(name) { return new TypeError(`TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`); } function defaultControllerFinishPromiseResolve(controller) { if (controller._finishPromise_resolve === void 0) { return; } controller._finishPromise_resolve(); controller._finishPromise_resolve = void 0; controller._finishPromise_reject = void 0; } function defaultControllerFinishPromiseReject(controller, reason) { if (controller._finishPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(controller._finishPromise); controller._finishPromise_reject(reason); controller._finishPromise_resolve = void 0; controller._finishPromise_reject = void 0; } function streamBrandCheckException(name) { return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`); } exports3.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy; exports3.CountQueuingStrategy = CountQueuingStrategy; exports3.ReadableByteStreamController = ReadableByteStreamController; exports3.ReadableStream = ReadableStream2; exports3.ReadableStreamBYOBReader = ReadableStreamBYOBReader; exports3.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest; exports3.ReadableStreamDefaultController = ReadableStreamDefaultController; exports3.ReadableStreamDefaultReader = ReadableStreamDefaultReader; exports3.TransformStream = TransformStream; exports3.TransformStreamDefaultController = TransformStreamDefaultController; exports3.WritableStream = WritableStream; exports3.WritableStreamDefaultController = WritableStreamDefaultController; exports3.WritableStreamDefaultWriter = WritableStreamDefaultWriter; }); } }); // ../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/streams.cjs var require_streams = __commonJS({ "../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/streams.cjs"() { var POOL_SIZE2 = 65536; if (!globalThis.ReadableStream) { try { const process2 = require("node:process"); const { emitWarning } = process2; try { process2.emitWarning = () => { }; Object.assign(globalThis, require("node:stream/web")); process2.emitWarning = emitWarning; } catch (error) { process2.emitWarning = emitWarning; throw error; } } catch (error) { Object.assign(globalThis, require_ponyfill_es2018()); } } try { const { Blob: Blob4 } = require("buffer"); if (Blob4 && !Blob4.prototype.stream) { Blob4.prototype.stream = function name(params) { let position = 0; const blob = this; return new ReadableStream({ type: "bytes", async pull(ctrl) { const chunk = blob.slice(position, Math.min(blob.size, position + POOL_SIZE2)); const buffer2 = await chunk.arrayBuffer(); position += buffer2.byteLength; ctrl.enqueue(new Uint8Array(buffer2)); if (position === blob.size) { ctrl.close(); } } }); }; } } catch (error) { } } }); // ../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/index.js async function* toIterator(parts, clone2 = true) { for (const part of parts) { if ("stream" in part) { yield* ( /** @type {AsyncIterableIterator} */ part.stream() ); } else if (ArrayBuffer.isView(part)) { if (clone2) { let position = part.byteOffset; const end = part.byteOffset + part.byteLength; while (position !== end) { const size = Math.min(end - position, POOL_SIZE); const chunk = part.buffer.slice(position, position + size); position += chunk.byteLength; yield new Uint8Array(chunk); } } else { yield part; } } else { let position = 0, b = ( /** @type {Blob} */ part ); while (position !== b.size) { const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE)); const buffer2 = await chunk.arrayBuffer(); position += buffer2.byteLength; yield new Uint8Array(buffer2); } } } } var import_streams, POOL_SIZE, _Blob, Blob3, fetch_blob_default; var init_fetch_blob = __esm({ "../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/index.js"() { import_streams = __toESM(require_streams(), 1); POOL_SIZE = 65536; _Blob = class Blob2 { /** @type {Array.<(Blob|Uint8Array)>} */ #parts = []; #type = ""; #size = 0; #endings = "transparent"; /** * The Blob() constructor returns a new Blob object. The content * of the blob consists of the concatenation of the values given * in the parameter array. * * @param {*} blobParts * @param {{ type?: string, endings?: string }} [options] */ constructor(blobParts = [], options = {}) { if (typeof blobParts !== "object" || blobParts === null) { throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence."); } if (typeof blobParts[Symbol.iterator] !== "function") { throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property."); } if (typeof options !== "object" && typeof options !== "function") { throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary."); } if (options === null) options = {}; const encoder = new TextEncoder(); for (const element of blobParts) { let part; if (ArrayBuffer.isView(element)) { part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength)); } else if (element instanceof ArrayBuffer) { part = new Uint8Array(element.slice(0)); } else if (element instanceof Blob2) { part = element; } else { part = encoder.encode(`${element}`); } this.#size += ArrayBuffer.isView(part) ? part.byteLength : part.size; this.#parts.push(part); } this.#endings = `${options.endings === void 0 ? "transparent" : options.endings}`; const type = options.type === void 0 ? "" : String(options.type); this.#type = /^[\x20-\x7E]*$/.test(type) ? type : ""; } /** * The Blob interface's size property returns the * size of the Blob in bytes. */ get size() { return this.#size; } /** * The type property of a Blob object returns the MIME type of the file. */ get type() { return this.#type; } /** * The text() method in the Blob interface returns a Promise * that resolves with a string containing the contents of * the blob, interpreted as UTF-8. * * @return {Promise} */ async text() { const decoder = new TextDecoder(); let str = ""; for await (const part of toIterator(this.#parts, false)) { str += decoder.decode(part, { stream: true }); } str += decoder.decode(); return str; } /** * The arrayBuffer() method in the Blob interface returns a * Promise that resolves with the contents of the blob as * binary data contained in an ArrayBuffer. * * @return {Promise} */ async arrayBuffer() { const data = new Uint8Array(this.size); let offset = 0; for await (const chunk of toIterator(this.#parts, false)) { data.set(chunk, offset); offset += chunk.length; } return data.buffer; } stream() { const it = toIterator(this.#parts, true); return new globalThis.ReadableStream({ // @ts-ignore type: "bytes", async pull(ctrl) { const chunk = await it.next(); chunk.done ? ctrl.close() : ctrl.enqueue(chunk.value); }, async cancel() { await it.return(); } }); } /** * The Blob interface's slice() method creates and returns a * new Blob object which contains data from a subset of the * blob on which it's called. * * @param {number} [start] * @param {number} [end] * @param {string} [type] */ slice(start = 0, end = this.size, type = "") { const { size } = this; let relativeStart = start < 0 ? Math.max(size + start, 0) : Math.min(start, size); let relativeEnd = end < 0 ? Math.max(size + end, 0) : Math.min(end, size); const span = Math.max(relativeEnd - relativeStart, 0); const parts = this.#parts; const blobParts = []; let added = 0; for (const part of parts) { if (added >= span) { break; } const size2 = ArrayBuffer.isView(part) ? part.byteLength : part.size; if (relativeStart && size2 <= relativeStart) { relativeStart -= size2; relativeEnd -= size2; } else { let chunk; if (ArrayBuffer.isView(part)) { chunk = part.subarray(relativeStart, Math.min(size2, relativeEnd)); added += chunk.byteLength; } else { chunk = part.slice(relativeStart, Math.min(size2, relativeEnd)); added += chunk.size; } relativeEnd -= size2; blobParts.push(chunk); relativeStart = 0; } } const blob = new Blob2([], { type: String(type).toLowerCase() }); blob.#size = span; blob.#parts = blobParts; return blob; } get [Symbol.toStringTag]() { return "Blob"; } static [Symbol.hasInstance](object) { return object && typeof object === "object" && typeof object.constructor === "function" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]); } }; Object.defineProperties(_Blob.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } }); Blob3 = _Blob; fetch_blob_default = Blob3; } }); // ../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/file.js var _File, File2, file_default; var init_file = __esm({ "../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/file.js"() { init_fetch_blob(); _File = class File extends fetch_blob_default { #lastModified = 0; #name = ""; /** * @param {*[]} fileBits * @param {string} fileName * @param {{lastModified?: number, type?: string}} options */ // @ts-ignore constructor(fileBits, fileName, options = {}) { if (arguments.length < 2) { throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`); } super(fileBits, options); if (options === null) options = {}; const lastModified = options.lastModified === void 0 ? Date.now() : Number(options.lastModified); if (!Number.isNaN(lastModified)) { this.#lastModified = lastModified; } this.#name = String(fileName); } get name() { return this.#name; } get lastModified() { return this.#lastModified; } get [Symbol.toStringTag]() { return "File"; } static [Symbol.hasInstance](object) { return !!object && object instanceof fetch_blob_default && /^(File)$/.test(object[Symbol.toStringTag]); } }; File2 = _File; file_default = File2; } }); // ../node_modules/.pnpm/formdata-polyfill@4.0.10/node_modules/formdata-polyfill/esm.min.js function formDataToBlob(F2, B = fetch_blob_default) { var b = `${r()}${r()}`.replace(/\./g, "").slice(-28).padStart(32, "-"), c = [], p = `--${b}\r Content-Disposition: form-data; name="`; F2.forEach((v, n) => typeof v == "string" ? c.push(p + e(n) + `"\r \r ${v.replace(/\r(?!\n)|(? (a += "", /^(Blob|File)$/.test(b && b[t]) ? [(c = c !== void 0 ? c + "" : b[t] == "File" ? b.name : "blob", a), b.name !== c || b[t] == "blob" ? new file_default([b], c, b) : b] : [a, b + ""]); e = (c, f3) => (f3 ? c : c.replace(/\r?\n|\r/g, "\r\n")).replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); x = (n, a, e2) => { if (a.length < e2) { throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e2} arguments required, but only ${a.length} present.`); } }; FormData = class FormData2 { #d = []; constructor(...a) { if (a.length) throw new TypeError(`Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.`); } get [t]() { return "FormData"; } [i]() { return this.entries(); } static [h](o) { return o && typeof o === "object" && o[t] === "FormData" && !m.some((m2) => typeof o[m2] != "function"); } append(...a) { x("append", arguments, 2); this.#d.push(f(...a)); } delete(a) { x("delete", arguments, 1); a += ""; this.#d = this.#d.filter(([b]) => b !== a); } get(a) { x("get", arguments, 1); a += ""; for (var b = this.#d, l = b.length, c = 0; c < l; c++) if (b[c][0] === a) return b[c][1]; return null; } getAll(a, b) { x("getAll", arguments, 1); b = []; a += ""; this.#d.forEach((c) => c[0] === a && b.push(c[1])); return b; } has(a) { x("has", arguments, 1); a += ""; return this.#d.some((b) => b[0] === a); } forEach(a, b) { x("forEach", arguments, 1); for (var [c, d] of this) a.call(b, d, c, this); } set(...a) { x("set", arguments, 2); var b = [], c = true; a = f(...a); this.#d.forEach((d) => { d[0] === a[0] ? c && (c = !b.push(a)) : b.push(d); }); c && b.push(a); this.#d = b; } *entries() { yield* this.#d; } *keys() { for (var [a] of this) yield a; } *values() { for (var [, a] of this) yield a; } }; } }); // ../node_modules/.pnpm/node-domexception@1.0.0/node_modules/node-domexception/index.js var require_node_domexception = __commonJS({ "../node_modules/.pnpm/node-domexception@1.0.0/node_modules/node-domexception/index.js"(exports2, module2) { if (!globalThis.DOMException) { try { const { MessageChannel } = require("worker_threads"), port = new MessageChannel().port1, ab = new ArrayBuffer(); port.postMessage(ab, [ab, ab]); } catch (err) { err.constructor.name === "DOMException" && (globalThis.DOMException = err.constructor); } } module2.exports = globalThis.DOMException; } }); // ../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/from.js var import_node_fs, import_node_domexception, stat; var init_from = __esm({ "../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/from.js"() { import_node_fs = require("node:fs"); import_node_domexception = __toESM(require_node_domexception(), 1); init_file(); init_fetch_blob(); ({ stat } = import_node_fs.promises); } }); // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/multipart-parser.js var multipart_parser_exports = {}; __export(multipart_parser_exports, { toFormData: () => toFormData }); function _fileName(headerValue) { const m2 = headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i); if (!m2) { return; } const match = m2[2] || m2[3] || ""; let filename = match.slice(match.lastIndexOf("\\") + 1); filename = filename.replace(/%22/g, '"'); filename = filename.replace(/&#(\d{4});/g, (m3, code) => { return String.fromCharCode(code); }); return filename; } async function toFormData(Body2, ct) { if (!/multipart/i.test(ct)) { throw new TypeError("Failed to fetch"); } const m2 = ct.match(/boundary=(?:"([^"]+)"|([^;]+))/i); if (!m2) { throw new TypeError("no or bad content-type header, no multipart boundary"); } const parser = new MultipartParser(m2[1] || m2[2]); let headerField; let headerValue; let entryValue; let entryName; let contentType; let filename; const entryChunks = []; const formData = new FormData(); const onPartData = (ui8a) => { entryValue += decoder.decode(ui8a, { stream: true }); }; const appendToFile = (ui8a) => { entryChunks.push(ui8a); }; const appendFileToFormData = () => { const file = new file_default(entryChunks, filename, { type: contentType }); formData.append(entryName, file); }; const appendEntryToFormData = () => { formData.append(entryName, entryValue); }; const decoder = new TextDecoder("utf-8"); decoder.decode(); parser.onPartBegin = function() { parser.onPartData = onPartData; parser.onPartEnd = appendEntryToFormData; headerField = ""; headerValue = ""; entryValue = ""; entryName = ""; contentType = ""; filename = null; entryChunks.length = 0; }; parser.onHeaderField = function(ui8a) { headerField += decoder.decode(ui8a, { stream: true }); }; parser.onHeaderValue = function(ui8a) { headerValue += decoder.decode(ui8a, { stream: true }); }; parser.onHeaderEnd = function() { headerValue += decoder.decode(); headerField = headerField.toLowerCase(); if (headerField === "content-disposition") { const m3 = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i); if (m3) { entryName = m3[2] || m3[3] || ""; } filename = _fileName(headerValue); if (filename) { parser.onPartData = appendToFile; parser.onPartEnd = appendFileToFormData; } } else if (headerField === "content-type") { contentType = headerValue; } headerValue = ""; headerField = ""; }; for await (const chunk of Body2) { parser.write(chunk); } parser.end(); return formData; } var s, S, f2, F, LF, CR, SPACE, HYPHEN, COLON, A, Z, lower, noop, MultipartParser; var init_multipart_parser = __esm({ "../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/multipart-parser.js"() { init_from(); init_esm_min(); s = 0; S = { START_BOUNDARY: s++, HEADER_FIELD_START: s++, HEADER_FIELD: s++, HEADER_VALUE_START: s++, HEADER_VALUE: s++, HEADER_VALUE_ALMOST_DONE: s++, HEADERS_ALMOST_DONE: s++, PART_DATA_START: s++, PART_DATA: s++, END: s++ }; f2 = 1; F = { PART_BOUNDARY: f2, LAST_BOUNDARY: f2 *= 2 }; LF = 10; CR = 13; SPACE = 32; HYPHEN = 45; COLON = 58; A = 97; Z = 122; lower = (c) => c | 32; noop = () => { }; MultipartParser = class { /** * @param {string} boundary */ constructor(boundary) { this.index = 0; this.flags = 0; this.onHeaderEnd = noop; this.onHeaderField = noop; this.onHeadersEnd = noop; this.onHeaderValue = noop; this.onPartBegin = noop; this.onPartData = noop; this.onPartEnd = noop; this.boundaryChars = {}; boundary = "\r\n--" + boundary; const ui8a = new Uint8Array(boundary.length); for (let i2 = 0; i2 < boundary.length; i2++) { ui8a[i2] = boundary.charCodeAt(i2); this.boundaryChars[ui8a[i2]] = true; } this.boundary = ui8a; this.lookbehind = new Uint8Array(this.boundary.length + 8); this.state = S.START_BOUNDARY; } /** * @param {Uint8Array} data */ write(data) { let i2 = 0; const length_ = data.length; let previousIndex = this.index; let { lookbehind, boundary, boundaryChars, index, state, flags } = this; const boundaryLength = this.boundary.length; const boundaryEnd = boundaryLength - 1; const bufferLength = data.length; let c; let cl; const mark = (name) => { this[name + "Mark"] = i2; }; const clear = (name) => { delete this[name + "Mark"]; }; const callback = (callbackSymbol, start, end, ui8a) => { if (start === void 0 || start !== end) { this[callbackSymbol](ui8a && ui8a.subarray(start, end)); } }; const dataCallback = (name, clear2) => { const markSymbol = name + "Mark"; if (!(markSymbol in this)) { return; } if (clear2) { callback(name, this[markSymbol], i2, data); delete this[markSymbol]; } else { callback(name, this[markSymbol], data.length, data); this[markSymbol] = 0; } }; for (i2 = 0; i2 < length_; i2++) { c = data[i2]; switch (state) { case S.START_BOUNDARY: if (index === boundary.length - 2) { if (c === HYPHEN) { flags |= F.LAST_BOUNDARY; } else if (c !== CR) { return; } index++; break; } else if (index - 1 === boundary.length - 2) { if (flags & F.LAST_BOUNDARY && c === HYPHEN) { state = S.END; flags = 0; } else if (!(flags & F.LAST_BOUNDARY) && c === LF) { index = 0; callback("onPartBegin"); state = S.HEADER_FIELD_START; } else { return; } break; } if (c !== boundary[index + 2]) { index = -2; } if (c === boundary[index + 2]) { index++; } break; case S.HEADER_FIELD_START: state = S.HEADER_FIELD; mark("onHeaderField"); index = 0; // falls through case S.HEADER_FIELD: if (c === CR) { clear("onHeaderField"); state = S.HEADERS_ALMOST_DONE; break; } index++; if (c === HYPHEN) { break; } if (c === COLON) { if (index === 1) { return; } dataCallback("onHeaderField", true); state = S.HEADER_VALUE_START; break; } cl = lower(c); if (cl < A || cl > Z) { return; } break; case S.HEADER_VALUE_START: if (c === SPACE) { break; } mark("onHeaderValue"); state = S.HEADER_VALUE; // falls through case S.HEADER_VALUE: if (c === CR) { dataCallback("onHeaderValue", true); callback("onHeaderEnd"); state = S.HEADER_VALUE_ALMOST_DONE; } break; case S.HEADER_VALUE_ALMOST_DONE: if (c !== LF) { return; } state = S.HEADER_FIELD_START; break; case S.HEADERS_ALMOST_DONE: if (c !== LF) { return; } callback("onHeadersEnd"); state = S.PART_DATA_START; break; case S.PART_DATA_START: state = S.PART_DATA; mark("onPartData"); // falls through case S.PART_DATA: previousIndex = index; if (index === 0) { i2 += boundaryEnd; while (i2 < bufferLength && !(data[i2] in boundaryChars)) { i2 += boundaryLength; } i2 -= boundaryEnd; c = data[i2]; } if (index < boundary.length) { if (boundary[index] === c) { if (index === 0) { dataCallback("onPartData", true); } index++; } else { index = 0; } } else if (index === boundary.length) { index++; if (c === CR) { flags |= F.PART_BOUNDARY; } else if (c === HYPHEN) { flags |= F.LAST_BOUNDARY; } else { index = 0; } } else if (index - 1 === boundary.length) { if (flags & F.PART_BOUNDARY) { index = 0; if (c === LF) { flags &= ~F.PART_BOUNDARY; callback("onPartEnd"); callback("onPartBegin"); state = S.HEADER_FIELD_START; break; } } else if (flags & F.LAST_BOUNDARY) { if (c === HYPHEN) { callback("onPartEnd"); state = S.END; flags = 0; } else { index = 0; } } else { index = 0; } } if (index > 0) { lookbehind[index - 1] = c; } else if (previousIndex > 0) { const _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength); callback("onPartData", 0, previousIndex, _lookbehind); previousIndex = 0; mark("onPartData"); i2--; } break; case S.END: break; default: throw new Error(`Unexpected state entered: ${state}`); } } dataCallback("onHeaderField"); dataCallback("onHeaderValue"); dataCallback("onPartData"); this.index = index; this.state = state; this.flags = flags; } end() { if (this.state === S.HEADER_FIELD_START && this.index === 0 || this.state === S.PART_DATA && this.index === this.boundary.length) { this.onPartEnd(); } else if (this.state !== S.END) { throw new Error("MultipartParser.end(): stream ended unexpectedly"); } } }; } }); // server/bootstrap.ts var bootstrap_exports = {}; __export(bootstrap_exports, { uploadStore: () => uploadStore }); module.exports = __toCommonJS(bootstrap_exports); // ../node_modules/.pnpm/koa@2.15.4/node_modules/koa/dist/koa.mjs var import_application = __toESM(require_application(), 1); var koa_default = import_application.default; var HttpError = import_application.default.HttpError; // server/koa-router.ts var import_router = __toESM(require_router()); // server/multer.ts var import_multer = __toESM(require_multer()); function multer(options) { const m2 = (0, import_multer.default)(options); makePromise(m2, "any"); makePromise(m2, "array"); makePromise(m2, "fields"); makePromise(m2, "none"); makePromise(m2, "single"); return m2; } function makePromise(multer2, name) { if (!multer2[name]) return; const fn2 = multer2[name]; multer2[name] = function() { const middleware = Reflect.apply(fn2, this, arguments); return async (ctx, next) => { await new Promise((resolve, reject) => { middleware(ctx.req, ctx.res, (err) => { if (err) return reject(err); if ("request" in ctx) { if (ctx.req.body) { ctx.request.body = ctx.req.body; delete ctx.req.body; } if (ctx.req.file) { ctx.request.file = ctx.req.file; ctx.file = ctx.req.file; delete ctx.req.file; } if (ctx.req.files) { ctx.request.files = ctx.req.files; ctx.files = ctx.req.files; delete ctx.req.files; } } resolve(ctx); }); }); return next(); }; }; } multer.diskStorage = import_multer.default.diskStorage; multer.memoryStorage = import_multer.default.memoryStorage; // server/koa-router.ts var import_http_wrapper = __toESM(require_http_wrapper()); var import_form_data = __toESM(require_form_data()); // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/index.js var import_node_http2 = __toESM(require("node:http"), 1); var import_node_https = __toESM(require("node:https"), 1); var import_node_zlib = __toESM(require("node:zlib"), 1); var import_node_stream2 = __toESM(require("node:stream"), 1); var import_node_buffer2 = require("node:buffer"); // ../node_modules/.pnpm/data-uri-to-buffer@4.0.1/node_modules/data-uri-to-buffer/dist/index.js function dataUriToBuffer(uri) { if (!/^data:/i.test(uri)) { throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")'); } uri = uri.replace(/\r?\n/g, ""); const firstComma = uri.indexOf(","); if (firstComma === -1 || firstComma <= 4) { throw new TypeError("malformed data: URI"); } const meta = uri.substring(5, firstComma).split(";"); let charset = ""; let base64 = false; const type = meta[0] || "text/plain"; let typeFull = type; for (let i2 = 1; i2 < meta.length; i2++) { if (meta[i2] === "base64") { base64 = true; } else if (meta[i2]) { typeFull += `;${meta[i2]}`; if (meta[i2].indexOf("charset=") === 0) { charset = meta[i2].substring(8); } } } if (!meta[0] && !charset.length) { typeFull += ";charset=US-ASCII"; charset = "US-ASCII"; } const encoding = base64 ? "base64" : "ascii"; const data = unescape(uri.substring(firstComma + 1)); const buffer2 = Buffer.from(data, encoding); buffer2.type = type; buffer2.typeFull = typeFull; buffer2.charset = charset; return buffer2; } var dist_default = dataUriToBuffer; // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/body.js var import_node_stream = __toESM(require("node:stream"), 1); var import_node_util = require("node:util"); var import_node_buffer = require("node:buffer"); init_fetch_blob(); init_esm_min(); // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/errors/base.js var FetchBaseError = class extends Error { constructor(message2, type) { super(message2); Error.captureStackTrace(this, this.constructor); this.type = type; } get name() { return this.constructor.name; } get [Symbol.toStringTag]() { return this.constructor.name; } }; // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/errors/fetch-error.js var FetchError = class extends FetchBaseError { /** * @param {string} message - Error message for human * @param {string} [type] - Error type for machine * @param {SystemError} [systemError] - For Node.js system error */ constructor(message2, type, systemError) { super(message2, type); if (systemError) { this.code = this.errno = systemError.code; this.erroredSysCall = systemError.syscall; } } }; // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/is.js var NAME = Symbol.toStringTag; var isURLSearchParameters = (object) => { return typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && typeof object.sort === "function" && object[NAME] === "URLSearchParams"; }; var isBlob = (object) => { return object && typeof object === "object" && typeof object.arrayBuffer === "function" && typeof object.type === "string" && typeof object.stream === "function" && typeof object.constructor === "function" && /^(Blob|File)$/.test(object[NAME]); }; var isAbortSignal = (object) => { return typeof object === "object" && (object[NAME] === "AbortSignal" || object[NAME] === "EventTarget"); }; var isDomainOrSubdomain = (destination, original) => { const orig = new URL(original).hostname; const dest = new URL(destination).hostname; return orig === dest || orig.endsWith(`.${dest}`); }; var isSameProtocol = (destination, original) => { const orig = new URL(original).protocol; const dest = new URL(destination).protocol; return orig === dest; }; // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/body.js var pipeline = (0, import_node_util.promisify)(import_node_stream.default.pipeline); var INTERNALS = Symbol("Body internals"); var Body = class { constructor(body, { size = 0 } = {}) { let boundary = null; if (body === null) { body = null; } else if (isURLSearchParameters(body)) { body = import_node_buffer.Buffer.from(body.toString()); } else if (isBlob(body)) { } else if (import_node_buffer.Buffer.isBuffer(body)) { } else if (import_node_util.types.isAnyArrayBuffer(body)) { body = import_node_buffer.Buffer.from(body); } else if (ArrayBuffer.isView(body)) { body = import_node_buffer.Buffer.from(body.buffer, body.byteOffset, body.byteLength); } else if (body instanceof import_node_stream.default) { } else if (body instanceof FormData) { body = formDataToBlob(body); boundary = body.type.split("=")[1]; } else { body = import_node_buffer.Buffer.from(String(body)); } let stream = body; if (import_node_buffer.Buffer.isBuffer(body)) { stream = import_node_stream.default.Readable.from(body); } else if (isBlob(body)) { stream = import_node_stream.default.Readable.from(body.stream()); } this[INTERNALS] = { body, stream, boundary, disturbed: false, error: null }; this.size = size; if (body instanceof import_node_stream.default) { body.on("error", (error_) => { const error = error_ instanceof FetchBaseError ? error_ : new FetchError(`Invalid response body while trying to fetch ${this.url}: ${error_.message}`, "system", error_); this[INTERNALS].error = error; }); } } get body() { return this[INTERNALS].stream; } get bodyUsed() { return this[INTERNALS].disturbed; } /** * Decode response as ArrayBuffer * * @return Promise */ async arrayBuffer() { const { buffer: buffer2, byteOffset, byteLength } = await consumeBody(this); return buffer2.slice(byteOffset, byteOffset + byteLength); } async formData() { const ct = this.headers.get("content-type"); if (ct.startsWith("application/x-www-form-urlencoded")) { const formData = new FormData(); const parameters = new URLSearchParams(await this.text()); for (const [name, value] of parameters) { formData.append(name, value); } return formData; } const { toFormData: toFormData2 } = await Promise.resolve().then(() => (init_multipart_parser(), multipart_parser_exports)); return toFormData2(this.body, ct); } /** * Return raw response as Blob * * @return Promise */ async blob() { const ct = this.headers && this.headers.get("content-type") || this[INTERNALS].body && this[INTERNALS].body.type || ""; const buf = await this.arrayBuffer(); return new fetch_blob_default([buf], { type: ct }); } /** * Decode response as json * * @return Promise */ async json() { const text = await this.text(); return JSON.parse(text); } /** * Decode response as text * * @return Promise */ async text() { const buffer2 = await consumeBody(this); return new TextDecoder().decode(buffer2); } /** * Decode response as buffer (non-spec api) * * @return Promise */ buffer() { return consumeBody(this); } }; Body.prototype.buffer = (0, import_node_util.deprecate)(Body.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer"); Object.defineProperties(Body.prototype, { body: { enumerable: true }, bodyUsed: { enumerable: true }, arrayBuffer: { enumerable: true }, blob: { enumerable: true }, json: { enumerable: true }, text: { enumerable: true }, data: { get: (0, import_node_util.deprecate)( () => { }, "data doesn't exist, use json(), text(), arrayBuffer(), or body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (response)" ) } }); async function consumeBody(data) { if (data[INTERNALS].disturbed) { throw new TypeError(`body used already for: ${data.url}`); } data[INTERNALS].disturbed = true; if (data[INTERNALS].error) { throw data[INTERNALS].error; } const { body } = data; if (body === null) { return import_node_buffer.Buffer.alloc(0); } if (!(body instanceof import_node_stream.default)) { return import_node_buffer.Buffer.alloc(0); } const accum = []; let accumBytes = 0; try { for await (const chunk of body) { if (data.size > 0 && accumBytes + chunk.length > data.size) { const error = new FetchError(`content size at ${data.url} over limit: ${data.size}`, "max-size"); body.destroy(error); throw error; } accumBytes += chunk.length; accum.push(chunk); } } catch (error) { const error_ = error instanceof FetchBaseError ? error : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`, "system", error); throw error_; } if (body.readableEnded === true || body._readableState.ended === true) { try { if (accum.every((c) => typeof c === "string")) { return import_node_buffer.Buffer.from(accum.join("")); } return import_node_buffer.Buffer.concat(accum, accumBytes); } catch (error) { throw new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`, "system", error); } } else { throw new FetchError(`Premature close of server response while trying to fetch ${data.url}`); } } var clone = (instance, highWaterMark) => { let p1; let p2; let { body } = instance[INTERNALS]; if (instance.bodyUsed) { throw new Error("cannot clone body after it is used"); } if (body instanceof import_node_stream.default && typeof body.getBoundary !== "function") { p1 = new import_node_stream.PassThrough({ highWaterMark }); p2 = new import_node_stream.PassThrough({ highWaterMark }); body.pipe(p1); body.pipe(p2); instance[INTERNALS].stream = p1; body = p2; } return body; }; var getNonSpecFormDataBoundary = (0, import_node_util.deprecate)( (body) => body.getBoundary(), "form-data doesn't follow the spec and requires special treatment. Use alternative package", "https://github.com/node-fetch/node-fetch/issues/1167" ); var extractContentType = (body, request) => { if (body === null) { return null; } if (typeof body === "string") { return "text/plain;charset=UTF-8"; } if (isURLSearchParameters(body)) { return "application/x-www-form-urlencoded;charset=UTF-8"; } if (isBlob(body)) { return body.type || null; } if (import_node_buffer.Buffer.isBuffer(body) || import_node_util.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) { return null; } if (body instanceof FormData) { return `multipart/form-data; boundary=${request[INTERNALS].boundary}`; } if (body && typeof body.getBoundary === "function") { return `multipart/form-data;boundary=${getNonSpecFormDataBoundary(body)}`; } if (body instanceof import_node_stream.default) { return null; } return "text/plain;charset=UTF-8"; }; var getTotalBytes = (request) => { const { body } = request[INTERNALS]; if (body === null) { return 0; } if (isBlob(body)) { return body.size; } if (import_node_buffer.Buffer.isBuffer(body)) { return body.length; } if (body && typeof body.getLengthSync === "function") { return body.hasKnownLength && body.hasKnownLength() ? body.getLengthSync() : null; } return null; }; var writeToStream = async (dest, { body }) => { if (body === null) { dest.end(); } else { await pipeline(body, dest); } }; // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/headers.js var import_node_util2 = require("node:util"); var import_node_http = __toESM(require("node:http"), 1); var validateHeaderName = typeof import_node_http.default.validateHeaderName === "function" ? import_node_http.default.validateHeaderName : (name) => { if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) { const error = new TypeError(`Header name must be a valid HTTP token [${name}]`); Object.defineProperty(error, "code", { value: "ERR_INVALID_HTTP_TOKEN" }); throw error; } }; var validateHeaderValue = typeof import_node_http.default.validateHeaderValue === "function" ? import_node_http.default.validateHeaderValue : (name, value) => { if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(value)) { const error = new TypeError(`Invalid character in header content ["${name}"]`); Object.defineProperty(error, "code", { value: "ERR_INVALID_CHAR" }); throw error; } }; var Headers = class _Headers extends URLSearchParams { /** * Headers class * * @constructor * @param {HeadersInit} [init] - Response headers */ constructor(init) { let result = []; if (init instanceof _Headers) { const raw = init.raw(); for (const [name, values] of Object.entries(raw)) { result.push(...values.map((value) => [name, value])); } } else if (init == null) { } else if (typeof init === "object" && !import_node_util2.types.isBoxedPrimitive(init)) { const method = init[Symbol.iterator]; if (method == null) { result.push(...Object.entries(init)); } else { if (typeof method !== "function") { throw new TypeError("Header pairs must be iterable"); } result = [...init].map((pair) => { if (typeof pair !== "object" || import_node_util2.types.isBoxedPrimitive(pair)) { throw new TypeError("Each header pair must be an iterable object"); } return [...pair]; }).map((pair) => { if (pair.length !== 2) { throw new TypeError("Each header pair must be a name/value tuple"); } return [...pair]; }); } } else { throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence> or record)"); } result = result.length > 0 ? result.map(([name, value]) => { validateHeaderName(name); validateHeaderValue(name, String(value)); return [String(name).toLowerCase(), String(value)]; }) : void 0; super(result); return new Proxy(this, { get(target, p, receiver) { switch (p) { case "append": case "set": return (name, value) => { validateHeaderName(name); validateHeaderValue(name, String(value)); return URLSearchParams.prototype[p].call( target, String(name).toLowerCase(), String(value) ); }; case "delete": case "has": case "getAll": return (name) => { validateHeaderName(name); return URLSearchParams.prototype[p].call( target, String(name).toLowerCase() ); }; case "keys": return () => { target.sort(); return new Set(URLSearchParams.prototype.keys.call(target)).keys(); }; default: return Reflect.get(target, p, receiver); } } }); } get [Symbol.toStringTag]() { return this.constructor.name; } toString() { return Object.prototype.toString.call(this); } get(name) { const values = this.getAll(name); if (values.length === 0) { return null; } let value = values.join(", "); if (/^content-encoding$/i.test(name)) { value = value.toLowerCase(); } return value; } forEach(callback, thisArg = void 0) { for (const name of this.keys()) { Reflect.apply(callback, thisArg, [this.get(name), name, this]); } } *values() { for (const name of this.keys()) { yield this.get(name); } } /** * @type {() => IterableIterator<[string, string]>} */ *entries() { for (const name of this.keys()) { yield [name, this.get(name)]; } } [Symbol.iterator]() { return this.entries(); } /** * Node-fetch non-spec method * returning all headers and their values as array * @returns {Record} */ raw() { return [...this.keys()].reduce((result, key) => { result[key] = this.getAll(key); return result; }, {}); } /** * For better console.log(headers) and also to convert Headers into Node.js Request compatible format */ [Symbol.for("nodejs.util.inspect.custom")]() { return [...this.keys()].reduce((result, key) => { const values = this.getAll(key); if (key === "host") { result[key] = values[0]; } else { result[key] = values.length > 1 ? values : values[0]; } return result; }, {}); } }; Object.defineProperties( Headers.prototype, ["get", "entries", "forEach", "values"].reduce((result, property) => { result[property] = { enumerable: true }; return result; }, {}) ); function fromRawHeaders(headers = []) { return new Headers( headers.reduce((result, value, index, array) => { if (index % 2 === 0) { result.push(array.slice(index, index + 2)); } return result; }, []).filter(([name, value]) => { try { validateHeaderName(name); validateHeaderValue(name, String(value)); return true; } catch { return false; } }) ); } // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/is-redirect.js var redirectStatus = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]); var isRedirect = (code) => { return redirectStatus.has(code); }; // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/response.js var INTERNALS2 = Symbol("Response internals"); var Response = class _Response extends Body { constructor(body = null, options = {}) { super(body, options); const status = options.status != null ? options.status : 200; const headers = new Headers(options.headers); if (body !== null && !headers.has("Content-Type")) { const contentType = extractContentType(body, this); if (contentType) { headers.append("Content-Type", contentType); } } this[INTERNALS2] = { type: "default", url: options.url, status, statusText: options.statusText || "", headers, counter: options.counter, highWaterMark: options.highWaterMark }; } get type() { return this[INTERNALS2].type; } get url() { return this[INTERNALS2].url || ""; } get status() { return this[INTERNALS2].status; } /** * Convenience property representing if the request ended normally */ get ok() { return this[INTERNALS2].status >= 200 && this[INTERNALS2].status < 300; } get redirected() { return this[INTERNALS2].counter > 0; } get statusText() { return this[INTERNALS2].statusText; } get headers() { return this[INTERNALS2].headers; } get highWaterMark() { return this[INTERNALS2].highWaterMark; } /** * Clone this response * * @return Response */ clone() { return new _Response(clone(this, this.highWaterMark), { type: this.type, url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected, size: this.size, highWaterMark: this.highWaterMark }); } /** * @param {string} url The URL that the new response is to originate from. * @param {number} status An optional status code for the response (e.g., 302.) * @returns {Response} A Response object. */ static redirect(url, status = 302) { if (!isRedirect(status)) { throw new RangeError('Failed to execute "redirect" on "response": Invalid status code'); } return new _Response(null, { headers: { location: new URL(url).toString() }, status }); } static error() { const response = new _Response(null, { status: 0, statusText: "" }); response[INTERNALS2].type = "error"; return response; } static json(data = void 0, init = {}) { const body = JSON.stringify(data); if (body === void 0) { throw new TypeError("data is not JSON serializable"); } const headers = new Headers(init && init.headers); if (!headers.has("content-type")) { headers.set("content-type", "application/json"); } return new _Response(body, { ...init, headers }); } get [Symbol.toStringTag]() { return "Response"; } }; Object.defineProperties(Response.prototype, { type: { enumerable: true }, url: { enumerable: true }, status: { enumerable: true }, ok: { enumerable: true }, redirected: { enumerable: true }, statusText: { enumerable: true }, headers: { enumerable: true }, clone: { enumerable: true } }); // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/request.js var import_node_url = require("node:url"); var import_node_util3 = require("node:util"); // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/get-search.js var getSearch = (parsedURL) => { if (parsedURL.search) { return parsedURL.search; } const lastOffset = parsedURL.href.length - 1; const hash = parsedURL.hash || (parsedURL.href[lastOffset] === "#" ? "#" : ""); return parsedURL.href[lastOffset - hash.length] === "?" ? "?" : ""; }; // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/referrer.js var import_node_net = require("node:net"); function stripURLForUseAsAReferrer(url, originOnly = false) { if (url == null) { return "no-referrer"; } url = new URL(url); if (/^(about|blob|data):$/.test(url.protocol)) { return "no-referrer"; } url.username = ""; url.password = ""; url.hash = ""; if (originOnly) { url.pathname = ""; url.search = ""; } return url; } var ReferrerPolicy = /* @__PURE__ */ new Set([ "", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url" ]); var DEFAULT_REFERRER_POLICY = "strict-origin-when-cross-origin"; function validateReferrerPolicy(referrerPolicy) { if (!ReferrerPolicy.has(referrerPolicy)) { throw new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`); } return referrerPolicy; } function isOriginPotentiallyTrustworthy(url) { if (/^(http|ws)s:$/.test(url.protocol)) { return true; } const hostIp = url.host.replace(/(^\[)|(]$)/g, ""); const hostIPVersion = (0, import_node_net.isIP)(hostIp); if (hostIPVersion === 4 && /^127\./.test(hostIp)) { return true; } if (hostIPVersion === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp)) { return true; } if (url.host === "localhost" || url.host.endsWith(".localhost")) { return false; } if (url.protocol === "file:") { return true; } return false; } function isUrlPotentiallyTrustworthy(url) { if (/^about:(blank|srcdoc)$/.test(url)) { return true; } if (url.protocol === "data:") { return true; } if (/^(blob|filesystem):$/.test(url.protocol)) { return true; } return isOriginPotentiallyTrustworthy(url); } function determineRequestsReferrer(request, { referrerURLCallback, referrerOriginCallback } = {}) { if (request.referrer === "no-referrer" || request.referrerPolicy === "") { return null; } const policy = request.referrerPolicy; if (request.referrer === "about:client") { return "no-referrer"; } const referrerSource = request.referrer; let referrerURL = stripURLForUseAsAReferrer(referrerSource); let referrerOrigin = stripURLForUseAsAReferrer(referrerSource, true); if (referrerURL.toString().length > 4096) { referrerURL = referrerOrigin; } if (referrerURLCallback) { referrerURL = referrerURLCallback(referrerURL); } if (referrerOriginCallback) { referrerOrigin = referrerOriginCallback(referrerOrigin); } const currentURL = new URL(request.url); switch (policy) { case "no-referrer": return "no-referrer"; case "origin": return referrerOrigin; case "unsafe-url": return referrerURL; case "strict-origin": if (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) { return "no-referrer"; } return referrerOrigin.toString(); case "strict-origin-when-cross-origin": if (referrerURL.origin === currentURL.origin) { return referrerURL; } if (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) { return "no-referrer"; } return referrerOrigin; case "same-origin": if (referrerURL.origin === currentURL.origin) { return referrerURL; } return "no-referrer"; case "origin-when-cross-origin": if (referrerURL.origin === currentURL.origin) { return referrerURL; } return referrerOrigin; case "no-referrer-when-downgrade": if (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) { return "no-referrer"; } return referrerURL; default: throw new TypeError(`Invalid referrerPolicy: ${policy}`); } } function parseReferrerPolicyFromHeader(headers) { const policyTokens = (headers.get("referrer-policy") || "").split(/[,\s]+/); let policy = ""; for (const token of policyTokens) { if (token && ReferrerPolicy.has(token)) { policy = token; } } return policy; } // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/request.js var INTERNALS3 = Symbol("Request internals"); var isRequest = (object) => { return typeof object === "object" && typeof object[INTERNALS3] === "object"; }; var doBadDataWarn = (0, import_node_util3.deprecate)( () => { }, ".data is not a valid RequestInit property, use .body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (request)" ); var Request = class _Request extends Body { constructor(input, init = {}) { let parsedURL; if (isRequest(input)) { parsedURL = new URL(input.url); } else { parsedURL = new URL(input); input = {}; } if (parsedURL.username !== "" || parsedURL.password !== "") { throw new TypeError(`${parsedURL} is an url with embedded credentials.`); } let method = init.method || input.method || "GET"; if (/^(delete|get|head|options|post|put)$/i.test(method)) { method = method.toUpperCase(); } if (!isRequest(init) && "data" in init) { doBadDataWarn(); } if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) { throw new TypeError("Request with GET/HEAD method cannot have body"); } const inputBody = init.body ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; super(inputBody, { size: init.size || input.size || 0 }); const headers = new Headers(init.headers || input.headers || {}); if (inputBody !== null && !headers.has("Content-Type")) { const contentType = extractContentType(inputBody, this); if (contentType) { headers.set("Content-Type", contentType); } } let signal = isRequest(input) ? input.signal : null; if ("signal" in init) { signal = init.signal; } if (signal != null && !isAbortSignal(signal)) { throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget"); } let referrer = init.referrer == null ? input.referrer : init.referrer; if (referrer === "") { referrer = "no-referrer"; } else if (referrer) { const parsedReferrer = new URL(referrer); referrer = /^about:(\/\/)?client$/.test(parsedReferrer) ? "client" : parsedReferrer; } else { referrer = void 0; } this[INTERNALS3] = { method, redirect: init.redirect || input.redirect || "follow", headers, parsedURL, signal, referrer }; this.follow = init.follow === void 0 ? input.follow === void 0 ? 20 : input.follow : init.follow; this.compress = init.compress === void 0 ? input.compress === void 0 ? true : input.compress : init.compress; this.counter = init.counter || input.counter || 0; this.agent = init.agent || input.agent; this.highWaterMark = init.highWaterMark || input.highWaterMark || 16384; this.insecureHTTPParser = init.insecureHTTPParser || input.insecureHTTPParser || false; this.referrerPolicy = init.referrerPolicy || input.referrerPolicy || ""; } /** @returns {string} */ get method() { return this[INTERNALS3].method; } /** @returns {string} */ get url() { return (0, import_node_url.format)(this[INTERNALS3].parsedURL); } /** @returns {Headers} */ get headers() { return this[INTERNALS3].headers; } get redirect() { return this[INTERNALS3].redirect; } /** @returns {AbortSignal} */ get signal() { return this[INTERNALS3].signal; } // https://fetch.spec.whatwg.org/#dom-request-referrer get referrer() { if (this[INTERNALS3].referrer === "no-referrer") { return ""; } if (this[INTERNALS3].referrer === "client") { return "about:client"; } if (this[INTERNALS3].referrer) { return this[INTERNALS3].referrer.toString(); } return void 0; } get referrerPolicy() { return this[INTERNALS3].referrerPolicy; } set referrerPolicy(referrerPolicy) { this[INTERNALS3].referrerPolicy = validateReferrerPolicy(referrerPolicy); } /** * Clone this request * * @return Request */ clone() { return new _Request(this); } get [Symbol.toStringTag]() { return "Request"; } }; Object.defineProperties(Request.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, redirect: { enumerable: true }, clone: { enumerable: true }, signal: { enumerable: true }, referrer: { enumerable: true }, referrerPolicy: { enumerable: true } }); var getNodeRequestOptions = (request) => { const { parsedURL } = request[INTERNALS3]; const headers = new Headers(request[INTERNALS3].headers); if (!headers.has("Accept")) { headers.set("Accept", "*/*"); } let contentLengthValue = null; if (request.body === null && /^(post|put)$/i.test(request.method)) { contentLengthValue = "0"; } if (request.body !== null) { const totalBytes = getTotalBytes(request); if (typeof totalBytes === "number" && !Number.isNaN(totalBytes)) { contentLengthValue = String(totalBytes); } } if (contentLengthValue) { headers.set("Content-Length", contentLengthValue); } if (request.referrerPolicy === "") { request.referrerPolicy = DEFAULT_REFERRER_POLICY; } if (request.referrer && request.referrer !== "no-referrer") { request[INTERNALS3].referrer = determineRequestsReferrer(request); } else { request[INTERNALS3].referrer = "no-referrer"; } if (request[INTERNALS3].referrer instanceof URL) { headers.set("Referer", request.referrer); } if (!headers.has("User-Agent")) { headers.set("User-Agent", "node-fetch"); } if (request.compress && !headers.has("Accept-Encoding")) { headers.set("Accept-Encoding", "gzip, deflate, br"); } let { agent } = request; if (typeof agent === "function") { agent = agent(parsedURL); } const search = getSearch(parsedURL); const options = { // Overwrite search to retain trailing ? (issue #776) path: parsedURL.pathname + search, // The following options are not expressed in the URL method: request.method, headers: headers[Symbol.for("nodejs.util.inspect.custom")](), insecureHTTPParser: request.insecureHTTPParser, agent }; return { /** @type {URL} */ parsedURL, options }; }; // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/errors/abort-error.js var AbortError = class extends FetchBaseError { constructor(message2, type = "aborted") { super(message2, type); } }; // ../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/index.js init_esm_min(); init_from(); var supportedSchemas = /* @__PURE__ */ new Set(["data:", "http:", "https:"]); async function fetch(url, options_) { return new Promise((resolve, reject) => { const request = new Request(url, options_); const { parsedURL, options } = getNodeRequestOptions(request); if (!supportedSchemas.has(parsedURL.protocol)) { throw new TypeError(`node-fetch cannot load ${url}. URL scheme "${parsedURL.protocol.replace(/:$/, "")}" is not supported.`); } if (parsedURL.protocol === "data:") { const data = dist_default(request.url); const response2 = new Response(data, { headers: { "Content-Type": data.typeFull } }); resolve(response2); return; } const send = (parsedURL.protocol === "https:" ? import_node_https.default : import_node_http2.default).request; const { signal } = request; let response = null; const abort = () => { const error = new AbortError("The operation was aborted."); reject(error); if (request.body && request.body instanceof import_node_stream2.default.Readable) { request.body.destroy(error); } if (!response || !response.body) { return; } response.body.emit("error", error); }; if (signal && signal.aborted) { abort(); return; } const abortAndFinalize = () => { abort(); finalize(); }; const request_ = send(parsedURL.toString(), options); if (signal) { signal.addEventListener("abort", abortAndFinalize); } const finalize = () => { request_.abort(); if (signal) { signal.removeEventListener("abort", abortAndFinalize); } }; request_.on("error", (error) => { reject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`, "system", error)); finalize(); }); fixResponseChunkedTransferBadEnding(request_, (error) => { if (response && response.body) { response.body.destroy(error); } }); if (process.version < "v14") { request_.on("socket", (s2) => { let endedWithEventsCount; s2.prependListener("end", () => { endedWithEventsCount = s2._eventsCount; }); s2.prependListener("close", (hadError) => { if (response && endedWithEventsCount < s2._eventsCount && !hadError) { const error = new Error("Premature close"); error.code = "ERR_STREAM_PREMATURE_CLOSE"; response.body.emit("error", error); } }); }); } request_.on("response", (response_) => { request_.setTimeout(0); const headers = fromRawHeaders(response_.rawHeaders); if (isRedirect(response_.statusCode)) { const location = headers.get("Location"); let locationURL = null; try { locationURL = location === null ? null : new URL(location, request.url); } catch { if (request.redirect !== "manual") { reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect")); finalize(); return; } } switch (request.redirect) { case "error": reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, "no-redirect")); finalize(); return; case "manual": break; case "follow": { if (locationURL === null) { break; } if (request.counter >= request.follow) { reject(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect")); finalize(); return; } const requestOptions = { headers: new Headers(request.headers), follow: request.follow, counter: request.counter + 1, agent: request.agent, compress: request.compress, method: request.method, body: clone(request), signal: request.signal, size: request.size, referrer: request.referrer, referrerPolicy: request.referrerPolicy }; if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) { requestOptions.headers.delete(name); } } if (response_.statusCode !== 303 && request.body && options_.body instanceof import_node_stream2.default.Readable) { reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")); finalize(); return; } if (response_.statusCode === 303 || (response_.statusCode === 301 || response_.statusCode === 302) && request.method === "POST") { requestOptions.method = "GET"; requestOptions.body = void 0; requestOptions.headers.delete("content-length"); } const responseReferrerPolicy = parseReferrerPolicyFromHeader(headers); if (responseReferrerPolicy) { requestOptions.referrerPolicy = responseReferrerPolicy; } resolve(fetch(new Request(locationURL, requestOptions))); finalize(); return; } default: return reject(new TypeError(`Redirect option '${request.redirect}' is not a valid value of RequestRedirect`)); } } if (signal) { response_.once("end", () => { signal.removeEventListener("abort", abortAndFinalize); }); } let body = (0, import_node_stream2.pipeline)(response_, new import_node_stream2.PassThrough(), (error) => { if (error) { reject(error); } }); if (process.version < "v12.10") { response_.on("aborted", abortAndFinalize); } const responseOptions = { url: request.url, status: response_.statusCode, statusText: response_.statusMessage, headers, size: request.size, counter: request.counter, highWaterMark: request.highWaterMark }; const codings = headers.get("Content-Encoding"); if (!request.compress || request.method === "HEAD" || codings === null || response_.statusCode === 204 || response_.statusCode === 304) { response = new Response(body, responseOptions); resolve(response); return; } const zlibOptions = { flush: import_node_zlib.default.Z_SYNC_FLUSH, finishFlush: import_node_zlib.default.Z_SYNC_FLUSH }; if (codings === "gzip" || codings === "x-gzip") { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createGunzip(zlibOptions), (error) => { if (error) { reject(error); } }); response = new Response(body, responseOptions); resolve(response); return; } if (codings === "deflate" || codings === "x-deflate") { const raw = (0, import_node_stream2.pipeline)(response_, new import_node_stream2.PassThrough(), (error) => { if (error) { reject(error); } }); raw.once("data", (chunk) => { if ((chunk[0] & 15) === 8) { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createInflate(), (error) => { if (error) { reject(error); } }); } else { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createInflateRaw(), (error) => { if (error) { reject(error); } }); } response = new Response(body, responseOptions); resolve(response); }); raw.once("end", () => { if (!response) { response = new Response(body, responseOptions); resolve(response); } }); return; } if (codings === "br") { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createBrotliDecompress(), (error) => { if (error) { reject(error); } }); response = new Response(body, responseOptions); resolve(response); return; } response = new Response(body, responseOptions); resolve(response); }); writeToStream(request_, request).catch(reject); }); } function fixResponseChunkedTransferBadEnding(request, errorCallback) { const LAST_CHUNK = import_node_buffer2.Buffer.from("0\r\n\r\n"); let isChunkedTransfer = false; let properLastChunkReceived = false; let previousChunk; request.on("response", (response) => { const { headers } = response; isChunkedTransfer = headers["transfer-encoding"] === "chunked" && !headers["content-length"]; }); request.on("socket", (socket) => { const onSocketClose = () => { if (isChunkedTransfer && !properLastChunkReceived) { const error = new Error("Premature close"); error.code = "ERR_STREAM_PREMATURE_CLOSE"; errorCallback(error); } }; const onData = (buf) => { properLastChunkReceived = import_node_buffer2.Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0; if (!properLastChunkReceived && previousChunk) { properLastChunkReceived = import_node_buffer2.Buffer.compare(previousChunk.slice(-3), LAST_CHUNK.slice(0, 3)) === 0 && import_node_buffer2.Buffer.compare(buf.slice(-2), LAST_CHUNK.slice(3)) === 0; } previousChunk = buf; }; socket.prependListener("close", onSocketClose); socket.on("data", onData); request.on("close", () => { socket.removeListener("close", onSocketClose); socket.removeListener("data", onData); }); }); } // server/koa-router.ts async function createServer(uploadStore2) { const app = new koa_default(); const router = new import_router.default(); const upload = multer({ storage: multer.memoryStorage() }); router.post("/image", upload.single("file"), async (ctx) => { const token = ctx.request.headers["x-screencapture-token"]; if (!token) { ctx.status = 401; ctx.body = { status: "error", message: "No token provided" }; return; } const { callback, dataType, isRemote, remoteConfig, url, playerSource, correlationId } = uploadStore2.getUpload(token); const file = ctx.file; if (!file) { ctx.status = 400; ctx.body = { status: "error", message: "No file provided" }; return; } try { const buf = await buffer(dataType, file.buffer); if (isRemote) { const response = await uploadFile(url, remoteConfig, buf, dataType); if (playerSource && correlationId) { callback(response, playerSource, correlationId); } else { callback(response); } } else { callback(buf); } ctx.status = 200; ctx.body = { status: "success" }; } catch (err) { if (err instanceof Error) { ctx.status = 500; ctx.body = { status: "error", message: err.message }; } else { ctx.status = 500; ctx.body = { status: "error", message: "An unknown error occurred" }; } } }); app.use(router.routes()).use(router.allowedMethods()); (0, import_http_wrapper.setHttpCallback)(app.callback()); } async function uploadFile(url, config, buf, dataType) { if (!url) throw new Error("No remote URL provided"); if (!config) throw new Error("No remote config provided"); try { const body = await createRequestBody(buf, dataType, config); let response; if (body instanceof import_form_data.default) { response = await fetch(url, { method: "POST", headers: { ...body.getHeaders(), ...config.headers }, body: body.getBuffer() }); } else { response = await fetch(url, { method: "POST", headers: config.headers || {}, // as soon as we get a node upgrade, we'll use Node's http module // we might be able to do it now, but if so I'll test that later body }); } if (!response.ok) { const text = await response.text(); throw new Error(`Failed to upload file to ${url}. Status: ${response.status}. Response: ${text}`); } const res = await response.json(); return res; } catch (err) { if (err instanceof Error) { throw new Error(err.message); } } } function createRequestBody(buf, dataType, config) { return new Promise((resolve, reject) => { const { formField, filename } = config; const filenameExt = filename ? `${filename}.${config.encoding}` : `screenshot.${config.encoding}`; if (dataType === "blob") { const formData = new import_form_data.default(); formData.append(formField || "file", buf, filenameExt); if (filename) { formData.append("filename", filename); } return resolve(formData); } if (typeof buf === "string" && dataType === "base64") { return resolve(buf); } return reject("Invalid body data"); }); } async function buffer(dataType, imageData) { return new Promise(async (resolve, reject) => { if (dataType === "base64") { const blob = new Blob([imageData]); const dateURL = await blobToBase64(blob); resolve(dateURL); } else { resolve(imageData); } }); } async function blobToBase64(blob) { return new Promise(async (resolve, reject) => { try { const arrayBuffer = await blob.arrayBuffer(); const base64 = Buffer.from(arrayBuffer).toString("base64"); resolve(base64); } catch (err) { reject(err); } }); } // server/export.ts global.exports( "remoteUpload", (source, url, options, callback, dataType = "base64") => { if (!source) return console.error("source is required for serverCapture"); const token = uploadStore.addUpload({ callback, isRemote: true, remoteConfig: { ...options, encoding: options.encoding ?? "webp" }, url, dataType }); emitNet("screencapture:captureScreen", source, token, options, dataType); } ); global.exports( "serverCapture", (source, options, callback, dataType = "base64") => { if (!source) return console.error("source is required for serverCapture"); const token = uploadStore.addUpload({ callback, isRemote: false, remoteConfig: null, dataType }); const opts = { ...options, encoding: options.encoding ?? "webp" }; emitNet("screencapture:captureScreen", source, token, opts, dataType); } ); // server/context.ts function getEventContext() { const _source = global.source; return { source: _source }; } // server/event.ts function eventController(event, callback) { onNet(event, async (responseEvent, data) => { const ctx = getEventContext(); function send(data2) { return emitNet(responseEvent, ctx.source, data2); } await callback({ body: data, ctx, send }); }); } // ../node_modules/.pnpm/nanoid@5.0.8/node_modules/nanoid/index.js var import_node_crypto = require("node:crypto"); // ../node_modules/.pnpm/nanoid@5.0.8/node_modules/nanoid/url-alphabet/index.js var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"; // ../node_modules/.pnpm/nanoid@5.0.8/node_modules/nanoid/index.js var POOL_SIZE_MULTIPLIER = 128; var pool; var poolOffset; function fillPool(bytes) { if (!pool || pool.length < bytes) { pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER); import_node_crypto.webcrypto.getRandomValues(pool); poolOffset = 0; } else if (poolOffset + bytes > pool.length) { import_node_crypto.webcrypto.getRandomValues(pool); poolOffset = 0; } poolOffset += bytes; } function nanoid(size = 21) { fillPool(size -= 0); let id = ""; for (let i2 = poolOffset - size; i2 < poolOffset; i2++) { id += urlAlphabet[pool[i2] & 63]; } return id; } // server/upload-store.ts var UploadStore = class { #uploadMap; //#streamUploadMap: Map; constructor() { this.#uploadMap = /* @__PURE__ */ new Map(); } addUpload(params) { const uploadToken = nanoid(24); this.#uploadMap.set(uploadToken, params); return uploadToken; } getUpload(uploadToken) { const exists = this.#uploadMap.has(uploadToken); if (!exists) { throw new Error("Upload data does not exist. Cancelling screen capture."); } const data = this.#uploadMap.get(uploadToken); if (!data) throw new Error("Could not find upload data"); return data; } }; // server/bootstrap.ts var uploadStore = new UploadStore(); async function boot() { createServer(uploadStore); } boot(); eventController( "screencapture:INTERNAL_requestUploadToken", async ({ ctx, body, send }) => { function uploadCallback(response, playerSource, correlationId) { emitNet("screencapture:INTERNAL_uploadComplete", playerSource, JSON.stringify(response), correlationId); } const token = uploadStore.addUpload({ callback: uploadCallback, isRemote: true, remoteConfig: { filename: body ? body.filename : void 0, encoding: body.encoding, headers: body.headers, formField: "file" }, url: body.url, dataType: "blob", playerSource: ctx.source, correlationId: body.correlationId }); return send(token); } ); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { uploadStore }); /*! Bundled license information: ee-first/index.js: (*! * ee-first * Copyright(c) 2014 Jonathan Ong * MIT Licensed *) on-finished/index.js: (*! * on-finished * Copyright(c) 2013 Jonathan Ong * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed *) safe-buffer/index.js: (*! safe-buffer. MIT License. Feross Aboukhadijeh *) content-disposition/index.js: (*! * content-disposition * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed *) mime-db/index.js: (*! * mime-db * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015-2022 Douglas Christopher Wilson * MIT Licensed *) mime-types/index.js: (*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed *) escape-html/index.js: (*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * Copyright(c) 2015 Andreas Lubbe * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed *) media-typer/index.js: (*! * media-typer * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed *) type-is/index.js: (*! * type-is * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed *) statuses/index.js: (*! * statuses * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed *) destroy/index.js: (*! * destroy * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015-2022 Douglas Christopher Wilson * MIT Licensed *) vary/index.js: (*! * vary * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed *) encodeurl/index.js: (*! * encodeurl * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed *) depd/lib/compat/callsite-tostring.js: (*! * depd * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed *) depd/lib/compat/event-listener-count.js: (*! * depd * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed *) depd/lib/compat/index.js: (*! * depd * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed *) depd/index.js: (*! * depd * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed *) toidentifier/index.js: (*! * toidentifier * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed *) http-errors/index.js: (*! * http-errors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed *) depd/index.js: (*! * depd * Copyright(c) 2014-2018 Douglas Christopher Wilson * MIT Licensed *) keygrip/index.js: (*! * keygrip * Copyright(c) 2011-2014 Jed Schmidt * MIT Licensed *) cookies/index.js: (*! * cookies * Copyright(c) 2014 Jed Schmidt, http://jed.is/ * Copyright(c) 2015-2016 Douglas Christopher Wilson * MIT Licensed *) negotiator/index.js: (*! * negotiator * Copyright(c) 2012 Federico Romero * Copyright(c) 2012-2014 Isaac Z. Schlueter * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed *) accepts/index.js: (*! * accepts * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed *) content-type/index.js: (*! * content-type * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed *) parseurl/index.js: (*! * parseurl * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed *) fresh/index.js: (*! * fresh * Copyright(c) 2012 TJ Holowaychuk * Copyright(c) 2016-2017 Douglas Christopher Wilson * MIT Licensed *) statuses/index.js: (*! * statuses * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed *) http-errors/index.js: (*! * http-errors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed *) object-assign/index.js: (* object-assign (c) Sindre Sorhus @license MIT *) web-streams-polyfill/dist/ponyfill.es2018.js: (** * @license * web-streams-polyfill v3.3.3 * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors. * This code is released under the MIT license. * SPDX-License-Identifier: MIT *) fetch-blob/index.js: (*! fetch-blob. MIT License. Jimmy Wärting *) formdata-polyfill/esm.min.js: (*! formdata-polyfill. MIT License. Jimmy Wärting *) node-domexception/index.js: (*! node-domexception. MIT License. Jimmy Wärting *) */