@recursica/adapter-tester 2.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -16
- package/dist/adapter-tester.schema.json.d.ts +14 -10
- package/dist/cli.cjs +20 -24
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +235 -4842
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +46 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/fileConfig.d.ts +9 -2
- package/dist/fileConfig.d.ts.map +1 -1
- package/dist/golden/diffPng.d.ts +8 -0
- package/dist/golden/diffPng.d.ts.map +1 -0
- package/dist/golden/manifest.schema.json.d.ts +27 -0
- package/dist/golden/manifestStore.d.ts +15 -0
- package/dist/golden/manifestStore.d.ts.map +1 -0
- package/dist/golden/resolveSourceOfTruthGolden.d.ts +29 -0
- package/dist/golden/resolveSourceOfTruthGolden.d.ts.map +1 -0
- package/dist/golden/validateManifest.d.ts +7 -0
- package/dist/golden/validateManifest.d.ts.map +1 -0
- package/dist/index-C6uYPRmx.cjs +9 -0
- package/dist/index-C6uYPRmx.cjs.map +1 -0
- package/dist/index-DqQzFSAH.js +4667 -0
- package/dist/index-DqQzFSAH.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -6
- package/dist/index.js.map +1 -1
- package/dist/testing/runVisualRegression.d.ts +22 -5
- package/dist/testing/runVisualRegression.d.ts.map +1 -1
- package/dist/testing.cjs +4 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +221 -151
- package/dist/testing.js.map +1 -1
- package/package.json +3 -2
- package/src/adapter-tester.schema.json +14 -10
- package/src/golden/manifest.schema.json +24 -0
- package/dist/config-B0Eop8Az.cjs +0 -2
- package/dist/config-B0Eop8Az.cjs.map +0 -1
- package/dist/config-CDxTeSAY.js +0 -21
- package/dist/config-CDxTeSAY.js.map +0 -1
package/dist/config.d.ts
CHANGED
|
@@ -9,18 +9,44 @@ export interface AdapterTarget {
|
|
|
9
9
|
*/
|
|
10
10
|
sourceOfTruth?: boolean;
|
|
11
11
|
}
|
|
12
|
+
/** How `runVisualRegression` reaches the source-of-truth adapter's (mantine)
|
|
13
|
+
* own golden images, for the divergence check. Never involves booting a
|
|
14
|
+
* Storybook — both `readImage` targets are plain files on disk. */
|
|
15
|
+
export type SourceOfTruthGoldenLocation = {
|
|
16
|
+
/** Sibling package already checked out locally (this monorepo's own
|
|
17
|
+
* `sourceOfTruth.type: "url"` mode) — read its `test/golden/` directly. */
|
|
18
|
+
type: "local";
|
|
19
|
+
/** Absolute path to the source-of-truth adapter's `test/golden/` directory. */
|
|
20
|
+
dir: string;
|
|
21
|
+
} | {
|
|
22
|
+
/** No local checkout (the default, standalone-repo mode) — resolve the
|
|
23
|
+
* installed version against the npm registry, then fetch that git tag's
|
|
24
|
+
* `test/golden/` from the public GitHub repo, caching what's downloaded. */
|
|
25
|
+
type: "npm";
|
|
26
|
+
packageName: string;
|
|
27
|
+
/** npm version/dist-tag to resolve, e.g. "latest" or a pinned version. */
|
|
28
|
+
versionSpec: string;
|
|
29
|
+
/** Directory downloaded manifest/images are cached in between runs. */
|
|
30
|
+
cacheDir: string;
|
|
31
|
+
};
|
|
32
|
+
export type GoldenMode = "check" | "update-golden" | "approve-divergence";
|
|
12
33
|
export interface AdapterTesterConfig {
|
|
13
34
|
targets: AdapterTarget[];
|
|
14
35
|
/** Global pixel-diff threshold applied to every story comparison. */
|
|
15
36
|
diffThresholdPixels: number;
|
|
16
37
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
38
|
+
* Per-story diff threshold overrides, keyed by story id prefix (a story
|
|
39
|
+
* matches if its id equals the key or starts with it). Overrides
|
|
40
|
+
* `diffThresholdPixels` for components with acceptable cross-library
|
|
41
|
+
* structural variation (e.g. native control widgets). When more than one
|
|
42
|
+
* key matches, the longest (most specific) key wins.
|
|
20
43
|
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
|
|
44
|
+
storyThresholds?: Record<string, number>;
|
|
45
|
+
/**
|
|
46
|
+
* Story id prefixes (same matching rule as `storyThresholds`) skipped
|
|
47
|
+
* entirely — no own-drift check, no divergence check, no golden captured.
|
|
48
|
+
*/
|
|
49
|
+
excludeStoryIds?: string[];
|
|
24
50
|
/**
|
|
25
51
|
* Storybook entry title categories excluded from the comparison — an
|
|
26
52
|
* entry is excluded if its title equals one of these or starts with
|
|
@@ -31,6 +57,20 @@ export interface AdapterTesterConfig {
|
|
|
31
57
|
* cross-adapter counterpart to diff against.
|
|
32
58
|
*/
|
|
33
59
|
excludeTitlePrefixes?: string[];
|
|
60
|
+
/** Absolute path to this project's own `test/golden/` directory — where
|
|
61
|
+
* golden PNGs and `manifest.json` are stored, committed to git. */
|
|
62
|
+
goldenDir: string;
|
|
63
|
+
/**
|
|
64
|
+
* True only for the source-of-truth adapter's own config (mantine). It has
|
|
65
|
+
* nothing above it to diverge from, so the divergence check is skipped
|
|
66
|
+
* entirely and `sourceOfTruthGolden` is ignored.
|
|
67
|
+
*/
|
|
68
|
+
isSourceOfTruthAdapter: boolean;
|
|
69
|
+
/** How to reach the source-of-truth's golden images. Required unless
|
|
70
|
+
* `isSourceOfTruthAdapter` is true. */
|
|
71
|
+
sourceOfTruthGolden?: SourceOfTruthGoldenLocation;
|
|
72
|
+
/** Set by the CLI from `--update-golden`/`--approve-divergence`. Defaults to `"check"`. */
|
|
73
|
+
goldenMode: GoldenMode;
|
|
34
74
|
}
|
|
35
75
|
export declare function defineAdapterTesterConfig(config: AdapterTesterConfig): AdapterTesterConfig;
|
|
36
76
|
export declare function getSourceOfTruth(config: AdapterTesterConfig): AdapterTarget;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,qEAAqE;IACrE,mBAAmB,EAAE,MAAM,CAAC;IAC5B
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;mEAEmE;AACnE,MAAM,MAAM,2BAA2B,GACnC;IACE;+EAC2E;IAC3E,IAAI,EAAE,OAAO,CAAC;IACd,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAC;CACb,GACD;IACE;;gFAE4E;IAC5E,IAAI,EAAE,KAAK,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,eAAe,GAAG,oBAAoB,CAAC;AAE1E,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,qEAAqE;IACrE,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC;uEACmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;2CACuC;IACvC,mBAAmB,CAAC,EAAE,2BAA2B,CAAC;IAClD,2FAA2F;IAC3F,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAUrB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAM3E"}
|
package/dist/fileConfig.d.ts
CHANGED
|
@@ -36,9 +36,16 @@ export interface AdapterTesterFileConfig {
|
|
|
36
36
|
storybook?: StorybookTargetFileConfig;
|
|
37
37
|
sourceOfTruth?: SourceOfTruthFileConfig;
|
|
38
38
|
diffThresholdPixels?: number;
|
|
39
|
-
|
|
40
|
-
relaxedThresholdPixels?: number;
|
|
39
|
+
storyThresholds?: Record<string, number>;
|
|
41
40
|
excludeTitlePrefixes?: string[];
|
|
41
|
+
excludeStoryIds?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* True only for the source-of-truth adapter's own config (mantine-adapter).
|
|
44
|
+
* Skips `sourceOfTruth` entirely — there's nothing above it to diverge
|
|
45
|
+
* from — and runs the own-drift golden check standalone, against just this
|
|
46
|
+
* project's own Storybook. Defaults to false.
|
|
47
|
+
*/
|
|
48
|
+
isSourceOfTruthAdapter?: boolean;
|
|
42
49
|
}
|
|
43
50
|
export interface ResolvedAdapterTesterConfig {
|
|
44
51
|
engineConfig: AdapterTesterConfig;
|
package/dist/fileConfig.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileConfig.d.ts","sourceRoot":"","sources":["../src/fileConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"fileConfig.d.ts","sourceRoot":"","sources":["../src/fileConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAMhF,eAAO,MAAM,gBAAgB,+BAA+B,CAAC;AAO7D,UAAU,yBAAyB;IACjC;;wEAEoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,UAAU,qCAAqC;IAC7C;gFAC4E;IAC5E,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,UAAU,0BAA0B;IAClC;yEACqE;IACrE,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,KAAK,uBAAuB,GACxB,qCAAqC,GACrC,0BAA0B,CAAC;AAE/B,MAAM,WAAW,uBAAuB;IACtC;uFACmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,mBAAmB,CAAC;IAClC,UAAU,EAAE,sBAAsB,EAAE,CAAC;CACtC;AAmCD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,2BAA2B,CAgHtE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pixel-diffs two PNG buffers. Returns the mismatched-pixel count, or
|
|
3
|
+
* `Infinity` if the two images aren't even the same dimensions — pixelmatch
|
|
4
|
+
* itself throws on a size mismatch, and a size mismatch is itself a real
|
|
5
|
+
* difference, not something to swallow.
|
|
6
|
+
*/
|
|
7
|
+
export declare function diffPngBuffers(a: Buffer, b: Buffer): number;
|
|
8
|
+
//# sourceMappingURL=diffPng.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diffPng.d.ts","sourceRoot":"","sources":["../../src/golden/diffPng.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAU3D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://github.com/borderux/recursica/tree/main/packages/adapter-tester/src/golden/manifest.schema.json",
|
|
4
|
+
"title": "test/golden/manifest.json",
|
|
5
|
+
"description": "Tracks golden (baseline) image metadata for @recursica/adapter-tester's golden-image visual regression checks. One manifest lives alongside its adapter's test/golden/<story-id>.png files, keyed by story id.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"required": ["createdAt"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"createdAt": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"format": "date-time",
|
|
15
|
+
"description": "When this story's own golden PNG was last captured, via --update-golden, --approve-divergence, or first-run auto-create."
|
|
16
|
+
},
|
|
17
|
+
"sourceOfTruthCreatedAt": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"format": "date-time",
|
|
20
|
+
"description": "The source-of-truth adapter's (mantine) manifest `createdAt` for this story at the time this adapter's divergence from it was last reviewed via --approve-divergence. Omitted on the source-of-truth adapter's own manifest, and omitted here until the first approval. If mantine's current `createdAt` for this story is newer than this value, the divergence is flagged again for re-review."
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
;
|
|
26
|
+
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface GoldenManifestEntry {
|
|
2
|
+
createdAt: string;
|
|
3
|
+
sourceOfTruthCreatedAt?: string;
|
|
4
|
+
}
|
|
5
|
+
export type GoldenManifest = Record<string, GoldenManifestEntry>;
|
|
6
|
+
export declare function manifestPath(goldenDir: string): string;
|
|
7
|
+
export declare function goldenImagePath(goldenDir: string, storyId: string): string;
|
|
8
|
+
/** Returns `{}` if no manifest exists yet — a fresh adapter with no goldens
|
|
9
|
+
* captured is the normal starting state, not an error. */
|
|
10
|
+
export declare function loadManifest(goldenDir: string): GoldenManifest;
|
|
11
|
+
/** Validates before writing, and sorts keys so the diff on a reviewed PR is
|
|
12
|
+
* stable regardless of the order stories happened to run in. */
|
|
13
|
+
export declare function saveManifest(goldenDir: string, manifest: GoldenManifest): void;
|
|
14
|
+
export declare function saveGoldenImage(goldenDir: string, storyId: string, buffer: Buffer): void;
|
|
15
|
+
//# sourceMappingURL=manifestStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifestStore.d.ts","sourceRoot":"","sources":["../../src/golden/manifestStore.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAEjE,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED;0DAC0D;AAC1D,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAM9D;AAED;gEACgE;AAChE,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,IAAI,CASN;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,IAAI,CAGN"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SourceOfTruthGoldenLocation } from '../config.js';
|
|
2
|
+
import { GoldenManifest } from './manifestStore.js';
|
|
3
|
+
export interface SourceOfTruthGolden {
|
|
4
|
+
manifest: GoldenManifest;
|
|
5
|
+
/** Returns the golden PNG bytes for a story, or `null` if the source of
|
|
6
|
+
* truth has no golden captured for it yet. */
|
|
7
|
+
readImage(storyId: string): Promise<Buffer | null>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Resolves the source-of-truth adapter's golden images for the divergence
|
|
11
|
+
* check. Never boots a Storybook — both location types resolve to plain
|
|
12
|
+
* files, fetched once and cached, not re-diffed per pixel over the wire.
|
|
13
|
+
*
|
|
14
|
+
* `location.type === "local"`: a sibling package already checked out (this
|
|
15
|
+
* monorepo's own `sourceOfTruth.type: "url"` mode) — read its
|
|
16
|
+
* `test/golden/` directly, including any uncommitted local changes.
|
|
17
|
+
*
|
|
18
|
+
* `location.type === "npm"`: no local checkout (the default, standalone-repo
|
|
19
|
+
* mode) — resolve the installed version against the npm registry, then fetch
|
|
20
|
+
* that exact version's `test/golden/` from the public GitHub repo at the
|
|
21
|
+
* matching release tag (changesets tags every release as
|
|
22
|
+
* `<packageName>@<version>`), caching what's downloaded under `cacheDir`.
|
|
23
|
+
*
|
|
24
|
+
* Returns `null` — degrading the divergence check to a skip, not a failure —
|
|
25
|
+
* when no golden baseline exists yet for this version, or the registry/repo
|
|
26
|
+
* is unreachable.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveSourceOfTruthGolden(location: SourceOfTruthGoldenLocation): Promise<SourceOfTruthGolden | null>;
|
|
29
|
+
//# sourceMappingURL=resolveSourceOfTruthGolden.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveSourceOfTruthGolden.d.ts","sourceRoot":"","sources":["../../src/golden/resolveSourceOfTruthGolden.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,cAAc,CAAC;IACzB;kDAC8C;IAC9C,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACpD;AAkCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,2BAA2B,GACpC,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CA8ErC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates a parsed `test/golden/manifest.json` against `manifest.schema.json`.
|
|
3
|
+
* Throws with every violation listed — callers must not silently coerce or
|
|
4
|
+
* drop invalid entries.
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateGoldenManifest(data: unknown, path: string): void;
|
|
7
|
+
//# sourceMappingURL=validateManifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateManifest.d.ts","sourceRoot":"","sources":["../../src/golden/validateManifest.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAYxE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";function fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oe={exports:{}},Et={},he={},ge={},St={},Pt={},Nt={},Ft;function mt(){return Ft||(Ft=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class n{}e._CodeOrName=n,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class w extends n{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=w;class l extends n{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((a,f)=>`${a}${f}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((a,f)=>(f instanceof w&&(a[f.str]=(a[f.str]||0)+1),a),{})}}e._Code=l,e.nil=new l("");function E(i,...t){const a=[i[0]];let f=0;for(;f<t.length;)u(a,t[f]),a.push(i[++f]);return new l(a)}e._=E;const s=new l("+");function h(i,...t){const a=[p(i[0])];let f=0;for(;f<t.length;)a.push(s),u(a,t[f]),a.push(s,p(i[++f]));return m(a),new l(a)}e.str=h;function u(i,t){t instanceof l?i.push(...t._items):t instanceof w?i.push(t):i.push(P(t))}e.addCodeArg=u;function m(i){let t=1;for(;t<i.length-1;){if(i[t]===s){const a=g(i[t-1],i[t+1]);if(a!==void 0){i.splice(t-1,3,a);continue}i[t++]="+"}t++}}function g(i,t){if(t==='""')return i;if(i==='""')return t;if(typeof i=="string")return t instanceof w||i[i.length-1]!=='"'?void 0:typeof t!="string"?`${i.slice(0,-1)}${t}"`:t[0]==='"'?i.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(i instanceof w))return`"${i}${t.slice(1)}`}function _(i,t){return t.emptyStr()?i:i.emptyStr()?t:h`${i}${t}`}e.strConcat=_;function P(i){return typeof i=="number"||typeof i=="boolean"||i===null?i:p(Array.isArray(i)?i.join(","):i)}function v(i){return new l(p(i))}e.stringify=v;function p(i){return JSON.stringify(i).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=p;function y(i){return typeof i=="string"&&e.IDENTIFIER.test(i)?new l(`.${i}`):E`[${i}]`}e.getProperty=y;function $(i){if(typeof i=="string"&&e.IDENTIFIER.test(i))return new l(`${i}`);throw new Error(`CodeGen: invalid export name: ${i}, use explicit $id name mapping`)}e.getEsmExportName=$;function o(i){return new l(i.toString())}e.regexpCode=o})(Nt)),Nt}var Rt={},Ut;function Kt(){return Ut||(Ut=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const n=mt();class w extends Error{constructor(g){super(`CodeGen: "code" for ${g} not defined`),this.value=g.value}}var l;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(l||(e.UsedValueState=l={})),e.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class E{constructor({prefixes:g,parent:_}={}){this._names={},this._prefixes=g,this._parent=_}toName(g){return g instanceof n.Name?g:this.name(g)}name(g){return new n.Name(this._newName(g))}_newName(g){const _=this._names[g]||this._nameGroup(g);return`${g}${_.index++}`}_nameGroup(g){var _,P;if(!((P=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||P===void 0)&&P.has(g)||this._prefixes&&!this._prefixes.has(g))throw new Error(`CodeGen: prefix "${g}" is not allowed in this scope`);return this._names[g]={prefix:g,index:0}}}e.Scope=E;class s extends n.Name{constructor(g,_){super(_),this.prefix=g}setValue(g,{property:_,itemIndex:P}){this.value=g,this.scopePath=(0,n._)`.${new n.Name(_)}[${P}]`}}e.ValueScopeName=s;const h=(0,n._)`\n`;class u extends E{constructor(g){super(g),this._values={},this._scope=g.scope,this.opts={...g,_n:g.lines?h:n.nil}}get(){return this._scope}name(g){return new s(g,this._newName(g))}value(g,_){var P;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName(g),{prefix:p}=v,y=(P=_.key)!==null&&P!==void 0?P:_.ref;let $=this._values[p];if($){const t=$.get(y);if(t)return t}else $=this._values[p]=new Map;$.set(y,v);const o=this._scope[p]||(this._scope[p]=[]),i=o.length;return o[i]=_.ref,v.setValue(_,{property:p,itemIndex:i}),v}getValue(g,_){const P=this._values[g];if(P)return P.get(_)}scopeRefs(g,_=this._values){return this._reduceValues(_,P=>{if(P.scopePath===void 0)throw new Error(`CodeGen: name "${P}" has no value`);return(0,n._)`${g}${P.scopePath}`})}scopeCode(g=this._values,_,P){return this._reduceValues(g,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},_,P)}_reduceValues(g,_,P={},v){let p=n.nil;for(const y in g){const $=g[y];if(!$)continue;const o=P[y]=P[y]||new Map;$.forEach(i=>{if(o.has(i))return;o.set(i,l.Started);let t=_(i);if(t){const a=this.opts.es5?e.varKinds.var:e.varKinds.const;p=(0,n._)`${p}${a} ${i} = ${t};${this.opts._n}`}else if(t=v==null?void 0:v(i))p=(0,n._)`${p}${t}${this.opts._n}`;else throw new w(i);o.set(i,l.Completed)})}return p}}e.ValueScope=u})(Rt)),Rt}var Lt;function G(){return Lt||(Lt=1,(function(e){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;const n=mt(),w=Kt();var l=mt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return l.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return l.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return l.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}});var E=Kt();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return E.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return E.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return E.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return E.varKinds}}),e.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class s{optimizeNodes(){return this}optimizeNames(c,S){return this}}class h extends s{constructor(c,S,I){super(),this.varKind=c,this.name=S,this.rhs=I}render({es5:c,_n:S}){const I=c?w.varKinds.var:this.varKind,F=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${F};`+S}optimizeNames(c,S){if(c[this.name.str])return this.rhs&&(this.rhs=J(this.rhs,c,S)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class u extends s{constructor(c,S,I){super(),this.lhs=c,this.rhs=S,this.sideEffects=I}render({_n:c}){return`${this.lhs} = ${this.rhs};`+c}optimizeNames(c,S){if(!(this.lhs instanceof n.Name&&!c[this.lhs.str]&&!this.sideEffects))return this.rhs=J(this.rhs,c,S),this}get names(){const c=this.lhs instanceof n.Name?{}:{...this.lhs.names};return U(c,this.rhs)}}class m extends u{constructor(c,S,I,F){super(c,I,F),this.op=S}render({_n:c}){return`${this.lhs} ${this.op}= ${this.rhs};`+c}}class g extends s{constructor(c){super(),this.label=c,this.names={}}render({_n:c}){return`${this.label}:`+c}}class _ extends s{constructor(c){super(),this.label=c,this.names={}}render({_n:c}){return`break${this.label?` ${this.label}`:""};`+c}}class P extends s{constructor(c){super(),this.error=c}render({_n:c}){return`throw ${this.error};`+c}get names(){return this.error.names}}class v extends s{constructor(c){super(),this.code=c}render({_n:c}){return`${this.code};`+c}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(c,S){return this.code=J(this.code,c,S),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class p extends s{constructor(c=[]){super(),this.nodes=c}render(c){return this.nodes.reduce((S,I)=>S+I.render(c),"")}optimizeNodes(){const{nodes:c}=this;let S=c.length;for(;S--;){const I=c[S].optimizeNodes();Array.isArray(I)?c.splice(S,1,...I):I?c[S]=I:c.splice(S,1)}return c.length>0?this:void 0}optimizeNames(c,S){const{nodes:I}=this;let F=I.length;for(;F--;){const L=I[F];L.optimizeNames(c,S)||(x(c,L.names),I.splice(F,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((c,S)=>V(c,S.names),{})}}class y extends p{render(c){return"{"+c._n+super.render(c)+"}"+c._n}}class $ extends p{}class o extends y{}o.kind="else";class i extends y{constructor(c,S){super(S),this.condition=c}render(c){let S=`if(${this.condition})`+super.render(c);return this.else&&(S+="else "+this.else.render(c)),S}optimizeNodes(){super.optimizeNodes();const c=this.condition;if(c===!0)return this.nodes;let S=this.else;if(S){const I=S.optimizeNodes();S=this.else=Array.isArray(I)?new o(I):I}if(S)return c===!1?S instanceof i?S:S.nodes:this.nodes.length?this:new i(le(c),S instanceof i?[S]:S.nodes);if(!(c===!1||!this.nodes.length))return this}optimizeNames(c,S){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(c,S),!!(super.optimizeNames(c,S)||this.else))return this.condition=J(this.condition,c,S),this}get names(){const c=super.names;return U(c,this.condition),this.else&&V(c,this.else.names),c}}i.kind="if";class t extends y{}t.kind="for";class a extends t{constructor(c){super(),this.iteration=c}render(c){return`for(${this.iteration})`+super.render(c)}optimizeNames(c,S){if(super.optimizeNames(c,S))return this.iteration=J(this.iteration,c,S),this}get names(){return V(super.names,this.iteration.names)}}class f extends t{constructor(c,S,I,F){super(),this.varKind=c,this.name=S,this.from=I,this.to=F}render(c){const S=c.es5?w.varKinds.var:this.varKind,{name:I,from:F,to:L}=this;return`for(${S} ${I}=${F}; ${I}<${L}; ${I}++)`+super.render(c)}get names(){const c=U(super.names,this.from);return U(c,this.to)}}class r extends t{constructor(c,S,I,F){super(),this.loop=c,this.varKind=S,this.name=I,this.iterable=F}render(c){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(c)}optimizeNames(c,S){if(super.optimizeNames(c,S))return this.iterable=J(this.iterable,c,S),this}get names(){return V(super.names,this.iterable.names)}}class d extends y{constructor(c,S,I){super(),this.name=c,this.args=S,this.async=I}render(c){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(c)}}d.kind="func";class b extends p{render(c){return"return "+super.render(c)}}b.kind="return";class j extends y{render(c){let S="try"+super.render(c);return this.catch&&(S+=this.catch.render(c)),this.finally&&(S+=this.finally.render(c)),S}optimizeNodes(){var c,S;return super.optimizeNodes(),(c=this.catch)===null||c===void 0||c.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(c,S){var I,F;return super.optimizeNames(c,S),(I=this.catch)===null||I===void 0||I.optimizeNames(c,S),(F=this.finally)===null||F===void 0||F.optimizeNames(c,S),this}get names(){const c=super.names;return this.catch&&V(c,this.catch.names),this.finally&&V(c,this.finally.names),c}}class T extends y{constructor(c){super(),this.error=c}render(c){return`catch(${this.error})`+super.render(c)}}T.kind="catch";class M extends y{render(c){return"finally"+super.render(c)}}M.kind="finally";class z{constructor(c,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
|
|
2
|
+
`:""},this._extScope=c,this._scope=new w.Scope({parent:c}),this._nodes=[new $]}toString(){return this._root.render(this.opts)}name(c){return this._scope.name(c)}scopeName(c){return this._extScope.name(c)}scopeValue(c,S){const I=this._extScope.value(c,S);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(c,S){return this._extScope.getValue(c,S)}scopeRefs(c){return this._extScope.scopeRefs(c,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(c,S,I,F){const L=this._scope.toName(S);return I!==void 0&&F&&(this._constants[L.str]=I),this._leafNode(new h(c,L,I)),L}const(c,S,I){return this._def(w.varKinds.const,c,S,I)}let(c,S,I){return this._def(w.varKinds.let,c,S,I)}var(c,S,I){return this._def(w.varKinds.var,c,S,I)}assign(c,S,I){return this._leafNode(new u(c,S,I))}add(c,S){return this._leafNode(new m(c,e.operators.ADD,S))}code(c){return typeof c=="function"?c():c!==n.nil&&this._leafNode(new v(c)),this}object(...c){const S=["{"];for(const[I,F]of c)S.length>1&&S.push(","),S.push(I),(I!==F||this.opts.es5)&&(S.push(":"),(0,n.addCodeArg)(S,F));return S.push("}"),new n._Code(S)}if(c,S,I){if(this._blockNode(new i(c)),S&&I)this.code(S).else().code(I).endIf();else if(S)this.code(S).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(c){return this._elseNode(new i(c))}else(){return this._elseNode(new o)}endIf(){return this._endBlockNode(i,o)}_for(c,S){return this._blockNode(c),S&&this.code(S).endFor(),this}for(c,S){return this._for(new a(c),S)}forRange(c,S,I,F,L=this.opts.es5?w.varKinds.var:w.varKinds.let){const Y=this._scope.toName(c);return this._for(new f(L,Y,S,I),()=>F(Y))}forOf(c,S,I,F=w.varKinds.const){const L=this._scope.toName(c);if(this.opts.es5){const Y=S instanceof n.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,n._)`${Y}.length`,B=>{this.var(L,(0,n._)`${Y}[${B}]`),I(L)})}return this._for(new r("of",F,L,S),()=>I(L))}forIn(c,S,I,F=this.opts.es5?w.varKinds.var:w.varKinds.const){if(this.opts.ownProperties)return this.forOf(c,(0,n._)`Object.keys(${S})`,I);const L=this._scope.toName(c);return this._for(new r("in",F,L,S),()=>I(L))}endFor(){return this._endBlockNode(t)}label(c){return this._leafNode(new g(c))}break(c){return this._leafNode(new _(c))}return(c){const S=new b;if(this._blockNode(S),this.code(c),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(b)}try(c,S,I){if(!S&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const F=new j;if(this._blockNode(F),this.code(c),S){const L=this.name("e");this._currNode=F.catch=new T(L),S(L)}return I&&(this._currNode=F.finally=new M,this.code(I)),this._endBlockNode(T,M)}throw(c){return this._leafNode(new P(c))}block(c,S){return this._blockStarts.push(this._nodes.length),c&&this.code(c).endBlock(S),this}endBlock(c){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-S;if(I<0||c!==void 0&&I!==c)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${c} expected`);return this._nodes.length=S,this}func(c,S=n.nil,I,F){return this._blockNode(new d(c,S,I)),F&&this.code(F).endFunc(),this}endFunc(){return this._endBlockNode(d)}optimize(c=1){for(;c-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(c){return this._currNode.nodes.push(c),this}_blockNode(c){this._currNode.nodes.push(c),this._nodes.push(c)}_endBlockNode(c,S){const I=this._currNode;if(I instanceof c||S&&I instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${c.kind}/${S.kind}`:c.kind}"`)}_elseNode(c){const S=this._currNode;if(!(S instanceof i))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=c,this}get _root(){return this._nodes[0]}get _currNode(){const c=this._nodes;return c[c.length-1]}set _currNode(c){const S=this._nodes;S[S.length-1]=c}}e.CodeGen=z;function V(O,c){for(const S in c)O[S]=(O[S]||0)+(c[S]||0);return O}function U(O,c){return c instanceof n._CodeOrName?V(O,c.names):O}function J(O,c,S){if(O instanceof n.Name)return I(O);if(!F(O))return O;return new n._Code(O._items.reduce((L,Y)=>(Y instanceof n.Name&&(Y=I(Y)),Y instanceof n._Code?L.push(...Y._items):L.push(Y),L),[]));function I(L){const Y=S[L.str];return Y===void 0||c[L.str]!==1?L:(delete c[L.str],Y)}function F(L){return L instanceof n._Code&&L._items.some(Y=>Y instanceof n.Name&&c[Y.str]===1&&S[Y.str]!==void 0)}}function x(O,c){for(const S in c)O[S]=(O[S]||0)-(c[S]||0)}function le(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,n._)`!${C(O)}`}e.not=le;const fe=R(e.operators.AND);function X(...O){return O.reduce(fe)}e.and=X;const ye=R(e.operators.OR);function A(...O){return O.reduce(ye)}e.or=A;function R(O){return(c,S)=>c===n.nil?S:S===n.nil?c:(0,n._)`${C(c)} ${O} ${C(S)}`}function C(O){return O instanceof n.Name?O:(0,n._)`(${O})`}})(Pt)),Pt}var H={},Ht;function Z(){if(Ht)return H;Ht=1,Object.defineProperty(H,"__esModule",{value:!0}),H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;const e=G(),n=mt();function w(r){const d={};for(const b of r)d[b]=!0;return d}H.toHash=w;function l(r,d){return typeof d=="boolean"?d:Object.keys(d).length===0?!0:(E(r,d),!s(d,r.self.RULES.all))}H.alwaysValidSchema=l;function E(r,d=r.schema){const{opts:b,self:j}=r;if(!b.strictSchema||typeof d=="boolean")return;const T=j.RULES.keywords;for(const M in d)T[M]||f(r,`unknown keyword: "${M}"`)}H.checkUnknownRules=E;function s(r,d){if(typeof r=="boolean")return!r;for(const b in r)if(d[b])return!0;return!1}H.schemaHasRules=s;function h(r,d){if(typeof r=="boolean")return!r;for(const b in r)if(b!=="$ref"&&d.all[b])return!0;return!1}H.schemaHasRulesButRef=h;function u({topSchemaRef:r,schemaPath:d},b,j,T){if(!T){if(typeof b=="number"||typeof b=="boolean")return b;if(typeof b=="string")return(0,e._)`${b}`}return(0,e._)`${r}${d}${(0,e.getProperty)(j)}`}H.schemaRefOrVal=u;function m(r){return P(decodeURIComponent(r))}H.unescapeFragment=m;function g(r){return encodeURIComponent(_(r))}H.escapeFragment=g;function _(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=_;function P(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=P;function v(r,d){if(Array.isArray(r))for(const b of r)d(b);else d(r)}H.eachItem=v;function p({mergeNames:r,mergeToName:d,mergeValues:b,resultToName:j}){return(T,M,z,V)=>{const U=z===void 0?M:z instanceof e.Name?(M instanceof e.Name?r(T,M,z):d(T,M,z),z):M instanceof e.Name?(d(T,z,M),M):b(M,z);return V===e.Name&&!(U instanceof e.Name)?j(T,U):U}}H.mergeEvaluated={props:p({mergeNames:(r,d,b)=>r.if((0,e._)`${b} !== true && ${d} !== undefined`,()=>{r.if((0,e._)`${d} === true`,()=>r.assign(b,!0),()=>r.assign(b,(0,e._)`${b} || {}`).code((0,e._)`Object.assign(${b}, ${d})`))}),mergeToName:(r,d,b)=>r.if((0,e._)`${b} !== true`,()=>{d===!0?r.assign(b,!0):(r.assign(b,(0,e._)`${b} || {}`),$(r,b,d))}),mergeValues:(r,d)=>r===!0?!0:{...r,...d},resultToName:y}),items:p({mergeNames:(r,d,b)=>r.if((0,e._)`${b} !== true && ${d} !== undefined`,()=>r.assign(b,(0,e._)`${d} === true ? true : ${b} > ${d} ? ${b} : ${d}`)),mergeToName:(r,d,b)=>r.if((0,e._)`${b} !== true`,()=>r.assign(b,d===!0?!0:(0,e._)`${b} > ${d} ? ${b} : ${d}`)),mergeValues:(r,d)=>r===!0?!0:Math.max(r,d),resultToName:(r,d)=>r.var("items",d)})};function y(r,d){if(d===!0)return r.var("props",!0);const b=r.var("props",(0,e._)`{}`);return d!==void 0&&$(r,b,d),b}H.evaluatedPropsToName=y;function $(r,d,b){Object.keys(b).forEach(j=>r.assign((0,e._)`${d}${(0,e.getProperty)(j)}`,!0))}H.setEvaluated=$;const o={};function i(r,d){return r.scopeValue("func",{ref:d,code:o[d.code]||(o[d.code]=new n._Code(d.code))})}H.useFunc=i;var t;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(t||(H.Type=t={}));function a(r,d,b){if(r instanceof e.Name){const j=d===t.Num;return b?j?(0,e._)`"[" + ${r} + "]"`:(0,e._)`"['" + ${r} + "']"`:j?(0,e._)`"/" + ${r}`:(0,e._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return b?(0,e.getProperty)(r).toString():"/"+_(r)}H.getErrorPath=a;function f(r,d,b=r.opts.strictSchema){if(b){if(d=`strict mode: ${d}`,b===!0)throw new Error(d);r.self.logger.warn(d)}}return H.checkStrictMode=f,H}var je={},Gt;function ve(){if(Gt)return je;Gt=1,Object.defineProperty(je,"__esModule",{value:!0});const e=G(),n={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return je.default=n,je}var Jt;function yt(){return Jt||(Jt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const n=G(),w=Z(),l=ve();e.keywordError={message:({keyword:o})=>(0,n.str)`must pass "${o}" keyword validation`},e.keyword$DataError={message:({keyword:o,schemaType:i})=>i?(0,n.str)`"${o}" keyword must be ${i} ($data)`:(0,n.str)`"${o}" keyword is invalid ($data)`};function E(o,i=e.keywordError,t,a){const{it:f}=o,{gen:r,compositeRule:d,allErrors:b}=f,j=P(o,i,t);a??(d||b)?m(r,j):g(f,(0,n._)`[${j}]`)}e.reportError=E;function s(o,i=e.keywordError,t){const{it:a}=o,{gen:f,compositeRule:r,allErrors:d}=a,b=P(o,i,t);m(f,b),r||d||g(a,l.default.vErrors)}e.reportExtraError=s;function h(o,i){o.assign(l.default.errors,i),o.if((0,n._)`${l.default.vErrors} !== null`,()=>o.if(i,()=>o.assign((0,n._)`${l.default.vErrors}.length`,i),()=>o.assign(l.default.vErrors,null)))}e.resetErrorsCount=h;function u({gen:o,keyword:i,schemaValue:t,data:a,errsCount:f,it:r}){if(f===void 0)throw new Error("ajv implementation error");const d=o.name("err");o.forRange("i",f,l.default.errors,b=>{o.const(d,(0,n._)`${l.default.vErrors}[${b}]`),o.if((0,n._)`${d}.instancePath === undefined`,()=>o.assign((0,n._)`${d}.instancePath`,(0,n.strConcat)(l.default.instancePath,r.errorPath))),o.assign((0,n._)`${d}.schemaPath`,(0,n.str)`${r.errSchemaPath}/${i}`),r.opts.verbose&&(o.assign((0,n._)`${d}.schema`,t),o.assign((0,n._)`${d}.data`,a))})}e.extendErrors=u;function m(o,i){const t=o.const("err",i);o.if((0,n._)`${l.default.vErrors} === null`,()=>o.assign(l.default.vErrors,(0,n._)`[${t}]`),(0,n._)`${l.default.vErrors}.push(${t})`),o.code((0,n._)`${l.default.errors}++`)}function g(o,i){const{gen:t,validateName:a,schemaEnv:f}=o;f.$async?t.throw((0,n._)`new ${o.ValidationError}(${i})`):(t.assign((0,n._)`${a}.errors`,i),t.return(!1))}const _={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function P(o,i,t){const{createErrors:a}=o.it;return a===!1?(0,n._)`{}`:v(o,i,t)}function v(o,i,t={}){const{gen:a,it:f}=o,r=[p(f,t),y(o,t)];return $(o,i,r),a.object(...r)}function p({errorPath:o},{instancePath:i}){const t=i?(0,n.str)`${o}${(0,w.getErrorPath)(i,w.Type.Str)}`:o;return[l.default.instancePath,(0,n.strConcat)(l.default.instancePath,t)]}function y({keyword:o,it:{errSchemaPath:i}},{schemaPath:t,parentSchema:a}){let f=a?i:(0,n.str)`${i}/${o}`;return t&&(f=(0,n.str)`${f}${(0,w.getErrorPath)(t,w.Type.Str)}`),[_.schemaPath,f]}function $(o,{params:i,message:t},a){const{keyword:f,data:r,schemaValue:d,it:b}=o,{opts:j,propertyName:T,topSchemaRef:M,schemaPath:z}=b;a.push([_.keyword,f],[_.params,typeof i=="function"?i(o):i||(0,n._)`{}`]),j.messages&&a.push([_.message,typeof t=="function"?t(o):t]),j.verbose&&a.push([_.schema,d],[_.parentSchema,(0,n._)`${M}${z}`],[l.default.data,r]),T&&a.push([_.propertyName,T])}})(St)),St}var Wt;function hn(){if(Wt)return ge;Wt=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.boolOrEmptySchema=ge.topBoolOrEmptySchema=void 0;const e=yt(),n=G(),w=ve(),l={message:"boolean schema is false"};function E(u){const{gen:m,schema:g,validateName:_}=u;g===!1?h(u,!1):typeof g=="object"&&g.$async===!0?m.return(w.default.data):(m.assign((0,n._)`${_}.errors`,null),m.return(!0))}ge.topBoolOrEmptySchema=E;function s(u,m){const{gen:g,schema:_}=u;_===!1?(g.var(m,!1),h(u)):g.var(m,!0)}ge.boolOrEmptySchema=s;function h(u,m){const{gen:g,data:_}=u,P={gen:g,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(P,l,void 0,m)}return ge}var re={},$e={},Bt;function rn(){if(Bt)return $e;Bt=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.getRules=$e.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],n=new Set(e);function w(E){return typeof E=="string"&&n.has(E)}$e.isJSONType=w;function l(){const E={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...E,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},E.number,E.string,E.array,E.object],post:{rules:[]},all:{},keywords:{}}}return $e.getRules=l,$e}var me={},Zt;function nn(){if(Zt)return me;Zt=1,Object.defineProperty(me,"__esModule",{value:!0}),me.shouldUseRule=me.shouldUseGroup=me.schemaHasRulesForType=void 0;function e({schema:l,self:E},s){const h=E.RULES.types[s];return h&&h!==!0&&n(l,h)}me.schemaHasRulesForType=e;function n(l,E){return E.rules.some(s=>w(l,s))}me.shouldUseGroup=n;function w(l,E){var s;return l[E.keyword]!==void 0||((s=E.definition.implements)===null||s===void 0?void 0:s.some(h=>l[h]!==void 0))}return me.shouldUseRule=w,me}var Yt;function pt(){if(Yt)return re;Yt=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=rn(),n=nn(),w=yt(),l=G(),E=Z();var s;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(s||(re.DataType=s={}));function h(t){const a=u(t.type);if(a.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!a.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&a.push("null")}return a}re.getSchemaTypes=h;function u(t){const a=Array.isArray(t)?t:t?[t]:[];if(a.every(e.isJSONType))return a;throw new Error("type must be JSONType or JSONType[]: "+a.join(","))}re.getJSONTypes=u;function m(t,a){const{gen:f,data:r,opts:d}=t,b=_(a,d.coerceTypes),j=a.length>0&&!(b.length===0&&a.length===1&&(0,n.schemaHasRulesForType)(t,a[0]));if(j){const T=y(a,r,d.strictNumbers,s.Wrong);f.if(T,()=>{b.length?P(t,a,b):o(t)})}return j}re.coerceAndCheckDataType=m;const g=new Set(["string","number","integer","boolean","null"]);function _(t,a){return a?t.filter(f=>g.has(f)||a==="array"&&f==="array"):[]}function P(t,a,f){const{gen:r,data:d,opts:b}=t,j=r.let("dataType",(0,l._)`typeof ${d}`),T=r.let("coerced",(0,l._)`undefined`);b.coerceTypes==="array"&&r.if((0,l._)`${j} == 'object' && Array.isArray(${d}) && ${d}.length == 1`,()=>r.assign(d,(0,l._)`${d}[0]`).assign(j,(0,l._)`typeof ${d}`).if(y(a,d,b.strictNumbers),()=>r.assign(T,d))),r.if((0,l._)`${T} !== undefined`);for(const z of f)(g.has(z)||z==="array"&&b.coerceTypes==="array")&&M(z);r.else(),o(t),r.endIf(),r.if((0,l._)`${T} !== undefined`,()=>{r.assign(d,T),v(t,T)});function M(z){switch(z){case"string":r.elseIf((0,l._)`${j} == "number" || ${j} == "boolean"`).assign(T,(0,l._)`"" + ${d}`).elseIf((0,l._)`${d} === null`).assign(T,(0,l._)`""`);return;case"number":r.elseIf((0,l._)`${j} == "boolean" || ${d} === null
|
|
3
|
+
|| (${j} == "string" && ${d} && ${d} == +${d})`).assign(T,(0,l._)`+${d}`);return;case"integer":r.elseIf((0,l._)`${j} === "boolean" || ${d} === null
|
|
4
|
+
|| (${j} === "string" && ${d} && ${d} == +${d} && !(${d} % 1))`).assign(T,(0,l._)`+${d}`);return;case"boolean":r.elseIf((0,l._)`${d} === "false" || ${d} === 0 || ${d} === null`).assign(T,!1).elseIf((0,l._)`${d} === "true" || ${d} === 1`).assign(T,!0);return;case"null":r.elseIf((0,l._)`${d} === "" || ${d} === 0 || ${d} === false`),r.assign(T,null);return;case"array":r.elseIf((0,l._)`${j} === "string" || ${j} === "number"
|
|
5
|
+
|| ${j} === "boolean" || ${d} === null`).assign(T,(0,l._)`[${d}]`)}}}function v({gen:t,parentData:a,parentDataProperty:f},r){t.if((0,l._)`${a} !== undefined`,()=>t.assign((0,l._)`${a}[${f}]`,r))}function p(t,a,f,r=s.Correct){const d=r===s.Correct?l.operators.EQ:l.operators.NEQ;let b;switch(t){case"null":return(0,l._)`${a} ${d} null`;case"array":b=(0,l._)`Array.isArray(${a})`;break;case"object":b=(0,l._)`${a} && typeof ${a} == "object" && !Array.isArray(${a})`;break;case"integer":b=j((0,l._)`!(${a} % 1) && !isNaN(${a})`);break;case"number":b=j();break;default:return(0,l._)`typeof ${a} ${d} ${t}`}return r===s.Correct?b:(0,l.not)(b);function j(T=l.nil){return(0,l.and)((0,l._)`typeof ${a} == "number"`,T,f?(0,l._)`isFinite(${a})`:l.nil)}}re.checkDataType=p;function y(t,a,f,r){if(t.length===1)return p(t[0],a,f,r);let d;const b=(0,E.toHash)(t);if(b.array&&b.object){const j=(0,l._)`typeof ${a} != "object"`;d=b.null?j:(0,l._)`!${a} || ${j}`,delete b.null,delete b.array,delete b.object}else d=l.nil;b.number&&delete b.integer;for(const j in b)d=(0,l.and)(d,p(j,a,f,r));return d}re.checkDataTypes=y;const $={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:a})=>typeof t=="string"?(0,l._)`{type: ${t}}`:(0,l._)`{type: ${a}}`};function o(t){const a=i(t);(0,w.reportError)(a,$)}re.reportTypeError=o;function i(t){const{gen:a,data:f,schema:r}=t,d=(0,E.schemaRefOrVal)(t,r,"type");return{gen:a,keyword:"type",data:f,schema:r.type,schemaCode:d,schemaValue:d,parentSchema:r,params:{},it:t}}return re}var Ne={},Qt;function mn(){if(Qt)return Ne;Qt=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.assignDefaults=void 0;const e=G(),n=Z();function w(E,s){const{properties:h,items:u}=E.schema;if(s==="object"&&h)for(const m in h)l(E,m,h[m].default);else s==="array"&&Array.isArray(u)&&u.forEach((m,g)=>l(E,g,m.default))}Ne.assignDefaults=w;function l(E,s,h){const{gen:u,compositeRule:m,data:g,opts:_}=E;if(h===void 0)return;const P=(0,e._)`${g}${(0,e.getProperty)(s)}`;if(m){(0,n.checkStrictMode)(E,`default is ignored for: ${P}`);return}let v=(0,e._)`${P} === undefined`;_.useDefaults==="empty"&&(v=(0,e._)`${v} || ${P} === null || ${P} === ""`),u.if(v,(0,e._)`${P} = ${(0,e.stringify)(h)}`)}return Ne}var ce={},Q={},Xt;function de(){if(Xt)return Q;Xt=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.validateUnion=Q.validateArray=Q.usePattern=Q.callValidateCode=Q.schemaProperties=Q.allSchemaProperties=Q.noPropertyInData=Q.propertyInData=Q.isOwnProperty=Q.hasPropFunc=Q.reportMissingProp=Q.checkMissingProp=Q.checkReportMissingProp=void 0;const e=G(),n=Z(),w=ve(),l=Z();function E(t,a){const{gen:f,data:r,it:d}=t;f.if(_(f,r,a,d.opts.ownProperties),()=>{t.setParams({missingProperty:(0,e._)`${a}`},!0),t.error()})}Q.checkReportMissingProp=E;function s({gen:t,data:a,it:{opts:f}},r,d){return(0,e.or)(...r.map(b=>(0,e.and)(_(t,a,b,f.ownProperties),(0,e._)`${d} = ${b}`)))}Q.checkMissingProp=s;function h(t,a){t.setParams({missingProperty:a},!0),t.error()}Q.reportMissingProp=h;function u(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Q.hasPropFunc=u;function m(t,a,f){return(0,e._)`${u(t)}.call(${a}, ${f})`}Q.isOwnProperty=m;function g(t,a,f,r){const d=(0,e._)`${a}${(0,e.getProperty)(f)} !== undefined`;return r?(0,e._)`${d} && ${m(t,a,f)}`:d}Q.propertyInData=g;function _(t,a,f,r){const d=(0,e._)`${a}${(0,e.getProperty)(f)} === undefined`;return r?(0,e.or)(d,(0,e.not)(m(t,a,f))):d}Q.noPropertyInData=_;function P(t){return t?Object.keys(t).filter(a=>a!=="__proto__"):[]}Q.allSchemaProperties=P;function v(t,a){return P(a).filter(f=>!(0,n.alwaysValidSchema)(t,a[f]))}Q.schemaProperties=v;function p({schemaCode:t,data:a,it:{gen:f,topSchemaRef:r,schemaPath:d,errorPath:b},it:j},T,M,z){const V=z?(0,e._)`${t}, ${a}, ${r}${d}`:a,U=[[w.default.instancePath,(0,e.strConcat)(w.default.instancePath,b)],[w.default.parentData,j.parentData],[w.default.parentDataProperty,j.parentDataProperty],[w.default.rootData,w.default.rootData]];j.opts.dynamicRef&&U.push([w.default.dynamicAnchors,w.default.dynamicAnchors]);const J=(0,e._)`${V}, ${f.object(...U)}`;return M!==e.nil?(0,e._)`${T}.call(${M}, ${J})`:(0,e._)`${T}(${J})`}Q.callValidateCode=p;const y=(0,e._)`new RegExp`;function $({gen:t,it:{opts:a}},f){const r=a.unicodeRegExp?"u":"",{regExp:d}=a.code,b=d(f,r);return t.scopeValue("pattern",{key:b.toString(),ref:b,code:(0,e._)`${d.code==="new RegExp"?y:(0,l.useFunc)(t,d)}(${f}, ${r})`})}Q.usePattern=$;function o(t){const{gen:a,data:f,keyword:r,it:d}=t,b=a.name("valid");if(d.allErrors){const T=a.let("valid",!0);return j(()=>a.assign(T,!1)),T}return a.var(b,!0),j(()=>a.break()),b;function j(T){const M=a.const("len",(0,e._)`${f}.length`);a.forRange("i",0,M,z=>{t.subschema({keyword:r,dataProp:z,dataPropType:n.Type.Num},b),a.if((0,e.not)(b),T)})}}Q.validateArray=o;function i(t){const{gen:a,schema:f,keyword:r,it:d}=t;if(!Array.isArray(f))throw new Error("ajv implementation error");if(f.some(M=>(0,n.alwaysValidSchema)(d,M))&&!d.opts.unevaluated)return;const j=a.let("valid",!1),T=a.name("_valid");a.block(()=>f.forEach((M,z)=>{const V=t.subschema({keyword:r,schemaProp:z,compositeRule:!0},T);a.assign(j,(0,e._)`${j} || ${T}`),t.mergeValidEvaluated(V,T)||a.if((0,e.not)(j))})),t.result(j,()=>t.reset(),()=>t.error(!0))}return Q.validateUnion=i,Q}var xt;function pn(){if(xt)return ce;xt=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.validateKeywordUsage=ce.validSchemaType=ce.funcKeywordCode=ce.macroKeywordCode=void 0;const e=G(),n=ve(),w=de(),l=yt();function E(v,p){const{gen:y,keyword:$,schema:o,parentSchema:i,it:t}=v,a=p.macro.call(t.self,o,i,t),f=g(y,$,a);t.opts.validateSchema!==!1&&t.self.validateSchema(a,!0);const r=y.name("valid");v.subschema({schema:a,schemaPath:e.nil,errSchemaPath:`${t.errSchemaPath}/${$}`,topSchemaRef:f,compositeRule:!0},r),v.pass(r,()=>v.error(!0))}ce.macroKeywordCode=E;function s(v,p){var y;const{gen:$,keyword:o,schema:i,parentSchema:t,$data:a,it:f}=v;m(f,p);const r=!a&&p.compile?p.compile.call(f.self,i,t,f):p.validate,d=g($,o,r),b=$.let("valid");v.block$data(b,j),v.ok((y=p.valid)!==null&&y!==void 0?y:b);function j(){if(p.errors===!1)z(),p.modifying&&h(v),V(()=>v.error());else{const U=p.async?T():M();p.modifying&&h(v),V(()=>u(v,U))}}function T(){const U=$.let("ruleErrs",null);return $.try(()=>z((0,e._)`await `),J=>$.assign(b,!1).if((0,e._)`${J} instanceof ${f.ValidationError}`,()=>$.assign(U,(0,e._)`${J}.errors`),()=>$.throw(J))),U}function M(){const U=(0,e._)`${d}.errors`;return $.assign(U,null),z(e.nil),U}function z(U=p.async?(0,e._)`await `:e.nil){const J=f.opts.passContext?n.default.this:n.default.self,x=!("compile"in p&&!a||p.schema===!1);$.assign(b,(0,e._)`${U}${(0,w.callValidateCode)(v,d,J,x)}`,p.modifying)}function V(U){var J;$.if((0,e.not)((J=p.valid)!==null&&J!==void 0?J:b),U)}}ce.funcKeywordCode=s;function h(v){const{gen:p,data:y,it:$}=v;p.if($.parentData,()=>p.assign(y,(0,e._)`${$.parentData}[${$.parentDataProperty}]`))}function u(v,p){const{gen:y}=v;y.if((0,e._)`Array.isArray(${p})`,()=>{y.assign(n.default.vErrors,(0,e._)`${n.default.vErrors} === null ? ${p} : ${n.default.vErrors}.concat(${p})`).assign(n.default.errors,(0,e._)`${n.default.vErrors}.length`),(0,l.extendErrors)(v)},()=>v.error())}function m({schemaEnv:v},p){if(p.async&&!v.$async)throw new Error("async keyword in sync schema")}function g(v,p,y){if(y===void 0)throw new Error(`keyword "${p}" failed to compile`);return v.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}function _(v,p,y=!1){return!p.length||p.some($=>$==="array"?Array.isArray(v):$==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==$||y&&typeof v>"u")}ce.validSchemaType=_;function P({schema:v,opts:p,self:y,errSchemaPath:$},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const t=o.dependencies;if(t!=null&&t.some(a=>!Object.prototype.hasOwnProperty.call(v,a)))throw new Error(`parent schema must have dependencies of ${i}: ${t.join(",")}`);if(o.validateSchema&&!o.validateSchema(v[i])){const f=`keyword "${i}" value is invalid at path "${$}": `+y.errorsText(o.validateSchema.errors);if(p.validateSchema==="log")y.logger.error(f);else throw new Error(f)}}return ce.validateKeywordUsage=P,ce}var pe={},er;function yn(){if(er)return pe;er=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.extendSubschemaMode=pe.extendSubschemaData=pe.getSubschema=void 0;const e=G(),n=Z();function w(s,{keyword:h,schemaProp:u,schema:m,schemaPath:g,errSchemaPath:_,topSchemaRef:P}){if(h!==void 0&&m!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(h!==void 0){const v=s.schema[h];return u===void 0?{schema:v,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(h)}`,errSchemaPath:`${s.errSchemaPath}/${h}`}:{schema:v[u],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(h)}${(0,e.getProperty)(u)}`,errSchemaPath:`${s.errSchemaPath}/${h}/${(0,n.escapeFragment)(u)}`}}if(m!==void 0){if(g===void 0||_===void 0||P===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:g,topSchemaRef:P,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}pe.getSubschema=w;function l(s,h,{dataProp:u,dataPropType:m,data:g,dataTypes:_,propertyName:P}){if(g!==void 0&&u!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:v}=h;if(u!==void 0){const{errorPath:y,dataPathArr:$,opts:o}=h,i=v.let("data",(0,e._)`${h.data}${(0,e.getProperty)(u)}`,!0);p(i),s.errorPath=(0,e.str)`${y}${(0,n.getErrorPath)(u,m,o.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${u}`,s.dataPathArr=[...$,s.parentDataProperty]}if(g!==void 0){const y=g instanceof e.Name?g:v.let("data",g,!0);p(y),P!==void 0&&(s.propertyName=P)}_&&(s.dataTypes=_);function p(y){s.data=y,s.dataLevel=h.dataLevel+1,s.dataTypes=[],h.definedProperties=new Set,s.parentData=h.data,s.dataNames=[...h.dataNames,y]}}pe.extendSubschemaData=l;function E(s,{jtdDiscriminator:h,jtdMetadata:u,compositeRule:m,createErrors:g,allErrors:_}){m!==void 0&&(s.compositeRule=m),g!==void 0&&(s.createErrors=g),_!==void 0&&(s.allErrors=_),s.jtdDiscriminator=h,s.jtdMetadata=u}return pe.extendSubschemaMode=E,pe}var ne={},kt,tr;function sn(){return tr||(tr=1,kt=function e(n,w){if(n===w)return!0;if(n&&w&&typeof n=="object"&&typeof w=="object"){if(n.constructor!==w.constructor)return!1;var l,E,s;if(Array.isArray(n)){if(l=n.length,l!=w.length)return!1;for(E=l;E--!==0;)if(!e(n[E],w[E]))return!1;return!0}if(n.constructor===RegExp)return n.source===w.source&&n.flags===w.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===w.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===w.toString();if(s=Object.keys(n),l=s.length,l!==Object.keys(w).length)return!1;for(E=l;E--!==0;)if(!Object.prototype.hasOwnProperty.call(w,s[E]))return!1;for(E=l;E--!==0;){var h=s[E];if(!e(n[h],w[h]))return!1}return!0}return n!==n&&w!==w}),kt}var Ot={exports:{}},rr;function _n(){if(rr)return Ot.exports;rr=1;var e=Ot.exports=function(l,E,s){typeof E=="function"&&(s=E,E={}),s=E.cb||s;var h=typeof s=="function"?s:s.pre||function(){},u=s.post||function(){};n(E,h,u,l,"",l)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.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 n(l,E,s,h,u,m,g,_,P,v){if(h&&typeof h=="object"&&!Array.isArray(h)){E(h,u,m,g,_,P,v);for(var p in h){var y=h[p];if(Array.isArray(y)){if(p in e.arrayKeywords)for(var $=0;$<y.length;$++)n(l,E,s,y[$],u+"/"+p+"/"+$,m,u,p,h,$)}else if(p in e.propsKeywords){if(y&&typeof y=="object")for(var o in y)n(l,E,s,y[o],u+"/"+p+"/"+w(o),m,u,p,h,o)}else(p in e.keywords||l.allKeys&&!(p in e.skipKeywords))&&n(l,E,s,y,u+"/"+p,m,u,p,h)}s(h,u,m,g,_,P,v)}}function w(l){return l.replace(/~/g,"~0").replace(/\//g,"~1")}return Ot.exports}var nr;function _t(){if(nr)return ne;nr=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.getSchemaRefs=ne.resolveUrl=ne.normalizeId=ne._getFullPath=ne.getFullPath=ne.inlineRef=void 0;const e=Z(),n=sn(),w=_n(),l=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function E($,o=!0){return typeof $=="boolean"?!0:o===!0?!h($):o?u($)<=o:!1}ne.inlineRef=E;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function h($){for(const o in $){if(s.has(o))return!0;const i=$[o];if(Array.isArray(i)&&i.some(h)||typeof i=="object"&&h(i))return!0}return!1}function u($){let o=0;for(const i in $){if(i==="$ref")return 1/0;if(o++,!l.has(i)&&(typeof $[i]=="object"&&(0,e.eachItem)($[i],t=>o+=u(t)),o===1/0))return 1/0}return o}function m($,o="",i){i!==!1&&(o=P(o));const t=$.parse(o);return g($,t)}ne.getFullPath=m;function g($,o){return $.serialize(o).split("#")[0]+"#"}ne._getFullPath=g;const _=/#\/?$/;function P($){return $?$.replace(_,""):""}ne.normalizeId=P;function v($,o,i){return i=P(i),$.resolve(o,i)}ne.resolveUrl=v;const p=/^[a-z_][-a-z0-9._]*$/i;function y($,o){if(typeof $=="boolean")return{};const{schemaId:i,uriResolver:t}=this.opts,a=P($[i]||o),f={"":a},r=m(t,a,!1),d={},b=new Set;return w($,{allKeys:!0},(M,z,V,U)=>{if(U===void 0)return;const J=r+z;let x=f[U];typeof M[i]=="string"&&(x=le.call(this,M[i])),fe.call(this,M.$anchor),fe.call(this,M.$dynamicAnchor),f[z]=x;function le(X){const ye=this.opts.uriResolver.resolve;if(X=P(x?ye(x,X):X),b.has(X))throw T(X);b.add(X);let A=this.refs[X];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?j(M,A.schema,X):X!==P(J)&&(X[0]==="#"?(j(M,d[X],X),d[X]=M):this.refs[X]=J),X}function fe(X){if(typeof X=="string"){if(!p.test(X))throw new Error(`invalid anchor "${X}"`);le.call(this,`#${X}`)}}}),d;function j(M,z,V){if(z!==void 0&&!n(M,z))throw T(V)}function T(M){return new Error(`reference "${M}" resolves to more than one schema`)}}return ne.getSchemaRefs=y,ne}var sr;function vt(){if(sr)return he;sr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getData=he.KeywordCxt=he.validateFunctionCode=void 0;const e=hn(),n=pt(),w=nn(),l=pt(),E=mn(),s=pn(),h=yn(),u=G(),m=ve(),g=_t(),_=Z(),P=yt();function v(N){if(r(N)&&(b(N),f(N))){o(N);return}p(N,()=>(0,e.topBoolOrEmptySchema)(N))}he.validateFunctionCode=v;function p({gen:N,validateName:k,schema:q,schemaEnv:D,opts:K},W){K.code.es5?N.func(k,(0,u._)`${m.default.data}, ${m.default.valCxt}`,D.$async,()=>{N.code((0,u._)`"use strict"; ${t(q,K)}`),$(N,K),N.code(W)}):N.func(k,(0,u._)`${m.default.data}, ${y(K)}`,D.$async,()=>N.code(t(q,K)).code(W))}function y(N){return(0,u._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${N.dynamicRef?(0,u._)`, ${m.default.dynamicAnchors}={}`:u.nil}}={}`}function $(N,k){N.if(m.default.valCxt,()=>{N.var(m.default.instancePath,(0,u._)`${m.default.valCxt}.${m.default.instancePath}`),N.var(m.default.parentData,(0,u._)`${m.default.valCxt}.${m.default.parentData}`),N.var(m.default.parentDataProperty,(0,u._)`${m.default.valCxt}.${m.default.parentDataProperty}`),N.var(m.default.rootData,(0,u._)`${m.default.valCxt}.${m.default.rootData}`),k.dynamicRef&&N.var(m.default.dynamicAnchors,(0,u._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{N.var(m.default.instancePath,(0,u._)`""`),N.var(m.default.parentData,(0,u._)`undefined`),N.var(m.default.parentDataProperty,(0,u._)`undefined`),N.var(m.default.rootData,m.default.data),k.dynamicRef&&N.var(m.default.dynamicAnchors,(0,u._)`{}`)})}function o(N){const{schema:k,opts:q,gen:D}=N;p(N,()=>{q.$comment&&k.$comment&&U(N),M(N),D.let(m.default.vErrors,null),D.let(m.default.errors,0),q.unevaluated&&i(N),j(N),J(N)})}function i(N){const{gen:k,validateName:q}=N;N.evaluated=k.const("evaluated",(0,u._)`${q}.evaluated`),k.if((0,u._)`${N.evaluated}.dynamicProps`,()=>k.assign((0,u._)`${N.evaluated}.props`,(0,u._)`undefined`)),k.if((0,u._)`${N.evaluated}.dynamicItems`,()=>k.assign((0,u._)`${N.evaluated}.items`,(0,u._)`undefined`))}function t(N,k){const q=typeof N=="object"&&N[k.schemaId];return q&&(k.code.source||k.code.process)?(0,u._)`/*# sourceURL=${q} */`:u.nil}function a(N,k){if(r(N)&&(b(N),f(N))){d(N,k);return}(0,e.boolOrEmptySchema)(N,k)}function f({schema:N,self:k}){if(typeof N=="boolean")return!N;for(const q in N)if(k.RULES.all[q])return!0;return!1}function r(N){return typeof N.schema!="boolean"}function d(N,k){const{schema:q,gen:D,opts:K}=N;K.$comment&&q.$comment&&U(N),z(N),V(N);const W=D.const("_errs",m.default.errors);j(N,W),D.var(k,(0,u._)`${W} === ${m.default.errors}`)}function b(N){(0,_.checkUnknownRules)(N),T(N)}function j(N,k){if(N.opts.jtd)return le(N,[],!1,k);const q=(0,n.getSchemaTypes)(N.schema),D=(0,n.coerceAndCheckDataType)(N,q);le(N,q,!D,k)}function T(N){const{schema:k,errSchemaPath:q,opts:D,self:K}=N;k.$ref&&D.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(k,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function M(N){const{schema:k,opts:q}=N;k.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,_.checkStrictMode)(N,"default is ignored in the schema root")}function z(N){const k=N.schema[N.opts.schemaId];k&&(N.baseId=(0,g.resolveUrl)(N.opts.uriResolver,N.baseId,k))}function V(N){if(N.schema.$async&&!N.schemaEnv.$async)throw new Error("async schema in sync schema")}function U({gen:N,schemaEnv:k,schema:q,errSchemaPath:D,opts:K}){const W=q.$comment;if(K.$comment===!0)N.code((0,u._)`${m.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const ee=(0,u.str)`${D}/$comment`,ue=N.scopeValue("root",{ref:k.root});N.code((0,u._)`${m.default.self}.opts.$comment(${W}, ${ee}, ${ue}.schema)`)}}function J(N){const{gen:k,schemaEnv:q,validateName:D,ValidationError:K,opts:W}=N;q.$async?k.if((0,u._)`${m.default.errors} === 0`,()=>k.return(m.default.data),()=>k.throw((0,u._)`new ${K}(${m.default.vErrors})`)):(k.assign((0,u._)`${D}.errors`,m.default.vErrors),W.unevaluated&&x(N),k.return((0,u._)`${m.default.errors} === 0`))}function x({gen:N,evaluated:k,props:q,items:D}){q instanceof u.Name&&N.assign((0,u._)`${k}.props`,q),D instanceof u.Name&&N.assign((0,u._)`${k}.items`,D)}function le(N,k,q,D){const{gen:K,schema:W,data:ee,allErrors:ue,opts:se,self:ae}=N,{RULES:te}=ae;if(W.$ref&&(se.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(W,te))){K.block(()=>F(N,"$ref",te.all.$ref.definition));return}se.jtd||X(N,k),K.block(()=>{for(const ie of te.rules)be(ie);be(te.post)});function be(ie){(0,w.shouldUseGroup)(W,ie)&&(ie.type?(K.if((0,l.checkDataType)(ie.type,ee,se.strictNumbers)),fe(N,ie),k.length===1&&k[0]===ie.type&&q&&(K.else(),(0,l.reportTypeError)(N)),K.endIf()):fe(N,ie),ue||K.if((0,u._)`${m.default.errors} === ${D||0}`))}}function fe(N,k){const{gen:q,schema:D,opts:{useDefaults:K}}=N;K&&(0,E.assignDefaults)(N,k.type),q.block(()=>{for(const W of k.rules)(0,w.shouldUseRule)(D,W)&&F(N,W.keyword,W.definition,k.type)})}function X(N,k){N.schemaEnv.meta||!N.opts.strictTypes||(ye(N,k),N.opts.allowUnionTypes||A(N,k),R(N,N.dataTypes))}function ye(N,k){if(k.length){if(!N.dataTypes.length){N.dataTypes=k;return}k.forEach(q=>{O(N.dataTypes,q)||S(N,`type "${q}" not allowed by context "${N.dataTypes.join(",")}"`)}),c(N,k)}}function A(N,k){k.length>1&&!(k.length===2&&k.includes("null"))&&S(N,"use allowUnionTypes to allow union type keyword")}function R(N,k){const q=N.self.RULES.all;for(const D in q){const K=q[D];if(typeof K=="object"&&(0,w.shouldUseRule)(N.schema,K)){const{type:W}=K.definition;W.length&&!W.some(ee=>C(k,ee))&&S(N,`missing type "${W.join(",")}" for keyword "${D}"`)}}}function C(N,k){return N.includes(k)||k==="number"&&N.includes("integer")}function O(N,k){return N.includes(k)||k==="integer"&&N.includes("number")}function c(N,k){const q=[];for(const D of N.dataTypes)O(k,D)?q.push(D):k.includes("integer")&&D==="number"&&q.push("integer");N.dataTypes=q}function S(N,k){const q=N.schemaEnv.baseId+N.errSchemaPath;k+=` at "${q}" (strictTypes)`,(0,_.checkStrictMode)(N,k,N.opts.strictTypes)}class I{constructor(k,q,D){if((0,s.validateKeywordUsage)(k,q,D),this.gen=k.gen,this.allErrors=k.allErrors,this.keyword=D,this.data=k.data,this.schema=k.schema[D],this.$data=q.$data&&k.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(k,this.schema,D,this.$data),this.schemaType=q.schemaType,this.parentSchema=k.schema,this.params={},this.it=k,this.def=q,this.$data)this.schemaCode=k.gen.const("vSchema",B(this.$data,k));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${D} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=k.gen.const("_errs",m.default.errors))}result(k,q,D){this.failResult((0,u.not)(k),q,D)}failResult(k,q,D){this.gen.if(k),D?D():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(k,q){this.failResult((0,u.not)(k),void 0,q)}fail(k){if(k===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(k),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(k){if(!this.$data)return this.fail(k);const{schemaCode:q}=this;this.fail((0,u._)`${q} !== undefined && (${(0,u.or)(this.invalid$data(),k)})`)}error(k,q,D){if(q){this.setParams(q),this._error(k,D),this.setParams({});return}this._error(k,D)}_error(k,q){(k?P.reportExtraError:P.reportError)(this,this.def.error,q)}$dataError(){(0,P.reportError)(this,this.def.$dataError||P.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,P.resetErrorsCount)(this.gen,this.errsCount)}ok(k){this.allErrors||this.gen.if(k)}setParams(k,q){q?Object.assign(this.params,k):this.params=k}block$data(k,q,D=u.nil){this.gen.block(()=>{this.check$data(k,D),q()})}check$data(k=u.nil,q=u.nil){if(!this.$data)return;const{gen:D,schemaCode:K,schemaType:W,def:ee}=this;D.if((0,u.or)((0,u._)`${K} === undefined`,q)),k!==u.nil&&D.assign(k,!0),(W.length||ee.validateSchema)&&(D.elseIf(this.invalid$data()),this.$dataError(),k!==u.nil&&D.assign(k,!1)),D.else()}invalid$data(){const{gen:k,schemaCode:q,schemaType:D,def:K,it:W}=this;return(0,u.or)(ee(),ue());function ee(){if(D.length){if(!(q instanceof u.Name))throw new Error("ajv implementation error");const se=Array.isArray(D)?D:[D];return(0,u._)`${(0,l.checkDataTypes)(se,q,W.opts.strictNumbers,l.DataType.Wrong)}`}return u.nil}function ue(){if(K.validateSchema){const se=k.scopeValue("validate$data",{ref:K.validateSchema});return(0,u._)`!${se}(${q})`}return u.nil}}subschema(k,q){const D=(0,h.getSubschema)(this.it,k);(0,h.extendSubschemaData)(D,this.it,k),(0,h.extendSubschemaMode)(D,k);const K={...this.it,...D,items:void 0,props:void 0};return a(K,q),K}mergeEvaluated(k,q){const{it:D,gen:K}=this;D.opts.unevaluated&&(D.props!==!0&&k.props!==void 0&&(D.props=_.mergeEvaluated.props(K,k.props,D.props,q)),D.items!==!0&&k.items!==void 0&&(D.items=_.mergeEvaluated.items(K,k.items,D.items,q)))}mergeValidEvaluated(k,q){const{it:D,gen:K}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return K.if(q,()=>this.mergeEvaluated(k,u.Name)),!0}}he.KeywordCxt=I;function F(N,k,q,D){const K=new I(N,q,k);"code"in q?q.code(K,D):K.$data&&q.validate?(0,s.funcKeywordCode)(K,q):"macro"in q?(0,s.macroKeywordCode)(K,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(K,q)}const L=/^\/(?:[^~]|~0|~1)*$/,Y=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(N,{dataLevel:k,dataNames:q,dataPathArr:D}){let K,W;if(N==="")return m.default.rootData;if(N[0]==="/"){if(!L.test(N))throw new Error(`Invalid JSON-pointer: ${N}`);K=N,W=m.default.rootData}else{const ae=Y.exec(N);if(!ae)throw new Error(`Invalid JSON-pointer: ${N}`);const te=+ae[1];if(K=ae[2],K==="#"){if(te>=k)throw new Error(se("property/index",te));return D[k-te]}if(te>k)throw new Error(se("data",te));if(W=q[k-te],!K)return W}let ee=W;const ue=K.split("/");for(const ae of ue)ae&&(W=(0,u._)`${W}${(0,u.getProperty)((0,_.unescapeJsonPointer)(ae))}`,ee=(0,u._)`${ee} && ${W}`);return ee;function se(ae,te){return`Cannot access ${ae} ${te} levels up, current level is ${k}`}}return he.getData=B,he}var Te={},ar;function Mt(){if(ar)return Te;ar=1,Object.defineProperty(Te,"__esModule",{value:!0});class e extends Error{constructor(w){super("validation failed"),this.errors=w,this.ajv=this.validation=!0}}return Te.default=e,Te}var Ie={},or;function gt(){if(or)return Ie;or=1,Object.defineProperty(Ie,"__esModule",{value:!0});const e=_t();class n extends Error{constructor(l,E,s,h){super(h||`can't resolve reference ${s} from id ${E}`),this.missingRef=(0,e.resolveUrl)(l,E,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(l,this.missingRef))}}return Ie.default=n,Ie}var oe={},ir;function At(){if(ir)return oe;ir=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.resolveSchema=oe.getCompilingSchema=oe.resolveRef=oe.compileSchema=oe.SchemaEnv=void 0;const e=G(),n=Mt(),w=ve(),l=_t(),E=Z(),s=vt();class h{constructor(i){var t;this.refs={},this.dynamicAnchors={};let a;typeof i.schema=="object"&&(a=i.schema),this.schema=i.schema,this.schemaId=i.schemaId,this.root=i.root||this,this.baseId=(t=i.baseId)!==null&&t!==void 0?t:(0,l.normalizeId)(a==null?void 0:a[i.schemaId||"$id"]),this.schemaPath=i.schemaPath,this.localRefs=i.localRefs,this.meta=i.meta,this.$async=a==null?void 0:a.$async,this.refs={}}}oe.SchemaEnv=h;function u(o){const i=_.call(this,o);if(i)return i;const t=(0,l.getFullPath)(this.opts.uriResolver,o.root.baseId),{es5:a,lines:f}=this.opts.code,{ownProperties:r}=this.opts,d=new e.CodeGen(this.scope,{es5:a,lines:f,ownProperties:r});let b;o.$async&&(b=d.scopeValue("Error",{ref:n.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const j=d.scopeName("validate");o.validateName=j;const T={gen:d,allErrors:this.opts.allErrors,data:w.default.data,parentData:w.default.parentData,parentDataProperty:w.default.parentDataProperty,dataNames:[w.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",this.opts.code.source===!0?{ref:o.schema,code:(0,e.stringify)(o.schema)}:{ref:o.schema}),validateName:j,ValidationError:b,schema:o.schema,schemaEnv:o,rootId:t,baseId:o.baseId||t,schemaPath:e.nil,errSchemaPath:o.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let M;try{this._compilations.add(o),(0,s.validateFunctionCode)(T),d.optimize(this.opts.code.optimize);const z=d.toString();M=`${d.scopeRefs(w.default.scope)}return ${z}`,this.opts.code.process&&(M=this.opts.code.process(M,o));const U=new Function(`${w.default.self}`,`${w.default.scope}`,M)(this,this.scope.get());if(this.scope.value(j,{ref:U}),U.errors=null,U.schema=o.schema,U.schemaEnv=o,o.$async&&(U.$async=!0),this.opts.code.source===!0&&(U.source={validateName:j,validateCode:z,scopeValues:d._values}),this.opts.unevaluated){const{props:J,items:x}=T;U.evaluated={props:J instanceof e.Name?void 0:J,items:x instanceof e.Name?void 0:x,dynamicProps:J instanceof e.Name,dynamicItems:x instanceof e.Name},U.source&&(U.source.evaluated=(0,e.stringify)(U.evaluated))}return o.validate=U,o}catch(z){throw delete o.validate,delete o.validateName,M&&this.logger.error("Error compiling schema, function code:",M),z}finally{this._compilations.delete(o)}}oe.compileSchema=u;function m(o,i,t){var a;t=(0,l.resolveUrl)(this.opts.uriResolver,i,t);const f=o.refs[t];if(f)return f;let r=v.call(this,o,t);if(r===void 0){const d=(a=o.localRefs)===null||a===void 0?void 0:a[t],{schemaId:b}=this.opts;d&&(r=new h({schema:d,schemaId:b,root:o,baseId:i}))}if(r!==void 0)return o.refs[t]=g.call(this,r)}oe.resolveRef=m;function g(o){return(0,l.inlineRef)(o.schema,this.opts.inlineRefs)?o.schema:o.validate?o:u.call(this,o)}function _(o){for(const i of this._compilations)if(P(i,o))return i}oe.getCompilingSchema=_;function P(o,i){return o.schema===i.schema&&o.root===i.root&&o.baseId===i.baseId}function v(o,i){let t;for(;typeof(t=this.refs[i])=="string";)i=t;return t||this.schemas[i]||p.call(this,o,i)}function p(o,i){const t=this.opts.uriResolver.parse(i),a=(0,l._getFullPath)(this.opts.uriResolver,t);let f=(0,l.getFullPath)(this.opts.uriResolver,o.baseId,void 0);if(Object.keys(o.schema).length>0&&a===f)return $.call(this,t,o);const r=(0,l.normalizeId)(a),d=this.refs[r]||this.schemas[r];if(typeof d=="string"){const b=p.call(this,o,d);return typeof(b==null?void 0:b.schema)!="object"?void 0:$.call(this,t,b)}if(typeof(d==null?void 0:d.schema)=="object"){if(d.validate||u.call(this,d),r===(0,l.normalizeId)(i)){const{schema:b}=d,{schemaId:j}=this.opts,T=b[j];return T&&(f=(0,l.resolveUrl)(this.opts.uriResolver,f,T)),new h({schema:b,schemaId:j,root:o,baseId:f})}return $.call(this,t,d)}}oe.resolveSchema=p;const y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $(o,{baseId:i,schema:t,root:a}){var f;if(((f=o.fragment)===null||f===void 0?void 0:f[0])!=="/")return;for(const b of o.fragment.slice(1).split("/")){if(typeof t=="boolean")return;const j=t[(0,E.unescapeFragment)(b)];if(j===void 0)return;t=j;const T=typeof t=="object"&&t[this.opts.schemaId];!y.has(b)&&T&&(i=(0,l.resolveUrl)(this.opts.uriResolver,i,T))}let r;if(typeof t!="boolean"&&t.$ref&&!(0,E.schemaHasRulesButRef)(t,this.RULES)){const b=(0,l.resolveUrl)(this.opts.uriResolver,i,t.$ref);r=p.call(this,a,b)}const{schemaId:d}=this.opts;if(r=r||new h({schema:t,schemaId:d,root:a,baseId:i}),r.schema!==r.root.schema)return r}return oe}const vn="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",gn="Meta-schema for $data reference (JSON AnySchema extension proposal)",$n="object",wn=["$data"],bn={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},En=!1,Sn={$id:vn,description:gn,type:$n,required:wn,properties:bn,additionalProperties:En};var qe={},Re={exports:{}},jt,ur;function an(){if(ur)return jt;ur=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),n=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);function w(v){let p="",y=0,$=0;for($=0;$<v.length;$++)if(y=v[$].charCodeAt(0),y!==48){if(!(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102))return"";p+=v[$];break}for($+=1;$<v.length;$++){if(y=v[$].charCodeAt(0),!(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102))return"";p+=v[$]}return p}const l=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function E(v){return v.length=0,!0}function s(v,p,y){if(v.length){const $=w(v);if($!=="")p.push($);else return y.error=!0,!1;v.length=0}return!0}function h(v){let p=0;const y={error:!1,address:"",zone:""},$=[],o=[];let i=!1,t=!1,a=s;for(let f=0;f<v.length;f++){const r=v[f];if(!(r==="["||r==="]"))if(r===":"){if(i===!0&&(t=!0),!a(o,$,y))break;if(++p>7){y.error=!0;break}f>0&&v[f-1]===":"&&(i=!0),$.push(":");continue}else if(r==="%"){if(!a(o,$,y))break;a=E}else{o.push(r);continue}}return o.length&&(a===E?y.zone=o.join(""):t?$.push(o.join("")):$.push(w(o))),y.address=$.join(""),y}function u(v){if(m(v,":")<2)return{host:v,isIPV6:!1};const p=h(v);if(p.error)return{host:v,isIPV6:!1};{let y=p.address,$=p.address;return p.zone&&(y+="%"+p.zone,$+="%25"+p.zone),{host:y,isIPV6:!0,escapedHost:$}}}function m(v,p){let y=0;for(let $=0;$<v.length;$++)v[$]===p&&y++;return y}function g(v){let p=v;const y=[];let $=-1,o=0;for(;o=p.length;){if(o===1){if(p===".")break;if(p==="/"){y.push("/");break}else{y.push(p);break}}else if(o===2){if(p[0]==="."){if(p[1]===".")break;if(p[1]==="/"){p=p.slice(2);continue}}else if(p[0]==="/"&&(p[1]==="."||p[1]==="/")){y.push("/");break}}else if(o===3&&p==="/.."){y.length!==0&&y.pop(),y.push("/");break}if(p[0]==="."){if(p[1]==="."){if(p[2]==="/"){p=p.slice(3);continue}}else if(p[1]==="/"){p=p.slice(2);continue}}else if(p[0]==="/"&&p[1]==="."){if(p[2]==="/"){p=p.slice(2);continue}else if(p[2]==="."&&p[3]==="/"){p=p.slice(3),y.length!==0&&y.pop();continue}}if(($=p.indexOf("/",1))===-1){y.push(p);break}else y.push(p.slice(0,$)),p=p.slice($)}return y.join("")}function _(v,p){const y=p!==!0?escape:unescape;return v.scheme!==void 0&&(v.scheme=y(v.scheme)),v.userinfo!==void 0&&(v.userinfo=y(v.userinfo)),v.host!==void 0&&(v.host=y(v.host)),v.path!==void 0&&(v.path=y(v.path)),v.query!==void 0&&(v.query=y(v.query)),v.fragment!==void 0&&(v.fragment=y(v.fragment)),v}function P(v){const p=[];if(v.userinfo!==void 0&&(p.push(v.userinfo),p.push("@")),v.host!==void 0){let y=unescape(v.host);if(!n(y)){const $=u(y);$.isIPV6===!0?y=`[${$.escapedHost}]`:y=v.host}p.push(y)}return(typeof v.port=="number"||typeof v.port=="string")&&(p.push(":"),p.push(String(v.port))),p.length?p.join(""):void 0}return jt={nonSimpleDomain:l,recomposeAuthority:P,normalizeComponentEncoding:_,removeDotSegments:g,isIPv4:n,isUUID:e,normalizeIPv6:u,stringArrayToHexStripped:w},jt}var Tt,cr;function Pn(){if(cr)return Tt;cr=1;const{isUUID:e}=an(),n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,w=["http","https","ws","wss","urn","urn:uuid"];function l(r){return w.indexOf(r)!==-1}function E(r){return r.secure===!0?!0:r.secure===!1?!1:r.scheme?r.scheme.length===3&&(r.scheme[0]==="w"||r.scheme[0]==="W")&&(r.scheme[1]==="s"||r.scheme[1]==="S")&&(r.scheme[2]==="s"||r.scheme[2]==="S"):!1}function s(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function h(r){const d=String(r.scheme).toLowerCase()==="https";return(r.port===(d?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function u(r){return r.secure=E(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function m(r){if((r.port===(E(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){const[d,b]=r.resourceName.split("?");r.path=d&&d!=="/"?d:void 0,r.query=b,r.resourceName=void 0}return r.fragment=void 0,r}function g(r,d){if(!r.path)return r.error="URN can not be parsed",r;const b=r.path.match(n);if(b){const j=d.scheme||r.scheme||"urn";r.nid=b[1].toLowerCase(),r.nss=b[2];const T=`${j}:${d.nid||r.nid}`,M=f(T);r.path=void 0,M&&(r=M.parse(r,d))}else r.error=r.error||"URN can not be parsed.";return r}function _(r,d){if(r.nid===void 0)throw new Error("URN without nid cannot be serialized");const b=d.scheme||r.scheme||"urn",j=r.nid.toLowerCase(),T=`${b}:${d.nid||j}`,M=f(T);M&&(r=M.serialize(r,d));const z=r,V=r.nss;return z.path=`${j||d.nid}:${V}`,d.skipEscape=!0,z}function P(r,d){const b=r;return b.uuid=b.nss,b.nss=void 0,!d.tolerant&&(!b.uuid||!e(b.uuid))&&(b.error=b.error||"UUID is not valid."),b}function v(r){const d=r;return d.nss=(r.uuid||"").toLowerCase(),d}const p={scheme:"http",domainHost:!0,parse:s,serialize:h},y={scheme:"https",domainHost:p.domainHost,parse:s,serialize:h},$={scheme:"ws",domainHost:!0,parse:u,serialize:m},o={scheme:"wss",domainHost:$.domainHost,parse:$.parse,serialize:$.serialize},a={http:p,https:y,ws:$,wss:o,urn:{scheme:"urn",parse:g,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:P,serialize:v,skipNormalize:!0}};Object.setPrototypeOf(a,null);function f(r){return r&&(a[r]||a[r.toLowerCase()])||void 0}return Tt={wsIsSecure:E,SCHEMES:a,isValidSchemeName:l,getSchemeHandler:f},Tt}var dr;function Nn(){if(dr)return Re.exports;dr=1;const{normalizeIPv6:e,removeDotSegments:n,recomposeAuthority:w,normalizeComponentEncoding:l,isIPv4:E,nonSimpleDomain:s}=an(),{SCHEMES:h,getSchemeHandler:u}=Pn();function m(o,i){return typeof o=="string"?o=v(y(o,i),i):typeof o=="object"&&(o=y(v(o,i),i)),o}function g(o,i,t){const a=t?Object.assign({scheme:"null"},t):{scheme:"null"},f=_(y(o,a),y(i,a),a,!0);return a.skipEscape=!0,v(f,a)}function _(o,i,t,a){const f={};return a||(o=y(v(o,t),t),i=y(v(i,t),t)),t=t||{},!t.tolerant&&i.scheme?(f.scheme=i.scheme,f.userinfo=i.userinfo,f.host=i.host,f.port=i.port,f.path=n(i.path||""),f.query=i.query):(i.userinfo!==void 0||i.host!==void 0||i.port!==void 0?(f.userinfo=i.userinfo,f.host=i.host,f.port=i.port,f.path=n(i.path||""),f.query=i.query):(i.path?(i.path[0]==="/"?f.path=n(i.path):((o.userinfo!==void 0||o.host!==void 0||o.port!==void 0)&&!o.path?f.path="/"+i.path:o.path?f.path=o.path.slice(0,o.path.lastIndexOf("/")+1)+i.path:f.path=i.path,f.path=n(f.path)),f.query=i.query):(f.path=o.path,i.query!==void 0?f.query=i.query:f.query=o.query),f.userinfo=o.userinfo,f.host=o.host,f.port=o.port),f.scheme=o.scheme),f.fragment=i.fragment,f}function P(o,i,t){return typeof o=="string"?(o=unescape(o),o=v(l(y(o,t),!0),{...t,skipEscape:!0})):typeof o=="object"&&(o=v(l(o,!0),{...t,skipEscape:!0})),typeof i=="string"?(i=unescape(i),i=v(l(y(i,t),!0),{...t,skipEscape:!0})):typeof i=="object"&&(i=v(l(i,!0),{...t,skipEscape:!0})),o.toLowerCase()===i.toLowerCase()}function v(o,i){const t={host:o.host,scheme:o.scheme,userinfo:o.userinfo,port:o.port,path:o.path,query:o.query,nid:o.nid,nss:o.nss,uuid:o.uuid,fragment:o.fragment,reference:o.reference,resourceName:o.resourceName,secure:o.secure,error:""},a=Object.assign({},i),f=[],r=u(a.scheme||t.scheme);r&&r.serialize&&r.serialize(t,a),t.path!==void 0&&(a.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),a.reference!=="suffix"&&t.scheme&&f.push(t.scheme,":");const d=w(t);if(d!==void 0&&(a.reference!=="suffix"&&f.push("//"),f.push(d),t.path&&t.path[0]!=="/"&&f.push("/")),t.path!==void 0){let b=t.path;!a.absolutePath&&(!r||!r.absolutePath)&&(b=n(b)),d===void 0&&b[0]==="/"&&b[1]==="/"&&(b="/%2F"+b.slice(2)),f.push(b)}return t.query!==void 0&&f.push("?",t.query),t.fragment!==void 0&&f.push("#",t.fragment),f.join("")}const p=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function y(o,i){const t=Object.assign({},i),a={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let f=!1;t.reference==="suffix"&&(t.scheme?o=t.scheme+":"+o:o="//"+o);const r=o.match(p);if(r){if(a.scheme=r[1],a.userinfo=r[3],a.host=r[4],a.port=parseInt(r[5],10),a.path=r[6]||"",a.query=r[7],a.fragment=r[8],isNaN(a.port)&&(a.port=r[5]),a.host)if(E(a.host)===!1){const j=e(a.host);a.host=j.host.toLowerCase(),f=j.isIPV6}else f=!0;a.scheme===void 0&&a.userinfo===void 0&&a.host===void 0&&a.port===void 0&&a.query===void 0&&!a.path?a.reference="same-document":a.scheme===void 0?a.reference="relative":a.fragment===void 0?a.reference="absolute":a.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==a.reference&&(a.error=a.error||"URI is not a "+t.reference+" reference.");const d=u(t.scheme||a.scheme);if(!t.unicodeSupport&&(!d||!d.unicodeSupport)&&a.host&&(t.domainHost||d&&d.domainHost)&&f===!1&&s(a.host))try{a.host=URL.domainToASCII(a.host.toLowerCase())}catch(b){a.error=a.error||"Host's domain name can not be converted to ASCII: "+b}(!d||d&&!d.skipNormalize)&&(o.indexOf("%")!==-1&&(a.scheme!==void 0&&(a.scheme=unescape(a.scheme)),a.host!==void 0&&(a.host=unescape(a.host))),a.path&&(a.path=escape(unescape(a.path))),a.fragment&&(a.fragment=encodeURI(decodeURIComponent(a.fragment)))),d&&d.parse&&d.parse(a,t)}else a.error=a.error||"URI can not be parsed.";return a}const $={SCHEMES:h,normalize:m,resolve:g,resolveComponent:_,equal:P,serialize:v,parse:y};return Re.exports=$,Re.exports.default=$,Re.exports.fastUri=$,Re.exports}var lr;function Rn(){if(lr)return qe;lr=1,Object.defineProperty(qe,"__esModule",{value:!0});const e=Nn();return e.code='require("ajv/dist/runtime/uri").default',qe.default=e,qe}var fr;function kn(){return fr||(fr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var n=vt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var w=G();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return w._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return w.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return w.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return w.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return w.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return w.CodeGen}});const l=Mt(),E=gt(),s=rn(),h=At(),u=G(),m=_t(),g=pt(),_=Z(),P=Sn,v=Rn(),p=(A,R)=>new RegExp(A,R);p.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],$=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),o={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."},i={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},t=200;function a(A){var R,C,O,c,S,I,F,L,Y,B,N,k,q,D,K,W,ee,ue,se,ae,te,be,ie,$t,wt;const Pe=A.strict,bt=(R=A.code)===null||R===void 0?void 0:R.optimize,zt=bt===!0||bt===void 0?1:bt||0,Vt=(O=(C=A.code)===null||C===void 0?void 0:C.regExp)!==null&&O!==void 0?O:p,ln=(c=A.uriResolver)!==null&&c!==void 0?c:v.default;return{strictSchema:(I=(S=A.strictSchema)!==null&&S!==void 0?S:Pe)!==null&&I!==void 0?I:!0,strictNumbers:(L=(F=A.strictNumbers)!==null&&F!==void 0?F:Pe)!==null&&L!==void 0?L:!0,strictTypes:(B=(Y=A.strictTypes)!==null&&Y!==void 0?Y:Pe)!==null&&B!==void 0?B:"log",strictTuples:(k=(N=A.strictTuples)!==null&&N!==void 0?N:Pe)!==null&&k!==void 0?k:"log",strictRequired:(D=(q=A.strictRequired)!==null&&q!==void 0?q:Pe)!==null&&D!==void 0?D:!1,code:A.code?{...A.code,optimize:zt,regExp:Vt}:{optimize:zt,regExp:Vt},loopRequired:(K=A.loopRequired)!==null&&K!==void 0?K:t,loopEnum:(W=A.loopEnum)!==null&&W!==void 0?W:t,meta:(ee=A.meta)!==null&&ee!==void 0?ee:!0,messages:(ue=A.messages)!==null&&ue!==void 0?ue:!0,inlineRefs:(se=A.inlineRefs)!==null&&se!==void 0?se:!0,schemaId:(ae=A.schemaId)!==null&&ae!==void 0?ae:"$id",addUsedSchema:(te=A.addUsedSchema)!==null&&te!==void 0?te:!0,validateSchema:(be=A.validateSchema)!==null&&be!==void 0?be:!0,validateFormats:(ie=A.validateFormats)!==null&&ie!==void 0?ie:!0,unicodeRegExp:($t=A.unicodeRegExp)!==null&&$t!==void 0?$t:!0,int32range:(wt=A.int32range)!==null&&wt!==void 0?wt:!0,uriResolver:ln}}class f{constructor(R={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,R=this.opts={...R,...a(R)};const{es5:C,lines:O}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:$,es5:C,lines:O}),this.logger=V(R.logger);const c=R.validateFormats;R.validateFormats=!1,this.RULES=(0,s.getRules)(),r.call(this,o,R,"NOT SUPPORTED"),r.call(this,i,R,"DEPRECATED","warn"),this._metaOpts=M.call(this),R.formats&&j.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),R.keywords&&T.call(this,R.keywords),typeof R.meta=="object"&&this.addMetaSchema(R.meta),b.call(this),R.validateFormats=c}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:R,meta:C,schemaId:O}=this.opts;let c=P;O==="id"&&(c={...P},c.id=c.$id,delete c.$id),C&&R&&this.addMetaSchema(c,c[O],!1)}defaultMeta(){const{meta:R,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof R=="object"?R[C]||R:void 0}validate(R,C){let O;if(typeof R=="string"){if(O=this.getSchema(R),!O)throw new Error(`no schema with key or ref "${R}"`)}else O=this.compile(R);const c=O(C);return"$async"in O||(this.errors=O.errors),c}compile(R,C){const O=this._addSchema(R,C);return O.validate||this._compileSchemaEnv(O)}compileAsync(R,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:O}=this.opts;return c.call(this,R,C);async function c(B,N){await S.call(this,B.$schema);const k=this._addSchema(B,N);return k.validate||I.call(this,k)}async function S(B){B&&!this.getSchema(B)&&await c.call(this,{$ref:B},!0)}async function I(B){try{return this._compileSchemaEnv(B)}catch(N){if(!(N instanceof E.default))throw N;return F.call(this,N),await L.call(this,N.missingSchema),I.call(this,B)}}function F({missingSchema:B,missingRef:N}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${N} cannot be resolved`)}async function L(B){const N=await Y.call(this,B);this.refs[B]||await S.call(this,N.$schema),this.refs[B]||this.addSchema(N,B,C)}async function Y(B){const N=this._loading[B];if(N)return N;try{return await(this._loading[B]=O(B))}finally{delete this._loading[B]}}}addSchema(R,C,O,c=this.opts.validateSchema){if(Array.isArray(R)){for(const I of R)this.addSchema(I,void 0,O,c);return this}let S;if(typeof R=="object"){const{schemaId:I}=this.opts;if(S=R[I],S!==void 0&&typeof S!="string")throw new Error(`schema ${I} must be string`)}return C=(0,m.normalizeId)(C||S),this._checkUnique(C),this.schemas[C]=this._addSchema(R,O,C,c,!0),this}addMetaSchema(R,C,O=this.opts.validateSchema){return this.addSchema(R,C,!0,O),this}validateSchema(R,C){if(typeof R=="boolean")return!0;let O;if(O=R.$schema,O!==void 0&&typeof O!="string")throw new Error("$schema must be a string");if(O=O||this.opts.defaultMeta||this.defaultMeta(),!O)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const c=this.validate(O,R);if(!c&&C){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return c}getSchema(R){let C;for(;typeof(C=d.call(this,R))=="string";)R=C;if(C===void 0){const{schemaId:O}=this.opts,c=new h.SchemaEnv({schema:{},schemaId:O});if(C=h.resolveSchema.call(this,c,R),!C)return;this.refs[R]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(R){if(R instanceof RegExp)return this._removeAllSchemas(this.schemas,R),this._removeAllSchemas(this.refs,R),this;switch(typeof R){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=d.call(this,R);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[R],delete this.refs[R],this}case"object":{const C=R;this._cache.delete(C);let O=R[this.opts.schemaId];return O&&(O=(0,m.normalizeId)(O),delete this.schemas[O],delete this.refs[O]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(R){for(const C of R)this.addKeyword(C);return this}addKeyword(R,C){let O;if(typeof R=="string")O=R,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=O);else if(typeof R=="object"&&C===void 0){if(C=R,O=C.keyword,Array.isArray(O)&&!O.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(J.call(this,O,C),!C)return(0,_.eachItem)(O,S=>x.call(this,S)),this;fe.call(this,C);const c={...C,type:(0,g.getJSONTypes)(C.type),schemaType:(0,g.getJSONTypes)(C.schemaType)};return(0,_.eachItem)(O,c.type.length===0?S=>x.call(this,S,c):S=>c.type.forEach(I=>x.call(this,S,c,I))),this}getKeyword(R){const C=this.RULES.all[R];return typeof C=="object"?C.definition:!!C}removeKeyword(R){const{RULES:C}=this;delete C.keywords[R],delete C.all[R];for(const O of C.rules){const c=O.rules.findIndex(S=>S.keyword===R);c>=0&&O.rules.splice(c,1)}return this}addFormat(R,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[R]=C,this}errorsText(R=this.errors,{separator:C=", ",dataVar:O="data"}={}){return!R||R.length===0?"No errors":R.map(c=>`${O}${c.instancePath} ${c.message}`).reduce((c,S)=>c+C+S)}$dataMetaSchema(R,C){const O=this.RULES.all;R=JSON.parse(JSON.stringify(R));for(const c of C){const S=c.split("/").slice(1);let I=R;for(const F of S)I=I[F];for(const F in O){const L=O[F];if(typeof L!="object")continue;const{$data:Y}=L.definition,B=I[F];Y&&B&&(I[F]=ye(B))}}return R}_removeAllSchemas(R,C){for(const O in R){const c=R[O];(!C||C.test(O))&&(typeof c=="string"?delete R[O]:c&&!c.meta&&(this._cache.delete(c.schema),delete R[O]))}}_addSchema(R,C,O,c=this.opts.validateSchema,S=this.opts.addUsedSchema){let I;const{schemaId:F}=this.opts;if(typeof R=="object")I=R[F];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof R!="boolean")throw new Error("schema must be object or boolean")}let L=this._cache.get(R);if(L!==void 0)return L;O=(0,m.normalizeId)(I||O);const Y=m.getSchemaRefs.call(this,R,O);return L=new h.SchemaEnv({schema:R,schemaId:F,meta:C,baseId:O,localRefs:Y}),this._cache.set(L.schema,L),S&&!O.startsWith("#")&&(O&&this._checkUnique(O),this.refs[O]=L),c&&this.validateSchema(R,!0),L}_checkUnique(R){if(this.schemas[R]||this.refs[R])throw new Error(`schema with key or id "${R}" already exists`)}_compileSchemaEnv(R){if(R.meta?this._compileMetaSchema(R):h.compileSchema.call(this,R),!R.validate)throw new Error("ajv implementation error");return R.validate}_compileMetaSchema(R){const C=this.opts;this.opts=this._metaOpts;try{h.compileSchema.call(this,R)}finally{this.opts=C}}}f.ValidationError=l.default,f.MissingRefError=E.default,e.default=f;function r(A,R,C,O="error"){for(const c in A){const S=c;S in R&&this.logger[O](`${C}: option ${c}. ${A[S]}`)}}function d(A){return A=(0,m.normalizeId)(A),this.schemas[A]||this.refs[A]}function b(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const R in A)this.addSchema(A[R],R)}function j(){for(const A in this.opts.formats){const R=this.opts.formats[A];R&&this.addFormat(A,R)}}function T(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const R in A){const C=A[R];C.keyword||(C.keyword=R),this.addKeyword(C)}}function M(){const A={...this.opts};for(const R of y)delete A[R];return A}const z={log(){},warn(){},error(){}};function V(A){if(A===!1)return z;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function J(A,R){const{RULES:C}=this;if((0,_.eachItem)(A,O=>{if(C.keywords[O])throw new Error(`Keyword ${O} is already defined`);if(!U.test(O))throw new Error(`Keyword ${O} has invalid name`)}),!!R&&R.$data&&!("code"in R||"validate"in R))throw new Error('$data keyword must have "code" or "validate" function')}function x(A,R,C){var O;const c=R==null?void 0:R.post;if(C&&c)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let I=c?S.post:S.rules.find(({type:L})=>L===C);if(I||(I={type:C,rules:[]},S.rules.push(I)),S.keywords[A]=!0,!R)return;const F={keyword:A,definition:{...R,type:(0,g.getJSONTypes)(R.type),schemaType:(0,g.getJSONTypes)(R.schemaType)}};R.before?le.call(this,I,F,R.before):I.rules.push(F),S.all[A]=F,(O=R.implements)===null||O===void 0||O.forEach(L=>this.addKeyword(L))}function le(A,R,C){const O=A.rules.findIndex(c=>c.keyword===C);O>=0?A.rules.splice(O,0,R):(A.rules.push(R),this.logger.warn(`rule ${C} is not defined`))}function fe(A){let{metaSchema:R}=A;R!==void 0&&(A.$data&&this.opts.$data&&(R=ye(R)),A.validateSchema=this.compile(R,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ye(A){return{anyOf:[A,X]}}})(Et)),Et}var Ce={},Me={},Ae={},hr;function On(){if(hr)return Ae;hr=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ae.default=e,Ae}var _e={},mr;function jn(){if(mr)return _e;mr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.callRef=_e.getValidate=void 0;const e=gt(),n=de(),w=G(),l=ve(),E=At(),s=Z(),h={keyword:"$ref",schemaType:"string",code(g){const{gen:_,schema:P,it:v}=g,{baseId:p,schemaEnv:y,validateName:$,opts:o,self:i}=v,{root:t}=y;if((P==="#"||P==="#/")&&p===t.baseId)return f();const a=E.resolveRef.call(i,t,p,P);if(a===void 0)throw new e.default(v.opts.uriResolver,p,P);if(a instanceof E.SchemaEnv)return r(a);return d(a);function f(){if(y===t)return m(g,$,y,y.$async);const b=_.scopeValue("root",{ref:t});return m(g,(0,w._)`${b}.validate`,t,t.$async)}function r(b){const j=u(g,b);m(g,j,b,b.$async)}function d(b){const j=_.scopeValue("schema",o.code.source===!0?{ref:b,code:(0,w.stringify)(b)}:{ref:b}),T=_.name("valid"),M=g.subschema({schema:b,dataTypes:[],schemaPath:w.nil,topSchemaRef:j,errSchemaPath:P},T);g.mergeEvaluated(M),g.ok(T)}}};function u(g,_){const{gen:P}=g;return _.validate?P.scopeValue("validate",{ref:_.validate}):(0,w._)`${P.scopeValue("wrapper",{ref:_})}.validate`}_e.getValidate=u;function m(g,_,P,v){const{gen:p,it:y}=g,{allErrors:$,schemaEnv:o,opts:i}=y,t=i.passContext?l.default.this:w.nil;v?a():f();function a(){if(!o.$async)throw new Error("async schema referenced by sync schema");const b=p.let("valid");p.try(()=>{p.code((0,w._)`await ${(0,n.callValidateCode)(g,_,t)}`),d(_),$||p.assign(b,!0)},j=>{p.if((0,w._)`!(${j} instanceof ${y.ValidationError})`,()=>p.throw(j)),r(j),$||p.assign(b,!1)}),g.ok(b)}function f(){g.result((0,n.callValidateCode)(g,_,t),()=>d(_),()=>r(_))}function r(b){const j=(0,w._)`${b}.errors`;p.assign(l.default.vErrors,(0,w._)`${l.default.vErrors} === null ? ${j} : ${l.default.vErrors}.concat(${j})`),p.assign(l.default.errors,(0,w._)`${l.default.vErrors}.length`)}function d(b){var j;if(!y.opts.unevaluated)return;const T=(j=P==null?void 0:P.validate)===null||j===void 0?void 0:j.evaluated;if(y.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(y.props=s.mergeEvaluated.props(p,T.props,y.props));else{const M=p.var("props",(0,w._)`${b}.evaluated.props`);y.props=s.mergeEvaluated.props(p,M,y.props,w.Name)}if(y.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(y.items=s.mergeEvaluated.items(p,T.items,y.items));else{const M=p.var("items",(0,w._)`${b}.evaluated.items`);y.items=s.mergeEvaluated.items(p,M,y.items,w.Name)}}}return _e.callRef=m,_e.default=h,_e}var pr;function Tn(){if(pr)return Me;pr=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=On(),n=jn(),w=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,n.default];return Me.default=w,Me}var De={},ze={},yr;function In(){if(yr)return ze;yr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=G(),n=e.operators,w={maximum:{okStr:"<=",ok:n.LTE,fail:n.GT},minimum:{okStr:">=",ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},l={message:({keyword:s,schemaCode:h})=>(0,e.str)`must be ${w[s].okStr} ${h}`,params:({keyword:s,schemaCode:h})=>(0,e._)`{comparison: ${w[s].okStr}, limit: ${h}}`},E={keyword:Object.keys(w),type:"number",schemaType:"number",$data:!0,error:l,code(s){const{keyword:h,data:u,schemaCode:m}=s;s.fail$data((0,e._)`${u} ${w[h].fail} ${m} || isNaN(${u})`)}};return ze.default=E,ze}var Ve={},_r;function qn(){if(_r)return Ve;_r=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=G(),w={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:l})=>(0,e.str)`must be multiple of ${l}`,params:({schemaCode:l})=>(0,e._)`{multipleOf: ${l}}`},code(l){const{gen:E,data:s,schemaCode:h,it:u}=l,m=u.opts.multipleOfPrecision,g=E.let("res"),_=m?(0,e._)`Math.abs(Math.round(${g}) - ${g}) > 1e-${m}`:(0,e._)`${g} !== parseInt(${g})`;l.fail$data((0,e._)`(${h} === 0 || (${g} = ${s}/${h}, ${_}))`)}};return Ve.default=w,Ve}var Fe={},Ue={},vr;function Cn(){if(vr)return Ue;vr=1,Object.defineProperty(Ue,"__esModule",{value:!0});function e(n){const w=n.length;let l=0,E=0,s;for(;E<w;)l++,s=n.charCodeAt(E++),s>=55296&&s<=56319&&E<w&&(s=n.charCodeAt(E),(s&64512)===56320&&E++);return l}return Ue.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Ue}var gr;function Mn(){if(gr)return Fe;gr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=G(),n=Z(),w=Cn(),E={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:h}){const u=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${u} than ${h} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:h,data:u,schemaCode:m,it:g}=s,_=h==="maxLength"?e.operators.GT:e.operators.LT,P=g.opts.unicode===!1?(0,e._)`${u}.length`:(0,e._)`${(0,n.useFunc)(s.gen,w.default)}(${u})`;s.fail$data((0,e._)`${P} ${_} ${m}`)}};return Fe.default=E,Fe}var Ke={},$r;function An(){if($r)return Ke;$r=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=de(),n=Z(),w=G(),E={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,w.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,w._)`{pattern: ${s}}`},code(s){const{gen:h,data:u,$data:m,schema:g,schemaCode:_,it:P}=s,v=P.opts.unicodeRegExp?"u":"";if(m){const{regExp:p}=P.opts.code,y=p.code==="new RegExp"?(0,w._)`new RegExp`:(0,n.useFunc)(h,p),$=h.let("valid");h.try(()=>h.assign($,(0,w._)`${y}(${_}, ${v}).test(${u})`),()=>h.assign($,!1)),s.fail$data((0,w._)`!${$}`)}else{const p=(0,e.usePattern)(s,g);s.fail$data((0,w._)`!${p}.test(${u})`)}}};return Ke.default=E,Ke}var Le={},wr;function Dn(){if(wr)return Le;wr=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=G(),w={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:l,schemaCode:E}){const s=l==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${E} properties`},params:({schemaCode:l})=>(0,e._)`{limit: ${l}}`},code(l){const{keyword:E,data:s,schemaCode:h}=l,u=E==="maxProperties"?e.operators.GT:e.operators.LT;l.fail$data((0,e._)`Object.keys(${s}).length ${u} ${h}`)}};return Le.default=w,Le}var He={},br;function zn(){if(br)return He;br=1,Object.defineProperty(He,"__esModule",{value:!0});const e=de(),n=G(),w=Z(),E={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,n.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,n._)`{missingProperty: ${s}}`},code(s){const{gen:h,schema:u,schemaCode:m,data:g,$data:_,it:P}=s,{opts:v}=P;if(!_&&u.length===0)return;const p=u.length>=v.loopRequired;if(P.allErrors?y():$(),v.strictRequired){const t=s.parentSchema.properties,{definedProperties:a}=s.it;for(const f of u)if((t==null?void 0:t[f])===void 0&&!a.has(f)){const r=P.schemaEnv.baseId+P.errSchemaPath,d=`required property "${f}" is not defined at "${r}" (strictRequired)`;(0,w.checkStrictMode)(P,d,P.opts.strictRequired)}}function y(){if(p||_)s.block$data(n.nil,o);else for(const t of u)(0,e.checkReportMissingProp)(s,t)}function $(){const t=h.let("missing");if(p||_){const a=h.let("valid",!0);s.block$data(a,()=>i(t,a)),s.ok(a)}else h.if((0,e.checkMissingProp)(s,u,t)),(0,e.reportMissingProp)(s,t),h.else()}function o(){h.forOf("prop",m,t=>{s.setParams({missingProperty:t}),h.if((0,e.noPropertyInData)(h,g,t,v.ownProperties),()=>s.error())})}function i(t,a){s.setParams({missingProperty:t}),h.forOf(t,m,()=>{h.assign(a,(0,e.propertyInData)(h,g,t,v.ownProperties)),h.if((0,n.not)(a),()=>{s.error(),h.break()})},n.nil)}}};return He.default=E,He}var Ge={},Er;function Vn(){if(Er)return Ge;Er=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=G(),w={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:l,schemaCode:E}){const s=l==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${E} items`},params:({schemaCode:l})=>(0,e._)`{limit: ${l}}`},code(l){const{keyword:E,data:s,schemaCode:h}=l,u=E==="maxItems"?e.operators.GT:e.operators.LT;l.fail$data((0,e._)`${s}.length ${u} ${h}`)}};return Ge.default=w,Ge}var Je={},We={},Sr;function Dt(){if(Sr)return We;Sr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=sn();return e.code='require("ajv/dist/runtime/equal").default',We.default=e,We}var Pr;function Fn(){if(Pr)return Je;Pr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=pt(),n=G(),w=Z(),l=Dt(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:h,j:u}})=>(0,n.str)`must NOT have duplicate items (items ## ${u} and ${h} are identical)`,params:({params:{i:h,j:u}})=>(0,n._)`{i: ${h}, j: ${u}}`},code(h){const{gen:u,data:m,$data:g,schema:_,parentSchema:P,schemaCode:v,it:p}=h;if(!g&&!_)return;const y=u.let("valid"),$=P.items?(0,e.getSchemaTypes)(P.items):[];h.block$data(y,o,(0,n._)`${v} === false`),h.ok(y);function o(){const f=u.let("i",(0,n._)`${m}.length`),r=u.let("j");h.setParams({i:f,j:r}),u.assign(y,!0),u.if((0,n._)`${f} > 1`,()=>(i()?t:a)(f,r))}function i(){return $.length>0&&!$.some(f=>f==="object"||f==="array")}function t(f,r){const d=u.name("item"),b=(0,e.checkDataTypes)($,d,p.opts.strictNumbers,e.DataType.Wrong),j=u.const("indices",(0,n._)`{}`);u.for((0,n._)`;${f}--;`,()=>{u.let(d,(0,n._)`${m}[${f}]`),u.if(b,(0,n._)`continue`),$.length>1&&u.if((0,n._)`typeof ${d} == "string"`,(0,n._)`${d} += "_"`),u.if((0,n._)`typeof ${j}[${d}] == "number"`,()=>{u.assign(r,(0,n._)`${j}[${d}]`),h.error(),u.assign(y,!1).break()}).code((0,n._)`${j}[${d}] = ${f}`)})}function a(f,r){const d=(0,w.useFunc)(u,l.default),b=u.name("outer");u.label(b).for((0,n._)`;${f}--;`,()=>u.for((0,n._)`${r} = ${f}; ${r}--;`,()=>u.if((0,n._)`${d}(${m}[${f}], ${m}[${r}])`,()=>{h.error(),u.assign(y,!1).break(b)})))}}};return Je.default=s,Je}var Be={},Nr;function Un(){if(Nr)return Be;Nr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=G(),n=Z(),w=Dt(),E={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:h,data:u,$data:m,schemaCode:g,schema:_}=s;m||_&&typeof _=="object"?s.fail$data((0,e._)`!${(0,n.useFunc)(h,w.default)}(${u}, ${g})`):s.fail((0,e._)`${_} !== ${u}`)}};return Be.default=E,Be}var Ze={},Rr;function Kn(){if(Rr)return Ze;Rr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=G(),n=Z(),w=Dt(),E={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:h,data:u,$data:m,schema:g,schemaCode:_,it:P}=s;if(!m&&g.length===0)throw new Error("enum must have non-empty array");const v=g.length>=P.opts.loopEnum;let p;const y=()=>p??(p=(0,n.useFunc)(h,w.default));let $;if(v||m)$=h.let("valid"),s.block$data($,o);else{if(!Array.isArray(g))throw new Error("ajv implementation error");const t=h.const("vSchema",_);$=(0,e.or)(...g.map((a,f)=>i(t,f)))}s.pass($);function o(){h.assign($,!1),h.forOf("v",_,t=>h.if((0,e._)`${y()}(${u}, ${t})`,()=>h.assign($,!0).break()))}function i(t,a){const f=g[a];return typeof f=="object"&&f!==null?(0,e._)`${y()}(${u}, ${t}[${a}])`:(0,e._)`${u} === ${f}`}}};return Ze.default=E,Ze}var kr;function Ln(){if(kr)return De;kr=1,Object.defineProperty(De,"__esModule",{value:!0});const e=In(),n=qn(),w=Mn(),l=An(),E=Dn(),s=zn(),h=Vn(),u=Fn(),m=Un(),g=Kn(),_=[e.default,n.default,w.default,l.default,E.default,s.default,h.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,g.default];return De.default=_,De}var Ye={},Ee={},Or;function on(){if(Or)return Ee;Or=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.validateAdditionalItems=void 0;const e=G(),n=Z(),l={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:h,it:u}=s,{items:m}=h;if(!Array.isArray(m)){(0,n.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}E(s,m)}};function E(s,h){const{gen:u,schema:m,data:g,keyword:_,it:P}=s;P.items=!0;const v=u.const("len",(0,e._)`${g}.length`);if(m===!1)s.setParams({len:h.length}),s.pass((0,e._)`${v} <= ${h.length}`);else if(typeof m=="object"&&!(0,n.alwaysValidSchema)(P,m)){const y=u.var("valid",(0,e._)`${v} <= ${h.length}`);u.if((0,e.not)(y),()=>p(y)),s.ok(y)}function p(y){u.forRange("i",h.length,v,$=>{s.subschema({keyword:_,dataProp:$,dataPropType:n.Type.Num},y),P.allErrors||u.if((0,e.not)(y),()=>u.break())})}}return Ee.validateAdditionalItems=E,Ee.default=l,Ee}var Qe={},Se={},jr;function un(){if(jr)return Se;jr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.validateTuple=void 0;const e=G(),n=Z(),w=de(),l={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:h,it:u}=s;if(Array.isArray(h))return E(s,"additionalItems",h);u.items=!0,!(0,n.alwaysValidSchema)(u,h)&&s.ok((0,w.validateArray)(s))}};function E(s,h,u=s.schema){const{gen:m,parentSchema:g,data:_,keyword:P,it:v}=s;$(g),v.opts.unevaluated&&u.length&&v.items!==!0&&(v.items=n.mergeEvaluated.items(m,u.length,v.items));const p=m.name("valid"),y=m.const("len",(0,e._)`${_}.length`);u.forEach((o,i)=>{(0,n.alwaysValidSchema)(v,o)||(m.if((0,e._)`${y} > ${i}`,()=>s.subschema({keyword:P,schemaProp:i,dataProp:i},p)),s.ok(p))});function $(o){const{opts:i,errSchemaPath:t}=v,a=u.length,f=a===o.minItems&&(a===o.maxItems||o[h]===!1);if(i.strictTuples&&!f){const r=`"${P}" is ${a}-tuple, but minItems or maxItems/${h} are not specified or different at path "${t}"`;(0,n.checkStrictMode)(v,r,i.strictTuples)}}}return Se.validateTuple=E,Se.default=l,Se}var Tr;function Hn(){if(Tr)return Qe;Tr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=un(),n={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:w=>(0,e.validateTuple)(w,"items")};return Qe.default=n,Qe}var Xe={},Ir;function Gn(){if(Ir)return Xe;Ir=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=G(),n=Z(),w=de(),l=on(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:h}})=>(0,e.str)`must NOT have more than ${h} items`,params:({params:{len:h}})=>(0,e._)`{limit: ${h}}`},code(h){const{schema:u,parentSchema:m,it:g}=h,{prefixItems:_}=m;g.items=!0,!(0,n.alwaysValidSchema)(g,u)&&(_?(0,l.validateAdditionalItems)(h,_):h.ok((0,w.validateArray)(h)))}};return Xe.default=s,Xe}var xe={},qr;function Jn(){if(qr)return xe;qr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=G(),n=Z(),l={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:E,max:s}})=>s===void 0?(0,e.str)`must contain at least ${E} valid item(s)`:(0,e.str)`must contain at least ${E} and no more than ${s} valid item(s)`,params:({params:{min:E,max:s}})=>s===void 0?(0,e._)`{minContains: ${E}}`:(0,e._)`{minContains: ${E}, maxContains: ${s}}`},code(E){const{gen:s,schema:h,parentSchema:u,data:m,it:g}=E;let _,P;const{minContains:v,maxContains:p}=u;g.opts.next?(_=v===void 0?1:v,P=p):_=1;const y=s.const("len",(0,e._)`${m}.length`);if(E.setParams({min:_,max:P}),P===void 0&&_===0){(0,n.checkStrictMode)(g,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(P!==void 0&&_>P){(0,n.checkStrictMode)(g,'"minContains" > "maxContains" is always invalid'),E.fail();return}if((0,n.alwaysValidSchema)(g,h)){let a=(0,e._)`${y} >= ${_}`;P!==void 0&&(a=(0,e._)`${a} && ${y} <= ${P}`),E.pass(a);return}g.items=!0;const $=s.name("valid");P===void 0&&_===1?i($,()=>s.if($,()=>s.break())):_===0?(s.let($,!0),P!==void 0&&s.if((0,e._)`${m}.length > 0`,o)):(s.let($,!1),o()),E.result($,()=>E.reset());function o(){const a=s.name("_valid"),f=s.let("count",0);i(a,()=>s.if(a,()=>t(f)))}function i(a,f){s.forRange("i",0,y,r=>{E.subschema({keyword:"contains",dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},a),f()})}function t(a){s.code((0,e._)`${a}++`),P===void 0?s.if((0,e._)`${a} >= ${_}`,()=>s.assign($,!0).break()):(s.if((0,e._)`${a} > ${P}`,()=>s.assign($,!1).break()),_===1?s.assign($,!0):s.if((0,e._)`${a} >= ${_}`,()=>s.assign($,!0)))}}};return xe.default=l,xe}var It={},Cr;function Wn(){return Cr||(Cr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const n=G(),w=Z(),l=de();e.error={message:({params:{property:m,depsCount:g,deps:_}})=>{const P=g===1?"property":"properties";return(0,n.str)`must have ${P} ${_} when property ${m} is present`},params:({params:{property:m,depsCount:g,deps:_,missingProperty:P}})=>(0,n._)`{property: ${m},
|
|
6
|
+
missingProperty: ${P},
|
|
7
|
+
depsCount: ${g},
|
|
8
|
+
deps: ${_}}`};const E={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[g,_]=s(m);h(m,g),u(m,_)}};function s({schema:m}){const g={},_={};for(const P in m){if(P==="__proto__")continue;const v=Array.isArray(m[P])?g:_;v[P]=m[P]}return[g,_]}function h(m,g=m.schema){const{gen:_,data:P,it:v}=m;if(Object.keys(g).length===0)return;const p=_.let("missing");for(const y in g){const $=g[y];if($.length===0)continue;const o=(0,l.propertyInData)(_,P,y,v.opts.ownProperties);m.setParams({property:y,depsCount:$.length,deps:$.join(", ")}),v.allErrors?_.if(o,()=>{for(const i of $)(0,l.checkReportMissingProp)(m,i)}):(_.if((0,n._)`${o} && (${(0,l.checkMissingProp)(m,$,p)})`),(0,l.reportMissingProp)(m,p),_.else())}}e.validatePropertyDeps=h;function u(m,g=m.schema){const{gen:_,data:P,keyword:v,it:p}=m,y=_.name("valid");for(const $ in g)(0,w.alwaysValidSchema)(p,g[$])||(_.if((0,l.propertyInData)(_,P,$,p.opts.ownProperties),()=>{const o=m.subschema({keyword:v,schemaProp:$},y);m.mergeValidEvaluated(o,y)},()=>_.var(y,!0)),m.ok(y))}e.validateSchemaDeps=u,e.default=E})(It)),It}var et={},Mr;function Bn(){if(Mr)return et;Mr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=G(),n=Z(),l={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:E})=>(0,e._)`{propertyName: ${E.propertyName}}`},code(E){const{gen:s,schema:h,data:u,it:m}=E;if((0,n.alwaysValidSchema)(m,h))return;const g=s.name("valid");s.forIn("key",u,_=>{E.setParams({propertyName:_}),E.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},g),s.if((0,e.not)(g),()=>{E.error(!0),m.allErrors||s.break()})}),E.ok(g)}};return et.default=l,et}var tt={},Ar;function cn(){if(Ar)return tt;Ar=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=de(),n=G(),w=ve(),l=Z(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:h})=>(0,n._)`{additionalProperty: ${h.additionalProperty}}`},code(h){const{gen:u,schema:m,parentSchema:g,data:_,errsCount:P,it:v}=h;if(!P)throw new Error("ajv implementation error");const{allErrors:p,opts:y}=v;if(v.props=!0,y.removeAdditional!=="all"&&(0,l.alwaysValidSchema)(v,m))return;const $=(0,e.allSchemaProperties)(g.properties),o=(0,e.allSchemaProperties)(g.patternProperties);i(),h.ok((0,n._)`${P} === ${w.default.errors}`);function i(){u.forIn("key",_,d=>{!$.length&&!o.length?f(d):u.if(t(d),()=>f(d))})}function t(d){let b;if($.length>8){const j=(0,l.schemaRefOrVal)(v,g.properties,"properties");b=(0,e.isOwnProperty)(u,j,d)}else $.length?b=(0,n.or)(...$.map(j=>(0,n._)`${d} === ${j}`)):b=n.nil;return o.length&&(b=(0,n.or)(b,...o.map(j=>(0,n._)`${(0,e.usePattern)(h,j)}.test(${d})`))),(0,n.not)(b)}function a(d){u.code((0,n._)`delete ${_}[${d}]`)}function f(d){if(y.removeAdditional==="all"||y.removeAdditional&&m===!1){a(d);return}if(m===!1){h.setParams({additionalProperty:d}),h.error(),p||u.break();return}if(typeof m=="object"&&!(0,l.alwaysValidSchema)(v,m)){const b=u.name("valid");y.removeAdditional==="failing"?(r(d,b,!1),u.if((0,n.not)(b),()=>{h.reset(),a(d)})):(r(d,b),p||u.if((0,n.not)(b),()=>u.break()))}}function r(d,b,j){const T={keyword:"additionalProperties",dataProp:d,dataPropType:l.Type.Str};j===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),h.subschema(T,b)}}};return tt.default=s,tt}var rt={},Dr;function Zn(){if(Dr)return rt;Dr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=vt(),n=de(),w=Z(),l=cn(),E={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:h,schema:u,parentSchema:m,data:g,it:_}=s;_.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&l.default.code(new e.KeywordCxt(_,l.default,"additionalProperties"));const P=(0,n.allSchemaProperties)(u);for(const o of P)_.definedProperties.add(o);_.opts.unevaluated&&P.length&&_.props!==!0&&(_.props=w.mergeEvaluated.props(h,(0,w.toHash)(P),_.props));const v=P.filter(o=>!(0,w.alwaysValidSchema)(_,u[o]));if(v.length===0)return;const p=h.name("valid");for(const o of v)y(o)?$(o):(h.if((0,n.propertyInData)(h,g,o,_.opts.ownProperties)),$(o),_.allErrors||h.else().var(p,!0),h.endIf()),s.it.definedProperties.add(o),s.ok(p);function y(o){return _.opts.useDefaults&&!_.compositeRule&&u[o].default!==void 0}function $(o){s.subschema({keyword:"properties",schemaProp:o,dataProp:o},p)}}};return rt.default=E,rt}var nt={},zr;function Yn(){if(zr)return nt;zr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=de(),n=G(),w=Z(),l=Z(),E={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:h,schema:u,data:m,parentSchema:g,it:_}=s,{opts:P}=_,v=(0,e.allSchemaProperties)(u),p=v.filter(f=>(0,w.alwaysValidSchema)(_,u[f]));if(v.length===0||p.length===v.length&&(!_.opts.unevaluated||_.props===!0))return;const y=P.strictSchema&&!P.allowMatchingProperties&&g.properties,$=h.name("valid");_.props!==!0&&!(_.props instanceof n.Name)&&(_.props=(0,l.evaluatedPropsToName)(h,_.props));const{props:o}=_;i();function i(){for(const f of v)y&&t(f),_.allErrors?a(f):(h.var($,!0),a(f),h.if($))}function t(f){for(const r in y)new RegExp(f).test(r)&&(0,w.checkStrictMode)(_,`property ${r} matches pattern ${f} (use allowMatchingProperties)`)}function a(f){h.forIn("key",m,r=>{h.if((0,n._)`${(0,e.usePattern)(s,f)}.test(${r})`,()=>{const d=p.includes(f);d||s.subschema({keyword:"patternProperties",schemaProp:f,dataProp:r,dataPropType:l.Type.Str},$),_.opts.unevaluated&&o!==!0?h.assign((0,n._)`${o}[${r}]`,!0):!d&&!_.allErrors&&h.if((0,n.not)($),()=>h.break())})})}}};return nt.default=E,nt}var st={},Vr;function Qn(){if(Vr)return st;Vr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=Z(),n={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(w){const{gen:l,schema:E,it:s}=w;if((0,e.alwaysValidSchema)(s,E)){w.fail();return}const h=l.name("valid");w.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},h),w.failResult(h,()=>w.reset(),()=>w.error())},error:{message:"must NOT be valid"}};return st.default=n,st}var at={},Fr;function Xn(){if(Fr)return at;Fr=1,Object.defineProperty(at,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:de().validateUnion,error:{message:"must match a schema in anyOf"}};return at.default=n,at}var ot={},Ur;function xn(){if(Ur)return ot;Ur=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=G(),n=Z(),l={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:E})=>(0,e._)`{passingSchemas: ${E.passing}}`},code(E){const{gen:s,schema:h,parentSchema:u,it:m}=E;if(!Array.isArray(h))throw new Error("ajv implementation error");if(m.opts.discriminator&&u.discriminator)return;const g=h,_=s.let("valid",!1),P=s.let("passing",null),v=s.name("_valid");E.setParams({passing:P}),s.block(p),E.result(_,()=>E.reset(),()=>E.error(!0));function p(){g.forEach((y,$)=>{let o;(0,n.alwaysValidSchema)(m,y)?s.var(v,!0):o=E.subschema({keyword:"oneOf",schemaProp:$,compositeRule:!0},v),$>0&&s.if((0,e._)`${v} && ${_}`).assign(_,!1).assign(P,(0,e._)`[${P}, ${$}]`).else(),s.if(v,()=>{s.assign(_,!0),s.assign(P,$),o&&E.mergeEvaluated(o,e.Name)})})}}};return ot.default=l,ot}var it={},Kr;function es(){if(Kr)return it;Kr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=Z(),n={keyword:"allOf",schemaType:"array",code(w){const{gen:l,schema:E,it:s}=w;if(!Array.isArray(E))throw new Error("ajv implementation error");const h=l.name("valid");E.forEach((u,m)=>{if((0,e.alwaysValidSchema)(s,u))return;const g=w.subschema({keyword:"allOf",schemaProp:m},h);w.ok(h),w.mergeEvaluated(g)})}};return it.default=n,it}var ut={},Lr;function ts(){if(Lr)return ut;Lr=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=G(),n=Z(),l={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:h,parentSchema:u,it:m}=s;u.then===void 0&&u.else===void 0&&(0,n.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const g=E(m,"then"),_=E(m,"else");if(!g&&!_)return;const P=h.let("valid",!0),v=h.name("_valid");if(p(),s.reset(),g&&_){const $=h.let("ifClause");s.setParams({ifClause:$}),h.if(v,y("then",$),y("else",$))}else g?h.if(v,y("then")):h.if((0,e.not)(v),y("else"));s.pass(P,()=>s.error(!0));function p(){const $=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);s.mergeEvaluated($)}function y($,o){return()=>{const i=s.subschema({keyword:$},v);h.assign(P,v),s.mergeValidEvaluated(i,P),o?h.assign(o,(0,e._)`${$}`):s.setParams({ifClause:$})}}}};function E(s,h){const u=s.schema[h];return u!==void 0&&!(0,n.alwaysValidSchema)(s,u)}return ut.default=l,ut}var ct={},Hr;function rs(){if(Hr)return ct;Hr=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=Z(),n={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:w,parentSchema:l,it:E}){l.if===void 0&&(0,e.checkStrictMode)(E,`"${w}" without "if" is ignored`)}};return ct.default=n,ct}var Gr;function ns(){if(Gr)return Ye;Gr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=on(),n=Hn(),w=un(),l=Gn(),E=Jn(),s=Wn(),h=Bn(),u=cn(),m=Zn(),g=Yn(),_=Qn(),P=Xn(),v=xn(),p=es(),y=ts(),$=rs();function o(i=!1){const t=[_.default,P.default,v.default,p.default,y.default,$.default,h.default,u.default,s.default,m.default,g.default];return i?t.push(n.default,l.default):t.push(e.default,w.default),t.push(E.default),t}return Ye.default=o,Ye}var dt={},lt={},Jr;function ss(){if(Jr)return lt;Jr=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=G(),w={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:l})=>(0,e.str)`must match format "${l}"`,params:({schemaCode:l})=>(0,e._)`{format: ${l}}`},code(l,E){const{gen:s,data:h,$data:u,schema:m,schemaCode:g,it:_}=l,{opts:P,errSchemaPath:v,schemaEnv:p,self:y}=_;if(!P.validateFormats)return;u?$():o();function $(){const i=s.scopeValue("formats",{ref:y.formats,code:P.code.formats}),t=s.const("fDef",(0,e._)`${i}[${g}]`),a=s.let("fType"),f=s.let("format");s.if((0,e._)`typeof ${t} == "object" && !(${t} instanceof RegExp)`,()=>s.assign(a,(0,e._)`${t}.type || "string"`).assign(f,(0,e._)`${t}.validate`),()=>s.assign(a,(0,e._)`"string"`).assign(f,t)),l.fail$data((0,e.or)(r(),d()));function r(){return P.strictSchema===!1?e.nil:(0,e._)`${g} && !${f}`}function d(){const b=p.$async?(0,e._)`(${t}.async ? await ${f}(${h}) : ${f}(${h}))`:(0,e._)`${f}(${h})`,j=(0,e._)`(typeof ${f} == "function" ? ${b} : ${f}.test(${h}))`;return(0,e._)`${f} && ${f} !== true && ${a} === ${E} && !${j}`}}function o(){const i=y.formats[m];if(!i){r();return}if(i===!0)return;const[t,a,f]=d(i);t===E&&l.pass(b());function r(){if(P.strictSchema===!1){y.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${m}" ignored in schema at path "${v}"`}}function d(j){const T=j instanceof RegExp?(0,e.regexpCode)(j):P.code.formats?(0,e._)`${P.code.formats}${(0,e.getProperty)(m)}`:void 0,M=s.scopeValue("formats",{key:m,ref:j,code:T});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,e._)`${M}.validate`]:["string",j,M]}function b(){if(typeof i=="object"&&!(i instanceof RegExp)&&i.async){if(!p.$async)throw new Error("async format in sync schema");return(0,e._)`await ${f}(${h})`}return typeof a=="function"?(0,e._)`${f}(${h})`:(0,e._)`${f}.test(${h})`}}}};return lt.default=w,lt}var Wr;function as(){if(Wr)return dt;Wr=1,Object.defineProperty(dt,"__esModule",{value:!0});const n=[ss().default];return dt.default=n,dt}var we={},Br;function os(){return Br||(Br=1,Object.defineProperty(we,"__esModule",{value:!0}),we.contentVocabulary=we.metadataVocabulary=void 0,we.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],we.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),we}var Zr;function is(){if(Zr)return Ce;Zr=1,Object.defineProperty(Ce,"__esModule",{value:!0});const e=Tn(),n=Ln(),w=ns(),l=as(),E=os(),s=[e.default,n.default,(0,w.default)(),l.default,E.metadataVocabulary,E.contentVocabulary];return Ce.default=s,Ce}var ft={},ke={},Yr;function us(){if(Yr)return ke;Yr=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.DiscrError=void 0;var e;return(function(n){n.Tag="tag",n.Mapping="mapping"})(e||(ke.DiscrError=e={})),ke}var Qr;function cs(){if(Qr)return ft;Qr=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=G(),n=us(),w=At(),l=gt(),E=Z(),h={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:m}})=>u===n.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:u,tag:m,tagName:g}})=>(0,e._)`{error: ${u}, tag: ${g}, tagValue: ${m}}`},code(u){const{gen:m,data:g,schema:_,parentSchema:P,it:v}=u,{oneOf:p}=P;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const y=_.propertyName;if(typeof y!="string")throw new Error("discriminator: requires propertyName");if(_.mapping)throw new Error("discriminator: mapping is not supported");if(!p)throw new Error("discriminator: requires oneOf keyword");const $=m.let("valid",!1),o=m.const("tag",(0,e._)`${g}${(0,e.getProperty)(y)}`);m.if((0,e._)`typeof ${o} == "string"`,()=>i(),()=>u.error(!1,{discrError:n.DiscrError.Tag,tag:o,tagName:y})),u.ok($);function i(){const f=a();m.if(!1);for(const r in f)m.elseIf((0,e._)`${o} === ${r}`),m.assign($,t(f[r]));m.else(),u.error(!1,{discrError:n.DiscrError.Mapping,tag:o,tagName:y}),m.endIf()}function t(f){const r=m.name("valid"),d=u.subschema({keyword:"oneOf",schemaProp:f},r);return u.mergeEvaluated(d,e.Name),r}function a(){var f;const r={},d=j(P);let b=!0;for(let z=0;z<p.length;z++){let V=p[z];if(V!=null&&V.$ref&&!(0,E.schemaHasRulesButRef)(V,v.self.RULES)){const J=V.$ref;if(V=w.resolveRef.call(v.self,v.schemaEnv.root,v.baseId,J),V instanceof w.SchemaEnv&&(V=V.schema),V===void 0)throw new l.default(v.opts.uriResolver,v.baseId,J)}const U=(f=V==null?void 0:V.properties)===null||f===void 0?void 0:f[y];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${y}"`);b=b&&(d||j(V)),T(U,z)}if(!b)throw new Error(`discriminator: "${y}" must be required`);return r;function j({required:z}){return Array.isArray(z)&&z.includes(y)}function T(z,V){if(z.const)M(z.const,V);else if(z.enum)for(const U of z.enum)M(U,V);else throw new Error(`discriminator: "properties/${y}" must have "const" or "enum"`)}function M(z,V){if(typeof z!="string"||z in r)throw new Error(`discriminator: "${y}" values must be unique strings`);r[z]=V}}}};return ft.default=h,ft}const ds="http://json-schema.org/draft-07/schema#",ls="http://json-schema.org/draft-07/schema#",fs="Core schema meta-schema",hs={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:[]}},ms=["object","boolean"],ps={$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:"#"}},ys={$schema:ds,$id:ls,title:fs,definitions:hs,type:ms,properties:ps,default:!0};var Xr;function dn(){return Xr||(Xr=1,(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MissingRefError=n.ValidationError=n.CodeGen=n.Name=n.nil=n.stringify=n.str=n._=n.KeywordCxt=n.Ajv=void 0;const w=kn(),l=is(),E=cs(),s=ys,h=["/properties"],u="http://json-schema.org/draft-07/schema";class m extends w.default{_addVocabularies(){super._addVocabularies(),l.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(E.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const y=this.opts.$data?this.$dataMetaSchema(s,h):s;this.addMetaSchema(y,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}n.Ajv=m,e.exports=n=m,e.exports.Ajv=m,Object.defineProperty(n,"__esModule",{value:!0}),n.default=m;var g=vt();Object.defineProperty(n,"KeywordCxt",{enumerable:!0,get:function(){return g.KeywordCxt}});var _=G();Object.defineProperty(n,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(n,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(n,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(n,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(n,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var P=Mt();Object.defineProperty(n,"ValidationError",{enumerable:!0,get:function(){return P.default}});var v=gt();Object.defineProperty(n,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(Oe,Oe.exports)),Oe.exports}var _s=dn(),ht={exports:{}},qt={},xr;function vs(){return xr||(xr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function n(T,M){return{validate:T,compare:M}}e.fullFormats={date:n(s,h),time:n(m,g),"date-time":n(P,v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:$,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:j,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:i,int32:{type:"number",validate:f},int64:{type:"number",validate:r},float:{type:"number",validate:d},double:{type:"number",validate:d},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:n(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,h),time:n(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),"date-time":n(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function w(T){return T%4===0&&(T%100!==0||T%400===0)}const l=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,E=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(T){const M=l.exec(T);if(!M)return!1;const z=+M[1],V=+M[2],U=+M[3];return V>=1&&V<=12&&U>=1&&U<=(V===2&&w(z)?29:E[V])}function h(T,M){if(T&&M)return T>M?1:T<M?-1:0}const u=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function m(T,M){const z=u.exec(T);if(!z)return!1;const V=+z[1],U=+z[2],J=+z[3],x=z[5];return(V<=23&&U<=59&&J<=59||V===23&&U===59&&J===60)&&(!M||x!=="")}function g(T,M){if(!(T&&M))return;const z=u.exec(T),V=u.exec(M);if(z&&V)return T=z[1]+z[2]+z[3]+(z[4]||""),M=V[1]+V[2]+V[3]+(V[4]||""),T>M?1:T<M?-1:0}const _=/t|\s/i;function P(T){const M=T.split(_);return M.length===2&&s(M[0])&&m(M[1],!0)}function v(T,M){if(!(T&&M))return;const[z,V]=T.split(_),[U,J]=M.split(_),x=h(z,U);if(x!==void 0)return x||g(V,J)}const p=/\/|:/,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function $(T){return p.test(T)&&y.test(T)}const o=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function i(T){return o.lastIndex=0,o.test(T)}const t=-2147483648,a=2**31-1;function f(T){return Number.isInteger(T)&&T<=a&&T>=t}function r(T){return Number.isInteger(T)}function d(){return!0}const b=/[^\\]\\Z/;function j(T){if(b.test(T))return!1;try{return new RegExp(T),!0}catch{return!1}}})(qt)),qt}var Ct={},en;function gs(){return en||(en=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const n=dn(),w=G(),l=w.operators,E={formatMaximum:{okStr:"<=",ok:l.LTE,fail:l.GT},formatMinimum:{okStr:">=",ok:l.GTE,fail:l.LT},formatExclusiveMaximum:{okStr:"<",ok:l.LT,fail:l.GTE},formatExclusiveMinimum:{okStr:">",ok:l.GT,fail:l.LTE}},s={message:({keyword:u,schemaCode:m})=>w.str`should be ${E[u].okStr} ${m}`,params:({keyword:u,schemaCode:m})=>w._`{comparison: ${E[u].okStr}, limit: ${m}}`};e.formatLimitDefinition={keyword:Object.keys(E),type:"string",schemaType:"string",$data:!0,error:s,code(u){const{gen:m,data:g,schemaCode:_,keyword:P,it:v}=u,{opts:p,self:y}=v;if(!p.validateFormats)return;const $=new n.KeywordCxt(v,y.RULES.all.format.definition,"format");$.$data?o():i();function o(){const a=m.scopeValue("formats",{ref:y.formats,code:p.code.formats}),f=m.const("fmt",w._`${a}[${$.schemaCode}]`);u.fail$data(w.or(w._`typeof ${f} != "object"`,w._`${f} instanceof RegExp`,w._`typeof ${f}.compare != "function"`,t(f)))}function i(){const a=$.schema,f=y.formats[a];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${P}": format "${a}" does not define "compare" function`);const r=m.scopeValue("formats",{key:a,ref:f,code:p.code.formats?w._`${p.code.formats}${w.getProperty(a)}`:void 0});u.fail$data(t(r))}function t(a){return w._`${a}.compare(${g}, ${_}) ${E[P].fail} 0`}},dependencies:["format"]};const h=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=h})(Ct)),Ct}var tn;function $s(){return tn||(tn=1,(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});const w=vs(),l=gs(),E=G(),s=new E.Name("fullFormats"),h=new E.Name("fastFormats"),u=(g,_={keywords:!0})=>{if(Array.isArray(_))return m(g,_,w.fullFormats,s),g;const[P,v]=_.mode==="fast"?[w.fastFormats,h]:[w.fullFormats,s],p=_.formats||w.formatNames;return m(g,p,P,v),_.keywords&&l.default(g),g};u.get=(g,_="full")=>{const v=(_==="fast"?w.fastFormats:w.fullFormats)[g];if(!v)throw new Error(`Unknown format "${g}"`);return v};function m(g,_,P,v){var p,y;(p=(y=g.opts.code).formats)!==null&&p!==void 0||(y.formats=E._`require("ajv-formats/dist/formats").${v}`);for(const $ of _)g.addFormat($,P[$])}e.exports=n=u,Object.defineProperty(n,"__esModule",{value:!0}),n.default=u})(ht,ht.exports)),ht.exports}var ws=$s();const bs=fn(ws);exports.ajvExports=_s;exports.index=bs;
|
|
9
|
+
//# sourceMappingURL=index-C6uYPRmx.cjs.map
|