@finalai/agent-definition 0.1.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.
Potentially problematic release.
This version of @finalai/agent-definition might be problematic. Click here for more details.
- package/README.md +16 -0
- package/THIRD_PARTY_NOTICES.md +303 -0
- package/dist/compiler-assets/chunk-2CZRHOLL.ts +10 -0
- package/dist/compiler-assets/chunk-32O3ODZE.ts +39 -0
- package/dist/compiler-assets/chunk-5BK6FVRE.ts +75 -0
- package/dist/compiler-assets/chunk-6WR3PGNF.ts +0 -0
- package/dist/compiler-assets/chunk-7QP2CKPI.ts +30 -0
- package/dist/compiler-assets/chunk-7VSSVZM4.ts +55 -0
- package/dist/compiler-assets/chunk-7WGYG73V.ts +42 -0
- package/dist/compiler-assets/chunk-BLB6JGLO.ts +481 -0
- package/dist/compiler-assets/chunk-CWWRTRWW.ts +76 -0
- package/dist/compiler-assets/chunk-EVQIK62B.ts +188 -0
- package/dist/compiler-assets/chunk-GNR7XBPN.ts +3364 -0
- package/dist/compiler-assets/chunk-GTUZOATD.ts +10 -0
- package/dist/compiler-assets/chunk-HFS4KLEL.ts +10 -0
- package/dist/compiler-assets/chunk-HGW4YHAY.ts +6865 -0
- package/dist/compiler-assets/chunk-HNPUTP35.ts +172 -0
- package/dist/compiler-assets/chunk-JIPNTA56.ts +59 -0
- package/dist/compiler-assets/chunk-JNJE72EH.ts +10 -0
- package/dist/compiler-assets/chunk-JPY4L2UJ.ts +349 -0
- package/dist/compiler-assets/chunk-JTGTLYDT.ts +0 -0
- package/dist/compiler-assets/chunk-LUSAAV4L.ts +33 -0
- package/dist/compiler-assets/chunk-MZMSKIKU.ts +472 -0
- package/dist/compiler-assets/chunk-NMYHO2QN.ts +25 -0
- package/dist/compiler-assets/chunk-NYTOYKKF.ts +28 -0
- package/dist/compiler-assets/chunk-OWC6SFFF.ts +295 -0
- package/dist/compiler-assets/chunk-QMKWAFVZ.ts +59 -0
- package/dist/compiler-assets/chunk-QMWTDPNT.ts +79 -0
- package/dist/compiler-assets/chunk-RWUIMTBI.ts +13 -0
- package/dist/compiler-assets/chunk-SKTNMUO7.ts +64 -0
- package/dist/compiler-assets/chunk-T6WG4L4M.ts +19 -0
- package/dist/compiler-assets/chunk-TATN3PYK.ts +81 -0
- package/dist/compiler-assets/chunk-VHXHUU7L.ts +16 -0
- package/dist/compiler-assets/chunk-WMXMVFHM.ts +121 -0
- package/dist/compiler-assets/chunk-XHKPWT3G.ts +55 -0
- package/dist/compiler-assets/chunk-ZDLVA6XF.ts +476 -0
- package/dist/compiler-assets/src/authoring/agent.ts +10 -0
- package/dist/compiler-assets/src/authoring/approval.ts +19 -0
- package/dist/compiler-assets/src/authoring/brand.ts +23 -0
- package/dist/compiler-assets/src/authoring/channels.ts +26 -0
- package/dist/compiler-assets/src/authoring/connections.ts +10 -0
- package/dist/compiler-assets/src/authoring/context.ts +7 -0
- package/dist/compiler-assets/src/authoring/credentials.ts +21 -0
- package/dist/compiler-assets/src/authoring/dynamic.ts +10 -0
- package/dist/compiler-assets/src/authoring/harness.ts +17 -0
- package/dist/compiler-assets/src/authoring/hooks.ts +28 -0
- package/dist/compiler-assets/src/authoring/index.ts +110 -0
- package/dist/compiler-assets/src/authoring/instructions.ts +14 -0
- package/dist/compiler-assets/src/authoring/sandbox.ts +25 -0
- package/dist/compiler-assets/src/authoring/schedules.ts +10 -0
- package/dist/compiler-assets/src/authoring/skills.ts +10 -0
- package/dist/compiler-assets/src/authoring/tools.ts +23 -0
- package/dist/compiler-assets/src/compatibility.ts +14810 -0
- package/dist/compiler-assets/src/compiler/evaluate-child.mjs +77 -0
- package/dist/compiler-assets/src/index.ts +195 -0
- package/dist/compiler-assets/src/manifest.ts +72 -0
- package/dist/compiler-assets/src/resolve.ts +19 -0
- package/dist/compiler-assets/src/runtime/bundle.ts +72 -0
- package/dist/compiler-assets/src/runtime/describe.ts +31 -0
- package/dist/compiler-assets/src/runtime/described.ts +142 -0
- package/dist/compiler-assets/src/runtime/isolate.ts +28 -0
- package/dist/compiler-assets/src/runtime/layout.ts +15 -0
- package/dist/compiler-assets/src/runtime/lower.ts +52 -0
- package/dist/compiler-assets/src/runtime/schema-validation.ts +21 -0
- package/dist/compiler-assets/src/runtime/values.ts +38 -0
- package/dist/modules/authoring/agent.d.mts +22 -0
- package/dist/modules/authoring/agent.mjs +6 -0
- package/dist/modules/authoring/agent.mjs.map +7 -0
- package/dist/modules/authoring/approval.d.mts +17 -0
- package/dist/modules/authoring/approval.mjs +42 -0
- package/dist/modules/authoring/approval.mjs.map +7 -0
- package/dist/modules/authoring/brand.d.mts +27 -0
- package/dist/modules/authoring/brand.mjs +51 -0
- package/dist/modules/authoring/brand.mjs.map +7 -0
- package/dist/modules/authoring/channels.d.mts +41 -0
- package/dist/modules/authoring/channels.mjs +65 -0
- package/dist/modules/authoring/channels.mjs.map +7 -0
- package/dist/modules/authoring/connections.d.mts +23 -0
- package/dist/modules/authoring/connections.mjs +6 -0
- package/dist/modules/authoring/connections.mjs.map +7 -0
- package/dist/modules/authoring/context.d.mts +83 -0
- package/dist/modules/authoring/context.mjs +12 -0
- package/dist/modules/authoring/context.mjs.map +7 -0
- package/dist/modules/authoring/credentials.d.mts +10 -0
- package/dist/modules/authoring/credentials.mjs +31 -0
- package/dist/modules/authoring/credentials.mjs.map +7 -0
- package/dist/modules/authoring/dynamic.d.mts +30 -0
- package/dist/modules/authoring/dynamic.mjs +15 -0
- package/dist/modules/authoring/dynamic.mjs.map +7 -0
- package/dist/modules/authoring/harness.d.mts +85 -0
- package/dist/modules/authoring/harness.mjs +55 -0
- package/dist/modules/authoring/harness.mjs.map +7 -0
- package/dist/modules/authoring/hooks.d.mts +120 -0
- package/dist/modules/authoring/hooks.mjs +72 -0
- package/dist/modules/authoring/hooks.mjs.map +7 -0
- package/dist/modules/authoring/index.d.mts +27 -0
- package/dist/modules/authoring/index.mjs +63 -0
- package/dist/modules/authoring/index.mjs.map +7 -0
- package/dist/modules/authoring/instructions.d.mts +13 -0
- package/dist/modules/authoring/instructions.mjs +15 -0
- package/dist/modules/authoring/instructions.mjs.map +7 -0
- package/dist/modules/authoring/sandbox.d.mts +21 -0
- package/dist/modules/authoring/sandbox.mjs +13 -0
- package/dist/modules/authoring/sandbox.mjs.map +7 -0
- package/dist/modules/authoring/schedules.d.mts +8 -0
- package/dist/modules/authoring/schedules.mjs +6 -0
- package/dist/modules/authoring/schedules.mjs.map +7 -0
- package/dist/modules/authoring/skills.d.mts +8 -0
- package/dist/modules/authoring/skills.mjs +6 -0
- package/dist/modules/authoring/skills.mjs.map +7 -0
- package/dist/modules/authoring/tools.d.mts +80 -0
- package/dist/modules/authoring/tools.mjs +70 -0
- package/dist/modules/authoring/tools.mjs.map +7 -0
- package/dist/modules/compatibility.d.mts +36 -0
- package/dist/modules/compatibility.mjs +536 -0
- package/dist/modules/compatibility.mjs.map +7 -0
- package/dist/modules/compiler/assemble.d.mts +30 -0
- package/dist/modules/compiler/assemble.mjs +923 -0
- package/dist/modules/compiler/assemble.mjs.map +7 -0
- package/dist/modules/compiler/bundle.d.mts +22 -0
- package/dist/modules/compiler/bundle.mjs +385 -0
- package/dist/modules/compiler/bundle.mjs.map +7 -0
- package/dist/modules/compiler/diagnostics.d.mts +40 -0
- package/dist/modules/compiler/diagnostics.mjs +38 -0
- package/dist/modules/compiler/diagnostics.mjs.map +7 -0
- package/dist/modules/compiler/discovery.d.mts +36 -0
- package/dist/modules/compiler/discovery.mjs +158 -0
- package/dist/modules/compiler/discovery.mjs.map +7 -0
- package/dist/modules/compiler/evaluate.d.mts +13 -0
- package/dist/modules/compiler/evaluate.mjs +194 -0
- package/dist/modules/compiler/evaluate.mjs.map +7 -0
- package/dist/modules/compiler/files.d.mts +19 -0
- package/dist/modules/compiler/files.mjs +90 -0
- package/dist/modules/compiler/files.mjs.map +7 -0
- package/dist/modules/compiler/frontmatter.d.mts +9 -0
- package/dist/modules/compiler/frontmatter.mjs +34 -0
- package/dist/modules/compiler/frontmatter.mjs.map +7 -0
- package/dist/modules/compiler/index.d.mts +49 -0
- package/dist/modules/compiler/index.mjs +244 -0
- package/dist/modules/compiler/index.mjs.map +7 -0
- package/dist/modules/compiler/load.d.mts +8 -0
- package/dist/modules/compiler/load.mjs +45 -0
- package/dist/modules/compiler/load.mjs.map +7 -0
- package/dist/modules/compiler/local-isolate.d.mts +20 -0
- package/dist/modules/compiler/local-isolate.mjs +93 -0
- package/dist/modules/compiler/local-isolate.mjs.map +7 -0
- package/dist/modules/compiler/packages.d.mts +66 -0
- package/dist/modules/compiler/packages.mjs +307 -0
- package/dist/modules/compiler/packages.mjs.map +7 -0
- package/dist/modules/index.d.mts +7 -0
- package/dist/modules/index.mjs +25 -0
- package/dist/modules/index.mjs.map +7 -0
- package/dist/modules/manifest.d.mts +2 -0
- package/dist/modules/manifest.mjs +67 -0
- package/dist/modules/manifest.mjs.map +7 -0
- package/dist/modules/resolve.d.mts +24 -0
- package/dist/modules/resolve.mjs +176 -0
- package/dist/modules/resolve.mjs.map +7 -0
- package/dist/modules/runtime/bundle.d.mts +12 -0
- package/dist/modules/runtime/bundle.mjs +48 -0
- package/dist/modules/runtime/bundle.mjs.map +7 -0
- package/dist/modules/runtime/describe.d.mts +19 -0
- package/dist/modules/runtime/describe.mjs +471 -0
- package/dist/modules/runtime/describe.mjs.map +7 -0
- package/dist/modules/runtime/described.d.mts +376 -0
- package/dist/modules/runtime/described.mjs +116 -0
- package/dist/modules/runtime/described.mjs.map +7 -0
- package/dist/modules/runtime/isolate.d.mts +70 -0
- package/dist/modules/runtime/isolate.mjs +454 -0
- package/dist/modules/runtime/isolate.mjs.map +7 -0
- package/dist/modules/runtime/layout.d.mts +21 -0
- package/dist/modules/runtime/layout.mjs +24 -0
- package/dist/modules/runtime/layout.mjs.map +7 -0
- package/dist/modules/runtime/lower.d.mts +73 -0
- package/dist/modules/runtime/lower.mjs +463 -0
- package/dist/modules/runtime/lower.mjs.map +7 -0
- package/dist/modules/runtime/schema-validation.d.mts +21 -0
- package/dist/modules/runtime/schema-validation.mjs +238 -0
- package/dist/modules/runtime/schema-validation.mjs.map +7 -0
- package/dist/modules/runtime/values.d.mts +20 -0
- package/dist/modules/runtime/values.mjs +48 -0
- package/dist/modules/runtime/values.mjs.map +7 -0
- package/fixtures/acme-fleet/agent/agent.ts +74 -0
- package/fixtures/acme-fleet/agent/instructions.md +1 -0
- package/fixtures/assistant/agent/agent.ts +16 -0
- package/fixtures/assistant/agent/instructions.md +1 -0
- package/fixtures/assistant/agent/tools/current_time.ts +9 -0
- package/fixtures/assistant-with-tools/agent/agent.ts +16 -0
- package/fixtures/assistant-with-tools/agent/instructions.md +1 -0
- package/fixtures/assistant-with-tools/agent/tools/current_time.ts +9 -0
- package/fixtures/final-connection/agent/agent.ts +15 -0
- package/fixtures/final-connection/agent/connections/final.ts +9 -0
- package/fixtures/release-scout/agent/agent.ts +22 -0
- package/fixtures/release-scout/agent/channels/github-signature.ts +27 -0
- package/fixtures/release-scout/agent/channels/github.ts +38 -0
- package/fixtures/release-scout/agent/connections/linear.ts +9 -0
- package/fixtures/release-scout/agent/hooks/audit.ts +24 -0
- package/fixtures/release-scout/agent/instructions/org-context.ts +26 -0
- package/fixtures/release-scout/agent/instructions.md +2 -0
- package/fixtures/release-scout/agent/sandbox.ts +20 -0
- package/fixtures/release-scout/agent/schedules/daily-digest.md +7 -0
- package/fixtures/release-scout/agent/skills/triage/SKILL.md +8 -0
- package/fixtures/release-scout/agent/skills/triage/checklist.md +3 -0
- package/fixtures/release-scout/agent/tools/lookup_release_notes.ts +24 -0
- package/fixtures/tsconfig.json +5 -0
- package/package.json +94 -0
|
@@ -0,0 +1,3364 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_fast_deep_equal
|
|
3
|
+
} from "./chunk-7WGYG73V.ts";
|
|
4
|
+
import {
|
|
5
|
+
jsonObjectSchema,
|
|
6
|
+
jsonValueSchema
|
|
7
|
+
} from "./chunk-7QP2CKPI.ts";
|
|
8
|
+
import {
|
|
9
|
+
callableSchema,
|
|
10
|
+
fieldOf
|
|
11
|
+
} from "./chunk-JIPNTA56.ts";
|
|
12
|
+
import {
|
|
13
|
+
array,
|
|
14
|
+
boolean,
|
|
15
|
+
literal,
|
|
16
|
+
looseObject,
|
|
17
|
+
object,
|
|
18
|
+
record,
|
|
19
|
+
string,
|
|
20
|
+
unknown
|
|
21
|
+
} from "./chunk-HGW4YHAY.ts";
|
|
22
|
+
import {
|
|
23
|
+
__commonJS,
|
|
24
|
+
__toESM
|
|
25
|
+
} from "./chunk-32O3ODZE.ts";
|
|
26
|
+
|
|
27
|
+
// ../../../node_modules/.pnpm/valid-url@1.0.9/node_modules/valid-url/index.js
|
|
28
|
+
var require_valid_url = __commonJS({
|
|
29
|
+
"../../../node_modules/.pnpm/valid-url@1.0.9/node_modules/valid-url/index.js"(exports, module) {
|
|
30
|
+
(function(module2) {
|
|
31
|
+
"use strict";
|
|
32
|
+
module2.exports.is_uri = is_iri;
|
|
33
|
+
module2.exports.is_http_uri = is_http_iri;
|
|
34
|
+
module2.exports.is_https_uri = is_https_iri;
|
|
35
|
+
module2.exports.is_web_uri = is_web_iri;
|
|
36
|
+
module2.exports.isUri = is_iri;
|
|
37
|
+
module2.exports.isHttpUri = is_http_iri;
|
|
38
|
+
module2.exports.isHttpsUri = is_https_iri;
|
|
39
|
+
module2.exports.isWebUri = is_web_iri;
|
|
40
|
+
var splitUri = function(uri) {
|
|
41
|
+
var splitted = uri.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);
|
|
42
|
+
return splitted;
|
|
43
|
+
};
|
|
44
|
+
function is_iri(value) {
|
|
45
|
+
if (!value) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(value)) return;
|
|
49
|
+
if (/%[^0-9a-f]/i.test(value)) return;
|
|
50
|
+
if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value)) return;
|
|
51
|
+
var splitted = [];
|
|
52
|
+
var scheme = "";
|
|
53
|
+
var authority = "";
|
|
54
|
+
var path = "";
|
|
55
|
+
var query = "";
|
|
56
|
+
var fragment = "";
|
|
57
|
+
var out = "";
|
|
58
|
+
splitted = splitUri(value);
|
|
59
|
+
scheme = splitted[1];
|
|
60
|
+
authority = splitted[2];
|
|
61
|
+
path = splitted[3];
|
|
62
|
+
query = splitted[4];
|
|
63
|
+
fragment = splitted[5];
|
|
64
|
+
if (!(scheme && scheme.length && path.length >= 0)) return;
|
|
65
|
+
if (authority && authority.length) {
|
|
66
|
+
if (!(path.length === 0 || /^\//.test(path))) return;
|
|
67
|
+
} else {
|
|
68
|
+
if (/^\/\//.test(path)) return;
|
|
69
|
+
}
|
|
70
|
+
if (!/^[a-z][a-z0-9\+\-\.]*$/.test(scheme.toLowerCase())) return;
|
|
71
|
+
out += scheme + ":";
|
|
72
|
+
if (authority && authority.length) {
|
|
73
|
+
out += "//" + authority;
|
|
74
|
+
}
|
|
75
|
+
out += path;
|
|
76
|
+
if (query && query.length) {
|
|
77
|
+
out += "?" + query;
|
|
78
|
+
}
|
|
79
|
+
if (fragment && fragment.length) {
|
|
80
|
+
out += "#" + fragment;
|
|
81
|
+
}
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
function is_http_iri(value, allowHttps) {
|
|
85
|
+
if (!is_iri(value)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
var splitted = [];
|
|
89
|
+
var scheme = "";
|
|
90
|
+
var authority = "";
|
|
91
|
+
var path = "";
|
|
92
|
+
var port = "";
|
|
93
|
+
var query = "";
|
|
94
|
+
var fragment = "";
|
|
95
|
+
var out = "";
|
|
96
|
+
splitted = splitUri(value);
|
|
97
|
+
scheme = splitted[1];
|
|
98
|
+
authority = splitted[2];
|
|
99
|
+
path = splitted[3];
|
|
100
|
+
query = splitted[4];
|
|
101
|
+
fragment = splitted[5];
|
|
102
|
+
if (!scheme) return;
|
|
103
|
+
if (allowHttps) {
|
|
104
|
+
if (scheme.toLowerCase() != "https") return;
|
|
105
|
+
} else {
|
|
106
|
+
if (scheme.toLowerCase() != "http") return;
|
|
107
|
+
}
|
|
108
|
+
if (!authority) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (/:(\d+)$/.test(authority)) {
|
|
112
|
+
port = authority.match(/:(\d+)$/)[0];
|
|
113
|
+
authority = authority.replace(/:\d+$/, "");
|
|
114
|
+
}
|
|
115
|
+
out += scheme + ":";
|
|
116
|
+
out += "//" + authority;
|
|
117
|
+
if (port) {
|
|
118
|
+
out += port;
|
|
119
|
+
}
|
|
120
|
+
out += path;
|
|
121
|
+
if (query && query.length) {
|
|
122
|
+
out += "?" + query;
|
|
123
|
+
}
|
|
124
|
+
if (fragment && fragment.length) {
|
|
125
|
+
out += "#" + fragment;
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
129
|
+
function is_https_iri(value) {
|
|
130
|
+
return is_http_iri(value, true);
|
|
131
|
+
}
|
|
132
|
+
function is_web_iri(value) {
|
|
133
|
+
return is_http_iri(value) || is_https_iri(value);
|
|
134
|
+
}
|
|
135
|
+
})(module);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
// ../../../node_modules/.pnpm/json-schema-library@11.6.5/node_modules/json-schema-library/dist/rolldown-runtime-D9-fqq9M.mjs
|
|
140
|
+
var e = (e4, t2) => () => (t2 || (e4((t2 = { exports: {} }).exports, t2), e4 = null), t2.exports);
|
|
141
|
+
|
|
142
|
+
// ../../../node_modules/.pnpm/fast-copy@4.1.2/node_modules/fast-copy/dist/es/index.mjs
|
|
143
|
+
var MaxDepthExceededError = class extends RangeError {
|
|
144
|
+
constructor(maxDepth) {
|
|
145
|
+
super(`Maximum copy depth of ${String(maxDepth)} exceeded; the value copied is nested too deeply.`);
|
|
146
|
+
this.maxDepth = maxDepth;
|
|
147
|
+
this.name = "MaxDepthExceededError";
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
var toStringFunction = Function.prototype.toString;
|
|
151
|
+
var toStringObject = Object.prototype.toString;
|
|
152
|
+
function getCleanClone(prototype) {
|
|
153
|
+
if (!prototype) {
|
|
154
|
+
return /* @__PURE__ */ Object.create(null);
|
|
155
|
+
}
|
|
156
|
+
const Constructor = prototype.constructor;
|
|
157
|
+
if (Constructor === Object) {
|
|
158
|
+
return prototype === Object.prototype ? {} : Object.create(prototype);
|
|
159
|
+
}
|
|
160
|
+
if (Constructor && ~toStringFunction.call(Constructor).indexOf("[native code]")) {
|
|
161
|
+
try {
|
|
162
|
+
return new Constructor();
|
|
163
|
+
} catch (_a) {
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return Object.create(prototype);
|
|
167
|
+
}
|
|
168
|
+
function getTag(value) {
|
|
169
|
+
const stringTag = value[Symbol.toStringTag];
|
|
170
|
+
if (stringTag) {
|
|
171
|
+
return stringTag;
|
|
172
|
+
}
|
|
173
|
+
const type = toStringObject.call(value);
|
|
174
|
+
return type.substring(8, type.length - 1);
|
|
175
|
+
}
|
|
176
|
+
var { propertyIsEnumerable } = Object.prototype;
|
|
177
|
+
var sliceTypedArray = Object.getPrototypeOf(Int8Array.prototype).slice;
|
|
178
|
+
function copyOwnDescriptor(original, clone, property, state) {
|
|
179
|
+
const ownDescriptor = Object.getOwnPropertyDescriptor(original, property) || {
|
|
180
|
+
configurable: true,
|
|
181
|
+
enumerable: true,
|
|
182
|
+
value: original[property],
|
|
183
|
+
writable: true
|
|
184
|
+
};
|
|
185
|
+
const descriptor = ownDescriptor.get || ownDescriptor.set ? ownDescriptor : {
|
|
186
|
+
configurable: ownDescriptor.configurable,
|
|
187
|
+
enumerable: ownDescriptor.enumerable,
|
|
188
|
+
value: state.copier(ownDescriptor.value, state),
|
|
189
|
+
writable: ownDescriptor.writable
|
|
190
|
+
};
|
|
191
|
+
try {
|
|
192
|
+
Object.defineProperty(clone, property, descriptor);
|
|
193
|
+
} catch (_a) {
|
|
194
|
+
clone[property] = descriptor.get ? descriptor.get() : descriptor.value;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function copyOwnPropertiesStrict(value, clone, state) {
|
|
198
|
+
for (const name2 of Object.getOwnPropertyNames(value)) {
|
|
199
|
+
copyOwnDescriptor(value, clone, name2, state);
|
|
200
|
+
}
|
|
201
|
+
for (const symbol of Object.getOwnPropertySymbols(value)) {
|
|
202
|
+
copyOwnDescriptor(value, clone, symbol, state);
|
|
203
|
+
}
|
|
204
|
+
return clone;
|
|
205
|
+
}
|
|
206
|
+
function copyArrayLoose(array2, state) {
|
|
207
|
+
const clone = new state.Constructor();
|
|
208
|
+
state.cache.set(array2, clone);
|
|
209
|
+
for (let index = 0; index < array2.length; ++index) {
|
|
210
|
+
clone[index] = state.copier(array2[index], state);
|
|
211
|
+
}
|
|
212
|
+
return clone;
|
|
213
|
+
}
|
|
214
|
+
function copyArrayStrict(array2, state) {
|
|
215
|
+
const clone = new state.Constructor();
|
|
216
|
+
state.cache.set(array2, clone);
|
|
217
|
+
return copyOwnPropertiesStrict(array2, clone, state);
|
|
218
|
+
}
|
|
219
|
+
function copyArrayBuffer(arrayBuffer, _state) {
|
|
220
|
+
return ArrayBuffer.isView(arrayBuffer) ? sliceTypedArray.call(arrayBuffer, 0) : arrayBuffer.slice(0);
|
|
221
|
+
}
|
|
222
|
+
function copyBlob(blob, _state) {
|
|
223
|
+
return blob.slice(0, blob.size, blob.type);
|
|
224
|
+
}
|
|
225
|
+
function copyDataView(dataView, state) {
|
|
226
|
+
return new state.Constructor(copyArrayBuffer(dataView.buffer), dataView.byteOffset, dataView.byteLength);
|
|
227
|
+
}
|
|
228
|
+
function copyDate(date, state) {
|
|
229
|
+
return new state.Constructor(date.getTime());
|
|
230
|
+
}
|
|
231
|
+
function copyMapLoose(map, state) {
|
|
232
|
+
const clone = new state.Constructor();
|
|
233
|
+
state.cache.set(map, clone);
|
|
234
|
+
for (const [key, value] of map) {
|
|
235
|
+
clone.set(key, state.copier(value, state));
|
|
236
|
+
}
|
|
237
|
+
return clone;
|
|
238
|
+
}
|
|
239
|
+
function copyMapStrict(map, state) {
|
|
240
|
+
return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);
|
|
241
|
+
}
|
|
242
|
+
function copyObjectLoose(object2, state) {
|
|
243
|
+
const clone = getCleanClone(state.prototype);
|
|
244
|
+
state.cache.set(object2, clone);
|
|
245
|
+
for (const key of Object.keys(object2)) {
|
|
246
|
+
clone[key] = state.copier(object2[key], state);
|
|
247
|
+
}
|
|
248
|
+
for (const symbol of Object.getOwnPropertySymbols(object2)) {
|
|
249
|
+
if (propertyIsEnumerable.call(object2, symbol)) {
|
|
250
|
+
clone[symbol] = state.copier(object2[symbol], state);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return clone;
|
|
254
|
+
}
|
|
255
|
+
function copyObjectStrict(object2, state) {
|
|
256
|
+
const clone = getCleanClone(state.prototype);
|
|
257
|
+
state.cache.set(object2, clone);
|
|
258
|
+
return copyOwnPropertiesStrict(object2, clone, state);
|
|
259
|
+
}
|
|
260
|
+
function copyPrimitiveWrapper(primitiveObject, state) {
|
|
261
|
+
return new state.Constructor(primitiveObject.valueOf());
|
|
262
|
+
}
|
|
263
|
+
function copyRegExp(regExp, state) {
|
|
264
|
+
const clone = new state.Constructor(regExp.source, regExp.flags);
|
|
265
|
+
clone.lastIndex = regExp.lastIndex;
|
|
266
|
+
return clone;
|
|
267
|
+
}
|
|
268
|
+
function copySelf(value, _state) {
|
|
269
|
+
return value;
|
|
270
|
+
}
|
|
271
|
+
function copySetLoose(set, state) {
|
|
272
|
+
const clone = new state.Constructor();
|
|
273
|
+
state.cache.set(set, clone);
|
|
274
|
+
for (const value of set) {
|
|
275
|
+
clone.add(state.copier(value, state));
|
|
276
|
+
}
|
|
277
|
+
return clone;
|
|
278
|
+
}
|
|
279
|
+
function copySetStrict(set, state) {
|
|
280
|
+
return copyOwnPropertiesStrict(set, copySetLoose(set, state), state);
|
|
281
|
+
}
|
|
282
|
+
var DEFAULT_MAX_DEPTH = 1e3;
|
|
283
|
+
function createDefaultCache() {
|
|
284
|
+
return /* @__PURE__ */ new WeakMap();
|
|
285
|
+
}
|
|
286
|
+
function getOptions({ createCache: createCacheOverride, maxDepth, methods: methodsOverride, strict }) {
|
|
287
|
+
const defaultMethods = {
|
|
288
|
+
array: strict ? copyArrayStrict : copyArrayLoose,
|
|
289
|
+
arrayBuffer: copyArrayBuffer,
|
|
290
|
+
asyncGenerator: copySelf,
|
|
291
|
+
blob: copyBlob,
|
|
292
|
+
dataView: copyDataView,
|
|
293
|
+
date: copyDate,
|
|
294
|
+
error: copySelf,
|
|
295
|
+
generator: copySelf,
|
|
296
|
+
map: strict ? copyMapStrict : copyMapLoose,
|
|
297
|
+
object: strict ? copyObjectStrict : copyObjectLoose,
|
|
298
|
+
regExp: copyRegExp,
|
|
299
|
+
set: strict ? copySetStrict : copySetLoose
|
|
300
|
+
};
|
|
301
|
+
const methods = methodsOverride ? Object.assign(defaultMethods, methodsOverride) : defaultMethods;
|
|
302
|
+
const copiers = getTagSpecificCopiers(methods);
|
|
303
|
+
const createCache = createCacheOverride || createDefaultCache;
|
|
304
|
+
if (!copiers.Object || !copiers.Array) {
|
|
305
|
+
throw new Error("An object and array copier must be provided.");
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
createCache,
|
|
309
|
+
copiers,
|
|
310
|
+
maxDepth: maxDepth == null ? DEFAULT_MAX_DEPTH : maxDepth,
|
|
311
|
+
methods,
|
|
312
|
+
strict: Boolean(strict)
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
function getTagSpecificCopiers(methods) {
|
|
316
|
+
return Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
317
|
+
Arguments: methods.object,
|
|
318
|
+
Array: methods.array,
|
|
319
|
+
ArrayBuffer: methods.arrayBuffer,
|
|
320
|
+
AsyncGenerator: methods.asyncGenerator,
|
|
321
|
+
BigInt64Array: methods.arrayBuffer,
|
|
322
|
+
BigUint64Array: methods.arrayBuffer,
|
|
323
|
+
Blob: methods.blob,
|
|
324
|
+
Boolean: copyPrimitiveWrapper,
|
|
325
|
+
DataView: methods.dataView,
|
|
326
|
+
Date: methods.date,
|
|
327
|
+
Error: methods.error,
|
|
328
|
+
Float32Array: methods.arrayBuffer,
|
|
329
|
+
Float64Array: methods.arrayBuffer,
|
|
330
|
+
Generator: methods.generator,
|
|
331
|
+
Int8Array: methods.arrayBuffer,
|
|
332
|
+
Int16Array: methods.arrayBuffer,
|
|
333
|
+
Int32Array: methods.arrayBuffer,
|
|
334
|
+
Map: methods.map,
|
|
335
|
+
Number: copyPrimitiveWrapper,
|
|
336
|
+
Object: methods.object,
|
|
337
|
+
Promise: copySelf,
|
|
338
|
+
RegExp: methods.regExp,
|
|
339
|
+
Set: methods.set,
|
|
340
|
+
String: copyPrimitiveWrapper,
|
|
341
|
+
WeakMap: copySelf,
|
|
342
|
+
WeakSet: copySelf,
|
|
343
|
+
Uint8Array: methods.arrayBuffer,
|
|
344
|
+
Uint8ClampedArray: methods.arrayBuffer,
|
|
345
|
+
Uint16Array: methods.arrayBuffer,
|
|
346
|
+
Uint32Array: methods.arrayBuffer
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
function createCopier(options = {}) {
|
|
350
|
+
const { createCache, copiers, maxDepth } = getOptions(options);
|
|
351
|
+
const { Array: copyArray, Object: copyObject } = copiers;
|
|
352
|
+
function copier(value, state) {
|
|
353
|
+
state.prototype = state.Constructor = void 0;
|
|
354
|
+
if (!value || typeof value !== "object") {
|
|
355
|
+
return value;
|
|
356
|
+
}
|
|
357
|
+
if (state.cache.has(value)) {
|
|
358
|
+
return state.cache.get(value);
|
|
359
|
+
}
|
|
360
|
+
if (++state.depth > maxDepth) {
|
|
361
|
+
throw new MaxDepthExceededError(maxDepth);
|
|
362
|
+
}
|
|
363
|
+
state.prototype = Object.getPrototypeOf(value);
|
|
364
|
+
state.Constructor = state.prototype && state.prototype.constructor;
|
|
365
|
+
let clone;
|
|
366
|
+
if (!state.Constructor || state.Constructor === Object) {
|
|
367
|
+
clone = copyObject(value, state);
|
|
368
|
+
} else if (Array.isArray(value)) {
|
|
369
|
+
clone = copyArray(value, state);
|
|
370
|
+
} else {
|
|
371
|
+
const tagSpecificCopier = copiers[getTag(value)];
|
|
372
|
+
if (tagSpecificCopier) {
|
|
373
|
+
clone = tagSpecificCopier(value, state);
|
|
374
|
+
} else {
|
|
375
|
+
clone = typeof value.then === "function" ? value : copyObject(value, state);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
--state.depth;
|
|
379
|
+
return clone;
|
|
380
|
+
}
|
|
381
|
+
return function copy2(value) {
|
|
382
|
+
return copier(value, {
|
|
383
|
+
Constructor: void 0,
|
|
384
|
+
cache: createCache(),
|
|
385
|
+
copier,
|
|
386
|
+
depth: 0,
|
|
387
|
+
prototype: void 0
|
|
388
|
+
});
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
var copyStrict = createCopier({ strict: true });
|
|
392
|
+
var copy = createCopier();
|
|
393
|
+
|
|
394
|
+
// ../../../node_modules/.pnpm/@sagold+json-pointer@7.2.1/node_modules/@sagold/json-pointer/dist/index.mjs
|
|
395
|
+
function e2(e4) {
|
|
396
|
+
return e4 === `#` || e4 === `` || Array.isArray(e4) && e4.length === 0 || false;
|
|
397
|
+
}
|
|
398
|
+
var t = /~1/g;
|
|
399
|
+
var n = /~0/g;
|
|
400
|
+
var r = /(^#?\/?)/g;
|
|
401
|
+
function i(e4) {
|
|
402
|
+
return e4.replace(t, `/`).replace(n, `~`);
|
|
403
|
+
}
|
|
404
|
+
function a(e4) {
|
|
405
|
+
return i(decodeURIComponent(e4));
|
|
406
|
+
}
|
|
407
|
+
function o(t2) {
|
|
408
|
+
if (t2 == null || typeof t2 != `string` || e2(t2)) return Array.isArray(t2) ? t2.slice() : [];
|
|
409
|
+
let n2 = t2.indexOf(`#`) >= 0 ? a : i;
|
|
410
|
+
t2 = t2.replace(r, ``);
|
|
411
|
+
let o3 = t2.split(`/`);
|
|
412
|
+
for (let e4 = 0, t3 = o3.length; e4 < t3; e4 += 1) o3[e4] = n2(o3[e4]);
|
|
413
|
+
return o3;
|
|
414
|
+
}
|
|
415
|
+
function s(t2, n2, r2 = void 0) {
|
|
416
|
+
if (n2 == null || t2 == null) return r2;
|
|
417
|
+
if (e2(n2)) return t2;
|
|
418
|
+
let i2 = c(t2, o(n2));
|
|
419
|
+
return i2 === void 0 ? r2 : i2;
|
|
420
|
+
}
|
|
421
|
+
function c(e4, t2) {
|
|
422
|
+
let n2 = t2.shift();
|
|
423
|
+
if (e4 !== void 0) return n2 === void 0 ? e4 : e4 == null ? void 0 : c(e4[n2], t2);
|
|
424
|
+
}
|
|
425
|
+
var _ = /~/g;
|
|
426
|
+
var v = /\//g;
|
|
427
|
+
function y(e4, t2) {
|
|
428
|
+
if (e4.length === 0) return t2 ? `#` : ``;
|
|
429
|
+
for (let n2 = 0, r2 = e4.length; n2 < r2; n2 += 1) e4[n2] = e4[n2].replace(_, `~0`).replace(v, `~1`), t2 && (e4[n2] = encodeURIComponent(e4[n2]));
|
|
430
|
+
return (t2 ? `#/` : `/`) + e4.join(`/`);
|
|
431
|
+
}
|
|
432
|
+
function b(e4, ...t2) {
|
|
433
|
+
let n2 = [];
|
|
434
|
+
if (Array.isArray(e4)) return y(e4, arguments[1] === true);
|
|
435
|
+
let r2 = arguments[arguments.length - 1], i2 = typeof r2 == `boolean` ? r2 : e4 && e4[0] === `#`;
|
|
436
|
+
for (let e5 = 0, t3 = arguments.length; e5 < t3; e5 += 1) n2.push.apply(n2, o(arguments[e5]));
|
|
437
|
+
let a3 = [];
|
|
438
|
+
for (let e5 = 0, t3 = n2.length; e5 < t3; e5 += 1) if (n2[e5] === `..`) {
|
|
439
|
+
if (a3.length === 0) return i2 ? `#` : ``;
|
|
440
|
+
a3.pop();
|
|
441
|
+
} else a3.push(n2[e5]);
|
|
442
|
+
return y(a3, i2);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// ../../../node_modules/.pnpm/json-schema-library@11.6.5/node_modules/json-schema-library/dist/index.mjs
|
|
446
|
+
var import_valid_url = __toESM(require_valid_url(), 1);
|
|
447
|
+
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
448
|
+
function s2(e4, t2 = []) {
|
|
449
|
+
if (!Array.isArray(e4)) return e4 === void 0 ? [] : [e4];
|
|
450
|
+
for (let n2 of e4) Array.isArray(n2) ? s2(n2, t2) : (Se(n2) || n2 instanceof Promise) && t2.push(n2);
|
|
451
|
+
return t2;
|
|
452
|
+
}
|
|
453
|
+
var c2 = { DECLARATOR_ONEOF: `oneOfProperty`, propertyBlacklist: [`_id`], DYNAMIC_PROPERTIES: [`$ref`, `$defs`, `if`, `then`, `else`, `allOf`, `anyOf`, `oneOf`, `dependentSchemas`, `dependentRequired`, `definitions`, `dependencies`, `patternProperties`, `propertyDependencies`], REGEX_FLAGS: `u`, VALID_ANNOTATION_KEYWORDS: [`$id`, `$schema`, `title`, `description`, `default`, `oneOfProperty`], PROPERTIES_TO_MERGE: [`title`, `description`, `default`, `options`, `x-options`, `readOnly`, `writeOnly`] };
|
|
454
|
+
var l = Object.prototype.toString;
|
|
455
|
+
function u(e4) {
|
|
456
|
+
let t2 = l.call(e4).slice(8, -1).toLowerCase();
|
|
457
|
+
return t2 === `file` ? `object` : t2;
|
|
458
|
+
}
|
|
459
|
+
function d(e4) {
|
|
460
|
+
return u(e4) === `object`;
|
|
461
|
+
}
|
|
462
|
+
function f(e4) {
|
|
463
|
+
let t2 = e4 === void 0 ? {} : { type: u(e4) };
|
|
464
|
+
return t2.type === `object` && d(e4) && (t2.properties = {}, Object.keys(e4).forEach((n2) => t2.properties[n2] = f(e4[n2]))), t2.type === `array` && Array.isArray(e4) && (e4.length === 1 ? t2.items = f(e4[0]) : (t2.items = e4.map(f), t2.items.find((e5) => e5.type !== t2.items[0].type) ?? (t2.items = t2.items[0]))), t2;
|
|
465
|
+
}
|
|
466
|
+
function p(e4, t2) {
|
|
467
|
+
t2 != null && Object.values(t2).forEach((t3) => h(t3, e4));
|
|
468
|
+
}
|
|
469
|
+
function m(e4, t2) {
|
|
470
|
+
t2?.forEach((t3) => h(t3, e4));
|
|
471
|
+
}
|
|
472
|
+
function h(e4, t2 = []) {
|
|
473
|
+
return j(e4) ? (t2.push(e4), p(t2, e4.$defs), e4.additionalProperties && h(e4.additionalProperties, t2), m(t2, e4.allOf), m(t2, e4.anyOf), e4.contains && h(e4.contains, t2), p(t2, e4.dependentSchemas), e4.if && h(e4.if, t2), e4.else && h(e4.else, t2), e4.then && h(e4.then, t2), e4.items && h(e4.items, t2), m(t2, e4.prefixItems), e4.not && h(e4.not, t2), m(t2, e4.oneOf), e4.patternProperties && Object.values(e4.patternProperties).forEach(({ node: e5 }) => h(e5, t2)), p(t2, e4.properties), e4.propertyNames && h(e4.propertyNames, t2), e4.unevaluatedProperties && h(e4.unevaluatedProperties, t2), e4.unevaluatedItems && h(e4.unevaluatedItems, t2), t2) : t2;
|
|
474
|
+
}
|
|
475
|
+
var ee = e(((e4, t2) => {
|
|
476
|
+
let n2 = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu), r2 = 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), i2 = RegExp.prototype.test.bind(/^\d*$/u), a3 = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu), o3 = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu), s3 = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u), c3 = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u), l2 = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
|
|
477
|
+
function u2(e5) {
|
|
478
|
+
let t3 = ``, n3 = 0, r3 = 0;
|
|
479
|
+
for (r3 = 0; r3 < e5.length; r3++) if (n3 = e5[r3].charCodeAt(0), n3 !== 48) {
|
|
480
|
+
if (!(n3 >= 48 && n3 <= 57 || n3 >= 65 && n3 <= 70 || n3 >= 97 && n3 <= 102)) return ``;
|
|
481
|
+
t3 += e5[r3];
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
for (r3 += 1; r3 < e5.length; r3++) {
|
|
485
|
+
if (n3 = e5[r3].charCodeAt(0), !(n3 >= 48 && n3 <= 57 || n3 >= 65 && n3 <= 70 || n3 >= 97 && n3 <= 102)) return ``;
|
|
486
|
+
t3 += e5[r3];
|
|
487
|
+
}
|
|
488
|
+
return t3;
|
|
489
|
+
}
|
|
490
|
+
let d2 = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/), f2 = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/), p2 = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/), m2 = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u), h2 = RegExp.prototype.test.bind(/[^\d!"$&'()*+,\-.;=_`a-z{}~]/u), ee2 = RegExp.prototype.test.bind(/(?:^|\.)\d+$/u);
|
|
491
|
+
function te2(e5) {
|
|
492
|
+
return h2(e5) || ee2(e5);
|
|
493
|
+
}
|
|
494
|
+
function ne2(e5) {
|
|
495
|
+
if (e5.length === 0) return false;
|
|
496
|
+
for (let t3 = 0; t3 < e5.length; t3++) if (!p2(e5[t3])) {
|
|
497
|
+
if (e5[t3] === `%` && t3 + 2 < e5.length && a3(e5.slice(t3 + 1, t3 + 3))) {
|
|
498
|
+
t3 += 2;
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
function g2(e5) {
|
|
506
|
+
let t3 = -1, n3 = 0, r3 = -1, i3 = 0;
|
|
507
|
+
for (let a5 = 0; a5 < e5.length; a5++) e5[a5] === `0` ? (r3 === -1 && (r3 = a5), i3++, i3 > n3 && (n3 = i3, t3 = r3)) : (r3 = -1, i3 = 0);
|
|
508
|
+
if (n3 < 2) return e5.join(`:`);
|
|
509
|
+
let a4 = e5.slice(0, t3).join(`:`), o4 = e5.slice(t3 + n3).join(`:`);
|
|
510
|
+
return a4 + `::` + o4;
|
|
511
|
+
}
|
|
512
|
+
function _3(e5) {
|
|
513
|
+
let t3 = e5.indexOf(`::`);
|
|
514
|
+
if (t3 !== -1 && e5.indexOf(`::`, t3 + 1) !== -1) return;
|
|
515
|
+
let n3 = t3 === -1 ? e5.split(`:`) : e5.slice(0, t3).split(`:`), i3 = t3 === -1 ? [] : e5.slice(t3 + 2).split(`:`);
|
|
516
|
+
t3 !== -1 && (n3.length === 1 && n3[0] === `` && (n3.length = 0), i3.length === 1 && i3[0] === `` && (i3.length = 0));
|
|
517
|
+
let a4 = n3.concat(i3), o4 = 0;
|
|
518
|
+
for (let e6 = 0; e6 < a4.length; e6++) {
|
|
519
|
+
let n4 = a4[e6];
|
|
520
|
+
if (n4 === ``) return;
|
|
521
|
+
if (n4.indexOf(`.`) !== -1) {
|
|
522
|
+
if (e6 !== a4.length - 1 || t3 !== -1 && i3.length === 0 || !r2(n4)) return;
|
|
523
|
+
o4 += 2;
|
|
524
|
+
continue;
|
|
525
|
+
}
|
|
526
|
+
if (!d2(n4)) return;
|
|
527
|
+
a4[e6] = parseInt(n4, 16).toString(16), o4++;
|
|
528
|
+
}
|
|
529
|
+
if (t3 === -1) return o4 === 8 ? g2(a4) : void 0;
|
|
530
|
+
if (o4 >= 8) return;
|
|
531
|
+
let s4 = a4.slice(0, n3.length);
|
|
532
|
+
for (let e6 = o4; e6 < 8; e6++) s4.push(`0`);
|
|
533
|
+
for (let e6 = n3.length; e6 < a4.length; e6++) s4.push(a4[e6]);
|
|
534
|
+
return g2(s4);
|
|
535
|
+
}
|
|
536
|
+
function v3(e5) {
|
|
537
|
+
let t3 = e5[0] === `[` && e5[e5.length - 1] === `]`;
|
|
538
|
+
if ((e5[0] === `[` || e5[e5.length - 1] === `]`) && !t3) return { host: e5, isIPV6: false, error: true };
|
|
539
|
+
let n3 = t3 ? e5.slice(1, -1) : e5;
|
|
540
|
+
if (t3 && f2(n3)) return n3 = n3.toLowerCase(), { host: `[${n3}]`, escapedHost: n3, isIPV6: false, isIPVFuture: true };
|
|
541
|
+
if (re2(n3, `:`) < 2) return { host: e5, isIPV6: false, error: t3 };
|
|
542
|
+
let r3 = ``, i3 = n3.indexOf(`%`);
|
|
543
|
+
if (i3 !== -1) {
|
|
544
|
+
let t4 = n3.slice(i3, i3 + 3).toLowerCase() === `%25` ? 3 : 1;
|
|
545
|
+
if (r3 = n3.slice(i3 + t4), !ne2(r3)) return { host: e5, isIPV6: false, error: true };
|
|
546
|
+
n3 = n3.slice(0, i3);
|
|
547
|
+
}
|
|
548
|
+
let a4 = _3(n3);
|
|
549
|
+
return a4 === void 0 ? { host: e5, isIPV6: false, error: true } : { host: a4 + (r3 ? `%` + r3 : ``), escapedHost: a4 + (r3 ? `%25` + r3 : ``), isIPV6: true };
|
|
550
|
+
}
|
|
551
|
+
function re2(e5, t3) {
|
|
552
|
+
let n3 = 0;
|
|
553
|
+
for (let r3 = 0; r3 < e5.length; r3++) e5[r3] === t3 && n3++;
|
|
554
|
+
return n3;
|
|
555
|
+
}
|
|
556
|
+
function y3(e5) {
|
|
557
|
+
let t3 = e5, n3 = [], r3 = -1, i3 = 0;
|
|
558
|
+
for (; i3 = t3.length; ) {
|
|
559
|
+
if (i3 === 1) {
|
|
560
|
+
if (t3 === `.`) break;
|
|
561
|
+
if (t3 === `/`) {
|
|
562
|
+
n3.push(`/`);
|
|
563
|
+
break;
|
|
564
|
+
} else {
|
|
565
|
+
n3.push(t3);
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
} else if (i3 === 2) {
|
|
569
|
+
if (t3[0] === `.`) {
|
|
570
|
+
if (t3[1] === `.`) break;
|
|
571
|
+
if (t3[1] === `/`) {
|
|
572
|
+
t3 = t3.slice(2);
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
} else if (t3[0] === `/` && t3[1] === `.`) {
|
|
576
|
+
n3.push(`/`);
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
579
|
+
} else if (i3 === 3 && t3 === `/..`) {
|
|
580
|
+
n3.length !== 0 && n3.pop(), n3.push(`/`);
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
if (t3[0] === `.`) {
|
|
584
|
+
if (t3[1] === `.`) {
|
|
585
|
+
if (t3[2] === `/`) {
|
|
586
|
+
t3 = t3.slice(3);
|
|
587
|
+
continue;
|
|
588
|
+
}
|
|
589
|
+
} else if (t3[1] === `/`) {
|
|
590
|
+
t3 = t3.slice(2);
|
|
591
|
+
continue;
|
|
592
|
+
}
|
|
593
|
+
} else if (t3[0] === `/` && t3[1] === `.`) {
|
|
594
|
+
if (t3[2] === `/`) {
|
|
595
|
+
t3 = t3.slice(2);
|
|
596
|
+
continue;
|
|
597
|
+
} else if (t3[2] === `.` && t3[3] === `/`) {
|
|
598
|
+
t3 = t3.slice(3), n3.length !== 0 && n3.pop();
|
|
599
|
+
continue;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
if ((r3 = t3.indexOf(`/`, 1)) === -1) {
|
|
603
|
+
n3.push(t3);
|
|
604
|
+
break;
|
|
605
|
+
} else n3.push(t3.slice(0, r3)), t3 = t3.slice(r3);
|
|
606
|
+
}
|
|
607
|
+
return n3.join(``);
|
|
608
|
+
}
|
|
609
|
+
let b3 = { "@": `%40`, "/": `%2F`, "?": `%3F`, "#": `%23`, ":": `%3A` }, x2 = /[@/?#:]/g, S2 = /[@/?#]/g;
|
|
610
|
+
function ie2(e5, t3) {
|
|
611
|
+
let n3 = t3 ? S2 : x2;
|
|
612
|
+
return n3.lastIndex = 0, e5.replace(n3, (e6) => b3[e6]);
|
|
613
|
+
}
|
|
614
|
+
function ae2(e5, t3 = false) {
|
|
615
|
+
if (e5.indexOf(`%`) === -1) return e5;
|
|
616
|
+
let n3 = ``;
|
|
617
|
+
for (let r3 = 0; r3 < e5.length; r3++) {
|
|
618
|
+
if (e5[r3] === `%` && r3 + 2 < e5.length) {
|
|
619
|
+
let i3 = e5.slice(r3 + 1, r3 + 3);
|
|
620
|
+
if (a3(i3)) {
|
|
621
|
+
let e6 = i3.toUpperCase(), a4 = String.fromCharCode(parseInt(e6, 16));
|
|
622
|
+
t3 && o3(a4) ? n3 += a4 : n3 += `%` + e6, r3 += 2;
|
|
623
|
+
continue;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
n3 += e5[r3];
|
|
627
|
+
}
|
|
628
|
+
return n3;
|
|
629
|
+
}
|
|
630
|
+
let C2 = Array(256);
|
|
631
|
+
{
|
|
632
|
+
let e5 = `0123456789ABCDEF`;
|
|
633
|
+
for (let t3 = 0; t3 < 256; t3++) C2[t3] = `%` + e5[t3 >> 4] + e5[t3 & 15];
|
|
634
|
+
}
|
|
635
|
+
function oe2(e5) {
|
|
636
|
+
return e5 >= 48 && e5 <= 57 || e5 >= 65 && e5 <= 90 || e5 >= 97 && e5 <= 122 || e5 === 42 || e5 === 43 || e5 === 45 || e5 === 46 || e5 === 47 || e5 === 64 || e5 === 95;
|
|
637
|
+
}
|
|
638
|
+
function w2(e5) {
|
|
639
|
+
return e5 < 2048 ? C2[192 | e5 >> 6] + C2[128 | e5 & 63] : e5 < 65536 ? C2[224 | e5 >> 12] + C2[128 | e5 >> 6 & 63] + C2[128 | e5 & 63] : C2[240 | e5 >> 18] + C2[128 | e5 >> 12 & 63] + C2[128 | e5 >> 6 & 63] + C2[128 | e5 & 63];
|
|
640
|
+
}
|
|
641
|
+
function se2(e5) {
|
|
642
|
+
let t3 = ``;
|
|
643
|
+
for (let n3 = 0; n3 < e5.length; n3++) {
|
|
644
|
+
let r3 = e5[n3];
|
|
645
|
+
if (r3 === `%` && n3 + 2 < e5.length) {
|
|
646
|
+
let r4 = e5.slice(n3 + 1, n3 + 3);
|
|
647
|
+
if (a3(r4)) {
|
|
648
|
+
let e6 = r4.toUpperCase(), i3 = String.fromCharCode(parseInt(e6, 16));
|
|
649
|
+
i3 !== `.` && o3(i3) ? t3 += i3 : t3 += `%` + e6, n3 += 2;
|
|
650
|
+
continue;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
if (s3(r3)) t3 += r3;
|
|
654
|
+
else {
|
|
655
|
+
let i3 = e5.charCodeAt(n3);
|
|
656
|
+
if (i3 < 128) t3 += oe2(i3) ? r3 : C2[i3];
|
|
657
|
+
else if (i3 < 55296 || i3 > 57343) t3 += w2(i3);
|
|
658
|
+
else if (i3 <= 56319 && n3 + 1 < e5.length) {
|
|
659
|
+
let r4 = e5.charCodeAt(n3 + 1);
|
|
660
|
+
r4 >= 56320 && r4 <= 57343 ? (t3 += w2(65536 + (i3 - 55296 << 10) + (r4 - 56320)), n3++) : t3 += w2(65533);
|
|
661
|
+
} else t3 += w2(65533);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
return t3;
|
|
665
|
+
}
|
|
666
|
+
function T2(e5, t3 = false) {
|
|
667
|
+
let n3 = ``, r3 = t3 && e5[0] !== `/`;
|
|
668
|
+
for (let t4 = 0; t4 < e5.length; t4++) {
|
|
669
|
+
let i3 = e5[t4];
|
|
670
|
+
if (i3 === `%` && t4 + 2 < e5.length) {
|
|
671
|
+
let r4 = e5.slice(t4 + 1, t4 + 3);
|
|
672
|
+
if (a3(r4)) {
|
|
673
|
+
n3 += `%` + r4.toUpperCase(), t4 += 2;
|
|
674
|
+
continue;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
if (i3 === `/` && (r3 = false), s3(i3) && (i3 !== `:` || !r3)) n3 += i3;
|
|
678
|
+
else {
|
|
679
|
+
let r4 = e5.charCodeAt(t4);
|
|
680
|
+
if (r4 < 128) n3 += C2[r4];
|
|
681
|
+
else if (r4 < 55296 || r4 > 57343) n3 += w2(r4);
|
|
682
|
+
else if (r4 <= 56319 && t4 + 1 < e5.length) {
|
|
683
|
+
let i4 = e5.charCodeAt(t4 + 1);
|
|
684
|
+
i4 >= 56320 && i4 <= 57343 ? (n3 += w2(65536 + (r4 - 55296 << 10) + (i4 - 56320)), t4++) : n3 += w2(65533);
|
|
685
|
+
} else n3 += w2(65533);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
return n3;
|
|
689
|
+
}
|
|
690
|
+
function E2(e5) {
|
|
691
|
+
let t3 = ``;
|
|
692
|
+
for (let n3 = 0; n3 < e5.length; n3++) {
|
|
693
|
+
let r3 = e5[n3];
|
|
694
|
+
if (r3 === `%` && n3 + 2 < e5.length) {
|
|
695
|
+
let r4 = e5.slice(n3 + 1, n3 + 3);
|
|
696
|
+
if (a3(r4)) {
|
|
697
|
+
let e6 = r4.toUpperCase(), i3 = String.fromCharCode(parseInt(e6, 16));
|
|
698
|
+
o3(i3) ? t3 += i3 : t3 += `%` + e6, n3 += 2;
|
|
699
|
+
continue;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
if (c3(r3)) t3 += r3;
|
|
703
|
+
else {
|
|
704
|
+
let i3 = e5.charCodeAt(n3);
|
|
705
|
+
if (i3 < 128) t3 += oe2(i3) ? r3 : C2[i3];
|
|
706
|
+
else if (i3 < 55296 || i3 > 57343) t3 += w2(i3);
|
|
707
|
+
else if (i3 <= 56319 && n3 + 1 < e5.length) {
|
|
708
|
+
let r4 = e5.charCodeAt(n3 + 1);
|
|
709
|
+
r4 >= 56320 && r4 <= 57343 ? (t3 += w2(65536 + (i3 - 55296 << 10) + (r4 - 56320)), n3++) : t3 += w2(65533);
|
|
710
|
+
} else t3 += w2(65533);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return t3;
|
|
714
|
+
}
|
|
715
|
+
function D2(e5, t3) {
|
|
716
|
+
let n3 = ``;
|
|
717
|
+
for (let r3 = 0; r3 < e5.length; r3++) {
|
|
718
|
+
let i3 = e5[r3];
|
|
719
|
+
if (i3 === `%` && r3 + 2 < e5.length) {
|
|
720
|
+
let t4 = e5.slice(r3 + 1, r3 + 3);
|
|
721
|
+
if (a3(t4)) {
|
|
722
|
+
n3 += `%` + t4.toUpperCase(), r3 += 2;
|
|
723
|
+
continue;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
if (t3(i3)) n3 += i3;
|
|
727
|
+
else {
|
|
728
|
+
let t4 = e5.charCodeAt(r3);
|
|
729
|
+
if (t4 < 128) n3 += C2[t4];
|
|
730
|
+
else if (t4 < 55296 || t4 > 57343) n3 += w2(t4);
|
|
731
|
+
else if (t4 <= 56319 && r3 + 1 < e5.length) {
|
|
732
|
+
let i4 = e5.charCodeAt(r3 + 1);
|
|
733
|
+
i4 >= 56320 && i4 <= 57343 ? (n3 += w2(65536 + (t4 - 55296 << 10) + (i4 - 56320)), r3++) : n3 += w2(65533);
|
|
734
|
+
} else n3 += w2(65533);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
return n3;
|
|
738
|
+
}
|
|
739
|
+
function O2(e5) {
|
|
740
|
+
return D2(e5, l2);
|
|
741
|
+
}
|
|
742
|
+
function k2(e5) {
|
|
743
|
+
return D2(e5, c3);
|
|
744
|
+
}
|
|
745
|
+
function A2(e5) {
|
|
746
|
+
return D2(e5, c3);
|
|
747
|
+
}
|
|
748
|
+
function ce2(e5) {
|
|
749
|
+
let t3 = ``;
|
|
750
|
+
for (let n3 = 0; n3 < e5.length; n3++) {
|
|
751
|
+
let r3 = e5[n3];
|
|
752
|
+
if (r3 === `%` && n3 + 2 < e5.length) {
|
|
753
|
+
let r4 = e5.slice(n3 + 1, n3 + 3);
|
|
754
|
+
if (a3(r4)) {
|
|
755
|
+
t3 += `%` + r4.toUpperCase(), n3 += 2;
|
|
756
|
+
continue;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
let i3 = e5.charCodeAt(n3);
|
|
760
|
+
if (i3 < 128) t3 += oe2(i3) ? r3 : C2[i3];
|
|
761
|
+
else if (i3 < 55296 || i3 > 57343) t3 += w2(i3);
|
|
762
|
+
else if (i3 <= 56319 && n3 + 1 < e5.length) {
|
|
763
|
+
let r4 = e5.charCodeAt(n3 + 1);
|
|
764
|
+
r4 >= 56320 && r4 <= 57343 ? (t3 += w2(65536 + (i3 - 55296 << 10) + (r4 - 56320)), n3++) : t3 += w2(65533);
|
|
765
|
+
} else t3 += w2(65533);
|
|
766
|
+
}
|
|
767
|
+
return t3;
|
|
768
|
+
}
|
|
769
|
+
function le2(e5) {
|
|
770
|
+
let t3 = e5.ipv6Zone;
|
|
771
|
+
if (t3 === void 0) return;
|
|
772
|
+
let n3 = e5.host, r3 = n3.indexOf(`%`);
|
|
773
|
+
if (r3 === -1) return;
|
|
774
|
+
let i3 = n3.slice(0, r3) + `%25` + t3, a4 = v3(`[` + i3 + `]`);
|
|
775
|
+
if (a4.isIPV6 === true && a4.host === n3) return `[` + i3 + `]`;
|
|
776
|
+
}
|
|
777
|
+
function ue2(e5) {
|
|
778
|
+
let t3 = [];
|
|
779
|
+
if (e5.userinfo !== void 0 && (t3.push(O2(e5.userinfo)), t3.push(`@`)), e5.host !== void 0) {
|
|
780
|
+
let n3 = e5.host;
|
|
781
|
+
if (!r2(n3)) {
|
|
782
|
+
let t4 = le2(e5);
|
|
783
|
+
if (t4 !== void 0) n3 = t4;
|
|
784
|
+
else {
|
|
785
|
+
let e6 = v3(n3);
|
|
786
|
+
e6.isIPV6 !== true && e6.isIPVFuture !== true && (n3 = ae2(n3, true), e6 = v3(n3)), n3 = e6.isIPV6 === true || e6.isIPVFuture === true ? `[${e6.escapedHost}]` : ie2(n3, false);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
t3.push(n3);
|
|
790
|
+
}
|
|
791
|
+
if (typeof e5.port == `number` || typeof e5.port == `string`) {
|
|
792
|
+
let n3 = String(e5.port);
|
|
793
|
+
if (!i2(n3)) throw TypeError(`URI port is malformed.`);
|
|
794
|
+
t3.push(`:`), t3.push(n3);
|
|
795
|
+
}
|
|
796
|
+
return t3.length ? t3.join(``) : void 0;
|
|
797
|
+
}
|
|
798
|
+
t2.exports = { BYTE_HEX: C2, percentEncodeNonAscii: w2, nonSimpleDomain: m2, nonSimpleMailtoDomain: te2, recomposeAuthority: ue2, reescapeHostDelimiters: ie2, normalizePercentEncoding: ae2, normalizePathEncoding: se2, serializePathEncoding: T2, normalizeQueryFragmentEncoding: E2, encodeUserinfo: O2, encodeQuery: k2, encodeFragment: A2, escapePreservingEscapes: ce2, removeDotSegments: y3, isIPv4: r2, isUUID: n2, normalizeIPv6: v3, stringArrayToHexStripped: u2 };
|
|
799
|
+
}));
|
|
800
|
+
var te = e(((e4, t2) => {
|
|
801
|
+
let { isUUID: n2, BYTE_HEX: r2, percentEncodeNonAscii: i2, nonSimpleMailtoDomain: a3 } = ee(), o3 = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu, s3 = [`http`, `https`, `ws`, `wss`, `urn`, `urn:uuid`, `mailto`];
|
|
802
|
+
function c3(e5) {
|
|
803
|
+
return s3.indexOf(e5) !== -1;
|
|
804
|
+
}
|
|
805
|
+
function l2(e5) {
|
|
806
|
+
return e5.secure === true ? true : e5.secure === false ? false : e5.scheme ? e5.scheme.length === 3 && (e5.scheme[0] === `w` || e5.scheme[0] === `W`) && (e5.scheme[1] === `s` || e5.scheme[1] === `S`) && (e5.scheme[2] === `s` || e5.scheme[2] === `S`) : false;
|
|
807
|
+
}
|
|
808
|
+
function u2(e5) {
|
|
809
|
+
return e5.host || (e5.error = e5.error || `HTTP URIs must have a host.`), e5;
|
|
810
|
+
}
|
|
811
|
+
function d2(e5) {
|
|
812
|
+
let t3 = String(e5.scheme).toLowerCase() === `https`;
|
|
813
|
+
return (e5.port === (t3 ? 443 : 80) || e5.port === ``) && (e5.port = void 0), e5.path ||= `/`, e5;
|
|
814
|
+
}
|
|
815
|
+
function f2(e5) {
|
|
816
|
+
return e5.secure = l2(e5), e5.resourceName = (e5.path || `/`) + (e5.query ? `?` + e5.query : ``), e5.path = void 0, e5.query = void 0, e5;
|
|
817
|
+
}
|
|
818
|
+
function p2(e5) {
|
|
819
|
+
if ((e5.port === (l2(e5) ? 443 : 80) || e5.port === ``) && (e5.port = void 0), typeof e5.secure == `boolean` && (e5.scheme = e5.secure ? `wss` : `ws`, e5.secure = void 0), e5.resourceName) {
|
|
820
|
+
let t3 = e5.resourceName.indexOf(`?`), n3 = t3 === -1 ? e5.resourceName : e5.resourceName.slice(0, t3);
|
|
821
|
+
e5.path = n3 && n3 !== `/` ? n3 : void 0, e5.query = t3 === -1 ? void 0 : e5.resourceName.slice(t3 + 1), e5.resourceName = void 0;
|
|
822
|
+
}
|
|
823
|
+
return e5.fragment = void 0, e5;
|
|
824
|
+
}
|
|
825
|
+
function m2(e5, t3) {
|
|
826
|
+
if (!e5.path) return e5.error = `URN can not be parsed`, e5;
|
|
827
|
+
let n3 = e5.path.match(o3);
|
|
828
|
+
if (n3 && n3[0] === e5.path) {
|
|
829
|
+
let r3 = t3.scheme || e5.scheme || `urn`;
|
|
830
|
+
e5.nid = n3[1].toLowerCase(), e5.nss = n3[2];
|
|
831
|
+
let i3 = pe2(`${r3}:${t3.nid || e5.nid}`);
|
|
832
|
+
e5.path = void 0, i3 && (e5 = i3.parse(e5, t3));
|
|
833
|
+
} else e5.error = e5.error || `URN can not be parsed.`;
|
|
834
|
+
return e5;
|
|
835
|
+
}
|
|
836
|
+
function h2(e5, t3) {
|
|
837
|
+
if (e5.nid === void 0) throw Error(`URN without nid cannot be serialized`);
|
|
838
|
+
let n3 = t3.scheme || e5.scheme || `urn`, r3 = e5.nid.toLowerCase(), i3 = pe2(`${n3}:${t3.nid || r3}`);
|
|
839
|
+
i3 && (e5 = i3.serialize(e5, t3));
|
|
840
|
+
let a4 = e5, o4 = e5.nss;
|
|
841
|
+
return a4.path = `${r3 || t3.nid}:${o4}`, t3.skipEscape = true, a4;
|
|
842
|
+
}
|
|
843
|
+
function te2(e5, t3) {
|
|
844
|
+
let r3 = e5;
|
|
845
|
+
return r3.uuid = r3.nss, r3.nss = void 0, !t3.tolerant && (!r3.uuid || !n2(r3.uuid)) && (r3.error = r3.error || `UUID is not valid.`), r3;
|
|
846
|
+
}
|
|
847
|
+
function ne2(e5) {
|
|
848
|
+
let t3 = e5;
|
|
849
|
+
return t3.nss = (e5.uuid || ``).toLowerCase(), t3;
|
|
850
|
+
}
|
|
851
|
+
let g2 = { scheme: `http`, domainHost: true, parse: u2, serialize: d2 }, _3 = { scheme: `https`, domainHost: g2.domainHost, parse: u2, serialize: d2 }, v3 = { scheme: `ws`, domainHost: true, parse: f2, serialize: p2 }, re2 = { scheme: `wss`, domainHost: v3.domainHost, parse: v3.parse, serialize: v3.serialize }, y3 = { scheme: `urn`, parse: m2, serialize: h2, skipNormalize: true }, b3 = { scheme: `urn:uuid`, parse: te2, serialize: ne2, skipNormalize: true }, x2 = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+;:`;
|
|
852
|
+
function S2(e5, t3 = false) {
|
|
853
|
+
let n3 = new Uint8Array(128);
|
|
854
|
+
for (let t4 = 0; t4 < e5.length; t4++) n3[e5.charCodeAt(t4)] = 1;
|
|
855
|
+
let r3 = e5.replace(/[\\\]^-]/gu, `\\$&`), i3 = t3 ? `[${r3}]|[^\\0-\\x7F\\uD800-\\uDFFF]` : `[${r3}]`;
|
|
856
|
+
return { all: RegExp(`^(?:${i3})*$`, `u`), table: n3, allowNonAscii: t3 };
|
|
857
|
+
}
|
|
858
|
+
let ie2 = S2(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+=`), ae2 = S2(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+,;:@`), C2 = S2(x2), oe2 = S2(x2, true), w2 = /^[\da-f]{2}$/iu, se2 = /^\[[\x21-\x5A\x5E-\x7E]*\]$/u, T2 = `URI mailto has an invalid recipient domain.`, E2 = /[\uD800-\uDFFF]/u;
|
|
859
|
+
function D2(e5) {
|
|
860
|
+
if (typeof e5 != `string` || e5.indexOf(`%`) === -1) return e5;
|
|
861
|
+
try {
|
|
862
|
+
return decodeURIComponent(e5);
|
|
863
|
+
} catch {
|
|
864
|
+
return e5;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
function O2(e5) {
|
|
868
|
+
let t3 = ``;
|
|
869
|
+
for (let n3 = 0; n3 < e5.length; n3++) {
|
|
870
|
+
let r3 = e5.charCodeAt(n3);
|
|
871
|
+
if (r3 >= 55296 && r3 <= 56319 && n3 + 1 < e5.length) {
|
|
872
|
+
let r4 = e5.charCodeAt(n3 + 1);
|
|
873
|
+
if (r4 >= 56320 && r4 <= 57343) {
|
|
874
|
+
t3 += e5[n3] + e5[n3 + 1], n3++;
|
|
875
|
+
continue;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
t3 += r3 >= 55296 && r3 <= 57343 ? `\uFFFD` : e5[n3];
|
|
879
|
+
}
|
|
880
|
+
return t3;
|
|
881
|
+
}
|
|
882
|
+
function k2(e5, t3) {
|
|
883
|
+
if (t3.all.test(e5)) return e5;
|
|
884
|
+
let n3 = t3.table, a4 = ``;
|
|
885
|
+
for (let o4 = 0; o4 < e5.length; o4++) {
|
|
886
|
+
let s4 = e5.charCodeAt(o4);
|
|
887
|
+
if (s4 < 128) {
|
|
888
|
+
n3[s4] === 1 ? a4 += e5[o4] : s4 === 37 && o4 + 2 < e5.length && w2.test(e5.slice(o4 + 1, o4 + 3)) ? (a4 += `%` + e5.slice(o4 + 1, o4 + 3).toUpperCase(), o4 += 2) : a4 += r2[s4];
|
|
889
|
+
continue;
|
|
890
|
+
}
|
|
891
|
+
if (s4 < 55296 || s4 > 57343) {
|
|
892
|
+
a4 += t3.allowNonAscii ? e5[o4] : i2(s4);
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
if (s4 <= 56319 && o4 + 1 < e5.length) {
|
|
896
|
+
let n4 = e5.charCodeAt(o4 + 1);
|
|
897
|
+
if (n4 >= 56320 && n4 <= 57343) {
|
|
898
|
+
a4 += t3.allowNonAscii ? e5[o4] + e5[o4 + 1] : i2(65536 + (s4 - 55296 << 10) + (n4 - 56320)), o4++;
|
|
899
|
+
continue;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
a4 += t3.allowNonAscii ? `\uFFFD` : i2(65533);
|
|
903
|
+
}
|
|
904
|
+
return a4;
|
|
905
|
+
}
|
|
906
|
+
function A2(e5, t3, n3) {
|
|
907
|
+
let r3 = String(e5).toLowerCase();
|
|
908
|
+
if (se2.test(r3) || r3 !== `` && !a3(r3)) return r3;
|
|
909
|
+
try {
|
|
910
|
+
let e6 = new URL(`http://` + r3);
|
|
911
|
+
if (e6.username || e6.password || e6.port || e6.pathname !== `/` || e6.search || e6.hash || !e6.hostname) throw Error(T2);
|
|
912
|
+
return t3 && t3.unicodeSupport ? r3 : e6.hostname;
|
|
913
|
+
} catch {
|
|
914
|
+
return n3 && (n3.error = n3.error || T2), r3;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
function ce2(e5, t3) {
|
|
918
|
+
let n3 = t3 && t3.unicodeSupport ? oe2 : C2;
|
|
919
|
+
return e5.length > 1 && e5[0] === `[` && e5[e5.length - 1] === `]` ? `[` + k2(e5.slice(1, -1), n3) + `]` : k2(e5, n3);
|
|
920
|
+
}
|
|
921
|
+
function le2(e5, t3) {
|
|
922
|
+
let n3 = e5, r3 = n3.path, i3 = n3.query;
|
|
923
|
+
r3 && E2.test(r3) && (r3 = O2(r3)), i3 && E2.test(i3) && (i3 = O2(i3));
|
|
924
|
+
let a4 = r3 ? r3.indexOf(`,`) === -1 ? [r3] : r3.split(`,`) : [];
|
|
925
|
+
if (n3.path = void 0, i3) {
|
|
926
|
+
let e6 = null, t4 = 0;
|
|
927
|
+
for (; t4 <= i3.length; ) {
|
|
928
|
+
let r4 = i3.indexOf(`&`, t4);
|
|
929
|
+
r4 === -1 && (r4 = i3.length);
|
|
930
|
+
let o4 = i3.slice(t4, r4);
|
|
931
|
+
t4 = r4 + 1;
|
|
932
|
+
let s4 = o4.indexOf(`=`);
|
|
933
|
+
if (s4 !== o4.lastIndexOf(`=`)) {
|
|
934
|
+
n3.error = n3.error || `URI mailto has malformed header fields.`;
|
|
935
|
+
continue;
|
|
936
|
+
}
|
|
937
|
+
let c4 = D2(s4 === -1 ? o4 : o4.slice(0, s4)), l3 = c4.toLowerCase(), u3 = s4 === -1 ? `` : o4.slice(s4 + 1);
|
|
938
|
+
if (l3 === `to`) {
|
|
939
|
+
let e7 = u3.split(`,`);
|
|
940
|
+
for (let t5 = 0; t5 < e7.length; t5++) a4.push(e7[t5]);
|
|
941
|
+
continue;
|
|
942
|
+
}
|
|
943
|
+
if (l3 === `subject`) {
|
|
944
|
+
n3.subject = D2(u3);
|
|
945
|
+
continue;
|
|
946
|
+
}
|
|
947
|
+
if (l3 === `body`) {
|
|
948
|
+
n3.body = D2(u3);
|
|
949
|
+
continue;
|
|
950
|
+
}
|
|
951
|
+
e6 === null && (e6 = /* @__PURE__ */ Object.create(null)), e6[c4] = D2(u3);
|
|
952
|
+
}
|
|
953
|
+
e6 !== null && (n3.headers = e6);
|
|
954
|
+
}
|
|
955
|
+
n3.query = void 0, a4.length > 0 && (n3.userinfo !== void 0 || n3.host !== void 0 || n3.port !== void 0) && (n3.userinfo = void 0, n3.host = void 0, n3.port = void 0, n3.error = n3.error || `URI mailto must not have an authority component.`);
|
|
956
|
+
for (let e6 = 0; e6 < a4.length; e6++) {
|
|
957
|
+
let r4 = a4[e6], i4 = r4.lastIndexOf(`@`);
|
|
958
|
+
if (i4 < 0) {
|
|
959
|
+
n3.error = n3.error || T2, a4[e6] = D2(r4);
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
let o4 = D2(r4.slice(0, i4)), s4 = A2(D2(r4.slice(i4 + 1)), t3, n3);
|
|
963
|
+
a4[e6] = o4 + `@` + s4;
|
|
964
|
+
}
|
|
965
|
+
return a4.length && (n3.to = a4), n3;
|
|
966
|
+
}
|
|
967
|
+
function ue2(e5) {
|
|
968
|
+
return k2(e5.replace(/%/gu, `%25`), ae2);
|
|
969
|
+
}
|
|
970
|
+
function de2(e5, t3) {
|
|
971
|
+
let n3 = e5, r3 = Array.isArray(n3.to) ? n3.to.slice() : [], i3 = n3.headers && typeof n3.headers == `object` ? Object.assign(/* @__PURE__ */ Object.create(null), n3.headers) : /* @__PURE__ */ Object.create(null), a4 = /* @__PURE__ */ Object.create(null);
|
|
972
|
+
for (let e6 in i3) {
|
|
973
|
+
let t4 = e6.toLowerCase();
|
|
974
|
+
if (t4 === `to`) {
|
|
975
|
+
let t5 = String(i3[e6]).split(`,`);
|
|
976
|
+
for (let e7 = 0; e7 < t5.length; e7++) r3.push(t5[e7]);
|
|
977
|
+
} else t4 === `subject` || t4 === `body` ? a4[t4] = i3[e6] : a4[e6] = i3[e6];
|
|
978
|
+
}
|
|
979
|
+
if (n3.subject !== void 0 && (a4.subject = n3.subject), n3.body !== void 0 && (a4.body = n3.body), n3.headers = a4, r3.length) {
|
|
980
|
+
n3.userinfo = void 0, n3.host = void 0, n3.port = void 0;
|
|
981
|
+
for (let e6 = 0; e6 < r3.length; e6++) {
|
|
982
|
+
let n4 = String(r3[e6]), i4 = n4.lastIndexOf(`@`), a5 = i4 >= 0 ? n4.slice(0, i4) : n4, o5 = i4 >= 0 ? n4.slice(i4 + 1) : ``, s5 = k2(a5, ie2), c4 = A2(D2(o5), t3);
|
|
983
|
+
r3[e6] = s5 + `@` + ce2(c4, t3);
|
|
984
|
+
}
|
|
985
|
+
n3.path = r3.join(`,`), t3.skipEscape = true;
|
|
986
|
+
} else n3.path = void 0;
|
|
987
|
+
let o4 = ``, s4 = 0;
|
|
988
|
+
for (let e6 in a4) s4++ !== 0 && (o4 += `&`), o4 += ue2(e6) + `=` + k2(String(a4[e6]), ae2);
|
|
989
|
+
return s4 === 0 ? n3.headers = void 0 : n3.query = o4, n3;
|
|
990
|
+
}
|
|
991
|
+
let fe2 = { http: g2, https: _3, ws: v3, wss: re2, urn: y3, "urn:uuid": b3, mailto: { scheme: `mailto`, parse: le2, serialize: de2, domainHost: false, unicodeSupport: true, skipNormalize: true, absolutePath: true } };
|
|
992
|
+
Object.setPrototypeOf(fe2, null);
|
|
993
|
+
function pe2(e5) {
|
|
994
|
+
return e5 && (fe2[e5] || fe2[e5.toLowerCase()]) || void 0;
|
|
995
|
+
}
|
|
996
|
+
t2.exports = { wsIsSecure: l2, SCHEMES: fe2, isValidSchemeName: c3, getSchemeHandler: pe2 };
|
|
997
|
+
}));
|
|
998
|
+
var ne = e(((e4, t2) => {
|
|
999
|
+
let { normalizeIPv6: n2, removeDotSegments: r2, recomposeAuthority: i2, normalizePercentEncoding: a3, normalizePathEncoding: o3, serializePathEncoding: s3, normalizeQueryFragmentEncoding: c3, encodeQuery: l2, encodeFragment: u2, reescapeHostDelimiters: d2, isIPv4: f2, nonSimpleDomain: p2 } = ee(), { SCHEMES: m2, getSchemeHandler: h2 } = te(), ne2 = /^[A-Za-z][A-Za-z0-9+.-]*$/u, g2 = `URI scheme is malformed.`;
|
|
1000
|
+
function _3(e5) {
|
|
1001
|
+
let t3 = unescape(String(e5));
|
|
1002
|
+
if (!ne2.test(t3)) throw TypeError(g2);
|
|
1003
|
+
return t3;
|
|
1004
|
+
}
|
|
1005
|
+
function v3(e5, t3) {
|
|
1006
|
+
return typeof e5 == `string` ? e5 = k2(e5, t3) : typeof e5 == `object` && (e5 = O2(S2(e5, t3), t3)), e5;
|
|
1007
|
+
}
|
|
1008
|
+
function re2(e5, t3, r3) {
|
|
1009
|
+
let i3 = r3 ? Object.assign({ scheme: `null` }, r3) : { scheme: `null` }, { parsed: a4, malformedAuthorityOrPort: o4, malformedPercentEncoding: s4, malformedSchemeSpecific: c4, malformedHost: l3, malformedScheme: u3 } = D2(e5, i3), { parsed: d3, malformedAuthorityOrPort: p3, malformedPercentEncoding: m3, malformedSchemeSpecific: ee2, malformedHost: te2, malformedScheme: ne3 } = D2(t3, i3);
|
|
1010
|
+
if (o4 || p3 || s4 || m3 || c4 || ee2 || l3 || te2 || u3 || ne3) throw Error(a4.error || d3.error || `URI is malformed.`);
|
|
1011
|
+
let g3 = b3(a4, d3, i3, true), _4 = h2(r3 && r3.scheme || g3.scheme), v4 = g3.host, re3 = v4 !== void 0 && v4 !== `` && (f2(v4) || n2(v4).isIPV6);
|
|
1012
|
+
E2(g3, r3 || {}, _4, re3);
|
|
1013
|
+
let y4 = v4 && v4.indexOf(`%`) !== -1 && !/\P{ASCII}/u.test(v4);
|
|
1014
|
+
if (g3.error && !y4) throw Error(g3.error);
|
|
1015
|
+
return i3.skipEscape = true, S2(g3, i3);
|
|
1016
|
+
}
|
|
1017
|
+
function y3(e5, t3) {
|
|
1018
|
+
e5.host = t3.host, t3.ipv6Zone !== void 0 && (e5.ipv6Zone = t3.ipv6Zone);
|
|
1019
|
+
}
|
|
1020
|
+
function b3(e5, t3, n3, i3) {
|
|
1021
|
+
let a4 = {};
|
|
1022
|
+
return i3 || (e5 = O2(S2(e5, n3), n3), t3 = O2(S2(t3, n3), n3)), n3 ||= {}, !n3.tolerant && t3.scheme ? (a4.scheme = t3.scheme, a4.userinfo = t3.userinfo, y3(a4, t3), a4.port = t3.port, a4.path = r2(t3.path || ``), a4.query = t3.query) : (t3.userinfo !== void 0 || t3.host !== void 0 || t3.port !== void 0 ? (a4.userinfo = t3.userinfo, y3(a4, t3), a4.port = t3.port, a4.path = r2(t3.path || ``), a4.query = t3.query) : (t3.path ? (t3.path[0] === `/` ? a4.path = r2(t3.path) : ((e5.userinfo !== void 0 || e5.host !== void 0 || e5.port !== void 0) && !e5.path ? a4.path = `/` + t3.path : e5.path ? a4.path = e5.path.slice(0, e5.path.lastIndexOf(`/`) + 1) + t3.path : a4.path = t3.path, a4.path = r2(a4.path)), a4.query = t3.query) : (a4.path = e5.path, t3.query === void 0 ? a4.query = e5.query : a4.query = t3.query), a4.userinfo = e5.userinfo, y3(a4, e5), a4.port = e5.port), a4.scheme = e5.scheme), a4.fragment = t3.fragment, a4;
|
|
1023
|
+
}
|
|
1024
|
+
function x2(e5, t3, n3) {
|
|
1025
|
+
let r3 = ce2(e5, n3), i3 = ce2(t3, n3);
|
|
1026
|
+
return r3 !== void 0 && i3 !== void 0 && r3 === i3;
|
|
1027
|
+
}
|
|
1028
|
+
function S2(e5, t3) {
|
|
1029
|
+
let n3 = { host: e5.host, ipv6Zone: e5.ipv6Zone, scheme: e5.scheme, userinfo: e5.userinfo, port: e5.port, path: e5.path, query: e5.query, nid: e5.nid, nss: e5.nss, uuid: e5.uuid, fragment: e5.fragment, reference: e5.reference, resourceName: e5.resourceName, secure: e5.secure, to: e5.to, subject: e5.subject, body: e5.body, headers: e5.headers, error: `` }, o4 = Object.assign({}, t3), c4 = [];
|
|
1030
|
+
n3.scheme &&= _3(n3.scheme);
|
|
1031
|
+
let d3 = h2(o4.scheme || n3.scheme);
|
|
1032
|
+
d3 && d3.serialize && d3.serialize(n3, o4);
|
|
1033
|
+
let f3 = n3.userinfo !== void 0 || n3.host !== void 0 || n3.port !== void 0, p3 = !o4.skipEscape && n3.scheme === void 0 && !f3;
|
|
1034
|
+
n3.path !== void 0 && (o4.skipEscape ? n3.path = a3(n3.path) : n3.path = s3(n3.path, p3)), o4.reference !== `suffix` && n3.scheme && (n3.scheme = _3(n3.scheme), c4.push(n3.scheme, `:`));
|
|
1035
|
+
let m3 = i2(n3);
|
|
1036
|
+
if (m3 !== void 0 && (o4.reference !== `suffix` && c4.push(`//`), c4.push(m3), n3.path && n3.path[0] !== `/` && c4.push(`/`)), n3.path !== void 0) {
|
|
1037
|
+
let e6 = n3.path;
|
|
1038
|
+
!o4.absolutePath && (!d3 || !d3.absolutePath) && (e6 = r2(e6)), p3 && (e6 = s3(e6, true)), m3 === void 0 && e6[0] === `/` && e6[1] === `/` && (e6 = `/%2F` + e6.slice(2)), c4.push(e6);
|
|
1039
|
+
}
|
|
1040
|
+
return n3.query !== void 0 && c4.push(`?`, l2(n3.query)), n3.fragment !== void 0 && c4.push(`#`, u2(n3.fragment)), c4.join(``);
|
|
1041
|
+
}
|
|
1042
|
+
let ie2 = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u, ae2 = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/, C2 = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
|
|
1043
|
+
function oe2(e5, t3) {
|
|
1044
|
+
if (t3[2] !== void 0 && e5.path && e5.path[0] !== `/`) return `URI path must start with "/" when authority is present.`;
|
|
1045
|
+
if (typeof e5.port == `number` && (e5.port < 0 || e5.port > 65535)) return `URI port is malformed.`;
|
|
1046
|
+
}
|
|
1047
|
+
function w2(e5) {
|
|
1048
|
+
if (e5 === void 0) return false;
|
|
1049
|
+
let t3 = e5.indexOf(`%`);
|
|
1050
|
+
for (; t3 !== -1; ) {
|
|
1051
|
+
if (t3 + 2 >= e5.length || !/^[\da-f]{2}$/iu.test(e5.slice(t3 + 1, t3 + 3))) return true;
|
|
1052
|
+
t3 = e5.indexOf(`%`, t3 + 3);
|
|
1053
|
+
}
|
|
1054
|
+
return false;
|
|
1055
|
+
}
|
|
1056
|
+
function se2(e5) {
|
|
1057
|
+
return e5[0] === `[` && e5[e5.length - 1] === `]`;
|
|
1058
|
+
}
|
|
1059
|
+
function T2(e5) {
|
|
1060
|
+
let t3 = e5[4];
|
|
1061
|
+
return w2(e5[3]) || t3 !== void 0 && !se2(t3) && w2(t3) || w2(e5[6]) || w2(e5[7]) || w2(e5[8]);
|
|
1062
|
+
}
|
|
1063
|
+
function E2(e5, t3, n3, r3) {
|
|
1064
|
+
let i3 = e5.host && e5.host[0] === `[` && e5.host[e5.host.length - 1] === `]`;
|
|
1065
|
+
if (!t3.unicodeSupport && (!n3 || !n3.unicodeSupport) && e5.host && !se2(e5.host) && (t3.domainHost || n3 && n3.domainHost) && r3 === false && !i3 && p2(e5.host)) try {
|
|
1066
|
+
e5.host = new URL(`http://` + e5.host).hostname;
|
|
1067
|
+
} catch (t4) {
|
|
1068
|
+
return e5.error = e5.error || `Host's domain name can not be converted to ASCII: ` + t4, true;
|
|
1069
|
+
}
|
|
1070
|
+
return false;
|
|
1071
|
+
}
|
|
1072
|
+
function D2(e5, t3) {
|
|
1073
|
+
let r3 = Object.assign({}, t3), i3 = { scheme: void 0, userinfo: void 0, host: ``, port: void 0, path: ``, query: void 0, fragment: void 0 }, s4 = false, l3 = false, u3 = false, p3 = false, ee2 = false, te2 = false, _4 = false;
|
|
1074
|
+
r3.reference === `suffix` && (e5 = r3.scheme ? r3.scheme + `:` + e5 : `//` + e5);
|
|
1075
|
+
let v4 = e5.match(ae2);
|
|
1076
|
+
v4 !== null && v4[1].indexOf(`\\`) !== -1 && (i3.error = `URI authority must not contain a literal backslash.`, s4 = true);
|
|
1077
|
+
let re3 = e5.match(C2);
|
|
1078
|
+
if (re3 !== null) {
|
|
1079
|
+
let e6 = re3[1], t4 = e6.replace(/[\t\n\r]/g, ``);
|
|
1080
|
+
t4.length >= 2 && (t4.slice(0, 2) === `//` ? e6.length !== t4.length && (i3.error = i3.error || `URI authority introducer must not contain whitespace.`, s4 = true) : (i3.error = i3.error || `URI authority must not contain a literal backslash.`, s4 = true));
|
|
1081
|
+
}
|
|
1082
|
+
let y4 = e5.match(ie2);
|
|
1083
|
+
if (y4) {
|
|
1084
|
+
if (i3.scheme = y4[1], i3.userinfo = y4[3], i3.host = y4[4], i3.port = parseInt(y4[5], 10), i3.path = y4[6] || ``, i3.query = y4[7], i3.fragment = y4[8], i3.scheme !== void 0) {
|
|
1085
|
+
let e6 = unescape(i3.scheme);
|
|
1086
|
+
ne2.test(e6) ? i3.scheme = e6.toLowerCase() : (i3.error = i3.error || g2, te2 = true);
|
|
1087
|
+
}
|
|
1088
|
+
l3 = T2(y4), l3 && (i3.error = i3.error || `URI contains malformed percent-encoding.`), isNaN(i3.port) && (i3.port = y4[5]);
|
|
1089
|
+
let t4 = oe2(i3, y4);
|
|
1090
|
+
if (t4 !== void 0 && (i3.error = i3.error || t4, s4 = true), i3.host) if (f2(i3.host) === false) {
|
|
1091
|
+
let e6 = se2(i3.host), t5 = i3.host.indexOf(`[`) !== -1 || i3.host.indexOf(`]`) !== -1, r4 = n2(i3.host);
|
|
1092
|
+
_4 = r4.isIPV6 || r4.isIPVFuture === true, ee2 = t5 && (!e6 || r4.error === true), i3.host = _4 ? r4.host : r4.host.toLowerCase(), _4 && r4.isIPV6 === true && i3.host.indexOf(`%`) !== -1 && (i3.ipv6Zone = i3.host.slice(i3.host.indexOf(`%`) + 1)), ee2 && (i3.error = i3.error || `URI host is malformed.`, s4 = true);
|
|
1093
|
+
} else _4 = true;
|
|
1094
|
+
i3.scheme === void 0 && i3.userinfo === void 0 && i3.host === void 0 && i3.port === void 0 && i3.query === void 0 && !i3.path ? i3.reference = `same-document` : i3.scheme === void 0 ? i3.reference = `relative` : i3.fragment === void 0 ? i3.reference = `absolute` : i3.reference = `uri`, r3.reference && r3.reference !== `suffix` && r3.reference !== i3.reference && (i3.error = i3.error || `URI is not a ` + r3.reference + ` reference.`);
|
|
1095
|
+
let v5 = h2(r3.scheme || i3.scheme);
|
|
1096
|
+
if (ee2 || (p3 = E2(i3, r3, v5, _4)), e5.indexOf(`%`) !== -1 && i3.host !== void 0 && !ee2) {
|
|
1097
|
+
let e6 = _4 ? i3.host : a3(i3.host, true);
|
|
1098
|
+
_4 || (e6 = a3(e6.toLowerCase())), i3.host = d2(e6, _4);
|
|
1099
|
+
}
|
|
1100
|
+
(!v5 || v5 && !v5.skipNormalize) && (i3.path &&= o3(i3.path), i3.query &&= c3(i3.query), i3.fragment &&= c3(i3.fragment)), v5 && v5.parse && (v5.parse(i3, r3), v5 === m2.urn && i3.nid === void 0 && (u3 = true));
|
|
1101
|
+
} else i3.error = i3.error || `URI can not be parsed.`;
|
|
1102
|
+
return { parsed: i3, malformedAuthorityOrPort: s4, malformedPercentEncoding: l3, malformedSchemeSpecific: u3, malformedHost: p3, malformedScheme: te2 };
|
|
1103
|
+
}
|
|
1104
|
+
function O2(e5, t3) {
|
|
1105
|
+
return D2(e5, t3).parsed;
|
|
1106
|
+
}
|
|
1107
|
+
function k2(e5, t3) {
|
|
1108
|
+
return A2(e5, t3).normalized;
|
|
1109
|
+
}
|
|
1110
|
+
function A2(e5, t3) {
|
|
1111
|
+
let { parsed: n3, malformedAuthorityOrPort: r3, malformedPercentEncoding: i3, malformedSchemeSpecific: a4, malformedHost: o4, malformedScheme: s4 } = D2(e5, t3);
|
|
1112
|
+
return { normalized: r3 || i3 || a4 || o4 || s4 ? e5 : S2(n3, t3), malformedAuthorityOrPort: r3, malformedPercentEncoding: i3, malformedSchemeSpecific: a4, malformedHost: o4, malformedScheme: s4 };
|
|
1113
|
+
}
|
|
1114
|
+
function ce2(e5, t3) {
|
|
1115
|
+
if (typeof e5 != `string` && typeof e5 != `object`) return;
|
|
1116
|
+
let n3;
|
|
1117
|
+
try {
|
|
1118
|
+
n3 = typeof e5 == `string` ? e5 : S2(e5, t3);
|
|
1119
|
+
} catch {
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
let { normalized: r3, malformedAuthorityOrPort: i3, malformedPercentEncoding: a4, malformedSchemeSpecific: o4, malformedHost: s4, malformedScheme: c4 } = A2(n3, t3);
|
|
1123
|
+
return i3 || a4 || o4 || s4 || c4 ? void 0 : r3;
|
|
1124
|
+
}
|
|
1125
|
+
let le2 = { SCHEMES: m2, normalize: v3, resolve: re2, resolveComponent: b3, equal: x2, serialize: S2, parse: O2 };
|
|
1126
|
+
t2.exports = le2, t2.exports.default = le2, t2.exports.fastUri = le2;
|
|
1127
|
+
}))();
|
|
1128
|
+
var g = /(#)+$/;
|
|
1129
|
+
var _2 = /#$/;
|
|
1130
|
+
var v2 = /^[^:]+:\/\/[^/]+\//;
|
|
1131
|
+
var re = /#.*$/;
|
|
1132
|
+
function y2(e4, t2) {
|
|
1133
|
+
return t2 == null ? e4?.replace(_2, ``) ?? `#` : e4 == null || e4 === `#` ? t2?.replace(_2, ``) : t2[0] === `#` ? e4[0] === `/` ? t2 : `${e4.replace(re, ``)}${t2.replace(g, ``)}` : v2.test(t2) ? t2.replace(_2, ``) : (0, ne.resolve)(e4, t2 ?? ``) ?? `#`;
|
|
1134
|
+
}
|
|
1135
|
+
function b2(e4, t2, ...n2) {
|
|
1136
|
+
if (t2?.type === `error`) return t2;
|
|
1137
|
+
if (e4?.type === `error` || u(e4) !== u(t2)) return e4;
|
|
1138
|
+
let r2 = x(e4, t2);
|
|
1139
|
+
for (let e5 of n2) delete r2[e5];
|
|
1140
|
+
return r2;
|
|
1141
|
+
}
|
|
1142
|
+
function x(e4, t2, n2) {
|
|
1143
|
+
if (d(e4) && d(t2)) {
|
|
1144
|
+
let n3 = {};
|
|
1145
|
+
return [...Object.keys(e4), ...Object.keys(t2)].filter((e5, t3, n4) => n4.indexOf(e5) === t3).forEach((r3) => n3[r3] = x(e4[r3], t2[r3], r3)), n3;
|
|
1146
|
+
}
|
|
1147
|
+
let r2 = Array.isArray(e4), i2 = Array.isArray(t2);
|
|
1148
|
+
if (r2 && i2) {
|
|
1149
|
+
if (n2 === `required` || n2 === `anyOf`) return e4.concat(t2).filter((e5, t3, n3) => n3.indexOf(e5) === t3);
|
|
1150
|
+
if (n2 === `items` || n2 === `prefixItems`) {
|
|
1151
|
+
let n3 = [];
|
|
1152
|
+
for (let r4 = 0; r4 < t2.length; r4 += 1) d(e4[r4]) && d(t2[r4]) && e4[r4].type === t2[r4].type ? n3[r4] = x(e4[r4], t2[r4]) : n3.push(t2[r4] ?? e4[r4]);
|
|
1153
|
+
return n3;
|
|
1154
|
+
}
|
|
1155
|
+
let r3 = [], i3 = [];
|
|
1156
|
+
for (let n3 = 0; n3 < Math.max(e4.length, t2.length); n3 += 1) d(e4[n3]) && d(t2[n3]) ? r3[n3] = x(e4[n3], t2[n3]) : e4[n3] !== void 0 && t2[n3] !== void 0 ? (r3[n3] = e4[n3], i3.push(t2[n3])) : e4[n3] === void 0 ? t2[n3] !== void 0 && i3.push(t2[n3]) : r3[n3] = e4[n3];
|
|
1157
|
+
return [...r3, ...i3].filter((e5, t3, n3) => n3.indexOf(e5) === t3);
|
|
1158
|
+
}
|
|
1159
|
+
if (n2 === `type` && (r2 || i2)) {
|
|
1160
|
+
if (r2 && e4.includes(t2)) return t2;
|
|
1161
|
+
if (i2 && t2.includes(e4)) return e4;
|
|
1162
|
+
if (r2) return [...e4, t2];
|
|
1163
|
+
if (i2) return [...t2, e4];
|
|
1164
|
+
}
|
|
1165
|
+
return i2 ? t2 : r2 || t2 === void 0 ? e4 : t2;
|
|
1166
|
+
}
|
|
1167
|
+
function S(e4, t2) {
|
|
1168
|
+
return (t2.order ?? 0) - (e4.order ?? 0);
|
|
1169
|
+
}
|
|
1170
|
+
function ie(e4, t2, n2) {
|
|
1171
|
+
if (e4 == null || n2.indexOf(e4) !== t2) return false;
|
|
1172
|
+
let r2 = e4.toJSON?.() ?? e4.name;
|
|
1173
|
+
return n2.find((e5, n3) => (e5.toJSON?.() ?? e5.name) === r2 && n3 === t2);
|
|
1174
|
+
}
|
|
1175
|
+
function ae(e4, t2) {
|
|
1176
|
+
if (e4 == null || t2 == null) return t2 || e4;
|
|
1177
|
+
let n2 = {};
|
|
1178
|
+
return [...Object.keys(e4), ...Object.keys(t2)].filter((e5, t3, n3) => n3.indexOf(e5) === t3).forEach((r2) => {
|
|
1179
|
+
let i2 = w(e4[r2], t2[r2]);
|
|
1180
|
+
j(i2) && (n2[r2] = i2);
|
|
1181
|
+
}), n2;
|
|
1182
|
+
}
|
|
1183
|
+
function C(e4, t2) {
|
|
1184
|
+
return e4 == null || t2 == null ? t2 || e4 : e4.concat(t2).filter((e5, t3, n2) => n2.indexOf(e5) === t3);
|
|
1185
|
+
}
|
|
1186
|
+
function oe(e4, t2) {
|
|
1187
|
+
if (e4 == null || t2 == null) return e4 || t2;
|
|
1188
|
+
let n2 = [...e4], r2 = e4.map((e5) => e5.node.evaluationPath);
|
|
1189
|
+
return t2.forEach((e5) => {
|
|
1190
|
+
r2.includes(e5.node.evaluationPath) || n2.push(e5);
|
|
1191
|
+
}), n2;
|
|
1192
|
+
}
|
|
1193
|
+
function w(e4, t2, ...n2) {
|
|
1194
|
+
if (e4 == null || t2 == null) return e4 || t2;
|
|
1195
|
+
let r2 = {};
|
|
1196
|
+
e4.items && t2.prefixItems || e4.prefixItems && t2.items ? t2.prefixItems ? r2.prefixItems = t2.prefixItems : r2.items = t2.items : (r2.prefixItems = t2.prefixItems ?? e4.prefixItems, r2.items = w(e4.items, t2.items));
|
|
1197
|
+
let i2 = { ...e4, ...t2, ...r2, dynamicId: ge(e4.dynamicId, t2.dynamicId), oneOfIndex: e4.oneOfIndex ?? t2.oneOfIndex, schema: b2(e4.schema, t2.schema, ...n2), parent: e4.parent, resolvers: e4.resolvers.concat(t2.resolvers).filter(ie).sort(S), reducers: e4.reducers.concat(t2.reducers).filter(ie).sort(S), validators: e4.validators.concat(t2.validators).filter(ie).sort(S), additionalProperties: w(e4.additionalProperties, t2.additionalProperties), contains: w(e4.contains, t2.contains), enum: C(e4.enum, t2.enum), if: w(e4.if, t2.if), then: w(e4.then, t2.then), else: w(e4.else, t2.else), not: w(e4.not, t2.not), propertyNames: w(e4.propertyNames, t2.propertyNames), unevaluatedProperties: w(e4.unevaluatedProperties, t2.unevaluatedProperties), unevaluatedItems: w(e4.unevaluatedItems, t2.unevaluatedItems), $defs: ae(e4.$defs, t2.$defs), patternProperties: oe(e4.patternProperties, t2.patternProperties), properties: ae(e4.properties, t2.properties), required: C(e4.required, t2.required) };
|
|
1198
|
+
function a3(e5) {
|
|
1199
|
+
let t3 = e5.toJSON?.() ?? e5.name;
|
|
1200
|
+
return i2.schema?.[t3] === void 0 ? (i2[t3] = void 0, false) : true;
|
|
1201
|
+
}
|
|
1202
|
+
return n2?.forEach((e5) => i2[e5] = void 0), i2.resolvers = i2.resolvers.filter(a3), i2.reducers = i2.reducers.filter(a3), i2.validators = i2.validators.filter(a3), i2;
|
|
1203
|
+
}
|
|
1204
|
+
function se(e4, ...t2) {
|
|
1205
|
+
let n2 = {};
|
|
1206
|
+
return Object.keys(e4).forEach((r2) => {
|
|
1207
|
+
t2.includes(r2) || (n2[r2] = e4[r2]);
|
|
1208
|
+
}), n2;
|
|
1209
|
+
}
|
|
1210
|
+
function T(e4, ...t2) {
|
|
1211
|
+
if (!d(e4) || t2.length === 0) return e4;
|
|
1212
|
+
let n2 = {};
|
|
1213
|
+
return t2.forEach((t3) => {
|
|
1214
|
+
e4[t3] !== void 0 && (n2[t3] = e4[t3]);
|
|
1215
|
+
}), n2;
|
|
1216
|
+
}
|
|
1217
|
+
function E(e4, t2 = {}) {
|
|
1218
|
+
return e4.replace(/\{\{(\w+)\}\}/g, (e5, n2) => {
|
|
1219
|
+
let r2 = t2[n2];
|
|
1220
|
+
return r2 == null ? `` : typeof r2 == `object` ? JSON.stringify(r2) : String(r2);
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
function D(e4, t2, n2, r2) {
|
|
1224
|
+
if (P(e4)) return [e4];
|
|
1225
|
+
r2.push({ pointer: n2, node: e4 });
|
|
1226
|
+
let i2 = e4.schema;
|
|
1227
|
+
if (i2 === true) return [];
|
|
1228
|
+
if (i2 === false) return [e4.createError(`invalid-data-error`, { value: t2, pointer: n2, schema: e4.schema })];
|
|
1229
|
+
let a3 = [];
|
|
1230
|
+
for (let i3 of e4.validators) {
|
|
1231
|
+
let o3 = i3({ node: e4, data: t2, pointer: n2, path: r2 });
|
|
1232
|
+
Array.isArray(o3) ? a3.push(...o3) : o3 && a3.push(o3);
|
|
1233
|
+
}
|
|
1234
|
+
return s2(a3);
|
|
1235
|
+
}
|
|
1236
|
+
var O = Object.prototype.hasOwnProperty;
|
|
1237
|
+
var k = (e4, t2) => !(e4[t2] === void 0 || !O.call(e4, t2));
|
|
1238
|
+
function A(e4, t2) {
|
|
1239
|
+
if (d(e4) && k(e4, `${t2}`) || Array.isArray(e4)) return e4[t2];
|
|
1240
|
+
}
|
|
1241
|
+
function ce(e4, t2, n2 = {}) {
|
|
1242
|
+
n2.path = n2.path ?? [], n2.withSchemaWarning = n2.withSchemaWarning ?? false, n2.pointer = n2.pointer ?? `#`;
|
|
1243
|
+
let r2 = this, a3 = o(e4);
|
|
1244
|
+
if (a3.length === 0) {
|
|
1245
|
+
let e5 = r2.resolveRef(n2);
|
|
1246
|
+
return P(e5) ? { node: void 0, error: e5 } : { node: e5, error: void 0 };
|
|
1247
|
+
}
|
|
1248
|
+
let o3 = `#`, s3 = r2;
|
|
1249
|
+
for (let e5 = 0, r3 = a3.length; e5 < r3; e5 += 1) {
|
|
1250
|
+
o3 = `${o3}/${a3[e5]}`;
|
|
1251
|
+
let r4 = s3.getNodeChild(a3[e5], t2, { ...n2, pointer: o3 });
|
|
1252
|
+
if (r4.error || r4.node == null) return r4;
|
|
1253
|
+
s3 = r4.node, t2 = A(t2, a3[e5]);
|
|
1254
|
+
}
|
|
1255
|
+
let { node: c3, error: l2 } = s3.resolveRef(n2).reduceNode(t2);
|
|
1256
|
+
return P(l2) ? { node: void 0, error: l2 } : j(c3) ? { node: c3, error: void 0 } : { error: void 0 };
|
|
1257
|
+
}
|
|
1258
|
+
function le(e4, t2, n2 = {}) {
|
|
1259
|
+
n2.path = n2.path ?? [], n2.withSchemaWarning = n2.withSchemaWarning ?? false, n2.pointer = n2.pointer ?? `#`;
|
|
1260
|
+
let { path: r2, pointer: i2 } = n2, a3 = this;
|
|
1261
|
+
if (a3.reducers.length) {
|
|
1262
|
+
let n3 = a3.reduceNode(t2, { key: e4, path: r2, pointer: i2 });
|
|
1263
|
+
if (n3.error) return n3;
|
|
1264
|
+
j(n3.node) && (a3 = n3.node);
|
|
1265
|
+
}
|
|
1266
|
+
for (let n3 of a3.resolvers) {
|
|
1267
|
+
let o3 = n3({ data: t2, key: e4, node: a3 });
|
|
1268
|
+
if (P(o3)) return { node: void 0, error: o3 };
|
|
1269
|
+
if (j(o3)) return { node: o3.resolveRef({ pointer: i2, path: r2 }), error: void 0 };
|
|
1270
|
+
}
|
|
1271
|
+
return n2.createSchema === true ? { node: a3.compileSchema(a3.createSchema(A(t2, e4)), `${a3.evaluationPath}/additional`, `${a3.schemaLocation}/additional`), error: void 0 } : n2.withSchemaWarning === true ? { node: void 0, error: a3.createError(`schema-warning`, { pointer: i2, value: t2, schema: a3.schema, key: e4 }) } : { node: void 0 };
|
|
1272
|
+
}
|
|
1273
|
+
var { DYNAMIC_PROPERTIES: ue, REGEX_FLAGS: de, DECLARATOR_ONEOF: fe, VALID_ANNOTATION_KEYWORDS: pe } = c2;
|
|
1274
|
+
function j(e4) {
|
|
1275
|
+
return d(e4) && Array.isArray(e4?.reducers) && Array.isArray(e4?.resolvers);
|
|
1276
|
+
}
|
|
1277
|
+
function he(e4, t2) {
|
|
1278
|
+
if (!Array.isArray(e4) || e4.length === 0) throw Error(`Missing drafts in 'compileSchema({ $schema: "${t2}" })'`);
|
|
1279
|
+
return e4.length === 1 ? e4[0] : e4.find((e5) => new RegExp(e5.$schemaRegEx, de).test(t2)) ?? e4[e4.length - 1];
|
|
1280
|
+
}
|
|
1281
|
+
function ge(e4, t2) {
|
|
1282
|
+
return e4 == t2 ? e4 ?? `` : e4 == null || t2 == null ? (e4 || t2) ?? `` : e4.startsWith(t2) ? e4 : t2.startsWith(e4) ? t2 : `${e4}+${t2}`;
|
|
1283
|
+
}
|
|
1284
|
+
var _e = { compileSchema(e4, t2, n2, i2) {
|
|
1285
|
+
let a3 = this;
|
|
1286
|
+
t2 ??= a3.evaluationPath;
|
|
1287
|
+
let o3 = t2.split(`/$ref`)[0], c3 = { lastIdPointer: a3.lastIdPointer, context: a3.context, parent: a3, evaluationPath: t2, dynamicId: ge(a3.dynamicId, i2), schemaLocation: n2 ?? b(a3.schemaLocation, o3), reducers: [], resolvers: [], validators: [], schema: e4, ..._e };
|
|
1288
|
+
return !M(e4) && !N(e4) ? (c3.schemaValidation = [c3.createError(`schema-error`, { pointer: n2 ?? t2, schema: e4, value: void 0, message: `JSON schema must be object or boolean - reveived: '${e4}'` })], c3) : (c3.schemaValidation = s2(be(c3).filter((e5) => e5 != null)), c3);
|
|
1289
|
+
}, createError(e4, t2, n2) {
|
|
1290
|
+
let r2 = this, i2 = n2;
|
|
1291
|
+
if (i2 === void 0) {
|
|
1292
|
+
let n3 = r2.schema?.errorMessages?.[e4] ?? r2.context.errors[e4];
|
|
1293
|
+
if (typeof n3 == `function`) return n3(t2);
|
|
1294
|
+
i2 = E(n3 ?? name, t2);
|
|
1295
|
+
}
|
|
1296
|
+
return { type: `error`, code: e4, message: i2, data: t2 };
|
|
1297
|
+
}, createAnnotation(e4, t2, n2) {
|
|
1298
|
+
let r2 = this, i2 = n2;
|
|
1299
|
+
if (i2 === void 0) {
|
|
1300
|
+
let n3 = r2.schema?.errorMessages?.[e4] ?? r2.context.errors[e4];
|
|
1301
|
+
if (typeof n3 == `function`) return n3(t2);
|
|
1302
|
+
i2 = E(n3 ?? name, t2);
|
|
1303
|
+
}
|
|
1304
|
+
return { type: `annotation`, code: e4, message: i2, data: t2 };
|
|
1305
|
+
}, createSchema: f, getChildSelection(e4) {
|
|
1306
|
+
let t2 = this;
|
|
1307
|
+
return t2.context.methods.getChildSelection(t2, e4);
|
|
1308
|
+
}, getNode: ce, getNodeChild: le, getNodeRef(e4) {
|
|
1309
|
+
return this.compileSchema({ $ref: e4 }, `$dynamic`).resolveRef();
|
|
1310
|
+
}, getNodeRoot() {
|
|
1311
|
+
return this.context.rootNode;
|
|
1312
|
+
}, getDraftVersion() {
|
|
1313
|
+
return this.context.version;
|
|
1314
|
+
}, getData(e4, t2) {
|
|
1315
|
+
let n2 = this, r2 = { recursionLimit: 1, ...n2.context.getDataDefaultOptions, cache: {}, ...t2 ?? {} };
|
|
1316
|
+
return n2.context.methods.getData(n2, e4, r2);
|
|
1317
|
+
}, reduceNode(e4, t2 = {}) {
|
|
1318
|
+
let n2 = this, { key: r2 = `missing-key`, pointer: i2 = n2.evaluationPath, path: a3 } = t2;
|
|
1319
|
+
if (n2.schema === false) return { node: n2, error: void 0 };
|
|
1320
|
+
if (n2.schema === true) {
|
|
1321
|
+
let t3 = n2.compileSchema(f(e4), n2.evaluationPath, n2.schemaLocation);
|
|
1322
|
+
return a3?.push({ pointer: i2, node: n2 }), { node: t3, error: void 0 };
|
|
1323
|
+
}
|
|
1324
|
+
let o3, s3 = n2.compileSchema(n2.schema, n2.evaluationPath, n2.schemaLocation), c3 = n2.reducers;
|
|
1325
|
+
for (let t3 of c3) {
|
|
1326
|
+
let c4 = t3({ data: e4, key: r2, node: n2, pointer: i2, path: a3 ?? [] });
|
|
1327
|
+
if (P(c4)) return { node: void 0, error: c4 };
|
|
1328
|
+
if (c4) {
|
|
1329
|
+
if (c4.schema === false) {
|
|
1330
|
+
o3 = false;
|
|
1331
|
+
break;
|
|
1332
|
+
}
|
|
1333
|
+
s3 = w(s3, c4);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
return o3 === false ? { node: { ...n2, schema: false, reducers: [] }, error: void 0 } : (s3 !== n2 && a3?.push({ pointer: i2, node: n2 }), s3.schema = se(s3.schema, fe, ...ue), ue.forEach((e5) => s3[e5] = void 0), { node: s3, error: void 0 });
|
|
1337
|
+
}, validate(e4, t2 = `#`, n2 = []) {
|
|
1338
|
+
let r2 = this, i2 = D(r2, e4, t2, n2) ?? [], a3 = [], o3 = [], c3 = s2(Array.isArray(i2) ? i2 : [i2]).filter(P), l2 = [];
|
|
1339
|
+
return s2(Array.isArray(i2) ? i2 : [i2]).forEach((e5) => {
|
|
1340
|
+
if (P(e5)) {
|
|
1341
|
+
if (r2.context.throwOnInvalidRef && e5.code === `ref-error`) {
|
|
1342
|
+
let t3 = Error(`Invalid $ref: ` + e5.message);
|
|
1343
|
+
throw t3.data = a3, t3;
|
|
1344
|
+
}
|
|
1345
|
+
a3.push(e5);
|
|
1346
|
+
} else e5 instanceof Promise ? l2.push(e5.then(s2)) : Ce(e5) && o3.push(e5);
|
|
1347
|
+
}), { valid: c3.length === 0, errors: a3, annotations: o3, errorsAsync: l2 };
|
|
1348
|
+
}, addRemoteSchema(e4, n2) {
|
|
1349
|
+
M(n2) && (n2.$id = y2(n2.$id || e4));
|
|
1350
|
+
let r2 = this, { context: i2 } = r2, a3 = M(n2) ? r2.context.draft ?? n2.$schema : void 0, o3 = he(i2.drafts, a3 ?? i2.rootNode.schema?.$schema), c3 = { evaluationPath: `#`, lastIdPointer: `#`, schemaLocation: `#`, dynamicId: ``, reducers: [], resolvers: [], validators: [], schema: n2, context: { ...i2, refs: {}, anchors: {}, ...copy(T(o3, `methods`, `keywords`, `version`, `formats`, `errors`)) }, ..._e };
|
|
1351
|
+
c3.context.rootNode = c3, c3.context.remotes[y2(e4)] = c3;
|
|
1352
|
+
let l2 = be(c3).filter((e5) => e5 != null);
|
|
1353
|
+
l2 = s2(l2);
|
|
1354
|
+
let u2 = [], d2 = [], f2 = c3.context.rootNode.$id ?? y2(e4);
|
|
1355
|
+
return l2.forEach((e5) => {
|
|
1356
|
+
P(e5) ? (e5.data.schemaId = f2, u2.push(e5)) : Ce(e5) && (e5.data.schemaId = f2, d2.push(e5));
|
|
1357
|
+
}), r2.schemaErrors = (r2.schemaErrors ?? []).concat(u2), r2.schemaAnnotations = (r2.schemaAnnotations ?? []).concat(d2), r2;
|
|
1358
|
+
}, resolveRef(e4) {
|
|
1359
|
+
throw Error(`method 'resolveRef' is not implemented`);
|
|
1360
|
+
}, toSchemaNodes() {
|
|
1361
|
+
return h(this);
|
|
1362
|
+
}, toDataNodes(e4, t2) {
|
|
1363
|
+
let n2 = this;
|
|
1364
|
+
return n2.context.methods.toDataNodes(n2, e4, t2);
|
|
1365
|
+
}, toJSON() {
|
|
1366
|
+
let e4 = this;
|
|
1367
|
+
return { ...e4, context: void 0, errors: void 0, parent: e4.parent?.evaluationPath };
|
|
1368
|
+
} };
|
|
1369
|
+
var ve = [`$ref`, `if`, `$defs`];
|
|
1370
|
+
var ye = [`draft-04`, `draft-06`, `draft-07`];
|
|
1371
|
+
function be(e4) {
|
|
1372
|
+
if (e4.schema.$ref && ye.includes(e4.context.version)) return e4.context.keywords.filter(({ keyword: e5 }) => ve.includes(e5)).map((t3) => xe(t3, e4));
|
|
1373
|
+
let t2 = Object.keys(e4.schema), n2 = e4.context.keywords.filter(({ keyword: e5 }) => ve.includes(e5) || t2.includes(e5)).map((t3) => xe(t3, e4));
|
|
1374
|
+
return t2.filter((t3) => !t3.startsWith(`x-`) && !pe.includes(t3) && e4.context.keywords.find((e5) => e5.keyword === t3) == null).forEach((t3) => {
|
|
1375
|
+
n2.push(e4.createAnnotation(`unknown-keyword-warning`, { $id: e4.$id, pointer: `${e4.schemaLocation}/${t3}`, schema: e4.schema, value: t3, draft: e4.getDraftVersion() }));
|
|
1376
|
+
}), n2;
|
|
1377
|
+
}
|
|
1378
|
+
function xe(e4, t2) {
|
|
1379
|
+
let n2 = e4.parse?.(t2);
|
|
1380
|
+
return e4.reduce && e4.addReduce?.(t2) && t2.reducers.push(e4.reduce), e4.resolve && e4.addResolve?.(t2) && t2.resolvers.push(e4.resolve), e4.validate && e4.addValidate?.(t2) && t2.validators.push(e4.validate), n2;
|
|
1381
|
+
}
|
|
1382
|
+
function M(e4) {
|
|
1383
|
+
return d(e4);
|
|
1384
|
+
}
|
|
1385
|
+
function N(e4) {
|
|
1386
|
+
return typeof e4 == `boolean`;
|
|
1387
|
+
}
|
|
1388
|
+
function Se(e4) {
|
|
1389
|
+
return d(e4) && (e4?.type && e4?.code && e4?.data) != null;
|
|
1390
|
+
}
|
|
1391
|
+
function Ce(e4) {
|
|
1392
|
+
return d(e4) && e4.type === `annotation`;
|
|
1393
|
+
}
|
|
1394
|
+
function P(e4) {
|
|
1395
|
+
return d(e4) && e4.type === `error`;
|
|
1396
|
+
}
|
|
1397
|
+
function F(e4) {
|
|
1398
|
+
return typeof e4 == `number`;
|
|
1399
|
+
}
|
|
1400
|
+
var we = /(#)+$/g;
|
|
1401
|
+
var Te = [``, null, `#`];
|
|
1402
|
+
function Ee(e4) {
|
|
1403
|
+
if (Te.includes(e4)) return [];
|
|
1404
|
+
if (e4 = e4.replace(we, ``), e4.indexOf(`#`) === -1) return [e4.replace(/(#|\/)+$/g, ``)];
|
|
1405
|
+
if (e4.indexOf(`#`) === 0) return [e4.replace(we, ``)];
|
|
1406
|
+
let t2 = e4.split(`#`);
|
|
1407
|
+
return t2[0] = t2[0].replace(/(#|\/)+$/g, ``), t2[1] = `#${t2[1].replace(we, ``)}`, t2;
|
|
1408
|
+
}
|
|
1409
|
+
var De = { id: `$ref`, keyword: `$ref`, order: 10, parse: ke, addReduce: (e4) => e4.$ref != null || e4.schema.$dynamicRef != null, reduce: Ae, addValidate: ({ schema: e4 }) => e4.$ref != null || e4.$dynamicRef != null, validate: Me };
|
|
1410
|
+
function Oe(e4, t2) {
|
|
1411
|
+
e4.context.refs[t2] ?? (e4.context.refs[t2] = e4);
|
|
1412
|
+
}
|
|
1413
|
+
function ke(e4) {
|
|
1414
|
+
e4.resolveRef = je;
|
|
1415
|
+
let t2 = y2(e4.parent?.$id, e4.schema?.$id);
|
|
1416
|
+
e4.$id = t2, e4.lastIdPointer = e4.parent?.lastIdPointer ?? `#`, t2 !== e4.parent?.$id && e4.evaluationPath !== `#` && (e4.lastIdPointer = e4.evaluationPath), e4.lastIdPointer !== `#` && e4.evaluationPath.startsWith(e4.lastIdPointer) && Oe(e4, y2(t2, `#${e4.evaluationPath.replace(e4.lastIdPointer, ``)}`)), Oe(e4, y2(e4.context.rootNode.$id, e4.evaluationPath));
|
|
1417
|
+
let r2 = e4.schema.$anchor;
|
|
1418
|
+
if (r2) {
|
|
1419
|
+
let n2 = `${t2.replace(/#$/, ``)}#${r2}`;
|
|
1420
|
+
e4.context.anchors[n2] ?? (e4.context.anchors[n2] = e4);
|
|
1421
|
+
}
|
|
1422
|
+
let i2 = e4.schema.$dynamicAnchor;
|
|
1423
|
+
if (i2) {
|
|
1424
|
+
let n2 = `${t2.replace(/#$/, ``)}#${i2}`;
|
|
1425
|
+
e4.context.dynamicAnchors[n2] ?? (e4.context.dynamicAnchors[n2] = e4);
|
|
1426
|
+
}
|
|
1427
|
+
if (e4.schema.$ref && (e4.$ref = y2(t2, e4.schema.$ref), e4.$ref.startsWith(`/`) && (e4.$ref = `#${e4.$ref}`)), e4.$ref?.startsWith(`#/$defs/`) && s(e4.getNodeRoot().schema, e4.$ref) == null) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/$ref`, schema: e4.schema, value: e4.schema.$ref, message: `Invalid $ref to missing target '${e4.schema.ref}'` });
|
|
1428
|
+
}
|
|
1429
|
+
function Ae({ node: e4, data: t2, key: n2, pointer: r2, path: i2 }) {
|
|
1430
|
+
if (e4 == null) return;
|
|
1431
|
+
let a3 = e4.resolveRef({ pointer: r2, path: i2 });
|
|
1432
|
+
if (a3 == null) return e4.createError(`ref-error`, { ref: e4.schema.$ref ?? e4.schema.$dynamicRef, pointer: r2, schema: e4.schema, value: t2 });
|
|
1433
|
+
if (a3.schemaLocation === e4.schemaLocation) return a3;
|
|
1434
|
+
let { node: o3, error: s3 } = w(e4, a3).reduceNode(t2, { key: n2, pointer: r2, path: i2 });
|
|
1435
|
+
return o3 ?? s3;
|
|
1436
|
+
}
|
|
1437
|
+
function je({ pointer: e4, path: t2 = [] } = {}) {
|
|
1438
|
+
if (this.schema.$dynamicRef) {
|
|
1439
|
+
let n3 = Ne(this, t2);
|
|
1440
|
+
return P(n3) || t2.push({ pointer: e4, node: n3 }), n3;
|
|
1441
|
+
}
|
|
1442
|
+
if (this.$ref == null) return this;
|
|
1443
|
+
let n2 = Pe(this);
|
|
1444
|
+
return j(n2) && t2.push({ pointer: e4, node: n2 }), n2;
|
|
1445
|
+
}
|
|
1446
|
+
function Me({ node: e4, data: t2, pointer: n2 = `#`, path: r2 }) {
|
|
1447
|
+
let i2 = e4.resolveRef({ pointer: n2, path: r2 });
|
|
1448
|
+
return i2 == null ? e4.createError(`ref-error`, { ref: e4.schema.$ref ?? e4.schema.$dynamicRef, pointer: n2, schema: e4.schema, value: t2 }) : D(i2, t2, n2, r2);
|
|
1449
|
+
}
|
|
1450
|
+
function Ne(e4, t2) {
|
|
1451
|
+
let n2 = t2, r2 = y2(e4.$id, e4.schema.$dynamicRef);
|
|
1452
|
+
if (e4.context.dynamicAnchors[r2] == null && e4.context.anchors[r2]) return I(e4.context.anchors[r2], e4);
|
|
1453
|
+
for (let t3 of n2) {
|
|
1454
|
+
if (t3.node.schema.$dynamicAnchor) return I(t3.node, e4);
|
|
1455
|
+
let n3 = e4.schema.$dynamicRef.split(`#`).pop(), r3 = y2(t3.node.$id, `#${n3}`);
|
|
1456
|
+
if (e4.context.dynamicAnchors[r3]) return I(e4.context.dynamicAnchors[r3], e4);
|
|
1457
|
+
}
|
|
1458
|
+
return Pe(e4, r2);
|
|
1459
|
+
}
|
|
1460
|
+
function I(e4, t2) {
|
|
1461
|
+
let n2 = e4.schema;
|
|
1462
|
+
return d(e4.schema) && (n2 = { ...se(e4.schema, `$id`), ...T(t2.schema, ...c2.PROPERTIES_TO_MERGE) }), e4.compileSchema(n2, `${t2.evaluationPath}/$ref`, e4.schemaLocation);
|
|
1463
|
+
}
|
|
1464
|
+
function Pe(e4, t2 = e4?.$ref) {
|
|
1465
|
+
if (t2 == null) return e4;
|
|
1466
|
+
if (e4.context.refs[t2]) return I(e4.context.refs[t2], e4);
|
|
1467
|
+
if (e4.context.anchors[t2]) return I(e4.context.anchors[t2], e4);
|
|
1468
|
+
if (e4.context.dynamicAnchors[t2]) return I(e4.context.dynamicAnchors[t2], e4);
|
|
1469
|
+
let r2 = Ee(t2);
|
|
1470
|
+
if (r2.length === 0) return e4.createError(`ref-error`, { ref: t2, pointer: e4.evaluationPath, schema: e4.schema, value: void 0 });
|
|
1471
|
+
if (r2.length === 1) {
|
|
1472
|
+
let t3 = r2[0];
|
|
1473
|
+
if (e4.context.remotes[t3]) return I(e4.context.remotes[t3], e4);
|
|
1474
|
+
if (t3[0] === `#`) {
|
|
1475
|
+
let r3 = e4.context.rootNode.schema, i2 = s(r3, t3);
|
|
1476
|
+
if (i2) return e4.compileSchema(i2, `${e4.evaluationPath}/$ref`, t3);
|
|
1477
|
+
}
|
|
1478
|
+
return e4.createError(`ref-error`, { ref: t3, pointer: e4.evaluationPath, schema: e4.schema, value: void 0 });
|
|
1479
|
+
}
|
|
1480
|
+
if (r2.length === 2) {
|
|
1481
|
+
let n2 = r2[0];
|
|
1482
|
+
if (e4.context.remotes[n2] && e4 !== e4.context.remotes[n2]) {
|
|
1483
|
+
let i2 = e4.context.remotes[n2], a3 = Pe(i2, t2);
|
|
1484
|
+
if (a3 || (a3 = Pe(i2, r2[1]), a3)) return a3;
|
|
1485
|
+
}
|
|
1486
|
+
if (e4.context.refs[n2]) {
|
|
1487
|
+
let a3 = e4.context.refs[n2], o3 = o(r2[1]), s3 = a3;
|
|
1488
|
+
for (let n3 of o3) if (s3 = s3[n3 === `definitions` ? `$defs` : n3], s3 == null) return e4.createError(`ref-error`, { ref: t2, pointer: e4.evaluationPath, schema: e4.schema, value: void 0, host: r2[0], local: r2[1] });
|
|
1489
|
+
return s3;
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
return e4.createError(`ref-error`, { ref: t2, pointer: e4.evaluationPath, schema: e4.schema, value: void 0 });
|
|
1493
|
+
}
|
|
1494
|
+
function L(e4, ...t2) {
|
|
1495
|
+
return t2.reduce((e5, t3) => (t3.schemaValidation && e5.push(...t3.schemaValidation), e5), e4);
|
|
1496
|
+
}
|
|
1497
|
+
var Fe = { id: `$defs`, keyword: `$defs`, parse: Ie };
|
|
1498
|
+
function Ie(e4) {
|
|
1499
|
+
let t2 = [];
|
|
1500
|
+
return e4.schema.$defs && (d(e4.schema.$defs) ? (e4.$defs = e4.$defs ?? {}, Object.keys(e4.schema.$defs).forEach((n2) => {
|
|
1501
|
+
e4.$defs[n2] = e4.compileSchema(e4.schema.$defs[n2], `${e4.evaluationPath}/$defs/${Le(n2)}`, `${e4.schemaLocation}/$defs/${n2}`), L(t2, e4.$defs[n2]);
|
|
1502
|
+
})) : t2.push(e4.createError(`schema-error`, { pointer: e4.schemaLocation, schema: e4.schema, value: e4.schema.$defs, message: `$defs must be an object - received: ${typeof e4.schema.$defs}` }))), e4.schema.definitions && (d(e4.schema.definitions) || t2.push(e4.createError(`schema-error`, { pointer: e4.schemaLocation, schema: e4.schema, value: e4.schema.$defs, message: `definitions must be an object - received: ${typeof e4.schema.definitions}` })), e4.$defs = e4.$defs ?? {}, Object.keys(e4.schema.definitions).forEach((n2) => {
|
|
1503
|
+
e4.$defs[n2] = e4.compileSchema(e4.schema.definitions[n2], `${e4.evaluationPath}/definitions/${Le(n2)}`, `${e4.schemaLocation}/definitions/${Le(n2)}`), L(t2, e4.$defs[n2]);
|
|
1504
|
+
})), t2;
|
|
1505
|
+
}
|
|
1506
|
+
function Le(e4) {
|
|
1507
|
+
return e4 = e4.replace(/~/g, `~0`), e4 = e4.replace(/\//g, `~1`), encodeURIComponent(e4);
|
|
1508
|
+
}
|
|
1509
|
+
var Re = { id: `$ref`, keyword: `$ref`, parse: ze, addValidate: ({ schema: e4 }) => e4.$ref != null, validate: Be };
|
|
1510
|
+
function ze(e4) {
|
|
1511
|
+
let t2 = e4.parent?.$id;
|
|
1512
|
+
if (e4.schema?.$ref ?? (t2 = y2(e4.parent?.$id, e4.schema?.$id)), e4.$id = t2, e4.lastIdPointer = e4.parent?.lastIdPointer ?? `#`, e4.resolveRef = je, e4.context.refs[t2] ?? (e4.context.refs[t2] = e4), t2 !== e4.parent?.$id && (e4.lastIdPointer = e4.evaluationPath), e4.lastIdPointer !== `#` && e4.evaluationPath.startsWith(e4.lastIdPointer)) {
|
|
1513
|
+
let n2 = `#${e4.evaluationPath.replace(e4.lastIdPointer, ``)}`;
|
|
1514
|
+
e4.context.refs[y2(t2, n2)] = e4;
|
|
1515
|
+
} else e4.context.refs[y2(t2, e4.evaluationPath)] = e4;
|
|
1516
|
+
e4.context.refs[y2(e4.context.rootNode.$id, e4.evaluationPath)] = e4, e4.schema.$ref && (e4.$ref = y2(t2, e4.schema.$ref));
|
|
1517
|
+
}
|
|
1518
|
+
function Be({ node: e4, data: t2, pointer: n2 = `#`, path: r2 }) {
|
|
1519
|
+
let i2 = Ve(e4, n2, r2);
|
|
1520
|
+
return j(i2) ? D(i2, t2, n2, r2) : e4.createError(`ref-error`, { ref: e4.schema.$ref, pointer: n2, schema: e4.schema, value: t2 });
|
|
1521
|
+
}
|
|
1522
|
+
function Ve(e4, t2, n2) {
|
|
1523
|
+
let r2 = e4.resolveRef({ pointer: t2, path: n2 });
|
|
1524
|
+
return j(r2) ? r2 !== e4 && r2 ? Ve(r2, t2, n2) : e4 : e4.createError(`ref-error`, { ref: e4.schema.$ref, pointer: t2, schema: e4.schema, value: void 0 });
|
|
1525
|
+
}
|
|
1526
|
+
var He = { id: `$ref`, keyword: `$ref`, parse: We, addValidate: ({ schema: e4 }) => e4.$ref != null, validate: Re.validate };
|
|
1527
|
+
function Ue(e4, t2) {
|
|
1528
|
+
e4.context.refs[t2] ?? (e4.context.refs[t2] = e4);
|
|
1529
|
+
}
|
|
1530
|
+
function We(e4) {
|
|
1531
|
+
let t2 = e4.parent?.$id;
|
|
1532
|
+
if (e4.schema?.$ref == null && e4.schema?.id && (t2 = y2(e4.parent?.$id, e4.schema.id)), e4.$id = t2, e4.lastIdPointer = e4.parent?.lastIdPointer ?? `#`, e4.resolveRef = Ge, e4.context.refs[t2] ?? (e4.context.refs[t2] = e4), t2 !== e4.parent?.$id && (e4.lastIdPointer = e4.evaluationPath), e4.lastIdPointer !== `#` && e4.evaluationPath.startsWith(e4.lastIdPointer)) {
|
|
1533
|
+
let n2 = `#${e4.evaluationPath.replace(e4.lastIdPointer, ``)}`;
|
|
1534
|
+
Ue(e4, y2(t2, n2));
|
|
1535
|
+
} else Ue(e4, y2(t2, e4.evaluationPath));
|
|
1536
|
+
Ue(e4, y2(e4.context.rootNode.$id, e4.evaluationPath)), e4.schema.$ref && (e4.$ref = y2(t2, e4.schema.$ref));
|
|
1537
|
+
}
|
|
1538
|
+
function Ge({ pointer: e4, path: t2 } = {}) {
|
|
1539
|
+
if (this.$ref == null) return this;
|
|
1540
|
+
let n2 = qe(this);
|
|
1541
|
+
return j(n2) && t2?.push({ pointer: e4, node: n2 }), n2;
|
|
1542
|
+
}
|
|
1543
|
+
function Ke(e4, t2 = e4.evaluationPath) {
|
|
1544
|
+
let n2 = d(e4.schema) ? se(e4.schema, `id`) : e4.schema;
|
|
1545
|
+
return e4.compileSchema(n2, `${t2}/$ref`, n2.schemaLocation);
|
|
1546
|
+
}
|
|
1547
|
+
function qe(e4, t2 = e4?.$ref) {
|
|
1548
|
+
if (t2 == null) return e4;
|
|
1549
|
+
if (e4.context.refs[t2]) return Ke(e4.context.refs[t2], e4.evaluationPath);
|
|
1550
|
+
if (e4.context.anchors[t2]) return Ke(e4.context.anchors[t2], e4.evaluationPath);
|
|
1551
|
+
let n2 = Ee(t2);
|
|
1552
|
+
if (n2.length === 0) return e4.createError(`ref-error`, { ref: t2, pointer: e4.evaluationPath, schema: e4.schema, value: void 0 });
|
|
1553
|
+
if (n2.length === 1) {
|
|
1554
|
+
let t3 = n2[0];
|
|
1555
|
+
return e4.context.remotes[t3] ? Ke(e4.context.remotes[t3], e4.evaluationPath) : e4.createError(`ref-error`, { ref: t3, pointer: e4.evaluationPath, schema: e4.schema, value: void 0 });
|
|
1556
|
+
}
|
|
1557
|
+
if (n2.length === 2) {
|
|
1558
|
+
let r2 = n2[0];
|
|
1559
|
+
if (e4.context.remotes[r2] && e4 !== e4.context.remotes[r2]) {
|
|
1560
|
+
let i3 = e4.context.remotes[r2], a3 = qe(i3, t2);
|
|
1561
|
+
if (a3 || (a3 = qe(i3, n2[1]), a3)) return a3;
|
|
1562
|
+
}
|
|
1563
|
+
let i2 = n2[0];
|
|
1564
|
+
if (e4.context.refs[i2]) {
|
|
1565
|
+
let t3 = e4.context.refs[i2], r3 = n2[1].split(`$defs/`).pop();
|
|
1566
|
+
if (r3 && t3?.$defs) return qe(t3.$defs[r3]);
|
|
1567
|
+
}
|
|
1568
|
+
return;
|
|
1569
|
+
}
|
|
1570
|
+
return e4.createError(`ref-error`, { ref: t2, pointer: e4.evaluationPath, schema: e4.schema, value: void 0 });
|
|
1571
|
+
}
|
|
1572
|
+
var Je = `additionalItems`;
|
|
1573
|
+
var Ye = { id: Je, keyword: Je, order: -10, parse: Xe, addResolve: (e4) => e4.items != null, resolve: Ze, addValidate: ({ schema: e4 }) => e4[Je] != null && e4[Je] !== true && Array.isArray(e4.items), validate: Qe };
|
|
1574
|
+
function Xe(e4) {
|
|
1575
|
+
let { schema: t2, evaluationPath: n2, schemaLocation: r2 } = e4;
|
|
1576
|
+
if (t2.additionalItems == null || t2.additionalItems === false) return;
|
|
1577
|
+
let i2 = t2[Je];
|
|
1578
|
+
if (!(d(i2) || i2 === true)) return e4.createError(`schema-error`, { pointer: n2, schema: t2, value: void 0, message: `Keyword '${Je}' must be an object or a boolean - received '${typeof i2}'` });
|
|
1579
|
+
if (!Array.isArray(t2.items)) return e4.createAnnotation(`schema-error`, { pointer: n2, schema: t2, value: void 0, message: `Keyword '${Je}' is only evaluated with a given items-array` });
|
|
1580
|
+
e4.items = e4.compileSchema(t2.additionalItems, `${n2}/additionalItems`, `${r2}/additionalItems`);
|
|
1581
|
+
}
|
|
1582
|
+
function Ze({ node: e4, key: t2, data: n2 }) {
|
|
1583
|
+
if (Array.isArray(n2)) {
|
|
1584
|
+
let r2 = A(n2, t2), { node: i2, error: a3 } = e4.items.reduceNode(r2);
|
|
1585
|
+
return i2 ?? a3;
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
function Qe({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
1589
|
+
let { schema: i2 } = e4;
|
|
1590
|
+
if (!Array.isArray(t2) || t2.length === 0 || Array.isArray(i2.items) && i2.items.length >= t2.length) return;
|
|
1591
|
+
let a3 = Array.isArray(i2.items) ? i2.items.length : 0, o3 = [];
|
|
1592
|
+
for (let s3 = a3; s3 < t2.length; s3 += 1) {
|
|
1593
|
+
let a4 = t2[s3];
|
|
1594
|
+
if (e4.items) {
|
|
1595
|
+
let t3 = D(e4.items, a4, `${n2}/${s3}`, r2);
|
|
1596
|
+
t3 && o3.push(...t3);
|
|
1597
|
+
} else i2.additionalItems === false && o3.push(e4.createError(`additional-items-error`, { key: s3, pointer: `${n2}/${s3}`, value: t2, schema: i2 }));
|
|
1598
|
+
}
|
|
1599
|
+
return o3;
|
|
1600
|
+
}
|
|
1601
|
+
var $e = { id: `additionalProperties`, keyword: `additionalProperties`, order: -10, parse: et, addResolve: ({ schema: e4 }) => e4.additionalProperties != null, resolve: tt, addValidate: ({ schema: e4 }) => e4.additionalProperties !== true && e4.additionalProperties != null && !(e4.additionalProperties === false && d(e4.patternProperties)), validate: nt };
|
|
1602
|
+
function et(e4) {
|
|
1603
|
+
let { schema: t2, evaluationPath: n2, schemaLocation: r2 } = e4;
|
|
1604
|
+
if (!(t2.additionalProperties == null || N(t2.additionalProperties))) return d(t2.additionalProperties) ? (e4.additionalProperties = e4.compileSchema(t2.additionalProperties, `${n2}/additionalProperties`, `${r2}/additionalProperties`), e4.additionalProperties.schemaValidation) : e4.createError(`schema-error`, { pointer: e4.schemaLocation, schema: t2, value: t2.additionalProperties, message: `keyword 'additionalProperties' must be a valid JSON Schema - receoved: ${typeof t2.additionalProperties}` });
|
|
1605
|
+
}
|
|
1606
|
+
function tt({ node: e4, data: t2, key: n2 }) {
|
|
1607
|
+
let r2 = A(t2, n2);
|
|
1608
|
+
if (e4.additionalProperties) {
|
|
1609
|
+
let { node: t3, error: n3 } = e4.additionalProperties.reduceNode(r2);
|
|
1610
|
+
return t3 ?? n3;
|
|
1611
|
+
}
|
|
1612
|
+
if (e4.schema.additionalProperties === false) return e4.createError(`no-additional-properties-error`, { pointer: `${n2}`, schema: e4.schema, value: A(t2, n2), property: `${n2}` });
|
|
1613
|
+
}
|
|
1614
|
+
function nt({ node: e4, data: t2, pointer: n2 = `#`, path: r2 }) {
|
|
1615
|
+
if (!d(t2)) return;
|
|
1616
|
+
let { schema: i2 } = e4, a3 = [], o3 = Object.keys(t2).filter((e5) => c2.propertyBlacklist.includes(e5) === false), s3 = e4.patternProperties;
|
|
1617
|
+
Array.isArray(s3) && (o3 = o3.filter((e5) => {
|
|
1618
|
+
for (let t3 of s3) if (t3.pattern.test(e5)) return false;
|
|
1619
|
+
return true;
|
|
1620
|
+
}));
|
|
1621
|
+
let l2 = e4.properties ? Object.keys(e4.properties) : [];
|
|
1622
|
+
return o3.filter((e5) => l2.indexOf(e5) === -1).forEach((o4) => {
|
|
1623
|
+
let s4 = A(t2, o4);
|
|
1624
|
+
if (s4 !== void 0) if (d(e4.additionalProperties)) {
|
|
1625
|
+
let t3 = D(e4.additionalProperties, s4, `${n2}/${o4}`, r2);
|
|
1626
|
+
t3 && a3.push(...t3);
|
|
1627
|
+
} else a3.push(e4.createError(`no-additional-properties-error`, { pointer: `${n2}/${o4}`, schema: i2, value: t2, property: o4, properties: l2 }));
|
|
1628
|
+
}), a3;
|
|
1629
|
+
}
|
|
1630
|
+
var R = `allOf`;
|
|
1631
|
+
var rt = { id: R, keyword: R, parse: it, addReduce: (e4) => e4[R] != null, reduce: at, addValidate: (e4) => e4[R] != null, validate: ot };
|
|
1632
|
+
function it(e4) {
|
|
1633
|
+
let { schema: t2, evaluationPath: n2, schemaLocation: r2 } = e4;
|
|
1634
|
+
if (t2[R] != null) {
|
|
1635
|
+
if (!Array.isArray(t2[R])) return e4.createError(`schema-error`, { pointer: r2, schema: t2, value: t2[R], message: `Keyword '${R}' must be an array - received '${typeof t2[R]}'` });
|
|
1636
|
+
if (t2[R].length !== 0) return e4[R] = t2[R].map((t3, i2) => e4.compileSchema(t3, `${n2}/${R}/${i2}`, `${r2}/${R}/${i2}`)), L([], ...e4[R]);
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
function at({ node: e4, data: t2, key: n2, pointer: r2, path: i2 }) {
|
|
1640
|
+
if (e4[R] == null) return;
|
|
1641
|
+
let a3 = {}, o3 = ``;
|
|
1642
|
+
for (let s3 = 0; s3 < e4[R].length; s3 += 1) {
|
|
1643
|
+
let { node: c3 } = e4[R][s3].reduceNode(t2, { key: n2, pointer: r2, path: i2 });
|
|
1644
|
+
if (c3) {
|
|
1645
|
+
let t3 = c3.dynamicId?.replace(e4.dynamicId, ``) ?? ``, n3 = t3 === `` ? `${R}/${s3}` : t3;
|
|
1646
|
+
o3 += `${o3 === `` ? `` : `,`}${n3}`;
|
|
1647
|
+
let r3 = b2(e4[R][s3].schema, c3.schema);
|
|
1648
|
+
a3 = b2(a3, r3, R, `contains`);
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
return e4.compileSchema(a3, `${e4.evaluationPath}/${o3}`, e4.schemaLocation, `${e4.schemaLocation}(${o3})`);
|
|
1652
|
+
}
|
|
1653
|
+
function ot({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
1654
|
+
if (!Array.isArray(e4[R]) || e4[R].length === 0) return;
|
|
1655
|
+
let i2 = [];
|
|
1656
|
+
return e4[R].forEach((e5) => {
|
|
1657
|
+
i2.push(...D(e5, t2, n2, r2));
|
|
1658
|
+
}), i2;
|
|
1659
|
+
}
|
|
1660
|
+
var z = `anyOf`;
|
|
1661
|
+
var st = { id: z, keyword: z, parse: ct, addReduce: (e4) => e4[z] != null, reduce: lt, addValidate: (e4) => e4[z] != null, validate: ut };
|
|
1662
|
+
function ct(e4) {
|
|
1663
|
+
let { schema: t2, evaluationPath: n2, schemaLocation: r2 } = e4;
|
|
1664
|
+
if (t2[z] != null) {
|
|
1665
|
+
if (!Array.isArray(t2[z])) return e4.createError(`schema-error`, { pointer: r2, schema: t2, value: t2[z], message: `Keyword '${z}' must be an array - received '${typeof t2[z]}'` });
|
|
1666
|
+
if (t2[z].length !== 0) return e4[z] = t2[z].map((t3, i2) => e4.compileSchema(t3, `${n2}/${z}/${i2}`, `${r2}/${z}/${i2}`)), L([], ...e4[z]);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
function lt({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
1670
|
+
if (e4[z] == null) return;
|
|
1671
|
+
let i2 = {}, a3 = ``;
|
|
1672
|
+
for (let o3 = 0; o3 < e4[z].length; o3 += 1) if (D(e4[z][o3], t2, n2, r2).length === 0) {
|
|
1673
|
+
let { node: n3 } = e4[z][o3].reduceNode(t2);
|
|
1674
|
+
if (n3) {
|
|
1675
|
+
let t3 = n3.dynamicId?.replace(e4.dynamicId, ``) ?? ``, r3 = t3 === `` ? `${z}/${o3}` : t3;
|
|
1676
|
+
a3 += `${a3 === `` ? `` : `,`}${r3}`;
|
|
1677
|
+
let s3 = b2(e4[z][o3].schema, n3.schema);
|
|
1678
|
+
i2 = b2(i2, s3, z);
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
return e4.compileSchema(i2, `${e4.evaluationPath}${a3}`, e4.schemaLocation, `${e4.schemaLocation}(${a3})`);
|
|
1682
|
+
}
|
|
1683
|
+
function ut({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
1684
|
+
if (e4[z] != null) {
|
|
1685
|
+
for (let i2 of e4[z]) if (D(i2, t2, n2, r2).length === 0) return;
|
|
1686
|
+
return e4.createError(`any-of-error`, { pointer: n2, schema: e4.schema, value: t2, anyOf: e4.schema[z] });
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
var B = `contains`;
|
|
1690
|
+
var dt = { id: B, keyword: B, parse: ft, addValidate: (e4) => e4[B] != null, validate: pt, addReduce: (e4) => e4[B] != null, reduce: ({ node: e4 }) => e4.compileSchema({ items: { anyOf: [e4[B].schema] } }, e4.evaluationPath, e4.schemaLocation) };
|
|
1691
|
+
function ft(e4) {
|
|
1692
|
+
let t2 = e4.schema[B];
|
|
1693
|
+
if (t2 != null) return M(t2) || N(t2) ? (e4[B] = e4.compileSchema(t2, `${e4.evaluationPath}/${B}`), e4[B].schemaValidation) : e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${B}`, schema: e4.schema, value: t2, message: `Keyword '${B}' must be a valid JSON Schema - received '${typeof t2}'` });
|
|
1694
|
+
}
|
|
1695
|
+
function pt({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
1696
|
+
let { schema: i2 } = e4;
|
|
1697
|
+
if (!Array.isArray(t2)) return;
|
|
1698
|
+
if (i2.contains === false) return e4.createError(`contains-array-error`, { pointer: n2, value: t2, schema: i2 });
|
|
1699
|
+
if (i2.contains === true) return Array.isArray(t2) && t2.length === 0 ? e4.createError(`contains-any-error`, { pointer: n2, value: t2, schema: i2 }) : void 0;
|
|
1700
|
+
if (!d(i2.contains) || !Array.isArray(t2)) return;
|
|
1701
|
+
let a3 = 0;
|
|
1702
|
+
for (let i3 of t2) D(e4.contains, i3, n2, r2).length === 0 && a3++;
|
|
1703
|
+
let o3 = i2.maxContains ?? 1 / 0, s3 = i2.minContains ?? 1;
|
|
1704
|
+
if (!(o3 >= a3 && s3 <= a3)) return o3 < a3 ? e4.createError(`contains-max-error`, { pointer: n2, schema: i2, delta: a3 - o3, value: t2 }) : s3 > a3 ? e4.createError(`contains-min-error`, { pointer: n2, schema: i2, delta: s3 - a3, value: t2 }) : e4.createError(`contains-error`, { pointer: n2, schema: i2, value: t2 });
|
|
1705
|
+
}
|
|
1706
|
+
function mt(e4) {
|
|
1707
|
+
return Array.isArray(e4) && e4.find((e5) => typeof e5 != `string`) == null;
|
|
1708
|
+
}
|
|
1709
|
+
var V = `dependentRequired`;
|
|
1710
|
+
var ht = { id: V, keyword: V, parse: gt, addValidate: (e4) => e4[V] != null, validate: _t };
|
|
1711
|
+
function gt(e4) {
|
|
1712
|
+
let { schema: t2 } = e4;
|
|
1713
|
+
if (t2[V] == null) return;
|
|
1714
|
+
if (!d(t2[V])) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${V}`, schema: t2, value: t2[V], message: `Keyword '${V}' must be an object - received '${typeof t2[V]}'` });
|
|
1715
|
+
let n2 = [];
|
|
1716
|
+
e4.dependentRequired = {};
|
|
1717
|
+
for (let r2 of Object.keys(t2[V])) {
|
|
1718
|
+
let i2 = t2[V][r2];
|
|
1719
|
+
mt(i2) ? e4.dependentRequired[r2] = i2 : n2.push(e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${V}/${r2}`, schema: t2, value: i2, message: `Keyword '${V}[string]' must be a string[] - received '${typeof i2}'` }));
|
|
1720
|
+
}
|
|
1721
|
+
return n2;
|
|
1722
|
+
}
|
|
1723
|
+
function _t({ node: e4, data: t2, pointer: n2 = `#` }) {
|
|
1724
|
+
let { dependentRequired: r2 } = e4;
|
|
1725
|
+
if (r2 == null || !d(t2)) return;
|
|
1726
|
+
let i2 = [];
|
|
1727
|
+
return Object.keys(t2).forEach((a3) => {
|
|
1728
|
+
let o3 = r2[a3];
|
|
1729
|
+
if (Array.isArray(o3)) for (let r3 = 0, a4 = o3.length; r3 < a4; r3 += 1) t2[o3[r3]] === void 0 && i2.push(e4.createError(`missing-dependency-error`, { missingProperty: o3[r3], pointer: n2, schema: e4.schema, value: t2 }));
|
|
1730
|
+
}), i2;
|
|
1731
|
+
}
|
|
1732
|
+
var H = `dependentSchemas`;
|
|
1733
|
+
var vt = { id: H, keyword: H, parse: yt, addReduce: (e4) => e4.dependentSchemas != null, reduce: bt, addValidate: (e4) => e4.dependentSchemas != null, validate: xt };
|
|
1734
|
+
function yt(e4) {
|
|
1735
|
+
let { dependentSchemas: t2 } = e4.schema;
|
|
1736
|
+
if (t2 == null) return;
|
|
1737
|
+
if (!d(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${H}`, schema: e4.schema, value: t2, message: `Keyword '${H}' must be an object - received '${typeof t2}'` });
|
|
1738
|
+
if (Object.keys(t2).length === 0) return;
|
|
1739
|
+
let n2 = [], r2 = {};
|
|
1740
|
+
for (let i2 of Object.keys(t2)) {
|
|
1741
|
+
let a3 = t2[i2];
|
|
1742
|
+
d(a3) ? (r2[i2] = e4.compileSchema(a3, `${e4.evaluationPath}/${H}/${i2}`, `${e4.schemaLocation}/${H}/${i2}`), L(n2, r2[i2])) : N(a3) ? r2[i2] = a3 : n2.push(e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${H}/${i2}`, schema: e4.schema, value: a3, message: `Keyword '${H}[string]' must be a valid JSON Schema'` }));
|
|
1743
|
+
}
|
|
1744
|
+
return e4.dependentSchemas = r2, n2;
|
|
1745
|
+
}
|
|
1746
|
+
function bt({ node: e4, data: t2 }) {
|
|
1747
|
+
let { dependentSchemas: n2 } = e4;
|
|
1748
|
+
if (!d(t2) || n2 == null) return e4;
|
|
1749
|
+
let r2, i2 = 0, a3 = `${e4.schemaLocation}(`;
|
|
1750
|
+
return Object.keys(t2).forEach((e5) => {
|
|
1751
|
+
n2[e5] != null && (r2 ??= { properties: {} }, j(n2[e5]) ? r2 = b2(r2, n2[e5].schema) : r2.properties[e5] = n2[e5], a3 += `${i2 ? `,` : ``}${H}/${e5}`, i2++);
|
|
1752
|
+
}), r2 == null ? e4 : (r2 = b2(e4.schema, r2, H), e4.compileSchema(r2, e4.evaluationPath, e4.schemaLocation, `${a3})`));
|
|
1753
|
+
}
|
|
1754
|
+
function xt({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
1755
|
+
let { schema: i2, dependentSchemas: a3 } = e4;
|
|
1756
|
+
if (!d(t2) || a3 == null) return;
|
|
1757
|
+
let o3 = [];
|
|
1758
|
+
return Object.keys(t2).forEach((c3) => {
|
|
1759
|
+
let l2 = a3[c3];
|
|
1760
|
+
if (l2 !== true) {
|
|
1761
|
+
if (l2 === false) {
|
|
1762
|
+
o3.push(e4.createError(`missing-dependency-error`, { pointer: n2, schema: i2, value: t2 }));
|
|
1763
|
+
return;
|
|
1764
|
+
}
|
|
1765
|
+
if (j(l2)) {
|
|
1766
|
+
s2(D(l2, t2, n2, r2), o3);
|
|
1767
|
+
return;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
}), o3;
|
|
1771
|
+
}
|
|
1772
|
+
var U = `dependencies`;
|
|
1773
|
+
var St = { id: U, keyword: U, parse: Ct, order: -9, addReduce: (e4) => e4.schema[U] != null, reduce: wt, addValidate: (e4) => e4.schema[U] != null, validate: Tt };
|
|
1774
|
+
function Ct(e4) {
|
|
1775
|
+
let { dependencies: t2 } = e4.schema;
|
|
1776
|
+
if (!d(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${U}`, schema: e4.schema, value: t2, message: `Keyword '${U}' must be an object - received ${typeof t2}` });
|
|
1777
|
+
let n2 = [];
|
|
1778
|
+
for (let r2 of Object.keys(t2)) {
|
|
1779
|
+
let i2 = t2[r2];
|
|
1780
|
+
M(i2) || N(i2) ? (e4.dependentSchemas = e4.dependentSchemas ?? {}, e4.dependentSchemas[r2] = e4.compileSchema(i2, `${e4.evaluationPath}/${U}/${r2}`, `${e4.schemaLocation}/${U}/${r2}`), L(n2, e4.dependentSchemas[r2])) : mt(i2) ? (e4.dependentRequired = e4.dependentRequired ?? {}, e4.dependentRequired[r2] = i2) : n2.push(e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${U}`, schema: e4.schema, value: t2, message: `Keyword '${U}[string]' must be JSON Schema or string[]` }));
|
|
1781
|
+
}
|
|
1782
|
+
return n2;
|
|
1783
|
+
}
|
|
1784
|
+
function wt({ node: e4, data: t2, key: n2, pointer: r2, path: i2 }) {
|
|
1785
|
+
if (!d(t2) || e4.dependentRequired == null && e4.dependentSchemas == null) return e4;
|
|
1786
|
+
let a3 = e4.compileSchema(e4.schema, e4.evaluationPath, e4.schemaLocation), o3 = a3.schema.required ?? [], s3 = ``, c3 = e4.dependentRequired;
|
|
1787
|
+
c3 && Object.keys(c3).forEach((e5) => {
|
|
1788
|
+
if (!k(t2, e5) && !o3.includes(e5) || c3[e5] == null) return;
|
|
1789
|
+
o3.push(...c3[e5]);
|
|
1790
|
+
let n3 = `${U}/${e5}`;
|
|
1791
|
+
s3 += `${s3 === `` ? `` : `,`}${n3}`;
|
|
1792
|
+
});
|
|
1793
|
+
let l2 = e4.dependentSchemas;
|
|
1794
|
+
return l2 && Object.keys(l2).forEach((c4) => {
|
|
1795
|
+
if (!k(t2, c4) && !o3.includes(c4)) return true;
|
|
1796
|
+
let u2 = l2[c4];
|
|
1797
|
+
if (!j(u2)) return true;
|
|
1798
|
+
Array.isArray(u2.schema.required) && o3.push(...u2.schema.required);
|
|
1799
|
+
let d2 = { ...u2, schema: { ...u2.schema, required: o3 } }.reduceNode(t2, { key: n2, pointer: `${r2}/${U}/${c4}`, path: i2 }).node;
|
|
1800
|
+
a3 = w(a3, d2);
|
|
1801
|
+
let f2 = d2.dynamicId?.replace(e4.dynamicId, ``) ?? ``, p2 = f2 === `` ? `${U}/${c4}` : f2;
|
|
1802
|
+
s3 += `${s3 === `` ? `` : `,`}${p2}`;
|
|
1803
|
+
}), a3 === e4 ? e4 : o3.length === 0 ? a3 : (o3 = a3.schema.required ? a3.schema.required.concat(...o3) : o3, o3 = o3.filter((e5, t3, n3) => n3.indexOf(e5) === t3), a3 = w(a3, a3, U), a3.compileSchema({ ...a3.schema, required: o3 }, a3.evaluationPath, a3.schemaLocation, `${e4.schemaLocation}(${s3})`));
|
|
1804
|
+
}
|
|
1805
|
+
function Tt({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
1806
|
+
if (!d(t2)) return;
|
|
1807
|
+
let i2 = [];
|
|
1808
|
+
return e4.dependentRequired && s2(_t({ node: e4, data: t2, pointer: n2, path: r2 }), i2), e4.dependentSchemas && s2(xt({ node: e4, data: t2, pointer: n2, path: r2 }), i2), i2;
|
|
1809
|
+
}
|
|
1810
|
+
var Et = `deprecated`;
|
|
1811
|
+
var Dt = { id: Et, keyword: Et, parse: Ot, addValidate: (e4) => e4[Et] === true, validate: kt };
|
|
1812
|
+
function Ot(e4) {
|
|
1813
|
+
let t2 = e4.schema[Et];
|
|
1814
|
+
if (t2 != null) {
|
|
1815
|
+
if (typeof t2 != `boolean`) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${Et}`, schema: e4.schema, value: t2, message: `Keyword '${Et}' must be a boolean - received '${typeof t2}'` });
|
|
1816
|
+
e4[Et] = t2;
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
function kt({ node: e4, data: t2, pointer: n2 }) {
|
|
1820
|
+
return [e4.createAnnotation(`deprecated-warning`, { pointer: n2, schema: e4.schema, value: t2 }, e4.schema.deprecatedMessage)];
|
|
1821
|
+
}
|
|
1822
|
+
var W = `enum`;
|
|
1823
|
+
var At = { id: W, keyword: W, parse: jt, addValidate: (e4) => e4.enum != null, validate: Mt };
|
|
1824
|
+
function jt(e4) {
|
|
1825
|
+
let { schema: t2 } = e4;
|
|
1826
|
+
if (t2[W] != null) {
|
|
1827
|
+
if (!Array.isArray(t2[W])) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${W}`, schema: t2, value: t2[W], message: `Keyword '${W}' must be an array - received '${typeof t2[W]}'` });
|
|
1828
|
+
e4.enum = t2[W];
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
function Mt({ node: e4, data: t2, pointer: n2 = `#` }) {
|
|
1832
|
+
if (e4.enum == null) return;
|
|
1833
|
+
let r2 = u(t2);
|
|
1834
|
+
if (r2 === `object` || r2 === `array`) {
|
|
1835
|
+
let n3 = JSON.stringify(t2);
|
|
1836
|
+
for (let t3 of e4.enum) if (JSON.stringify(t3) === n3) return;
|
|
1837
|
+
} else if (e4.enum.includes(t2)) return;
|
|
1838
|
+
return e4.createError(`enum-error`, { pointer: n2, schema: e4.schema, value: t2, values: e4.enum });
|
|
1839
|
+
}
|
|
1840
|
+
var Nt = { "additional-items-error": "Array at `{{pointer}}` may not have an additional item `{{key}}`", "additional-properties-error": "Additional property `{{property}}` on `{{pointer}}` does not match schema `{{schema}}`", "all-of-error": "Value `{{value}}` at `{{pointer}}` does not match schema of `{{allOf}}`", "any-of-error": "Value `{{value}}` at `{{pointer}}` does not match any schema of `{{anyOf}}`", "const-error": "Expected value at `{{pointer}}` to be `{{expected}}`, but value given is `{{value}}`", "contains-any-error": "The array at `{{pointer}}` must contain at least one item", "contains-array-error": "The property at `{{pointer}}` must not be an array", "contains-error": "The array at `{{pointer}}` must contain an element that matches `{{schema}}`", "contains-min-error": "The array at `{{pointer}}` contains {{delta}} too few items matching `{{schema}}`", "contains-max-error": "The array at `{{pointer}}` contains {{delta}} too many items matching `{{schema}}`", "enum-error": "Expected given value `{{value}}` in `{{pointer}}` to be one of `{{values}}`", "exclusive-maximum-error": "Value in `{{pointer}}` is `{{length}}`, but should be at most `{{maximum}}`", "exclusive-minimum-error": "Value in `{{pointer}}` is `{{length}}`, but should be at minimum `{{minimum}}`", "forbidden-property-error": "Property name `{{property}}` at `{{pointer}}` is not allowed", "format-date-error": "Value `{{value}}` at `{{pointer}}` is not a valid date", "format-date-time-error": "Value `{{value}}` at `{{pointer}}` is not a valid date-time", "format-duration-error": "Value `{{value}}` at `{{pointer}}` is not a valid duration", "format-email-error": "Value `{{value}}` at `{{pointer}}` is not a valid email", "format-hostname-error": "Value `{{value}}` at `{{pointer}}` is not a valid hostname", "format-idn-hostname-error": "Value `{{value}}` at `{{pointer}}` is not a valid idn hostname", "format-ipv4-error": "Value `{{value}}` at `{{pointer}}` is not a valid IPv4 address", "format-ipv4-leading-zero-error": `IPv4 addresses starting with zero are invalid, since they are interpreted as octals`, "format-ipv6-error": "Value `{{value}}` at `{{pointer}}` is not a valid IPv6 address", "format-ipv6-leading-zero-error": `IPv6 addresses starting with zero are invalid, since they are interpreted as octals`, "format-iri-error": "Value `{{value}}` at `{{pointer}}` is not a valid iri", "format-iri-reference-error": "Value `{{value}}` at `{{pointer}}` is not a valid iri-reference", "format-json-pointer-error": "Value `{{value}}` at `{{pointer}}` is not a valid json-pointer", "format-regex-error": "Value `{{value}}` at `{{pointer}}` is not a valid regular expression", "format-time-error": "Value `{{value}}` at `{{pointer}}` is not a valid time", "format-uri-error": "Value `{{value}}` at `{{pointer}}` is not a valid uri", "format-uri-reference-error": "Value `{{value}}` at `{{pointer}}` is not a valid uri-reference", "format-uri-template-error": "Value `{{value}}` at `{{pointer}}` is not a valid uri-template", "format-url-error": "Value `{{value}}` at `{{pointer}}` is not a valid url", "format-uuid-error": "Value `{{value}}` at `{{pointer}}` is not a valid uuid", "invalid-data-error": "No value may be specified in `{{pointer}}`", "invalid-property-name-error": "Invalid property name `{{property}}` at `{{pointer}}`", "maximum-error": "Value in `{{pointer}}` is `{{length}}`, but should be `{{maximum}}` at maximum", "max-items-error": "Too many items in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`", "max-length-error": "Value `{{pointer}}` should have a maximum length of `{{maxLength}}`, but got `{{length}}`.", "max-properties-error": "Too many properties in `{{pointer}}`, should be `{{maxProperties}}` at most, but got `{{length}}`", "minimum-error": "Value in `{{pointer}}` is `{{length}}`, but should be `{{minimum}}` at minimum", "min-items-error": "Too few items in `{{pointer}}`, should be at least `{{minItems}}`, but got `{{length}}`", "min-items-one-error": "At least one item is required in `{{pointer}}`", "min-length-error": "Value `{{pointer}}` should have a minimum length of `{{minLength}}`, but got `{{length}}`.", "min-length-one-error": "A value is required in `{{pointer}}`", "missing-one-of-declarator-error": "Missing oneOf declarator `{{declarator}}` in schema `{{schemaLocation}}`", "min-properties-error": "Too few properties in `{{pointer}}`, should be at least `{{minProperties}}`, but got `{{length}}`", "missing-array-item-error": `Array at '{{pointer}}' has a missing item at '{{key}}'`, "missing-dependency-error": "The required propery '{{missingProperty}}' in `{{pointer}}` is missing", "missing-one-of-property-error": "Value at `{{pointer}}` must be object or array and have a property ${oneOfProperty}: ${value}", "multiple-of-error": "Expected `{{value}}` in `{{pointer}}` to be multiple of `{{multipleOf}}`", "multiple-one-of-error": "Value `{{value}}` should not match multiple schemas in oneOf `{{matches}}`", "no-additional-properties-error": "Additional property `{{property}}` in `{{pointer}}` is not allowed", "not-error": "Value `{{value}}` at pointer should not match schema `{{not}}`", "one-of-error": "Value `{{value}}` in `{{pointer}}` does not match any given oneof schema", "one-of-property-error": "Failed finding a matching oneOfProperty schema in `{{pointer}}` where `{{property}}` matches `{{value}}`", "pattern-error": "Value in `{{pointer}}` should match `{{description}}`, but received `{{received}}`", "pattern-properties-error": "Property `{{key}}` does not match any patterns in `{{pointer}}`. Valid patterns are: {{patterns}}", "ref-error": `Could not resolve $ref '{{ref}}' from '{{pointer}}'`, "required-property-error": "The required property `{{key}}` is missing at `{{pointer}}`", "schema-warning": `Failed retrieving a schema from '{{pointer}}' to key '{{key}}'`, "type-error": "Expected `{{value}}` ({{received}}) in `{{pointer}}` to be of type `{{expected}}`", "undefined-value-error": "Value must not be undefined in `{{pointer}}`", "unevaluated-property-error": "Invalid unevaluated property `{{pointer}}`", "unevaluated-items-error": "Invalid unevaluated item `{{pointer}}`", "unique-items-error": "Items in array must be unique. Value `{{value}}` in `{{pointer}}` is a duplicate of {{duplicatePointer}}.", "unknown-property-error": "Could not find a valid schema for property `{{pointer}}` within object", "value-not-empty-error": "A value for `{{property}}` is required at `{{pointer}}`", "deprecated-warning": "Value at `{{pointer}}` is deprecated", "schema-error": `Invalid schema found at {{pointer}}: {{message}}`, "unknown-keyword-warning": `Keyword '{{value}}' is not a valid keyword to draft '{{draft}}'`, "unknown-format-warning": `Format {{value}} is not a valid format` };
|
|
1841
|
+
var Pt = { id: `exclusiveMaximum`, keyword: `exclusiveMaximum`, parse: Ft, addValidate: ({ schema: e4 }) => e4.exclusiveMaximum === true || !isNaN(e4.maximum), validate: It };
|
|
1842
|
+
function Ft(e4) {
|
|
1843
|
+
let { exclusiveMaximum: t2 } = e4.schema;
|
|
1844
|
+
if (t2 != null && typeof t2 != `number` && typeof t2 != `boolean`) return e4.createError(`schema-error`, { pointer: e4.evaluationPath, schema: e4.schema, value: void 0, message: `Keyword 'exclusiveMaximum' must be a number - received '${typeof t2}'` });
|
|
1845
|
+
}
|
|
1846
|
+
function It({ node: e4, data: t2, pointer: n2 }) {
|
|
1847
|
+
if (typeof t2 == `number` && e4.schema.exclusiveMaximum && e4.schema.maximum === t2) return e4.createError(`maximum-error`, { maximum: e4.schema.exclusiveMaximum, length: t2, pointer: n2, schema: e4.schema, value: t2 });
|
|
1848
|
+
}
|
|
1849
|
+
var Lt = { id: `exclusiveMinimum`, keyword: `exclusiveMinimum`, parse: Rt, addValidate: ({ schema: e4 }) => e4.exclusiveMinimum === true || !isNaN(e4.minimum), validate: zt };
|
|
1850
|
+
function Rt(e4) {
|
|
1851
|
+
let { exclusiveMinimum: t2 } = e4.schema;
|
|
1852
|
+
if (t2 != null && typeof t2 != `number` && typeof t2 != `boolean`) return e4.createError(`schema-error`, { pointer: e4.evaluationPath, schema: e4.schema, value: void 0, message: `Keyword 'exclusiveMinimum' must be a number - received '${typeof t2}'` });
|
|
1853
|
+
}
|
|
1854
|
+
function zt({ node: e4, data: t2, pointer: n2 }) {
|
|
1855
|
+
if (typeof t2 == `number` && e4.schema.exclusiveMinimum && e4.schema.minimum === t2) return e4.createError(`minimum-error`, { minimum: e4.schema.exclusiveMinimum, length: t2, pointer: n2, schema: e4.schema, value: t2 });
|
|
1856
|
+
}
|
|
1857
|
+
var Bt = `format`;
|
|
1858
|
+
var Vt = { id: Bt, keyword: Bt, parse: Ht, addValidate: ({ schema: e4 }) => e4?.format != null, validate: Ut };
|
|
1859
|
+
function Ht(e4) {
|
|
1860
|
+
let t2 = e4.schema[Bt];
|
|
1861
|
+
if (t2 != null) {
|
|
1862
|
+
if (typeof t2 != `string`) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${Bt}`, schema: e4.schema, value: t2, message: `Keyword '${Bt}' must be a string - received '${typeof t2}'` });
|
|
1863
|
+
if (e4.context.formats[t2] == null) return e4.createAnnotation(`unknown-format-warning`, { pointer: `${e4.schemaLocation}/${Bt}`, schema: e4.schema, value: t2, message: `Keyword '${Bt}' must be a string - received '${typeof t2}'` });
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
function Ut(e4) {
|
|
1867
|
+
let { node: t2 } = e4, n2 = t2.context.formats[t2.schema.format];
|
|
1868
|
+
return n2?.(e4);
|
|
1869
|
+
}
|
|
1870
|
+
var { REGEX_FLAGS: Wt } = c2;
|
|
1871
|
+
var Gt = /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;
|
|
1872
|
+
var Kt = /^((([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;
|
|
1873
|
+
var qt = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
1874
|
+
var Jt = /^(?<time>(?:([0-1]\d|2[0-3]):[0-5]\d:(?<second>[0-5]\d|60)))(?:\.\d+)?(?<offset>(?:z|[+-]([0-1]\d|2[0-3])(?::?[0-5]\d)?))$/i;
|
|
1875
|
+
var Yt = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1876
|
+
var Xt = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
|
|
1877
|
+
var Zt = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
|
|
1878
|
+
var Qt = /^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/;
|
|
1879
|
+
var $t = { date: ({ node: e4, pointer: t2, data: n2 }) => {
|
|
1880
|
+
let { schema: r2 } = e4;
|
|
1881
|
+
if (typeof n2 != `string` || n2 === ``) return;
|
|
1882
|
+
let i2 = n2.match(qt);
|
|
1883
|
+
if (!i2) return e4.createError(`format-date-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1884
|
+
let a3 = +i2[1], o3 = +i2[2], s3 = +i2[3], c3 = a3 % 4 == 0 && (a3 % 100 != 0 || a3 % 400 == 0);
|
|
1885
|
+
if (!(o3 >= 1 && o3 <= 12 && s3 >= 1 && s3 <= (o3 == 2 && c3 ? 29 : Yt[o3]))) return e4.createError(`format-date-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1886
|
+
}, "date-time": ({ node: e4, pointer: t2, data: n2, path: r2 }) => {
|
|
1887
|
+
let { schema: i2 } = e4;
|
|
1888
|
+
if (typeof n2 != `string` || n2 === ``) return;
|
|
1889
|
+
let a3 = n2.split(/t/i);
|
|
1890
|
+
if (a3.length === 2) {
|
|
1891
|
+
let n3 = $t.date({ node: e4, pointer: t2, data: a3[0], path: r2 }) === void 0, i3 = $t.time({ node: e4, pointer: t2, data: a3[1], path: r2 }) === void 0;
|
|
1892
|
+
if (n3 && i3) return;
|
|
1893
|
+
}
|
|
1894
|
+
return e4.createError(`format-date-time-error`, { value: n2, pointer: t2, schema: i2 });
|
|
1895
|
+
}, duration: ({ node: e4, pointer: t2, data: n2 }) => {
|
|
1896
|
+
if (u(n2) === `string` && (!Qt.test(n2) || /(\d+M)(\d+W)|(\d+Y)(\d+W)/.test(n2))) return e4.createError(`format-duration-error`, { value: n2, pointer: t2, schema: e4.schema });
|
|
1897
|
+
}, email: ({ node: e4, pointer: t2, data: n2 }) => {
|
|
1898
|
+
let { schema: r2 } = e4;
|
|
1899
|
+
if (typeof n2 != `string` || n2 === ``) return;
|
|
1900
|
+
let i2 = n2.lastIndexOf(`@`), a3 = n2.substr(0, i2), o3 = n2.substr(i2 + 1);
|
|
1901
|
+
if (!a3 || !o3 || a3.length > 64 || o3.length > 253) return e4.createError(`format-email-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1902
|
+
let s3 = a3;
|
|
1903
|
+
if (/^".*"$/.test(a3) && (s3 = a3.replace(/(^")|([. @]+)|("$)/g, ``)), s3[0] === `.` || s3.endsWith(`.`) || s3.includes(`..`) || !/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(s3)) return e4.createError(`format-email-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1904
|
+
if (/^\[.*\]$/.test(o3)) {
|
|
1905
|
+
let e5 = o3.substr(1, o3.length - 2);
|
|
1906
|
+
if (Gt.test(e5) || Kt.test(e5) || /IPv6:::[0-9a-f]{1,4}/.test(e5)) return;
|
|
1907
|
+
}
|
|
1908
|
+
if (!/^[a-z0-9.-]+$/i.test(o3) || !o3.split(`.`).every((e5) => /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e5))) return e4.createError(`format-email-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1909
|
+
}, "json-pointer": ({ node: e4, pointer: t2, data: n2 }) => {
|
|
1910
|
+
let { schema: r2 } = e4;
|
|
1911
|
+
if (typeof n2 == `string` && n2 !== `` && !Xt.test(n2)) return e4.createError(`format-json-pointer-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1912
|
+
}, "relative-json-pointer": ({ node: e4, pointer: t2, data: n2 }) => {
|
|
1913
|
+
let { schema: r2 } = e4;
|
|
1914
|
+
if (typeof n2 == `string` && !Zt.test(n2)) return e4.createError(`format-json-pointer-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1915
|
+
}, regex: ({ node: e4, pointer: t2, data: n2 }) => {
|
|
1916
|
+
let { schema: r2 } = e4;
|
|
1917
|
+
if (!(typeof n2 == `object` || typeof n2 == `number` || Array.isArray(n2) || u(n2) === `boolean`)) {
|
|
1918
|
+
if (typeof n2 == `string` && /\\Z$/.test(n2) === false) {
|
|
1919
|
+
try {
|
|
1920
|
+
new RegExp(n2, r2.regexFlags ?? Wt);
|
|
1921
|
+
return;
|
|
1922
|
+
} catch {
|
|
1923
|
+
}
|
|
1924
|
+
return e4.createError(`format-regex-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1925
|
+
}
|
|
1926
|
+
return e4.createError(`format-regex-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1927
|
+
}
|
|
1928
|
+
}, time: ({ node: e4, pointer: t2, data: n2 }) => {
|
|
1929
|
+
let { schema: r2 } = e4;
|
|
1930
|
+
if (typeof n2 != `string` || n2 === ``) return;
|
|
1931
|
+
let i2 = n2.match(Jt);
|
|
1932
|
+
if (!i2) return e4.createError(`format-date-time-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1933
|
+
if (i2.groups?.second === `60`) {
|
|
1934
|
+
if (/23:59:60(z|\+00:00)/i.test(n2)) return;
|
|
1935
|
+
let a3 = i2.groups.time.match(/(\d+):(\d+):/), o3 = i2.groups.offset.match(/(\d+):(\d+)/);
|
|
1936
|
+
if (a3 && o3) {
|
|
1937
|
+
let e5 = parseInt(a3[1]), t3 = parseInt(o3[1]), n3 = parseInt(a3[2]), r3 = parseInt(o3[2]), s3;
|
|
1938
|
+
s3 = /^-/.test(i2.groups.offset) ? (e5 + t3) * 60 + (n3 + r3) : (24 + e5 - t3) * 60 + (n3 - r3);
|
|
1939
|
+
let c3 = Math.floor(s3 / 60), l2 = c3 % 24, u2 = s3 - c3 * 60;
|
|
1940
|
+
if (l2 === 23 && u2 === 59) return;
|
|
1941
|
+
}
|
|
1942
|
+
return e4.createError(`format-date-time-error`, { value: n2, pointer: t2, schema: r2 });
|
|
1943
|
+
}
|
|
1944
|
+
}, url: ({ node: e4, data: t2, pointer: n2 }) => {
|
|
1945
|
+
let { schema: r2 } = e4;
|
|
1946
|
+
if (!(t2 === `` || (0, import_valid_url.isWebUri)(`${t2}`))) return e4.createError(`format-url-error`, { value: t2, pointer: n2, schema: r2 });
|
|
1947
|
+
}, uuid: ({ node: e4, data: t2, pointer: n2 }) => {
|
|
1948
|
+
let { schema: r2 } = e4;
|
|
1949
|
+
if (typeof t2 == `string` && t2 !== `` && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t2)) return e4.createError(`format-uuid-error`, { value: t2, pointer: n2, schema: r2 });
|
|
1950
|
+
} };
|
|
1951
|
+
function en(e4, t2) {
|
|
1952
|
+
if (e4.oneOf) return e4.oneOf.map((e5) => e5.resolveRef());
|
|
1953
|
+
if (e4.items?.oneOf) return e4.items.oneOf.map((e5) => e5.resolveRef());
|
|
1954
|
+
if (e4.prefixItems && e4.prefixItems.length > +t2) {
|
|
1955
|
+
let { node: n3, error: r3 } = e4.getNodeChild(t2);
|
|
1956
|
+
return n3 ? [n3] : r3;
|
|
1957
|
+
}
|
|
1958
|
+
if (e4.schema.additionalItems) {
|
|
1959
|
+
if (e4.schema.additionalItems === true) return [e4.compileSchema({ type: `string` })];
|
|
1960
|
+
if (e4.items) return [e4.items.resolveRef()];
|
|
1961
|
+
}
|
|
1962
|
+
if (e4.prefixItems && e4.prefixItems.length <= +t2) return [];
|
|
1963
|
+
let { node: n2, error: r2 } = e4.getNodeChild(t2);
|
|
1964
|
+
return n2 ? [n2] : r2;
|
|
1965
|
+
}
|
|
1966
|
+
var tn = [`string`, `number`, `integer`, `boolean`, `null`, `array`, `object`];
|
|
1967
|
+
var nn = [`additionalProperties`, `dependencies`, `dependentSchemas`, `dependentRequired`, `maxProperties`, `minProperties`, `patternProperties`, `properties`, `propertyNames`, `required`, `unevaluatedProperties`];
|
|
1968
|
+
var rn = [`contains`, `items`, `maxItems`, `minItems`, `unevaluatedItems`, `uniqueItems`];
|
|
1969
|
+
function G(e4, t2) {
|
|
1970
|
+
let n2 = u(t2), r2 = e4.schema;
|
|
1971
|
+
if (r2 === true) return n2 === `bigint` ? `number` : tn.some((e5) => e5 === n2) ? n2 : void 0;
|
|
1972
|
+
if (!d(r2)) return;
|
|
1973
|
+
let i2 = r2.type;
|
|
1974
|
+
if (Array.isArray(i2)) {
|
|
1975
|
+
if (i2.includes(n2)) return n2;
|
|
1976
|
+
let e5 = u(r2.default);
|
|
1977
|
+
return i2.includes(e5) ? e5 : i2[0];
|
|
1978
|
+
}
|
|
1979
|
+
if (i2) return i2;
|
|
1980
|
+
if (Array.isArray(r2.enum)) {
|
|
1981
|
+
let e5 = r2.enum.map((e6) => u(e6)).filter((e6, t4, n3) => n3.indexOf(e6) === t4);
|
|
1982
|
+
if (e5.includes(n2)) return n2;
|
|
1983
|
+
let t3 = u(r2.default);
|
|
1984
|
+
return e5.includes(t3) ? t3 : e5[0];
|
|
1985
|
+
}
|
|
1986
|
+
let a3 = Object.keys(e4.schema), o3 = a3.filter((e5) => nn.includes(e5)), s3 = a3.filter((e5) => rn.includes(e5));
|
|
1987
|
+
if (o3.length > 0 && o3.length > s3.length) return `object`;
|
|
1988
|
+
if (s3.length > 0 && s3.length > o3.length) return `array`;
|
|
1989
|
+
if (e4.if) return G(e4.if.resolveRef() ?? e4.if, t2);
|
|
1990
|
+
if (e4.allOf) for (let n3 of e4.allOf) {
|
|
1991
|
+
let e5 = G(n3.resolveRef() ?? n3, t2);
|
|
1992
|
+
if (e5) return e5;
|
|
1993
|
+
}
|
|
1994
|
+
if (e4.oneOf) for (let n3 of e4.oneOf) {
|
|
1995
|
+
let e5 = G(n3.resolveRef() ?? n3, t2);
|
|
1996
|
+
if (e5) return e5;
|
|
1997
|
+
}
|
|
1998
|
+
if (e4.anyOf) for (let n3 of e4.anyOf) {
|
|
1999
|
+
let e5 = G(n3.resolveRef() ?? n3, t2);
|
|
2000
|
+
if (e5) return e5;
|
|
2001
|
+
}
|
|
2002
|
+
if (r2.$ref) {
|
|
2003
|
+
let n3 = e4.resolveRef();
|
|
2004
|
+
if (n3) return G(n3, t2);
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
function an(e4) {
|
|
2008
|
+
switch (u(e4)) {
|
|
2009
|
+
case `string`:
|
|
2010
|
+
case `array`:
|
|
2011
|
+
return e4?.length === 0;
|
|
2012
|
+
case `null`:
|
|
2013
|
+
case `undefined`:
|
|
2014
|
+
return true;
|
|
2015
|
+
case `object`:
|
|
2016
|
+
return Object.keys(e4).length === 0;
|
|
2017
|
+
default:
|
|
2018
|
+
return false;
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
var K = `oneOf`;
|
|
2022
|
+
var { DECLARATOR_ONEOF: on } = c2;
|
|
2023
|
+
var sn = { id: K, keyword: K, parse: ln, addReduce: (e4) => e4[K] != null, reduce: un, addValidate: (e4) => e4[K] != null, validate: hn };
|
|
2024
|
+
var cn = { id: `oneOf-fuzzy`, keyword: `oneOf`, parse: ln, addReduce: (e4) => e4.oneOf != null, reduce: pn, addValidate: (e4) => e4.oneOf != null, validate: hn };
|
|
2025
|
+
function ln(e4) {
|
|
2026
|
+
let { schema: t2, evaluationPath: n2, schemaLocation: r2 } = e4;
|
|
2027
|
+
if (t2[K] != null) {
|
|
2028
|
+
if (!Array.isArray(t2[K])) return e4.createError(`schema-error`, { pointer: r2, schema: t2, value: t2[K], message: `Keyword '${K}' must be an array - received '${typeof t2[K]}'` });
|
|
2029
|
+
if (t2[K].length !== 0) return e4[K] = t2[K].map((t3, i2) => e4.compileSchema(t3, `${n2}/${K}/${i2}`, `${r2}/${K}/${i2}`)), L([], ...e4[K]);
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
function un({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2033
|
+
if (e4.oneOf == null) return;
|
|
2034
|
+
if (t2 != null && e4.schema[on]) return dn({ node: e4, data: t2, pointer: n2, path: r2 });
|
|
2035
|
+
let i2 = [], a3 = [];
|
|
2036
|
+
for (let o3 = 0; o3 < e4.oneOf.length; o3 += 1) {
|
|
2037
|
+
let s3 = D(e4.oneOf[o3], t2, n2, r2);
|
|
2038
|
+
s3.length === 0 ? i2.push({ index: o3, node: e4.oneOf[o3] }) : a3.push(...s3);
|
|
2039
|
+
}
|
|
2040
|
+
if (i2.length === 1) {
|
|
2041
|
+
let { node: e5, index: a4 } = i2[0], { node: o3, error: s3 } = e5.reduceNode(t2, { pointer: n2, path: r2 });
|
|
2042
|
+
if (o3) {
|
|
2043
|
+
let t3 = o3.dynamicId?.replace(e5.dynamicId, ``) ?? ``, n3 = t3 === `` ? `oneOf/${a4}` : t3;
|
|
2044
|
+
return o3.oneOfIndex = a4, o3.dynamicId = ge(o3.dynamicId, `+${e5.schemaLocation}(${n3})`), o3;
|
|
2045
|
+
}
|
|
2046
|
+
return s3;
|
|
2047
|
+
}
|
|
2048
|
+
return i2.length, e4.createError(`one-of-error`, { value: JSON.stringify(t2), pointer: n2, schema: e4.schema, oneOf: e4.schema.oneOf, errors: a3 });
|
|
2049
|
+
}
|
|
2050
|
+
function dn({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2051
|
+
if (e4.oneOf == null) return;
|
|
2052
|
+
let i2 = e4.schema[on], a3 = A(t2, i2);
|
|
2053
|
+
if (t2 === void 0 || a3 === void 0) return e4.createError(`missing-one-of-property-error`, { oneOfProperty: i2, pointer: n2, schema: e4.schema, value: t2 });
|
|
2054
|
+
let o3 = [];
|
|
2055
|
+
for (let c3 = 0; c3 < e4.oneOf.length; c3 += 1) {
|
|
2056
|
+
let { node: l2 } = e4.oneOf[c3].getNodeChild(i2, t2);
|
|
2057
|
+
if (!j(l2)) return e4.createError(`missing-one-of-declarator-error`, { declarator: on, oneOfProperty: i2, schemaLocation: e4.oneOf[c3].schemaLocation, pointer: `${n2}/oneOf/${c3}`, schema: e4.schema, value: t2 });
|
|
2058
|
+
let u2 = s2(D(l2, a3, `${n2}/${i2}`, r2));
|
|
2059
|
+
if (u2.length > 0) o3.push(...u2);
|
|
2060
|
+
else {
|
|
2061
|
+
let { node: i3 } = e4.oneOf[c3].reduceNode(t2, { pointer: n2, path: r2 });
|
|
2062
|
+
if (i3) return i3.oneOfIndex = c3, i3;
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
return e4.createError(`one-of-property-error`, { property: i2, value: t2, pointer: n2, schema: e4.schema, errors: o3 });
|
|
2066
|
+
}
|
|
2067
|
+
function fn(e4, t2, n2, r2) {
|
|
2068
|
+
if (t2 == null || e4.properties == null) return -1;
|
|
2069
|
+
let i2 = 0, a3 = Object.keys(e4.properties ?? {});
|
|
2070
|
+
for (let o3 of a3) t2[o3] && D(e4.properties[o3], t2[o3], n2, r2).length === 0 && (i2 += 1);
|
|
2071
|
+
return i2;
|
|
2072
|
+
}
|
|
2073
|
+
function pn({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2074
|
+
if (e4.oneOf == null) return e4;
|
|
2075
|
+
let i2 = un({ node: e4, data: t2, pointer: n2, path: r2 });
|
|
2076
|
+
if (j(i2)) return i2;
|
|
2077
|
+
if (d(t2)) {
|
|
2078
|
+
let i3, a3 = -1, o3 = 0;
|
|
2079
|
+
for (let s4 = 0; s4 < e4.oneOf.length; s4 += 1) {
|
|
2080
|
+
let c4 = e4.oneOf[s4], l2 = fn(c4, t2, n2, r2);
|
|
2081
|
+
o3 < l2 && (o3 = l2, i3 = c4, a3 = s4);
|
|
2082
|
+
}
|
|
2083
|
+
if (i3 === void 0) return e4.createError(`one-of-error`, { value: JSON.stringify(t2), pointer: n2, schema: e4.schema, oneOf: e4.schema.oneOf });
|
|
2084
|
+
let { node: s3, error: c3 } = i3.reduceNode(t2, { pointer: n2, path: r2 });
|
|
2085
|
+
return s3 ? (s3.oneOfIndex = a3, s3) : c3;
|
|
2086
|
+
} else if (Array.isArray(t2)) {
|
|
2087
|
+
let i3, a3 = -1, o3 = 1 / 0;
|
|
2088
|
+
for (let n3 = 0; n3 < e4.oneOf.length; n3 += 1) {
|
|
2089
|
+
let r3 = e4.oneOf[n3], { errors: s4 } = r3.validate(t2), c4 = s4.length;
|
|
2090
|
+
c4 < o3 && (o3 = c4, i3 = r3, a3 = n3);
|
|
2091
|
+
}
|
|
2092
|
+
if (i3 === void 0) return e4.createError(`one-of-error`, { value: JSON.stringify(t2), pointer: n2, schema: e4.schema, oneOf: e4.schema.oneOf });
|
|
2093
|
+
let { node: s3, error: c3 } = i3.reduceNode(t2, { pointer: n2, path: r2 });
|
|
2094
|
+
return s3 ? (s3.oneOfIndex = a3, s3) : c3;
|
|
2095
|
+
}
|
|
2096
|
+
return i2;
|
|
2097
|
+
}
|
|
2098
|
+
function mn({ node: e4, data: t2, pointer: n2 = `#`, path: r2 }) {
|
|
2099
|
+
let { oneOf: i2, schema: a3 } = e4;
|
|
2100
|
+
if (!i2) return;
|
|
2101
|
+
let o3 = a3[on], s3 = A(t2, o3), c3 = [], l2 = [];
|
|
2102
|
+
for (let e5 of i2) {
|
|
2103
|
+
let { node: t3, error: a4 } = e5.getNodeChild(o3, s3);
|
|
2104
|
+
if (t3) {
|
|
2105
|
+
let a5 = D(t3, s3, `${n2}/${o3}`, r2);
|
|
2106
|
+
a5.length > 0 ? l2.push(...a5) : c3.push({ index: i2.indexOf(e5), node: e5 });
|
|
2107
|
+
} else console.log(`jlib oneOf error: failed getting schema for '${o3}' to resolve ${on} in ${n2}/oneOf/${i2.indexOf(e5)}`, a4);
|
|
2108
|
+
}
|
|
2109
|
+
if (c3.length === 1) {
|
|
2110
|
+
let e5 = c3[0];
|
|
2111
|
+
return e5.node.oneOfIndex = e5.index, D(e5.node, t2, n2, r2);
|
|
2112
|
+
}
|
|
2113
|
+
return c3.length > 1 ? e4.createError(`multiple-one-of-error`, { value: t2, pointer: n2, schema: a3, matches: c3 }) : e4.createError(`one-of-error`, { value: JSON.stringify(t2), pointer: n2, schema: a3, oneOf: a3.oneOf, errors: l2 });
|
|
2114
|
+
}
|
|
2115
|
+
function hn({ node: e4, data: t2, pointer: n2 = `#`, path: r2 }) {
|
|
2116
|
+
let { oneOf: i2, schema: a3 } = e4;
|
|
2117
|
+
if (!i2) return;
|
|
2118
|
+
if (a3[on]) return mn({ node: e4, data: t2, pointer: n2, path: r2 });
|
|
2119
|
+
let o3 = [], s3 = [];
|
|
2120
|
+
for (let e5 = 0; e5 < i2.length; e5 += 1) {
|
|
2121
|
+
let a4 = D(i2[e5], t2, n2, r2);
|
|
2122
|
+
a4.length > 0 ? s3.push(...a4) : o3.push({ index: e5, node: i2[e5] });
|
|
2123
|
+
}
|
|
2124
|
+
if (o3.length === 1) {
|
|
2125
|
+
let { node: e5, index: t3 } = o3[0];
|
|
2126
|
+
e5.oneOfIndex = t3;
|
|
2127
|
+
return;
|
|
2128
|
+
}
|
|
2129
|
+
return o3.length > 1 ? e4.createError(`multiple-one-of-error`, { value: t2, pointer: n2, schema: a3, matches: o3 }) : e4.createError(`one-of-error`, { value: JSON.stringify(t2), pointer: n2, schema: a3, oneOf: a3.oneOf, errors: s3 });
|
|
2130
|
+
}
|
|
2131
|
+
var gn = () => false;
|
|
2132
|
+
try {
|
|
2133
|
+
typeof File == `function` && (gn = (e4) => e4 instanceof File);
|
|
2134
|
+
} catch {
|
|
2135
|
+
}
|
|
2136
|
+
function _n(e4, t2) {
|
|
2137
|
+
if (e4.$ref == null) return;
|
|
2138
|
+
t2.cache = t2.cache ?? {};
|
|
2139
|
+
let { cache: n2, recursionLimit: r2 = 1 } = t2, i2 = e4.schemaLocation;
|
|
2140
|
+
if (n2[i2] = n2[i2] ?? {}, n2[i2][e4.$ref] = n2[i2][e4.$ref] ?? 0, n2[i2][e4.$ref] >= r2 && t2.disableRecursionLimit !== true) return false;
|
|
2141
|
+
t2.disableRecursionLimit = false, n2[i2][e4.$ref] += 1;
|
|
2142
|
+
let a3 = e4.resolveRef();
|
|
2143
|
+
if (a3 && a3 !== e4) return a3;
|
|
2144
|
+
}
|
|
2145
|
+
function vn(e4, t2) {
|
|
2146
|
+
return (t2.cache?.[e4.schemaLocation]?.[e4.$ref] ?? -1) < (t2.recursionLimit ?? 1);
|
|
2147
|
+
}
|
|
2148
|
+
function yn(e4, t2) {
|
|
2149
|
+
let n2 = u(t2);
|
|
2150
|
+
if (e4 === void 0 || t2 == null || n2 === e4 || n2 === `number` && e4 === `integer`) return t2;
|
|
2151
|
+
if (e4 === `string`) return JSON.stringify(t2);
|
|
2152
|
+
if (n2 !== `string`) return t2;
|
|
2153
|
+
try {
|
|
2154
|
+
let n3 = JSON.parse(t2);
|
|
2155
|
+
if (u(n3) === e4) return n3;
|
|
2156
|
+
} catch {
|
|
2157
|
+
}
|
|
2158
|
+
return t2;
|
|
2159
|
+
}
|
|
2160
|
+
function bn(e4, t2, n2) {
|
|
2161
|
+
if (n2?.cache == null) throw Error(`Missing options`);
|
|
2162
|
+
if (e4.schema === false || e4.schema === true || gn(t2)) return t2;
|
|
2163
|
+
if (e4.schema?.const !== void 0) return e4.schema?.const;
|
|
2164
|
+
let r2 = e4, i2 = t2;
|
|
2165
|
+
if (Array.isArray(e4.schema.enum) && e4.schema.enum.length > 0 && t2 === void 0) return e4.schema.default ?? e4.schema.enum[0];
|
|
2166
|
+
if (e4.schema.default !== void 0 && i2 === void 0 && (i2 = e4.schema.default), r2.allOf?.length && r2.allOf.forEach((e5) => {
|
|
2167
|
+
i2 = e5.getData(i2, n2) ?? i2;
|
|
2168
|
+
}), r2.anyOf && r2.anyOf?.length > 0 && (i2 = r2.anyOf[0].getData(i2, n2) ?? i2), r2.oneOf && r2.oneOf?.length > 0) if (an(i2)) r2 = w(r2, r2.oneOf[0]);
|
|
2169
|
+
else {
|
|
2170
|
+
let e5 = pn({ node: r2, data: i2, path: [], pointer: `#` });
|
|
2171
|
+
if (P(e5)) {
|
|
2172
|
+
if (i2 != null && n2.removeInvalidData !== true) return i2;
|
|
2173
|
+
r2 = r2.oneOf[0], i2 = void 0;
|
|
2174
|
+
} else r2 = w(r2, e5);
|
|
2175
|
+
}
|
|
2176
|
+
let a3 = _n(r2, n2);
|
|
2177
|
+
if (a3 === false) return i2;
|
|
2178
|
+
j(a3) && (i2 = a3.getData(i2, n2) ?? i2, r2 = a3);
|
|
2179
|
+
let o3 = G(r2, i2), s3 = xn[o3]?.(r2, i2, n2);
|
|
2180
|
+
return s3 === void 0 ? i2 : s3;
|
|
2181
|
+
}
|
|
2182
|
+
var xn = { null: (e4, t2, n2) => Sn(e4, t2, null, n2.useTypeDefaults), string: (e4, t2, n2) => Sn(e4, t2, ``, n2.useTypeDefaults), number: (e4, t2, n2) => Sn(e4, t2, 0, n2.useTypeDefaults), integer: (e4, t2, n2) => Sn(e4, t2, 0, n2.useTypeDefaults), boolean: (e4, t2, n2) => Sn(e4, t2, false, n2.useTypeDefaults), object: (e4, t2, n2) => {
|
|
2183
|
+
let r2 = e4.schema, i2 = r2.default === void 0 ? {} : r2.default, a3 = {}, o3 = n2.extendDefaults === false && r2.default !== void 0 ? [] : r2.required ?? [], s3 = e4.properties;
|
|
2184
|
+
s3 && Object.keys(s3).forEach((e5) => {
|
|
2185
|
+
let r3 = s3[e5], c4 = o3.includes(e5), l3 = A(t2, e5), d2 = t2 === void 0 || l3 === void 0 ? A(i2, e5) : l3;
|
|
2186
|
+
if (d2 !== void 0 || c4 || n2.addOptionalProps) {
|
|
2187
|
+
let t3 = r3.getData(d2, n2), i3 = u(t3);
|
|
2188
|
+
if (n2.removeInvalidData && i3 !== `object` && i3 !== `array` && !r3.validate(t3).valid) return;
|
|
2189
|
+
(t3 !== void 0 || n2.useTypeDefaults !== false) && (a3[e5] = t3);
|
|
2190
|
+
}
|
|
2191
|
+
});
|
|
2192
|
+
let c3 = e4.dependentRequired;
|
|
2193
|
+
d(c3) && Object.keys(c3).forEach((t3) => {
|
|
2194
|
+
let r3 = c3[t3];
|
|
2195
|
+
A(a3, t3) !== void 0 && r3.forEach((t4) => {
|
|
2196
|
+
let { node: r4 } = e4.getNodeChild(t4, a3);
|
|
2197
|
+
r4 && (a3[t4] = r4.getData(A(a3, t4), n2));
|
|
2198
|
+
});
|
|
2199
|
+
});
|
|
2200
|
+
let l2 = e4.dependentSchemas;
|
|
2201
|
+
if (l2 && Object.keys(l2).forEach((e5) => {
|
|
2202
|
+
let r3 = l2[e5];
|
|
2203
|
+
if (a3[e5] !== void 0 && j(r3)) {
|
|
2204
|
+
let e6 = r3.getData(t2 ?? a3, n2);
|
|
2205
|
+
Object.assign(a3, e6);
|
|
2206
|
+
}
|
|
2207
|
+
}), t2) if (n2.removeInvalidData === true && (r2.additionalProperties === false || d(r2.additionalProperties))) {
|
|
2208
|
+
let n3 = e4.additionalProperties;
|
|
2209
|
+
j(n3) && Object.keys(t2).forEach((e5) => {
|
|
2210
|
+
if (a3[e5] == null) {
|
|
2211
|
+
let r3 = A(t2, e5);
|
|
2212
|
+
n3.validate(r3).valid && (a3[e5] = r3);
|
|
2213
|
+
}
|
|
2214
|
+
});
|
|
2215
|
+
} else Object.keys(t2).forEach((r3) => {
|
|
2216
|
+
let i3 = u(r3);
|
|
2217
|
+
if (n2.removeInvalidData && e4.properties && e4.properties[r3] && i3 !== `object` && i3 !== `array`) {
|
|
2218
|
+
let i4 = e4.properties[r3], a4 = i4.getData(A(t2, r3), n2);
|
|
2219
|
+
if (!i4.validate(a4).valid) return;
|
|
2220
|
+
}
|
|
2221
|
+
a3[r3] ?? (a3[r3] = A(t2, r3));
|
|
2222
|
+
});
|
|
2223
|
+
if (e4.if) {
|
|
2224
|
+
let { valid: t3 } = e4.if.validate(a3);
|
|
2225
|
+
if (t3 && e4.then) {
|
|
2226
|
+
let t4 = e4.then.getData(a3, n2);
|
|
2227
|
+
Object.assign(a3, t4);
|
|
2228
|
+
} else if (!t3 && e4.else) {
|
|
2229
|
+
let t4 = e4.else.getData(a3, n2);
|
|
2230
|
+
Object.assign(a3, t4);
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
return { ...i2, ...a3 };
|
|
2234
|
+
}, array: (e4, n2, r2) => {
|
|
2235
|
+
let i2 = e4.schema, a3 = i2.default === void 0 ? [] : i2.default, o3 = Array.isArray(n2) ? [...n2] : a3, s3 = r2.extendDefaults === false && i2.default !== void 0 ? 0 : i2.minItems ?? 0;
|
|
2236
|
+
if (i2.items == null) {
|
|
2237
|
+
if (e4.items) {
|
|
2238
|
+
let t2 = Math.max(s3, o3.length);
|
|
2239
|
+
for (let n3 = 0; n3 < t2; n3 += 1) o3[n3] = e4.items.getData(o3[n3], r2);
|
|
2240
|
+
}
|
|
2241
|
+
return o3 || [];
|
|
2242
|
+
}
|
|
2243
|
+
if (e4.prefixItems) {
|
|
2244
|
+
let t2 = Array.isArray(n2) ? n2 : [], i3 = Math.max(s3 ?? 0, e4.prefixItems.length);
|
|
2245
|
+
for (let n3 = 0; n3 < i3; n3 += 1) {
|
|
2246
|
+
let i4 = e4.prefixItems[n3] ?? e4.items;
|
|
2247
|
+
if (i4 && vn(i4, r2) || t2[n3] !== void 0) {
|
|
2248
|
+
let e5 = i4.getData(o3[n3] == null ? a3[n3] : o3[n3], r2);
|
|
2249
|
+
e5 !== void 0 && (o3[n3] = e5);
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
return o3 || [];
|
|
2253
|
+
}
|
|
2254
|
+
if (e4.items == null) return o3;
|
|
2255
|
+
if (e4.items && vn(e4.items, r2) || Array.isArray(n2) && n2?.length > 0) {
|
|
2256
|
+
let n3 = { ...r2.cache };
|
|
2257
|
+
for (let i3 = 0, c3 = Math.max(s3, o3.length); i3 < c3; i3 += 1) {
|
|
2258
|
+
r2.cache = copy(n3);
|
|
2259
|
+
let s4 = { ...r2, disableRecursionLimit: true }, c4 = e4.items.getData(o3[i3] == null ? a3[i3] : o3[i3], s4);
|
|
2260
|
+
if (c4 === void 0) return o3;
|
|
2261
|
+
o3[i3] = c4;
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
return o3;
|
|
2265
|
+
} };
|
|
2266
|
+
function Sn({ schema: e4 }, t2, n2, r2) {
|
|
2267
|
+
return t2 === void 0 ? e4.const ? e4.const : e4.default === void 0 && Array.isArray(e4.enum) ? e4.enum[0] : e4.default === void 0 && r2 !== false ? n2 : e4.default : yn(e4.type, t2);
|
|
2268
|
+
}
|
|
2269
|
+
var q = `items`;
|
|
2270
|
+
var Cn = { id: q, keyword: q, parse: Tn, addResolve: (e4) => (e4.prefixItems || e4[q]) != null, resolve: wn, addValidate: ({ schema: e4 }) => e4.items != null, validate: En };
|
|
2271
|
+
function wn({ node: e4, key: t2 }) {
|
|
2272
|
+
if (e4.prefixItems?.[t2]) return e4.prefixItems[t2];
|
|
2273
|
+
if (e4.items) return e4.items;
|
|
2274
|
+
}
|
|
2275
|
+
function Tn(e4) {
|
|
2276
|
+
let { schema: t2, evaluationPath: n2 } = e4, r2 = t2[q];
|
|
2277
|
+
if (r2 != null && typeof r2 != `boolean`) {
|
|
2278
|
+
if (d(r2)) {
|
|
2279
|
+
e4.items = e4.compileSchema(r2, `${n2}/${q}`, `${e4.schemaLocation}/${q}`);
|
|
2280
|
+
return;
|
|
2281
|
+
}
|
|
2282
|
+
if (Array.isArray(r2)) {
|
|
2283
|
+
e4.prefixItems = r2.map((t3, r3) => e4.compileSchema(t3, `${n2}/${q}/${r3}`, `${e4.schemaLocation}/${q}/${r3}`));
|
|
2284
|
+
return;
|
|
2285
|
+
}
|
|
2286
|
+
return e4.createError(`schema-error`, { pointer: n2, schema: t2, value: void 0, message: `Keyword '${q}' must be an object or array - received '${typeof r2}'` });
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
function En({ node: e4, data: t2, pointer: n2 = `#`, path: r2 }) {
|
|
2290
|
+
let { schema: i2 } = e4;
|
|
2291
|
+
if (!Array.isArray(t2) || t2.length === 0) return;
|
|
2292
|
+
if (i2.items === false) return Array.isArray(t2) && t2.length === 0 ? void 0 : e4.createError(`invalid-data-error`, { pointer: n2, value: t2, schema: i2 });
|
|
2293
|
+
let a3 = [];
|
|
2294
|
+
if (e4.prefixItems) {
|
|
2295
|
+
for (let i3 = 0; i3 < Math.min(e4.prefixItems.length, t2.length); i3 += 1) {
|
|
2296
|
+
let o3 = t2[i3], s3 = e4.prefixItems[i3], c3 = D(s3, o3, `${n2}/${i3}`, r2);
|
|
2297
|
+
a3.push(...c3);
|
|
2298
|
+
}
|
|
2299
|
+
return a3;
|
|
2300
|
+
}
|
|
2301
|
+
if (e4.items) {
|
|
2302
|
+
for (let i3 = 0; i3 < t2.length; i3 += 1) {
|
|
2303
|
+
let o3 = t2[i3], s3 = D(e4.items, o3, `${n2}/${i3}`, r2);
|
|
2304
|
+
s3 && a3.push(...s3);
|
|
2305
|
+
}
|
|
2306
|
+
return a3;
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
var Dn = `maximum`;
|
|
2310
|
+
var On = { id: Dn, keyword: Dn, parse: kn, addValidate: (e4) => e4.maximum != null, validate: An };
|
|
2311
|
+
function kn(e4) {
|
|
2312
|
+
let t2 = e4.schema[Dn];
|
|
2313
|
+
if (t2 != null) {
|
|
2314
|
+
if (!F(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${Dn}`, schema: e4.schema, value: t2, message: `Keyword '${Dn}' must be a number - received '${typeof t2}'` });
|
|
2315
|
+
e4[Dn] = t2;
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
function An({ node: e4, data: t2, pointer: n2 }) {
|
|
2319
|
+
if (!F(t2)) return;
|
|
2320
|
+
let r2 = e4[Dn], { schema: i2 } = e4;
|
|
2321
|
+
if (r2 && r2 < t2) return e4.createError(`maximum-error`, { maximum: r2, length: t2, value: t2, pointer: n2, schema: i2 });
|
|
2322
|
+
if (r2 && i2.exclusiveMaximum === true && r2 === t2) return e4.createError(`maximum-error`, { maximum: r2, length: t2, pointer: n2, schema: i2, value: t2 });
|
|
2323
|
+
}
|
|
2324
|
+
var jn = `maxItems`;
|
|
2325
|
+
var Mn = { id: jn, keyword: jn, parse: Nn, addValidate: ({ schema: e4 }) => !isNaN(e4.maxItems), validate: Pn };
|
|
2326
|
+
function Nn(e4) {
|
|
2327
|
+
let t2 = e4.schema[jn];
|
|
2328
|
+
if (t2 != null) {
|
|
2329
|
+
if (!F(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${jn}`, schema: e4.schema, value: t2, message: `Keyword '${jn}' must be a number - received '${typeof t2}'` });
|
|
2330
|
+
e4[jn] = t2;
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
function Pn({ node: e4, data: t2, pointer: n2 }) {
|
|
2334
|
+
let { schema: r2 } = e4;
|
|
2335
|
+
if (Array.isArray(t2) && r2.maxItems < t2.length) return e4.createError(`max-items-error`, { maximum: r2.maxItems, length: t2.length, schema: r2, value: t2, pointer: n2 });
|
|
2336
|
+
}
|
|
2337
|
+
function Fn(e4) {
|
|
2338
|
+
let t2 = [], n2 = 0, r2 = e4.length;
|
|
2339
|
+
for (; n2 < r2; ) {
|
|
2340
|
+
let i2 = e4.charCodeAt(n2++);
|
|
2341
|
+
if (i2 >= 55296 && i2 <= 56319 && n2 < r2) {
|
|
2342
|
+
let r3 = e4.charCodeAt(n2++);
|
|
2343
|
+
(r3 & 64512) == 56320 ? t2.push(((i2 & 1023) << 10) + (r3 & 1023) + 65536) : (t2.push(i2), n2--);
|
|
2344
|
+
} else t2.push(i2);
|
|
2345
|
+
}
|
|
2346
|
+
return t2;
|
|
2347
|
+
}
|
|
2348
|
+
var J = `maxLength`;
|
|
2349
|
+
var In = { id: J, keyword: J, parse: Ln, addValidate: (e4) => e4[J] != null, validate: Rn };
|
|
2350
|
+
function Ln(e4) {
|
|
2351
|
+
let t2 = e4.schema[J];
|
|
2352
|
+
if (t2 != null) {
|
|
2353
|
+
if (!F(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${J}`, schema: e4.schema, value: t2, message: `Keyword '${J}' must be a number - received '${typeof t2}'` });
|
|
2354
|
+
e4[J] = t2;
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
function Rn({ node: e4, data: t2, pointer: n2 = `#` }) {
|
|
2358
|
+
if (typeof t2 != `string`) return;
|
|
2359
|
+
let r2 = e4[J], i2 = Fn(t2).length;
|
|
2360
|
+
if (r2 < i2) return e4.createError(`max-length-error`, { maxLength: r2, length: i2, pointer: n2, schema: e4.schema, value: t2 });
|
|
2361
|
+
}
|
|
2362
|
+
var Y = `maxProperties`;
|
|
2363
|
+
var zn = { id: Y, keyword: Y, parse: Bn, addValidate: (e4) => e4[Y] != null, validate: Vn };
|
|
2364
|
+
function Bn(e4) {
|
|
2365
|
+
let t2 = e4.schema[Y];
|
|
2366
|
+
if (t2 != null) {
|
|
2367
|
+
if (!F(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${Y}`, schema: e4.schema, value: t2, message: `Keyword '${Y}' must be a number - received '${typeof t2}'` });
|
|
2368
|
+
e4[Y] = t2;
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
function Vn({ node: e4, data: t2, pointer: n2 = `#` }) {
|
|
2372
|
+
if (!d(t2)) return;
|
|
2373
|
+
let r2 = e4[Y], i2 = Object.keys(t2).length;
|
|
2374
|
+
if (r2 < i2) return e4.createError(`max-properties-error`, { maxProperties: r2, length: i2, pointer: n2, schema: e4.schema, value: t2 });
|
|
2375
|
+
}
|
|
2376
|
+
var Hn = `minimum`;
|
|
2377
|
+
var Un = { id: Hn, keyword: Hn, parse: Wn, addValidate: (e4) => e4[Hn] != null, validate: Gn };
|
|
2378
|
+
function Wn(e4) {
|
|
2379
|
+
let t2 = e4.schema[Hn];
|
|
2380
|
+
if (t2 != null) {
|
|
2381
|
+
if (!F(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${Hn}`, schema: e4.schema, value: t2, message: `Keyword '${Hn}' must be a number - received '${typeof t2}'` });
|
|
2382
|
+
e4[Hn] = t2;
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
function Gn({ node: e4, data: t2, pointer: n2 }) {
|
|
2386
|
+
if (!F(t2)) return;
|
|
2387
|
+
let r2 = e4[Hn];
|
|
2388
|
+
if (r2 > t2 || e4.schema.exclusiveMinimum === true && e4.schema.minimum === t2) return e4.createError(`minimum-error`, { minimum: r2, length: t2, pointer: n2, schema: e4.schema, value: t2 });
|
|
2389
|
+
}
|
|
2390
|
+
var Kn = `minItems`;
|
|
2391
|
+
var qn = { id: Kn, keyword: Kn, parse: Jn, addValidate: (e4) => e4[Kn] != null, validate: Yn };
|
|
2392
|
+
function Jn(e4) {
|
|
2393
|
+
let t2 = e4.schema[Kn];
|
|
2394
|
+
if (t2 != null) {
|
|
2395
|
+
if (!F(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${Kn}`, schema: e4.schema, value: t2, message: `Keyword '${Kn}' must be a number - received '${typeof t2}'` });
|
|
2396
|
+
e4[Kn] = t2;
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
function Yn({ node: e4, data: t2, pointer: n2 }) {
|
|
2400
|
+
if (!Array.isArray(t2)) return;
|
|
2401
|
+
let r2 = e4[Kn];
|
|
2402
|
+
if (r2 > t2.length) return e4.createError(`min-items-error`, { minItems: r2, length: t2.length, pointer: n2, schema: e4.schema, value: t2 });
|
|
2403
|
+
}
|
|
2404
|
+
var Xn = `minLength`;
|
|
2405
|
+
var Zn = { id: Xn, keyword: Xn, parse: Qn, addValidate: (e4) => e4[Xn] != null, validate: $n };
|
|
2406
|
+
function Qn(e4) {
|
|
2407
|
+
let t2 = e4.schema[Xn];
|
|
2408
|
+
if (t2 != null) {
|
|
2409
|
+
if (!F(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${Xn}`, schema: e4.schema, value: t2, message: `Keyword '${Xn}' must be a number - received '${typeof t2}'` });
|
|
2410
|
+
e4[Xn] = t2;
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
function $n({ node: e4, data: t2, pointer: n2 = `#` }) {
|
|
2414
|
+
if (typeof t2 != `string`) return;
|
|
2415
|
+
let r2 = Fn(t2).length, i2 = e4[Xn];
|
|
2416
|
+
if (!(i2 <= r2)) return e4.createError(`min-length-error`, { minLength: i2, length: r2, pointer: n2, schema: e4.schema, value: t2 });
|
|
2417
|
+
}
|
|
2418
|
+
var er = `minProperties`;
|
|
2419
|
+
var tr = { id: er, keyword: er, parse: nr, addValidate: (e4) => e4[er] != null, validate: rr };
|
|
2420
|
+
function nr(e4) {
|
|
2421
|
+
let t2 = e4.schema[er];
|
|
2422
|
+
if (t2 != null) {
|
|
2423
|
+
if (!F(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${er}`, schema: e4.schema, value: t2, message: `Keyword '${er}' must be a number - received '${typeof t2}'` });
|
|
2424
|
+
e4[er] = t2;
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
function rr({ node: e4, data: t2, pointer: n2 = `#` }) {
|
|
2428
|
+
if (!d(t2)) return;
|
|
2429
|
+
let r2 = Object.keys(t2).length;
|
|
2430
|
+
if (e4.schema.minProperties > r2) return e4.createError(`min-properties-error`, { minProperties: e4.schema.minProperties, length: r2, pointer: n2, schema: e4.schema, value: t2 });
|
|
2431
|
+
}
|
|
2432
|
+
function ir(e4) {
|
|
2433
|
+
let t2 = `${e4}`;
|
|
2434
|
+
if (t2.includes(`e-`)) return parseInt(t2.replace(/.*e-/, ``));
|
|
2435
|
+
let n2 = t2.indexOf(`.`);
|
|
2436
|
+
return n2 === -1 ? 0 : t2.length - (n2 + 1);
|
|
2437
|
+
}
|
|
2438
|
+
var ar = `multipleOf`;
|
|
2439
|
+
var or = { id: ar, keyword: ar, parse: sr, addValidate: (e4) => e4[ar] != null, validate: cr };
|
|
2440
|
+
function sr(e4) {
|
|
2441
|
+
let t2 = e4.schema[ar];
|
|
2442
|
+
if (t2 != null) {
|
|
2443
|
+
if (!F(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${ar}`, schema: e4.schema, value: t2, message: `Keyword '${ar}' must be a number - received '${typeof t2}'` });
|
|
2444
|
+
e4[ar] = t2;
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
function cr({ node: e4, data: t2, pointer: n2 }) {
|
|
2448
|
+
if (typeof t2 != `number`) return;
|
|
2449
|
+
let r2 = e4[ar], i2 = ir(t2), a3 = ir(r2);
|
|
2450
|
+
if (i2 > a3) return e4.createError(`multiple-of-error`, { multipleOf: r2, value: t2, pointer: n2, schema: e4.schema });
|
|
2451
|
+
let o3 = 10 ** a3;
|
|
2452
|
+
if (Math.round(t2 * o3) % Math.round(r2 * o3) / o3 !== 0) return e4.createError(`multiple-of-error`, { multipleOf: r2, value: t2, pointer: n2, schema: e4.schema });
|
|
2453
|
+
}
|
|
2454
|
+
var lr = { id: `not`, keyword: `not`, parse: ur, addValidate: (e4) => e4.not != null, validate: dr };
|
|
2455
|
+
function ur(e4) {
|
|
2456
|
+
let { schema: t2, evaluationPath: n2, schemaLocation: r2 } = e4, i2 = t2.not;
|
|
2457
|
+
if (i2 != null) return !M(i2) && !N(i2) ? e4.createError(`schema-error`, { pointer: `${r2}/not`, schema: t2, value: i2, message: `Keyword 'not' must be a valid JSON Schema - received '${typeof i2}'` }) : (e4.not = e4.compileSchema(t2.not, `${n2}/not`, `${r2}/not`), e4.not.schemaValidation);
|
|
2458
|
+
}
|
|
2459
|
+
function dr({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2460
|
+
let { schema: i2 } = e4;
|
|
2461
|
+
if (D(e4.not, t2, n2, r2).length === 0) return e4.createError(`not-error`, { value: t2, not: i2.not, pointer: n2, schema: i2 });
|
|
2462
|
+
}
|
|
2463
|
+
var fr = `pattern`;
|
|
2464
|
+
var { REGEX_FLAGS: pr } = c2;
|
|
2465
|
+
var mr = { id: fr, keyword: fr, parse: hr, addValidate: (e4) => e4[fr] != null, validate: gr };
|
|
2466
|
+
function hr(e4) {
|
|
2467
|
+
let t2 = e4.schema[fr];
|
|
2468
|
+
if (t2 != null) {
|
|
2469
|
+
if (typeof t2 != `string`) return e4.createError(`schema-error`, { pointer: e4.schemaLocation, schema: e4.schema, value: t2, message: `Keyword 'pattern' must be a string - received '${typeof t2}'` });
|
|
2470
|
+
try {
|
|
2471
|
+
e4[fr] = new RegExp(t2, e4.schema.regexFlags ?? pr);
|
|
2472
|
+
} catch (n2) {
|
|
2473
|
+
return e4.createError(`schema-error`, { pointer: e4.schemaLocation, schema: e4.schema, value: t2, message: n2.message });
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
function gr({ node: e4, data: t2, pointer: n2 = `#` }) {
|
|
2478
|
+
if (typeof t2 == `string` && e4.pattern.test(t2) === false) {
|
|
2479
|
+
let { schema: r2 } = e4;
|
|
2480
|
+
return e4.createError(`pattern-error`, { pattern: r2.pattern, description: r2.patternExample || r2.pattern, received: t2, schema: r2, value: t2, pointer: n2 });
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
var { REGEX_FLAGS: _r } = c2;
|
|
2484
|
+
var vr = { id: `patternProperties`, keyword: `patternProperties`, parse: yr, addReduce: (e4) => e4.patternProperties != null, reduce: xr, addResolve: (e4) => e4.patternProperties != null, resolve: br, addValidate: (e4) => e4.patternProperties != null, validate: Sr };
|
|
2485
|
+
function yr(e4) {
|
|
2486
|
+
let { schema: t2 } = e4;
|
|
2487
|
+
if (!d(t2.patternProperties)) return;
|
|
2488
|
+
let n2 = Object.keys(t2.patternProperties);
|
|
2489
|
+
if (n2.length !== 0) return e4.patternProperties = n2.map((n3) => ({ name: n3, pattern: new RegExp(n3, t2.regexFlags ?? _r), node: e4.compileSchema(t2.patternProperties[n3], `${e4.evaluationPath}/patternProperties/${n3}`, `${e4.schemaLocation}/patternProperties/${n3}`) })), L([], ...e4.patternProperties.map(({ node: e5 }) => e5));
|
|
2490
|
+
}
|
|
2491
|
+
function br({ node: e4, key: t2 }) {
|
|
2492
|
+
return e4.patternProperties?.find(({ pattern: e5 }) => e5.test(`${t2}`))?.node;
|
|
2493
|
+
}
|
|
2494
|
+
function xr({ node: e4, data: t2, key: n2 }) {
|
|
2495
|
+
let { patternProperties: r2 } = e4;
|
|
2496
|
+
if (r2 == null) return;
|
|
2497
|
+
let i2, a3 = Object.keys(t2 ?? {});
|
|
2498
|
+
n2 && a3.push(`${n2}`);
|
|
2499
|
+
let o3 = `${e4.schemaLocation}(`;
|
|
2500
|
+
return a3.push(...Object.keys(e4.schema.properties ?? {})), a3.forEach((t3, n3, a4) => {
|
|
2501
|
+
if (a4.indexOf(t3) !== n3) return;
|
|
2502
|
+
let s3 = e4.schema.properties?.[t3] ?? {}, c3 = r2.filter((e5) => e5.pattern.test(t3));
|
|
2503
|
+
c3.forEach((e5) => s3 = b2(s3, e5.node.schema)), c3.length > 0 && (i2 ??= { properties: {} }, i2.properties[t3] = s3, o3 += `${c3.map(({ name: e5 }) => `patternProperties/${e5}`).join(`,`)}`);
|
|
2504
|
+
}), i2 == null ? e4 : (i2 = b2(e4.schema, i2, `patternProperties`), e4.compileSchema(i2, e4.evaluationPath, e4.schemaLocation, `${o3})`));
|
|
2505
|
+
}
|
|
2506
|
+
function Sr({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2507
|
+
if (!d(t2)) return;
|
|
2508
|
+
let { schema: i2, patternProperties: a3 } = e4, o3 = i2.properties || {}, s3 = Object.keys(i2.patternProperties).join(`,`), c3 = [];
|
|
2509
|
+
return Object.keys(t2).forEach((l2) => {
|
|
2510
|
+
let u2 = A(t2, l2), d2 = a3.filter((e5) => e5.pattern.test(l2));
|
|
2511
|
+
d2.forEach(({ node: e5 }) => c3.push(...D(e5, u2, `${n2}/${l2}`, r2))), !o3[l2] && d2.length === 0 && i2.additionalProperties === false && c3.push(e4.createError(`no-additional-properties-error`, { key: l2, pointer: `${n2}/${l2}`, schema: i2, value: u2, patterns: s3 }));
|
|
2512
|
+
}), c3;
|
|
2513
|
+
}
|
|
2514
|
+
var Cr = { id: `property`, keyword: `properties`, parse: Tr, addResolve: (e4) => e4.properties != null, resolve: wr, addValidate: (e4) => e4.properties != null, validate: Er };
|
|
2515
|
+
function wr({ node: e4, key: t2 }) {
|
|
2516
|
+
return e4.properties?.[t2];
|
|
2517
|
+
}
|
|
2518
|
+
function Tr(e4) {
|
|
2519
|
+
let { schema: t2, evaluationPath: n2, schemaLocation: r2 } = e4;
|
|
2520
|
+
if (t2.properties == null) return;
|
|
2521
|
+
if (t2.properties && !d(t2.properties)) return e4.createError(`schema-error`, { pointer: r2, schema: t2, value: void 0, message: "keyword `properties` must be of type `object`" });
|
|
2522
|
+
let i2 = [], a3 = {};
|
|
2523
|
+
return Object.keys(t2.properties).forEach((o3) => {
|
|
2524
|
+
let s3 = e4.compileSchema(t2.properties[o3], `${n2}/properties/${o3}`, `${r2}/properties/${o3}`);
|
|
2525
|
+
a3[o3] = s3, L(i2, a3[o3]);
|
|
2526
|
+
}), e4.properties = a3, i2;
|
|
2527
|
+
}
|
|
2528
|
+
function Er({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2529
|
+
if (!d(t2)) return;
|
|
2530
|
+
let i2 = [], a3 = e4.properties ?? {};
|
|
2531
|
+
return Object.keys(t2).forEach((e5) => {
|
|
2532
|
+
let o3 = A(t2, e5), s3 = a3[e5];
|
|
2533
|
+
if (s3 == null || o3 === void 0) return;
|
|
2534
|
+
let c3 = D(s3, o3, `${n2}/${e5}`, r2);
|
|
2535
|
+
i2.push(...c3);
|
|
2536
|
+
}), i2;
|
|
2537
|
+
}
|
|
2538
|
+
var Dr = `propertyNames`;
|
|
2539
|
+
var Or = { id: Dr, keyword: Dr, parse: kr, addValidate: (e4) => e4.schema[Dr] != null, validate: Ar };
|
|
2540
|
+
function kr(e4) {
|
|
2541
|
+
let t2 = e4.schema[Dr];
|
|
2542
|
+
if (t2 != null) {
|
|
2543
|
+
if (!(M(t2) || N(t2))) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${Dr}`, schema: e4.schema, value: t2, message: `Keyword '${Dr}' must be a valid JSON Schema - received '${typeof t2}'` });
|
|
2544
|
+
if (!N(t2)) return e4.propertyNames = e4.compileSchema(t2, `${e4.evaluationPath}/propertyNames`, `${e4.schemaLocation}/propertyNames`), e4.propertyNames.schemaValidation;
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2547
|
+
function Ar({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2548
|
+
let { schema: i2 } = e4;
|
|
2549
|
+
if (!d(t2)) return;
|
|
2550
|
+
if (i2.propertyNames === false) return Object.keys(t2).length === 0 ? void 0 : e4.createError(`invalid-property-name-error`, { property: Object.keys(t2), pointer: n2, value: t2, schema: i2 });
|
|
2551
|
+
if (i2[Dr] === true) return;
|
|
2552
|
+
let a3 = e4[Dr];
|
|
2553
|
+
if (!d(a3)) return;
|
|
2554
|
+
let o3 = [];
|
|
2555
|
+
return Object.keys(t2).forEach((s3) => {
|
|
2556
|
+
let c3 = D(a3, s3, `${n2}/${s3}`, r2);
|
|
2557
|
+
c3.length > 0 && o3.push(e4.createError(`invalid-property-name-error`, { property: s3, pointer: n2, validationError: c3[0], value: t2[s3], schema: i2 }));
|
|
2558
|
+
}), o3;
|
|
2559
|
+
}
|
|
2560
|
+
var jr = `required`;
|
|
2561
|
+
var Mr = { id: jr, keyword: jr, parse: Nr, addValidate: (e4) => e4.required != null, validate: Pr };
|
|
2562
|
+
function Nr(e4) {
|
|
2563
|
+
let t2 = e4.schema[jr];
|
|
2564
|
+
if (t2 != null) {
|
|
2565
|
+
if (!mt(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${jr}`, schema: e4.schema, value: t2, message: `Keyword '${jr}' must be a string[]` });
|
|
2566
|
+
e4.required = t2;
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
function Pr({ node: e4, data: t2, pointer: n2 = `#` }) {
|
|
2570
|
+
let { required: r2 } = e4;
|
|
2571
|
+
if (d(t2)) return r2.map((r3) => {
|
|
2572
|
+
if (!k(t2, r3)) return e4.createError(`required-property-error`, { key: r3, pointer: n2, schema: e4.schema, value: t2 });
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2575
|
+
function Fr(e4) {
|
|
2576
|
+
return { ...e4, keywords: [...e4.keywords.map((e5) => ({ ...e5 }))] };
|
|
2577
|
+
}
|
|
2578
|
+
function Ir(e4, t2) {
|
|
2579
|
+
let { keywords: n2 } = Lr(e4, ...t2.keywords ?? []), r2 = { ...e4.errors, ...t2.errors ?? {} }, i2 = { ...e4.formats, ...t2.formats ?? {} };
|
|
2580
|
+
return zr({ ...e4, ...t2, formats: i2, keywords: n2, errors: r2 });
|
|
2581
|
+
}
|
|
2582
|
+
function Lr(e4, ...t2) {
|
|
2583
|
+
let n2 = Fr(e4);
|
|
2584
|
+
return t2.forEach((e5) => Rr(n2, e5)), n2;
|
|
2585
|
+
}
|
|
2586
|
+
function Rr(e4, t2) {
|
|
2587
|
+
let n2 = e4.keywords.findIndex((e5) => e5.keyword === t2.keyword);
|
|
2588
|
+
n2 === -1 ? e4.keywords.push(t2) : e4.keywords[n2] = t2;
|
|
2589
|
+
}
|
|
2590
|
+
function zr(e4) {
|
|
2591
|
+
return e4.keywords?.forEach((e5) => {
|
|
2592
|
+
let t2 = () => e5.keyword;
|
|
2593
|
+
e5.validate && (e5.validate.toJSON = t2, e5.validate.order = e5.order ?? 0), e5.reduce && (e5.reduce.toJSON = t2, e5.reduce.order = e5.order ?? 0), e5.resolve && (e5.resolve.toJSON = t2, e5.resolve.order = e5.order ?? 0);
|
|
2594
|
+
}), e4.keywords?.sort((e5, t2) => (t2.order ?? 0) - (e5.order ?? 0)), e4;
|
|
2595
|
+
}
|
|
2596
|
+
function Br(e4, t2, n2 = `#`, r2 = []) {
|
|
2597
|
+
let i2 = e4.resolveRef() ?? e4;
|
|
2598
|
+
return r2.push({ node: i2, value: t2, pointer: n2 }), d(t2) ? Object.keys(t2).forEach((e5) => {
|
|
2599
|
+
let { node: a3 } = i2.getNodeChild(e5, t2);
|
|
2600
|
+
a3 && Br(a3, A(t2, e5), `${n2}/${e5}`, r2);
|
|
2601
|
+
}) : Array.isArray(t2) && t2.forEach((e5, a3) => {
|
|
2602
|
+
let { node: o3 } = i2.getNodeChild(a3, t2);
|
|
2603
|
+
o3 && Br(o3, A(t2, a3), `${n2}/${a3}`, r2);
|
|
2604
|
+
}), r2;
|
|
2605
|
+
}
|
|
2606
|
+
var X = `type`;
|
|
2607
|
+
var Vr = [`null`, `boolean`, `number`, `integer`, `string`, `object`, `array`];
|
|
2608
|
+
var Hr = { id: X, keyword: X, parse: Ur, addReduce: (e4) => Array.isArray(e4.type), reduce: Wr, addValidate: (e4) => e4.type != null, validate: Kr };
|
|
2609
|
+
function Ur(e4) {
|
|
2610
|
+
let t2 = e4.schema[X];
|
|
2611
|
+
if (t2 != null) {
|
|
2612
|
+
if (typeof t2 != `string` && !Array.isArray(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${X}`, schema: e4.schema, value: t2, message: `Keyword '${X}' must be a string or a string[] - received ${typeof t2}` });
|
|
2613
|
+
if (typeof t2 == `string` && !Vr.includes(t2)) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${X}`, schema: e4.schema, value: t2, message: `Keyword '${X}' is not a valid JSON Schema type - received '${t2}'. Expected one of ${Vr.join(`, `)}` });
|
|
2614
|
+
if (Array.isArray(t2)) {
|
|
2615
|
+
let n2 = t2.findIndex((e5) => !Vr.includes(e5));
|
|
2616
|
+
if (n2 !== -1) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${X}/${n2}`, schema: e4.schema, value: t2[n2], message: `Keyword '${X}' contains an invalid JSON Schema type: '${t2[n2]}'` });
|
|
2617
|
+
}
|
|
2618
|
+
e4[X] = t2;
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
function Wr({ node: e4, pointer: t2, data: n2 }) {
|
|
2622
|
+
let r2 = Gr(n2, e4.type);
|
|
2623
|
+
if (r2 !== `undefined` && Array.isArray(e4.schema.type) && e4.schema.type.includes(r2)) return e4.compileSchema({ ...e4.schema, pointer: t2, type: r2 }, e4.evaluationPath);
|
|
2624
|
+
}
|
|
2625
|
+
function Gr(e4, t2) {
|
|
2626
|
+
let n2 = u(e4);
|
|
2627
|
+
return n2 === `number` && (t2 === `integer` || Array.isArray(t2) && t2.includes(`integer`)) ? Number.isInteger(e4) || isNaN(e4) ? `integer` : `number` : n2;
|
|
2628
|
+
}
|
|
2629
|
+
function Kr({ node: e4, data: t2, pointer: n2 }) {
|
|
2630
|
+
let r2 = e4[X], i2 = Gr(t2, r2);
|
|
2631
|
+
if (!(t2 === void 0 || r2 === i2 || Array.isArray(r2) && r2.includes(i2))) return e4.createError(`type-error`, { value: t2, received: i2, expected: r2, schema: e4.schema, pointer: n2 });
|
|
2632
|
+
}
|
|
2633
|
+
var qr = `uniqueItems`;
|
|
2634
|
+
var Jr = { id: qr, keyword: qr, parse: Yr, addValidate: ({ schema: e4 }) => e4[qr] === true, validate: Xr };
|
|
2635
|
+
function Yr(e4) {
|
|
2636
|
+
let t2 = e4.schema[qr];
|
|
2637
|
+
if (t2 != null && t2 !== false) {
|
|
2638
|
+
if (typeof t2 != `boolean`) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${qr}`, schema: e4.schema, value: t2, message: `Keyword '${qr}' must be a boolean - received ${typeof t2}` });
|
|
2639
|
+
e4.uniqueItems = true;
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
function Xr({ node: e4, data: t2, pointer: n2 }) {
|
|
2643
|
+
if (!Array.isArray(t2)) return;
|
|
2644
|
+
let { schema: r2 } = e4, i2 = [], a3 = [];
|
|
2645
|
+
return t2.forEach((s3, c3) => {
|
|
2646
|
+
for (let l2 = c3 + 1; l2 < t2.length; l2 += 1) (0, import_fast_deep_equal.default)(s3, t2[l2]) && !i2.includes(l2) && (a3.push(e4.createError(`unique-items-error`, { pointer: `${n2}/${l2}`, duplicatePointer: `${n2}/${c3}`, arrayPointer: n2, value: JSON.stringify(s3), schema: r2 })), i2.push(l2));
|
|
2647
|
+
}), a3;
|
|
2648
|
+
}
|
|
2649
|
+
var Zr = zr({ version: `draft-04`, $schemaRegEx: `draft-?0?4`, $schema: `http://json-schema.org/draft-04/schema#`, errors: Nt, formats: $t, methods: { createSchema: f, getData: bn, getChildSelection: en, toDataNodes: Br }, keywords: [He, rt, st, dt, Fe, St, Dt, At, Pt, Lt, Vt, Cn, On, Mn, In, zn, Un, qn, Zn, tr, or, lr, vr, mr, Cr, Or, Mr, Hr, Jr, sn, Ye, $e] });
|
|
2650
|
+
var Qr = { id: `const`, keyword: `const`, addValidate: ({ schema: e4 }) => e4.const !== void 0, validate: $r };
|
|
2651
|
+
function $r({ node: e4, data: t2, pointer: n2 }) {
|
|
2652
|
+
if (!(0, import_fast_deep_equal.default)(t2, e4.schema.const)) return [e4.createError(`const-error`, { pointer: n2, schema: e4.schema, value: t2, expected: e4.schema.const })];
|
|
2653
|
+
}
|
|
2654
|
+
var ei = `exclusiveMaximum`;
|
|
2655
|
+
var ti = { id: ei, keyword: ei, parse: ni, addValidate: ({ schema: e4 }) => e4.exclusiveMaximum != null && !isNaN(parseInt(e4.exclusiveMaximum)), validate: ri };
|
|
2656
|
+
function ni(e4) {
|
|
2657
|
+
let t2 = e4.schema[ei];
|
|
2658
|
+
if (t2 != null && typeof t2 != `number`) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${ei}`, schema: e4.schema, value: t2, message: `Keyword '${ei}' must be a number - received '${typeof t2}'` });
|
|
2659
|
+
}
|
|
2660
|
+
function ri({ node: e4, data: t2, pointer: n2 }) {
|
|
2661
|
+
if (typeof t2 == `number` && e4.schema.exclusiveMaximum <= t2) return e4.createError(`exclusive-maximum-error`, { maximum: e4.schema.exclusiveMaximum, length: t2, pointer: n2, schema: e4.schema, value: t2 });
|
|
2662
|
+
}
|
|
2663
|
+
var ii = `exclusiveMinimum`;
|
|
2664
|
+
var ai = { id: ii, keyword: ii, parse: oi, addValidate: ({ schema: e4 }) => e4[ii] != null && !isNaN(parseInt(e4[ii])), validate: si };
|
|
2665
|
+
function oi(e4) {
|
|
2666
|
+
let t2 = e4.schema[ii];
|
|
2667
|
+
if (t2 != null && typeof t2 != `number`) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${ii}`, schema: e4.schema, value: t2, message: `Keyword '${ii}' must be a number - received '${typeof t2}'` });
|
|
2668
|
+
}
|
|
2669
|
+
function si({ node: e4, data: t2, pointer: n2 }) {
|
|
2670
|
+
if (typeof t2 == `number` && e4.schema.exclusiveMinimum >= t2) return e4.createError(`exclusive-minimum-error`, { minimum: e4.schema.exclusiveMinimum, length: t2, pointer: n2, schema: e4.schema, value: t2 });
|
|
2671
|
+
}
|
|
2672
|
+
var ci = zr({ version: `draft-06`, $schemaRegEx: `draft-?0?6`, $schema: `http://json-schema.org/draft-06/schema#`, errors: Nt, formats: $t, methods: { createSchema: f, getData: bn, getChildSelection: en, toDataNodes: Br }, keywords: [Re, rt, st, Qr, dt, Fe, St, Dt, At, ti, ai, Vt, Cn, On, Mn, In, zn, Un, qn, Zn, tr, or, lr, vr, mr, Cr, Or, Mr, Hr, Jr, sn, Ye, $e] });
|
|
2673
|
+
var li = { id: `if-then-else`, keyword: `if`, parse: ui, addReduce: (e4) => e4.if != null && (e4.then != null || e4.else != null), reduce: di, addValidate: (e4) => e4.if != null, validate: fi };
|
|
2674
|
+
function ui(e4) {
|
|
2675
|
+
let { schema: t2, evaluationPath: n2 } = e4, r2 = [];
|
|
2676
|
+
return t2.if != null && (M(t2.if) || N(t2.if) ? (e4.if = e4.compileSchema(t2.if, `${n2}/if`), L(r2, e4.if)) : r2.push(e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/if`, schema: e4.schema, value: t2.if, message: `Keyword 'if' must be valid JSON Schema - received '${typeof t2.if}'` }))), t2.then != null && (M(t2.then) || N(t2.then) ? (e4.then = e4.compileSchema(t2.then, `${n2}/then`), L(r2, e4.then)) : r2.push(e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/then`, schema: e4.schema, value: t2.then, message: `Keyword 'then' must be valid JSON Schema - received '${typeof t2.then}'` }))), t2.else != null && (M(t2.else) || N(t2.else) ? (e4.else = e4.compileSchema(t2.else, `${n2}/else`), L(r2, e4.else)) : r2.push(e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/else`, schema: e4.schema, value: t2.else, message: `Keyword 'else' must be valid JSON Schema - received '${typeof t2.else}'` }))), r2;
|
|
2677
|
+
}
|
|
2678
|
+
function di({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2679
|
+
if (t2 !== void 0 && e4.if != null) {
|
|
2680
|
+
if (D(e4.if, t2, n2, [...r2 ?? []]).length === 0) {
|
|
2681
|
+
if (e4.then) {
|
|
2682
|
+
let { node: n3 } = e4.then.reduceNode(t2);
|
|
2683
|
+
if (n3) {
|
|
2684
|
+
let t3 = n3.dynamicId?.replace(e4.dynamicId, ``).replace(/^#/, ``) ?? ``, r3 = t3 === `` ? `(then)` : t3, i2 = b2(e4.then.schema, n3.schema, `if`, `then`, `else`);
|
|
2685
|
+
return e4.compileSchema(i2, e4.then.evaluationPath, e4.schemaLocation, `${e4.schemaLocation}${r3}`);
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
} else if (e4.else) {
|
|
2689
|
+
let { node: n3 } = e4.else.reduceNode(t2);
|
|
2690
|
+
if (n3) {
|
|
2691
|
+
let t3 = n3.dynamicId?.replace(e4.dynamicId, ``) ?? ``, r3 = t3 === `` ? `(else)` : t3, i2 = b2(e4.else.schema, n3.schema, `if`, `then`, `else`);
|
|
2692
|
+
return e4.compileSchema(i2, e4.else.evaluationPath, e4.schemaLocation, `${e4.schemaLocation}${r3}`);
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
function fi({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2698
|
+
if (e4.if != null) {
|
|
2699
|
+
if (D(e4.if, t2, n2, [...r2 ?? []]).length === 0) {
|
|
2700
|
+
if (e4.then) return D(e4.then, t2, n2, r2);
|
|
2701
|
+
} else if (e4.else) return D(e4.else, t2, n2, r2);
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
var pi = zr({ version: `draft-07`, $schemaRegEx: `draft-?0?7`, $schema: `http://json-schema.org/draft-07/schema#`, errors: Nt, formats: $t, methods: { createSchema: f, getData: bn, getChildSelection: en, toDataNodes: Br }, keywords: [Re, rt, st, Qr, dt, Fe, St, Dt, At, ti, ai, Vt, li, Cn, On, Mn, In, zn, Un, qn, Zn, tr, or, lr, vr, mr, Cr, Or, Mr, Hr, Jr, sn, Ye, $e] });
|
|
2705
|
+
var mi = { id: `$ref`, keyword: `$ref`, parse: gi, addValidate: ({ schema: e4 }) => e4.$ref != null || e4.$recursiveRef != null, validate: vi, addReduce: ({ schema: e4 }) => e4.$ref != null || e4.$recursiveRef != null, reduce: Ae };
|
|
2706
|
+
function hi(e4, t2) {
|
|
2707
|
+
e4.context.refs[t2] ?? (e4.context.refs[t2] = e4);
|
|
2708
|
+
}
|
|
2709
|
+
function gi(e4) {
|
|
2710
|
+
e4.resolveRef = _i;
|
|
2711
|
+
let t2 = y2(e4.parent?.$id, e4.schema?.$id);
|
|
2712
|
+
e4.$id = t2, e4.lastIdPointer = e4.parent?.lastIdPointer ?? `#`, t2 !== e4.parent?.$id && e4.evaluationPath !== `#` && (e4.lastIdPointer = e4.evaluationPath), e4.lastIdPointer !== `#` && e4.evaluationPath.startsWith(e4.lastIdPointer) && hi(e4, y2(t2, `#${e4.evaluationPath.replace(e4.lastIdPointer, ``)}`)), hi(e4, y2(e4.context.rootNode.$id, e4.evaluationPath)), e4.schema.$anchor && (e4.context.anchors[`${t2.replace(/#$/, ``)}#${e4.schema.$anchor}`] = e4), e4.schema.$ref && (e4.$ref = y2(t2, e4.schema.$ref), e4.$ref.startsWith(`/`) && (e4.$ref = `#${e4.$ref}`));
|
|
2713
|
+
}
|
|
2714
|
+
function _i({ pointer: e4, path: t2 } = {}) {
|
|
2715
|
+
if (this.schema.$recursiveRef) {
|
|
2716
|
+
let n3 = yi(this, t2 ?? []);
|
|
2717
|
+
return j(n3) && t2?.push({ pointer: e4, node: n3 }), n3;
|
|
2718
|
+
}
|
|
2719
|
+
if (this.$ref == null) return this;
|
|
2720
|
+
let n2 = bi(this);
|
|
2721
|
+
return j(n2) && t2?.push({ pointer: e4, node: n2 }), n2;
|
|
2722
|
+
}
|
|
2723
|
+
function vi({ node: e4, data: t2, pointer: n2 = `#`, path: r2 }) {
|
|
2724
|
+
let i2 = e4.resolveRef({ pointer: n2, path: r2 });
|
|
2725
|
+
return i2 == null ? e4.createError(`ref-error`, { ref: e4.schema.$ref ?? e4.schema.$recursiveRef, pointer: n2, schema: e4.schema, value: t2 }) : D(i2, t2, n2, r2);
|
|
2726
|
+
}
|
|
2727
|
+
function yi(e4, t2) {
|
|
2728
|
+
let n2 = t2, r2 = 0;
|
|
2729
|
+
for (let t3 = n2.length - 1; t3 >= 0; t3--) {
|
|
2730
|
+
if (n2[t3].node.schema.$recursiveAnchor === false) return bi(e4, y2(e4.$id, e4.schema.$recursiveRef));
|
|
2731
|
+
if (/^https?:\/\//.test(n2[t3].node.schema.$id ?? ``) && n2[t3].node.schema.$recursiveAnchor !== true) {
|
|
2732
|
+
r2 = t3;
|
|
2733
|
+
break;
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
let i2 = n2.find((e5, t3) => t3 >= r2 && e5.node.schema.$recursiveAnchor === true);
|
|
2737
|
+
return i2 ? i2.node : bi(e4, y2(e4.$id, e4.schema.$recursiveRef));
|
|
2738
|
+
}
|
|
2739
|
+
function bi(e4, t2 = e4?.$ref) {
|
|
2740
|
+
if (t2 == null) return e4;
|
|
2741
|
+
if (e4.context.refs[t2]) return I(e4.context.refs[t2], e4);
|
|
2742
|
+
if (e4.context.anchors[t2]) return I(e4.context.anchors[t2], e4);
|
|
2743
|
+
let r2 = Ee(t2);
|
|
2744
|
+
if (r2.length === 0) return e4.createError(`ref-error`, { ref: t2, pointer: e4.evaluationPath, schema: e4.schema, value: void 0 });
|
|
2745
|
+
if (r2.length === 1) {
|
|
2746
|
+
let t3 = r2[0];
|
|
2747
|
+
if (e4.context.remotes[t3]) return I(e4.context.remotes[t3], e4);
|
|
2748
|
+
if (t3[0] === `#`) {
|
|
2749
|
+
let r3 = t3.match(/#[^#]*$/)?.pop(), i2 = e4.context.rootNode.schema, a3 = s(i2, r3);
|
|
2750
|
+
if (a3) return e4.compileSchema(a3, `${e4.evaluationPath}/$ref`, r3);
|
|
2751
|
+
}
|
|
2752
|
+
return e4.createError(`ref-error`, { ref: t3, pointer: e4.evaluationPath, schema: e4.schema, value: void 0 });
|
|
2753
|
+
}
|
|
2754
|
+
if (r2.length === 2) {
|
|
2755
|
+
let n2 = r2[0];
|
|
2756
|
+
if (e4.context.remotes[n2] && e4 !== e4.context.remotes[n2]) {
|
|
2757
|
+
let i2 = e4.context.remotes[n2], a3 = bi(i2, t2);
|
|
2758
|
+
if (a3 || (a3 = bi(i2, r2[1]), a3)) return a3;
|
|
2759
|
+
}
|
|
2760
|
+
if (e4.context.refs[n2]) {
|
|
2761
|
+
let a3 = e4.context.refs[n2], o3 = o(r2[1]), s3 = a3;
|
|
2762
|
+
for (let n3 of o3) if (s3 = s3[n3 === `definitions` ? `$defs` : n3], s3 == null) return e4.createError(`ref-error`, { ref: t2, pointer: e4.evaluationPath, schema: e4.schema, value: void 0, host: r2[0], local: r2[1] });
|
|
2763
|
+
return s3;
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
return e4.createError(`ref-error`, { ref: t2, pointer: e4.evaluationPath, schema: e4.schema, value: void 0 });
|
|
2767
|
+
}
|
|
2768
|
+
var xi = `unevaluatedItems`;
|
|
2769
|
+
var Si = { id: xi, keyword: xi, parse: Ci, addValidate: ({ schema: e4 }) => e4[xi] != null, validate: wi };
|
|
2770
|
+
function Ci(e4) {
|
|
2771
|
+
let { unevaluatedItems: t2 } = e4.schema;
|
|
2772
|
+
if (t2 != null && typeof t2 != `boolean`) {
|
|
2773
|
+
if (!d(t2)) return e4.createError(`schema-error`, { pointer: e4.evaluationPath, schema: e4.schema, value: void 0, message: `Keyword '${xi}' must be an object - received '${typeof t2}'` });
|
|
2774
|
+
e4.unevaluatedItems = e4.compileSchema(e4.schema.unevaluatedItems, `${e4.evaluationPath}/${xi}`, `${e4.schemaLocation}/${xi}`);
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
function wi({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2778
|
+
let { schema: i2 } = e4;
|
|
2779
|
+
if (!Array.isArray(t2) || t2.length === 0 || i2.unevaluatedItems == null || i2.unevaluatedItems === true) return;
|
|
2780
|
+
let { node: a3 } = e4.reduceNode(t2, { pointer: n2, path: r2 });
|
|
2781
|
+
if (a3 ??= e4, a3.schema.unevaluatedItems === true || a3.schema.additionalItems === true) return;
|
|
2782
|
+
let o3 = e4.if != null && D(e4.if, t2, n2, r2).length === 0, s3 = [];
|
|
2783
|
+
for (let a4 = 0; a4 < t2.length; a4 += 1) {
|
|
2784
|
+
let c3 = t2[a4], { node: l2 } = e4.getNodeChild(a4, t2, { path: r2 });
|
|
2785
|
+
if (l2 && D(l2, c3, `${n2}/${a4}`, r2).length > 0) {
|
|
2786
|
+
let o4 = e4.unevaluatedItems;
|
|
2787
|
+
if (o4 && t2.forEach((e5) => {
|
|
2788
|
+
let t3 = D(o4, e5, `${n2}/${a4}`, r2);
|
|
2789
|
+
if (t3 != null) {
|
|
2790
|
+
if (Array.isArray(t3)) return s3.push(...t3);
|
|
2791
|
+
s3.push(t3);
|
|
2792
|
+
}
|
|
2793
|
+
}), e4.schema.unevaluatedItems === false) return e4.createError(`unevaluated-items-error`, { pointer: `${n2}/${a4}`, value: JSON.stringify(c3), schema: i2 });
|
|
2794
|
+
}
|
|
2795
|
+
if (l2 === void 0 && !(o3 && e4.if.prefixItems && e4.if.prefixItems.length > a4)) if (e4.unevaluatedItems) {
|
|
2796
|
+
let t3 = D(e4.unevaluatedItems, c3, `${n2}/${a4}`, r2);
|
|
2797
|
+
t3.length > 0 && s3.push(...t3);
|
|
2798
|
+
} else s3.push(e4.createError(`unevaluated-items-error`, { pointer: `${n2}/${a4}`, value: JSON.stringify(c3), schema: i2 }));
|
|
2799
|
+
}
|
|
2800
|
+
return s3;
|
|
2801
|
+
}
|
|
2802
|
+
function Ti({ node: e4, data: t2, key: n2, pointer: r2, path: i2 }) {
|
|
2803
|
+
if (Array.isArray(e4.schema.required) && !e4.schema.required.find((e5) => k(t2, e5))) return false;
|
|
2804
|
+
if (e4.schema.unevaluatedProperties === true || e4.schema.additionalProperties === true || e4.properties?.[n2] && e4.properties[n2].validate(t2[n2], r2, i2).valid || e4.patternProperties && e4.patternProperties.find((e5) => e5.pattern.test(n2))) return true;
|
|
2805
|
+
if (e4.allOf) {
|
|
2806
|
+
for (let a4 of e4.allOf) if (Ti({ node: a4, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
2807
|
+
}
|
|
2808
|
+
if (e4.anyOf) {
|
|
2809
|
+
for (let a4 of e4.anyOf) if (Ti({ node: a4, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
2810
|
+
}
|
|
2811
|
+
if (e4.oneOf) {
|
|
2812
|
+
for (let a4 of e4.oneOf) if (Ti({ node: a4, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
2813
|
+
}
|
|
2814
|
+
if (e4.if) {
|
|
2815
|
+
if (Ti({ node: e4.if, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
2816
|
+
let a4 = D(e4.if, t2, r2, i2).length === 0;
|
|
2817
|
+
if (a4 && e4.then) {
|
|
2818
|
+
if (Ti({ node: e4.then, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
2819
|
+
} else if (!a4 && e4.else && Ti({ node: e4.else, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
2820
|
+
}
|
|
2821
|
+
let a3 = e4.resolveRef({ pointer: r2, path: i2 });
|
|
2822
|
+
return !!(a3 !== e4 && Ti({ node: a3, data: t2, key: n2, pointer: r2, path: i2 }));
|
|
2823
|
+
}
|
|
2824
|
+
var Z = `unevaluatedProperties`;
|
|
2825
|
+
var Ei = { id: Z, keyword: Z, parse: Di, addValidate: ({ schema: e4 }) => e4[Z] != null, validate: Oi };
|
|
2826
|
+
function Di(e4) {
|
|
2827
|
+
let t2 = e4.schema[Z];
|
|
2828
|
+
if (t2 != null) {
|
|
2829
|
+
if (!(M(t2) || N(t2))) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${Z}`, schema: e4.schema, value: t2, message: `Keyword '${Z}' must be a valid JSON Schema - received '${typeof t2}'` });
|
|
2830
|
+
if (!N(t2)) return e4.unevaluatedProperties = e4.compileSchema(e4.schema.unevaluatedProperties, `${e4.evaluationPath}/${Z}`, `${e4.schemaLocation}/${Z}`), e4.unevaluatedProperties.schemaValidation;
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
function Oi({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
2834
|
+
if (!d(t2)) return;
|
|
2835
|
+
let i2 = Object.keys(t2).filter((e5) => t2[e5] !== void 0);
|
|
2836
|
+
if (i2.length === 0) return;
|
|
2837
|
+
let a3 = [];
|
|
2838
|
+
for (let o3 of i2) {
|
|
2839
|
+
if (e4.properties?.[o3] || Ti({ node: e4, data: t2, key: o3, pointer: n2, path: r2 })) continue;
|
|
2840
|
+
let { node: i3 } = e4.getNodeChild(o3, t2, { pointer: n2, path: r2 });
|
|
2841
|
+
if (i3 === void 0) if (e4.unevaluatedProperties) {
|
|
2842
|
+
let i4 = D(e4.unevaluatedProperties, t2[o3], `${n2}/${o3}`, r2);
|
|
2843
|
+
a3.push(...i4);
|
|
2844
|
+
} else e4.schema.unevaluatedProperties === false && a3.push(e4.createError(`unevaluated-property-error`, { pointer: `${n2}/${o3}`, value: JSON.stringify(t2[o3]), schema: e4.schema }));
|
|
2845
|
+
if (i3 && D(i3, t2[o3], `${n2}/${o3}`, r2).length > 0) if (e4.unevaluatedProperties) {
|
|
2846
|
+
let i4 = D(e4.unevaluatedProperties, t2[o3], `${n2}/${o3}`, r2);
|
|
2847
|
+
a3.push(...i4);
|
|
2848
|
+
} else e4.schema.unevaluatedProperties === false && a3.push(e4.createError(`unevaluated-property-error`, { pointer: `${n2}/${o3}`, value: JSON.stringify(t2[o3]), schema: e4.schema }));
|
|
2849
|
+
}
|
|
2850
|
+
return a3;
|
|
2851
|
+
}
|
|
2852
|
+
var ki = zr({ version: `draft-2019-09`, $schemaRegEx: `draft[/-]2019-?(09)?`, $schema: `https://json-schema.org/draft/2019-09/schema`, errors: Nt, formats: $t, methods: { createSchema: f, getData: bn, getChildSelection: en, toDataNodes: Br }, keywords: [mi, rt, st, Qr, dt, Fe, St, ht, vt, Dt, At, ti, ai, Vt, li, Cn, On, Mn, In, zn, Un, qn, Zn, tr, or, lr, vr, mr, Cr, Or, Mr, Hr, Si, Ei, Jr, sn, Ye, $e] });
|
|
2853
|
+
function Ai(e4, t2) {
|
|
2854
|
+
if (e4.items) {
|
|
2855
|
+
let t3 = e4.items.resolveRef();
|
|
2856
|
+
if (t3?.oneOf) return t3.oneOf.map((e5) => e5.resolveRef());
|
|
2857
|
+
}
|
|
2858
|
+
if (e4.oneOf) return e4.oneOf.map((e5) => e5.resolveRef());
|
|
2859
|
+
if (e4.prefixItems && e4.prefixItems.length > +t2) {
|
|
2860
|
+
let { node: n3, error: r3 } = e4.getNodeChild(t2);
|
|
2861
|
+
return j(n3) ? [n3] : r3;
|
|
2862
|
+
}
|
|
2863
|
+
if (e4.schema.items === true) return [e4.compileSchema({ type: `string` })];
|
|
2864
|
+
if (e4.schema.items === false) return [];
|
|
2865
|
+
if (e4.items) return [e4.items.resolveRef()];
|
|
2866
|
+
if (e4.prefixItems && e4.prefixItems.length <= +t2) return [];
|
|
2867
|
+
let { node: n2, error: r2 } = e4.getNodeChild(t2);
|
|
2868
|
+
return r2 ?? [n2];
|
|
2869
|
+
}
|
|
2870
|
+
function ji(e4, t2) {
|
|
2871
|
+
if (e4.$ref == null) return;
|
|
2872
|
+
t2.cache = t2.cache ?? {};
|
|
2873
|
+
let { cache: n2, recursionLimit: r2 = 1 } = t2, i2 = e4.schemaLocation;
|
|
2874
|
+
if (n2[i2] = n2[i2] ?? {}, n2[i2][e4.$ref] = n2[i2][e4.$ref] ?? 0, n2[i2][e4.$ref] >= r2 && t2.disableRecursionLimit !== true) return false;
|
|
2875
|
+
t2.disableRecursionLimit = false, n2[i2][e4.$ref] += 1;
|
|
2876
|
+
let a3 = e4.resolveRef();
|
|
2877
|
+
if (a3 && a3 !== e4) return a3;
|
|
2878
|
+
}
|
|
2879
|
+
function Mi(e4, t2) {
|
|
2880
|
+
return (t2.cache?.[e4.schemaLocation]?.[e4.$ref] ?? -1) < (t2.recursionLimit ?? 1);
|
|
2881
|
+
}
|
|
2882
|
+
function Ni(e4, t2) {
|
|
2883
|
+
let n2 = u(t2);
|
|
2884
|
+
if (e4 === void 0 || t2 == null || n2 === e4 || n2 === `number` && e4 === `integer`) return t2;
|
|
2885
|
+
if (e4 === `string`) return JSON.stringify(t2);
|
|
2886
|
+
if (n2 !== `string`) return t2;
|
|
2887
|
+
try {
|
|
2888
|
+
let n3 = JSON.parse(t2);
|
|
2889
|
+
if (u(n3) === e4) return n3;
|
|
2890
|
+
} catch {
|
|
2891
|
+
}
|
|
2892
|
+
return t2;
|
|
2893
|
+
}
|
|
2894
|
+
function Pi(e4, t2, n2) {
|
|
2895
|
+
if (n2?.cache == null) throw Error(`Missing options`);
|
|
2896
|
+
if (e4.schema === false || e4.schema === true || gn(t2)) return t2;
|
|
2897
|
+
if (e4.schema?.const !== void 0) return e4.schema?.const;
|
|
2898
|
+
let r2 = e4, i2 = t2;
|
|
2899
|
+
if (Array.isArray(e4.schema.enum) && e4.schema.enum.length > 0 && t2 === void 0) return e4.schema.default ?? e4.schema.enum[0];
|
|
2900
|
+
if (e4.schema.default !== void 0 && i2 === void 0 && (i2 = e4.schema.default), r2.allOf?.length && r2.allOf.forEach((e5) => {
|
|
2901
|
+
i2 = e5.getData(i2, n2) ?? i2;
|
|
2902
|
+
}), r2.anyOf && r2.anyOf?.length > 0 && (i2 = r2.anyOf[0].getData(i2, n2) ?? i2), r2.oneOf && r2.oneOf?.length > 0) if (an(i2)) r2 = w(r2, r2.oneOf[0]);
|
|
2903
|
+
else {
|
|
2904
|
+
let e5 = pn({ node: r2, data: i2, path: [], pointer: `#` });
|
|
2905
|
+
if (P(e5)) {
|
|
2906
|
+
if (i2 != null && n2.removeInvalidData !== true) return i2;
|
|
2907
|
+
r2 = r2.oneOf[0], i2 = void 0;
|
|
2908
|
+
} else r2 = w(r2, e5);
|
|
2909
|
+
}
|
|
2910
|
+
let a3 = ji(r2, n2);
|
|
2911
|
+
if (a3 === false) return i2;
|
|
2912
|
+
j(a3) && (i2 = a3.getData(i2, n2) ?? i2, r2 = a3);
|
|
2913
|
+
let o3 = G(r2, i2), s3 = Fi[o3]?.(r2, i2, n2);
|
|
2914
|
+
return s3 === void 0 ? i2 : s3;
|
|
2915
|
+
}
|
|
2916
|
+
var Fi = { null: (e4, t2, n2) => Ii(e4, t2, null, n2.useTypeDefaults), string: (e4, t2, n2) => Ii(e4, t2, ``, n2.useTypeDefaults), number: (e4, t2, n2) => Ii(e4, t2, 0, n2.useTypeDefaults), integer: (e4, t2, n2) => Ii(e4, t2, 0, n2.useTypeDefaults), boolean: (e4, t2, n2) => Ii(e4, t2, false, n2.useTypeDefaults), object: (e4, t2, n2) => {
|
|
2917
|
+
let r2 = e4.schema, i2 = r2.default === void 0 ? {} : r2.default, a3 = {}, o3 = n2.extendDefaults === false && r2.default !== void 0 ? [] : r2.required ?? [], s3 = e4.properties;
|
|
2918
|
+
s3 && Object.keys(s3).forEach((e5) => {
|
|
2919
|
+
let r3 = s3[e5], c4 = o3.includes(e5), l3 = A(t2, e5), d2 = t2 === void 0 || l3 === void 0 ? A(i2, e5) : l3;
|
|
2920
|
+
if (d2 !== void 0 || c4 || n2.addOptionalProps) {
|
|
2921
|
+
let t3 = r3.getData(d2, n2), i3 = u(t3);
|
|
2922
|
+
if (n2.removeInvalidData && i3 !== `object` && i3 !== `array` && !r3.validate(t3).valid) return;
|
|
2923
|
+
(t3 !== void 0 || n2.useTypeDefaults !== false) && (a3[e5] = t3);
|
|
2924
|
+
}
|
|
2925
|
+
});
|
|
2926
|
+
let c3 = e4.dependentRequired;
|
|
2927
|
+
d(c3) && Object.keys(c3).forEach((t3) => {
|
|
2928
|
+
let r3 = c3[t3];
|
|
2929
|
+
A(a3, t3) !== void 0 && r3.forEach((t4) => {
|
|
2930
|
+
let { node: r4 } = e4.getNodeChild(t4, a3);
|
|
2931
|
+
r4 && (a3[t4] = r4.getData(A(a3, t4), n2));
|
|
2932
|
+
});
|
|
2933
|
+
});
|
|
2934
|
+
let l2 = e4.dependentSchemas;
|
|
2935
|
+
if (l2 && Object.keys(l2).forEach((e5) => {
|
|
2936
|
+
let r3 = l2[e5];
|
|
2937
|
+
if (a3[e5] !== void 0 && j(r3)) {
|
|
2938
|
+
let e6 = r3.getData(t2 ?? a3, n2);
|
|
2939
|
+
Object.assign(a3, e6);
|
|
2940
|
+
}
|
|
2941
|
+
}), t2 && (n2.removeInvalidData === true && (r2.additionalProperties === false || d(r2.additionalProperties)) ? j(e4.additionalProperties) && Object.keys(t2).forEach((n3) => {
|
|
2942
|
+
if (a3[n3] == null) {
|
|
2943
|
+
let r3 = A(t2, n3);
|
|
2944
|
+
e4.additionalProperties?.validate(r3).valid && (a3[n3] = r3);
|
|
2945
|
+
}
|
|
2946
|
+
}) : Object.keys(t2).forEach((r3) => {
|
|
2947
|
+
let i3 = u(r3);
|
|
2948
|
+
if (n2.removeInvalidData && e4.properties && e4.properties[r3] && i3 !== `object` && i3 !== `array`) {
|
|
2949
|
+
let i4 = e4.properties[r3], a4 = i4.getData(A(t2, r3), n2);
|
|
2950
|
+
if (!i4.validate(a4).valid) return;
|
|
2951
|
+
}
|
|
2952
|
+
a3[r3] ?? (a3[r3] = A(t2, r3));
|
|
2953
|
+
})), e4.if) {
|
|
2954
|
+
let { errors: t3 } = e4.if.validate(a3);
|
|
2955
|
+
if (t3.length === 0 && e4.then) {
|
|
2956
|
+
let t4 = e4.then.getData(a3, n2);
|
|
2957
|
+
Object.assign(a3, t4);
|
|
2958
|
+
} else if (t3.length > 0 && e4.else) {
|
|
2959
|
+
let t4 = e4.else.getData(a3, n2);
|
|
2960
|
+
Object.assign(a3, t4);
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
return { ...i2, ...a3 };
|
|
2964
|
+
}, array: (e4, n2, r2) => {
|
|
2965
|
+
let i2 = e4.schema, a3 = i2.default === void 0 ? [] : i2.default, o3 = Array.isArray(n2) ? [...n2] : a3, s3 = r2.extendDefaults === false && i2.default !== void 0 ? 0 : i2.minItems ?? 0;
|
|
2966
|
+
if (i2.prefixItems == null) {
|
|
2967
|
+
if (e4.items && (Mi(e4.items, r2) || o3?.length > 0)) {
|
|
2968
|
+
let n3 = { ...r2.cache }, i3 = Math.max(s3, o3.length);
|
|
2969
|
+
for (let s4 = 0; s4 < i3; s4 += 1) {
|
|
2970
|
+
r2.cache = copy(n3);
|
|
2971
|
+
let i4 = { ...r2, disableRecursionLimit: true };
|
|
2972
|
+
o3[s4] = e4.items.getData(o3[s4] == null ? a3[s4] : o3[s4], i4);
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
return o3 || [];
|
|
2976
|
+
}
|
|
2977
|
+
if (e4.prefixItems) {
|
|
2978
|
+
let t2 = Array.isArray(n2) ? n2 : [], i3 = Math.max(s3 ?? 0, e4.prefixItems.length);
|
|
2979
|
+
for (let n3 = 0; n3 < i3; n3 += 1) {
|
|
2980
|
+
let i4 = e4.prefixItems[n3] ?? e4.items;
|
|
2981
|
+
if (i4 && Mi(i4, r2) || t2[n3] !== void 0) {
|
|
2982
|
+
let e5 = i4.getData(o3[n3] == null ? a3[n3] : o3[n3], r2);
|
|
2983
|
+
e5 !== void 0 && (o3[n3] = e5);
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
return o3 || [];
|
|
2987
|
+
}
|
|
2988
|
+
if (e4.items == null) return o3;
|
|
2989
|
+
if (e4.items && Mi(e4.items, r2) || n2?.length > 0) {
|
|
2990
|
+
let n3 = { ...r2.cache };
|
|
2991
|
+
for (let i3 = 0, c3 = Math.max(s3, o3.length); i3 < c3; i3 += 1) {
|
|
2992
|
+
r2.cache = copy(n3);
|
|
2993
|
+
let s4 = { ...r2, disableRecursionLimit: true }, c4 = e4.items.getData(o3[i3] == null ? a3[i3] : o3[i3], s4);
|
|
2994
|
+
if (c4 === void 0) return o3;
|
|
2995
|
+
o3[i3] = c4;
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
return o3;
|
|
2999
|
+
} };
|
|
3000
|
+
function Ii({ schema: e4 }, t2, n2, r2) {
|
|
3001
|
+
return t2 === void 0 ? e4.const ? e4.const : e4.default === void 0 && Array.isArray(e4.enum) ? e4.enum[0] : e4.default === void 0 && r2 !== false ? n2 : e4.default : Ni(e4.type, t2);
|
|
3002
|
+
}
|
|
3003
|
+
var Q = `items`;
|
|
3004
|
+
var Li = { id: Q, keyword: Q, parse: zi, addResolve: (e4) => e4[Q] != null, resolve: Ri, addValidate: (e4) => e4[Q] != null, validate: Bi };
|
|
3005
|
+
function Ri({ node: e4, key: t2 }) {
|
|
3006
|
+
if (!(e4.prefixItems && e4.prefixItems?.length > +t2)) return e4.items;
|
|
3007
|
+
}
|
|
3008
|
+
function zi(e4) {
|
|
3009
|
+
let t2 = e4.schema[Q];
|
|
3010
|
+
if (t2 != null) {
|
|
3011
|
+
if (!(M(t2) || N(t2))) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${Q}`, schema: e4.schema, value: t2, message: `Keyword '${Q}' must be a valid JSON Schema - received '${typeof t2}'` });
|
|
3012
|
+
if (t2 !== true) return e4[Q] = e4.compileSchema(t2, `${e4.evaluationPath}/${Q}`, `${e4.schemaLocation}/${Q}`), e4[Q].schemaValidation;
|
|
3013
|
+
}
|
|
3014
|
+
}
|
|
3015
|
+
function Bi({ node: e4, data: t2, pointer: n2 = `#`, path: r2 }) {
|
|
3016
|
+
let { schema: i2 } = e4;
|
|
3017
|
+
if (!Array.isArray(t2) || t2.length === 0 || Array.isArray(i2.prefixItems) && i2.prefixItems.length >= t2.length) return;
|
|
3018
|
+
if (i2.items === false) return Array.isArray(t2) && t2.length === 0 ? void 0 : e4.createError(`invalid-data-error`, { pointer: n2, value: t2, schema: i2 });
|
|
3019
|
+
let a3 = [];
|
|
3020
|
+
if (e4.items) {
|
|
3021
|
+
for (let o3 = i2.prefixItems?.length ?? 0; o3 < t2.length; o3 += 1) {
|
|
3022
|
+
let i3 = t2[o3], s3 = D(e4.items, i3, `${n2}/${o3}`, r2);
|
|
3023
|
+
s3 && a3.push(...s3);
|
|
3024
|
+
}
|
|
3025
|
+
return a3;
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
var Vi = `prefixItems`;
|
|
3029
|
+
var Hi = { id: Vi, keyword: Vi, parse: Wi, addResolve: (e4) => e4[Vi] != null, resolve: Ui, addValidate: (e4) => e4[Vi] != null, validate: Gi };
|
|
3030
|
+
function Ui({ node: e4, key: t2 }) {
|
|
3031
|
+
if (e4.prefixItems && e4.prefixItems[t2]) return e4.prefixItems[t2];
|
|
3032
|
+
}
|
|
3033
|
+
function Wi(e4) {
|
|
3034
|
+
let { schema: t2, evaluationPath: n2 } = e4;
|
|
3035
|
+
if (Array.isArray(t2.prefixItems)) return e4.prefixItems = t2.prefixItems.map((t3, r2) => e4.compileSchema(t3, `${n2}/${Vi}/${r2}`, `${e4.schemaLocation}/${Vi}/${r2}`)), L([], ...e4.prefixItems);
|
|
3036
|
+
}
|
|
3037
|
+
function Gi({ node: e4, data: t2, pointer: n2 = `#`, path: r2 }) {
|
|
3038
|
+
if (!Array.isArray(t2) || t2.length === 0) return;
|
|
3039
|
+
let i2 = [], a3 = e4[Vi];
|
|
3040
|
+
if (a3) {
|
|
3041
|
+
for (let e5 = 0; e5 < Math.min(a3.length, t2.length); e5 += 1) {
|
|
3042
|
+
let o3 = t2[e5], s3 = a3[e5], c3 = D(s3, o3, `${n2}/${e5}`, r2);
|
|
3043
|
+
i2.push(...c3);
|
|
3044
|
+
}
|
|
3045
|
+
return i2;
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
function Ki({ node: e4, data: t2, key: n2, pointer: r2, path: i2 }) {
|
|
3049
|
+
let a3 = A(t2, n2);
|
|
3050
|
+
if (e4.schema.unevaluatedItems === true || e4.schema.items === true || e4.contains && D(e4.contains, a3, `${r2}/${n2}`, i2).length === 0) return true;
|
|
3051
|
+
if (e4.allOf) {
|
|
3052
|
+
for (let a4 of e4.allOf) if (Ki({ node: a4, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
3053
|
+
}
|
|
3054
|
+
if (e4.anyOf) {
|
|
3055
|
+
for (let a4 of e4.anyOf) if (Ki({ node: a4, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
3056
|
+
}
|
|
3057
|
+
if (e4.oneOf) {
|
|
3058
|
+
for (let a4 of e4.oneOf) if (Ki({ node: a4, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
3059
|
+
}
|
|
3060
|
+
if (e4.if) {
|
|
3061
|
+
if (Ki({ node: e4.if, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
3062
|
+
let a4 = D(e4.if, t2, r2, i2).length === 0;
|
|
3063
|
+
if (a4 && e4.if.prefixItems && e4.if.prefixItems.length > n2) return true;
|
|
3064
|
+
if (a4 && e4.then) {
|
|
3065
|
+
if (Ki({ node: e4.then, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
3066
|
+
} else if (!a4 && e4.else && Ki({ node: e4.else, data: t2, key: n2, pointer: r2, path: i2 })) return true;
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
var qi = `unevaluatedItems`;
|
|
3070
|
+
var Ji = { id: qi, keyword: qi, parse: Yi, addValidate: ({ schema: e4 }) => e4.unevaluatedItems != null, validate: Xi };
|
|
3071
|
+
function Yi(e4) {
|
|
3072
|
+
let t2 = e4.schema[qi];
|
|
3073
|
+
if (t2 != null) {
|
|
3074
|
+
if (!(M(t2) || N(t2))) return e4.createError(`schema-error`, { pointer: `${e4.schemaLocation}/${qi}`, schema: e4.schema, value: t2, message: `Keyword '${qi}' must be a valid JSON Schema - received '${typeof t2}'` });
|
|
3075
|
+
if (!N(t2)) return e4.unevaluatedItems = e4.compileSchema(e4.schema.unevaluatedItems, `${e4.evaluationPath}/${qi}`, `${e4.schemaLocation}/${qi}`), e4.unevaluatedItems.schemaValidation;
|
|
3076
|
+
}
|
|
3077
|
+
}
|
|
3078
|
+
function Xi({ node: e4, data: t2, pointer: n2, path: r2 }) {
|
|
3079
|
+
let { schema: i2 } = e4;
|
|
3080
|
+
if (!Array.isArray(t2) || t2.length === 0 || i2.unevaluatedItems == null || i2.unevaluatedItems === true) return;
|
|
3081
|
+
let a3 = [];
|
|
3082
|
+
for (let o3 = 0; o3 < t2.length; o3 += 1) {
|
|
3083
|
+
if (Ki({ node: e4, data: t2, pointer: n2, key: o3, path: r2 })) continue;
|
|
3084
|
+
let s3 = t2[o3], { node: c3 } = e4.getNodeChild(o3, t2, { path: r2 });
|
|
3085
|
+
if (c3 === void 0) if (e4.unevaluatedItems) {
|
|
3086
|
+
let t3 = D(e4.unevaluatedItems, s3, `${n2}/${o3}`, r2);
|
|
3087
|
+
t3.length > 0 && a3.push(...t3);
|
|
3088
|
+
} else a3.push(e4.createError(`unevaluated-items-error`, { pointer: `${n2}/${o3}`, value: JSON.stringify(s3), schema: i2 }));
|
|
3089
|
+
if (c3 && D(c3, s3, `${n2}/${o3}`, r2).length > 0 && (e4.unevaluatedItems && e4.unevaluatedItems.validate(s3, `${n2}/${o3}`, r2).valid === false || e4.schema.unevaluatedItems === false)) return e4.createError(`unevaluated-items-error`, { pointer: `${n2}/${o3}`, value: JSON.stringify(s3), schema: i2 });
|
|
3090
|
+
}
|
|
3091
|
+
return a3;
|
|
3092
|
+
}
|
|
3093
|
+
var Zi = zr({ version: `draft-2020-12`, $schemaRegEx: `draft[/-]2020-?(12)?`, $schema: `https://json-schema.org/draft/2020-12/schema`, errors: Nt, formats: $t, methods: { createSchema: f, getData: Pi, getChildSelection: Ai, toDataNodes: Br }, keywords: [De, $e, rt, st, Qr, dt, Fe, St, ht, vt, Dt, At, ti, ai, Vt, li, Li, On, Mn, In, zn, Un, qn, Zn, tr, or, lr, sn, mr, vr, Hi, Cr, Or, Mr, Hr, Ji, Ei, Jr] });
|
|
3094
|
+
var { REGEX_FLAGS: Qi } = c2;
|
|
3095
|
+
var $i = [Zr, ci, pi, ki, Zi];
|
|
3096
|
+
function ea(e4, t2) {
|
|
3097
|
+
return e4.find((e5) => new RegExp(e5.$schemaRegEx, Qi).test(t2)) ?? e4[e4.length - 1];
|
|
3098
|
+
}
|
|
3099
|
+
function ta(e4, n2 = {}) {
|
|
3100
|
+
let r2 = n2.remote;
|
|
3101
|
+
if (Array.isArray(n2.remotes) && n2.remotes.length > 0 && !n2.remote) {
|
|
3102
|
+
let e5 = [...n2.remotes];
|
|
3103
|
+
e5.forEach((e6, t2) => {
|
|
3104
|
+
if (e6.$id == null) throw Error(`required $id on remotes[${t2}] is missing`);
|
|
3105
|
+
}), r2 = ta(e5.shift()), e5.forEach((e6) => r2?.addRemoteSchema(e6.$id, e6));
|
|
3106
|
+
}
|
|
3107
|
+
let i2 = n2.formatAssertion ?? true, a3 = n2.drafts ?? $i, o3 = ea(a3, M(e4) ? n2.draft ?? e4.$schema : void 0), c3 = { evaluationPath: `#`, lastIdPointer: `#`, schemaLocation: `#`, dynamicId: ``, reducers: [], resolvers: [], validators: [], schema: e4, context: { remotes: {}, dynamicAnchors: {}, ...r2?.context ?? {}, anchors: {}, refs: {}, ...copy(T(o3, `methods`, `keywords`, `version`, `formats`, `errors`)), draft: n2.draft, getDataDefaultOptions: n2.getDataDefaultOptions, throwOnInvalidRef: n2.throwOnInvalidRef ?? false, drafts: a3 }, ..._e };
|
|
3108
|
+
if (c3.context.rootNode = c3, c3.context.remotes[(M(e4) ? e4.$id : void 0) ?? `#`] = c3, r2) {
|
|
3109
|
+
let e5 = Pe(c3, c3.schema.$schema);
|
|
3110
|
+
if (j(e5) && e5.schema.$vocabulary) {
|
|
3111
|
+
let t2 = Object.keys(e5.schema.$vocabulary).find((e6) => e6.includes(`vocab/format-assertion`));
|
|
3112
|
+
t2 && i2 === `meta-schema` && (i2 = e5.schema.$vocabulary[t2] === true);
|
|
3113
|
+
let n3 = Object.keys(e5.getData({}, { addOptionalProps: true }));
|
|
3114
|
+
n3.length > 0 && (c3.context.keywords = c3.context.keywords.filter((e6) => n3.includes(e6.keyword)));
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
if (i2 === false && (c3.context.keywords = c3.context.keywords.filter((e5) => e5.keyword !== `format`)), !M(e4) && !N(e4)) return c3.schemaErrors = [c3.createError(`schema-error`, { pointer: `#`, schema: e4, value: void 0, message: `JSON schema must be object or boolean - reveived: '${e4}'` })], c3;
|
|
3118
|
+
let l2 = be(c3).filter((e5) => e5 != null);
|
|
3119
|
+
l2 = s2(l2);
|
|
3120
|
+
let u2 = [], d2 = [];
|
|
3121
|
+
if (l2.forEach((e5) => {
|
|
3122
|
+
P(e5) ? (e5.data.schemaId = c3.context.rootNode.$id ?? `#`, u2.push(e5)) : Ce(e5) && (e5.data.schemaId = c3.context.rootNode.$id ?? `#`, d2.push(e5));
|
|
3123
|
+
}), Array.isArray(r2?.schemaErrors) && u2.push(...r2.schemaErrors), Array.isArray(r2?.schemaAnnotations) && d2.push(...r2.schemaAnnotations), n2.throwOnInvalidSchema && u2.length > 0) {
|
|
3124
|
+
let e5 = Error(`Invalid schema passed to compileSchema`);
|
|
3125
|
+
throw e5.data = u2, e5;
|
|
3126
|
+
}
|
|
3127
|
+
return c3.schemaErrors = u2, c3.schemaAnnotations = d2, c3;
|
|
3128
|
+
}
|
|
3129
|
+
var na = Ir(Zi, { $schemaRegEx: `.`, keywords: [cn], errors: { "min-length-error": (e4) => e4.minLength === 1 ? { type: `error`, code: `min-length-one-error`, message: `An input is required`, data: e4 } : { type: `error`, code: `min-length-error`, message: E("Value in `{{pointer}}` is `{{length}}`, but should be `{{minLength}}` at minimum", e4), data: e4 } } });
|
|
3130
|
+
|
|
3131
|
+
// ../../../node_modules/.pnpm/json-schema-library@11.6.5/node_modules/json-schema-library/dist/remotes.mjs
|
|
3132
|
+
var e3 = [{ id: `http://json-schema.org/draft-04/schema#`, $schema: `http://json-schema.org/draft-04/schema#`, description: `Core schema meta-schema`, definitions: { schemaArray: { type: `array`, minItems: 1, items: { $ref: `#` } }, positiveInteger: { type: `integer`, minimum: 0 }, positiveIntegerDefault0: { allOf: [{ $ref: `#/definitions/positiveInteger` }, { default: 0 }] }, simpleTypes: { enum: [`array`, `boolean`, `integer`, `null`, `number`, `object`, `string`] }, stringArray: { type: `array`, items: { type: `string` }, minItems: 1, uniqueItems: true } }, type: `object`, properties: { id: { type: `string`, format: `uri` }, $schema: { type: `string`, format: `uri` }, title: { type: `string` }, description: { type: `string` }, default: {}, multipleOf: { type: `number`, minimum: 0, exclusiveMinimum: true }, maximum: { type: `number` }, exclusiveMaximum: { type: `boolean`, default: false }, minimum: { type: `number` }, exclusiveMinimum: { type: `boolean`, default: false }, maxLength: { $ref: `#/definitions/positiveInteger` }, minLength: { $ref: `#/definitions/positiveIntegerDefault0` }, pattern: { type: `string`, format: `regex` }, additionalItems: { anyOf: [{ type: `boolean` }, { $ref: `#` }], default: {} }, items: { anyOf: [{ $ref: `#` }, { $ref: `#/definitions/schemaArray` }], default: {} }, maxItems: { $ref: `#/definitions/positiveInteger` }, minItems: { $ref: `#/definitions/positiveIntegerDefault0` }, uniqueItems: { type: `boolean`, default: false }, maxProperties: { $ref: `#/definitions/positiveInteger` }, minProperties: { $ref: `#/definitions/positiveIntegerDefault0` }, required: { $ref: `#/definitions/stringArray` }, additionalProperties: { anyOf: [{ type: `boolean` }, { $ref: `#` }], default: {} }, definitions: { type: `object`, additionalProperties: { $ref: `#` }, default: {} }, properties: { type: `object`, additionalProperties: { $ref: `#` }, default: {} }, patternProperties: { type: `object`, additionalProperties: { $ref: `#` }, default: {} }, dependencies: { type: `object`, additionalProperties: { anyOf: [{ $ref: `#` }, { $ref: `#/definitions/stringArray` }] } }, enum: { type: `array`, minItems: 1, uniqueItems: true }, type: { anyOf: [{ $ref: `#/definitions/simpleTypes` }, { type: `array`, items: { $ref: `#/definitions/simpleTypes` }, minItems: 1, uniqueItems: true }] }, allOf: { $ref: `#/definitions/schemaArray` }, anyOf: { $ref: `#/definitions/schemaArray` }, oneOf: { $ref: `#/definitions/schemaArray` }, not: { $ref: `#` } }, dependencies: { exclusiveMaximum: [`maximum`], exclusiveMinimum: [`minimum`] }, default: {} }, { $schema: `http://json-schema.org/draft-06/schema#`, $id: `http://json-schema.org/draft-06/schema#`, title: `Core schema meta-schema`, definitions: { schemaArray: { type: `array`, minItems: 1, items: { $ref: `#` } }, nonNegativeInteger: { type: `integer`, minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [{ $ref: `#/definitions/nonNegativeInteger` }, { default: 0 }] }, simpleTypes: { enum: [`array`, `boolean`, `integer`, `null`, `number`, `object`, `string`] }, stringArray: { type: `array`, items: { type: `string` }, uniqueItems: true, default: [] } }, type: [`object`, `boolean`], properties: { $id: { type: `string`, format: `uri-reference` }, $schema: { type: `string`, format: `uri` }, $ref: { type: `string`, format: `uri-reference` }, title: { type: `string` }, description: { type: `string` }, default: {}, examples: { type: `array`, items: {} }, 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: {} }, maxItems: { $ref: `#/definitions/nonNegativeInteger` }, minItems: { $ref: `#/definitions/nonNegativeIntegerDefault0` }, uniqueItems: { type: `boolean`, default: false }, 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: {}, enum: { type: `array`, minItems: 1, uniqueItems: true }, type: { anyOf: [{ $ref: `#/definitions/simpleTypes` }, { type: `array`, items: { $ref: `#/definitions/simpleTypes` }, minItems: 1, uniqueItems: true }] }, format: { type: `string` }, allOf: { $ref: `#/definitions/schemaArray` }, anyOf: { $ref: `#/definitions/schemaArray` }, oneOf: { $ref: `#/definitions/schemaArray` }, not: { $ref: `#` } }, default: {} }, { $schema: `http://json-schema.org/draft-07/schema#`, $id: `http://json-schema.org/draft-07/schema#`, title: `Core schema meta-schema`, definitions: { schemaArray: { type: `array`, minItems: 1, items: { $ref: `#` } }, nonNegativeInteger: { type: `integer`, minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [{ $ref: `#/definitions/nonNegativeInteger` }, { default: 0 }] }, simpleTypes: { enum: [`array`, `boolean`, `integer`, `null`, `number`, `object`, `string`] }, stringArray: { type: `array`, items: { type: `string` }, uniqueItems: true, default: [] } }, type: [`object`, `boolean`], properties: { $id: { type: `string`, format: `uri-reference` }, $schema: { type: `string`, format: `uri` }, $ref: { type: `string`, format: `uri-reference` }, $comment: { type: `string` }, title: { type: `string` }, description: { type: `string` }, default: true, readOnly: { type: `boolean`, default: false }, writeOnly: { type: `boolean`, default: false }, examples: { type: `array`, items: true }, 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: true }, maxItems: { $ref: `#/definitions/nonNegativeInteger` }, minItems: { $ref: `#/definitions/nonNegativeIntegerDefault0` }, uniqueItems: { type: `boolean`, default: false }, 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: true, enum: { type: `array`, items: true, minItems: 1, uniqueItems: true }, type: { anyOf: [{ $ref: `#/definitions/simpleTypes` }, { type: `array`, items: { $ref: `#/definitions/simpleTypes` }, minItems: 1, uniqueItems: true }] }, format: { type: `string` }, contentMediaType: { type: `string` }, contentEncoding: { type: `string` }, if: { $ref: `#` }, then: { $ref: `#` }, else: { $ref: `#` }, allOf: { $ref: `#/definitions/schemaArray` }, anyOf: { $ref: `#/definitions/schemaArray` }, oneOf: { $ref: `#/definitions/schemaArray` }, not: { $ref: `#` } }, default: true }, { $schema: `https://json-schema.org/draft/2019-09/schema`, $id: `https://json-schema.org/draft/2019-09/schema`, $vocabulary: { "https://json-schema.org/draft/2019-09/vocab/core": true, "https://json-schema.org/draft/2019-09/vocab/applicator": true, "https://json-schema.org/draft/2019-09/vocab/validation": true, "https://json-schema.org/draft/2019-09/vocab/meta-data": true, "https://json-schema.org/draft/2019-09/vocab/format": false, "https://json-schema.org/draft/2019-09/vocab/content": true }, $recursiveAnchor: true, title: `Core and Validation specifications meta-schema`, allOf: [{ $ref: `meta/core` }, { $ref: `meta/applicator` }, { $ref: `meta/validation` }, { $ref: `meta/meta-data` }, { $ref: `meta/format` }, { $ref: `meta/content` }], type: [`object`, `boolean`], properties: { definitions: { $comment: `While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.`, type: `object`, additionalProperties: { $recursiveRef: `#` }, default: {} }, dependencies: { $comment: `"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"`, type: `object`, additionalProperties: { anyOf: [{ $recursiveRef: `#` }, { $ref: `meta/validation#/$defs/stringArray` }] } } } }, { $schema: `https://json-schema.org/draft/2019-09/schema`, $id: `https://json-schema.org/draft/2019-09/meta/applicator`, $recursiveAnchor: true, title: `Applicator vocabulary meta-schema`, type: [`object`, `boolean`], properties: { additionalItems: { $recursiveRef: `#` }, unevaluatedItems: { $recursiveRef: `#` }, items: { anyOf: [{ $recursiveRef: `#` }, { $ref: `#/$defs/schemaArray` }] }, contains: { $recursiveRef: `#` }, additionalProperties: { $recursiveRef: `#` }, unevaluatedProperties: { $recursiveRef: `#` }, properties: { type: `object`, additionalProperties: { $recursiveRef: `#` }, default: {} }, patternProperties: { type: `object`, additionalProperties: { $recursiveRef: `#` }, propertyNames: { format: `regex` }, default: {} }, dependentSchemas: { type: `object`, additionalProperties: { $recursiveRef: `#` } }, propertyNames: { $recursiveRef: `#` }, if: { $recursiveRef: `#` }, then: { $recursiveRef: `#` }, else: { $recursiveRef: `#` }, allOf: { $ref: `#/$defs/schemaArray` }, anyOf: { $ref: `#/$defs/schemaArray` }, oneOf: { $ref: `#/$defs/schemaArray` }, not: { $recursiveRef: `#` } }, $defs: { schemaArray: { type: `array`, minItems: 1, items: { $recursiveRef: `#` } } } }, { $schema: `https://json-schema.org/draft/2019-09/schema`, $id: `https://json-schema.org/draft/2019-09/meta/content`, $recursiveAnchor: true, title: `Content vocabulary meta-schema`, type: [`object`, `boolean`], properties: { contentMediaType: { type: `string` }, contentEncoding: { type: `string` }, contentSchema: { $recursiveRef: `#` } } }, { $schema: `https://json-schema.org/draft/2019-09/schema`, $id: `https://json-schema.org/draft/2019-09/meta/core`, $recursiveAnchor: true, title: `Core vocabulary meta-schema`, type: [`object`, `boolean`], properties: { $id: { type: `string`, format: `uri-reference`, $comment: `Non-empty fragments not allowed.`, pattern: `^[^#]*#?$` }, $schema: { type: `string`, format: `uri` }, $anchor: { type: `string`, pattern: `^[A-Za-z][-A-Za-z0-9.:_]*$` }, $ref: { type: `string`, format: `uri-reference` }, $recursiveRef: { type: `string`, format: `uri-reference` }, $recursiveAnchor: { type: `boolean`, default: false }, $vocabulary: { type: `object`, propertyNames: { type: `string`, format: `uri` }, additionalProperties: { type: `boolean` } }, $comment: { type: `string` }, $defs: { type: `object`, additionalProperties: { $recursiveRef: `#` }, default: {} } } }, { $schema: `https://json-schema.org/draft/2019-09/schema`, $id: `https://json-schema.org/draft/2019-09/meta/format`, $recursiveAnchor: true, title: `Format vocabulary meta-schema`, type: [`object`, `boolean`], properties: { format: { type: `string` } } }, { $schema: `https://json-schema.org/draft/2019-09/schema`, $id: `https://json-schema.org/draft/2019-09/meta/meta-data`, $recursiveAnchor: true, title: `Meta-data vocabulary meta-schema`, type: [`object`, `boolean`], properties: { title: { type: `string` }, description: { type: `string` }, default: true, deprecated: { type: `boolean`, default: false }, readOnly: { type: `boolean`, default: false }, writeOnly: { type: `boolean`, default: false }, examples: { type: `array`, items: true } } }, { $schema: `https://json-schema.org/draft/2019-09/schema`, $id: `https://json-schema.org/draft/2019-09/meta/validation`, $recursiveAnchor: true, title: `Validation vocabulary meta-schema`, type: [`object`, `boolean`], properties: { multipleOf: { type: `number`, exclusiveMinimum: 0 }, maximum: { type: `number` }, exclusiveMaximum: { type: `number` }, minimum: { type: `number` }, exclusiveMinimum: { type: `number` }, maxLength: { $ref: `#/$defs/nonNegativeInteger` }, minLength: { $ref: `#/$defs/nonNegativeIntegerDefault0` }, pattern: { type: `string`, format: `regex` }, maxItems: { $ref: `#/$defs/nonNegativeInteger` }, minItems: { $ref: `#/$defs/nonNegativeIntegerDefault0` }, uniqueItems: { type: `boolean`, default: false }, maxContains: { $ref: `#/$defs/nonNegativeInteger` }, minContains: { $ref: `#/$defs/nonNegativeInteger`, default: 1 }, maxProperties: { $ref: `#/$defs/nonNegativeInteger` }, minProperties: { $ref: `#/$defs/nonNegativeIntegerDefault0` }, required: { $ref: `#/$defs/stringArray` }, dependentRequired: { type: `object`, additionalProperties: { $ref: `#/$defs/stringArray` } }, const: true, enum: { type: `array`, items: true }, type: { anyOf: [{ $ref: `#/$defs/simpleTypes` }, { type: `array`, items: { $ref: `#/$defs/simpleTypes` }, minItems: 1, uniqueItems: true }] } }, $defs: { nonNegativeInteger: { type: `integer`, minimum: 0 }, nonNegativeIntegerDefault0: { $ref: `#/$defs/nonNegativeInteger`, default: 0 }, simpleTypes: { enum: [`array`, `boolean`, `integer`, `null`, `number`, `object`, `string`] }, stringArray: { type: `array`, items: { type: `string` }, uniqueItems: true, default: [] } } }, { $schema: `https://json-schema.org/draft/2020-12/schema`, $id: `https://json-schema.org/draft/2020-12/schema`, $vocabulary: { "https://json-schema.org/draft/2020-12/vocab/core": true, "https://json-schema.org/draft/2020-12/vocab/applicator": true, "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, "https://json-schema.org/draft/2020-12/vocab/validation": true, "https://json-schema.org/draft/2020-12/vocab/meta-data": true, "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, "https://json-schema.org/draft/2020-12/vocab/content": true }, $dynamicAnchor: `meta`, title: `Core and Validation specifications meta-schema`, allOf: [{ $ref: `meta/core` }, { $ref: `meta/applicator` }, { $ref: `meta/unevaluated` }, { $ref: `meta/validation` }, { $ref: `meta/meta-data` }, { $ref: `meta/format-annotation` }, { $ref: `meta/content` }], type: [`object`, `boolean`], $comment: `This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`, properties: { definitions: { $comment: `"definitions" has been replaced by "$defs".`, type: `object`, additionalProperties: { $dynamicRef: `#meta` }, deprecated: true, default: {} }, dependencies: { $comment: `"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`, type: `object`, additionalProperties: { anyOf: [{ $dynamicRef: `#meta` }, { $ref: `meta/validation#/$defs/stringArray` }] }, deprecated: true, default: {} }, $recursiveAnchor: { $comment: `"$recursiveAnchor" has been replaced by "$dynamicAnchor".`, $ref: `meta/core#/$defs/anchorString`, deprecated: true }, $recursiveRef: { $comment: `"$recursiveRef" has been replaced by "$dynamicRef".`, $ref: `meta/core#/$defs/uriReferenceString`, deprecated: true } } }, { $schema: `https://json-schema.org/draft/2020-12/schema`, $id: `https://json-schema.org/draft/2020-12/meta/applicator`, $dynamicAnchor: `meta`, title: `Applicator vocabulary meta-schema`, type: [`object`, `boolean`], properties: { prefixItems: { $ref: `#/$defs/schemaArray` }, items: { $dynamicRef: `#meta` }, contains: { $dynamicRef: `#meta` }, additionalProperties: { $dynamicRef: `#meta` }, properties: { type: `object`, additionalProperties: { $dynamicRef: `#meta` }, default: {} }, patternProperties: { type: `object`, additionalProperties: { $dynamicRef: `#meta` }, propertyNames: { format: `regex` }, default: {} }, dependentSchemas: { type: `object`, additionalProperties: { $dynamicRef: `#meta` }, default: {} }, propertyNames: { $dynamicRef: `#meta` }, if: { $dynamicRef: `#meta` }, then: { $dynamicRef: `#meta` }, else: { $dynamicRef: `#meta` }, allOf: { $ref: `#/$defs/schemaArray` }, anyOf: { $ref: `#/$defs/schemaArray` }, oneOf: { $ref: `#/$defs/schemaArray` }, not: { $dynamicRef: `#meta` } }, $defs: { schemaArray: { type: `array`, minItems: 1, items: { $dynamicRef: `#meta` } } } }, { $schema: `https://json-schema.org/draft/2020-12/schema`, $id: `https://json-schema.org/draft/2020-12/meta/content`, $dynamicAnchor: `meta`, title: `Content vocabulary meta-schema`, type: [`object`, `boolean`], properties: { contentEncoding: { type: `string` }, contentMediaType: { type: `string` }, contentSchema: { $dynamicRef: `#meta` } } }, { $schema: `https://json-schema.org/draft/2020-12/schema`, $id: `https://json-schema.org/draft/2020-12/meta/core`, $dynamicAnchor: `meta`, title: `Core vocabulary meta-schema`, type: [`object`, `boolean`], properties: { $id: { $ref: `#/$defs/uriReferenceString`, $comment: `Non-empty fragments not allowed.`, pattern: `^[^#]*#?$` }, $schema: { $ref: `#/$defs/uriString` }, $ref: { $ref: `#/$defs/uriReferenceString` }, $anchor: { $ref: `#/$defs/anchorString` }, $dynamicRef: { $ref: `#/$defs/uriReferenceString` }, $dynamicAnchor: { $ref: `#/$defs/anchorString` }, $vocabulary: { type: `object`, propertyNames: { $ref: `#/$defs/uriString` }, additionalProperties: { type: `boolean` } }, $comment: { type: `string` }, $defs: { type: `object`, additionalProperties: { $dynamicRef: `#meta` } } }, $defs: { anchorString: { type: `string`, pattern: `^[A-Za-z_][-A-Za-z0-9._]*$` }, uriString: { type: `string`, format: `uri` }, uriReferenceString: { type: `string`, format: `uri-reference` } } }, { $schema: `https://json-schema.org/draft/2020-12/schema`, $id: `https://json-schema.org/draft/2020-12/meta/format-annotation`, $dynamicAnchor: `meta`, title: `Format vocabulary meta-schema for annotation results`, type: [`object`, `boolean`], properties: { format: { type: `string` } } }, { $schema: `https://json-schema.org/draft/2020-12/schema`, $id: `https://json-schema.org/draft/2020-12/meta/format-assertion`, $dynamicAnchor: `meta`, title: `Format vocabulary meta-schema for assertion results`, type: [`object`, `boolean`], properties: { format: { type: `string` } } }, { $schema: `https://json-schema.org/draft/2020-12/schema`, $id: `https://json-schema.org/draft/2020-12/meta/meta-data`, $dynamicAnchor: `meta`, title: `Meta-data vocabulary meta-schema`, type: [`object`, `boolean`], properties: { title: { type: `string` }, description: { type: `string` }, default: true, deprecated: { type: `boolean`, default: false }, readOnly: { type: `boolean`, default: false }, writeOnly: { type: `boolean`, default: false }, examples: { type: `array`, items: true } } }, { $schema: `https://json-schema.org/draft/2020-12/schema`, $id: `https://json-schema.org/draft/2020-12/meta/unevaluated`, $dynamicAnchor: `meta`, title: `Unevaluated applicator vocabulary meta-schema`, type: [`object`, `boolean`], properties: { unevaluatedItems: { $dynamicRef: `#meta` }, unevaluatedProperties: { $dynamicRef: `#meta` } } }, { $schema: `https://json-schema.org/draft/2020-12/schema`, $id: `https://json-schema.org/draft/2020-12/meta/validation`, $dynamicAnchor: `meta`, title: `Validation vocabulary meta-schema`, type: [`object`, `boolean`], properties: { type: { anyOf: [{ $ref: `#/$defs/simpleTypes` }, { type: `array`, items: { $ref: `#/$defs/simpleTypes` }, minItems: 1, uniqueItems: true }] }, const: true, enum: { type: `array`, items: true }, multipleOf: { type: `number`, exclusiveMinimum: 0 }, maximum: { type: `number` }, exclusiveMaximum: { type: `number` }, minimum: { type: `number` }, exclusiveMinimum: { type: `number` }, maxLength: { $ref: `#/$defs/nonNegativeInteger` }, minLength: { $ref: `#/$defs/nonNegativeIntegerDefault0` }, pattern: { type: `string`, format: `regex` }, maxItems: { $ref: `#/$defs/nonNegativeInteger` }, minItems: { $ref: `#/$defs/nonNegativeIntegerDefault0` }, uniqueItems: { type: `boolean`, default: false }, maxContains: { $ref: `#/$defs/nonNegativeInteger` }, minContains: { $ref: `#/$defs/nonNegativeInteger`, default: 1 }, maxProperties: { $ref: `#/$defs/nonNegativeInteger` }, minProperties: { $ref: `#/$defs/nonNegativeIntegerDefault0` }, required: { $ref: `#/$defs/stringArray` }, dependentRequired: { type: `object`, additionalProperties: { $ref: `#/$defs/stringArray` } } }, $defs: { nonNegativeInteger: { type: `integer`, minimum: 0 }, nonNegativeIntegerDefault0: { $ref: `#/$defs/nonNegativeInteger`, default: 0 }, simpleTypes: { enum: [`array`, `boolean`, `integer`, `null`, `number`, `object`, `string`] }, stringArray: { type: `array`, items: { type: `string` }, uniqueItems: true, default: [] } } }];
|
|
3133
|
+
|
|
3134
|
+
// src/runtime/schema-validation.ts
|
|
3135
|
+
var SchemaIo = /* @__PURE__ */ ((SchemaIo2) => {
|
|
3136
|
+
SchemaIo2["Input"] = "input";
|
|
3137
|
+
SchemaIo2["Output"] = "output";
|
|
3138
|
+
return SchemaIo2;
|
|
3139
|
+
})(SchemaIo || {});
|
|
3140
|
+
var dialects = /* @__PURE__ */ new Set([
|
|
3141
|
+
"https://json-schema.org/draft/2020-12/schema",
|
|
3142
|
+
"https://json-schema.org/draft/2019-09/schema",
|
|
3143
|
+
"http://json-schema.org/draft-07/schema#",
|
|
3144
|
+
"https://json-schema.org/draft-07/schema#",
|
|
3145
|
+
"http://json-schema.org/draft-06/schema#",
|
|
3146
|
+
"https://json-schema.org/draft-06/schema#",
|
|
3147
|
+
"http://json-schema.org/draft-04/schema#",
|
|
3148
|
+
"https://json-schema.org/draft-04/schema#"
|
|
3149
|
+
]);
|
|
3150
|
+
var vocabularies = /* @__PURE__ */ new Set([
|
|
3151
|
+
"https://json-schema.org/draft/2020-12/vocab/core",
|
|
3152
|
+
"https://json-schema.org/draft/2020-12/vocab/applicator",
|
|
3153
|
+
"https://json-schema.org/draft/2020-12/vocab/validation",
|
|
3154
|
+
"https://json-schema.org/draft/2020-12/vocab/unevaluated",
|
|
3155
|
+
"https://json-schema.org/draft/2020-12/vocab/meta-data",
|
|
3156
|
+
"https://json-schema.org/draft/2020-12/vocab/format-annotation",
|
|
3157
|
+
"https://json-schema.org/draft/2020-12/vocab/format-assertion",
|
|
3158
|
+
"https://json-schema.org/draft/2020-12/vocab/content",
|
|
3159
|
+
"https://json-schema.org/draft/2019-09/vocab/core",
|
|
3160
|
+
"https://json-schema.org/draft/2019-09/vocab/applicator",
|
|
3161
|
+
"https://json-schema.org/draft/2019-09/vocab/validation",
|
|
3162
|
+
"https://json-schema.org/draft/2019-09/vocab/meta-data",
|
|
3163
|
+
"https://json-schema.org/draft/2019-09/vocab/format",
|
|
3164
|
+
"https://json-schema.org/draft/2019-09/vocab/content"
|
|
3165
|
+
]);
|
|
3166
|
+
var declarationSchema = looseObject({
|
|
3167
|
+
$schema: string().optional(),
|
|
3168
|
+
$vocabulary: record(string(), boolean()).optional()
|
|
3169
|
+
});
|
|
3170
|
+
var checkDialect = (value) => {
|
|
3171
|
+
if (boolean().safeParse(value).success) return;
|
|
3172
|
+
const schema = declarationSchema.parse(value);
|
|
3173
|
+
if (schema.$schema != null && !dialects.has(schema.$schema))
|
|
3174
|
+
throw new Error(`Unsupported JSON Schema dialect ${schema.$schema}`);
|
|
3175
|
+
for (const [name2, required] of Object.entries(schema.$vocabulary ?? {})) {
|
|
3176
|
+
if (required && !vocabularies.has(name2))
|
|
3177
|
+
throw new Error(`Unsupported required JSON Schema vocabulary ${name2}`);
|
|
3178
|
+
}
|
|
3179
|
+
};
|
|
3180
|
+
var dialectByVersion = {
|
|
3181
|
+
"draft-04": "http://json-schema.org/draft-04/schema#",
|
|
3182
|
+
"draft-06": "http://json-schema.org/draft-06/schema#",
|
|
3183
|
+
"draft-07": "http://json-schema.org/draft-07/schema#",
|
|
3184
|
+
"draft-2019-09": "https://json-schema.org/draft/2019-09/schema",
|
|
3185
|
+
"draft-2020-12": "https://json-schema.org/draft/2020-12/schema"
|
|
3186
|
+
};
|
|
3187
|
+
var metaRoot = null;
|
|
3188
|
+
var metaSchemas = () => {
|
|
3189
|
+
if (metaRoot != null) return metaRoot;
|
|
3190
|
+
const schemas = array(jsonObjectSchema).parse(e3).map((schema) => {
|
|
3191
|
+
const identity = string().parse(schema.$id ?? schema.id).replace(/#$/, "");
|
|
3192
|
+
const remote = { ...schema, $id: identity };
|
|
3193
|
+
if (schema.id != null) remote["id"] = identity;
|
|
3194
|
+
return remote;
|
|
3195
|
+
});
|
|
3196
|
+
metaRoot = ta(
|
|
3197
|
+
{},
|
|
3198
|
+
{ remotes: schemas, formatAssertion: true, throwOnInvalidRef: true }
|
|
3199
|
+
);
|
|
3200
|
+
return metaRoot;
|
|
3201
|
+
};
|
|
3202
|
+
var schemaKeywords = /* @__PURE__ */ new Set([
|
|
3203
|
+
"additionalItems",
|
|
3204
|
+
"additionalProperties",
|
|
3205
|
+
"contains",
|
|
3206
|
+
"propertyNames",
|
|
3207
|
+
"unevaluatedItems",
|
|
3208
|
+
"unevaluatedProperties",
|
|
3209
|
+
"not",
|
|
3210
|
+
"if",
|
|
3211
|
+
"then",
|
|
3212
|
+
"else"
|
|
3213
|
+
]);
|
|
3214
|
+
var schemaMaps = /* @__PURE__ */ new Set([
|
|
3215
|
+
"properties",
|
|
3216
|
+
"patternProperties",
|
|
3217
|
+
"$defs",
|
|
3218
|
+
"definitions",
|
|
3219
|
+
"dependentSchemas",
|
|
3220
|
+
"dependencies"
|
|
3221
|
+
]);
|
|
3222
|
+
var schemaArrays = /* @__PURE__ */ new Set(["allOf", "anyOf", "oneOf", "prefixItems"]);
|
|
3223
|
+
var childPlaceholder = (value) => jsonObjectSchema.safeParse(value).success ? {} : value;
|
|
3224
|
+
var shallowDeclaration = (schema) => Object.fromEntries(
|
|
3225
|
+
Object.entries(schema).map(([key, value]) => {
|
|
3226
|
+
if (schemaKeywords.has(key)) return [key, childPlaceholder(value)];
|
|
3227
|
+
if ((schemaArrays.has(key) || key === "items") && Array.isArray(value))
|
|
3228
|
+
return [key, value.map(childPlaceholder)];
|
|
3229
|
+
if (key === "items") return [key, childPlaceholder(value)];
|
|
3230
|
+
const object2 = jsonObjectSchema.safeParse(value);
|
|
3231
|
+
if (schemaMaps.has(key) && object2.success)
|
|
3232
|
+
return [
|
|
3233
|
+
key,
|
|
3234
|
+
Object.fromEntries(
|
|
3235
|
+
Object.entries(object2.data).map(([name2, child]) => [name2, childPlaceholder(child)])
|
|
3236
|
+
)
|
|
3237
|
+
];
|
|
3238
|
+
return [key, value];
|
|
3239
|
+
})
|
|
3240
|
+
);
|
|
3241
|
+
var checkDeclaration = (node) => {
|
|
3242
|
+
if (boolean().safeParse(node.schema).success) return;
|
|
3243
|
+
const schema = jsonObjectSchema.parse(node.schema);
|
|
3244
|
+
checkDialect(schema);
|
|
3245
|
+
const dialect = Object.entries(dialectByVersion).find(
|
|
3246
|
+
([version]) => version === node.context.version
|
|
3247
|
+
)?.[1];
|
|
3248
|
+
if (dialect == null) throw new Error(`Unsupported JSON Schema version ${node.context.version}`);
|
|
3249
|
+
const meta = metaSchemas().getNodeRef(dialect);
|
|
3250
|
+
if (!j(meta)) throw new Error(`Missing JSON Schema metaschema ${dialect}`);
|
|
3251
|
+
const result = meta.validate(shallowDeclaration(schema));
|
|
3252
|
+
if (!result.valid) throw new Error(result.errors.map((issue) => issue.message).join("; "));
|
|
3253
|
+
};
|
|
3254
|
+
var canonicalJson = (value) => {
|
|
3255
|
+
if (Array.isArray(value)) return value.map(canonicalJson);
|
|
3256
|
+
const object2 = jsonObjectSchema.safeParse(value);
|
|
3257
|
+
if (!object2.success) return value;
|
|
3258
|
+
return Object.fromEntries(
|
|
3259
|
+
Object.entries(object2.data).sort(([left], [right]) => left.localeCompare(right)).map(([key, item]) => [key, canonicalJson(item)])
|
|
3260
|
+
);
|
|
3261
|
+
};
|
|
3262
|
+
var validatorFor = (schema) => {
|
|
3263
|
+
const text = JSON.stringify(schema);
|
|
3264
|
+
if (text == null) throw new Error("Expected a JSON Schema object");
|
|
3265
|
+
const parsed = jsonObjectSchema.parse(canonicalJson(jsonObjectSchema.parse(JSON.parse(text))));
|
|
3266
|
+
checkDialect(parsed);
|
|
3267
|
+
const node = ta(parsed, { formatAssertion: true, throwOnInvalidRef: true });
|
|
3268
|
+
if (node.schemaErrors != null && node.schemaErrors.length > 0)
|
|
3269
|
+
throw new Error(node.schemaErrors.map((issue) => issue.message).join("; "));
|
|
3270
|
+
const nodes = /* @__PURE__ */ new Set([node, ...Object.values(node.context.refs)]);
|
|
3271
|
+
for (const child of nodes) {
|
|
3272
|
+
checkDeclaration(child);
|
|
3273
|
+
const ref = fieldOf(child.schema, "$ref") ?? fieldOf(child.schema, "$dynamicRef") ?? fieldOf(child.schema, "$recursiveRef");
|
|
3274
|
+
if (ref == null) continue;
|
|
3275
|
+
const resolved = child.resolveRef();
|
|
3276
|
+
if (!j(resolved))
|
|
3277
|
+
throw new Error(`Unresolved JSON Schema reference ${String(ref)} at ${child.schemaLocation}`);
|
|
3278
|
+
}
|
|
3279
|
+
return node;
|
|
3280
|
+
};
|
|
3281
|
+
var jsonSchemaError = (schema, value) => {
|
|
3282
|
+
const validator = validatorFor(schema);
|
|
3283
|
+
const parsed = jsonValueSchema.safeParse(value);
|
|
3284
|
+
if (!parsed.success) return "Expected a JSON-compatible value";
|
|
3285
|
+
const result = validator.validate(canonicalJson(parsed.data));
|
|
3286
|
+
return result.valid ? null : result.errors.map((issue) => issue.message).join("; ");
|
|
3287
|
+
};
|
|
3288
|
+
var jsonSchemaDeclarationError = (schema) => {
|
|
3289
|
+
try {
|
|
3290
|
+
validatorFor(schema);
|
|
3291
|
+
return null;
|
|
3292
|
+
} catch (cause) {
|
|
3293
|
+
return cause instanceof Error ? cause.message : String(cause);
|
|
3294
|
+
}
|
|
3295
|
+
};
|
|
3296
|
+
var standardValidatorSchema = looseObject({
|
|
3297
|
+
"~standard": looseObject({
|
|
3298
|
+
version: literal(1),
|
|
3299
|
+
vendor: string(),
|
|
3300
|
+
validate: callableSchema
|
|
3301
|
+
})
|
|
3302
|
+
});
|
|
3303
|
+
var validationResultSchema = looseObject({
|
|
3304
|
+
value: unknown().optional(),
|
|
3305
|
+
issues: array(looseObject({ message: string().optional() })).optional()
|
|
3306
|
+
});
|
|
3307
|
+
var validateSchemaValue = async (args) => {
|
|
3308
|
+
if (args.schema == null) return args.value;
|
|
3309
|
+
const standard = standardValidatorSchema.safeParse(args.schema);
|
|
3310
|
+
if (standard.success) {
|
|
3311
|
+
if (standard.data["~standard"].vendor === "zod") {
|
|
3312
|
+
const parser = callableSchema.safeParse(fieldOf(args.schema, "safeParseAsync"));
|
|
3313
|
+
if (parser.success) {
|
|
3314
|
+
const result2 = looseObject({
|
|
3315
|
+
success: boolean(),
|
|
3316
|
+
data: unknown().optional(),
|
|
3317
|
+
error: looseObject({ issues: array(object({ message: string() })) }).optional()
|
|
3318
|
+
}).parse(await parser.data.call(args.schema, args.value));
|
|
3319
|
+
if (!result2.success)
|
|
3320
|
+
throw new Error(
|
|
3321
|
+
`Invalid ${args.what}: ${result2.error?.issues.map((issue) => issue.message).join("; ") ?? "invalid"}`
|
|
3322
|
+
);
|
|
3323
|
+
return result2.data;
|
|
3324
|
+
}
|
|
3325
|
+
}
|
|
3326
|
+
const raw = await standard.data["~standard"].validate.call(
|
|
3327
|
+
fieldOf(args.schema, "~standard"),
|
|
3328
|
+
args.value
|
|
3329
|
+
);
|
|
3330
|
+
const result = validationResultSchema.parse(raw);
|
|
3331
|
+
if (result.issues != null)
|
|
3332
|
+
throw new Error(
|
|
3333
|
+
`Invalid ${args.what}: ${result.issues.map((issue) => issue.message ?? "invalid").join("; ") || "invalid"}`
|
|
3334
|
+
);
|
|
3335
|
+
if (!Object.hasOwn(result, "value"))
|
|
3336
|
+
throw new Error(`Invalid ${args.what}: schema validator returned no value`);
|
|
3337
|
+
return result.value;
|
|
3338
|
+
}
|
|
3339
|
+
const error = jsonSchemaError(args.schema, args.value);
|
|
3340
|
+
if (error != null) throw new Error(`Invalid ${args.what}: ${error}`);
|
|
3341
|
+
return args.value;
|
|
3342
|
+
};
|
|
3343
|
+
var resultMatchesSchema = (schema, value) => {
|
|
3344
|
+
if (schema == null) return true;
|
|
3345
|
+
try {
|
|
3346
|
+
const standard = standardValidatorSchema.safeParse(schema);
|
|
3347
|
+
if (!standard.success) return jsonSchemaError(schema, value) == null;
|
|
3348
|
+
const jsonSchemas = fieldOf(fieldOf(schema, "~standard"), "jsonSchema");
|
|
3349
|
+
const converter = callableSchema.safeParse(fieldOf(jsonSchemas, "output" /* Output */));
|
|
3350
|
+
if (!converter.success) return false;
|
|
3351
|
+
return jsonSchemaError(converter.data.call(jsonSchemas, { target: "draft-2020-12" }), value) == null;
|
|
3352
|
+
} catch {
|
|
3353
|
+
return false;
|
|
3354
|
+
}
|
|
3355
|
+
};
|
|
3356
|
+
|
|
3357
|
+
export {
|
|
3358
|
+
SchemaIo,
|
|
3359
|
+
jsonSchemaError,
|
|
3360
|
+
jsonSchemaDeclarationError,
|
|
3361
|
+
standardValidatorSchema,
|
|
3362
|
+
validateSchemaValue,
|
|
3363
|
+
resultMatchesSchema
|
|
3364
|
+
};
|