diff --git a/.github/workflows/generate_release_note.yml b/.github/workflows/generate_release_note.yml new file mode 100644 index 0000000..2925627 --- /dev/null +++ b/.github/workflows/generate_release_note.yml @@ -0,0 +1,16 @@ +name: Generate Release Note + +on: + push: + tags: + - '*' +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Generate release note + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true diff --git a/app/views/importmap_mocha/test/index.html.erb b/app/views/importmap_mocha/test/index.html.erb index e2da8a5..d3896f7 100644 --- a/app/views/importmap_mocha/test/index.html.erb +++ b/app/views/importmap_mocha/test/index.html.erb @@ -6,6 +6,7 @@ <% if Rails.application.config.importmap_mocha_scripts.size > 0 %> <%= javascript_include_tag *Rails.application.config.importmap_mocha_scripts %> <% end %> +<%= favicon_link_tag %> <%= javascript_include_tag 'mocha' %> <%= stylesheet_link_tag 'mocha' %> <%= javascript_importmap_tags 'importmap_mocha' %> diff --git a/config/importmap.rb b/config/importmap.rb index fece2fc..428ad36 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -4,13 +4,6 @@ pin "@mswjs/interceptors/presets/browser" , to: "@mswjs--interceptors--presets--browser.js" pin "chai", to: "chai.js" -pin "@open-draft/logger", to: "@open-draft--logger.js" # @0.3.0 -pin "is-node-process", to: "is-node-process.js" # @1.2.0 -pin "outvariant", to: "outvariant.js" # @1.4.0 -pin "@open-draft/until", to: "@open-draft--until.js" # @2.1.0 -pin "@open-draft/deferred-promise", to: "@open-draft--deferred-promise.js" # @2.2.0 -pin "strict-event-emitter", to: "strict-event-emitter.js" # @0.5.1 - Rails.application.config.importmap_mocha_path.each do |path| pin_all_from path end diff --git a/importmap_mocha-rails.gemspec b/importmap_mocha-rails.gemspec index 88d28bf..9bd8671 100644 --- a/importmap_mocha-rails.gemspec +++ b/importmap_mocha-rails.gemspec @@ -5,12 +5,13 @@ Gem::Specification.new do |spec| spec.version = ImportmapMocha::VERSION spec.authors = ['Takashi Kato'] spec.email = ['tohosaku@users.osdn.me'] - spec.homepage = 'https://github.com/tohosaku/importmap_mocha-rails' + spec.homepage = 'https://github.com/redmine-ui/importmap_mocha-rails' spec.summary = 'mochajs rails integration' - spec.description = 'Add JavaScript testing tools in importmap environment.' + spec.description = 'Add JavaScript testing tools in importmap-rails environment.' spec.required_ruby_version = '>= 2.7.0' spec.license = 'MIT' + spec.metadata['rubygems_mfa_required'] = 'true' spec.metadata['homepage_uri'] = spec.homepage spec.metadata['source_code_uri'] = spec.homepage spec.metadata['changelog_uri'] = spec.homepage @@ -19,6 +20,5 @@ Gem::Specification.new do |spec| Dir['app/**/*', 'config/**/*', 'lib/**/*', 'vendor/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] end - spec.add_dependency 'rails', '~> 7.0' - spec.add_dependency 'importmap-rails' + spec.add_dependency 'importmap-rails', '~> 2.0.0' end diff --git a/lib/importmap_mocha/version.rb b/lib/importmap_mocha/version.rb index 15f8c0f..319b55c 100644 --- a/lib/importmap_mocha/version.rb +++ b/lib/importmap_mocha/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ImportmapMocha - VERSION = '0.3.4' + VERSION = '0.3.5' end diff --git a/vendor/javascripts/@mswjs--interceptors--presets--browser.js b/vendor/javascripts/@mswjs--interceptors--presets--browser.js index 890eeff..810ee0b 100644 --- a/vendor/javascripts/@mswjs--interceptors--presets--browser.js +++ b/vendor/javascripts/@mswjs--interceptors--presets--browser.js @@ -1,13 +1,609 @@ -// src/interceptors/fetch/index.ts -import { invariant as invariant2 } from "outvariant"; -import { DeferredPromise as DeferredPromise3 } from "@open-draft/deferred-promise"; +// node_modules/.pnpm/outvariant@1.4.3/node_modules/outvariant/lib/index.mjs +var POSITIONALS_EXP = /(%?)(%([sdijo]))/g; +function serializePositional(positional, flag) { + switch (flag) { + case "s": + return positional; + case "d": + case "i": + return Number(positional); + case "j": + return JSON.stringify(positional); + case "o": { + if (typeof positional === "string") { + return positional; + } + const json = JSON.stringify(positional); + if (json === "{}" || json === "[]" || /^\[object .+?\]$/.test(json)) { + return positional; + } + return json; + } + } +} +function format(message, ...positionals) { + if (positionals.length === 0) { + return message; + } + let positionalIndex = 0; + let formattedMessage = message.replace( + POSITIONALS_EXP, + (match, isEscaped, _, flag) => { + const positional = positionals[positionalIndex]; + const value = serializePositional(positional, flag); + if (!isEscaped) { + positionalIndex++; + return value; + } + return match; + } + ); + if (positionalIndex < positionals.length) { + formattedMessage += ` ${positionals.slice(positionalIndex).join(" ")}`; + } + formattedMessage = formattedMessage.replace(/%{2,2}/g, "%"); + return formattedMessage; +} +var STACK_FRAMES_TO_IGNORE = 2; +function cleanErrorStack(error2) { + if (!error2.stack) { + return; + } + const nextStack = error2.stack.split("\n"); + nextStack.splice(1, STACK_FRAMES_TO_IGNORE); + error2.stack = nextStack.join("\n"); +} +var InvariantError = class extends Error { + constructor(message, ...positionals) { + super(message); + this.message = message; + this.name = "Invariant Violation"; + this.message = format(message, ...positionals); + cleanErrorStack(this); + } +}; +var invariant = (predicate, message, ...positionals) => { + if (!predicate) { + throw new InvariantError(message, ...positionals); + } +}; +invariant.as = (ErrorConstructor, predicate, message, ...positionals) => { + if (!predicate) { + const formatMessage = positionals.length === 0 ? message : format(message, ...positionals); + let error2; + try { + error2 = Reflect.construct(ErrorConstructor, [ + formatMessage + ]); + } catch (err) { + error2 = ErrorConstructor(formatMessage); + } + throw error2; + } +}; + +// node_modules/.pnpm/@open-draft+deferred-promise@2.2.0/node_modules/@open-draft/deferred-promise/build/index.mjs +function createDeferredExecutor() { + const executor = (resolve, reject) => { + executor.state = "pending"; + executor.resolve = (data) => { + if (executor.state !== "pending") { + return; + } + executor.result = data; + const onFulfilled = (value) => { + executor.state = "fulfilled"; + return value; + }; + return resolve( + data instanceof Promise ? data : Promise.resolve(data).then(onFulfilled) + ); + }; + executor.reject = (reason) => { + if (executor.state !== "pending") { + return; + } + queueMicrotask(() => { + executor.state = "rejected"; + }); + return reject(executor.rejectionReason = reason); + }; + }; + return executor; +} +var DeferredPromise = class extends Promise { + #executor; + resolve; + reject; + constructor(executor = null) { + const deferredExecutor = createDeferredExecutor(); + super((originalResolve, originalReject) => { + deferredExecutor(originalResolve, originalReject); + executor?.(deferredExecutor.resolve, deferredExecutor.reject); + }); + this.#executor = deferredExecutor; + this.resolve = this.#executor.resolve; + this.reject = this.#executor.reject; + } + get state() { + return this.#executor.state; + } + get rejectionReason() { + return this.#executor.rejectionReason; + } + then(onFulfilled, onRejected) { + return this.#decorate(super.then(onFulfilled, onRejected)); + } + catch(onRejected) { + return this.#decorate(super.catch(onRejected)); + } + finally(onfinally) { + return this.#decorate(super.finally(onfinally)); + } + #decorate(promise) { + return Object.defineProperties(promise, { + resolve: { configurable: true, value: this.resolve }, + reject: { configurable: true, value: this.reject } + }); + } +}; // src/glossary.ts var IS_PATCHED_MODULE = Symbol("isPatchedModule"); +// node_modules/.pnpm/is-node-process@1.2.0/node_modules/is-node-process/lib/index.mjs +function isNodeProcess() { + if (typeof navigator !== "undefined" && navigator.product === "ReactNative") { + return true; + } + if (typeof process !== "undefined") { + const type = process.type; + if (type === "renderer" || type === "worker") { + return false; + } + return !!(process.versions && process.versions.node); + } + return false; +} + +// node_modules/.pnpm/@open-draft+logger@0.3.0/node_modules/@open-draft/logger/lib/index.mjs +var __defProp = Object.defineProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var colors_exports = {}; +__export(colors_exports, { + blue: () => blue, + gray: () => gray, + green: () => green, + red: () => red, + yellow: () => yellow +}); +function yellow(text) { + return `\x1B[33m${text}\x1B[0m`; +} +function blue(text) { + return `\x1B[34m${text}\x1B[0m`; +} +function gray(text) { + return `\x1B[90m${text}\x1B[0m`; +} +function red(text) { + return `\x1B[31m${text}\x1B[0m`; +} +function green(text) { + return `\x1B[32m${text}\x1B[0m`; +} +var IS_NODE = isNodeProcess(); +var Logger = class { + constructor(name) { + this.name = name; + this.prefix = `[${this.name}]`; + const LOGGER_NAME = getVariable("DEBUG"); + const LOGGER_LEVEL = getVariable("LOG_LEVEL"); + const isLoggingEnabled = LOGGER_NAME === "1" || LOGGER_NAME === "true" || typeof LOGGER_NAME !== "undefined" && this.name.startsWith(LOGGER_NAME); + if (isLoggingEnabled) { + this.debug = isDefinedAndNotEquals(LOGGER_LEVEL, "debug") ? noop : this.debug; + this.info = isDefinedAndNotEquals(LOGGER_LEVEL, "info") ? noop : this.info; + this.success = isDefinedAndNotEquals(LOGGER_LEVEL, "success") ? noop : this.success; + this.warning = isDefinedAndNotEquals(LOGGER_LEVEL, "warning") ? noop : this.warning; + this.error = isDefinedAndNotEquals(LOGGER_LEVEL, "error") ? noop : this.error; + } else { + this.info = noop; + this.success = noop; + this.warning = noop; + this.error = noop; + this.only = noop; + } + } + prefix; + extend(domain) { + return new Logger(`${this.name}:${domain}`); + } + /** + * Print a debug message. + * @example + * logger.debug('no duplicates found, creating a document...') + */ + debug(message, ...positionals) { + this.logEntry({ + level: "debug", + message: gray(message), + positionals, + prefix: this.prefix, + colors: { + prefix: "gray" + } + }); + } + /** + * Print an info message. + * @example + * logger.info('start parsing...') + */ + info(message, ...positionals) { + this.logEntry({ + level: "info", + message, + positionals, + prefix: this.prefix, + colors: { + prefix: "blue" + } + }); + const performance2 = new PerformanceEntry(); + return (message2, ...positionals2) => { + performance2.measure(); + this.logEntry({ + level: "info", + message: `${message2} ${gray(`${performance2.deltaTime}ms`)}`, + positionals: positionals2, + prefix: this.prefix, + colors: { + prefix: "blue" + } + }); + }; + } + /** + * Print a success message. + * @example + * logger.success('successfully created document') + */ + success(message, ...positionals) { + this.logEntry({ + level: "info", + message, + positionals, + prefix: `\u2714 ${this.prefix}`, + colors: { + timestamp: "green", + prefix: "green" + } + }); + } + /** + * Print a warning. + * @example + * logger.warning('found legacy document format') + */ + warning(message, ...positionals) { + this.logEntry({ + level: "warning", + message, + positionals, + prefix: `\u26A0 ${this.prefix}`, + colors: { + timestamp: "yellow", + prefix: "yellow" + } + }); + } + /** + * Print an error message. + * @example + * logger.error('something went wrong') + */ + error(message, ...positionals) { + this.logEntry({ + level: "error", + message, + positionals, + prefix: `\u2716 ${this.prefix}`, + colors: { + timestamp: "red", + prefix: "red" + } + }); + } + /** + * Execute the given callback only when the logging is enabled. + * This is skipped in its entirety and has no runtime cost otherwise. + * This executes regardless of the log level. + * @example + * logger.only(() => { + * logger.info('additional info') + * }) + */ + only(callback) { + callback(); + } + createEntry(level, message) { + return { + timestamp: /* @__PURE__ */ new Date(), + level, + message + }; + } + logEntry(args) { + const { + level, + message, + prefix, + colors: customColors, + positionals = [] + } = args; + const entry = this.createEntry(level, message); + const timestampColor = customColors?.timestamp || "gray"; + const prefixColor = customColors?.prefix || "gray"; + const colorize = { + timestamp: colors_exports[timestampColor], + prefix: colors_exports[prefixColor] + }; + const write = this.getWriter(level); + write( + [colorize.timestamp(this.formatTimestamp(entry.timestamp))].concat(prefix != null ? colorize.prefix(prefix) : []).concat(serializeInput(message)).join(" "), + ...positionals.map(serializeInput) + ); + } + formatTimestamp(timestamp) { + return `${timestamp.toLocaleTimeString( + "en-GB" + )}:${timestamp.getMilliseconds()}`; + } + getWriter(level) { + switch (level) { + case "debug": + case "success": + case "info": { + return log; + } + case "warning": { + return warn; + } + case "error": { + return error; + } + } + } +}; +var PerformanceEntry = class { + startTime; + endTime; + deltaTime; + constructor() { + this.startTime = performance.now(); + } + measure() { + this.endTime = performance.now(); + const deltaTime = this.endTime - this.startTime; + this.deltaTime = deltaTime.toFixed(2); + } +}; +var noop = () => void 0; +function log(message, ...positionals) { + if (IS_NODE) { + process.stdout.write(format(message, ...positionals) + "\n"); + return; + } + console.log(message, ...positionals); +} +function warn(message, ...positionals) { + if (IS_NODE) { + process.stderr.write(format(message, ...positionals) + "\n"); + return; + } + console.warn(message, ...positionals); +} +function error(message, ...positionals) { + if (IS_NODE) { + process.stderr.write(format(message, ...positionals) + "\n"); + return; + } + console.error(message, ...positionals); +} +function getVariable(variableName) { + if (IS_NODE) { + return process.env[variableName]; + } + return globalThis[variableName]?.toString(); +} +function isDefinedAndNotEquals(value, expected) { + return value !== void 0 && value !== expected; +} +function serializeInput(message) { + if (typeof message === "undefined") { + return "undefined"; + } + if (message === null) { + return "null"; + } + if (typeof message === "string") { + return message; + } + if (typeof message === "object") { + return JSON.stringify(message); + } + return message.toString(); +} + +// node_modules/.pnpm/strict-event-emitter@0.5.1/node_modules/strict-event-emitter/lib/index.mjs +var MemoryLeakError = class extends Error { + constructor(emitter, type, count) { + super( + `Possible EventEmitter memory leak detected. ${count} ${type.toString()} listeners added. Use emitter.setMaxListeners() to increase limit` + ); + this.emitter = emitter; + this.type = type; + this.count = count; + this.name = "MaxListenersExceededWarning"; + } +}; +var _Emitter = class { + static listenerCount(emitter, eventName) { + return emitter.listenerCount(eventName); + } + constructor() { + this.events = /* @__PURE__ */ new Map(); + this.maxListeners = _Emitter.defaultMaxListeners; + this.hasWarnedAboutPotentialMemoryLeak = false; + } + _emitInternalEvent(internalEventName, eventName, listener) { + this.emit( + internalEventName, + ...[eventName, listener] + ); + } + _getListeners(eventName) { + return Array.prototype.concat.apply([], this.events.get(eventName)) || []; + } + _removeListener(listeners, listener) { + const index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 1); + } + return []; + } + _wrapOnceListener(eventName, listener) { + const onceListener = (...data) => { + this.removeListener(eventName, onceListener); + return listener.apply(this, data); + }; + Object.defineProperty(onceListener, "name", { value: listener.name }); + return onceListener; + } + setMaxListeners(maxListeners) { + this.maxListeners = maxListeners; + return this; + } + /** + * Returns the current max listener value for the `Emitter` which is + * either set by `emitter.setMaxListeners(n)` or defaults to + * `Emitter.defaultMaxListeners`. + */ + getMaxListeners() { + return this.maxListeners; + } + /** + * Returns an array listing the events for which the emitter has registered listeners. + * The values in the array will be strings or Symbols. + */ + eventNames() { + return Array.from(this.events.keys()); + } + /** + * Synchronously calls each of the listeners registered for the event named `eventName`, + * in the order they were registered, passing the supplied arguments to each. + * Returns `true` if the event has listeners, `false` otherwise. + * + * @example + * const emitter = new Emitter<{ hello: [string] }>() + * emitter.emit('hello', 'John') + */ + emit(eventName, ...data) { + const listeners = this._getListeners(eventName); + listeners.forEach((listener) => { + listener.apply(this, data); + }); + return listeners.length > 0; + } + addListener(eventName, listener) { + this._emitInternalEvent("newListener", eventName, listener); + const nextListeners = this._getListeners(eventName).concat(listener); + this.events.set(eventName, nextListeners); + if (this.maxListeners > 0 && this.listenerCount(eventName) > this.maxListeners && !this.hasWarnedAboutPotentialMemoryLeak) { + this.hasWarnedAboutPotentialMemoryLeak = true; + const memoryLeakWarning = new MemoryLeakError( + this, + eventName, + this.listenerCount(eventName) + ); + console.warn(memoryLeakWarning); + } + return this; + } + on(eventName, listener) { + return this.addListener(eventName, listener); + } + once(eventName, listener) { + return this.addListener( + eventName, + this._wrapOnceListener(eventName, listener) + ); + } + prependListener(eventName, listener) { + const listeners = this._getListeners(eventName); + if (listeners.length > 0) { + const nextListeners = [listener].concat(listeners); + this.events.set(eventName, nextListeners); + } else { + this.events.set(eventName, listeners.concat(listener)); + } + return this; + } + prependOnceListener(eventName, listener) { + return this.prependListener( + eventName, + this._wrapOnceListener(eventName, listener) + ); + } + removeListener(eventName, listener) { + const listeners = this._getListeners(eventName); + if (listeners.length > 0) { + this._removeListener(listeners, listener); + this.events.set(eventName, listeners); + this._emitInternalEvent("removeListener", eventName, listener); + } + return this; + } + /** + * Alias for `emitter.removeListener()`. + * + * @example + * emitter.off('hello', listener) + */ + off(eventName, listener) { + return this.removeListener(eventName, listener); + } + removeAllListeners(eventName) { + if (eventName) { + this.events.delete(eventName); + } else { + this.events.clear(); + } + return this; + } + /** + * Returns a copy of the array of listeners for the event named `eventName`. + */ + listeners(eventName) { + return Array.from(this._getListeners(eventName)); + } + /** + * Returns the number of listeners listening to the event named `eventName`. + */ + listenerCount(eventName) { + return this._getListeners(eventName).length; + } + rawListeners(eventName) { + return this.listeners(eventName); + } +}; +var Emitter = _Emitter; +Emitter.defaultMaxListeners = 10; + // src/Interceptor.ts -import { Logger } from "@open-draft/logger"; -import { Emitter } from "strict-event-emitter"; var INTERNAL_REQUEST_ID_HEADER_NAME = "x-interceptors-internal-request-id"; function getGlobalSymbol(symbol) { return ( @@ -137,9 +733,8 @@ var Interceptor = class { this.readyState = "DISPOSED" /* DISPOSED */; } getInstance() { - var _a; const instance = getGlobalSymbol(this.symbol); - this.logger.info("retrieved global instance:", (_a = instance == null ? void 0 : instance.constructor) == null ? void 0 : _a.name); + this.logger.info("retrieved global instance:", instance?.constructor?.name); return instance; } setInstance() { @@ -152,22 +747,19 @@ var Interceptor = class { } }; -// src/RequestController.ts -import { invariant } from "outvariant"; -import { DeferredPromise } from "@open-draft/deferred-promise"; - // src/InterceptorError.ts -var InterceptorError = class extends Error { +var InterceptorError = class _InterceptorError extends Error { constructor(message) { super(message); this.name = "InterceptorError"; - Object.setPrototypeOf(this, InterceptorError.prototype); + Object.setPrototypeOf(this, _InterceptorError.prototype); } }; // src/RequestController.ts var kRequestHandled = Symbol("kRequestHandled"); var kResponsePromise = Symbol("kResponsePromise"); +kResponsePromise, kRequestHandled; var RequestController = class { constructor(request) { this.request = request; @@ -198,7 +790,7 @@ var RequestController = class { * controller.errorWith() * controller.errorWith(new Error('Oops!')) */ - errorWith(error) { + errorWith(error2) { invariant.as( InterceptorError, !this[kRequestHandled], @@ -207,10 +799,9 @@ var RequestController = class { this.request.url ); this[kRequestHandled] = true; - this[kResponsePromise].resolve(error); + this[kResponsePromise].resolve(error2); } }; -kResponsePromise, kRequestHandled; // src/utils/emitAsync.ts async function emitAsync(emitter, eventName, ...data) { @@ -223,16 +814,24 @@ async function emitAsync(emitter, eventName, ...data) { } } -// src/utils/handleRequest.ts -import { DeferredPromise as DeferredPromise2 } from "@open-draft/deferred-promise"; -import { until } from "@open-draft/until"; +// node_modules/.pnpm/@open-draft+until@2.1.0/node_modules/@open-draft/until/lib/index.mjs +var until = async (promise) => { + try { + const data = await promise().catch((error2) => { + throw error2; + }); + return { error: null, data }; + } catch (error2) { + return { error: error2, data: null }; + } +}; // src/utils/isPropertyAccessible.ts function isPropertyAccessible(obj, key) { try { obj[key]; return true; - } catch (e) { + } catch { return false; } } @@ -245,6 +844,13 @@ var RESPONSE_STATUS_CODES_WITHOUT_BODY = /* @__PURE__ */ new Set([ 205, 304 ]); +var RESPONSE_STATUS_CODES_WITH_REDIRECT = /* @__PURE__ */ new Set([ + 301, + 302, + 303, + 307, + 308 +]); function isResponseWithoutBody(status) { return RESPONSE_STATUS_CODES_WITHOUT_BODY.has(status); } @@ -271,38 +877,38 @@ function isResponseError(response) { } // src/utils/isNodeLikeError.ts -function isNodeLikeError(error) { - if (error == null) { +function isNodeLikeError(error2) { + if (error2 == null) { return false; } - if (!(error instanceof Error)) { + if (!(error2 instanceof Error)) { return false; } - return "code" in error && "errno" in error; + return "code" in error2 && "errno" in error2; } // src/utils/handleRequest.ts async function handleRequest(options) { - const handleResponse = (response) => { + const handleResponse = async (response) => { if (response instanceof Error) { options.onError(response); } else if (isResponseError(response)) { options.onRequestError(response); } else { - options.onResponse(response); + await options.onResponse(response); } return true; }; - const handleResponseError = (error) => { - if (error instanceof InterceptorError) { + const handleResponseError = async (error2) => { + if (error2 instanceof InterceptorError) { throw result.error; } - if (isNodeLikeError(error)) { - options.onError(error); + if (isNodeLikeError(error2)) { + options.onError(error2); return true; } - if (error instanceof Response) { - return handleResponse(error); + if (error2 instanceof Response) { + return await handleResponse(error2); } return false; }; @@ -314,7 +920,7 @@ async function handleRequest(options) { options.controller[kResponsePromise].resolve(void 0); } }); - const requestAbortPromise = new DeferredPromise2(); + const requestAbortPromise = new DeferredPromise(); if (options.request.signal) { options.request.signal.addEventListener( "abort", @@ -344,7 +950,7 @@ async function handleRequest(options) { return true; } if (result.error) { - if (handleResponseError(result.error)) { + if (await handleResponseError(result.error)) { return true; } if (options.emitter.listenerCount("unhandledException") > 0) { @@ -395,17 +1001,175 @@ function createRequestId() { return Math.random().toString(16).slice(2); } +// src/interceptors/fetch/utils/createNetworkError.ts +function createNetworkError(cause) { + return Object.assign(new TypeError("Failed to fetch"), { + cause + }); +} + +// src/interceptors/fetch/utils/followRedirect.ts +var REQUEST_BODY_HEADERS = [ + "content-encoding", + "content-language", + "content-location", + "content-type", + "content-length" +]; +var kRedirectCount = Symbol("kRedirectCount"); +async function followFetchRedirect(request, response) { + if (response.status !== 303 && request.body != null) { + return Promise.reject(createNetworkError()); + } + const requestUrl = new URL(request.url); + let locationUrl; + try { + locationUrl = new URL(response.headers.get("location"), request.url); + } catch (error2) { + return Promise.reject(createNetworkError(error2)); + } + if (!(locationUrl.protocol === "http:" || locationUrl.protocol === "https:")) { + return Promise.reject( + createNetworkError("URL scheme must be a HTTP(S) scheme") + ); + } + if (Reflect.get(request, kRedirectCount) > 20) { + return Promise.reject(createNetworkError("redirect count exceeded")); + } + Object.defineProperty(request, kRedirectCount, { + value: (Reflect.get(request, kRedirectCount) || 0) + 1 + }); + if (request.mode === "cors" && (locationUrl.username || locationUrl.password) && !sameOrigin(requestUrl, locationUrl)) { + return Promise.reject( + createNetworkError('cross origin not allowed for request mode "cors"') + ); + } + const requestInit = {}; + if ([301, 302].includes(response.status) && request.method === "POST" || response.status === 303 && !["HEAD", "GET"].includes(request.method)) { + requestInit.method = "GET"; + requestInit.body = null; + REQUEST_BODY_HEADERS.forEach((headerName) => { + request.headers.delete(headerName); + }); + } + if (!sameOrigin(requestUrl, locationUrl)) { + request.headers.delete("authorization"); + request.headers.delete("proxy-authorization"); + request.headers.delete("cookie"); + request.headers.delete("host"); + } + requestInit.headers = request.headers; + return fetch(new Request(locationUrl, requestInit)); +} +function sameOrigin(left, right) { + if (left.origin === right.origin && left.origin === "null") { + return true; + } + if (left.protocol === right.protocol && left.hostname === right.hostname && left.port === right.port) { + return true; + } + return false; +} + +// src/interceptors/fetch/utils/brotli-decompress.browser.ts +var BrotliDecompressionStream = class extends TransformStream { + constructor() { + console.warn( + "[Interceptors]: Brotli decompression of response streams is not supported in the browser" + ); + super({ + transform(chunk, controller) { + controller.enqueue(chunk); + } + }); + } +}; + +// src/interceptors/fetch/utils/decompression.ts +var PipelineStream = class extends TransformStream { + constructor(transformStreams, ...strategies) { + super({}, ...strategies); + const readable = [super.readable, ...transformStreams].reduce( + (readable2, transform) => readable2.pipeThrough(transform) + ); + Object.defineProperty(this, "readable", { + get() { + return readable; + } + }); + } +}; +function parseContentEncoding(contentEncoding) { + return contentEncoding.toLowerCase().split(",").map((coding) => coding.trim()); +} +function createDecompressionStream(contentEncoding) { + if (contentEncoding === "") { + return null; + } + const codings = parseContentEncoding(contentEncoding); + if (codings.length === 0) { + return null; + } + const transformers = codings.reduceRight( + (transformers2, coding) => { + if (coding === "gzip" || coding === "x-gzip") { + return transformers2.concat(new DecompressionStream("gzip")); + } else if (coding === "deflate") { + return transformers2.concat(new DecompressionStream("deflate")); + } else if (coding === "br") { + return transformers2.concat(new BrotliDecompressionStream()); + } else { + transformers2.length = 0; + } + return transformers2; + }, + [] + ); + return new PipelineStream(transformers); +} +function decompressResponse(response) { + if (response.body === null) { + return null; + } + const decompressionStream = createDecompressionStream( + response.headers.get("content-encoding") || "" + ); + if (!decompressionStream) { + return null; + } + response.body.pipeTo(decompressionStream.writable); + return decompressionStream.readable; +} + +// src/utils/hasConfigurableGlobal.ts +function hasConfigurableGlobal(propertyName) { + const descriptor = Object.getOwnPropertyDescriptor(globalThis, propertyName); + if (typeof descriptor === "undefined") { + return false; + } + if (typeof descriptor.set === "undefined" && !descriptor.configurable) { + console.error( + `[MSW] Failed to apply interceptor: the global \`${propertyName}\` property is non-configurable. This is likely an issue with your environment. If you are using a framework, please open an issue about this in their repository.` + ); + return false; + } + return true; +} + // src/interceptors/fetch/index.ts -var _FetchInterceptor = class extends Interceptor { +var FetchInterceptor = class _FetchInterceptor extends Interceptor { + static { + this.symbol = Symbol("fetch"); + } constructor() { super(_FetchInterceptor.symbol); } checkEnvironment() { - return typeof globalThis !== "undefined" && typeof globalThis.fetch !== "undefined"; + return hasConfigurableGlobal("fetch"); } async setup() { const pureFetch = globalThis.fetch; - invariant2( + invariant( !pureFetch[IS_PATCHED_MODULE], 'Failed to patch the "fetch" module: already patched.' ); @@ -413,7 +1177,7 @@ var _FetchInterceptor = class extends Interceptor { const requestId = createRequestId(); const resolvedInput = typeof input === "string" && typeof location !== "undefined" && !canParseUrl(input) ? new URL(input, location.origin) : input; const request = new Request(resolvedInput, init); - const responsePromise = new DeferredPromise3(); + const responsePromise = new DeferredPromise(); const controller = new RequestController(request); this.logger.info("[%s] %s", request.method, request.url); this.logger.info("awaiting for the mocked response..."); @@ -426,9 +1190,34 @@ var _FetchInterceptor = class extends Interceptor { requestId, emitter: this.emitter, controller, - onResponse: async (response) => { + onResponse: async (rawResponse) => { this.logger.info("received mocked response!", { - response + rawResponse + }); + const decompressedStream = decompressResponse(rawResponse); + const response = decompressedStream === null ? rawResponse : new Response(decompressedStream, rawResponse); + if (RESPONSE_STATUS_CODES_WITH_REDIRECT.has(response.status)) { + if (request.redirect === "error") { + responsePromise.reject(createNetworkError("unexpected redirect")); + return; + } + if (request.redirect === "follow") { + followFetchRedirect(request, response).then( + (response2) => { + responsePromise.resolve(response2); + }, + (reason) => { + responsePromise.reject(reason); + } + ); + return; + } + } + Object.defineProperty(response, "url", { + writable: false, + enumerable: true, + configurable: false, + value: request.url }); if (this.emitter.listenerCount("response") > 0) { this.logger.info('emitting the "response" event...'); @@ -442,21 +1231,15 @@ var _FetchInterceptor = class extends Interceptor { requestId }); } - Object.defineProperty(response, "url", { - writable: false, - enumerable: true, - configurable: false, - value: request.url - }); responsePromise.resolve(response); }, onRequestError: (response) => { this.logger.info("request has errored!", { response }); responsePromise.reject(createNetworkError(response)); }, - onError: (error) => { - this.logger.info("request has been aborted!", { error }); - responsePromise.reject(error); + onError: (error2) => { + this.logger.info("request has been aborted!", { error: error2 }); + responsePromise.reject(error2); } }); if (isRequestHandled) { @@ -466,12 +1249,12 @@ var _FetchInterceptor = class extends Interceptor { this.logger.info( "no mocked response received, performing request as-is..." ); - return pureFetch(request).then((response) => { + return pureFetch(request).then(async (response) => { this.logger.info("original fetch performed", response); if (this.emitter.listenerCount("response") > 0) { this.logger.info('emitting the "response" event...'); const responseClone = response.clone(); - this.emitter.emit("response", { + await emitAsync(this.emitter, "response", { response: responseClone, isMockedResponse: false, request, @@ -498,20 +1281,6 @@ var _FetchInterceptor = class extends Interceptor { }); } }; -var FetchInterceptor = _FetchInterceptor; -FetchInterceptor.symbol = Symbol("fetch"); -function createNetworkError(cause) { - return Object.assign(new TypeError("Failed to fetch"), { - cause - }); -} - -// src/interceptors/XMLHttpRequest/index.ts -import { invariant as invariant4 } from "outvariant"; - -// src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts -import { invariant as invariant3 } from "outvariant"; -import { isNodeProcess } from "is-node-process"; // src/interceptors/XMLHttpRequest/utils/concatArrayBuffer.ts function concatArrayBuffer(left, right) { @@ -524,10 +1293,10 @@ function concatArrayBuffer(left, right) { // src/interceptors/XMLHttpRequest/polyfills/EventPolyfill.ts var EventPolyfill = class { constructor(type, options) { - this.AT_TARGET = 0; - this.BUBBLING_PHASE = 0; - this.CAPTURING_PHASE = 0; this.NONE = 0; + this.CAPTURING_PHASE = 1; + this.AT_TARGET = 2; + this.BUBBLING_PHASE = 3; this.type = ""; this.srcElement = null; this.currentTarget = null; @@ -543,8 +1312,8 @@ var EventPolyfill = class { this.cancelBubble = false; this.returnValue = true; this.type = type; - this.target = (options == null ? void 0 : options.target) || null; - this.currentTarget = (options == null ? void 0 : options.currentTarget) || null; + this.target = options?.target || null; + this.currentTarget = options?.currentTarget || null; this.timeStamp = Date.now(); } composedPath() { @@ -568,10 +1337,10 @@ var EventPolyfill = class { var ProgressEventPolyfill = class extends EventPolyfill { constructor(type, init) { super(type); - this.lengthComputable = (init == null ? void 0 : init.lengthComputable) || false; - this.composed = (init == null ? void 0 : init.composed) || false; - this.loaded = (init == null ? void 0 : init.loaded) || 0; - this.total = (init == null ? void 0 : init.total) || 0; + this.lengthComputable = init?.lengthComputable || false; + this.composed = init?.composed || false; + this.loaded = init?.loaded || 0; + this.total = init?.total || 0; } }; @@ -590,8 +1359,8 @@ function createEvent(target, type, init) { const ProgressEventClass = SUPPORTS_PROGRESS_EVENT ? ProgressEvent : ProgressEventPolyfill; const event = progressEvents.includes(type) ? new ProgressEventClass(type, { lengthComputable: true, - loaded: (init == null ? void 0 : init.loaded) || 0, - total: (init == null ? void 0 : init.total) || 0 + loaded: init?.loaded || 0, + total: init?.total || 0 }) : new EventPolyfill(type, { target, currentTarget: target @@ -649,7 +1418,7 @@ function optionsToProxyHandler(options) { propertySource, propertyName ); - if (typeof (ownDescriptors == null ? void 0 : ownDescriptors.set) !== "undefined") { + if (typeof ownDescriptors?.set !== "undefined") { ownDescriptors.set.apply(target, [nextValue]); return true; } @@ -731,16 +1500,30 @@ function createHeadersFromXMLHttpReqestHeaders(headersString) { return headers; } +// src/interceptors/XMLHttpRequest/utils/getBodyByteLength.ts +async function getBodyByteLength(input) { + const explicitContentLength = input.headers.get("content-length"); + if (explicitContentLength != null && explicitContentLength !== "") { + return Number(explicitContentLength); + } + const buffer = await input.arrayBuffer(); + return buffer.byteLength; +} + // src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts -var IS_MOCKED_RESPONSE = Symbol("isMockedResponse"); -var IS_NODE = isNodeProcess(); +var kIsRequestHandled = Symbol("kIsRequestHandled"); +var IS_NODE2 = isNodeProcess(); +var kFetchRequest = Symbol("kFetchRequest"); +kIsRequestHandled, kFetchRequest; var XMLHttpRequestController = class { constructor(initialRequest, logger) { this.initialRequest = initialRequest; this.logger = logger; this.method = "GET"; this.url = null; + this[kIsRequestHandled] = false; this.events = /* @__PURE__ */ new Map(); + this.uploadEvents = /* @__PURE__ */ new Map(); this.requestId = createRequestId(); this.requestHeaders = new Headers(); this.responseBuffer = new Uint8Array(); @@ -760,7 +1543,6 @@ var XMLHttpRequestController = class { } }, methodCall: ([methodName, args], invoke) => { - var _a; switch (methodName) { case "open": { const [method, url] = args; @@ -789,9 +1571,6 @@ var XMLHttpRequestController = class { } case "send": { const [body] = args; - if (body != null) { - this.requestBody = typeof body === "string" ? encodeBuffer(body) : body; - } this.request.addEventListener("load", () => { if (typeof this.onResponse !== "undefined") { const fetchResponse = createResponse( @@ -805,24 +1584,26 @@ var XMLHttpRequestController = class { ); this.onResponse.call(this, { response: fetchResponse, - isMockedResponse: IS_MOCKED_RESPONSE in this.request, + isMockedResponse: this[kIsRequestHandled], request: fetchRequest, requestId: this.requestId }); } }); - const fetchRequest = this.toFetchApiRequest(); - const onceRequestSettled = ((_a = this.onRequest) == null ? void 0 : _a.call(this, { + const requestBody = typeof body === "string" ? encodeBuffer(body) : body; + const fetchRequest = this.toFetchApiRequest(requestBody); + this[kFetchRequest] = fetchRequest.clone(); + const onceRequestSettled = this.onRequest?.call(this, { request: fetchRequest, requestId: this.requestId - })) || Promise.resolve(); + }) || Promise.resolve(); onceRequestSettled.finally(() => { - if (this.request.readyState < this.request.LOADING) { + if (!this[kIsRequestHandled]) { this.logger.info( "request callback settled but request has not been handled (readystate %d), performing as-is...", this.request.readyState ); - if (IS_NODE) { + if (IS_NODE2) { this.request.setRequestHeader( INTERNAL_REQUEST_ID_HEADER_NAME, this.requestId @@ -839,6 +1620,39 @@ var XMLHttpRequestController = class { } } }); + define( + this.request, + "upload", + createProxy(this.request.upload, { + setProperty: ([propertyName, nextValue], invoke) => { + switch (propertyName) { + case "onloadstart": + case "onprogress": + case "onaboart": + case "onerror": + case "onload": + case "ontimeout": + case "onloadend": { + const eventName = propertyName.slice( + 2 + ); + this.registerUploadEvent(eventName, nextValue); + } + } + return invoke(); + }, + methodCall: ([methodName, args], invoke) => { + switch (methodName) { + case "addEventListener": { + const [eventName, listener] = args; + this.registerUploadEvent(eventName, listener); + this.logger.info("upload.addEventListener", eventName, listener); + return invoke(); + } + } + } + }) + ); } registerEvent(eventName, listener) { const prevEvents = this.events.get(eventName) || []; @@ -846,17 +1660,44 @@ var XMLHttpRequestController = class { this.events.set(eventName, nextEvents); this.logger.info('registered event "%s"', eventName, listener); } + registerUploadEvent(eventName, listener) { + const prevEvents = this.uploadEvents.get(eventName) || []; + const nextEvents = prevEvents.concat(listener); + this.uploadEvents.set(eventName, nextEvents); + this.logger.info('registered upload event "%s"', eventName, listener); + } /** * Responds to the current request with the given * Fetch API `Response` instance. */ - respondWith(response) { + async respondWith(response) { + this[kIsRequestHandled] = true; + if (this[kFetchRequest]) { + const totalRequestBodyLength = await getBodyByteLength( + this[kFetchRequest] + ); + this.trigger("loadstart", this.request.upload, { + loaded: 0, + total: totalRequestBodyLength + }); + this.trigger("progress", this.request.upload, { + loaded: totalRequestBodyLength, + total: totalRequestBodyLength + }); + this.trigger("load", this.request.upload, { + loaded: totalRequestBodyLength, + total: totalRequestBodyLength + }); + this.trigger("loadend", this.request.upload, { + loaded: totalRequestBodyLength, + total: totalRequestBodyLength + }); + } this.logger.info( "responding with a mocked response: %d %s", response.status, response.statusText ); - define(this.request, IS_MOCKED_RESPONSE, true); define(this.request, "status", response.status); define(this.request, "statusText", response.statusText); define(this.request, "responseURL", this.url.href); @@ -911,14 +1752,9 @@ var XMLHttpRequestController = class { get: () => this.responseXML } }); - const totalResponseBodyLength = response.headers.has("Content-Length") ? Number(response.headers.get("Content-Length")) : ( - /** - * @todo Infer the response body length from the response body. - */ - void 0 - ); + const totalResponseBodyLength = await getBodyByteLength(response.clone()); this.logger.info("calculated response body length", totalResponseBodyLength); - this.trigger("loadstart", { + this.trigger("loadstart", this.request, { loaded: 0, total: totalResponseBodyLength }); @@ -927,11 +1763,11 @@ var XMLHttpRequestController = class { const finalizeResponse = () => { this.logger.info("finalizing the mocked response..."); this.setReadyState(this.request.DONE); - this.trigger("load", { + this.trigger("load", this.request, { loaded: this.responseBuffer.byteLength, total: totalResponseBodyLength }); - this.trigger("loadend", { + this.trigger("loadend", this.request, { loaded: this.responseBuffer.byteLength, total: totalResponseBodyLength }); @@ -949,7 +1785,7 @@ var XMLHttpRequestController = class { if (value) { this.logger.info("read response body chunk:", value); this.responseBuffer = concatArrayBuffer(this.responseBuffer, value); - this.trigger("progress", { + this.trigger("progress", this.request, { loaded: this.responseBuffer.byteLength, total: totalResponseBodyLength }); @@ -1007,7 +1843,7 @@ var XMLHttpRequestController = class { } } get responseText() { - invariant3( + invariant( this.request.responseType === "" || this.request.responseType === "text", "InvalidStateError: The object is in invalid state." ); @@ -1019,7 +1855,7 @@ var XMLHttpRequestController = class { return responseText; } get responseXML() { - invariant3( + invariant( this.request.responseType === "" || this.request.responseType === "document", "InvalidStateError: The object is in invalid state." ); @@ -1041,11 +1877,12 @@ var XMLHttpRequestController = class { } return null; } - errorWith(error) { + errorWith(error2) { + this[kIsRequestHandled] = true; this.logger.info("responding with an error"); this.setReadyState(this.request.DONE); - this.trigger("error"); - this.trigger("loadend"); + this.trigger("error", this.request); + this.trigger("loadend", this.request); } /** * Transitions this request's `readyState` to the given one. @@ -1064,36 +1901,38 @@ var XMLHttpRequestController = class { this.logger.info("set readyState to: %d", nextReadyState); if (nextReadyState !== this.request.UNSENT) { this.logger.info('triggerring "readystatechange" event...'); - this.trigger("readystatechange"); + this.trigger("readystatechange", this.request); } } /** * Triggers given event on the `XMLHttpRequest` instance. */ - trigger(eventName, options) { - const callback = this.request[`on${eventName}`]; - const event = createEvent(this.request, eventName, options); + trigger(eventName, target, options) { + const callback = target[`on${eventName}`]; + const event = createEvent(target, eventName, options); this.logger.info('trigger "%s"', eventName, options || ""); if (typeof callback === "function") { this.logger.info('found a direct "%s" callback, calling...', eventName); - callback.call(this.request, event); + callback.call(target, event); } - for (const [registeredEventName, listeners] of this.events) { + const events = target instanceof XMLHttpRequestUpload ? this.uploadEvents : this.events; + for (const [registeredEventName, listeners] of events) { if (registeredEventName === eventName) { this.logger.info( 'found %d listener(s) for "%s" event, calling...', listeners.length, eventName ); - listeners.forEach((listener) => listener.call(this.request, event)); + listeners.forEach((listener) => listener.call(target, event)); } } } /** * Converts this `XMLHttpRequest` instance into a Fetch API `Request` instance. */ - toFetchApiRequest() { + toFetchApiRequest(body) { this.logger.info("converting request to a Fetch API Request..."); + const resolvedBody = body instanceof Document ? body.documentElement.innerText : body; const fetchRequest = new Request(this.url.href, { method: this.method, headers: this.requestHeaders, @@ -1101,7 +1940,7 @@ var XMLHttpRequestController = class { * @see https://xhr.spec.whatwg.org/#cross-origin-credentials */ credentials: this.request.withCredentials ? "include" : "same-origin", - body: ["GET", "HEAD"].includes(this.method) ? null : this.requestBody + body: ["GET", "HEAD"].includes(this.method.toUpperCase()) ? null : resolvedBody }); const proxyHeaders = createProxy(fetchRequest.headers, { methodCall: ([methodName, args], invoke) => { @@ -1182,16 +2021,16 @@ function createXMLHttpRequestProxy({ requestId, controller, emitter, - onResponse: (response) => { - this.respondWith(response); + onResponse: async (response) => { + await this.respondWith(response); }, onRequestError: () => { this.errorWith(new TypeError("Network error")); }, - onError: (error) => { - this.logger.info("request errored!", { error }); - if (error instanceof Error) { - this.errorWith(error); + onError: (error2) => { + this.logger.info("request errored!", { error: error2 }); + if (error2 instanceof Error) { + this.errorWith(error2); } } }); @@ -1225,18 +2064,21 @@ function createXMLHttpRequestProxy({ } // src/interceptors/XMLHttpRequest/index.ts -var _XMLHttpRequestInterceptor = class extends Interceptor { +var XMLHttpRequestInterceptor = class _XMLHttpRequestInterceptor extends Interceptor { + static { + this.interceptorSymbol = Symbol("xhr"); + } constructor() { super(_XMLHttpRequestInterceptor.interceptorSymbol); } checkEnvironment() { - return typeof globalThis.XMLHttpRequest !== "undefined"; + return hasConfigurableGlobal("XMLHttpRequest"); } setup() { const logger = this.logger.extend("setup"); logger.info('patching "XMLHttpRequest" module...'); const PureXMLHttpRequest = globalThis.XMLHttpRequest; - invariant4( + invariant( !PureXMLHttpRequest[IS_PATCHED_MODULE], 'Failed to patch the "XMLHttpRequest" module: already patched.' ); @@ -1265,8 +2107,6 @@ var _XMLHttpRequestInterceptor = class extends Interceptor { }); } }; -var XMLHttpRequestInterceptor = _XMLHttpRequestInterceptor; -XMLHttpRequestInterceptor.interceptorSymbol = Symbol("xhr"); // src/presets/browser.ts var browser_default = [ diff --git a/vendor/javascripts/@mswjs--interceptors.js b/vendor/javascripts/@mswjs--interceptors.js index 0d29cf7..28d490b 100644 --- a/vendor/javascripts/@mswjs--interceptors.js +++ b/vendor/javascripts/@mswjs--interceptors.js @@ -1,9 +1,543 @@ // src/glossary.ts var IS_PATCHED_MODULE = Symbol("isPatchedModule"); +// node_modules/.pnpm/is-node-process@1.2.0/node_modules/is-node-process/lib/index.mjs +function isNodeProcess() { + if (typeof navigator !== "undefined" && navigator.product === "ReactNative") { + return true; + } + if (typeof process !== "undefined") { + const type = process.type; + if (type === "renderer" || type === "worker") { + return false; + } + return !!(process.versions && process.versions.node); + } + return false; +} + +// node_modules/.pnpm/outvariant@1.4.3/node_modules/outvariant/lib/index.mjs +var POSITIONALS_EXP = /(%?)(%([sdijo]))/g; +function serializePositional(positional, flag) { + switch (flag) { + case "s": + return positional; + case "d": + case "i": + return Number(positional); + case "j": + return JSON.stringify(positional); + case "o": { + if (typeof positional === "string") { + return positional; + } + const json = JSON.stringify(positional); + if (json === "{}" || json === "[]" || /^\[object .+?\]$/.test(json)) { + return positional; + } + return json; + } + } +} +function format(message, ...positionals) { + if (positionals.length === 0) { + return message; + } + let positionalIndex = 0; + let formattedMessage = message.replace( + POSITIONALS_EXP, + (match, isEscaped, _, flag) => { + const positional = positionals[positionalIndex]; + const value = serializePositional(positional, flag); + if (!isEscaped) { + positionalIndex++; + return value; + } + return match; + } + ); + if (positionalIndex < positionals.length) { + formattedMessage += ` ${positionals.slice(positionalIndex).join(" ")}`; + } + formattedMessage = formattedMessage.replace(/%{2,2}/g, "%"); + return formattedMessage; +} +var STACK_FRAMES_TO_IGNORE = 2; +function cleanErrorStack(error2) { + if (!error2.stack) { + return; + } + const nextStack = error2.stack.split("\n"); + nextStack.splice(1, STACK_FRAMES_TO_IGNORE); + error2.stack = nextStack.join("\n"); +} +var InvariantError = class extends Error { + constructor(message, ...positionals) { + super(message); + this.message = message; + this.name = "Invariant Violation"; + this.message = format(message, ...positionals); + cleanErrorStack(this); + } +}; +var invariant = (predicate, message, ...positionals) => { + if (!predicate) { + throw new InvariantError(message, ...positionals); + } +}; +invariant.as = (ErrorConstructor, predicate, message, ...positionals) => { + if (!predicate) { + const formatMessage = positionals.length === 0 ? message : format(message, ...positionals); + let error2; + try { + error2 = Reflect.construct(ErrorConstructor, [ + formatMessage + ]); + } catch (err) { + error2 = ErrorConstructor(formatMessage); + } + throw error2; + } +}; + +// node_modules/.pnpm/@open-draft+logger@0.3.0/node_modules/@open-draft/logger/lib/index.mjs +var __defProp = Object.defineProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var colors_exports = {}; +__export(colors_exports, { + blue: () => blue, + gray: () => gray, + green: () => green, + red: () => red, + yellow: () => yellow +}); +function yellow(text) { + return `\x1B[33m${text}\x1B[0m`; +} +function blue(text) { + return `\x1B[34m${text}\x1B[0m`; +} +function gray(text) { + return `\x1B[90m${text}\x1B[0m`; +} +function red(text) { + return `\x1B[31m${text}\x1B[0m`; +} +function green(text) { + return `\x1B[32m${text}\x1B[0m`; +} +var IS_NODE = isNodeProcess(); +var Logger = class { + constructor(name) { + this.name = name; + this.prefix = `[${this.name}]`; + const LOGGER_NAME = getVariable("DEBUG"); + const LOGGER_LEVEL = getVariable("LOG_LEVEL"); + const isLoggingEnabled = LOGGER_NAME === "1" || LOGGER_NAME === "true" || typeof LOGGER_NAME !== "undefined" && this.name.startsWith(LOGGER_NAME); + if (isLoggingEnabled) { + this.debug = isDefinedAndNotEquals(LOGGER_LEVEL, "debug") ? noop : this.debug; + this.info = isDefinedAndNotEquals(LOGGER_LEVEL, "info") ? noop : this.info; + this.success = isDefinedAndNotEquals(LOGGER_LEVEL, "success") ? noop : this.success; + this.warning = isDefinedAndNotEquals(LOGGER_LEVEL, "warning") ? noop : this.warning; + this.error = isDefinedAndNotEquals(LOGGER_LEVEL, "error") ? noop : this.error; + } else { + this.info = noop; + this.success = noop; + this.warning = noop; + this.error = noop; + this.only = noop; + } + } + prefix; + extend(domain) { + return new Logger(`${this.name}:${domain}`); + } + /** + * Print a debug message. + * @example + * logger.debug('no duplicates found, creating a document...') + */ + debug(message, ...positionals) { + this.logEntry({ + level: "debug", + message: gray(message), + positionals, + prefix: this.prefix, + colors: { + prefix: "gray" + } + }); + } + /** + * Print an info message. + * @example + * logger.info('start parsing...') + */ + info(message, ...positionals) { + this.logEntry({ + level: "info", + message, + positionals, + prefix: this.prefix, + colors: { + prefix: "blue" + } + }); + const performance2 = new PerformanceEntry(); + return (message2, ...positionals2) => { + performance2.measure(); + this.logEntry({ + level: "info", + message: `${message2} ${gray(`${performance2.deltaTime}ms`)}`, + positionals: positionals2, + prefix: this.prefix, + colors: { + prefix: "blue" + } + }); + }; + } + /** + * Print a success message. + * @example + * logger.success('successfully created document') + */ + success(message, ...positionals) { + this.logEntry({ + level: "info", + message, + positionals, + prefix: `\u2714 ${this.prefix}`, + colors: { + timestamp: "green", + prefix: "green" + } + }); + } + /** + * Print a warning. + * @example + * logger.warning('found legacy document format') + */ + warning(message, ...positionals) { + this.logEntry({ + level: "warning", + message, + positionals, + prefix: `\u26A0 ${this.prefix}`, + colors: { + timestamp: "yellow", + prefix: "yellow" + } + }); + } + /** + * Print an error message. + * @example + * logger.error('something went wrong') + */ + error(message, ...positionals) { + this.logEntry({ + level: "error", + message, + positionals, + prefix: `\u2716 ${this.prefix}`, + colors: { + timestamp: "red", + prefix: "red" + } + }); + } + /** + * Execute the given callback only when the logging is enabled. + * This is skipped in its entirety and has no runtime cost otherwise. + * This executes regardless of the log level. + * @example + * logger.only(() => { + * logger.info('additional info') + * }) + */ + only(callback) { + callback(); + } + createEntry(level, message) { + return { + timestamp: /* @__PURE__ */ new Date(), + level, + message + }; + } + logEntry(args) { + const { + level, + message, + prefix, + colors: customColors, + positionals = [] + } = args; + const entry = this.createEntry(level, message); + const timestampColor = customColors?.timestamp || "gray"; + const prefixColor = customColors?.prefix || "gray"; + const colorize = { + timestamp: colors_exports[timestampColor], + prefix: colors_exports[prefixColor] + }; + const write = this.getWriter(level); + write( + [colorize.timestamp(this.formatTimestamp(entry.timestamp))].concat(prefix != null ? colorize.prefix(prefix) : []).concat(serializeInput(message)).join(" "), + ...positionals.map(serializeInput) + ); + } + formatTimestamp(timestamp) { + return `${timestamp.toLocaleTimeString( + "en-GB" + )}:${timestamp.getMilliseconds()}`; + } + getWriter(level) { + switch (level) { + case "debug": + case "success": + case "info": { + return log; + } + case "warning": { + return warn; + } + case "error": { + return error; + } + } + } +}; +var PerformanceEntry = class { + startTime; + endTime; + deltaTime; + constructor() { + this.startTime = performance.now(); + } + measure() { + this.endTime = performance.now(); + const deltaTime = this.endTime - this.startTime; + this.deltaTime = deltaTime.toFixed(2); + } +}; +var noop = () => void 0; +function log(message, ...positionals) { + if (IS_NODE) { + process.stdout.write(format(message, ...positionals) + "\n"); + return; + } + console.log(message, ...positionals); +} +function warn(message, ...positionals) { + if (IS_NODE) { + process.stderr.write(format(message, ...positionals) + "\n"); + return; + } + console.warn(message, ...positionals); +} +function error(message, ...positionals) { + if (IS_NODE) { + process.stderr.write(format(message, ...positionals) + "\n"); + return; + } + console.error(message, ...positionals); +} +function getVariable(variableName) { + if (IS_NODE) { + return process.env[variableName]; + } + return globalThis[variableName]?.toString(); +} +function isDefinedAndNotEquals(value, expected) { + return value !== void 0 && value !== expected; +} +function serializeInput(message) { + if (typeof message === "undefined") { + return "undefined"; + } + if (message === null) { + return "null"; + } + if (typeof message === "string") { + return message; + } + if (typeof message === "object") { + return JSON.stringify(message); + } + return message.toString(); +} + +// node_modules/.pnpm/strict-event-emitter@0.5.1/node_modules/strict-event-emitter/lib/index.mjs +var MemoryLeakError = class extends Error { + constructor(emitter, type, count) { + super( + `Possible EventEmitter memory leak detected. ${count} ${type.toString()} listeners added. Use emitter.setMaxListeners() to increase limit` + ); + this.emitter = emitter; + this.type = type; + this.count = count; + this.name = "MaxListenersExceededWarning"; + } +}; +var _Emitter = class { + static listenerCount(emitter, eventName) { + return emitter.listenerCount(eventName); + } + constructor() { + this.events = /* @__PURE__ */ new Map(); + this.maxListeners = _Emitter.defaultMaxListeners; + this.hasWarnedAboutPotentialMemoryLeak = false; + } + _emitInternalEvent(internalEventName, eventName, listener) { + this.emit( + internalEventName, + ...[eventName, listener] + ); + } + _getListeners(eventName) { + return Array.prototype.concat.apply([], this.events.get(eventName)) || []; + } + _removeListener(listeners, listener) { + const index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 1); + } + return []; + } + _wrapOnceListener(eventName, listener) { + const onceListener = (...data) => { + this.removeListener(eventName, onceListener); + return listener.apply(this, data); + }; + Object.defineProperty(onceListener, "name", { value: listener.name }); + return onceListener; + } + setMaxListeners(maxListeners) { + this.maxListeners = maxListeners; + return this; + } + /** + * Returns the current max listener value for the `Emitter` which is + * either set by `emitter.setMaxListeners(n)` or defaults to + * `Emitter.defaultMaxListeners`. + */ + getMaxListeners() { + return this.maxListeners; + } + /** + * Returns an array listing the events for which the emitter has registered listeners. + * The values in the array will be strings or Symbols. + */ + eventNames() { + return Array.from(this.events.keys()); + } + /** + * Synchronously calls each of the listeners registered for the event named `eventName`, + * in the order they were registered, passing the supplied arguments to each. + * Returns `true` if the event has listeners, `false` otherwise. + * + * @example + * const emitter = new Emitter<{ hello: [string] }>() + * emitter.emit('hello', 'John') + */ + emit(eventName, ...data) { + const listeners = this._getListeners(eventName); + listeners.forEach((listener) => { + listener.apply(this, data); + }); + return listeners.length > 0; + } + addListener(eventName, listener) { + this._emitInternalEvent("newListener", eventName, listener); + const nextListeners = this._getListeners(eventName).concat(listener); + this.events.set(eventName, nextListeners); + if (this.maxListeners > 0 && this.listenerCount(eventName) > this.maxListeners && !this.hasWarnedAboutPotentialMemoryLeak) { + this.hasWarnedAboutPotentialMemoryLeak = true; + const memoryLeakWarning = new MemoryLeakError( + this, + eventName, + this.listenerCount(eventName) + ); + console.warn(memoryLeakWarning); + } + return this; + } + on(eventName, listener) { + return this.addListener(eventName, listener); + } + once(eventName, listener) { + return this.addListener( + eventName, + this._wrapOnceListener(eventName, listener) + ); + } + prependListener(eventName, listener) { + const listeners = this._getListeners(eventName); + if (listeners.length > 0) { + const nextListeners = [listener].concat(listeners); + this.events.set(eventName, nextListeners); + } else { + this.events.set(eventName, listeners.concat(listener)); + } + return this; + } + prependOnceListener(eventName, listener) { + return this.prependListener( + eventName, + this._wrapOnceListener(eventName, listener) + ); + } + removeListener(eventName, listener) { + const listeners = this._getListeners(eventName); + if (listeners.length > 0) { + this._removeListener(listeners, listener); + this.events.set(eventName, listeners); + this._emitInternalEvent("removeListener", eventName, listener); + } + return this; + } + /** + * Alias for `emitter.removeListener()`. + * + * @example + * emitter.off('hello', listener) + */ + off(eventName, listener) { + return this.removeListener(eventName, listener); + } + removeAllListeners(eventName) { + if (eventName) { + this.events.delete(eventName); + } else { + this.events.clear(); + } + return this; + } + /** + * Returns a copy of the array of listeners for the event named `eventName`. + */ + listeners(eventName) { + return Array.from(this._getListeners(eventName)); + } + /** + * Returns the number of listeners listening to the event named `eventName`. + */ + listenerCount(eventName) { + return this._getListeners(eventName).length; + } + rawListeners(eventName) { + return this.listeners(eventName); + } +}; +var Emitter = _Emitter; +Emitter.defaultMaxListeners = 10; + // src/Interceptor.ts -import { Logger } from "@open-draft/logger"; -import { Emitter } from "strict-event-emitter"; var INTERNAL_REQUEST_ID_HEADER_NAME = "x-interceptors-internal-request-id"; function getGlobalSymbol(symbol) { return ( @@ -141,9 +675,8 @@ var Interceptor = class { this.readyState = "DISPOSED" /* DISPOSED */; } getInstance() { - var _a; const instance = getGlobalSymbol(this.symbol); - this.logger.info("retrieved global instance:", (_a = instance == null ? void 0 : instance.constructor) == null ? void 0 : _a.name); + this.logger.info("retrieved global instance:", instance?.constructor?.name); return instance; } setInstance() { @@ -157,10 +690,10 @@ var Interceptor = class { }; // src/BatchInterceptor.ts -var BatchInterceptor = class extends Interceptor { +var BatchInterceptor = class _BatchInterceptor extends Interceptor { constructor(options) { - BatchInterceptor.symbol = Symbol(options.name); - super(BatchInterceptor.symbol); + _BatchInterceptor.symbol = Symbol(options.name); + super(_BatchInterceptor.symbol); this.interceptors = options.interceptors; } setup() { diff --git a/vendor/javascripts/@open-draft--deferred-promise.js b/vendor/javascripts/@open-draft--deferred-promise.js deleted file mode 100644 index f26c8b6..0000000 --- a/vendor/javascripts/@open-draft--deferred-promise.js +++ /dev/null @@ -1,2 +0,0 @@ -function createDeferredExecutor(){const executor=(e,t)=>{executor.state="pending";executor.resolve=t=>{if("pending"!==executor.state)return;executor.result=t;const onFulfilled=e=>{executor.state="fulfilled";return e};return e(t instanceof Promise?t:Promise.resolve(t).then(onFulfilled))};executor.reject=e=>{if("pending"===executor.state){queueMicrotask((()=>{executor.state="rejected"}));return t(executor.rejectionReason=e)}}};return executor}var e=class extends Promise{#e;resolve;reject;constructor(e=null){const t=createDeferredExecutor();super(((r,s)=>{t(r,s);e?.(t.resolve,t.reject)}));this.#e=t;this.resolve=this.#e.resolve;this.reject=this.#e.reject}get state(){return this.#e.state}get rejectionReason(){return this.#e.rejectionReason}then(e,t){return this.#t(super.then(e,t))}catch(e){return this.#t(super.catch(e))}finally(e){return this.#t(super.finally(e))}#t(e){return Object.defineProperties(e,{resolve:{configurable:true,value:this.resolve},reject:{configurable:true,value:this.reject}})}};export{e as DeferredPromise,createDeferredExecutor}; - diff --git a/vendor/javascripts/@open-draft--logger.js b/vendor/javascripts/@open-draft--logger.js deleted file mode 100644 index 9a5e3ab..0000000 --- a/vendor/javascripts/@open-draft--logger.js +++ /dev/null @@ -1,2 +0,0 @@ -import{isNodeProcess as e}from"is-node-process";import{format as r}from"outvariant";var t=Object.defineProperty;var __export=(e,r)=>{for(var i in r)t(e,i,{get:r[i],enumerable:true})};var i={};__export(i,{blue:()=>blue,gray:()=>gray,green:()=>green,red:()=>red,yellow:()=>yellow});function yellow(e){return`${e}`}function blue(e){return`${e}`}function gray(e){return`${e}`}function red(e){return`${e}`}function green(e){return`${e}`}var s=e();var n=class{constructor(e){this.name=e;this.prefix=`[${this.name}]`;const r=getVariable("DEBUG");const t=getVariable("LOG_LEVEL");const i="1"===r||"true"===r||"undefined"!==typeof r&&this.name.startsWith(r);if(i){this.debug=isDefinedAndNotEquals(t,"debug")?noop:this.debug;this.info=isDefinedAndNotEquals(t,"info")?noop:this.info;this.success=isDefinedAndNotEquals(t,"success")?noop:this.success;this.warning=isDefinedAndNotEquals(t,"warning")?noop:this.warning;this.error=isDefinedAndNotEquals(t,"error")?noop:this.error}else{this.info=noop;this.success=noop;this.warning=noop;this.error=noop;this.only=noop}}prefix;extend(e){return new n(`${this.name}:${e}`)}debug(e,...r){this.logEntry({level:"debug",message:gray(e),positionals:r,prefix:this.prefix,colors:{prefix:"gray"}})}info(e,...r){this.logEntry({level:"info",message:e,positionals:r,prefix:this.prefix,colors:{prefix:"blue"}});const t=new o;return(e,...r)=>{t.measure();this.logEntry({level:"info",message:`${e} ${gray(`${t.deltaTime}ms`)}`,positionals:r,prefix:this.prefix,colors:{prefix:"blue"}})}}success(e,...r){this.logEntry({level:"info",message:e,positionals:r,prefix:`✔ ${this.prefix}`,colors:{timestamp:"green",prefix:"green"}})}warning(e,...r){this.logEntry({level:"warning",message:e,positionals:r,prefix:`⚠ ${this.prefix}`,colors:{timestamp:"yellow",prefix:"yellow"}})}error(e,...r){this.logEntry({level:"error",message:e,positionals:r,prefix:`✖ ${this.prefix}`,colors:{timestamp:"red",prefix:"red"}})}only(e){e()}createEntry(e,r){return{timestamp:new Date,level:e,message:r}}logEntry(e){const{level:r,message:t,prefix:s,colors:n,positionals:o=[]}=e;const a=this.createEntry(r,t);const l=n?.timestamp||"gray";const c=n?.prefix||"gray";const f={timestamp:i[l],prefix:i[c]};const u=this.getWriter(r);u([f.timestamp(this.formatTimestamp(a.timestamp))].concat(null!=s?f.prefix(s):[]).concat(serializeInput(t)).join(" "),...o.map(serializeInput))}formatTimestamp(e){return`${e.toLocaleTimeString("en-GB")}:${e.getMilliseconds()}`}getWriter(e){switch(e){case"debug":case"success":case"info":return log;case"warning":return warn;case"error":return error}}};var o=class{startTime;endTime;deltaTime;constructor(){this.startTime=performance.now()}measure(){this.endTime=performance.now();const e=this.endTime-this.startTime;this.deltaTime=e.toFixed(2)}};var noop=()=>{};function log(e,...t){s?process.stdout.write(r(e,...t)+"\n"):console.log(e,...t)}function warn(e,...t){s?process.stderr.write(r(e,...t)+"\n"):console.warn(e,...t)}function error(e,...t){s?process.stderr.write(r(e,...t)+"\n"):console.error(e,...t)}function getVariable(e){return s?process.env[e]:globalThis[e]?.toString()}function isDefinedAndNotEquals(e,r){return void 0!==e&&e!==r}function serializeInput(e){return"undefined"===typeof e?"undefined":null===e?"null":"string"===typeof e?e:"object"===typeof e?JSON.stringify(e):e.toString()}export{n as Logger}; - diff --git a/vendor/javascripts/@open-draft--until.js b/vendor/javascripts/@open-draft--until.js deleted file mode 100644 index 4d371f9..0000000 --- a/vendor/javascripts/@open-draft--until.js +++ /dev/null @@ -1,2 +0,0 @@ -var until=async r=>{try{const t=await r().catch((r=>{throw r}));return{error:null,data:t}}catch(r){return{error:r,data:null}}};export{until}; - diff --git a/vendor/javascripts/chai.js b/vendor/javascripts/chai.js index e1791e6..dc7c572 100644 --- a/vendor/javascripts/chai.js +++ b/vendor/javascripts/chai.js @@ -1,10 +1,10 @@ /** * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. - * Original file: /npm/chai@5.1.1/chai.js + * Original file: /npm/chai@5.1.2/chai.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ -var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t=[],n=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o=!1;function i(){o=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)t[r]=e[r],n[e.charCodeAt(r)]=r;n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}function s(e,n,r){for(var o,i,s=[],a=n;a>18&63]+t[i>>12&63]+t[i>>6&63]+t[63&i]);return s.join("")}function a(e){var n;o||i();for(var r=e.length,a=r%3,c="",u=[],h=16383,f=0,l=r-a;fl?l:f+h));return 1===a?(n=e[r-1],c+=t[n>>2],c+=t[n<<4&63],c+="=="):2===a&&(n=(e[r-2]<<8)+e[r-1],c+=t[n>>10],c+=t[n>>4&63],c+=t[n<<2&63],c+="="),u.push(c),u.join("")}function c(e,t,n,r,o){var i,s,a=8*o-r-1,c=(1<>1,h=-7,f=n?o-1:0,l=n?-1:1,p=e[t+f];for(f+=l,i=p&(1<<-h)-1,p>>=-h,h+=a;h>0;i=256*i+e[t+f],f+=l,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=r;h>0;s=256*s+e[t+f],f+=l,h-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),i-=u}return(p?-1:1)*s*Math.pow(2,i-r)}function u(e,t,n,r,o,i){var s,a,c,u=8*i-o-1,h=(1<>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+f>=1?l/c:l*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(t*c-1)*Math.pow(2,o),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[n+p]=255&a,p+=d,a/=256,o-=8);for(s=s<0;e[n+p]=255&s,p+=d,s/=256,u-=8);e[n+p-d]|=128*g}var h={}.toString,f=Array.isArray||function(e){return"[object Array]"==h.call(e)};function l(){return d.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function p(e,t){if(l()=l())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l().toString(16)+" bytes");return 0|e}function v(e){return!(null==e||!e._isBuffer)}function x(e,t){if(v(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function O(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return _(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return B(this,t,n);case"base64":return D(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function E(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function P(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=d.from(t,r)),v(t))return 0===t.length?-1:S(e,t,n,r,o);if("number"==typeof t)return t&=255,d.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):S(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function S(e,t,n,r,o){var i,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var h=-1;for(i=n;ia&&(n=a-c),i=n;i>=0;i--){for(var f=!0,l=0;lo&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function D(e,t,n){return 0===t&&n===e.length?a(e):a(e.slice(t,n))}function _(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:u>223?3:u>191?2:1;if(o+f<=n)switch(f){case 1:u<128&&(h=u);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&u)<<6|63&i)>127&&(h=c);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(c=(15&u)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(h=c)}null===h?(h=65533,f=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),o+=f}return function(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},d.prototype.compare=function(e,t,n,r,o){if(!v(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(i,s),c=this.slice(r,o),u=e.slice(t,n),h=0;ho)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return A(this,e,t,n);case"utf8":case"utf-8":return M(this,e,t,n);case"ascii":return j(this,e,t,n);case"latin1":case"binary":return N(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function q(e,t,n,r,o,i){if(!v(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function U(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function F(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Y(e,t,n,r,o){return o||F(e,0,n,4),u(e,t,n,r,23,4),n+4}function V(e,t,n,r,o){return o||F(e,0,n,8),u(e,t,n,r,52,8),n+8}d.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},d.prototype.readUInt8=function(e,t){return t||$(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return t||$(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return t||$(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return t||$(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUInt32BE=function(e,t){return t||$(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||$(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},d.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||$(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},d.prototype.readInt8=function(e,t){return t||$(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){t||$(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},d.prototype.readInt16BE=function(e,t){t||$(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},d.prototype.readInt32LE=function(e,t){return t||$(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return t||$(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return t||$(e,4,this.length),c(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return t||$(e,4,this.length),c(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return t||$(e,8,this.length),c(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return t||$(e,8,this.length),c(this,e,!1,52,8)},d.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||q(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},d.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,1,255,0),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},d.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},d.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},d.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):U(this,e,t,!0),t+4},d.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},d.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);q(this,e,t,n,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i>0)-a&255;return t+n},d.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);q(this,e,t,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},d.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,1,127,-128),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},d.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},d.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},d.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,4,2147483647,-2147483648),d.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):U(this,e,t,!0),t+4},d.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},d.prototype.writeFloatLE=function(e,t,n){return Y(this,e,t,!0,n)},d.prototype.writeFloatBE=function(e,t,n){return Y(this,e,t,!1,n)},d.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},d.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},d.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!d.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function W(e){return function(e){var t,s,a,c,u,h;o||i();var f=e.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");u="="===e[f-2]?2:"="===e[f-1]?1:0,h=new r(3*f/4-u),a=u>0?f-4:f;var l=0;for(t=0,s=0;t>16&255,h[l++]=c>>8&255,h[l++]=255&c;return 2===u?(c=n[e.charCodeAt(t)]<<2|n[e.charCodeAt(t+1)]>>4,h[l++]=255&c):1===u&&(c=n[e.charCodeAt(t)]<<10|n[e.charCodeAt(t+1)]<<4|n[e.charCodeAt(t+2)]>>2,h[l++]=c>>8&255,h[l++]=255&c),h}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function J(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function Q(){throw new Error("setTimeout has not been defined")}function X(){throw new Error("clearTimeout has not been defined")}var ee=Q,te=X;function ne(e){if(ee===setTimeout)return setTimeout(e,0);if((ee===Q||!ee)&&setTimeout)return ee=setTimeout,setTimeout(e,0);try{return ee(e,0)}catch(t){try{return ee.call(null,e,0)}catch(t){return ee.call(this,e,0)}}}"function"==typeof e.setTimeout&&(ee=setTimeout),"function"==typeof e.clearTimeout&&(te=clearTimeout);var re,oe=[],ie=!1,se=-1;function ae(){ie&&re&&(ie=!1,re.length?oe=re.concat(oe):se=-1,oe.length&&ce())}function ce(){if(!ie){var e=ne(ae);ie=!0;for(var t=oe.length;t;){for(re=oe,oe=[];++se1)for(var n=1;nPe(e,"name",{value:t,configurable:!0}),Me=(e,t)=>{for(var n in t)Pe(e,n,{get:t[n],enumerable:!0})},je=(xe={"(disabled):util"(){}},function(){return Oe||(0,xe[Se(xe)[0]])((Oe={exports:{}}).exports,Oe),Oe.exports}),Ne={};Me(Ne,{addChainableMethod:()=>Bn,addLengthGuard:()=>En,addMethod:()=>jn,addProperty:()=>xn,checkError:()=>Te,compareByInspect:()=>zn,eql:()=>Zt,expectTypes:()=>Fe,flag:()=>ze,getActual:()=>Ye,getMessage:()=>Ft,getName:()=>Vn,getOperator:()=>Yn,getOwnEnumerableProperties:()=>qn,getOwnEnumerablePropertySymbols:()=>$n,getPathInfo:()=>mn,hasProperty:()=>gn,inspect:()=>Lt,isNaN:()=>Un,isProxyEnabled:()=>vn,isRegExp:()=>Kn,objDisplay:()=>Ut,overwriteChainableMethod:()=>Rn,overwriteMethod:()=>Tn,overwriteProperty:()=>Nn,proxify:()=>An,test:()=>$e,transferFlags:()=>Yt,type:()=>qe});var Te={};function ke(e){return e instanceof Error||"[object Error]"===Object.prototype.toString.call(e)}function De(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function _e(e,t){return ke(t)&&e===t}function Ie(e,t){return ke(t)?e.constructor===t.constructor||e instanceof t.constructor:!("object"!=typeof t&&"function"!=typeof t||!t.prototype)&&(e.constructor===t||e instanceof t)}function Ce(e,t){const n="string"==typeof e?e:e.message;return De(t)?t.test(n):"string"==typeof t&&-1!==n.indexOf(t)}function Be(e){let t=e;if(ke(e))t=e.constructor.name;else if("function"==typeof e&&(t=e.name,""===t)){t=(new e).name||t}return t}function Re(e){let t="";return e&&e.message?t=e.message:"string"==typeof e&&(t=e),t}function ze(e,t,n){var r=e.__flags||(e.__flags=Object.create(null));if(3!==arguments.length)return r[t];r[t]=n}function $e(e,t){var n=ze(e,"negate"),r=t[0];return n?!r:r}function qe(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=e[Symbol.toStringTag];if("string"==typeof t)return t;return Object.prototype.toString.call(e).slice(8,-1)}Me(Te,{compatibleConstructor:()=>Ie,compatibleInstance:()=>_e,compatibleMessage:()=>Ce,getConstructorName:()=>Be,getMessage:()=>Re}),Ae(ke,"isErrorInstance"),Ae(De,"isRegExp"),Ae(_e,"compatibleInstance"),Ae(Ie,"compatibleConstructor"),Ae(Ce,"compatibleMessage"),Ae(Be,"getConstructorName"),Ae(Re,"getMessage"),Ae(ze,"flag"),Ae($e,"test"),Ae(qe,"type");var Le="captureStackTrace"in Error,Ue=class e extends Error{static{Ae(this,"AssertionError")}message;get name(){return"AssertionError"}get ok(){return!1}constructor(t="Unspecified AssertionError",n,r){super(t),this.message=t,Le&&Error.captureStackTrace(this,r||e);for(const e in n)e in this||(this[e]=n[e])}toJSON(e){return{...this,name:this.name,message:this.message,ok:!1,stack:!1!==e?this.stack:void 0}}};function Fe(e,t){var n=ze(e,"message"),r=ze(e,"ssfi");n=n?n+": ":"",e=ze(e,"object"),(t=t.map((function(e){return e.toLowerCase()}))).sort();var o=t.map((function(e,n){var r=~["a","e","i","o","u"].indexOf(e.charAt(0))?"an":"a";return(t.length>1&&n===t.length-1?"or ":"")+r+" "+e})).join(", "),i=qe(e).toLowerCase();if(!t.some((function(e){return i===e})))throw new Ue(n+"object tested must be "+o+", but "+i+" given",void 0,r)}function Ye(e,t){return t.length>4?t[4]:e._obj}Ae(Fe,"expectTypes"),Ae(Ye,"getActual");var Ve={bold:["1","22"],dim:["2","22"],italic:["3","23"],underline:["4","24"],inverse:["7","27"],hidden:["8","28"],strike:["9","29"],black:["30","39"],red:["31","39"],green:["32","39"],yellow:["33","39"],blue:["34","39"],magenta:["35","39"],cyan:["36","39"],white:["37","39"],brightblack:["30;1","39"],brightred:["31;1","39"],brightgreen:["32;1","39"],brightyellow:["33;1","39"],brightblue:["34;1","39"],brightmagenta:["35;1","39"],brightcyan:["36;1","39"],brightwhite:["37;1","39"],grey:["90","39"]},Ke={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},He="…";function Ge(e,t){const n=Ve[Ke[t]]||Ve[t]||"";return n?`[${n[0]}m${String(e)}[${n[1]}m`:String(e)}function We({showHidden:e=!1,depth:t=2,colors:n=!1,customInspect:r=!0,showProxy:o=!1,maxArrayLength:i=1/0,breakLength:s=1/0,seen:a=[],truncate:c=1/0,stylize:u=String}={},h){const f={showHidden:Boolean(e),depth:Number(t),colors:Boolean(n),customInspect:Boolean(r),showProxy:Boolean(o),maxArrayLength:Number(i),breakLength:Number(s),truncate:Number(c),seen:a,inspect:h,stylize:u};return f.colors&&(f.stylize=Ge),f}function Ze(e,t,n=He){e=String(e);const r=n.length,o=e.length;return r>t&&o>r?n:o>t&&o>r?`${e.slice(0,t-r)}${n}`:e}function Je(e,t,n,r=", "){n=n||t.inspect;const o=e.length;if(0===o)return"";const i=t.truncate;let s="",a="",c="";for(let u=0;ui&&s.length+c.length<=i)break;if(!o&&!h&&d>i)break;if(a=o?"":n(e[u+1],t)+(h?"":r),!o&&h&&d>i&&p+a.length>i)break;if(s+=l,!o&&!h&&p+a.length>=i){c=`${He}(${e.length-u-1})`;break}c=""}return`${s}${c}`}function Qe(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}function Xe([e,t],n){return n.truncate-=2,"string"==typeof e?e=Qe(e):"number"!=typeof e&&(e=`[${n.inspect(e,n)}]`),n.truncate-=e.length,`${e}: ${t=n.inspect(t,n)}`}function et(e,t){const n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return"[]";t.truncate-=4;const r=Je(e,t);t.truncate-=r.length;let o="";return n.length&&(o=Je(n.map((t=>[t,e[t]])),t,Xe)),`[ ${r}${o?`, ${o}`:""} ]`}Ae(Ge,"colorise"),Ae(We,"normaliseOptions"),Ae(Ze,"truncate"),Ae(Je,"inspectList"),Ae(Qe,"quoteComplexKey"),Ae(Xe,"inspectProperty"),Ae(et,"inspectArray");var tt=Ae((e=>e instanceof d?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name),"getArrayName");function nt(e,t){const n=tt(e);t.truncate-=n.length+4;const r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return`${n}[]`;let o="";for(let n=0;n[t,e[t]])),t,Xe)),`${n}[ ${o}${i?`, ${i}`:""} ]`}function rt(e,t){const n=e.toJSON();if(null===n)return"Invalid Date";const r=n.split("T"),o=r[0];return t.stylize(`${o}T${Ze(r[1],t.truncate-o.length-1)}`,"date")}function ot(e,t){const n=e[Symbol.toStringTag]||"Function",r=e.name;return r?t.stylize(`[${n} ${Ze(r,t.truncate-11)}]`,"special"):t.stylize(`[${n}]`,"special")}function it([e,t],n){return n.truncate-=4,e=n.inspect(e,n),n.truncate-=e.length,`${e} => ${t=n.inspect(t,n)}`}function st(e){const t=[];return e.forEach(((e,n)=>{t.push([n,e])})),t}function at(e,t){return e.size-1<=0?"Map{}":(t.truncate-=7,`Map{ ${Je(st(e),t,it)} }`)}Ae(nt,"inspectTypedArray"),Ae(rt,"inspectDate"),Ae(ot,"inspectFunction"),Ae(it,"inspectMapEntry"),Ae(st,"mapToEntries"),Ae(at,"inspectMap");var ct=Number.isNaN||(e=>e!=e);function ut(e,t){return ct(e)?t.stylize("NaN","number"):e===1/0?t.stylize("Infinity","number"):e===-1/0?t.stylize("-Infinity","number"):0===e?t.stylize(1/e==1/0?"+0":"-0","number"):t.stylize(Ze(String(e),t.truncate),"number")}function ht(e,t){let n=Ze(e.toString(),t.truncate-1);return n!==He&&(n+="n"),t.stylize(n,"bigint")}function ft(e,t){const n=e.toString().split("/")[2],r=t.truncate-(2+n.length),o=e.source;return t.stylize(`/${Ze(o,r)}/${n}`,"regexp")}function lt(e){const t=[];return e.forEach((e=>{t.push(e)})),t}function pt(e,t){return 0===e.size?"Set{}":(t.truncate-=7,`Set{ ${Je(lt(e),t)} }`)}Ae(ut,"inspectNumber"),Ae(ht,"inspectBigInt"),Ae(ft,"inspectRegExp"),Ae(lt,"arrayFromSet"),Ae(pt,"inspectSet");var dt=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),gt={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},yt=16,bt=4;function mt(e){return gt[e]||`\\u${`0000${e.charCodeAt(0).toString(yt)}`.slice(-bt)}`}function wt(e,t){return dt.test(e)&&(e=e.replace(dt,mt)),t.stylize(`'${Ze(e,t.truncate-2)}'`,"string")}function vt(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}Ae(mt,"escape"),Ae(wt,"inspectString"),Ae(vt,"inspectSymbol");var xt=Ae((()=>"Promise{…}"),"getPromiseValue");try{const{getPromiseDetails:e,kPending:t,kRejected:n}=Ee.binding("util");Array.isArray(e(Promise.resolve()))&&(xt=Ae(((r,o)=>{const[i,s]=e(r);return i===t?"Promise{}":`Promise${i===n?"!":""}{${o.inspect(s,o)}}`}),"getPromiseValue"))}catch(e){}var Ot=xt;function Et(e,t){const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(0===n.length&&0===r.length)return"{}";if(t.truncate-=4,t.seen=t.seen||[],t.seen.indexOf(e)>=0)return"[Circular]";t.seen.push(e);const o=Je(n.map((t=>[t,e[t]])),t,Xe),i=Je(r.map((t=>[t,e[t]])),t,Xe);t.seen.pop();let s="";return o&&i&&(s=", "),`{ ${o}${s}${i} }`}Ae(Et,"inspectObject");var Pt=!("undefined"==typeof Symbol||!Symbol.toStringTag)&&Symbol.toStringTag;function St(e,t){let n="";return Pt&&Pt in e&&(n=e[Pt]),n=n||e.constructor.name,n&&"_class"!==n||(n=""),t.truncate-=n.length,`${n}${Et(e,t)}`}function At(e,t){return 0===e.length?"Arguments[]":(t.truncate-=13,`Arguments[ ${Je(e,t)} ]`)}Ae(St,"inspectClass"),Ae(At,"inspectArguments");var Mt=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description"];function jt(e,t){const n=Object.getOwnPropertyNames(e).filter((e=>-1===Mt.indexOf(e))),r=e.name;t.truncate-=r.length;let o="";"string"==typeof e.message?o=Ze(e.message,t.truncate):n.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5;const i=Je(n.map((t=>[t,e[t]])),t,Xe);return`${r}${o}${i?` { ${i} }`:""}`}function Nt([e,t],n){return n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:`${n.stylize(String(e),"yellow")}`}function Tt(e,t){return Je(e,t,kt,"\n")}function kt(e,t){const n=e.getAttributeNames(),r=e.tagName.toLowerCase(),o=t.stylize(`<${r}`,"special"),i=t.stylize(">","special"),s=t.stylize(``,"special");t.truncate-=2*r.length+5;let a="";n.length>0&&(a+=" ",a+=Je(n.map((t=>[t,e.getAttribute(t)])),t,Nt," ")),t.truncate-=a.length;const c=t.truncate;let u=Tt(e.children,t);return u&&u.length>c&&(u=`${He}(${e.children.length})`),`${o}${a}${i}${u}${s}`}Ae(jt,"inspectObject"),Ae(Nt,"inspectAttribute"),Ae(Tt,"inspectHTMLCollection"),Ae(kt,"inspectHTML");var Dt="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("chai/inspect"):"@@chai/inspect",_t=!1;try{const e=je();_t=!!e.inspect&&e.inspect.custom}catch(e){_t=!1}var It=new WeakMap,Ct={},Bt={undefined:(e,t)=>t.stylize("undefined","undefined"),null:(e,t)=>t.stylize("null","null"),boolean:(e,t)=>t.stylize(String(e),"boolean"),Boolean:(e,t)=>t.stylize(String(e),"boolean"),number:ut,Number:ut,bigint:ht,BigInt:ht,string:wt,String:wt,function:ot,Function:ot,symbol:vt,Symbol:vt,Array:et,Date:rt,Map:at,Set:pt,RegExp:ft,Promise:Ot,WeakSet:(e,t)=>t.stylize("WeakSet{…}","special"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),Arguments:At,Int8Array:nt,Uint8Array:nt,Uint8ClampedArray:nt,Int16Array:nt,Uint16Array:nt,Int32Array:nt,Uint32Array:nt,Float32Array:nt,Float64Array:nt,Generator:()=>"",DataView:()=>"",ArrayBuffer:()=>"",Error:jt,HTMLCollection:Tt,NodeList:Tt},Rt=Ae(((e,t,n)=>Dt in e&&"function"==typeof e[Dt]?e[Dt](t):_t&&_t in e&&"function"==typeof e[_t]?e[_t](t.depth,t):"inspect"in e&&"function"==typeof e.inspect?e.inspect(t.depth,t):"constructor"in e&&It.has(e.constructor)?It.get(e.constructor)(e,t):Ct[n]?Ct[n](e,t):""),"inspectCustom"),zt=Object.prototype.toString;function $t(e,t={}){const n=We(t,$t),{customInspect:r}=n;let o=null===e?"null":typeof e;if("object"===o&&(o=zt.call(e).slice(8,-1)),o in Bt)return Bt[o](e,n);if(r&&e){const t=Rt(e,n,o);if(t)return"string"==typeof t?t:$t(t,n)}const i=!!e&&Object.getPrototypeOf(e);return i===Object.prototype||null===i?Et(e,n):e&&"function"==typeof HTMLElement&&e instanceof HTMLElement?kt(e,n):"constructor"in e?e.constructor!==Object?St(e,n):Et(e,n):e===Object(e)?Et(e,n):n.stylize(String(e),o)}Ae($t,"inspect");var qt={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function Lt(e,t,n,r){return $t(e,{colors:r,depth:void 0===n?2:n,showHidden:t,truncate:qt.truncateThreshold?qt.truncateThreshold:1/0})}function Ut(e){var t=Lt(e),n=Object.prototype.toString.call(e);if(qt.truncateThreshold&&t.length>=qt.truncateThreshold){if("[object Function]"===n)return e.name&&""!==e.name?"[Function: "+e.name+"]":"[Function]";if("[object Array]"===n)return"[ Array("+e.length+") ]";if("[object Object]"===n){var r=Object.keys(e);return"{ Object ("+(r.length>2?r.splice(0,2).join(", ")+", ...":r.join(", "))+") }"}return t}return t}function Ft(e,t){var n=ze(e,"negate"),r=ze(e,"object"),o=t[3],i=Ye(e,t),s=n?t[2]:t[1],a=ze(e,"message");return"function"==typeof s&&(s=s()),s=(s=s||"").replace(/#\{this\}/g,(function(){return Ut(r)})).replace(/#\{act\}/g,(function(){return Ut(i)})).replace(/#\{exp\}/g,(function(){return Ut(o)})),a?a+": "+s:s}function Yt(e,t,n){var r=e.__flags||(e.__flags=Object.create(null));for(var o in t.__flags||(t.__flags=Object.create(null)),n=3!==arguments.length||n,r)(n||"object"!==o&&"ssfi"!==o&&"lockSsfi"!==o&&"message"!=o)&&(t.__flags[o]=r[o])}function Vt(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=e[Symbol.toStringTag];if("string"==typeof t)return t;return Object.prototype.toString.call(e).slice(8,-1)}function Kt(){this._key="chai/deep-eql__"+Math.random()+Date.now()}Ae(Lt,"inspect"),Ae(Ut,"objDisplay"),Ae(Ft,"getMessage"),Ae(Yt,"transferFlags"),Ae(Vt,"type"),Ae(Kt,"FakeMap"),Kt.prototype={get:Ae((function(e){return e[this._key]}),"get"),set:Ae((function(e,t){Object.isExtensible(e)&&Object.defineProperty(e,this._key,{value:t,configurable:!0})}),"set")};var Ht="function"==typeof WeakMap?WeakMap:Kt;function Gt(e,t,n){if(!n||pn(e)||pn(t))return null;var r=n.get(e);if(r){var o=r.get(t);if("boolean"==typeof o)return o}return null}function Wt(e,t,n,r){if(n&&!pn(e)&&!pn(t)){var o=n.get(e);o?o.set(t,r):((o=new Ht).set(t,r),n.set(e,o))}}Ae(Gt,"memoizeCompare"),Ae(Wt,"memoizeSet");var Zt=Jt;function Jt(e,t,n){if(n&&n.comparator)return Xt(e,t,n);var r=Qt(e,t);return null!==r?r:Xt(e,t,n)}function Qt(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t||!pn(e)&&!pn(t)&&null}function Xt(e,t,n){(n=n||{}).memoize=!1!==n.memoize&&(n.memoize||new Ht);var r=n&&n.comparator,o=Gt(e,t,n.memoize);if(null!==o)return o;var i=Gt(t,e,n.memoize);if(null!==i)return i;if(r){var s=r(e,t);if(!1===s||!0===s)return Wt(e,t,n.memoize,s),s;var a=Qt(e,t);if(null!==a)return a}var c=Vt(e);if(c!==Vt(t))return Wt(e,t,n.memoize,!1),!1;Wt(e,t,n.memoize,!0);var u=en(e,t,c,n);return Wt(e,t,n.memoize,u),u}function en(e,t,n,r){switch(n){case"String":case"Number":case"Boolean":case"Date":return Jt(e.valueOf(),t.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return e===t;case"Error":return fn(e,t,["name","message","code"],r);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return rn(e,t,r);case"RegExp":return tn(e,t);case"Generator":return on(e,t,r);case"DataView":return rn(new Uint8Array(e.buffer),new Uint8Array(t.buffer),r);case"ArrayBuffer":return rn(new Uint8Array(e),new Uint8Array(t),r);case"Set":case"Map":return nn(e,t,r);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return e.equals(t);case"Temporal.Duration":return e.total("nanoseconds")===t.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return e.toString()===t.toString();default:return ln(e,t,r)}}function tn(e,t){return e.toString()===t.toString()}function nn(e,t,n){if(e.size!==t.size)return!1;if(0===e.size)return!0;var r=[],o=[];return e.forEach(Ae((function(e,t){r.push([e,t])}),"gatherEntries")),t.forEach(Ae((function(e,t){o.push([e,t])}),"gatherEntries")),rn(r.sort(),o.sort(),n)}function rn(e,t,n){var r=e.length;if(r!==t.length)return!1;if(0===r)return!0;for(var o=-1;++o{if("constructor"===e||"__proto__"===e||"prototype"===e)return{};const t=/^\[(\d+)\]$/.exec(e);let n=null;return n=t?{i:parseFloat(t[1])}:{p:e.replace(/\\([.[\]])/g,"$1")},n}))}function bn(e,t,n){let r=e,o=null;n=void 0===n?t.length:n;for(let e=0;e1?bn(e,n,n.length-1):e,name:r.p||r.i,value:bn(e,n)};return o.exists=gn(o.parent,o.name),o}function wn(e,t,n,r){return ze(this,"ssfi",n||wn),ze(this,"lockSsfi",r),ze(this,"object",e),ze(this,"message",t),ze(this,"eql",qt.deepEqual||Zt),An(this)}function vn(){return qt.useProxy&&"undefined"!=typeof Proxy&&"undefined"!=typeof Reflect}function xn(e,t,n){n=void 0===n?function(){}:n,Object.defineProperty(e,t,{get:Ae((function e(){vn()||ze(this,"lockSsfi")||ze(this,"ssfi",e);var t=n.call(this);if(void 0!==t)return t;var r=new wn;return Yt(this,r),r}),"propertyGetter"),configurable:!0})}Ae(Jt,"deepEqual"),Ae(Qt,"simpleEqual"),Ae(Xt,"extensiveDeepEqual"),Ae(en,"extensiveDeepEqualByType"),Ae(tn,"regexpEqual"),Ae(nn,"entriesEqual"),Ae(rn,"iterableEqual"),Ae(on,"generatorEqual"),Ae(sn,"hasIteratorFunction"),Ae(an,"getIteratorEntries"),Ae(cn,"getGeneratorEntries"),Ae(un,"getEnumerableKeys"),Ae(hn,"getEnumerableSymbols"),Ae(fn,"keysEqual"),Ae(ln,"objectEqual"),Ae(pn,"isPrimitive"),Ae(dn,"mapSymbols"),Ae(gn,"hasProperty"),Ae(yn,"parsePath"),Ae(bn,"internalGetPathValue"),Ae(mn,"getPathInfo"),Ae(wn,"Assertion"),Object.defineProperty(wn,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),qt.includeStack},set:function(e){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),qt.includeStack=e}}),Object.defineProperty(wn,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),qt.showDiff},set:function(e){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),qt.showDiff=e}}),wn.addProperty=function(e,t){xn(this.prototype,e,t)},wn.addMethod=function(e,t){jn(this.prototype,e,t)},wn.addChainableMethod=function(e,t,n){Bn(this.prototype,e,t,n)},wn.overwriteProperty=function(e,t){Nn(this.prototype,e,t)},wn.overwriteMethod=function(e,t){Tn(this.prototype,e,t)},wn.overwriteChainableMethod=function(e,t,n){Rn(this.prototype,e,t,n)},wn.prototype.assert=function(e,t,n,r,o,i){var s=$e(this,arguments);if(!1!==i&&(i=!0),void 0===r&&void 0===o&&(i=!1),!0!==qt.showDiff&&(i=!1),!s){t=Ft(this,arguments);var a={actual:Ye(this,arguments),expected:r,showDiff:i},c=Yn(this,arguments);throw c&&(a.operator=c),new Ue(t,a,qt.includeStack?this.assert:ze(this,"ssfi"))}},Object.defineProperty(wn.prototype,"_obj",{get:function(){return ze(this,"object")},set:function(e){ze(this,"object",e)}}),Ae(vn,"isProxyEnabled"),Ae(xn,"addProperty");var On=Object.getOwnPropertyDescriptor((function(){}),"length");function En(e,t,n){return On.configurable?(Object.defineProperty(e,"length",{get:function(){if(n)throw Error("Invalid Chai property: "+t+'.length. Due to a compatibility issue, "length" cannot directly follow "'+t+'". Use "'+t+'.lengthOf" instead.');throw Error("Invalid Chai property: "+t+'.length. See docs for proper usage of "'+t+'".')}}),e):e}function Pn(e){var t=Object.getOwnPropertyNames(e);function n(e){-1===t.indexOf(e)&&t.push(e)}Ae(n,"addProperty");for(var r=Object.getPrototypeOf(e);null!==r;)Object.getOwnPropertyNames(r).forEach(n),r=Object.getPrototypeOf(r);return t}Ae(En,"addLengthGuard"),Ae(Pn,"getProperties");var Sn=["__flags","__methods","_obj","assert"];function An(e,t){return vn()?new Proxy(e,{get:Ae((function e(n,r){if("string"==typeof r&&-1===qt.proxyExcludedKeys.indexOf(r)&&!Reflect.has(n,r)){if(t)throw Error("Invalid Chai property: "+t+"."+r+'. See docs for proper usage of "'+t+'".');var o=null,i=4;throw Pn(n).forEach((function(e){if(!Object.prototype.hasOwnProperty(e)&&-1===Sn.indexOf(e)){var t=Mn(r,e,i);t=n)return n;for(var r=[],o=0;o<=e.length;o++)r[o]=Array(t.length+1).fill(0),r[o][0]=o;for(var i=0;i=n?r[o][i]=n:r[o][i]=Math.min(r[o-1][i]+1,r[o][i-1]+1,r[o-1][i-1]+(s===t.charCodeAt(i-1)?0:1))}return r[e.length][t.length]}function jn(e,t,n){var r=Ae((function(){ze(this,"lockSsfi")||ze(this,"ssfi",r);var e=n.apply(this,arguments);if(void 0!==e)return e;var t=new wn;return Yt(this,t),t}),"methodWrapper");En(r,t,!1),e[t]=An(r,t)}function Nn(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t),o=Ae((function(){}),"_super");r&&"function"==typeof r.get&&(o=r.get),Object.defineProperty(e,t,{get:Ae((function e(){vn()||ze(this,"lockSsfi")||ze(this,"ssfi",e);var t=ze(this,"lockSsfi");ze(this,"lockSsfi",!0);var r=n(o).call(this);if(ze(this,"lockSsfi",t),void 0!==r)return r;var i=new wn;return Yt(this,i),i}),"overwritingPropertyGetter"),configurable:!0})}function Tn(e,t,n){var r=e[t],o=Ae((function(){throw new Error(t+" is not a function")}),"_super");r&&"function"==typeof r&&(o=r);var i=Ae((function(){ze(this,"lockSsfi")||ze(this,"ssfi",i);var e=ze(this,"lockSsfi");ze(this,"lockSsfi",!0);var t=n(o).apply(this,arguments);if(ze(this,"lockSsfi",e),void 0!==t)return t;var r=new wn;return Yt(this,r),r}),"overwritingMethodWrapper");En(i,t,!1),e[t]=An(i,t)}Ae(An,"proxify"),Ae(Mn,"stringDistanceCapped"),Ae(jn,"addMethod"),Ae(Nn,"overwriteProperty"),Ae(Tn,"overwriteMethod");var kn="function"==typeof Object.setPrototypeOf,Dn=Ae((function(){}),"testFn"),_n=Object.getOwnPropertyNames(Dn).filter((function(e){var t=Object.getOwnPropertyDescriptor(Dn,e);return"object"!=typeof t||!t.configurable})),In=Function.prototype.call,Cn=Function.prototype.apply;function Bn(e,t,n,r){"function"!=typeof r&&(r=Ae((function(){}),"chainingBehavior"));var o={method:n,chainingBehavior:r};e.__methods||(e.__methods={}),e.__methods[t]=o,Object.defineProperty(e,t,{get:Ae((function(){o.chainingBehavior.call(this);var n=Ae((function(){ze(this,"lockSsfi")||ze(this,"ssfi",n);var e=o.method.apply(this,arguments);if(void 0!==e)return e;var t=new wn;return Yt(this,t),t}),"chainableMethodWrapper");if(En(n,t,!0),kn){var r=Object.create(this);r.call=In,r.apply=Cn,Object.setPrototypeOf(n,r)}else{Object.getOwnPropertyNames(e).forEach((function(t){if(-1===_n.indexOf(t)){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r)}}))}return Yt(this,n),An(n)}),"chainableMethodGetter"),configurable:!0})}function Rn(e,t,n,r){var o=e.__methods[t],i=o.chainingBehavior;o.chainingBehavior=Ae((function(){var e=r(i).call(this);if(void 0!==e)return e;var t=new wn;return Yt(this,t),t}),"overwritingChainableMethodGetter");var s=o.method;o.method=Ae((function(){var e=n(s).apply(this,arguments);if(void 0!==e)return e;var t=new wn;return Yt(this,t),t}),"overwritingChainableMethodWrapper")}function zn(e,t){return Lt(e)1&&p===f.length)throw l;return}this.assert(h,"expected #{this} to "+c+"include "+Lt(e),"expected #{this} to not "+c+"include "+Lt(e))}function Xn(){var e=Hn(this,"object");this.assert(null!=e,"expected #{this} to exist","expected #{this} to not exist")}function er(){var e=qe(Hn(this,"object"));this.assert("Arguments"===e,"expected #{this} to be arguments but got "+e,"expected #{this} to not be arguments")}function tr(e,t){t&&Hn(this,"message",t);var n=Hn(this,"object");if(Hn(this,"deep")){var r=Hn(this,"lockSsfi");Hn(this,"lockSsfi",!0),this.eql(e),Hn(this,"lockSsfi",r)}else this.assert(e===n,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",e,this._obj,!0)}function nr(e,t){t&&Hn(this,"message",t);var n=Hn(this,"eql");this.assert(n(e,Hn(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",e,this._obj,!0)}function rr(e,t){t&&Hn(this,"message",t);var n,r=Hn(this,"object"),o=Hn(this,"doLength"),i=Hn(this,"message"),s=i?i+": ":"",a=Hn(this,"ssfi"),c=qe(r).toLowerCase(),u=qe(e).toLowerCase(),h=!0;if(o&&"map"!==c&&"set"!==c&&new wn(r,i,a,!0).to.have.property("length"),o||"date"!==c||"date"===u)if("number"===u||!o&&"number"!==c)if(o||"date"===c||"number"===c)h=!1;else{n=s+"expected "+("string"===c?"'"+r+"'":r)+" to be a number or a date"}else n=s+"the argument to above must be a number";else n=s+"the argument to above must be a date";if(h)throw new Ue(n,void 0,a);if(o){var f,l="length";"map"===c||"set"===c?(l="size",f=r.size):f=r.length,this.assert(f>e,"expected #{this} to have a "+l+" above #{exp} but got #{act}","expected #{this} to not have a "+l+" above #{exp}",e,f)}else this.assert(r>e,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",e)}function or(e,t){t&&Hn(this,"message",t);var n,r=Hn(this,"object"),o=Hn(this,"doLength"),i=Hn(this,"message"),s=i?i+": ":"",a=Hn(this,"ssfi"),c=qe(r).toLowerCase(),u=qe(e).toLowerCase(),h=!0;if(o&&"map"!==c&&"set"!==c&&new wn(r,i,a,!0).to.have.property("length"),o||"date"!==c||"date"===u)if("number"===u||!o&&"number"!==c)if(o||"date"===c||"number"===c)h=!1;else{n=s+"expected "+("string"===c?"'"+r+"'":r)+" to be a number or a date"}else n=s+"the argument to least must be a number";else n=s+"the argument to least must be a date";if(h)throw new Ue(n,void 0,a);if(o){var f,l="length";"map"===c||"set"===c?(l="size",f=r.size):f=r.length,this.assert(f>=e,"expected #{this} to have a "+l+" at least #{exp} but got #{act}","expected #{this} to have a "+l+" below #{exp}",e,f)}else this.assert(r>=e,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",e)}function ir(e,t){t&&Hn(this,"message",t);var n,r=Hn(this,"object"),o=Hn(this,"doLength"),i=Hn(this,"message"),s=i?i+": ":"",a=Hn(this,"ssfi"),c=qe(r).toLowerCase(),u=qe(e).toLowerCase(),h=!0;if(o&&"map"!==c&&"set"!==c&&new wn(r,i,a,!0).to.have.property("length"),o||"date"!==c||"date"===u)if("number"===u||!o&&"number"!==c)if(o||"date"===c||"number"===c)h=!1;else{n=s+"expected "+("string"===c?"'"+r+"'":r)+" to be a number or a date"}else n=s+"the argument to below must be a number";else n=s+"the argument to below must be a date";if(h)throw new Ue(n,void 0,a);if(o){var f,l="length";"map"===c||"set"===c?(l="size",f=r.size):f=r.length,this.assert(fe===t,g="";h&&(g+="deep "),o&&(g+="own "),r&&(g+="nested "),g+="property ",u=o?Object.prototype.hasOwnProperty.call(s,e):r?l.exists:gn(s,e),f&&1!==arguments.length||this.assert(u,"expected #{this} to have "+g+Lt(e),"expected #{this} to not have "+g+Lt(e)),arguments.length>1&&this.assert(u&&d(t,p),"expected #{this} to have "+g+Lt(e)+" of #{exp}, but got #{act}","expected #{this} to not have "+g+Lt(e)+" of #{act}",t,p),Hn(this,"object",p)}function ur(e,t,n){Hn(this,"own",!0),cr.apply(this,arguments)}function hr(e,t,n){"string"==typeof t&&(n=t,t=null),n&&Hn(this,"message",n);var r=Hn(this,"object"),o=Object.getOwnPropertyDescriptor(Object(r),e),i=Hn(this,"eql");o&&t?this.assert(i(t,o),"expected the own property descriptor for "+Lt(e)+" on #{this} to match "+Lt(t)+", got "+Lt(o),"expected the own property descriptor for "+Lt(e)+" on #{this} to not match "+Lt(t),t,o,!0):this.assert(o,"expected #{this} to have an own property descriptor for "+Lt(e),"expected #{this} to not have an own property descriptor for "+Lt(e)),Hn(this,"object",o)}function fr(){Hn(this,"doLength",!0)}function lr(e,t){t&&Hn(this,"message",t);var n,r=Hn(this,"object"),o=qe(r).toLowerCase(),i=Hn(this,"message"),s=Hn(this,"ssfi"),a="length";switch(o){case"map":case"set":a="size",n=r.size;break;default:new wn(r,i,s,!0).to.have.property("length"),n=r.length}this.assert(n==e,"expected #{this} to have a "+a+" of #{exp} but got #{act}","expected #{this} to not have a "+a+" of #{act}",e,n)}function pr(e,t){t&&Hn(this,"message",t);var n=Hn(this,"object");this.assert(e.exec(n),"expected #{this} to match "+e,"expected #{this} not to match "+e)}function dr(e){var t,n,r=Hn(this,"object"),o=qe(r),i=qe(e),s=Hn(this,"ssfi"),a=Hn(this,"deep"),c="",u=!0,h=Hn(this,"message"),f=(h=h?h+": ":"")+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if("Map"===o||"Set"===o)c=a?"deeply ":"",n=[],r.forEach((function(e,t){n.push(t)})),"Array"!==i&&(e=Array.prototype.slice.call(arguments));else{switch(n=qn(r),i){case"Array":if(arguments.length>1)throw new Ue(f,void 0,s);break;case"Object":if(arguments.length>1)throw new Ue(f,void 0,s);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}e=e.map((function(e){return"symbol"==typeof e?e:String(e)}))}if(!e.length)throw new Ue(h+"keys required",void 0,s);var l=e.length,p=Hn(this,"any"),d=Hn(this,"all"),g=e,y=a?Hn(this,"eql"):(e,t)=>e===t;if(p||d||(d=!0),p&&(u=g.some((function(e){return n.some((function(t){return y(e,t)}))}))),d&&(u=g.every((function(e){return n.some((function(t){return y(e,t)}))})),Hn(this,"contains")||(u=u&&e.length==n.length)),l>1){var b=(e=e.map((function(e){return Lt(e)}))).pop();d&&(t=e.join(", ")+", and "+b),p&&(t=e.join(", ")+", or "+b)}else t=Lt(e[0]);t=(l>1?"keys ":"key ")+t,t=(Hn(this,"contains")?"contain ":"have ")+t,this.assert(u,"expected #{this} to "+c+t,"expected #{this} to not "+c+t,g.slice(0).sort(zn),n.sort(zn),!0)}function gr(e,t,n){n&&Hn(this,"message",n);var r=Hn(this,"object"),o=Hn(this,"ssfi"),i=Hn(this,"message"),s=Hn(this,"negate")||!1;let a;new wn(r,i,o,!0).is.a("function"),(Kn(e)||"string"==typeof e)&&(t=e,e=null);let c=!1;try{r()}catch(e){c=!0,a=e}var u=void 0===e&&void 0===t,h=Boolean(e&&t),f=!1,l=!1;if(u||!u&&!s){var p="an error";e instanceof Error?p="#{exp}":e&&(p=Te.getConstructorName(e));let t=a;if(a instanceof Error)t=a.toString();else if("string"==typeof a)t=a;else if(a&&("object"==typeof a||"function"==typeof a))try{t=Te.getConstructorName(a)}catch(e){}this.assert(c,"expected #{this} to throw "+p,"expected #{this} to not throw an error but #{act} was thrown",e&&e.toString(),t)}if(e&&a){if(e instanceof Error)Te.compatibleInstance(a,e)===s&&(h&&s?f=!0:this.assert(s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(a&&!s?" but #{act} was thrown":""),e.toString(),a.toString()));Te.compatibleConstructor(a,e)===s&&(h&&s?f=!0:this.assert(s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(a?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&Te.getConstructorName(e),a instanceof Error?a.toString():a&&Te.getConstructorName(a)))}if(a&&null!=t){var d="including";Kn(t)&&(d="matching"),Te.compatibleMessage(a,t)===s&&(h&&s?l=!0:this.assert(s,"expected #{this} to throw error "+d+" #{exp} but got #{act}","expected #{this} to throw error not "+d+" #{exp}",t,Te.getMessage(a)))}f&&l&&this.assert(s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(a?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&Te.getConstructorName(e),a instanceof Error?a.toString():a&&Te.getConstructorName(a)),Hn(this,"object",a)}function yr(e,t){t&&Hn(this,"message",t);var n=Hn(this,"object"),r=Hn(this,"itself"),o="function"!=typeof n||r?n[e]:n.prototype[e];this.assert("function"==typeof o,"expected #{this} to respond to "+Lt(e),"expected #{this} to not respond to "+Lt(e))}function br(e,t){t&&Hn(this,"message",t);var n=e(Hn(this,"object"));this.assert(n,"expected #{this} to satisfy "+Ut(e),"expected #{this} to not satisfy"+Ut(e),!Hn(this,"negate"),n)}function mr(e,t,n){n&&Hn(this,"message",n);var r=Hn(this,"object"),o=Hn(this,"message"),i=Hn(this,"ssfi");if(new wn(r,o,i,!0).is.a("number"),"number"!=typeof e||"number"!=typeof t)throw new Ue((o=o?o+": ":"")+"the arguments to closeTo or approximately must be numbers"+(void 0===t?", and a delta is required":""),void 0,i);this.assert(Math.abs(r-e)<=t,"expected #{this} to be close to "+e+" +/- "+t,"expected #{this} not to be close to "+e+" +/- "+t)}function wr(e,t,n,r,o){let i=Array.from(t),s=Array.from(e);if(!r){if(s.length!==i.length)return!1;i=i.slice()}return s.every((function(e,t){if(o)return n?n(e,i[t]):e===i[t];if(!n){var s=i.indexOf(e);return-1!==s&&(r||i.splice(s,1),!0)}return i.some((function(t,o){return!!n(e,t)&&(r||i.splice(o,1),!0)}))}))}function vr(e,t){t&&Hn(this,"message",t);var n=Hn(this,"object"),r=Hn(this,"message"),o=Hn(this,"ssfi"),i=Hn(this,"contains"),s=Hn(this,"deep"),a=Hn(this,"eql");new wn(e,r,o,!0).to.be.an("array"),i?this.assert(e.some((function(e){return n.indexOf(e)>-1})),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",e,n):s?this.assert(e.some((function(e){return a(n,e)})),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",e,n):this.assert(e.indexOf(n)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",e,n)}function xr(e,t,n){n&&Hn(this,"message",n);var r,o=Hn(this,"object"),i=Hn(this,"message"),s=Hn(this,"ssfi");new wn(o,i,s,!0).is.a("function"),t?(new wn(e,i,s,!0).to.have.property(t),r=e[t]):(new wn(e,i,s,!0).is.a("function"),r=e()),o();var a=null==t?e():e[t],c=null==t?r:"."+t;Hn(this,"deltaMsgObj",c),Hn(this,"initialDeltaValue",r),Hn(this,"finalDeltaValue",a),Hn(this,"deltaBehavior","change"),Hn(this,"realDelta",a!==r),this.assert(r!==a,"expected "+c+" to change","expected "+c+" to not change")}function Or(e,t,n){n&&Hn(this,"message",n);var r,o=Hn(this,"object"),i=Hn(this,"message"),s=Hn(this,"ssfi");new wn(o,i,s,!0).is.a("function"),t?(new wn(e,i,s,!0).to.have.property(t),r=e[t]):(new wn(e,i,s,!0).is.a("function"),r=e()),new wn(r,i,s,!0).is.a("number"),o();var a=null==t?e():e[t],c=null==t?r:"."+t;Hn(this,"deltaMsgObj",c),Hn(this,"initialDeltaValue",r),Hn(this,"finalDeltaValue",a),Hn(this,"deltaBehavior","increase"),Hn(this,"realDelta",a-r),this.assert(a-r>0,"expected "+c+" to increase","expected "+c+" to not increase")}function Er(e,t,n){n&&Hn(this,"message",n);var r,o=Hn(this,"object"),i=Hn(this,"message"),s=Hn(this,"ssfi");new wn(o,i,s,!0).is.a("function"),t?(new wn(e,i,s,!0).to.have.property(t),r=e[t]):(new wn(e,i,s,!0).is.a("function"),r=e()),new wn(r,i,s,!0).is.a("number"),o();var a=null==t?e():e[t],c=null==t?r:"."+t;Hn(this,"deltaMsgObj",c),Hn(this,"initialDeltaValue",r),Hn(this,"finalDeltaValue",a),Hn(this,"deltaBehavior","decrease"),Hn(this,"realDelta",r-a),this.assert(a-r<0,"expected "+c+" to decrease","expected "+c+" to not decrease")}function Pr(e,t){t&&Hn(this,"message",t);var n,r=Hn(this,"deltaMsgObj"),o=Hn(this,"initialDeltaValue"),i=Hn(this,"finalDeltaValue"),s=Hn(this,"deltaBehavior"),a=Hn(this,"realDelta");n="change"===s?Math.abs(i-o)===Math.abs(e):a===Math.abs(e),this.assert(n,"expected "+r+" to "+s+" by "+e,"expected "+r+" to not "+s+" by "+e)}function Sr(e,t){return new wn(e,t)}Ae(Wn,"an"),wn.addChainableMethod("an",Wn),wn.addChainableMethod("a",Wn),Ae(Zn,"SameValueZero"),Ae(Jn,"includeChainingBehavior"),Ae(Qn,"include"),wn.addChainableMethod("include",Qn,Jn),wn.addChainableMethod("contain",Qn,Jn),wn.addChainableMethod("contains",Qn,Jn),wn.addChainableMethod("includes",Qn,Jn),wn.addProperty("ok",(function(){this.assert(Hn(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")})),wn.addProperty("true",(function(){this.assert(!0===Hn(this,"object"),"expected #{this} to be true","expected #{this} to be false",!Hn(this,"negate"))})),wn.addProperty("callable",(function(){const e=Hn(this,"object"),t=Hn(this,"ssfi"),n=Hn(this,"message"),r=n?`${n}: `:"",o=Hn(this,"negate"),i=o?`${r}expected ${Lt(e)} not to be a callable function`:`${r}expected ${Lt(e)} to be a callable function`,s=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(qe(e));if(s&&o||!s&&!o)throw new Ue(i,void 0,t)})),wn.addProperty("false",(function(){this.assert(!1===Hn(this,"object"),"expected #{this} to be false","expected #{this} to be true",!!Hn(this,"negate"))})),wn.addProperty("null",(function(){this.assert(null===Hn(this,"object"),"expected #{this} to be null","expected #{this} not to be null")})),wn.addProperty("undefined",(function(){this.assert(void 0===Hn(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")})),wn.addProperty("NaN",(function(){this.assert(Un(Hn(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")})),Ae(Xn,"assertExist"),wn.addProperty("exist",Xn),wn.addProperty("exists",Xn),wn.addProperty("empty",(function(){var e,t=Hn(this,"object"),n=Hn(this,"ssfi"),r=Hn(this,"message");switch(r=r?r+": ":"",qe(t).toLowerCase()){case"array":case"string":e=t.length;break;case"map":case"set":e=t.size;break;case"weakmap":case"weakset":throw new Ue(r+".empty was passed a weak collection",void 0,n);case"function":var o=r+".empty was passed a function "+Vn(t);throw new Ue(o.trim(),void 0,n);default:if(t!==Object(t))throw new Ue(r+".empty was passed non-string primitive "+Lt(t),void 0,n);e=Object.keys(t).length}this.assert(0===e,"expected #{this} to be empty","expected #{this} not to be empty")})),Ae(er,"checkArguments"),wn.addProperty("arguments",er),wn.addProperty("Arguments",er),Ae(tr,"assertEqual"),wn.addMethod("equal",tr),wn.addMethod("equals",tr),wn.addMethod("eq",tr),Ae(nr,"assertEql"),wn.addMethod("eql",nr),wn.addMethod("eqls",nr),Ae(rr,"assertAbove"),wn.addMethod("above",rr),wn.addMethod("gt",rr),wn.addMethod("greaterThan",rr),Ae(or,"assertLeast"),wn.addMethod("least",or),wn.addMethod("gte",or),wn.addMethod("greaterThanOrEqual",or),Ae(ir,"assertBelow"),wn.addMethod("below",ir),wn.addMethod("lt",ir),wn.addMethod("lessThan",ir),Ae(sr,"assertMost"),wn.addMethod("most",sr),wn.addMethod("lte",sr),wn.addMethod("lessThanOrEqual",sr),wn.addMethod("within",(function(e,t,n){n&&Hn(this,"message",n);var r,o=Hn(this,"object"),i=Hn(this,"doLength"),s=Hn(this,"message"),a=s?s+": ":"",c=Hn(this,"ssfi"),u=qe(o).toLowerCase(),h=qe(e).toLowerCase(),f=qe(t).toLowerCase(),l=!0,p="date"===h&&"date"===f?e.toISOString()+".."+t.toISOString():e+".."+t;if(i&&"map"!==u&&"set"!==u&&new wn(o,s,c,!0).to.have.property("length"),i||"date"!==u||"date"===h&&"date"===f)if("number"===h&&"number"===f||!i&&"number"!==u)if(i||"date"===u||"number"===u)l=!1;else{r=a+"expected "+("string"===u?"'"+o+"'":o)+" to be a number or a date"}else r=a+"the arguments to within must be numbers";else r=a+"the arguments to within must be dates";if(l)throw new Ue(r,void 0,c);if(i){var d,g="length";"map"===u||"set"===u?(g="size",d=o.size):d=o.length,this.assert(d>=e&&d<=t,"expected #{this} to have a "+g+" within "+p,"expected #{this} to not have a "+g+" within "+p)}else this.assert(o>=e&&o<=t,"expected #{this} to be within "+p,"expected #{this} to not be within "+p)})),Ae(ar,"assertInstanceOf"),wn.addMethod("instanceof",ar),wn.addMethod("instanceOf",ar),Ae(cr,"assertProperty"),wn.addMethod("property",cr),Ae(ur,"assertOwnProperty"),wn.addMethod("ownProperty",ur),wn.addMethod("haveOwnProperty",ur),Ae(hr,"assertOwnPropertyDescriptor"),wn.addMethod("ownPropertyDescriptor",hr),wn.addMethod("haveOwnPropertyDescriptor",hr),Ae(fr,"assertLengthChain"),Ae(lr,"assertLength"),wn.addChainableMethod("length",lr,fr),wn.addChainableMethod("lengthOf",lr,fr),Ae(pr,"assertMatch"),wn.addMethod("match",pr),wn.addMethod("matches",pr),wn.addMethod("string",(function(e,t){t&&Hn(this,"message",t);var n=Hn(this,"object");new wn(n,Hn(this,"message"),Hn(this,"ssfi"),!0).is.a("string"),this.assert(~n.indexOf(e),"expected #{this} to contain "+Lt(e),"expected #{this} to not contain "+Lt(e))})),Ae(dr,"assertKeys"),wn.addMethod("keys",dr),wn.addMethod("key",dr),Ae(gr,"assertThrows"),wn.addMethod("throw",gr),wn.addMethod("throws",gr),wn.addMethod("Throw",gr),Ae(yr,"respondTo"),wn.addMethod("respondTo",yr),wn.addMethod("respondsTo",yr),wn.addProperty("itself",(function(){Hn(this,"itself",!0)})),Ae(br,"satisfy"),wn.addMethod("satisfy",br),wn.addMethod("satisfies",br),Ae(mr,"closeTo"),wn.addMethod("closeTo",mr),wn.addMethod("approximately",mr),Ae(wr,"isSubsetOf"),wn.addMethod("members",(function(e,t){t&&Hn(this,"message",t);var n=Hn(this,"object"),r=Hn(this,"message"),o=Hn(this,"ssfi");new wn(n,r,o,!0).to.be.iterable,new wn(e,r,o,!0).to.be.iterable;var i,s,a,c=Hn(this,"contains"),u=Hn(this,"ordered");c?(s="expected #{this} to be "+(i=u?"an ordered superset":"a superset")+" of #{exp}",a="expected #{this} to not be "+i+" of #{exp}"):(s="expected #{this} to have the same "+(i=u?"ordered members":"members")+" as #{exp}",a="expected #{this} to not have the same "+i+" as #{exp}");var h=Hn(this,"deep")?Hn(this,"eql"):void 0;this.assert(wr(e,n,h,c,u),s,a,e,n,!0)})),wn.addProperty("iterable",(function(e){e&&Hn(this,"message",e);var t=Hn(this,"object");this.assert(null!=t&&t[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",t)})),Ae(vr,"oneOf"),wn.addMethod("oneOf",vr),Ae(xr,"assertChanges"),wn.addMethod("change",xr),wn.addMethod("changes",xr),Ae(Or,"assertIncreases"),wn.addMethod("increase",Or),wn.addMethod("increases",Or),Ae(Er,"assertDecreases"),wn.addMethod("decrease",Er),wn.addMethod("decreases",Er),Ae(Pr,"assertDelta"),wn.addMethod("by",Pr),wn.addProperty("extensible",(function(){var e=Hn(this,"object"),t=e===Object(e)&&Object.isExtensible(e);this.assert(t,"expected #{this} to be extensible","expected #{this} to not be extensible")})),wn.addProperty("sealed",(function(){var e=Hn(this,"object"),t=e!==Object(e)||Object.isSealed(e);this.assert(t,"expected #{this} to be sealed","expected #{this} to not be sealed")})),wn.addProperty("frozen",(function(){var e=Hn(this,"object"),t=e!==Object(e)||Object.isFrozen(e);this.assert(t,"expected #{this} to be frozen","expected #{this} to not be frozen")})),wn.addProperty("finite",(function(e){var t=Hn(this,"object");this.assert("number"==typeof t&&isFinite(t),"expected #{this} to be a finite number","expected #{this} to not be a finite number")})),Ae(Sr,"expect"),Sr.fail=function(e,t,n,r){throw arguments.length<2&&(n=e,e=void 0),new Ue(n=n||"expect.fail()",{actual:e,expected:t,operator:r},Sr.fail)};var Ar={};function Mr(){function e(){return this instanceof String||this instanceof Number||this instanceof Boolean||"function"==typeof Symbol&&this instanceof Symbol||"function"==typeof BigInt&&this instanceof BigInt?new wn(this.valueOf(),null,e):new wn(this,null,e)}function t(e){Object.defineProperty(this,"should",{value:e,enumerable:!0,configurable:!0,writable:!0})}Ae(e,"shouldGetter"),Ae(t,"shouldSetter"),Object.defineProperty(Object.prototype,"should",{set:t,get:e,configurable:!0});var n={fail:function(e,t,r,o){throw arguments.length<2&&(r=e,e=void 0),new Ue(r=r||"should.fail()",{actual:e,expected:t,operator:o},n.fail)},equal:function(e,t,n){new wn(e,n).to.equal(t)},Throw:function(e,t,n,r){new wn(e,r).to.Throw(t,n)},exist:function(e,t){new wn(e,t).to.exist},not:{}};return n.not.equal=function(e,t,n){new wn(e,n).to.not.equal(t)},n.not.Throw=function(e,t,n,r){new wn(e,r).to.not.Throw(t,n)},n.not.exist=function(e,t){new wn(e,t).to.not.exist},n.throw=n.Throw,n.not.throw=n.not.Throw,n}Me(Ar,{Should:()=>Nr,should:()=>jr}),Ae(Mr,"loadShould");var jr=Mr,Nr=Mr;function Tr(e,t){new wn(null,null,Tr,!0).assert(e,t,"[ negation message unavailable ]")}Ae(Tr,"assert"),Tr.fail=function(e,t,n,r){throw arguments.length<2&&(n=e,e=void 0),new Ue(n=n||"assert.fail()",{actual:e,expected:t,operator:r},Tr.fail)},Tr.isOk=function(e,t){new wn(e,t,Tr.isOk,!0).is.ok},Tr.isNotOk=function(e,t){new wn(e,t,Tr.isNotOk,!0).is.not.ok},Tr.equal=function(e,t,n){var r=new wn(e,n,Tr.equal,!0);r.assert(t==ze(r,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",t,e,!0)},Tr.notEqual=function(e,t,n){var r=new wn(e,n,Tr.notEqual,!0);r.assert(t!=ze(r,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",t,e,!0)},Tr.strictEqual=function(e,t,n){new wn(e,n,Tr.strictEqual,!0).to.equal(t)},Tr.notStrictEqual=function(e,t,n){new wn(e,n,Tr.notStrictEqual,!0).to.not.equal(t)},Tr.deepEqual=Tr.deepStrictEqual=function(e,t,n){new wn(e,n,Tr.deepEqual,!0).to.eql(t)},Tr.notDeepEqual=function(e,t,n){new wn(e,n,Tr.notDeepEqual,!0).to.not.eql(t)},Tr.isAbove=function(e,t,n){new wn(e,n,Tr.isAbove,!0).to.be.above(t)},Tr.isAtLeast=function(e,t,n){new wn(e,n,Tr.isAtLeast,!0).to.be.least(t)},Tr.isBelow=function(e,t,n){new wn(e,n,Tr.isBelow,!0).to.be.below(t)},Tr.isAtMost=function(e,t,n){new wn(e,n,Tr.isAtMost,!0).to.be.most(t)},Tr.isTrue=function(e,t){new wn(e,t,Tr.isTrue,!0).is.true},Tr.isNotTrue=function(e,t){new wn(e,t,Tr.isNotTrue,!0).to.not.equal(!0)},Tr.isFalse=function(e,t){new wn(e,t,Tr.isFalse,!0).is.false},Tr.isNotFalse=function(e,t){new wn(e,t,Tr.isNotFalse,!0).to.not.equal(!1)},Tr.isNull=function(e,t){new wn(e,t,Tr.isNull,!0).to.equal(null)},Tr.isNotNull=function(e,t){new wn(e,t,Tr.isNotNull,!0).to.not.equal(null)},Tr.isNaN=function(e,t){new wn(e,t,Tr.isNaN,!0).to.be.NaN},Tr.isNotNaN=function(e,t){new wn(e,t,Tr.isNotNaN,!0).not.to.be.NaN},Tr.exists=function(e,t){new wn(e,t,Tr.exists,!0).to.exist},Tr.notExists=function(e,t){new wn(e,t,Tr.notExists,!0).to.not.exist},Tr.isUndefined=function(e,t){new wn(e,t,Tr.isUndefined,!0).to.equal(void 0)},Tr.isDefined=function(e,t){new wn(e,t,Tr.isDefined,!0).to.not.equal(void 0)},Tr.isCallable=function(e,t){new wn(e,t,Tr.isCallable,!0).is.callable},Tr.isNotCallable=function(e,t){new wn(e,t,Tr.isNotCallable,!0).is.not.callable},Tr.isObject=function(e,t){new wn(e,t,Tr.isObject,!0).to.be.a("object")},Tr.isNotObject=function(e,t){new wn(e,t,Tr.isNotObject,!0).to.not.be.a("object")},Tr.isArray=function(e,t){new wn(e,t,Tr.isArray,!0).to.be.an("array")},Tr.isNotArray=function(e,t){new wn(e,t,Tr.isNotArray,!0).to.not.be.an("array")},Tr.isString=function(e,t){new wn(e,t,Tr.isString,!0).to.be.a("string")},Tr.isNotString=function(e,t){new wn(e,t,Tr.isNotString,!0).to.not.be.a("string")},Tr.isNumber=function(e,t){new wn(e,t,Tr.isNumber,!0).to.be.a("number")},Tr.isNotNumber=function(e,t){new wn(e,t,Tr.isNotNumber,!0).to.not.be.a("number")},Tr.isFinite=function(e,t){new wn(e,t,Tr.isFinite,!0).to.be.finite},Tr.isBoolean=function(e,t){new wn(e,t,Tr.isBoolean,!0).to.be.a("boolean")},Tr.isNotBoolean=function(e,t){new wn(e,t,Tr.isNotBoolean,!0).to.not.be.a("boolean")},Tr.typeOf=function(e,t,n){new wn(e,n,Tr.typeOf,!0).to.be.a(t)},Tr.notTypeOf=function(e,t,n){new wn(e,n,Tr.notTypeOf,!0).to.not.be.a(t)},Tr.instanceOf=function(e,t,n){new wn(e,n,Tr.instanceOf,!0).to.be.instanceOf(t)},Tr.notInstanceOf=function(e,t,n){new wn(e,n,Tr.notInstanceOf,!0).to.not.be.instanceOf(t)},Tr.include=function(e,t,n){new wn(e,n,Tr.include,!0).include(t)},Tr.notInclude=function(e,t,n){new wn(e,n,Tr.notInclude,!0).not.include(t)},Tr.deepInclude=function(e,t,n){new wn(e,n,Tr.deepInclude,!0).deep.include(t)},Tr.notDeepInclude=function(e,t,n){new wn(e,n,Tr.notDeepInclude,!0).not.deep.include(t)},Tr.nestedInclude=function(e,t,n){new wn(e,n,Tr.nestedInclude,!0).nested.include(t)},Tr.notNestedInclude=function(e,t,n){new wn(e,n,Tr.notNestedInclude,!0).not.nested.include(t)},Tr.deepNestedInclude=function(e,t,n){new wn(e,n,Tr.deepNestedInclude,!0).deep.nested.include(t)},Tr.notDeepNestedInclude=function(e,t,n){new wn(e,n,Tr.notDeepNestedInclude,!0).not.deep.nested.include(t)},Tr.ownInclude=function(e,t,n){new wn(e,n,Tr.ownInclude,!0).own.include(t)},Tr.notOwnInclude=function(e,t,n){new wn(e,n,Tr.notOwnInclude,!0).not.own.include(t)},Tr.deepOwnInclude=function(e,t,n){new wn(e,n,Tr.deepOwnInclude,!0).deep.own.include(t)},Tr.notDeepOwnInclude=function(e,t,n){new wn(e,n,Tr.notDeepOwnInclude,!0).not.deep.own.include(t)},Tr.match=function(e,t,n){new wn(e,n,Tr.match,!0).to.match(t)},Tr.notMatch=function(e,t,n){new wn(e,n,Tr.notMatch,!0).to.not.match(t)},Tr.property=function(e,t,n){new wn(e,n,Tr.property,!0).to.have.property(t)},Tr.notProperty=function(e,t,n){new wn(e,n,Tr.notProperty,!0).to.not.have.property(t)},Tr.propertyVal=function(e,t,n,r){new wn(e,r,Tr.propertyVal,!0).to.have.property(t,n)},Tr.notPropertyVal=function(e,t,n,r){new wn(e,r,Tr.notPropertyVal,!0).to.not.have.property(t,n)},Tr.deepPropertyVal=function(e,t,n,r){new wn(e,r,Tr.deepPropertyVal,!0).to.have.deep.property(t,n)},Tr.notDeepPropertyVal=function(e,t,n,r){new wn(e,r,Tr.notDeepPropertyVal,!0).to.not.have.deep.property(t,n)},Tr.ownProperty=function(e,t,n){new wn(e,n,Tr.ownProperty,!0).to.have.own.property(t)},Tr.notOwnProperty=function(e,t,n){new wn(e,n,Tr.notOwnProperty,!0).to.not.have.own.property(t)},Tr.ownPropertyVal=function(e,t,n,r){new wn(e,r,Tr.ownPropertyVal,!0).to.have.own.property(t,n)},Tr.notOwnPropertyVal=function(e,t,n,r){new wn(e,r,Tr.notOwnPropertyVal,!0).to.not.have.own.property(t,n)},Tr.deepOwnPropertyVal=function(e,t,n,r){new wn(e,r,Tr.deepOwnPropertyVal,!0).to.have.deep.own.property(t,n)},Tr.notDeepOwnPropertyVal=function(e,t,n,r){new wn(e,r,Tr.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(t,n)},Tr.nestedProperty=function(e,t,n){new wn(e,n,Tr.nestedProperty,!0).to.have.nested.property(t)},Tr.notNestedProperty=function(e,t,n){new wn(e,n,Tr.notNestedProperty,!0).to.not.have.nested.property(t)},Tr.nestedPropertyVal=function(e,t,n,r){new wn(e,r,Tr.nestedPropertyVal,!0).to.have.nested.property(t,n)},Tr.notNestedPropertyVal=function(e,t,n,r){new wn(e,r,Tr.notNestedPropertyVal,!0).to.not.have.nested.property(t,n)},Tr.deepNestedPropertyVal=function(e,t,n,r){new wn(e,r,Tr.deepNestedPropertyVal,!0).to.have.deep.nested.property(t,n)},Tr.notDeepNestedPropertyVal=function(e,t,n,r){new wn(e,r,Tr.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(t,n)},Tr.lengthOf=function(e,t,n){new wn(e,n,Tr.lengthOf,!0).to.have.lengthOf(t)},Tr.hasAnyKeys=function(e,t,n){new wn(e,n,Tr.hasAnyKeys,!0).to.have.any.keys(t)},Tr.hasAllKeys=function(e,t,n){new wn(e,n,Tr.hasAllKeys,!0).to.have.all.keys(t)},Tr.containsAllKeys=function(e,t,n){new wn(e,n,Tr.containsAllKeys,!0).to.contain.all.keys(t)},Tr.doesNotHaveAnyKeys=function(e,t,n){new wn(e,n,Tr.doesNotHaveAnyKeys,!0).to.not.have.any.keys(t)},Tr.doesNotHaveAllKeys=function(e,t,n){new wn(e,n,Tr.doesNotHaveAllKeys,!0).to.not.have.all.keys(t)},Tr.hasAnyDeepKeys=function(e,t,n){new wn(e,n,Tr.hasAnyDeepKeys,!0).to.have.any.deep.keys(t)},Tr.hasAllDeepKeys=function(e,t,n){new wn(e,n,Tr.hasAllDeepKeys,!0).to.have.all.deep.keys(t)},Tr.containsAllDeepKeys=function(e,t,n){new wn(e,n,Tr.containsAllDeepKeys,!0).to.contain.all.deep.keys(t)},Tr.doesNotHaveAnyDeepKeys=function(e,t,n){new wn(e,n,Tr.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(t)},Tr.doesNotHaveAllDeepKeys=function(e,t,n){new wn(e,n,Tr.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(t)},Tr.throws=function(e,t,n,r){return("string"==typeof t||t instanceof RegExp)&&(n=t,t=null),ze(new wn(e,r,Tr.throws,!0).to.throw(t,n),"object")},Tr.doesNotThrow=function(e,t,n,r){("string"==typeof t||t instanceof RegExp)&&(n=t,t=null),new wn(e,r,Tr.doesNotThrow,!0).to.not.throw(t,n)},Tr.operator=function(e,t,n,r){var o;switch(t){case"==":o=e==n;break;case"===":o=e===n;break;case">":o=e>n;break;case">=":o=e>=n;break;case"<":o=e>18&63]+t[i>>12&63]+t[i>>6&63]+t[63&i]);return s.join("")}function a(e){var n;o||i();for(var r=e.length,a=r%3,c="",u=[],h=16383,f=0,l=r-a;fl?l:f+h));return 1===a?(n=e[r-1],c+=t[n>>2],c+=t[n<<4&63],c+="=="):2===a&&(n=(e[r-2]<<8)+e[r-1],c+=t[n>>10],c+=t[n>>4&63],c+=t[n<<2&63],c+="="),u.push(c),u.join("")}function c(e,t,n,r,o){var i,s,a=8*o-r-1,c=(1<>1,h=-7,f=n?o-1:0,l=n?-1:1,p=e[t+f];for(f+=l,i=p&(1<<-h)-1,p>>=-h,h+=a;h>0;i=256*i+e[t+f],f+=l,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=r;h>0;s=256*s+e[t+f],f+=l,h-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),i-=u}return(p?-1:1)*s*Math.pow(2,i-r)}function u(e,t,n,r,o,i){var s,a,c,u=8*i-o-1,h=(1<>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+f>=1?l/c:l*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(t*c-1)*Math.pow(2,o),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[n+p]=255&a,p+=d,a/=256,o-=8);for(s=s<0;e[n+p]=255&s,p+=d,s/=256,u-=8);e[n+p-d]|=128*g}var h={}.toString,f=Array.isArray||function(e){return"[object Array]"==h.call(e)};function l(){return d.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function p(e,t){if(l()=l())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l().toString(16)+" bytes");return 0|e}function v(e){return!(null==e||!e._isBuffer)}function x(e,t){if(v(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function O(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return _(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return B(this,t,n);case"base64":return D(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function E(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function P(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=d.from(t,r)),v(t))return 0===t.length?-1:S(e,t,n,r,o);if("number"==typeof t)return t&=255,d.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):S(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function S(e,t,n,r,o){var i,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var h=-1;for(i=n;ia&&(n=a-c),i=n;i>=0;i--){for(var f=!0,l=0;lo&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function D(e,t,n){return 0===t&&n===e.length?a(e):a(e.slice(t,n))}function _(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:u>223?3:u>191?2:1;if(o+f<=n)switch(f){case 1:u<128&&(h=u);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&u)<<6|63&i)>127&&(h=c);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(c=(15&u)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(h=c)}null===h?(h=65533,f=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),o+=f}return function(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},d.prototype.compare=function(e,t,n,r,o){if(!v(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(i,s),c=this.slice(r,o),u=e.slice(t,n),h=0;ho)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return A(this,e,t,n);case"utf8":case"utf-8":return M(this,e,t,n);case"ascii":return j(this,e,t,n);case"latin1":case"binary":return N(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function q(e,t,n,r,o,i){if(!v(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function U(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function F(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Y(e,t,n,r,o){return o||F(e,0,n,4),u(e,t,n,r,23,4),n+4}function V(e,t,n,r,o){return o||F(e,0,n,8),u(e,t,n,r,52,8),n+8}d.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},d.prototype.readUInt8=function(e,t){return t||z(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return t||z(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return t||z(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return t||z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUInt32BE=function(e,t){return t||z(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||z(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},d.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||z(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},d.prototype.readInt8=function(e,t){return t||z(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){t||z(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},d.prototype.readInt16BE=function(e,t){t||z(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},d.prototype.readInt32LE=function(e,t){return t||z(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return t||z(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return t||z(e,4,this.length),c(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return t||z(e,4,this.length),c(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return t||z(e,8,this.length),c(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return t||z(e,8,this.length),c(this,e,!1,52,8)},d.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||q(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},d.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,1,255,0),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},d.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},d.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},d.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):U(this,e,t,!0),t+4},d.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},d.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);q(this,e,t,n,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i>0)-a&255;return t+n},d.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);q(this,e,t,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},d.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,1,127,-128),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},d.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},d.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},d.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,4,2147483647,-2147483648),d.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):U(this,e,t,!0),t+4},d.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||q(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},d.prototype.writeFloatLE=function(e,t,n){return Y(this,e,t,!0,n)},d.prototype.writeFloatBE=function(e,t,n){return Y(this,e,t,!1,n)},d.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},d.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},d.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!d.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function W(e){return function(e){var t,s,a,c,u,h;o||i();var f=e.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");u="="===e[f-2]?2:"="===e[f-1]?1:0,h=new r(3*f/4-u),a=u>0?f-4:f;var l=0;for(t=0,s=0;t>16&255,h[l++]=c>>8&255,h[l++]=255&c;return 2===u?(c=n[e.charCodeAt(t)]<<2|n[e.charCodeAt(t+1)]>>4,h[l++]=255&c):1===u&&(c=n[e.charCodeAt(t)]<<10|n[e.charCodeAt(t+1)]<<4|n[e.charCodeAt(t+2)]>>2,h[l++]=c>>8&255,h[l++]=255&c),h}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function J(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function Q(){throw new Error("setTimeout has not been defined")}function X(){throw new Error("clearTimeout has not been defined")}var ee=Q,te=X;function ne(e){if(ee===setTimeout)return setTimeout(e,0);if((ee===Q||!ee)&&setTimeout)return ee=setTimeout,setTimeout(e,0);try{return ee(e,0)}catch(t){try{return ee.call(null,e,0)}catch(t){return ee.call(this,e,0)}}}"function"==typeof e.setTimeout&&(ee=setTimeout),"function"==typeof e.clearTimeout&&(te=clearTimeout);var re,oe=[],ie=!1,se=-1;function ae(){ie&&re&&(ie=!1,re.length?oe=re.concat(oe):se=-1,oe.length&&ce())}function ce(){if(!ie){var e=ne(ae);ie=!0;for(var t=oe.length;t;){for(re=oe,oe=[];++se1)for(var n=1;nPe(e,"name",{value:t,configurable:!0}),Me=(e,t)=>{for(var n in t)Pe(e,n,{get:t[n],enumerable:!0})},je=(xe={"(disabled):util"(){}},function(){return Oe||(0,xe[Se(xe)[0]])((Oe={exports:{}}).exports,Oe),Oe.exports}),Ne={};Me(Ne,{addChainableMethod:()=>Rn,addLengthGuard:()=>Pn,addMethod:()=>Nn,addProperty:()=>On,checkError:()=>Te,compareByInspect:()=>zn,eql:()=>Jt,expectTypes:()=>Fe,flag:()=>$e,getActual:()=>Ye,getMessage:()=>Yt,getName:()=>Kn,getOperator:()=>Vn,getOwnEnumerableProperties:()=>Ln,getOwnEnumerablePropertySymbols:()=>qn,getPathInfo:()=>mn,hasProperty:()=>yn,inspect:()=>Ut,isNaN:()=>Fn,isNumeric:()=>Gn,isProxyEnabled:()=>xn,isRegExp:()=>Hn,objDisplay:()=>Ft,overwriteChainableMethod:()=>$n,overwriteMethod:()=>kn,overwriteProperty:()=>Tn,proxify:()=>Mn,test:()=>ze,transferFlags:()=>Vt,type:()=>qe});var Te={};function ke(e){return e instanceof Error||"[object Error]"===Object.prototype.toString.call(e)}function De(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function _e(e,t){return ke(t)&&e===t}function Ie(e,t){return ke(t)?e.constructor===t.constructor||e instanceof t.constructor:!("object"!=typeof t&&"function"!=typeof t||!t.prototype)&&(e.constructor===t||e instanceof t)}function Ce(e,t){const n="string"==typeof e?e:e.message;return De(t)?t.test(n):"string"==typeof t&&-1!==n.indexOf(t)}function Be(e){let t=e;if(ke(e))t=e.constructor.name;else if("function"==typeof e&&(t=e.name,""===t)){t=(new e).name||t}return t}function Re(e){let t="";return e&&e.message?t=e.message:"string"==typeof e&&(t=e),t}function $e(e,t,n){var r=e.__flags||(e.__flags=Object.create(null));if(3!==arguments.length)return r[t];r[t]=n}function ze(e,t){var n=$e(e,"negate"),r=t[0];return n?!r:r}function qe(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=e[Symbol.toStringTag];if("string"==typeof t)return t;return Object.prototype.toString.call(e).slice(8,-1)}Me(Te,{compatibleConstructor:()=>Ie,compatibleInstance:()=>_e,compatibleMessage:()=>Ce,getConstructorName:()=>Be,getMessage:()=>Re}),Ae(ke,"isErrorInstance"),Ae(De,"isRegExp"),Ae(_e,"compatibleInstance"),Ae(Ie,"compatibleConstructor"),Ae(Ce,"compatibleMessage"),Ae(Be,"getConstructorName"),Ae(Re,"getMessage"),Ae($e,"flag"),Ae(ze,"test"),Ae(qe,"type");var Le="captureStackTrace"in Error,Ue=class e extends Error{static{Ae(this,"AssertionError")}message;get name(){return"AssertionError"}get ok(){return!1}constructor(t="Unspecified AssertionError",n,r){super(t),this.message=t,Le&&Error.captureStackTrace(this,r||e);for(const e in n)e in this||(this[e]=n[e])}toJSON(e){return{...this,name:this.name,message:this.message,ok:!1,stack:!1!==e?this.stack:void 0}}};function Fe(e,t){var n=$e(e,"message"),r=$e(e,"ssfi");n=n?n+": ":"",e=$e(e,"object"),(t=t.map((function(e){return e.toLowerCase()}))).sort();var o=t.map((function(e,n){var r=~["a","e","i","o","u"].indexOf(e.charAt(0))?"an":"a";return(t.length>1&&n===t.length-1?"or ":"")+r+" "+e})).join(", "),i=qe(e).toLowerCase();if(!t.some((function(e){return i===e})))throw new Ue(n+"object tested must be "+o+", but "+i+" given",void 0,r)}function Ye(e,t){return t.length>4?t[4]:e._obj}Ae(Fe,"expectTypes"),Ae(Ye,"getActual");var Ve={bold:["1","22"],dim:["2","22"],italic:["3","23"],underline:["4","24"],inverse:["7","27"],hidden:["8","28"],strike:["9","29"],black:["30","39"],red:["31","39"],green:["32","39"],yellow:["33","39"],blue:["34","39"],magenta:["35","39"],cyan:["36","39"],white:["37","39"],brightblack:["30;1","39"],brightred:["31;1","39"],brightgreen:["32;1","39"],brightyellow:["33;1","39"],brightblue:["34;1","39"],brightmagenta:["35;1","39"],brightcyan:["36;1","39"],brightwhite:["37;1","39"],grey:["90","39"]},Ke={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},He="…";function Ge(e,t){const n=Ve[Ke[t]]||Ve[t]||"";return n?`[${n[0]}m${String(e)}[${n[1]}m`:String(e)}function We({showHidden:e=!1,depth:t=2,colors:n=!1,customInspect:r=!0,showProxy:o=!1,maxArrayLength:i=1/0,breakLength:s=1/0,seen:a=[],truncate:c=1/0,stylize:u=String}={},h){const f={showHidden:Boolean(e),depth:Number(t),colors:Boolean(n),customInspect:Boolean(r),showProxy:Boolean(o),maxArrayLength:Number(i),breakLength:Number(s),truncate:Number(c),seen:a,inspect:h,stylize:u};return f.colors&&(f.stylize=Ge),f}function Ze(e){return e>="\ud800"&&e<="\udbff"}function Je(e,t,n=He){e=String(e);const r=n.length,o=e.length;if(r>t&&o>r)return n;if(o>t&&o>r){let o=t-r;return o>0&&Ze(e[o-1])&&(o-=1),`${e.slice(0,o)}${n}`}return e}function Qe(e,t,n,r=", "){n=n||t.inspect;const o=e.length;if(0===o)return"";const i=t.truncate;let s="",a="",c="";for(let u=0;ui&&s.length+c.length<=i)break;if(!o&&!h&&d>i)break;if(a=o?"":n(e[u+1],t)+(h?"":r),!o&&h&&d>i&&p+a.length>i)break;if(s+=l,!o&&!h&&p+a.length>=i){c=`${He}(${e.length-u-1})`;break}c=""}return`${s}${c}`}function Xe(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}function et([e,t],n){return n.truncate-=2,"string"==typeof e?e=Xe(e):"number"!=typeof e&&(e=`[${n.inspect(e,n)}]`),n.truncate-=e.length,`${e}: ${t=n.inspect(t,n)}`}function tt(e,t){const n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return"[]";t.truncate-=4;const r=Qe(e,t);t.truncate-=r.length;let o="";return n.length&&(o=Qe(n.map((t=>[t,e[t]])),t,et)),`[ ${r}${o?`, ${o}`:""} ]`}Ae(Ge,"colorise"),Ae(We,"normaliseOptions"),Ae(Ze,"isHighSurrogate"),Ae(Je,"truncate"),Ae(Qe,"inspectList"),Ae(Xe,"quoteComplexKey"),Ae(et,"inspectProperty"),Ae(tt,"inspectArray");var nt=Ae((e=>e instanceof d?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name),"getArrayName");function rt(e,t){const n=nt(e);t.truncate-=n.length+4;const r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return`${n}[]`;let o="";for(let n=0;n[t,e[t]])),t,et)),`${n}[ ${o}${i?`, ${i}`:""} ]`}function ot(e,t){const n=e.toJSON();if(null===n)return"Invalid Date";const r=n.split("T"),o=r[0];return t.stylize(`${o}T${Je(r[1],t.truncate-o.length-1)}`,"date")}function it(e,t){const n=e[Symbol.toStringTag]||"Function",r=e.name;return r?t.stylize(`[${n} ${Je(r,t.truncate-11)}]`,"special"):t.stylize(`[${n}]`,"special")}function st([e,t],n){return n.truncate-=4,e=n.inspect(e,n),n.truncate-=e.length,`${e} => ${t=n.inspect(t,n)}`}function at(e){const t=[];return e.forEach(((e,n)=>{t.push([n,e])})),t}function ct(e,t){return e.size-1<=0?"Map{}":(t.truncate-=7,`Map{ ${Qe(at(e),t,st)} }`)}Ae(rt,"inspectTypedArray"),Ae(ot,"inspectDate"),Ae(it,"inspectFunction"),Ae(st,"inspectMapEntry"),Ae(at,"mapToEntries"),Ae(ct,"inspectMap");var ut=Number.isNaN||(e=>e!=e);function ht(e,t){return ut(e)?t.stylize("NaN","number"):e===1/0?t.stylize("Infinity","number"):e===-1/0?t.stylize("-Infinity","number"):0===e?t.stylize(1/e==1/0?"+0":"-0","number"):t.stylize(Je(String(e),t.truncate),"number")}function ft(e,t){let n=Je(e.toString(),t.truncate-1);return n!==He&&(n+="n"),t.stylize(n,"bigint")}function lt(e,t){const n=e.toString().split("/")[2],r=t.truncate-(2+n.length),o=e.source;return t.stylize(`/${Je(o,r)}/${n}`,"regexp")}function pt(e){const t=[];return e.forEach((e=>{t.push(e)})),t}function dt(e,t){return 0===e.size?"Set{}":(t.truncate-=7,`Set{ ${Qe(pt(e),t)} }`)}Ae(ht,"inspectNumber"),Ae(ft,"inspectBigInt"),Ae(lt,"inspectRegExp"),Ae(pt,"arrayFromSet"),Ae(dt,"inspectSet");var gt=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),yt={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},bt=16,wt=4;function mt(e){return yt[e]||`\\u${`0000${e.charCodeAt(0).toString(bt)}`.slice(-wt)}`}function vt(e,t){return gt.test(e)&&(e=e.replace(gt,mt)),t.stylize(`'${Je(e,t.truncate-2)}'`,"string")}function xt(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}Ae(mt,"escape"),Ae(vt,"inspectString"),Ae(xt,"inspectSymbol");var Ot=Ae((()=>"Promise{…}"),"getPromiseValue");try{const{getPromiseDetails:e,kPending:t,kRejected:n}=Ee.binding("util");Array.isArray(e(Promise.resolve()))&&(Ot=Ae(((r,o)=>{const[i,s]=e(r);return i===t?"Promise{}":`Promise${i===n?"!":""}{${o.inspect(s,o)}}`}),"getPromiseValue"))}catch(e){}var Et=Ot;function Pt(e,t){const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(0===n.length&&0===r.length)return"{}";if(t.truncate-=4,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const o=Qe(n.map((t=>[t,e[t]])),t,et),i=Qe(r.map((t=>[t,e[t]])),t,et);t.seen.pop();let s="";return o&&i&&(s=", "),`{ ${o}${s}${i} }`}Ae(Pt,"inspectObject");var St=!("undefined"==typeof Symbol||!Symbol.toStringTag)&&Symbol.toStringTag;function At(e,t){let n="";return St&&St in e&&(n=e[St]),n=n||e.constructor.name,n&&"_class"!==n||(n=""),t.truncate-=n.length,`${n}${Pt(e,t)}`}function Mt(e,t){return 0===e.length?"Arguments[]":(t.truncate-=13,`Arguments[ ${Qe(e,t)} ]`)}Ae(At,"inspectClass"),Ae(Mt,"inspectArguments");var jt=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function Nt(e,t){const n=Object.getOwnPropertyNames(e).filter((e=>-1===jt.indexOf(e))),r=e.name;t.truncate-=r.length;let o="";if("string"==typeof e.message?o=Je(e.message,t.truncate):n.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const i=Qe(n.map((t=>[t,e[t]])),t,et);return`${r}${o}${i?` { ${i} }`:""}`}function Tt([e,t],n){return n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:`${n.stylize(String(e),"yellow")}`}function kt(e,t){return Qe(e,t,Dt,"\n")}function Dt(e,t){const n=e.getAttributeNames(),r=e.tagName.toLowerCase(),o=t.stylize(`<${r}`,"special"),i=t.stylize(">","special"),s=t.stylize(``,"special");t.truncate-=2*r.length+5;let a="";n.length>0&&(a+=" ",a+=Qe(n.map((t=>[t,e.getAttribute(t)])),t,Tt," ")),t.truncate-=a.length;const c=t.truncate;let u=kt(e.children,t);return u&&u.length>c&&(u=`${He}(${e.children.length})`),`${o}${a}${i}${u}${s}`}Ae(Nt,"inspectObject"),Ae(Tt,"inspectAttribute"),Ae(kt,"inspectHTMLCollection"),Ae(Dt,"inspectHTML");var _t="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("chai/inspect"):"@@chai/inspect",It=!1;try{const e=je();It=!!e.inspect&&e.inspect.custom}catch(e){It=!1}var Ct=new WeakMap,Bt={},Rt={undefined:(e,t)=>t.stylize("undefined","undefined"),null:(e,t)=>t.stylize("null","null"),boolean:(e,t)=>t.stylize(String(e),"boolean"),Boolean:(e,t)=>t.stylize(String(e),"boolean"),number:ht,Number:ht,bigint:ft,BigInt:ft,string:vt,String:vt,function:it,Function:it,symbol:xt,Symbol:xt,Array:tt,Date:ot,Map:ct,Set:dt,RegExp:lt,Promise:Et,WeakSet:(e,t)=>t.stylize("WeakSet{…}","special"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),Arguments:Mt,Int8Array:rt,Uint8Array:rt,Uint8ClampedArray:rt,Int16Array:rt,Uint16Array:rt,Int32Array:rt,Uint32Array:rt,Float32Array:rt,Float64Array:rt,Generator:()=>"",DataView:()=>"",ArrayBuffer:()=>"",Error:Nt,HTMLCollection:kt,NodeList:kt},$t=Ae(((e,t,n)=>_t in e&&"function"==typeof e[_t]?e[_t](t):It&&It in e&&"function"==typeof e[It]?e[It](t.depth,t):"inspect"in e&&"function"==typeof e.inspect?e.inspect(t.depth,t):"constructor"in e&&Ct.has(e.constructor)?Ct.get(e.constructor)(e,t):Bt[n]?Bt[n](e,t):""),"inspectCustom"),zt=Object.prototype.toString;function qt(e,t={}){const n=We(t,qt),{customInspect:r}=n;let o=null===e?"null":typeof e;if("object"===o&&(o=zt.call(e).slice(8,-1)),o in Rt)return Rt[o](e,n);if(r&&e){const t=$t(e,n,o);if(t)return"string"==typeof t?t:qt(t,n)}const i=!!e&&Object.getPrototypeOf(e);return i===Object.prototype||null===i?Pt(e,n):e&&"function"==typeof HTMLElement&&e instanceof HTMLElement?Dt(e,n):"constructor"in e?e.constructor!==Object?At(e,n):Pt(e,n):e===Object(e)?Pt(e,n):n.stylize(String(e),o)}Ae(qt,"inspect");var Lt={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function Ut(e,t,n,r){return qt(e,{colors:r,depth:void 0===n?2:n,showHidden:t,truncate:Lt.truncateThreshold?Lt.truncateThreshold:1/0})}function Ft(e){var t=Ut(e),n=Object.prototype.toString.call(e);if(Lt.truncateThreshold&&t.length>=Lt.truncateThreshold){if("[object Function]"===n)return e.name&&""!==e.name?"[Function: "+e.name+"]":"[Function]";if("[object Array]"===n)return"[ Array("+e.length+") ]";if("[object Object]"===n){var r=Object.keys(e);return"{ Object ("+(r.length>2?r.splice(0,2).join(", ")+", ...":r.join(", "))+") }"}return t}return t}function Yt(e,t){var n=$e(e,"negate"),r=$e(e,"object"),o=t[3],i=Ye(e,t),s=n?t[2]:t[1],a=$e(e,"message");return"function"==typeof s&&(s=s()),s=(s=s||"").replace(/#\{this\}/g,(function(){return Ft(r)})).replace(/#\{act\}/g,(function(){return Ft(i)})).replace(/#\{exp\}/g,(function(){return Ft(o)})),a?a+": "+s:s}function Vt(e,t,n){var r=e.__flags||(e.__flags=Object.create(null));for(var o in t.__flags||(t.__flags=Object.create(null)),n=3!==arguments.length||n,r)(n||"object"!==o&&"ssfi"!==o&&"lockSsfi"!==o&&"message"!=o)&&(t.__flags[o]=r[o])}function Kt(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=e[Symbol.toStringTag];if("string"==typeof t)return t;return Object.prototype.toString.call(e).slice(8,-1)}function Ht(){this._key="chai/deep-eql__"+Math.random()+Date.now()}Ae(Ut,"inspect"),Ae(Ft,"objDisplay"),Ae(Yt,"getMessage"),Ae(Vt,"transferFlags"),Ae(Kt,"type"),Ae(Ht,"FakeMap"),Ht.prototype={get:Ae((function(e){return e[this._key]}),"get"),set:Ae((function(e,t){Object.isExtensible(e)&&Object.defineProperty(e,this._key,{value:t,configurable:!0})}),"set")};var Gt="function"==typeof WeakMap?WeakMap:Ht;function Wt(e,t,n){if(!n||dn(e)||dn(t))return null;var r=n.get(e);if(r){var o=r.get(t);if("boolean"==typeof o)return o}return null}function Zt(e,t,n,r){if(n&&!dn(e)&&!dn(t)){var o=n.get(e);o?o.set(t,r):((o=new Gt).set(t,r),n.set(e,o))}}Ae(Wt,"memoizeCompare"),Ae(Zt,"memoizeSet");var Jt=Qt;function Qt(e,t,n){if(n&&n.comparator)return en(e,t,n);var r=Xt(e,t);return null!==r?r:en(e,t,n)}function Xt(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t||!dn(e)&&!dn(t)&&null}function en(e,t,n){(n=n||{}).memoize=!1!==n.memoize&&(n.memoize||new Gt);var r=n&&n.comparator,o=Wt(e,t,n.memoize);if(null!==o)return o;var i=Wt(t,e,n.memoize);if(null!==i)return i;if(r){var s=r(e,t);if(!1===s||!0===s)return Zt(e,t,n.memoize,s),s;var a=Xt(e,t);if(null!==a)return a}var c=Kt(e);if(c!==Kt(t))return Zt(e,t,n.memoize,!1),!1;Zt(e,t,n.memoize,!0);var u=tn(e,t,c,n);return Zt(e,t,n.memoize,u),u}function tn(e,t,n,r){switch(n){case"String":case"Number":case"Boolean":case"Date":return Qt(e.valueOf(),t.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return e===t;case"Error":return ln(e,t,["name","message","code"],r);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return on(e,t,r);case"RegExp":return nn(e,t);case"Generator":return sn(e,t,r);case"DataView":return on(new Uint8Array(e.buffer),new Uint8Array(t.buffer),r);case"ArrayBuffer":return on(new Uint8Array(e),new Uint8Array(t),r);case"Set":case"Map":return rn(e,t,r);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return e.equals(t);case"Temporal.Duration":return e.total("nanoseconds")===t.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return e.toString()===t.toString();default:return pn(e,t,r)}}function nn(e,t){return e.toString()===t.toString()}function rn(e,t,n){try{if(e.size!==t.size)return!1;if(0===e.size)return!0}catch(e){return!1}var r=[],o=[];return e.forEach(Ae((function(e,t){r.push([e,t])}),"gatherEntries")),t.forEach(Ae((function(e,t){o.push([e,t])}),"gatherEntries")),on(r.sort(),o.sort(),n)}function on(e,t,n){var r=e.length;if(r!==t.length)return!1;if(0===r)return!0;for(var o=-1;++o{if("constructor"===e||"__proto__"===e||"prototype"===e)return{};const t=/^\[(\d+)\]$/.exec(e);let n=null;return n=t?{i:parseFloat(t[1])}:{p:e.replace(/\\([.[\]])/g,"$1")},n}))}function wn(e,t,n){let r=e,o=null;n=void 0===n?t.length:n;for(let e=0;e1?wn(e,n,n.length-1):e,name:r.p||r.i,value:wn(e,n)};return o.exists=yn(o.parent,o.name),o}function vn(e,t,n,r){return $e(this,"ssfi",n||vn),$e(this,"lockSsfi",r),$e(this,"object",e),$e(this,"message",t),$e(this,"eql",Lt.deepEqual||Jt),Mn(this)}function xn(){return Lt.useProxy&&"undefined"!=typeof Proxy&&"undefined"!=typeof Reflect}function On(e,t,n){n=void 0===n?function(){}:n,Object.defineProperty(e,t,{get:Ae((function e(){xn()||$e(this,"lockSsfi")||$e(this,"ssfi",e);var t=n.call(this);if(void 0!==t)return t;var r=new vn;return Vt(this,r),r}),"propertyGetter"),configurable:!0})}Ae(Qt,"deepEqual"),Ae(Xt,"simpleEqual"),Ae(en,"extensiveDeepEqual"),Ae(tn,"extensiveDeepEqualByType"),Ae(nn,"regexpEqual"),Ae(rn,"entriesEqual"),Ae(on,"iterableEqual"),Ae(sn,"generatorEqual"),Ae(an,"hasIteratorFunction"),Ae(cn,"getIteratorEntries"),Ae(un,"getGeneratorEntries"),Ae(hn,"getEnumerableKeys"),Ae(fn,"getEnumerableSymbols"),Ae(ln,"keysEqual"),Ae(pn,"objectEqual"),Ae(dn,"isPrimitive"),Ae(gn,"mapSymbols"),Ae(yn,"hasProperty"),Ae(bn,"parsePath"),Ae(wn,"internalGetPathValue"),Ae(mn,"getPathInfo"),Ae(vn,"Assertion"),Object.defineProperty(vn,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),Lt.includeStack},set:function(e){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),Lt.includeStack=e}}),Object.defineProperty(vn,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),Lt.showDiff},set:function(e){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),Lt.showDiff=e}}),vn.addProperty=function(e,t){On(this.prototype,e,t)},vn.addMethod=function(e,t){Nn(this.prototype,e,t)},vn.addChainableMethod=function(e,t,n){Rn(this.prototype,e,t,n)},vn.overwriteProperty=function(e,t){Tn(this.prototype,e,t)},vn.overwriteMethod=function(e,t){kn(this.prototype,e,t)},vn.overwriteChainableMethod=function(e,t,n){$n(this.prototype,e,t,n)},vn.prototype.assert=function(e,t,n,r,o,i){var s=ze(this,arguments);if(!1!==i&&(i=!0),void 0===r&&void 0===o&&(i=!1),!0!==Lt.showDiff&&(i=!1),!s){t=Yt(this,arguments);var a={actual:Ye(this,arguments),expected:r,showDiff:i},c=Vn(this,arguments);throw c&&(a.operator=c),new Ue(t,a,Lt.includeStack?this.assert:$e(this,"ssfi"))}},Object.defineProperty(vn.prototype,"_obj",{get:function(){return $e(this,"object")},set:function(e){$e(this,"object",e)}}),Ae(xn,"isProxyEnabled"),Ae(On,"addProperty");var En=Object.getOwnPropertyDescriptor((function(){}),"length");function Pn(e,t,n){return En.configurable?(Object.defineProperty(e,"length",{get:function(){if(n)throw Error("Invalid Chai property: "+t+'.length. Due to a compatibility issue, "length" cannot directly follow "'+t+'". Use "'+t+'.lengthOf" instead.');throw Error("Invalid Chai property: "+t+'.length. See docs for proper usage of "'+t+'".')}}),e):e}function Sn(e){var t=Object.getOwnPropertyNames(e);function n(e){-1===t.indexOf(e)&&t.push(e)}Ae(n,"addProperty");for(var r=Object.getPrototypeOf(e);null!==r;)Object.getOwnPropertyNames(r).forEach(n),r=Object.getPrototypeOf(r);return t}Ae(Pn,"addLengthGuard"),Ae(Sn,"getProperties");var An=["__flags","__methods","_obj","assert"];function Mn(e,t){return xn()?new Proxy(e,{get:Ae((function e(n,r){if("string"==typeof r&&-1===Lt.proxyExcludedKeys.indexOf(r)&&!Reflect.has(n,r)){if(t)throw Error("Invalid Chai property: "+t+"."+r+'. See docs for proper usage of "'+t+'".');var o=null,i=4;throw Sn(n).forEach((function(e){if(!Object.prototype.hasOwnProperty(e)&&-1===An.indexOf(e)){var t=jn(r,e,i);t=n)return n;for(var r=[],o=0;o<=e.length;o++)r[o]=Array(t.length+1).fill(0),r[o][0]=o;for(var i=0;i=n?r[o][i]=n:r[o][i]=Math.min(r[o-1][i]+1,r[o][i-1]+1,r[o-1][i-1]+(s===t.charCodeAt(i-1)?0:1))}return r[e.length][t.length]}function Nn(e,t,n){var r=Ae((function(){$e(this,"lockSsfi")||$e(this,"ssfi",r);var e=n.apply(this,arguments);if(void 0!==e)return e;var t=new vn;return Vt(this,t),t}),"methodWrapper");Pn(r,t,!1),e[t]=Mn(r,t)}function Tn(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t),o=Ae((function(){}),"_super");r&&"function"==typeof r.get&&(o=r.get),Object.defineProperty(e,t,{get:Ae((function e(){xn()||$e(this,"lockSsfi")||$e(this,"ssfi",e);var t=$e(this,"lockSsfi");$e(this,"lockSsfi",!0);var r=n(o).call(this);if($e(this,"lockSsfi",t),void 0!==r)return r;var i=new vn;return Vt(this,i),i}),"overwritingPropertyGetter"),configurable:!0})}function kn(e,t,n){var r=e[t],o=Ae((function(){throw new Error(t+" is not a function")}),"_super");r&&"function"==typeof r&&(o=r);var i=Ae((function(){$e(this,"lockSsfi")||$e(this,"ssfi",i);var e=$e(this,"lockSsfi");$e(this,"lockSsfi",!0);var t=n(o).apply(this,arguments);if($e(this,"lockSsfi",e),void 0!==t)return t;var r=new vn;return Vt(this,r),r}),"overwritingMethodWrapper");Pn(i,t,!1),e[t]=Mn(i,t)}Ae(Mn,"proxify"),Ae(jn,"stringDistanceCapped"),Ae(Nn,"addMethod"),Ae(Tn,"overwriteProperty"),Ae(kn,"overwriteMethod");var Dn="function"==typeof Object.setPrototypeOf,_n=Ae((function(){}),"testFn"),In=Object.getOwnPropertyNames(_n).filter((function(e){var t=Object.getOwnPropertyDescriptor(_n,e);return"object"!=typeof t||!t.configurable})),Cn=Function.prototype.call,Bn=Function.prototype.apply;function Rn(e,t,n,r){"function"!=typeof r&&(r=Ae((function(){}),"chainingBehavior"));var o={method:n,chainingBehavior:r};e.__methods||(e.__methods={}),e.__methods[t]=o,Object.defineProperty(e,t,{get:Ae((function(){o.chainingBehavior.call(this);var n=Ae((function(){$e(this,"lockSsfi")||$e(this,"ssfi",n);var e=o.method.apply(this,arguments);if(void 0!==e)return e;var t=new vn;return Vt(this,t),t}),"chainableMethodWrapper");if(Pn(n,t,!0),Dn){var r=Object.create(this);r.call=Cn,r.apply=Bn,Object.setPrototypeOf(n,r)}else{Object.getOwnPropertyNames(e).forEach((function(t){if(-1===In.indexOf(t)){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r)}}))}return Vt(this,n),Mn(n)}),"chainableMethodGetter"),configurable:!0})}function $n(e,t,n,r){var o=e.__methods[t],i=o.chainingBehavior;o.chainingBehavior=Ae((function(){var e=r(i).call(this);if(void 0!==e)return e;var t=new vn;return Vt(this,t),t}),"overwritingChainableMethodGetter");var s=o.method;o.method=Ae((function(){var e=n(s).apply(this,arguments);if(void 0!==e)return e;var t=new vn;return Vt(this,t),t}),"overwritingChainableMethodWrapper")}function zn(e,t){return Ut(e)1&&p===f.length)throw l;return}this.assert(h,"expected #{this} to "+c+"include "+Ut(e),"expected #{this} to not "+c+"include "+Ut(e))}function tr(){var e=Wn(this,"object");this.assert(null!=e,"expected #{this} to exist","expected #{this} to not exist")}function nr(){var e=qe(Wn(this,"object"));this.assert("Arguments"===e,"expected #{this} to be arguments but got "+e,"expected #{this} to not be arguments")}function rr(e,t){t&&Wn(this,"message",t);var n=Wn(this,"object");if(Wn(this,"deep")){var r=Wn(this,"lockSsfi");Wn(this,"lockSsfi",!0),this.eql(e),Wn(this,"lockSsfi",r)}else this.assert(e===n,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",e,this._obj,!0)}function or(e,t){t&&Wn(this,"message",t);var n=Wn(this,"eql");this.assert(n(e,Wn(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",e,this._obj,!0)}function ir(e,t){t&&Wn(this,"message",t);var n=Wn(this,"object"),r=Wn(this,"doLength"),o=Wn(this,"message"),i=o?o+": ":"",s=Wn(this,"ssfi"),a=qe(n).toLowerCase(),c=qe(e).toLowerCase();if(r&&"map"!==a&&"set"!==a&&new vn(n,o,s,!0).to.have.property("length"),!r&&"date"===a&&"date"!==c)throw new Ue(i+"the argument to above must be a date",void 0,s);if(!Gn(e)&&(r||Gn(n)))throw new Ue(i+"the argument to above must be a number",void 0,s);if(!r&&"date"!==a&&!Gn(n))throw new Ue(i+"expected "+("string"===a?"'"+n+"'":n)+" to be a number or a date",void 0,s);if(r){var u,h="length";"map"===a||"set"===a?(h="size",u=n.size):u=n.length,this.assert(u>e,"expected #{this} to have a "+h+" above #{exp} but got #{act}","expected #{this} to not have a "+h+" above #{exp}",e,u)}else this.assert(n>e,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",e)}function sr(e,t){t&&Wn(this,"message",t);var n,r=Wn(this,"object"),o=Wn(this,"doLength"),i=Wn(this,"message"),s=i?i+": ":"",a=Wn(this,"ssfi"),c=qe(r).toLowerCase(),u=qe(e).toLowerCase(),h=!0;if(o&&"map"!==c&&"set"!==c&&new vn(r,i,a,!0).to.have.property("length"),o||"date"!==c||"date"===u)if(Gn(e)||!o&&!Gn(r))if(o||"date"===c||Gn(r))h=!1;else{n=s+"expected "+("string"===c?"'"+r+"'":r)+" to be a number or a date"}else n=s+"the argument to least must be a number";else n=s+"the argument to least must be a date";if(h)throw new Ue(n,void 0,a);if(o){var f,l="length";"map"===c||"set"===c?(l="size",f=r.size):f=r.length,this.assert(f>=e,"expected #{this} to have a "+l+" at least #{exp} but got #{act}","expected #{this} to have a "+l+" below #{exp}",e,f)}else this.assert(r>=e,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",e)}function ar(e,t){t&&Wn(this,"message",t);var n,r=Wn(this,"object"),o=Wn(this,"doLength"),i=Wn(this,"message"),s=i?i+": ":"",a=Wn(this,"ssfi"),c=qe(r).toLowerCase(),u=qe(e).toLowerCase(),h=!0;if(o&&"map"!==c&&"set"!==c&&new vn(r,i,a,!0).to.have.property("length"),o||"date"!==c||"date"===u)if(Gn(e)||!o&&!Gn(r))if(o||"date"===c||Gn(r))h=!1;else{n=s+"expected "+("string"===c?"'"+r+"'":r)+" to be a number or a date"}else n=s+"the argument to below must be a number";else n=s+"the argument to below must be a date";if(h)throw new Ue(n,void 0,a);if(o){var f,l="length";"map"===c||"set"===c?(l="size",f=r.size):f=r.length,this.assert(fe===t,g="";h&&(g+="deep "),o&&(g+="own "),r&&(g+="nested "),g+="property ",u=o?Object.prototype.hasOwnProperty.call(s,e):r?l.exists:yn(s,e),f&&1!==arguments.length||this.assert(u,"expected #{this} to have "+g+Ut(e),"expected #{this} to not have "+g+Ut(e)),arguments.length>1&&this.assert(u&&d(t,p),"expected #{this} to have "+g+Ut(e)+" of #{exp}, but got #{act}","expected #{this} to not have "+g+Ut(e)+" of #{act}",t,p),Wn(this,"object",p)}function fr(e,t,n){Wn(this,"own",!0),hr.apply(this,arguments)}function lr(e,t,n){"string"==typeof t&&(n=t,t=null),n&&Wn(this,"message",n);var r=Wn(this,"object"),o=Object.getOwnPropertyDescriptor(Object(r),e),i=Wn(this,"eql");o&&t?this.assert(i(t,o),"expected the own property descriptor for "+Ut(e)+" on #{this} to match "+Ut(t)+", got "+Ut(o),"expected the own property descriptor for "+Ut(e)+" on #{this} to not match "+Ut(t),t,o,!0):this.assert(o,"expected #{this} to have an own property descriptor for "+Ut(e),"expected #{this} to not have an own property descriptor for "+Ut(e)),Wn(this,"object",o)}function pr(){Wn(this,"doLength",!0)}function dr(e,t){t&&Wn(this,"message",t);var n,r=Wn(this,"object"),o=qe(r).toLowerCase(),i=Wn(this,"message"),s=Wn(this,"ssfi"),a="length";switch(o){case"map":case"set":a="size",n=r.size;break;default:new vn(r,i,s,!0).to.have.property("length"),n=r.length}this.assert(n==e,"expected #{this} to have a "+a+" of #{exp} but got #{act}","expected #{this} to not have a "+a+" of #{act}",e,n)}function gr(e,t){t&&Wn(this,"message",t);var n=Wn(this,"object");this.assert(e.exec(n),"expected #{this} to match "+e,"expected #{this} not to match "+e)}function yr(e){var t,n,r=Wn(this,"object"),o=qe(r),i=qe(e),s=Wn(this,"ssfi"),a=Wn(this,"deep"),c="",u=!0,h=Wn(this,"message"),f=(h=h?h+": ":"")+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if("Map"===o||"Set"===o)c=a?"deeply ":"",n=[],r.forEach((function(e,t){n.push(t)})),"Array"!==i&&(e=Array.prototype.slice.call(arguments));else{switch(n=Ln(r),i){case"Array":if(arguments.length>1)throw new Ue(f,void 0,s);break;case"Object":if(arguments.length>1)throw new Ue(f,void 0,s);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}e=e.map((function(e){return"symbol"==typeof e?e:String(e)}))}if(!e.length)throw new Ue(h+"keys required",void 0,s);var l=e.length,p=Wn(this,"any"),d=Wn(this,"all"),g=e,y=a?Wn(this,"eql"):(e,t)=>e===t;if(p||d||(d=!0),p&&(u=g.some((function(e){return n.some((function(t){return y(e,t)}))}))),d&&(u=g.every((function(e){return n.some((function(t){return y(e,t)}))})),Wn(this,"contains")||(u=u&&e.length==n.length)),l>1){var b=(e=e.map((function(e){return Ut(e)}))).pop();d&&(t=e.join(", ")+", and "+b),p&&(t=e.join(", ")+", or "+b)}else t=Ut(e[0]);t=(l>1?"keys ":"key ")+t,t=(Wn(this,"contains")?"contain ":"have ")+t,this.assert(u,"expected #{this} to "+c+t,"expected #{this} to not "+c+t,g.slice(0).sort(zn),n.sort(zn),!0)}function br(e,t,n){n&&Wn(this,"message",n);var r=Wn(this,"object"),o=Wn(this,"ssfi"),i=Wn(this,"message"),s=Wn(this,"negate")||!1;let a;new vn(r,i,o,!0).is.a("function"),(Hn(e)||"string"==typeof e)&&(t=e,e=null);let c=!1;try{r()}catch(e){c=!0,a=e}var u=void 0===e&&void 0===t,h=Boolean(e&&t),f=!1,l=!1;if(u||!u&&!s){var p="an error";e instanceof Error?p="#{exp}":e&&(p=Te.getConstructorName(e));let t=a;if(a instanceof Error)t=a.toString();else if("string"==typeof a)t=a;else if(a&&("object"==typeof a||"function"==typeof a))try{t=Te.getConstructorName(a)}catch(e){}this.assert(c,"expected #{this} to throw "+p,"expected #{this} to not throw an error but #{act} was thrown",e&&e.toString(),t)}if(e&&a){if(e instanceof Error)Te.compatibleInstance(a,e)===s&&(h&&s?f=!0:this.assert(s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(a&&!s?" but #{act} was thrown":""),e.toString(),a.toString()));Te.compatibleConstructor(a,e)===s&&(h&&s?f=!0:this.assert(s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(a?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&Te.getConstructorName(e),a instanceof Error?a.toString():a&&Te.getConstructorName(a)))}if(a&&null!=t){var d="including";Hn(t)&&(d="matching"),Te.compatibleMessage(a,t)===s&&(h&&s?l=!0:this.assert(s,"expected #{this} to throw error "+d+" #{exp} but got #{act}","expected #{this} to throw error not "+d+" #{exp}",t,Te.getMessage(a)))}f&&l&&this.assert(s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(a?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&Te.getConstructorName(e),a instanceof Error?a.toString():a&&Te.getConstructorName(a)),Wn(this,"object",a)}function wr(e,t){t&&Wn(this,"message",t);var n=Wn(this,"object"),r=Wn(this,"itself"),o="function"!=typeof n||r?n[e]:n.prototype[e];this.assert("function"==typeof o,"expected #{this} to respond to "+Ut(e),"expected #{this} to not respond to "+Ut(e))}function mr(e,t){t&&Wn(this,"message",t);var n=e(Wn(this,"object"));this.assert(n,"expected #{this} to satisfy "+Ft(e),"expected #{this} to not satisfy"+Ft(e),!Wn(this,"negate"),n)}function vr(e,t,n){n&&Wn(this,"message",n);var r=Wn(this,"object"),o=Wn(this,"message"),i=Wn(this,"ssfi");new vn(r,o,i,!0).is.numeric;let s="A `delta` value is required for `closeTo`";if(null==t)throw new Ue(o?`${o}: ${s}`:s,void 0,i);if(new vn(t,o,i,!0).is.numeric,s="A `expected` value is required for `closeTo`",null==e)throw new Ue(o?`${o}: ${s}`:s,void 0,i);new vn(e,o,i,!0).is.numeric;const a=Ae((e=>e<0n?-e:e),"abs");this.assert(a(r-e)<=t,"expected #{this} to be close to "+e+" +/- "+t,"expected #{this} not to be close to "+e+" +/- "+t)}function xr(e,t,n,r,o){let i=Array.from(t),s=Array.from(e);if(!r){if(s.length!==i.length)return!1;i=i.slice()}return s.every((function(e,t){if(o)return n?n(e,i[t]):e===i[t];if(!n){var s=i.indexOf(e);return-1!==s&&(r||i.splice(s,1),!0)}return i.some((function(t,o){return!!n(e,t)&&(r||i.splice(o,1),!0)}))}))}function Or(e,t){t&&Wn(this,"message",t);var n=Wn(this,"object"),r=Wn(this,"message"),o=Wn(this,"ssfi"),i=Wn(this,"contains"),s=Wn(this,"deep"),a=Wn(this,"eql");new vn(e,r,o,!0).to.be.an("array"),i?this.assert(e.some((function(e){return n.indexOf(e)>-1})),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",e,n):s?this.assert(e.some((function(e){return a(n,e)})),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",e,n):this.assert(e.indexOf(n)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",e,n)}function Er(e,t,n){n&&Wn(this,"message",n);var r,o=Wn(this,"object"),i=Wn(this,"message"),s=Wn(this,"ssfi");new vn(o,i,s,!0).is.a("function"),t?(new vn(e,i,s,!0).to.have.property(t),r=e[t]):(new vn(e,i,s,!0).is.a("function"),r=e()),o();var a=null==t?e():e[t],c=null==t?r:"."+t;Wn(this,"deltaMsgObj",c),Wn(this,"initialDeltaValue",r),Wn(this,"finalDeltaValue",a),Wn(this,"deltaBehavior","change"),Wn(this,"realDelta",a!==r),this.assert(r!==a,"expected "+c+" to change","expected "+c+" to not change")}function Pr(e,t,n){n&&Wn(this,"message",n);var r,o=Wn(this,"object"),i=Wn(this,"message"),s=Wn(this,"ssfi");new vn(o,i,s,!0).is.a("function"),t?(new vn(e,i,s,!0).to.have.property(t),r=e[t]):(new vn(e,i,s,!0).is.a("function"),r=e()),new vn(r,i,s,!0).is.a("number"),o();var a=null==t?e():e[t],c=null==t?r:"."+t;Wn(this,"deltaMsgObj",c),Wn(this,"initialDeltaValue",r),Wn(this,"finalDeltaValue",a),Wn(this,"deltaBehavior","increase"),Wn(this,"realDelta",a-r),this.assert(a-r>0,"expected "+c+" to increase","expected "+c+" to not increase")}function Sr(e,t,n){n&&Wn(this,"message",n);var r,o=Wn(this,"object"),i=Wn(this,"message"),s=Wn(this,"ssfi");new vn(o,i,s,!0).is.a("function"),t?(new vn(e,i,s,!0).to.have.property(t),r=e[t]):(new vn(e,i,s,!0).is.a("function"),r=e()),new vn(r,i,s,!0).is.a("number"),o();var a=null==t?e():e[t],c=null==t?r:"."+t;Wn(this,"deltaMsgObj",c),Wn(this,"initialDeltaValue",r),Wn(this,"finalDeltaValue",a),Wn(this,"deltaBehavior","decrease"),Wn(this,"realDelta",r-a),this.assert(a-r<0,"expected "+c+" to decrease","expected "+c+" to not decrease")}function Ar(e,t){t&&Wn(this,"message",t);var n,r=Wn(this,"deltaMsgObj"),o=Wn(this,"initialDeltaValue"),i=Wn(this,"finalDeltaValue"),s=Wn(this,"deltaBehavior"),a=Wn(this,"realDelta");n="change"===s?Math.abs(i-o)===Math.abs(e):a===Math.abs(e),this.assert(n,"expected "+r+" to "+s+" by "+e,"expected "+r+" to not "+s+" by "+e)}function Mr(e,t){return new vn(e,t)}Ae(Jn,"an"),vn.addChainableMethod("an",Jn),vn.addChainableMethod("a",Jn),Ae(Qn,"SameValueZero"),Ae(Xn,"includeChainingBehavior"),Ae(er,"include"),vn.addChainableMethod("include",er,Xn),vn.addChainableMethod("contain",er,Xn),vn.addChainableMethod("contains",er,Xn),vn.addChainableMethod("includes",er,Xn),vn.addProperty("ok",(function(){this.assert(Wn(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")})),vn.addProperty("true",(function(){this.assert(!0===Wn(this,"object"),"expected #{this} to be true","expected #{this} to be false",!Wn(this,"negate"))})),vn.addProperty("numeric",(function(){const e=Wn(this,"object");this.assert(["Number","BigInt"].includes(qe(e)),"expected #{this} to be numeric","expected #{this} to not be numeric",!Wn(this,"negate"))})),vn.addProperty("callable",(function(){const e=Wn(this,"object"),t=Wn(this,"ssfi"),n=Wn(this,"message"),r=n?`${n}: `:"",o=Wn(this,"negate"),i=o?`${r}expected ${Ut(e)} not to be a callable function`:`${r}expected ${Ut(e)} to be a callable function`,s=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(qe(e));if(s&&o||!s&&!o)throw new Ue(i,void 0,t)})),vn.addProperty("false",(function(){this.assert(!1===Wn(this,"object"),"expected #{this} to be false","expected #{this} to be true",!!Wn(this,"negate"))})),vn.addProperty("null",(function(){this.assert(null===Wn(this,"object"),"expected #{this} to be null","expected #{this} not to be null")})),vn.addProperty("undefined",(function(){this.assert(void 0===Wn(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")})),vn.addProperty("NaN",(function(){this.assert(Fn(Wn(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")})),Ae(tr,"assertExist"),vn.addProperty("exist",tr),vn.addProperty("exists",tr),vn.addProperty("empty",(function(){var e,t=Wn(this,"object"),n=Wn(this,"ssfi"),r=Wn(this,"message");switch(r=r?r+": ":"",qe(t).toLowerCase()){case"array":case"string":e=t.length;break;case"map":case"set":e=t.size;break;case"weakmap":case"weakset":throw new Ue(r+".empty was passed a weak collection",void 0,n);case"function":var o=r+".empty was passed a function "+Kn(t);throw new Ue(o.trim(),void 0,n);default:if(t!==Object(t))throw new Ue(r+".empty was passed non-string primitive "+Ut(t),void 0,n);e=Object.keys(t).length}this.assert(0===e,"expected #{this} to be empty","expected #{this} not to be empty")})),Ae(nr,"checkArguments"),vn.addProperty("arguments",nr),vn.addProperty("Arguments",nr),Ae(rr,"assertEqual"),vn.addMethod("equal",rr),vn.addMethod("equals",rr),vn.addMethod("eq",rr),Ae(or,"assertEql"),vn.addMethod("eql",or),vn.addMethod("eqls",or),Ae(ir,"assertAbove"),vn.addMethod("above",ir),vn.addMethod("gt",ir),vn.addMethod("greaterThan",ir),Ae(sr,"assertLeast"),vn.addMethod("least",sr),vn.addMethod("gte",sr),vn.addMethod("greaterThanOrEqual",sr),Ae(ar,"assertBelow"),vn.addMethod("below",ar),vn.addMethod("lt",ar),vn.addMethod("lessThan",ar),Ae(cr,"assertMost"),vn.addMethod("most",cr),vn.addMethod("lte",cr),vn.addMethod("lessThanOrEqual",cr),vn.addMethod("within",(function(e,t,n){n&&Wn(this,"message",n);var r,o=Wn(this,"object"),i=Wn(this,"doLength"),s=Wn(this,"message"),a=s?s+": ":"",c=Wn(this,"ssfi"),u=qe(o).toLowerCase(),h=qe(e).toLowerCase(),f=qe(t).toLowerCase(),l=!0,p="date"===h&&"date"===f?e.toISOString()+".."+t.toISOString():e+".."+t;if(i&&"map"!==u&&"set"!==u&&new vn(o,s,c,!0).to.have.property("length"),i||"date"!==u||"date"===h&&"date"===f)if(Gn(e)&&Gn(t)||!i&&!Gn(o))if(i||"date"===u||Gn(o))l=!1;else{r=a+"expected "+("string"===u?"'"+o+"'":o)+" to be a number or a date"}else r=a+"the arguments to within must be numbers";else r=a+"the arguments to within must be dates";if(l)throw new Ue(r,void 0,c);if(i){var d,g="length";"map"===u||"set"===u?(g="size",d=o.size):d=o.length,this.assert(d>=e&&d<=t,"expected #{this} to have a "+g+" within "+p,"expected #{this} to not have a "+g+" within "+p)}else this.assert(o>=e&&o<=t,"expected #{this} to be within "+p,"expected #{this} to not be within "+p)})),Ae(ur,"assertInstanceOf"),vn.addMethod("instanceof",ur),vn.addMethod("instanceOf",ur),Ae(hr,"assertProperty"),vn.addMethod("property",hr),Ae(fr,"assertOwnProperty"),vn.addMethod("ownProperty",fr),vn.addMethod("haveOwnProperty",fr),Ae(lr,"assertOwnPropertyDescriptor"),vn.addMethod("ownPropertyDescriptor",lr),vn.addMethod("haveOwnPropertyDescriptor",lr),Ae(pr,"assertLengthChain"),Ae(dr,"assertLength"),vn.addChainableMethod("length",dr,pr),vn.addChainableMethod("lengthOf",dr,pr),Ae(gr,"assertMatch"),vn.addMethod("match",gr),vn.addMethod("matches",gr),vn.addMethod("string",(function(e,t){t&&Wn(this,"message",t);var n=Wn(this,"object");new vn(n,Wn(this,"message"),Wn(this,"ssfi"),!0).is.a("string"),this.assert(~n.indexOf(e),"expected #{this} to contain "+Ut(e),"expected #{this} to not contain "+Ut(e))})),Ae(yr,"assertKeys"),vn.addMethod("keys",yr),vn.addMethod("key",yr),Ae(br,"assertThrows"),vn.addMethod("throw",br),vn.addMethod("throws",br),vn.addMethod("Throw",br),Ae(wr,"respondTo"),vn.addMethod("respondTo",wr),vn.addMethod("respondsTo",wr),vn.addProperty("itself",(function(){Wn(this,"itself",!0)})),Ae(mr,"satisfy"),vn.addMethod("satisfy",mr),vn.addMethod("satisfies",mr),Ae(vr,"closeTo"),vn.addMethod("closeTo",vr),vn.addMethod("approximately",vr),Ae(xr,"isSubsetOf"),vn.addMethod("members",(function(e,t){t&&Wn(this,"message",t);var n=Wn(this,"object"),r=Wn(this,"message"),o=Wn(this,"ssfi");new vn(n,r,o,!0).to.be.iterable,new vn(e,r,o,!0).to.be.iterable;var i,s,a,c=Wn(this,"contains"),u=Wn(this,"ordered");c?(s="expected #{this} to be "+(i=u?"an ordered superset":"a superset")+" of #{exp}",a="expected #{this} to not be "+i+" of #{exp}"):(s="expected #{this} to have the same "+(i=u?"ordered members":"members")+" as #{exp}",a="expected #{this} to not have the same "+i+" as #{exp}");var h=Wn(this,"deep")?Wn(this,"eql"):void 0;this.assert(xr(e,n,h,c,u),s,a,e,n,!0)})),vn.addProperty("iterable",(function(e){e&&Wn(this,"message",e);var t=Wn(this,"object");this.assert(null!=t&&t[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",t)})),Ae(Or,"oneOf"),vn.addMethod("oneOf",Or),Ae(Er,"assertChanges"),vn.addMethod("change",Er),vn.addMethod("changes",Er),Ae(Pr,"assertIncreases"),vn.addMethod("increase",Pr),vn.addMethod("increases",Pr),Ae(Sr,"assertDecreases"),vn.addMethod("decrease",Sr),vn.addMethod("decreases",Sr),Ae(Ar,"assertDelta"),vn.addMethod("by",Ar),vn.addProperty("extensible",(function(){var e=Wn(this,"object"),t=e===Object(e)&&Object.isExtensible(e);this.assert(t,"expected #{this} to be extensible","expected #{this} to not be extensible")})),vn.addProperty("sealed",(function(){var e=Wn(this,"object"),t=e!==Object(e)||Object.isSealed(e);this.assert(t,"expected #{this} to be sealed","expected #{this} to not be sealed")})),vn.addProperty("frozen",(function(){var e=Wn(this,"object"),t=e!==Object(e)||Object.isFrozen(e);this.assert(t,"expected #{this} to be frozen","expected #{this} to not be frozen")})),vn.addProperty("finite",(function(e){var t=Wn(this,"object");this.assert("number"==typeof t&&isFinite(t),"expected #{this} to be a finite number","expected #{this} to not be a finite number")})),Ae(Mr,"expect"),Mr.fail=function(e,t,n,r){throw arguments.length<2&&(n=e,e=void 0),new Ue(n=n||"expect.fail()",{actual:e,expected:t,operator:r},Mr.fail)};var jr={};function Nr(){function e(){return this instanceof String||this instanceof Number||this instanceof Boolean||"function"==typeof Symbol&&this instanceof Symbol||"function"==typeof BigInt&&this instanceof BigInt?new vn(this.valueOf(),null,e):new vn(this,null,e)}function t(e){Object.defineProperty(this,"should",{value:e,enumerable:!0,configurable:!0,writable:!0})}Ae(e,"shouldGetter"),Ae(t,"shouldSetter"),Object.defineProperty(Object.prototype,"should",{set:t,get:e,configurable:!0});var n={fail:function(e,t,r,o){throw arguments.length<2&&(r=e,e=void 0),new Ue(r=r||"should.fail()",{actual:e,expected:t,operator:o},n.fail)},equal:function(e,t,n){new vn(e,n).to.equal(t)},Throw:function(e,t,n,r){new vn(e,r).to.Throw(t,n)},exist:function(e,t){new vn(e,t).to.exist},not:{}};return n.not.equal=function(e,t,n){new vn(e,n).to.not.equal(t)},n.not.Throw=function(e,t,n,r){new vn(e,r).to.not.Throw(t,n)},n.not.exist=function(e,t){new vn(e,t).to.not.exist},n.throw=n.Throw,n.not.throw=n.not.Throw,n}Me(jr,{Should:()=>kr,should:()=>Tr}),Ae(Nr,"loadShould");var Tr=Nr,kr=Nr;function Dr(e,t){new vn(null,null,Dr,!0).assert(e,t,"[ negation message unavailable ]")}Ae(Dr,"assert"),Dr.fail=function(e,t,n,r){throw arguments.length<2&&(n=e,e=void 0),new Ue(n=n||"assert.fail()",{actual:e,expected:t,operator:r},Dr.fail)},Dr.isOk=function(e,t){new vn(e,t,Dr.isOk,!0).is.ok},Dr.isNotOk=function(e,t){new vn(e,t,Dr.isNotOk,!0).is.not.ok},Dr.equal=function(e,t,n){var r=new vn(e,n,Dr.equal,!0);r.assert(t==$e(r,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",t,e,!0)},Dr.notEqual=function(e,t,n){var r=new vn(e,n,Dr.notEqual,!0);r.assert(t!=$e(r,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",t,e,!0)},Dr.strictEqual=function(e,t,n){new vn(e,n,Dr.strictEqual,!0).to.equal(t)},Dr.notStrictEqual=function(e,t,n){new vn(e,n,Dr.notStrictEqual,!0).to.not.equal(t)},Dr.deepEqual=Dr.deepStrictEqual=function(e,t,n){new vn(e,n,Dr.deepEqual,!0).to.eql(t)},Dr.notDeepEqual=function(e,t,n){new vn(e,n,Dr.notDeepEqual,!0).to.not.eql(t)},Dr.isAbove=function(e,t,n){new vn(e,n,Dr.isAbove,!0).to.be.above(t)},Dr.isAtLeast=function(e,t,n){new vn(e,n,Dr.isAtLeast,!0).to.be.least(t)},Dr.isBelow=function(e,t,n){new vn(e,n,Dr.isBelow,!0).to.be.below(t)},Dr.isAtMost=function(e,t,n){new vn(e,n,Dr.isAtMost,!0).to.be.most(t)},Dr.isTrue=function(e,t){new vn(e,t,Dr.isTrue,!0).is.true},Dr.isNotTrue=function(e,t){new vn(e,t,Dr.isNotTrue,!0).to.not.equal(!0)},Dr.isFalse=function(e,t){new vn(e,t,Dr.isFalse,!0).is.false},Dr.isNotFalse=function(e,t){new vn(e,t,Dr.isNotFalse,!0).to.not.equal(!1)},Dr.isNull=function(e,t){new vn(e,t,Dr.isNull,!0).to.equal(null)},Dr.isNotNull=function(e,t){new vn(e,t,Dr.isNotNull,!0).to.not.equal(null)},Dr.isNaN=function(e,t){new vn(e,t,Dr.isNaN,!0).to.be.NaN},Dr.isNotNaN=function(e,t){new vn(e,t,Dr.isNotNaN,!0).not.to.be.NaN},Dr.exists=function(e,t){new vn(e,t,Dr.exists,!0).to.exist},Dr.notExists=function(e,t){new vn(e,t,Dr.notExists,!0).to.not.exist},Dr.isUndefined=function(e,t){new vn(e,t,Dr.isUndefined,!0).to.equal(void 0)},Dr.isDefined=function(e,t){new vn(e,t,Dr.isDefined,!0).to.not.equal(void 0)},Dr.isCallable=function(e,t){new vn(e,t,Dr.isCallable,!0).is.callable},Dr.isNotCallable=function(e,t){new vn(e,t,Dr.isNotCallable,!0).is.not.callable},Dr.isObject=function(e,t){new vn(e,t,Dr.isObject,!0).to.be.a("object")},Dr.isNotObject=function(e,t){new vn(e,t,Dr.isNotObject,!0).to.not.be.a("object")},Dr.isArray=function(e,t){new vn(e,t,Dr.isArray,!0).to.be.an("array")},Dr.isNotArray=function(e,t){new vn(e,t,Dr.isNotArray,!0).to.not.be.an("array")},Dr.isString=function(e,t){new vn(e,t,Dr.isString,!0).to.be.a("string")},Dr.isNotString=function(e,t){new vn(e,t,Dr.isNotString,!0).to.not.be.a("string")},Dr.isNumber=function(e,t){new vn(e,t,Dr.isNumber,!0).to.be.a("number")},Dr.isNotNumber=function(e,t){new vn(e,t,Dr.isNotNumber,!0).to.not.be.a("number")},Dr.isNumeric=function(e,t){new vn(e,t,Dr.isNumeric,!0).is.numeric},Dr.isNotNumeric=function(e,t){new vn(e,t,Dr.isNotNumeric,!0).is.not.numeric},Dr.isFinite=function(e,t){new vn(e,t,Dr.isFinite,!0).to.be.finite},Dr.isBoolean=function(e,t){new vn(e,t,Dr.isBoolean,!0).to.be.a("boolean")},Dr.isNotBoolean=function(e,t){new vn(e,t,Dr.isNotBoolean,!0).to.not.be.a("boolean")},Dr.typeOf=function(e,t,n){new vn(e,n,Dr.typeOf,!0).to.be.a(t)},Dr.notTypeOf=function(e,t,n){new vn(e,n,Dr.notTypeOf,!0).to.not.be.a(t)},Dr.instanceOf=function(e,t,n){new vn(e,n,Dr.instanceOf,!0).to.be.instanceOf(t)},Dr.notInstanceOf=function(e,t,n){new vn(e,n,Dr.notInstanceOf,!0).to.not.be.instanceOf(t)},Dr.include=function(e,t,n){new vn(e,n,Dr.include,!0).include(t)},Dr.notInclude=function(e,t,n){new vn(e,n,Dr.notInclude,!0).not.include(t)},Dr.deepInclude=function(e,t,n){new vn(e,n,Dr.deepInclude,!0).deep.include(t)},Dr.notDeepInclude=function(e,t,n){new vn(e,n,Dr.notDeepInclude,!0).not.deep.include(t)},Dr.nestedInclude=function(e,t,n){new vn(e,n,Dr.nestedInclude,!0).nested.include(t)},Dr.notNestedInclude=function(e,t,n){new vn(e,n,Dr.notNestedInclude,!0).not.nested.include(t)},Dr.deepNestedInclude=function(e,t,n){new vn(e,n,Dr.deepNestedInclude,!0).deep.nested.include(t)},Dr.notDeepNestedInclude=function(e,t,n){new vn(e,n,Dr.notDeepNestedInclude,!0).not.deep.nested.include(t)},Dr.ownInclude=function(e,t,n){new vn(e,n,Dr.ownInclude,!0).own.include(t)},Dr.notOwnInclude=function(e,t,n){new vn(e,n,Dr.notOwnInclude,!0).not.own.include(t)},Dr.deepOwnInclude=function(e,t,n){new vn(e,n,Dr.deepOwnInclude,!0).deep.own.include(t)},Dr.notDeepOwnInclude=function(e,t,n){new vn(e,n,Dr.notDeepOwnInclude,!0).not.deep.own.include(t)},Dr.match=function(e,t,n){new vn(e,n,Dr.match,!0).to.match(t)},Dr.notMatch=function(e,t,n){new vn(e,n,Dr.notMatch,!0).to.not.match(t)},Dr.property=function(e,t,n){new vn(e,n,Dr.property,!0).to.have.property(t)},Dr.notProperty=function(e,t,n){new vn(e,n,Dr.notProperty,!0).to.not.have.property(t)},Dr.propertyVal=function(e,t,n,r){new vn(e,r,Dr.propertyVal,!0).to.have.property(t,n)},Dr.notPropertyVal=function(e,t,n,r){new vn(e,r,Dr.notPropertyVal,!0).to.not.have.property(t,n)},Dr.deepPropertyVal=function(e,t,n,r){new vn(e,r,Dr.deepPropertyVal,!0).to.have.deep.property(t,n)},Dr.notDeepPropertyVal=function(e,t,n,r){new vn(e,r,Dr.notDeepPropertyVal,!0).to.not.have.deep.property(t,n)},Dr.ownProperty=function(e,t,n){new vn(e,n,Dr.ownProperty,!0).to.have.own.property(t)},Dr.notOwnProperty=function(e,t,n){new vn(e,n,Dr.notOwnProperty,!0).to.not.have.own.property(t)},Dr.ownPropertyVal=function(e,t,n,r){new vn(e,r,Dr.ownPropertyVal,!0).to.have.own.property(t,n)},Dr.notOwnPropertyVal=function(e,t,n,r){new vn(e,r,Dr.notOwnPropertyVal,!0).to.not.have.own.property(t,n)},Dr.deepOwnPropertyVal=function(e,t,n,r){new vn(e,r,Dr.deepOwnPropertyVal,!0).to.have.deep.own.property(t,n)},Dr.notDeepOwnPropertyVal=function(e,t,n,r){new vn(e,r,Dr.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(t,n)},Dr.nestedProperty=function(e,t,n){new vn(e,n,Dr.nestedProperty,!0).to.have.nested.property(t)},Dr.notNestedProperty=function(e,t,n){new vn(e,n,Dr.notNestedProperty,!0).to.not.have.nested.property(t)},Dr.nestedPropertyVal=function(e,t,n,r){new vn(e,r,Dr.nestedPropertyVal,!0).to.have.nested.property(t,n)},Dr.notNestedPropertyVal=function(e,t,n,r){new vn(e,r,Dr.notNestedPropertyVal,!0).to.not.have.nested.property(t,n)},Dr.deepNestedPropertyVal=function(e,t,n,r){new vn(e,r,Dr.deepNestedPropertyVal,!0).to.have.deep.nested.property(t,n)},Dr.notDeepNestedPropertyVal=function(e,t,n,r){new vn(e,r,Dr.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(t,n)},Dr.lengthOf=function(e,t,n){new vn(e,n,Dr.lengthOf,!0).to.have.lengthOf(t)},Dr.hasAnyKeys=function(e,t,n){new vn(e,n,Dr.hasAnyKeys,!0).to.have.any.keys(t)},Dr.hasAllKeys=function(e,t,n){new vn(e,n,Dr.hasAllKeys,!0).to.have.all.keys(t)},Dr.containsAllKeys=function(e,t,n){new vn(e,n,Dr.containsAllKeys,!0).to.contain.all.keys(t)},Dr.doesNotHaveAnyKeys=function(e,t,n){new vn(e,n,Dr.doesNotHaveAnyKeys,!0).to.not.have.any.keys(t)},Dr.doesNotHaveAllKeys=function(e,t,n){new vn(e,n,Dr.doesNotHaveAllKeys,!0).to.not.have.all.keys(t)},Dr.hasAnyDeepKeys=function(e,t,n){new vn(e,n,Dr.hasAnyDeepKeys,!0).to.have.any.deep.keys(t)},Dr.hasAllDeepKeys=function(e,t,n){new vn(e,n,Dr.hasAllDeepKeys,!0).to.have.all.deep.keys(t)},Dr.containsAllDeepKeys=function(e,t,n){new vn(e,n,Dr.containsAllDeepKeys,!0).to.contain.all.deep.keys(t)},Dr.doesNotHaveAnyDeepKeys=function(e,t,n){new vn(e,n,Dr.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(t)},Dr.doesNotHaveAllDeepKeys=function(e,t,n){new vn(e,n,Dr.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(t)},Dr.throws=function(e,t,n,r){return("string"==typeof t||t instanceof RegExp)&&(n=t,t=null),$e(new vn(e,r,Dr.throws,!0).to.throw(t,n),"object")},Dr.doesNotThrow=function(e,t,n,r){("string"==typeof t||t instanceof RegExp)&&(n=t,t=null),new vn(e,r,Dr.doesNotThrow,!0).to.not.throw(t,n)},Dr.operator=function(e,t,n,r){var o;switch(t){case"==":o=e==n;break;case"===":o=e===n;break;case">":o=e>n;break;case">=":o=e>=n;break;case"<":o=e @@ -245,4 +245,5 @@ deep-eql/index.js: * @return {Boolean} result *) */ -export{wn as Assertion,Ue as AssertionError,Nr as Should,Tr as assert,qt as config,Sr as expect,jr as should,Dr as use,Ne as util};export default null; +export{vn as Assertion,Ue as AssertionError,kr as Should,Dr as assert,Lt as config,Mr as expect,Tr as should,Ir as use,Ne as util};export default null; +//# sourceMappingURL=/sm/405bacd4206da662872d80fe97b5f4c00731c9473bed68fc6e343b4457bfce6e.map \ No newline at end of file diff --git a/vendor/javascripts/is-node-process.js b/vendor/javascripts/is-node-process.js deleted file mode 100644 index abd19b8..0000000 --- a/vendor/javascripts/is-node-process.js +++ /dev/null @@ -1,2 +0,0 @@ -function isNodeProcess(){if("undefined"!==typeof navigator&&"ReactNative"===navigator.product)return true;if("undefined"!==typeof process){const e=process.type;return"renderer"!==e&&"worker"!==e&&!!(process.versions&&process.versions.node)}return false}export{isNodeProcess}; - diff --git a/vendor/javascripts/mocha.js b/vendor/javascripts/mocha.js index bdc4108..ccc871b 100644 --- a/vendor/javascripts/mocha.js +++ b/vendor/javascripts/mocha.js @@ -1,4 +1,4 @@ -// mocha@10.6.0 in javascript ES2018 +// mocha@10.8.2 in javascript ES2018 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -11101,7 +11101,7 @@ * canonicalType(global) // 'global' * canonicalType(new String('foo') // 'object' * canonicalType(async function() {}) // 'asyncfunction' - * canonicalType(await import(name)) // 'module' + * canonicalType(Object.create(null)) // 'null-prototype' */ var canonicalType = (exports.canonicalType = function canonicalType(value) { if (value === undefined) { @@ -11110,7 +11110,10 @@ return 'null'; } else if (isBuffer(value)) { return 'buffer'; + } else if (Object.getPrototypeOf(value) === null) { + return 'null-prototype'; } + return Object.prototype.toString .call(value) .replace(/^\[.+\s(.+?)]$/, '$1') @@ -11176,7 +11179,7 @@ exports.stringify = function (value) { var typeHint = canonicalType(value); - if (!~['object', 'array', 'function'].indexOf(typeHint)) { + if (!~['object', 'array', 'function', 'null-prototype'].indexOf(typeHint)) { if (typeHint === 'buffer') { var json = Buffer.prototype.toJSON.call(value); // Based on the toJSON result @@ -11362,8 +11365,12 @@ break; } /* falls through */ + case 'null-prototype': case 'object': canonicalizedObj = canonicalizedObj || {}; + if (typeHint === 'null-prototype' && Symbol.toStringTag in value) { + canonicalizedObj['[Symbol.toStringTag]'] = value[Symbol.toStringTag]; + } withStack(value, function () { Object.keys(value) .sort() @@ -11631,7 +11638,9 @@ seen.add(obj); for (const k in obj) { - if (Object.prototype.hasOwnProperty.call(obj, k)) { + const descriptor = Object.getOwnPropertyDescriptor(obj, k); + + if (descriptor && descriptor.writable) { obj[k] = _breakCircularDeps(obj[k]); } } @@ -12960,6 +12969,8 @@ var clearTimeout$1 = commonjsGlobal.clearTimeout; var toString = Object.prototype.toString; + var MAX_TIMEOUT = Math.pow(2, 31) - 1; + var runnable = Runnable$3; /** @@ -13035,8 +13046,7 @@ } // Clamp to range - var INT_MAX = Math.pow(2, 31) - 1; - var range = [0, INT_MAX]; + var range = [0, MAX_TIMEOUT]; ms = utils$2.clamp(ms, range); // see #1652 for reasoning @@ -13173,11 +13183,8 @@ */ Runnable$3.prototype.resetTimeout = function () { var self = this; - var ms = this.timeout(); + var ms = this.timeout() || MAX_TIMEOUT; - if (ms === 0) { - return; - } this.clearTimeout(); this.timer = setTimeout$2(function () { if (self.timeout() === 0) { @@ -16724,11 +16731,12 @@ module.exports = HTML; /** - * Stats template. + * Stats template: Result, progress, passes, failures, and duration. */ var statsTemplate = '