From 797c000aa84bc2272b99b1e5200fbb00839e4c70 Mon Sep 17 00:00:00 2001 From: jackkav Date: Mon, 17 Aug 2026 11:09:28 +0200 Subject: [PATCH 1/4] feat(quickjs): insomnia.test()/pm.test() lifecycle + real chai parity Vendors chai@4.5.0 through the existing M3 npm-vendoring pipeline (sandbox-vendored-libs-list.ts -> chai.generated.ts) and binds its .expect as insomnia.expect, so pm.test() assertion messages match the hidden-window path byte-for-byte instead of a hand-rolled reimplementation. insomnia.test()/insomnia.test.skip() run entirely inside the VM, building requestTestResults in the same shape run-script.ts produces; a pm.test() the script doesn't await is still waited on before the run ends. Also generalizes the sendRequest bridge's teardown fix into a BridgeCalls registry that drains outstanding calls after the task settles (bounded by the script deadline) -- landing PR2's deferred item so a fire-and-forget insomnia.sendRequest(url, callback) actually gets its callback called instead of being silently dropped, with anything still open at the deadline cancelled and rejected with a real, observable error. --- .../scripts/sandbox-vendored-libs-list.ts | 4 + .../scripting/quickjs-script-engine.test.ts | 165 ++++++++++- .../src/scripting/quickjs-script-engine.ts | 260 ++++++++++++++---- .../sandbox/vendored/chai.generated.ts | 7 + .../sandbox/vendored/pkg/package-lock.json | 88 ++++++ .../sandbox/vendored/pkg/package.json | 3 +- 6 files changed, 462 insertions(+), 65 deletions(-) create mode 100644 packages/insomnia/src/templating/sandbox/vendored/chai.generated.ts diff --git a/packages/insomnia/scripts/sandbox-vendored-libs-list.ts b/packages/insomnia/scripts/sandbox-vendored-libs-list.ts index c3b89690fdf..6e6ffe4c3c4 100644 --- a/packages/insomnia/scripts/sandbox-vendored-libs-list.ts +++ b/packages/insomnia/scripts/sandbox-vendored-libs-list.ts @@ -9,4 +9,8 @@ import { type VendoredLib } from './sandbox-vendored-lib'; export const VENDORED_LIBS: VendoredLib[] = [ { name: 'uuid', entry: "module.exports = require('uuid');" }, { name: 'ajv', entry: "module.exports = require('ajv').default || require('ajv');" }, + // Also consumed outside the template-tag sandbox: quickjs-script-engine.ts binds this bundle's + // `.expect` as `insomnia.expect`, so pm.test()/insomnia.test() assertions match the hidden-window + // path byte-for-byte (same library, same error messages) instead of a hand-rolled reimplementation. + { name: 'chai', entry: "module.exports = require('chai');" }, ]; diff --git a/packages/insomnia/src/scripting/quickjs-script-engine.test.ts b/packages/insomnia/src/scripting/quickjs-script-engine.test.ts index dc4360fc550..e4446e3a8c4 100644 --- a/packages/insomnia/src/scripting/quickjs-script-engine.test.ts +++ b/packages/insomnia/src/scripting/quickjs-script-engine.test.ts @@ -175,6 +175,9 @@ describe('runScriptInQuickJs', () => { '__task', 'insomnia', '$', + 'chai', + '__testResults', + '__testPromises', ]); const unexpectedGlobals = (data.sandboxGlobalNames as string[]).filter( name => !baseline.has(name) && !ALLOWED_EXTRA_GLOBALS.has(name), @@ -429,6 +432,132 @@ describe('runScriptInQuickJs sendRequest bridge', () => { }); }); +describe('runScriptInQuickJs insomnia.test()/pm.test()', () => { + it('records pass, fail-with-message, and throw in one requestTestResults array, in order', async () => { + const context = baseContext(); + + const result = await runScriptInQuickJs({ + script: ` + await insomnia.test('passes', () => { + insomnia.expect(200).to.eql(200); + }); + await insomnia.test('fails with a message', () => { + insomnia.expect(199).to.eql(200); + }); + await insomnia.test('throws', () => { + throw new Error('boom'); + }); + `, + context, + }); + + expect(result.requestTestResults).toHaveLength(3); + expect(result.requestTestResults?.[0]).toMatchObject({ testCase: 'passes', status: 'passed' }); + expect(result.requestTestResults?.[1]).toMatchObject({ + testCase: 'fails with a message', + status: 'failed', + errorMessage: expect.stringContaining('expected 199 to deeply equal 200'), + }); + expect(result.requestTestResults?.[2]).toMatchObject({ + testCase: 'throws', + status: 'failed', + errorMessage: expect.stringContaining('boom'), + }); + }); + + it('$ is a Postman-compat alias, and pm-style chai chains work: type/length/include/oneOf/below/keys/property', async () => { + const context = baseContext(); + + const result = await runScriptInQuickJs({ + script: ` + $.test('happy tests', () => { + $.expect(200).to.eql(200); + $.expect('uname').to.be.a('string'); + $.expect('a').to.have.lengthOf(1); + $.expect('xxx_customer_id_yyy').to.include('customer_id'); + $.expect(201).to.be.oneOf([201, 202]); + $.expect(199).to.be.below(200); + $.expect({ a: 1, b: 2 }).to.have.all.keys('a', 'b'); + $.expect({ a: 1, b: 2 }).to.have.any.keys('a', 'b'); + $.expect({ a: 1, b: 2 }).to.not.have.any.keys('c', 'd'); + $.expect({ a: 1 }).to.have.property('a'); + $.expect({ a: 1, b: 2 }).to.be.a('object').that.has.all.keys('a', 'b'); + }); + `, + context, + }); + + expect(result.requestTestResults).toEqual([ + expect.objectContaining({ testCase: 'happy tests', status: 'passed' }), + ]); + }); + + it('waits for a test the script body did not await before considering the run done', async () => { + const context = baseContext(); + + const result = await runScriptInQuickJs({ + script: ` + insomnia.test('not awaited', async () => { + // QuickJS has no timers bridged in; a few microtask hops stand in for "still pending + // when the script body returns" without depending on one. + await Promise.resolve().then(() => Promise.resolve()).then(() => Promise.resolve()); + insomnia.expect(1).to.eql(1); + }); + insomnia.environment.set('reachedEnd', true); + `, + context, + }); + + expect((result.environment.data as Record).reachedEnd).toBe(true); + expect(result.requestTestResults).toEqual([expect.objectContaining({ testCase: 'not awaited', status: 'passed' })]); + }); + + it('records a skipped test without running its body', async () => { + const context = baseContext(); + + const result = await runScriptInQuickJs({ + script: `insomnia.test.skip('not run', () => { throw new Error('should never execute'); });`, + context, + }); + + expect(result.requestTestResults).toEqual([ + expect.objectContaining({ testCase: 'not run', status: 'skipped' }), + ]); + }); + + it('is caught by the script timeout, not a silent hang, when a test never resolves', async () => { + const context = baseContext(); + context.settings = { timeout: 30 } as any; + + await expect( + runScriptInQuickJs({ + script: `insomnia.test('never resolves', () => new Promise(() => {}));`, + context, + }), + ).rejects.toThrow(/Executing script timeout: 30/); + + const laterResult = await runScriptInQuickJs({ + script: 'insomnia.environment.set("ranCleanly", true);', + context: baseContext(), + }); + expect((laterResult.environment.data as Record).ranCleanly).toBe(true); + }); + + it('never populates requestTestResults when the script throws before registering any test', async () => { + const context = baseContext(); + + await expect( + runScriptInQuickJs({ + script: ` + throw new Error('top-level failure'); + insomnia.test('unreachable', () => {}); + `, + context, + }), + ).rejects.toThrow('top-level failure'); + }); +}); + /** * `vm.newPromise()` allocates three JSValues — the promise plus its `resolve`/`reject` functions — * and quickjs-emscripten frees the latter two only from inside `resolve()`/`reject()`. Disposing the @@ -469,24 +598,24 @@ describe('runScriptInQuickJs sendRequest bridge teardown', () => { return fetchMock; }; - it('tears down cleanly when the script never awaits its sendRequest', async () => { + it('delivers the callback of a sendRequest the script never awaited', async () => { stubSlowFetch(120); const context = baseContext(); - // Postman-style fire-and-forget: the script returns while the request is still in flight. + // The Postman-style callback form returns undefined, so this script reaches the end of its body + // with the request still in flight. The run drains outstanding bridge calls before tearing down, + // so the callback still fires instead of being silently dropped. const result = await runScriptInQuickJs({ script: ` - insomnia.sendRequest('https://example.com', () => {}); + insomnia.sendRequest('https://example.com', (error, response) => { + insomnia.environment.set('callbackBody', response.body); + }); insomnia.environment.set('finished', true); `, context, }); - expect((result.environment.data as Record).finished).toBe(true); - - // The response lands after teardown; it must be a silent no-op rather than an abort or an - // unhandled QuickJSUseAfterFree rejection out of the settle callback. - await new Promise(resolve => setTimeout(resolve, 250)); + expect(result.environment.data).toMatchObject({ finished: true, callbackBody: 'late' }); // A later run still works. Note this is NOT what detects the abort — a fresh context on the same // WASM module succeeds even after one, so only the assertions above are load-bearing here. @@ -497,6 +626,26 @@ describe('runScriptInQuickJs sendRequest bridge teardown', () => { expect((laterResult.environment.data as Record).ranCleanly).toBe(true); }); + it('cancels and reports a sendRequest still outstanding when the drain deadline passes', async () => { + stubSlowFetch(5000); + const context = baseContext(); + context.settings = { timeout: 150 } as any; + + const result = await runScriptInQuickJs({ + script: ` + insomnia.sendRequest('https://example.com', (error) => { + console.log('sendRequest failed: ' + error); + }); + insomnia.environment.set('finished', true); + `, + context, + }); + + expect((result.environment.data as Record).finished).toBe(true); + // The script learns the request was cancelled rather than the response vanishing silently. + expect(result.logs.some(row => row.includes('did not finish before the script did'))).toBe(true); + }); + it('tears down cleanly when the deadline fires while a sendRequest is in flight', async () => { stubSlowFetch(2000); const context = baseContext(); diff --git a/packages/insomnia/src/scripting/quickjs-script-engine.ts b/packages/insomnia/src/scripting/quickjs-script-engine.ts index 323a16ed5bd..90022118b74 100644 --- a/packages/insomnia/src/scripting/quickjs-script-engine.ts +++ b/packages/insomnia/src/scripting/quickjs-script-engine.ts @@ -3,6 +3,7 @@ import type { QuickJSContext, QuickJSDeferredPromise, QuickJSHandle } from 'quic import { Console } from '../../../insomnia-scripting-environment/src/objects/console'; import type { RequestContext } from '../../../insomnia-scripting-environment/src/objects/interfaces'; import { getQuickJSModule } from '../templating/sandbox/quickjs-runtime'; +import { CHAI_FACTORY_SOURCE } from '../templating/sandbox/vendored/chai.generated'; /** * The actual QuickJS execution engine — creates a fresh VM, bridges in the minimal API surface, runs @@ -19,11 +20,24 @@ import { getQuickJSModule } from '../templating/sandbox/quickjs-runtime'; * fetch-based protocol — see `installSendRequestBridge` below. It supports only a minimal request * shape (a URL string, or `{ url, method, headers, body }` with a plain string body) — no auth, * client certificates, cookies, or multipart/urlencoded bodies yet, and the response object exposes - * only `code`/`status`/`headers`/`body`/`responseTime`/`json()`/`text()` (no chai assertions, no - * `originalRequest`). Full parity with the hidden-window `Response` class is deferred. + * only `code`/`status`/`headers`/`body`/`responseTime`/`json()`/`text()` (no `originalRequest`). Full + * parity with the hidden-window `Response` class is deferred. * - * Not supported (throws inside the script if called): insomnia.test()/pm.test(), collectionVariables, - * vault, cookies, client certificates, and mutating the request. + * insomnia.test()/pm.test() run entirely inside the VM: `insomnia.expect` is the real `chai` library + * (vendored the same way as the template-tag sandbox's M3 npm libs — see + * `../templating/sandbox/vendored/chai.generated.ts` — so assertion messages match the hidden-window + * path byte-for-byte instead of a hand-rolled reimplementation), and `requestTestResults` is built up + * in a VM-side array in the same `{testCase, status, executionTime, errorMessage, category}` shape + * `insomnia-scripting-environment/src/objects/test.ts` produces, read back out after the task settles. + * + * A script can register work it doesn't await — `insomnia.sendRequest(url, callback)` returns + * `undefined`, so a script using it reaches the end of its body with the request still in flight. + * `driveTaskToCompletion` keeps draining `BridgeCalls` after `__task` settles (bounded by the script + * deadline), so the callback still runs instead of being silently dropped; anything still open when + * the deadline passes is cancelled and rejected with a real error the script can observe. + * + * Not supported (throws inside the script if called): collectionVariables, vault, cookies, client + * certificates, and mutating the request. */ export const runScriptInQuickJs = async ({ script, @@ -54,14 +68,10 @@ export const runScriptInQuickJs = async ({ const environmentData: Record = { ...context.environment.data }; const variablesData: Record = { ...context.transientVariables?.data }; - // Every VM promise handed to the script by `installSendRequestBridge` that hasn't settled yet. - // Each one owns three JSValues — the promise plus its `resolve`/`reject` functions — and - // quickjs-emscripten only frees the two functions from inside `resolve()`/`reject()`. A VM - // promise still pending when the runtime is freed therefore leaks two live function objects, - // which trips QuickJS's `assert(list_empty(&rt->gc_obj_list))` in `JS_FreeRuntime`: a native - // Emscripten abort rather than a catchable error, so it takes the script worker down instead of - // surfacing as a script failure. `finally` below settles this set before disposing. - const pendingDeferreds = new Set(); + const bridgeCalls = createBridgeCalls(); + // Whether `__task` settled — gates whether teardown may pump the VM. See `abandonAll`. + let taskSettled = false; + let requestTestResults: RequestContext['requestTestResults']; try { // Polled during synchronous execution so a tight sync loop in the script can't bypass the timeout. @@ -78,20 +88,18 @@ export const runScriptInQuickJs = async ({ installConsole(vm, scriptConsole); installKeyValueBridge(vm, '__envGet', '__envSet', environmentData); installKeyValueBridge(vm, '__varGet', '__varSet', variablesData); - installSendRequestBridge(vm, pendingDeferreds, authToken); + installSendRequestBridge(vm, bridgeCalls, authToken); setGlobalString(vm, '__requestJSON', JSON.stringify(context.request ?? {})); evalOrThrow(vm, BOOTSTRAP, ''); evalOrThrow(vm, wrapUserScript(script), ''); - await driveTaskToCompletion(vm, deadline, timeoutMs); + await driveTaskToCompletion(vm, bridgeCalls, deadline, timeoutMs); + taskSettled = true; + requestTestResults = readTestResults(vm); } finally { - // Ordering matters: free the resolve/reject functions of anything still in flight (a script - // that never awaited its sendRequest, or a run that hit the deadline mid-request) *before* - // the runtime, or `JS_FreeRuntime` aborts. `dispose()` is documented as idempotent, so - // already-settled deferreds still in the set are harmless. - pendingDeferreds.forEach(deferred => deferred.dispose()); - pendingDeferreds.clear(); + // Nothing may still own a VM handle when the runtime goes — see `abandonAll`. + bridgeCalls.abandonAll(vm, SEND_REQUEST_ABANDONED_MESSAGE, taskSettled); try { vm.dispose(); } catch (err) { @@ -117,6 +125,7 @@ export const runScriptInQuickJs = async ({ name: context.transientVariables?.name || 'transientVariables', data: variablesData, }, + requestTestResults, logs: scriptConsole.dumpLogsAsArray(), }; }; @@ -135,10 +144,11 @@ export const runScriptInQuickJs = async ({ const ENGINE_FAULT_MESSAGE = 'The QuickJS engine faulted while cleaning up after this script, a known issue with large amounts of data handled after an await. The script finished and its results are intact; the engine will be replaced before the next run.'; -const unsupportedApiMessage = (name: string): string => - `${name} is not supported yet by the QuickJS sandbox (proof of concept). Disable "Use QuickJS sandbox for scripts" in Settings > Scripting to use it.`; - +// Interpolated raw as code (not JSON-encoded as data) — see module-registry.ts's identical pattern +// for the template-tag sandbox's vendored libs. Trusted: it comes from a checked-in, generated file, +// never from user/script input. const BOOTSTRAP = ` +globalThis.chai = (${CHAI_FACTORY_SOURCE})(); globalThis.insomnia = { environment: { get: (key) => JSON.parse(__envGet(key)), @@ -203,7 +213,34 @@ globalThis.insomnia = { } return promise; }, - test: () => { throw new Error(${JSON.stringify(unsupportedApiMessage('insomnia.test()/pm.test()'))}); }, + expect: globalThis.chai.expect, +}; +globalThis.__testResults = []; +// Every promise started by insomnia.test()/insomnia.test.skip() — awaited after the user script body +// finishes, mirroring insomnia-scripting-environment/src/objects/test.ts's waitForAllTestsDone(), so +// a script that calls pm.test() without awaiting it still has the result recorded before the run ends. +globalThis.__testPromises = []; +globalThis.insomnia.test = (msg, fn) => { + const testPromise = (async () => { + const started = Date.now(); + try { + await fn(); + globalThis.__testResults.push({ testCase: msg, status: 'passed', executionTime: Date.now() - started, category: 'unknown' }); + } catch (e) { + globalThis.__testResults.push({ + testCase: msg, + status: 'failed', + executionTime: Date.now() - started, + errorMessage: 'error: ' + e + ' | ACTUAL: ' + (e && e.actual) + ' | EXPECTED: ' + (e && e.expected), + category: 'unknown', + }); + } + })(); + globalThis.__testPromises.push(testPromise); + return testPromise; +}; +globalThis.insomnia.test.skip = (msg) => { + globalThis.__testResults.push({ testCase: msg, status: 'skipped', executionTime: 0, category: 'unknown' }); }; globalThis.$ = globalThis.insomnia; `; @@ -211,9 +248,18 @@ globalThis.$ = globalThis.insomnia; const wrapUserScript = (script: string): string => ` globalThis.__task = (async () => { ${script} + await Promise.all(globalThis.__testPromises); })(); `; +/** Reads back `requestTestResults` built up by insomnia.test() during the run. */ +const readTestResults = (vm: QuickJSContext): RequestContext['requestTestResults'] => { + const handle = vm.getProp(vm.global, '__testResults'); + const results = vm.dump(handle) as RequestContext['requestTestResults']; + handle.dispose(); + return results; +}; + const installConsole = (vm: QuickJSContext, scriptConsole: Console): void => { const consoleHandle = vm.newObject(); (['log', 'warn', 'error', 'info', 'debug'] as const).forEach(level => { @@ -276,12 +322,17 @@ const assertSupportedSendRequestBody = (requestBodyJson: string): void => { } }; -const sendRequestViaFetch = async (requestBodyJson: string, authToken?: string): Promise> => { +const sendRequestViaFetch = async ( + requestBodyJson: string, + signal: AbortSignal, + authToken?: string, +): Promise> => { assertSupportedSendRequestBody(requestBodyJson); const resp = await fetch(SEND_REQUEST_ENDPOINT, { method: 'post', headers: authToken ? { [TEMPLATING_DB_AUTH_HEADER]: authToken } : undefined, body: requestBodyJson, + signal, }); const text = await resp.text(); let parsed: unknown; @@ -306,68 +357,150 @@ const sendRequestViaFetch = async (requestBodyJson: string, authToken?: string): return parsed as Record; }; +const SEND_REQUEST_ABANDONED_MESSAGE = + 'insomnia.sendRequest() did not finish before the script did — the request was cancelled.'; + +/** Settle/pump rounds allowed at teardown; the last one only settles. See `abandonAll`. */ +const MAX_ABANDON_PASSES = 3; + +/** One in-flight `insomnia.sendRequest()`: the VM promise the script is holding, plus its fetch. */ +interface BridgeCall { + deferred: QuickJSDeferredPromise; + controller: AbortController; +} + +type BridgeCalls = ReturnType; + +/** + * Owns every `insomnia.sendRequest()` still waiting on the host. + * + * This registry exists because of how `vm.newPromise()` allocates: each deferred holds THREE + * JSValues — the promise plus its `resolve`/`reject` functions — and quickjs-emscripten frees the + * two functions only from inside `resolve()`/`reject()`. A deferred that is never settled therefore + * keeps two live function objects in the runtime, and `JS_FreeRuntime` aborts the whole WASM module + * on `assert(list_empty(&rt->gc_obj_list))` — a native Emscripten abort rather than a catchable + * error, so it takes the script worker down instead of surfacing as a script failure. + * + * Rather than leave that invariant to each callback, the run owns the set: `driveTaskToCompletion` + * drains it before finishing (so a fire-and-forget `sendRequest(url, callback)` still gets its + * callback called), and `abandonAll` guarantees it is empty before `vm.dispose()`. + */ +const createBridgeCalls = () => { + const open = new Set(); + + return { + get size(): number { + return open.size; + }, + + add(call: BridgeCall): void { + open.add(call); + }, + + /** Called once a call has settled the VM promise itself; nothing left to clean up. */ + close(call: BridgeCall): void { + open.delete(call); + }, + + /** + * Cancel the host work for every call still open and settle its VM promise, so the run can + * dispose the context safely. Rejecting is preferred over disposing the deferred outright: it + * is the library's documented path, it frees the resolvers the same way, and a script that + * attached a `.catch` (or passed a callback) gets a real error instead of a promise that + * silently never settles. `dispose()` still runs afterwards as a backstop — it is idempotent, + * and it is the thing that actually has to have happened before the runtime goes. + * + * `notifyScript` controls whether the VM job queue is pumped so the script's own `.catch` / + * callback actually runs. It is only safe once `__task` has settled: pumping while the task is + * still pending lets the rejection resume the script and settle the task, at which point + * `vm.resolvePromise`'s reject callback then `dup()`s the error into a host promise that + * `driveTaskToCompletion` has already stopped listening to — an undisposed handle, i.e. the same + * abort by another route. On the timeout/error path the deferreds are therefore freed silently. + * + * Passes alternate settle/pump because a script's handler can start another request; the last + * pass never pumps, so nothing can be left unsettled behind us. + */ + abandonAll(vm: QuickJSContext, reason: string, notifyScript: boolean): void { + if (notifyScript && open.size > 0 && vm.alive) { + // Teardown can run because the deadline passed, and an armed interrupt handler aborts the + // pump below immediately — so the script would never see the cancellation. Nothing after + // this point runs unbounded user code: the passes are capped. + vm.runtime.removeInterruptHandler(); + } + for (let pass = 0; pass < MAX_ABANDON_PASSES && open.size > 0; pass++) { + const batch = [...open]; + open.clear(); + batch.forEach(({ deferred, controller }) => { + controller.abort(); + if (vm.alive && deferred.alive) { + const errorHandle = vm.newError(reason); + deferred.reject(errorHandle); + errorHandle.dispose(); + } + deferred.dispose(); + }); + if (notifyScript && vm.alive && pass < MAX_ABANDON_PASSES - 1) { + vm.runtime.executePendingJobs().dispose(); + } + } + open.clear(); + }, + }; +}; + /** Registers the async `__sendRequest(bodyJson)` bridge backing `insomnia.sendRequest()` in BOOTSTRAP. */ -const installSendRequestBridge = ( - vm: QuickJSContext, - pendingDeferreds: Set, - authToken?: string, -): void => { +const installSendRequestBridge = (vm: QuickJSContext, calls: BridgeCalls, authToken?: string): void => { const fn = vm.newFunction('__sendRequest', bodyHandle => { const bodyJson = vm.getString(bodyHandle); - const deferred = vm.newPromise(); - // Registered so the run's `finally` can free this deferred's resolve/reject functions if the - // fetch is still outstanding when the VM is torn down — see `pendingDeferreds`' comment. - pendingDeferreds.add(deferred); + const call: BridgeCall = { deferred: vm.newPromise(), controller: new AbortController() }; + calls.add(call); + // `Promise.resolve().then(...)` defers the real fetch() call by one microtask tick so it never // runs while still nested inside this C-to-JS callback frame — matching plugin-tag-sandbox.ts's // installHostBridge, the proven-working equivalent for the template-tag sandbox. Promise.resolve() - .then(() => sendRequestViaFetch(bodyJson, authToken)) + .then(() => sendRequestViaFetch(bodyJson, call.controller.signal, authToken)) .then( - value => settle(vm, deferred, pendingDeferreds, JSON.stringify({ ok: true, value })), + value => settleCall(vm, calls, call, JSON.stringify({ ok: true, value })), err => - settle( + settleCall( vm, - deferred, - pendingDeferreds, + calls, + call, JSON.stringify({ ok: false, error: err instanceof Error ? err.message : String(err) }), ), ); + // The settled VM promise schedules a job; pump it so the awaiting script resumes. - deferred.settled.then(() => { + call.deferred.settled.then(() => { if (vm.alive) { // executePendingJobs() returns a DisposableResult — on failure its `.error` is a live // QuickJSHandle that leaks if the result is discarded rather than disposed. vm.runtime.executePendingJobs().dispose(); } }); - return deferred.handle; + + return call.deferred.handle; }); setGlobal(vm, '__sendRequest', fn); }; /** - * Resolve a bridge deferred with a JSON payload, if the VM is still around to receive it. + * Hand a host response back to the script, unless the run already abandoned this call. * - * A `fetch()` can land after the run has finished (the script never awaited it, or the deadline - * fired first), by which point the VM is gone: `vm.newString` on a disposed context throws + * `abandonAll` settles and drops anything outstanding, so by the time a cancelled fetch rejects + * here the deferred is dead and there is nothing to do. Touching a disposed context would throw * `QuickJSUseAfterFree` synchronously inside this `.then`, i.e. an unhandled rejection in the - * worker. `deferred.alive` covers the narrower case of a deferred already force-disposed by the - * run's `finally` while the context itself is somehow still up. + * worker, so both guards matter. */ -const settle = ( - vm: QuickJSContext, - deferred: QuickJSDeferredPromise, - pendingDeferreds: Set, - value: string, -): void => { - if (!vm.alive || !deferred.alive) { +const settleCall = (vm: QuickJSContext, calls: BridgeCalls, call: BridgeCall, value: string): void => { + if (!vm.alive || !call.deferred.alive) { return; } const handle = vm.newString(value); - deferred.resolve(handle); + call.deferred.resolve(handle); handle.dispose(); - pendingDeferreds.delete(deferred); + calls.close(call); }; /** Registers `(key)`/`(key, jsonValue)` host functions backed by a plain object. */ @@ -424,7 +557,12 @@ const evalOrThrow = (vm: QuickJSContext, code: string, filename: string): void = }; /** Drives `globalThis.__task` (a VM promise wrapping the user script) to completion. */ -const driveTaskToCompletion = async (vm: QuickJSContext, deadline: number, timeoutMs: number): Promise => { +const driveTaskToCompletion = async ( + vm: QuickJSContext, + calls: BridgeCalls, + deadline: number, + timeoutMs: number, +): Promise => { const taskHandle = vm.getProp(vm.global, '__task'); const resultPromise = vm.resolvePromise(taskHandle); taskHandle.dispose(); @@ -455,6 +593,16 @@ const driveTaskToCompletion = async (vm: QuickJSContext, deadline: number, timeo if ('value' in settled) { settled.value.dispose(); } + + // The script can finish with requests still in flight — the Postman-style + // `insomnia.sendRequest(url, callback)` form returns undefined, so a script using it reaches the + // end of its body immediately. Returning here would tear the VM down before those responses land, + // silently dropping every callback. Keep pumping until they arrive or the deadline passes; + // whatever is left over is cancelled and rejected by `abandonAll`. + while (calls.size > 0 && Date.now() <= deadline) { + vm.runtime.executePendingJobs().dispose(); + await new Promise(resolve => setTimeout(resolve, 0)); + } }; const toError = (data: unknown): Error => { diff --git a/packages/insomnia/src/templating/sandbox/vendored/chai.generated.ts b/packages/insomnia/src/templating/sandbox/vendored/chai.generated.ts new file mode 100644 index 00000000000..7558b21572a --- /dev/null +++ b/packages/insomnia/src/templating/sandbox/vendored/chai.generated.ts @@ -0,0 +1,7 @@ +// @generated by scripts/generate-sandbox-vendored.ts — DO NOT EDIT BY HAND. +// Vendored, pinned bundle of "chai" for the QuickJS template-tag sandbox (M3). +// Sourced from the isolated install in vendored/pkg/ (see its package.json) — NOT the app's own node_modules. +// Regenerate with: npm run sandbox:vendored:generate -w insomnia + +export const CHAI_FACTORY_VERSION = "4.5.0"; +export const CHAI_FACTORY_SOURCE = "function () {\n var module = { exports: {} };\n var exports = module.exports;\n (function (module, exports) {\nvar q=(a,i)=>()=>(i||a((i={exports:{}}).exports,i),i.exports);var $e=q((go,ht)=>{function lt(){var a=[].slice.call(arguments);function i(t,f){Object.keys(f).forEach(function(e){~a.indexOf(e)||(t[e]=f[e])})}return function(){for(var f=[].slice.call(arguments),e=0,n={};e{\"use strict\";function pt(a,i){return typeof a>\"u\"||a===null?!1:i in Object(a)}function yt(a){var i=a.replace(/([^\\\\])\\[/g,\"$1.[\"),t=i.match(/(\\\\\\.|[^.]+?)+/g);return t.map(function(e){if(e===\"constructor\"||e===\"__proto__\"||e===\"prototype\")return{};var n=/^\\[(\\d+)\\]$/,r=n.exec(e),o=null;return r?o={i:parseFloat(r[1])}:o={p:e.replace(/\\\\([.[\\]])/g,\"$1\")},o})}function dt(a,i,t){var f=a,e=null;t=typeof t>\"u\"?i.length:t;for(var n=0;n\"u\"?f=f[r.i]:f=f[r.p],n===t-1&&(e=f))}return e}function ar(a,i,t){for(var f=a,e=t.length,n=null,r=0;r\"u\"?n.i:n.p,f[o]=i;else if(typeof n.p<\"u\"&&f[n.p])f=f[n.p];else if(typeof n.i<\"u\"&&f[n.i])f=f[n.i];else{var v=t[r+1];o=typeof n.p>\"u\"?n.i:n.p,l=typeof v.p>\"u\"?[]:{},f[o]=l,f=f[o]}}}function gt(a,i){var t=yt(i),f=t[t.length-1],e={parent:t.length>1?dt(a,t,t.length-1):a,name:f.p||f.i,value:dt(a,t)};return e.exists=pt(e.parent,e.name),e}function ur(a,i){var t=gt(a,i);return t.value}function cr(a,i,t){var f=yt(i);return ar(a,t,f),a}bt.exports={hasProperty:pt,getPathInfo:gt,getPathValue:ur,setPathValue:cr}});var Z=q((mo,vt)=>{vt.exports=function(i,t,f){var e=i.__flags||(i.__flags=Object.create(null));if(arguments.length===3)e[t]=f;else return e[t]}});var xt=q((vo,wt)=>{var fr=Z();wt.exports=function(i,t){var f=fr(i,\"negate\"),e=t[0];return f?!e:e}});var Se=q((_e,Je)=>{(function(a,i){typeof _e==\"object\"&&typeof Je<\"u\"?Je.exports=i():typeof define==\"function\"&&define.amd?define(i):(a=typeof globalThis<\"u\"?globalThis:a||self,a.typeDetect=i())})(_e,(function(){\"use strict\";var a=typeof Promise==\"function\",i=(function(F){if(typeof globalThis==\"object\")return globalThis;Object.defineProperty(F,\"typeDetectGlobalObject\",{get:function(){return this},configurable:!0});var Q=typeDetectGlobalObject;return delete F.typeDetectGlobalObject,Q})(Object.prototype),t=typeof Symbol<\"u\",f=typeof Map<\"u\",e=typeof Set<\"u\",n=typeof WeakMap<\"u\",r=typeof WeakSet<\"u\",o=typeof DataView<\"u\",l=t&&typeof Symbol.iterator<\"u\",v=t&&typeof Symbol.toStringTag<\"u\",P=e&&typeof Set.prototype.entries==\"function\",R=f&&typeof Map.prototype.entries==\"function\",X=P&&Object.getPrototypeOf(new Set().entries()),K=R&&Object.getPrototypeOf(new Map().entries()),V=l&&typeof Array.prototype[Symbol.iterator]==\"function\",re=V&&Object.getPrototypeOf([][Symbol.iterator]()),_=l&&typeof String.prototype[Symbol.iterator]==\"function\",ce=_&&Object.getPrototypeOf(\"\"[Symbol.iterator]()),fe=8,le=-1;function he(F){var Q=typeof F;if(Q!==\"object\")return Q;if(F===null)return\"null\";if(F===i)return\"global\";if(Array.isArray(F)&&(v===!1||!(Symbol.toStringTag in F)))return\"Array\";if(typeof window==\"object\"&&window!==null){if(typeof window.location==\"object\"&&F===window.location)return\"Location\";if(typeof window.document==\"object\"&&F===window.document)return\"Document\";if(typeof window.navigator==\"object\"){if(typeof window.navigator.mimeTypes==\"object\"&&F===window.navigator.mimeTypes)return\"MimeTypeArray\";if(typeof window.navigator.plugins==\"object\"&&F===window.navigator.plugins)return\"PluginArray\"}if((typeof window.HTMLElement==\"function\"||typeof window.HTMLElement==\"object\")&&F instanceof window.HTMLElement){if(F.tagName===\"BLOCKQUOTE\")return\"HTMLQuoteElement\";if(F.tagName===\"TD\")return\"HTMLTableDataCellElement\";if(F.tagName===\"TH\")return\"HTMLTableHeaderCellElement\"}}var H=v&&F[Symbol.toStringTag];if(typeof H==\"string\")return H;var z=Object.getPrototypeOf(F);return z===RegExp.prototype?\"RegExp\":z===Date.prototype?\"Date\":a&&z===Promise.prototype?\"Promise\":e&&z===Set.prototype?\"Set\":f&&z===Map.prototype?\"Map\":r&&z===WeakSet.prototype?\"WeakSet\":n&&z===WeakMap.prototype?\"WeakMap\":o&&z===DataView.prototype?\"DataView\":f&&z===K?\"Map Iterator\":e&&z===X?\"Set Iterator\":V&&z===re?\"Array Iterator\":_&&z===ce?\"String Iterator\":z===null?\"Object\":Object.prototype.toString.call(F).slice(fe,le)}return he}))});var Mt=q((wo,St)=>{var lr=$e(),Ze=Z(),hr=Se();St.exports=function(i,t){var f=Ze(i,\"message\"),e=Ze(i,\"ssfi\");f=f?f+\": \":\"\",i=Ze(i,\"object\"),t=t.map(function(o){return o.toLowerCase()}),t.sort();var n=t.map(function(o,l){var v=~[\"a\",\"e\",\"i\",\"o\",\"u\"].indexOf(o.charAt(0))?\"an\":\"a\",P=t.length>1&&l===t.length-1?\"or \":\"\";return P+v+\" \"+o}).join(\", \"),r=hr(i).toLowerCase();if(!t.some(function(o){return r===o}))throw new lr(f+\"object tested must be \"+n+\", but \"+r+\" given\",void 0,e)}});var Qe=q((xo,Pt)=>{Pt.exports=function(i,t){return t.length>4?t[4]:i._obj}});var ze=q((So,Et)=>{\"use strict\";var dr=Function.prototype.toString,pr=/\\s*function(?:\\s|\\s*\\/\\*[^(?:*\\/)]+\\*\\/\\s*)*([^\\s\\(\\/]+)/,yr=512;function gr(a){if(typeof a!=\"function\")return null;var i=\"\";if(typeof Function.prototype.name>\"u\"&&typeof a.name>\"u\"){var t=dr.call(a);if(t.indexOf(\"(\")>yr)return i;var f=t.match(pr);f&&(i=f[1])}else i=a.name;return i}Et.exports=gr});var Ot=q(()=>{});var Nt=q((Ce,qt)=>{(function(a,i){typeof Ce==\"object\"&&typeof qt<\"u\"?i(Ce):typeof define==\"function\"&&define.amd?define([\"exports\"],i):(a=typeof globalThis<\"u\"?globalThis:a||self,i(a.loupe={}))})(Ce,(function(a){\"use strict\";function i(u){\"@babel/helpers - typeof\";return typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?i=function(c){return typeof c}:i=function(c){return c&&typeof Symbol==\"function\"&&c.constructor===Symbol&&c!==Symbol.prototype?\"symbol\":typeof c},i(u)}function t(u,c){return f(u)||e(u,c)||n(u,c)||o()}function f(u){if(Array.isArray(u))return u}function e(u,c){if(!(typeof Symbol>\"u\"||!(Symbol.iterator in Object(u)))){var y=[],x=!0,M=!1,N=void 0;try{for(var D=u[Symbol.iterator](),B;!(x=(B=D.next()).done)&&(y.push(B.value),!(c&&y.length===c));x=!0);}catch(G){M=!0,N=G}finally{try{!x&&D.return!=null&&D.return()}finally{if(M)throw N}}return y}}function n(u,c){if(u){if(typeof u==\"string\")return r(u,c);var y=Object.prototype.toString.call(u).slice(8,-1);if(y===\"Object\"&&u.constructor&&(y=u.constructor.name),y===\"Map\"||y===\"Set\")return Array.from(u);if(y===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return r(u,c)}}function r(u,c){(c==null||c>u.length)&&(c=u.length);for(var y=0,x=new Array(c);y0&&arguments[0]!==void 0?arguments[0]:{},c=u.showHidden,y=c===void 0?!1:c,x=u.depth,M=x===void 0?2:x,N=u.colors,D=N===void 0?!1:N,B=u.customInspect,G=B===void 0?!0:B,W=u.showProxy,J=W===void 0?!1:W,oe=u.maxArrayLength,Re=oe===void 0?1/0:oe,we=u.breakLength,pe=we===void 0?1/0:we,xe=u.seen,or=xe===void 0?[]:xe,ct=u.truncate,ir=ct===void 0?1/0:ct,ft=u.stylize,sr=ft===void 0?String:ft,Ue={showHidden:!!y,depth:Number(M),colors:!!D,customInspect:!!G,showProxy:!!J,maxArrayLength:Number(Re),breakLength:Number(pe),truncate:Number(ir),seen:or,stylize:sr};return Ue.colors&&(Ue.stylize=R),Ue}function K(u,c){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:P;u=String(u);var x=y.length,M=u.length;return x>c&&M>x?y:M>c&&M>x?\"\".concat(u.slice(0,c-x)).concat(y):u}function V(u,c,y){var x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:\", \";y=y||c.inspect;var M=u.length;if(M===0)return\"\";for(var N=c.truncate,D=\"\",B=\"\",G=\"\",W=0;WN&&D.length+G.length<=N||!J&&!oe&&xe>N||(B=J?\"\":y(u[W+1],c)+(oe?\"\":x),!J&&oe&&xe>N&&pe+B.length>N))break;if(D+=we,!J&&!oe&&pe+B.length>=N){G=\"\".concat(P,\"(\").concat(u.length-W-1,\")\");break}G=\"\"}return\"\".concat(D).concat(G)}function re(u){return u.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?u:JSON.stringify(u).replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\")}function _(u,c){var y=t(u,2),x=y[0],M=y[1];return c.truncate-=2,typeof x==\"string\"?x=re(x):typeof x!=\"number\"&&(x=\"[\".concat(c.inspect(x,c),\"]\")),c.truncate-=x.length,M=c.inspect(M,c),\"\".concat(x,\": \").concat(M)}function ce(u,c){var y=Object.keys(u).slice(u.length);if(!u.length&&!y.length)return\"[]\";c.truncate-=4;var x=V(u,c);c.truncate-=x.length;var M=\"\";return y.length&&(M=V(y.map(function(N){return[N,u[N]]}),c,_)),\"[ \".concat(x).concat(M?\", \".concat(M):\"\",\" ]\")}var fe=Function.prototype.toString,le=/\\s*function(?:\\s|\\s*\\/\\*[^(?:*\\/)]+\\*\\/\\s*)*([^\\s\\(\\/]+)/,he=512;function F(u){if(typeof u!=\"function\")return null;var c=\"\";if(typeof Function.prototype.name>\"u\"&&typeof u.name>\"u\"){var y=fe.call(u);if(y.indexOf(\"(\")>he)return c;var x=y.match(le);x&&(c=x[1])}else c=u.name;return c}var Q=F,H=function(c){return typeof Buffer==\"function\"&&c instanceof Buffer?\"Buffer\":c[Symbol.toStringTag]?c[Symbol.toStringTag]:Q(c.constructor)};function z(u,c){var y=H(u);c.truncate-=y.length+4;var x=Object.keys(u).slice(u.length);if(!u.length&&!x.length)return\"\".concat(y,\"[]\");for(var M=\"\",N=0;N \").concat(M)}function Ae(u){var c=[];return u.forEach(function(y,x){c.push([x,y])}),c}function Ke(u,c){var y=u.size-1;return y<=0?\"Map{}\":(c.truncate-=7,\"Map{ \".concat(V(Ae(u),c,Ne),\" }\"))}var Le=Number.isNaN||function(u){return u!==u};function me(u,c){return Le(u)?c.stylize(\"NaN\",\"number\"):u===1/0?c.stylize(\"Infinity\",\"number\"):u===-1/0?c.stylize(\"-Infinity\",\"number\"):u===0?c.stylize(1/u===1/0?\"+0\":\"-0\",\"number\"):c.stylize(K(u,c.truncate),\"number\")}function ve(u,c){var y=K(u.toString(),c.truncate-1);return y!==P&&(y+=\"n\"),c.stylize(y,\"bigint\")}function je(u,c){var y=u.toString().split(\"/\")[2],x=c.truncate-(2+y.length),M=u.source;return c.stylize(\"/\".concat(K(M,x),\"/\").concat(y),\"regexp\")}function We(u){var c=[];return u.forEach(function(y){c.push(y)}),c}function s(u,c){return u.size===0?\"Set{}\":(c.truncate-=7,\"Set{ \".concat(V(We(u),c),\" }\"))}var h=new RegExp(\"['\\\\u0000-\\\\u001f\\\\u007f-\\\\u009f\\\\u00ad\\\\u0600-\\\\u0604\\\\u070f\\\\u17b4\\\\u17b5\\\\u200c-\\\\u200f\\\\u2028-\\\\u202f\\\\u2060-\\\\u206f\\\\ufeff\\\\ufff0-\\\\uffff]\",\"g\"),p={\"\\b\":\"\\\\b\",\"\t\":\"\\\\t\",\"\\n\":\"\\\\n\",\"\\f\":\"\\\\f\",\"\\r\":\"\\\\r\",\"'\":\"\\\\'\",\"\\\\\":\"\\\\\\\\\"},g=16,m=4;function w(u){return p[u]||\"\\\\u\".concat(\"0000\".concat(u.charCodeAt(0).toString(g)).slice(-m))}function b(u,c){return h.test(u)&&(u=u.replace(h,w)),c.stylize(\"'\".concat(K(u,c.truncate-2),\"'\"),\"string\")}function d(u){return\"description\"in Symbol.prototype?u.description?\"Symbol(\".concat(u.description,\")\"):\"Symbol()\":u.toString()}var S=function(){return\"Promise{\\u2026}\"};try{var E=process.binding(\"util\"),O=E.getPromiseDetails,k=E.kPending,j=E.kRejected;Array.isArray(O(Promise.resolve()))&&(S=function(c,y){var x=O(c),M=t(x,2),N=M[0],D=M[1];return N===k?\"Promise{}\":\"Promise\".concat(N===j?\"!\":\"\",\"{\").concat(y.inspect(D,y),\"}\")})}catch{}var A=S;function T(u,c){var y=Object.getOwnPropertyNames(u),x=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(u):[];if(y.length===0&&x.length===0)return\"{}\";if(c.truncate-=4,c.seen=c.seen||[],c.seen.indexOf(u)>=0)return\"[Circular]\";c.seen.push(u);var M=V(y.map(function(B){return[B,u[B]]}),c,_),N=V(x.map(function(B){return[B,u[B]]}),c,_);c.seen.pop();var D=\"\";return M&&N&&(D=\", \"),\"{ \".concat(M).concat(D).concat(N,\" }\")}var C=typeof Symbol<\"u\"&&Symbol.toStringTag?Symbol.toStringTag:!1;function L(u,c){var y=\"\";return C&&C in u&&(y=u[C]),y=y||Q(u.constructor),(!y||y===\"_class\")&&(y=\"\"),c.truncate-=y.length,\"\".concat(y).concat(T(u,c))}function ee(u,c){return u.length===0?\"Arguments[]\":(c.truncate-=13,\"Arguments[ \".concat(V(u,c),\" ]\"))}var U=[\"stack\",\"line\",\"column\",\"name\",\"message\",\"fileName\",\"lineNumber\",\"columnNumber\",\"number\",\"description\"];function Y(u,c){var y=Object.getOwnPropertyNames(u).filter(function(D){return U.indexOf(D)===-1}),x=u.name;c.truncate-=x.length;var M=\"\";typeof u.message==\"string\"?M=K(u.message,c.truncate):y.unshift(\"message\"),M=M?\": \".concat(M):\"\",c.truncate-=M.length+5;var N=V(y.map(function(D){return[D,u[D]]}),c,_);return\"\".concat(x).concat(M).concat(N?\" { \".concat(N,\" }\"):\"\")}function Yn(u,c){var y=t(u,2),x=y[0],M=y[1];return c.truncate-=3,M?\"\".concat(c.stylize(x,\"yellow\"),\"=\").concat(c.stylize('\"'.concat(M,'\"'),\"string\")):\"\".concat(c.stylize(x,\"yellow\"))}function Ge(u,c){return V(u,c,it,`\n`)}function it(u,c){var y=u.getAttributeNames(),x=u.tagName.toLowerCase(),M=c.stylize(\"<\".concat(x),\"special\"),N=c.stylize(\">\",\"special\"),D=c.stylize(\"\"),\"special\");c.truncate-=x.length*2+5;var B=\"\";y.length>0&&(B+=\" \",B+=V(y.map(function(J){return[J,u.getAttribute(J)]}),c,Yn,\" \")),c.truncate-=B.length;var G=c.truncate,W=Ge(u.children,c);return W&&W.length>G&&(W=\"\".concat(P,\"(\").concat(u.children.length,\")\")),\"\".concat(M).concat(B).concat(N).concat(W).concat(D)}var Xn=typeof Symbol==\"function\"&&typeof Symbol.for==\"function\",Te=Xn?Symbol.for(\"chai/inspect\"):\"@@chai/inspect\",de=!1;try{var st=Ot();de=st.inspect?st.inspect.custom:!1}catch{de=!1}function at(){this.key=\"chai/loupe__\"+Math.random()+Date.now()}at.prototype={get:function(c){return c[this.key]},has:function(c){return this.key in c},set:function(c,y){Object.isExtensible(c)&&Object.defineProperty(c,this.key,{value:y,configurable:!0})}};var De=new(typeof WeakMap==\"function\"?WeakMap:at),Ie={},ut={undefined:function(c,y){return y.stylize(\"undefined\",\"undefined\")},null:function(c,y){return y.stylize(null,\"null\")},boolean:function(c,y){return y.stylize(c,\"boolean\")},Boolean:function(c,y){return y.stylize(c,\"boolean\")},number:me,Number:me,bigint:ve,BigInt:ve,string:b,String:b,function:be,Function:be,symbol:d,Symbol:d,Array:ce,Date:ge,Map:Ke,Set:s,RegExp:je,Promise:A,WeakSet:function(c,y){return y.stylize(\"WeakSet{\\u2026}\",\"special\")},WeakMap:function(c,y){return y.stylize(\"WeakMap{\\u2026}\",\"special\")},Arguments:ee,Int8Array:z,Uint8Array:z,Uint8ClampedArray:z,Int16Array:z,Uint16Array:z,Int32Array:z,Uint32Array:z,Float32Array:z,Float64Array:z,Generator:function(){return\"\"},DataView:function(){return\"\"},ArrayBuffer:function(){return\"\"},Error:Y,HTMLCollection:Ge,NodeList:Ge},Hn=function(c,y,x){return Te in c&&typeof c[Te]==\"function\"?c[Te](y):de&&de in c&&typeof c[de]==\"function\"?c[de](y.depth,y):\"inspect\"in c&&typeof c.inspect==\"function\"?c.inspect(y.depth,y):\"constructor\"in c&&De.has(c.constructor)?De.get(c.constructor)(c,y):Ie[x]?Ie[x](c,y):\"\"},er=Object.prototype.toString;function ke(u,c){c=X(c),c.inspect=ke;var y=c,x=y.customInspect,M=u===null?\"null\":i(u);if(M===\"object\"&&(M=er.call(u).slice(8,-1)),ut[M])return ut[M](u,c);if(x&&u){var N=Hn(u,c,M);if(N)return typeof N==\"string\"?N:ke(N,c)}var D=u?Object.getPrototypeOf(u):!1;return D===Object.prototype||D===null?T(u,c):u&&typeof HTMLElement==\"function\"&&u instanceof HTMLElement?it(u,c):\"constructor\"in u?u.constructor!==Object?L(u,c):T(u,c):u===Object(u)?T(u,c):c.stylize(String(u),M)}function tr(u,c){return De.has(u)?!1:(De.set(u,c),!0)}function nr(u,c){return u in Ie?!1:(Ie[u]=c,!0)}var rr=Te;a.custom=rr,a.default=ke,a.inspect=ke,a.registerConstructor=tr,a.registerStringTag=nr,Object.defineProperty(a,\"__esModule\",{value:!0})}))});var se=q((Eo,At)=>{At.exports={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:[\"then\",\"catch\",\"inspect\",\"toJSON\"],deepEqual:null}});var Be=q((qo,Tt)=>{var Oo=ze(),br=Nt(),jt=se();Tt.exports=mr;function mr(a,i,t,f){var e={colors:f,depth:typeof t>\"u\"?2:t,showHidden:i,truncate:jt.truncateThreshold?jt.truncateThreshold:1/0};return br.inspect(a,e)}});var Ye=q((No,It)=>{var vr=Be(),Dt=se();It.exports=function(i){var t=vr(i),f=Object.prototype.toString.call(i);if(Dt.truncateThreshold&&t.length>=Dt.truncateThreshold){if(f===\"[object Function]\")return!i.name||i.name===\"\"?\"[Function]\":\"[Function: \"+i.name+\"]\";if(f===\"[object Array]\")return\"[ Array(\"+i.length+\") ]\";if(f===\"[object Object]\"){var e=Object.keys(i),n=e.length>2?e.splice(0,2).join(\", \")+\", ...\":e.join(\", \");return\"{ Object (\"+n+\") }\"}else return t}else return t}});var zt=q((Ao,kt)=>{var Xe=Z(),wr=Qe(),He=Ye();kt.exports=function(i,t){var f=Xe(i,\"negate\"),e=Xe(i,\"object\"),n=t[3],r=wr(i,t),o=f?t[2]:t[1],l=Xe(i,\"message\");return typeof o==\"function\"&&(o=o()),o=o||\"\",o=o.replace(/#\\{this\\}/g,function(){return He(e)}).replace(/#\\{act\\}/g,function(){return He(r)}).replace(/#\\{exp\\}/g,function(){return He(n)}),l?l+\": \"+o:o}});var te=q((jo,Ct)=>{Ct.exports=function(i,t,f){var e=i.__flags||(i.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),f=arguments.length===3?f:!0;for(var n in e)(f||n!==\"object\"&&n!==\"ssfi\"&&n!==\"lockSsfi\"&&n!=\"message\")&&(t.__flags[n]=e[n])}});var Jt=q((To,nt)=>{\"use strict\";var Bt=Se();function Ut(){this._key=\"chai/deep-eql__\"+Math.random()+Date.now()}Ut.prototype={get:function(i){return i[this._key]},set:function(i,t){Object.isExtensible(i)&&Object.defineProperty(i,this._key,{value:t,configurable:!0})}};var tt=typeof WeakMap==\"function\"?WeakMap:Ut;function Ft(a,i,t){if(!t||ye(a)||ye(i))return null;var f=t.get(a);if(f){var e=f.get(i);if(typeof e==\"boolean\")return e}return null}function Fe(a,i,t,f){if(!(!t||ye(a)||ye(i))){var e=t.get(a);e?e.set(i,f):(e=new tt,e.set(i,f),t.set(a,e))}}nt.exports=Ve;nt.exports.MemoizeMap=tt;function Ve(a,i,t){if(t&&t.comparator)return Vt(a,i,t);var f=$t(a,i);return f!==null?f:Vt(a,i,t)}function $t(a,i){return a===i?a!==0||1/a===1/i:a!==a&&i!==i?!0:ye(a)||ye(i)?!1:null}function Vt(a,i,t){t=t||{},t.memoize=t.memoize===!1?!1:t.memoize||new tt;var f=t&&t.comparator,e=Ft(a,i,t.memoize);if(e!==null)return e;var n=Ft(i,a,t.memoize);if(n!==null)return n;if(f){var r=f(a,i);if(r===!1||r===!0)return Fe(a,i,t.memoize,r),r;var o=$t(a,i);if(o!==null)return o}var l=Bt(a);if(l!==Bt(i))return Fe(a,i,t.memoize,!1),!1;Fe(a,i,t.memoize,!0);var v=xr(a,i,l,t);return Fe(a,i,t.memoize,v),v}function xr(a,i,t,f){switch(t){case\"String\":case\"Number\":case\"Boolean\":case\"Date\":return Ve(a.valueOf(),i.valueOf());case\"Promise\":case\"Symbol\":case\"function\":case\"WeakMap\":case\"WeakSet\":return a===i;case\"Error\":return _t(a,i,[\"name\",\"message\",\"code\"],f);case\"Arguments\":case\"Int8Array\":case\"Uint8Array\":case\"Uint8ClampedArray\":case\"Int16Array\":case\"Uint16Array\":case\"Int32Array\":case\"Uint32Array\":case\"Float32Array\":case\"Float64Array\":case\"Array\":return ae(a,i,f);case\"RegExp\":return Sr(a,i);case\"Generator\":return Mr(a,i,f);case\"DataView\":return ae(new Uint8Array(a.buffer),new Uint8Array(i.buffer),f);case\"ArrayBuffer\":return ae(new Uint8Array(a),new Uint8Array(i),f);case\"Set\":return Kt(a,i,f);case\"Map\":return Kt(a,i,f);case\"Temporal.PlainDate\":case\"Temporal.PlainTime\":case\"Temporal.PlainDateTime\":case\"Temporal.Instant\":case\"Temporal.ZonedDateTime\":case\"Temporal.PlainYearMonth\":case\"Temporal.PlainMonthDay\":return a.equals(i);case\"Temporal.Duration\":return a.total(\"nanoseconds\")===i.total(\"nanoseconds\");case\"Temporal.TimeZone\":case\"Temporal.Calendar\":return a.toString()===i.toString();default:return Er(a,i,f)}}function Sr(a,i){return a.toString()===i.toString()}function Kt(a,i,t){try{if(a.size!==i.size)return!1;if(a.size===0)return!0}catch{return!1}var f=[],e=[];return a.forEach(function(r,o){f.push([r,o])}),i.forEach(function(r,o){e.push([r,o])}),ae(f.sort(),e.sort(),t)}function ae(a,i,t){var f=a.length;if(f!==i.length)return!1;if(f===0)return!0;for(var e=-1;++e{var Or=se();Zt.exports=function(){return Or.useProxy&&typeof Proxy<\"u\"&&typeof Reflect<\"u\"}});var Xt=q((Io,Yt)=>{var qr=ne(),Qt=Z(),Nr=Me(),Ar=te();Yt.exports=function(i,t,f){f=f===void 0?function(){}:f,Object.defineProperty(i,t,{get:function e(){!Nr()&&!Qt(this,\"lockSsfi\")&&Qt(this,\"ssfi\",e);var n=f.call(this);if(n!==void 0)return n;var r=new qr.Assertion;return Ar(this,r),r},configurable:!0})}});var Pe=q((ko,Ht)=>{var jr=Object.getOwnPropertyDescriptor(function(){},\"length\");Ht.exports=function(i,t,f){return jr.configurable&&Object.defineProperty(i,\"length\",{get:function(){throw Error(f?\"Invalid Chai property: \"+t+'.length. Due to a compatibility issue, \"length\" cannot directly follow \"'+t+'\". Use \"'+t+'.lengthOf\" instead.':\"Invalid Chai property: \"+t+'.length. See docs for proper usage of \"'+t+'\".')}}),i}});var tn=q((zo,en)=>{en.exports=function(i){var t=Object.getOwnPropertyNames(i);function f(n){t.indexOf(n)===-1&&t.push(n)}for(var e=Object.getPrototypeOf(i);e!==null;)Object.getOwnPropertyNames(e).forEach(f),e=Object.getPrototypeOf(e);return t}});var Ee=q((Co,on)=>{var Tr=se(),nn=Z(),Dr=tn(),Ir=Me();var rn=[\"__flags\",\"__methods\",\"_obj\",\"assert\"];on.exports=function(i,t){return Ir()?new Proxy(i,{get:function f(e,n){if(typeof n==\"string\"&&Tr.proxyExcludedKeys.indexOf(n)===-1&&!Reflect.has(e,n)){if(t)throw Error(\"Invalid Chai property: \"+t+\".\"+n+'. See docs for proper usage of \"'+t+'\".');var r=null,o=4;throw Dr(e).forEach(function(l){if(!Object.prototype.hasOwnProperty(l)&&rn.indexOf(l)===-1){var v=kr(n,l,o);v=t)return t;for(var f=[],e=0;e<=a.length;e++)f[e]=Array(i.length+1).fill(0),f[e][0]=e;for(var n=0;n=t){f[e][n]=t;continue}f[e][n]=Math.min(f[e-1][n]+1,f[e][n-1]+1,f[e-1][n-1]+(r===i.charCodeAt(n-1)?0:1))}return f[a.length][i.length]}});var un=q((Bo,an)=>{var zr=Pe(),Cr=ne(),sn=Z(),Br=Ee(),Fr=te();an.exports=function(i,t,f){var e=function(){sn(this,\"lockSsfi\")||sn(this,\"ssfi\",e);var n=f.apply(this,arguments);if(n!==void 0)return n;var r=new Cr.Assertion;return Fr(this,r),r};zr(e,t,!1),i[t]=Br(e,t)}});var fn=q((Fo,cn)=>{var Vr=ne(),Oe=Z(),Kr=Me(),Lr=te();cn.exports=function(i,t,f){var e=Object.getOwnPropertyDescriptor(i,t),n=function(){};e&&typeof e.get==\"function\"&&(n=e.get),Object.defineProperty(i,t,{get:function r(){!Kr()&&!Oe(this,\"lockSsfi\")&&Oe(this,\"ssfi\",r);var o=Oe(this,\"lockSsfi\");Oe(this,\"lockSsfi\",!0);var l=f(n).call(this);if(Oe(this,\"lockSsfi\",o),l!==void 0)return l;var v=new Vr.Assertion;return Lr(this,v),v},configurable:!0})}});var hn=q((Vo,ln)=>{var Wr=Pe(),Gr=ne(),qe=Z(),Rr=Ee(),Ur=te();ln.exports=function(i,t,f){var e=i[t],n=function(){throw new Error(t+\" is not a function\")};e&&typeof e==\"function\"&&(n=e);var r=function(){qe(this,\"lockSsfi\")||qe(this,\"ssfi\",r);var o=qe(this,\"lockSsfi\");qe(this,\"lockSsfi\",!0);var l=f(n).apply(this,arguments);if(qe(this,\"lockSsfi\",o),l!==void 0)return l;var v=new Gr.Assertion;return Ur(this,v),v};Wr(r,t,!1),i[t]=Rr(r,t)}});var bn=q((Ko,gn)=>{var $r=Pe(),_r=ne(),dn=Z(),Jr=Ee(),pn=te();var Zr=typeof Object.setPrototypeOf==\"function\",yn=function(){},Qr=Object.getOwnPropertyNames(yn).filter(function(a){var i=Object.getOwnPropertyDescriptor(yn,a);return typeof i!=\"object\"?!0:!i.configurable}),Yr=Function.prototype.call,Xr=Function.prototype.apply;gn.exports=function(i,t,f,e){typeof e!=\"function\"&&(e=function(){});var n={method:f,chainingBehavior:e};i.__methods||(i.__methods={}),i.__methods[t]=n,Object.defineProperty(i,t,{get:function(){n.chainingBehavior.call(this);var o=function(){dn(this,\"lockSsfi\")||dn(this,\"ssfi\",o);var P=n.method.apply(this,arguments);if(P!==void 0)return P;var R=new _r.Assertion;return pn(this,R),R};if($r(o,t,!0),Zr){var l=Object.create(this);l.call=Yr,l.apply=Xr,Object.setPrototypeOf(o,l)}else{var v=Object.getOwnPropertyNames(i);v.forEach(function(P){if(Qr.indexOf(P)===-1){var R=Object.getOwnPropertyDescriptor(i,P);Object.defineProperty(o,P,R)}})}return pn(this,o),Jr(o)},configurable:!0})}});var xn=q((Lo,wn)=>{var mn=ne(),vn=te();wn.exports=function(i,t,f,e){var n=i.__methods[t],r=n.chainingBehavior;n.chainingBehavior=function(){var v=e(r).call(this);if(v!==void 0)return v;var P=new mn.Assertion;return vn(this,P),P};var o=n.method;n.method=function(){var v=f(o).apply(this,arguments);if(v!==void 0)return v;var P=new mn.Assertion;return vn(this,P),P}}});var Pn=q((Wo,Mn)=>{var Sn=Be();Mn.exports=function(i,t){return Sn(i){En.exports=function(i){return typeof Object.getOwnPropertySymbols!=\"function\"?[]:Object.getOwnPropertySymbols(i).filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})}});var qn=q((Ro,On)=>{var Hr=rt();On.exports=function(i){return Object.keys(i).concat(Hr(i))}});var An=q((Uo,Nn)=>{\"use strict\";var ot=ze();function eo(a,i){return i instanceof Error&&a===i}function to(a,i){return i instanceof Error?a.constructor===i.constructor||a instanceof i.constructor:i.prototype instanceof Error||i===Error?a.constructor===i||a instanceof i:!1}function no(a,i){var t=typeof a==\"string\"?a:a.message;return i instanceof RegExp?i.test(t):typeof i==\"string\"?t.indexOf(i)!==-1:!1}function ro(a){var i=a;if(a instanceof Error)i=ot(a.constructor);else if(typeof a==\"function\"&&(i=ot(a),i===\"\")){var t=ot(new a);i=t||i}return i}function oo(a){var i=\"\";return a&&a.message?i=a.message:typeof a==\"string\"&&(i=a),i}Nn.exports={compatibleInstance:eo,compatibleConstructor:to,compatibleMessage:no,getMessage:oo,getConstructorName:ro}});var Tn=q(($o,jn)=>{function io(a){return a!==a}jn.exports=Number.isNaN||io});var kn=q((_o,In)=>{var so=Se(),Dn=Z();function ao(a){var i=so(a),t=[\"Array\",\"Object\",\"function\"];return t.indexOf(i)!==-1}In.exports=function(i,t){var f=Dn(i,\"operator\"),e=Dn(i,\"negate\"),n=t[3],r=e?t[2]:t[1];if(f)return f;if(typeof r==\"function\"&&(r=r()),r=r||\"\",!!r&&!/\\shave\\s/.test(r)){var o=ao(n);return/\\snot\\s/.test(r)?o?\"notDeepStrictEqual\":\"notStrictEqual\":o?\"deepStrictEqual\":\"strictEqual\"}}});var Cn=q(I=>{var zn=mt();I.test=xt();I.type=Se();I.expectTypes=Mt();I.getMessage=zt();I.getActual=Qe();I.inspect=Be();I.objDisplay=Ye();I.flag=Z();I.transferFlags=te();I.eql=Jt();I.getPathInfo=zn.getPathInfo;I.hasProperty=zn.hasProperty;I.getName=ze();I.addProperty=Xt();I.addMethod=un();I.overwriteProperty=fn();I.overwriteMethod=hn();I.addChainableMethod=bn();I.overwriteChainableMethod=xn();I.compareByInspect=Pn();I.getOwnEnumerablePropertySymbols=rt();I.getOwnEnumerableProperties=qn();I.checkError=An();I.proxify=Ee();I.addLengthGuard=Pe();I.isProxyEnabled=Me();I.isNaN=Tn();I.getOperator=kn()});var Fn=q((Zo,Bn)=>{var ue=se();Bn.exports=function(a,i){var t=a.AssertionError,f=i.flag;a.Assertion=e;function e(n,r,o,l){return f(this,\"ssfi\",o||e),f(this,\"lockSsfi\",l),f(this,\"object\",n),f(this,\"message\",r),f(this,\"eql\",ue.deepEqual||i.eql),i.proxify(this)}Object.defineProperty(e,\"includeStack\",{get:function(){return console.warn(\"Assertion.includeStack is deprecated, use chai.config.includeStack instead.\"),ue.includeStack},set:function(n){console.warn(\"Assertion.includeStack is deprecated, use chai.config.includeStack instead.\"),ue.includeStack=n}}),Object.defineProperty(e,\"showDiff\",{get:function(){return console.warn(\"Assertion.showDiff is deprecated, use chai.config.showDiff instead.\"),ue.showDiff},set:function(n){console.warn(\"Assertion.showDiff is deprecated, use chai.config.showDiff instead.\"),ue.showDiff=n}}),e.addProperty=function(n,r){i.addProperty(this.prototype,n,r)},e.addMethod=function(n,r){i.addMethod(this.prototype,n,r)},e.addChainableMethod=function(n,r,o){i.addChainableMethod(this.prototype,n,r,o)},e.overwriteProperty=function(n,r){i.overwriteProperty(this.prototype,n,r)},e.overwriteMethod=function(n,r){i.overwriteMethod(this.prototype,n,r)},e.overwriteChainableMethod=function(n,r,o){i.overwriteChainableMethod(this.prototype,n,r,o)},e.prototype.assert=function(n,r,o,l,v,P){var R=i.test(this,arguments);if(P!==!1&&(P=!0),l===void 0&&v===void 0&&(P=!1),ue.showDiff!==!0&&(P=!1),!R){r=i.getMessage(this,arguments);var X=i.getActual(this,arguments),K={actual:X,expected:l,showDiff:P},V=i.getOperator(this,arguments);throw V&&(K.operator=V),new t(r,K,ue.includeStack?this.assert:f(this,\"ssfi\"))}};Object.defineProperty(e.prototype,\"_obj\",{get:function(){return f(this,\"object\")},set:function(n){f(this,\"object\",n)}})}});var Kn=q((Qo,Vn)=>{Vn.exports=function(a,i){var t=a.Assertion,f=a.AssertionError,e=i.flag;[\"to\",\"be\",\"been\",\"is\",\"and\",\"has\",\"have\",\"with\",\"that\",\"which\",\"at\",\"of\",\"same\",\"but\",\"does\",\"still\",\"also\"].forEach(function(s){t.addProperty(s)}),t.addProperty(\"not\",function(){e(this,\"negate\",!0)}),t.addProperty(\"deep\",function(){e(this,\"deep\",!0)}),t.addProperty(\"nested\",function(){e(this,\"nested\",!0)}),t.addProperty(\"own\",function(){e(this,\"own\",!0)}),t.addProperty(\"ordered\",function(){e(this,\"ordered\",!0)}),t.addProperty(\"any\",function(){e(this,\"any\",!0),e(this,\"all\",!1)}),t.addProperty(\"all\",function(){e(this,\"all\",!0),e(this,\"any\",!1)});function n(s,h){h&&e(this,\"message\",h),s=s.toLowerCase();var p=e(this,\"object\"),g=~[\"a\",\"e\",\"i\",\"o\",\"u\"].indexOf(s.charAt(0))?\"an \":\"a \";this.assert(s===i.type(p).toLowerCase(),\"expected #{this} to be \"+g+s,\"expected #{this} not to be \"+g+s)}t.addChainableMethod(\"an\",n),t.addChainableMethod(\"a\",n);function r(s,h){return i.isNaN(s)&&i.isNaN(h)||s===h}function o(){e(this,\"contains\",!0)}function l(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=i.type(p).toLowerCase(),m=e(this,\"message\"),w=e(this,\"negate\"),b=e(this,\"ssfi\"),d=e(this,\"deep\"),S=d?\"deep \":\"\",E=d?e(this,\"eql\"):r;m=m?m+\": \":\"\";var O=!1;switch(g){case\"string\":O=p.indexOf(s)!==-1;break;case\"weakset\":if(d)throw new f(m+\"unable to use .deep.include with WeakSet\",void 0,b);O=p.has(s);break;case\"map\":p.forEach(function(T){O=O||E(T,s)});break;case\"set\":d?p.forEach(function(T){O=O||E(T,s)}):O=p.has(s);break;case\"array\":d?O=p.some(function(T){return E(T,s)}):O=p.indexOf(s)!==-1;break;default:if(s!==Object(s))throw new f(m+\"the given combination of arguments (\"+g+\" and \"+i.type(s).toLowerCase()+\") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a \"+i.type(s).toLowerCase(),void 0,b);var k=Object.keys(s),j=null,A=0;if(k.forEach(function(T){var C=new t(p);if(i.transferFlags(this,C,!0),e(C,\"lockSsfi\",!0),!w||k.length===1){C.property(T,s[T]);return}try{C.property(T,s[T])}catch(L){if(!i.checkError.compatibleConstructor(L,f))throw L;j===null&&(j=L),A++}},this),w&&k.length>1&&A===k.length)throw j;return}this.assert(O,\"expected #{this} to \"+S+\"include \"+i.inspect(s),\"expected #{this} to not \"+S+\"include \"+i.inspect(s))}t.addChainableMethod(\"include\",l,o),t.addChainableMethod(\"contain\",l,o),t.addChainableMethod(\"contains\",l,o),t.addChainableMethod(\"includes\",l,o),t.addProperty(\"ok\",function(){this.assert(e(this,\"object\"),\"expected #{this} to be truthy\",\"expected #{this} to be falsy\")}),t.addProperty(\"true\",function(){this.assert(e(this,\"object\")===!0,\"expected #{this} to be true\",\"expected #{this} to be false\",!e(this,\"negate\"))}),t.addProperty(\"false\",function(){this.assert(e(this,\"object\")===!1,\"expected #{this} to be false\",\"expected #{this} to be true\",!!e(this,\"negate\"))}),t.addProperty(\"null\",function(){this.assert(e(this,\"object\")===null,\"expected #{this} to be null\",\"expected #{this} not to be null\")}),t.addProperty(\"undefined\",function(){this.assert(e(this,\"object\")===void 0,\"expected #{this} to be undefined\",\"expected #{this} not to be undefined\")}),t.addProperty(\"NaN\",function(){this.assert(i.isNaN(e(this,\"object\")),\"expected #{this} to be NaN\",\"expected #{this} not to be NaN\")});function v(){var s=e(this,\"object\");this.assert(s!=null,\"expected #{this} to exist\",\"expected #{this} to not exist\")}t.addProperty(\"exist\",v),t.addProperty(\"exists\",v),t.addProperty(\"empty\",function(){var s=e(this,\"object\"),h=e(this,\"ssfi\"),p=e(this,\"message\"),g;switch(p=p?p+\": \":\"\",i.type(s).toLowerCase()){case\"array\":case\"string\":g=s.length;break;case\"map\":case\"set\":g=s.size;break;case\"weakmap\":case\"weakset\":throw new f(p+\".empty was passed a weak collection\",void 0,h);case\"function\":var m=p+\".empty was passed a function \"+i.getName(s);throw new f(m.trim(),void 0,h);default:if(s!==Object(s))throw new f(p+\".empty was passed non-string primitive \"+i.inspect(s),void 0,h);g=Object.keys(s).length}this.assert(g===0,\"expected #{this} to be empty\",\"expected #{this} not to be empty\")});function P(){var s=e(this,\"object\"),h=i.type(s);this.assert(h===\"Arguments\",\"expected #{this} to be arguments but got \"+h,\"expected #{this} to not be arguments\")}t.addProperty(\"arguments\",P),t.addProperty(\"Arguments\",P);function R(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\");if(e(this,\"deep\")){var g=e(this,\"lockSsfi\");e(this,\"lockSsfi\",!0),this.eql(s),e(this,\"lockSsfi\",g)}else this.assert(s===p,\"expected #{this} to equal #{exp}\",\"expected #{this} to not equal #{exp}\",s,this._obj,!0)}t.addMethod(\"equal\",R),t.addMethod(\"equals\",R),t.addMethod(\"eq\",R);function X(s,h){h&&e(this,\"message\",h);var p=e(this,\"eql\");this.assert(p(s,e(this,\"object\")),\"expected #{this} to deeply equal #{exp}\",\"expected #{this} to not deeply equal #{exp}\",s,this._obj,!0)}t.addMethod(\"eql\",X),t.addMethod(\"eqls\",X);function K(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"doLength\"),m=e(this,\"message\"),w=m?m+\": \":\"\",b=e(this,\"ssfi\"),d=i.type(p).toLowerCase(),S=i.type(s).toLowerCase(),E,O=!0;if(g&&d!==\"map\"&&d!==\"set\"&&new t(p,m,b,!0).to.have.property(\"length\"),!g&&d===\"date\"&&S!==\"date\")E=w+\"the argument to above must be a date\";else if(S!==\"number\"&&(g||d===\"number\"))E=w+\"the argument to above must be a number\";else if(!g&&d!==\"date\"&&d!==\"number\"){var k=d===\"string\"?\"'\"+p+\"'\":p;E=w+\"expected \"+k+\" to be a number or a date\"}else O=!1;if(O)throw new f(E,void 0,b);if(g){var j=\"length\",A;d===\"map\"||d===\"set\"?(j=\"size\",A=p.size):A=p.length,this.assert(A>s,\"expected #{this} to have a \"+j+\" above #{exp} but got #{act}\",\"expected #{this} to not have a \"+j+\" above #{exp}\",s,A)}else this.assert(p>s,\"expected #{this} to be above #{exp}\",\"expected #{this} to be at most #{exp}\",s)}t.addMethod(\"above\",K),t.addMethod(\"gt\",K),t.addMethod(\"greaterThan\",K);function V(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"doLength\"),m=e(this,\"message\"),w=m?m+\": \":\"\",b=e(this,\"ssfi\"),d=i.type(p).toLowerCase(),S=i.type(s).toLowerCase(),E,O=!0;if(g&&d!==\"map\"&&d!==\"set\"&&new t(p,m,b,!0).to.have.property(\"length\"),!g&&d===\"date\"&&S!==\"date\")E=w+\"the argument to least must be a date\";else if(S!==\"number\"&&(g||d===\"number\"))E=w+\"the argument to least must be a number\";else if(!g&&d!==\"date\"&&d!==\"number\"){var k=d===\"string\"?\"'\"+p+\"'\":p;E=w+\"expected \"+k+\" to be a number or a date\"}else O=!1;if(O)throw new f(E,void 0,b);if(g){var j=\"length\",A;d===\"map\"||d===\"set\"?(j=\"size\",A=p.size):A=p.length,this.assert(A>=s,\"expected #{this} to have a \"+j+\" at least #{exp} but got #{act}\",\"expected #{this} to have a \"+j+\" below #{exp}\",s,A)}else this.assert(p>=s,\"expected #{this} to be at least #{exp}\",\"expected #{this} to be below #{exp}\",s)}t.addMethod(\"least\",V),t.addMethod(\"gte\",V),t.addMethod(\"greaterThanOrEqual\",V);function re(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"doLength\"),m=e(this,\"message\"),w=m?m+\": \":\"\",b=e(this,\"ssfi\"),d=i.type(p).toLowerCase(),S=i.type(s).toLowerCase(),E,O=!0;if(g&&d!==\"map\"&&d!==\"set\"&&new t(p,m,b,!0).to.have.property(\"length\"),!g&&d===\"date\"&&S!==\"date\")E=w+\"the argument to below must be a date\";else if(S!==\"number\"&&(g||d===\"number\"))E=w+\"the argument to below must be a number\";else if(!g&&d!==\"date\"&&d!==\"number\"){var k=d===\"string\"?\"'\"+p+\"'\":p;E=w+\"expected \"+k+\" to be a number or a date\"}else O=!1;if(O)throw new f(E,void 0,b);if(g){var j=\"length\",A;d===\"map\"||d===\"set\"?(j=\"size\",A=p.size):A=p.length,this.assert(A=s&&L<=h,\"expected #{this} to have a \"+C+\" within \"+A,\"expected #{this} to not have a \"+C+\" within \"+A)}else this.assert(g>=s&&g<=h,\"expected #{this} to be within \"+A,\"expected #{this} to not be within \"+A)});function ce(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"ssfi\"),m=e(this,\"message\");try{var w=p instanceof s}catch(d){throw d instanceof TypeError?(m=m?m+\": \":\"\",new f(m+\"The instanceof assertion needs a constructor but \"+i.type(s)+\" was given.\",void 0,g)):d}var b=i.getName(s);b===null&&(b=\"an unnamed constructor\"),this.assert(w,\"expected #{this} to be an instance of \"+b,\"expected #{this} to not be an instance of \"+b)}t.addMethod(\"instanceof\",ce),t.addMethod(\"instanceOf\",ce);function fe(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"nested\"),m=e(this,\"own\"),w=e(this,\"message\"),b=e(this,\"object\"),d=e(this,\"ssfi\"),S=typeof s;if(w=w?w+\": \":\"\",g){if(S!==\"string\")throw new f(w+\"the argument to property must be a string when using nested syntax\",void 0,d)}else if(S!==\"string\"&&S!==\"number\"&&S!==\"symbol\")throw new f(w+\"the argument to property must be a string, number, or symbol\",void 0,d);if(g&&m)throw new f(w+'The \"nested\" and \"own\" flags cannot be combined.',void 0,d);if(b==null)throw new f(w+\"Target cannot be null or undefined.\",void 0,d);var E=e(this,\"deep\"),O=e(this,\"negate\"),k=g?i.getPathInfo(b,s):null,j=g?k.value:b[s],A=E?e(this,\"eql\"):(L,ee)=>L===ee,T=\"\";E&&(T+=\"deep \"),m&&(T+=\"own \"),g&&(T+=\"nested \"),T+=\"property \";var C;m?C=Object.prototype.hasOwnProperty.call(b,s):g?C=k.exists:C=i.hasProperty(b,s),(!O||arguments.length===1)&&this.assert(C,\"expected #{this} to have \"+T+i.inspect(s),\"expected #{this} to not have \"+T+i.inspect(s)),arguments.length>1&&this.assert(C&&A(h,j),\"expected #{this} to have \"+T+i.inspect(s)+\" of #{exp}, but got #{act}\",\"expected #{this} to not have \"+T+i.inspect(s)+\" of #{act}\",h,j),e(this,\"object\",j)}t.addMethod(\"property\",fe);function le(s,h,p){e(this,\"own\",!0),fe.apply(this,arguments)}t.addMethod(\"ownProperty\",le),t.addMethod(\"haveOwnProperty\",le);function he(s,h,p){typeof h==\"string\"&&(p=h,h=null),p&&e(this,\"message\",p);var g=e(this,\"object\"),m=Object.getOwnPropertyDescriptor(Object(g),s),w=e(this,\"eql\");m&&h?this.assert(w(h,m),\"expected the own property descriptor for \"+i.inspect(s)+\" on #{this} to match \"+i.inspect(h)+\", got \"+i.inspect(m),\"expected the own property descriptor for \"+i.inspect(s)+\" on #{this} to not match \"+i.inspect(h),h,m,!0):this.assert(m,\"expected #{this} to have an own property descriptor for \"+i.inspect(s),\"expected #{this} to not have an own property descriptor for \"+i.inspect(s)),e(this,\"object\",m)}t.addMethod(\"ownPropertyDescriptor\",he),t.addMethod(\"haveOwnPropertyDescriptor\",he);function F(){e(this,\"doLength\",!0)}function Q(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=i.type(p).toLowerCase(),m=e(this,\"message\"),w=e(this,\"ssfi\"),b=\"length\",d;switch(g){case\"map\":case\"set\":b=\"size\",d=p.size;break;default:new t(p,m,w,!0).to.have.property(\"length\"),d=p.length}this.assert(d==s,\"expected #{this} to have a \"+b+\" of #{exp} but got #{act}\",\"expected #{this} to not have a \"+b+\" of #{act}\",s,d)}t.addChainableMethod(\"length\",Q,F),t.addChainableMethod(\"lengthOf\",Q,F);function H(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\");this.assert(s.exec(p),\"expected #{this} to match \"+s,\"expected #{this} not to match \"+s)}t.addMethod(\"match\",H),t.addMethod(\"matches\",H),t.addMethod(\"string\",function(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"message\"),m=e(this,\"ssfi\");new t(p,g,m,!0).is.a(\"string\"),this.assert(~p.indexOf(s),\"expected #{this} to contain \"+i.inspect(s),\"expected #{this} to not contain \"+i.inspect(s))});function z(s){var h=e(this,\"object\"),p=i.type(h),g=i.type(s),m=e(this,\"ssfi\"),w=e(this,\"deep\"),b,d=\"\",S,E=!0,O=e(this,\"message\");O=O?O+\": \":\"\";var k=O+\"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments\";if(p===\"Map\"||p===\"Set\")d=w?\"deeply \":\"\",S=[],h.forEach(function(U,Y){S.push(Y)}),g!==\"Array\"&&(s=Array.prototype.slice.call(arguments));else{switch(S=i.getOwnEnumerableProperties(h),g){case\"Array\":if(arguments.length>1)throw new f(k,void 0,m);break;case\"Object\":if(arguments.length>1)throw new f(k,void 0,m);s=Object.keys(s);break;default:s=Array.prototype.slice.call(arguments)}s=s.map(function(U){return typeof U==\"symbol\"?U:String(U)})}if(!s.length)throw new f(O+\"keys required\",void 0,m);var j=s.length,A=e(this,\"any\"),T=e(this,\"all\"),C=s,L=w?e(this,\"eql\"):(U,Y)=>U===Y;if(!A&&!T&&(T=!0),A&&(E=C.some(function(U){return S.some(function(Y){return L(U,Y)})})),T&&(E=C.every(function(U){return S.some(function(Y){return L(U,Y)})}),e(this,\"contains\")||(E=E&&s.length==S.length)),j>1){s=s.map(function(U){return i.inspect(U)});var ee=s.pop();T&&(b=s.join(\", \")+\", and \"+ee),A&&(b=s.join(\", \")+\", or \"+ee)}else b=i.inspect(s[0]);b=(j>1?\"keys \":\"key \")+b,b=(e(this,\"contains\")?\"contain \":\"have \")+b,this.assert(E,\"expected #{this} to \"+d+b,\"expected #{this} to not \"+d+b,C.slice(0).sort(i.compareByInspect),S.sort(i.compareByInspect),!0)}t.addMethod(\"keys\",z),t.addMethod(\"key\",z);function ge(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"object\"),m=e(this,\"ssfi\"),w=e(this,\"message\"),b=e(this,\"negate\")||!1;new t(g,w,m,!0).is.a(\"function\"),(s instanceof RegExp||typeof s==\"string\")&&(h=s,s=null);var d;try{g()}catch(ee){d=ee}var S=s===void 0&&h===void 0,E=!!(s&&h),O=!1,k=!1;if(S||!S&&!b){var j=\"an error\";s instanceof Error?j=\"#{exp}\":s&&(j=i.checkError.getConstructorName(s)),this.assert(d,\"expected #{this} to throw \"+j,\"expected #{this} to not throw an error but #{act} was thrown\",s&&s.toString(),d instanceof Error?d.toString():typeof d==\"string\"?d:d&&i.checkError.getConstructorName(d))}if(s&&d){if(s instanceof Error){var A=i.checkError.compatibleInstance(d,s);A===b&&(E&&b?O=!0:this.assert(b,\"expected #{this} to throw #{exp} but #{act} was thrown\",\"expected #{this} to not throw #{exp}\"+(d&&!b?\" but #{act} was thrown\":\"\"),s.toString(),d.toString()))}var T=i.checkError.compatibleConstructor(d,s);T===b&&(E&&b?O=!0:this.assert(b,\"expected #{this} to throw #{exp} but #{act} was thrown\",\"expected #{this} to not throw #{exp}\"+(d?\" but #{act} was thrown\":\"\"),s instanceof Error?s.toString():s&&i.checkError.getConstructorName(s),d instanceof Error?d.toString():d&&i.checkError.getConstructorName(d)))}if(d&&h!==void 0&&h!==null){var C=\"including\";h instanceof RegExp&&(C=\"matching\");var L=i.checkError.compatibleMessage(d,h);L===b&&(E&&b?k=!0:this.assert(b,\"expected #{this} to throw error \"+C+\" #{exp} but got #{act}\",\"expected #{this} to throw error not \"+C+\" #{exp}\",h,i.checkError.getMessage(d)))}O&&k&&this.assert(b,\"expected #{this} to throw #{exp} but #{act} was thrown\",\"expected #{this} to not throw #{exp}\"+(d?\" but #{act} was thrown\":\"\"),s instanceof Error?s.toString():s&&i.checkError.getConstructorName(s),d instanceof Error?d.toString():d&&i.checkError.getConstructorName(d)),e(this,\"object\",d)}t.addMethod(\"throw\",ge),t.addMethod(\"throws\",ge),t.addMethod(\"Throw\",ge);function be(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"itself\"),m=typeof p==\"function\"&&!g?p.prototype[s]:p[s];this.assert(typeof m==\"function\",\"expected #{this} to respond to \"+i.inspect(s),\"expected #{this} to not respond to \"+i.inspect(s))}t.addMethod(\"respondTo\",be),t.addMethod(\"respondsTo\",be),t.addProperty(\"itself\",function(){e(this,\"itself\",!0)});function Ne(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=s(p);this.assert(g,\"expected #{this} to satisfy \"+i.objDisplay(s),\"expected #{this} to not satisfy\"+i.objDisplay(s),!e(this,\"negate\"),g)}t.addMethod(\"satisfy\",Ne),t.addMethod(\"satisfies\",Ne);function Ae(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"object\"),m=e(this,\"message\"),w=e(this,\"ssfi\");if(new t(g,m,w,!0).is.a(\"number\"),typeof s!=\"number\"||typeof h!=\"number\"){m=m?m+\": \":\"\";var b=h===void 0?\", and a delta is required\":\"\";throw new f(m+\"the arguments to closeTo or approximately must be numbers\"+b,void 0,w)}this.assert(Math.abs(g-s)<=h,\"expected #{this} to be close to \"+s+\" +/- \"+h,\"expected #{this} not to be close to \"+s+\" +/- \"+h)}t.addMethod(\"closeTo\",Ae),t.addMethod(\"approximately\",Ae);function Ke(s,h,p,g,m){if(!g){if(s.length!==h.length)return!1;h=h.slice()}return s.every(function(w,b){if(m)return p?p(w,h[b]):w===h[b];if(!p){var d=h.indexOf(w);return d===-1?!1:(g||h.splice(d,1),!0)}return h.some(function(S,E){return p(w,S)?(g||h.splice(E,1),!0):!1})})}t.addMethod(\"members\",function(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"message\"),m=e(this,\"ssfi\");new t(p,g,m,!0).to.be.an(\"array\"),new t(s,g,m,!0).to.be.an(\"array\");var w=e(this,\"contains\"),b=e(this,\"ordered\"),d,S,E;w?(d=b?\"an ordered superset\":\"a superset\",S=\"expected #{this} to be \"+d+\" of #{exp}\",E=\"expected #{this} to not be \"+d+\" of #{exp}\"):(d=b?\"ordered members\":\"members\",S=\"expected #{this} to have the same \"+d+\" as #{exp}\",E=\"expected #{this} to not have the same \"+d+\" as #{exp}\");var O=e(this,\"deep\")?e(this,\"eql\"):void 0;this.assert(Ke(s,p,O,w,b),S,E,s,p,!0)});function Le(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"message\"),m=e(this,\"ssfi\"),w=e(this,\"contains\"),b=e(this,\"deep\"),d=e(this,\"eql\");new t(s,g,m,!0).to.be.an(\"array\"),w?this.assert(s.some(function(S){return p.indexOf(S)>-1}),\"expected #{this} to contain one of #{exp}\",\"expected #{this} to not contain one of #{exp}\",s,p):b?this.assert(s.some(function(S){return d(p,S)}),\"expected #{this} to deeply equal one of #{exp}\",\"expected #{this} to deeply equal one of #{exp}\",s,p):this.assert(s.indexOf(p)>-1,\"expected #{this} to be one of #{exp}\",\"expected #{this} to not be one of #{exp}\",s,p)}t.addMethod(\"oneOf\",Le);function me(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"object\"),m=e(this,\"message\"),w=e(this,\"ssfi\");new t(g,m,w,!0).is.a(\"function\");var b;h?(new t(s,m,w,!0).to.have.property(h),b=s[h]):(new t(s,m,w,!0).is.a(\"function\"),b=s()),g();var d=h==null?s():s[h],S=h==null?b:\".\"+h;e(this,\"deltaMsgObj\",S),e(this,\"initialDeltaValue\",b),e(this,\"finalDeltaValue\",d),e(this,\"deltaBehavior\",\"change\"),e(this,\"realDelta\",d!==b),this.assert(b!==d,\"expected \"+S+\" to change\",\"expected \"+S+\" to not change\")}t.addMethod(\"change\",me),t.addMethod(\"changes\",me);function ve(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"object\"),m=e(this,\"message\"),w=e(this,\"ssfi\");new t(g,m,w,!0).is.a(\"function\");var b;h?(new t(s,m,w,!0).to.have.property(h),b=s[h]):(new t(s,m,w,!0).is.a(\"function\"),b=s()),new t(b,m,w,!0).is.a(\"number\"),g();var d=h==null?s():s[h],S=h==null?b:\".\"+h;e(this,\"deltaMsgObj\",S),e(this,\"initialDeltaValue\",b),e(this,\"finalDeltaValue\",d),e(this,\"deltaBehavior\",\"increase\"),e(this,\"realDelta\",d-b),this.assert(d-b>0,\"expected \"+S+\" to increase\",\"expected \"+S+\" to not increase\")}t.addMethod(\"increase\",ve),t.addMethod(\"increases\",ve);function je(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"object\"),m=e(this,\"message\"),w=e(this,\"ssfi\");new t(g,m,w,!0).is.a(\"function\");var b;h?(new t(s,m,w,!0).to.have.property(h),b=s[h]):(new t(s,m,w,!0).is.a(\"function\"),b=s()),new t(b,m,w,!0).is.a(\"number\"),g();var d=h==null?s():s[h],S=h==null?b:\".\"+h;e(this,\"deltaMsgObj\",S),e(this,\"initialDeltaValue\",b),e(this,\"finalDeltaValue\",d),e(this,\"deltaBehavior\",\"decrease\"),e(this,\"realDelta\",b-d),this.assert(d-b<0,\"expected \"+S+\" to decrease\",\"expected \"+S+\" to not decrease\")}t.addMethod(\"decrease\",je),t.addMethod(\"decreases\",je);function We(s,h){h&&e(this,\"message\",h);var p=e(this,\"deltaMsgObj\"),g=e(this,\"initialDeltaValue\"),m=e(this,\"finalDeltaValue\"),w=e(this,\"deltaBehavior\"),b=e(this,\"realDelta\"),d;w===\"change\"?d=Math.abs(m-g)===Math.abs(s):d=b===Math.abs(s),this.assert(d,\"expected \"+p+\" to \"+w+\" by \"+s,\"expected \"+p+\" to not \"+w+\" by \"+s)}t.addMethod(\"by\",We),t.addProperty(\"extensible\",function(){var s=e(this,\"object\"),h=s===Object(s)&&Object.isExtensible(s);this.assert(h,\"expected #{this} to be extensible\",\"expected #{this} to not be extensible\")}),t.addProperty(\"sealed\",function(){var s=e(this,\"object\"),h=s===Object(s)?Object.isSealed(s):!0;this.assert(h,\"expected #{this} to be sealed\",\"expected #{this} to not be sealed\")}),t.addProperty(\"frozen\",function(){var s=e(this,\"object\"),h=s===Object(s)?Object.isFrozen(s):!0;this.assert(h,\"expected #{this} to be frozen\",\"expected #{this} to not be frozen\")}),t.addProperty(\"finite\",function(s){var h=e(this,\"object\");this.assert(typeof h==\"number\"&&isFinite(h),\"expected #{this} to be a finite number\",\"expected #{this} to not be a finite number\")})}});var Wn=q((Yo,Ln)=>{Ln.exports=function(a,i){a.expect=function(t,f){return new a.Assertion(t,f)},a.expect.fail=function(t,f,e,n){throw arguments.length<2&&(e=t,t=void 0),e=e||\"expect.fail()\",new a.AssertionError(e,{actual:t,expected:f,operator:n},a.expect.fail)}}});var Rn=q((Xo,Gn)=>{Gn.exports=function(a,i){var t=a.Assertion;function f(){function e(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol==\"function\"&&this instanceof Symbol||typeof BigInt==\"function\"&&this instanceof BigInt?new t(this.valueOf(),null,e):new t(this,null,e)}function n(o){Object.defineProperty(this,\"should\",{value:o,enumerable:!0,configurable:!0,writable:!0})}Object.defineProperty(Object.prototype,\"should\",{set:n,get:e,configurable:!0});var r={};return r.fail=function(o,l,v,P){throw arguments.length<2&&(v=o,o=void 0),v=v||\"should.fail()\",new a.AssertionError(v,{actual:o,expected:l,operator:P},r.fail)},r.equal=function(o,l,v){new t(o,v).to.equal(l)},r.Throw=function(o,l,v,P){new t(o,P).to.Throw(l,v)},r.exist=function(o,l){new t(o,l).to.exist},r.not={},r.not.equal=function(o,l,v){new t(o,v).to.not.equal(l)},r.not.Throw=function(o,l,v,P){new t(o,P).to.not.Throw(l,v)},r.not.exist=function(o,l){new t(o,l).to.not.exist},r.throw=r.Throw,r.not.throw=r.not.Throw,r}a.should=f,a.Should=f}});var $n=q((Ho,Un)=>{Un.exports=function(a,i){var t=a.Assertion,f=i.flag;var e=a.assert=function(n,r){var o=new t(null,null,a.assert,!0);o.assert(n,r,\"[ negation message unavailable ]\")};e.fail=function(n,r,o,l){throw arguments.length<2&&(o=n,n=void 0),o=o||\"assert.fail()\",new a.AssertionError(o,{actual:n,expected:r,operator:l},e.fail)},e.isOk=function(n,r){new t(n,r,e.isOk,!0).is.ok},e.isNotOk=function(n,r){new t(n,r,e.isNotOk,!0).is.not.ok},e.equal=function(n,r,o){var l=new t(n,o,e.equal,!0);l.assert(r==f(l,\"object\"),\"expected #{this} to equal #{exp}\",\"expected #{this} to not equal #{act}\",r,n,!0)},e.notEqual=function(n,r,o){var l=new t(n,o,e.notEqual,!0);l.assert(r!=f(l,\"object\"),\"expected #{this} to not equal #{exp}\",\"expected #{this} to equal #{act}\",r,n,!0)},e.strictEqual=function(n,r,o){new t(n,o,e.strictEqual,!0).to.equal(r)},e.notStrictEqual=function(n,r,o){new t(n,o,e.notStrictEqual,!0).to.not.equal(r)},e.deepEqual=e.deepStrictEqual=function(n,r,o){new t(n,o,e.deepEqual,!0).to.eql(r)},e.notDeepEqual=function(n,r,o){new t(n,o,e.notDeepEqual,!0).to.not.eql(r)},e.isAbove=function(n,r,o){new t(n,o,e.isAbove,!0).to.be.above(r)},e.isAtLeast=function(n,r,o){new t(n,o,e.isAtLeast,!0).to.be.least(r)},e.isBelow=function(n,r,o){new t(n,o,e.isBelow,!0).to.be.below(r)},e.isAtMost=function(n,r,o){new t(n,o,e.isAtMost,!0).to.be.most(r)},e.isTrue=function(n,r){new t(n,r,e.isTrue,!0).is.true},e.isNotTrue=function(n,r){new t(n,r,e.isNotTrue,!0).to.not.equal(!0)},e.isFalse=function(n,r){new t(n,r,e.isFalse,!0).is.false},e.isNotFalse=function(n,r){new t(n,r,e.isNotFalse,!0).to.not.equal(!1)},e.isNull=function(n,r){new t(n,r,e.isNull,!0).to.equal(null)},e.isNotNull=function(n,r){new t(n,r,e.isNotNull,!0).to.not.equal(null)},e.isNaN=function(n,r){new t(n,r,e.isNaN,!0).to.be.NaN},e.isNotNaN=function(n,r){new t(n,r,e.isNotNaN,!0).not.to.be.NaN},e.exists=function(n,r){new t(n,r,e.exists,!0).to.exist},e.notExists=function(n,r){new t(n,r,e.notExists,!0).to.not.exist},e.isUndefined=function(n,r){new t(n,r,e.isUndefined,!0).to.equal(void 0)},e.isDefined=function(n,r){new t(n,r,e.isDefined,!0).to.not.equal(void 0)},e.isFunction=function(n,r){new t(n,r,e.isFunction,!0).to.be.a(\"function\")},e.isNotFunction=function(n,r){new t(n,r,e.isNotFunction,!0).to.not.be.a(\"function\")},e.isObject=function(n,r){new t(n,r,e.isObject,!0).to.be.a(\"object\")},e.isNotObject=function(n,r){new t(n,r,e.isNotObject,!0).to.not.be.a(\"object\")},e.isArray=function(n,r){new t(n,r,e.isArray,!0).to.be.an(\"array\")},e.isNotArray=function(n,r){new t(n,r,e.isNotArray,!0).to.not.be.an(\"array\")},e.isString=function(n,r){new t(n,r,e.isString,!0).to.be.a(\"string\")},e.isNotString=function(n,r){new t(n,r,e.isNotString,!0).to.not.be.a(\"string\")},e.isNumber=function(n,r){new t(n,r,e.isNumber,!0).to.be.a(\"number\")},e.isNotNumber=function(n,r){new t(n,r,e.isNotNumber,!0).to.not.be.a(\"number\")},e.isFinite=function(n,r){new t(n,r,e.isFinite,!0).to.be.finite},e.isBoolean=function(n,r){new t(n,r,e.isBoolean,!0).to.be.a(\"boolean\")},e.isNotBoolean=function(n,r){new t(n,r,e.isNotBoolean,!0).to.not.be.a(\"boolean\")},e.typeOf=function(n,r,o){new t(n,o,e.typeOf,!0).to.be.a(r)},e.notTypeOf=function(n,r,o){new t(n,o,e.notTypeOf,!0).to.not.be.a(r)},e.instanceOf=function(n,r,o){new t(n,o,e.instanceOf,!0).to.be.instanceOf(r)},e.notInstanceOf=function(n,r,o){new t(n,o,e.notInstanceOf,!0).to.not.be.instanceOf(r)},e.include=function(n,r,o){new t(n,o,e.include,!0).include(r)},e.notInclude=function(n,r,o){new t(n,o,e.notInclude,!0).not.include(r)},e.deepInclude=function(n,r,o){new t(n,o,e.deepInclude,!0).deep.include(r)},e.notDeepInclude=function(n,r,o){new t(n,o,e.notDeepInclude,!0).not.deep.include(r)},e.nestedInclude=function(n,r,o){new t(n,o,e.nestedInclude,!0).nested.include(r)},e.notNestedInclude=function(n,r,o){new t(n,o,e.notNestedInclude,!0).not.nested.include(r)},e.deepNestedInclude=function(n,r,o){new t(n,o,e.deepNestedInclude,!0).deep.nested.include(r)},e.notDeepNestedInclude=function(n,r,o){new t(n,o,e.notDeepNestedInclude,!0).not.deep.nested.include(r)},e.ownInclude=function(n,r,o){new t(n,o,e.ownInclude,!0).own.include(r)},e.notOwnInclude=function(n,r,o){new t(n,o,e.notOwnInclude,!0).not.own.include(r)},e.deepOwnInclude=function(n,r,o){new t(n,o,e.deepOwnInclude,!0).deep.own.include(r)},e.notDeepOwnInclude=function(n,r,o){new t(n,o,e.notDeepOwnInclude,!0).not.deep.own.include(r)},e.match=function(n,r,o){new t(n,o,e.match,!0).to.match(r)},e.notMatch=function(n,r,o){new t(n,o,e.notMatch,!0).to.not.match(r)},e.property=function(n,r,o){new t(n,o,e.property,!0).to.have.property(r)},e.notProperty=function(n,r,o){new t(n,o,e.notProperty,!0).to.not.have.property(r)},e.propertyVal=function(n,r,o,l){new t(n,l,e.propertyVal,!0).to.have.property(r,o)},e.notPropertyVal=function(n,r,o,l){new t(n,l,e.notPropertyVal,!0).to.not.have.property(r,o)},e.deepPropertyVal=function(n,r,o,l){new t(n,l,e.deepPropertyVal,!0).to.have.deep.property(r,o)},e.notDeepPropertyVal=function(n,r,o,l){new t(n,l,e.notDeepPropertyVal,!0).to.not.have.deep.property(r,o)},e.ownProperty=function(n,r,o){new t(n,o,e.ownProperty,!0).to.have.own.property(r)},e.notOwnProperty=function(n,r,o){new t(n,o,e.notOwnProperty,!0).to.not.have.own.property(r)},e.ownPropertyVal=function(n,r,o,l){new t(n,l,e.ownPropertyVal,!0).to.have.own.property(r,o)},e.notOwnPropertyVal=function(n,r,o,l){new t(n,l,e.notOwnPropertyVal,!0).to.not.have.own.property(r,o)},e.deepOwnPropertyVal=function(n,r,o,l){new t(n,l,e.deepOwnPropertyVal,!0).to.have.deep.own.property(r,o)},e.notDeepOwnPropertyVal=function(n,r,o,l){new t(n,l,e.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(r,o)},e.nestedProperty=function(n,r,o){new t(n,o,e.nestedProperty,!0).to.have.nested.property(r)},e.notNestedProperty=function(n,r,o){new t(n,o,e.notNestedProperty,!0).to.not.have.nested.property(r)},e.nestedPropertyVal=function(n,r,o,l){new t(n,l,e.nestedPropertyVal,!0).to.have.nested.property(r,o)},e.notNestedPropertyVal=function(n,r,o,l){new t(n,l,e.notNestedPropertyVal,!0).to.not.have.nested.property(r,o)},e.deepNestedPropertyVal=function(n,r,o,l){new t(n,l,e.deepNestedPropertyVal,!0).to.have.deep.nested.property(r,o)},e.notDeepNestedPropertyVal=function(n,r,o,l){new t(n,l,e.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(r,o)},e.lengthOf=function(n,r,o){new t(n,o,e.lengthOf,!0).to.have.lengthOf(r)},e.hasAnyKeys=function(n,r,o){new t(n,o,e.hasAnyKeys,!0).to.have.any.keys(r)},e.hasAllKeys=function(n,r,o){new t(n,o,e.hasAllKeys,!0).to.have.all.keys(r)},e.containsAllKeys=function(n,r,o){new t(n,o,e.containsAllKeys,!0).to.contain.all.keys(r)},e.doesNotHaveAnyKeys=function(n,r,o){new t(n,o,e.doesNotHaveAnyKeys,!0).to.not.have.any.keys(r)},e.doesNotHaveAllKeys=function(n,r,o){new t(n,o,e.doesNotHaveAllKeys,!0).to.not.have.all.keys(r)},e.hasAnyDeepKeys=function(n,r,o){new t(n,o,e.hasAnyDeepKeys,!0).to.have.any.deep.keys(r)},e.hasAllDeepKeys=function(n,r,o){new t(n,o,e.hasAllDeepKeys,!0).to.have.all.deep.keys(r)},e.containsAllDeepKeys=function(n,r,o){new t(n,o,e.containsAllDeepKeys,!0).to.contain.all.deep.keys(r)},e.doesNotHaveAnyDeepKeys=function(n,r,o){new t(n,o,e.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(r)},e.doesNotHaveAllDeepKeys=function(n,r,o){new t(n,o,e.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(r)},e.throws=function(n,r,o,l){(typeof r==\"string\"||r instanceof RegExp)&&(o=r,r=null);var v=new t(n,l,e.throws,!0).to.throw(r,o);return f(v,\"object\")},e.doesNotThrow=function(n,r,o,l){(typeof r==\"string\"||r instanceof RegExp)&&(o=r,r=null),new t(n,l,e.doesNotThrow,!0).to.not.throw(r,o)},e.operator=function(n,r,o,l){var v;switch(r){case\"==\":v=n==o;break;case\"===\":v=n===o;break;case\">\":v=n>o;break;case\">=\":v=n>=o;break;case\"<\":v=n{var _n=[];$.version=\"4.3.8\";$.AssertionError=$e();var Jn=Cn();$.use=function(a){return~_n.indexOf(a)||(a($,Jn),_n.push(a)),$};$.util=Jn;var uo=se();$.config=uo;var co=Fn();$.use(co);var fo=Kn();$.use(fo);var lo=Wn();$.use(lo);var ho=Rn();$.use(ho);var po=$n();$.use(po)});var Qn=q((ti,Zn)=>{Zn.exports=ne()});module.exports=Qn();\n\n })(module, exports);\n return module.exports;\n}"; diff --git a/packages/insomnia/src/templating/sandbox/vendored/pkg/package-lock.json b/packages/insomnia/src/templating/sandbox/vendored/pkg/package-lock.json index 41ca37b9a09..acae194af37 100644 --- a/packages/insomnia/src/templating/sandbox/vendored/pkg/package-lock.json +++ b/packages/insomnia/src/templating/sandbox/vendored/pkg/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "ajv": "8.18.0", + "chai": "4.5.0", "uuid": "11.1.1" } }, @@ -28,6 +29,57 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/chai": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "license": "MIT", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/deep-eql": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "license": "MIT", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -50,12 +102,39 @@ ], "license": "BSD-3-Clause" }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "license": "MIT" }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -65,6 +144,15 @@ "node": ">=0.10.0" } }, + "node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/uuid": { "version": "11.1.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.1.tgz", diff --git a/packages/insomnia/src/templating/sandbox/vendored/pkg/package.json b/packages/insomnia/src/templating/sandbox/vendored/pkg/package.json index 79d791dce18..bf356f6ced2 100644 --- a/packages/insomnia/src/templating/sandbox/vendored/pkg/package.json +++ b/packages/insomnia/src/templating/sandbox/vendored/pkg/package.json @@ -2,9 +2,10 @@ "name": "@insomnia/sandbox-vendored-pkg", "private": true, "version": "0.0.0", - "description": "Isolated, exact-pinned install used ONLY to source the npm libraries bundled into the QuickJS template-tag sandbox (see ../../../scripts/generate-sandbox-vendored.ts). Not a workspace member — do NOT add this path to the root package.json 'workspaces' array; do NOT add ranged (^ or ~) versions here. The pin here is the sandbox's vetted version and must never exceed the same library's resolved version in packages/insomnia/package.json. Upgrade via 'npm run sandbox:vendored:upgrade -w insomnia -- @', never by hand-editing this file.", + "description": "Isolated, exact-pinned install used ONLY to source the npm libraries bundled into QuickJS sandboxes — the template-tag sandbox and the scripting sandbox (see ../../../scripts/generate-sandbox-vendored.ts). Not a workspace member — do NOT add this path to the root package.json 'workspaces' array; do NOT add ranged (^ or ~) versions here. The pin here is the sandbox's vetted version and must never exceed the same library's resolved version in packages/insomnia/package.json. Upgrade via 'npm run sandbox:vendored:upgrade -w insomnia -- @', never by hand-editing this file.", "dependencies": { "ajv": "8.18.0", + "chai": "4.5.0", "uuid": "11.1.1" } } From 8d3a6444ed25da90f23a9e8db7b435e02dd7e954 Mon Sep 17 00:00:00 2001 From: jackkav Date: Mon, 17 Aug 2026 12:28:35 +0200 Subject: [PATCH 2/4] fix(quickjs): restore stripped eslint-disable in chai.generated.ts A background formatter in this environment stripped the leading /* eslint-disable */ from the vendored chai bundle before it was committed, which the sandbox:vendored:ci guardrail in CI correctly flagged as drift from a fresh regeneration. --- .../insomnia/src/templating/sandbox/vendored/ajv.generated.ts | 2 +- .../insomnia/src/templating/sandbox/vendored/uuid.generated.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/insomnia/src/templating/sandbox/vendored/ajv.generated.ts b/packages/insomnia/src/templating/sandbox/vendored/ajv.generated.ts index 2e56b0dd9b8..25d60916564 100644 --- a/packages/insomnia/src/templating/sandbox/vendored/ajv.generated.ts +++ b/packages/insomnia/src/templating/sandbox/vendored/ajv.generated.ts @@ -2,6 +2,6 @@ // Vendored, pinned bundle of "ajv" for the QuickJS template-tag sandbox (M3). // Sourced from the isolated install in vendored/pkg/ (see its package.json) — NOT the app's own node_modules. // Regenerate with: npm run sandbox:vendored:generate -w insomnia -/* eslint-disable */ + export const AJV_FACTORY_VERSION = "8.18.0"; export const AJV_FACTORY_SOURCE = "function () {\n var module = { exports: {} };\n var exports = module.exports;\n (function (module, exports) {\nvar g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Be=g(R=>{\"use strict\";Object.defineProperty(R,\"__esModule\",{value:!0});R.regexpCode=R.getEsmExportName=R.getProperty=R.safeStringify=R.stringify=R.strConcat=R.addCodeArg=R.str=R._=R.nil=R._Code=R.Name=R.IDENTIFIER=R._CodeOrName=void 0;var Je=class{};R._CodeOrName=Je;R.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var $e=class extends Je{constructor(e){if(super(),!R.IDENTIFIER.test(e))throw new Error(\"CodeGen: name must be a valid identifier\");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};R.Name=$e;var B=class extends Je{constructor(e){super(),this._items=typeof e==\"string\"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===\"\"||e==='\"\"'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,s)=>`${r}${s}`,\"\")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,s)=>(s instanceof $e&&(r[s.str]=(r[s.str]||0)+1),r),{})}};R._Code=B;R.nil=new B(\"\");function Hs(t,...e){let r=[t[0]],s=0;for(;s{\"use strict\";Object.defineProperty(G,\"__esModule\",{value:!0});G.ValueScope=G.ValueScopeName=G.Scope=G.varKinds=G.UsedValueState=void 0;var H=Be(),or=class extends Error{constructor(e){super(`CodeGen: \"code\" for ${e} not defined`),this.value=e.value}},wt;(function(t){t[t.Started=0]=\"Started\",t[t.Completed=1]=\"Completed\"})(wt||(G.UsedValueState=wt={}));G.varKinds={const:new H.Name(\"const\"),let:new H.Name(\"let\"),var:new H.Name(\"var\")};var bt=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof H.Name?e:this.name(e)}name(e){return new H.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,s;if(!((s=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix \"${e}\" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};G.Scope=bt;var Et=class extends H.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:s}){this.value=e,this.scopePath=(0,H._)`.${new H.Name(r)}[${s}]`}};G.ValueScopeName=Et;var Ti=(0,H._)`\\n`,ir=class extends bt{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Ti:H.nil}}get(){return this._scope}name(e){return new Et(e,this._newName(e))}value(e,r){var s;if(r.ref===void 0)throw new Error(\"CodeGen: ref must be passed in value\");let n=this.toName(e),{prefix:o}=n,i=(s=r.key)!==null&&s!==void 0?s:r.ref,a=this._values[o];if(a){let u=a.get(i);if(u)return u}else a=this._values[o]=new Map;a.set(i,n);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,n.setValue(r,{property:o,itemIndex:l}),n}getValue(e,r){let s=this._values[e];if(s)return s.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name \"${s}\" has no value`);return(0,H._)`${e}${s.scopePath}`})}scopeCode(e=this._values,r,s){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name \"${n}\" has no value`);return n.value.code},r,s)}_reduceValues(e,r,s={},n){let o=H.nil;for(let i in e){let a=e[i];if(!a)continue;let c=s[i]=s[i]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,wt.Started);let u=r(l);if(u){let d=this.opts.es5?G.varKinds.var:G.varKinds.const;o=(0,H._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=n?.(l))o=(0,H._)`${o}${u}${this.opts._n}`;else throw new or(l);c.set(l,wt.Completed)})}return o}};G.ValueScope=ir});var S=g(E=>{\"use strict\";Object.defineProperty(E,\"__esModule\",{value:!0});E.or=E.and=E.not=E.CodeGen=E.operators=E.varKinds=E.ValueScopeName=E.ValueScope=E.Scope=E.Name=E.regexpCode=E.stringify=E.getProperty=E.nil=E.strConcat=E.str=E._=void 0;var k=Be(),Z=ar(),fe=Be();Object.defineProperty(E,\"_\",{enumerable:!0,get:function(){return fe._}});Object.defineProperty(E,\"str\",{enumerable:!0,get:function(){return fe.str}});Object.defineProperty(E,\"strConcat\",{enumerable:!0,get:function(){return fe.strConcat}});Object.defineProperty(E,\"nil\",{enumerable:!0,get:function(){return fe.nil}});Object.defineProperty(E,\"getProperty\",{enumerable:!0,get:function(){return fe.getProperty}});Object.defineProperty(E,\"stringify\",{enumerable:!0,get:function(){return fe.stringify}});Object.defineProperty(E,\"regexpCode\",{enumerable:!0,get:function(){return fe.regexpCode}});Object.defineProperty(E,\"Name\",{enumerable:!0,get:function(){return fe.Name}});var kt=ar();Object.defineProperty(E,\"Scope\",{enumerable:!0,get:function(){return kt.Scope}});Object.defineProperty(E,\"ValueScope\",{enumerable:!0,get:function(){return kt.ValueScope}});Object.defineProperty(E,\"ValueScopeName\",{enumerable:!0,get:function(){return kt.ValueScopeName}});Object.defineProperty(E,\"varKinds\",{enumerable:!0,get:function(){return kt.varKinds}});E.operators={GT:new k._Code(\">\"),GTE:new k._Code(\">=\"),LT:new k._Code(\"<\"),LTE:new k._Code(\"<=\"),EQ:new k._Code(\"===\"),NEQ:new k._Code(\"!==\"),NOT:new k._Code(\"!\"),OR:new k._Code(\"||\"),AND:new k._Code(\"&&\"),ADD:new k._Code(\"+\")};var ce=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},cr=class extends ce{constructor(e,r,s){super(),this.varKind=e,this.name=r,this.rhs=s}render({es5:e,_n:r}){let s=e?Z.varKinds.var:this.varKind,n=this.rhs===void 0?\"\":` = ${this.rhs}`;return`${s} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Re(this.rhs,e,r)),this}get names(){return this.rhs instanceof k._CodeOrName?this.rhs.names:{}}},St=class extends ce{constructor(e,r,s){super(),this.lhs=e,this.rhs=r,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof k.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Re(this.rhs,e,r),this}get names(){let e=this.lhs instanceof k.Name?{}:{...this.lhs.names};return Nt(e,this.rhs)}},ur=class extends St{constructor(e,r,s,n){super(e,s,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},lr=class extends ce{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},dr=class extends ce{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:\"\"};`+e}},fr=class extends ce{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},hr=class extends ce{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Re(this.code,e,r),this}get names(){return this.code instanceof k._CodeOrName?this.code.names:{}}},Qe=class extends ce{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,s)=>r+s.render(e),\"\")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let s=e[r].optimizeNodes();Array.isArray(s)?e.splice(r,1,...s):s?e[r]=s:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:s}=this,n=s.length;for(;n--;){let o=s[n];o.optimizeNames(e,r)||(Ci(e,o.names),s.splice(n,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>be(e,r.names),{})}},ue=class extends Qe{render(e){return\"{\"+e._n+super.render(e)+\"}\"+e._n}},pr=class extends Qe{},je=class extends ue{};je.kind=\"else\";var ve=class t extends ue{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+=\"else \"+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let s=r.optimizeNodes();r=this.else=Array.isArray(s)?new je(s):s}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Js(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Re(this.condition,e,r),this}get names(){let e=super.names;return Nt(e,this.condition),this.else&&be(e,this.else.names),e}};ve.kind=\"if\";var we=class extends ue{};we.kind=\"for\";var mr=class extends we{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Re(this.iteration,e,r),this}get names(){return be(super.names,this.iteration.names)}},yr=class extends we{constructor(e,r,s,n){super(),this.varKind=e,this.name=r,this.from=s,this.to=n}render(e){let r=e.es5?Z.varKinds.var:this.varKind,{name:s,from:n,to:o}=this;return`for(${r} ${s}=${n}; ${s}<${o}; ${s}++)`+super.render(e)}get names(){let e=Nt(super.names,this.from);return Nt(e,this.to)}},Pt=class extends we{constructor(e,r,s,n){super(),this.loop=e,this.varKind=r,this.name=s,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Re(this.iterable,e,r),this}get names(){return be(super.names,this.iterable.names)}},Xe=class extends ue{constructor(e,r,s){super(),this.name=e,this.args=r,this.async=s}render(e){return`${this.async?\"async \":\"\"}function ${this.name}(${this.args})`+super.render(e)}};Xe.kind=\"func\";var Ye=class extends Qe{render(e){return\"return \"+super.render(e)}};Ye.kind=\"return\";var _r=class extends ue{render(e){let r=\"try\"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var s,n;return super.optimizeNames(e,r),(s=this.catch)===null||s===void 0||s.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&be(e,this.catch.names),this.finally&&be(e,this.finally.names),e}},Ze=class extends ue{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Ze.kind=\"catch\";var et=class extends ue{render(e){return\"finally\"+super.render(e)}};et.kind=\"finally\";var gr=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`\n`:\"\"},this._extScope=e,this._scope=new Z.Scope({parent:e}),this._nodes=[new pr]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let s=this._extScope.value(e,r);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,s,n){let o=this._scope.toName(r);return s!==void 0&&n&&(this._constants[o.str]=s),this._leafNode(new cr(e,o,s)),o}const(e,r,s){return this._def(Z.varKinds.const,e,r,s)}let(e,r,s){return this._def(Z.varKinds.let,e,r,s)}var(e,r,s){return this._def(Z.varKinds.var,e,r,s)}assign(e,r,s){return this._leafNode(new St(e,r,s))}add(e,r){return this._leafNode(new ur(e,E.operators.ADD,r))}code(e){return typeof e==\"function\"?e():e!==k.nil&&this._leafNode(new hr(e)),this}object(...e){let r=[\"{\"];for(let[s,n]of e)r.length>1&&r.push(\",\"),r.push(s),(s!==n||this.opts.es5)&&(r.push(\":\"),(0,k.addCodeArg)(r,n));return r.push(\"}\"),new k._Code(r)}if(e,r,s){if(this._blockNode(new ve(e)),r&&s)this.code(r).else().code(s).endIf();else if(r)this.code(r).endIf();else if(s)throw new Error('CodeGen: \"else\" body without \"then\" body');return this}elseIf(e){return this._elseNode(new ve(e))}else(){return this._elseNode(new je)}endIf(){return this._endBlockNode(ve,je)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new mr(e),r)}forRange(e,r,s,n,o=this.opts.es5?Z.varKinds.var:Z.varKinds.let){let i=this._scope.toName(e);return this._for(new yr(o,i,r,s),()=>n(i))}forOf(e,r,s,n=Z.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let i=r instanceof k.Name?r:this.var(\"_arr\",r);return this.forRange(\"_i\",0,(0,k._)`${i}.length`,a=>{this.var(o,(0,k._)`${i}[${a}]`),s(o)})}return this._for(new Pt(\"of\",n,o,r),()=>s(o))}forIn(e,r,s,n=this.opts.es5?Z.varKinds.var:Z.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,k._)`Object.keys(${r})`,s);let o=this._scope.toName(e);return this._for(new Pt(\"in\",n,o,r),()=>s(o))}endFor(){return this._endBlockNode(we)}label(e){return this._leafNode(new lr(e))}break(e){return this._leafNode(new dr(e))}return(e){let r=new Ye;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: \"return\" should have one node');return this._endBlockNode(Ye)}try(e,r,s){if(!r&&!s)throw new Error('CodeGen: \"try\" without \"catch\" and \"finally\"');let n=new _r;if(this._blockNode(n),this.code(e),r){let o=this.name(\"e\");this._currNode=n.catch=new Ze(o),r(o)}return s&&(this._currNode=n.finally=new et,this.code(s)),this._endBlockNode(Ze,et)}throw(e){return this._leafNode(new fr(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error(\"CodeGen: not in self-balancing block\");let s=this._nodes.length-r;if(s<0||e!==void 0&&s!==e)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=k.nil,s,n){return this._blockNode(new Xe(e,r,s)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Xe)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let s=this._currNode;if(s instanceof e||r&&s instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block \"${r?`${e.kind}/${r.kind}`:e.kind}\"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof ve))throw new Error('CodeGen: \"else\" without \"if\"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};E.CodeGen=gr;function be(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Nt(t,e){return e instanceof k._CodeOrName?be(t,e.names):t}function Re(t,e,r){if(t instanceof k.Name)return s(t);if(!n(t))return t;return new k._Code(t._items.reduce((o,i)=>(i instanceof k.Name&&(i=s(i)),i instanceof k._Code?o.push(...i._items):o.push(i),o),[]));function s(o){let i=r[o.str];return i===void 0||e[o.str]!==1?o:(delete e[o.str],i)}function n(o){return o instanceof k._Code&&o._items.some(i=>i instanceof k.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function Ci(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Js(t){return typeof t==\"boolean\"||typeof t==\"number\"||t===null?!t:(0,k._)`!${$r(t)}`}E.not=Js;var Mi=Ws(E.operators.AND);function Ai(...t){return t.reduce(Mi)}E.and=Ai;var Di=Ws(E.operators.OR);function Vi(...t){return t.reduce(Di)}E.or=Vi;function Ws(t){return(e,r)=>e===k.nil?r:r===k.nil?e:(0,k._)`${$r(e)} ${t} ${$r(r)}`}function $r(t){return t instanceof k.Name?t:(0,k._)`(${t})`}});var O=g(P=>{\"use strict\";Object.defineProperty(P,\"__esModule\",{value:!0});P.checkStrictMode=P.getErrorPath=P.Type=P.useFunc=P.setEvaluated=P.evaluatedPropsToName=P.mergeEvaluated=P.eachItem=P.unescapeJsonPointer=P.escapeJsonPointer=P.escapeFragment=P.unescapeFragment=P.schemaRefOrVal=P.schemaHasRulesButRef=P.schemaHasRules=P.checkUnknownRules=P.alwaysValidSchema=P.toHash=void 0;var T=S(),zi=Be();function Ui(t){let e={};for(let r of t)e[r]=!0;return e}P.toHash=Ui;function Ki(t,e){return typeof e==\"boolean\"?e:Object.keys(e).length===0?!0:(Xs(t,e),!Ys(e,t.self.RULES.all))}P.alwaysValidSchema=Ki;function Xs(t,e=t.schema){let{opts:r,self:s}=t;if(!r.strictSchema||typeof e==\"boolean\")return;let n=s.RULES.keywords;for(let o in e)n[o]||tn(t,`unknown keyword: \"${o}\"`)}P.checkUnknownRules=Xs;function Ys(t,e){if(typeof t==\"boolean\")return!t;for(let r in t)if(e[r])return!0;return!1}P.schemaHasRules=Ys;function xi(t,e){if(typeof t==\"boolean\")return!t;for(let r in t)if(r!==\"$ref\"&&e.all[r])return!0;return!1}P.schemaHasRulesButRef=xi;function Fi({topSchemaRef:t,schemaPath:e},r,s,n){if(!n){if(typeof r==\"number\"||typeof r==\"boolean\")return r;if(typeof r==\"string\")return(0,T._)`${r}`}return(0,T._)`${t}${e}${(0,T.getProperty)(s)}`}P.schemaRefOrVal=Fi;function Li(t){return Zs(decodeURIComponent(t))}P.unescapeFragment=Li;function Hi(t){return encodeURIComponent(wr(t))}P.escapeFragment=Hi;function wr(t){return typeof t==\"number\"?`${t}`:t.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")}P.escapeJsonPointer=wr;function Zs(t){return t.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}P.unescapeJsonPointer=Zs;function Gi(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}P.eachItem=Gi;function Bs({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:s}){return(n,o,i,a)=>{let c=i===void 0?o:i instanceof T.Name?(o instanceof T.Name?t(n,o,i):e(n,o,i),i):o instanceof T.Name?(e(n,i,o),o):r(o,i);return a===T.Name&&!(c instanceof T.Name)?s(n,c):c}}P.mergeEvaluated={props:Bs({mergeNames:(t,e,r)=>t.if((0,T._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,T._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,T._)`${r} || {}`).code((0,T._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,T._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,T._)`${r} || {}`),br(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:en}),items:Bs({mergeNames:(t,e,r)=>t.if((0,T._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,T._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,T._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,T._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var(\"items\",e)})};function en(t,e){if(e===!0)return t.var(\"props\",!0);let r=t.var(\"props\",(0,T._)`{}`);return e!==void 0&&br(t,r,e),r}P.evaluatedPropsToName=en;function br(t,e,r){Object.keys(r).forEach(s=>t.assign((0,T._)`${e}${(0,T.getProperty)(s)}`,!0))}P.setEvaluated=br;var Qs={};function Ji(t,e){return t.scopeValue(\"func\",{ref:e,code:Qs[e.code]||(Qs[e.code]=new zi._Code(e.code))})}P.useFunc=Ji;var vr;(function(t){t[t.Num=0]=\"Num\",t[t.Str=1]=\"Str\"})(vr||(P.Type=vr={}));function Wi(t,e,r){if(t instanceof T.Name){let s=e===vr.Num;return r?s?(0,T._)`\"[\" + ${t} + \"]\"`:(0,T._)`\"['\" + ${t} + \"']\"`:s?(0,T._)`\"/\" + ${t}`:(0,T._)`\"/\" + ${t}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`}return r?(0,T.getProperty)(t).toString():\"/\"+wr(t)}P.getErrorPath=Wi;function tn(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}P.checkStrictMode=tn});var le=g(Er=>{\"use strict\";Object.defineProperty(Er,\"__esModule\",{value:!0});var U=S(),Bi={data:new U.Name(\"data\"),valCxt:new U.Name(\"valCxt\"),instancePath:new U.Name(\"instancePath\"),parentData:new U.Name(\"parentData\"),parentDataProperty:new U.Name(\"parentDataProperty\"),rootData:new U.Name(\"rootData\"),dynamicAnchors:new U.Name(\"dynamicAnchors\"),vErrors:new U.Name(\"vErrors\"),errors:new U.Name(\"errors\"),this:new U.Name(\"this\"),self:new U.Name(\"self\"),scope:new U.Name(\"scope\"),json:new U.Name(\"json\"),jsonPos:new U.Name(\"jsonPos\"),jsonLen:new U.Name(\"jsonLen\"),jsonPart:new U.Name(\"jsonPart\")};Er.default=Bi});var tt=g(K=>{\"use strict\";Object.defineProperty(K,\"__esModule\",{value:!0});K.extendErrors=K.resetErrorsCount=K.reportExtraError=K.reportError=K.keyword$DataError=K.keywordError=void 0;var j=S(),qt=O(),F=le();K.keywordError={message:({keyword:t})=>(0,j.str)`must pass \"${t}\" keyword validation`};K.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,j.str)`\"${t}\" keyword must be ${e} ($data)`:(0,j.str)`\"${t}\" keyword is invalid ($data)`};function Qi(t,e=K.keywordError,r,s){let{it:n}=t,{gen:o,compositeRule:i,allErrors:a}=n,c=nn(t,e,r);s??(i||a)?rn(o,c):sn(n,(0,j._)`[${c}]`)}K.reportError=Qi;function Xi(t,e=K.keywordError,r){let{it:s}=t,{gen:n,compositeRule:o,allErrors:i}=s,a=nn(t,e,r);rn(n,a),o||i||sn(s,F.default.vErrors)}K.reportExtraError=Xi;function Yi(t,e){t.assign(F.default.errors,e),t.if((0,j._)`${F.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,j._)`${F.default.vErrors}.length`,e),()=>t.assign(F.default.vErrors,null)))}K.resetErrorsCount=Yi;function Zi({gen:t,keyword:e,schemaValue:r,data:s,errsCount:n,it:o}){if(n===void 0)throw new Error(\"ajv implementation error\");let i=t.name(\"err\");t.forRange(\"i\",n,F.default.errors,a=>{t.const(i,(0,j._)`${F.default.vErrors}[${a}]`),t.if((0,j._)`${i}.instancePath === undefined`,()=>t.assign((0,j._)`${i}.instancePath`,(0,j.strConcat)(F.default.instancePath,o.errorPath))),t.assign((0,j._)`${i}.schemaPath`,(0,j.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,j._)`${i}.schema`,r),t.assign((0,j._)`${i}.data`,s))})}K.extendErrors=Zi;function rn(t,e){let r=t.const(\"err\",e);t.if((0,j._)`${F.default.vErrors} === null`,()=>t.assign(F.default.vErrors,(0,j._)`[${r}]`),(0,j._)`${F.default.vErrors}.push(${r})`),t.code((0,j._)`${F.default.errors}++`)}function sn(t,e){let{gen:r,validateName:s,schemaEnv:n}=t;n.$async?r.throw((0,j._)`new ${t.ValidationError}(${e})`):(r.assign((0,j._)`${s}.errors`,e),r.return(!1))}var Ee={keyword:new j.Name(\"keyword\"),schemaPath:new j.Name(\"schemaPath\"),params:new j.Name(\"params\"),propertyName:new j.Name(\"propertyName\"),message:new j.Name(\"message\"),schema:new j.Name(\"schema\"),parentSchema:new j.Name(\"parentSchema\")};function nn(t,e,r){let{createErrors:s}=t.it;return s===!1?(0,j._)`{}`:ea(t,e,r)}function ea(t,e,r={}){let{gen:s,it:n}=t,o=[ta(n,r),ra(t,r)];return sa(t,e,o),s.object(...o)}function ta({errorPath:t},{instancePath:e}){let r=e?(0,j.str)`${t}${(0,qt.getErrorPath)(e,qt.Type.Str)}`:t;return[F.default.instancePath,(0,j.strConcat)(F.default.instancePath,r)]}function ra({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:s}){let n=s?e:(0,j.str)`${e}/${t}`;return r&&(n=(0,j.str)`${n}${(0,qt.getErrorPath)(r,qt.Type.Str)}`),[Ee.schemaPath,n]}function sa(t,{params:e,message:r},s){let{keyword:n,data:o,schemaValue:i,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;s.push([Ee.keyword,n],[Ee.params,typeof e==\"function\"?e(t):e||(0,j._)`{}`]),c.messages&&s.push([Ee.message,typeof r==\"function\"?r(t):r]),c.verbose&&s.push([Ee.schema,i],[Ee.parentSchema,(0,j._)`${u}${d}`],[F.default.data,o]),l&&s.push([Ee.propertyName,l])}});var an=g(Ie=>{\"use strict\";Object.defineProperty(Ie,\"__esModule\",{value:!0});Ie.boolOrEmptySchema=Ie.topBoolOrEmptySchema=void 0;var na=tt(),oa=S(),ia=le(),aa={message:\"boolean schema is false\"};function ca(t){let{gen:e,schema:r,validateName:s}=t;r===!1?on(t,!1):typeof r==\"object\"&&r.$async===!0?e.return(ia.default.data):(e.assign((0,oa._)`${s}.errors`,null),e.return(!0))}Ie.topBoolOrEmptySchema=ca;function ua(t,e){let{gen:r,schema:s}=t;s===!1?(r.var(e,!1),on(t)):r.var(e,!0)}Ie.boolOrEmptySchema=ua;function on(t,e){let{gen:r,data:s}=t,n={gen:r,keyword:\"false schema\",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,na.reportError)(n,aa,void 0,e)}});var Sr=g(Te=>{\"use strict\";Object.defineProperty(Te,\"__esModule\",{value:!0});Te.getRules=Te.isJSONType=void 0;var la=[\"string\",\"number\",\"integer\",\"boolean\",\"null\",\"object\",\"array\"],da=new Set(la);function fa(t){return typeof t==\"string\"&&da.has(t)}Te.isJSONType=fa;function ha(){let t={number:{type:\"number\",rules:[]},string:{type:\"string\",rules:[]},array:{type:\"array\",rules:[]},object:{type:\"object\",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Te.getRules=ha});var Pr=g(he=>{\"use strict\";Object.defineProperty(he,\"__esModule\",{value:!0});he.shouldUseRule=he.shouldUseGroup=he.schemaHasRulesForType=void 0;function pa({schema:t,self:e},r){let s=e.RULES.types[r];return s&&s!==!0&&cn(t,s)}he.schemaHasRulesForType=pa;function cn(t,e){return e.rules.some(r=>un(t,r))}he.shouldUseGroup=cn;function un(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(s=>t[s]!==void 0))}he.shouldUseRule=un});var rt=g(x=>{\"use strict\";Object.defineProperty(x,\"__esModule\",{value:!0});x.reportTypeError=x.checkDataTypes=x.checkDataType=x.coerceAndCheckDataType=x.getJSONTypes=x.getSchemaTypes=x.DataType=void 0;var ma=Sr(),ya=Pr(),_a=tt(),b=S(),ln=O(),Ce;(function(t){t[t.Correct=0]=\"Correct\",t[t.Wrong=1]=\"Wrong\"})(Ce||(x.DataType=Ce={}));function ga(t){let e=dn(t.type);if(e.includes(\"null\")){if(t.nullable===!1)throw new Error(\"type: null contradicts nullable: false\")}else{if(!e.length&&t.nullable!==void 0)throw new Error('\"nullable\" cannot be used without \"type\"');t.nullable===!0&&e.push(\"null\")}return e}x.getSchemaTypes=ga;function dn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(ma.isJSONType))return e;throw new Error(\"type must be JSONType or JSONType[]: \"+e.join(\",\"))}x.getJSONTypes=dn;function $a(t,e){let{gen:r,data:s,opts:n}=t,o=va(e,n.coerceTypes),i=e.length>0&&!(o.length===0&&e.length===1&&(0,ya.schemaHasRulesForType)(t,e[0]));if(i){let a=kr(e,s,n.strictNumbers,Ce.Wrong);r.if(a,()=>{o.length?wa(t,e,o):qr(t)})}return i}x.coerceAndCheckDataType=$a;var fn=new Set([\"string\",\"number\",\"integer\",\"boolean\",\"null\"]);function va(t,e){return e?t.filter(r=>fn.has(r)||e===\"array\"&&r===\"array\"):[]}function wa(t,e,r){let{gen:s,data:n,opts:o}=t,i=s.let(\"dataType\",(0,b._)`typeof ${n}`),a=s.let(\"coerced\",(0,b._)`undefined`);o.coerceTypes===\"array\"&&s.if((0,b._)`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>s.assign(n,(0,b._)`${n}[0]`).assign(i,(0,b._)`typeof ${n}`).if(kr(e,n,o.strictNumbers),()=>s.assign(a,n))),s.if((0,b._)`${a} !== undefined`);for(let l of r)(fn.has(l)||l===\"array\"&&o.coerceTypes===\"array\")&&c(l);s.else(),qr(t),s.endIf(),s.if((0,b._)`${a} !== undefined`,()=>{s.assign(n,a),ba(t,a)});function c(l){switch(l){case\"string\":s.elseIf((0,b._)`${i} == \"number\" || ${i} == \"boolean\"`).assign(a,(0,b._)`\"\" + ${n}`).elseIf((0,b._)`${n} === null`).assign(a,(0,b._)`\"\"`);return;case\"number\":s.elseIf((0,b._)`${i} == \"boolean\" || ${n} === null\n || (${i} == \"string\" && ${n} && ${n} == +${n})`).assign(a,(0,b._)`+${n}`);return;case\"integer\":s.elseIf((0,b._)`${i} === \"boolean\" || ${n} === null\n || (${i} === \"string\" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,b._)`+${n}`);return;case\"boolean\":s.elseIf((0,b._)`${n} === \"false\" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,b._)`${n} === \"true\" || ${n} === 1`).assign(a,!0);return;case\"null\":s.elseIf((0,b._)`${n} === \"\" || ${n} === 0 || ${n} === false`),s.assign(a,null);return;case\"array\":s.elseIf((0,b._)`${i} === \"string\" || ${i} === \"number\"\n || ${i} === \"boolean\" || ${n} === null`).assign(a,(0,b._)`[${n}]`)}}}function ba({gen:t,parentData:e,parentDataProperty:r},s){t.if((0,b._)`${e} !== undefined`,()=>t.assign((0,b._)`${e}[${r}]`,s))}function Nr(t,e,r,s=Ce.Correct){let n=s===Ce.Correct?b.operators.EQ:b.operators.NEQ,o;switch(t){case\"null\":return(0,b._)`${e} ${n} null`;case\"array\":o=(0,b._)`Array.isArray(${e})`;break;case\"object\":o=(0,b._)`${e} && typeof ${e} == \"object\" && !Array.isArray(${e})`;break;case\"integer\":o=i((0,b._)`!(${e} % 1) && !isNaN(${e})`);break;case\"number\":o=i();break;default:return(0,b._)`typeof ${e} ${n} ${t}`}return s===Ce.Correct?o:(0,b.not)(o);function i(a=b.nil){return(0,b.and)((0,b._)`typeof ${e} == \"number\"`,a,r?(0,b._)`isFinite(${e})`:b.nil)}}x.checkDataType=Nr;function kr(t,e,r,s){if(t.length===1)return Nr(t[0],e,r,s);let n,o=(0,ln.toHash)(t);if(o.array&&o.object){let i=(0,b._)`typeof ${e} != \"object\"`;n=o.null?i:(0,b._)`!${e} || ${i}`,delete o.null,delete o.array,delete o.object}else n=b.nil;o.number&&delete o.integer;for(let i in o)n=(0,b.and)(n,Nr(i,e,r,s));return n}x.checkDataTypes=kr;var Ea={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t==\"string\"?(0,b._)`{type: ${t}}`:(0,b._)`{type: ${e}}`};function qr(t){let e=Sa(t);(0,_a.reportError)(e,Ea)}x.reportTypeError=qr;function Sa(t){let{gen:e,data:r,schema:s}=t,n=(0,ln.schemaRefOrVal)(t,s,\"type\");return{gen:e,keyword:\"type\",data:r,schema:s.type,schemaCode:n,schemaValue:n,parentSchema:s,params:{},it:t}}});var pn=g(Ot=>{\"use strict\";Object.defineProperty(Ot,\"__esModule\",{value:!0});Ot.assignDefaults=void 0;var Me=S(),Pa=O();function Na(t,e){let{properties:r,items:s}=t.schema;if(e===\"object\"&&r)for(let n in r)hn(t,n,r[n].default);else e===\"array\"&&Array.isArray(s)&&s.forEach((n,o)=>hn(t,o,n.default))}Ot.assignDefaults=Na;function hn(t,e,r){let{gen:s,compositeRule:n,data:o,opts:i}=t;if(r===void 0)return;let a=(0,Me._)`${o}${(0,Me.getProperty)(e)}`;if(n){(0,Pa.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Me._)`${a} === undefined`;i.useDefaults===\"empty\"&&(c=(0,Me._)`${c} || ${a} === null || ${a} === \"\"`),s.if(c,(0,Me._)`${a} = ${(0,Me.stringify)(r)}`)}});var Q=g(I=>{\"use strict\";Object.defineProperty(I,\"__esModule\",{value:!0});I.validateUnion=I.validateArray=I.usePattern=I.callValidateCode=I.schemaProperties=I.allSchemaProperties=I.noPropertyInData=I.propertyInData=I.isOwnProperty=I.hasPropFunc=I.reportMissingProp=I.checkMissingProp=I.checkReportMissingProp=void 0;var M=S(),Or=O(),pe=le(),ka=O();function qa(t,e){let{gen:r,data:s,it:n}=t;r.if(Rr(r,s,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,M._)`${e}`},!0),t.error()})}I.checkReportMissingProp=qa;function Oa({gen:t,data:e,it:{opts:r}},s,n){return(0,M.or)(...s.map(o=>(0,M.and)(Rr(t,e,o,r.ownProperties),(0,M._)`${n} = ${o}`)))}I.checkMissingProp=Oa;function ja(t,e){t.setParams({missingProperty:e},!0),t.error()}I.reportMissingProp=ja;function mn(t){return t.scopeValue(\"func\",{ref:Object.prototype.hasOwnProperty,code:(0,M._)`Object.prototype.hasOwnProperty`})}I.hasPropFunc=mn;function jr(t,e,r){return(0,M._)`${mn(t)}.call(${e}, ${r})`}I.isOwnProperty=jr;function Ra(t,e,r,s){let n=(0,M._)`${e}${(0,M.getProperty)(r)} !== undefined`;return s?(0,M._)`${n} && ${jr(t,e,r)}`:n}I.propertyInData=Ra;function Rr(t,e,r,s){let n=(0,M._)`${e}${(0,M.getProperty)(r)} === undefined`;return s?(0,M.or)(n,(0,M.not)(jr(t,e,r))):n}I.noPropertyInData=Rr;function yn(t){return t?Object.keys(t).filter(e=>e!==\"__proto__\"):[]}I.allSchemaProperties=yn;function Ia(t,e){return yn(e).filter(r=>!(0,Or.alwaysValidSchema)(t,e[r]))}I.schemaProperties=Ia;function Ta({schemaCode:t,data:e,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:o},it:i},a,c,l){let u=l?(0,M._)`${t}, ${e}, ${s}${n}`:e,d=[[pe.default.instancePath,(0,M.strConcat)(pe.default.instancePath,o)],[pe.default.parentData,i.parentData],[pe.default.parentDataProperty,i.parentDataProperty],[pe.default.rootData,pe.default.rootData]];i.opts.dynamicRef&&d.push([pe.default.dynamicAnchors,pe.default.dynamicAnchors]);let y=(0,M._)`${u}, ${r.object(...d)}`;return c!==M.nil?(0,M._)`${a}.call(${c}, ${y})`:(0,M._)`${a}(${y})`}I.callValidateCode=Ta;var Ca=(0,M._)`new RegExp`;function Ma({gen:t,it:{opts:e}},r){let s=e.unicodeRegExp?\"u\":\"\",{regExp:n}=e.code,o=n(r,s);return t.scopeValue(\"pattern\",{key:o.toString(),ref:o,code:(0,M._)`${n.code===\"new RegExp\"?Ca:(0,ka.useFunc)(t,n)}(${r}, ${s})`})}I.usePattern=Ma;function Aa(t){let{gen:e,data:r,keyword:s,it:n}=t,o=e.name(\"valid\");if(n.allErrors){let a=e.let(\"valid\",!0);return i(()=>e.assign(a,!1)),a}return e.var(o,!0),i(()=>e.break()),o;function i(a){let c=e.const(\"len\",(0,M._)`${r}.length`);e.forRange(\"i\",0,c,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:Or.Type.Num},o),e.if((0,M.not)(o),a)})}}I.validateArray=Aa;function Da(t){let{gen:e,schema:r,keyword:s,it:n}=t;if(!Array.isArray(r))throw new Error(\"ajv implementation error\");if(r.some(c=>(0,Or.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let i=e.let(\"valid\",!1),a=e.name(\"_valid\");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:s,schemaProp:l,compositeRule:!0},a);e.assign(i,(0,M._)`${i} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,M.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}I.validateUnion=Da});var $n=g(ne=>{\"use strict\";Object.defineProperty(ne,\"__esModule\",{value:!0});ne.validateKeywordUsage=ne.validSchemaType=ne.funcKeywordCode=ne.macroKeywordCode=void 0;var L=S(),Se=le(),Va=Q(),za=tt();function Ua(t,e){let{gen:r,keyword:s,schema:n,parentSchema:o,it:i}=t,a=e.macro.call(i.self,n,o,i),c=gn(r,s,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let l=r.name(\"valid\");t.subschema({schema:a,schemaPath:L.nil,errSchemaPath:`${i.errSchemaPath}/${s}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}ne.macroKeywordCode=Ua;function Ka(t,e){var r;let{gen:s,keyword:n,schema:o,parentSchema:i,$data:a,it:c}=t;Fa(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,i,c):e.validate,u=gn(s,n,l),d=s.let(\"valid\");t.block$data(d,y),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function y(){if(e.errors===!1)f(),e.modifying&&_n(t),p(()=>t.error());else{let _=e.async?m():h();e.modifying&&_n(t),p(()=>xa(t,_))}}function m(){let _=s.let(\"ruleErrs\",null);return s.try(()=>f((0,L._)`await `),q=>s.assign(d,!1).if((0,L._)`${q} instanceof ${c.ValidationError}`,()=>s.assign(_,(0,L._)`${q}.errors`),()=>s.throw(q))),_}function h(){let _=(0,L._)`${u}.errors`;return s.assign(_,null),f(L.nil),_}function f(_=e.async?(0,L._)`await `:L.nil){let q=c.opts.passContext?Se.default.this:Se.default.self,N=!(\"compile\"in e&&!a||e.schema===!1);s.assign(d,(0,L._)`${_}${(0,Va.callValidateCode)(t,u,q,N)}`,e.modifying)}function p(_){var q;s.if((0,L.not)((q=e.valid)!==null&&q!==void 0?q:d),_)}}ne.funcKeywordCode=Ka;function _n(t){let{gen:e,data:r,it:s}=t;e.if(s.parentData,()=>e.assign(r,(0,L._)`${s.parentData}[${s.parentDataProperty}]`))}function xa(t,e){let{gen:r}=t;r.if((0,L._)`Array.isArray(${e})`,()=>{r.assign(Se.default.vErrors,(0,L._)`${Se.default.vErrors} === null ? ${e} : ${Se.default.vErrors}.concat(${e})`).assign(Se.default.errors,(0,L._)`${Se.default.vErrors}.length`),(0,za.extendErrors)(t)},()=>t.error())}function Fa({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error(\"async keyword in sync schema\")}function gn(t,e,r){if(r===void 0)throw new Error(`keyword \"${e}\" failed to compile`);return t.scopeValue(\"keyword\",typeof r==\"function\"?{ref:r}:{ref:r,code:(0,L.stringify)(r)})}function La(t,e,r=!1){return!e.length||e.some(s=>s===\"array\"?Array.isArray(t):s===\"object\"?t&&typeof t==\"object\"&&!Array.isArray(t):typeof t==s||r&&typeof t>\"u\")}ne.validSchemaType=La;function Ha({schema:t,opts:e,self:r,errSchemaPath:s},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw new Error(\"ajv implementation error\");let i=n.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${i.join(\",\")}`);if(n.validateSchema&&!n.validateSchema(t[o])){let c=`keyword \"${o}\" value is invalid at path \"${s}\": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema===\"log\")r.logger.error(c);else throw new Error(c)}}ne.validateKeywordUsage=Ha});var wn=g(me=>{\"use strict\";Object.defineProperty(me,\"__esModule\",{value:!0});me.extendSubschemaMode=me.extendSubschemaData=me.getSubschema=void 0;var oe=S(),vn=O();function Ga(t,{keyword:e,schemaProp:r,schema:s,schemaPath:n,errSchemaPath:o,topSchemaRef:i}){if(e!==void 0&&s!==void 0)throw new Error('both \"keyword\" and \"schema\" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,oe._)`${t.schemaPath}${(0,oe.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,oe._)`${t.schemaPath}${(0,oe.getProperty)(e)}${(0,oe.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,vn.escapeFragment)(r)}`}}if(s!==void 0){if(n===void 0||o===void 0||i===void 0)throw new Error('\"schemaPath\", \"errSchemaPath\" and \"topSchemaRef\" are required with \"schema\"');return{schema:s,schemaPath:n,topSchemaRef:i,errSchemaPath:o}}throw new Error('either \"keyword\" or \"schema\" must be passed')}me.getSubschema=Ga;function Ja(t,e,{dataProp:r,dataPropType:s,data:n,dataTypes:o,propertyName:i}){if(n!==void 0&&r!==void 0)throw new Error('both \"data\" and \"dataProp\" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,y=a.let(\"data\",(0,oe._)`${e.data}${(0,oe.getProperty)(r)}`,!0);c(y),t.errorPath=(0,oe.str)`${l}${(0,vn.getErrorPath)(r,s,d.jsPropertySyntax)}`,t.parentDataProperty=(0,oe._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(n!==void 0){let l=n instanceof oe.Name?n:a.let(\"data\",n,!0);c(l),i!==void 0&&(t.propertyName=i)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}me.extendSubschemaData=Ja;function Wa(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:s,createErrors:n,allErrors:o}){s!==void 0&&(t.compositeRule=s),n!==void 0&&(t.createErrors=n),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}me.extendSubschemaMode=Wa});var Ir=g((Pf,bn)=>{\"use strict\";bn.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e==\"object\"&&typeof r==\"object\"){if(e.constructor!==r.constructor)return!1;var s,n,o;if(Array.isArray(e)){if(s=e.length,s!=r.length)return!1;for(n=s;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),s=o.length,s!==Object.keys(r).length)return!1;for(n=s;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=s;n--!==0;){var i=o[n];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var Sn=g((Nf,En)=>{\"use strict\";var ye=En.exports=function(t,e,r){typeof e==\"function\"&&(r=e,e={}),r=e.cb||r;var s=typeof r==\"function\"?r:r.pre||function(){},n=r.post||function(){};jt(e,s,n,t,\"\",t)};ye.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ye.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ye.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ye.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function jt(t,e,r,s,n,o,i,a,c,l){if(s&&typeof s==\"object\"&&!Array.isArray(s)){e(s,n,o,i,a,c,l);for(var u in s){var d=s[u];if(Array.isArray(d)){if(u in ye.arrayKeywords)for(var y=0;y{\"use strict\";Object.defineProperty(J,\"__esModule\",{value:!0});J.getSchemaRefs=J.resolveUrl=J.normalizeId=J._getFullPath=J.getFullPath=J.inlineRef=void 0;var Qa=O(),Xa=Ir(),Ya=Sn(),Za=new Set([\"type\",\"format\",\"pattern\",\"maxLength\",\"minLength\",\"maxProperties\",\"minProperties\",\"maxItems\",\"minItems\",\"maximum\",\"minimum\",\"uniqueItems\",\"multipleOf\",\"required\",\"enum\",\"const\"]);function ec(t,e=!0){return typeof t==\"boolean\"?!0:e===!0?!Tr(t):e?Pn(t)<=e:!1}J.inlineRef=ec;var tc=new Set([\"$ref\",\"$recursiveRef\",\"$recursiveAnchor\",\"$dynamicRef\",\"$dynamicAnchor\"]);function Tr(t){for(let e in t){if(tc.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Tr)||typeof r==\"object\"&&Tr(r))return!0}return!1}function Pn(t){let e=0;for(let r in t){if(r===\"$ref\")return 1/0;if(e++,!Za.has(r)&&(typeof t[r]==\"object\"&&(0,Qa.eachItem)(t[r],s=>e+=Pn(s)),e===1/0))return 1/0}return e}function Nn(t,e=\"\",r){r!==!1&&(e=Ae(e));let s=t.parse(e);return kn(t,s)}J.getFullPath=Nn;function kn(t,e){return t.serialize(e).split(\"#\")[0]+\"#\"}J._getFullPath=kn;var rc=/#\\/?$/;function Ae(t){return t?t.replace(rc,\"\"):\"\"}J.normalizeId=Ae;function sc(t,e,r){return r=Ae(r),t.resolve(e,r)}J.resolveUrl=sc;var nc=/^[a-z_][-a-z0-9._]*$/i;function oc(t,e){if(typeof t==\"boolean\")return{};let{schemaId:r,uriResolver:s}=this.opts,n=Ae(t[r]||e),o={\"\":n},i=Nn(s,n,!1),a={},c=new Set;return Ya(t,{allKeys:!0},(d,y,m,h)=>{if(h===void 0)return;let f=i+y,p=o[h];typeof d[r]==\"string\"&&(p=_.call(this,d[r])),q.call(this,d.$anchor),q.call(this,d.$dynamicAnchor),o[y]=p;function _(N){let C=this.opts.uriResolver.resolve;if(N=Ae(p?C(p,N):N),c.has(N))throw u(N);c.add(N);let w=this.refs[N];return typeof w==\"string\"&&(w=this.refs[w]),typeof w==\"object\"?l(d,w.schema,N):N!==Ae(f)&&(N[0]===\"#\"?(l(d,a[N],N),a[N]=d):this.refs[N]=f),N}function q(N){if(typeof N==\"string\"){if(!nc.test(N))throw new Error(`invalid anchor \"${N}\"`);_.call(this,`#${N}`)}}}),a;function l(d,y,m){if(y!==void 0&&!Xa(d,y))throw u(m)}function u(d){return new Error(`reference \"${d}\" resolves to more than one schema`)}}J.getSchemaRefs=oc});var it=g(_e=>{\"use strict\";Object.defineProperty(_e,\"__esModule\",{value:!0});_e.getData=_e.KeywordCxt=_e.validateFunctionCode=void 0;var In=an(),qn=rt(),Mr=Pr(),Rt=rt(),ic=pn(),ot=$n(),Cr=wn(),$=S(),v=le(),ac=st(),de=O(),nt=tt();function cc(t){if(Mn(t)&&(An(t),Cn(t))){dc(t);return}Tn(t,()=>(0,In.topBoolOrEmptySchema)(t))}_e.validateFunctionCode=cc;function Tn({gen:t,validateName:e,schema:r,schemaEnv:s,opts:n},o){n.code.es5?t.func(e,(0,$._)`${v.default.data}, ${v.default.valCxt}`,s.$async,()=>{t.code((0,$._)`\"use strict\"; ${On(r,n)}`),lc(t,n),t.code(o)}):t.func(e,(0,$._)`${v.default.data}, ${uc(n)}`,s.$async,()=>t.code(On(r,n)).code(o))}function uc(t){return(0,$._)`{${v.default.instancePath}=\"\", ${v.default.parentData}, ${v.default.parentDataProperty}, ${v.default.rootData}=${v.default.data}${t.dynamicRef?(0,$._)`, ${v.default.dynamicAnchors}={}`:$.nil}}={}`}function lc(t,e){t.if(v.default.valCxt,()=>{t.var(v.default.instancePath,(0,$._)`${v.default.valCxt}.${v.default.instancePath}`),t.var(v.default.parentData,(0,$._)`${v.default.valCxt}.${v.default.parentData}`),t.var(v.default.parentDataProperty,(0,$._)`${v.default.valCxt}.${v.default.parentDataProperty}`),t.var(v.default.rootData,(0,$._)`${v.default.valCxt}.${v.default.rootData}`),e.dynamicRef&&t.var(v.default.dynamicAnchors,(0,$._)`${v.default.valCxt}.${v.default.dynamicAnchors}`)},()=>{t.var(v.default.instancePath,(0,$._)`\"\"`),t.var(v.default.parentData,(0,$._)`undefined`),t.var(v.default.parentDataProperty,(0,$._)`undefined`),t.var(v.default.rootData,v.default.data),e.dynamicRef&&t.var(v.default.dynamicAnchors,(0,$._)`{}`)})}function dc(t){let{schema:e,opts:r,gen:s}=t;Tn(t,()=>{r.$comment&&e.$comment&&Vn(t),yc(t),s.let(v.default.vErrors,null),s.let(v.default.errors,0),r.unevaluated&&fc(t),Dn(t),$c(t)})}function fc(t){let{gen:e,validateName:r}=t;t.evaluated=e.const(\"evaluated\",(0,$._)`${r}.evaluated`),e.if((0,$._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,$._)`${t.evaluated}.props`,(0,$._)`undefined`)),e.if((0,$._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,$._)`${t.evaluated}.items`,(0,$._)`undefined`))}function On(t,e){let r=typeof t==\"object\"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,$._)`/*# sourceURL=${r} */`:$.nil}function hc(t,e){if(Mn(t)&&(An(t),Cn(t))){pc(t,e);return}(0,In.boolOrEmptySchema)(t,e)}function Cn({schema:t,self:e}){if(typeof t==\"boolean\")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Mn(t){return typeof t.schema!=\"boolean\"}function pc(t,e){let{schema:r,gen:s,opts:n}=t;n.$comment&&r.$comment&&Vn(t),_c(t),gc(t);let o=s.const(\"_errs\",v.default.errors);Dn(t,o),s.var(e,(0,$._)`${o} === ${v.default.errors}`)}function An(t){(0,de.checkUnknownRules)(t),mc(t)}function Dn(t,e){if(t.opts.jtd)return jn(t,[],!1,e);let r=(0,qn.getSchemaTypes)(t.schema),s=(0,qn.coerceAndCheckDataType)(t,r);jn(t,r,!s,e)}function mc(t){let{schema:e,errSchemaPath:r,opts:s,self:n}=t;e.$ref&&s.ignoreKeywordsWithRef&&(0,de.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path \"${r}\"`)}function yc(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,de.checkStrictMode)(t,\"default is ignored in the schema root\")}function _c(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,ac.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function gc(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error(\"async schema in sync schema\")}function Vn({gen:t,schemaEnv:e,schema:r,errSchemaPath:s,opts:n}){let o=r.$comment;if(n.$comment===!0)t.code((0,$._)`${v.default.self}.logger.log(${o})`);else if(typeof n.$comment==\"function\"){let i=(0,$.str)`${s}/$comment`,a=t.scopeValue(\"root\",{ref:e.root});t.code((0,$._)`${v.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function $c(t){let{gen:e,schemaEnv:r,validateName:s,ValidationError:n,opts:o}=t;r.$async?e.if((0,$._)`${v.default.errors} === 0`,()=>e.return(v.default.data),()=>e.throw((0,$._)`new ${n}(${v.default.vErrors})`)):(e.assign((0,$._)`${s}.errors`,v.default.vErrors),o.unevaluated&&vc(t),e.return((0,$._)`${v.default.errors} === 0`))}function vc({gen:t,evaluated:e,props:r,items:s}){r instanceof $.Name&&t.assign((0,$._)`${e}.props`,r),s instanceof $.Name&&t.assign((0,$._)`${e}.items`,s)}function jn(t,e,r,s){let{gen:n,schema:o,data:i,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,de.schemaHasRulesButRef)(o,u))){n.block(()=>Un(t,\"$ref\",u.all.$ref.definition));return}c.jtd||wc(t,e),n.block(()=>{for(let y of u.rules)d(y);d(u.post)});function d(y){(0,Mr.shouldUseGroup)(o,y)&&(y.type?(n.if((0,Rt.checkDataType)(y.type,i,c.strictNumbers)),Rn(t,y),e.length===1&&e[0]===y.type&&r&&(n.else(),(0,Rt.reportTypeError)(t)),n.endIf()):Rn(t,y),a||n.if((0,$._)`${v.default.errors} === ${s||0}`))}}function Rn(t,e){let{gen:r,schema:s,opts:{useDefaults:n}}=t;n&&(0,ic.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,Mr.shouldUseRule)(s,o)&&Un(t,o.keyword,o.definition,e.type)})}function wc(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(bc(t,e),t.opts.allowUnionTypes||Ec(t,e),Sc(t,t.dataTypes))}function bc(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{zn(t.dataTypes,r)||Ar(t,`type \"${r}\" not allowed by context \"${t.dataTypes.join(\",\")}\"`)}),Nc(t,e)}}function Ec(t,e){e.length>1&&!(e.length===2&&e.includes(\"null\"))&&Ar(t,\"use allowUnionTypes to allow union type keyword\")}function Sc(t,e){let r=t.self.RULES.all;for(let s in r){let n=r[s];if(typeof n==\"object\"&&(0,Mr.shouldUseRule)(t.schema,n)){let{type:o}=n.definition;o.length&&!o.some(i=>Pc(e,i))&&Ar(t,`missing type \"${o.join(\",\")}\" for keyword \"${s}\"`)}}}function Pc(t,e){return t.includes(e)||e===\"number\"&&t.includes(\"integer\")}function zn(t,e){return t.includes(e)||e===\"integer\"&&t.includes(\"number\")}function Nc(t,e){let r=[];for(let s of t.dataTypes)zn(e,s)?r.push(s):e.includes(\"integer\")&&s===\"number\"&&r.push(\"integer\");t.dataTypes=r}function Ar(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at \"${r}\" (strictTypes)`,(0,de.checkStrictMode)(t,e,t.opts.strictTypes)}var It=class{constructor(e,r,s){if((0,ot.validateKeywordUsage)(e,r,s),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=s,this.data=e.data,this.schema=e.schema[s],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,de.schemaRefOrVal)(e,this.schema,s,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const(\"vSchema\",Kn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ot.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${s} value must be ${JSON.stringify(r.schemaType)}`);(\"code\"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const(\"_errs\",v.default.errors))}result(e,r,s){this.failResult((0,$.not)(e),r,s)}failResult(e,r,s){this.gen.if(e),s?s():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,$.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,$._)`${r} !== undefined && (${(0,$.or)(this.invalid$data(),e)})`)}error(e,r,s){if(r){this.setParams(r),this._error(e,s),this.setParams({});return}this._error(e,s)}_error(e,r){(e?nt.reportExtraError:nt.reportError)(this,this.def.error,r)}$dataError(){(0,nt.reportError)(this,this.def.$dataError||nt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add \"trackErrors\" to keyword definition');(0,nt.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,s=$.nil){this.gen.block(()=>{this.check$data(e,s),r()})}check$data(e=$.nil,r=$.nil){if(!this.$data)return;let{gen:s,schemaCode:n,schemaType:o,def:i}=this;s.if((0,$.or)((0,$._)`${n} === undefined`,r)),e!==$.nil&&s.assign(e,!0),(o.length||i.validateSchema)&&(s.elseIf(this.invalid$data()),this.$dataError(),e!==$.nil&&s.assign(e,!1)),s.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:s,def:n,it:o}=this;return(0,$.or)(i(),a());function i(){if(s.length){if(!(r instanceof $.Name))throw new Error(\"ajv implementation error\");let c=Array.isArray(s)?s:[s];return(0,$._)`${(0,Rt.checkDataTypes)(c,r,o.opts.strictNumbers,Rt.DataType.Wrong)}`}return $.nil}function a(){if(n.validateSchema){let c=e.scopeValue(\"validate$data\",{ref:n.validateSchema});return(0,$._)`!${c}(${r})`}return $.nil}}subschema(e,r){let s=(0,Cr.getSubschema)(this.it,e);(0,Cr.extendSubschemaData)(s,this.it,e),(0,Cr.extendSubschemaMode)(s,e);let n={...this.it,...s,items:void 0,props:void 0};return hc(n,r),n}mergeEvaluated(e,r){let{it:s,gen:n}=this;s.opts.unevaluated&&(s.props!==!0&&e.props!==void 0&&(s.props=de.mergeEvaluated.props(n,e.props,s.props,r)),s.items!==!0&&e.items!==void 0&&(s.items=de.mergeEvaluated.items(n,e.items,s.items,r)))}mergeValidEvaluated(e,r){let{it:s,gen:n}=this;if(s.opts.unevaluated&&(s.props!==!0||s.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,$.Name)),!0}};_e.KeywordCxt=It;function Un(t,e,r,s){let n=new It(t,r,e);\"code\"in r?r.code(n,s):n.$data&&r.validate?(0,ot.funcKeywordCode)(n,r):\"macro\"in r?(0,ot.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,ot.funcKeywordCode)(n,r)}var kc=/^\\/(?:[^~]|~0|~1)*$/,qc=/^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/;function Kn(t,{dataLevel:e,dataNames:r,dataPathArr:s}){let n,o;if(t===\"\")return v.default.rootData;if(t[0]===\"/\"){if(!kc.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,o=v.default.rootData}else{let l=qc.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(n=l[2],n===\"#\"){if(u>=e)throw new Error(c(\"property/index\",u));return s[e-u]}if(u>e)throw new Error(c(\"data\",u));if(o=r[e-u],!n)return o}let i=o,a=n.split(\"/\");for(let l of a)l&&(o=(0,$._)`${o}${(0,$.getProperty)((0,de.unescapeJsonPointer)(l))}`,i=(0,$._)`${i} && ${o}`);return i;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}_e.getData=Kn});var Tt=g(Vr=>{\"use strict\";Object.defineProperty(Vr,\"__esModule\",{value:!0});var Dr=class extends Error{constructor(e){super(\"validation failed\"),this.errors=e,this.ajv=this.validation=!0}};Vr.default=Dr});var at=g(Kr=>{\"use strict\";Object.defineProperty(Kr,\"__esModule\",{value:!0});var zr=st(),Ur=class extends Error{constructor(e,r,s,n){super(n||`can't resolve reference ${s} from id ${r}`),this.missingRef=(0,zr.resolveUrl)(e,r,s),this.missingSchema=(0,zr.normalizeId)((0,zr.getFullPath)(e,this.missingRef))}};Kr.default=Ur});var Mt=g(X=>{\"use strict\";Object.defineProperty(X,\"__esModule\",{value:!0});X.resolveSchema=X.getCompilingSchema=X.resolveRef=X.compileSchema=X.SchemaEnv=void 0;var ee=S(),Oc=Tt(),Pe=le(),te=st(),xn=O(),jc=it(),De=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let s;typeof e.schema==\"object\"&&(s=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,te.normalizeId)(s?.[e.schemaId||\"$id\"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=s?.$async,this.refs={}}};X.SchemaEnv=De;function Fr(t){let e=Fn.call(this,t);if(e)return e;let r=(0,te.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:s,lines:n}=this.opts.code,{ownProperties:o}=this.opts,i=new ee.CodeGen(this.scope,{es5:s,lines:n,ownProperties:o}),a;t.$async&&(a=i.scopeValue(\"Error\",{ref:Oc.default,code:(0,ee._)`require(\"ajv/dist/runtime/validation_error\").default`}));let c=i.scopeName(\"validate\");t.validateName=c;let l={gen:i,allErrors:this.opts.allErrors,data:Pe.default.data,parentData:Pe.default.parentData,parentDataProperty:Pe.default.parentDataProperty,dataNames:[Pe.default.data],dataPathArr:[ee.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue(\"schema\",this.opts.code.source===!0?{ref:t.schema,code:(0,ee.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:ee.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?\"\":\"#\"),errorPath:(0,ee._)`\"\"`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,jc.validateFunctionCode)(l),i.optimize(this.opts.code.optimize);let d=i.toString();u=`${i.scopeRefs(Pe.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let m=new Function(`${Pe.default.self}`,`${Pe.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=t.schema,m.schemaEnv=t,t.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:h,items:f}=l;m.evaluated={props:h instanceof ee.Name?void 0:h,items:f instanceof ee.Name?void 0:f,dynamicProps:h instanceof ee.Name,dynamicItems:f instanceof ee.Name},m.source&&(m.source.evaluated=(0,ee.stringify)(m.evaluated))}return t.validate=m,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error(\"Error compiling schema, function code:\",u),d}finally{this._compilations.delete(t)}}X.compileSchema=Fr;function Rc(t,e,r){var s;r=(0,te.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let o=Cc.call(this,t,r);if(o===void 0){let i=(s=t.localRefs)===null||s===void 0?void 0:s[r],{schemaId:a}=this.opts;i&&(o=new De({schema:i,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=Ic.call(this,o)}X.resolveRef=Rc;function Ic(t){return(0,te.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Fr.call(this,t)}function Fn(t){for(let e of this._compilations)if(Tc(e,t))return e}X.getCompilingSchema=Fn;function Tc(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Cc(t,e){let r;for(;typeof(r=this.refs[e])==\"string\";)e=r;return r||this.schemas[e]||Ct.call(this,t,e)}function Ct(t,e){let r=this.opts.uriResolver.parse(e),s=(0,te._getFullPath)(this.opts.uriResolver,r),n=(0,te.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&s===n)return xr.call(this,r,t);let o=(0,te.normalizeId)(s),i=this.refs[o]||this.schemas[o];if(typeof i==\"string\"){let a=Ct.call(this,t,i);return typeof a?.schema!=\"object\"?void 0:xr.call(this,r,a)}if(typeof i?.schema==\"object\"){if(i.validate||Fr.call(this,i),o===(0,te.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,l=a[c];return l&&(n=(0,te.resolveUrl)(this.opts.uriResolver,n,l)),new De({schema:a,schemaId:c,root:t,baseId:n})}return xr.call(this,r,i)}}X.resolveSchema=Ct;var Mc=new Set([\"properties\",\"patternProperties\",\"enum\",\"dependencies\",\"definitions\"]);function xr(t,{baseId:e,schema:r,root:s}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!==\"/\")return;for(let a of t.fragment.slice(1).split(\"/\")){if(typeof r==\"boolean\")return;let c=r[(0,xn.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r==\"object\"&&r[this.opts.schemaId];!Mc.has(a)&&l&&(e=(0,te.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!=\"boolean\"&&r.$ref&&!(0,xn.schemaHasRulesButRef)(r,this.RULES)){let a=(0,te.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=Ct.call(this,s,a)}let{schemaId:i}=this.opts;if(o=o||new De({schema:r,schemaId:i,root:s,baseId:e}),o.schema!==o.root.schema)return o}});var Ln=g((If,Ac)=>{Ac.exports={$id:\"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",description:\"Meta-schema for $data reference (JSON AnySchema extension proposal)\",type:\"object\",required:[\"$data\"],properties:{$data:{type:\"string\",anyOf:[{format:\"relative-json-pointer\"},{format:\"json-pointer\"}]}},additionalProperties:!1}});var Gr=g((Tf,Qn)=>{\"use strict\";var Dc=RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu),Gn=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u),Lr=RegExp.prototype.test.bind(/^[\\da-f]{2}$/iu),Jn=RegExp.prototype.test.bind(/^[\\da-z\\-._~]$/iu),Vc=RegExp.prototype.test.bind(/^[\\da-z\\-._~!$&'()*+,;=:@/]$/iu);function Hr(t){let e=\"\",r=0,s=0;for(s=0;s=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return\"\";e+=t[s];break}for(s+=1;s=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return\"\";e+=t[s]}return e}var zc=RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u);function Hn(t){return t.length=0,!0}function Uc(t,e,r){if(t.length){let s=Hr(t);if(s!==\"\")e.push(s);else return r.error=!0,!1;t.length=0}return!0}function Kc(t){let e=0,r={error:!1,address:\"\",zone:\"\"},s=[],n=[],o=!1,i=!1,a=Uc;for(let c=0;c7){r.error=!0;break}c>0&&t[c-1]===\":\"&&(o=!0),s.push(\":\");continue}else if(l===\"%\"){if(!a(n,s,r))break;a=Hn}else{n.push(l);continue}}return n.length&&(a===Hn?r.zone=n.join(\"\"):i?s.push(n.join(\"\")):s.push(Hr(n))),r.address=s.join(\"\"),r}function Wn(t){if(xc(t,\":\")<2)return{host:t,isIPV6:!1};let e=Kc(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,s=e.address;return e.zone&&(r+=\"%\"+e.zone,s+=\"%25\"+e.zone),{host:r,isIPV6:!0,escapedHost:s}}}function xc(t,e){let r=0;for(let s=0;sLc[s])}function Jc(t,e=!1){if(t.indexOf(\"%\")===-1)return t;let r=\"\";for(let s=0;s{\"use strict\";var{isUUID:Xc}=Gr(),Yc=/([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)/iu,Zc=[\"http\",\"https\",\"ws\",\"wss\",\"urn\",\"urn:uuid\"];function eu(t){return Zc.indexOf(t)!==-1}function Jr(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]===\"w\"||t.scheme[0]===\"W\")&&(t.scheme[1]===\"s\"||t.scheme[1]===\"S\")&&(t.scheme[2]===\"s\"||t.scheme[2]===\"S\"):!1}function Xn(t){return t.host||(t.error=t.error||\"HTTP URIs must have a host.\"),t}function Yn(t){let e=String(t.scheme).toLowerCase()===\"https\";return(t.port===(e?443:80)||t.port===\"\")&&(t.port=void 0),t.path||(t.path=\"/\"),t}function tu(t){return t.secure=Jr(t),t.resourceName=(t.path||\"/\")+(t.query?\"?\"+t.query:\"\"),t.path=void 0,t.query=void 0,t}function ru(t){if((t.port===(Jr(t)?443:80)||t.port===\"\")&&(t.port=void 0),typeof t.secure==\"boolean\"&&(t.scheme=t.secure?\"wss\":\"ws\",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split(\"?\");t.path=e&&e!==\"/\"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function su(t,e){if(!t.path)return t.error=\"URN can not be parsed\",t;let r=t.path.match(Yc);if(r){let s=e.scheme||t.scheme||\"urn\";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${s}:${e.nid||t.nid}`,o=Wr(n);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||\"URN can not be parsed.\";return t}function nu(t,e){if(t.nid===void 0)throw new Error(\"URN without nid cannot be serialized\");let r=e.scheme||t.scheme||\"urn\",s=t.nid.toLowerCase(),n=`${r}:${e.nid||s}`,o=Wr(n);o&&(t=o.serialize(t,e));let i=t,a=t.nss;return i.path=`${s||e.nid}:${a}`,e.skipEscape=!0,i}function ou(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Xc(r.uuid))&&(r.error=r.error||\"UUID is not valid.\"),r}function iu(t){let e=t;return e.nss=(t.uuid||\"\").toLowerCase(),e}var Zn={scheme:\"http\",domainHost:!0,parse:Xn,serialize:Yn},au={scheme:\"https\",domainHost:Zn.domainHost,parse:Xn,serialize:Yn},At={scheme:\"ws\",domainHost:!0,parse:tu,serialize:ru},cu={scheme:\"wss\",domainHost:At.domainHost,parse:At.parse,serialize:At.serialize},uu={scheme:\"urn\",parse:su,serialize:nu,skipNormalize:!0},lu={scheme:\"urn:uuid\",parse:ou,serialize:iu,skipNormalize:!0},Dt={http:Zn,https:au,ws:At,wss:cu,urn:uu,\"urn:uuid\":lu};Object.setPrototypeOf(Dt,null);function Wr(t){return t&&(Dt[t]||Dt[t.toLowerCase()])||void 0}eo.exports={wsIsSecure:Jr,SCHEMES:Dt,isValidSchemeName:eu,getSchemeHandler:Wr}});var ao=g((Mf,Vt)=>{\"use strict\";var{normalizeIPv6:du,removeDotSegments:ct,recomposeAuthority:fu,normalizePercentEncoding:hu,normalizePathEncoding:pu,escapePreservingEscapes:mu,reescapeHostDelimiters:yu,isIPv4:_u,nonSimpleDomain:gu}=Gr(),{SCHEMES:$u,getSchemeHandler:so}=to();function vu(t,e){return typeof t==\"string\"?t=Pu(t,e):typeof t==\"object\"&&(t=Ve(Ne(t,e),e)),t}function wu(t,e,r){let s=r?Object.assign({scheme:\"null\"},r):{scheme:\"null\"},n=no(Ve(t,s),Ve(e,s),s,!0);return s.skipEscape=!0,Ne(n,s)}function no(t,e,r,s){let n={};return s||(t=Ve(Ne(t,r),r),e=Ve(Ne(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=ct(e.path||\"\"),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=ct(e.path||\"\"),n.query=e.query):(e.path?(e.path[0]===\"/\"?n.path=ct(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path=\"/\"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf(\"/\")+1)+e.path:n.path=e.path,n.path=ct(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function bu(t,e,r){let s=ro(t,r),n=ro(e,r);return s!==void 0&&n!==void 0&&s.toLowerCase()===n.toLowerCase()}function Ne(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:\"\"},s=Object.assign({},e),n=[],o=so(s.scheme||r.scheme);o&&o.serialize&&o.serialize(r,s),r.path!==void 0&&(s.skipEscape?r.path=hu(r.path):(r.path=mu(r.path),r.scheme!==void 0&&(r.path=r.path.split(\"%3A\").join(\":\")))),s.reference!==\"suffix\"&&r.scheme&&n.push(r.scheme,\":\");let i=fu(r);if(i!==void 0&&(s.reference!==\"suffix\"&&n.push(\"//\"),n.push(i),r.path&&r.path[0]!==\"/\"&&n.push(\"/\")),r.path!==void 0){let a=r.path;!s.absolutePath&&(!o||!o.absolutePath)&&(a=ct(a)),i===void 0&&a[0]===\"/\"&&a[1]===\"/\"&&(a=\"/%2F\"+a.slice(2)),n.push(a)}return r.query!==void 0&&n.push(\"?\",r.query),r.fragment!==void 0&&n.push(\"#\",r.fragment),n.join(\"\")}var Eu=/^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u;function Su(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!==\"/\")return'URI path must start with \"/\" when authority is present.';if(typeof t.port==\"number\"&&(t.port<0||t.port>65535))return\"URI port is malformed.\"}function oo(t,e){let r=Object.assign({},e),s={scheme:void 0,userinfo:void 0,host:\"\",port:void 0,path:\"\",query:void 0,fragment:void 0},n=!1,o=!1;r.reference===\"suffix\"&&(r.scheme?t=r.scheme+\":\"+t:t=\"//\"+t);let i=t.match(Eu);if(i){s.scheme=i[1],s.userinfo=i[3],s.host=i[4],s.port=parseInt(i[5],10),s.path=i[6]||\"\",s.query=i[7],s.fragment=i[8],isNaN(s.port)&&(s.port=i[5]);let a=Su(s,i);if(a!==void 0&&(s.error=s.error||a,n=!0),s.host)if(_u(s.host)===!1){let u=du(s.host);s.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;s.scheme===void 0&&s.userinfo===void 0&&s.host===void 0&&s.port===void 0&&s.query===void 0&&!s.path?s.reference=\"same-document\":s.scheme===void 0?s.reference=\"relative\":s.fragment===void 0?s.reference=\"absolute\":s.reference=\"uri\",r.reference&&r.reference!==\"suffix\"&&r.reference!==s.reference&&(s.error=s.error||\"URI is not a \"+r.reference+\" reference.\");let c=so(r.scheme||s.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&s.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&gu(s.host))try{s.host=new URL(\"http://\"+s.host).hostname}catch(l){s.error=s.error||\"Host's domain name can not be converted to ASCII: \"+l}if((!c||c&&!c.skipNormalize)&&(t.indexOf(\"%\")!==-1&&(s.scheme!==void 0&&(s.scheme=unescape(s.scheme)),s.host!==void 0&&(s.host=yu(unescape(s.host),o))),s.path&&(s.path=pu(s.path)),s.fragment))try{s.fragment=encodeURI(decodeURIComponent(s.fragment))}catch{s.error=s.error||\"URI malformed\"}c&&c.parse&&c.parse(s,r)}else s.error=s.error||\"URI can not be parsed.\";return{parsed:s,malformedAuthorityOrPort:n}}function Ve(t,e){return oo(t,e).parsed}function Pu(t,e){return io(t,e).normalized}function io(t,e){let{parsed:r,malformedAuthorityOrPort:s}=oo(t,e);return{normalized:s?t:Ne(r,e),malformedAuthorityOrPort:s}}function ro(t,e){if(typeof t==\"string\"){let{normalized:r,malformedAuthorityOrPort:s}=io(t,e);return s?void 0:r}if(typeof t==\"object\")return Ne(t,e)}var Br={SCHEMES:$u,normalize:vu,resolve:wu,resolveComponent:no,equal:bu,serialize:Ne,parse:Ve};Vt.exports=Br;Vt.exports.default=Br;Vt.exports.fastUri=Br});var uo=g(Qr=>{\"use strict\";Object.defineProperty(Qr,\"__esModule\",{value:!0});var co=ao();co.code='require(\"ajv/dist/runtime/uri\").default';Qr.default=co});var go=g(V=>{\"use strict\";Object.defineProperty(V,\"__esModule\",{value:!0});V.CodeGen=V.Name=V.nil=V.stringify=V.str=V._=V.KeywordCxt=void 0;var Nu=it();Object.defineProperty(V,\"KeywordCxt\",{enumerable:!0,get:function(){return Nu.KeywordCxt}});var ze=S();Object.defineProperty(V,\"_\",{enumerable:!0,get:function(){return ze._}});Object.defineProperty(V,\"str\",{enumerable:!0,get:function(){return ze.str}});Object.defineProperty(V,\"stringify\",{enumerable:!0,get:function(){return ze.stringify}});Object.defineProperty(V,\"nil\",{enumerable:!0,get:function(){return ze.nil}});Object.defineProperty(V,\"Name\",{enumerable:!0,get:function(){return ze.Name}});Object.defineProperty(V,\"CodeGen\",{enumerable:!0,get:function(){return ze.CodeGen}});var ku=Tt(),mo=at(),qu=Sr(),ut=Mt(),Ou=S(),lt=st(),zt=rt(),Yr=O(),lo=Ln(),ju=uo(),yo=(t,e)=>new RegExp(t,e);yo.code=\"new RegExp\";var Ru=[\"removeAdditional\",\"useDefaults\",\"coerceTypes\"],Iu=new Set([\"validate\",\"serialize\",\"parse\",\"wrapper\",\"root\",\"schema\",\"keyword\",\"pattern\",\"formats\",\"validate$data\",\"func\",\"obj\",\"Error\"]),Tu={errorDataPath:\"\",format:\"`validateFormats: false` can be used instead.\",nullable:'\"nullable\" keyword is supported by default.',jsonPointers:\"Deprecated jsPropertySyntax can be used instead.\",extendRefs:\"Deprecated ignoreKeywordsWithRef can be used instead.\",missingRefs:\"Pass empty schema with $id that should be ignored to ajv.addSchema.\",processCode:\"Use option `code: {process: (code, schemaEnv: object) => string}`\",sourceCode:\"Use option `code: {source: true}`\",strictDefaults:\"It is default now, see option `strict`.\",strictKeywords:\"It is default now, see option `strict`.\",uniqueItems:'\"uniqueItems\" keyword is always validated.',unknownFormats:\"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).\",cache:\"Map is used as cache, schema object as key.\",serialize:\"Map is used as cache, schema object as key.\",ajvErrors:\"It is default now.\"},Cu={ignoreKeywordsWithRef:\"\",jsPropertySyntax:\"\",unicode:'\"minLength\"/\"maxLength\" account for unicode characters by default.'},fo=200;function Mu(t){var e,r,s,n,o,i,a,c,l,u,d,y,m,h,f,p,_,q,N,C,w,se,ae,er,tr;let Ge=t.strict,rr=(e=t.code)===null||e===void 0?void 0:e.optimize,Fs=rr===!0||rr===void 0?1:rr||0,Ls=(s=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&s!==void 0?s:yo,Si=(n=t.uriResolver)!==null&&n!==void 0?n:ju.default;return{strictSchema:(i=(o=t.strictSchema)!==null&&o!==void 0?o:Ge)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Ge)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:Ge)!==null&&u!==void 0?u:\"log\",strictTuples:(y=(d=t.strictTuples)!==null&&d!==void 0?d:Ge)!==null&&y!==void 0?y:\"log\",strictRequired:(h=(m=t.strictRequired)!==null&&m!==void 0?m:Ge)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:Fs,regExp:Ls}:{optimize:Fs,regExp:Ls},loopRequired:(f=t.loopRequired)!==null&&f!==void 0?f:fo,loopEnum:(p=t.loopEnum)!==null&&p!==void 0?p:fo,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(q=t.messages)!==null&&q!==void 0?q:!0,inlineRefs:(N=t.inlineRefs)!==null&&N!==void 0?N:!0,schemaId:(C=t.schemaId)!==null&&C!==void 0?C:\"$id\",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(se=t.validateSchema)!==null&&se!==void 0?se:!0,validateFormats:(ae=t.validateFormats)!==null&&ae!==void 0?ae:!0,unicodeRegExp:(er=t.unicodeRegExp)!==null&&er!==void 0?er:!0,int32range:(tr=t.int32range)!==null&&tr!==void 0?tr:!0,uriResolver:Si}}var dt=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Mu(e)};let{es5:r,lines:s}=this.opts.code;this.scope=new Ou.ValueScope({scope:{},prefixes:Iu,es5:r,lines:s}),this.logger=Ku(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,qu.getRules)(),ho.call(this,Tu,e,\"NOT SUPPORTED\"),ho.call(this,Cu,e,\"DEPRECATED\",\"warn\"),this._metaOpts=zu.call(this),e.formats&&Du.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Vu.call(this,e.keywords),typeof e.meta==\"object\"&&this.addMetaSchema(e.meta),Au.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword(\"$async\")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:s}=this.opts,n=lo;s===\"id\"&&(n={...lo},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[s],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e==\"object\"?e[r]||e:void 0}validate(e,r){let s;if(typeof e==\"string\"){if(s=this.getSchema(e),!s)throw new Error(`no schema with key or ref \"${e}\"`)}else s=this.compile(e);let n=s(r);return\"$async\"in s||(this.errors=s.errors),n}compile(e,r){let s=this._addSchema(e,r);return s.validate||this._compileSchemaEnv(s)}compileAsync(e,r){if(typeof this.opts.loadSchema!=\"function\")throw new Error(\"options.loadSchema should be a function\");let{loadSchema:s}=this.opts;return n.call(this,e,r);async function n(u,d){await o.call(this,u.$schema);let y=this._addSchema(u,d);return y.validate||i.call(this,y)}async function o(u){u&&!this.getSchema(u)&&await n.call(this,{$ref:u},!0)}async function i(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof mo.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),i.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=s(u))}finally{delete this._loading[u]}}}addSchema(e,r,s,n=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,s,n);return this}let o;if(typeof e==\"object\"){let{schemaId:i}=this.opts;if(o=e[i],o!==void 0&&typeof o!=\"string\")throw new Error(`schema ${i} must be string`)}return r=(0,lt.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,s,r,n,!0),this}addMetaSchema(e,r,s=this.opts.validateSchema){return this.addSchema(e,r,!0,s),this}validateSchema(e,r){if(typeof e==\"boolean\")return!0;let s;if(s=e.$schema,s!==void 0&&typeof s!=\"string\")throw new Error(\"$schema must be a string\");if(s=s||this.opts.defaultMeta||this.defaultMeta(),!s)return this.logger.warn(\"meta-schema not available\"),this.errors=null,!0;let n=this.validate(s,e);if(!n&&r){let o=\"schema is invalid: \"+this.errorsText();if(this.opts.validateSchema===\"log\")this.logger.error(o);else throw new Error(o)}return n}getSchema(e){let r;for(;typeof(r=po.call(this,e))==\"string\";)e=r;if(r===void 0){let{schemaId:s}=this.opts,n=new ut.SchemaEnv({schema:{},schemaId:s});if(r=ut.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case\"undefined\":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case\"string\":{let r=po.call(this,e);return typeof r==\"object\"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case\"object\":{let r=e;this._cache.delete(r);let s=e[this.opts.schemaId];return s&&(s=(0,lt.normalizeId)(s),delete this.schemas[s],delete this.refs[s]),this}default:throw new Error(\"ajv.removeSchema: invalid parameter\")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let s;if(typeof e==\"string\")s=e,typeof r==\"object\"&&(this.logger.warn(\"these parameters are deprecated, see docs for addKeyword\"),r.keyword=s);else if(typeof e==\"object\"&&r===void 0){if(r=e,s=r.keyword,Array.isArray(s)&&!s.length)throw new Error(\"addKeywords: keyword must be string or non-empty array\")}else throw new Error(\"invalid addKeywords parameters\");if(Fu.call(this,s,r),!r)return(0,Yr.eachItem)(s,o=>Xr.call(this,o)),this;Hu.call(this,r);let n={...r,type:(0,zt.getJSONTypes)(r.type),schemaType:(0,zt.getJSONTypes)(r.schemaType)};return(0,Yr.eachItem)(s,n.type.length===0?o=>Xr.call(this,o,n):o=>n.type.forEach(i=>Xr.call(this,o,n,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r==\"object\"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let s of r.rules){let n=s.rules.findIndex(o=>o.keyword===e);n>=0&&s.rules.splice(n,1)}return this}addFormat(e,r){return typeof r==\"string\"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=\", \",dataVar:s=\"data\"}={}){return!e||e.length===0?\"No errors\":e.map(n=>`${s}${n.instancePath} ${n.message}`).reduce((n,o)=>n+r+o)}$dataMetaSchema(e,r){let s=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let o=n.split(\"/\").slice(1),i=e;for(let a of o)i=i[a];for(let a in s){let c=s[a];if(typeof c!=\"object\")continue;let{$data:l}=c.definition,u=i[a];l&&u&&(i[a]=_o(u))}}return e}_removeAllSchemas(e,r){for(let s in e){let n=e[s];(!r||r.test(s))&&(typeof n==\"string\"?delete e[s]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[s]))}}_addSchema(e,r,s,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e==\"object\")i=e[a];else{if(this.opts.jtd)throw new Error(\"schema must be object\");if(typeof e!=\"boolean\")throw new Error(\"schema must be object or boolean\")}let c=this._cache.get(e);if(c!==void 0)return c;s=(0,lt.normalizeId)(i||s);let l=lt.getSchemaRefs.call(this,e,s);return c=new ut.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:s,localRefs:l}),this._cache.set(c.schema,c),o&&!s.startsWith(\"#\")&&(s&&this._checkUnique(s),this.refs[s]=c),n&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id \"${e}\" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):ut.compileSchema.call(this,e),!e.validate)throw new Error(\"ajv implementation error\");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{ut.compileSchema.call(this,e)}finally{this.opts=r}}};dt.ValidationError=ku.default;dt.MissingRefError=mo.default;V.default=dt;function ho(t,e,r,s=\"error\"){for(let n in t){let o=n;o in e&&this.logger[s](`${r}: option ${n}. ${t[o]}`)}}function po(t){return t=(0,lt.normalizeId)(t),this.schemas[t]||this.refs[t]}function Au(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Du(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Vu(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn(\"keywords option as map is deprecated, pass array\");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function zu(){let t={...this.opts};for(let e of Ru)delete t[e];return t}var Uu={log(){},warn(){},error(){}};function Ku(t){if(t===!1)return Uu;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error(\"logger must implement log, warn and error methods\")}var xu=/^[a-z_$][a-z0-9_$:-]*$/i;function Fu(t,e){let{RULES:r}=this;if((0,Yr.eachItem)(t,s=>{if(r.keywords[s])throw new Error(`Keyword ${s} is already defined`);if(!xu.test(s))throw new Error(`Keyword ${s} has invalid name`)}),!!e&&e.$data&&!(\"code\"in e||\"validate\"in e))throw new Error('$data keyword must have \"code\" or \"validate\" function')}function Xr(t,e,r){var s;let n=e?.post;if(r&&n)throw new Error('keyword with \"post\" flag cannot have \"type\"');let{RULES:o}=this,i=n?o.post:o.rules.find(({type:c})=>c===r);if(i||(i={type:r,rules:[]},o.rules.push(i)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,zt.getJSONTypes)(e.type),schemaType:(0,zt.getJSONTypes)(e.schemaType)}};e.before?Lu.call(this,i,a,e.before):i.rules.push(a),o.all[t]=a,(s=e.implements)===null||s===void 0||s.forEach(c=>this.addKeyword(c))}function Lu(t,e,r){let s=t.rules.findIndex(n=>n.keyword===r);s>=0?t.rules.splice(s,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Hu(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=_o(e)),t.validateSchema=this.compile(e,!0))}var Gu={$ref:\"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\"};function _o(t){return{anyOf:[t,Gu]}}});var $o=g(Zr=>{\"use strict\";Object.defineProperty(Zr,\"__esModule\",{value:!0});var Ju={keyword:\"id\",code(){throw new Error('NOT SUPPORTED: keyword \"id\", use \"$id\" for schema ID')}};Zr.default=Ju});var Eo=g(ke=>{\"use strict\";Object.defineProperty(ke,\"__esModule\",{value:!0});ke.callRef=ke.getValidate=void 0;var Wu=at(),vo=Q(),W=S(),Ue=le(),wo=Mt(),Ut=O(),Bu={keyword:\"$ref\",schemaType:\"string\",code(t){let{gen:e,schema:r,it:s}=t,{baseId:n,schemaEnv:o,validateName:i,opts:a,self:c}=s,{root:l}=o;if((r===\"#\"||r===\"#/\")&&n===l.baseId)return d();let u=wo.resolveRef.call(c,l,n,r);if(u===void 0)throw new Wu.default(s.opts.uriResolver,n,r);if(u instanceof wo.SchemaEnv)return y(u);return m(u);function d(){if(o===l)return Kt(t,i,o,o.$async);let h=e.scopeValue(\"root\",{ref:l});return Kt(t,(0,W._)`${h}.validate`,l,l.$async)}function y(h){let f=bo(t,h);Kt(t,f,h,h.$async)}function m(h){let f=e.scopeValue(\"schema\",a.code.source===!0?{ref:h,code:(0,W.stringify)(h)}:{ref:h}),p=e.name(\"valid\"),_=t.subschema({schema:h,dataTypes:[],schemaPath:W.nil,topSchemaRef:f,errSchemaPath:r},p);t.mergeEvaluated(_),t.ok(p)}}};function bo(t,e){let{gen:r}=t;return e.validate?r.scopeValue(\"validate\",{ref:e.validate}):(0,W._)`${r.scopeValue(\"wrapper\",{ref:e})}.validate`}ke.getValidate=bo;function Kt(t,e,r,s){let{gen:n,it:o}=t,{allErrors:i,schemaEnv:a,opts:c}=o,l=c.passContext?Ue.default.this:W.nil;s?u():d();function u(){if(!a.$async)throw new Error(\"async schema referenced by sync schema\");let h=n.let(\"valid\");n.try(()=>{n.code((0,W._)`await ${(0,vo.callValidateCode)(t,e,l)}`),m(e),i||n.assign(h,!0)},f=>{n.if((0,W._)`!(${f} instanceof ${o.ValidationError})`,()=>n.throw(f)),y(f),i||n.assign(h,!1)}),t.ok(h)}function d(){t.result((0,vo.callValidateCode)(t,e,l),()=>m(e),()=>y(e))}function y(h){let f=(0,W._)`${h}.errors`;n.assign(Ue.default.vErrors,(0,W._)`${Ue.default.vErrors} === null ? ${f} : ${Ue.default.vErrors}.concat(${f})`),n.assign(Ue.default.errors,(0,W._)`${Ue.default.vErrors}.length`)}function m(h){var f;if(!o.opts.unevaluated)return;let p=(f=r?.validate)===null||f===void 0?void 0:f.evaluated;if(o.props!==!0)if(p&&!p.dynamicProps)p.props!==void 0&&(o.props=Ut.mergeEvaluated.props(n,p.props,o.props));else{let _=n.var(\"props\",(0,W._)`${h}.evaluated.props`);o.props=Ut.mergeEvaluated.props(n,_,o.props,W.Name)}if(o.items!==!0)if(p&&!p.dynamicItems)p.items!==void 0&&(o.items=Ut.mergeEvaluated.items(n,p.items,o.items));else{let _=n.var(\"items\",(0,W._)`${h}.evaluated.items`);o.items=Ut.mergeEvaluated.items(n,_,o.items,W.Name)}}}ke.callRef=Kt;ke.default=Bu});var So=g(es=>{\"use strict\";Object.defineProperty(es,\"__esModule\",{value:!0});var Qu=$o(),Xu=Eo(),Yu=[\"$schema\",\"$id\",\"$defs\",\"$vocabulary\",{keyword:\"$comment\"},\"definitions\",Qu.default,Xu.default];es.default=Yu});var Po=g(ts=>{\"use strict\";Object.defineProperty(ts,\"__esModule\",{value:!0});var xt=S(),ge=xt.operators,Ft={maximum:{okStr:\"<=\",ok:ge.LTE,fail:ge.GT},minimum:{okStr:\">=\",ok:ge.GTE,fail:ge.LT},exclusiveMaximum:{okStr:\"<\",ok:ge.LT,fail:ge.GTE},exclusiveMinimum:{okStr:\">\",ok:ge.GT,fail:ge.LTE}},Zu={message:({keyword:t,schemaCode:e})=>(0,xt.str)`must be ${Ft[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,xt._)`{comparison: ${Ft[t].okStr}, limit: ${e}}`},el={keyword:Object.keys(Ft),type:\"number\",schemaType:\"number\",$data:!0,error:Zu,code(t){let{keyword:e,data:r,schemaCode:s}=t;t.fail$data((0,xt._)`${r} ${Ft[e].fail} ${s} || isNaN(${r})`)}};ts.default=el});var No=g(rs=>{\"use strict\";Object.defineProperty(rs,\"__esModule\",{value:!0});var ft=S(),tl={message:({schemaCode:t})=>(0,ft.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ft._)`{multipleOf: ${t}}`},rl={keyword:\"multipleOf\",type:\"number\",schemaType:\"number\",$data:!0,error:tl,code(t){let{gen:e,data:r,schemaCode:s,it:n}=t,o=n.opts.multipleOfPrecision,i=e.let(\"res\"),a=o?(0,ft._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:(0,ft._)`${i} !== parseInt(${i})`;t.fail$data((0,ft._)`(${s} === 0 || (${i} = ${r}/${s}, ${a}))`)}};rs.default=rl});var qo=g(ss=>{\"use strict\";Object.defineProperty(ss,\"__esModule\",{value:!0});function ko(t){let e=t.length,r=0,s=0,n;for(;s=55296&&n<=56319&&s{\"use strict\";Object.defineProperty(ns,\"__esModule\",{value:!0});var qe=S(),sl=O(),nl=qo(),ol={message({keyword:t,schemaCode:e}){let r=t===\"maxLength\"?\"more\":\"fewer\";return(0,qe.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,qe._)`{limit: ${t}}`},il={keyword:[\"maxLength\",\"minLength\"],type:\"string\",schemaType:\"number\",$data:!0,error:ol,code(t){let{keyword:e,data:r,schemaCode:s,it:n}=t,o=e===\"maxLength\"?qe.operators.GT:qe.operators.LT,i=n.opts.unicode===!1?(0,qe._)`${r}.length`:(0,qe._)`${(0,sl.useFunc)(t.gen,nl.default)}(${r})`;t.fail$data((0,qe._)`${i} ${o} ${s}`)}};ns.default=il});var jo=g(os=>{\"use strict\";Object.defineProperty(os,\"__esModule\",{value:!0});var al=Q(),cl=O(),Ke=S(),ul={message:({schemaCode:t})=>(0,Ke.str)`must match pattern \"${t}\"`,params:({schemaCode:t})=>(0,Ke._)`{pattern: ${t}}`},ll={keyword:\"pattern\",type:\"string\",schemaType:\"string\",$data:!0,error:ul,code(t){let{gen:e,data:r,$data:s,schema:n,schemaCode:o,it:i}=t,a=i.opts.unicodeRegExp?\"u\":\"\";if(s){let{regExp:c}=i.opts.code,l=c.code===\"new RegExp\"?(0,Ke._)`new RegExp`:(0,cl.useFunc)(e,c),u=e.let(\"valid\");e.try(()=>e.assign(u,(0,Ke._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Ke._)`!${u}`)}else{let c=(0,al.usePattern)(t,n);t.fail$data((0,Ke._)`!${c}.test(${r})`)}}};os.default=ll});var Ro=g(is=>{\"use strict\";Object.defineProperty(is,\"__esModule\",{value:!0});var ht=S(),dl={message({keyword:t,schemaCode:e}){let r=t===\"maxProperties\"?\"more\":\"fewer\";return(0,ht.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,ht._)`{limit: ${t}}`},fl={keyword:[\"maxProperties\",\"minProperties\"],type:\"object\",schemaType:\"number\",$data:!0,error:dl,code(t){let{keyword:e,data:r,schemaCode:s}=t,n=e===\"maxProperties\"?ht.operators.GT:ht.operators.LT;t.fail$data((0,ht._)`Object.keys(${r}).length ${n} ${s}`)}};is.default=fl});var Io=g(as=>{\"use strict\";Object.defineProperty(as,\"__esModule\",{value:!0});var pt=Q(),mt=S(),hl=O(),pl={message:({params:{missingProperty:t}})=>(0,mt.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,mt._)`{missingProperty: ${t}}`},ml={keyword:\"required\",type:\"object\",schemaType:\"array\",$data:!0,error:pl,code(t){let{gen:e,schema:r,schemaCode:s,data:n,$data:o,it:i}=t,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors?l():u(),a.strictRequired){let m=t.parentSchema.properties,{definedProperties:h}=t.it;for(let f of r)if(m?.[f]===void 0&&!h.has(f)){let p=i.schemaEnv.baseId+i.errSchemaPath,_=`required property \"${f}\" is not defined at \"${p}\" (strictRequired)`;(0,hl.checkStrictMode)(i,_,i.opts.strictRequired)}}function l(){if(c||o)t.block$data(mt.nil,d);else for(let m of r)(0,pt.checkReportMissingProp)(t,m)}function u(){let m=e.let(\"missing\");if(c||o){let h=e.let(\"valid\",!0);t.block$data(h,()=>y(m,h)),t.ok(h)}else e.if((0,pt.checkMissingProp)(t,r,m)),(0,pt.reportMissingProp)(t,m),e.else()}function d(){e.forOf(\"prop\",s,m=>{t.setParams({missingProperty:m}),e.if((0,pt.noPropertyInData)(e,n,m,a.ownProperties),()=>t.error())})}function y(m,h){t.setParams({missingProperty:m}),e.forOf(m,s,()=>{e.assign(h,(0,pt.propertyInData)(e,n,m,a.ownProperties)),e.if((0,mt.not)(h),()=>{t.error(),e.break()})},mt.nil)}}};as.default=ml});var To=g(cs=>{\"use strict\";Object.defineProperty(cs,\"__esModule\",{value:!0});var yt=S(),yl={message({keyword:t,schemaCode:e}){let r=t===\"maxItems\"?\"more\":\"fewer\";return(0,yt.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,yt._)`{limit: ${t}}`},_l={keyword:[\"maxItems\",\"minItems\"],type:\"array\",schemaType:\"number\",$data:!0,error:yl,code(t){let{keyword:e,data:r,schemaCode:s}=t,n=e===\"maxItems\"?yt.operators.GT:yt.operators.LT;t.fail$data((0,yt._)`${r}.length ${n} ${s}`)}};cs.default=_l});var Lt=g(us=>{\"use strict\";Object.defineProperty(us,\"__esModule\",{value:!0});var Co=Ir();Co.code='require(\"ajv/dist/runtime/equal\").default';us.default=Co});var Mo=g(ds=>{\"use strict\";Object.defineProperty(ds,\"__esModule\",{value:!0});var ls=rt(),z=S(),gl=O(),$l=Lt(),vl={message:({params:{i:t,j:e}})=>(0,z.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,z._)`{i: ${t}, j: ${e}}`},wl={keyword:\"uniqueItems\",type:\"array\",schemaType:\"boolean\",$data:!0,error:vl,code(t){let{gen:e,data:r,$data:s,schema:n,parentSchema:o,schemaCode:i,it:a}=t;if(!s&&!n)return;let c=e.let(\"valid\"),l=o.items?(0,ls.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,z._)`${i} === false`),t.ok(c);function u(){let h=e.let(\"i\",(0,z._)`${r}.length`),f=e.let(\"j\");t.setParams({i:h,j:f}),e.assign(c,!0),e.if((0,z._)`${h} > 1`,()=>(d()?y:m)(h,f))}function d(){return l.length>0&&!l.some(h=>h===\"object\"||h===\"array\")}function y(h,f){let p=e.name(\"item\"),_=(0,ls.checkDataTypes)(l,p,a.opts.strictNumbers,ls.DataType.Wrong),q=e.const(\"indices\",(0,z._)`{}`);e.for((0,z._)`;${h}--;`,()=>{e.let(p,(0,z._)`${r}[${h}]`),e.if(_,(0,z._)`continue`),l.length>1&&e.if((0,z._)`typeof ${p} == \"string\"`,(0,z._)`${p} += \"_\"`),e.if((0,z._)`typeof ${q}[${p}] == \"number\"`,()=>{e.assign(f,(0,z._)`${q}[${p}]`),t.error(),e.assign(c,!1).break()}).code((0,z._)`${q}[${p}] = ${h}`)})}function m(h,f){let p=(0,gl.useFunc)(e,$l.default),_=e.name(\"outer\");e.label(_).for((0,z._)`;${h}--;`,()=>e.for((0,z._)`${f} = ${h}; ${f}--;`,()=>e.if((0,z._)`${p}(${r}[${h}], ${r}[${f}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};ds.default=wl});var Ao=g(hs=>{\"use strict\";Object.defineProperty(hs,\"__esModule\",{value:!0});var fs=S(),bl=O(),El=Lt(),Sl={message:\"must be equal to constant\",params:({schemaCode:t})=>(0,fs._)`{allowedValue: ${t}}`},Pl={keyword:\"const\",$data:!0,error:Sl,code(t){let{gen:e,data:r,$data:s,schemaCode:n,schema:o}=t;s||o&&typeof o==\"object\"?t.fail$data((0,fs._)`!${(0,bl.useFunc)(e,El.default)}(${r}, ${n})`):t.fail((0,fs._)`${o} !== ${r}`)}};hs.default=Pl});var Do=g(ps=>{\"use strict\";Object.defineProperty(ps,\"__esModule\",{value:!0});var _t=S(),Nl=O(),kl=Lt(),ql={message:\"must be equal to one of the allowed values\",params:({schemaCode:t})=>(0,_t._)`{allowedValues: ${t}}`},Ol={keyword:\"enum\",schemaType:\"array\",$data:!0,error:ql,code(t){let{gen:e,data:r,$data:s,schema:n,schemaCode:o,it:i}=t;if(!s&&n.length===0)throw new Error(\"enum must have non-empty array\");let a=n.length>=i.opts.loopEnum,c,l=()=>c??(c=(0,Nl.useFunc)(e,kl.default)),u;if(a||s)u=e.let(\"valid\"),t.block$data(u,d);else{if(!Array.isArray(n))throw new Error(\"ajv implementation error\");let m=e.const(\"vSchema\",o);u=(0,_t.or)(...n.map((h,f)=>y(m,f)))}t.pass(u);function d(){e.assign(u,!1),e.forOf(\"v\",o,m=>e.if((0,_t._)`${l()}(${r}, ${m})`,()=>e.assign(u,!0).break()))}function y(m,h){let f=n[h];return typeof f==\"object\"&&f!==null?(0,_t._)`${l()}(${r}, ${m}[${h}])`:(0,_t._)`${r} === ${f}`}}};ps.default=Ol});var Vo=g(ms=>{\"use strict\";Object.defineProperty(ms,\"__esModule\",{value:!0});var jl=Po(),Rl=No(),Il=Oo(),Tl=jo(),Cl=Ro(),Ml=Io(),Al=To(),Dl=Mo(),Vl=Ao(),zl=Do(),Ul=[jl.default,Rl.default,Il.default,Tl.default,Cl.default,Ml.default,Al.default,Dl.default,{keyword:\"type\",schemaType:[\"string\",\"array\"]},{keyword:\"nullable\",schemaType:\"boolean\"},Vl.default,zl.default];ms.default=Ul});var _s=g(gt=>{\"use strict\";Object.defineProperty(gt,\"__esModule\",{value:!0});gt.validateAdditionalItems=void 0;var Oe=S(),ys=O(),Kl={message:({params:{len:t}})=>(0,Oe.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Oe._)`{limit: ${t}}`},xl={keyword:\"additionalItems\",type:\"array\",schemaType:[\"boolean\",\"object\"],before:\"uniqueItems\",error:Kl,code(t){let{parentSchema:e,it:r}=t,{items:s}=e;if(!Array.isArray(s)){(0,ys.checkStrictMode)(r,'\"additionalItems\" is ignored when \"items\" is not an array of schemas');return}zo(t,s)}};function zo(t,e){let{gen:r,schema:s,data:n,keyword:o,it:i}=t;i.items=!0;let a=r.const(\"len\",(0,Oe._)`${n}.length`);if(s===!1)t.setParams({len:e.length}),t.pass((0,Oe._)`${a} <= ${e.length}`);else if(typeof s==\"object\"&&!(0,ys.alwaysValidSchema)(i,s)){let l=r.var(\"valid\",(0,Oe._)`${a} <= ${e.length}`);r.if((0,Oe.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange(\"i\",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:ys.Type.Num},l),i.allErrors||r.if((0,Oe.not)(l),()=>r.break())})}}gt.validateAdditionalItems=zo;gt.default=xl});var gs=g($t=>{\"use strict\";Object.defineProperty($t,\"__esModule\",{value:!0});$t.validateTuple=void 0;var Uo=S(),Ht=O(),Fl=Q(),Ll={keyword:\"items\",type:\"array\",schemaType:[\"object\",\"array\",\"boolean\"],before:\"uniqueItems\",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Ko(t,\"additionalItems\",e);r.items=!0,!(0,Ht.alwaysValidSchema)(r,e)&&t.ok((0,Fl.validateArray)(t))}};function Ko(t,e,r=t.schema){let{gen:s,parentSchema:n,data:o,keyword:i,it:a}=t;u(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Ht.mergeEvaluated.items(s,r.length,a.items));let c=s.name(\"valid\"),l=s.const(\"len\",(0,Uo._)`${o}.length`);r.forEach((d,y)=>{(0,Ht.alwaysValidSchema)(a,d)||(s.if((0,Uo._)`${l} > ${y}`,()=>t.subschema({keyword:i,schemaProp:y,dataProp:y},c)),t.ok(c))});function u(d){let{opts:y,errSchemaPath:m}=a,h=r.length,f=h===d.minItems&&(h===d.maxItems||d[e]===!1);if(y.strictTuples&&!f){let p=`\"${i}\" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path \"${m}\"`;(0,Ht.checkStrictMode)(a,p,y.strictTuples)}}}$t.validateTuple=Ko;$t.default=Ll});var xo=g($s=>{\"use strict\";Object.defineProperty($s,\"__esModule\",{value:!0});var Hl=gs(),Gl={keyword:\"prefixItems\",type:\"array\",schemaType:[\"array\"],before:\"uniqueItems\",code:t=>(0,Hl.validateTuple)(t,\"items\")};$s.default=Gl});var Lo=g(vs=>{\"use strict\";Object.defineProperty(vs,\"__esModule\",{value:!0});var Fo=S(),Jl=O(),Wl=Q(),Bl=_s(),Ql={message:({params:{len:t}})=>(0,Fo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Fo._)`{limit: ${t}}`},Xl={keyword:\"items\",type:\"array\",schemaType:[\"object\",\"boolean\"],before:\"uniqueItems\",error:Ql,code(t){let{schema:e,parentSchema:r,it:s}=t,{prefixItems:n}=r;s.items=!0,!(0,Jl.alwaysValidSchema)(s,e)&&(n?(0,Bl.validateAdditionalItems)(t,n):t.ok((0,Wl.validateArray)(t)))}};vs.default=Xl});var Ho=g(ws=>{\"use strict\";Object.defineProperty(ws,\"__esModule\",{value:!0});var Y=S(),Gt=O(),Yl={message:({params:{min:t,max:e}})=>e===void 0?(0,Y.str)`must contain at least ${t} valid item(s)`:(0,Y.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Y._)`{minContains: ${t}}`:(0,Y._)`{minContains: ${t}, maxContains: ${e}}`},Zl={keyword:\"contains\",type:\"array\",schemaType:[\"object\",\"boolean\"],before:\"uniqueItems\",trackErrors:!0,error:Yl,code(t){let{gen:e,schema:r,parentSchema:s,data:n,it:o}=t,i,a,{minContains:c,maxContains:l}=s;o.opts.next?(i=c===void 0?1:c,a=l):i=1;let u=e.const(\"len\",(0,Y._)`${n}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,Gt.checkStrictMode)(o,'\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored');return}if(a!==void 0&&i>a){(0,Gt.checkStrictMode)(o,'\"minContains\" > \"maxContains\" is always invalid'),t.fail();return}if((0,Gt.alwaysValidSchema)(o,r)){let f=(0,Y._)`${u} >= ${i}`;a!==void 0&&(f=(0,Y._)`${f} && ${u} <= ${a}`),t.pass(f);return}o.items=!0;let d=e.name(\"valid\");a===void 0&&i===1?m(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,Y._)`${n}.length > 0`,y)):(e.let(d,!1),y()),t.result(d,()=>t.reset());function y(){let f=e.name(\"_valid\"),p=e.let(\"count\",0);m(f,()=>e.if(f,()=>h(p)))}function m(f,p){e.forRange(\"i\",0,u,_=>{t.subschema({keyword:\"contains\",dataProp:_,dataPropType:Gt.Type.Num,compositeRule:!0},f),p()})}function h(f){e.code((0,Y._)`${f}++`),a===void 0?e.if((0,Y._)`${f} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,Y._)`${f} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,Y._)`${f} >= ${i}`,()=>e.assign(d,!0)))}}};ws.default=Zl});var Wo=g(ie=>{\"use strict\";Object.defineProperty(ie,\"__esModule\",{value:!0});ie.validateSchemaDeps=ie.validatePropertyDeps=ie.error=void 0;var bs=S(),ed=O(),vt=Q();ie.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let s=e===1?\"property\":\"properties\";return(0,bs.str)`must have ${s} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:s}})=>(0,bs._)`{property: ${t},\n missingProperty: ${s},\n depsCount: ${e},\n deps: ${r}}`};var td={keyword:\"dependencies\",type:\"object\",schemaType:\"object\",error:ie.error,code(t){let[e,r]=rd(t);Go(t,e),Jo(t,r)}};function rd({schema:t}){let e={},r={};for(let s in t){if(s===\"__proto__\")continue;let n=Array.isArray(t[s])?e:r;n[s]=t[s]}return[e,r]}function Go(t,e=t.schema){let{gen:r,data:s,it:n}=t;if(Object.keys(e).length===0)return;let o=r.let(\"missing\");for(let i in e){let a=e[i];if(a.length===0)continue;let c=(0,vt.propertyInData)(r,s,i,n.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(\", \")}),n.allErrors?r.if(c,()=>{for(let l of a)(0,vt.checkReportMissingProp)(t,l)}):(r.if((0,bs._)`${c} && (${(0,vt.checkMissingProp)(t,a,o)})`),(0,vt.reportMissingProp)(t,o),r.else())}}ie.validatePropertyDeps=Go;function Jo(t,e=t.schema){let{gen:r,data:s,keyword:n,it:o}=t,i=r.name(\"valid\");for(let a in e)(0,ed.alwaysValidSchema)(o,e[a])||(r.if((0,vt.propertyInData)(r,s,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:n,schemaProp:a},i);t.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),t.ok(i))}ie.validateSchemaDeps=Jo;ie.default=td});var Qo=g(Es=>{\"use strict\";Object.defineProperty(Es,\"__esModule\",{value:!0});var Bo=S(),sd=O(),nd={message:\"property name must be valid\",params:({params:t})=>(0,Bo._)`{propertyName: ${t.propertyName}}`},od={keyword:\"propertyNames\",type:\"object\",schemaType:[\"object\",\"boolean\"],error:nd,code(t){let{gen:e,schema:r,data:s,it:n}=t;if((0,sd.alwaysValidSchema)(n,r))return;let o=e.name(\"valid\");e.forIn(\"key\",s,i=>{t.setParams({propertyName:i}),t.subschema({keyword:\"propertyNames\",data:i,dataTypes:[\"string\"],propertyName:i,compositeRule:!0},o),e.if((0,Bo.not)(o),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(o)}};Es.default=od});var Ps=g(Ss=>{\"use strict\";Object.defineProperty(Ss,\"__esModule\",{value:!0});var Jt=Q(),re=S(),id=le(),Wt=O(),ad={message:\"must NOT have additional properties\",params:({params:t})=>(0,re._)`{additionalProperty: ${t.additionalProperty}}`},cd={keyword:\"additionalProperties\",type:[\"object\"],schemaType:[\"boolean\",\"object\"],allowUndefined:!0,trackErrors:!0,error:ad,code(t){let{gen:e,schema:r,parentSchema:s,data:n,errsCount:o,it:i}=t;if(!o)throw new Error(\"ajv implementation error\");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!==\"all\"&&(0,Wt.alwaysValidSchema)(i,r))return;let l=(0,Jt.allSchemaProperties)(s.properties),u=(0,Jt.allSchemaProperties)(s.patternProperties);d(),t.ok((0,re._)`${o} === ${id.default.errors}`);function d(){e.forIn(\"key\",n,p=>{!l.length&&!u.length?h(p):e.if(y(p),()=>h(p))})}function y(p){let _;if(l.length>8){let q=(0,Wt.schemaRefOrVal)(i,s.properties,\"properties\");_=(0,Jt.isOwnProperty)(e,q,p)}else l.length?_=(0,re.or)(...l.map(q=>(0,re._)`${p} === ${q}`)):_=re.nil;return u.length&&(_=(0,re.or)(_,...u.map(q=>(0,re._)`${(0,Jt.usePattern)(t,q)}.test(${p})`))),(0,re.not)(_)}function m(p){e.code((0,re._)`delete ${n}[${p}]`)}function h(p){if(c.removeAdditional===\"all\"||c.removeAdditional&&r===!1){m(p);return}if(r===!1){t.setParams({additionalProperty:p}),t.error(),a||e.break();return}if(typeof r==\"object\"&&!(0,Wt.alwaysValidSchema)(i,r)){let _=e.name(\"valid\");c.removeAdditional===\"failing\"?(f(p,_,!1),e.if((0,re.not)(_),()=>{t.reset(),m(p)})):(f(p,_),a||e.if((0,re.not)(_),()=>e.break()))}}function f(p,_,q){let N={keyword:\"additionalProperties\",dataProp:p,dataPropType:Wt.Type.Str};q===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(N,_)}}};Ss.default=cd});var Zo=g(ks=>{\"use strict\";Object.defineProperty(ks,\"__esModule\",{value:!0});var ud=it(),Xo=Q(),Ns=O(),Yo=Ps(),ld={keyword:\"properties\",type:\"object\",schemaType:\"object\",code(t){let{gen:e,schema:r,parentSchema:s,data:n,it:o}=t;o.opts.removeAdditional===\"all\"&&s.additionalProperties===void 0&&Yo.default.code(new ud.KeywordCxt(o,Yo.default,\"additionalProperties\"));let i=(0,Xo.allSchemaProperties)(r);for(let d of i)o.definedProperties.add(d);o.opts.unevaluated&&i.length&&o.props!==!0&&(o.props=Ns.mergeEvaluated.props(e,(0,Ns.toHash)(i),o.props));let a=i.filter(d=>!(0,Ns.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name(\"valid\");for(let d of a)l(d)?u(d):(e.if((0,Xo.propertyInData)(e,n,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:\"properties\",schemaProp:d,dataProp:d},c)}}};ks.default=ld});var si=g(qs=>{\"use strict\";Object.defineProperty(qs,\"__esModule\",{value:!0});var ei=Q(),Bt=S(),ti=O(),ri=O(),dd={keyword:\"patternProperties\",type:\"object\",schemaType:\"object\",code(t){let{gen:e,schema:r,data:s,parentSchema:n,it:o}=t,{opts:i}=o,a=(0,ei.allSchemaProperties)(r),c=a.filter(f=>(0,ti.alwaysValidSchema)(o,r[f]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=i.strictSchema&&!i.allowMatchingProperties&&n.properties,u=e.name(\"valid\");o.props!==!0&&!(o.props instanceof Bt.Name)&&(o.props=(0,ri.evaluatedPropsToName)(e,o.props));let{props:d}=o;y();function y(){for(let f of a)l&&m(f),o.allErrors?h(f):(e.var(u,!0),h(f),e.if(u))}function m(f){for(let p in l)new RegExp(f).test(p)&&(0,ti.checkStrictMode)(o,`property ${p} matches pattern ${f} (use allowMatchingProperties)`)}function h(f){e.forIn(\"key\",s,p=>{e.if((0,Bt._)`${(0,ei.usePattern)(t,f)}.test(${p})`,()=>{let _=c.includes(f);_||t.subschema({keyword:\"patternProperties\",schemaProp:f,dataProp:p,dataPropType:ri.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,Bt._)`${d}[${p}]`,!0):!_&&!o.allErrors&&e.if((0,Bt.not)(u),()=>e.break())})})}}};qs.default=dd});var ni=g(Os=>{\"use strict\";Object.defineProperty(Os,\"__esModule\",{value:!0});var fd=O(),hd={keyword:\"not\",schemaType:[\"object\",\"boolean\"],trackErrors:!0,code(t){let{gen:e,schema:r,it:s}=t;if((0,fd.alwaysValidSchema)(s,r)){t.fail();return}let n=e.name(\"valid\");t.subschema({keyword:\"not\",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:\"must NOT be valid\"}};Os.default=hd});var oi=g(js=>{\"use strict\";Object.defineProperty(js,\"__esModule\",{value:!0});var pd=Q(),md={keyword:\"anyOf\",schemaType:\"array\",trackErrors:!0,code:pd.validateUnion,error:{message:\"must match a schema in anyOf\"}};js.default=md});var ii=g(Rs=>{\"use strict\";Object.defineProperty(Rs,\"__esModule\",{value:!0});var Qt=S(),yd=O(),_d={message:\"must match exactly one schema in oneOf\",params:({params:t})=>(0,Qt._)`{passingSchemas: ${t.passing}}`},gd={keyword:\"oneOf\",schemaType:\"array\",trackErrors:!0,error:_d,code(t){let{gen:e,schema:r,parentSchema:s,it:n}=t;if(!Array.isArray(r))throw new Error(\"ajv implementation error\");if(n.opts.discriminator&&s.discriminator)return;let o=r,i=e.let(\"valid\",!1),a=e.let(\"passing\",null),c=e.name(\"_valid\");t.setParams({passing:a}),e.block(l),t.result(i,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let y;(0,yd.alwaysValidSchema)(n,u)?e.var(c,!0):y=t.subschema({keyword:\"oneOf\",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Qt._)`${c} && ${i}`).assign(i,!1).assign(a,(0,Qt._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),y&&t.mergeEvaluated(y,Qt.Name)})})}}};Rs.default=gd});var ai=g(Is=>{\"use strict\";Object.defineProperty(Is,\"__esModule\",{value:!0});var $d=O(),vd={keyword:\"allOf\",schemaType:\"array\",code(t){let{gen:e,schema:r,it:s}=t;if(!Array.isArray(r))throw new Error(\"ajv implementation error\");let n=e.name(\"valid\");r.forEach((o,i)=>{if((0,$d.alwaysValidSchema)(s,o))return;let a=t.subschema({keyword:\"allOf\",schemaProp:i},n);t.ok(n),t.mergeEvaluated(a)})}};Is.default=vd});var li=g(Ts=>{\"use strict\";Object.defineProperty(Ts,\"__esModule\",{value:!0});var Xt=S(),ui=O(),wd={message:({params:t})=>(0,Xt.str)`must match \"${t.ifClause}\" schema`,params:({params:t})=>(0,Xt._)`{failingKeyword: ${t.ifClause}}`},bd={keyword:\"if\",schemaType:[\"object\",\"boolean\"],trackErrors:!0,error:wd,code(t){let{gen:e,parentSchema:r,it:s}=t;r.then===void 0&&r.else===void 0&&(0,ui.checkStrictMode)(s,'\"if\" without \"then\" and \"else\" is ignored');let n=ci(s,\"then\"),o=ci(s,\"else\");if(!n&&!o)return;let i=e.let(\"valid\",!0),a=e.name(\"_valid\");if(c(),t.reset(),n&&o){let u=e.let(\"ifClause\");t.setParams({ifClause:u}),e.if(a,l(\"then\",u),l(\"else\",u))}else n?e.if(a,l(\"then\")):e.if((0,Xt.not)(a),l(\"else\"));t.pass(i,()=>t.error(!0));function c(){let u=t.subschema({keyword:\"if\",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let y=t.subschema({keyword:u},a);e.assign(i,a),t.mergeValidEvaluated(y,i),d?e.assign(d,(0,Xt._)`${u}`):t.setParams({ifClause:u})}}}};function ci(t,e){let r=t.schema[e];return r!==void 0&&!(0,ui.alwaysValidSchema)(t,r)}Ts.default=bd});var di=g(Cs=>{\"use strict\";Object.defineProperty(Cs,\"__esModule\",{value:!0});var Ed=O(),Sd={keyword:[\"then\",\"else\"],schemaType:[\"object\",\"boolean\"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Ed.checkStrictMode)(r,`\"${t}\" without \"if\" is ignored`)}};Cs.default=Sd});var fi=g(Ms=>{\"use strict\";Object.defineProperty(Ms,\"__esModule\",{value:!0});var Pd=_s(),Nd=xo(),kd=gs(),qd=Lo(),Od=Ho(),jd=Wo(),Rd=Qo(),Id=Ps(),Td=Zo(),Cd=si(),Md=ni(),Ad=oi(),Dd=ii(),Vd=ai(),zd=li(),Ud=di();function Kd(t=!1){let e=[Md.default,Ad.default,Dd.default,Vd.default,zd.default,Ud.default,Rd.default,Id.default,jd.default,Td.default,Cd.default];return t?e.push(Nd.default,qd.default):e.push(Pd.default,kd.default),e.push(Od.default),e}Ms.default=Kd});var hi=g(As=>{\"use strict\";Object.defineProperty(As,\"__esModule\",{value:!0});var D=S(),xd={message:({schemaCode:t})=>(0,D.str)`must match format \"${t}\"`,params:({schemaCode:t})=>(0,D._)`{format: ${t}}`},Fd={keyword:\"format\",type:[\"number\",\"string\"],schemaType:\"string\",$data:!0,error:xd,code(t,e){let{gen:r,data:s,$data:n,schema:o,schemaCode:i,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;n?y():m();function y(){let h=r.scopeValue(\"formats\",{ref:d.formats,code:c.code.formats}),f=r.const(\"fDef\",(0,D._)`${h}[${i}]`),p=r.let(\"fType\"),_=r.let(\"format\");r.if((0,D._)`typeof ${f} == \"object\" && !(${f} instanceof RegExp)`,()=>r.assign(p,(0,D._)`${f}.type || \"string\"`).assign(_,(0,D._)`${f}.validate`),()=>r.assign(p,(0,D._)`\"string\"`).assign(_,f)),t.fail$data((0,D.or)(q(),N()));function q(){return c.strictSchema===!1?D.nil:(0,D._)`${i} && !${_}`}function N(){let C=u.$async?(0,D._)`(${f}.async ? await ${_}(${s}) : ${_}(${s}))`:(0,D._)`${_}(${s})`,w=(0,D._)`(typeof ${_} == \"function\" ? ${C} : ${_}.test(${s}))`;return(0,D._)`${_} && ${_} !== true && ${p} === ${e} && !${w}`}}function m(){let h=d.formats[o];if(!h){q();return}if(h===!0)return;let[f,p,_]=N(h);f===e&&t.pass(C());function q(){if(c.strictSchema===!1){d.logger.warn(w());return}throw new Error(w());function w(){return`unknown format \"${o}\" ignored in schema at path \"${l}\"`}}function N(w){let se=w instanceof RegExp?(0,D.regexpCode)(w):c.code.formats?(0,D._)`${c.code.formats}${(0,D.getProperty)(o)}`:void 0,ae=r.scopeValue(\"formats\",{key:o,ref:w,code:se});return typeof w==\"object\"&&!(w instanceof RegExp)?[w.type||\"string\",w.validate,(0,D._)`${ae}.validate`]:[\"string\",w,ae]}function C(){if(typeof h==\"object\"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw new Error(\"async format in sync schema\");return(0,D._)`await ${_}(${s})`}return typeof p==\"function\"?(0,D._)`${_}(${s})`:(0,D._)`${_}.test(${s})`}}}};As.default=Fd});var pi=g(Ds=>{\"use strict\";Object.defineProperty(Ds,\"__esModule\",{value:!0});var Ld=hi(),Hd=[Ld.default];Ds.default=Hd});var mi=g(xe=>{\"use strict\";Object.defineProperty(xe,\"__esModule\",{value:!0});xe.contentVocabulary=xe.metadataVocabulary=void 0;xe.metadataVocabulary=[\"title\",\"description\",\"default\",\"deprecated\",\"readOnly\",\"writeOnly\",\"examples\"];xe.contentVocabulary=[\"contentMediaType\",\"contentEncoding\",\"contentSchema\"]});var _i=g(Vs=>{\"use strict\";Object.defineProperty(Vs,\"__esModule\",{value:!0});var Gd=So(),Jd=Vo(),Wd=fi(),Bd=pi(),yi=mi(),Qd=[Gd.default,Jd.default,(0,Wd.default)(),Bd.default,yi.metadataVocabulary,yi.contentVocabulary];Vs.default=Qd});var $i=g(Yt=>{\"use strict\";Object.defineProperty(Yt,\"__esModule\",{value:!0});Yt.DiscrError=void 0;var gi;(function(t){t.Tag=\"tag\",t.Mapping=\"mapping\"})(gi||(Yt.DiscrError=gi={}))});var wi=g(Us=>{\"use strict\";Object.defineProperty(Us,\"__esModule\",{value:!0});var Fe=S(),zs=$i(),vi=Mt(),Xd=at(),Yd=O(),Zd={message:({params:{discrError:t,tagName:e}})=>t===zs.DiscrError.Tag?`tag \"${e}\" must be string`:`value of tag \"${e}\" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Fe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},ef={keyword:\"discriminator\",type:\"object\",schemaType:\"object\",error:Zd,code(t){let{gen:e,data:r,schema:s,parentSchema:n,it:o}=t,{oneOf:i}=n;if(!o.opts.discriminator)throw new Error(\"discriminator: requires discriminator option\");let a=s.propertyName;if(typeof a!=\"string\")throw new Error(\"discriminator: requires propertyName\");if(s.mapping)throw new Error(\"discriminator: mapping is not supported\");if(!i)throw new Error(\"discriminator: requires oneOf keyword\");let c=e.let(\"valid\",!1),l=e.const(\"tag\",(0,Fe._)`${r}${(0,Fe.getProperty)(a)}`);e.if((0,Fe._)`typeof ${l} == \"string\"`,()=>u(),()=>t.error(!1,{discrError:zs.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let m=y();e.if(!1);for(let h in m)e.elseIf((0,Fe._)`${l} === ${h}`),e.assign(c,d(m[h]));e.else(),t.error(!1,{discrError:zs.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(m){let h=e.name(\"valid\"),f=t.subschema({keyword:\"oneOf\",schemaProp:m},h);return t.mergeEvaluated(f,Fe.Name),h}function y(){var m;let h={},f=_(n),p=!0;for(let C=0;C{tf.exports={$schema:\"http://json-schema.org/draft-07/schema#\",$id:\"http://json-schema.org/draft-07/schema#\",title:\"Core schema meta-schema\",definitions:{schemaArray:{type:\"array\",minItems:1,items:{$ref:\"#\"}},nonNegativeInteger:{type:\"integer\",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:\"#/definitions/nonNegativeInteger\"},{default:0}]},simpleTypes:{enum:[\"array\",\"boolean\",\"integer\",\"null\",\"number\",\"object\",\"string\"]},stringArray:{type:\"array\",items:{type:\"string\"},uniqueItems:!0,default:[]}},type:[\"object\",\"boolean\"],properties:{$id:{type:\"string\",format:\"uri-reference\"},$schema:{type:\"string\",format:\"uri\"},$ref:{type:\"string\",format:\"uri-reference\"},$comment:{type:\"string\"},title:{type:\"string\"},description:{type:\"string\"},default:!0,readOnly:{type:\"boolean\",default:!1},examples:{type:\"array\",items:!0},multipleOf:{type:\"number\",exclusiveMinimum:0},maximum:{type:\"number\"},exclusiveMaximum:{type:\"number\"},minimum:{type:\"number\"},exclusiveMinimum:{type:\"number\"},maxLength:{$ref:\"#/definitions/nonNegativeInteger\"},minLength:{$ref:\"#/definitions/nonNegativeIntegerDefault0\"},pattern:{type:\"string\",format:\"regex\"},additionalItems:{$ref:\"#\"},items:{anyOf:[{$ref:\"#\"},{$ref:\"#/definitions/schemaArray\"}],default:!0},maxItems:{$ref:\"#/definitions/nonNegativeInteger\"},minItems:{$ref:\"#/definitions/nonNegativeIntegerDefault0\"},uniqueItems:{type:\"boolean\",default:!1},contains:{$ref:\"#\"},maxProperties:{$ref:\"#/definitions/nonNegativeInteger\"},minProperties:{$ref:\"#/definitions/nonNegativeIntegerDefault0\"},required:{$ref:\"#/definitions/stringArray\"},additionalProperties:{$ref:\"#\"},definitions:{type:\"object\",additionalProperties:{$ref:\"#\"},default:{}},properties:{type:\"object\",additionalProperties:{$ref:\"#\"},default:{}},patternProperties:{type:\"object\",additionalProperties:{$ref:\"#\"},propertyNames:{format:\"regex\"},default:{}},dependencies:{type:\"object\",additionalProperties:{anyOf:[{$ref:\"#\"},{$ref:\"#/definitions/stringArray\"}]}},propertyNames:{$ref:\"#\"},const:!0,enum:{type:\"array\",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:\"#/definitions/simpleTypes\"},{type:\"array\",items:{$ref:\"#/definitions/simpleTypes\"},minItems:1,uniqueItems:!0}]},format:{type:\"string\"},contentMediaType:{type:\"string\"},contentEncoding:{type:\"string\"},if:{$ref:\"#\"},then:{$ref:\"#\"},else:{$ref:\"#\"},allOf:{$ref:\"#/definitions/schemaArray\"},anyOf:{$ref:\"#/definitions/schemaArray\"},oneOf:{$ref:\"#/definitions/schemaArray\"},not:{$ref:\"#\"}},default:!0}});var xs=g((A,Ks)=>{\"use strict\";Object.defineProperty(A,\"__esModule\",{value:!0});A.MissingRefError=A.ValidationError=A.CodeGen=A.Name=A.nil=A.stringify=A.str=A._=A.KeywordCxt=A.Ajv=void 0;var rf=go(),sf=_i(),nf=wi(),Ei=bi(),of=[\"/properties\"],Zt=\"http://json-schema.org/draft-07/schema\",Le=class extends rf.default{_addVocabularies(){super._addVocabularies(),sf.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(nf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Ei,of):Ei;this.addMetaSchema(e,Zt,!1),this.refs[\"http://json-schema.org/schema\"]=Zt}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Zt)?Zt:void 0)}};A.Ajv=Le;Ks.exports=A=Le;Ks.exports.Ajv=Le;Object.defineProperty(A,\"__esModule\",{value:!0});A.default=Le;var af=it();Object.defineProperty(A,\"KeywordCxt\",{enumerable:!0,get:function(){return af.KeywordCxt}});var He=S();Object.defineProperty(A,\"_\",{enumerable:!0,get:function(){return He._}});Object.defineProperty(A,\"str\",{enumerable:!0,get:function(){return He.str}});Object.defineProperty(A,\"stringify\",{enumerable:!0,get:function(){return He.stringify}});Object.defineProperty(A,\"nil\",{enumerable:!0,get:function(){return He.nil}});Object.defineProperty(A,\"Name\",{enumerable:!0,get:function(){return He.Name}});Object.defineProperty(A,\"CodeGen\",{enumerable:!0,get:function(){return He.CodeGen}});var cf=Tt();Object.defineProperty(A,\"ValidationError\",{enumerable:!0,get:function(){return cf.default}});var uf=at();Object.defineProperty(A,\"MissingRefError\",{enumerable:!0,get:function(){return uf.default}})});module.exports=xs().default||xs();\n\n })(module, exports);\n return module.exports;\n}"; diff --git a/packages/insomnia/src/templating/sandbox/vendored/uuid.generated.ts b/packages/insomnia/src/templating/sandbox/vendored/uuid.generated.ts index 7becd85b602..193a3c2e719 100644 --- a/packages/insomnia/src/templating/sandbox/vendored/uuid.generated.ts +++ b/packages/insomnia/src/templating/sandbox/vendored/uuid.generated.ts @@ -2,6 +2,6 @@ // Vendored, pinned bundle of "uuid" for the QuickJS template-tag sandbox (M3). // Sourced from the isolated install in vendored/pkg/ (see its package.json) — NOT the app's own node_modules. // Regenerate with: npm run sandbox:vendored:generate -w insomnia -/* eslint-disable */ + export const UUID_FACTORY_VERSION = "11.1.1"; export const UUID_FACTORY_SOURCE = "function () {\n var module = { exports: {} };\n var exports = module.exports;\n (function (module, exports) {\nvar a=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var fe=a(L=>{\"use strict\";Object.defineProperty(L,\"__esModule\",{value:!0});L.default=\"ffffffff-ffff-ffff-ffff-ffffffffffff\"});var oe=a(N=>{\"use strict\";Object.defineProperty(N,\"__esModule\",{value:!0});N.default=\"00000000-0000-0000-0000-000000000000\"});var ce=a(E=>{\"use strict\";Object.defineProperty(E,\"__esModule\",{value:!0});E.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var O=a($=>{\"use strict\";Object.defineProperty($,\"__esModule\",{value:!0});var Ae=ce();function Ve(e){return typeof e==\"string\"&&Ae.default.test(e)}$.default=Ve});var x=a(k=>{\"use strict\";Object.defineProperty(k,\"__esModule\",{value:!0});var Le=O();function Ne(e){if(!(0,Le.default)(e))throw TypeError(\"Invalid UUID\");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}k.default=Ne});var p=a(P=>{\"use strict\";Object.defineProperty(P,\"__esModule\",{value:!0});P.unsafeStringify=void 0;var Ee=O(),_=[];for(let e=0;e<256;++e)_.push((e+256).toString(16).slice(1));function le(e,t=0){return(_[e[t+0]]+_[e[t+1]]+_[e[t+2]]+_[e[t+3]]+\"-\"+_[e[t+4]]+_[e[t+5]]+\"-\"+_[e[t+6]]+_[e[t+7]]+\"-\"+_[e[t+8]]+_[e[t+9]]+\"-\"+_[e[t+10]]+_[e[t+11]]+_[e[t+12]]+_[e[t+13]]+_[e[t+14]]+_[e[t+15]]).toLowerCase()}P.unsafeStringify=le;function $e(e,t=0){let u=le(e,t);if(!(0,Ee.default)(u))throw TypeError(\"Stringified UUID is invalid\");return u}P.default=$e});var T=a(H=>{\"use strict\";Object.defineProperty(H,\"__esModule\",{value:!0});var C,ke=new Uint8Array(16);function Ce(){if(!C){if(typeof crypto>\"u\"||!crypto.getRandomValues)throw new Error(\"crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\");C=crypto.getRandomValues.bind(crypto)}return C(ke)}H.default=Ce});var K=a(D=>{\"use strict\";Object.defineProperty(D,\"__esModule\",{value:!0});D.updateV1State=void 0;var de=T(),He=p(),S={};function Ke(e,t,u){let r,n=e?._v6??!1;if(e){let i=Object.keys(e);i.length===1&&i[0]===\"_v6\"&&(e=void 0)}if(e)r=ae(e.random??e.rng?.()??(0,de.default)(),e.msecs,e.nsecs,e.clockseq,e.node,t,u);else{let i=Date.now(),f=(0,de.default)();se(S,i,f),r=ae(f,S.msecs,S.nsecs,n?void 0:S.clockseq,n?void 0:S.node,t,u)}return t??(0,He.unsafeStringify)(r)}function se(e,t,u){return e.msecs??(e.msecs=-1/0),e.nsecs??(e.nsecs=0),t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t= 16\");if(!i)i=new Uint8Array(16),f=0;else if(f<0||f+16>i.length)throw new RangeError(`UUID byte range ${f}:${f+15} is out of buffer bounds`);t??(t=Date.now()),u??(u=0),r??(r=(e[8]<<8|e[9])&16383),n??(n=e.slice(10,16)),t+=122192928e5;let o=((t&268435455)*1e4+u)%4294967296;i[f++]=o>>>24&255,i[f++]=o>>>16&255,i[f++]=o>>>8&255,i[f++]=o&255;let l=t/4294967296*1e4&268435455;i[f++]=l>>>8&255,i[f++]=l&255,i[f++]=l>>>24&15|16,i[f++]=l>>>16&255,i[f++]=r>>>8|128,i[f++]=r&255;for(let d=0;d<6;++d)i[f++]=n[d];return i}D.default=Ke});var W=a(X=>{\"use strict\";Object.defineProperty(X,\"__esModule\",{value:!0});var Xe=x(),We=p();function Fe(e){let t=typeof e==\"string\"?(0,Xe.default)(e):e,u=Ge(t);return typeof e==\"string\"?(0,We.unsafeStringify)(u):u}X.default=Fe;function Ge(e){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}});var ge=a(F=>{\"use strict\";Object.defineProperty(F,\"__esModule\",{value:!0});function Je(e){let t=Ze(e),u=Ye(t,e.length*8);return Qe(u)}function Qe(e){let t=new Uint8Array(e.length*4);for(let u=0;u>2]>>>u%4*8&255;return t}function _e(e){return(e+64>>>9<<4)+14+1}function Ye(e,t){let u=new Uint32Array(_e(t)).fill(0);u.set(e),u[t>>5]|=128<>2]|=(e[u]&255)<>16)+(t>>16)+(u>>16)<<16|u&65535}function ze(e,t){return e<>>32-t}function A(e,t,u,r,n,i){return h(ze(h(h(t,e),h(r,i)),n),u)}function g(e,t,u,r,n,i,f){return A(t&u|~t&r,e,t,n,i,f)}function j(e,t,u,r,n,i,f){return A(t&r|u&~r,e,t,n,i,f)}function y(e,t,u,r,n,i,f){return A(t^u^r,e,t,n,i,f)}function v(e,t,u,r,n,i,f){return A(u^(t|~r),e,t,n,i,f)}F.default=Je});var M=a(U=>{\"use strict\";Object.defineProperty(U,\"__esModule\",{value:!0});U.URL=U.DNS=U.stringToBytes=void 0;var je=x(),Be=p();function ye(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let u=0;un.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let d=0;d<16;++d)n[i+d]=l[d];return n}return(0,Be.unsafeStringify)(l)}U.default=er});var pe=a(m=>{\"use strict\";Object.defineProperty(m,\"__esModule\",{value:!0});m.URL=m.DNS=void 0;var rr=ge(),G=M(),ve=M();Object.defineProperty(m,\"DNS\",{enumerable:!0,get:function(){return ve.DNS}});Object.defineProperty(m,\"URL\",{enumerable:!0,get:function(){return ve.URL}});function J(e,t,u,r){return(0,G.default)(48,rr.default,e,t,u,r)}J.DNS=G.DNS;J.URL=G.URL;m.default=J});var Ue=a(Q=>{\"use strict\";Object.defineProperty(Q,\"__esModule\",{value:!0});var nr=typeof crypto<\"u\"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);Q.default={randomUUID:nr}});var me=a(Y=>{\"use strict\";Object.defineProperty(Y,\"__esModule\",{value:!0});var he=Ue(),tr=T(),ur=p();function ir(e,t,u){if(he.default.randomUUID&&!t&&!e)return he.default.randomUUID();e=e||{};let r=e.random??e.rng?.()??(0,tr.default)();if(r.length<16)throw new Error(\"Random bytes length must be >= 16\");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(u=u||0,u<0||u+16>t.length)throw new RangeError(`UUID byte range ${u}:${u+15} is out of buffer bounds`);for(let n=0;n<16;++n)t[u+n]=r[n];return t}return(0,ur.unsafeStringify)(r)}Y.default=ir});var we=a(z=>{\"use strict\";Object.defineProperty(z,\"__esModule\",{value:!0});function fr(e,t,u,r){switch(e){case 0:return t&u^~t&r;case 1:return t^u^r;case 2:return t&u^t&r^u&r;case 3:return t^u^r}}function Z(e,t){return e<>>32-t}function or(e){let t=[1518500249,1859775393,2400959708,3395469782],u=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(e.length+1);r.set(e),r[e.length]=128,e=r;let n=e.length/4+2,i=Math.ceil(n/16),f=new Array(i);for(let o=0;o>>0;V=I,I=q,q=Z(b,30)>>>0,b=d,d=Te}u[0]=u[0]+d>>>0,u[1]=u[1]+b>>>0,u[2]=u[2]+q>>>0,u[3]=u[3]+I>>>0,u[4]=u[4]+V>>>0}return Uint8Array.of(u[0]>>24,u[0]>>16,u[0]>>8,u[0],u[1]>>24,u[1]>>16,u[1]>>8,u[1],u[2]>>24,u[2]>>16,u[2]>>8,u[2],u[3]>>24,u[3]>>16,u[3]>>8,u[3],u[4]>>24,u[4]>>16,u[4]>>8,u[4])}z.default=or});var qe=a(w=>{\"use strict\";Object.defineProperty(w,\"__esModule\",{value:!0});w.URL=w.DNS=void 0;var cr=we(),B=M(),be=M();Object.defineProperty(w,\"DNS\",{enumerable:!0,get:function(){return be.DNS}});Object.defineProperty(w,\"URL\",{enumerable:!0,get:function(){return be.URL}});function ee(e,t,u,r){return(0,B.default)(80,cr.default,e,t,u,r)}ee.DNS=B.DNS;ee.URL=B.URL;w.default=ee});var Oe=a(re=>{\"use strict\";Object.defineProperty(re,\"__esModule\",{value:!0});var lr=p(),dr=K(),ar=W();function sr(e,t,u){e??(e={}),u??(u=0);let r=(0,dr.default)({...e,_v6:!0},new Uint8Array(16));if(r=(0,ar.default)(r),t){if(u<0||u+16>t.length)throw new RangeError(`UUID byte range ${u}:${u+15} is out of buffer bounds`);for(let n=0;n<16;n++)t[u+n]=r[n];return t}return(0,lr.unsafeStringify)(r)}re.default=sr});var xe=a(ne=>{\"use strict\";Object.defineProperty(ne,\"__esModule\",{value:!0});var _r=x(),gr=p();function jr(e){let t=typeof e==\"string\"?(0,_r.default)(e):e,u=yr(t);return typeof e==\"string\"?(0,gr.unsafeStringify)(u):u}ne.default=jr;function yr(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}});var Me=a(R=>{\"use strict\";Object.defineProperty(R,\"__esModule\",{value:!0});R.updateV7State=void 0;var Pe=T(),vr=p(),te={};function pr(e,t,u){let r;if(e)r=Se(e.random??e.rng?.()??(0,Pe.default)(),e.msecs,e.seq,t,u);else{let n=Date.now(),i=(0,Pe.default)();De(te,n,i),r=Se(i,te.msecs,te.seq,t,u)}return t??(0,vr.unsafeStringify)(r)}function De(e,t,u){return e.msecs??(e.msecs=-1/0),e.seq??(e.seq=0),t>e.msecs?(e.seq=u[6]<<23|u[7]<<16|u[8]<<8|u[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}R.updateV7State=De;function Se(e,t,u,r,n=0){if(e.length<16)throw new Error(\"Random bytes length must be >= 16\");if(!r)r=new Uint8Array(16),n=0;else if(n<0||n+16>r.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);return t??(t=Date.now()),u??(u=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9]),r[n++]=t/1099511627776&255,r[n++]=t/4294967296&255,r[n++]=t/16777216&255,r[n++]=t/65536&255,r[n++]=t/256&255,r[n++]=t&255,r[n++]=112|u>>>28&15,r[n++]=u>>>20&255,r[n++]=128|u>>>14&63,r[n++]=u>>>6&255,r[n++]=u<<2&255|e[10]&3,r[n++]=e[11],r[n++]=e[12],r[n++]=e[13],r[n++]=e[14],r[n++]=e[15],r}R.default=pr});var Re=a(ue=>{\"use strict\";Object.defineProperty(ue,\"__esModule\",{value:!0});var Ur=O();function hr(e){if(!(0,Ur.default)(e))throw TypeError(\"Invalid UUID\");return parseInt(e.slice(14,15),16)}ue.default=hr});var Ie=a(c=>{\"use strict\";Object.defineProperty(c,\"__esModule\",{value:!0});c.version=c.validate=c.v7=c.v6ToV1=c.v6=c.v5=c.v4=c.v3=c.v1ToV6=c.v1=c.stringify=c.parse=c.NIL=c.MAX=void 0;var mr=fe();Object.defineProperty(c,\"MAX\",{enumerable:!0,get:function(){return mr.default}});var wr=oe();Object.defineProperty(c,\"NIL\",{enumerable:!0,get:function(){return wr.default}});var br=x();Object.defineProperty(c,\"parse\",{enumerable:!0,get:function(){return br.default}});var qr=p();Object.defineProperty(c,\"stringify\",{enumerable:!0,get:function(){return qr.default}});var Or=K();Object.defineProperty(c,\"v1\",{enumerable:!0,get:function(){return Or.default}});var xr=W();Object.defineProperty(c,\"v1ToV6\",{enumerable:!0,get:function(){return xr.default}});var Pr=pe();Object.defineProperty(c,\"v3\",{enumerable:!0,get:function(){return Pr.default}});var Sr=me();Object.defineProperty(c,\"v4\",{enumerable:!0,get:function(){return Sr.default}});var Dr=qe();Object.defineProperty(c,\"v5\",{enumerable:!0,get:function(){return Dr.default}});var Mr=Oe();Object.defineProperty(c,\"v6\",{enumerable:!0,get:function(){return Mr.default}});var Rr=xe();Object.defineProperty(c,\"v6ToV1\",{enumerable:!0,get:function(){return Rr.default}});var Ir=Me();Object.defineProperty(c,\"v7\",{enumerable:!0,get:function(){return Ir.default}});var Tr=O();Object.defineProperty(c,\"validate\",{enumerable:!0,get:function(){return Tr.default}});var Ar=Re();Object.defineProperty(c,\"version\",{enumerable:!0,get:function(){return Ar.default}})});module.exports=Ie();\n\n })(module, exports);\n return module.exports;\n}"; From 14b00a6315f18f66323eb1b8951bbd03f6dc48f5 Mon Sep 17 00:00:00 2001 From: jackkav Date: Mon, 17 Aug 2026 12:39:18 +0200 Subject: [PATCH 3/4] fix(quickjs): address Copilot review feedback on test() lifecycle Clarify doc comments: there is no globalThis.pm alias in the QuickJS sandbox, matching the hidden-window sandbox, which has none either (only `insomnia` and the `$` Postman-compat alias exist in both). Drop the `e &&` guard around e.actual/e.expected in the failed-test errorMessage so it matches insomnia-scripting-environment/src/objects/ test.ts's template exactly -- the guard changed the rendered value for a falsy thrown primitive (e.g. `throw 0`) instead of just avoiding a crash, which property access on a primitive never causes anyway. --- .../src/scripting/quickjs-script-engine.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/insomnia/src/scripting/quickjs-script-engine.ts b/packages/insomnia/src/scripting/quickjs-script-engine.ts index 90022118b74..7515e338dfe 100644 --- a/packages/insomnia/src/scripting/quickjs-script-engine.ts +++ b/packages/insomnia/src/scripting/quickjs-script-engine.ts @@ -23,7 +23,9 @@ import { CHAI_FACTORY_SOURCE } from '../templating/sandbox/vendored/chai.generat * only `code`/`status`/`headers`/`body`/`responseTime`/`json()`/`text()` (no `originalRequest`). Full * parity with the hidden-window `Response` class is deferred. * - * insomnia.test()/pm.test() run entirely inside the VM: `insomnia.expect` is the real `chai` library + * insomnia.test() (aka `pm.test()`, the Postman-compat name it's commonly called by — there is no + * `pm` global here, matching the hidden-window sandbox, which has none either) runs entirely inside + * the VM: `insomnia.expect` is the real `chai` library * (vendored the same way as the template-tag sandbox's M3 npm libs — see * `../templating/sandbox/vendored/chai.generated.ts` — so assertion messages match the hidden-window * path byte-for-byte instead of a hand-rolled reimplementation), and `requestTestResults` is built up @@ -218,7 +220,9 @@ globalThis.insomnia = { globalThis.__testResults = []; // Every promise started by insomnia.test()/insomnia.test.skip() — awaited after the user script body // finishes, mirroring insomnia-scripting-environment/src/objects/test.ts's waitForAllTestsDone(), so -// a script that calls pm.test() without awaiting it still has the result recorded before the run ends. +// a script that calls insomnia.test() without awaiting it still has the result recorded before the +// run ends. There is no globalThis.pm alias here, matching the hidden-window sandbox — only +// insomnia and $ Postman-compat alias exist there too (see run-script.ts). globalThis.__testPromises = []; globalThis.insomnia.test = (msg, fn) => { const testPromise = (async () => { @@ -231,7 +235,12 @@ globalThis.insomnia.test = (msg, fn) => { testCase: msg, status: 'failed', executionTime: Date.now() - started, - errorMessage: 'error: ' + e + ' | ACTUAL: ' + (e && e.actual) + ' | EXPECTED: ' + (e && e.expected), + // Matches insomnia-scripting-environment/src/objects/test.ts's template exactly, including + // reading .actual/.expected off e unguarded: e is a primitive (thrown by insomnia.expect() + // failures it's always a chai AssertionError, but a script can throw anything) only when a + // script throws a bare value, and property access on a primitive is legal JS returning + // undefined, not a crash — the same as the hidden-window path. + errorMessage: 'error: ' + e + ' | ACTUAL: ' + e.actual + ' | EXPECTED: ' + e.expected, category: 'unknown', }); } From ed9b04592c7d45cc2ee0cc9fdcfc61bf962a71f2 Mon Sep 17 00:00:00 2001 From: jackkav Date: Mon, 17 Aug 2026 14:12:38 +0200 Subject: [PATCH 4/4] chore(lint): exclude generated sandbox-vendored bundles from ESLint Without this, ESLint's default reportUnusedDisableDirectives flags these checked-in, machine-generated files' blanket `/* eslint-disable */` as unused (the minified bundle happens to trip no rule under this config), and `--fix` deletes it -- which then perpetually conflicts with scripts/generate-sandbox-vendored.ts always re-adding it and with CI's sandbox:vendored:generate diff check. Same category as the existing **/*.min.js/**/dist/* ignores. Also restores the comment in the three vendored files, stripped by this exact autofix before it landed on this branch. --- eslint.config.mjs | 6 ++++++ .../src/templating/sandbox/vendored/ajv.generated.ts | 2 +- .../src/templating/sandbox/vendored/chai.generated.ts | 2 +- .../src/templating/sandbox/vendored/uuid.generated.ts | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 992ceb43b43..7de6dbaf063 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -300,6 +300,12 @@ export default defineConfig([ '**/__mocks__/*', '**/.react-router/*', 'packages/insomnia/src/*.js', + // Checked-in, machine-generated bundles (scripts/generate-sandbox-vendored.ts) — same category + // as **/*.min.js/**/dist/* above. Without this, ESLint's default reportUnusedDisableDirectives + // flags these files' blanket `/* eslint-disable */` as unused (the minified bundle happens to + // trip no rule under this config) and --fix deletes it, which then perpetually conflicts with + // the generator script re-adding it and with CI's sandbox:vendored:generate diff check. + 'packages/insomnia/src/templating/sandbox/vendored/*.generated.ts', ], }, // Node context: main process, UtilityProcess, and node adapters — no DOM globals. diff --git a/packages/insomnia/src/templating/sandbox/vendored/ajv.generated.ts b/packages/insomnia/src/templating/sandbox/vendored/ajv.generated.ts index 25d60916564..2e56b0dd9b8 100644 --- a/packages/insomnia/src/templating/sandbox/vendored/ajv.generated.ts +++ b/packages/insomnia/src/templating/sandbox/vendored/ajv.generated.ts @@ -2,6 +2,6 @@ // Vendored, pinned bundle of "ajv" for the QuickJS template-tag sandbox (M3). // Sourced from the isolated install in vendored/pkg/ (see its package.json) — NOT the app's own node_modules. // Regenerate with: npm run sandbox:vendored:generate -w insomnia - +/* eslint-disable */ export const AJV_FACTORY_VERSION = "8.18.0"; export const AJV_FACTORY_SOURCE = "function () {\n var module = { exports: {} };\n var exports = module.exports;\n (function (module, exports) {\nvar g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Be=g(R=>{\"use strict\";Object.defineProperty(R,\"__esModule\",{value:!0});R.regexpCode=R.getEsmExportName=R.getProperty=R.safeStringify=R.stringify=R.strConcat=R.addCodeArg=R.str=R._=R.nil=R._Code=R.Name=R.IDENTIFIER=R._CodeOrName=void 0;var Je=class{};R._CodeOrName=Je;R.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var $e=class extends Je{constructor(e){if(super(),!R.IDENTIFIER.test(e))throw new Error(\"CodeGen: name must be a valid identifier\");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};R.Name=$e;var B=class extends Je{constructor(e){super(),this._items=typeof e==\"string\"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===\"\"||e==='\"\"'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,s)=>`${r}${s}`,\"\")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,s)=>(s instanceof $e&&(r[s.str]=(r[s.str]||0)+1),r),{})}};R._Code=B;R.nil=new B(\"\");function Hs(t,...e){let r=[t[0]],s=0;for(;s{\"use strict\";Object.defineProperty(G,\"__esModule\",{value:!0});G.ValueScope=G.ValueScopeName=G.Scope=G.varKinds=G.UsedValueState=void 0;var H=Be(),or=class extends Error{constructor(e){super(`CodeGen: \"code\" for ${e} not defined`),this.value=e.value}},wt;(function(t){t[t.Started=0]=\"Started\",t[t.Completed=1]=\"Completed\"})(wt||(G.UsedValueState=wt={}));G.varKinds={const:new H.Name(\"const\"),let:new H.Name(\"let\"),var:new H.Name(\"var\")};var bt=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof H.Name?e:this.name(e)}name(e){return new H.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,s;if(!((s=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix \"${e}\" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};G.Scope=bt;var Et=class extends H.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:s}){this.value=e,this.scopePath=(0,H._)`.${new H.Name(r)}[${s}]`}};G.ValueScopeName=Et;var Ti=(0,H._)`\\n`,ir=class extends bt{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Ti:H.nil}}get(){return this._scope}name(e){return new Et(e,this._newName(e))}value(e,r){var s;if(r.ref===void 0)throw new Error(\"CodeGen: ref must be passed in value\");let n=this.toName(e),{prefix:o}=n,i=(s=r.key)!==null&&s!==void 0?s:r.ref,a=this._values[o];if(a){let u=a.get(i);if(u)return u}else a=this._values[o]=new Map;a.set(i,n);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,n.setValue(r,{property:o,itemIndex:l}),n}getValue(e,r){let s=this._values[e];if(s)return s.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name \"${s}\" has no value`);return(0,H._)`${e}${s.scopePath}`})}scopeCode(e=this._values,r,s){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name \"${n}\" has no value`);return n.value.code},r,s)}_reduceValues(e,r,s={},n){let o=H.nil;for(let i in e){let a=e[i];if(!a)continue;let c=s[i]=s[i]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,wt.Started);let u=r(l);if(u){let d=this.opts.es5?G.varKinds.var:G.varKinds.const;o=(0,H._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=n?.(l))o=(0,H._)`${o}${u}${this.opts._n}`;else throw new or(l);c.set(l,wt.Completed)})}return o}};G.ValueScope=ir});var S=g(E=>{\"use strict\";Object.defineProperty(E,\"__esModule\",{value:!0});E.or=E.and=E.not=E.CodeGen=E.operators=E.varKinds=E.ValueScopeName=E.ValueScope=E.Scope=E.Name=E.regexpCode=E.stringify=E.getProperty=E.nil=E.strConcat=E.str=E._=void 0;var k=Be(),Z=ar(),fe=Be();Object.defineProperty(E,\"_\",{enumerable:!0,get:function(){return fe._}});Object.defineProperty(E,\"str\",{enumerable:!0,get:function(){return fe.str}});Object.defineProperty(E,\"strConcat\",{enumerable:!0,get:function(){return fe.strConcat}});Object.defineProperty(E,\"nil\",{enumerable:!0,get:function(){return fe.nil}});Object.defineProperty(E,\"getProperty\",{enumerable:!0,get:function(){return fe.getProperty}});Object.defineProperty(E,\"stringify\",{enumerable:!0,get:function(){return fe.stringify}});Object.defineProperty(E,\"regexpCode\",{enumerable:!0,get:function(){return fe.regexpCode}});Object.defineProperty(E,\"Name\",{enumerable:!0,get:function(){return fe.Name}});var kt=ar();Object.defineProperty(E,\"Scope\",{enumerable:!0,get:function(){return kt.Scope}});Object.defineProperty(E,\"ValueScope\",{enumerable:!0,get:function(){return kt.ValueScope}});Object.defineProperty(E,\"ValueScopeName\",{enumerable:!0,get:function(){return kt.ValueScopeName}});Object.defineProperty(E,\"varKinds\",{enumerable:!0,get:function(){return kt.varKinds}});E.operators={GT:new k._Code(\">\"),GTE:new k._Code(\">=\"),LT:new k._Code(\"<\"),LTE:new k._Code(\"<=\"),EQ:new k._Code(\"===\"),NEQ:new k._Code(\"!==\"),NOT:new k._Code(\"!\"),OR:new k._Code(\"||\"),AND:new k._Code(\"&&\"),ADD:new k._Code(\"+\")};var ce=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},cr=class extends ce{constructor(e,r,s){super(),this.varKind=e,this.name=r,this.rhs=s}render({es5:e,_n:r}){let s=e?Z.varKinds.var:this.varKind,n=this.rhs===void 0?\"\":` = ${this.rhs}`;return`${s} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Re(this.rhs,e,r)),this}get names(){return this.rhs instanceof k._CodeOrName?this.rhs.names:{}}},St=class extends ce{constructor(e,r,s){super(),this.lhs=e,this.rhs=r,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof k.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Re(this.rhs,e,r),this}get names(){let e=this.lhs instanceof k.Name?{}:{...this.lhs.names};return Nt(e,this.rhs)}},ur=class extends St{constructor(e,r,s,n){super(e,s,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},lr=class extends ce{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},dr=class extends ce{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:\"\"};`+e}},fr=class extends ce{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},hr=class extends ce{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Re(this.code,e,r),this}get names(){return this.code instanceof k._CodeOrName?this.code.names:{}}},Qe=class extends ce{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,s)=>r+s.render(e),\"\")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let s=e[r].optimizeNodes();Array.isArray(s)?e.splice(r,1,...s):s?e[r]=s:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:s}=this,n=s.length;for(;n--;){let o=s[n];o.optimizeNames(e,r)||(Ci(e,o.names),s.splice(n,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>be(e,r.names),{})}},ue=class extends Qe{render(e){return\"{\"+e._n+super.render(e)+\"}\"+e._n}},pr=class extends Qe{},je=class extends ue{};je.kind=\"else\";var ve=class t extends ue{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+=\"else \"+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let s=r.optimizeNodes();r=this.else=Array.isArray(s)?new je(s):s}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Js(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Re(this.condition,e,r),this}get names(){let e=super.names;return Nt(e,this.condition),this.else&&be(e,this.else.names),e}};ve.kind=\"if\";var we=class extends ue{};we.kind=\"for\";var mr=class extends we{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Re(this.iteration,e,r),this}get names(){return be(super.names,this.iteration.names)}},yr=class extends we{constructor(e,r,s,n){super(),this.varKind=e,this.name=r,this.from=s,this.to=n}render(e){let r=e.es5?Z.varKinds.var:this.varKind,{name:s,from:n,to:o}=this;return`for(${r} ${s}=${n}; ${s}<${o}; ${s}++)`+super.render(e)}get names(){let e=Nt(super.names,this.from);return Nt(e,this.to)}},Pt=class extends we{constructor(e,r,s,n){super(),this.loop=e,this.varKind=r,this.name=s,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Re(this.iterable,e,r),this}get names(){return be(super.names,this.iterable.names)}},Xe=class extends ue{constructor(e,r,s){super(),this.name=e,this.args=r,this.async=s}render(e){return`${this.async?\"async \":\"\"}function ${this.name}(${this.args})`+super.render(e)}};Xe.kind=\"func\";var Ye=class extends Qe{render(e){return\"return \"+super.render(e)}};Ye.kind=\"return\";var _r=class extends ue{render(e){let r=\"try\"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var s,n;return super.optimizeNames(e,r),(s=this.catch)===null||s===void 0||s.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&be(e,this.catch.names),this.finally&&be(e,this.finally.names),e}},Ze=class extends ue{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Ze.kind=\"catch\";var et=class extends ue{render(e){return\"finally\"+super.render(e)}};et.kind=\"finally\";var gr=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`\n`:\"\"},this._extScope=e,this._scope=new Z.Scope({parent:e}),this._nodes=[new pr]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let s=this._extScope.value(e,r);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,s,n){let o=this._scope.toName(r);return s!==void 0&&n&&(this._constants[o.str]=s),this._leafNode(new cr(e,o,s)),o}const(e,r,s){return this._def(Z.varKinds.const,e,r,s)}let(e,r,s){return this._def(Z.varKinds.let,e,r,s)}var(e,r,s){return this._def(Z.varKinds.var,e,r,s)}assign(e,r,s){return this._leafNode(new St(e,r,s))}add(e,r){return this._leafNode(new ur(e,E.operators.ADD,r))}code(e){return typeof e==\"function\"?e():e!==k.nil&&this._leafNode(new hr(e)),this}object(...e){let r=[\"{\"];for(let[s,n]of e)r.length>1&&r.push(\",\"),r.push(s),(s!==n||this.opts.es5)&&(r.push(\":\"),(0,k.addCodeArg)(r,n));return r.push(\"}\"),new k._Code(r)}if(e,r,s){if(this._blockNode(new ve(e)),r&&s)this.code(r).else().code(s).endIf();else if(r)this.code(r).endIf();else if(s)throw new Error('CodeGen: \"else\" body without \"then\" body');return this}elseIf(e){return this._elseNode(new ve(e))}else(){return this._elseNode(new je)}endIf(){return this._endBlockNode(ve,je)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new mr(e),r)}forRange(e,r,s,n,o=this.opts.es5?Z.varKinds.var:Z.varKinds.let){let i=this._scope.toName(e);return this._for(new yr(o,i,r,s),()=>n(i))}forOf(e,r,s,n=Z.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let i=r instanceof k.Name?r:this.var(\"_arr\",r);return this.forRange(\"_i\",0,(0,k._)`${i}.length`,a=>{this.var(o,(0,k._)`${i}[${a}]`),s(o)})}return this._for(new Pt(\"of\",n,o,r),()=>s(o))}forIn(e,r,s,n=this.opts.es5?Z.varKinds.var:Z.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,k._)`Object.keys(${r})`,s);let o=this._scope.toName(e);return this._for(new Pt(\"in\",n,o,r),()=>s(o))}endFor(){return this._endBlockNode(we)}label(e){return this._leafNode(new lr(e))}break(e){return this._leafNode(new dr(e))}return(e){let r=new Ye;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: \"return\" should have one node');return this._endBlockNode(Ye)}try(e,r,s){if(!r&&!s)throw new Error('CodeGen: \"try\" without \"catch\" and \"finally\"');let n=new _r;if(this._blockNode(n),this.code(e),r){let o=this.name(\"e\");this._currNode=n.catch=new Ze(o),r(o)}return s&&(this._currNode=n.finally=new et,this.code(s)),this._endBlockNode(Ze,et)}throw(e){return this._leafNode(new fr(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error(\"CodeGen: not in self-balancing block\");let s=this._nodes.length-r;if(s<0||e!==void 0&&s!==e)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=k.nil,s,n){return this._blockNode(new Xe(e,r,s)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Xe)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let s=this._currNode;if(s instanceof e||r&&s instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block \"${r?`${e.kind}/${r.kind}`:e.kind}\"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof ve))throw new Error('CodeGen: \"else\" without \"if\"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};E.CodeGen=gr;function be(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Nt(t,e){return e instanceof k._CodeOrName?be(t,e.names):t}function Re(t,e,r){if(t instanceof k.Name)return s(t);if(!n(t))return t;return new k._Code(t._items.reduce((o,i)=>(i instanceof k.Name&&(i=s(i)),i instanceof k._Code?o.push(...i._items):o.push(i),o),[]));function s(o){let i=r[o.str];return i===void 0||e[o.str]!==1?o:(delete e[o.str],i)}function n(o){return o instanceof k._Code&&o._items.some(i=>i instanceof k.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function Ci(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Js(t){return typeof t==\"boolean\"||typeof t==\"number\"||t===null?!t:(0,k._)`!${$r(t)}`}E.not=Js;var Mi=Ws(E.operators.AND);function Ai(...t){return t.reduce(Mi)}E.and=Ai;var Di=Ws(E.operators.OR);function Vi(...t){return t.reduce(Di)}E.or=Vi;function Ws(t){return(e,r)=>e===k.nil?r:r===k.nil?e:(0,k._)`${$r(e)} ${t} ${$r(r)}`}function $r(t){return t instanceof k.Name?t:(0,k._)`(${t})`}});var O=g(P=>{\"use strict\";Object.defineProperty(P,\"__esModule\",{value:!0});P.checkStrictMode=P.getErrorPath=P.Type=P.useFunc=P.setEvaluated=P.evaluatedPropsToName=P.mergeEvaluated=P.eachItem=P.unescapeJsonPointer=P.escapeJsonPointer=P.escapeFragment=P.unescapeFragment=P.schemaRefOrVal=P.schemaHasRulesButRef=P.schemaHasRules=P.checkUnknownRules=P.alwaysValidSchema=P.toHash=void 0;var T=S(),zi=Be();function Ui(t){let e={};for(let r of t)e[r]=!0;return e}P.toHash=Ui;function Ki(t,e){return typeof e==\"boolean\"?e:Object.keys(e).length===0?!0:(Xs(t,e),!Ys(e,t.self.RULES.all))}P.alwaysValidSchema=Ki;function Xs(t,e=t.schema){let{opts:r,self:s}=t;if(!r.strictSchema||typeof e==\"boolean\")return;let n=s.RULES.keywords;for(let o in e)n[o]||tn(t,`unknown keyword: \"${o}\"`)}P.checkUnknownRules=Xs;function Ys(t,e){if(typeof t==\"boolean\")return!t;for(let r in t)if(e[r])return!0;return!1}P.schemaHasRules=Ys;function xi(t,e){if(typeof t==\"boolean\")return!t;for(let r in t)if(r!==\"$ref\"&&e.all[r])return!0;return!1}P.schemaHasRulesButRef=xi;function Fi({topSchemaRef:t,schemaPath:e},r,s,n){if(!n){if(typeof r==\"number\"||typeof r==\"boolean\")return r;if(typeof r==\"string\")return(0,T._)`${r}`}return(0,T._)`${t}${e}${(0,T.getProperty)(s)}`}P.schemaRefOrVal=Fi;function Li(t){return Zs(decodeURIComponent(t))}P.unescapeFragment=Li;function Hi(t){return encodeURIComponent(wr(t))}P.escapeFragment=Hi;function wr(t){return typeof t==\"number\"?`${t}`:t.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")}P.escapeJsonPointer=wr;function Zs(t){return t.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}P.unescapeJsonPointer=Zs;function Gi(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}P.eachItem=Gi;function Bs({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:s}){return(n,o,i,a)=>{let c=i===void 0?o:i instanceof T.Name?(o instanceof T.Name?t(n,o,i):e(n,o,i),i):o instanceof T.Name?(e(n,i,o),o):r(o,i);return a===T.Name&&!(c instanceof T.Name)?s(n,c):c}}P.mergeEvaluated={props:Bs({mergeNames:(t,e,r)=>t.if((0,T._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,T._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,T._)`${r} || {}`).code((0,T._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,T._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,T._)`${r} || {}`),br(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:en}),items:Bs({mergeNames:(t,e,r)=>t.if((0,T._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,T._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,T._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,T._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var(\"items\",e)})};function en(t,e){if(e===!0)return t.var(\"props\",!0);let r=t.var(\"props\",(0,T._)`{}`);return e!==void 0&&br(t,r,e),r}P.evaluatedPropsToName=en;function br(t,e,r){Object.keys(r).forEach(s=>t.assign((0,T._)`${e}${(0,T.getProperty)(s)}`,!0))}P.setEvaluated=br;var Qs={};function Ji(t,e){return t.scopeValue(\"func\",{ref:e,code:Qs[e.code]||(Qs[e.code]=new zi._Code(e.code))})}P.useFunc=Ji;var vr;(function(t){t[t.Num=0]=\"Num\",t[t.Str=1]=\"Str\"})(vr||(P.Type=vr={}));function Wi(t,e,r){if(t instanceof T.Name){let s=e===vr.Num;return r?s?(0,T._)`\"[\" + ${t} + \"]\"`:(0,T._)`\"['\" + ${t} + \"']\"`:s?(0,T._)`\"/\" + ${t}`:(0,T._)`\"/\" + ${t}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`}return r?(0,T.getProperty)(t).toString():\"/\"+wr(t)}P.getErrorPath=Wi;function tn(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}P.checkStrictMode=tn});var le=g(Er=>{\"use strict\";Object.defineProperty(Er,\"__esModule\",{value:!0});var U=S(),Bi={data:new U.Name(\"data\"),valCxt:new U.Name(\"valCxt\"),instancePath:new U.Name(\"instancePath\"),parentData:new U.Name(\"parentData\"),parentDataProperty:new U.Name(\"parentDataProperty\"),rootData:new U.Name(\"rootData\"),dynamicAnchors:new U.Name(\"dynamicAnchors\"),vErrors:new U.Name(\"vErrors\"),errors:new U.Name(\"errors\"),this:new U.Name(\"this\"),self:new U.Name(\"self\"),scope:new U.Name(\"scope\"),json:new U.Name(\"json\"),jsonPos:new U.Name(\"jsonPos\"),jsonLen:new U.Name(\"jsonLen\"),jsonPart:new U.Name(\"jsonPart\")};Er.default=Bi});var tt=g(K=>{\"use strict\";Object.defineProperty(K,\"__esModule\",{value:!0});K.extendErrors=K.resetErrorsCount=K.reportExtraError=K.reportError=K.keyword$DataError=K.keywordError=void 0;var j=S(),qt=O(),F=le();K.keywordError={message:({keyword:t})=>(0,j.str)`must pass \"${t}\" keyword validation`};K.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,j.str)`\"${t}\" keyword must be ${e} ($data)`:(0,j.str)`\"${t}\" keyword is invalid ($data)`};function Qi(t,e=K.keywordError,r,s){let{it:n}=t,{gen:o,compositeRule:i,allErrors:a}=n,c=nn(t,e,r);s??(i||a)?rn(o,c):sn(n,(0,j._)`[${c}]`)}K.reportError=Qi;function Xi(t,e=K.keywordError,r){let{it:s}=t,{gen:n,compositeRule:o,allErrors:i}=s,a=nn(t,e,r);rn(n,a),o||i||sn(s,F.default.vErrors)}K.reportExtraError=Xi;function Yi(t,e){t.assign(F.default.errors,e),t.if((0,j._)`${F.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,j._)`${F.default.vErrors}.length`,e),()=>t.assign(F.default.vErrors,null)))}K.resetErrorsCount=Yi;function Zi({gen:t,keyword:e,schemaValue:r,data:s,errsCount:n,it:o}){if(n===void 0)throw new Error(\"ajv implementation error\");let i=t.name(\"err\");t.forRange(\"i\",n,F.default.errors,a=>{t.const(i,(0,j._)`${F.default.vErrors}[${a}]`),t.if((0,j._)`${i}.instancePath === undefined`,()=>t.assign((0,j._)`${i}.instancePath`,(0,j.strConcat)(F.default.instancePath,o.errorPath))),t.assign((0,j._)`${i}.schemaPath`,(0,j.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,j._)`${i}.schema`,r),t.assign((0,j._)`${i}.data`,s))})}K.extendErrors=Zi;function rn(t,e){let r=t.const(\"err\",e);t.if((0,j._)`${F.default.vErrors} === null`,()=>t.assign(F.default.vErrors,(0,j._)`[${r}]`),(0,j._)`${F.default.vErrors}.push(${r})`),t.code((0,j._)`${F.default.errors}++`)}function sn(t,e){let{gen:r,validateName:s,schemaEnv:n}=t;n.$async?r.throw((0,j._)`new ${t.ValidationError}(${e})`):(r.assign((0,j._)`${s}.errors`,e),r.return(!1))}var Ee={keyword:new j.Name(\"keyword\"),schemaPath:new j.Name(\"schemaPath\"),params:new j.Name(\"params\"),propertyName:new j.Name(\"propertyName\"),message:new j.Name(\"message\"),schema:new j.Name(\"schema\"),parentSchema:new j.Name(\"parentSchema\")};function nn(t,e,r){let{createErrors:s}=t.it;return s===!1?(0,j._)`{}`:ea(t,e,r)}function ea(t,e,r={}){let{gen:s,it:n}=t,o=[ta(n,r),ra(t,r)];return sa(t,e,o),s.object(...o)}function ta({errorPath:t},{instancePath:e}){let r=e?(0,j.str)`${t}${(0,qt.getErrorPath)(e,qt.Type.Str)}`:t;return[F.default.instancePath,(0,j.strConcat)(F.default.instancePath,r)]}function ra({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:s}){let n=s?e:(0,j.str)`${e}/${t}`;return r&&(n=(0,j.str)`${n}${(0,qt.getErrorPath)(r,qt.Type.Str)}`),[Ee.schemaPath,n]}function sa(t,{params:e,message:r},s){let{keyword:n,data:o,schemaValue:i,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;s.push([Ee.keyword,n],[Ee.params,typeof e==\"function\"?e(t):e||(0,j._)`{}`]),c.messages&&s.push([Ee.message,typeof r==\"function\"?r(t):r]),c.verbose&&s.push([Ee.schema,i],[Ee.parentSchema,(0,j._)`${u}${d}`],[F.default.data,o]),l&&s.push([Ee.propertyName,l])}});var an=g(Ie=>{\"use strict\";Object.defineProperty(Ie,\"__esModule\",{value:!0});Ie.boolOrEmptySchema=Ie.topBoolOrEmptySchema=void 0;var na=tt(),oa=S(),ia=le(),aa={message:\"boolean schema is false\"};function ca(t){let{gen:e,schema:r,validateName:s}=t;r===!1?on(t,!1):typeof r==\"object\"&&r.$async===!0?e.return(ia.default.data):(e.assign((0,oa._)`${s}.errors`,null),e.return(!0))}Ie.topBoolOrEmptySchema=ca;function ua(t,e){let{gen:r,schema:s}=t;s===!1?(r.var(e,!1),on(t)):r.var(e,!0)}Ie.boolOrEmptySchema=ua;function on(t,e){let{gen:r,data:s}=t,n={gen:r,keyword:\"false schema\",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,na.reportError)(n,aa,void 0,e)}});var Sr=g(Te=>{\"use strict\";Object.defineProperty(Te,\"__esModule\",{value:!0});Te.getRules=Te.isJSONType=void 0;var la=[\"string\",\"number\",\"integer\",\"boolean\",\"null\",\"object\",\"array\"],da=new Set(la);function fa(t){return typeof t==\"string\"&&da.has(t)}Te.isJSONType=fa;function ha(){let t={number:{type:\"number\",rules:[]},string:{type:\"string\",rules:[]},array:{type:\"array\",rules:[]},object:{type:\"object\",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Te.getRules=ha});var Pr=g(he=>{\"use strict\";Object.defineProperty(he,\"__esModule\",{value:!0});he.shouldUseRule=he.shouldUseGroup=he.schemaHasRulesForType=void 0;function pa({schema:t,self:e},r){let s=e.RULES.types[r];return s&&s!==!0&&cn(t,s)}he.schemaHasRulesForType=pa;function cn(t,e){return e.rules.some(r=>un(t,r))}he.shouldUseGroup=cn;function un(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(s=>t[s]!==void 0))}he.shouldUseRule=un});var rt=g(x=>{\"use strict\";Object.defineProperty(x,\"__esModule\",{value:!0});x.reportTypeError=x.checkDataTypes=x.checkDataType=x.coerceAndCheckDataType=x.getJSONTypes=x.getSchemaTypes=x.DataType=void 0;var ma=Sr(),ya=Pr(),_a=tt(),b=S(),ln=O(),Ce;(function(t){t[t.Correct=0]=\"Correct\",t[t.Wrong=1]=\"Wrong\"})(Ce||(x.DataType=Ce={}));function ga(t){let e=dn(t.type);if(e.includes(\"null\")){if(t.nullable===!1)throw new Error(\"type: null contradicts nullable: false\")}else{if(!e.length&&t.nullable!==void 0)throw new Error('\"nullable\" cannot be used without \"type\"');t.nullable===!0&&e.push(\"null\")}return e}x.getSchemaTypes=ga;function dn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(ma.isJSONType))return e;throw new Error(\"type must be JSONType or JSONType[]: \"+e.join(\",\"))}x.getJSONTypes=dn;function $a(t,e){let{gen:r,data:s,opts:n}=t,o=va(e,n.coerceTypes),i=e.length>0&&!(o.length===0&&e.length===1&&(0,ya.schemaHasRulesForType)(t,e[0]));if(i){let a=kr(e,s,n.strictNumbers,Ce.Wrong);r.if(a,()=>{o.length?wa(t,e,o):qr(t)})}return i}x.coerceAndCheckDataType=$a;var fn=new Set([\"string\",\"number\",\"integer\",\"boolean\",\"null\"]);function va(t,e){return e?t.filter(r=>fn.has(r)||e===\"array\"&&r===\"array\"):[]}function wa(t,e,r){let{gen:s,data:n,opts:o}=t,i=s.let(\"dataType\",(0,b._)`typeof ${n}`),a=s.let(\"coerced\",(0,b._)`undefined`);o.coerceTypes===\"array\"&&s.if((0,b._)`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>s.assign(n,(0,b._)`${n}[0]`).assign(i,(0,b._)`typeof ${n}`).if(kr(e,n,o.strictNumbers),()=>s.assign(a,n))),s.if((0,b._)`${a} !== undefined`);for(let l of r)(fn.has(l)||l===\"array\"&&o.coerceTypes===\"array\")&&c(l);s.else(),qr(t),s.endIf(),s.if((0,b._)`${a} !== undefined`,()=>{s.assign(n,a),ba(t,a)});function c(l){switch(l){case\"string\":s.elseIf((0,b._)`${i} == \"number\" || ${i} == \"boolean\"`).assign(a,(0,b._)`\"\" + ${n}`).elseIf((0,b._)`${n} === null`).assign(a,(0,b._)`\"\"`);return;case\"number\":s.elseIf((0,b._)`${i} == \"boolean\" || ${n} === null\n || (${i} == \"string\" && ${n} && ${n} == +${n})`).assign(a,(0,b._)`+${n}`);return;case\"integer\":s.elseIf((0,b._)`${i} === \"boolean\" || ${n} === null\n || (${i} === \"string\" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,b._)`+${n}`);return;case\"boolean\":s.elseIf((0,b._)`${n} === \"false\" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,b._)`${n} === \"true\" || ${n} === 1`).assign(a,!0);return;case\"null\":s.elseIf((0,b._)`${n} === \"\" || ${n} === 0 || ${n} === false`),s.assign(a,null);return;case\"array\":s.elseIf((0,b._)`${i} === \"string\" || ${i} === \"number\"\n || ${i} === \"boolean\" || ${n} === null`).assign(a,(0,b._)`[${n}]`)}}}function ba({gen:t,parentData:e,parentDataProperty:r},s){t.if((0,b._)`${e} !== undefined`,()=>t.assign((0,b._)`${e}[${r}]`,s))}function Nr(t,e,r,s=Ce.Correct){let n=s===Ce.Correct?b.operators.EQ:b.operators.NEQ,o;switch(t){case\"null\":return(0,b._)`${e} ${n} null`;case\"array\":o=(0,b._)`Array.isArray(${e})`;break;case\"object\":o=(0,b._)`${e} && typeof ${e} == \"object\" && !Array.isArray(${e})`;break;case\"integer\":o=i((0,b._)`!(${e} % 1) && !isNaN(${e})`);break;case\"number\":o=i();break;default:return(0,b._)`typeof ${e} ${n} ${t}`}return s===Ce.Correct?o:(0,b.not)(o);function i(a=b.nil){return(0,b.and)((0,b._)`typeof ${e} == \"number\"`,a,r?(0,b._)`isFinite(${e})`:b.nil)}}x.checkDataType=Nr;function kr(t,e,r,s){if(t.length===1)return Nr(t[0],e,r,s);let n,o=(0,ln.toHash)(t);if(o.array&&o.object){let i=(0,b._)`typeof ${e} != \"object\"`;n=o.null?i:(0,b._)`!${e} || ${i}`,delete o.null,delete o.array,delete o.object}else n=b.nil;o.number&&delete o.integer;for(let i in o)n=(0,b.and)(n,Nr(i,e,r,s));return n}x.checkDataTypes=kr;var Ea={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t==\"string\"?(0,b._)`{type: ${t}}`:(0,b._)`{type: ${e}}`};function qr(t){let e=Sa(t);(0,_a.reportError)(e,Ea)}x.reportTypeError=qr;function Sa(t){let{gen:e,data:r,schema:s}=t,n=(0,ln.schemaRefOrVal)(t,s,\"type\");return{gen:e,keyword:\"type\",data:r,schema:s.type,schemaCode:n,schemaValue:n,parentSchema:s,params:{},it:t}}});var pn=g(Ot=>{\"use strict\";Object.defineProperty(Ot,\"__esModule\",{value:!0});Ot.assignDefaults=void 0;var Me=S(),Pa=O();function Na(t,e){let{properties:r,items:s}=t.schema;if(e===\"object\"&&r)for(let n in r)hn(t,n,r[n].default);else e===\"array\"&&Array.isArray(s)&&s.forEach((n,o)=>hn(t,o,n.default))}Ot.assignDefaults=Na;function hn(t,e,r){let{gen:s,compositeRule:n,data:o,opts:i}=t;if(r===void 0)return;let a=(0,Me._)`${o}${(0,Me.getProperty)(e)}`;if(n){(0,Pa.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Me._)`${a} === undefined`;i.useDefaults===\"empty\"&&(c=(0,Me._)`${c} || ${a} === null || ${a} === \"\"`),s.if(c,(0,Me._)`${a} = ${(0,Me.stringify)(r)}`)}});var Q=g(I=>{\"use strict\";Object.defineProperty(I,\"__esModule\",{value:!0});I.validateUnion=I.validateArray=I.usePattern=I.callValidateCode=I.schemaProperties=I.allSchemaProperties=I.noPropertyInData=I.propertyInData=I.isOwnProperty=I.hasPropFunc=I.reportMissingProp=I.checkMissingProp=I.checkReportMissingProp=void 0;var M=S(),Or=O(),pe=le(),ka=O();function qa(t,e){let{gen:r,data:s,it:n}=t;r.if(Rr(r,s,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,M._)`${e}`},!0),t.error()})}I.checkReportMissingProp=qa;function Oa({gen:t,data:e,it:{opts:r}},s,n){return(0,M.or)(...s.map(o=>(0,M.and)(Rr(t,e,o,r.ownProperties),(0,M._)`${n} = ${o}`)))}I.checkMissingProp=Oa;function ja(t,e){t.setParams({missingProperty:e},!0),t.error()}I.reportMissingProp=ja;function mn(t){return t.scopeValue(\"func\",{ref:Object.prototype.hasOwnProperty,code:(0,M._)`Object.prototype.hasOwnProperty`})}I.hasPropFunc=mn;function jr(t,e,r){return(0,M._)`${mn(t)}.call(${e}, ${r})`}I.isOwnProperty=jr;function Ra(t,e,r,s){let n=(0,M._)`${e}${(0,M.getProperty)(r)} !== undefined`;return s?(0,M._)`${n} && ${jr(t,e,r)}`:n}I.propertyInData=Ra;function Rr(t,e,r,s){let n=(0,M._)`${e}${(0,M.getProperty)(r)} === undefined`;return s?(0,M.or)(n,(0,M.not)(jr(t,e,r))):n}I.noPropertyInData=Rr;function yn(t){return t?Object.keys(t).filter(e=>e!==\"__proto__\"):[]}I.allSchemaProperties=yn;function Ia(t,e){return yn(e).filter(r=>!(0,Or.alwaysValidSchema)(t,e[r]))}I.schemaProperties=Ia;function Ta({schemaCode:t,data:e,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:o},it:i},a,c,l){let u=l?(0,M._)`${t}, ${e}, ${s}${n}`:e,d=[[pe.default.instancePath,(0,M.strConcat)(pe.default.instancePath,o)],[pe.default.parentData,i.parentData],[pe.default.parentDataProperty,i.parentDataProperty],[pe.default.rootData,pe.default.rootData]];i.opts.dynamicRef&&d.push([pe.default.dynamicAnchors,pe.default.dynamicAnchors]);let y=(0,M._)`${u}, ${r.object(...d)}`;return c!==M.nil?(0,M._)`${a}.call(${c}, ${y})`:(0,M._)`${a}(${y})`}I.callValidateCode=Ta;var Ca=(0,M._)`new RegExp`;function Ma({gen:t,it:{opts:e}},r){let s=e.unicodeRegExp?\"u\":\"\",{regExp:n}=e.code,o=n(r,s);return t.scopeValue(\"pattern\",{key:o.toString(),ref:o,code:(0,M._)`${n.code===\"new RegExp\"?Ca:(0,ka.useFunc)(t,n)}(${r}, ${s})`})}I.usePattern=Ma;function Aa(t){let{gen:e,data:r,keyword:s,it:n}=t,o=e.name(\"valid\");if(n.allErrors){let a=e.let(\"valid\",!0);return i(()=>e.assign(a,!1)),a}return e.var(o,!0),i(()=>e.break()),o;function i(a){let c=e.const(\"len\",(0,M._)`${r}.length`);e.forRange(\"i\",0,c,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:Or.Type.Num},o),e.if((0,M.not)(o),a)})}}I.validateArray=Aa;function Da(t){let{gen:e,schema:r,keyword:s,it:n}=t;if(!Array.isArray(r))throw new Error(\"ajv implementation error\");if(r.some(c=>(0,Or.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let i=e.let(\"valid\",!1),a=e.name(\"_valid\");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:s,schemaProp:l,compositeRule:!0},a);e.assign(i,(0,M._)`${i} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,M.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}I.validateUnion=Da});var $n=g(ne=>{\"use strict\";Object.defineProperty(ne,\"__esModule\",{value:!0});ne.validateKeywordUsage=ne.validSchemaType=ne.funcKeywordCode=ne.macroKeywordCode=void 0;var L=S(),Se=le(),Va=Q(),za=tt();function Ua(t,e){let{gen:r,keyword:s,schema:n,parentSchema:o,it:i}=t,a=e.macro.call(i.self,n,o,i),c=gn(r,s,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let l=r.name(\"valid\");t.subschema({schema:a,schemaPath:L.nil,errSchemaPath:`${i.errSchemaPath}/${s}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}ne.macroKeywordCode=Ua;function Ka(t,e){var r;let{gen:s,keyword:n,schema:o,parentSchema:i,$data:a,it:c}=t;Fa(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,i,c):e.validate,u=gn(s,n,l),d=s.let(\"valid\");t.block$data(d,y),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function y(){if(e.errors===!1)f(),e.modifying&&_n(t),p(()=>t.error());else{let _=e.async?m():h();e.modifying&&_n(t),p(()=>xa(t,_))}}function m(){let _=s.let(\"ruleErrs\",null);return s.try(()=>f((0,L._)`await `),q=>s.assign(d,!1).if((0,L._)`${q} instanceof ${c.ValidationError}`,()=>s.assign(_,(0,L._)`${q}.errors`),()=>s.throw(q))),_}function h(){let _=(0,L._)`${u}.errors`;return s.assign(_,null),f(L.nil),_}function f(_=e.async?(0,L._)`await `:L.nil){let q=c.opts.passContext?Se.default.this:Se.default.self,N=!(\"compile\"in e&&!a||e.schema===!1);s.assign(d,(0,L._)`${_}${(0,Va.callValidateCode)(t,u,q,N)}`,e.modifying)}function p(_){var q;s.if((0,L.not)((q=e.valid)!==null&&q!==void 0?q:d),_)}}ne.funcKeywordCode=Ka;function _n(t){let{gen:e,data:r,it:s}=t;e.if(s.parentData,()=>e.assign(r,(0,L._)`${s.parentData}[${s.parentDataProperty}]`))}function xa(t,e){let{gen:r}=t;r.if((0,L._)`Array.isArray(${e})`,()=>{r.assign(Se.default.vErrors,(0,L._)`${Se.default.vErrors} === null ? ${e} : ${Se.default.vErrors}.concat(${e})`).assign(Se.default.errors,(0,L._)`${Se.default.vErrors}.length`),(0,za.extendErrors)(t)},()=>t.error())}function Fa({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error(\"async keyword in sync schema\")}function gn(t,e,r){if(r===void 0)throw new Error(`keyword \"${e}\" failed to compile`);return t.scopeValue(\"keyword\",typeof r==\"function\"?{ref:r}:{ref:r,code:(0,L.stringify)(r)})}function La(t,e,r=!1){return!e.length||e.some(s=>s===\"array\"?Array.isArray(t):s===\"object\"?t&&typeof t==\"object\"&&!Array.isArray(t):typeof t==s||r&&typeof t>\"u\")}ne.validSchemaType=La;function Ha({schema:t,opts:e,self:r,errSchemaPath:s},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw new Error(\"ajv implementation error\");let i=n.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${i.join(\",\")}`);if(n.validateSchema&&!n.validateSchema(t[o])){let c=`keyword \"${o}\" value is invalid at path \"${s}\": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema===\"log\")r.logger.error(c);else throw new Error(c)}}ne.validateKeywordUsage=Ha});var wn=g(me=>{\"use strict\";Object.defineProperty(me,\"__esModule\",{value:!0});me.extendSubschemaMode=me.extendSubschemaData=me.getSubschema=void 0;var oe=S(),vn=O();function Ga(t,{keyword:e,schemaProp:r,schema:s,schemaPath:n,errSchemaPath:o,topSchemaRef:i}){if(e!==void 0&&s!==void 0)throw new Error('both \"keyword\" and \"schema\" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,oe._)`${t.schemaPath}${(0,oe.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,oe._)`${t.schemaPath}${(0,oe.getProperty)(e)}${(0,oe.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,vn.escapeFragment)(r)}`}}if(s!==void 0){if(n===void 0||o===void 0||i===void 0)throw new Error('\"schemaPath\", \"errSchemaPath\" and \"topSchemaRef\" are required with \"schema\"');return{schema:s,schemaPath:n,topSchemaRef:i,errSchemaPath:o}}throw new Error('either \"keyword\" or \"schema\" must be passed')}me.getSubschema=Ga;function Ja(t,e,{dataProp:r,dataPropType:s,data:n,dataTypes:o,propertyName:i}){if(n!==void 0&&r!==void 0)throw new Error('both \"data\" and \"dataProp\" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,y=a.let(\"data\",(0,oe._)`${e.data}${(0,oe.getProperty)(r)}`,!0);c(y),t.errorPath=(0,oe.str)`${l}${(0,vn.getErrorPath)(r,s,d.jsPropertySyntax)}`,t.parentDataProperty=(0,oe._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(n!==void 0){let l=n instanceof oe.Name?n:a.let(\"data\",n,!0);c(l),i!==void 0&&(t.propertyName=i)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}me.extendSubschemaData=Ja;function Wa(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:s,createErrors:n,allErrors:o}){s!==void 0&&(t.compositeRule=s),n!==void 0&&(t.createErrors=n),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}me.extendSubschemaMode=Wa});var Ir=g((Pf,bn)=>{\"use strict\";bn.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e==\"object\"&&typeof r==\"object\"){if(e.constructor!==r.constructor)return!1;var s,n,o;if(Array.isArray(e)){if(s=e.length,s!=r.length)return!1;for(n=s;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),s=o.length,s!==Object.keys(r).length)return!1;for(n=s;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=s;n--!==0;){var i=o[n];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var Sn=g((Nf,En)=>{\"use strict\";var ye=En.exports=function(t,e,r){typeof e==\"function\"&&(r=e,e={}),r=e.cb||r;var s=typeof r==\"function\"?r:r.pre||function(){},n=r.post||function(){};jt(e,s,n,t,\"\",t)};ye.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ye.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ye.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ye.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function jt(t,e,r,s,n,o,i,a,c,l){if(s&&typeof s==\"object\"&&!Array.isArray(s)){e(s,n,o,i,a,c,l);for(var u in s){var d=s[u];if(Array.isArray(d)){if(u in ye.arrayKeywords)for(var y=0;y{\"use strict\";Object.defineProperty(J,\"__esModule\",{value:!0});J.getSchemaRefs=J.resolveUrl=J.normalizeId=J._getFullPath=J.getFullPath=J.inlineRef=void 0;var Qa=O(),Xa=Ir(),Ya=Sn(),Za=new Set([\"type\",\"format\",\"pattern\",\"maxLength\",\"minLength\",\"maxProperties\",\"minProperties\",\"maxItems\",\"minItems\",\"maximum\",\"minimum\",\"uniqueItems\",\"multipleOf\",\"required\",\"enum\",\"const\"]);function ec(t,e=!0){return typeof t==\"boolean\"?!0:e===!0?!Tr(t):e?Pn(t)<=e:!1}J.inlineRef=ec;var tc=new Set([\"$ref\",\"$recursiveRef\",\"$recursiveAnchor\",\"$dynamicRef\",\"$dynamicAnchor\"]);function Tr(t){for(let e in t){if(tc.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Tr)||typeof r==\"object\"&&Tr(r))return!0}return!1}function Pn(t){let e=0;for(let r in t){if(r===\"$ref\")return 1/0;if(e++,!Za.has(r)&&(typeof t[r]==\"object\"&&(0,Qa.eachItem)(t[r],s=>e+=Pn(s)),e===1/0))return 1/0}return e}function Nn(t,e=\"\",r){r!==!1&&(e=Ae(e));let s=t.parse(e);return kn(t,s)}J.getFullPath=Nn;function kn(t,e){return t.serialize(e).split(\"#\")[0]+\"#\"}J._getFullPath=kn;var rc=/#\\/?$/;function Ae(t){return t?t.replace(rc,\"\"):\"\"}J.normalizeId=Ae;function sc(t,e,r){return r=Ae(r),t.resolve(e,r)}J.resolveUrl=sc;var nc=/^[a-z_][-a-z0-9._]*$/i;function oc(t,e){if(typeof t==\"boolean\")return{};let{schemaId:r,uriResolver:s}=this.opts,n=Ae(t[r]||e),o={\"\":n},i=Nn(s,n,!1),a={},c=new Set;return Ya(t,{allKeys:!0},(d,y,m,h)=>{if(h===void 0)return;let f=i+y,p=o[h];typeof d[r]==\"string\"&&(p=_.call(this,d[r])),q.call(this,d.$anchor),q.call(this,d.$dynamicAnchor),o[y]=p;function _(N){let C=this.opts.uriResolver.resolve;if(N=Ae(p?C(p,N):N),c.has(N))throw u(N);c.add(N);let w=this.refs[N];return typeof w==\"string\"&&(w=this.refs[w]),typeof w==\"object\"?l(d,w.schema,N):N!==Ae(f)&&(N[0]===\"#\"?(l(d,a[N],N),a[N]=d):this.refs[N]=f),N}function q(N){if(typeof N==\"string\"){if(!nc.test(N))throw new Error(`invalid anchor \"${N}\"`);_.call(this,`#${N}`)}}}),a;function l(d,y,m){if(y!==void 0&&!Xa(d,y))throw u(m)}function u(d){return new Error(`reference \"${d}\" resolves to more than one schema`)}}J.getSchemaRefs=oc});var it=g(_e=>{\"use strict\";Object.defineProperty(_e,\"__esModule\",{value:!0});_e.getData=_e.KeywordCxt=_e.validateFunctionCode=void 0;var In=an(),qn=rt(),Mr=Pr(),Rt=rt(),ic=pn(),ot=$n(),Cr=wn(),$=S(),v=le(),ac=st(),de=O(),nt=tt();function cc(t){if(Mn(t)&&(An(t),Cn(t))){dc(t);return}Tn(t,()=>(0,In.topBoolOrEmptySchema)(t))}_e.validateFunctionCode=cc;function Tn({gen:t,validateName:e,schema:r,schemaEnv:s,opts:n},o){n.code.es5?t.func(e,(0,$._)`${v.default.data}, ${v.default.valCxt}`,s.$async,()=>{t.code((0,$._)`\"use strict\"; ${On(r,n)}`),lc(t,n),t.code(o)}):t.func(e,(0,$._)`${v.default.data}, ${uc(n)}`,s.$async,()=>t.code(On(r,n)).code(o))}function uc(t){return(0,$._)`{${v.default.instancePath}=\"\", ${v.default.parentData}, ${v.default.parentDataProperty}, ${v.default.rootData}=${v.default.data}${t.dynamicRef?(0,$._)`, ${v.default.dynamicAnchors}={}`:$.nil}}={}`}function lc(t,e){t.if(v.default.valCxt,()=>{t.var(v.default.instancePath,(0,$._)`${v.default.valCxt}.${v.default.instancePath}`),t.var(v.default.parentData,(0,$._)`${v.default.valCxt}.${v.default.parentData}`),t.var(v.default.parentDataProperty,(0,$._)`${v.default.valCxt}.${v.default.parentDataProperty}`),t.var(v.default.rootData,(0,$._)`${v.default.valCxt}.${v.default.rootData}`),e.dynamicRef&&t.var(v.default.dynamicAnchors,(0,$._)`${v.default.valCxt}.${v.default.dynamicAnchors}`)},()=>{t.var(v.default.instancePath,(0,$._)`\"\"`),t.var(v.default.parentData,(0,$._)`undefined`),t.var(v.default.parentDataProperty,(0,$._)`undefined`),t.var(v.default.rootData,v.default.data),e.dynamicRef&&t.var(v.default.dynamicAnchors,(0,$._)`{}`)})}function dc(t){let{schema:e,opts:r,gen:s}=t;Tn(t,()=>{r.$comment&&e.$comment&&Vn(t),yc(t),s.let(v.default.vErrors,null),s.let(v.default.errors,0),r.unevaluated&&fc(t),Dn(t),$c(t)})}function fc(t){let{gen:e,validateName:r}=t;t.evaluated=e.const(\"evaluated\",(0,$._)`${r}.evaluated`),e.if((0,$._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,$._)`${t.evaluated}.props`,(0,$._)`undefined`)),e.if((0,$._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,$._)`${t.evaluated}.items`,(0,$._)`undefined`))}function On(t,e){let r=typeof t==\"object\"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,$._)`/*# sourceURL=${r} */`:$.nil}function hc(t,e){if(Mn(t)&&(An(t),Cn(t))){pc(t,e);return}(0,In.boolOrEmptySchema)(t,e)}function Cn({schema:t,self:e}){if(typeof t==\"boolean\")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Mn(t){return typeof t.schema!=\"boolean\"}function pc(t,e){let{schema:r,gen:s,opts:n}=t;n.$comment&&r.$comment&&Vn(t),_c(t),gc(t);let o=s.const(\"_errs\",v.default.errors);Dn(t,o),s.var(e,(0,$._)`${o} === ${v.default.errors}`)}function An(t){(0,de.checkUnknownRules)(t),mc(t)}function Dn(t,e){if(t.opts.jtd)return jn(t,[],!1,e);let r=(0,qn.getSchemaTypes)(t.schema),s=(0,qn.coerceAndCheckDataType)(t,r);jn(t,r,!s,e)}function mc(t){let{schema:e,errSchemaPath:r,opts:s,self:n}=t;e.$ref&&s.ignoreKeywordsWithRef&&(0,de.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path \"${r}\"`)}function yc(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,de.checkStrictMode)(t,\"default is ignored in the schema root\")}function _c(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,ac.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function gc(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error(\"async schema in sync schema\")}function Vn({gen:t,schemaEnv:e,schema:r,errSchemaPath:s,opts:n}){let o=r.$comment;if(n.$comment===!0)t.code((0,$._)`${v.default.self}.logger.log(${o})`);else if(typeof n.$comment==\"function\"){let i=(0,$.str)`${s}/$comment`,a=t.scopeValue(\"root\",{ref:e.root});t.code((0,$._)`${v.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function $c(t){let{gen:e,schemaEnv:r,validateName:s,ValidationError:n,opts:o}=t;r.$async?e.if((0,$._)`${v.default.errors} === 0`,()=>e.return(v.default.data),()=>e.throw((0,$._)`new ${n}(${v.default.vErrors})`)):(e.assign((0,$._)`${s}.errors`,v.default.vErrors),o.unevaluated&&vc(t),e.return((0,$._)`${v.default.errors} === 0`))}function vc({gen:t,evaluated:e,props:r,items:s}){r instanceof $.Name&&t.assign((0,$._)`${e}.props`,r),s instanceof $.Name&&t.assign((0,$._)`${e}.items`,s)}function jn(t,e,r,s){let{gen:n,schema:o,data:i,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,de.schemaHasRulesButRef)(o,u))){n.block(()=>Un(t,\"$ref\",u.all.$ref.definition));return}c.jtd||wc(t,e),n.block(()=>{for(let y of u.rules)d(y);d(u.post)});function d(y){(0,Mr.shouldUseGroup)(o,y)&&(y.type?(n.if((0,Rt.checkDataType)(y.type,i,c.strictNumbers)),Rn(t,y),e.length===1&&e[0]===y.type&&r&&(n.else(),(0,Rt.reportTypeError)(t)),n.endIf()):Rn(t,y),a||n.if((0,$._)`${v.default.errors} === ${s||0}`))}}function Rn(t,e){let{gen:r,schema:s,opts:{useDefaults:n}}=t;n&&(0,ic.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,Mr.shouldUseRule)(s,o)&&Un(t,o.keyword,o.definition,e.type)})}function wc(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(bc(t,e),t.opts.allowUnionTypes||Ec(t,e),Sc(t,t.dataTypes))}function bc(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{zn(t.dataTypes,r)||Ar(t,`type \"${r}\" not allowed by context \"${t.dataTypes.join(\",\")}\"`)}),Nc(t,e)}}function Ec(t,e){e.length>1&&!(e.length===2&&e.includes(\"null\"))&&Ar(t,\"use allowUnionTypes to allow union type keyword\")}function Sc(t,e){let r=t.self.RULES.all;for(let s in r){let n=r[s];if(typeof n==\"object\"&&(0,Mr.shouldUseRule)(t.schema,n)){let{type:o}=n.definition;o.length&&!o.some(i=>Pc(e,i))&&Ar(t,`missing type \"${o.join(\",\")}\" for keyword \"${s}\"`)}}}function Pc(t,e){return t.includes(e)||e===\"number\"&&t.includes(\"integer\")}function zn(t,e){return t.includes(e)||e===\"integer\"&&t.includes(\"number\")}function Nc(t,e){let r=[];for(let s of t.dataTypes)zn(e,s)?r.push(s):e.includes(\"integer\")&&s===\"number\"&&r.push(\"integer\");t.dataTypes=r}function Ar(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at \"${r}\" (strictTypes)`,(0,de.checkStrictMode)(t,e,t.opts.strictTypes)}var It=class{constructor(e,r,s){if((0,ot.validateKeywordUsage)(e,r,s),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=s,this.data=e.data,this.schema=e.schema[s],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,de.schemaRefOrVal)(e,this.schema,s,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const(\"vSchema\",Kn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ot.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${s} value must be ${JSON.stringify(r.schemaType)}`);(\"code\"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const(\"_errs\",v.default.errors))}result(e,r,s){this.failResult((0,$.not)(e),r,s)}failResult(e,r,s){this.gen.if(e),s?s():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,$.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,$._)`${r} !== undefined && (${(0,$.or)(this.invalid$data(),e)})`)}error(e,r,s){if(r){this.setParams(r),this._error(e,s),this.setParams({});return}this._error(e,s)}_error(e,r){(e?nt.reportExtraError:nt.reportError)(this,this.def.error,r)}$dataError(){(0,nt.reportError)(this,this.def.$dataError||nt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add \"trackErrors\" to keyword definition');(0,nt.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,s=$.nil){this.gen.block(()=>{this.check$data(e,s),r()})}check$data(e=$.nil,r=$.nil){if(!this.$data)return;let{gen:s,schemaCode:n,schemaType:o,def:i}=this;s.if((0,$.or)((0,$._)`${n} === undefined`,r)),e!==$.nil&&s.assign(e,!0),(o.length||i.validateSchema)&&(s.elseIf(this.invalid$data()),this.$dataError(),e!==$.nil&&s.assign(e,!1)),s.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:s,def:n,it:o}=this;return(0,$.or)(i(),a());function i(){if(s.length){if(!(r instanceof $.Name))throw new Error(\"ajv implementation error\");let c=Array.isArray(s)?s:[s];return(0,$._)`${(0,Rt.checkDataTypes)(c,r,o.opts.strictNumbers,Rt.DataType.Wrong)}`}return $.nil}function a(){if(n.validateSchema){let c=e.scopeValue(\"validate$data\",{ref:n.validateSchema});return(0,$._)`!${c}(${r})`}return $.nil}}subschema(e,r){let s=(0,Cr.getSubschema)(this.it,e);(0,Cr.extendSubschemaData)(s,this.it,e),(0,Cr.extendSubschemaMode)(s,e);let n={...this.it,...s,items:void 0,props:void 0};return hc(n,r),n}mergeEvaluated(e,r){let{it:s,gen:n}=this;s.opts.unevaluated&&(s.props!==!0&&e.props!==void 0&&(s.props=de.mergeEvaluated.props(n,e.props,s.props,r)),s.items!==!0&&e.items!==void 0&&(s.items=de.mergeEvaluated.items(n,e.items,s.items,r)))}mergeValidEvaluated(e,r){let{it:s,gen:n}=this;if(s.opts.unevaluated&&(s.props!==!0||s.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,$.Name)),!0}};_e.KeywordCxt=It;function Un(t,e,r,s){let n=new It(t,r,e);\"code\"in r?r.code(n,s):n.$data&&r.validate?(0,ot.funcKeywordCode)(n,r):\"macro\"in r?(0,ot.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,ot.funcKeywordCode)(n,r)}var kc=/^\\/(?:[^~]|~0|~1)*$/,qc=/^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/;function Kn(t,{dataLevel:e,dataNames:r,dataPathArr:s}){let n,o;if(t===\"\")return v.default.rootData;if(t[0]===\"/\"){if(!kc.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,o=v.default.rootData}else{let l=qc.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(n=l[2],n===\"#\"){if(u>=e)throw new Error(c(\"property/index\",u));return s[e-u]}if(u>e)throw new Error(c(\"data\",u));if(o=r[e-u],!n)return o}let i=o,a=n.split(\"/\");for(let l of a)l&&(o=(0,$._)`${o}${(0,$.getProperty)((0,de.unescapeJsonPointer)(l))}`,i=(0,$._)`${i} && ${o}`);return i;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}_e.getData=Kn});var Tt=g(Vr=>{\"use strict\";Object.defineProperty(Vr,\"__esModule\",{value:!0});var Dr=class extends Error{constructor(e){super(\"validation failed\"),this.errors=e,this.ajv=this.validation=!0}};Vr.default=Dr});var at=g(Kr=>{\"use strict\";Object.defineProperty(Kr,\"__esModule\",{value:!0});var zr=st(),Ur=class extends Error{constructor(e,r,s,n){super(n||`can't resolve reference ${s} from id ${r}`),this.missingRef=(0,zr.resolveUrl)(e,r,s),this.missingSchema=(0,zr.normalizeId)((0,zr.getFullPath)(e,this.missingRef))}};Kr.default=Ur});var Mt=g(X=>{\"use strict\";Object.defineProperty(X,\"__esModule\",{value:!0});X.resolveSchema=X.getCompilingSchema=X.resolveRef=X.compileSchema=X.SchemaEnv=void 0;var ee=S(),Oc=Tt(),Pe=le(),te=st(),xn=O(),jc=it(),De=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let s;typeof e.schema==\"object\"&&(s=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,te.normalizeId)(s?.[e.schemaId||\"$id\"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=s?.$async,this.refs={}}};X.SchemaEnv=De;function Fr(t){let e=Fn.call(this,t);if(e)return e;let r=(0,te.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:s,lines:n}=this.opts.code,{ownProperties:o}=this.opts,i=new ee.CodeGen(this.scope,{es5:s,lines:n,ownProperties:o}),a;t.$async&&(a=i.scopeValue(\"Error\",{ref:Oc.default,code:(0,ee._)`require(\"ajv/dist/runtime/validation_error\").default`}));let c=i.scopeName(\"validate\");t.validateName=c;let l={gen:i,allErrors:this.opts.allErrors,data:Pe.default.data,parentData:Pe.default.parentData,parentDataProperty:Pe.default.parentDataProperty,dataNames:[Pe.default.data],dataPathArr:[ee.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue(\"schema\",this.opts.code.source===!0?{ref:t.schema,code:(0,ee.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:ee.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?\"\":\"#\"),errorPath:(0,ee._)`\"\"`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,jc.validateFunctionCode)(l),i.optimize(this.opts.code.optimize);let d=i.toString();u=`${i.scopeRefs(Pe.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let m=new Function(`${Pe.default.self}`,`${Pe.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=t.schema,m.schemaEnv=t,t.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:h,items:f}=l;m.evaluated={props:h instanceof ee.Name?void 0:h,items:f instanceof ee.Name?void 0:f,dynamicProps:h instanceof ee.Name,dynamicItems:f instanceof ee.Name},m.source&&(m.source.evaluated=(0,ee.stringify)(m.evaluated))}return t.validate=m,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error(\"Error compiling schema, function code:\",u),d}finally{this._compilations.delete(t)}}X.compileSchema=Fr;function Rc(t,e,r){var s;r=(0,te.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let o=Cc.call(this,t,r);if(o===void 0){let i=(s=t.localRefs)===null||s===void 0?void 0:s[r],{schemaId:a}=this.opts;i&&(o=new De({schema:i,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=Ic.call(this,o)}X.resolveRef=Rc;function Ic(t){return(0,te.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Fr.call(this,t)}function Fn(t){for(let e of this._compilations)if(Tc(e,t))return e}X.getCompilingSchema=Fn;function Tc(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Cc(t,e){let r;for(;typeof(r=this.refs[e])==\"string\";)e=r;return r||this.schemas[e]||Ct.call(this,t,e)}function Ct(t,e){let r=this.opts.uriResolver.parse(e),s=(0,te._getFullPath)(this.opts.uriResolver,r),n=(0,te.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&s===n)return xr.call(this,r,t);let o=(0,te.normalizeId)(s),i=this.refs[o]||this.schemas[o];if(typeof i==\"string\"){let a=Ct.call(this,t,i);return typeof a?.schema!=\"object\"?void 0:xr.call(this,r,a)}if(typeof i?.schema==\"object\"){if(i.validate||Fr.call(this,i),o===(0,te.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,l=a[c];return l&&(n=(0,te.resolveUrl)(this.opts.uriResolver,n,l)),new De({schema:a,schemaId:c,root:t,baseId:n})}return xr.call(this,r,i)}}X.resolveSchema=Ct;var Mc=new Set([\"properties\",\"patternProperties\",\"enum\",\"dependencies\",\"definitions\"]);function xr(t,{baseId:e,schema:r,root:s}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!==\"/\")return;for(let a of t.fragment.slice(1).split(\"/\")){if(typeof r==\"boolean\")return;let c=r[(0,xn.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r==\"object\"&&r[this.opts.schemaId];!Mc.has(a)&&l&&(e=(0,te.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!=\"boolean\"&&r.$ref&&!(0,xn.schemaHasRulesButRef)(r,this.RULES)){let a=(0,te.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=Ct.call(this,s,a)}let{schemaId:i}=this.opts;if(o=o||new De({schema:r,schemaId:i,root:s,baseId:e}),o.schema!==o.root.schema)return o}});var Ln=g((If,Ac)=>{Ac.exports={$id:\"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",description:\"Meta-schema for $data reference (JSON AnySchema extension proposal)\",type:\"object\",required:[\"$data\"],properties:{$data:{type:\"string\",anyOf:[{format:\"relative-json-pointer\"},{format:\"json-pointer\"}]}},additionalProperties:!1}});var Gr=g((Tf,Qn)=>{\"use strict\";var Dc=RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu),Gn=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u),Lr=RegExp.prototype.test.bind(/^[\\da-f]{2}$/iu),Jn=RegExp.prototype.test.bind(/^[\\da-z\\-._~]$/iu),Vc=RegExp.prototype.test.bind(/^[\\da-z\\-._~!$&'()*+,;=:@/]$/iu);function Hr(t){let e=\"\",r=0,s=0;for(s=0;s=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return\"\";e+=t[s];break}for(s+=1;s=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return\"\";e+=t[s]}return e}var zc=RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u);function Hn(t){return t.length=0,!0}function Uc(t,e,r){if(t.length){let s=Hr(t);if(s!==\"\")e.push(s);else return r.error=!0,!1;t.length=0}return!0}function Kc(t){let e=0,r={error:!1,address:\"\",zone:\"\"},s=[],n=[],o=!1,i=!1,a=Uc;for(let c=0;c7){r.error=!0;break}c>0&&t[c-1]===\":\"&&(o=!0),s.push(\":\");continue}else if(l===\"%\"){if(!a(n,s,r))break;a=Hn}else{n.push(l);continue}}return n.length&&(a===Hn?r.zone=n.join(\"\"):i?s.push(n.join(\"\")):s.push(Hr(n))),r.address=s.join(\"\"),r}function Wn(t){if(xc(t,\":\")<2)return{host:t,isIPV6:!1};let e=Kc(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,s=e.address;return e.zone&&(r+=\"%\"+e.zone,s+=\"%25\"+e.zone),{host:r,isIPV6:!0,escapedHost:s}}}function xc(t,e){let r=0;for(let s=0;sLc[s])}function Jc(t,e=!1){if(t.indexOf(\"%\")===-1)return t;let r=\"\";for(let s=0;s{\"use strict\";var{isUUID:Xc}=Gr(),Yc=/([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)/iu,Zc=[\"http\",\"https\",\"ws\",\"wss\",\"urn\",\"urn:uuid\"];function eu(t){return Zc.indexOf(t)!==-1}function Jr(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]===\"w\"||t.scheme[0]===\"W\")&&(t.scheme[1]===\"s\"||t.scheme[1]===\"S\")&&(t.scheme[2]===\"s\"||t.scheme[2]===\"S\"):!1}function Xn(t){return t.host||(t.error=t.error||\"HTTP URIs must have a host.\"),t}function Yn(t){let e=String(t.scheme).toLowerCase()===\"https\";return(t.port===(e?443:80)||t.port===\"\")&&(t.port=void 0),t.path||(t.path=\"/\"),t}function tu(t){return t.secure=Jr(t),t.resourceName=(t.path||\"/\")+(t.query?\"?\"+t.query:\"\"),t.path=void 0,t.query=void 0,t}function ru(t){if((t.port===(Jr(t)?443:80)||t.port===\"\")&&(t.port=void 0),typeof t.secure==\"boolean\"&&(t.scheme=t.secure?\"wss\":\"ws\",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split(\"?\");t.path=e&&e!==\"/\"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function su(t,e){if(!t.path)return t.error=\"URN can not be parsed\",t;let r=t.path.match(Yc);if(r){let s=e.scheme||t.scheme||\"urn\";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${s}:${e.nid||t.nid}`,o=Wr(n);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||\"URN can not be parsed.\";return t}function nu(t,e){if(t.nid===void 0)throw new Error(\"URN without nid cannot be serialized\");let r=e.scheme||t.scheme||\"urn\",s=t.nid.toLowerCase(),n=`${r}:${e.nid||s}`,o=Wr(n);o&&(t=o.serialize(t,e));let i=t,a=t.nss;return i.path=`${s||e.nid}:${a}`,e.skipEscape=!0,i}function ou(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Xc(r.uuid))&&(r.error=r.error||\"UUID is not valid.\"),r}function iu(t){let e=t;return e.nss=(t.uuid||\"\").toLowerCase(),e}var Zn={scheme:\"http\",domainHost:!0,parse:Xn,serialize:Yn},au={scheme:\"https\",domainHost:Zn.domainHost,parse:Xn,serialize:Yn},At={scheme:\"ws\",domainHost:!0,parse:tu,serialize:ru},cu={scheme:\"wss\",domainHost:At.domainHost,parse:At.parse,serialize:At.serialize},uu={scheme:\"urn\",parse:su,serialize:nu,skipNormalize:!0},lu={scheme:\"urn:uuid\",parse:ou,serialize:iu,skipNormalize:!0},Dt={http:Zn,https:au,ws:At,wss:cu,urn:uu,\"urn:uuid\":lu};Object.setPrototypeOf(Dt,null);function Wr(t){return t&&(Dt[t]||Dt[t.toLowerCase()])||void 0}eo.exports={wsIsSecure:Jr,SCHEMES:Dt,isValidSchemeName:eu,getSchemeHandler:Wr}});var ao=g((Mf,Vt)=>{\"use strict\";var{normalizeIPv6:du,removeDotSegments:ct,recomposeAuthority:fu,normalizePercentEncoding:hu,normalizePathEncoding:pu,escapePreservingEscapes:mu,reescapeHostDelimiters:yu,isIPv4:_u,nonSimpleDomain:gu}=Gr(),{SCHEMES:$u,getSchemeHandler:so}=to();function vu(t,e){return typeof t==\"string\"?t=Pu(t,e):typeof t==\"object\"&&(t=Ve(Ne(t,e),e)),t}function wu(t,e,r){let s=r?Object.assign({scheme:\"null\"},r):{scheme:\"null\"},n=no(Ve(t,s),Ve(e,s),s,!0);return s.skipEscape=!0,Ne(n,s)}function no(t,e,r,s){let n={};return s||(t=Ve(Ne(t,r),r),e=Ve(Ne(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=ct(e.path||\"\"),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=ct(e.path||\"\"),n.query=e.query):(e.path?(e.path[0]===\"/\"?n.path=ct(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path=\"/\"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf(\"/\")+1)+e.path:n.path=e.path,n.path=ct(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function bu(t,e,r){let s=ro(t,r),n=ro(e,r);return s!==void 0&&n!==void 0&&s.toLowerCase()===n.toLowerCase()}function Ne(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:\"\"},s=Object.assign({},e),n=[],o=so(s.scheme||r.scheme);o&&o.serialize&&o.serialize(r,s),r.path!==void 0&&(s.skipEscape?r.path=hu(r.path):(r.path=mu(r.path),r.scheme!==void 0&&(r.path=r.path.split(\"%3A\").join(\":\")))),s.reference!==\"suffix\"&&r.scheme&&n.push(r.scheme,\":\");let i=fu(r);if(i!==void 0&&(s.reference!==\"suffix\"&&n.push(\"//\"),n.push(i),r.path&&r.path[0]!==\"/\"&&n.push(\"/\")),r.path!==void 0){let a=r.path;!s.absolutePath&&(!o||!o.absolutePath)&&(a=ct(a)),i===void 0&&a[0]===\"/\"&&a[1]===\"/\"&&(a=\"/%2F\"+a.slice(2)),n.push(a)}return r.query!==void 0&&n.push(\"?\",r.query),r.fragment!==void 0&&n.push(\"#\",r.fragment),n.join(\"\")}var Eu=/^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u;function Su(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!==\"/\")return'URI path must start with \"/\" when authority is present.';if(typeof t.port==\"number\"&&(t.port<0||t.port>65535))return\"URI port is malformed.\"}function oo(t,e){let r=Object.assign({},e),s={scheme:void 0,userinfo:void 0,host:\"\",port:void 0,path:\"\",query:void 0,fragment:void 0},n=!1,o=!1;r.reference===\"suffix\"&&(r.scheme?t=r.scheme+\":\"+t:t=\"//\"+t);let i=t.match(Eu);if(i){s.scheme=i[1],s.userinfo=i[3],s.host=i[4],s.port=parseInt(i[5],10),s.path=i[6]||\"\",s.query=i[7],s.fragment=i[8],isNaN(s.port)&&(s.port=i[5]);let a=Su(s,i);if(a!==void 0&&(s.error=s.error||a,n=!0),s.host)if(_u(s.host)===!1){let u=du(s.host);s.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;s.scheme===void 0&&s.userinfo===void 0&&s.host===void 0&&s.port===void 0&&s.query===void 0&&!s.path?s.reference=\"same-document\":s.scheme===void 0?s.reference=\"relative\":s.fragment===void 0?s.reference=\"absolute\":s.reference=\"uri\",r.reference&&r.reference!==\"suffix\"&&r.reference!==s.reference&&(s.error=s.error||\"URI is not a \"+r.reference+\" reference.\");let c=so(r.scheme||s.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&s.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&gu(s.host))try{s.host=new URL(\"http://\"+s.host).hostname}catch(l){s.error=s.error||\"Host's domain name can not be converted to ASCII: \"+l}if((!c||c&&!c.skipNormalize)&&(t.indexOf(\"%\")!==-1&&(s.scheme!==void 0&&(s.scheme=unescape(s.scheme)),s.host!==void 0&&(s.host=yu(unescape(s.host),o))),s.path&&(s.path=pu(s.path)),s.fragment))try{s.fragment=encodeURI(decodeURIComponent(s.fragment))}catch{s.error=s.error||\"URI malformed\"}c&&c.parse&&c.parse(s,r)}else s.error=s.error||\"URI can not be parsed.\";return{parsed:s,malformedAuthorityOrPort:n}}function Ve(t,e){return oo(t,e).parsed}function Pu(t,e){return io(t,e).normalized}function io(t,e){let{parsed:r,malformedAuthorityOrPort:s}=oo(t,e);return{normalized:s?t:Ne(r,e),malformedAuthorityOrPort:s}}function ro(t,e){if(typeof t==\"string\"){let{normalized:r,malformedAuthorityOrPort:s}=io(t,e);return s?void 0:r}if(typeof t==\"object\")return Ne(t,e)}var Br={SCHEMES:$u,normalize:vu,resolve:wu,resolveComponent:no,equal:bu,serialize:Ne,parse:Ve};Vt.exports=Br;Vt.exports.default=Br;Vt.exports.fastUri=Br});var uo=g(Qr=>{\"use strict\";Object.defineProperty(Qr,\"__esModule\",{value:!0});var co=ao();co.code='require(\"ajv/dist/runtime/uri\").default';Qr.default=co});var go=g(V=>{\"use strict\";Object.defineProperty(V,\"__esModule\",{value:!0});V.CodeGen=V.Name=V.nil=V.stringify=V.str=V._=V.KeywordCxt=void 0;var Nu=it();Object.defineProperty(V,\"KeywordCxt\",{enumerable:!0,get:function(){return Nu.KeywordCxt}});var ze=S();Object.defineProperty(V,\"_\",{enumerable:!0,get:function(){return ze._}});Object.defineProperty(V,\"str\",{enumerable:!0,get:function(){return ze.str}});Object.defineProperty(V,\"stringify\",{enumerable:!0,get:function(){return ze.stringify}});Object.defineProperty(V,\"nil\",{enumerable:!0,get:function(){return ze.nil}});Object.defineProperty(V,\"Name\",{enumerable:!0,get:function(){return ze.Name}});Object.defineProperty(V,\"CodeGen\",{enumerable:!0,get:function(){return ze.CodeGen}});var ku=Tt(),mo=at(),qu=Sr(),ut=Mt(),Ou=S(),lt=st(),zt=rt(),Yr=O(),lo=Ln(),ju=uo(),yo=(t,e)=>new RegExp(t,e);yo.code=\"new RegExp\";var Ru=[\"removeAdditional\",\"useDefaults\",\"coerceTypes\"],Iu=new Set([\"validate\",\"serialize\",\"parse\",\"wrapper\",\"root\",\"schema\",\"keyword\",\"pattern\",\"formats\",\"validate$data\",\"func\",\"obj\",\"Error\"]),Tu={errorDataPath:\"\",format:\"`validateFormats: false` can be used instead.\",nullable:'\"nullable\" keyword is supported by default.',jsonPointers:\"Deprecated jsPropertySyntax can be used instead.\",extendRefs:\"Deprecated ignoreKeywordsWithRef can be used instead.\",missingRefs:\"Pass empty schema with $id that should be ignored to ajv.addSchema.\",processCode:\"Use option `code: {process: (code, schemaEnv: object) => string}`\",sourceCode:\"Use option `code: {source: true}`\",strictDefaults:\"It is default now, see option `strict`.\",strictKeywords:\"It is default now, see option `strict`.\",uniqueItems:'\"uniqueItems\" keyword is always validated.',unknownFormats:\"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).\",cache:\"Map is used as cache, schema object as key.\",serialize:\"Map is used as cache, schema object as key.\",ajvErrors:\"It is default now.\"},Cu={ignoreKeywordsWithRef:\"\",jsPropertySyntax:\"\",unicode:'\"minLength\"/\"maxLength\" account for unicode characters by default.'},fo=200;function Mu(t){var e,r,s,n,o,i,a,c,l,u,d,y,m,h,f,p,_,q,N,C,w,se,ae,er,tr;let Ge=t.strict,rr=(e=t.code)===null||e===void 0?void 0:e.optimize,Fs=rr===!0||rr===void 0?1:rr||0,Ls=(s=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&s!==void 0?s:yo,Si=(n=t.uriResolver)!==null&&n!==void 0?n:ju.default;return{strictSchema:(i=(o=t.strictSchema)!==null&&o!==void 0?o:Ge)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Ge)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:Ge)!==null&&u!==void 0?u:\"log\",strictTuples:(y=(d=t.strictTuples)!==null&&d!==void 0?d:Ge)!==null&&y!==void 0?y:\"log\",strictRequired:(h=(m=t.strictRequired)!==null&&m!==void 0?m:Ge)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:Fs,regExp:Ls}:{optimize:Fs,regExp:Ls},loopRequired:(f=t.loopRequired)!==null&&f!==void 0?f:fo,loopEnum:(p=t.loopEnum)!==null&&p!==void 0?p:fo,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(q=t.messages)!==null&&q!==void 0?q:!0,inlineRefs:(N=t.inlineRefs)!==null&&N!==void 0?N:!0,schemaId:(C=t.schemaId)!==null&&C!==void 0?C:\"$id\",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(se=t.validateSchema)!==null&&se!==void 0?se:!0,validateFormats:(ae=t.validateFormats)!==null&&ae!==void 0?ae:!0,unicodeRegExp:(er=t.unicodeRegExp)!==null&&er!==void 0?er:!0,int32range:(tr=t.int32range)!==null&&tr!==void 0?tr:!0,uriResolver:Si}}var dt=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Mu(e)};let{es5:r,lines:s}=this.opts.code;this.scope=new Ou.ValueScope({scope:{},prefixes:Iu,es5:r,lines:s}),this.logger=Ku(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,qu.getRules)(),ho.call(this,Tu,e,\"NOT SUPPORTED\"),ho.call(this,Cu,e,\"DEPRECATED\",\"warn\"),this._metaOpts=zu.call(this),e.formats&&Du.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Vu.call(this,e.keywords),typeof e.meta==\"object\"&&this.addMetaSchema(e.meta),Au.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword(\"$async\")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:s}=this.opts,n=lo;s===\"id\"&&(n={...lo},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[s],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e==\"object\"?e[r]||e:void 0}validate(e,r){let s;if(typeof e==\"string\"){if(s=this.getSchema(e),!s)throw new Error(`no schema with key or ref \"${e}\"`)}else s=this.compile(e);let n=s(r);return\"$async\"in s||(this.errors=s.errors),n}compile(e,r){let s=this._addSchema(e,r);return s.validate||this._compileSchemaEnv(s)}compileAsync(e,r){if(typeof this.opts.loadSchema!=\"function\")throw new Error(\"options.loadSchema should be a function\");let{loadSchema:s}=this.opts;return n.call(this,e,r);async function n(u,d){await o.call(this,u.$schema);let y=this._addSchema(u,d);return y.validate||i.call(this,y)}async function o(u){u&&!this.getSchema(u)&&await n.call(this,{$ref:u},!0)}async function i(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof mo.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),i.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=s(u))}finally{delete this._loading[u]}}}addSchema(e,r,s,n=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,s,n);return this}let o;if(typeof e==\"object\"){let{schemaId:i}=this.opts;if(o=e[i],o!==void 0&&typeof o!=\"string\")throw new Error(`schema ${i} must be string`)}return r=(0,lt.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,s,r,n,!0),this}addMetaSchema(e,r,s=this.opts.validateSchema){return this.addSchema(e,r,!0,s),this}validateSchema(e,r){if(typeof e==\"boolean\")return!0;let s;if(s=e.$schema,s!==void 0&&typeof s!=\"string\")throw new Error(\"$schema must be a string\");if(s=s||this.opts.defaultMeta||this.defaultMeta(),!s)return this.logger.warn(\"meta-schema not available\"),this.errors=null,!0;let n=this.validate(s,e);if(!n&&r){let o=\"schema is invalid: \"+this.errorsText();if(this.opts.validateSchema===\"log\")this.logger.error(o);else throw new Error(o)}return n}getSchema(e){let r;for(;typeof(r=po.call(this,e))==\"string\";)e=r;if(r===void 0){let{schemaId:s}=this.opts,n=new ut.SchemaEnv({schema:{},schemaId:s});if(r=ut.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case\"undefined\":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case\"string\":{let r=po.call(this,e);return typeof r==\"object\"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case\"object\":{let r=e;this._cache.delete(r);let s=e[this.opts.schemaId];return s&&(s=(0,lt.normalizeId)(s),delete this.schemas[s],delete this.refs[s]),this}default:throw new Error(\"ajv.removeSchema: invalid parameter\")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let s;if(typeof e==\"string\")s=e,typeof r==\"object\"&&(this.logger.warn(\"these parameters are deprecated, see docs for addKeyword\"),r.keyword=s);else if(typeof e==\"object\"&&r===void 0){if(r=e,s=r.keyword,Array.isArray(s)&&!s.length)throw new Error(\"addKeywords: keyword must be string or non-empty array\")}else throw new Error(\"invalid addKeywords parameters\");if(Fu.call(this,s,r),!r)return(0,Yr.eachItem)(s,o=>Xr.call(this,o)),this;Hu.call(this,r);let n={...r,type:(0,zt.getJSONTypes)(r.type),schemaType:(0,zt.getJSONTypes)(r.schemaType)};return(0,Yr.eachItem)(s,n.type.length===0?o=>Xr.call(this,o,n):o=>n.type.forEach(i=>Xr.call(this,o,n,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r==\"object\"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let s of r.rules){let n=s.rules.findIndex(o=>o.keyword===e);n>=0&&s.rules.splice(n,1)}return this}addFormat(e,r){return typeof r==\"string\"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=\", \",dataVar:s=\"data\"}={}){return!e||e.length===0?\"No errors\":e.map(n=>`${s}${n.instancePath} ${n.message}`).reduce((n,o)=>n+r+o)}$dataMetaSchema(e,r){let s=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let o=n.split(\"/\").slice(1),i=e;for(let a of o)i=i[a];for(let a in s){let c=s[a];if(typeof c!=\"object\")continue;let{$data:l}=c.definition,u=i[a];l&&u&&(i[a]=_o(u))}}return e}_removeAllSchemas(e,r){for(let s in e){let n=e[s];(!r||r.test(s))&&(typeof n==\"string\"?delete e[s]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[s]))}}_addSchema(e,r,s,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e==\"object\")i=e[a];else{if(this.opts.jtd)throw new Error(\"schema must be object\");if(typeof e!=\"boolean\")throw new Error(\"schema must be object or boolean\")}let c=this._cache.get(e);if(c!==void 0)return c;s=(0,lt.normalizeId)(i||s);let l=lt.getSchemaRefs.call(this,e,s);return c=new ut.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:s,localRefs:l}),this._cache.set(c.schema,c),o&&!s.startsWith(\"#\")&&(s&&this._checkUnique(s),this.refs[s]=c),n&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id \"${e}\" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):ut.compileSchema.call(this,e),!e.validate)throw new Error(\"ajv implementation error\");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{ut.compileSchema.call(this,e)}finally{this.opts=r}}};dt.ValidationError=ku.default;dt.MissingRefError=mo.default;V.default=dt;function ho(t,e,r,s=\"error\"){for(let n in t){let o=n;o in e&&this.logger[s](`${r}: option ${n}. ${t[o]}`)}}function po(t){return t=(0,lt.normalizeId)(t),this.schemas[t]||this.refs[t]}function Au(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Du(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Vu(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn(\"keywords option as map is deprecated, pass array\");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function zu(){let t={...this.opts};for(let e of Ru)delete t[e];return t}var Uu={log(){},warn(){},error(){}};function Ku(t){if(t===!1)return Uu;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error(\"logger must implement log, warn and error methods\")}var xu=/^[a-z_$][a-z0-9_$:-]*$/i;function Fu(t,e){let{RULES:r}=this;if((0,Yr.eachItem)(t,s=>{if(r.keywords[s])throw new Error(`Keyword ${s} is already defined`);if(!xu.test(s))throw new Error(`Keyword ${s} has invalid name`)}),!!e&&e.$data&&!(\"code\"in e||\"validate\"in e))throw new Error('$data keyword must have \"code\" or \"validate\" function')}function Xr(t,e,r){var s;let n=e?.post;if(r&&n)throw new Error('keyword with \"post\" flag cannot have \"type\"');let{RULES:o}=this,i=n?o.post:o.rules.find(({type:c})=>c===r);if(i||(i={type:r,rules:[]},o.rules.push(i)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,zt.getJSONTypes)(e.type),schemaType:(0,zt.getJSONTypes)(e.schemaType)}};e.before?Lu.call(this,i,a,e.before):i.rules.push(a),o.all[t]=a,(s=e.implements)===null||s===void 0||s.forEach(c=>this.addKeyword(c))}function Lu(t,e,r){let s=t.rules.findIndex(n=>n.keyword===r);s>=0?t.rules.splice(s,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Hu(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=_o(e)),t.validateSchema=this.compile(e,!0))}var Gu={$ref:\"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\"};function _o(t){return{anyOf:[t,Gu]}}});var $o=g(Zr=>{\"use strict\";Object.defineProperty(Zr,\"__esModule\",{value:!0});var Ju={keyword:\"id\",code(){throw new Error('NOT SUPPORTED: keyword \"id\", use \"$id\" for schema ID')}};Zr.default=Ju});var Eo=g(ke=>{\"use strict\";Object.defineProperty(ke,\"__esModule\",{value:!0});ke.callRef=ke.getValidate=void 0;var Wu=at(),vo=Q(),W=S(),Ue=le(),wo=Mt(),Ut=O(),Bu={keyword:\"$ref\",schemaType:\"string\",code(t){let{gen:e,schema:r,it:s}=t,{baseId:n,schemaEnv:o,validateName:i,opts:a,self:c}=s,{root:l}=o;if((r===\"#\"||r===\"#/\")&&n===l.baseId)return d();let u=wo.resolveRef.call(c,l,n,r);if(u===void 0)throw new Wu.default(s.opts.uriResolver,n,r);if(u instanceof wo.SchemaEnv)return y(u);return m(u);function d(){if(o===l)return Kt(t,i,o,o.$async);let h=e.scopeValue(\"root\",{ref:l});return Kt(t,(0,W._)`${h}.validate`,l,l.$async)}function y(h){let f=bo(t,h);Kt(t,f,h,h.$async)}function m(h){let f=e.scopeValue(\"schema\",a.code.source===!0?{ref:h,code:(0,W.stringify)(h)}:{ref:h}),p=e.name(\"valid\"),_=t.subschema({schema:h,dataTypes:[],schemaPath:W.nil,topSchemaRef:f,errSchemaPath:r},p);t.mergeEvaluated(_),t.ok(p)}}};function bo(t,e){let{gen:r}=t;return e.validate?r.scopeValue(\"validate\",{ref:e.validate}):(0,W._)`${r.scopeValue(\"wrapper\",{ref:e})}.validate`}ke.getValidate=bo;function Kt(t,e,r,s){let{gen:n,it:o}=t,{allErrors:i,schemaEnv:a,opts:c}=o,l=c.passContext?Ue.default.this:W.nil;s?u():d();function u(){if(!a.$async)throw new Error(\"async schema referenced by sync schema\");let h=n.let(\"valid\");n.try(()=>{n.code((0,W._)`await ${(0,vo.callValidateCode)(t,e,l)}`),m(e),i||n.assign(h,!0)},f=>{n.if((0,W._)`!(${f} instanceof ${o.ValidationError})`,()=>n.throw(f)),y(f),i||n.assign(h,!1)}),t.ok(h)}function d(){t.result((0,vo.callValidateCode)(t,e,l),()=>m(e),()=>y(e))}function y(h){let f=(0,W._)`${h}.errors`;n.assign(Ue.default.vErrors,(0,W._)`${Ue.default.vErrors} === null ? ${f} : ${Ue.default.vErrors}.concat(${f})`),n.assign(Ue.default.errors,(0,W._)`${Ue.default.vErrors}.length`)}function m(h){var f;if(!o.opts.unevaluated)return;let p=(f=r?.validate)===null||f===void 0?void 0:f.evaluated;if(o.props!==!0)if(p&&!p.dynamicProps)p.props!==void 0&&(o.props=Ut.mergeEvaluated.props(n,p.props,o.props));else{let _=n.var(\"props\",(0,W._)`${h}.evaluated.props`);o.props=Ut.mergeEvaluated.props(n,_,o.props,W.Name)}if(o.items!==!0)if(p&&!p.dynamicItems)p.items!==void 0&&(o.items=Ut.mergeEvaluated.items(n,p.items,o.items));else{let _=n.var(\"items\",(0,W._)`${h}.evaluated.items`);o.items=Ut.mergeEvaluated.items(n,_,o.items,W.Name)}}}ke.callRef=Kt;ke.default=Bu});var So=g(es=>{\"use strict\";Object.defineProperty(es,\"__esModule\",{value:!0});var Qu=$o(),Xu=Eo(),Yu=[\"$schema\",\"$id\",\"$defs\",\"$vocabulary\",{keyword:\"$comment\"},\"definitions\",Qu.default,Xu.default];es.default=Yu});var Po=g(ts=>{\"use strict\";Object.defineProperty(ts,\"__esModule\",{value:!0});var xt=S(),ge=xt.operators,Ft={maximum:{okStr:\"<=\",ok:ge.LTE,fail:ge.GT},minimum:{okStr:\">=\",ok:ge.GTE,fail:ge.LT},exclusiveMaximum:{okStr:\"<\",ok:ge.LT,fail:ge.GTE},exclusiveMinimum:{okStr:\">\",ok:ge.GT,fail:ge.LTE}},Zu={message:({keyword:t,schemaCode:e})=>(0,xt.str)`must be ${Ft[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,xt._)`{comparison: ${Ft[t].okStr}, limit: ${e}}`},el={keyword:Object.keys(Ft),type:\"number\",schemaType:\"number\",$data:!0,error:Zu,code(t){let{keyword:e,data:r,schemaCode:s}=t;t.fail$data((0,xt._)`${r} ${Ft[e].fail} ${s} || isNaN(${r})`)}};ts.default=el});var No=g(rs=>{\"use strict\";Object.defineProperty(rs,\"__esModule\",{value:!0});var ft=S(),tl={message:({schemaCode:t})=>(0,ft.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ft._)`{multipleOf: ${t}}`},rl={keyword:\"multipleOf\",type:\"number\",schemaType:\"number\",$data:!0,error:tl,code(t){let{gen:e,data:r,schemaCode:s,it:n}=t,o=n.opts.multipleOfPrecision,i=e.let(\"res\"),a=o?(0,ft._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:(0,ft._)`${i} !== parseInt(${i})`;t.fail$data((0,ft._)`(${s} === 0 || (${i} = ${r}/${s}, ${a}))`)}};rs.default=rl});var qo=g(ss=>{\"use strict\";Object.defineProperty(ss,\"__esModule\",{value:!0});function ko(t){let e=t.length,r=0,s=0,n;for(;s=55296&&n<=56319&&s{\"use strict\";Object.defineProperty(ns,\"__esModule\",{value:!0});var qe=S(),sl=O(),nl=qo(),ol={message({keyword:t,schemaCode:e}){let r=t===\"maxLength\"?\"more\":\"fewer\";return(0,qe.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,qe._)`{limit: ${t}}`},il={keyword:[\"maxLength\",\"minLength\"],type:\"string\",schemaType:\"number\",$data:!0,error:ol,code(t){let{keyword:e,data:r,schemaCode:s,it:n}=t,o=e===\"maxLength\"?qe.operators.GT:qe.operators.LT,i=n.opts.unicode===!1?(0,qe._)`${r}.length`:(0,qe._)`${(0,sl.useFunc)(t.gen,nl.default)}(${r})`;t.fail$data((0,qe._)`${i} ${o} ${s}`)}};ns.default=il});var jo=g(os=>{\"use strict\";Object.defineProperty(os,\"__esModule\",{value:!0});var al=Q(),cl=O(),Ke=S(),ul={message:({schemaCode:t})=>(0,Ke.str)`must match pattern \"${t}\"`,params:({schemaCode:t})=>(0,Ke._)`{pattern: ${t}}`},ll={keyword:\"pattern\",type:\"string\",schemaType:\"string\",$data:!0,error:ul,code(t){let{gen:e,data:r,$data:s,schema:n,schemaCode:o,it:i}=t,a=i.opts.unicodeRegExp?\"u\":\"\";if(s){let{regExp:c}=i.opts.code,l=c.code===\"new RegExp\"?(0,Ke._)`new RegExp`:(0,cl.useFunc)(e,c),u=e.let(\"valid\");e.try(()=>e.assign(u,(0,Ke._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Ke._)`!${u}`)}else{let c=(0,al.usePattern)(t,n);t.fail$data((0,Ke._)`!${c}.test(${r})`)}}};os.default=ll});var Ro=g(is=>{\"use strict\";Object.defineProperty(is,\"__esModule\",{value:!0});var ht=S(),dl={message({keyword:t,schemaCode:e}){let r=t===\"maxProperties\"?\"more\":\"fewer\";return(0,ht.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,ht._)`{limit: ${t}}`},fl={keyword:[\"maxProperties\",\"minProperties\"],type:\"object\",schemaType:\"number\",$data:!0,error:dl,code(t){let{keyword:e,data:r,schemaCode:s}=t,n=e===\"maxProperties\"?ht.operators.GT:ht.operators.LT;t.fail$data((0,ht._)`Object.keys(${r}).length ${n} ${s}`)}};is.default=fl});var Io=g(as=>{\"use strict\";Object.defineProperty(as,\"__esModule\",{value:!0});var pt=Q(),mt=S(),hl=O(),pl={message:({params:{missingProperty:t}})=>(0,mt.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,mt._)`{missingProperty: ${t}}`},ml={keyword:\"required\",type:\"object\",schemaType:\"array\",$data:!0,error:pl,code(t){let{gen:e,schema:r,schemaCode:s,data:n,$data:o,it:i}=t,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors?l():u(),a.strictRequired){let m=t.parentSchema.properties,{definedProperties:h}=t.it;for(let f of r)if(m?.[f]===void 0&&!h.has(f)){let p=i.schemaEnv.baseId+i.errSchemaPath,_=`required property \"${f}\" is not defined at \"${p}\" (strictRequired)`;(0,hl.checkStrictMode)(i,_,i.opts.strictRequired)}}function l(){if(c||o)t.block$data(mt.nil,d);else for(let m of r)(0,pt.checkReportMissingProp)(t,m)}function u(){let m=e.let(\"missing\");if(c||o){let h=e.let(\"valid\",!0);t.block$data(h,()=>y(m,h)),t.ok(h)}else e.if((0,pt.checkMissingProp)(t,r,m)),(0,pt.reportMissingProp)(t,m),e.else()}function d(){e.forOf(\"prop\",s,m=>{t.setParams({missingProperty:m}),e.if((0,pt.noPropertyInData)(e,n,m,a.ownProperties),()=>t.error())})}function y(m,h){t.setParams({missingProperty:m}),e.forOf(m,s,()=>{e.assign(h,(0,pt.propertyInData)(e,n,m,a.ownProperties)),e.if((0,mt.not)(h),()=>{t.error(),e.break()})},mt.nil)}}};as.default=ml});var To=g(cs=>{\"use strict\";Object.defineProperty(cs,\"__esModule\",{value:!0});var yt=S(),yl={message({keyword:t,schemaCode:e}){let r=t===\"maxItems\"?\"more\":\"fewer\";return(0,yt.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,yt._)`{limit: ${t}}`},_l={keyword:[\"maxItems\",\"minItems\"],type:\"array\",schemaType:\"number\",$data:!0,error:yl,code(t){let{keyword:e,data:r,schemaCode:s}=t,n=e===\"maxItems\"?yt.operators.GT:yt.operators.LT;t.fail$data((0,yt._)`${r}.length ${n} ${s}`)}};cs.default=_l});var Lt=g(us=>{\"use strict\";Object.defineProperty(us,\"__esModule\",{value:!0});var Co=Ir();Co.code='require(\"ajv/dist/runtime/equal\").default';us.default=Co});var Mo=g(ds=>{\"use strict\";Object.defineProperty(ds,\"__esModule\",{value:!0});var ls=rt(),z=S(),gl=O(),$l=Lt(),vl={message:({params:{i:t,j:e}})=>(0,z.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,z._)`{i: ${t}, j: ${e}}`},wl={keyword:\"uniqueItems\",type:\"array\",schemaType:\"boolean\",$data:!0,error:vl,code(t){let{gen:e,data:r,$data:s,schema:n,parentSchema:o,schemaCode:i,it:a}=t;if(!s&&!n)return;let c=e.let(\"valid\"),l=o.items?(0,ls.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,z._)`${i} === false`),t.ok(c);function u(){let h=e.let(\"i\",(0,z._)`${r}.length`),f=e.let(\"j\");t.setParams({i:h,j:f}),e.assign(c,!0),e.if((0,z._)`${h} > 1`,()=>(d()?y:m)(h,f))}function d(){return l.length>0&&!l.some(h=>h===\"object\"||h===\"array\")}function y(h,f){let p=e.name(\"item\"),_=(0,ls.checkDataTypes)(l,p,a.opts.strictNumbers,ls.DataType.Wrong),q=e.const(\"indices\",(0,z._)`{}`);e.for((0,z._)`;${h}--;`,()=>{e.let(p,(0,z._)`${r}[${h}]`),e.if(_,(0,z._)`continue`),l.length>1&&e.if((0,z._)`typeof ${p} == \"string\"`,(0,z._)`${p} += \"_\"`),e.if((0,z._)`typeof ${q}[${p}] == \"number\"`,()=>{e.assign(f,(0,z._)`${q}[${p}]`),t.error(),e.assign(c,!1).break()}).code((0,z._)`${q}[${p}] = ${h}`)})}function m(h,f){let p=(0,gl.useFunc)(e,$l.default),_=e.name(\"outer\");e.label(_).for((0,z._)`;${h}--;`,()=>e.for((0,z._)`${f} = ${h}; ${f}--;`,()=>e.if((0,z._)`${p}(${r}[${h}], ${r}[${f}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};ds.default=wl});var Ao=g(hs=>{\"use strict\";Object.defineProperty(hs,\"__esModule\",{value:!0});var fs=S(),bl=O(),El=Lt(),Sl={message:\"must be equal to constant\",params:({schemaCode:t})=>(0,fs._)`{allowedValue: ${t}}`},Pl={keyword:\"const\",$data:!0,error:Sl,code(t){let{gen:e,data:r,$data:s,schemaCode:n,schema:o}=t;s||o&&typeof o==\"object\"?t.fail$data((0,fs._)`!${(0,bl.useFunc)(e,El.default)}(${r}, ${n})`):t.fail((0,fs._)`${o} !== ${r}`)}};hs.default=Pl});var Do=g(ps=>{\"use strict\";Object.defineProperty(ps,\"__esModule\",{value:!0});var _t=S(),Nl=O(),kl=Lt(),ql={message:\"must be equal to one of the allowed values\",params:({schemaCode:t})=>(0,_t._)`{allowedValues: ${t}}`},Ol={keyword:\"enum\",schemaType:\"array\",$data:!0,error:ql,code(t){let{gen:e,data:r,$data:s,schema:n,schemaCode:o,it:i}=t;if(!s&&n.length===0)throw new Error(\"enum must have non-empty array\");let a=n.length>=i.opts.loopEnum,c,l=()=>c??(c=(0,Nl.useFunc)(e,kl.default)),u;if(a||s)u=e.let(\"valid\"),t.block$data(u,d);else{if(!Array.isArray(n))throw new Error(\"ajv implementation error\");let m=e.const(\"vSchema\",o);u=(0,_t.or)(...n.map((h,f)=>y(m,f)))}t.pass(u);function d(){e.assign(u,!1),e.forOf(\"v\",o,m=>e.if((0,_t._)`${l()}(${r}, ${m})`,()=>e.assign(u,!0).break()))}function y(m,h){let f=n[h];return typeof f==\"object\"&&f!==null?(0,_t._)`${l()}(${r}, ${m}[${h}])`:(0,_t._)`${r} === ${f}`}}};ps.default=Ol});var Vo=g(ms=>{\"use strict\";Object.defineProperty(ms,\"__esModule\",{value:!0});var jl=Po(),Rl=No(),Il=Oo(),Tl=jo(),Cl=Ro(),Ml=Io(),Al=To(),Dl=Mo(),Vl=Ao(),zl=Do(),Ul=[jl.default,Rl.default,Il.default,Tl.default,Cl.default,Ml.default,Al.default,Dl.default,{keyword:\"type\",schemaType:[\"string\",\"array\"]},{keyword:\"nullable\",schemaType:\"boolean\"},Vl.default,zl.default];ms.default=Ul});var _s=g(gt=>{\"use strict\";Object.defineProperty(gt,\"__esModule\",{value:!0});gt.validateAdditionalItems=void 0;var Oe=S(),ys=O(),Kl={message:({params:{len:t}})=>(0,Oe.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Oe._)`{limit: ${t}}`},xl={keyword:\"additionalItems\",type:\"array\",schemaType:[\"boolean\",\"object\"],before:\"uniqueItems\",error:Kl,code(t){let{parentSchema:e,it:r}=t,{items:s}=e;if(!Array.isArray(s)){(0,ys.checkStrictMode)(r,'\"additionalItems\" is ignored when \"items\" is not an array of schemas');return}zo(t,s)}};function zo(t,e){let{gen:r,schema:s,data:n,keyword:o,it:i}=t;i.items=!0;let a=r.const(\"len\",(0,Oe._)`${n}.length`);if(s===!1)t.setParams({len:e.length}),t.pass((0,Oe._)`${a} <= ${e.length}`);else if(typeof s==\"object\"&&!(0,ys.alwaysValidSchema)(i,s)){let l=r.var(\"valid\",(0,Oe._)`${a} <= ${e.length}`);r.if((0,Oe.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange(\"i\",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:ys.Type.Num},l),i.allErrors||r.if((0,Oe.not)(l),()=>r.break())})}}gt.validateAdditionalItems=zo;gt.default=xl});var gs=g($t=>{\"use strict\";Object.defineProperty($t,\"__esModule\",{value:!0});$t.validateTuple=void 0;var Uo=S(),Ht=O(),Fl=Q(),Ll={keyword:\"items\",type:\"array\",schemaType:[\"object\",\"array\",\"boolean\"],before:\"uniqueItems\",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Ko(t,\"additionalItems\",e);r.items=!0,!(0,Ht.alwaysValidSchema)(r,e)&&t.ok((0,Fl.validateArray)(t))}};function Ko(t,e,r=t.schema){let{gen:s,parentSchema:n,data:o,keyword:i,it:a}=t;u(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Ht.mergeEvaluated.items(s,r.length,a.items));let c=s.name(\"valid\"),l=s.const(\"len\",(0,Uo._)`${o}.length`);r.forEach((d,y)=>{(0,Ht.alwaysValidSchema)(a,d)||(s.if((0,Uo._)`${l} > ${y}`,()=>t.subschema({keyword:i,schemaProp:y,dataProp:y},c)),t.ok(c))});function u(d){let{opts:y,errSchemaPath:m}=a,h=r.length,f=h===d.minItems&&(h===d.maxItems||d[e]===!1);if(y.strictTuples&&!f){let p=`\"${i}\" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path \"${m}\"`;(0,Ht.checkStrictMode)(a,p,y.strictTuples)}}}$t.validateTuple=Ko;$t.default=Ll});var xo=g($s=>{\"use strict\";Object.defineProperty($s,\"__esModule\",{value:!0});var Hl=gs(),Gl={keyword:\"prefixItems\",type:\"array\",schemaType:[\"array\"],before:\"uniqueItems\",code:t=>(0,Hl.validateTuple)(t,\"items\")};$s.default=Gl});var Lo=g(vs=>{\"use strict\";Object.defineProperty(vs,\"__esModule\",{value:!0});var Fo=S(),Jl=O(),Wl=Q(),Bl=_s(),Ql={message:({params:{len:t}})=>(0,Fo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Fo._)`{limit: ${t}}`},Xl={keyword:\"items\",type:\"array\",schemaType:[\"object\",\"boolean\"],before:\"uniqueItems\",error:Ql,code(t){let{schema:e,parentSchema:r,it:s}=t,{prefixItems:n}=r;s.items=!0,!(0,Jl.alwaysValidSchema)(s,e)&&(n?(0,Bl.validateAdditionalItems)(t,n):t.ok((0,Wl.validateArray)(t)))}};vs.default=Xl});var Ho=g(ws=>{\"use strict\";Object.defineProperty(ws,\"__esModule\",{value:!0});var Y=S(),Gt=O(),Yl={message:({params:{min:t,max:e}})=>e===void 0?(0,Y.str)`must contain at least ${t} valid item(s)`:(0,Y.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Y._)`{minContains: ${t}}`:(0,Y._)`{minContains: ${t}, maxContains: ${e}}`},Zl={keyword:\"contains\",type:\"array\",schemaType:[\"object\",\"boolean\"],before:\"uniqueItems\",trackErrors:!0,error:Yl,code(t){let{gen:e,schema:r,parentSchema:s,data:n,it:o}=t,i,a,{minContains:c,maxContains:l}=s;o.opts.next?(i=c===void 0?1:c,a=l):i=1;let u=e.const(\"len\",(0,Y._)`${n}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,Gt.checkStrictMode)(o,'\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored');return}if(a!==void 0&&i>a){(0,Gt.checkStrictMode)(o,'\"minContains\" > \"maxContains\" is always invalid'),t.fail();return}if((0,Gt.alwaysValidSchema)(o,r)){let f=(0,Y._)`${u} >= ${i}`;a!==void 0&&(f=(0,Y._)`${f} && ${u} <= ${a}`),t.pass(f);return}o.items=!0;let d=e.name(\"valid\");a===void 0&&i===1?m(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,Y._)`${n}.length > 0`,y)):(e.let(d,!1),y()),t.result(d,()=>t.reset());function y(){let f=e.name(\"_valid\"),p=e.let(\"count\",0);m(f,()=>e.if(f,()=>h(p)))}function m(f,p){e.forRange(\"i\",0,u,_=>{t.subschema({keyword:\"contains\",dataProp:_,dataPropType:Gt.Type.Num,compositeRule:!0},f),p()})}function h(f){e.code((0,Y._)`${f}++`),a===void 0?e.if((0,Y._)`${f} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,Y._)`${f} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,Y._)`${f} >= ${i}`,()=>e.assign(d,!0)))}}};ws.default=Zl});var Wo=g(ie=>{\"use strict\";Object.defineProperty(ie,\"__esModule\",{value:!0});ie.validateSchemaDeps=ie.validatePropertyDeps=ie.error=void 0;var bs=S(),ed=O(),vt=Q();ie.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let s=e===1?\"property\":\"properties\";return(0,bs.str)`must have ${s} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:s}})=>(0,bs._)`{property: ${t},\n missingProperty: ${s},\n depsCount: ${e},\n deps: ${r}}`};var td={keyword:\"dependencies\",type:\"object\",schemaType:\"object\",error:ie.error,code(t){let[e,r]=rd(t);Go(t,e),Jo(t,r)}};function rd({schema:t}){let e={},r={};for(let s in t){if(s===\"__proto__\")continue;let n=Array.isArray(t[s])?e:r;n[s]=t[s]}return[e,r]}function Go(t,e=t.schema){let{gen:r,data:s,it:n}=t;if(Object.keys(e).length===0)return;let o=r.let(\"missing\");for(let i in e){let a=e[i];if(a.length===0)continue;let c=(0,vt.propertyInData)(r,s,i,n.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(\", \")}),n.allErrors?r.if(c,()=>{for(let l of a)(0,vt.checkReportMissingProp)(t,l)}):(r.if((0,bs._)`${c} && (${(0,vt.checkMissingProp)(t,a,o)})`),(0,vt.reportMissingProp)(t,o),r.else())}}ie.validatePropertyDeps=Go;function Jo(t,e=t.schema){let{gen:r,data:s,keyword:n,it:o}=t,i=r.name(\"valid\");for(let a in e)(0,ed.alwaysValidSchema)(o,e[a])||(r.if((0,vt.propertyInData)(r,s,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:n,schemaProp:a},i);t.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),t.ok(i))}ie.validateSchemaDeps=Jo;ie.default=td});var Qo=g(Es=>{\"use strict\";Object.defineProperty(Es,\"__esModule\",{value:!0});var Bo=S(),sd=O(),nd={message:\"property name must be valid\",params:({params:t})=>(0,Bo._)`{propertyName: ${t.propertyName}}`},od={keyword:\"propertyNames\",type:\"object\",schemaType:[\"object\",\"boolean\"],error:nd,code(t){let{gen:e,schema:r,data:s,it:n}=t;if((0,sd.alwaysValidSchema)(n,r))return;let o=e.name(\"valid\");e.forIn(\"key\",s,i=>{t.setParams({propertyName:i}),t.subschema({keyword:\"propertyNames\",data:i,dataTypes:[\"string\"],propertyName:i,compositeRule:!0},o),e.if((0,Bo.not)(o),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(o)}};Es.default=od});var Ps=g(Ss=>{\"use strict\";Object.defineProperty(Ss,\"__esModule\",{value:!0});var Jt=Q(),re=S(),id=le(),Wt=O(),ad={message:\"must NOT have additional properties\",params:({params:t})=>(0,re._)`{additionalProperty: ${t.additionalProperty}}`},cd={keyword:\"additionalProperties\",type:[\"object\"],schemaType:[\"boolean\",\"object\"],allowUndefined:!0,trackErrors:!0,error:ad,code(t){let{gen:e,schema:r,parentSchema:s,data:n,errsCount:o,it:i}=t;if(!o)throw new Error(\"ajv implementation error\");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!==\"all\"&&(0,Wt.alwaysValidSchema)(i,r))return;let l=(0,Jt.allSchemaProperties)(s.properties),u=(0,Jt.allSchemaProperties)(s.patternProperties);d(),t.ok((0,re._)`${o} === ${id.default.errors}`);function d(){e.forIn(\"key\",n,p=>{!l.length&&!u.length?h(p):e.if(y(p),()=>h(p))})}function y(p){let _;if(l.length>8){let q=(0,Wt.schemaRefOrVal)(i,s.properties,\"properties\");_=(0,Jt.isOwnProperty)(e,q,p)}else l.length?_=(0,re.or)(...l.map(q=>(0,re._)`${p} === ${q}`)):_=re.nil;return u.length&&(_=(0,re.or)(_,...u.map(q=>(0,re._)`${(0,Jt.usePattern)(t,q)}.test(${p})`))),(0,re.not)(_)}function m(p){e.code((0,re._)`delete ${n}[${p}]`)}function h(p){if(c.removeAdditional===\"all\"||c.removeAdditional&&r===!1){m(p);return}if(r===!1){t.setParams({additionalProperty:p}),t.error(),a||e.break();return}if(typeof r==\"object\"&&!(0,Wt.alwaysValidSchema)(i,r)){let _=e.name(\"valid\");c.removeAdditional===\"failing\"?(f(p,_,!1),e.if((0,re.not)(_),()=>{t.reset(),m(p)})):(f(p,_),a||e.if((0,re.not)(_),()=>e.break()))}}function f(p,_,q){let N={keyword:\"additionalProperties\",dataProp:p,dataPropType:Wt.Type.Str};q===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(N,_)}}};Ss.default=cd});var Zo=g(ks=>{\"use strict\";Object.defineProperty(ks,\"__esModule\",{value:!0});var ud=it(),Xo=Q(),Ns=O(),Yo=Ps(),ld={keyword:\"properties\",type:\"object\",schemaType:\"object\",code(t){let{gen:e,schema:r,parentSchema:s,data:n,it:o}=t;o.opts.removeAdditional===\"all\"&&s.additionalProperties===void 0&&Yo.default.code(new ud.KeywordCxt(o,Yo.default,\"additionalProperties\"));let i=(0,Xo.allSchemaProperties)(r);for(let d of i)o.definedProperties.add(d);o.opts.unevaluated&&i.length&&o.props!==!0&&(o.props=Ns.mergeEvaluated.props(e,(0,Ns.toHash)(i),o.props));let a=i.filter(d=>!(0,Ns.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name(\"valid\");for(let d of a)l(d)?u(d):(e.if((0,Xo.propertyInData)(e,n,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:\"properties\",schemaProp:d,dataProp:d},c)}}};ks.default=ld});var si=g(qs=>{\"use strict\";Object.defineProperty(qs,\"__esModule\",{value:!0});var ei=Q(),Bt=S(),ti=O(),ri=O(),dd={keyword:\"patternProperties\",type:\"object\",schemaType:\"object\",code(t){let{gen:e,schema:r,data:s,parentSchema:n,it:o}=t,{opts:i}=o,a=(0,ei.allSchemaProperties)(r),c=a.filter(f=>(0,ti.alwaysValidSchema)(o,r[f]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=i.strictSchema&&!i.allowMatchingProperties&&n.properties,u=e.name(\"valid\");o.props!==!0&&!(o.props instanceof Bt.Name)&&(o.props=(0,ri.evaluatedPropsToName)(e,o.props));let{props:d}=o;y();function y(){for(let f of a)l&&m(f),o.allErrors?h(f):(e.var(u,!0),h(f),e.if(u))}function m(f){for(let p in l)new RegExp(f).test(p)&&(0,ti.checkStrictMode)(o,`property ${p} matches pattern ${f} (use allowMatchingProperties)`)}function h(f){e.forIn(\"key\",s,p=>{e.if((0,Bt._)`${(0,ei.usePattern)(t,f)}.test(${p})`,()=>{let _=c.includes(f);_||t.subschema({keyword:\"patternProperties\",schemaProp:f,dataProp:p,dataPropType:ri.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,Bt._)`${d}[${p}]`,!0):!_&&!o.allErrors&&e.if((0,Bt.not)(u),()=>e.break())})})}}};qs.default=dd});var ni=g(Os=>{\"use strict\";Object.defineProperty(Os,\"__esModule\",{value:!0});var fd=O(),hd={keyword:\"not\",schemaType:[\"object\",\"boolean\"],trackErrors:!0,code(t){let{gen:e,schema:r,it:s}=t;if((0,fd.alwaysValidSchema)(s,r)){t.fail();return}let n=e.name(\"valid\");t.subschema({keyword:\"not\",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:\"must NOT be valid\"}};Os.default=hd});var oi=g(js=>{\"use strict\";Object.defineProperty(js,\"__esModule\",{value:!0});var pd=Q(),md={keyword:\"anyOf\",schemaType:\"array\",trackErrors:!0,code:pd.validateUnion,error:{message:\"must match a schema in anyOf\"}};js.default=md});var ii=g(Rs=>{\"use strict\";Object.defineProperty(Rs,\"__esModule\",{value:!0});var Qt=S(),yd=O(),_d={message:\"must match exactly one schema in oneOf\",params:({params:t})=>(0,Qt._)`{passingSchemas: ${t.passing}}`},gd={keyword:\"oneOf\",schemaType:\"array\",trackErrors:!0,error:_d,code(t){let{gen:e,schema:r,parentSchema:s,it:n}=t;if(!Array.isArray(r))throw new Error(\"ajv implementation error\");if(n.opts.discriminator&&s.discriminator)return;let o=r,i=e.let(\"valid\",!1),a=e.let(\"passing\",null),c=e.name(\"_valid\");t.setParams({passing:a}),e.block(l),t.result(i,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let y;(0,yd.alwaysValidSchema)(n,u)?e.var(c,!0):y=t.subschema({keyword:\"oneOf\",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Qt._)`${c} && ${i}`).assign(i,!1).assign(a,(0,Qt._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),y&&t.mergeEvaluated(y,Qt.Name)})})}}};Rs.default=gd});var ai=g(Is=>{\"use strict\";Object.defineProperty(Is,\"__esModule\",{value:!0});var $d=O(),vd={keyword:\"allOf\",schemaType:\"array\",code(t){let{gen:e,schema:r,it:s}=t;if(!Array.isArray(r))throw new Error(\"ajv implementation error\");let n=e.name(\"valid\");r.forEach((o,i)=>{if((0,$d.alwaysValidSchema)(s,o))return;let a=t.subschema({keyword:\"allOf\",schemaProp:i},n);t.ok(n),t.mergeEvaluated(a)})}};Is.default=vd});var li=g(Ts=>{\"use strict\";Object.defineProperty(Ts,\"__esModule\",{value:!0});var Xt=S(),ui=O(),wd={message:({params:t})=>(0,Xt.str)`must match \"${t.ifClause}\" schema`,params:({params:t})=>(0,Xt._)`{failingKeyword: ${t.ifClause}}`},bd={keyword:\"if\",schemaType:[\"object\",\"boolean\"],trackErrors:!0,error:wd,code(t){let{gen:e,parentSchema:r,it:s}=t;r.then===void 0&&r.else===void 0&&(0,ui.checkStrictMode)(s,'\"if\" without \"then\" and \"else\" is ignored');let n=ci(s,\"then\"),o=ci(s,\"else\");if(!n&&!o)return;let i=e.let(\"valid\",!0),a=e.name(\"_valid\");if(c(),t.reset(),n&&o){let u=e.let(\"ifClause\");t.setParams({ifClause:u}),e.if(a,l(\"then\",u),l(\"else\",u))}else n?e.if(a,l(\"then\")):e.if((0,Xt.not)(a),l(\"else\"));t.pass(i,()=>t.error(!0));function c(){let u=t.subschema({keyword:\"if\",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let y=t.subschema({keyword:u},a);e.assign(i,a),t.mergeValidEvaluated(y,i),d?e.assign(d,(0,Xt._)`${u}`):t.setParams({ifClause:u})}}}};function ci(t,e){let r=t.schema[e];return r!==void 0&&!(0,ui.alwaysValidSchema)(t,r)}Ts.default=bd});var di=g(Cs=>{\"use strict\";Object.defineProperty(Cs,\"__esModule\",{value:!0});var Ed=O(),Sd={keyword:[\"then\",\"else\"],schemaType:[\"object\",\"boolean\"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Ed.checkStrictMode)(r,`\"${t}\" without \"if\" is ignored`)}};Cs.default=Sd});var fi=g(Ms=>{\"use strict\";Object.defineProperty(Ms,\"__esModule\",{value:!0});var Pd=_s(),Nd=xo(),kd=gs(),qd=Lo(),Od=Ho(),jd=Wo(),Rd=Qo(),Id=Ps(),Td=Zo(),Cd=si(),Md=ni(),Ad=oi(),Dd=ii(),Vd=ai(),zd=li(),Ud=di();function Kd(t=!1){let e=[Md.default,Ad.default,Dd.default,Vd.default,zd.default,Ud.default,Rd.default,Id.default,jd.default,Td.default,Cd.default];return t?e.push(Nd.default,qd.default):e.push(Pd.default,kd.default),e.push(Od.default),e}Ms.default=Kd});var hi=g(As=>{\"use strict\";Object.defineProperty(As,\"__esModule\",{value:!0});var D=S(),xd={message:({schemaCode:t})=>(0,D.str)`must match format \"${t}\"`,params:({schemaCode:t})=>(0,D._)`{format: ${t}}`},Fd={keyword:\"format\",type:[\"number\",\"string\"],schemaType:\"string\",$data:!0,error:xd,code(t,e){let{gen:r,data:s,$data:n,schema:o,schemaCode:i,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;n?y():m();function y(){let h=r.scopeValue(\"formats\",{ref:d.formats,code:c.code.formats}),f=r.const(\"fDef\",(0,D._)`${h}[${i}]`),p=r.let(\"fType\"),_=r.let(\"format\");r.if((0,D._)`typeof ${f} == \"object\" && !(${f} instanceof RegExp)`,()=>r.assign(p,(0,D._)`${f}.type || \"string\"`).assign(_,(0,D._)`${f}.validate`),()=>r.assign(p,(0,D._)`\"string\"`).assign(_,f)),t.fail$data((0,D.or)(q(),N()));function q(){return c.strictSchema===!1?D.nil:(0,D._)`${i} && !${_}`}function N(){let C=u.$async?(0,D._)`(${f}.async ? await ${_}(${s}) : ${_}(${s}))`:(0,D._)`${_}(${s})`,w=(0,D._)`(typeof ${_} == \"function\" ? ${C} : ${_}.test(${s}))`;return(0,D._)`${_} && ${_} !== true && ${p} === ${e} && !${w}`}}function m(){let h=d.formats[o];if(!h){q();return}if(h===!0)return;let[f,p,_]=N(h);f===e&&t.pass(C());function q(){if(c.strictSchema===!1){d.logger.warn(w());return}throw new Error(w());function w(){return`unknown format \"${o}\" ignored in schema at path \"${l}\"`}}function N(w){let se=w instanceof RegExp?(0,D.regexpCode)(w):c.code.formats?(0,D._)`${c.code.formats}${(0,D.getProperty)(o)}`:void 0,ae=r.scopeValue(\"formats\",{key:o,ref:w,code:se});return typeof w==\"object\"&&!(w instanceof RegExp)?[w.type||\"string\",w.validate,(0,D._)`${ae}.validate`]:[\"string\",w,ae]}function C(){if(typeof h==\"object\"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw new Error(\"async format in sync schema\");return(0,D._)`await ${_}(${s})`}return typeof p==\"function\"?(0,D._)`${_}(${s})`:(0,D._)`${_}.test(${s})`}}}};As.default=Fd});var pi=g(Ds=>{\"use strict\";Object.defineProperty(Ds,\"__esModule\",{value:!0});var Ld=hi(),Hd=[Ld.default];Ds.default=Hd});var mi=g(xe=>{\"use strict\";Object.defineProperty(xe,\"__esModule\",{value:!0});xe.contentVocabulary=xe.metadataVocabulary=void 0;xe.metadataVocabulary=[\"title\",\"description\",\"default\",\"deprecated\",\"readOnly\",\"writeOnly\",\"examples\"];xe.contentVocabulary=[\"contentMediaType\",\"contentEncoding\",\"contentSchema\"]});var _i=g(Vs=>{\"use strict\";Object.defineProperty(Vs,\"__esModule\",{value:!0});var Gd=So(),Jd=Vo(),Wd=fi(),Bd=pi(),yi=mi(),Qd=[Gd.default,Jd.default,(0,Wd.default)(),Bd.default,yi.metadataVocabulary,yi.contentVocabulary];Vs.default=Qd});var $i=g(Yt=>{\"use strict\";Object.defineProperty(Yt,\"__esModule\",{value:!0});Yt.DiscrError=void 0;var gi;(function(t){t.Tag=\"tag\",t.Mapping=\"mapping\"})(gi||(Yt.DiscrError=gi={}))});var wi=g(Us=>{\"use strict\";Object.defineProperty(Us,\"__esModule\",{value:!0});var Fe=S(),zs=$i(),vi=Mt(),Xd=at(),Yd=O(),Zd={message:({params:{discrError:t,tagName:e}})=>t===zs.DiscrError.Tag?`tag \"${e}\" must be string`:`value of tag \"${e}\" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Fe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},ef={keyword:\"discriminator\",type:\"object\",schemaType:\"object\",error:Zd,code(t){let{gen:e,data:r,schema:s,parentSchema:n,it:o}=t,{oneOf:i}=n;if(!o.opts.discriminator)throw new Error(\"discriminator: requires discriminator option\");let a=s.propertyName;if(typeof a!=\"string\")throw new Error(\"discriminator: requires propertyName\");if(s.mapping)throw new Error(\"discriminator: mapping is not supported\");if(!i)throw new Error(\"discriminator: requires oneOf keyword\");let c=e.let(\"valid\",!1),l=e.const(\"tag\",(0,Fe._)`${r}${(0,Fe.getProperty)(a)}`);e.if((0,Fe._)`typeof ${l} == \"string\"`,()=>u(),()=>t.error(!1,{discrError:zs.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let m=y();e.if(!1);for(let h in m)e.elseIf((0,Fe._)`${l} === ${h}`),e.assign(c,d(m[h]));e.else(),t.error(!1,{discrError:zs.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(m){let h=e.name(\"valid\"),f=t.subschema({keyword:\"oneOf\",schemaProp:m},h);return t.mergeEvaluated(f,Fe.Name),h}function y(){var m;let h={},f=_(n),p=!0;for(let C=0;C{tf.exports={$schema:\"http://json-schema.org/draft-07/schema#\",$id:\"http://json-schema.org/draft-07/schema#\",title:\"Core schema meta-schema\",definitions:{schemaArray:{type:\"array\",minItems:1,items:{$ref:\"#\"}},nonNegativeInteger:{type:\"integer\",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:\"#/definitions/nonNegativeInteger\"},{default:0}]},simpleTypes:{enum:[\"array\",\"boolean\",\"integer\",\"null\",\"number\",\"object\",\"string\"]},stringArray:{type:\"array\",items:{type:\"string\"},uniqueItems:!0,default:[]}},type:[\"object\",\"boolean\"],properties:{$id:{type:\"string\",format:\"uri-reference\"},$schema:{type:\"string\",format:\"uri\"},$ref:{type:\"string\",format:\"uri-reference\"},$comment:{type:\"string\"},title:{type:\"string\"},description:{type:\"string\"},default:!0,readOnly:{type:\"boolean\",default:!1},examples:{type:\"array\",items:!0},multipleOf:{type:\"number\",exclusiveMinimum:0},maximum:{type:\"number\"},exclusiveMaximum:{type:\"number\"},minimum:{type:\"number\"},exclusiveMinimum:{type:\"number\"},maxLength:{$ref:\"#/definitions/nonNegativeInteger\"},minLength:{$ref:\"#/definitions/nonNegativeIntegerDefault0\"},pattern:{type:\"string\",format:\"regex\"},additionalItems:{$ref:\"#\"},items:{anyOf:[{$ref:\"#\"},{$ref:\"#/definitions/schemaArray\"}],default:!0},maxItems:{$ref:\"#/definitions/nonNegativeInteger\"},minItems:{$ref:\"#/definitions/nonNegativeIntegerDefault0\"},uniqueItems:{type:\"boolean\",default:!1},contains:{$ref:\"#\"},maxProperties:{$ref:\"#/definitions/nonNegativeInteger\"},minProperties:{$ref:\"#/definitions/nonNegativeIntegerDefault0\"},required:{$ref:\"#/definitions/stringArray\"},additionalProperties:{$ref:\"#\"},definitions:{type:\"object\",additionalProperties:{$ref:\"#\"},default:{}},properties:{type:\"object\",additionalProperties:{$ref:\"#\"},default:{}},patternProperties:{type:\"object\",additionalProperties:{$ref:\"#\"},propertyNames:{format:\"regex\"},default:{}},dependencies:{type:\"object\",additionalProperties:{anyOf:[{$ref:\"#\"},{$ref:\"#/definitions/stringArray\"}]}},propertyNames:{$ref:\"#\"},const:!0,enum:{type:\"array\",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:\"#/definitions/simpleTypes\"},{type:\"array\",items:{$ref:\"#/definitions/simpleTypes\"},minItems:1,uniqueItems:!0}]},format:{type:\"string\"},contentMediaType:{type:\"string\"},contentEncoding:{type:\"string\"},if:{$ref:\"#\"},then:{$ref:\"#\"},else:{$ref:\"#\"},allOf:{$ref:\"#/definitions/schemaArray\"},anyOf:{$ref:\"#/definitions/schemaArray\"},oneOf:{$ref:\"#/definitions/schemaArray\"},not:{$ref:\"#\"}},default:!0}});var xs=g((A,Ks)=>{\"use strict\";Object.defineProperty(A,\"__esModule\",{value:!0});A.MissingRefError=A.ValidationError=A.CodeGen=A.Name=A.nil=A.stringify=A.str=A._=A.KeywordCxt=A.Ajv=void 0;var rf=go(),sf=_i(),nf=wi(),Ei=bi(),of=[\"/properties\"],Zt=\"http://json-schema.org/draft-07/schema\",Le=class extends rf.default{_addVocabularies(){super._addVocabularies(),sf.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(nf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Ei,of):Ei;this.addMetaSchema(e,Zt,!1),this.refs[\"http://json-schema.org/schema\"]=Zt}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Zt)?Zt:void 0)}};A.Ajv=Le;Ks.exports=A=Le;Ks.exports.Ajv=Le;Object.defineProperty(A,\"__esModule\",{value:!0});A.default=Le;var af=it();Object.defineProperty(A,\"KeywordCxt\",{enumerable:!0,get:function(){return af.KeywordCxt}});var He=S();Object.defineProperty(A,\"_\",{enumerable:!0,get:function(){return He._}});Object.defineProperty(A,\"str\",{enumerable:!0,get:function(){return He.str}});Object.defineProperty(A,\"stringify\",{enumerable:!0,get:function(){return He.stringify}});Object.defineProperty(A,\"nil\",{enumerable:!0,get:function(){return He.nil}});Object.defineProperty(A,\"Name\",{enumerable:!0,get:function(){return He.Name}});Object.defineProperty(A,\"CodeGen\",{enumerable:!0,get:function(){return He.CodeGen}});var cf=Tt();Object.defineProperty(A,\"ValidationError\",{enumerable:!0,get:function(){return cf.default}});var uf=at();Object.defineProperty(A,\"MissingRefError\",{enumerable:!0,get:function(){return uf.default}})});module.exports=xs().default||xs();\n\n })(module, exports);\n return module.exports;\n}"; diff --git a/packages/insomnia/src/templating/sandbox/vendored/chai.generated.ts b/packages/insomnia/src/templating/sandbox/vendored/chai.generated.ts index 7558b21572a..c8ca0abe9c9 100644 --- a/packages/insomnia/src/templating/sandbox/vendored/chai.generated.ts +++ b/packages/insomnia/src/templating/sandbox/vendored/chai.generated.ts @@ -2,6 +2,6 @@ // Vendored, pinned bundle of "chai" for the QuickJS template-tag sandbox (M3). // Sourced from the isolated install in vendored/pkg/ (see its package.json) — NOT the app's own node_modules. // Regenerate with: npm run sandbox:vendored:generate -w insomnia - +/* eslint-disable */ export const CHAI_FACTORY_VERSION = "4.5.0"; export const CHAI_FACTORY_SOURCE = "function () {\n var module = { exports: {} };\n var exports = module.exports;\n (function (module, exports) {\nvar q=(a,i)=>()=>(i||a((i={exports:{}}).exports,i),i.exports);var $e=q((go,ht)=>{function lt(){var a=[].slice.call(arguments);function i(t,f){Object.keys(f).forEach(function(e){~a.indexOf(e)||(t[e]=f[e])})}return function(){for(var f=[].slice.call(arguments),e=0,n={};e{\"use strict\";function pt(a,i){return typeof a>\"u\"||a===null?!1:i in Object(a)}function yt(a){var i=a.replace(/([^\\\\])\\[/g,\"$1.[\"),t=i.match(/(\\\\\\.|[^.]+?)+/g);return t.map(function(e){if(e===\"constructor\"||e===\"__proto__\"||e===\"prototype\")return{};var n=/^\\[(\\d+)\\]$/,r=n.exec(e),o=null;return r?o={i:parseFloat(r[1])}:o={p:e.replace(/\\\\([.[\\]])/g,\"$1\")},o})}function dt(a,i,t){var f=a,e=null;t=typeof t>\"u\"?i.length:t;for(var n=0;n\"u\"?f=f[r.i]:f=f[r.p],n===t-1&&(e=f))}return e}function ar(a,i,t){for(var f=a,e=t.length,n=null,r=0;r\"u\"?n.i:n.p,f[o]=i;else if(typeof n.p<\"u\"&&f[n.p])f=f[n.p];else if(typeof n.i<\"u\"&&f[n.i])f=f[n.i];else{var v=t[r+1];o=typeof n.p>\"u\"?n.i:n.p,l=typeof v.p>\"u\"?[]:{},f[o]=l,f=f[o]}}}function gt(a,i){var t=yt(i),f=t[t.length-1],e={parent:t.length>1?dt(a,t,t.length-1):a,name:f.p||f.i,value:dt(a,t)};return e.exists=pt(e.parent,e.name),e}function ur(a,i){var t=gt(a,i);return t.value}function cr(a,i,t){var f=yt(i);return ar(a,t,f),a}bt.exports={hasProperty:pt,getPathInfo:gt,getPathValue:ur,setPathValue:cr}});var Z=q((mo,vt)=>{vt.exports=function(i,t,f){var e=i.__flags||(i.__flags=Object.create(null));if(arguments.length===3)e[t]=f;else return e[t]}});var xt=q((vo,wt)=>{var fr=Z();wt.exports=function(i,t){var f=fr(i,\"negate\"),e=t[0];return f?!e:e}});var Se=q((_e,Je)=>{(function(a,i){typeof _e==\"object\"&&typeof Je<\"u\"?Je.exports=i():typeof define==\"function\"&&define.amd?define(i):(a=typeof globalThis<\"u\"?globalThis:a||self,a.typeDetect=i())})(_e,(function(){\"use strict\";var a=typeof Promise==\"function\",i=(function(F){if(typeof globalThis==\"object\")return globalThis;Object.defineProperty(F,\"typeDetectGlobalObject\",{get:function(){return this},configurable:!0});var Q=typeDetectGlobalObject;return delete F.typeDetectGlobalObject,Q})(Object.prototype),t=typeof Symbol<\"u\",f=typeof Map<\"u\",e=typeof Set<\"u\",n=typeof WeakMap<\"u\",r=typeof WeakSet<\"u\",o=typeof DataView<\"u\",l=t&&typeof Symbol.iterator<\"u\",v=t&&typeof Symbol.toStringTag<\"u\",P=e&&typeof Set.prototype.entries==\"function\",R=f&&typeof Map.prototype.entries==\"function\",X=P&&Object.getPrototypeOf(new Set().entries()),K=R&&Object.getPrototypeOf(new Map().entries()),V=l&&typeof Array.prototype[Symbol.iterator]==\"function\",re=V&&Object.getPrototypeOf([][Symbol.iterator]()),_=l&&typeof String.prototype[Symbol.iterator]==\"function\",ce=_&&Object.getPrototypeOf(\"\"[Symbol.iterator]()),fe=8,le=-1;function he(F){var Q=typeof F;if(Q!==\"object\")return Q;if(F===null)return\"null\";if(F===i)return\"global\";if(Array.isArray(F)&&(v===!1||!(Symbol.toStringTag in F)))return\"Array\";if(typeof window==\"object\"&&window!==null){if(typeof window.location==\"object\"&&F===window.location)return\"Location\";if(typeof window.document==\"object\"&&F===window.document)return\"Document\";if(typeof window.navigator==\"object\"){if(typeof window.navigator.mimeTypes==\"object\"&&F===window.navigator.mimeTypes)return\"MimeTypeArray\";if(typeof window.navigator.plugins==\"object\"&&F===window.navigator.plugins)return\"PluginArray\"}if((typeof window.HTMLElement==\"function\"||typeof window.HTMLElement==\"object\")&&F instanceof window.HTMLElement){if(F.tagName===\"BLOCKQUOTE\")return\"HTMLQuoteElement\";if(F.tagName===\"TD\")return\"HTMLTableDataCellElement\";if(F.tagName===\"TH\")return\"HTMLTableHeaderCellElement\"}}var H=v&&F[Symbol.toStringTag];if(typeof H==\"string\")return H;var z=Object.getPrototypeOf(F);return z===RegExp.prototype?\"RegExp\":z===Date.prototype?\"Date\":a&&z===Promise.prototype?\"Promise\":e&&z===Set.prototype?\"Set\":f&&z===Map.prototype?\"Map\":r&&z===WeakSet.prototype?\"WeakSet\":n&&z===WeakMap.prototype?\"WeakMap\":o&&z===DataView.prototype?\"DataView\":f&&z===K?\"Map Iterator\":e&&z===X?\"Set Iterator\":V&&z===re?\"Array Iterator\":_&&z===ce?\"String Iterator\":z===null?\"Object\":Object.prototype.toString.call(F).slice(fe,le)}return he}))});var Mt=q((wo,St)=>{var lr=$e(),Ze=Z(),hr=Se();St.exports=function(i,t){var f=Ze(i,\"message\"),e=Ze(i,\"ssfi\");f=f?f+\": \":\"\",i=Ze(i,\"object\"),t=t.map(function(o){return o.toLowerCase()}),t.sort();var n=t.map(function(o,l){var v=~[\"a\",\"e\",\"i\",\"o\",\"u\"].indexOf(o.charAt(0))?\"an\":\"a\",P=t.length>1&&l===t.length-1?\"or \":\"\";return P+v+\" \"+o}).join(\", \"),r=hr(i).toLowerCase();if(!t.some(function(o){return r===o}))throw new lr(f+\"object tested must be \"+n+\", but \"+r+\" given\",void 0,e)}});var Qe=q((xo,Pt)=>{Pt.exports=function(i,t){return t.length>4?t[4]:i._obj}});var ze=q((So,Et)=>{\"use strict\";var dr=Function.prototype.toString,pr=/\\s*function(?:\\s|\\s*\\/\\*[^(?:*\\/)]+\\*\\/\\s*)*([^\\s\\(\\/]+)/,yr=512;function gr(a){if(typeof a!=\"function\")return null;var i=\"\";if(typeof Function.prototype.name>\"u\"&&typeof a.name>\"u\"){var t=dr.call(a);if(t.indexOf(\"(\")>yr)return i;var f=t.match(pr);f&&(i=f[1])}else i=a.name;return i}Et.exports=gr});var Ot=q(()=>{});var Nt=q((Ce,qt)=>{(function(a,i){typeof Ce==\"object\"&&typeof qt<\"u\"?i(Ce):typeof define==\"function\"&&define.amd?define([\"exports\"],i):(a=typeof globalThis<\"u\"?globalThis:a||self,i(a.loupe={}))})(Ce,(function(a){\"use strict\";function i(u){\"@babel/helpers - typeof\";return typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?i=function(c){return typeof c}:i=function(c){return c&&typeof Symbol==\"function\"&&c.constructor===Symbol&&c!==Symbol.prototype?\"symbol\":typeof c},i(u)}function t(u,c){return f(u)||e(u,c)||n(u,c)||o()}function f(u){if(Array.isArray(u))return u}function e(u,c){if(!(typeof Symbol>\"u\"||!(Symbol.iterator in Object(u)))){var y=[],x=!0,M=!1,N=void 0;try{for(var D=u[Symbol.iterator](),B;!(x=(B=D.next()).done)&&(y.push(B.value),!(c&&y.length===c));x=!0);}catch(G){M=!0,N=G}finally{try{!x&&D.return!=null&&D.return()}finally{if(M)throw N}}return y}}function n(u,c){if(u){if(typeof u==\"string\")return r(u,c);var y=Object.prototype.toString.call(u).slice(8,-1);if(y===\"Object\"&&u.constructor&&(y=u.constructor.name),y===\"Map\"||y===\"Set\")return Array.from(u);if(y===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return r(u,c)}}function r(u,c){(c==null||c>u.length)&&(c=u.length);for(var y=0,x=new Array(c);y0&&arguments[0]!==void 0?arguments[0]:{},c=u.showHidden,y=c===void 0?!1:c,x=u.depth,M=x===void 0?2:x,N=u.colors,D=N===void 0?!1:N,B=u.customInspect,G=B===void 0?!0:B,W=u.showProxy,J=W===void 0?!1:W,oe=u.maxArrayLength,Re=oe===void 0?1/0:oe,we=u.breakLength,pe=we===void 0?1/0:we,xe=u.seen,or=xe===void 0?[]:xe,ct=u.truncate,ir=ct===void 0?1/0:ct,ft=u.stylize,sr=ft===void 0?String:ft,Ue={showHidden:!!y,depth:Number(M),colors:!!D,customInspect:!!G,showProxy:!!J,maxArrayLength:Number(Re),breakLength:Number(pe),truncate:Number(ir),seen:or,stylize:sr};return Ue.colors&&(Ue.stylize=R),Ue}function K(u,c){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:P;u=String(u);var x=y.length,M=u.length;return x>c&&M>x?y:M>c&&M>x?\"\".concat(u.slice(0,c-x)).concat(y):u}function V(u,c,y){var x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:\", \";y=y||c.inspect;var M=u.length;if(M===0)return\"\";for(var N=c.truncate,D=\"\",B=\"\",G=\"\",W=0;WN&&D.length+G.length<=N||!J&&!oe&&xe>N||(B=J?\"\":y(u[W+1],c)+(oe?\"\":x),!J&&oe&&xe>N&&pe+B.length>N))break;if(D+=we,!J&&!oe&&pe+B.length>=N){G=\"\".concat(P,\"(\").concat(u.length-W-1,\")\");break}G=\"\"}return\"\".concat(D).concat(G)}function re(u){return u.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?u:JSON.stringify(u).replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\")}function _(u,c){var y=t(u,2),x=y[0],M=y[1];return c.truncate-=2,typeof x==\"string\"?x=re(x):typeof x!=\"number\"&&(x=\"[\".concat(c.inspect(x,c),\"]\")),c.truncate-=x.length,M=c.inspect(M,c),\"\".concat(x,\": \").concat(M)}function ce(u,c){var y=Object.keys(u).slice(u.length);if(!u.length&&!y.length)return\"[]\";c.truncate-=4;var x=V(u,c);c.truncate-=x.length;var M=\"\";return y.length&&(M=V(y.map(function(N){return[N,u[N]]}),c,_)),\"[ \".concat(x).concat(M?\", \".concat(M):\"\",\" ]\")}var fe=Function.prototype.toString,le=/\\s*function(?:\\s|\\s*\\/\\*[^(?:*\\/)]+\\*\\/\\s*)*([^\\s\\(\\/]+)/,he=512;function F(u){if(typeof u!=\"function\")return null;var c=\"\";if(typeof Function.prototype.name>\"u\"&&typeof u.name>\"u\"){var y=fe.call(u);if(y.indexOf(\"(\")>he)return c;var x=y.match(le);x&&(c=x[1])}else c=u.name;return c}var Q=F,H=function(c){return typeof Buffer==\"function\"&&c instanceof Buffer?\"Buffer\":c[Symbol.toStringTag]?c[Symbol.toStringTag]:Q(c.constructor)};function z(u,c){var y=H(u);c.truncate-=y.length+4;var x=Object.keys(u).slice(u.length);if(!u.length&&!x.length)return\"\".concat(y,\"[]\");for(var M=\"\",N=0;N \").concat(M)}function Ae(u){var c=[];return u.forEach(function(y,x){c.push([x,y])}),c}function Ke(u,c){var y=u.size-1;return y<=0?\"Map{}\":(c.truncate-=7,\"Map{ \".concat(V(Ae(u),c,Ne),\" }\"))}var Le=Number.isNaN||function(u){return u!==u};function me(u,c){return Le(u)?c.stylize(\"NaN\",\"number\"):u===1/0?c.stylize(\"Infinity\",\"number\"):u===-1/0?c.stylize(\"-Infinity\",\"number\"):u===0?c.stylize(1/u===1/0?\"+0\":\"-0\",\"number\"):c.stylize(K(u,c.truncate),\"number\")}function ve(u,c){var y=K(u.toString(),c.truncate-1);return y!==P&&(y+=\"n\"),c.stylize(y,\"bigint\")}function je(u,c){var y=u.toString().split(\"/\")[2],x=c.truncate-(2+y.length),M=u.source;return c.stylize(\"/\".concat(K(M,x),\"/\").concat(y),\"regexp\")}function We(u){var c=[];return u.forEach(function(y){c.push(y)}),c}function s(u,c){return u.size===0?\"Set{}\":(c.truncate-=7,\"Set{ \".concat(V(We(u),c),\" }\"))}var h=new RegExp(\"['\\\\u0000-\\\\u001f\\\\u007f-\\\\u009f\\\\u00ad\\\\u0600-\\\\u0604\\\\u070f\\\\u17b4\\\\u17b5\\\\u200c-\\\\u200f\\\\u2028-\\\\u202f\\\\u2060-\\\\u206f\\\\ufeff\\\\ufff0-\\\\uffff]\",\"g\"),p={\"\\b\":\"\\\\b\",\"\t\":\"\\\\t\",\"\\n\":\"\\\\n\",\"\\f\":\"\\\\f\",\"\\r\":\"\\\\r\",\"'\":\"\\\\'\",\"\\\\\":\"\\\\\\\\\"},g=16,m=4;function w(u){return p[u]||\"\\\\u\".concat(\"0000\".concat(u.charCodeAt(0).toString(g)).slice(-m))}function b(u,c){return h.test(u)&&(u=u.replace(h,w)),c.stylize(\"'\".concat(K(u,c.truncate-2),\"'\"),\"string\")}function d(u){return\"description\"in Symbol.prototype?u.description?\"Symbol(\".concat(u.description,\")\"):\"Symbol()\":u.toString()}var S=function(){return\"Promise{\\u2026}\"};try{var E=process.binding(\"util\"),O=E.getPromiseDetails,k=E.kPending,j=E.kRejected;Array.isArray(O(Promise.resolve()))&&(S=function(c,y){var x=O(c),M=t(x,2),N=M[0],D=M[1];return N===k?\"Promise{}\":\"Promise\".concat(N===j?\"!\":\"\",\"{\").concat(y.inspect(D,y),\"}\")})}catch{}var A=S;function T(u,c){var y=Object.getOwnPropertyNames(u),x=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(u):[];if(y.length===0&&x.length===0)return\"{}\";if(c.truncate-=4,c.seen=c.seen||[],c.seen.indexOf(u)>=0)return\"[Circular]\";c.seen.push(u);var M=V(y.map(function(B){return[B,u[B]]}),c,_),N=V(x.map(function(B){return[B,u[B]]}),c,_);c.seen.pop();var D=\"\";return M&&N&&(D=\", \"),\"{ \".concat(M).concat(D).concat(N,\" }\")}var C=typeof Symbol<\"u\"&&Symbol.toStringTag?Symbol.toStringTag:!1;function L(u,c){var y=\"\";return C&&C in u&&(y=u[C]),y=y||Q(u.constructor),(!y||y===\"_class\")&&(y=\"\"),c.truncate-=y.length,\"\".concat(y).concat(T(u,c))}function ee(u,c){return u.length===0?\"Arguments[]\":(c.truncate-=13,\"Arguments[ \".concat(V(u,c),\" ]\"))}var U=[\"stack\",\"line\",\"column\",\"name\",\"message\",\"fileName\",\"lineNumber\",\"columnNumber\",\"number\",\"description\"];function Y(u,c){var y=Object.getOwnPropertyNames(u).filter(function(D){return U.indexOf(D)===-1}),x=u.name;c.truncate-=x.length;var M=\"\";typeof u.message==\"string\"?M=K(u.message,c.truncate):y.unshift(\"message\"),M=M?\": \".concat(M):\"\",c.truncate-=M.length+5;var N=V(y.map(function(D){return[D,u[D]]}),c,_);return\"\".concat(x).concat(M).concat(N?\" { \".concat(N,\" }\"):\"\")}function Yn(u,c){var y=t(u,2),x=y[0],M=y[1];return c.truncate-=3,M?\"\".concat(c.stylize(x,\"yellow\"),\"=\").concat(c.stylize('\"'.concat(M,'\"'),\"string\")):\"\".concat(c.stylize(x,\"yellow\"))}function Ge(u,c){return V(u,c,it,`\n`)}function it(u,c){var y=u.getAttributeNames(),x=u.tagName.toLowerCase(),M=c.stylize(\"<\".concat(x),\"special\"),N=c.stylize(\">\",\"special\"),D=c.stylize(\"\"),\"special\");c.truncate-=x.length*2+5;var B=\"\";y.length>0&&(B+=\" \",B+=V(y.map(function(J){return[J,u.getAttribute(J)]}),c,Yn,\" \")),c.truncate-=B.length;var G=c.truncate,W=Ge(u.children,c);return W&&W.length>G&&(W=\"\".concat(P,\"(\").concat(u.children.length,\")\")),\"\".concat(M).concat(B).concat(N).concat(W).concat(D)}var Xn=typeof Symbol==\"function\"&&typeof Symbol.for==\"function\",Te=Xn?Symbol.for(\"chai/inspect\"):\"@@chai/inspect\",de=!1;try{var st=Ot();de=st.inspect?st.inspect.custom:!1}catch{de=!1}function at(){this.key=\"chai/loupe__\"+Math.random()+Date.now()}at.prototype={get:function(c){return c[this.key]},has:function(c){return this.key in c},set:function(c,y){Object.isExtensible(c)&&Object.defineProperty(c,this.key,{value:y,configurable:!0})}};var De=new(typeof WeakMap==\"function\"?WeakMap:at),Ie={},ut={undefined:function(c,y){return y.stylize(\"undefined\",\"undefined\")},null:function(c,y){return y.stylize(null,\"null\")},boolean:function(c,y){return y.stylize(c,\"boolean\")},Boolean:function(c,y){return y.stylize(c,\"boolean\")},number:me,Number:me,bigint:ve,BigInt:ve,string:b,String:b,function:be,Function:be,symbol:d,Symbol:d,Array:ce,Date:ge,Map:Ke,Set:s,RegExp:je,Promise:A,WeakSet:function(c,y){return y.stylize(\"WeakSet{\\u2026}\",\"special\")},WeakMap:function(c,y){return y.stylize(\"WeakMap{\\u2026}\",\"special\")},Arguments:ee,Int8Array:z,Uint8Array:z,Uint8ClampedArray:z,Int16Array:z,Uint16Array:z,Int32Array:z,Uint32Array:z,Float32Array:z,Float64Array:z,Generator:function(){return\"\"},DataView:function(){return\"\"},ArrayBuffer:function(){return\"\"},Error:Y,HTMLCollection:Ge,NodeList:Ge},Hn=function(c,y,x){return Te in c&&typeof c[Te]==\"function\"?c[Te](y):de&&de in c&&typeof c[de]==\"function\"?c[de](y.depth,y):\"inspect\"in c&&typeof c.inspect==\"function\"?c.inspect(y.depth,y):\"constructor\"in c&&De.has(c.constructor)?De.get(c.constructor)(c,y):Ie[x]?Ie[x](c,y):\"\"},er=Object.prototype.toString;function ke(u,c){c=X(c),c.inspect=ke;var y=c,x=y.customInspect,M=u===null?\"null\":i(u);if(M===\"object\"&&(M=er.call(u).slice(8,-1)),ut[M])return ut[M](u,c);if(x&&u){var N=Hn(u,c,M);if(N)return typeof N==\"string\"?N:ke(N,c)}var D=u?Object.getPrototypeOf(u):!1;return D===Object.prototype||D===null?T(u,c):u&&typeof HTMLElement==\"function\"&&u instanceof HTMLElement?it(u,c):\"constructor\"in u?u.constructor!==Object?L(u,c):T(u,c):u===Object(u)?T(u,c):c.stylize(String(u),M)}function tr(u,c){return De.has(u)?!1:(De.set(u,c),!0)}function nr(u,c){return u in Ie?!1:(Ie[u]=c,!0)}var rr=Te;a.custom=rr,a.default=ke,a.inspect=ke,a.registerConstructor=tr,a.registerStringTag=nr,Object.defineProperty(a,\"__esModule\",{value:!0})}))});var se=q((Eo,At)=>{At.exports={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:[\"then\",\"catch\",\"inspect\",\"toJSON\"],deepEqual:null}});var Be=q((qo,Tt)=>{var Oo=ze(),br=Nt(),jt=se();Tt.exports=mr;function mr(a,i,t,f){var e={colors:f,depth:typeof t>\"u\"?2:t,showHidden:i,truncate:jt.truncateThreshold?jt.truncateThreshold:1/0};return br.inspect(a,e)}});var Ye=q((No,It)=>{var vr=Be(),Dt=se();It.exports=function(i){var t=vr(i),f=Object.prototype.toString.call(i);if(Dt.truncateThreshold&&t.length>=Dt.truncateThreshold){if(f===\"[object Function]\")return!i.name||i.name===\"\"?\"[Function]\":\"[Function: \"+i.name+\"]\";if(f===\"[object Array]\")return\"[ Array(\"+i.length+\") ]\";if(f===\"[object Object]\"){var e=Object.keys(i),n=e.length>2?e.splice(0,2).join(\", \")+\", ...\":e.join(\", \");return\"{ Object (\"+n+\") }\"}else return t}else return t}});var zt=q((Ao,kt)=>{var Xe=Z(),wr=Qe(),He=Ye();kt.exports=function(i,t){var f=Xe(i,\"negate\"),e=Xe(i,\"object\"),n=t[3],r=wr(i,t),o=f?t[2]:t[1],l=Xe(i,\"message\");return typeof o==\"function\"&&(o=o()),o=o||\"\",o=o.replace(/#\\{this\\}/g,function(){return He(e)}).replace(/#\\{act\\}/g,function(){return He(r)}).replace(/#\\{exp\\}/g,function(){return He(n)}),l?l+\": \"+o:o}});var te=q((jo,Ct)=>{Ct.exports=function(i,t,f){var e=i.__flags||(i.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),f=arguments.length===3?f:!0;for(var n in e)(f||n!==\"object\"&&n!==\"ssfi\"&&n!==\"lockSsfi\"&&n!=\"message\")&&(t.__flags[n]=e[n])}});var Jt=q((To,nt)=>{\"use strict\";var Bt=Se();function Ut(){this._key=\"chai/deep-eql__\"+Math.random()+Date.now()}Ut.prototype={get:function(i){return i[this._key]},set:function(i,t){Object.isExtensible(i)&&Object.defineProperty(i,this._key,{value:t,configurable:!0})}};var tt=typeof WeakMap==\"function\"?WeakMap:Ut;function Ft(a,i,t){if(!t||ye(a)||ye(i))return null;var f=t.get(a);if(f){var e=f.get(i);if(typeof e==\"boolean\")return e}return null}function Fe(a,i,t,f){if(!(!t||ye(a)||ye(i))){var e=t.get(a);e?e.set(i,f):(e=new tt,e.set(i,f),t.set(a,e))}}nt.exports=Ve;nt.exports.MemoizeMap=tt;function Ve(a,i,t){if(t&&t.comparator)return Vt(a,i,t);var f=$t(a,i);return f!==null?f:Vt(a,i,t)}function $t(a,i){return a===i?a!==0||1/a===1/i:a!==a&&i!==i?!0:ye(a)||ye(i)?!1:null}function Vt(a,i,t){t=t||{},t.memoize=t.memoize===!1?!1:t.memoize||new tt;var f=t&&t.comparator,e=Ft(a,i,t.memoize);if(e!==null)return e;var n=Ft(i,a,t.memoize);if(n!==null)return n;if(f){var r=f(a,i);if(r===!1||r===!0)return Fe(a,i,t.memoize,r),r;var o=$t(a,i);if(o!==null)return o}var l=Bt(a);if(l!==Bt(i))return Fe(a,i,t.memoize,!1),!1;Fe(a,i,t.memoize,!0);var v=xr(a,i,l,t);return Fe(a,i,t.memoize,v),v}function xr(a,i,t,f){switch(t){case\"String\":case\"Number\":case\"Boolean\":case\"Date\":return Ve(a.valueOf(),i.valueOf());case\"Promise\":case\"Symbol\":case\"function\":case\"WeakMap\":case\"WeakSet\":return a===i;case\"Error\":return _t(a,i,[\"name\",\"message\",\"code\"],f);case\"Arguments\":case\"Int8Array\":case\"Uint8Array\":case\"Uint8ClampedArray\":case\"Int16Array\":case\"Uint16Array\":case\"Int32Array\":case\"Uint32Array\":case\"Float32Array\":case\"Float64Array\":case\"Array\":return ae(a,i,f);case\"RegExp\":return Sr(a,i);case\"Generator\":return Mr(a,i,f);case\"DataView\":return ae(new Uint8Array(a.buffer),new Uint8Array(i.buffer),f);case\"ArrayBuffer\":return ae(new Uint8Array(a),new Uint8Array(i),f);case\"Set\":return Kt(a,i,f);case\"Map\":return Kt(a,i,f);case\"Temporal.PlainDate\":case\"Temporal.PlainTime\":case\"Temporal.PlainDateTime\":case\"Temporal.Instant\":case\"Temporal.ZonedDateTime\":case\"Temporal.PlainYearMonth\":case\"Temporal.PlainMonthDay\":return a.equals(i);case\"Temporal.Duration\":return a.total(\"nanoseconds\")===i.total(\"nanoseconds\");case\"Temporal.TimeZone\":case\"Temporal.Calendar\":return a.toString()===i.toString();default:return Er(a,i,f)}}function Sr(a,i){return a.toString()===i.toString()}function Kt(a,i,t){try{if(a.size!==i.size)return!1;if(a.size===0)return!0}catch{return!1}var f=[],e=[];return a.forEach(function(r,o){f.push([r,o])}),i.forEach(function(r,o){e.push([r,o])}),ae(f.sort(),e.sort(),t)}function ae(a,i,t){var f=a.length;if(f!==i.length)return!1;if(f===0)return!0;for(var e=-1;++e{var Or=se();Zt.exports=function(){return Or.useProxy&&typeof Proxy<\"u\"&&typeof Reflect<\"u\"}});var Xt=q((Io,Yt)=>{var qr=ne(),Qt=Z(),Nr=Me(),Ar=te();Yt.exports=function(i,t,f){f=f===void 0?function(){}:f,Object.defineProperty(i,t,{get:function e(){!Nr()&&!Qt(this,\"lockSsfi\")&&Qt(this,\"ssfi\",e);var n=f.call(this);if(n!==void 0)return n;var r=new qr.Assertion;return Ar(this,r),r},configurable:!0})}});var Pe=q((ko,Ht)=>{var jr=Object.getOwnPropertyDescriptor(function(){},\"length\");Ht.exports=function(i,t,f){return jr.configurable&&Object.defineProperty(i,\"length\",{get:function(){throw Error(f?\"Invalid Chai property: \"+t+'.length. Due to a compatibility issue, \"length\" cannot directly follow \"'+t+'\". Use \"'+t+'.lengthOf\" instead.':\"Invalid Chai property: \"+t+'.length. See docs for proper usage of \"'+t+'\".')}}),i}});var tn=q((zo,en)=>{en.exports=function(i){var t=Object.getOwnPropertyNames(i);function f(n){t.indexOf(n)===-1&&t.push(n)}for(var e=Object.getPrototypeOf(i);e!==null;)Object.getOwnPropertyNames(e).forEach(f),e=Object.getPrototypeOf(e);return t}});var Ee=q((Co,on)=>{var Tr=se(),nn=Z(),Dr=tn(),Ir=Me();var rn=[\"__flags\",\"__methods\",\"_obj\",\"assert\"];on.exports=function(i,t){return Ir()?new Proxy(i,{get:function f(e,n){if(typeof n==\"string\"&&Tr.proxyExcludedKeys.indexOf(n)===-1&&!Reflect.has(e,n)){if(t)throw Error(\"Invalid Chai property: \"+t+\".\"+n+'. See docs for proper usage of \"'+t+'\".');var r=null,o=4;throw Dr(e).forEach(function(l){if(!Object.prototype.hasOwnProperty(l)&&rn.indexOf(l)===-1){var v=kr(n,l,o);v=t)return t;for(var f=[],e=0;e<=a.length;e++)f[e]=Array(i.length+1).fill(0),f[e][0]=e;for(var n=0;n=t){f[e][n]=t;continue}f[e][n]=Math.min(f[e-1][n]+1,f[e][n-1]+1,f[e-1][n-1]+(r===i.charCodeAt(n-1)?0:1))}return f[a.length][i.length]}});var un=q((Bo,an)=>{var zr=Pe(),Cr=ne(),sn=Z(),Br=Ee(),Fr=te();an.exports=function(i,t,f){var e=function(){sn(this,\"lockSsfi\")||sn(this,\"ssfi\",e);var n=f.apply(this,arguments);if(n!==void 0)return n;var r=new Cr.Assertion;return Fr(this,r),r};zr(e,t,!1),i[t]=Br(e,t)}});var fn=q((Fo,cn)=>{var Vr=ne(),Oe=Z(),Kr=Me(),Lr=te();cn.exports=function(i,t,f){var e=Object.getOwnPropertyDescriptor(i,t),n=function(){};e&&typeof e.get==\"function\"&&(n=e.get),Object.defineProperty(i,t,{get:function r(){!Kr()&&!Oe(this,\"lockSsfi\")&&Oe(this,\"ssfi\",r);var o=Oe(this,\"lockSsfi\");Oe(this,\"lockSsfi\",!0);var l=f(n).call(this);if(Oe(this,\"lockSsfi\",o),l!==void 0)return l;var v=new Vr.Assertion;return Lr(this,v),v},configurable:!0})}});var hn=q((Vo,ln)=>{var Wr=Pe(),Gr=ne(),qe=Z(),Rr=Ee(),Ur=te();ln.exports=function(i,t,f){var e=i[t],n=function(){throw new Error(t+\" is not a function\")};e&&typeof e==\"function\"&&(n=e);var r=function(){qe(this,\"lockSsfi\")||qe(this,\"ssfi\",r);var o=qe(this,\"lockSsfi\");qe(this,\"lockSsfi\",!0);var l=f(n).apply(this,arguments);if(qe(this,\"lockSsfi\",o),l!==void 0)return l;var v=new Gr.Assertion;return Ur(this,v),v};Wr(r,t,!1),i[t]=Rr(r,t)}});var bn=q((Ko,gn)=>{var $r=Pe(),_r=ne(),dn=Z(),Jr=Ee(),pn=te();var Zr=typeof Object.setPrototypeOf==\"function\",yn=function(){},Qr=Object.getOwnPropertyNames(yn).filter(function(a){var i=Object.getOwnPropertyDescriptor(yn,a);return typeof i!=\"object\"?!0:!i.configurable}),Yr=Function.prototype.call,Xr=Function.prototype.apply;gn.exports=function(i,t,f,e){typeof e!=\"function\"&&(e=function(){});var n={method:f,chainingBehavior:e};i.__methods||(i.__methods={}),i.__methods[t]=n,Object.defineProperty(i,t,{get:function(){n.chainingBehavior.call(this);var o=function(){dn(this,\"lockSsfi\")||dn(this,\"ssfi\",o);var P=n.method.apply(this,arguments);if(P!==void 0)return P;var R=new _r.Assertion;return pn(this,R),R};if($r(o,t,!0),Zr){var l=Object.create(this);l.call=Yr,l.apply=Xr,Object.setPrototypeOf(o,l)}else{var v=Object.getOwnPropertyNames(i);v.forEach(function(P){if(Qr.indexOf(P)===-1){var R=Object.getOwnPropertyDescriptor(i,P);Object.defineProperty(o,P,R)}})}return pn(this,o),Jr(o)},configurable:!0})}});var xn=q((Lo,wn)=>{var mn=ne(),vn=te();wn.exports=function(i,t,f,e){var n=i.__methods[t],r=n.chainingBehavior;n.chainingBehavior=function(){var v=e(r).call(this);if(v!==void 0)return v;var P=new mn.Assertion;return vn(this,P),P};var o=n.method;n.method=function(){var v=f(o).apply(this,arguments);if(v!==void 0)return v;var P=new mn.Assertion;return vn(this,P),P}}});var Pn=q((Wo,Mn)=>{var Sn=Be();Mn.exports=function(i,t){return Sn(i){En.exports=function(i){return typeof Object.getOwnPropertySymbols!=\"function\"?[]:Object.getOwnPropertySymbols(i).filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})}});var qn=q((Ro,On)=>{var Hr=rt();On.exports=function(i){return Object.keys(i).concat(Hr(i))}});var An=q((Uo,Nn)=>{\"use strict\";var ot=ze();function eo(a,i){return i instanceof Error&&a===i}function to(a,i){return i instanceof Error?a.constructor===i.constructor||a instanceof i.constructor:i.prototype instanceof Error||i===Error?a.constructor===i||a instanceof i:!1}function no(a,i){var t=typeof a==\"string\"?a:a.message;return i instanceof RegExp?i.test(t):typeof i==\"string\"?t.indexOf(i)!==-1:!1}function ro(a){var i=a;if(a instanceof Error)i=ot(a.constructor);else if(typeof a==\"function\"&&(i=ot(a),i===\"\")){var t=ot(new a);i=t||i}return i}function oo(a){var i=\"\";return a&&a.message?i=a.message:typeof a==\"string\"&&(i=a),i}Nn.exports={compatibleInstance:eo,compatibleConstructor:to,compatibleMessage:no,getMessage:oo,getConstructorName:ro}});var Tn=q(($o,jn)=>{function io(a){return a!==a}jn.exports=Number.isNaN||io});var kn=q((_o,In)=>{var so=Se(),Dn=Z();function ao(a){var i=so(a),t=[\"Array\",\"Object\",\"function\"];return t.indexOf(i)!==-1}In.exports=function(i,t){var f=Dn(i,\"operator\"),e=Dn(i,\"negate\"),n=t[3],r=e?t[2]:t[1];if(f)return f;if(typeof r==\"function\"&&(r=r()),r=r||\"\",!!r&&!/\\shave\\s/.test(r)){var o=ao(n);return/\\snot\\s/.test(r)?o?\"notDeepStrictEqual\":\"notStrictEqual\":o?\"deepStrictEqual\":\"strictEqual\"}}});var Cn=q(I=>{var zn=mt();I.test=xt();I.type=Se();I.expectTypes=Mt();I.getMessage=zt();I.getActual=Qe();I.inspect=Be();I.objDisplay=Ye();I.flag=Z();I.transferFlags=te();I.eql=Jt();I.getPathInfo=zn.getPathInfo;I.hasProperty=zn.hasProperty;I.getName=ze();I.addProperty=Xt();I.addMethod=un();I.overwriteProperty=fn();I.overwriteMethod=hn();I.addChainableMethod=bn();I.overwriteChainableMethod=xn();I.compareByInspect=Pn();I.getOwnEnumerablePropertySymbols=rt();I.getOwnEnumerableProperties=qn();I.checkError=An();I.proxify=Ee();I.addLengthGuard=Pe();I.isProxyEnabled=Me();I.isNaN=Tn();I.getOperator=kn()});var Fn=q((Zo,Bn)=>{var ue=se();Bn.exports=function(a,i){var t=a.AssertionError,f=i.flag;a.Assertion=e;function e(n,r,o,l){return f(this,\"ssfi\",o||e),f(this,\"lockSsfi\",l),f(this,\"object\",n),f(this,\"message\",r),f(this,\"eql\",ue.deepEqual||i.eql),i.proxify(this)}Object.defineProperty(e,\"includeStack\",{get:function(){return console.warn(\"Assertion.includeStack is deprecated, use chai.config.includeStack instead.\"),ue.includeStack},set:function(n){console.warn(\"Assertion.includeStack is deprecated, use chai.config.includeStack instead.\"),ue.includeStack=n}}),Object.defineProperty(e,\"showDiff\",{get:function(){return console.warn(\"Assertion.showDiff is deprecated, use chai.config.showDiff instead.\"),ue.showDiff},set:function(n){console.warn(\"Assertion.showDiff is deprecated, use chai.config.showDiff instead.\"),ue.showDiff=n}}),e.addProperty=function(n,r){i.addProperty(this.prototype,n,r)},e.addMethod=function(n,r){i.addMethod(this.prototype,n,r)},e.addChainableMethod=function(n,r,o){i.addChainableMethod(this.prototype,n,r,o)},e.overwriteProperty=function(n,r){i.overwriteProperty(this.prototype,n,r)},e.overwriteMethod=function(n,r){i.overwriteMethod(this.prototype,n,r)},e.overwriteChainableMethod=function(n,r,o){i.overwriteChainableMethod(this.prototype,n,r,o)},e.prototype.assert=function(n,r,o,l,v,P){var R=i.test(this,arguments);if(P!==!1&&(P=!0),l===void 0&&v===void 0&&(P=!1),ue.showDiff!==!0&&(P=!1),!R){r=i.getMessage(this,arguments);var X=i.getActual(this,arguments),K={actual:X,expected:l,showDiff:P},V=i.getOperator(this,arguments);throw V&&(K.operator=V),new t(r,K,ue.includeStack?this.assert:f(this,\"ssfi\"))}};Object.defineProperty(e.prototype,\"_obj\",{get:function(){return f(this,\"object\")},set:function(n){f(this,\"object\",n)}})}});var Kn=q((Qo,Vn)=>{Vn.exports=function(a,i){var t=a.Assertion,f=a.AssertionError,e=i.flag;[\"to\",\"be\",\"been\",\"is\",\"and\",\"has\",\"have\",\"with\",\"that\",\"which\",\"at\",\"of\",\"same\",\"but\",\"does\",\"still\",\"also\"].forEach(function(s){t.addProperty(s)}),t.addProperty(\"not\",function(){e(this,\"negate\",!0)}),t.addProperty(\"deep\",function(){e(this,\"deep\",!0)}),t.addProperty(\"nested\",function(){e(this,\"nested\",!0)}),t.addProperty(\"own\",function(){e(this,\"own\",!0)}),t.addProperty(\"ordered\",function(){e(this,\"ordered\",!0)}),t.addProperty(\"any\",function(){e(this,\"any\",!0),e(this,\"all\",!1)}),t.addProperty(\"all\",function(){e(this,\"all\",!0),e(this,\"any\",!1)});function n(s,h){h&&e(this,\"message\",h),s=s.toLowerCase();var p=e(this,\"object\"),g=~[\"a\",\"e\",\"i\",\"o\",\"u\"].indexOf(s.charAt(0))?\"an \":\"a \";this.assert(s===i.type(p).toLowerCase(),\"expected #{this} to be \"+g+s,\"expected #{this} not to be \"+g+s)}t.addChainableMethod(\"an\",n),t.addChainableMethod(\"a\",n);function r(s,h){return i.isNaN(s)&&i.isNaN(h)||s===h}function o(){e(this,\"contains\",!0)}function l(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=i.type(p).toLowerCase(),m=e(this,\"message\"),w=e(this,\"negate\"),b=e(this,\"ssfi\"),d=e(this,\"deep\"),S=d?\"deep \":\"\",E=d?e(this,\"eql\"):r;m=m?m+\": \":\"\";var O=!1;switch(g){case\"string\":O=p.indexOf(s)!==-1;break;case\"weakset\":if(d)throw new f(m+\"unable to use .deep.include with WeakSet\",void 0,b);O=p.has(s);break;case\"map\":p.forEach(function(T){O=O||E(T,s)});break;case\"set\":d?p.forEach(function(T){O=O||E(T,s)}):O=p.has(s);break;case\"array\":d?O=p.some(function(T){return E(T,s)}):O=p.indexOf(s)!==-1;break;default:if(s!==Object(s))throw new f(m+\"the given combination of arguments (\"+g+\" and \"+i.type(s).toLowerCase()+\") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a \"+i.type(s).toLowerCase(),void 0,b);var k=Object.keys(s),j=null,A=0;if(k.forEach(function(T){var C=new t(p);if(i.transferFlags(this,C,!0),e(C,\"lockSsfi\",!0),!w||k.length===1){C.property(T,s[T]);return}try{C.property(T,s[T])}catch(L){if(!i.checkError.compatibleConstructor(L,f))throw L;j===null&&(j=L),A++}},this),w&&k.length>1&&A===k.length)throw j;return}this.assert(O,\"expected #{this} to \"+S+\"include \"+i.inspect(s),\"expected #{this} to not \"+S+\"include \"+i.inspect(s))}t.addChainableMethod(\"include\",l,o),t.addChainableMethod(\"contain\",l,o),t.addChainableMethod(\"contains\",l,o),t.addChainableMethod(\"includes\",l,o),t.addProperty(\"ok\",function(){this.assert(e(this,\"object\"),\"expected #{this} to be truthy\",\"expected #{this} to be falsy\")}),t.addProperty(\"true\",function(){this.assert(e(this,\"object\")===!0,\"expected #{this} to be true\",\"expected #{this} to be false\",!e(this,\"negate\"))}),t.addProperty(\"false\",function(){this.assert(e(this,\"object\")===!1,\"expected #{this} to be false\",\"expected #{this} to be true\",!!e(this,\"negate\"))}),t.addProperty(\"null\",function(){this.assert(e(this,\"object\")===null,\"expected #{this} to be null\",\"expected #{this} not to be null\")}),t.addProperty(\"undefined\",function(){this.assert(e(this,\"object\")===void 0,\"expected #{this} to be undefined\",\"expected #{this} not to be undefined\")}),t.addProperty(\"NaN\",function(){this.assert(i.isNaN(e(this,\"object\")),\"expected #{this} to be NaN\",\"expected #{this} not to be NaN\")});function v(){var s=e(this,\"object\");this.assert(s!=null,\"expected #{this} to exist\",\"expected #{this} to not exist\")}t.addProperty(\"exist\",v),t.addProperty(\"exists\",v),t.addProperty(\"empty\",function(){var s=e(this,\"object\"),h=e(this,\"ssfi\"),p=e(this,\"message\"),g;switch(p=p?p+\": \":\"\",i.type(s).toLowerCase()){case\"array\":case\"string\":g=s.length;break;case\"map\":case\"set\":g=s.size;break;case\"weakmap\":case\"weakset\":throw new f(p+\".empty was passed a weak collection\",void 0,h);case\"function\":var m=p+\".empty was passed a function \"+i.getName(s);throw new f(m.trim(),void 0,h);default:if(s!==Object(s))throw new f(p+\".empty was passed non-string primitive \"+i.inspect(s),void 0,h);g=Object.keys(s).length}this.assert(g===0,\"expected #{this} to be empty\",\"expected #{this} not to be empty\")});function P(){var s=e(this,\"object\"),h=i.type(s);this.assert(h===\"Arguments\",\"expected #{this} to be arguments but got \"+h,\"expected #{this} to not be arguments\")}t.addProperty(\"arguments\",P),t.addProperty(\"Arguments\",P);function R(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\");if(e(this,\"deep\")){var g=e(this,\"lockSsfi\");e(this,\"lockSsfi\",!0),this.eql(s),e(this,\"lockSsfi\",g)}else this.assert(s===p,\"expected #{this} to equal #{exp}\",\"expected #{this} to not equal #{exp}\",s,this._obj,!0)}t.addMethod(\"equal\",R),t.addMethod(\"equals\",R),t.addMethod(\"eq\",R);function X(s,h){h&&e(this,\"message\",h);var p=e(this,\"eql\");this.assert(p(s,e(this,\"object\")),\"expected #{this} to deeply equal #{exp}\",\"expected #{this} to not deeply equal #{exp}\",s,this._obj,!0)}t.addMethod(\"eql\",X),t.addMethod(\"eqls\",X);function K(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"doLength\"),m=e(this,\"message\"),w=m?m+\": \":\"\",b=e(this,\"ssfi\"),d=i.type(p).toLowerCase(),S=i.type(s).toLowerCase(),E,O=!0;if(g&&d!==\"map\"&&d!==\"set\"&&new t(p,m,b,!0).to.have.property(\"length\"),!g&&d===\"date\"&&S!==\"date\")E=w+\"the argument to above must be a date\";else if(S!==\"number\"&&(g||d===\"number\"))E=w+\"the argument to above must be a number\";else if(!g&&d!==\"date\"&&d!==\"number\"){var k=d===\"string\"?\"'\"+p+\"'\":p;E=w+\"expected \"+k+\" to be a number or a date\"}else O=!1;if(O)throw new f(E,void 0,b);if(g){var j=\"length\",A;d===\"map\"||d===\"set\"?(j=\"size\",A=p.size):A=p.length,this.assert(A>s,\"expected #{this} to have a \"+j+\" above #{exp} but got #{act}\",\"expected #{this} to not have a \"+j+\" above #{exp}\",s,A)}else this.assert(p>s,\"expected #{this} to be above #{exp}\",\"expected #{this} to be at most #{exp}\",s)}t.addMethod(\"above\",K),t.addMethod(\"gt\",K),t.addMethod(\"greaterThan\",K);function V(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"doLength\"),m=e(this,\"message\"),w=m?m+\": \":\"\",b=e(this,\"ssfi\"),d=i.type(p).toLowerCase(),S=i.type(s).toLowerCase(),E,O=!0;if(g&&d!==\"map\"&&d!==\"set\"&&new t(p,m,b,!0).to.have.property(\"length\"),!g&&d===\"date\"&&S!==\"date\")E=w+\"the argument to least must be a date\";else if(S!==\"number\"&&(g||d===\"number\"))E=w+\"the argument to least must be a number\";else if(!g&&d!==\"date\"&&d!==\"number\"){var k=d===\"string\"?\"'\"+p+\"'\":p;E=w+\"expected \"+k+\" to be a number or a date\"}else O=!1;if(O)throw new f(E,void 0,b);if(g){var j=\"length\",A;d===\"map\"||d===\"set\"?(j=\"size\",A=p.size):A=p.length,this.assert(A>=s,\"expected #{this} to have a \"+j+\" at least #{exp} but got #{act}\",\"expected #{this} to have a \"+j+\" below #{exp}\",s,A)}else this.assert(p>=s,\"expected #{this} to be at least #{exp}\",\"expected #{this} to be below #{exp}\",s)}t.addMethod(\"least\",V),t.addMethod(\"gte\",V),t.addMethod(\"greaterThanOrEqual\",V);function re(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"doLength\"),m=e(this,\"message\"),w=m?m+\": \":\"\",b=e(this,\"ssfi\"),d=i.type(p).toLowerCase(),S=i.type(s).toLowerCase(),E,O=!0;if(g&&d!==\"map\"&&d!==\"set\"&&new t(p,m,b,!0).to.have.property(\"length\"),!g&&d===\"date\"&&S!==\"date\")E=w+\"the argument to below must be a date\";else if(S!==\"number\"&&(g||d===\"number\"))E=w+\"the argument to below must be a number\";else if(!g&&d!==\"date\"&&d!==\"number\"){var k=d===\"string\"?\"'\"+p+\"'\":p;E=w+\"expected \"+k+\" to be a number or a date\"}else O=!1;if(O)throw new f(E,void 0,b);if(g){var j=\"length\",A;d===\"map\"||d===\"set\"?(j=\"size\",A=p.size):A=p.length,this.assert(A=s&&L<=h,\"expected #{this} to have a \"+C+\" within \"+A,\"expected #{this} to not have a \"+C+\" within \"+A)}else this.assert(g>=s&&g<=h,\"expected #{this} to be within \"+A,\"expected #{this} to not be within \"+A)});function ce(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"ssfi\"),m=e(this,\"message\");try{var w=p instanceof s}catch(d){throw d instanceof TypeError?(m=m?m+\": \":\"\",new f(m+\"The instanceof assertion needs a constructor but \"+i.type(s)+\" was given.\",void 0,g)):d}var b=i.getName(s);b===null&&(b=\"an unnamed constructor\"),this.assert(w,\"expected #{this} to be an instance of \"+b,\"expected #{this} to not be an instance of \"+b)}t.addMethod(\"instanceof\",ce),t.addMethod(\"instanceOf\",ce);function fe(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"nested\"),m=e(this,\"own\"),w=e(this,\"message\"),b=e(this,\"object\"),d=e(this,\"ssfi\"),S=typeof s;if(w=w?w+\": \":\"\",g){if(S!==\"string\")throw new f(w+\"the argument to property must be a string when using nested syntax\",void 0,d)}else if(S!==\"string\"&&S!==\"number\"&&S!==\"symbol\")throw new f(w+\"the argument to property must be a string, number, or symbol\",void 0,d);if(g&&m)throw new f(w+'The \"nested\" and \"own\" flags cannot be combined.',void 0,d);if(b==null)throw new f(w+\"Target cannot be null or undefined.\",void 0,d);var E=e(this,\"deep\"),O=e(this,\"negate\"),k=g?i.getPathInfo(b,s):null,j=g?k.value:b[s],A=E?e(this,\"eql\"):(L,ee)=>L===ee,T=\"\";E&&(T+=\"deep \"),m&&(T+=\"own \"),g&&(T+=\"nested \"),T+=\"property \";var C;m?C=Object.prototype.hasOwnProperty.call(b,s):g?C=k.exists:C=i.hasProperty(b,s),(!O||arguments.length===1)&&this.assert(C,\"expected #{this} to have \"+T+i.inspect(s),\"expected #{this} to not have \"+T+i.inspect(s)),arguments.length>1&&this.assert(C&&A(h,j),\"expected #{this} to have \"+T+i.inspect(s)+\" of #{exp}, but got #{act}\",\"expected #{this} to not have \"+T+i.inspect(s)+\" of #{act}\",h,j),e(this,\"object\",j)}t.addMethod(\"property\",fe);function le(s,h,p){e(this,\"own\",!0),fe.apply(this,arguments)}t.addMethod(\"ownProperty\",le),t.addMethod(\"haveOwnProperty\",le);function he(s,h,p){typeof h==\"string\"&&(p=h,h=null),p&&e(this,\"message\",p);var g=e(this,\"object\"),m=Object.getOwnPropertyDescriptor(Object(g),s),w=e(this,\"eql\");m&&h?this.assert(w(h,m),\"expected the own property descriptor for \"+i.inspect(s)+\" on #{this} to match \"+i.inspect(h)+\", got \"+i.inspect(m),\"expected the own property descriptor for \"+i.inspect(s)+\" on #{this} to not match \"+i.inspect(h),h,m,!0):this.assert(m,\"expected #{this} to have an own property descriptor for \"+i.inspect(s),\"expected #{this} to not have an own property descriptor for \"+i.inspect(s)),e(this,\"object\",m)}t.addMethod(\"ownPropertyDescriptor\",he),t.addMethod(\"haveOwnPropertyDescriptor\",he);function F(){e(this,\"doLength\",!0)}function Q(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=i.type(p).toLowerCase(),m=e(this,\"message\"),w=e(this,\"ssfi\"),b=\"length\",d;switch(g){case\"map\":case\"set\":b=\"size\",d=p.size;break;default:new t(p,m,w,!0).to.have.property(\"length\"),d=p.length}this.assert(d==s,\"expected #{this} to have a \"+b+\" of #{exp} but got #{act}\",\"expected #{this} to not have a \"+b+\" of #{act}\",s,d)}t.addChainableMethod(\"length\",Q,F),t.addChainableMethod(\"lengthOf\",Q,F);function H(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\");this.assert(s.exec(p),\"expected #{this} to match \"+s,\"expected #{this} not to match \"+s)}t.addMethod(\"match\",H),t.addMethod(\"matches\",H),t.addMethod(\"string\",function(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"message\"),m=e(this,\"ssfi\");new t(p,g,m,!0).is.a(\"string\"),this.assert(~p.indexOf(s),\"expected #{this} to contain \"+i.inspect(s),\"expected #{this} to not contain \"+i.inspect(s))});function z(s){var h=e(this,\"object\"),p=i.type(h),g=i.type(s),m=e(this,\"ssfi\"),w=e(this,\"deep\"),b,d=\"\",S,E=!0,O=e(this,\"message\");O=O?O+\": \":\"\";var k=O+\"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments\";if(p===\"Map\"||p===\"Set\")d=w?\"deeply \":\"\",S=[],h.forEach(function(U,Y){S.push(Y)}),g!==\"Array\"&&(s=Array.prototype.slice.call(arguments));else{switch(S=i.getOwnEnumerableProperties(h),g){case\"Array\":if(arguments.length>1)throw new f(k,void 0,m);break;case\"Object\":if(arguments.length>1)throw new f(k,void 0,m);s=Object.keys(s);break;default:s=Array.prototype.slice.call(arguments)}s=s.map(function(U){return typeof U==\"symbol\"?U:String(U)})}if(!s.length)throw new f(O+\"keys required\",void 0,m);var j=s.length,A=e(this,\"any\"),T=e(this,\"all\"),C=s,L=w?e(this,\"eql\"):(U,Y)=>U===Y;if(!A&&!T&&(T=!0),A&&(E=C.some(function(U){return S.some(function(Y){return L(U,Y)})})),T&&(E=C.every(function(U){return S.some(function(Y){return L(U,Y)})}),e(this,\"contains\")||(E=E&&s.length==S.length)),j>1){s=s.map(function(U){return i.inspect(U)});var ee=s.pop();T&&(b=s.join(\", \")+\", and \"+ee),A&&(b=s.join(\", \")+\", or \"+ee)}else b=i.inspect(s[0]);b=(j>1?\"keys \":\"key \")+b,b=(e(this,\"contains\")?\"contain \":\"have \")+b,this.assert(E,\"expected #{this} to \"+d+b,\"expected #{this} to not \"+d+b,C.slice(0).sort(i.compareByInspect),S.sort(i.compareByInspect),!0)}t.addMethod(\"keys\",z),t.addMethod(\"key\",z);function ge(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"object\"),m=e(this,\"ssfi\"),w=e(this,\"message\"),b=e(this,\"negate\")||!1;new t(g,w,m,!0).is.a(\"function\"),(s instanceof RegExp||typeof s==\"string\")&&(h=s,s=null);var d;try{g()}catch(ee){d=ee}var S=s===void 0&&h===void 0,E=!!(s&&h),O=!1,k=!1;if(S||!S&&!b){var j=\"an error\";s instanceof Error?j=\"#{exp}\":s&&(j=i.checkError.getConstructorName(s)),this.assert(d,\"expected #{this} to throw \"+j,\"expected #{this} to not throw an error but #{act} was thrown\",s&&s.toString(),d instanceof Error?d.toString():typeof d==\"string\"?d:d&&i.checkError.getConstructorName(d))}if(s&&d){if(s instanceof Error){var A=i.checkError.compatibleInstance(d,s);A===b&&(E&&b?O=!0:this.assert(b,\"expected #{this} to throw #{exp} but #{act} was thrown\",\"expected #{this} to not throw #{exp}\"+(d&&!b?\" but #{act} was thrown\":\"\"),s.toString(),d.toString()))}var T=i.checkError.compatibleConstructor(d,s);T===b&&(E&&b?O=!0:this.assert(b,\"expected #{this} to throw #{exp} but #{act} was thrown\",\"expected #{this} to not throw #{exp}\"+(d?\" but #{act} was thrown\":\"\"),s instanceof Error?s.toString():s&&i.checkError.getConstructorName(s),d instanceof Error?d.toString():d&&i.checkError.getConstructorName(d)))}if(d&&h!==void 0&&h!==null){var C=\"including\";h instanceof RegExp&&(C=\"matching\");var L=i.checkError.compatibleMessage(d,h);L===b&&(E&&b?k=!0:this.assert(b,\"expected #{this} to throw error \"+C+\" #{exp} but got #{act}\",\"expected #{this} to throw error not \"+C+\" #{exp}\",h,i.checkError.getMessage(d)))}O&&k&&this.assert(b,\"expected #{this} to throw #{exp} but #{act} was thrown\",\"expected #{this} to not throw #{exp}\"+(d?\" but #{act} was thrown\":\"\"),s instanceof Error?s.toString():s&&i.checkError.getConstructorName(s),d instanceof Error?d.toString():d&&i.checkError.getConstructorName(d)),e(this,\"object\",d)}t.addMethod(\"throw\",ge),t.addMethod(\"throws\",ge),t.addMethod(\"Throw\",ge);function be(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"itself\"),m=typeof p==\"function\"&&!g?p.prototype[s]:p[s];this.assert(typeof m==\"function\",\"expected #{this} to respond to \"+i.inspect(s),\"expected #{this} to not respond to \"+i.inspect(s))}t.addMethod(\"respondTo\",be),t.addMethod(\"respondsTo\",be),t.addProperty(\"itself\",function(){e(this,\"itself\",!0)});function Ne(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=s(p);this.assert(g,\"expected #{this} to satisfy \"+i.objDisplay(s),\"expected #{this} to not satisfy\"+i.objDisplay(s),!e(this,\"negate\"),g)}t.addMethod(\"satisfy\",Ne),t.addMethod(\"satisfies\",Ne);function Ae(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"object\"),m=e(this,\"message\"),w=e(this,\"ssfi\");if(new t(g,m,w,!0).is.a(\"number\"),typeof s!=\"number\"||typeof h!=\"number\"){m=m?m+\": \":\"\";var b=h===void 0?\", and a delta is required\":\"\";throw new f(m+\"the arguments to closeTo or approximately must be numbers\"+b,void 0,w)}this.assert(Math.abs(g-s)<=h,\"expected #{this} to be close to \"+s+\" +/- \"+h,\"expected #{this} not to be close to \"+s+\" +/- \"+h)}t.addMethod(\"closeTo\",Ae),t.addMethod(\"approximately\",Ae);function Ke(s,h,p,g,m){if(!g){if(s.length!==h.length)return!1;h=h.slice()}return s.every(function(w,b){if(m)return p?p(w,h[b]):w===h[b];if(!p){var d=h.indexOf(w);return d===-1?!1:(g||h.splice(d,1),!0)}return h.some(function(S,E){return p(w,S)?(g||h.splice(E,1),!0):!1})})}t.addMethod(\"members\",function(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"message\"),m=e(this,\"ssfi\");new t(p,g,m,!0).to.be.an(\"array\"),new t(s,g,m,!0).to.be.an(\"array\");var w=e(this,\"contains\"),b=e(this,\"ordered\"),d,S,E;w?(d=b?\"an ordered superset\":\"a superset\",S=\"expected #{this} to be \"+d+\" of #{exp}\",E=\"expected #{this} to not be \"+d+\" of #{exp}\"):(d=b?\"ordered members\":\"members\",S=\"expected #{this} to have the same \"+d+\" as #{exp}\",E=\"expected #{this} to not have the same \"+d+\" as #{exp}\");var O=e(this,\"deep\")?e(this,\"eql\"):void 0;this.assert(Ke(s,p,O,w,b),S,E,s,p,!0)});function Le(s,h){h&&e(this,\"message\",h);var p=e(this,\"object\"),g=e(this,\"message\"),m=e(this,\"ssfi\"),w=e(this,\"contains\"),b=e(this,\"deep\"),d=e(this,\"eql\");new t(s,g,m,!0).to.be.an(\"array\"),w?this.assert(s.some(function(S){return p.indexOf(S)>-1}),\"expected #{this} to contain one of #{exp}\",\"expected #{this} to not contain one of #{exp}\",s,p):b?this.assert(s.some(function(S){return d(p,S)}),\"expected #{this} to deeply equal one of #{exp}\",\"expected #{this} to deeply equal one of #{exp}\",s,p):this.assert(s.indexOf(p)>-1,\"expected #{this} to be one of #{exp}\",\"expected #{this} to not be one of #{exp}\",s,p)}t.addMethod(\"oneOf\",Le);function me(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"object\"),m=e(this,\"message\"),w=e(this,\"ssfi\");new t(g,m,w,!0).is.a(\"function\");var b;h?(new t(s,m,w,!0).to.have.property(h),b=s[h]):(new t(s,m,w,!0).is.a(\"function\"),b=s()),g();var d=h==null?s():s[h],S=h==null?b:\".\"+h;e(this,\"deltaMsgObj\",S),e(this,\"initialDeltaValue\",b),e(this,\"finalDeltaValue\",d),e(this,\"deltaBehavior\",\"change\"),e(this,\"realDelta\",d!==b),this.assert(b!==d,\"expected \"+S+\" to change\",\"expected \"+S+\" to not change\")}t.addMethod(\"change\",me),t.addMethod(\"changes\",me);function ve(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"object\"),m=e(this,\"message\"),w=e(this,\"ssfi\");new t(g,m,w,!0).is.a(\"function\");var b;h?(new t(s,m,w,!0).to.have.property(h),b=s[h]):(new t(s,m,w,!0).is.a(\"function\"),b=s()),new t(b,m,w,!0).is.a(\"number\"),g();var d=h==null?s():s[h],S=h==null?b:\".\"+h;e(this,\"deltaMsgObj\",S),e(this,\"initialDeltaValue\",b),e(this,\"finalDeltaValue\",d),e(this,\"deltaBehavior\",\"increase\"),e(this,\"realDelta\",d-b),this.assert(d-b>0,\"expected \"+S+\" to increase\",\"expected \"+S+\" to not increase\")}t.addMethod(\"increase\",ve),t.addMethod(\"increases\",ve);function je(s,h,p){p&&e(this,\"message\",p);var g=e(this,\"object\"),m=e(this,\"message\"),w=e(this,\"ssfi\");new t(g,m,w,!0).is.a(\"function\");var b;h?(new t(s,m,w,!0).to.have.property(h),b=s[h]):(new t(s,m,w,!0).is.a(\"function\"),b=s()),new t(b,m,w,!0).is.a(\"number\"),g();var d=h==null?s():s[h],S=h==null?b:\".\"+h;e(this,\"deltaMsgObj\",S),e(this,\"initialDeltaValue\",b),e(this,\"finalDeltaValue\",d),e(this,\"deltaBehavior\",\"decrease\"),e(this,\"realDelta\",b-d),this.assert(d-b<0,\"expected \"+S+\" to decrease\",\"expected \"+S+\" to not decrease\")}t.addMethod(\"decrease\",je),t.addMethod(\"decreases\",je);function We(s,h){h&&e(this,\"message\",h);var p=e(this,\"deltaMsgObj\"),g=e(this,\"initialDeltaValue\"),m=e(this,\"finalDeltaValue\"),w=e(this,\"deltaBehavior\"),b=e(this,\"realDelta\"),d;w===\"change\"?d=Math.abs(m-g)===Math.abs(s):d=b===Math.abs(s),this.assert(d,\"expected \"+p+\" to \"+w+\" by \"+s,\"expected \"+p+\" to not \"+w+\" by \"+s)}t.addMethod(\"by\",We),t.addProperty(\"extensible\",function(){var s=e(this,\"object\"),h=s===Object(s)&&Object.isExtensible(s);this.assert(h,\"expected #{this} to be extensible\",\"expected #{this} to not be extensible\")}),t.addProperty(\"sealed\",function(){var s=e(this,\"object\"),h=s===Object(s)?Object.isSealed(s):!0;this.assert(h,\"expected #{this} to be sealed\",\"expected #{this} to not be sealed\")}),t.addProperty(\"frozen\",function(){var s=e(this,\"object\"),h=s===Object(s)?Object.isFrozen(s):!0;this.assert(h,\"expected #{this} to be frozen\",\"expected #{this} to not be frozen\")}),t.addProperty(\"finite\",function(s){var h=e(this,\"object\");this.assert(typeof h==\"number\"&&isFinite(h),\"expected #{this} to be a finite number\",\"expected #{this} to not be a finite number\")})}});var Wn=q((Yo,Ln)=>{Ln.exports=function(a,i){a.expect=function(t,f){return new a.Assertion(t,f)},a.expect.fail=function(t,f,e,n){throw arguments.length<2&&(e=t,t=void 0),e=e||\"expect.fail()\",new a.AssertionError(e,{actual:t,expected:f,operator:n},a.expect.fail)}}});var Rn=q((Xo,Gn)=>{Gn.exports=function(a,i){var t=a.Assertion;function f(){function e(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol==\"function\"&&this instanceof Symbol||typeof BigInt==\"function\"&&this instanceof BigInt?new t(this.valueOf(),null,e):new t(this,null,e)}function n(o){Object.defineProperty(this,\"should\",{value:o,enumerable:!0,configurable:!0,writable:!0})}Object.defineProperty(Object.prototype,\"should\",{set:n,get:e,configurable:!0});var r={};return r.fail=function(o,l,v,P){throw arguments.length<2&&(v=o,o=void 0),v=v||\"should.fail()\",new a.AssertionError(v,{actual:o,expected:l,operator:P},r.fail)},r.equal=function(o,l,v){new t(o,v).to.equal(l)},r.Throw=function(o,l,v,P){new t(o,P).to.Throw(l,v)},r.exist=function(o,l){new t(o,l).to.exist},r.not={},r.not.equal=function(o,l,v){new t(o,v).to.not.equal(l)},r.not.Throw=function(o,l,v,P){new t(o,P).to.not.Throw(l,v)},r.not.exist=function(o,l){new t(o,l).to.not.exist},r.throw=r.Throw,r.not.throw=r.not.Throw,r}a.should=f,a.Should=f}});var $n=q((Ho,Un)=>{Un.exports=function(a,i){var t=a.Assertion,f=i.flag;var e=a.assert=function(n,r){var o=new t(null,null,a.assert,!0);o.assert(n,r,\"[ negation message unavailable ]\")};e.fail=function(n,r,o,l){throw arguments.length<2&&(o=n,n=void 0),o=o||\"assert.fail()\",new a.AssertionError(o,{actual:n,expected:r,operator:l},e.fail)},e.isOk=function(n,r){new t(n,r,e.isOk,!0).is.ok},e.isNotOk=function(n,r){new t(n,r,e.isNotOk,!0).is.not.ok},e.equal=function(n,r,o){var l=new t(n,o,e.equal,!0);l.assert(r==f(l,\"object\"),\"expected #{this} to equal #{exp}\",\"expected #{this} to not equal #{act}\",r,n,!0)},e.notEqual=function(n,r,o){var l=new t(n,o,e.notEqual,!0);l.assert(r!=f(l,\"object\"),\"expected #{this} to not equal #{exp}\",\"expected #{this} to equal #{act}\",r,n,!0)},e.strictEqual=function(n,r,o){new t(n,o,e.strictEqual,!0).to.equal(r)},e.notStrictEqual=function(n,r,o){new t(n,o,e.notStrictEqual,!0).to.not.equal(r)},e.deepEqual=e.deepStrictEqual=function(n,r,o){new t(n,o,e.deepEqual,!0).to.eql(r)},e.notDeepEqual=function(n,r,o){new t(n,o,e.notDeepEqual,!0).to.not.eql(r)},e.isAbove=function(n,r,o){new t(n,o,e.isAbove,!0).to.be.above(r)},e.isAtLeast=function(n,r,o){new t(n,o,e.isAtLeast,!0).to.be.least(r)},e.isBelow=function(n,r,o){new t(n,o,e.isBelow,!0).to.be.below(r)},e.isAtMost=function(n,r,o){new t(n,o,e.isAtMost,!0).to.be.most(r)},e.isTrue=function(n,r){new t(n,r,e.isTrue,!0).is.true},e.isNotTrue=function(n,r){new t(n,r,e.isNotTrue,!0).to.not.equal(!0)},e.isFalse=function(n,r){new t(n,r,e.isFalse,!0).is.false},e.isNotFalse=function(n,r){new t(n,r,e.isNotFalse,!0).to.not.equal(!1)},e.isNull=function(n,r){new t(n,r,e.isNull,!0).to.equal(null)},e.isNotNull=function(n,r){new t(n,r,e.isNotNull,!0).to.not.equal(null)},e.isNaN=function(n,r){new t(n,r,e.isNaN,!0).to.be.NaN},e.isNotNaN=function(n,r){new t(n,r,e.isNotNaN,!0).not.to.be.NaN},e.exists=function(n,r){new t(n,r,e.exists,!0).to.exist},e.notExists=function(n,r){new t(n,r,e.notExists,!0).to.not.exist},e.isUndefined=function(n,r){new t(n,r,e.isUndefined,!0).to.equal(void 0)},e.isDefined=function(n,r){new t(n,r,e.isDefined,!0).to.not.equal(void 0)},e.isFunction=function(n,r){new t(n,r,e.isFunction,!0).to.be.a(\"function\")},e.isNotFunction=function(n,r){new t(n,r,e.isNotFunction,!0).to.not.be.a(\"function\")},e.isObject=function(n,r){new t(n,r,e.isObject,!0).to.be.a(\"object\")},e.isNotObject=function(n,r){new t(n,r,e.isNotObject,!0).to.not.be.a(\"object\")},e.isArray=function(n,r){new t(n,r,e.isArray,!0).to.be.an(\"array\")},e.isNotArray=function(n,r){new t(n,r,e.isNotArray,!0).to.not.be.an(\"array\")},e.isString=function(n,r){new t(n,r,e.isString,!0).to.be.a(\"string\")},e.isNotString=function(n,r){new t(n,r,e.isNotString,!0).to.not.be.a(\"string\")},e.isNumber=function(n,r){new t(n,r,e.isNumber,!0).to.be.a(\"number\")},e.isNotNumber=function(n,r){new t(n,r,e.isNotNumber,!0).to.not.be.a(\"number\")},e.isFinite=function(n,r){new t(n,r,e.isFinite,!0).to.be.finite},e.isBoolean=function(n,r){new t(n,r,e.isBoolean,!0).to.be.a(\"boolean\")},e.isNotBoolean=function(n,r){new t(n,r,e.isNotBoolean,!0).to.not.be.a(\"boolean\")},e.typeOf=function(n,r,o){new t(n,o,e.typeOf,!0).to.be.a(r)},e.notTypeOf=function(n,r,o){new t(n,o,e.notTypeOf,!0).to.not.be.a(r)},e.instanceOf=function(n,r,o){new t(n,o,e.instanceOf,!0).to.be.instanceOf(r)},e.notInstanceOf=function(n,r,o){new t(n,o,e.notInstanceOf,!0).to.not.be.instanceOf(r)},e.include=function(n,r,o){new t(n,o,e.include,!0).include(r)},e.notInclude=function(n,r,o){new t(n,o,e.notInclude,!0).not.include(r)},e.deepInclude=function(n,r,o){new t(n,o,e.deepInclude,!0).deep.include(r)},e.notDeepInclude=function(n,r,o){new t(n,o,e.notDeepInclude,!0).not.deep.include(r)},e.nestedInclude=function(n,r,o){new t(n,o,e.nestedInclude,!0).nested.include(r)},e.notNestedInclude=function(n,r,o){new t(n,o,e.notNestedInclude,!0).not.nested.include(r)},e.deepNestedInclude=function(n,r,o){new t(n,o,e.deepNestedInclude,!0).deep.nested.include(r)},e.notDeepNestedInclude=function(n,r,o){new t(n,o,e.notDeepNestedInclude,!0).not.deep.nested.include(r)},e.ownInclude=function(n,r,o){new t(n,o,e.ownInclude,!0).own.include(r)},e.notOwnInclude=function(n,r,o){new t(n,o,e.notOwnInclude,!0).not.own.include(r)},e.deepOwnInclude=function(n,r,o){new t(n,o,e.deepOwnInclude,!0).deep.own.include(r)},e.notDeepOwnInclude=function(n,r,o){new t(n,o,e.notDeepOwnInclude,!0).not.deep.own.include(r)},e.match=function(n,r,o){new t(n,o,e.match,!0).to.match(r)},e.notMatch=function(n,r,o){new t(n,o,e.notMatch,!0).to.not.match(r)},e.property=function(n,r,o){new t(n,o,e.property,!0).to.have.property(r)},e.notProperty=function(n,r,o){new t(n,o,e.notProperty,!0).to.not.have.property(r)},e.propertyVal=function(n,r,o,l){new t(n,l,e.propertyVal,!0).to.have.property(r,o)},e.notPropertyVal=function(n,r,o,l){new t(n,l,e.notPropertyVal,!0).to.not.have.property(r,o)},e.deepPropertyVal=function(n,r,o,l){new t(n,l,e.deepPropertyVal,!0).to.have.deep.property(r,o)},e.notDeepPropertyVal=function(n,r,o,l){new t(n,l,e.notDeepPropertyVal,!0).to.not.have.deep.property(r,o)},e.ownProperty=function(n,r,o){new t(n,o,e.ownProperty,!0).to.have.own.property(r)},e.notOwnProperty=function(n,r,o){new t(n,o,e.notOwnProperty,!0).to.not.have.own.property(r)},e.ownPropertyVal=function(n,r,o,l){new t(n,l,e.ownPropertyVal,!0).to.have.own.property(r,o)},e.notOwnPropertyVal=function(n,r,o,l){new t(n,l,e.notOwnPropertyVal,!0).to.not.have.own.property(r,o)},e.deepOwnPropertyVal=function(n,r,o,l){new t(n,l,e.deepOwnPropertyVal,!0).to.have.deep.own.property(r,o)},e.notDeepOwnPropertyVal=function(n,r,o,l){new t(n,l,e.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(r,o)},e.nestedProperty=function(n,r,o){new t(n,o,e.nestedProperty,!0).to.have.nested.property(r)},e.notNestedProperty=function(n,r,o){new t(n,o,e.notNestedProperty,!0).to.not.have.nested.property(r)},e.nestedPropertyVal=function(n,r,o,l){new t(n,l,e.nestedPropertyVal,!0).to.have.nested.property(r,o)},e.notNestedPropertyVal=function(n,r,o,l){new t(n,l,e.notNestedPropertyVal,!0).to.not.have.nested.property(r,o)},e.deepNestedPropertyVal=function(n,r,o,l){new t(n,l,e.deepNestedPropertyVal,!0).to.have.deep.nested.property(r,o)},e.notDeepNestedPropertyVal=function(n,r,o,l){new t(n,l,e.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(r,o)},e.lengthOf=function(n,r,o){new t(n,o,e.lengthOf,!0).to.have.lengthOf(r)},e.hasAnyKeys=function(n,r,o){new t(n,o,e.hasAnyKeys,!0).to.have.any.keys(r)},e.hasAllKeys=function(n,r,o){new t(n,o,e.hasAllKeys,!0).to.have.all.keys(r)},e.containsAllKeys=function(n,r,o){new t(n,o,e.containsAllKeys,!0).to.contain.all.keys(r)},e.doesNotHaveAnyKeys=function(n,r,o){new t(n,o,e.doesNotHaveAnyKeys,!0).to.not.have.any.keys(r)},e.doesNotHaveAllKeys=function(n,r,o){new t(n,o,e.doesNotHaveAllKeys,!0).to.not.have.all.keys(r)},e.hasAnyDeepKeys=function(n,r,o){new t(n,o,e.hasAnyDeepKeys,!0).to.have.any.deep.keys(r)},e.hasAllDeepKeys=function(n,r,o){new t(n,o,e.hasAllDeepKeys,!0).to.have.all.deep.keys(r)},e.containsAllDeepKeys=function(n,r,o){new t(n,o,e.containsAllDeepKeys,!0).to.contain.all.deep.keys(r)},e.doesNotHaveAnyDeepKeys=function(n,r,o){new t(n,o,e.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(r)},e.doesNotHaveAllDeepKeys=function(n,r,o){new t(n,o,e.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(r)},e.throws=function(n,r,o,l){(typeof r==\"string\"||r instanceof RegExp)&&(o=r,r=null);var v=new t(n,l,e.throws,!0).to.throw(r,o);return f(v,\"object\")},e.doesNotThrow=function(n,r,o,l){(typeof r==\"string\"||r instanceof RegExp)&&(o=r,r=null),new t(n,l,e.doesNotThrow,!0).to.not.throw(r,o)},e.operator=function(n,r,o,l){var v;switch(r){case\"==\":v=n==o;break;case\"===\":v=n===o;break;case\">\":v=n>o;break;case\">=\":v=n>=o;break;case\"<\":v=n{var _n=[];$.version=\"4.3.8\";$.AssertionError=$e();var Jn=Cn();$.use=function(a){return~_n.indexOf(a)||(a($,Jn),_n.push(a)),$};$.util=Jn;var uo=se();$.config=uo;var co=Fn();$.use(co);var fo=Kn();$.use(fo);var lo=Wn();$.use(lo);var ho=Rn();$.use(ho);var po=$n();$.use(po)});var Qn=q((ti,Zn)=>{Zn.exports=ne()});module.exports=Qn();\n\n })(module, exports);\n return module.exports;\n}"; diff --git a/packages/insomnia/src/templating/sandbox/vendored/uuid.generated.ts b/packages/insomnia/src/templating/sandbox/vendored/uuid.generated.ts index 193a3c2e719..7becd85b602 100644 --- a/packages/insomnia/src/templating/sandbox/vendored/uuid.generated.ts +++ b/packages/insomnia/src/templating/sandbox/vendored/uuid.generated.ts @@ -2,6 +2,6 @@ // Vendored, pinned bundle of "uuid" for the QuickJS template-tag sandbox (M3). // Sourced from the isolated install in vendored/pkg/ (see its package.json) — NOT the app's own node_modules. // Regenerate with: npm run sandbox:vendored:generate -w insomnia - +/* eslint-disable */ export const UUID_FACTORY_VERSION = "11.1.1"; export const UUID_FACTORY_SOURCE = "function () {\n var module = { exports: {} };\n var exports = module.exports;\n (function (module, exports) {\nvar a=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var fe=a(L=>{\"use strict\";Object.defineProperty(L,\"__esModule\",{value:!0});L.default=\"ffffffff-ffff-ffff-ffff-ffffffffffff\"});var oe=a(N=>{\"use strict\";Object.defineProperty(N,\"__esModule\",{value:!0});N.default=\"00000000-0000-0000-0000-000000000000\"});var ce=a(E=>{\"use strict\";Object.defineProperty(E,\"__esModule\",{value:!0});E.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var O=a($=>{\"use strict\";Object.defineProperty($,\"__esModule\",{value:!0});var Ae=ce();function Ve(e){return typeof e==\"string\"&&Ae.default.test(e)}$.default=Ve});var x=a(k=>{\"use strict\";Object.defineProperty(k,\"__esModule\",{value:!0});var Le=O();function Ne(e){if(!(0,Le.default)(e))throw TypeError(\"Invalid UUID\");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}k.default=Ne});var p=a(P=>{\"use strict\";Object.defineProperty(P,\"__esModule\",{value:!0});P.unsafeStringify=void 0;var Ee=O(),_=[];for(let e=0;e<256;++e)_.push((e+256).toString(16).slice(1));function le(e,t=0){return(_[e[t+0]]+_[e[t+1]]+_[e[t+2]]+_[e[t+3]]+\"-\"+_[e[t+4]]+_[e[t+5]]+\"-\"+_[e[t+6]]+_[e[t+7]]+\"-\"+_[e[t+8]]+_[e[t+9]]+\"-\"+_[e[t+10]]+_[e[t+11]]+_[e[t+12]]+_[e[t+13]]+_[e[t+14]]+_[e[t+15]]).toLowerCase()}P.unsafeStringify=le;function $e(e,t=0){let u=le(e,t);if(!(0,Ee.default)(u))throw TypeError(\"Stringified UUID is invalid\");return u}P.default=$e});var T=a(H=>{\"use strict\";Object.defineProperty(H,\"__esModule\",{value:!0});var C,ke=new Uint8Array(16);function Ce(){if(!C){if(typeof crypto>\"u\"||!crypto.getRandomValues)throw new Error(\"crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\");C=crypto.getRandomValues.bind(crypto)}return C(ke)}H.default=Ce});var K=a(D=>{\"use strict\";Object.defineProperty(D,\"__esModule\",{value:!0});D.updateV1State=void 0;var de=T(),He=p(),S={};function Ke(e,t,u){let r,n=e?._v6??!1;if(e){let i=Object.keys(e);i.length===1&&i[0]===\"_v6\"&&(e=void 0)}if(e)r=ae(e.random??e.rng?.()??(0,de.default)(),e.msecs,e.nsecs,e.clockseq,e.node,t,u);else{let i=Date.now(),f=(0,de.default)();se(S,i,f),r=ae(f,S.msecs,S.nsecs,n?void 0:S.clockseq,n?void 0:S.node,t,u)}return t??(0,He.unsafeStringify)(r)}function se(e,t,u){return e.msecs??(e.msecs=-1/0),e.nsecs??(e.nsecs=0),t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t= 16\");if(!i)i=new Uint8Array(16),f=0;else if(f<0||f+16>i.length)throw new RangeError(`UUID byte range ${f}:${f+15} is out of buffer bounds`);t??(t=Date.now()),u??(u=0),r??(r=(e[8]<<8|e[9])&16383),n??(n=e.slice(10,16)),t+=122192928e5;let o=((t&268435455)*1e4+u)%4294967296;i[f++]=o>>>24&255,i[f++]=o>>>16&255,i[f++]=o>>>8&255,i[f++]=o&255;let l=t/4294967296*1e4&268435455;i[f++]=l>>>8&255,i[f++]=l&255,i[f++]=l>>>24&15|16,i[f++]=l>>>16&255,i[f++]=r>>>8|128,i[f++]=r&255;for(let d=0;d<6;++d)i[f++]=n[d];return i}D.default=Ke});var W=a(X=>{\"use strict\";Object.defineProperty(X,\"__esModule\",{value:!0});var Xe=x(),We=p();function Fe(e){let t=typeof e==\"string\"?(0,Xe.default)(e):e,u=Ge(t);return typeof e==\"string\"?(0,We.unsafeStringify)(u):u}X.default=Fe;function Ge(e){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}});var ge=a(F=>{\"use strict\";Object.defineProperty(F,\"__esModule\",{value:!0});function Je(e){let t=Ze(e),u=Ye(t,e.length*8);return Qe(u)}function Qe(e){let t=new Uint8Array(e.length*4);for(let u=0;u>2]>>>u%4*8&255;return t}function _e(e){return(e+64>>>9<<4)+14+1}function Ye(e,t){let u=new Uint32Array(_e(t)).fill(0);u.set(e),u[t>>5]|=128<>2]|=(e[u]&255)<>16)+(t>>16)+(u>>16)<<16|u&65535}function ze(e,t){return e<>>32-t}function A(e,t,u,r,n,i){return h(ze(h(h(t,e),h(r,i)),n),u)}function g(e,t,u,r,n,i,f){return A(t&u|~t&r,e,t,n,i,f)}function j(e,t,u,r,n,i,f){return A(t&r|u&~r,e,t,n,i,f)}function y(e,t,u,r,n,i,f){return A(t^u^r,e,t,n,i,f)}function v(e,t,u,r,n,i,f){return A(u^(t|~r),e,t,n,i,f)}F.default=Je});var M=a(U=>{\"use strict\";Object.defineProperty(U,\"__esModule\",{value:!0});U.URL=U.DNS=U.stringToBytes=void 0;var je=x(),Be=p();function ye(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let u=0;un.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let d=0;d<16;++d)n[i+d]=l[d];return n}return(0,Be.unsafeStringify)(l)}U.default=er});var pe=a(m=>{\"use strict\";Object.defineProperty(m,\"__esModule\",{value:!0});m.URL=m.DNS=void 0;var rr=ge(),G=M(),ve=M();Object.defineProperty(m,\"DNS\",{enumerable:!0,get:function(){return ve.DNS}});Object.defineProperty(m,\"URL\",{enumerable:!0,get:function(){return ve.URL}});function J(e,t,u,r){return(0,G.default)(48,rr.default,e,t,u,r)}J.DNS=G.DNS;J.URL=G.URL;m.default=J});var Ue=a(Q=>{\"use strict\";Object.defineProperty(Q,\"__esModule\",{value:!0});var nr=typeof crypto<\"u\"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);Q.default={randomUUID:nr}});var me=a(Y=>{\"use strict\";Object.defineProperty(Y,\"__esModule\",{value:!0});var he=Ue(),tr=T(),ur=p();function ir(e,t,u){if(he.default.randomUUID&&!t&&!e)return he.default.randomUUID();e=e||{};let r=e.random??e.rng?.()??(0,tr.default)();if(r.length<16)throw new Error(\"Random bytes length must be >= 16\");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(u=u||0,u<0||u+16>t.length)throw new RangeError(`UUID byte range ${u}:${u+15} is out of buffer bounds`);for(let n=0;n<16;++n)t[u+n]=r[n];return t}return(0,ur.unsafeStringify)(r)}Y.default=ir});var we=a(z=>{\"use strict\";Object.defineProperty(z,\"__esModule\",{value:!0});function fr(e,t,u,r){switch(e){case 0:return t&u^~t&r;case 1:return t^u^r;case 2:return t&u^t&r^u&r;case 3:return t^u^r}}function Z(e,t){return e<>>32-t}function or(e){let t=[1518500249,1859775393,2400959708,3395469782],u=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(e.length+1);r.set(e),r[e.length]=128,e=r;let n=e.length/4+2,i=Math.ceil(n/16),f=new Array(i);for(let o=0;o>>0;V=I,I=q,q=Z(b,30)>>>0,b=d,d=Te}u[0]=u[0]+d>>>0,u[1]=u[1]+b>>>0,u[2]=u[2]+q>>>0,u[3]=u[3]+I>>>0,u[4]=u[4]+V>>>0}return Uint8Array.of(u[0]>>24,u[0]>>16,u[0]>>8,u[0],u[1]>>24,u[1]>>16,u[1]>>8,u[1],u[2]>>24,u[2]>>16,u[2]>>8,u[2],u[3]>>24,u[3]>>16,u[3]>>8,u[3],u[4]>>24,u[4]>>16,u[4]>>8,u[4])}z.default=or});var qe=a(w=>{\"use strict\";Object.defineProperty(w,\"__esModule\",{value:!0});w.URL=w.DNS=void 0;var cr=we(),B=M(),be=M();Object.defineProperty(w,\"DNS\",{enumerable:!0,get:function(){return be.DNS}});Object.defineProperty(w,\"URL\",{enumerable:!0,get:function(){return be.URL}});function ee(e,t,u,r){return(0,B.default)(80,cr.default,e,t,u,r)}ee.DNS=B.DNS;ee.URL=B.URL;w.default=ee});var Oe=a(re=>{\"use strict\";Object.defineProperty(re,\"__esModule\",{value:!0});var lr=p(),dr=K(),ar=W();function sr(e,t,u){e??(e={}),u??(u=0);let r=(0,dr.default)({...e,_v6:!0},new Uint8Array(16));if(r=(0,ar.default)(r),t){if(u<0||u+16>t.length)throw new RangeError(`UUID byte range ${u}:${u+15} is out of buffer bounds`);for(let n=0;n<16;n++)t[u+n]=r[n];return t}return(0,lr.unsafeStringify)(r)}re.default=sr});var xe=a(ne=>{\"use strict\";Object.defineProperty(ne,\"__esModule\",{value:!0});var _r=x(),gr=p();function jr(e){let t=typeof e==\"string\"?(0,_r.default)(e):e,u=yr(t);return typeof e==\"string\"?(0,gr.unsafeStringify)(u):u}ne.default=jr;function yr(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}});var Me=a(R=>{\"use strict\";Object.defineProperty(R,\"__esModule\",{value:!0});R.updateV7State=void 0;var Pe=T(),vr=p(),te={};function pr(e,t,u){let r;if(e)r=Se(e.random??e.rng?.()??(0,Pe.default)(),e.msecs,e.seq,t,u);else{let n=Date.now(),i=(0,Pe.default)();De(te,n,i),r=Se(i,te.msecs,te.seq,t,u)}return t??(0,vr.unsafeStringify)(r)}function De(e,t,u){return e.msecs??(e.msecs=-1/0),e.seq??(e.seq=0),t>e.msecs?(e.seq=u[6]<<23|u[7]<<16|u[8]<<8|u[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}R.updateV7State=De;function Se(e,t,u,r,n=0){if(e.length<16)throw new Error(\"Random bytes length must be >= 16\");if(!r)r=new Uint8Array(16),n=0;else if(n<0||n+16>r.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);return t??(t=Date.now()),u??(u=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9]),r[n++]=t/1099511627776&255,r[n++]=t/4294967296&255,r[n++]=t/16777216&255,r[n++]=t/65536&255,r[n++]=t/256&255,r[n++]=t&255,r[n++]=112|u>>>28&15,r[n++]=u>>>20&255,r[n++]=128|u>>>14&63,r[n++]=u>>>6&255,r[n++]=u<<2&255|e[10]&3,r[n++]=e[11],r[n++]=e[12],r[n++]=e[13],r[n++]=e[14],r[n++]=e[15],r}R.default=pr});var Re=a(ue=>{\"use strict\";Object.defineProperty(ue,\"__esModule\",{value:!0});var Ur=O();function hr(e){if(!(0,Ur.default)(e))throw TypeError(\"Invalid UUID\");return parseInt(e.slice(14,15),16)}ue.default=hr});var Ie=a(c=>{\"use strict\";Object.defineProperty(c,\"__esModule\",{value:!0});c.version=c.validate=c.v7=c.v6ToV1=c.v6=c.v5=c.v4=c.v3=c.v1ToV6=c.v1=c.stringify=c.parse=c.NIL=c.MAX=void 0;var mr=fe();Object.defineProperty(c,\"MAX\",{enumerable:!0,get:function(){return mr.default}});var wr=oe();Object.defineProperty(c,\"NIL\",{enumerable:!0,get:function(){return wr.default}});var br=x();Object.defineProperty(c,\"parse\",{enumerable:!0,get:function(){return br.default}});var qr=p();Object.defineProperty(c,\"stringify\",{enumerable:!0,get:function(){return qr.default}});var Or=K();Object.defineProperty(c,\"v1\",{enumerable:!0,get:function(){return Or.default}});var xr=W();Object.defineProperty(c,\"v1ToV6\",{enumerable:!0,get:function(){return xr.default}});var Pr=pe();Object.defineProperty(c,\"v3\",{enumerable:!0,get:function(){return Pr.default}});var Sr=me();Object.defineProperty(c,\"v4\",{enumerable:!0,get:function(){return Sr.default}});var Dr=qe();Object.defineProperty(c,\"v5\",{enumerable:!0,get:function(){return Dr.default}});var Mr=Oe();Object.defineProperty(c,\"v6\",{enumerable:!0,get:function(){return Mr.default}});var Rr=xe();Object.defineProperty(c,\"v6ToV1\",{enumerable:!0,get:function(){return Rr.default}});var Ir=Me();Object.defineProperty(c,\"v7\",{enumerable:!0,get:function(){return Ir.default}});var Tr=O();Object.defineProperty(c,\"validate\",{enumerable:!0,get:function(){return Tr.default}});var Ar=Re();Object.defineProperty(c,\"version\",{enumerable:!0,get:function(){return Ar.default}})});module.exports=Ie();\n\n })(module, exports);\n return module.exports;\n}";