@agent-ix/quoin 0.14.0 → 0.17.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.
Files changed (89) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/default-modules.yaml +4 -4
  4. package/dist/advisor/advise.d.ts +57 -0
  5. package/dist/advisor/advise.d.ts.map +1 -0
  6. package/dist/advisor/index.d.ts +10 -0
  7. package/dist/advisor/index.d.ts.map +1 -0
  8. package/dist/advisor/methods.d.ts +60 -0
  9. package/dist/advisor/methods.d.ts.map +1 -0
  10. package/dist/advisor-Dhy9S7PS.js +63 -0
  11. package/dist/audit-CudnEJmh.js +127 -0
  12. package/dist/auditor/audit.d.ts +63 -0
  13. package/dist/auditor/audit.d.ts.map +1 -0
  14. package/dist/auditor/index.d.ts +8 -0
  15. package/dist/auditor/index.d.ts.map +1 -0
  16. package/dist/{base-BIELM-Fk.js → base-D_-Jy4cE.js} +2 -2
  17. package/dist/catalog.d.ts +1 -0
  18. package/dist/catalog.d.ts.map +1 -1
  19. package/dist/cli.js +1 -1
  20. package/dist/commands/advise.d.ts +16 -0
  21. package/dist/commands/advise.d.ts.map +1 -0
  22. package/dist/commands/advise.js +161 -0
  23. package/dist/commands/catalog/list.js +2 -2
  24. package/dist/commands/catalog/methods.d.ts +12 -0
  25. package/dist/commands/catalog/methods.d.ts.map +1 -0
  26. package/dist/commands/catalog/methods.js +43 -0
  27. package/dist/commands/catalog/show.js +2 -2
  28. package/dist/commands/catalog/validate.js +2 -2
  29. package/dist/commands/config/doctor.js +1 -1
  30. package/dist/commands/config/edit.js +1 -1
  31. package/dist/commands/config/get.js +1 -1
  32. package/dist/commands/config/set.js +1 -1
  33. package/dist/commands/evidence/affirm.d.ts +17 -0
  34. package/dist/commands/evidence/affirm.d.ts.map +1 -0
  35. package/dist/commands/evidence/affirm.js +67 -0
  36. package/dist/commands/evidence/audit.d.ts +16 -0
  37. package/dist/commands/evidence/audit.d.ts.map +1 -0
  38. package/dist/commands/evidence/audit.js +80 -0
  39. package/dist/commands/evidence/baseline.d.ts +14 -0
  40. package/dist/commands/evidence/baseline.d.ts.map +1 -0
  41. package/dist/commands/evidence/baseline.js +79 -0
  42. package/dist/commands/evidence/gc.d.ts +13 -0
  43. package/dist/commands/evidence/gc.d.ts.map +1 -0
  44. package/dist/commands/evidence/gc.js +34 -0
  45. package/dist/commands/evidence/index.d.ts +8 -0
  46. package/dist/commands/evidence/index.d.ts.map +1 -0
  47. package/dist/commands/evidence/index.js +18 -0
  48. package/dist/commands/evidence/record.d.ts +19 -0
  49. package/dist/commands/evidence/record.d.ts.map +1 -0
  50. package/dist/commands/evidence/record.js +72 -0
  51. package/dist/commands/matrix.js +1 -1
  52. package/dist/commands/module/ensure-defaults.js +3 -3
  53. package/dist/commands/module/install.js +2 -2
  54. package/dist/commands/module/list.js +2 -2
  55. package/dist/commands/module/remove.js +2 -2
  56. package/dist/commands/review.js +1 -1
  57. package/dist/commands/to-plan.js +1 -1
  58. package/dist/commands/update.js +2 -2
  59. package/dist/commands/write.js +3 -3
  60. package/dist/evidence/index.d.ts +13 -0
  61. package/dist/evidence/index.d.ts.map +1 -0
  62. package/dist/evidence/record.d.ts +58 -0
  63. package/dist/evidence/record.d.ts.map +1 -0
  64. package/dist/evidence/store.d.ts +147 -0
  65. package/dist/evidence/store.d.ts.map +1 -0
  66. package/dist/evidence/types.d.ts +143 -0
  67. package/dist/evidence/types.d.ts.map +1 -0
  68. package/dist/evidence-QUw0KyMH.js +209 -0
  69. package/dist/{flow-command-Cu3AeDeV.js → flow-command-B-ZBn9Sd.js} +1 -1
  70. package/dist/index.js +6 -6
  71. package/dist/{modules-BumGtAYj.js → modules-DSkUXhHn.js} +2 -2
  72. package/dist/{plugins-DkBB_VkF.js → plugins-DiS0OXoo.js} +1 -1
  73. package/dist/quire/contract.d.ts +82 -0
  74. package/dist/quire/contract.d.ts.map +1 -0
  75. package/dist/quire/exec.d.ts +44 -0
  76. package/dist/quire/exec.d.ts.map +1 -0
  77. package/dist/quire/index.d.ts +12 -0
  78. package/dist/quire/index.d.ts.map +1 -0
  79. package/dist/quire/types.d.ts +155 -0
  80. package/dist/quire/types.d.ts.map +1 -0
  81. package/dist/quire/validate.d.ts +34 -0
  82. package/dist/quire/validate.d.ts.map +1 -0
  83. package/dist/quire-D7ra5rUF.js +4926 -0
  84. package/dist/schemas/coverage-v1.schema.json +191 -0
  85. package/dist/schemas/properties-v1.schema.json +134 -0
  86. package/dist/{version-4FRTZpv_.js → version-DmZHxX4n.js} +1 -1
  87. package/dist/{write-UmBcjFtj.js → write-CPdSNIkF.js} +1 -1
  88. package/package.json +6 -2
  89. package/skills/spec-evidence-analysis/SKILL.md +79 -51
@@ -0,0 +1,4926 @@
1
+ import { readFileSync as e } from "node:fs";
2
+ import { dirname as t, join as n } from "node:path";
3
+ import { fileURLToPath as r } from "node:url";
4
+ import { execFileSync as i } from "node:child_process";
5
+ import "node:crypto";
6
+ //#region \0rolldown/runtime.js
7
+ var a = Object.defineProperty, o = Object.getOwnPropertyDescriptor, s = Object.getOwnPropertyNames, c = Object.prototype.hasOwnProperty, l = (e, t, n) => () => {
8
+ if (n) throw n[0];
9
+ try {
10
+ return e && (t = e(e = 0)), t;
11
+ } catch (e) {
12
+ throw n = [e], e;
13
+ }
14
+ }, u = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), d = (e, t) => {
15
+ let n = {};
16
+ for (var r in e) a(n, r, {
17
+ get: e[r],
18
+ enumerable: !0
19
+ });
20
+ return t || a(n, Symbol.toStringTag, { value: "Module" }), n;
21
+ }, f = (e, t, n, r) => {
22
+ if (t && typeof t == "object" || typeof t == "function") for (var i = s(t), l = 0, u = i.length, d; l < u; l++) d = i[l], !c.call(e, d) && d !== n && a(e, d, {
23
+ get: ((e) => t[e]).bind(null, d),
24
+ enumerable: !(r = o(t, d)) || r.enumerable
25
+ });
26
+ return e;
27
+ }, p = (e) => c.call(e, "module.exports") ? e["module.exports"] : f(a({}, "__esModule", { value: !0 }), e), m = {
28
+ sourceTag: "v0.29.0",
29
+ contractVersion: "v1",
30
+ minimumCli: "0.21.0",
31
+ hashes: {
32
+ "coverage-v1.schema.json": "bcc79e194a2f6c1a60d5345cf4f7947913fe0fe7dcde3f31989b9d9b8cecdbc3",
33
+ "properties-v1.schema.json": "d81f1ec85abdecd1f1664ded15e081f9aecb6c0f054d6b332b71e904cf826292"
34
+ }
35
+ }, h = t(r(import.meta.url));
36
+ function g(e) {
37
+ return n(h, "schemas", e);
38
+ }
39
+ function _(t) {
40
+ return JSON.parse(e(g(t), "utf8"));
41
+ }
42
+ function v(e) {
43
+ let t = /(\d+)\.(\d+)\.(\d+)/.exec(e);
44
+ return t ? t[0] : null;
45
+ }
46
+ function y(e, t) {
47
+ let n = e.split(".").map((e) => Number.parseInt(e, 10)), r = t.split(".").map((e) => Number.parseInt(e, 10));
48
+ for (let e = 0; e < 3; e += 1) {
49
+ let t = (n[e] ?? 0) - (r[e] ?? 0);
50
+ if (t !== 0) return t;
51
+ }
52
+ return 0;
53
+ }
54
+ function b(e) {
55
+ let t = e ? v(e) : null, n = m.minimumCli;
56
+ return t === null ? {
57
+ kind: "version-premise",
58
+ found: null,
59
+ required: n,
60
+ message: `could not determine the quire CLI version (expected >= ${n}). Install or update quire-cli: the JSON contract quoin reads is only emitted from ${n} onward.`
61
+ } : y(t, n) < 0 ? {
62
+ kind: "version-premise",
63
+ found: t,
64
+ required: n,
65
+ message: `quire ${t} is older than the ${n} this contract requires. Its JSON payloads predate the published schemas (quire-rs FR-055) and the obligation records (FR-053), so quoin would misread them rather than fail. Update quire-cli.`
66
+ } : null;
67
+ }
68
+ //#endregion
69
+ //#region node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js
70
+ var x = /* @__PURE__ */ u(((e) => {
71
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0;
72
+ var t = class {};
73
+ e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
74
+ var n = class extends t {
75
+ constructor(t) {
76
+ if (super(), !e.IDENTIFIER.test(t)) throw Error("CodeGen: name must be a valid identifier");
77
+ this.str = t;
78
+ }
79
+ toString() {
80
+ return this.str;
81
+ }
82
+ emptyStr() {
83
+ return !1;
84
+ }
85
+ get names() {
86
+ return { [this.str]: 1 };
87
+ }
88
+ };
89
+ e.Name = n;
90
+ var r = class extends t {
91
+ constructor(e) {
92
+ super(), this._items = typeof e == "string" ? [e] : e;
93
+ }
94
+ toString() {
95
+ return this.str;
96
+ }
97
+ emptyStr() {
98
+ if (this._items.length > 1) return !1;
99
+ let e = this._items[0];
100
+ return e === "" || e === "\"\"";
101
+ }
102
+ get str() {
103
+ return this._str ??= this._items.reduce((e, t) => `${e}${t}`, "");
104
+ }
105
+ get names() {
106
+ return this._names ??= this._items.reduce((e, t) => (t instanceof n && (e[t.str] = (e[t.str] || 0) + 1), e), {});
107
+ }
108
+ };
109
+ e._Code = r, e.nil = new r("");
110
+ function i(e, ...t) {
111
+ let n = [e[0]], i = 0;
112
+ for (; i < t.length;) s(n, t[i]), n.push(e[++i]);
113
+ return new r(n);
114
+ }
115
+ e._ = i;
116
+ var a = new r("+");
117
+ function o(e, ...t) {
118
+ let n = [p(e[0])], i = 0;
119
+ for (; i < t.length;) n.push(a), s(n, t[i]), n.push(a, p(e[++i]));
120
+ return c(n), new r(n);
121
+ }
122
+ e.str = o;
123
+ function s(e, t) {
124
+ t instanceof r ? e.push(...t._items) : t instanceof n ? e.push(t) : e.push(d(t));
125
+ }
126
+ e.addCodeArg = s;
127
+ function c(e) {
128
+ let t = 1;
129
+ for (; t < e.length - 1;) {
130
+ if (e[t] === a) {
131
+ let n = l(e[t - 1], e[t + 1]);
132
+ if (n !== void 0) {
133
+ e.splice(t - 1, 3, n);
134
+ continue;
135
+ }
136
+ e[t++] = "+";
137
+ }
138
+ t++;
139
+ }
140
+ }
141
+ function l(e, t) {
142
+ if (t === "\"\"") return e;
143
+ if (e === "\"\"") return t;
144
+ if (typeof e == "string") return t instanceof n || e[e.length - 1] !== "\"" ? void 0 : typeof t == "string" ? t[0] === "\"" ? e.slice(0, -1) + t.slice(1) : void 0 : `${e.slice(0, -1)}${t}"`;
145
+ if (typeof t == "string" && t[0] === "\"" && !(e instanceof n)) return `"${e}${t.slice(1)}`;
146
+ }
147
+ function u(e, t) {
148
+ return t.emptyStr() ? e : e.emptyStr() ? t : o`${e}${t}`;
149
+ }
150
+ e.strConcat = u;
151
+ function d(e) {
152
+ return typeof e == "number" || typeof e == "boolean" || e === null ? e : p(Array.isArray(e) ? e.join(",") : e);
153
+ }
154
+ function f(e) {
155
+ return new r(p(e));
156
+ }
157
+ e.stringify = f;
158
+ function p(e) {
159
+ return JSON.stringify(e).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
160
+ }
161
+ e.safeStringify = p;
162
+ function m(t) {
163
+ return typeof t == "string" && e.IDENTIFIER.test(t) ? new r(`.${t}`) : i`[${t}]`;
164
+ }
165
+ e.getProperty = m;
166
+ function h(t) {
167
+ if (typeof t == "string" && e.IDENTIFIER.test(t)) return new r(`${t}`);
168
+ throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`);
169
+ }
170
+ e.getEsmExportName = h;
171
+ function g(e) {
172
+ return new r(e.toString());
173
+ }
174
+ e.regexpCode = g;
175
+ })), S = /* @__PURE__ */ u(((e) => {
176
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0;
177
+ var t = x(), n = class extends Error {
178
+ constructor(e) {
179
+ super(`CodeGen: "code" for ${e} not defined`), this.value = e.value;
180
+ }
181
+ }, r;
182
+ (function(e) {
183
+ e[e.Started = 0] = "Started", e[e.Completed = 1] = "Completed";
184
+ })(r || (e.UsedValueState = r = {})), e.varKinds = {
185
+ const: new t.Name("const"),
186
+ let: new t.Name("let"),
187
+ var: new t.Name("var")
188
+ };
189
+ var i = class {
190
+ constructor({ prefixes: e, parent: t } = {}) {
191
+ this._names = {}, this._prefixes = e, this._parent = t;
192
+ }
193
+ toName(e) {
194
+ return e instanceof t.Name ? e : this.name(e);
195
+ }
196
+ name(e) {
197
+ return new t.Name(this._newName(e));
198
+ }
199
+ _newName(e) {
200
+ let t = this._names[e] || this._nameGroup(e);
201
+ return `${e}${t.index++}`;
202
+ }
203
+ _nameGroup(e) {
204
+ if ((this._parent?._prefixes)?.has(e) || this._prefixes && !this._prefixes.has(e)) throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);
205
+ return this._names[e] = {
206
+ prefix: e,
207
+ index: 0
208
+ };
209
+ }
210
+ };
211
+ e.Scope = i;
212
+ var a = class extends t.Name {
213
+ constructor(e, t) {
214
+ super(t), this.prefix = e;
215
+ }
216
+ setValue(e, { property: n, itemIndex: r }) {
217
+ this.value = e, this.scopePath = (0, t._)`.${new t.Name(n)}[${r}]`;
218
+ }
219
+ };
220
+ e.ValueScopeName = a;
221
+ var o = (0, t._)`\n`;
222
+ e.ValueScope = class extends i {
223
+ constructor(e) {
224
+ super(e), this._values = {}, this._scope = e.scope, this.opts = {
225
+ ...e,
226
+ _n: e.lines ? o : t.nil
227
+ };
228
+ }
229
+ get() {
230
+ return this._scope;
231
+ }
232
+ name(e) {
233
+ return new a(e, this._newName(e));
234
+ }
235
+ value(e, t) {
236
+ if (t.ref === void 0) throw Error("CodeGen: ref must be passed in value");
237
+ let n = this.toName(e), { prefix: r } = n, i = t.key ?? t.ref, a = this._values[r];
238
+ if (a) {
239
+ let e = a.get(i);
240
+ if (e) return e;
241
+ } else a = this._values[r] = /* @__PURE__ */ new Map();
242
+ a.set(i, n);
243
+ let o = this._scope[r] || (this._scope[r] = []), s = o.length;
244
+ return o[s] = t.ref, n.setValue(t, {
245
+ property: r,
246
+ itemIndex: s
247
+ }), n;
248
+ }
249
+ getValue(e, t) {
250
+ let n = this._values[e];
251
+ if (n) return n.get(t);
252
+ }
253
+ scopeRefs(e, n = this._values) {
254
+ return this._reduceValues(n, (n) => {
255
+ if (n.scopePath === void 0) throw Error(`CodeGen: name "${n}" has no value`);
256
+ return (0, t._)`${e}${n.scopePath}`;
257
+ });
258
+ }
259
+ scopeCode(e = this._values, t, n) {
260
+ return this._reduceValues(e, (e) => {
261
+ if (e.value === void 0) throw Error(`CodeGen: name "${e}" has no value`);
262
+ return e.value.code;
263
+ }, t, n);
264
+ }
265
+ _reduceValues(i, a, o = {}, s) {
266
+ let c = t.nil;
267
+ for (let l in i) {
268
+ let u = i[l];
269
+ if (!u) continue;
270
+ let d = o[l] = o[l] || /* @__PURE__ */ new Map();
271
+ u.forEach((i) => {
272
+ if (d.has(i)) return;
273
+ d.set(i, r.Started);
274
+ let o = a(i);
275
+ if (o) {
276
+ let n = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
277
+ c = (0, t._)`${c}${n} ${i} = ${o};${this.opts._n}`;
278
+ } else if (o = s?.(i)) c = (0, t._)`${c}${o}${this.opts._n}`;
279
+ else throw new n(i);
280
+ d.set(i, r.Completed);
281
+ });
282
+ }
283
+ return c;
284
+ }
285
+ };
286
+ })), C = /* @__PURE__ */ u(((e) => {
287
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0;
288
+ var t = x(), n = S(), r = x();
289
+ Object.defineProperty(e, "_", {
290
+ enumerable: !0,
291
+ get: function() {
292
+ return r._;
293
+ }
294
+ }), Object.defineProperty(e, "str", {
295
+ enumerable: !0,
296
+ get: function() {
297
+ return r.str;
298
+ }
299
+ }), Object.defineProperty(e, "strConcat", {
300
+ enumerable: !0,
301
+ get: function() {
302
+ return r.strConcat;
303
+ }
304
+ }), Object.defineProperty(e, "nil", {
305
+ enumerable: !0,
306
+ get: function() {
307
+ return r.nil;
308
+ }
309
+ }), Object.defineProperty(e, "getProperty", {
310
+ enumerable: !0,
311
+ get: function() {
312
+ return r.getProperty;
313
+ }
314
+ }), Object.defineProperty(e, "stringify", {
315
+ enumerable: !0,
316
+ get: function() {
317
+ return r.stringify;
318
+ }
319
+ }), Object.defineProperty(e, "regexpCode", {
320
+ enumerable: !0,
321
+ get: function() {
322
+ return r.regexpCode;
323
+ }
324
+ }), Object.defineProperty(e, "Name", {
325
+ enumerable: !0,
326
+ get: function() {
327
+ return r.Name;
328
+ }
329
+ });
330
+ var i = S();
331
+ Object.defineProperty(e, "Scope", {
332
+ enumerable: !0,
333
+ get: function() {
334
+ return i.Scope;
335
+ }
336
+ }), Object.defineProperty(e, "ValueScope", {
337
+ enumerable: !0,
338
+ get: function() {
339
+ return i.ValueScope;
340
+ }
341
+ }), Object.defineProperty(e, "ValueScopeName", {
342
+ enumerable: !0,
343
+ get: function() {
344
+ return i.ValueScopeName;
345
+ }
346
+ }), Object.defineProperty(e, "varKinds", {
347
+ enumerable: !0,
348
+ get: function() {
349
+ return i.varKinds;
350
+ }
351
+ }), e.operators = {
352
+ GT: new t._Code(">"),
353
+ GTE: new t._Code(">="),
354
+ LT: new t._Code("<"),
355
+ LTE: new t._Code("<="),
356
+ EQ: new t._Code("==="),
357
+ NEQ: new t._Code("!=="),
358
+ NOT: new t._Code("!"),
359
+ OR: new t._Code("||"),
360
+ AND: new t._Code("&&"),
361
+ ADD: new t._Code("+")
362
+ };
363
+ var a = class {
364
+ optimizeNodes() {
365
+ return this;
366
+ }
367
+ optimizeNames(e, t) {
368
+ return this;
369
+ }
370
+ }, o = class extends a {
371
+ constructor(e, t, n) {
372
+ super(), this.varKind = e, this.name = t, this.rhs = n;
373
+ }
374
+ render({ es5: e, _n: t }) {
375
+ let r = e ? n.varKinds.var : this.varKind, i = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
376
+ return `${r} ${this.name}${i};` + t;
377
+ }
378
+ optimizeNames(e, t) {
379
+ if (e[this.name.str]) return this.rhs &&= j(this.rhs, e, t), this;
380
+ }
381
+ get names() {
382
+ return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
383
+ }
384
+ }, s = class extends a {
385
+ constructor(e, t, n) {
386
+ super(), this.lhs = e, this.rhs = t, this.sideEffects = n;
387
+ }
388
+ render({ _n: e }) {
389
+ return `${this.lhs} = ${this.rhs};` + e;
390
+ }
391
+ optimizeNames(e, n) {
392
+ if (!(this.lhs instanceof t.Name && !e[this.lhs.str] && !this.sideEffects)) return this.rhs = j(this.rhs, e, n), this;
393
+ }
394
+ get names() {
395
+ return A(this.lhs instanceof t.Name ? {} : { ...this.lhs.names }, this.rhs);
396
+ }
397
+ }, c = class extends s {
398
+ constructor(e, t, n, r) {
399
+ super(e, n, r), this.op = t;
400
+ }
401
+ render({ _n: e }) {
402
+ return `${this.lhs} ${this.op}= ${this.rhs};` + e;
403
+ }
404
+ }, l = class extends a {
405
+ constructor(e) {
406
+ super(), this.label = e, this.names = {};
407
+ }
408
+ render({ _n: e }) {
409
+ return `${this.label}:` + e;
410
+ }
411
+ }, u = class extends a {
412
+ constructor(e) {
413
+ super(), this.label = e, this.names = {};
414
+ }
415
+ render({ _n: e }) {
416
+ return `break${this.label ? ` ${this.label}` : ""};` + e;
417
+ }
418
+ }, d = class extends a {
419
+ constructor(e) {
420
+ super(), this.error = e;
421
+ }
422
+ render({ _n: e }) {
423
+ return `throw ${this.error};` + e;
424
+ }
425
+ get names() {
426
+ return this.error.names;
427
+ }
428
+ }, f = class extends a {
429
+ constructor(e) {
430
+ super(), this.code = e;
431
+ }
432
+ render({ _n: e }) {
433
+ return `${this.code};` + e;
434
+ }
435
+ optimizeNodes() {
436
+ return `${this.code}` ? this : void 0;
437
+ }
438
+ optimizeNames(e, t) {
439
+ return this.code = j(this.code, e, t), this;
440
+ }
441
+ get names() {
442
+ return this.code instanceof t._CodeOrName ? this.code.names : {};
443
+ }
444
+ }, p = class extends a {
445
+ constructor(e = []) {
446
+ super(), this.nodes = e;
447
+ }
448
+ render(e) {
449
+ return this.nodes.reduce((t, n) => t + n.render(e), "");
450
+ }
451
+ optimizeNodes() {
452
+ let { nodes: e } = this, t = e.length;
453
+ for (; t--;) {
454
+ let n = e[t].optimizeNodes();
455
+ Array.isArray(n) ? e.splice(t, 1, ...n) : n ? e[t] = n : e.splice(t, 1);
456
+ }
457
+ return e.length > 0 ? this : void 0;
458
+ }
459
+ optimizeNames(e, t) {
460
+ let { nodes: n } = this, r = n.length;
461
+ for (; r--;) {
462
+ let i = n[r];
463
+ i.optimizeNames(e, t) || (M(e, i.names), n.splice(r, 1));
464
+ }
465
+ return n.length > 0 ? this : void 0;
466
+ }
467
+ get names() {
468
+ return this.nodes.reduce((e, t) => k(e, t.names), {});
469
+ }
470
+ }, m = class extends p {
471
+ render(e) {
472
+ return "{" + e._n + super.render(e) + "}" + e._n;
473
+ }
474
+ }, h = class extends p {}, g = class extends m {};
475
+ g.kind = "else";
476
+ var _ = class e extends m {
477
+ constructor(e, t) {
478
+ super(t), this.condition = e;
479
+ }
480
+ render(e) {
481
+ let t = `if(${this.condition})` + super.render(e);
482
+ return this.else && (t += "else " + this.else.render(e)), t;
483
+ }
484
+ optimizeNodes() {
485
+ super.optimizeNodes();
486
+ let t = this.condition;
487
+ if (t === !0) return this.nodes;
488
+ let n = this.else;
489
+ if (n) {
490
+ let e = n.optimizeNodes();
491
+ n = this.else = Array.isArray(e) ? new g(e) : e;
492
+ }
493
+ if (n) return t === !1 ? n instanceof e ? n : n.nodes : this.nodes.length ? this : new e(N(t), n instanceof e ? [n] : n.nodes);
494
+ if (!(t === !1 || !this.nodes.length)) return this;
495
+ }
496
+ optimizeNames(e, t) {
497
+ if (this.else = this.else?.optimizeNames(e, t), super.optimizeNames(e, t) || this.else) return this.condition = j(this.condition, e, t), this;
498
+ }
499
+ get names() {
500
+ let e = super.names;
501
+ return A(e, this.condition), this.else && k(e, this.else.names), e;
502
+ }
503
+ };
504
+ _.kind = "if";
505
+ var v = class extends m {};
506
+ v.kind = "for";
507
+ var y = class extends v {
508
+ constructor(e) {
509
+ super(), this.iteration = e;
510
+ }
511
+ render(e) {
512
+ return `for(${this.iteration})` + super.render(e);
513
+ }
514
+ optimizeNames(e, t) {
515
+ if (super.optimizeNames(e, t)) return this.iteration = j(this.iteration, e, t), this;
516
+ }
517
+ get names() {
518
+ return k(super.names, this.iteration.names);
519
+ }
520
+ }, b = class extends v {
521
+ constructor(e, t, n, r) {
522
+ super(), this.varKind = e, this.name = t, this.from = n, this.to = r;
523
+ }
524
+ render(e) {
525
+ let t = e.es5 ? n.varKinds.var : this.varKind, { name: r, from: i, to: a } = this;
526
+ return `for(${t} ${r}=${i}; ${r}<${a}; ${r}++)` + super.render(e);
527
+ }
528
+ get names() {
529
+ return A(A(super.names, this.from), this.to);
530
+ }
531
+ }, C = class extends v {
532
+ constructor(e, t, n, r) {
533
+ super(), this.loop = e, this.varKind = t, this.name = n, this.iterable = r;
534
+ }
535
+ render(e) {
536
+ return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(e);
537
+ }
538
+ optimizeNames(e, t) {
539
+ if (super.optimizeNames(e, t)) return this.iterable = j(this.iterable, e, t), this;
540
+ }
541
+ get names() {
542
+ return k(super.names, this.iterable.names);
543
+ }
544
+ }, w = class extends m {
545
+ constructor(e, t, n) {
546
+ super(), this.name = e, this.args = t, this.async = n;
547
+ }
548
+ render(e) {
549
+ return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(e);
550
+ }
551
+ };
552
+ w.kind = "func";
553
+ var T = class extends p {
554
+ render(e) {
555
+ return "return " + super.render(e);
556
+ }
557
+ };
558
+ T.kind = "return";
559
+ var E = class extends m {
560
+ render(e) {
561
+ let t = "try" + super.render(e);
562
+ return this.catch && (t += this.catch.render(e)), this.finally && (t += this.finally.render(e)), t;
563
+ }
564
+ optimizeNodes() {
565
+ var e, t;
566
+ return super.optimizeNodes(), (e = this.catch) == null || e.optimizeNodes(), (t = this.finally) == null || t.optimizeNodes(), this;
567
+ }
568
+ optimizeNames(e, t) {
569
+ var n, r;
570
+ return super.optimizeNames(e, t), (n = this.catch) == null || n.optimizeNames(e, t), (r = this.finally) == null || r.optimizeNames(e, t), this;
571
+ }
572
+ get names() {
573
+ let e = super.names;
574
+ return this.catch && k(e, this.catch.names), this.finally && k(e, this.finally.names), e;
575
+ }
576
+ }, D = class extends m {
577
+ constructor(e) {
578
+ super(), this.error = e;
579
+ }
580
+ render(e) {
581
+ return `catch(${this.error})` + super.render(e);
582
+ }
583
+ };
584
+ D.kind = "catch";
585
+ var O = class extends m {
586
+ render(e) {
587
+ return "finally" + super.render(e);
588
+ }
589
+ };
590
+ O.kind = "finally", e.CodeGen = class {
591
+ constructor(e, t = {}) {
592
+ this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = {
593
+ ...t,
594
+ _n: t.lines ? "\n" : ""
595
+ }, this._extScope = e, this._scope = new n.Scope({ parent: e }), this._nodes = [new h()];
596
+ }
597
+ toString() {
598
+ return this._root.render(this.opts);
599
+ }
600
+ name(e) {
601
+ return this._scope.name(e);
602
+ }
603
+ scopeName(e) {
604
+ return this._extScope.name(e);
605
+ }
606
+ scopeValue(e, t) {
607
+ let n = this._extScope.value(e, t);
608
+ return (this._values[n.prefix] || (this._values[n.prefix] = /* @__PURE__ */ new Set())).add(n), n;
609
+ }
610
+ getScopeValue(e, t) {
611
+ return this._extScope.getValue(e, t);
612
+ }
613
+ scopeRefs(e) {
614
+ return this._extScope.scopeRefs(e, this._values);
615
+ }
616
+ scopeCode() {
617
+ return this._extScope.scopeCode(this._values);
618
+ }
619
+ _def(e, t, n, r) {
620
+ let i = this._scope.toName(t);
621
+ return n !== void 0 && r && (this._constants[i.str] = n), this._leafNode(new o(e, i, n)), i;
622
+ }
623
+ const(e, t, r) {
624
+ return this._def(n.varKinds.const, e, t, r);
625
+ }
626
+ let(e, t, r) {
627
+ return this._def(n.varKinds.let, e, t, r);
628
+ }
629
+ var(e, t, r) {
630
+ return this._def(n.varKinds.var, e, t, r);
631
+ }
632
+ assign(e, t, n) {
633
+ return this._leafNode(new s(e, t, n));
634
+ }
635
+ add(t, n) {
636
+ return this._leafNode(new c(t, e.operators.ADD, n));
637
+ }
638
+ code(e) {
639
+ return typeof e == "function" ? e() : e !== t.nil && this._leafNode(new f(e)), this;
640
+ }
641
+ object(...e) {
642
+ let n = ["{"];
643
+ for (let [r, i] of e) n.length > 1 && n.push(","), n.push(r), (r !== i || this.opts.es5) && (n.push(":"), (0, t.addCodeArg)(n, i));
644
+ return n.push("}"), new t._Code(n);
645
+ }
646
+ if(e, t, n) {
647
+ if (this._blockNode(new _(e)), t && n) this.code(t).else().code(n).endIf();
648
+ else if (t) this.code(t).endIf();
649
+ else if (n) throw Error("CodeGen: \"else\" body without \"then\" body");
650
+ return this;
651
+ }
652
+ elseIf(e) {
653
+ return this._elseNode(new _(e));
654
+ }
655
+ else() {
656
+ return this._elseNode(new g());
657
+ }
658
+ endIf() {
659
+ return this._endBlockNode(_, g);
660
+ }
661
+ _for(e, t) {
662
+ return this._blockNode(e), t && this.code(t).endFor(), this;
663
+ }
664
+ for(e, t) {
665
+ return this._for(new y(e), t);
666
+ }
667
+ forRange(e, t, r, i, a = this.opts.es5 ? n.varKinds.var : n.varKinds.let) {
668
+ let o = this._scope.toName(e);
669
+ return this._for(new b(a, o, t, r), () => i(o));
670
+ }
671
+ forOf(e, r, i, a = n.varKinds.const) {
672
+ let o = this._scope.toName(e);
673
+ if (this.opts.es5) {
674
+ let e = r instanceof t.Name ? r : this.var("_arr", r);
675
+ return this.forRange("_i", 0, (0, t._)`${e}.length`, (n) => {
676
+ this.var(o, (0, t._)`${e}[${n}]`), i(o);
677
+ });
678
+ }
679
+ return this._for(new C("of", a, o, r), () => i(o));
680
+ }
681
+ forIn(e, r, i, a = this.opts.es5 ? n.varKinds.var : n.varKinds.const) {
682
+ if (this.opts.ownProperties) return this.forOf(e, (0, t._)`Object.keys(${r})`, i);
683
+ let o = this._scope.toName(e);
684
+ return this._for(new C("in", a, o, r), () => i(o));
685
+ }
686
+ endFor() {
687
+ return this._endBlockNode(v);
688
+ }
689
+ label(e) {
690
+ return this._leafNode(new l(e));
691
+ }
692
+ break(e) {
693
+ return this._leafNode(new u(e));
694
+ }
695
+ return(e) {
696
+ let t = new T();
697
+ if (this._blockNode(t), this.code(e), t.nodes.length !== 1) throw Error("CodeGen: \"return\" should have one node");
698
+ return this._endBlockNode(T);
699
+ }
700
+ try(e, t, n) {
701
+ if (!t && !n) throw Error("CodeGen: \"try\" without \"catch\" and \"finally\"");
702
+ let r = new E();
703
+ if (this._blockNode(r), this.code(e), t) {
704
+ let e = this.name("e");
705
+ this._currNode = r.catch = new D(e), t(e);
706
+ }
707
+ return n && (this._currNode = r.finally = new O(), this.code(n)), this._endBlockNode(D, O);
708
+ }
709
+ throw(e) {
710
+ return this._leafNode(new d(e));
711
+ }
712
+ block(e, t) {
713
+ return this._blockStarts.push(this._nodes.length), e && this.code(e).endBlock(t), this;
714
+ }
715
+ endBlock(e) {
716
+ let t = this._blockStarts.pop();
717
+ if (t === void 0) throw Error("CodeGen: not in self-balancing block");
718
+ let n = this._nodes.length - t;
719
+ if (n < 0 || e !== void 0 && n !== e) throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);
720
+ return this._nodes.length = t, this;
721
+ }
722
+ func(e, n = t.nil, r, i) {
723
+ return this._blockNode(new w(e, n, r)), i && this.code(i).endFunc(), this;
724
+ }
725
+ endFunc() {
726
+ return this._endBlockNode(w);
727
+ }
728
+ optimize(e = 1) {
729
+ for (; e-- > 0;) this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants);
730
+ }
731
+ _leafNode(e) {
732
+ return this._currNode.nodes.push(e), this;
733
+ }
734
+ _blockNode(e) {
735
+ this._currNode.nodes.push(e), this._nodes.push(e);
736
+ }
737
+ _endBlockNode(e, t) {
738
+ let n = this._currNode;
739
+ if (n instanceof e || t && n instanceof t) return this._nodes.pop(), this;
740
+ throw Error(`CodeGen: not in block "${t ? `${e.kind}/${t.kind}` : e.kind}"`);
741
+ }
742
+ _elseNode(e) {
743
+ let t = this._currNode;
744
+ if (!(t instanceof _)) throw Error("CodeGen: \"else\" without \"if\"");
745
+ return this._currNode = t.else = e, this;
746
+ }
747
+ get _root() {
748
+ return this._nodes[0];
749
+ }
750
+ get _currNode() {
751
+ let e = this._nodes;
752
+ return e[e.length - 1];
753
+ }
754
+ set _currNode(e) {
755
+ let t = this._nodes;
756
+ t[t.length - 1] = e;
757
+ }
758
+ };
759
+ function k(e, t) {
760
+ for (let n in t) e[n] = (e[n] || 0) + (t[n] || 0);
761
+ return e;
762
+ }
763
+ function A(e, n) {
764
+ return n instanceof t._CodeOrName ? k(e, n.names) : e;
765
+ }
766
+ function j(e, n, r) {
767
+ if (e instanceof t.Name) return i(e);
768
+ if (!a(e)) return e;
769
+ return new t._Code(e._items.reduce((e, n) => (n instanceof t.Name && (n = i(n)), n instanceof t._Code ? e.push(...n._items) : e.push(n), e), []));
770
+ function i(e) {
771
+ let t = r[e.str];
772
+ return t === void 0 || n[e.str] !== 1 ? e : (delete n[e.str], t);
773
+ }
774
+ function a(e) {
775
+ return e instanceof t._Code && e._items.some((e) => e instanceof t.Name && n[e.str] === 1 && r[e.str] !== void 0);
776
+ }
777
+ }
778
+ function M(e, t) {
779
+ for (let n in t) e[n] = (e[n] || 0) - (t[n] || 0);
780
+ }
781
+ function N(e) {
782
+ return typeof e == "boolean" || typeof e == "number" || e === null ? !e : (0, t._)`!${z(e)}`;
783
+ }
784
+ e.not = N;
785
+ var P = R(e.operators.AND);
786
+ function F(...e) {
787
+ return e.reduce(P);
788
+ }
789
+ e.and = F;
790
+ var I = R(e.operators.OR);
791
+ function L(...e) {
792
+ return e.reduce(I);
793
+ }
794
+ e.or = L;
795
+ function R(e) {
796
+ return (n, r) => n === t.nil ? r : r === t.nil ? n : (0, t._)`${z(n)} ${e} ${z(r)}`;
797
+ }
798
+ function z(e) {
799
+ return e instanceof t.Name ? e : (0, t._)`(${e})`;
800
+ }
801
+ })), w = /* @__PURE__ */ u(((e) => {
802
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.checkStrictMode = e.getErrorPath = e.Type = e.useFunc = e.setEvaluated = e.evaluatedPropsToName = e.mergeEvaluated = e.eachItem = e.unescapeJsonPointer = e.escapeJsonPointer = e.escapeFragment = e.unescapeFragment = e.schemaRefOrVal = e.schemaHasRulesButRef = e.schemaHasRules = e.checkUnknownRules = e.alwaysValidSchema = e.toHash = void 0;
803
+ var t = C(), n = x();
804
+ function r(e) {
805
+ let t = {};
806
+ for (let n of e) t[n] = !0;
807
+ return t;
808
+ }
809
+ e.toHash = r;
810
+ function i(e, t) {
811
+ return typeof t == "boolean" ? t : Object.keys(t).length === 0 || (a(e, t), !o(t, e.self.RULES.all));
812
+ }
813
+ e.alwaysValidSchema = i;
814
+ function a(e, t = e.schema) {
815
+ let { opts: n, self: r } = e;
816
+ if (!n.strictSchema || typeof t == "boolean") return;
817
+ let i = r.RULES.keywords;
818
+ for (let n in t) i[n] || S(e, `unknown keyword: "${n}"`);
819
+ }
820
+ e.checkUnknownRules = a;
821
+ function o(e, t) {
822
+ if (typeof e == "boolean") return !e;
823
+ for (let n in e) if (t[n]) return !0;
824
+ return !1;
825
+ }
826
+ e.schemaHasRules = o;
827
+ function s(e, t) {
828
+ if (typeof e == "boolean") return !e;
829
+ for (let n in e) if (n !== "$ref" && t.all[n]) return !0;
830
+ return !1;
831
+ }
832
+ e.schemaHasRulesButRef = s;
833
+ function c({ topSchemaRef: e, schemaPath: n }, r, i, a) {
834
+ if (!a) {
835
+ if (typeof r == "number" || typeof r == "boolean") return r;
836
+ if (typeof r == "string") return (0, t._)`${r}`;
837
+ }
838
+ return (0, t._)`${e}${n}${(0, t.getProperty)(i)}`;
839
+ }
840
+ e.schemaRefOrVal = c;
841
+ function l(e) {
842
+ return f(decodeURIComponent(e));
843
+ }
844
+ e.unescapeFragment = l;
845
+ function u(e) {
846
+ return encodeURIComponent(d(e));
847
+ }
848
+ e.escapeFragment = u;
849
+ function d(e) {
850
+ return typeof e == "number" ? `${e}` : e.replace(/~/g, "~0").replace(/\//g, "~1");
851
+ }
852
+ e.escapeJsonPointer = d;
853
+ function f(e) {
854
+ return e.replace(/~1/g, "/").replace(/~0/g, "~");
855
+ }
856
+ e.unescapeJsonPointer = f;
857
+ function p(e, t) {
858
+ if (Array.isArray(e)) for (let n of e) t(n);
859
+ else t(e);
860
+ }
861
+ e.eachItem = p;
862
+ function m({ mergeNames: e, mergeToName: n, mergeValues: r, resultToName: i }) {
863
+ return (a, o, s, c) => {
864
+ let l = s === void 0 ? o : s instanceof t.Name ? (o instanceof t.Name ? e(a, o, s) : n(a, o, s), s) : o instanceof t.Name ? (n(a, s, o), o) : r(o, s);
865
+ return c === t.Name && !(l instanceof t.Name) ? i(a, l) : l;
866
+ };
867
+ }
868
+ e.mergeEvaluated = {
869
+ props: m({
870
+ mergeNames: (e, n, r) => e.if((0, t._)`${r} !== true && ${n} !== undefined`, () => {
871
+ e.if((0, t._)`${n} === true`, () => e.assign(r, !0), () => e.assign(r, (0, t._)`${r} || {}`).code((0, t._)`Object.assign(${r}, ${n})`));
872
+ }),
873
+ mergeToName: (e, n, r) => e.if((0, t._)`${r} !== true`, () => {
874
+ n === !0 ? e.assign(r, !0) : (e.assign(r, (0, t._)`${r} || {}`), g(e, r, n));
875
+ }),
876
+ mergeValues: (e, t) => e === !0 || {
877
+ ...e,
878
+ ...t
879
+ },
880
+ resultToName: h
881
+ }),
882
+ items: m({
883
+ mergeNames: (e, n, r) => e.if((0, t._)`${r} !== true && ${n} !== undefined`, () => e.assign(r, (0, t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),
884
+ mergeToName: (e, n, r) => e.if((0, t._)`${r} !== true`, () => e.assign(r, n === !0 || (0, t._)`${r} > ${n} ? ${r} : ${n}`)),
885
+ mergeValues: (e, t) => e === !0 || Math.max(e, t),
886
+ resultToName: (e, t) => e.var("items", t)
887
+ })
888
+ };
889
+ function h(e, n) {
890
+ if (n === !0) return e.var("props", !0);
891
+ let r = e.var("props", (0, t._)`{}`);
892
+ return n !== void 0 && g(e, r, n), r;
893
+ }
894
+ e.evaluatedPropsToName = h;
895
+ function g(e, n, r) {
896
+ Object.keys(r).forEach((r) => e.assign((0, t._)`${n}${(0, t.getProperty)(r)}`, !0));
897
+ }
898
+ e.setEvaluated = g;
899
+ var _ = {};
900
+ function v(e, t) {
901
+ return e.scopeValue("func", {
902
+ ref: t,
903
+ code: _[t.code] || (_[t.code] = new n._Code(t.code))
904
+ });
905
+ }
906
+ e.useFunc = v;
907
+ var y;
908
+ (function(e) {
909
+ e[e.Num = 0] = "Num", e[e.Str = 1] = "Str";
910
+ })(y || (e.Type = y = {}));
911
+ function b(e, n, r) {
912
+ if (e instanceof t.Name) {
913
+ let i = n === y.Num;
914
+ return r ? i ? (0, t._)`"[" + ${e} + "]"` : (0, t._)`"['" + ${e} + "']"` : i ? (0, t._)`"/" + ${e}` : (0, t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
915
+ }
916
+ return r ? (0, t.getProperty)(e).toString() : "/" + d(e);
917
+ }
918
+ e.getErrorPath = b;
919
+ function S(e, t, n = e.opts.strictSchema) {
920
+ if (n) {
921
+ if (t = `strict mode: ${t}`, n === !0) throw Error(t);
922
+ e.self.logger.warn(t);
923
+ }
924
+ }
925
+ e.checkStrictMode = S;
926
+ })), T = /* @__PURE__ */ u(((e) => {
927
+ Object.defineProperty(e, "__esModule", { value: !0 });
928
+ var t = C();
929
+ e.default = {
930
+ data: new t.Name("data"),
931
+ valCxt: new t.Name("valCxt"),
932
+ instancePath: new t.Name("instancePath"),
933
+ parentData: new t.Name("parentData"),
934
+ parentDataProperty: new t.Name("parentDataProperty"),
935
+ rootData: new t.Name("rootData"),
936
+ dynamicAnchors: new t.Name("dynamicAnchors"),
937
+ vErrors: new t.Name("vErrors"),
938
+ errors: new t.Name("errors"),
939
+ this: new t.Name("this"),
940
+ self: new t.Name("self"),
941
+ scope: new t.Name("scope"),
942
+ json: new t.Name("json"),
943
+ jsonPos: new t.Name("jsonPos"),
944
+ jsonLen: new t.Name("jsonLen"),
945
+ jsonPart: new t.Name("jsonPart")
946
+ };
947
+ })), E = /* @__PURE__ */ u(((e) => {
948
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
949
+ var t = C(), n = w(), r = T();
950
+ e.keywordError = { message: ({ keyword: e }) => (0, t.str)`must pass "${e}" keyword validation` }, e.keyword$DataError = { message: ({ keyword: e, schemaType: n }) => n ? (0, t.str)`"${e}" keyword must be ${n} ($data)` : (0, t.str)`"${e}" keyword is invalid ($data)` };
951
+ function i(n, r = e.keywordError, i, a) {
952
+ let { it: o } = n, { gen: s, compositeRule: u, allErrors: f } = o, p = d(n, r, i);
953
+ a ?? (u || f) ? c(s, p) : l(o, (0, t._)`[${p}]`);
954
+ }
955
+ e.reportError = i;
956
+ function a(t, n = e.keywordError, i) {
957
+ let { it: a } = t, { gen: o, compositeRule: s, allErrors: u } = a;
958
+ c(o, d(t, n, i)), s || u || l(a, r.default.vErrors);
959
+ }
960
+ e.reportExtraError = a;
961
+ function o(e, n) {
962
+ e.assign(r.default.errors, n), e.if((0, t._)`${r.default.vErrors} !== null`, () => e.if(n, () => e.assign((0, t._)`${r.default.vErrors}.length`, n), () => e.assign(r.default.vErrors, null)));
963
+ }
964
+ e.resetErrorsCount = o;
965
+ function s({ gen: e, keyword: n, schemaValue: i, data: a, errsCount: o, it: s }) {
966
+ /* istanbul ignore if */
967
+ if (o === void 0) throw Error("ajv implementation error");
968
+ let c = e.name("err");
969
+ e.forRange("i", o, r.default.errors, (o) => {
970
+ e.const(c, (0, t._)`${r.default.vErrors}[${o}]`), e.if((0, t._)`${c}.instancePath === undefined`, () => e.assign((0, t._)`${c}.instancePath`, (0, t.strConcat)(r.default.instancePath, s.errorPath))), e.assign((0, t._)`${c}.schemaPath`, (0, t.str)`${s.errSchemaPath}/${n}`), s.opts.verbose && (e.assign((0, t._)`${c}.schema`, i), e.assign((0, t._)`${c}.data`, a));
971
+ });
972
+ }
973
+ e.extendErrors = s;
974
+ function c(e, n) {
975
+ let i = e.const("err", n);
976
+ e.if((0, t._)`${r.default.vErrors} === null`, () => e.assign(r.default.vErrors, (0, t._)`[${i}]`), (0, t._)`${r.default.vErrors}.push(${i})`), e.code((0, t._)`${r.default.errors}++`);
977
+ }
978
+ function l(e, n) {
979
+ let { gen: r, validateName: i, schemaEnv: a } = e;
980
+ a.$async ? r.throw((0, t._)`new ${e.ValidationError}(${n})`) : (r.assign((0, t._)`${i}.errors`, n), r.return(!1));
981
+ }
982
+ var u = {
983
+ keyword: new t.Name("keyword"),
984
+ schemaPath: new t.Name("schemaPath"),
985
+ params: new t.Name("params"),
986
+ propertyName: new t.Name("propertyName"),
987
+ message: new t.Name("message"),
988
+ schema: new t.Name("schema"),
989
+ parentSchema: new t.Name("parentSchema")
990
+ };
991
+ function d(e, n, r) {
992
+ let { createErrors: i } = e.it;
993
+ return i === !1 ? (0, t._)`{}` : f(e, n, r);
994
+ }
995
+ function f(e, t, n = {}) {
996
+ let { gen: r, it: i } = e, a = [p(i, n), m(e, n)];
997
+ return h(e, t, a), r.object(...a);
998
+ }
999
+ function p({ errorPath: e }, { instancePath: i }) {
1000
+ let a = i ? (0, t.str)`${e}${(0, n.getErrorPath)(i, n.Type.Str)}` : e;
1001
+ return [r.default.instancePath, (0, t.strConcat)(r.default.instancePath, a)];
1002
+ }
1003
+ function m({ keyword: e, it: { errSchemaPath: r } }, { schemaPath: i, parentSchema: a }) {
1004
+ let o = a ? r : (0, t.str)`${r}/${e}`;
1005
+ return i && (o = (0, t.str)`${o}${(0, n.getErrorPath)(i, n.Type.Str)}`), [u.schemaPath, o];
1006
+ }
1007
+ function h(e, { params: n, message: i }, a) {
1008
+ let { keyword: o, data: s, schemaValue: c, it: l } = e, { opts: d, propertyName: f, topSchemaRef: p, schemaPath: m } = l;
1009
+ a.push([u.keyword, o], [u.params, typeof n == "function" ? n(e) : n || (0, t._)`{}`]), d.messages && a.push([u.message, typeof i == "function" ? i(e) : i]), d.verbose && a.push([u.schema, c], [u.parentSchema, (0, t._)`${p}${m}`], [r.default.data, s]), f && a.push([u.propertyName, f]);
1010
+ }
1011
+ })), D = /* @__PURE__ */ u(((e) => {
1012
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.boolOrEmptySchema = e.topBoolOrEmptySchema = void 0;
1013
+ var t = E(), n = C(), r = T(), i = { message: "boolean schema is false" };
1014
+ function a(e) {
1015
+ let { gen: t, schema: i, validateName: a } = e;
1016
+ i === !1 ? s(e, !1) : typeof i == "object" && i.$async === !0 ? t.return(r.default.data) : (t.assign((0, n._)`${a}.errors`, null), t.return(!0));
1017
+ }
1018
+ e.topBoolOrEmptySchema = a;
1019
+ function o(e, t) {
1020
+ let { gen: n, schema: r } = e;
1021
+ r === !1 ? (n.var(t, !1), s(e)) : n.var(t, !0);
1022
+ }
1023
+ e.boolOrEmptySchema = o;
1024
+ function s(e, n) {
1025
+ let { gen: r, data: a } = e, o = {
1026
+ gen: r,
1027
+ keyword: "false schema",
1028
+ data: a,
1029
+ schema: !1,
1030
+ schemaCode: !1,
1031
+ schemaValue: !1,
1032
+ params: {},
1033
+ it: e
1034
+ };
1035
+ (0, t.reportError)(o, i, void 0, n);
1036
+ }
1037
+ })), O = /* @__PURE__ */ u(((e) => {
1038
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.getRules = e.isJSONType = void 0;
1039
+ var t = /* @__PURE__ */ new Set([
1040
+ "string",
1041
+ "number",
1042
+ "integer",
1043
+ "boolean",
1044
+ "null",
1045
+ "object",
1046
+ "array"
1047
+ ]);
1048
+ function n(e) {
1049
+ return typeof e == "string" && t.has(e);
1050
+ }
1051
+ e.isJSONType = n;
1052
+ function r() {
1053
+ let e = {
1054
+ number: {
1055
+ type: "number",
1056
+ rules: []
1057
+ },
1058
+ string: {
1059
+ type: "string",
1060
+ rules: []
1061
+ },
1062
+ array: {
1063
+ type: "array",
1064
+ rules: []
1065
+ },
1066
+ object: {
1067
+ type: "object",
1068
+ rules: []
1069
+ }
1070
+ };
1071
+ return {
1072
+ types: {
1073
+ ...e,
1074
+ integer: !0,
1075
+ boolean: !0,
1076
+ null: !0
1077
+ },
1078
+ rules: [
1079
+ { rules: [] },
1080
+ e.number,
1081
+ e.string,
1082
+ e.array,
1083
+ e.object
1084
+ ],
1085
+ post: { rules: [] },
1086
+ all: {},
1087
+ keywords: {}
1088
+ };
1089
+ }
1090
+ e.getRules = r;
1091
+ })), k = /* @__PURE__ */ u(((e) => {
1092
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.shouldUseRule = e.shouldUseGroup = e.schemaHasRulesForType = void 0;
1093
+ function t({ schema: e, self: t }, r) {
1094
+ let i = t.RULES.types[r];
1095
+ return i && i !== !0 && n(e, i);
1096
+ }
1097
+ e.schemaHasRulesForType = t;
1098
+ function n(e, t) {
1099
+ return t.rules.some((t) => r(e, t));
1100
+ }
1101
+ e.shouldUseGroup = n;
1102
+ function r(e, t) {
1103
+ return e[t.keyword] !== void 0 || t.definition.implements?.some((t) => e[t] !== void 0);
1104
+ }
1105
+ e.shouldUseRule = r;
1106
+ })), A = /* @__PURE__ */ u(((e) => {
1107
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.reportTypeError = e.checkDataTypes = e.checkDataType = e.coerceAndCheckDataType = e.getJSONTypes = e.getSchemaTypes = e.DataType = void 0;
1108
+ var t = O(), n = k(), r = E(), i = C(), a = w(), o;
1109
+ (function(e) {
1110
+ e[e.Correct = 0] = "Correct", e[e.Wrong = 1] = "Wrong";
1111
+ })(o || (e.DataType = o = {}));
1112
+ function s(e) {
1113
+ let t = c(e.type);
1114
+ if (t.includes("null")) {
1115
+ if (e.nullable === !1) throw Error("type: null contradicts nullable: false");
1116
+ } else {
1117
+ if (!t.length && e.nullable !== void 0) throw Error("\"nullable\" cannot be used without \"type\"");
1118
+ e.nullable === !0 && t.push("null");
1119
+ }
1120
+ return t;
1121
+ }
1122
+ e.getSchemaTypes = s;
1123
+ function c(e) {
1124
+ let n = Array.isArray(e) ? e : e ? [e] : [];
1125
+ if (n.every(t.isJSONType)) return n;
1126
+ throw Error("type must be JSONType or JSONType[]: " + n.join(","));
1127
+ }
1128
+ e.getJSONTypes = c;
1129
+ function l(e, t) {
1130
+ let { gen: r, data: i, opts: a } = e, s = d(t, a.coerceTypes), c = t.length > 0 && !(s.length === 0 && t.length === 1 && (0, n.schemaHasRulesForType)(e, t[0]));
1131
+ if (c) {
1132
+ let n = h(t, i, a.strictNumbers, o.Wrong);
1133
+ r.if(n, () => {
1134
+ s.length ? f(e, t, s) : _(e);
1135
+ });
1136
+ }
1137
+ return c;
1138
+ }
1139
+ e.coerceAndCheckDataType = l;
1140
+ var u = /* @__PURE__ */ new Set([
1141
+ "string",
1142
+ "number",
1143
+ "integer",
1144
+ "boolean",
1145
+ "null"
1146
+ ]);
1147
+ function d(e, t) {
1148
+ return t ? e.filter((e) => u.has(e) || t === "array" && e === "array") : [];
1149
+ }
1150
+ function f(e, t, n) {
1151
+ let { gen: r, data: a, opts: o } = e, s = r.let("dataType", (0, i._)`typeof ${a}`), c = r.let("coerced", (0, i._)`undefined`);
1152
+ o.coerceTypes === "array" && r.if((0, i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`, () => r.assign(a, (0, i._)`${a}[0]`).assign(s, (0, i._)`typeof ${a}`).if(h(t, a, o.strictNumbers), () => r.assign(c, a))), r.if((0, i._)`${c} !== undefined`);
1153
+ for (let e of n) (u.has(e) || e === "array" && o.coerceTypes === "array") && l(e);
1154
+ r.else(), _(e), r.endIf(), r.if((0, i._)`${c} !== undefined`, () => {
1155
+ r.assign(a, c), p(e, c);
1156
+ });
1157
+ function l(e) {
1158
+ switch (e) {
1159
+ case "string":
1160
+ r.elseIf((0, i._)`${s} == "number" || ${s} == "boolean"`).assign(c, (0, i._)`"" + ${a}`).elseIf((0, i._)`${a} === null`).assign(c, (0, i._)`""`);
1161
+ return;
1162
+ case "number":
1163
+ r.elseIf((0, i._)`${s} == "boolean" || ${a} === null
1164
+ || (${s} == "string" && ${a} && ${a} == +${a})`).assign(c, (0, i._)`+${a}`);
1165
+ return;
1166
+ case "integer":
1167
+ r.elseIf((0, i._)`${s} === "boolean" || ${a} === null
1168
+ || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c, (0, i._)`+${a}`);
1169
+ return;
1170
+ case "boolean":
1171
+ r.elseIf((0, i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c, !1).elseIf((0, i._)`${a} === "true" || ${a} === 1`).assign(c, !0);
1172
+ return;
1173
+ case "null":
1174
+ r.elseIf((0, i._)`${a} === "" || ${a} === 0 || ${a} === false`), r.assign(c, null);
1175
+ return;
1176
+ case "array": r.elseIf((0, i._)`${s} === "string" || ${s} === "number"
1177
+ || ${s} === "boolean" || ${a} === null`).assign(c, (0, i._)`[${a}]`);
1178
+ }
1179
+ }
1180
+ }
1181
+ function p({ gen: e, parentData: t, parentDataProperty: n }, r) {
1182
+ e.if((0, i._)`${t} !== undefined`, () => e.assign((0, i._)`${t}[${n}]`, r));
1183
+ }
1184
+ function m(e, t, n, r = o.Correct) {
1185
+ let a = r === o.Correct ? i.operators.EQ : i.operators.NEQ, s;
1186
+ switch (e) {
1187
+ case "null": return (0, i._)`${t} ${a} null`;
1188
+ case "array":
1189
+ s = (0, i._)`Array.isArray(${t})`;
1190
+ break;
1191
+ case "object":
1192
+ s = (0, i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;
1193
+ break;
1194
+ case "integer":
1195
+ s = c((0, i._)`!(${t} % 1) && !isNaN(${t})`);
1196
+ break;
1197
+ case "number":
1198
+ s = c();
1199
+ break;
1200
+ default: return (0, i._)`typeof ${t} ${a} ${e}`;
1201
+ }
1202
+ return r === o.Correct ? s : (0, i.not)(s);
1203
+ function c(e = i.nil) {
1204
+ return (0, i.and)((0, i._)`typeof ${t} == "number"`, e, n ? (0, i._)`isFinite(${t})` : i.nil);
1205
+ }
1206
+ }
1207
+ e.checkDataType = m;
1208
+ function h(e, t, n, r) {
1209
+ if (e.length === 1) return m(e[0], t, n, r);
1210
+ let o, s = (0, a.toHash)(e);
1211
+ if (s.array && s.object) {
1212
+ let e = (0, i._)`typeof ${t} != "object"`;
1213
+ o = s.null ? e : (0, i._)`!${t} || ${e}`, delete s.null, delete s.array, delete s.object;
1214
+ } else o = i.nil;
1215
+ s.number && delete s.integer;
1216
+ for (let e in s) o = (0, i.and)(o, m(e, t, n, r));
1217
+ return o;
1218
+ }
1219
+ e.checkDataTypes = h;
1220
+ var g = {
1221
+ message: ({ schema: e }) => `must be ${e}`,
1222
+ params: ({ schema: e, schemaValue: t }) => typeof e == "string" ? (0, i._)`{type: ${e}}` : (0, i._)`{type: ${t}}`
1223
+ };
1224
+ function _(e) {
1225
+ let t = v(e);
1226
+ (0, r.reportError)(t, g);
1227
+ }
1228
+ e.reportTypeError = _;
1229
+ function v(e) {
1230
+ let { gen: t, data: n, schema: r } = e, i = (0, a.schemaRefOrVal)(e, r, "type");
1231
+ return {
1232
+ gen: t,
1233
+ keyword: "type",
1234
+ data: n,
1235
+ schema: r.type,
1236
+ schemaCode: i,
1237
+ schemaValue: i,
1238
+ parentSchema: r,
1239
+ params: {},
1240
+ it: e
1241
+ };
1242
+ }
1243
+ })), j = /* @__PURE__ */ u(((e) => {
1244
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.assignDefaults = void 0;
1245
+ var t = C(), n = w();
1246
+ function r(e, t) {
1247
+ let { properties: n, items: r } = e.schema;
1248
+ if (t === "object" && n) for (let t in n) i(e, t, n[t].default);
1249
+ else t === "array" && Array.isArray(r) && r.forEach((t, n) => i(e, n, t.default));
1250
+ }
1251
+ e.assignDefaults = r;
1252
+ function i(e, r, i) {
1253
+ let { gen: a, compositeRule: o, data: s, opts: c } = e;
1254
+ if (i === void 0) return;
1255
+ let l = (0, t._)`${s}${(0, t.getProperty)(r)}`;
1256
+ if (o) {
1257
+ (0, n.checkStrictMode)(e, `default is ignored for: ${l}`);
1258
+ return;
1259
+ }
1260
+ let u = (0, t._)`${l} === undefined`;
1261
+ c.useDefaults === "empty" && (u = (0, t._)`${u} || ${l} === null || ${l} === ""`), a.if(u, (0, t._)`${l} = ${(0, t.stringify)(i)}`);
1262
+ }
1263
+ })), M = /* @__PURE__ */ u(((e) => {
1264
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateUnion = e.validateArray = e.usePattern = e.callValidateCode = e.schemaProperties = e.allSchemaProperties = e.noPropertyInData = e.propertyInData = e.isOwnProperty = e.hasPropFunc = e.reportMissingProp = e.checkMissingProp = e.checkReportMissingProp = void 0;
1265
+ var t = C(), n = w(), r = T(), i = w();
1266
+ function a(e, n) {
1267
+ let { gen: r, data: i, it: a } = e;
1268
+ r.if(d(r, i, n, a.opts.ownProperties), () => {
1269
+ e.setParams({ missingProperty: (0, t._)`${n}` }, !0), e.error();
1270
+ });
1271
+ }
1272
+ e.checkReportMissingProp = a;
1273
+ function o({ gen: e, data: n, it: { opts: r } }, i, a) {
1274
+ return (0, t.or)(...i.map((i) => (0, t.and)(d(e, n, i, r.ownProperties), (0, t._)`${a} = ${i}`)));
1275
+ }
1276
+ e.checkMissingProp = o;
1277
+ function s(e, t) {
1278
+ e.setParams({ missingProperty: t }, !0), e.error();
1279
+ }
1280
+ e.reportMissingProp = s;
1281
+ function c(e) {
1282
+ return e.scopeValue("func", {
1283
+ ref: Object.prototype.hasOwnProperty,
1284
+ code: (0, t._)`Object.prototype.hasOwnProperty`
1285
+ });
1286
+ }
1287
+ e.hasPropFunc = c;
1288
+ function l(e, n, r) {
1289
+ return (0, t._)`${c(e)}.call(${n}, ${r})`;
1290
+ }
1291
+ e.isOwnProperty = l;
1292
+ function u(e, n, r, i) {
1293
+ let a = (0, t._)`${n}${(0, t.getProperty)(r)} !== undefined`;
1294
+ return i ? (0, t._)`${a} && ${l(e, n, r)}` : a;
1295
+ }
1296
+ e.propertyInData = u;
1297
+ function d(e, n, r, i) {
1298
+ let a = (0, t._)`${n}${(0, t.getProperty)(r)} === undefined`;
1299
+ return i ? (0, t.or)(a, (0, t.not)(l(e, n, r))) : a;
1300
+ }
1301
+ e.noPropertyInData = d;
1302
+ function f(e) {
1303
+ return e ? Object.keys(e).filter((e) => e !== "__proto__") : [];
1304
+ }
1305
+ e.allSchemaProperties = f;
1306
+ function p(e, t) {
1307
+ return f(t).filter((r) => !(0, n.alwaysValidSchema)(e, t[r]));
1308
+ }
1309
+ e.schemaProperties = p;
1310
+ function m({ schemaCode: e, data: n, it: { gen: i, topSchemaRef: a, schemaPath: o, errorPath: s }, it: c }, l, u, d) {
1311
+ let f = d ? (0, t._)`${e}, ${n}, ${a}${o}` : n, p = [
1312
+ [r.default.instancePath, (0, t.strConcat)(r.default.instancePath, s)],
1313
+ [r.default.parentData, c.parentData],
1314
+ [r.default.parentDataProperty, c.parentDataProperty],
1315
+ [r.default.rootData, r.default.rootData]
1316
+ ];
1317
+ c.opts.dynamicRef && p.push([r.default.dynamicAnchors, r.default.dynamicAnchors]);
1318
+ let m = (0, t._)`${f}, ${i.object(...p)}`;
1319
+ return u === t.nil ? (0, t._)`${l}(${m})` : (0, t._)`${l}.call(${u}, ${m})`;
1320
+ }
1321
+ e.callValidateCode = m;
1322
+ var h = (0, t._)`new RegExp`;
1323
+ function g({ gen: e, it: { opts: n } }, r) {
1324
+ let a = n.unicodeRegExp ? "u" : "", { regExp: o } = n.code, s = o(r, a);
1325
+ return e.scopeValue("pattern", {
1326
+ key: s.toString(),
1327
+ ref: s,
1328
+ code: (0, t._)`${o.code === "new RegExp" ? h : (0, i.useFunc)(e, o)}(${r}, ${a})`
1329
+ });
1330
+ }
1331
+ e.usePattern = g;
1332
+ function _(e) {
1333
+ let { gen: r, data: i, keyword: a, it: o } = e, s = r.name("valid");
1334
+ if (o.allErrors) {
1335
+ let e = r.let("valid", !0);
1336
+ return c(() => r.assign(e, !1)), e;
1337
+ }
1338
+ return r.var(s, !0), c(() => r.break()), s;
1339
+ function c(o) {
1340
+ let c = r.const("len", (0, t._)`${i}.length`);
1341
+ r.forRange("i", 0, c, (i) => {
1342
+ e.subschema({
1343
+ keyword: a,
1344
+ dataProp: i,
1345
+ dataPropType: n.Type.Num
1346
+ }, s), r.if((0, t.not)(s), o);
1347
+ });
1348
+ }
1349
+ }
1350
+ e.validateArray = _;
1351
+ function v(e) {
1352
+ let { gen: r, schema: i, keyword: a, it: o } = e;
1353
+ /* istanbul ignore if */
1354
+ if (!Array.isArray(i)) throw Error("ajv implementation error");
1355
+ if (i.some((e) => (0, n.alwaysValidSchema)(o, e)) && !o.opts.unevaluated) return;
1356
+ let s = r.let("valid", !1), c = r.name("_valid");
1357
+ r.block(() => i.forEach((n, i) => {
1358
+ let o = e.subschema({
1359
+ keyword: a,
1360
+ schemaProp: i,
1361
+ compositeRule: !0
1362
+ }, c);
1363
+ r.assign(s, (0, t._)`${s} || ${c}`), e.mergeValidEvaluated(o, c) || r.if((0, t.not)(s));
1364
+ })), e.result(s, () => e.reset(), () => e.error(!0));
1365
+ }
1366
+ e.validateUnion = v;
1367
+ })), N = /* @__PURE__ */ u(((e) => {
1368
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateKeywordUsage = e.validSchemaType = e.funcKeywordCode = e.macroKeywordCode = void 0;
1369
+ var t = C(), n = T(), r = M(), i = E();
1370
+ function a(e, n) {
1371
+ let { gen: r, keyword: i, schema: a, parentSchema: o, it: s } = e, c = n.macro.call(s.self, a, o, s), l = u(r, i, c);
1372
+ s.opts.validateSchema !== !1 && s.self.validateSchema(c, !0);
1373
+ let d = r.name("valid");
1374
+ e.subschema({
1375
+ schema: c,
1376
+ schemaPath: t.nil,
1377
+ errSchemaPath: `${s.errSchemaPath}/${i}`,
1378
+ topSchemaRef: l,
1379
+ compositeRule: !0
1380
+ }, d), e.pass(d, () => e.error(!0));
1381
+ }
1382
+ e.macroKeywordCode = a;
1383
+ function o(e, i) {
1384
+ let { gen: a, keyword: o, schema: d, parentSchema: f, $data: p, it: m } = e;
1385
+ l(m, i);
1386
+ let h = u(a, o, !p && i.compile ? i.compile.call(m.self, d, f, m) : i.validate), g = a.let("valid");
1387
+ e.block$data(g, _), e.ok(i.valid ?? g);
1388
+ function _() {
1389
+ if (i.errors === !1) b(), i.modifying && s(e), x(() => e.error());
1390
+ else {
1391
+ let t = i.async ? v() : y();
1392
+ i.modifying && s(e), x(() => c(e, t));
1393
+ }
1394
+ }
1395
+ function v() {
1396
+ let e = a.let("ruleErrs", null);
1397
+ return a.try(() => b((0, t._)`await `), (n) => a.assign(g, !1).if((0, t._)`${n} instanceof ${m.ValidationError}`, () => a.assign(e, (0, t._)`${n}.errors`), () => a.throw(n))), e;
1398
+ }
1399
+ function y() {
1400
+ let e = (0, t._)`${h}.errors`;
1401
+ return a.assign(e, null), b(t.nil), e;
1402
+ }
1403
+ function b(o = i.async ? (0, t._)`await ` : t.nil) {
1404
+ let s = m.opts.passContext ? n.default.this : n.default.self, c = !("compile" in i && !p || i.schema === !1);
1405
+ a.assign(g, (0, t._)`${o}${(0, r.callValidateCode)(e, h, s, c)}`, i.modifying);
1406
+ }
1407
+ function x(e) {
1408
+ a.if((0, t.not)(i.valid ?? g), e);
1409
+ }
1410
+ }
1411
+ e.funcKeywordCode = o;
1412
+ function s(e) {
1413
+ let { gen: n, data: r, it: i } = e;
1414
+ n.if(i.parentData, () => n.assign(r, (0, t._)`${i.parentData}[${i.parentDataProperty}]`));
1415
+ }
1416
+ function c(e, r) {
1417
+ let { gen: a } = e;
1418
+ a.if((0, t._)`Array.isArray(${r})`, () => {
1419
+ a.assign(n.default.vErrors, (0, t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors, (0, t._)`${n.default.vErrors}.length`), (0, i.extendErrors)(e);
1420
+ }, () => e.error());
1421
+ }
1422
+ function l({ schemaEnv: e }, t) {
1423
+ if (t.async && !e.$async) throw Error("async keyword in sync schema");
1424
+ }
1425
+ function u(e, n, r) {
1426
+ if (r === void 0) throw Error(`keyword "${n}" failed to compile`);
1427
+ return e.scopeValue("keyword", typeof r == "function" ? { ref: r } : {
1428
+ ref: r,
1429
+ code: (0, t.stringify)(r)
1430
+ });
1431
+ }
1432
+ function d(e, t, n = !1) {
1433
+ return !t.length || t.some((t) => t === "array" ? Array.isArray(e) : t === "object" ? e && typeof e == "object" && !Array.isArray(e) : typeof e == t || n && e === void 0);
1434
+ }
1435
+ e.validSchemaType = d;
1436
+ function f({ schema: e, opts: t, self: n, errSchemaPath: r }, i, a) {
1437
+ /* istanbul ignore if */
1438
+ if (Array.isArray(i.keyword) ? !i.keyword.includes(a) : i.keyword !== a) throw Error("ajv implementation error");
1439
+ let o = i.dependencies;
1440
+ if (o?.some((t) => !Object.prototype.hasOwnProperty.call(e, t))) throw Error(`parent schema must have dependencies of ${a}: ${o.join(",")}`);
1441
+ if (i.validateSchema && !i.validateSchema(e[a])) {
1442
+ let e = `keyword "${a}" value is invalid at path "${r}": ` + n.errorsText(i.validateSchema.errors);
1443
+ if (t.validateSchema === "log") n.logger.error(e);
1444
+ else throw Error(e);
1445
+ }
1446
+ }
1447
+ e.validateKeywordUsage = f;
1448
+ })), P = /* @__PURE__ */ u(((e) => {
1449
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.extendSubschemaMode = e.extendSubschemaData = e.getSubschema = void 0;
1450
+ var t = C(), n = w();
1451
+ function r(e, { keyword: r, schemaProp: i, schema: a, schemaPath: o, errSchemaPath: s, topSchemaRef: c }) {
1452
+ if (r !== void 0 && a !== void 0) throw Error("both \"keyword\" and \"schema\" passed, only one allowed");
1453
+ if (r !== void 0) {
1454
+ let a = e.schema[r];
1455
+ return i === void 0 ? {
1456
+ schema: a,
1457
+ schemaPath: (0, t._)`${e.schemaPath}${(0, t.getProperty)(r)}`,
1458
+ errSchemaPath: `${e.errSchemaPath}/${r}`
1459
+ } : {
1460
+ schema: a[i],
1461
+ schemaPath: (0, t._)`${e.schemaPath}${(0, t.getProperty)(r)}${(0, t.getProperty)(i)}`,
1462
+ errSchemaPath: `${e.errSchemaPath}/${r}/${(0, n.escapeFragment)(i)}`
1463
+ };
1464
+ }
1465
+ if (a !== void 0) {
1466
+ if (o === void 0 || s === void 0 || c === void 0) throw Error("\"schemaPath\", \"errSchemaPath\" and \"topSchemaRef\" are required with \"schema\"");
1467
+ return {
1468
+ schema: a,
1469
+ schemaPath: o,
1470
+ topSchemaRef: c,
1471
+ errSchemaPath: s
1472
+ };
1473
+ }
1474
+ throw Error("either \"keyword\" or \"schema\" must be passed");
1475
+ }
1476
+ e.getSubschema = r;
1477
+ function i(e, r, { dataProp: i, dataPropType: a, data: o, dataTypes: s, propertyName: c }) {
1478
+ if (o !== void 0 && i !== void 0) throw Error("both \"data\" and \"dataProp\" passed, only one allowed");
1479
+ let { gen: l } = r;
1480
+ if (i !== void 0) {
1481
+ let { errorPath: o, dataPathArr: s, opts: c } = r;
1482
+ u(l.let("data", (0, t._)`${r.data}${(0, t.getProperty)(i)}`, !0)), e.errorPath = (0, t.str)`${o}${(0, n.getErrorPath)(i, a, c.jsPropertySyntax)}`, e.parentDataProperty = (0, t._)`${i}`, e.dataPathArr = [...s, e.parentDataProperty];
1483
+ }
1484
+ o !== void 0 && (u(o instanceof t.Name ? o : l.let("data", o, !0)), c !== void 0 && (e.propertyName = c)), s && (e.dataTypes = s);
1485
+ function u(t) {
1486
+ e.data = t, e.dataLevel = r.dataLevel + 1, e.dataTypes = [], r.definedProperties = /* @__PURE__ */ new Set(), e.parentData = r.data, e.dataNames = [...r.dataNames, t];
1487
+ }
1488
+ }
1489
+ e.extendSubschemaData = i;
1490
+ function a(e, { jtdDiscriminator: t, jtdMetadata: n, compositeRule: r, createErrors: i, allErrors: a }) {
1491
+ r !== void 0 && (e.compositeRule = r), i !== void 0 && (e.createErrors = i), a !== void 0 && (e.allErrors = a), e.jtdDiscriminator = t, e.jtdMetadata = n;
1492
+ }
1493
+ e.extendSubschemaMode = a;
1494
+ })), F = /* @__PURE__ */ u(((e, t) => {
1495
+ t.exports = function e(t, n) {
1496
+ if (t === n) return !0;
1497
+ if (t && n && typeof t == "object" && typeof n == "object") {
1498
+ if (t.constructor !== n.constructor) return !1;
1499
+ var r, i, a;
1500
+ if (Array.isArray(t)) {
1501
+ if (r = t.length, r != n.length) return !1;
1502
+ for (i = r; i-- !== 0;) if (!e(t[i], n[i])) return !1;
1503
+ return !0;
1504
+ }
1505
+ if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
1506
+ if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
1507
+ if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
1508
+ if (a = Object.keys(t), r = a.length, r !== Object.keys(n).length) return !1;
1509
+ for (i = r; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(n, a[i])) return !1;
1510
+ for (i = r; i-- !== 0;) {
1511
+ var o = a[i];
1512
+ if (!e(t[o], n[o])) return !1;
1513
+ }
1514
+ return !0;
1515
+ }
1516
+ return t !== t && n !== n;
1517
+ };
1518
+ })), I = /* @__PURE__ */ u(((e, t) => {
1519
+ var n = t.exports = function(e, t, n) {
1520
+ typeof t == "function" && (n = t, t = {}), n = t.cb || n;
1521
+ var i = typeof n == "function" ? n : n.pre || function() {}, a = n.post || function() {};
1522
+ r(t, i, a, e, "", e);
1523
+ };
1524
+ n.keywords = {
1525
+ additionalItems: !0,
1526
+ items: !0,
1527
+ contains: !0,
1528
+ additionalProperties: !0,
1529
+ propertyNames: !0,
1530
+ not: !0,
1531
+ if: !0,
1532
+ then: !0,
1533
+ else: !0
1534
+ }, n.arrayKeywords = {
1535
+ items: !0,
1536
+ allOf: !0,
1537
+ anyOf: !0,
1538
+ oneOf: !0
1539
+ }, n.propsKeywords = {
1540
+ $defs: !0,
1541
+ definitions: !0,
1542
+ properties: !0,
1543
+ patternProperties: !0,
1544
+ dependencies: !0
1545
+ }, n.skipKeywords = {
1546
+ default: !0,
1547
+ enum: !0,
1548
+ const: !0,
1549
+ required: !0,
1550
+ maximum: !0,
1551
+ minimum: !0,
1552
+ exclusiveMaximum: !0,
1553
+ exclusiveMinimum: !0,
1554
+ multipleOf: !0,
1555
+ maxLength: !0,
1556
+ minLength: !0,
1557
+ pattern: !0,
1558
+ format: !0,
1559
+ maxItems: !0,
1560
+ minItems: !0,
1561
+ uniqueItems: !0,
1562
+ maxProperties: !0,
1563
+ minProperties: !0
1564
+ };
1565
+ function r(e, t, a, o, s, c, l, u, d, f) {
1566
+ if (o && typeof o == "object" && !Array.isArray(o)) {
1567
+ for (var p in t(o, s, c, l, u, d, f), o) {
1568
+ var m = o[p];
1569
+ if (Array.isArray(m)) {
1570
+ if (p in n.arrayKeywords) for (var h = 0; h < m.length; h++) r(e, t, a, m[h], s + "/" + p + "/" + h, c, s, p, o, h);
1571
+ } else if (p in n.propsKeywords) {
1572
+ if (m && typeof m == "object") for (var g in m) r(e, t, a, m[g], s + "/" + p + "/" + i(g), c, s, p, o, g);
1573
+ } else (p in n.keywords || e.allKeys && !(p in n.skipKeywords)) && r(e, t, a, m, s + "/" + p, c, s, p, o);
1574
+ }
1575
+ a(o, s, c, l, u, d, f);
1576
+ }
1577
+ }
1578
+ function i(e) {
1579
+ return e.replace(/~/g, "~0").replace(/\//g, "~1");
1580
+ }
1581
+ })), L = /* @__PURE__ */ u(((e) => {
1582
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.getSchemaRefs = e.resolveUrl = e.normalizeId = e._getFullPath = e.getFullPath = e.inlineRef = void 0;
1583
+ var t = w(), n = F(), r = I(), i = /* @__PURE__ */ new Set([
1584
+ "type",
1585
+ "format",
1586
+ "pattern",
1587
+ "maxLength",
1588
+ "minLength",
1589
+ "maxProperties",
1590
+ "minProperties",
1591
+ "maxItems",
1592
+ "minItems",
1593
+ "maximum",
1594
+ "minimum",
1595
+ "uniqueItems",
1596
+ "multipleOf",
1597
+ "required",
1598
+ "enum",
1599
+ "const"
1600
+ ]);
1601
+ function a(e, t = !0) {
1602
+ return typeof e == "boolean" ? !0 : t === !0 ? !s(e) : t ? c(e) <= t : !1;
1603
+ }
1604
+ e.inlineRef = a;
1605
+ var o = /* @__PURE__ */ new Set([
1606
+ "$ref",
1607
+ "$recursiveRef",
1608
+ "$recursiveAnchor",
1609
+ "$dynamicRef",
1610
+ "$dynamicAnchor"
1611
+ ]);
1612
+ function s(e) {
1613
+ for (let t in e) {
1614
+ if (o.has(t)) return !0;
1615
+ let n = e[t];
1616
+ if (Array.isArray(n) && n.some(s) || typeof n == "object" && s(n)) return !0;
1617
+ }
1618
+ return !1;
1619
+ }
1620
+ function c(e) {
1621
+ let n = 0;
1622
+ for (let r in e) if (r === "$ref" || (n++, !i.has(r) && (typeof e[r] == "object" && (0, t.eachItem)(e[r], (e) => n += c(e)), n === Infinity))) return Infinity;
1623
+ return n;
1624
+ }
1625
+ function l(e, t = "", n) {
1626
+ return n !== !1 && (t = f(t)), u(e, e.parse(t));
1627
+ }
1628
+ e.getFullPath = l;
1629
+ function u(e, t) {
1630
+ return e.serialize(t).split("#")[0] + "#";
1631
+ }
1632
+ e._getFullPath = u;
1633
+ var d = /#\/?$/;
1634
+ function f(e) {
1635
+ return e ? e.replace(d, "") : "";
1636
+ }
1637
+ e.normalizeId = f;
1638
+ function p(e, t, n) {
1639
+ return n = f(n), e.resolve(t, n);
1640
+ }
1641
+ e.resolveUrl = p;
1642
+ var m = /^[a-z_][-a-z0-9._]*$/i;
1643
+ function h(e, t) {
1644
+ if (typeof e == "boolean") return {};
1645
+ let { schemaId: i, uriResolver: a } = this.opts, o = f(e[i] || t), s = { "": o }, c = l(a, o, !1), u = {}, d = /* @__PURE__ */ new Set();
1646
+ return r(e, { allKeys: !0 }, (e, t, n, r) => {
1647
+ if (r === void 0) return;
1648
+ let a = c + t, o = s[r];
1649
+ typeof e[i] == "string" && (o = l.call(this, e[i])), g.call(this, e.$anchor), g.call(this, e.$dynamicAnchor), s[t] = o;
1650
+ function l(t) {
1651
+ let n = this.opts.uriResolver.resolve;
1652
+ if (t = f(o ? n(o, t) : t), d.has(t)) throw h(t);
1653
+ d.add(t);
1654
+ let r = this.refs[t];
1655
+ return typeof r == "string" && (r = this.refs[r]), typeof r == "object" ? p(e, r.schema, t) : t !== f(a) && (t[0] === "#" ? (p(e, u[t], t), u[t] = e) : this.refs[t] = a), t;
1656
+ }
1657
+ function g(e) {
1658
+ if (typeof e == "string") {
1659
+ if (!m.test(e)) throw Error(`invalid anchor "${e}"`);
1660
+ l.call(this, `#${e}`);
1661
+ }
1662
+ }
1663
+ }), u;
1664
+ function p(e, t, r) {
1665
+ if (t !== void 0 && !n(e, t)) throw h(r);
1666
+ }
1667
+ function h(e) {
1668
+ return /* @__PURE__ */ Error(`reference "${e}" resolves to more than one schema`);
1669
+ }
1670
+ }
1671
+ e.getSchemaRefs = h;
1672
+ })), R = /* @__PURE__ */ u(((e) => {
1673
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.getData = e.KeywordCxt = e.validateFunctionCode = void 0;
1674
+ var t = D(), n = A(), r = k(), i = A(), a = j(), o = N(), s = P(), c = C(), l = T(), u = L(), d = w(), f = E();
1675
+ function p(e) {
1676
+ if (S(e) && (M(e), x(e))) {
1677
+ _(e);
1678
+ return;
1679
+ }
1680
+ m(e, () => (0, t.topBoolOrEmptySchema)(e));
1681
+ }
1682
+ e.validateFunctionCode = p;
1683
+ function m({ gen: e, validateName: t, schema: n, schemaEnv: r, opts: i }, a) {
1684
+ i.code.es5 ? e.func(t, (0, c._)`${l.default.data}, ${l.default.valCxt}`, r.$async, () => {
1685
+ e.code((0, c._)`"use strict"; ${y(n, i)}`), g(e, i), e.code(a);
1686
+ }) : e.func(t, (0, c._)`${l.default.data}, ${h(i)}`, r.$async, () => e.code(y(n, i)).code(a));
1687
+ }
1688
+ function h(e) {
1689
+ return (0, c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef ? (0, c._)`, ${l.default.dynamicAnchors}={}` : c.nil}}={}`;
1690
+ }
1691
+ function g(e, t) {
1692
+ e.if(l.default.valCxt, () => {
1693
+ e.var(l.default.instancePath, (0, c._)`${l.default.valCxt}.${l.default.instancePath}`), e.var(l.default.parentData, (0, c._)`${l.default.valCxt}.${l.default.parentData}`), e.var(l.default.parentDataProperty, (0, c._)`${l.default.valCxt}.${l.default.parentDataProperty}`), e.var(l.default.rootData, (0, c._)`${l.default.valCxt}.${l.default.rootData}`), t.dynamicRef && e.var(l.default.dynamicAnchors, (0, c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`);
1694
+ }, () => {
1695
+ e.var(l.default.instancePath, (0, c._)`""`), e.var(l.default.parentData, (0, c._)`undefined`), e.var(l.default.parentDataProperty, (0, c._)`undefined`), e.var(l.default.rootData, l.default.data), t.dynamicRef && e.var(l.default.dynamicAnchors, (0, c._)`{}`);
1696
+ });
1697
+ }
1698
+ function _(e) {
1699
+ let { schema: t, opts: n, gen: r } = e;
1700
+ m(e, () => {
1701
+ n.$comment && t.$comment && V(e), R(e), r.let(l.default.vErrors, null), r.let(l.default.errors, 0), n.unevaluated && v(e), F(e), ee(e);
1702
+ });
1703
+ }
1704
+ function v(e) {
1705
+ let { gen: t, validateName: n } = e;
1706
+ e.evaluated = t.const("evaluated", (0, c._)`${n}.evaluated`), t.if((0, c._)`${e.evaluated}.dynamicProps`, () => t.assign((0, c._)`${e.evaluated}.props`, (0, c._)`undefined`)), t.if((0, c._)`${e.evaluated}.dynamicItems`, () => t.assign((0, c._)`${e.evaluated}.items`, (0, c._)`undefined`));
1707
+ }
1708
+ function y(e, t) {
1709
+ let n = typeof e == "object" && e[t.schemaId];
1710
+ return n && (t.code.source || t.code.process) ? (0, c._)`/*# sourceURL=${n} */` : c.nil;
1711
+ }
1712
+ function b(e, n) {
1713
+ if (S(e) && (M(e), x(e))) {
1714
+ O(e, n);
1715
+ return;
1716
+ }
1717
+ (0, t.boolOrEmptySchema)(e, n);
1718
+ }
1719
+ function x({ schema: e, self: t }) {
1720
+ if (typeof e == "boolean") return !e;
1721
+ for (let n in e) if (t.RULES.all[n]) return !0;
1722
+ return !1;
1723
+ }
1724
+ function S(e) {
1725
+ return typeof e.schema != "boolean";
1726
+ }
1727
+ function O(e, t) {
1728
+ let { schema: n, gen: r, opts: i } = e;
1729
+ i.$comment && n.$comment && V(e), z(e), B(e);
1730
+ let a = r.const("_errs", l.default.errors);
1731
+ F(e, a), r.var(t, (0, c._)`${a} === ${l.default.errors}`);
1732
+ }
1733
+ function M(e) {
1734
+ (0, d.checkUnknownRules)(e), I(e);
1735
+ }
1736
+ function F(e, t) {
1737
+ if (e.opts.jtd) return U(e, [], !1, t);
1738
+ let r = (0, n.getSchemaTypes)(e.schema);
1739
+ U(e, r, !(0, n.coerceAndCheckDataType)(e, r), t);
1740
+ }
1741
+ function I(e) {
1742
+ let { schema: t, errSchemaPath: n, opts: r, self: i } = e;
1743
+ t.$ref && r.ignoreKeywordsWithRef && (0, d.schemaHasRulesButRef)(t, i.RULES) && i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`);
1744
+ }
1745
+ function R(e) {
1746
+ let { schema: t, opts: n } = e;
1747
+ t.default !== void 0 && n.useDefaults && n.strictSchema && (0, d.checkStrictMode)(e, "default is ignored in the schema root");
1748
+ }
1749
+ function z(e) {
1750
+ let t = e.schema[e.opts.schemaId];
1751
+ t && (e.baseId = (0, u.resolveUrl)(e.opts.uriResolver, e.baseId, t));
1752
+ }
1753
+ function B(e) {
1754
+ if (e.schema.$async && !e.schemaEnv.$async) throw Error("async schema in sync schema");
1755
+ }
1756
+ function V({ gen: e, schemaEnv: t, schema: n, errSchemaPath: r, opts: i }) {
1757
+ let a = n.$comment;
1758
+ if (i.$comment === !0) e.code((0, c._)`${l.default.self}.logger.log(${a})`);
1759
+ else if (typeof i.$comment == "function") {
1760
+ let n = (0, c.str)`${r}/$comment`, i = e.scopeValue("root", { ref: t.root });
1761
+ e.code((0, c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`);
1762
+ }
1763
+ }
1764
+ function ee(e) {
1765
+ let { gen: t, schemaEnv: n, validateName: r, ValidationError: i, opts: a } = e;
1766
+ n.$async ? t.if((0, c._)`${l.default.errors} === 0`, () => t.return(l.default.data), () => t.throw((0, c._)`new ${i}(${l.default.vErrors})`)) : (t.assign((0, c._)`${r}.errors`, l.default.vErrors), a.unevaluated && H(e), t.return((0, c._)`${l.default.errors} === 0`));
1767
+ }
1768
+ function H({ gen: e, evaluated: t, props: n, items: r }) {
1769
+ n instanceof c.Name && e.assign((0, c._)`${t}.props`, n), r instanceof c.Name && e.assign((0, c._)`${t}.items`, r);
1770
+ }
1771
+ function U(e, t, n, a) {
1772
+ let { gen: o, schema: s, data: u, allErrors: f, opts: p, self: m } = e, { RULES: h } = m;
1773
+ if (s.$ref && (p.ignoreKeywordsWithRef || !(0, d.schemaHasRulesButRef)(s, h))) {
1774
+ o.block(() => X(e, "$ref", h.all.$ref.definition));
1775
+ return;
1776
+ }
1777
+ p.jtd || G(e, t), o.block(() => {
1778
+ for (let e of h.rules) g(e);
1779
+ g(h.post);
1780
+ });
1781
+ function g(d) {
1782
+ (0, r.shouldUseGroup)(s, d) && (d.type ? (o.if((0, i.checkDataType)(d.type, u, p.strictNumbers)), W(e, d), t.length === 1 && t[0] === d.type && n && (o.else(), (0, i.reportTypeError)(e)), o.endIf()) : W(e, d), f || o.if((0, c._)`${l.default.errors} === ${a || 0}`));
1783
+ }
1784
+ }
1785
+ function W(e, t) {
1786
+ let { gen: n, schema: i, opts: { useDefaults: o } } = e;
1787
+ o && (0, a.assignDefaults)(e, t.type), n.block(() => {
1788
+ for (let n of t.rules) (0, r.shouldUseRule)(i, n) && X(e, n.keyword, n.definition, t.type);
1789
+ });
1790
+ }
1791
+ function G(e, t) {
1792
+ e.schemaEnv.meta || !e.opts.strictTypes || (K(e, t), e.opts.allowUnionTypes || te(e, t), ne(e, e.dataTypes));
1793
+ }
1794
+ function K(e, t) {
1795
+ if (t.length) {
1796
+ if (!e.dataTypes.length) {
1797
+ e.dataTypes = t;
1798
+ return;
1799
+ }
1800
+ t.forEach((t) => {
1801
+ q(e.dataTypes, t) || J(e, `type "${t}" not allowed by context "${e.dataTypes.join(",")}"`);
1802
+ }), ie(e, t);
1803
+ }
1804
+ }
1805
+ function te(e, t) {
1806
+ t.length > 1 && !(t.length === 2 && t.includes("null")) && J(e, "use allowUnionTypes to allow union type keyword");
1807
+ }
1808
+ function ne(e, t) {
1809
+ let n = e.self.RULES.all;
1810
+ for (let i in n) {
1811
+ let a = n[i];
1812
+ if (typeof a == "object" && (0, r.shouldUseRule)(e.schema, a)) {
1813
+ let { type: n } = a.definition;
1814
+ n.length && !n.some((e) => re(t, e)) && J(e, `missing type "${n.join(",")}" for keyword "${i}"`);
1815
+ }
1816
+ }
1817
+ }
1818
+ function re(e, t) {
1819
+ return e.includes(t) || t === "number" && e.includes("integer");
1820
+ }
1821
+ function q(e, t) {
1822
+ return e.includes(t) || t === "integer" && e.includes("number");
1823
+ }
1824
+ function ie(e, t) {
1825
+ let n = [];
1826
+ for (let r of e.dataTypes) q(t, r) ? n.push(r) : t.includes("integer") && r === "number" && n.push("integer");
1827
+ e.dataTypes = n;
1828
+ }
1829
+ function J(e, t) {
1830
+ let n = e.schemaEnv.baseId + e.errSchemaPath;
1831
+ t += ` at "${n}" (strictTypes)`, (0, d.checkStrictMode)(e, t, e.opts.strictTypes);
1832
+ }
1833
+ var Y = class {
1834
+ constructor(e, t, n) {
1835
+ if ((0, o.validateKeywordUsage)(e, t, n), this.gen = e.gen, this.allErrors = e.allErrors, this.keyword = n, this.data = e.data, this.schema = e.schema[n], this.$data = t.$data && e.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, d.schemaRefOrVal)(e, this.schema, n, this.$data), this.schemaType = t.schemaType, this.parentSchema = e.schema, this.params = {}, this.it = e, this.def = t, this.$data) this.schemaCode = e.gen.const("vSchema", Q(this.$data, e));
1836
+ else if (this.schemaCode = this.schemaValue, !(0, o.validSchemaType)(this.schema, t.schemaType, t.allowUndefined)) throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);
1837
+ ("code" in t ? t.trackErrors : t.errors !== !1) && (this.errsCount = e.gen.const("_errs", l.default.errors));
1838
+ }
1839
+ result(e, t, n) {
1840
+ this.failResult((0, c.not)(e), t, n);
1841
+ }
1842
+ failResult(e, t, n) {
1843
+ this.gen.if(e), n ? n() : this.error(), t ? (this.gen.else(), t(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else();
1844
+ }
1845
+ pass(e, t) {
1846
+ this.failResult((0, c.not)(e), void 0, t);
1847
+ }
1848
+ fail(e) {
1849
+ if (e === void 0) {
1850
+ this.error(), this.allErrors || this.gen.if(!1);
1851
+ return;
1852
+ }
1853
+ this.gen.if(e), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else();
1854
+ }
1855
+ fail$data(e) {
1856
+ if (!this.$data) return this.fail(e);
1857
+ let { schemaCode: t } = this;
1858
+ this.fail((0, c._)`${t} !== undefined && (${(0, c.or)(this.invalid$data(), e)})`);
1859
+ }
1860
+ error(e, t, n) {
1861
+ if (t) {
1862
+ this.setParams(t), this._error(e, n), this.setParams({});
1863
+ return;
1864
+ }
1865
+ this._error(e, n);
1866
+ }
1867
+ _error(e, t) {
1868
+ (e ? f.reportExtraError : f.reportError)(this, this.def.error, t);
1869
+ }
1870
+ $dataError() {
1871
+ (0, f.reportError)(this, this.def.$dataError || f.keyword$DataError);
1872
+ }
1873
+ reset() {
1874
+ if (this.errsCount === void 0) throw Error("add \"trackErrors\" to keyword definition");
1875
+ (0, f.resetErrorsCount)(this.gen, this.errsCount);
1876
+ }
1877
+ ok(e) {
1878
+ this.allErrors || this.gen.if(e);
1879
+ }
1880
+ setParams(e, t) {
1881
+ t ? Object.assign(this.params, e) : this.params = e;
1882
+ }
1883
+ block$data(e, t, n = c.nil) {
1884
+ this.gen.block(() => {
1885
+ this.check$data(e, n), t();
1886
+ });
1887
+ }
1888
+ check$data(e = c.nil, t = c.nil) {
1889
+ if (!this.$data) return;
1890
+ let { gen: n, schemaCode: r, schemaType: i, def: a } = this;
1891
+ n.if((0, c.or)((0, c._)`${r} === undefined`, t)), e !== c.nil && n.assign(e, !0), (i.length || a.validateSchema) && (n.elseIf(this.invalid$data()), this.$dataError(), e !== c.nil && n.assign(e, !1)), n.else();
1892
+ }
1893
+ invalid$data() {
1894
+ let { gen: e, schemaCode: t, schemaType: n, def: r, it: a } = this;
1895
+ return (0, c.or)(o(), s());
1896
+ function o() {
1897
+ if (n.length) {
1898
+ /* istanbul ignore if */
1899
+ if (!(t instanceof c.Name)) throw Error("ajv implementation error");
1900
+ let e = Array.isArray(n) ? n : [n];
1901
+ return (0, c._)`${(0, i.checkDataTypes)(e, t, a.opts.strictNumbers, i.DataType.Wrong)}`;
1902
+ }
1903
+ return c.nil;
1904
+ }
1905
+ function s() {
1906
+ if (r.validateSchema) {
1907
+ let n = e.scopeValue("validate$data", { ref: r.validateSchema });
1908
+ return (0, c._)`!${n}(${t})`;
1909
+ }
1910
+ return c.nil;
1911
+ }
1912
+ }
1913
+ subschema(e, t) {
1914
+ let n = (0, s.getSubschema)(this.it, e);
1915
+ (0, s.extendSubschemaData)(n, this.it, e), (0, s.extendSubschemaMode)(n, e);
1916
+ let r = {
1917
+ ...this.it,
1918
+ ...n,
1919
+ items: void 0,
1920
+ props: void 0
1921
+ };
1922
+ return b(r, t), r;
1923
+ }
1924
+ mergeEvaluated(e, t) {
1925
+ let { it: n, gen: r } = this;
1926
+ n.opts.unevaluated && (n.props !== !0 && e.props !== void 0 && (n.props = d.mergeEvaluated.props(r, e.props, n.props, t)), n.items !== !0 && e.items !== void 0 && (n.items = d.mergeEvaluated.items(r, e.items, n.items, t)));
1927
+ }
1928
+ mergeValidEvaluated(e, t) {
1929
+ let { it: n, gen: r } = this;
1930
+ if (n.opts.unevaluated && (n.props !== !0 || n.items !== !0)) return r.if(t, () => this.mergeEvaluated(e, c.Name)), !0;
1931
+ }
1932
+ };
1933
+ e.KeywordCxt = Y;
1934
+ function X(e, t, n, r) {
1935
+ let i = new Y(e, n, t);
1936
+ "code" in n ? n.code(i, r) : i.$data && n.validate ? (0, o.funcKeywordCode)(i, n) : "macro" in n ? (0, o.macroKeywordCode)(i, n) : (n.compile || n.validate) && (0, o.funcKeywordCode)(i, n);
1937
+ }
1938
+ var Z = /^\/(?:[^~]|~0|~1)*$/, ae = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
1939
+ function Q(e, { dataLevel: t, dataNames: n, dataPathArr: r }) {
1940
+ let i, a;
1941
+ if (e === "") return l.default.rootData;
1942
+ if (e[0] === "/") {
1943
+ if (!Z.test(e)) throw Error(`Invalid JSON-pointer: ${e}`);
1944
+ i = e, a = l.default.rootData;
1945
+ } else {
1946
+ let o = ae.exec(e);
1947
+ if (!o) throw Error(`Invalid JSON-pointer: ${e}`);
1948
+ let s = +o[1];
1949
+ if (i = o[2], i === "#") {
1950
+ if (s >= t) throw Error(u("property/index", s));
1951
+ return r[t - s];
1952
+ }
1953
+ if (s > t) throw Error(u("data", s));
1954
+ if (a = n[t - s], !i) return a;
1955
+ }
1956
+ let o = a, s = i.split("/");
1957
+ for (let e of s) e && (a = (0, c._)`${a}${(0, c.getProperty)((0, d.unescapeJsonPointer)(e))}`, o = (0, c._)`${o} && ${a}`);
1958
+ return o;
1959
+ function u(e, n) {
1960
+ return `Cannot access ${e} ${n} levels up, current level is ${t}`;
1961
+ }
1962
+ }
1963
+ e.getData = Q;
1964
+ })), z = /* @__PURE__ */ u(((e) => {
1965
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.default = class extends Error {
1966
+ constructor(e) {
1967
+ super("validation failed"), this.errors = e, this.ajv = this.validation = !0;
1968
+ }
1969
+ };
1970
+ })), B = /* @__PURE__ */ u(((e) => {
1971
+ Object.defineProperty(e, "__esModule", { value: !0 });
1972
+ var t = L();
1973
+ e.default = class extends Error {
1974
+ constructor(e, n, r, i) {
1975
+ super(i || `can't resolve reference ${r} from id ${n}`), this.missingRef = (0, t.resolveUrl)(e, n, r), this.missingSchema = (0, t.normalizeId)((0, t.getFullPath)(e, this.missingRef));
1976
+ }
1977
+ };
1978
+ })), V = /* @__PURE__ */ u(((e) => {
1979
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.resolveSchema = e.getCompilingSchema = e.resolveRef = e.compileSchema = e.SchemaEnv = void 0;
1980
+ var t = C(), n = z(), r = T(), i = L(), a = w(), o = R(), s = class {
1981
+ constructor(e) {
1982
+ this.refs = {}, this.dynamicAnchors = {};
1983
+ let t;
1984
+ typeof e.schema == "object" && (t = e.schema), this.schema = e.schema, this.schemaId = e.schemaId, this.root = e.root || this, this.baseId = e.baseId ?? (0, i.normalizeId)(t?.[e.schemaId || "$id"]), this.schemaPath = e.schemaPath, this.localRefs = e.localRefs, this.meta = e.meta, this.$async = t?.$async, this.refs = {};
1985
+ }
1986
+ };
1987
+ e.SchemaEnv = s;
1988
+ function c(e) {
1989
+ let a = d.call(this, e);
1990
+ if (a) return a;
1991
+ let s = (0, i.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: c, lines: l } = this.opts.code, { ownProperties: u } = this.opts, f = new t.CodeGen(this.scope, {
1992
+ es5: c,
1993
+ lines: l,
1994
+ ownProperties: u
1995
+ }), p;
1996
+ e.$async && (p = f.scopeValue("Error", {
1997
+ ref: n.default,
1998
+ code: (0, t._)`require("ajv/dist/runtime/validation_error").default`
1999
+ }));
2000
+ let m = f.scopeName("validate");
2001
+ e.validateName = m;
2002
+ let h = {
2003
+ gen: f,
2004
+ allErrors: this.opts.allErrors,
2005
+ data: r.default.data,
2006
+ parentData: r.default.parentData,
2007
+ parentDataProperty: r.default.parentDataProperty,
2008
+ dataNames: [r.default.data],
2009
+ dataPathArr: [t.nil],
2010
+ dataLevel: 0,
2011
+ dataTypes: [],
2012
+ definedProperties: /* @__PURE__ */ new Set(),
2013
+ topSchemaRef: f.scopeValue("schema", this.opts.code.source === !0 ? {
2014
+ ref: e.schema,
2015
+ code: (0, t.stringify)(e.schema)
2016
+ } : { ref: e.schema }),
2017
+ validateName: m,
2018
+ ValidationError: p,
2019
+ schema: e.schema,
2020
+ schemaEnv: e,
2021
+ rootId: s,
2022
+ baseId: e.baseId || s,
2023
+ schemaPath: t.nil,
2024
+ errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"),
2025
+ errorPath: (0, t._)`""`,
2026
+ opts: this.opts,
2027
+ self: this
2028
+ }, g;
2029
+ try {
2030
+ this._compilations.add(e), (0, o.validateFunctionCode)(h), f.optimize(this.opts.code.optimize);
2031
+ let n = f.toString();
2032
+ g = `${f.scopeRefs(r.default.scope)}return ${n}`, this.opts.code.process && (g = this.opts.code.process(g, e));
2033
+ let i = Function(`${r.default.self}`, `${r.default.scope}`, g)(this, this.scope.get());
2034
+ if (this.scope.value(m, { ref: i }), i.errors = null, i.schema = e.schema, i.schemaEnv = e, e.$async && (i.$async = !0), this.opts.code.source === !0 && (i.source = {
2035
+ validateName: m,
2036
+ validateCode: n,
2037
+ scopeValues: f._values
2038
+ }), this.opts.unevaluated) {
2039
+ let { props: e, items: n } = h;
2040
+ i.evaluated = {
2041
+ props: e instanceof t.Name ? void 0 : e,
2042
+ items: n instanceof t.Name ? void 0 : n,
2043
+ dynamicProps: e instanceof t.Name,
2044
+ dynamicItems: n instanceof t.Name
2045
+ }, i.source && (i.source.evaluated = (0, t.stringify)(i.evaluated));
2046
+ }
2047
+ return e.validate = i, e;
2048
+ } catch (t) {
2049
+ throw delete e.validate, delete e.validateName, g && this.logger.error("Error compiling schema, function code:", g), t;
2050
+ } finally {
2051
+ this._compilations.delete(e);
2052
+ }
2053
+ }
2054
+ e.compileSchema = c;
2055
+ function l(e, t, n) {
2056
+ n = (0, i.resolveUrl)(this.opts.uriResolver, t, n);
2057
+ let r = e.refs[n];
2058
+ if (r) return r;
2059
+ let a = p.call(this, e, n);
2060
+ if (a === void 0) {
2061
+ let r = e.localRefs?.[n], { schemaId: i } = this.opts;
2062
+ r && (a = new s({
2063
+ schema: r,
2064
+ schemaId: i,
2065
+ root: e,
2066
+ baseId: t
2067
+ }));
2068
+ }
2069
+ if (a !== void 0) return e.refs[n] = u.call(this, a);
2070
+ }
2071
+ e.resolveRef = l;
2072
+ function u(e) {
2073
+ return (0, i.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : c.call(this, e);
2074
+ }
2075
+ function d(e) {
2076
+ for (let t of this._compilations) if (f(t, e)) return t;
2077
+ }
2078
+ e.getCompilingSchema = d;
2079
+ function f(e, t) {
2080
+ return e.schema === t.schema && e.root === t.root && e.baseId === t.baseId;
2081
+ }
2082
+ function p(e, t) {
2083
+ let n;
2084
+ for (; typeof (n = this.refs[t]) == "string";) t = n;
2085
+ return n || this.schemas[t] || m.call(this, e, t);
2086
+ }
2087
+ function m(e, t) {
2088
+ let n = this.opts.uriResolver.parse(t), r = (0, i._getFullPath)(this.opts.uriResolver, n), a = (0, i.getFullPath)(this.opts.uriResolver, e.baseId, void 0);
2089
+ if (Object.keys(e.schema).length > 0 && r === a) return g.call(this, n, e);
2090
+ let o = (0, i.normalizeId)(r), l = this.refs[o] || this.schemas[o];
2091
+ if (typeof l == "string") {
2092
+ let t = m.call(this, e, l);
2093
+ return typeof t?.schema == "object" ? g.call(this, n, t) : void 0;
2094
+ }
2095
+ if (typeof l?.schema == "object") {
2096
+ if (l.validate || c.call(this, l), o === (0, i.normalizeId)(t)) {
2097
+ let { schema: t } = l, { schemaId: n } = this.opts, r = t[n];
2098
+ return r && (a = (0, i.resolveUrl)(this.opts.uriResolver, a, r)), new s({
2099
+ schema: t,
2100
+ schemaId: n,
2101
+ root: e,
2102
+ baseId: a
2103
+ });
2104
+ }
2105
+ return g.call(this, n, l);
2106
+ }
2107
+ }
2108
+ e.resolveSchema = m;
2109
+ var h = /* @__PURE__ */ new Set([
2110
+ "properties",
2111
+ "patternProperties",
2112
+ "enum",
2113
+ "dependencies",
2114
+ "definitions"
2115
+ ]);
2116
+ function g(e, { baseId: t, schema: n, root: r }) {
2117
+ if (e.fragment?.[0] !== "/") return;
2118
+ for (let r of e.fragment.slice(1).split("/")) {
2119
+ if (typeof n == "boolean") return;
2120
+ let e = n[(0, a.unescapeFragment)(r)];
2121
+ if (e === void 0) return;
2122
+ n = e;
2123
+ let o = typeof n == "object" && n[this.opts.schemaId];
2124
+ !h.has(r) && o && (t = (0, i.resolveUrl)(this.opts.uriResolver, t, o));
2125
+ }
2126
+ let o;
2127
+ if (typeof n != "boolean" && n.$ref && !(0, a.schemaHasRulesButRef)(n, this.RULES)) {
2128
+ let e = (0, i.resolveUrl)(this.opts.uriResolver, t, n.$ref);
2129
+ o = m.call(this, r, e);
2130
+ }
2131
+ let { schemaId: c } = this.opts;
2132
+ if (o ||= new s({
2133
+ schema: n,
2134
+ schemaId: c,
2135
+ root: r,
2136
+ baseId: t
2137
+ }), o.schema !== o.root.schema) return o;
2138
+ }
2139
+ })), ee = /* @__PURE__ */ d({
2140
+ $id: () => H,
2141
+ additionalProperties: () => !1,
2142
+ default: () => te,
2143
+ description: () => U,
2144
+ properties: () => K,
2145
+ required: () => G,
2146
+ type: () => W
2147
+ }), H, U, W, G, K, te, ne = l((() => {
2148
+ H = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", U = "Meta-schema for $data reference (JSON AnySchema extension proposal)", W = "object", G = ["$data"], K = { $data: {
2149
+ type: "string",
2150
+ anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }]
2151
+ } }, te = {
2152
+ $id: H,
2153
+ description: U,
2154
+ type: W,
2155
+ required: G,
2156
+ properties: K,
2157
+ additionalProperties: !1
2158
+ };
2159
+ })), re = /* @__PURE__ */ u(((e, t) => {
2160
+ var n = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu), r = 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), i = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu), a = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu), o = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
2161
+ function s(e) {
2162
+ let t = "", n = 0, r = 0;
2163
+ for (r = 0; r < e.length; r++) if (n = e[r].charCodeAt(0), n !== 48) {
2164
+ if (!(n >= 48 && n <= 57 || n >= 65 && n <= 70 || n >= 97 && n <= 102)) return "";
2165
+ t += e[r];
2166
+ break;
2167
+ }
2168
+ for (r += 1; r < e.length; r++) {
2169
+ if (n = e[r].charCodeAt(0), !(n >= 48 && n <= 57 || n >= 65 && n <= 70 || n >= 97 && n <= 102)) return "";
2170
+ t += e[r];
2171
+ }
2172
+ return t;
2173
+ }
2174
+ var c = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
2175
+ function l(e) {
2176
+ return e.length = 0, !0;
2177
+ }
2178
+ function u(e, t, n) {
2179
+ if (e.length) {
2180
+ let r = s(e);
2181
+ if (r !== "") t.push(r);
2182
+ else return n.error = !0, !1;
2183
+ e.length = 0;
2184
+ }
2185
+ return !0;
2186
+ }
2187
+ function d(e) {
2188
+ let t = 0, n = {
2189
+ error: !1,
2190
+ address: "",
2191
+ zone: ""
2192
+ }, r = [], i = [], a = !1, o = !1, c = u;
2193
+ for (let s = 0; s < e.length; s++) {
2194
+ let u = e[s];
2195
+ if (u !== "[" && u !== "]") {
2196
+ if (u === ":") {
2197
+ if (a === !0 && (o = !0), !c(i, r, n)) break;
2198
+ if (++t > 7) {
2199
+ n.error = !0;
2200
+ break;
2201
+ }
2202
+ s > 0 && e[s - 1] === ":" && (a = !0), r.push(":");
2203
+ continue;
2204
+ }
2205
+ if (u === "%") {
2206
+ if (!c(i, r, n)) break;
2207
+ c = l;
2208
+ } else {
2209
+ i.push(u);
2210
+ continue;
2211
+ }
2212
+ }
2213
+ }
2214
+ return i.length && (c === l ? n.zone = i.join("") : o ? r.push(i.join("")) : r.push(s(i))), n.address = r.join(""), n;
2215
+ }
2216
+ function f(e) {
2217
+ if (p(e, ":") < 2) return {
2218
+ host: e,
2219
+ isIPV6: !1
2220
+ };
2221
+ let t = d(e);
2222
+ if (t.error) return {
2223
+ host: e,
2224
+ isIPV6: !1
2225
+ };
2226
+ {
2227
+ let e = t.address, n = t.address;
2228
+ return t.zone && (e += "%" + t.zone, n += "%25" + t.zone), {
2229
+ host: e,
2230
+ isIPV6: !0,
2231
+ escapedHost: n
2232
+ };
2233
+ }
2234
+ }
2235
+ function p(e, t) {
2236
+ let n = 0;
2237
+ for (let r = 0; r < e.length; r++) e[r] === t && n++;
2238
+ return n;
2239
+ }
2240
+ function m(e) {
2241
+ let t = e, n = [], r = -1, i = 0;
2242
+ for (; i = t.length;) {
2243
+ if (i === 1) {
2244
+ if (t === ".") break;
2245
+ if (t === "/") {
2246
+ n.push("/");
2247
+ break;
2248
+ }
2249
+ n.push(t);
2250
+ break;
2251
+ }
2252
+ if (i === 2) {
2253
+ if (t[0] === ".") {
2254
+ if (t[1] === ".") break;
2255
+ if (t[1] === "/") {
2256
+ t = t.slice(2);
2257
+ continue;
2258
+ }
2259
+ } else if (t[0] === "/" && (t[1] === "." || t[1] === "/")) {
2260
+ n.push("/");
2261
+ break;
2262
+ }
2263
+ } else if (i === 3 && t === "/..") {
2264
+ n.length !== 0 && n.pop(), n.push("/");
2265
+ break;
2266
+ }
2267
+ if (t[0] === ".") {
2268
+ if (t[1] === ".") {
2269
+ if (t[2] === "/") {
2270
+ t = t.slice(3);
2271
+ continue;
2272
+ }
2273
+ } else if (t[1] === "/") {
2274
+ t = t.slice(2);
2275
+ continue;
2276
+ }
2277
+ } else if (t[0] === "/" && t[1] === ".") {
2278
+ if (t[2] === "/") {
2279
+ t = t.slice(2);
2280
+ continue;
2281
+ }
2282
+ if (t[2] === "." && t[3] === "/") {
2283
+ t = t.slice(3), n.length !== 0 && n.pop();
2284
+ continue;
2285
+ }
2286
+ }
2287
+ if ((r = t.indexOf("/", 1)) === -1) {
2288
+ n.push(t);
2289
+ break;
2290
+ }
2291
+ n.push(t.slice(0, r)), t = t.slice(r);
2292
+ }
2293
+ return n.join("");
2294
+ }
2295
+ var h = {
2296
+ "@": "%40",
2297
+ "/": "%2F",
2298
+ "?": "%3F",
2299
+ "#": "%23",
2300
+ ":": "%3A"
2301
+ }, g = /[@/?#:]/g, _ = /[@/?#]/g;
2302
+ function v(e, t) {
2303
+ let n = t ? _ : g;
2304
+ return n.lastIndex = 0, e.replace(n, (e) => h[e]);
2305
+ }
2306
+ function y(e, t = !1) {
2307
+ if (e.indexOf("%") === -1) return e;
2308
+ let n = "";
2309
+ for (let r = 0; r < e.length; r++) {
2310
+ if (e[r] === "%" && r + 2 < e.length) {
2311
+ let o = e.slice(r + 1, r + 3);
2312
+ if (i(o)) {
2313
+ let e = o.toUpperCase(), i = String.fromCharCode(parseInt(e, 16));
2314
+ t && a(i) ? n += i : n += "%" + e, r += 2;
2315
+ continue;
2316
+ }
2317
+ }
2318
+ n += e[r];
2319
+ }
2320
+ return n;
2321
+ }
2322
+ function b(e) {
2323
+ let t = "";
2324
+ for (let n = 0; n < e.length; n++) {
2325
+ if (e[n] === "%" && n + 2 < e.length) {
2326
+ let r = e.slice(n + 1, n + 3);
2327
+ if (i(r)) {
2328
+ let e = r.toUpperCase(), i = String.fromCharCode(parseInt(e, 16));
2329
+ i !== "." && a(i) ? t += i : t += "%" + e, n += 2;
2330
+ continue;
2331
+ }
2332
+ }
2333
+ o(e[n]) ? t += e[n] : t += escape(e[n]);
2334
+ }
2335
+ return t;
2336
+ }
2337
+ function x(e) {
2338
+ let t = "";
2339
+ for (let n = 0; n < e.length; n++) {
2340
+ if (e[n] === "%" && n + 2 < e.length) {
2341
+ let r = e.slice(n + 1, n + 3);
2342
+ if (i(r)) {
2343
+ t += "%" + r.toUpperCase(), n += 2;
2344
+ continue;
2345
+ }
2346
+ }
2347
+ t += escape(e[n]);
2348
+ }
2349
+ return t;
2350
+ }
2351
+ function S(e) {
2352
+ let t = [];
2353
+ if (e.userinfo !== void 0 && (t.push(e.userinfo), t.push("@")), e.host !== void 0) {
2354
+ let n = unescape(e.host);
2355
+ if (!r(n)) {
2356
+ let e = f(n);
2357
+ n = e.isIPV6 === !0 ? `[${e.escapedHost}]` : v(n, !1);
2358
+ }
2359
+ t.push(n);
2360
+ }
2361
+ return (typeof e.port == "number" || typeof e.port == "string") && (t.push(":"), t.push(String(e.port))), t.length ? t.join("") : void 0;
2362
+ }
2363
+ t.exports = {
2364
+ nonSimpleDomain: c,
2365
+ recomposeAuthority: S,
2366
+ reescapeHostDelimiters: v,
2367
+ normalizePercentEncoding: y,
2368
+ normalizePathEncoding: b,
2369
+ escapePreservingEscapes: x,
2370
+ removeDotSegments: m,
2371
+ isIPv4: r,
2372
+ isUUID: n,
2373
+ normalizeIPv6: f,
2374
+ stringArrayToHexStripped: s
2375
+ };
2376
+ })), q = /* @__PURE__ */ u(((e, t) => {
2377
+ var { isUUID: n } = re(), r = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu, i = [
2378
+ "http",
2379
+ "https",
2380
+ "ws",
2381
+ "wss",
2382
+ "urn",
2383
+ "urn:uuid"
2384
+ ];
2385
+ function a(e) {
2386
+ return i.indexOf(e) !== -1;
2387
+ }
2388
+ function o(e) {
2389
+ return e.secure === !0 ? !0 : e.secure === !1 ? !1 : e.scheme ? e.scheme.length === 3 && (e.scheme[0] === "w" || e.scheme[0] === "W") && (e.scheme[1] === "s" || e.scheme[1] === "S") && (e.scheme[2] === "s" || e.scheme[2] === "S") : !1;
2390
+ }
2391
+ function s(e) {
2392
+ return e.host || (e.error = e.error || "HTTP URIs must have a host."), e;
2393
+ }
2394
+ function c(e) {
2395
+ let t = String(e.scheme).toLowerCase() === "https";
2396
+ return (e.port === (t ? 443 : 80) || e.port === "") && (e.port = void 0), e.path ||= "/", e;
2397
+ }
2398
+ function l(e) {
2399
+ return e.secure = o(e), e.resourceName = (e.path || "/") + (e.query ? "?" + e.query : ""), e.path = void 0, e.query = void 0, e;
2400
+ }
2401
+ function u(e) {
2402
+ if ((e.port === (o(e) ? 443 : 80) || e.port === "") && (e.port = void 0), typeof e.secure == "boolean" && (e.scheme = e.secure ? "wss" : "ws", e.secure = void 0), e.resourceName) {
2403
+ let [t, n] = e.resourceName.split("?");
2404
+ e.path = t && t !== "/" ? t : void 0, e.query = n, e.resourceName = void 0;
2405
+ }
2406
+ return e.fragment = void 0, e;
2407
+ }
2408
+ function d(e, t) {
2409
+ if (!e.path) return e.error = "URN can not be parsed", e;
2410
+ let n = e.path.match(r);
2411
+ if (n) {
2412
+ let r = t.scheme || e.scheme || "urn";
2413
+ e.nid = n[1].toLowerCase(), e.nss = n[2];
2414
+ let i = y(`${r}:${t.nid || e.nid}`);
2415
+ e.path = void 0, i && (e = i.parse(e, t));
2416
+ } else e.error = e.error || "URN can not be parsed.";
2417
+ return e;
2418
+ }
2419
+ function f(e, t) {
2420
+ if (e.nid === void 0) throw Error("URN without nid cannot be serialized");
2421
+ let n = t.scheme || e.scheme || "urn", r = e.nid.toLowerCase(), i = y(`${n}:${t.nid || r}`);
2422
+ i && (e = i.serialize(e, t));
2423
+ let a = e, o = e.nss;
2424
+ return a.path = `${r || t.nid}:${o}`, t.skipEscape = !0, a;
2425
+ }
2426
+ function p(e, t) {
2427
+ let r = e;
2428
+ return r.uuid = r.nss, r.nss = void 0, !t.tolerant && (!r.uuid || !n(r.uuid)) && (r.error = r.error || "UUID is not valid."), r;
2429
+ }
2430
+ function m(e) {
2431
+ let t = e;
2432
+ return t.nss = (e.uuid || "").toLowerCase(), t;
2433
+ }
2434
+ var h = {
2435
+ scheme: "http",
2436
+ domainHost: !0,
2437
+ parse: s,
2438
+ serialize: c
2439
+ }, g = {
2440
+ scheme: "https",
2441
+ domainHost: h.domainHost,
2442
+ parse: s,
2443
+ serialize: c
2444
+ }, _ = {
2445
+ scheme: "ws",
2446
+ domainHost: !0,
2447
+ parse: l,
2448
+ serialize: u
2449
+ }, v = {
2450
+ http: h,
2451
+ https: g,
2452
+ ws: _,
2453
+ wss: {
2454
+ scheme: "wss",
2455
+ domainHost: _.domainHost,
2456
+ parse: _.parse,
2457
+ serialize: _.serialize
2458
+ },
2459
+ urn: {
2460
+ scheme: "urn",
2461
+ parse: d,
2462
+ serialize: f,
2463
+ skipNormalize: !0
2464
+ },
2465
+ "urn:uuid": {
2466
+ scheme: "urn:uuid",
2467
+ parse: p,
2468
+ serialize: m,
2469
+ skipNormalize: !0
2470
+ }
2471
+ };
2472
+ Object.setPrototypeOf(v, null);
2473
+ function y(e) {
2474
+ return e && (v[e] || v[e.toLowerCase()]) || void 0;
2475
+ }
2476
+ t.exports = {
2477
+ wsIsSecure: o,
2478
+ SCHEMES: v,
2479
+ isValidSchemeName: a,
2480
+ getSchemeHandler: y
2481
+ };
2482
+ })), ie = /* @__PURE__ */ u(((e, t) => {
2483
+ var { normalizeIPv6: n, removeDotSegments: r, recomposeAuthority: i, normalizePercentEncoding: a, normalizePathEncoding: o, escapePreservingEscapes: s, reescapeHostDelimiters: c, isIPv4: l, nonSimpleDomain: u } = re(), { SCHEMES: d, getSchemeHandler: f } = q();
2484
+ function p(e, t) {
2485
+ return typeof e == "string" ? e = w(e, t) : typeof e == "object" && (e = C(_(e, t), t)), e;
2486
+ }
2487
+ function m(e, t, n) {
2488
+ let r = n ? Object.assign({ scheme: "null" }, n) : { scheme: "null" }, { parsed: i, malformedAuthorityOrPort: a } = S(e, r), { parsed: o, malformedAuthorityOrPort: s } = S(t, r);
2489
+ if (a || s) throw Error(i.error || o.error || "URI is malformed.");
2490
+ let c = h(i, o, r, !0);
2491
+ return r.skipEscape = !0, _(c, r);
2492
+ }
2493
+ function h(e, t, n, i) {
2494
+ let a = {};
2495
+ return i || (e = C(_(e, n), n), t = C(_(t, n), n)), n ||= {}, !n.tolerant && t.scheme ? (a.scheme = t.scheme, a.userinfo = t.userinfo, a.host = t.host, a.port = t.port, a.path = r(t.path || ""), a.query = t.query) : (t.userinfo !== void 0 || t.host !== void 0 || t.port !== void 0 ? (a.userinfo = t.userinfo, a.host = t.host, a.port = t.port, a.path = r(t.path || ""), a.query = t.query) : (t.path ? (t.path[0] === "/" ? a.path = r(t.path) : (a.path = (e.userinfo !== void 0 || e.host !== void 0 || e.port !== void 0) && !e.path ? "/" + t.path : e.path ? e.path.slice(0, e.path.lastIndexOf("/") + 1) + t.path : t.path, a.path = r(a.path)), a.query = t.query) : (a.path = e.path, a.query = t.query === void 0 ? e.query : t.query), a.userinfo = e.userinfo, a.host = e.host, a.port = e.port), a.scheme = e.scheme), a.fragment = t.fragment, a;
2496
+ }
2497
+ function g(e, t, n) {
2498
+ let r = E(e, n), i = E(t, n);
2499
+ return r !== void 0 && i !== void 0 && r.toLowerCase() === i.toLowerCase();
2500
+ }
2501
+ function _(e, t) {
2502
+ let n = {
2503
+ host: e.host,
2504
+ scheme: e.scheme,
2505
+ userinfo: e.userinfo,
2506
+ port: e.port,
2507
+ path: e.path,
2508
+ query: e.query,
2509
+ nid: e.nid,
2510
+ nss: e.nss,
2511
+ uuid: e.uuid,
2512
+ fragment: e.fragment,
2513
+ reference: e.reference,
2514
+ resourceName: e.resourceName,
2515
+ secure: e.secure,
2516
+ error: ""
2517
+ }, o = Object.assign({}, t), c = [], l = f(o.scheme || n.scheme);
2518
+ l && l.serialize && l.serialize(n, o), n.path !== void 0 && (o.skipEscape ? n.path = a(n.path) : (n.path = s(n.path), n.scheme !== void 0 && (n.path = n.path.split("%3A").join(":")))), o.reference !== "suffix" && n.scheme && c.push(n.scheme, ":");
2519
+ let u = i(n);
2520
+ if (u !== void 0 && (o.reference !== "suffix" && c.push("//"), c.push(u), n.path && n.path[0] !== "/" && c.push("/")), n.path !== void 0) {
2521
+ let e = n.path;
2522
+ !o.absolutePath && (!l || !l.absolutePath) && (e = r(e)), u === void 0 && e[0] === "/" && e[1] === "/" && (e = "/%2F" + e.slice(2)), c.push(e);
2523
+ }
2524
+ return n.query !== void 0 && c.push("?", n.query), n.fragment !== void 0 && c.push("#", n.fragment), c.join("");
2525
+ }
2526
+ var v = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u, y = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/, b = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
2527
+ function x(e, t) {
2528
+ if (t[2] !== void 0 && e.path && e.path[0] !== "/") return "URI path must start with \"/\" when authority is present.";
2529
+ if (typeof e.port == "number" && (e.port < 0 || e.port > 65535)) return "URI port is malformed.";
2530
+ }
2531
+ function S(e, t) {
2532
+ let r = Object.assign({}, t), i = {
2533
+ scheme: void 0,
2534
+ userinfo: void 0,
2535
+ host: "",
2536
+ port: void 0,
2537
+ path: "",
2538
+ query: void 0,
2539
+ fragment: void 0
2540
+ }, a = !1, s = !1;
2541
+ r.reference === "suffix" && (e = r.scheme ? r.scheme + ":" + e : "//" + e);
2542
+ let d = e.match(y);
2543
+ d !== null && d[1].indexOf("\\") !== -1 && (i.error = "URI authority must not contain a literal backslash.", a = !0);
2544
+ let p = e.match(b);
2545
+ if (p !== null) {
2546
+ let e = p[1], t = e.replace(/[\t\n\r]/g, "");
2547
+ t.length >= 2 && (t.slice(0, 2) === "//" ? e.length !== t.length && (i.error = i.error || "URI authority introducer must not contain whitespace.", a = !0) : (i.error = i.error || "URI authority must not contain a literal backslash.", a = !0));
2548
+ }
2549
+ let m = e.match(v);
2550
+ if (m) {
2551
+ i.scheme = m[1], i.userinfo = m[3], i.host = m[4], i.port = parseInt(m[5], 10), i.path = m[6] || "", i.query = m[7], i.fragment = m[8], isNaN(i.port) && (i.port = m[5]);
2552
+ let t = x(i, m);
2553
+ if (t !== void 0 && (i.error = i.error || t, a = !0), i.host) if (l(i.host) === !1) {
2554
+ let e = n(i.host);
2555
+ i.host = e.host.toLowerCase(), s = e.isIPV6;
2556
+ } else s = !0;
2557
+ i.reference = i.scheme === void 0 && i.userinfo === void 0 && i.host === void 0 && i.port === void 0 && i.query === void 0 && !i.path ? "same-document" : i.scheme === void 0 ? "relative" : i.fragment === void 0 ? "absolute" : "uri", r.reference && r.reference !== "suffix" && r.reference !== i.reference && (i.error = i.error || "URI is not a " + r.reference + " reference.");
2558
+ let d = f(r.scheme || i.scheme);
2559
+ if (!r.unicodeSupport && (!d || !d.unicodeSupport) && i.host && (r.domainHost || d && d.domainHost) && s === !1 && u(i.host)) try {
2560
+ i.host = new URL("http://" + i.host).hostname;
2561
+ } catch (e) {
2562
+ i.error = i.error || "Host's domain name can not be converted to ASCII: " + e;
2563
+ }
2564
+ if ((!d || d && !d.skipNormalize) && (e.indexOf("%") !== -1 && (i.scheme !== void 0 && (i.scheme = unescape(i.scheme)), i.host !== void 0 && (i.host = c(unescape(i.host), s))), i.path &&= o(i.path), i.fragment)) try {
2565
+ i.fragment = encodeURI(decodeURIComponent(i.fragment));
2566
+ } catch {
2567
+ i.error = i.error || "URI malformed";
2568
+ }
2569
+ d && d.parse && d.parse(i, r);
2570
+ } else i.error = i.error || "URI can not be parsed.";
2571
+ return {
2572
+ parsed: i,
2573
+ malformedAuthorityOrPort: a
2574
+ };
2575
+ }
2576
+ function C(e, t) {
2577
+ return S(e, t).parsed;
2578
+ }
2579
+ function w(e, t) {
2580
+ return T(e, t).normalized;
2581
+ }
2582
+ function T(e, t) {
2583
+ let { parsed: n, malformedAuthorityOrPort: r } = S(e, t);
2584
+ return {
2585
+ normalized: r ? e : _(n, t),
2586
+ malformedAuthorityOrPort: r
2587
+ };
2588
+ }
2589
+ function E(e, t) {
2590
+ if (typeof e == "string") {
2591
+ let { normalized: n, malformedAuthorityOrPort: r } = T(e, t);
2592
+ return r ? void 0 : n;
2593
+ }
2594
+ if (typeof e == "object") return _(e, t);
2595
+ }
2596
+ var D = {
2597
+ SCHEMES: d,
2598
+ normalize: p,
2599
+ resolve: m,
2600
+ resolveComponent: h,
2601
+ equal: g,
2602
+ serialize: _,
2603
+ parse: C
2604
+ };
2605
+ t.exports = D, t.exports.default = D, t.exports.fastUri = D;
2606
+ })), J = /* @__PURE__ */ u(((e) => {
2607
+ Object.defineProperty(e, "__esModule", { value: !0 });
2608
+ var t = ie();
2609
+ t.code = "require(\"ajv/dist/runtime/uri\").default", e.default = t;
2610
+ })), Y = /* @__PURE__ */ u(((e) => {
2611
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
2612
+ var t = R();
2613
+ Object.defineProperty(e, "KeywordCxt", {
2614
+ enumerable: !0,
2615
+ get: function() {
2616
+ return t.KeywordCxt;
2617
+ }
2618
+ });
2619
+ var n = C();
2620
+ Object.defineProperty(e, "_", {
2621
+ enumerable: !0,
2622
+ get: function() {
2623
+ return n._;
2624
+ }
2625
+ }), Object.defineProperty(e, "str", {
2626
+ enumerable: !0,
2627
+ get: function() {
2628
+ return n.str;
2629
+ }
2630
+ }), Object.defineProperty(e, "stringify", {
2631
+ enumerable: !0,
2632
+ get: function() {
2633
+ return n.stringify;
2634
+ }
2635
+ }), Object.defineProperty(e, "nil", {
2636
+ enumerable: !0,
2637
+ get: function() {
2638
+ return n.nil;
2639
+ }
2640
+ }), Object.defineProperty(e, "Name", {
2641
+ enumerable: !0,
2642
+ get: function() {
2643
+ return n.Name;
2644
+ }
2645
+ }), Object.defineProperty(e, "CodeGen", {
2646
+ enumerable: !0,
2647
+ get: function() {
2648
+ return n.CodeGen;
2649
+ }
2650
+ });
2651
+ var r = z(), i = B(), a = O(), o = V(), s = C(), c = L(), l = A(), u = w(), d = (ne(), p(ee).default), f = J(), m = (e, t) => new RegExp(e, t);
2652
+ m.code = "new RegExp";
2653
+ var h = [
2654
+ "removeAdditional",
2655
+ "useDefaults",
2656
+ "coerceTypes"
2657
+ ], g = /* @__PURE__ */ new Set([
2658
+ "validate",
2659
+ "serialize",
2660
+ "parse",
2661
+ "wrapper",
2662
+ "root",
2663
+ "schema",
2664
+ "keyword",
2665
+ "pattern",
2666
+ "formats",
2667
+ "validate$data",
2668
+ "func",
2669
+ "obj",
2670
+ "Error"
2671
+ ]), _ = {
2672
+ errorDataPath: "",
2673
+ format: "`validateFormats: false` can be used instead.",
2674
+ nullable: "\"nullable\" keyword is supported by default.",
2675
+ jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
2676
+ extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
2677
+ missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
2678
+ processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
2679
+ sourceCode: "Use option `code: {source: true}`",
2680
+ strictDefaults: "It is default now, see option `strict`.",
2681
+ strictKeywords: "It is default now, see option `strict`.",
2682
+ uniqueItems: "\"uniqueItems\" keyword is always validated.",
2683
+ unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
2684
+ cache: "Map is used as cache, schema object as key.",
2685
+ serialize: "Map is used as cache, schema object as key.",
2686
+ ajvErrors: "It is default now."
2687
+ }, v = {
2688
+ ignoreKeywordsWithRef: "",
2689
+ jsPropertySyntax: "",
2690
+ unicode: "\"minLength\"/\"maxLength\" account for unicode characters by default."
2691
+ }, y = 200;
2692
+ function b(e) {
2693
+ let t = e.strict, n = e.code?.optimize, r = n === !0 || n === void 0 ? 1 : n || 0, i = e.code?.regExp ?? m, a = e.uriResolver ?? f.default;
2694
+ return {
2695
+ strictSchema: e.strictSchema ?? t ?? !0,
2696
+ strictNumbers: e.strictNumbers ?? t ?? !0,
2697
+ strictTypes: e.strictTypes ?? t ?? "log",
2698
+ strictTuples: e.strictTuples ?? t ?? "log",
2699
+ strictRequired: e.strictRequired ?? t ?? !1,
2700
+ code: e.code ? {
2701
+ ...e.code,
2702
+ optimize: r,
2703
+ regExp: i
2704
+ } : {
2705
+ optimize: r,
2706
+ regExp: i
2707
+ },
2708
+ loopRequired: e.loopRequired ?? y,
2709
+ loopEnum: e.loopEnum ?? y,
2710
+ meta: e.meta ?? !0,
2711
+ messages: e.messages ?? !0,
2712
+ inlineRefs: e.inlineRefs ?? !0,
2713
+ schemaId: e.schemaId ?? "$id",
2714
+ addUsedSchema: e.addUsedSchema ?? !0,
2715
+ validateSchema: e.validateSchema ?? !0,
2716
+ validateFormats: e.validateFormats ?? !0,
2717
+ unicodeRegExp: e.unicodeRegExp ?? !0,
2718
+ int32range: e.int32range ?? !0,
2719
+ uriResolver: a
2720
+ };
2721
+ }
2722
+ var x = class {
2723
+ constructor(e = {}) {
2724
+ this.schemas = {}, this.refs = {}, this.formats = Object.create(null), this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), e = this.opts = {
2725
+ ...e,
2726
+ ...b(e)
2727
+ };
2728
+ let { es5: t, lines: n } = this.opts.code;
2729
+ this.scope = new s.ValueScope({
2730
+ scope: {},
2731
+ prefixes: g,
2732
+ es5: t,
2733
+ lines: n
2734
+ }), this.logger = N(e.logger);
2735
+ let r = e.validateFormats;
2736
+ e.validateFormats = !1, this.RULES = (0, a.getRules)(), S.call(this, _, e, "NOT SUPPORTED"), S.call(this, v, e, "DEPRECATED", "warn"), this._metaOpts = j.call(this), e.formats && D.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), e.keywords && k.call(this, e.keywords), typeof e.meta == "object" && this.addMetaSchema(e.meta), E.call(this), e.validateFormats = r;
2737
+ }
2738
+ _addVocabularies() {
2739
+ this.addKeyword("$async");
2740
+ }
2741
+ _addDefaultMetaSchema() {
2742
+ let { $data: e, meta: t, schemaId: n } = this.opts, r = d;
2743
+ n === "id" && (r = { ...d }, r.id = r.$id, delete r.$id), t && e && this.addMetaSchema(r, r[n], !1);
2744
+ }
2745
+ defaultMeta() {
2746
+ let { meta: e, schemaId: t } = this.opts;
2747
+ return this.opts.defaultMeta = typeof e == "object" ? e[t] || e : void 0;
2748
+ }
2749
+ validate(e, t) {
2750
+ let n;
2751
+ if (typeof e == "string") {
2752
+ if (n = this.getSchema(e), !n) throw Error(`no schema with key or ref "${e}"`);
2753
+ } else n = this.compile(e);
2754
+ let r = n(t);
2755
+ return "$async" in n || (this.errors = n.errors), r;
2756
+ }
2757
+ compile(e, t) {
2758
+ let n = this._addSchema(e, t);
2759
+ return n.validate || this._compileSchemaEnv(n);
2760
+ }
2761
+ compileAsync(e, t) {
2762
+ if (typeof this.opts.loadSchema != "function") throw Error("options.loadSchema should be a function");
2763
+ let { loadSchema: n } = this.opts;
2764
+ return r.call(this, e, t);
2765
+ async function r(e, t) {
2766
+ await a.call(this, e.$schema);
2767
+ let n = this._addSchema(e, t);
2768
+ return n.validate || o.call(this, n);
2769
+ }
2770
+ async function a(e) {
2771
+ e && !this.getSchema(e) && await r.call(this, { $ref: e }, !0);
2772
+ }
2773
+ async function o(e) {
2774
+ try {
2775
+ return this._compileSchemaEnv(e);
2776
+ } catch (t) {
2777
+ if (!(t instanceof i.default)) throw t;
2778
+ return s.call(this, t), await c.call(this, t.missingSchema), o.call(this, e);
2779
+ }
2780
+ }
2781
+ function s({ missingSchema: e, missingRef: t }) {
2782
+ if (this.refs[e]) throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`);
2783
+ }
2784
+ async function c(e) {
2785
+ let n = await l.call(this, e);
2786
+ this.refs[e] || await a.call(this, n.$schema), this.refs[e] || this.addSchema(n, e, t);
2787
+ }
2788
+ async function l(e) {
2789
+ let t = this._loading[e];
2790
+ if (t) return t;
2791
+ try {
2792
+ return await (this._loading[e] = n(e));
2793
+ } finally {
2794
+ delete this._loading[e];
2795
+ }
2796
+ }
2797
+ }
2798
+ addSchema(e, t, n, r = this.opts.validateSchema) {
2799
+ if (Array.isArray(e)) {
2800
+ for (let t of e) this.addSchema(t, void 0, n, r);
2801
+ return this;
2802
+ }
2803
+ let i;
2804
+ if (typeof e == "object") {
2805
+ let { schemaId: t } = this.opts;
2806
+ if (i = e[t], i !== void 0 && typeof i != "string") throw Error(`schema ${t} must be string`);
2807
+ }
2808
+ return t = (0, c.normalizeId)(t || i), this._checkUnique(t), this.schemas[t] = this._addSchema(e, n, t, r, !0), this;
2809
+ }
2810
+ addMetaSchema(e, t, n = this.opts.validateSchema) {
2811
+ return this.addSchema(e, t, !0, n), this;
2812
+ }
2813
+ validateSchema(e, t) {
2814
+ if (typeof e == "boolean") return !0;
2815
+ let n;
2816
+ if (n = e.$schema, n !== void 0 && typeof n != "string") throw Error("$schema must be a string");
2817
+ if (n = n || this.opts.defaultMeta || this.defaultMeta(), !n) return this.logger.warn("meta-schema not available"), this.errors = null, !0;
2818
+ let r = this.validate(n, e);
2819
+ if (!r && t) {
2820
+ let e = "schema is invalid: " + this.errorsText();
2821
+ if (this.opts.validateSchema === "log") this.logger.error(e);
2822
+ else throw Error(e);
2823
+ }
2824
+ return r;
2825
+ }
2826
+ getSchema(e) {
2827
+ let t;
2828
+ for (; typeof (t = T.call(this, e)) == "string";) e = t;
2829
+ if (t === void 0) {
2830
+ let { schemaId: n } = this.opts, r = new o.SchemaEnv({
2831
+ schema: {},
2832
+ schemaId: n
2833
+ });
2834
+ if (t = o.resolveSchema.call(this, r, e), !t) return;
2835
+ this.refs[e] = t;
2836
+ }
2837
+ return t.validate || this._compileSchemaEnv(t);
2838
+ }
2839
+ removeSchema(e) {
2840
+ if (e instanceof RegExp) return this._removeAllSchemas(this.schemas, e), this._removeAllSchemas(this.refs, e), this;
2841
+ switch (typeof e) {
2842
+ case "undefined": return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
2843
+ case "string": {
2844
+ let t = T.call(this, e);
2845
+ return typeof t == "object" && this._cache.delete(t.schema), delete this.schemas[e], delete this.refs[e], this;
2846
+ }
2847
+ case "object": {
2848
+ let t = e;
2849
+ this._cache.delete(t);
2850
+ let n = e[this.opts.schemaId];
2851
+ return n && (n = (0, c.normalizeId)(n), delete this.schemas[n], delete this.refs[n]), this;
2852
+ }
2853
+ default: throw Error("ajv.removeSchema: invalid parameter");
2854
+ }
2855
+ }
2856
+ addVocabulary(e) {
2857
+ for (let t of e) this.addKeyword(t);
2858
+ return this;
2859
+ }
2860
+ addKeyword(e, t) {
2861
+ let n;
2862
+ if (typeof e == "string") n = e, typeof t == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), t.keyword = n);
2863
+ else if (typeof e == "object" && t === void 0) {
2864
+ if (t = e, n = t.keyword, Array.isArray(n) && !n.length) throw Error("addKeywords: keyword must be string or non-empty array");
2865
+ } else throw Error("invalid addKeywords parameters");
2866
+ if (F.call(this, n, t), !t) return (0, u.eachItem)(n, (e) => I.call(this, e)), this;
2867
+ U.call(this, t);
2868
+ let r = {
2869
+ ...t,
2870
+ type: (0, l.getJSONTypes)(t.type),
2871
+ schemaType: (0, l.getJSONTypes)(t.schemaType)
2872
+ };
2873
+ return (0, u.eachItem)(n, r.type.length === 0 ? (e) => I.call(this, e, r) : (e) => r.type.forEach((t) => I.call(this, e, r, t))), this;
2874
+ }
2875
+ getKeyword(e) {
2876
+ let t = this.RULES.all[e];
2877
+ return typeof t == "object" ? t.definition : !!t;
2878
+ }
2879
+ removeKeyword(e) {
2880
+ let { RULES: t } = this;
2881
+ delete t.keywords[e], delete t.all[e];
2882
+ for (let n of t.rules) {
2883
+ let t = n.rules.findIndex((t) => t.keyword === e);
2884
+ t >= 0 && n.rules.splice(t, 1);
2885
+ }
2886
+ return this;
2887
+ }
2888
+ addFormat(e, t) {
2889
+ return typeof t == "string" && (t = new RegExp(t)), this.formats[e] = t, this;
2890
+ }
2891
+ errorsText(e = this.errors, { separator: t = ", ", dataVar: n = "data" } = {}) {
2892
+ return !e || e.length === 0 ? "No errors" : e.map((e) => `${n}${e.instancePath} ${e.message}`).reduce((e, n) => e + t + n);
2893
+ }
2894
+ $dataMetaSchema(e, t) {
2895
+ let n = this.RULES.all;
2896
+ e = JSON.parse(JSON.stringify(e));
2897
+ for (let r of t) {
2898
+ let t = r.split("/").slice(1), i = e;
2899
+ for (let e of t) i = i[e];
2900
+ for (let e in n) {
2901
+ let t = n[e];
2902
+ if (typeof t != "object") continue;
2903
+ let { $data: r } = t.definition, a = i[e];
2904
+ r && a && (i[e] = G(a));
2905
+ }
2906
+ }
2907
+ return e;
2908
+ }
2909
+ _removeAllSchemas(e, t) {
2910
+ for (let n in e) {
2911
+ let r = e[n];
2912
+ (!t || t.test(n)) && (typeof r == "string" ? delete e[n] : r && !r.meta && (this._cache.delete(r.schema), delete e[n]));
2913
+ }
2914
+ }
2915
+ _addSchema(e, t, n, r = this.opts.validateSchema, i = this.opts.addUsedSchema) {
2916
+ let a, { schemaId: s } = this.opts;
2917
+ if (typeof e == "object") a = e[s];
2918
+ else if (this.opts.jtd) throw Error("schema must be object");
2919
+ else if (typeof e != "boolean") throw Error("schema must be object or boolean");
2920
+ let l = this._cache.get(e);
2921
+ if (l !== void 0) return l;
2922
+ n = (0, c.normalizeId)(a || n);
2923
+ let u = c.getSchemaRefs.call(this, e, n);
2924
+ return l = new o.SchemaEnv({
2925
+ schema: e,
2926
+ schemaId: s,
2927
+ meta: t,
2928
+ baseId: n,
2929
+ localRefs: u
2930
+ }), this._cache.set(l.schema, l), i && !n.startsWith("#") && (n && this._checkUnique(n), this.refs[n] = l), r && this.validateSchema(e, !0), l;
2931
+ }
2932
+ _checkUnique(e) {
2933
+ if (this.schemas[e] || this.refs[e]) throw Error(`schema with key or id "${e}" already exists`);
2934
+ }
2935
+ _compileSchemaEnv(e) {
2936
+ /* istanbul ignore if */
2937
+ if (e.meta ? this._compileMetaSchema(e) : o.compileSchema.call(this, e), !e.validate) throw Error("ajv implementation error");
2938
+ return e.validate;
2939
+ }
2940
+ _compileMetaSchema(e) {
2941
+ let t = this.opts;
2942
+ this.opts = this._metaOpts;
2943
+ try {
2944
+ o.compileSchema.call(this, e);
2945
+ } finally {
2946
+ this.opts = t;
2947
+ }
2948
+ }
2949
+ };
2950
+ x.ValidationError = r.default, x.MissingRefError = i.default, e.default = x;
2951
+ function S(e, t, n, r = "error") {
2952
+ for (let i in e) {
2953
+ let a = i;
2954
+ a in t && this.logger[r](`${n}: option ${i}. ${e[a]}`);
2955
+ }
2956
+ }
2957
+ function T(e) {
2958
+ return e = (0, c.normalizeId)(e), this.schemas[e] || this.refs[e];
2959
+ }
2960
+ function E() {
2961
+ let e = this.opts.schemas;
2962
+ if (e) if (Array.isArray(e)) this.addSchema(e);
2963
+ else for (let t in e) this.addSchema(e[t], t);
2964
+ }
2965
+ function D() {
2966
+ for (let e in this.opts.formats) {
2967
+ let t = this.opts.formats[e];
2968
+ t && this.addFormat(e, t);
2969
+ }
2970
+ }
2971
+ function k(e) {
2972
+ if (Array.isArray(e)) {
2973
+ this.addVocabulary(e);
2974
+ return;
2975
+ }
2976
+ this.logger.warn("keywords option as map is deprecated, pass array");
2977
+ for (let t in e) {
2978
+ let n = e[t];
2979
+ n.keyword ||= t, this.addKeyword(n);
2980
+ }
2981
+ }
2982
+ function j() {
2983
+ let e = { ...this.opts };
2984
+ for (let t of h) delete e[t];
2985
+ return e;
2986
+ }
2987
+ var M = {
2988
+ log() {},
2989
+ warn() {},
2990
+ error() {}
2991
+ };
2992
+ function N(e) {
2993
+ if (e === !1) return M;
2994
+ if (e === void 0) return console;
2995
+ if (e.log && e.warn && e.error) return e;
2996
+ throw Error("logger must implement log, warn and error methods");
2997
+ }
2998
+ var P = /^[a-z_$][a-z0-9_$:-]*$/i;
2999
+ function F(e, t) {
3000
+ let { RULES: n } = this;
3001
+ if ((0, u.eachItem)(e, (e) => {
3002
+ if (n.keywords[e]) throw Error(`Keyword ${e} is already defined`);
3003
+ if (!P.test(e)) throw Error(`Keyword ${e} has invalid name`);
3004
+ }), t && t.$data && !("code" in t || "validate" in t)) throw Error("$data keyword must have \"code\" or \"validate\" function");
3005
+ }
3006
+ function I(e, t, n) {
3007
+ var r;
3008
+ let i = t?.post;
3009
+ if (n && i) throw Error("keyword with \"post\" flag cannot have \"type\"");
3010
+ let { RULES: a } = this, o = i ? a.post : a.rules.find(({ type: e }) => e === n);
3011
+ if (o || (o = {
3012
+ type: n,
3013
+ rules: []
3014
+ }, a.rules.push(o)), a.keywords[e] = !0, !t) return;
3015
+ let s = {
3016
+ keyword: e,
3017
+ definition: {
3018
+ ...t,
3019
+ type: (0, l.getJSONTypes)(t.type),
3020
+ schemaType: (0, l.getJSONTypes)(t.schemaType)
3021
+ }
3022
+ };
3023
+ t.before ? H.call(this, o, s, t.before) : o.rules.push(s), a.all[e] = s, (r = t.implements) == null || r.forEach((e) => this.addKeyword(e));
3024
+ }
3025
+ function H(e, t, n) {
3026
+ let r = e.rules.findIndex((e) => e.keyword === n);
3027
+ r >= 0 ? e.rules.splice(r, 0, t) : (e.rules.push(t), this.logger.warn(`rule ${n} is not defined`));
3028
+ }
3029
+ function U(e) {
3030
+ let { metaSchema: t } = e;
3031
+ t !== void 0 && (e.$data && this.opts.$data && (t = G(t)), e.validateSchema = this.compile(t, !0));
3032
+ }
3033
+ var W = { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" };
3034
+ function G(e) {
3035
+ return { anyOf: [e, W] };
3036
+ }
3037
+ })), X = /* @__PURE__ */ u(((e) => {
3038
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.default = {
3039
+ keyword: "id",
3040
+ code() {
3041
+ throw Error("NOT SUPPORTED: keyword \"id\", use \"$id\" for schema ID");
3042
+ }
3043
+ };
3044
+ })), Z = /* @__PURE__ */ u(((e) => {
3045
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.callRef = e.getValidate = void 0;
3046
+ var t = B(), n = M(), r = C(), i = T(), a = V(), o = w(), s = {
3047
+ keyword: "$ref",
3048
+ schemaType: "string",
3049
+ code(e) {
3050
+ let { gen: n, schema: i, it: o } = e, { baseId: s, schemaEnv: u, validateName: d, opts: f, self: p } = o, { root: m } = u;
3051
+ if ((i === "#" || i === "#/") && s === m.baseId) return g();
3052
+ let h = a.resolveRef.call(p, m, s, i);
3053
+ if (h === void 0) throw new t.default(o.opts.uriResolver, s, i);
3054
+ if (h instanceof a.SchemaEnv) return _(h);
3055
+ return v(h);
3056
+ function g() {
3057
+ if (u === m) return l(e, d, u, u.$async);
3058
+ let t = n.scopeValue("root", { ref: m });
3059
+ return l(e, (0, r._)`${t}.validate`, m, m.$async);
3060
+ }
3061
+ function _(t) {
3062
+ l(e, c(e, t), t, t.$async);
3063
+ }
3064
+ function v(t) {
3065
+ let a = n.scopeValue("schema", f.code.source === !0 ? {
3066
+ ref: t,
3067
+ code: (0, r.stringify)(t)
3068
+ } : { ref: t }), o = n.name("valid"), s = e.subschema({
3069
+ schema: t,
3070
+ dataTypes: [],
3071
+ schemaPath: r.nil,
3072
+ topSchemaRef: a,
3073
+ errSchemaPath: i
3074
+ }, o);
3075
+ e.mergeEvaluated(s), e.ok(o);
3076
+ }
3077
+ }
3078
+ };
3079
+ function c(e, t) {
3080
+ let { gen: n } = e;
3081
+ return t.validate ? n.scopeValue("validate", { ref: t.validate }) : (0, r._)`${n.scopeValue("wrapper", { ref: t })}.validate`;
3082
+ }
3083
+ e.getValidate = c;
3084
+ function l(e, t, a, s) {
3085
+ let { gen: c, it: l } = e, { allErrors: u, schemaEnv: d, opts: f } = l, p = f.passContext ? i.default.this : r.nil;
3086
+ s ? m() : h();
3087
+ function m() {
3088
+ if (!d.$async) throw Error("async schema referenced by sync schema");
3089
+ let i = c.let("valid");
3090
+ c.try(() => {
3091
+ c.code((0, r._)`await ${(0, n.callValidateCode)(e, t, p)}`), _(t), u || c.assign(i, !0);
3092
+ }, (e) => {
3093
+ c.if((0, r._)`!(${e} instanceof ${l.ValidationError})`, () => c.throw(e)), g(e), u || c.assign(i, !1);
3094
+ }), e.ok(i);
3095
+ }
3096
+ function h() {
3097
+ e.result((0, n.callValidateCode)(e, t, p), () => _(t), () => g(t));
3098
+ }
3099
+ function g(e) {
3100
+ let t = (0, r._)`${e}.errors`;
3101
+ c.assign(i.default.vErrors, (0, r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`), c.assign(i.default.errors, (0, r._)`${i.default.vErrors}.length`);
3102
+ }
3103
+ function _(e) {
3104
+ if (!l.opts.unevaluated) return;
3105
+ let t = a?.validate?.evaluated;
3106
+ if (l.props !== !0) if (t && !t.dynamicProps) t.props !== void 0 && (l.props = o.mergeEvaluated.props(c, t.props, l.props));
3107
+ else {
3108
+ let t = c.var("props", (0, r._)`${e}.evaluated.props`);
3109
+ l.props = o.mergeEvaluated.props(c, t, l.props, r.Name);
3110
+ }
3111
+ if (l.items !== !0) if (t && !t.dynamicItems) t.items !== void 0 && (l.items = o.mergeEvaluated.items(c, t.items, l.items));
3112
+ else {
3113
+ let t = c.var("items", (0, r._)`${e}.evaluated.items`);
3114
+ l.items = o.mergeEvaluated.items(c, t, l.items, r.Name);
3115
+ }
3116
+ }
3117
+ }
3118
+ e.callRef = l, e.default = s;
3119
+ })), ae = /* @__PURE__ */ u(((e) => {
3120
+ Object.defineProperty(e, "__esModule", { value: !0 });
3121
+ var t = X(), n = Z();
3122
+ e.default = [
3123
+ "$schema",
3124
+ "$id",
3125
+ "$defs",
3126
+ "$vocabulary",
3127
+ { keyword: "$comment" },
3128
+ "definitions",
3129
+ t.default,
3130
+ n.default
3131
+ ];
3132
+ })), Q = /* @__PURE__ */ u(((e) => {
3133
+ Object.defineProperty(e, "__esModule", { value: !0 });
3134
+ var t = C(), n = t.operators, r = {
3135
+ maximum: {
3136
+ okStr: "<=",
3137
+ ok: n.LTE,
3138
+ fail: n.GT
3139
+ },
3140
+ minimum: {
3141
+ okStr: ">=",
3142
+ ok: n.GTE,
3143
+ fail: n.LT
3144
+ },
3145
+ exclusiveMaximum: {
3146
+ okStr: "<",
3147
+ ok: n.LT,
3148
+ fail: n.GTE
3149
+ },
3150
+ exclusiveMinimum: {
3151
+ okStr: ">",
3152
+ ok: n.GT,
3153
+ fail: n.LTE
3154
+ }
3155
+ };
3156
+ e.default = {
3157
+ keyword: Object.keys(r),
3158
+ type: "number",
3159
+ schemaType: "number",
3160
+ $data: !0,
3161
+ error: {
3162
+ message: ({ keyword: e, schemaCode: n }) => (0, t.str)`must be ${r[e].okStr} ${n}`,
3163
+ params: ({ keyword: e, schemaCode: n }) => (0, t._)`{comparison: ${r[e].okStr}, limit: ${n}}`
3164
+ },
3165
+ code(e) {
3166
+ let { keyword: n, data: i, schemaCode: a } = e;
3167
+ e.fail$data((0, t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`);
3168
+ }
3169
+ };
3170
+ })), oe = /* @__PURE__ */ u(((e) => {
3171
+ Object.defineProperty(e, "__esModule", { value: !0 });
3172
+ var t = C();
3173
+ e.default = {
3174
+ keyword: "multipleOf",
3175
+ type: "number",
3176
+ schemaType: "number",
3177
+ $data: !0,
3178
+ error: {
3179
+ message: ({ schemaCode: e }) => (0, t.str)`must be multiple of ${e}`,
3180
+ params: ({ schemaCode: e }) => (0, t._)`{multipleOf: ${e}}`
3181
+ },
3182
+ code(e) {
3183
+ let { gen: n, data: r, schemaCode: i, it: a } = e, o = a.opts.multipleOfPrecision, s = n.let("res"), c = o ? (0, t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}` : (0, t._)`${s} !== parseInt(${s})`;
3184
+ e.fail$data((0, t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`);
3185
+ }
3186
+ };
3187
+ })), se = /* @__PURE__ */ u(((e) => {
3188
+ Object.defineProperty(e, "__esModule", { value: !0 });
3189
+ function t(e) {
3190
+ let t = e.length, n = 0, r = 0, i;
3191
+ for (; r < t;) n++, i = e.charCodeAt(r++), i >= 55296 && i <= 56319 && r < t && (i = e.charCodeAt(r), (i & 64512) == 56320 && r++);
3192
+ return n;
3193
+ }
3194
+ e.default = t, t.code = "require(\"ajv/dist/runtime/ucs2length\").default";
3195
+ })), ce = /* @__PURE__ */ u(((e) => {
3196
+ Object.defineProperty(e, "__esModule", { value: !0 });
3197
+ var t = C(), n = w(), r = se();
3198
+ e.default = {
3199
+ keyword: ["maxLength", "minLength"],
3200
+ type: "string",
3201
+ schemaType: "number",
3202
+ $data: !0,
3203
+ error: {
3204
+ message({ keyword: e, schemaCode: n }) {
3205
+ let r = e === "maxLength" ? "more" : "fewer";
3206
+ return (0, t.str)`must NOT have ${r} than ${n} characters`;
3207
+ },
3208
+ params: ({ schemaCode: e }) => (0, t._)`{limit: ${e}}`
3209
+ },
3210
+ code(e) {
3211
+ let { keyword: i, data: a, schemaCode: o, it: s } = e, c = i === "maxLength" ? t.operators.GT : t.operators.LT, l = s.opts.unicode === !1 ? (0, t._)`${a}.length` : (0, t._)`${(0, n.useFunc)(e.gen, r.default)}(${a})`;
3212
+ e.fail$data((0, t._)`${l} ${c} ${o}`);
3213
+ }
3214
+ };
3215
+ })), le = /* @__PURE__ */ u(((e) => {
3216
+ Object.defineProperty(e, "__esModule", { value: !0 });
3217
+ var t = M(), n = w(), r = C();
3218
+ e.default = {
3219
+ keyword: "pattern",
3220
+ type: "string",
3221
+ schemaType: "string",
3222
+ $data: !0,
3223
+ error: {
3224
+ message: ({ schemaCode: e }) => (0, r.str)`must match pattern "${e}"`,
3225
+ params: ({ schemaCode: e }) => (0, r._)`{pattern: ${e}}`
3226
+ },
3227
+ code(e) {
3228
+ let { gen: i, data: a, $data: o, schema: s, schemaCode: c, it: l } = e, u = l.opts.unicodeRegExp ? "u" : "";
3229
+ if (o) {
3230
+ let { regExp: t } = l.opts.code, o = t.code === "new RegExp" ? (0, r._)`new RegExp` : (0, n.useFunc)(i, t), s = i.let("valid");
3231
+ i.try(() => i.assign(s, (0, r._)`${o}(${c}, ${u}).test(${a})`), () => i.assign(s, !1)), e.fail$data((0, r._)`!${s}`);
3232
+ } else {
3233
+ let n = (0, t.usePattern)(e, s);
3234
+ e.fail$data((0, r._)`!${n}.test(${a})`);
3235
+ }
3236
+ }
3237
+ };
3238
+ })), ue = /* @__PURE__ */ u(((e) => {
3239
+ Object.defineProperty(e, "__esModule", { value: !0 });
3240
+ var t = C();
3241
+ e.default = {
3242
+ keyword: ["maxProperties", "minProperties"],
3243
+ type: "object",
3244
+ schemaType: "number",
3245
+ $data: !0,
3246
+ error: {
3247
+ message({ keyword: e, schemaCode: n }) {
3248
+ let r = e === "maxProperties" ? "more" : "fewer";
3249
+ return (0, t.str)`must NOT have ${r} than ${n} properties`;
3250
+ },
3251
+ params: ({ schemaCode: e }) => (0, t._)`{limit: ${e}}`
3252
+ },
3253
+ code(e) {
3254
+ let { keyword: n, data: r, schemaCode: i } = e, a = n === "maxProperties" ? t.operators.GT : t.operators.LT;
3255
+ e.fail$data((0, t._)`Object.keys(${r}).length ${a} ${i}`);
3256
+ }
3257
+ };
3258
+ })), de = /* @__PURE__ */ u(((e) => {
3259
+ Object.defineProperty(e, "__esModule", { value: !0 });
3260
+ var t = M(), n = C(), r = w();
3261
+ e.default = {
3262
+ keyword: "required",
3263
+ type: "object",
3264
+ schemaType: "array",
3265
+ $data: !0,
3266
+ error: {
3267
+ message: ({ params: { missingProperty: e } }) => (0, n.str)`must have required property '${e}'`,
3268
+ params: ({ params: { missingProperty: e } }) => (0, n._)`{missingProperty: ${e}}`
3269
+ },
3270
+ code(e) {
3271
+ let { gen: i, schema: a, schemaCode: o, data: s, $data: c, it: l } = e, { opts: u } = l;
3272
+ if (!c && a.length === 0) return;
3273
+ let d = a.length >= u.loopRequired;
3274
+ if (l.allErrors ? f() : p(), u.strictRequired) {
3275
+ let t = e.parentSchema.properties, { definedProperties: n } = e.it;
3276
+ for (let e of a) if (t?.[e] === void 0 && !n.has(e)) {
3277
+ let t = `required property "${e}" is not defined at "${l.schemaEnv.baseId + l.errSchemaPath}" (strictRequired)`;
3278
+ (0, r.checkStrictMode)(l, t, l.opts.strictRequired);
3279
+ }
3280
+ }
3281
+ function f() {
3282
+ if (d || c) e.block$data(n.nil, m);
3283
+ else for (let n of a) (0, t.checkReportMissingProp)(e, n);
3284
+ }
3285
+ function p() {
3286
+ let n = i.let("missing");
3287
+ if (d || c) {
3288
+ let t = i.let("valid", !0);
3289
+ e.block$data(t, () => h(n, t)), e.ok(t);
3290
+ } else i.if((0, t.checkMissingProp)(e, a, n)), (0, t.reportMissingProp)(e, n), i.else();
3291
+ }
3292
+ function m() {
3293
+ i.forOf("prop", o, (n) => {
3294
+ e.setParams({ missingProperty: n }), i.if((0, t.noPropertyInData)(i, s, n, u.ownProperties), () => e.error());
3295
+ });
3296
+ }
3297
+ function h(r, a) {
3298
+ e.setParams({ missingProperty: r }), i.forOf(r, o, () => {
3299
+ i.assign(a, (0, t.propertyInData)(i, s, r, u.ownProperties)), i.if((0, n.not)(a), () => {
3300
+ e.error(), i.break();
3301
+ });
3302
+ }, n.nil);
3303
+ }
3304
+ }
3305
+ };
3306
+ })), fe = /* @__PURE__ */ u(((e) => {
3307
+ Object.defineProperty(e, "__esModule", { value: !0 });
3308
+ var t = C();
3309
+ e.default = {
3310
+ keyword: ["maxItems", "minItems"],
3311
+ type: "array",
3312
+ schemaType: "number",
3313
+ $data: !0,
3314
+ error: {
3315
+ message({ keyword: e, schemaCode: n }) {
3316
+ let r = e === "maxItems" ? "more" : "fewer";
3317
+ return (0, t.str)`must NOT have ${r} than ${n} items`;
3318
+ },
3319
+ params: ({ schemaCode: e }) => (0, t._)`{limit: ${e}}`
3320
+ },
3321
+ code(e) {
3322
+ let { keyword: n, data: r, schemaCode: i } = e, a = n === "maxItems" ? t.operators.GT : t.operators.LT;
3323
+ e.fail$data((0, t._)`${r}.length ${a} ${i}`);
3324
+ }
3325
+ };
3326
+ })), pe = /* @__PURE__ */ u(((e) => {
3327
+ Object.defineProperty(e, "__esModule", { value: !0 });
3328
+ var t = F();
3329
+ t.code = "require(\"ajv/dist/runtime/equal\").default", e.default = t;
3330
+ })), me = /* @__PURE__ */ u(((e) => {
3331
+ Object.defineProperty(e, "__esModule", { value: !0 });
3332
+ var t = A(), n = C(), r = w(), i = pe();
3333
+ e.default = {
3334
+ keyword: "uniqueItems",
3335
+ type: "array",
3336
+ schemaType: "boolean",
3337
+ $data: !0,
3338
+ error: {
3339
+ message: ({ params: { i: e, j: t } }) => (0, n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,
3340
+ params: ({ params: { i: e, j: t } }) => (0, n._)`{i: ${e}, j: ${t}}`
3341
+ },
3342
+ code(e) {
3343
+ let { gen: a, data: o, $data: s, schema: c, parentSchema: l, schemaCode: u, it: d } = e;
3344
+ if (!s && !c) return;
3345
+ let f = a.let("valid"), p = l.items ? (0, t.getSchemaTypes)(l.items) : [];
3346
+ e.block$data(f, m, (0, n._)`${u} === false`), e.ok(f);
3347
+ function m() {
3348
+ let t = a.let("i", (0, n._)`${o}.length`), r = a.let("j");
3349
+ e.setParams({
3350
+ i: t,
3351
+ j: r
3352
+ }), a.assign(f, !0), a.if((0, n._)`${t} > 1`, () => (h() ? g : _)(t, r));
3353
+ }
3354
+ function h() {
3355
+ return p.length > 0 && !p.some((e) => e === "object" || e === "array");
3356
+ }
3357
+ function g(r, i) {
3358
+ let s = a.name("item"), c = (0, t.checkDataTypes)(p, s, d.opts.strictNumbers, t.DataType.Wrong), l = a.const("indices", (0, n._)`{}`);
3359
+ a.for((0, n._)`;${r}--;`, () => {
3360
+ a.let(s, (0, n._)`${o}[${r}]`), a.if(c, (0, n._)`continue`), p.length > 1 && a.if((0, n._)`typeof ${s} == "string"`, (0, n._)`${s} += "_"`), a.if((0, n._)`typeof ${l}[${s}] == "number"`, () => {
3361
+ a.assign(i, (0, n._)`${l}[${s}]`), e.error(), a.assign(f, !1).break();
3362
+ }).code((0, n._)`${l}[${s}] = ${r}`);
3363
+ });
3364
+ }
3365
+ function _(t, s) {
3366
+ let c = (0, r.useFunc)(a, i.default), l = a.name("outer");
3367
+ a.label(l).for((0, n._)`;${t}--;`, () => a.for((0, n._)`${s} = ${t}; ${s}--;`, () => a.if((0, n._)`${c}(${o}[${t}], ${o}[${s}])`, () => {
3368
+ e.error(), a.assign(f, !1).break(l);
3369
+ })));
3370
+ }
3371
+ }
3372
+ };
3373
+ })), he = /* @__PURE__ */ u(((e) => {
3374
+ Object.defineProperty(e, "__esModule", { value: !0 });
3375
+ var t = C(), n = w(), r = pe();
3376
+ e.default = {
3377
+ keyword: "const",
3378
+ $data: !0,
3379
+ error: {
3380
+ message: "must be equal to constant",
3381
+ params: ({ schemaCode: e }) => (0, t._)`{allowedValue: ${e}}`
3382
+ },
3383
+ code(e) {
3384
+ let { gen: i, data: a, $data: o, schemaCode: s, schema: c } = e;
3385
+ o || c && typeof c == "object" ? e.fail$data((0, t._)`!${(0, n.useFunc)(i, r.default)}(${a}, ${s})`) : e.fail((0, t._)`${c} !== ${a}`);
3386
+ }
3387
+ };
3388
+ })), ge = /* @__PURE__ */ u(((e) => {
3389
+ Object.defineProperty(e, "__esModule", { value: !0 });
3390
+ var t = C(), n = w(), r = pe();
3391
+ e.default = {
3392
+ keyword: "enum",
3393
+ schemaType: "array",
3394
+ $data: !0,
3395
+ error: {
3396
+ message: "must be equal to one of the allowed values",
3397
+ params: ({ schemaCode: e }) => (0, t._)`{allowedValues: ${e}}`
3398
+ },
3399
+ code(e) {
3400
+ let { gen: i, data: a, $data: o, schema: s, schemaCode: c, it: l } = e;
3401
+ if (!o && s.length === 0) throw Error("enum must have non-empty array");
3402
+ let u = s.length >= l.opts.loopEnum, d, f = () => d ??= (0, n.useFunc)(i, r.default), p;
3403
+ if (u || o) p = i.let("valid"), e.block$data(p, m);
3404
+ else {
3405
+ /* istanbul ignore if */
3406
+ if (!Array.isArray(s)) throw Error("ajv implementation error");
3407
+ let e = i.const("vSchema", c);
3408
+ p = (0, t.or)(...s.map((t, n) => h(e, n)));
3409
+ }
3410
+ e.pass(p);
3411
+ function m() {
3412
+ i.assign(p, !1), i.forOf("v", c, (e) => i.if((0, t._)`${f()}(${a}, ${e})`, () => i.assign(p, !0).break()));
3413
+ }
3414
+ function h(e, n) {
3415
+ let r = s[n];
3416
+ return typeof r == "object" && r ? (0, t._)`${f()}(${a}, ${e}[${n}])` : (0, t._)`${a} === ${r}`;
3417
+ }
3418
+ }
3419
+ };
3420
+ })), _e = /* @__PURE__ */ u(((e) => {
3421
+ Object.defineProperty(e, "__esModule", { value: !0 });
3422
+ var t = Q(), n = oe(), r = ce(), i = le(), a = ue(), o = de(), s = fe(), c = me(), l = he(), u = ge();
3423
+ e.default = [
3424
+ t.default,
3425
+ n.default,
3426
+ r.default,
3427
+ i.default,
3428
+ a.default,
3429
+ o.default,
3430
+ s.default,
3431
+ c.default,
3432
+ {
3433
+ keyword: "type",
3434
+ schemaType: ["string", "array"]
3435
+ },
3436
+ {
3437
+ keyword: "nullable",
3438
+ schemaType: "boolean"
3439
+ },
3440
+ l.default,
3441
+ u.default
3442
+ ];
3443
+ })), ve = /* @__PURE__ */ u(((e) => {
3444
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateAdditionalItems = void 0;
3445
+ var t = C(), n = w(), r = {
3446
+ keyword: "additionalItems",
3447
+ type: "array",
3448
+ schemaType: ["boolean", "object"],
3449
+ before: "uniqueItems",
3450
+ error: {
3451
+ message: ({ params: { len: e } }) => (0, t.str)`must NOT have more than ${e} items`,
3452
+ params: ({ params: { len: e } }) => (0, t._)`{limit: ${e}}`
3453
+ },
3454
+ code(e) {
3455
+ let { parentSchema: t, it: r } = e, { items: a } = t;
3456
+ if (!Array.isArray(a)) {
3457
+ (0, n.checkStrictMode)(r, "\"additionalItems\" is ignored when \"items\" is not an array of schemas");
3458
+ return;
3459
+ }
3460
+ i(e, a);
3461
+ }
3462
+ };
3463
+ function i(e, r) {
3464
+ let { gen: i, schema: a, data: o, keyword: s, it: c } = e;
3465
+ c.items = !0;
3466
+ let l = i.const("len", (0, t._)`${o}.length`);
3467
+ if (a === !1) e.setParams({ len: r.length }), e.pass((0, t._)`${l} <= ${r.length}`);
3468
+ else if (typeof a == "object" && !(0, n.alwaysValidSchema)(c, a)) {
3469
+ let n = i.var("valid", (0, t._)`${l} <= ${r.length}`);
3470
+ i.if((0, t.not)(n), () => u(n)), e.ok(n);
3471
+ }
3472
+ function u(a) {
3473
+ i.forRange("i", r.length, l, (r) => {
3474
+ e.subschema({
3475
+ keyword: s,
3476
+ dataProp: r,
3477
+ dataPropType: n.Type.Num
3478
+ }, a), c.allErrors || i.if((0, t.not)(a), () => i.break());
3479
+ });
3480
+ }
3481
+ }
3482
+ e.validateAdditionalItems = i, e.default = r;
3483
+ })), ye = /* @__PURE__ */ u(((e) => {
3484
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateTuple = void 0;
3485
+ var t = C(), n = w(), r = M(), i = {
3486
+ keyword: "items",
3487
+ type: "array",
3488
+ schemaType: [
3489
+ "object",
3490
+ "array",
3491
+ "boolean"
3492
+ ],
3493
+ before: "uniqueItems",
3494
+ code(e) {
3495
+ let { schema: t, it: i } = e;
3496
+ if (Array.isArray(t)) return a(e, "additionalItems", t);
3497
+ i.items = !0, !(0, n.alwaysValidSchema)(i, t) && e.ok((0, r.validateArray)(e));
3498
+ }
3499
+ };
3500
+ function a(e, r, i = e.schema) {
3501
+ let { gen: a, parentSchema: o, data: s, keyword: c, it: l } = e;
3502
+ f(o), l.opts.unevaluated && i.length && l.items !== !0 && (l.items = n.mergeEvaluated.items(a, i.length, l.items));
3503
+ let u = a.name("valid"), d = a.const("len", (0, t._)`${s}.length`);
3504
+ i.forEach((r, i) => {
3505
+ (0, n.alwaysValidSchema)(l, r) || (a.if((0, t._)`${d} > ${i}`, () => e.subschema({
3506
+ keyword: c,
3507
+ schemaProp: i,
3508
+ dataProp: i
3509
+ }, u)), e.ok(u));
3510
+ });
3511
+ function f(e) {
3512
+ let { opts: t, errSchemaPath: a } = l, o = i.length, s = o === e.minItems && (o === e.maxItems || e[r] === !1);
3513
+ if (t.strictTuples && !s) {
3514
+ let e = `"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;
3515
+ (0, n.checkStrictMode)(l, e, t.strictTuples);
3516
+ }
3517
+ }
3518
+ }
3519
+ e.validateTuple = a, e.default = i;
3520
+ })), be = /* @__PURE__ */ u(((e) => {
3521
+ Object.defineProperty(e, "__esModule", { value: !0 });
3522
+ var t = ye();
3523
+ e.default = {
3524
+ keyword: "prefixItems",
3525
+ type: "array",
3526
+ schemaType: ["array"],
3527
+ before: "uniqueItems",
3528
+ code: (e) => (0, t.validateTuple)(e, "items")
3529
+ };
3530
+ })), xe = /* @__PURE__ */ u(((e) => {
3531
+ Object.defineProperty(e, "__esModule", { value: !0 });
3532
+ var t = C(), n = w(), r = M(), i = ve();
3533
+ e.default = {
3534
+ keyword: "items",
3535
+ type: "array",
3536
+ schemaType: ["object", "boolean"],
3537
+ before: "uniqueItems",
3538
+ error: {
3539
+ message: ({ params: { len: e } }) => (0, t.str)`must NOT have more than ${e} items`,
3540
+ params: ({ params: { len: e } }) => (0, t._)`{limit: ${e}}`
3541
+ },
3542
+ code(e) {
3543
+ let { schema: t, parentSchema: a, it: o } = e, { prefixItems: s } = a;
3544
+ o.items = !0, !(0, n.alwaysValidSchema)(o, t) && (s ? (0, i.validateAdditionalItems)(e, s) : e.ok((0, r.validateArray)(e)));
3545
+ }
3546
+ };
3547
+ })), Se = /* @__PURE__ */ u(((e) => {
3548
+ Object.defineProperty(e, "__esModule", { value: !0 });
3549
+ var t = C(), n = w();
3550
+ e.default = {
3551
+ keyword: "contains",
3552
+ type: "array",
3553
+ schemaType: ["object", "boolean"],
3554
+ before: "uniqueItems",
3555
+ trackErrors: !0,
3556
+ error: {
3557
+ message: ({ params: { min: e, max: n } }) => n === void 0 ? (0, t.str)`must contain at least ${e} valid item(s)` : (0, t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,
3558
+ params: ({ params: { min: e, max: n } }) => n === void 0 ? (0, t._)`{minContains: ${e}}` : (0, t._)`{minContains: ${e}, maxContains: ${n}}`
3559
+ },
3560
+ code(e) {
3561
+ let { gen: r, schema: i, parentSchema: a, data: o, it: s } = e, c, l, { minContains: u, maxContains: d } = a;
3562
+ s.opts.next ? (c = u === void 0 ? 1 : u, l = d) : c = 1;
3563
+ let f = r.const("len", (0, t._)`${o}.length`);
3564
+ if (e.setParams({
3565
+ min: c,
3566
+ max: l
3567
+ }), l === void 0 && c === 0) {
3568
+ (0, n.checkStrictMode)(s, "\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored");
3569
+ return;
3570
+ }
3571
+ if (l !== void 0 && c > l) {
3572
+ (0, n.checkStrictMode)(s, "\"minContains\" > \"maxContains\" is always invalid"), e.fail();
3573
+ return;
3574
+ }
3575
+ if ((0, n.alwaysValidSchema)(s, i)) {
3576
+ let n = (0, t._)`${f} >= ${c}`;
3577
+ l !== void 0 && (n = (0, t._)`${n} && ${f} <= ${l}`), e.pass(n);
3578
+ return;
3579
+ }
3580
+ s.items = !0;
3581
+ let p = r.name("valid");
3582
+ l === void 0 && c === 1 ? h(p, () => r.if(p, () => r.break())) : c === 0 ? (r.let(p, !0), l !== void 0 && r.if((0, t._)`${o}.length > 0`, m)) : (r.let(p, !1), m()), e.result(p, () => e.reset());
3583
+ function m() {
3584
+ let e = r.name("_valid"), t = r.let("count", 0);
3585
+ h(e, () => r.if(e, () => g(t)));
3586
+ }
3587
+ function h(t, i) {
3588
+ r.forRange("i", 0, f, (r) => {
3589
+ e.subschema({
3590
+ keyword: "contains",
3591
+ dataProp: r,
3592
+ dataPropType: n.Type.Num,
3593
+ compositeRule: !0
3594
+ }, t), i();
3595
+ });
3596
+ }
3597
+ function g(e) {
3598
+ r.code((0, t._)`${e}++`), l === void 0 ? r.if((0, t._)`${e} >= ${c}`, () => r.assign(p, !0).break()) : (r.if((0, t._)`${e} > ${l}`, () => r.assign(p, !1).break()), c === 1 ? r.assign(p, !0) : r.if((0, t._)`${e} >= ${c}`, () => r.assign(p, !0)));
3599
+ }
3600
+ }
3601
+ };
3602
+ })), Ce = /* @__PURE__ */ u(((e) => {
3603
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
3604
+ var t = C(), n = w(), r = M();
3605
+ e.error = {
3606
+ message: ({ params: { property: e, depsCount: n, deps: r } }) => {
3607
+ let i = n === 1 ? "property" : "properties";
3608
+ return (0, t.str)`must have ${i} ${r} when property ${e} is present`;
3609
+ },
3610
+ params: ({ params: { property: e, depsCount: n, deps: r, missingProperty: i } }) => (0, t._)`{property: ${e},
3611
+ missingProperty: ${i},
3612
+ depsCount: ${n},
3613
+ deps: ${r}}`
3614
+ };
3615
+ var i = {
3616
+ keyword: "dependencies",
3617
+ type: "object",
3618
+ schemaType: "object",
3619
+ error: e.error,
3620
+ code(e) {
3621
+ let [t, n] = a(e);
3622
+ o(e, t), s(e, n);
3623
+ }
3624
+ };
3625
+ function a({ schema: e }) {
3626
+ let t = {}, n = {};
3627
+ for (let r in e) {
3628
+ if (r === "__proto__") continue;
3629
+ let i = Array.isArray(e[r]) ? t : n;
3630
+ i[r] = e[r];
3631
+ }
3632
+ return [t, n];
3633
+ }
3634
+ function o(e, n = e.schema) {
3635
+ let { gen: i, data: a, it: o } = e;
3636
+ if (Object.keys(n).length === 0) return;
3637
+ let s = i.let("missing");
3638
+ for (let c in n) {
3639
+ let l = n[c];
3640
+ if (l.length === 0) continue;
3641
+ let u = (0, r.propertyInData)(i, a, c, o.opts.ownProperties);
3642
+ e.setParams({
3643
+ property: c,
3644
+ depsCount: l.length,
3645
+ deps: l.join(", ")
3646
+ }), o.allErrors ? i.if(u, () => {
3647
+ for (let t of l) (0, r.checkReportMissingProp)(e, t);
3648
+ }) : (i.if((0, t._)`${u} && (${(0, r.checkMissingProp)(e, l, s)})`), (0, r.reportMissingProp)(e, s), i.else());
3649
+ }
3650
+ }
3651
+ e.validatePropertyDeps = o;
3652
+ function s(e, t = e.schema) {
3653
+ let { gen: i, data: a, keyword: o, it: s } = e, c = i.name("valid");
3654
+ for (let l in t) (0, n.alwaysValidSchema)(s, t[l]) || (i.if((0, r.propertyInData)(i, a, l, s.opts.ownProperties), () => {
3655
+ let t = e.subschema({
3656
+ keyword: o,
3657
+ schemaProp: l
3658
+ }, c);
3659
+ e.mergeValidEvaluated(t, c);
3660
+ }, () => i.var(c, !0)), e.ok(c));
3661
+ }
3662
+ e.validateSchemaDeps = s, e.default = i;
3663
+ })), we = /* @__PURE__ */ u(((e) => {
3664
+ Object.defineProperty(e, "__esModule", { value: !0 });
3665
+ var t = C(), n = w();
3666
+ e.default = {
3667
+ keyword: "propertyNames",
3668
+ type: "object",
3669
+ schemaType: ["object", "boolean"],
3670
+ error: {
3671
+ message: "property name must be valid",
3672
+ params: ({ params: e }) => (0, t._)`{propertyName: ${e.propertyName}}`
3673
+ },
3674
+ code(e) {
3675
+ let { gen: r, schema: i, data: a, it: o } = e;
3676
+ if ((0, n.alwaysValidSchema)(o, i)) return;
3677
+ let s = r.name("valid");
3678
+ r.forIn("key", a, (n) => {
3679
+ e.setParams({ propertyName: n }), e.subschema({
3680
+ keyword: "propertyNames",
3681
+ data: n,
3682
+ dataTypes: ["string"],
3683
+ propertyName: n,
3684
+ compositeRule: !0
3685
+ }, s), r.if((0, t.not)(s), () => {
3686
+ e.error(!0), o.allErrors || r.break();
3687
+ });
3688
+ }), e.ok(s);
3689
+ }
3690
+ };
3691
+ })), Te = /* @__PURE__ */ u(((e) => {
3692
+ Object.defineProperty(e, "__esModule", { value: !0 });
3693
+ var t = M(), n = C(), r = T(), i = w();
3694
+ e.default = {
3695
+ keyword: "additionalProperties",
3696
+ type: ["object"],
3697
+ schemaType: ["boolean", "object"],
3698
+ allowUndefined: !0,
3699
+ trackErrors: !0,
3700
+ error: {
3701
+ message: "must NOT have additional properties",
3702
+ params: ({ params: e }) => (0, n._)`{additionalProperty: ${e.additionalProperty}}`
3703
+ },
3704
+ code(e) {
3705
+ let { gen: a, schema: o, parentSchema: s, data: c, errsCount: l, it: u } = e;
3706
+ /* istanbul ignore if */
3707
+ if (!l) throw Error("ajv implementation error");
3708
+ let { allErrors: d, opts: f } = u;
3709
+ if (u.props = !0, f.removeAdditional !== "all" && (0, i.alwaysValidSchema)(u, o)) return;
3710
+ let p = (0, t.allSchemaProperties)(s.properties), m = (0, t.allSchemaProperties)(s.patternProperties);
3711
+ h(), e.ok((0, n._)`${l} === ${r.default.errors}`);
3712
+ function h() {
3713
+ a.forIn("key", c, (e) => {
3714
+ !p.length && !m.length ? v(e) : a.if(g(e), () => v(e));
3715
+ });
3716
+ }
3717
+ function g(r) {
3718
+ let o;
3719
+ if (p.length > 8) {
3720
+ let e = (0, i.schemaRefOrVal)(u, s.properties, "properties");
3721
+ o = (0, t.isOwnProperty)(a, e, r);
3722
+ } else o = p.length ? (0, n.or)(...p.map((e) => (0, n._)`${r} === ${e}`)) : n.nil;
3723
+ return m.length && (o = (0, n.or)(o, ...m.map((i) => (0, n._)`${(0, t.usePattern)(e, i)}.test(${r})`))), (0, n.not)(o);
3724
+ }
3725
+ function _(e) {
3726
+ a.code((0, n._)`delete ${c}[${e}]`);
3727
+ }
3728
+ function v(t) {
3729
+ if (f.removeAdditional === "all" || f.removeAdditional && o === !1) {
3730
+ _(t);
3731
+ return;
3732
+ }
3733
+ if (o === !1) {
3734
+ e.setParams({ additionalProperty: t }), e.error(), d || a.break();
3735
+ return;
3736
+ }
3737
+ if (typeof o == "object" && !(0, i.alwaysValidSchema)(u, o)) {
3738
+ let r = a.name("valid");
3739
+ f.removeAdditional === "failing" ? (y(t, r, !1), a.if((0, n.not)(r), () => {
3740
+ e.reset(), _(t);
3741
+ })) : (y(t, r), d || a.if((0, n.not)(r), () => a.break()));
3742
+ }
3743
+ }
3744
+ function y(t, n, r) {
3745
+ let a = {
3746
+ keyword: "additionalProperties",
3747
+ dataProp: t,
3748
+ dataPropType: i.Type.Str
3749
+ };
3750
+ r === !1 && Object.assign(a, {
3751
+ compositeRule: !0,
3752
+ createErrors: !1,
3753
+ allErrors: !1
3754
+ }), e.subschema(a, n);
3755
+ }
3756
+ }
3757
+ };
3758
+ })), Ee = /* @__PURE__ */ u(((e) => {
3759
+ Object.defineProperty(e, "__esModule", { value: !0 });
3760
+ var t = R(), n = M(), r = w(), i = Te();
3761
+ e.default = {
3762
+ keyword: "properties",
3763
+ type: "object",
3764
+ schemaType: "object",
3765
+ code(e) {
3766
+ let { gen: a, schema: o, parentSchema: s, data: c, it: l } = e;
3767
+ l.opts.removeAdditional === "all" && s.additionalProperties === void 0 && i.default.code(new t.KeywordCxt(l, i.default, "additionalProperties"));
3768
+ let u = (0, n.allSchemaProperties)(o);
3769
+ for (let e of u) l.definedProperties.add(e);
3770
+ l.opts.unevaluated && u.length && l.props !== !0 && (l.props = r.mergeEvaluated.props(a, (0, r.toHash)(u), l.props));
3771
+ let d = u.filter((e) => !(0, r.alwaysValidSchema)(l, o[e]));
3772
+ if (d.length === 0) return;
3773
+ let f = a.name("valid");
3774
+ for (let t of d) p(t) ? m(t) : (a.if((0, n.propertyInData)(a, c, t, l.opts.ownProperties)), m(t), l.allErrors || a.else().var(f, !0), a.endIf()), e.it.definedProperties.add(t), e.ok(f);
3775
+ function p(e) {
3776
+ return l.opts.useDefaults && !l.compositeRule && o[e].default !== void 0;
3777
+ }
3778
+ function m(t) {
3779
+ e.subschema({
3780
+ keyword: "properties",
3781
+ schemaProp: t,
3782
+ dataProp: t
3783
+ }, f);
3784
+ }
3785
+ }
3786
+ };
3787
+ })), De = /* @__PURE__ */ u(((e) => {
3788
+ Object.defineProperty(e, "__esModule", { value: !0 });
3789
+ var t = M(), n = C(), r = w(), i = w();
3790
+ e.default = {
3791
+ keyword: "patternProperties",
3792
+ type: "object",
3793
+ schemaType: "object",
3794
+ code(e) {
3795
+ let { gen: a, schema: o, data: s, parentSchema: c, it: l } = e, { opts: u } = l, d = (0, t.allSchemaProperties)(o), f = d.filter((e) => (0, r.alwaysValidSchema)(l, o[e]));
3796
+ if (d.length === 0 || f.length === d.length && (!l.opts.unevaluated || l.props === !0)) return;
3797
+ let p = u.strictSchema && !u.allowMatchingProperties && c.properties, m = a.name("valid");
3798
+ l.props !== !0 && !(l.props instanceof n.Name) && (l.props = (0, i.evaluatedPropsToName)(a, l.props));
3799
+ let { props: h } = l;
3800
+ g();
3801
+ function g() {
3802
+ for (let e of d) p && _(e), l.allErrors ? v(e) : (a.var(m, !0), v(e), a.if(m));
3803
+ }
3804
+ function _(e) {
3805
+ for (let t in p) new RegExp(e).test(t) && (0, r.checkStrictMode)(l, `property ${t} matches pattern ${e} (use allowMatchingProperties)`);
3806
+ }
3807
+ function v(r) {
3808
+ a.forIn("key", s, (o) => {
3809
+ a.if((0, n._)`${(0, t.usePattern)(e, r)}.test(${o})`, () => {
3810
+ let t = f.includes(r);
3811
+ t || e.subschema({
3812
+ keyword: "patternProperties",
3813
+ schemaProp: r,
3814
+ dataProp: o,
3815
+ dataPropType: i.Type.Str
3816
+ }, m), l.opts.unevaluated && h !== !0 ? a.assign((0, n._)`${h}[${o}]`, !0) : !t && !l.allErrors && a.if((0, n.not)(m), () => a.break());
3817
+ });
3818
+ });
3819
+ }
3820
+ }
3821
+ };
3822
+ })), Oe = /* @__PURE__ */ u(((e) => {
3823
+ Object.defineProperty(e, "__esModule", { value: !0 });
3824
+ var t = w();
3825
+ e.default = {
3826
+ keyword: "not",
3827
+ schemaType: ["object", "boolean"],
3828
+ trackErrors: !0,
3829
+ code(e) {
3830
+ let { gen: n, schema: r, it: i } = e;
3831
+ if ((0, t.alwaysValidSchema)(i, r)) {
3832
+ e.fail();
3833
+ return;
3834
+ }
3835
+ let a = n.name("valid");
3836
+ e.subschema({
3837
+ keyword: "not",
3838
+ compositeRule: !0,
3839
+ createErrors: !1,
3840
+ allErrors: !1
3841
+ }, a), e.failResult(a, () => e.reset(), () => e.error());
3842
+ },
3843
+ error: { message: "must NOT be valid" }
3844
+ };
3845
+ })), ke = /* @__PURE__ */ u(((e) => {
3846
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.default = {
3847
+ keyword: "anyOf",
3848
+ schemaType: "array",
3849
+ trackErrors: !0,
3850
+ code: M().validateUnion,
3851
+ error: { message: "must match a schema in anyOf" }
3852
+ };
3853
+ })), Ae = /* @__PURE__ */ u(((e) => {
3854
+ Object.defineProperty(e, "__esModule", { value: !0 });
3855
+ var t = C(), n = w();
3856
+ e.default = {
3857
+ keyword: "oneOf",
3858
+ schemaType: "array",
3859
+ trackErrors: !0,
3860
+ error: {
3861
+ message: "must match exactly one schema in oneOf",
3862
+ params: ({ params: e }) => (0, t._)`{passingSchemas: ${e.passing}}`
3863
+ },
3864
+ code(e) {
3865
+ let { gen: r, schema: i, parentSchema: a, it: o } = e;
3866
+ /* istanbul ignore if */
3867
+ if (!Array.isArray(i)) throw Error("ajv implementation error");
3868
+ if (o.opts.discriminator && a.discriminator) return;
3869
+ let s = i, c = r.let("valid", !1), l = r.let("passing", null), u = r.name("_valid");
3870
+ e.setParams({ passing: l }), r.block(d), e.result(c, () => e.reset(), () => e.error(!0));
3871
+ function d() {
3872
+ s.forEach((i, a) => {
3873
+ let s;
3874
+ (0, n.alwaysValidSchema)(o, i) ? r.var(u, !0) : s = e.subschema({
3875
+ keyword: "oneOf",
3876
+ schemaProp: a,
3877
+ compositeRule: !0
3878
+ }, u), a > 0 && r.if((0, t._)`${u} && ${c}`).assign(c, !1).assign(l, (0, t._)`[${l}, ${a}]`).else(), r.if(u, () => {
3879
+ r.assign(c, !0), r.assign(l, a), s && e.mergeEvaluated(s, t.Name);
3880
+ });
3881
+ });
3882
+ }
3883
+ }
3884
+ };
3885
+ })), je = /* @__PURE__ */ u(((e) => {
3886
+ Object.defineProperty(e, "__esModule", { value: !0 });
3887
+ var t = w();
3888
+ e.default = {
3889
+ keyword: "allOf",
3890
+ schemaType: "array",
3891
+ code(e) {
3892
+ let { gen: n, schema: r, it: i } = e;
3893
+ /* istanbul ignore if */
3894
+ if (!Array.isArray(r)) throw Error("ajv implementation error");
3895
+ let a = n.name("valid");
3896
+ r.forEach((n, r) => {
3897
+ if ((0, t.alwaysValidSchema)(i, n)) return;
3898
+ let o = e.subschema({
3899
+ keyword: "allOf",
3900
+ schemaProp: r
3901
+ }, a);
3902
+ e.ok(a), e.mergeEvaluated(o);
3903
+ });
3904
+ }
3905
+ };
3906
+ })), Me = /* @__PURE__ */ u(((e) => {
3907
+ Object.defineProperty(e, "__esModule", { value: !0 });
3908
+ var t = C(), n = w(), r = {
3909
+ keyword: "if",
3910
+ schemaType: ["object", "boolean"],
3911
+ trackErrors: !0,
3912
+ error: {
3913
+ message: ({ params: e }) => (0, t.str)`must match "${e.ifClause}" schema`,
3914
+ params: ({ params: e }) => (0, t._)`{failingKeyword: ${e.ifClause}}`
3915
+ },
3916
+ code(e) {
3917
+ let { gen: r, parentSchema: a, it: o } = e;
3918
+ a.then === void 0 && a.else === void 0 && (0, n.checkStrictMode)(o, "\"if\" without \"then\" and \"else\" is ignored");
3919
+ let s = i(o, "then"), c = i(o, "else");
3920
+ if (!s && !c) return;
3921
+ let l = r.let("valid", !0), u = r.name("_valid");
3922
+ if (d(), e.reset(), s && c) {
3923
+ let t = r.let("ifClause");
3924
+ e.setParams({ ifClause: t }), r.if(u, f("then", t), f("else", t));
3925
+ } else s ? r.if(u, f("then")) : r.if((0, t.not)(u), f("else"));
3926
+ e.pass(l, () => e.error(!0));
3927
+ function d() {
3928
+ let t = e.subschema({
3929
+ keyword: "if",
3930
+ compositeRule: !0,
3931
+ createErrors: !1,
3932
+ allErrors: !1
3933
+ }, u);
3934
+ e.mergeEvaluated(t);
3935
+ }
3936
+ function f(n, i) {
3937
+ return () => {
3938
+ let a = e.subschema({ keyword: n }, u);
3939
+ r.assign(l, u), e.mergeValidEvaluated(a, l), i ? r.assign(i, (0, t._)`${n}`) : e.setParams({ ifClause: n });
3940
+ };
3941
+ }
3942
+ }
3943
+ };
3944
+ function i(e, t) {
3945
+ let r = e.schema[t];
3946
+ return r !== void 0 && !(0, n.alwaysValidSchema)(e, r);
3947
+ }
3948
+ e.default = r;
3949
+ })), Ne = /* @__PURE__ */ u(((e) => {
3950
+ Object.defineProperty(e, "__esModule", { value: !0 });
3951
+ var t = w();
3952
+ e.default = {
3953
+ keyword: ["then", "else"],
3954
+ schemaType: ["object", "boolean"],
3955
+ code({ keyword: e, parentSchema: n, it: r }) {
3956
+ n.if === void 0 && (0, t.checkStrictMode)(r, `"${e}" without "if" is ignored`);
3957
+ }
3958
+ };
3959
+ })), Pe = /* @__PURE__ */ u(((e) => {
3960
+ Object.defineProperty(e, "__esModule", { value: !0 });
3961
+ var t = ve(), n = be(), r = ye(), i = xe(), a = Se(), o = Ce(), s = we(), c = Te(), l = Ee(), u = De(), d = Oe(), f = ke(), p = Ae(), m = je(), h = Me(), g = Ne();
3962
+ function _(e = !1) {
3963
+ let _ = [
3964
+ d.default,
3965
+ f.default,
3966
+ p.default,
3967
+ m.default,
3968
+ h.default,
3969
+ g.default,
3970
+ s.default,
3971
+ c.default,
3972
+ o.default,
3973
+ l.default,
3974
+ u.default
3975
+ ];
3976
+ return e ? _.push(n.default, i.default) : _.push(t.default, r.default), _.push(a.default), _;
3977
+ }
3978
+ e.default = _;
3979
+ })), Fe = /* @__PURE__ */ u(((e) => {
3980
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.dynamicAnchor = void 0;
3981
+ var t = C(), n = T(), r = V(), i = Z(), a = {
3982
+ keyword: "$dynamicAnchor",
3983
+ schemaType: "string",
3984
+ code: (e) => o(e, e.schema)
3985
+ };
3986
+ function o(e, r) {
3987
+ let { gen: i, it: a } = e;
3988
+ a.schemaEnv.root.dynamicAnchors[r] = !0;
3989
+ let o = (0, t._)`${n.default.dynamicAnchors}${(0, t.getProperty)(r)}`, c = a.errSchemaPath === "#" ? a.validateName : s(e);
3990
+ i.if((0, t._)`!${o}`, () => i.assign(o, c));
3991
+ }
3992
+ e.dynamicAnchor = o;
3993
+ function s(e) {
3994
+ let { schemaEnv: t, schema: n, self: a } = e.it, { root: o, baseId: s, localRefs: c, meta: l } = t.root, { schemaId: u } = a.opts, d = new r.SchemaEnv({
3995
+ schema: n,
3996
+ schemaId: u,
3997
+ root: o,
3998
+ baseId: s,
3999
+ localRefs: c,
4000
+ meta: l
4001
+ });
4002
+ return r.compileSchema.call(a, d), (0, i.getValidate)(e, d);
4003
+ }
4004
+ e.default = a;
4005
+ })), Ie = /* @__PURE__ */ u(((e) => {
4006
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.dynamicRef = void 0;
4007
+ var t = C(), n = T(), r = Z(), i = {
4008
+ keyword: "$dynamicRef",
4009
+ schemaType: "string",
4010
+ code: (e) => a(e, e.schema)
4011
+ };
4012
+ function a(e, i) {
4013
+ let { gen: a, keyword: o, it: s } = e;
4014
+ if (i[0] !== "#") throw Error(`"${o}" only supports hash fragment reference`);
4015
+ let c = i.slice(1);
4016
+ if (s.allErrors) l();
4017
+ else {
4018
+ let t = a.let("valid", !1);
4019
+ l(t), e.ok(t);
4020
+ }
4021
+ function l(e) {
4022
+ if (s.schemaEnv.root.dynamicAnchors[c]) {
4023
+ let r = a.let("_v", (0, t._)`${n.default.dynamicAnchors}${(0, t.getProperty)(c)}`);
4024
+ a.if(r, u(r, e), u(s.validateName, e));
4025
+ } else u(s.validateName, e)();
4026
+ }
4027
+ function u(t, n) {
4028
+ return n ? () => a.block(() => {
4029
+ (0, r.callRef)(e, t), a.let(n, !0);
4030
+ }) : () => (0, r.callRef)(e, t);
4031
+ }
4032
+ }
4033
+ e.dynamicRef = a, e.default = i;
4034
+ })), Le = /* @__PURE__ */ u(((e) => {
4035
+ Object.defineProperty(e, "__esModule", { value: !0 });
4036
+ var t = Fe(), n = w();
4037
+ e.default = {
4038
+ keyword: "$recursiveAnchor",
4039
+ schemaType: "boolean",
4040
+ code(e) {
4041
+ e.schema ? (0, t.dynamicAnchor)(e, "") : (0, n.checkStrictMode)(e.it, "$recursiveAnchor: false is ignored");
4042
+ }
4043
+ };
4044
+ })), Re = /* @__PURE__ */ u(((e) => {
4045
+ Object.defineProperty(e, "__esModule", { value: !0 });
4046
+ var t = Ie();
4047
+ e.default = {
4048
+ keyword: "$recursiveRef",
4049
+ schemaType: "string",
4050
+ code: (e) => (0, t.dynamicRef)(e, e.schema)
4051
+ };
4052
+ })), ze = /* @__PURE__ */ u(((e) => {
4053
+ Object.defineProperty(e, "__esModule", { value: !0 });
4054
+ var t = Fe(), n = Ie(), r = Le(), i = Re();
4055
+ e.default = [
4056
+ t.default,
4057
+ n.default,
4058
+ r.default,
4059
+ i.default
4060
+ ];
4061
+ })), Be = /* @__PURE__ */ u(((e) => {
4062
+ Object.defineProperty(e, "__esModule", { value: !0 });
4063
+ var t = Ce();
4064
+ e.default = {
4065
+ keyword: "dependentRequired",
4066
+ type: "object",
4067
+ schemaType: "object",
4068
+ error: t.error,
4069
+ code: (e) => (0, t.validatePropertyDeps)(e)
4070
+ };
4071
+ })), Ve = /* @__PURE__ */ u(((e) => {
4072
+ Object.defineProperty(e, "__esModule", { value: !0 });
4073
+ var t = Ce();
4074
+ e.default = {
4075
+ keyword: "dependentSchemas",
4076
+ type: "object",
4077
+ schemaType: "object",
4078
+ code: (e) => (0, t.validateSchemaDeps)(e)
4079
+ };
4080
+ })), He = /* @__PURE__ */ u(((e) => {
4081
+ Object.defineProperty(e, "__esModule", { value: !0 });
4082
+ var t = w();
4083
+ e.default = {
4084
+ keyword: ["maxContains", "minContains"],
4085
+ type: "array",
4086
+ schemaType: "number",
4087
+ code({ keyword: e, parentSchema: n, it: r }) {
4088
+ n.contains === void 0 && (0, t.checkStrictMode)(r, `"${e}" without "contains" is ignored`);
4089
+ }
4090
+ };
4091
+ })), Ue = /* @__PURE__ */ u(((e) => {
4092
+ Object.defineProperty(e, "__esModule", { value: !0 });
4093
+ var t = Be(), n = Ve(), r = He();
4094
+ e.default = [
4095
+ t.default,
4096
+ n.default,
4097
+ r.default
4098
+ ];
4099
+ })), We = /* @__PURE__ */ u(((e) => {
4100
+ Object.defineProperty(e, "__esModule", { value: !0 });
4101
+ var t = C(), n = w(), r = T();
4102
+ e.default = {
4103
+ keyword: "unevaluatedProperties",
4104
+ type: "object",
4105
+ schemaType: ["boolean", "object"],
4106
+ trackErrors: !0,
4107
+ error: {
4108
+ message: "must NOT have unevaluated properties",
4109
+ params: ({ params: e }) => (0, t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`
4110
+ },
4111
+ code(e) {
4112
+ let { gen: i, schema: a, data: o, errsCount: s, it: c } = e;
4113
+ /* istanbul ignore if */
4114
+ if (!s) throw Error("ajv implementation error");
4115
+ let { allErrors: l, props: u } = c;
4116
+ u instanceof t.Name ? i.if((0, t._)`${u} !== true`, () => i.forIn("key", o, (e) => i.if(f(u, e), () => d(e)))) : u !== !0 && i.forIn("key", o, (e) => u === void 0 ? d(e) : i.if(p(u, e), () => d(e))), c.props = !0, e.ok((0, t._)`${s} === ${r.default.errors}`);
4117
+ function d(r) {
4118
+ if (a === !1) {
4119
+ e.setParams({ unevaluatedProperty: r }), e.error(), l || i.break();
4120
+ return;
4121
+ }
4122
+ if (!(0, n.alwaysValidSchema)(c, a)) {
4123
+ let a = i.name("valid");
4124
+ e.subschema({
4125
+ keyword: "unevaluatedProperties",
4126
+ dataProp: r,
4127
+ dataPropType: n.Type.Str
4128
+ }, a), l || i.if((0, t.not)(a), () => i.break());
4129
+ }
4130
+ }
4131
+ function f(e, n) {
4132
+ return (0, t._)`!${e} || !${e}[${n}]`;
4133
+ }
4134
+ function p(e, n) {
4135
+ let r = [];
4136
+ for (let i in e) e[i] === !0 && r.push((0, t._)`${n} !== ${i}`);
4137
+ return (0, t.and)(...r);
4138
+ }
4139
+ }
4140
+ };
4141
+ })), Ge = /* @__PURE__ */ u(((e) => {
4142
+ Object.defineProperty(e, "__esModule", { value: !0 });
4143
+ var t = C(), n = w();
4144
+ e.default = {
4145
+ keyword: "unevaluatedItems",
4146
+ type: "array",
4147
+ schemaType: ["boolean", "object"],
4148
+ error: {
4149
+ message: ({ params: { len: e } }) => (0, t.str)`must NOT have more than ${e} items`,
4150
+ params: ({ params: { len: e } }) => (0, t._)`{limit: ${e}}`
4151
+ },
4152
+ code(e) {
4153
+ let { gen: r, schema: i, data: a, it: o } = e, s = o.items || 0;
4154
+ if (s === !0) return;
4155
+ let c = r.const("len", (0, t._)`${a}.length`);
4156
+ if (i === !1) e.setParams({ len: s }), e.fail((0, t._)`${c} > ${s}`);
4157
+ else if (typeof i == "object" && !(0, n.alwaysValidSchema)(o, i)) {
4158
+ let n = r.var("valid", (0, t._)`${c} <= ${s}`);
4159
+ r.if((0, t.not)(n), () => l(n, s)), e.ok(n);
4160
+ }
4161
+ o.items = !0;
4162
+ function l(i, a) {
4163
+ r.forRange("i", a, c, (a) => {
4164
+ e.subschema({
4165
+ keyword: "unevaluatedItems",
4166
+ dataProp: a,
4167
+ dataPropType: n.Type.Num
4168
+ }, i), o.allErrors || r.if((0, t.not)(i), () => r.break());
4169
+ });
4170
+ }
4171
+ }
4172
+ };
4173
+ })), Ke = /* @__PURE__ */ u(((e) => {
4174
+ Object.defineProperty(e, "__esModule", { value: !0 });
4175
+ var t = We(), n = Ge();
4176
+ e.default = [t.default, n.default];
4177
+ })), qe = /* @__PURE__ */ u(((e) => {
4178
+ Object.defineProperty(e, "__esModule", { value: !0 });
4179
+ var t = C();
4180
+ e.default = {
4181
+ keyword: "format",
4182
+ type: ["number", "string"],
4183
+ schemaType: "string",
4184
+ $data: !0,
4185
+ error: {
4186
+ message: ({ schemaCode: e }) => (0, t.str)`must match format "${e}"`,
4187
+ params: ({ schemaCode: e }) => (0, t._)`{format: ${e}}`
4188
+ },
4189
+ code(e, n) {
4190
+ let { gen: r, data: i, $data: a, schema: o, schemaCode: s, it: c } = e, { opts: l, errSchemaPath: u, schemaEnv: d, self: f } = c;
4191
+ if (!l.validateFormats) return;
4192
+ a ? p() : m();
4193
+ function p() {
4194
+ let a = r.scopeValue("formats", {
4195
+ ref: f.formats,
4196
+ code: l.code.formats
4197
+ }), o = r.const("fDef", (0, t._)`${a}[${s}]`), c = r.let("fType"), u = r.let("format");
4198
+ r.if((0, t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`, () => r.assign(c, (0, t._)`${o}.type || "string"`).assign(u, (0, t._)`${o}.validate`), () => r.assign(c, (0, t._)`"string"`).assign(u, o)), e.fail$data((0, t.or)(p(), m()));
4199
+ function p() {
4200
+ return l.strictSchema === !1 ? t.nil : (0, t._)`${s} && !${u}`;
4201
+ }
4202
+ function m() {
4203
+ let e = d.$async ? (0, t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))` : (0, t._)`${u}(${i})`, r = (0, t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;
4204
+ return (0, t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`;
4205
+ }
4206
+ }
4207
+ function m() {
4208
+ let a = f.formats[o];
4209
+ if (!a) {
4210
+ m();
4211
+ return;
4212
+ }
4213
+ if (a === !0) return;
4214
+ let [s, c, p] = h(a);
4215
+ s === n && e.pass(g());
4216
+ function m() {
4217
+ if (l.strictSchema === !1) {
4218
+ f.logger.warn(e());
4219
+ return;
4220
+ }
4221
+ throw Error(e());
4222
+ function e() {
4223
+ return `unknown format "${o}" ignored in schema at path "${u}"`;
4224
+ }
4225
+ }
4226
+ function h(e) {
4227
+ let n = e instanceof RegExp ? (0, t.regexpCode)(e) : l.code.formats ? (0, t._)`${l.code.formats}${(0, t.getProperty)(o)}` : void 0, i = r.scopeValue("formats", {
4228
+ key: o,
4229
+ ref: e,
4230
+ code: n
4231
+ });
4232
+ return typeof e == "object" && !(e instanceof RegExp) ? [
4233
+ e.type || "string",
4234
+ e.validate,
4235
+ (0, t._)`${i}.validate`
4236
+ ] : [
4237
+ "string",
4238
+ e,
4239
+ i
4240
+ ];
4241
+ }
4242
+ function g() {
4243
+ if (typeof a == "object" && !(a instanceof RegExp) && a.async) {
4244
+ if (!d.$async) throw Error("async format in sync schema");
4245
+ return (0, t._)`await ${p}(${i})`;
4246
+ }
4247
+ return typeof c == "function" ? (0, t._)`${p}(${i})` : (0, t._)`${p}.test(${i})`;
4248
+ }
4249
+ }
4250
+ }
4251
+ };
4252
+ })), Je = /* @__PURE__ */ u(((e) => {
4253
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.default = [qe().default];
4254
+ })), Ye = /* @__PURE__ */ u(((e) => {
4255
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.contentVocabulary = e.metadataVocabulary = void 0, e.metadataVocabulary = [
4256
+ "title",
4257
+ "description",
4258
+ "default",
4259
+ "deprecated",
4260
+ "readOnly",
4261
+ "writeOnly",
4262
+ "examples"
4263
+ ], e.contentVocabulary = [
4264
+ "contentMediaType",
4265
+ "contentEncoding",
4266
+ "contentSchema"
4267
+ ];
4268
+ })), Xe = /* @__PURE__ */ u(((e) => {
4269
+ Object.defineProperty(e, "__esModule", { value: !0 });
4270
+ var t = ae(), n = _e(), r = Pe(), i = ze(), a = Ue(), o = Ke(), s = Je(), c = Ye();
4271
+ e.default = [
4272
+ i.default,
4273
+ t.default,
4274
+ n.default,
4275
+ (0, r.default)(!0),
4276
+ s.default,
4277
+ c.metadataVocabulary,
4278
+ c.contentVocabulary,
4279
+ a.default,
4280
+ o.default
4281
+ ];
4282
+ })), Ze = /* @__PURE__ */ u(((e) => {
4283
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.DiscrError = void 0;
4284
+ var t;
4285
+ (function(e) {
4286
+ e.Tag = "tag", e.Mapping = "mapping";
4287
+ })(t || (e.DiscrError = t = {}));
4288
+ })), Qe = /* @__PURE__ */ u(((e) => {
4289
+ Object.defineProperty(e, "__esModule", { value: !0 });
4290
+ var t = C(), n = Ze(), r = V(), i = B(), a = w();
4291
+ e.default = {
4292
+ keyword: "discriminator",
4293
+ type: "object",
4294
+ schemaType: "object",
4295
+ error: {
4296
+ message: ({ params: { discrError: e, tagName: t } }) => e === n.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`,
4297
+ params: ({ params: { discrError: e, tag: n, tagName: r } }) => (0, t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`
4298
+ },
4299
+ code(e) {
4300
+ let { gen: o, data: s, schema: c, parentSchema: l, it: u } = e, { oneOf: d } = l;
4301
+ if (!u.opts.discriminator) throw Error("discriminator: requires discriminator option");
4302
+ let f = c.propertyName;
4303
+ if (typeof f != "string") throw Error("discriminator: requires propertyName");
4304
+ if (c.mapping) throw Error("discriminator: mapping is not supported");
4305
+ if (!d) throw Error("discriminator: requires oneOf keyword");
4306
+ let p = o.let("valid", !1), m = o.const("tag", (0, t._)`${s}${(0, t.getProperty)(f)}`);
4307
+ o.if((0, t._)`typeof ${m} == "string"`, () => h(), () => e.error(!1, {
4308
+ discrError: n.DiscrError.Tag,
4309
+ tag: m,
4310
+ tagName: f
4311
+ })), e.ok(p);
4312
+ function h() {
4313
+ let r = _();
4314
+ o.if(!1);
4315
+ for (let e in r) o.elseIf((0, t._)`${m} === ${e}`), o.assign(p, g(r[e]));
4316
+ o.else(), e.error(!1, {
4317
+ discrError: n.DiscrError.Mapping,
4318
+ tag: m,
4319
+ tagName: f
4320
+ }), o.endIf();
4321
+ }
4322
+ function g(n) {
4323
+ let r = o.name("valid"), i = e.subschema({
4324
+ keyword: "oneOf",
4325
+ schemaProp: n
4326
+ }, r);
4327
+ return e.mergeEvaluated(i, t.Name), r;
4328
+ }
4329
+ function _() {
4330
+ let e = {}, t = o(l), n = !0;
4331
+ for (let e = 0; e < d.length; e++) {
4332
+ let c = d[e];
4333
+ if (c?.$ref && !(0, a.schemaHasRulesButRef)(c, u.self.RULES)) {
4334
+ let e = c.$ref;
4335
+ if (c = r.resolveRef.call(u.self, u.schemaEnv.root, u.baseId, e), c instanceof r.SchemaEnv && (c = c.schema), c === void 0) throw new i.default(u.opts.uriResolver, u.baseId, e);
4336
+ }
4337
+ let l = c?.properties?.[f];
4338
+ if (typeof l != "object") throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);
4339
+ n &&= t || o(c), s(l, e);
4340
+ }
4341
+ if (!n) throw Error(`discriminator: "${f}" must be required`);
4342
+ return e;
4343
+ function o({ required: e }) {
4344
+ return Array.isArray(e) && e.includes(f);
4345
+ }
4346
+ function s(e, t) {
4347
+ if (e.const) c(e.const, t);
4348
+ else if (e.enum) for (let n of e.enum) c(n, t);
4349
+ else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`);
4350
+ }
4351
+ function c(t, n) {
4352
+ if (typeof t != "string" || t in e) throw Error(`discriminator: "${f}" values must be unique strings`);
4353
+ e[t] = n;
4354
+ }
4355
+ }
4356
+ }
4357
+ };
4358
+ })), $e = /* @__PURE__ */ d({
4359
+ $comment: () => st,
4360
+ $dynamicAnchor: () => rt,
4361
+ $id: () => tt,
4362
+ $schema: () => et,
4363
+ $vocabulary: () => nt,
4364
+ allOf: () => at,
4365
+ default: () => lt,
4366
+ properties: () => ct,
4367
+ title: () => it,
4368
+ type: () => ot
4369
+ }), et, tt, nt, rt, it, at, ot, st, ct, lt, ut = l((() => {
4370
+ et = "https://json-schema.org/draft/2020-12/schema", tt = "https://json-schema.org/draft/2020-12/schema", nt = {
4371
+ "https://json-schema.org/draft/2020-12/vocab/core": !0,
4372
+ "https://json-schema.org/draft/2020-12/vocab/applicator": !0,
4373
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0,
4374
+ "https://json-schema.org/draft/2020-12/vocab/validation": !0,
4375
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": !0,
4376
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0,
4377
+ "https://json-schema.org/draft/2020-12/vocab/content": !0
4378
+ }, rt = "meta", it = "Core and Validation specifications meta-schema", at = [
4379
+ { $ref: "meta/core" },
4380
+ { $ref: "meta/applicator" },
4381
+ { $ref: "meta/unevaluated" },
4382
+ { $ref: "meta/validation" },
4383
+ { $ref: "meta/meta-data" },
4384
+ { $ref: "meta/format-annotation" },
4385
+ { $ref: "meta/content" }
4386
+ ], ot = ["object", "boolean"], st = "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", ct = {
4387
+ definitions: {
4388
+ $comment: "\"definitions\" has been replaced by \"$defs\".",
4389
+ type: "object",
4390
+ additionalProperties: { $dynamicRef: "#meta" },
4391
+ deprecated: !0,
4392
+ default: {}
4393
+ },
4394
+ dependencies: {
4395
+ $comment: "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.",
4396
+ type: "object",
4397
+ additionalProperties: { anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }] },
4398
+ deprecated: !0,
4399
+ default: {}
4400
+ },
4401
+ $recursiveAnchor: {
4402
+ $comment: "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".",
4403
+ $ref: "meta/core#/$defs/anchorString",
4404
+ deprecated: !0
4405
+ },
4406
+ $recursiveRef: {
4407
+ $comment: "\"$recursiveRef\" has been replaced by \"$dynamicRef\".",
4408
+ $ref: "meta/core#/$defs/uriReferenceString",
4409
+ deprecated: !0
4410
+ }
4411
+ }, lt = {
4412
+ $schema: et,
4413
+ $id: tt,
4414
+ $vocabulary: nt,
4415
+ $dynamicAnchor: rt,
4416
+ title: it,
4417
+ allOf: at,
4418
+ type: ot,
4419
+ $comment: st,
4420
+ properties: ct
4421
+ };
4422
+ })), dt = /* @__PURE__ */ d({
4423
+ $defs: () => yt,
4424
+ $dynamicAnchor: () => ht,
4425
+ $id: () => pt,
4426
+ $schema: () => ft,
4427
+ $vocabulary: () => mt,
4428
+ default: () => bt,
4429
+ properties: () => vt,
4430
+ title: () => gt,
4431
+ type: () => _t
4432
+ }), ft, pt, mt, ht, gt, _t, vt, yt, bt, xt = l((() => {
4433
+ ft = "https://json-schema.org/draft/2020-12/schema", pt = "https://json-schema.org/draft/2020-12/meta/applicator", mt = { "https://json-schema.org/draft/2020-12/vocab/applicator": !0 }, ht = "meta", gt = "Applicator vocabulary meta-schema", _t = ["object", "boolean"], vt = {
4434
+ prefixItems: { $ref: "#/$defs/schemaArray" },
4435
+ items: { $dynamicRef: "#meta" },
4436
+ contains: { $dynamicRef: "#meta" },
4437
+ additionalProperties: { $dynamicRef: "#meta" },
4438
+ properties: {
4439
+ type: "object",
4440
+ additionalProperties: { $dynamicRef: "#meta" },
4441
+ default: {}
4442
+ },
4443
+ patternProperties: {
4444
+ type: "object",
4445
+ additionalProperties: { $dynamicRef: "#meta" },
4446
+ propertyNames: { format: "regex" },
4447
+ default: {}
4448
+ },
4449
+ dependentSchemas: {
4450
+ type: "object",
4451
+ additionalProperties: { $dynamicRef: "#meta" },
4452
+ default: {}
4453
+ },
4454
+ propertyNames: { $dynamicRef: "#meta" },
4455
+ if: { $dynamicRef: "#meta" },
4456
+ then: { $dynamicRef: "#meta" },
4457
+ else: { $dynamicRef: "#meta" },
4458
+ allOf: { $ref: "#/$defs/schemaArray" },
4459
+ anyOf: { $ref: "#/$defs/schemaArray" },
4460
+ oneOf: { $ref: "#/$defs/schemaArray" },
4461
+ not: { $dynamicRef: "#meta" }
4462
+ }, yt = { schemaArray: {
4463
+ type: "array",
4464
+ minItems: 1,
4465
+ items: { $dynamicRef: "#meta" }
4466
+ } }, bt = {
4467
+ $schema: ft,
4468
+ $id: pt,
4469
+ $vocabulary: mt,
4470
+ $dynamicAnchor: ht,
4471
+ title: gt,
4472
+ type: _t,
4473
+ properties: vt,
4474
+ $defs: yt
4475
+ };
4476
+ })), St = /* @__PURE__ */ d({
4477
+ $dynamicAnchor: () => Et,
4478
+ $id: () => wt,
4479
+ $schema: () => Ct,
4480
+ $vocabulary: () => Tt,
4481
+ default: () => At,
4482
+ properties: () => kt,
4483
+ title: () => Dt,
4484
+ type: () => Ot
4485
+ }), Ct, wt, Tt, Et, Dt, Ot, kt, At, jt = l((() => {
4486
+ Ct = "https://json-schema.org/draft/2020-12/schema", wt = "https://json-schema.org/draft/2020-12/meta/unevaluated", Tt = { "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0 }, Et = "meta", Dt = "Unevaluated applicator vocabulary meta-schema", Ot = ["object", "boolean"], kt = {
4487
+ unevaluatedItems: { $dynamicRef: "#meta" },
4488
+ unevaluatedProperties: { $dynamicRef: "#meta" }
4489
+ }, At = {
4490
+ $schema: Ct,
4491
+ $id: wt,
4492
+ $vocabulary: Tt,
4493
+ $dynamicAnchor: Et,
4494
+ title: Dt,
4495
+ type: Ot,
4496
+ properties: kt
4497
+ };
4498
+ })), Mt = /* @__PURE__ */ d({
4499
+ $dynamicAnchor: () => It,
4500
+ $id: () => Pt,
4501
+ $schema: () => Nt,
4502
+ $vocabulary: () => Ft,
4503
+ default: () => Bt,
4504
+ properties: () => zt,
4505
+ title: () => Lt,
4506
+ type: () => Rt
4507
+ }), Nt, Pt, Ft, It, Lt, Rt, zt, Bt, Vt = l((() => {
4508
+ Nt = "https://json-schema.org/draft/2020-12/schema", Pt = "https://json-schema.org/draft/2020-12/meta/content", Ft = { "https://json-schema.org/draft/2020-12/vocab/content": !0 }, It = "meta", Lt = "Content vocabulary meta-schema", Rt = ["object", "boolean"], zt = {
4509
+ contentEncoding: { type: "string" },
4510
+ contentMediaType: { type: "string" },
4511
+ contentSchema: { $dynamicRef: "#meta" }
4512
+ }, Bt = {
4513
+ $schema: Nt,
4514
+ $id: Pt,
4515
+ $vocabulary: Ft,
4516
+ $dynamicAnchor: It,
4517
+ title: Lt,
4518
+ type: Rt,
4519
+ properties: zt
4520
+ };
4521
+ })), Ht = /* @__PURE__ */ d({
4522
+ $defs: () => Xt,
4523
+ $dynamicAnchor: () => Kt,
4524
+ $id: () => Wt,
4525
+ $schema: () => Ut,
4526
+ $vocabulary: () => Gt,
4527
+ default: () => Zt,
4528
+ properties: () => Yt,
4529
+ title: () => qt,
4530
+ type: () => Jt
4531
+ }), Ut, Wt, Gt, Kt, qt, Jt, Yt, Xt, Zt, Qt = l((() => {
4532
+ Ut = "https://json-schema.org/draft/2020-12/schema", Wt = "https://json-schema.org/draft/2020-12/meta/core", Gt = { "https://json-schema.org/draft/2020-12/vocab/core": !0 }, Kt = "meta", qt = "Core vocabulary meta-schema", Jt = ["object", "boolean"], Yt = {
4533
+ $id: {
4534
+ $ref: "#/$defs/uriReferenceString",
4535
+ $comment: "Non-empty fragments not allowed.",
4536
+ pattern: "^[^#]*#?$"
4537
+ },
4538
+ $schema: { $ref: "#/$defs/uriString" },
4539
+ $ref: { $ref: "#/$defs/uriReferenceString" },
4540
+ $anchor: { $ref: "#/$defs/anchorString" },
4541
+ $dynamicRef: { $ref: "#/$defs/uriReferenceString" },
4542
+ $dynamicAnchor: { $ref: "#/$defs/anchorString" },
4543
+ $vocabulary: {
4544
+ type: "object",
4545
+ propertyNames: { $ref: "#/$defs/uriString" },
4546
+ additionalProperties: { type: "boolean" }
4547
+ },
4548
+ $comment: { type: "string" },
4549
+ $defs: {
4550
+ type: "object",
4551
+ additionalProperties: { $dynamicRef: "#meta" }
4552
+ }
4553
+ }, Xt = {
4554
+ anchorString: {
4555
+ type: "string",
4556
+ pattern: "^[A-Za-z_][-A-Za-z0-9._]*$"
4557
+ },
4558
+ uriString: {
4559
+ type: "string",
4560
+ format: "uri"
4561
+ },
4562
+ uriReferenceString: {
4563
+ type: "string",
4564
+ format: "uri-reference"
4565
+ }
4566
+ }, Zt = {
4567
+ $schema: Ut,
4568
+ $id: Wt,
4569
+ $vocabulary: Gt,
4570
+ $dynamicAnchor: Kt,
4571
+ title: qt,
4572
+ type: Jt,
4573
+ properties: Yt,
4574
+ $defs: Xt
4575
+ };
4576
+ })), $t = /* @__PURE__ */ d({
4577
+ $dynamicAnchor: () => rn,
4578
+ $id: () => tn,
4579
+ $schema: () => en,
4580
+ $vocabulary: () => nn,
4581
+ default: () => cn,
4582
+ properties: () => sn,
4583
+ title: () => an,
4584
+ type: () => on
4585
+ }), en, tn, nn, rn, an, on, sn, cn, ln = l((() => {
4586
+ en = "https://json-schema.org/draft/2020-12/schema", tn = "https://json-schema.org/draft/2020-12/meta/format-annotation", nn = { "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0 }, rn = "meta", an = "Format vocabulary meta-schema for annotation results", on = ["object", "boolean"], sn = { format: { type: "string" } }, cn = {
4587
+ $schema: en,
4588
+ $id: tn,
4589
+ $vocabulary: nn,
4590
+ $dynamicAnchor: rn,
4591
+ title: an,
4592
+ type: on,
4593
+ properties: sn
4594
+ };
4595
+ })), un = /* @__PURE__ */ d({
4596
+ $dynamicAnchor: () => mn,
4597
+ $id: () => fn,
4598
+ $schema: () => dn,
4599
+ $vocabulary: () => pn,
4600
+ default: () => _n,
4601
+ properties: () => gn,
4602
+ title: () => $,
4603
+ type: () => hn
4604
+ }), dn, fn, pn, mn, $, hn, gn, _n, vn = l((() => {
4605
+ dn = "https://json-schema.org/draft/2020-12/schema", fn = "https://json-schema.org/draft/2020-12/meta/meta-data", pn = { "https://json-schema.org/draft/2020-12/vocab/meta-data": !0 }, mn = "meta", $ = "Meta-data vocabulary meta-schema", hn = ["object", "boolean"], gn = {
4606
+ title: { type: "string" },
4607
+ description: { type: "string" },
4608
+ default: !0,
4609
+ deprecated: {
4610
+ type: "boolean",
4611
+ default: !1
4612
+ },
4613
+ readOnly: {
4614
+ type: "boolean",
4615
+ default: !1
4616
+ },
4617
+ writeOnly: {
4618
+ type: "boolean",
4619
+ default: !1
4620
+ },
4621
+ examples: {
4622
+ type: "array",
4623
+ items: !0
4624
+ }
4625
+ }, _n = {
4626
+ $schema: dn,
4627
+ $id: fn,
4628
+ $vocabulary: pn,
4629
+ $dynamicAnchor: mn,
4630
+ title: $,
4631
+ type: hn,
4632
+ properties: gn
4633
+ };
4634
+ })), yn = /* @__PURE__ */ d({
4635
+ $defs: () => Dn,
4636
+ $dynamicAnchor: () => Cn,
4637
+ $id: () => xn,
4638
+ $schema: () => bn,
4639
+ $vocabulary: () => Sn,
4640
+ default: () => On,
4641
+ properties: () => En,
4642
+ title: () => wn,
4643
+ type: () => Tn
4644
+ }), bn, xn, Sn, Cn, wn, Tn, En, Dn, On, kn = l((() => {
4645
+ bn = "https://json-schema.org/draft/2020-12/schema", xn = "https://json-schema.org/draft/2020-12/meta/validation", Sn = { "https://json-schema.org/draft/2020-12/vocab/validation": !0 }, Cn = "meta", wn = "Validation vocabulary meta-schema", Tn = ["object", "boolean"], En = {
4646
+ type: { anyOf: [{ $ref: "#/$defs/simpleTypes" }, {
4647
+ type: "array",
4648
+ items: { $ref: "#/$defs/simpleTypes" },
4649
+ minItems: 1,
4650
+ uniqueItems: !0
4651
+ }] },
4652
+ const: !0,
4653
+ enum: {
4654
+ type: "array",
4655
+ items: !0
4656
+ },
4657
+ multipleOf: {
4658
+ type: "number",
4659
+ exclusiveMinimum: 0
4660
+ },
4661
+ maximum: { type: "number" },
4662
+ exclusiveMaximum: { type: "number" },
4663
+ minimum: { type: "number" },
4664
+ exclusiveMinimum: { type: "number" },
4665
+ maxLength: { $ref: "#/$defs/nonNegativeInteger" },
4666
+ minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
4667
+ pattern: {
4668
+ type: "string",
4669
+ format: "regex"
4670
+ },
4671
+ maxItems: { $ref: "#/$defs/nonNegativeInteger" },
4672
+ minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
4673
+ uniqueItems: {
4674
+ type: "boolean",
4675
+ default: !1
4676
+ },
4677
+ maxContains: { $ref: "#/$defs/nonNegativeInteger" },
4678
+ minContains: {
4679
+ $ref: "#/$defs/nonNegativeInteger",
4680
+ default: 1
4681
+ },
4682
+ maxProperties: { $ref: "#/$defs/nonNegativeInteger" },
4683
+ minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
4684
+ required: { $ref: "#/$defs/stringArray" },
4685
+ dependentRequired: {
4686
+ type: "object",
4687
+ additionalProperties: { $ref: "#/$defs/stringArray" }
4688
+ }
4689
+ }, Dn = {
4690
+ nonNegativeInteger: {
4691
+ type: "integer",
4692
+ minimum: 0
4693
+ },
4694
+ nonNegativeIntegerDefault0: {
4695
+ $ref: "#/$defs/nonNegativeInteger",
4696
+ default: 0
4697
+ },
4698
+ simpleTypes: { enum: [
4699
+ "array",
4700
+ "boolean",
4701
+ "integer",
4702
+ "null",
4703
+ "number",
4704
+ "object",
4705
+ "string"
4706
+ ] },
4707
+ stringArray: {
4708
+ type: "array",
4709
+ items: { type: "string" },
4710
+ uniqueItems: !0,
4711
+ default: []
4712
+ }
4713
+ }, On = {
4714
+ $schema: bn,
4715
+ $id: xn,
4716
+ $vocabulary: Sn,
4717
+ $dynamicAnchor: Cn,
4718
+ title: wn,
4719
+ type: Tn,
4720
+ properties: En,
4721
+ $defs: Dn
4722
+ };
4723
+ })), An = /* @__PURE__ */ u(((e) => {
4724
+ Object.defineProperty(e, "__esModule", { value: !0 });
4725
+ var t = (ut(), p($e).default), n = (xt(), p(dt).default), r = (jt(), p(St).default), i = (Vt(), p(Mt).default), a = (Qt(), p(Ht).default), o = (ln(), p($t).default), s = (vn(), p(un).default), c = (kn(), p(yn).default), l = ["/properties"];
4726
+ function u(e) {
4727
+ return [
4728
+ t,
4729
+ n,
4730
+ r,
4731
+ i,
4732
+ a,
4733
+ u(this, o),
4734
+ s,
4735
+ u(this, c)
4736
+ ].forEach((e) => this.addMetaSchema(e, void 0, !1)), this;
4737
+ function u(t, n) {
4738
+ return e ? t.$dataMetaSchema(n, l) : n;
4739
+ }
4740
+ }
4741
+ e.default = u;
4742
+ })), jn = (/* @__PURE__ */ u(((e, t) => {
4743
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.MissingRefError = e.ValidationError = e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = e.Ajv2020 = void 0;
4744
+ var n = Y(), r = Xe(), i = Qe(), a = An(), o = "https://json-schema.org/draft/2020-12/schema", s = class extends n.default {
4745
+ constructor(e = {}) {
4746
+ super({
4747
+ ...e,
4748
+ dynamicRef: !0,
4749
+ next: !0,
4750
+ unevaluated: !0
4751
+ });
4752
+ }
4753
+ _addVocabularies() {
4754
+ super._addVocabularies(), r.default.forEach((e) => this.addVocabulary(e)), this.opts.discriminator && this.addKeyword(i.default);
4755
+ }
4756
+ _addDefaultMetaSchema() {
4757
+ super._addDefaultMetaSchema();
4758
+ let { $data: e, meta: t } = this.opts;
4759
+ t && (a.default.call(this, e), this.refs["http://json-schema.org/schema"] = o);
4760
+ }
4761
+ defaultMeta() {
4762
+ return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(o) ? o : void 0);
4763
+ }
4764
+ };
4765
+ e.Ajv2020 = s, t.exports = e = s, t.exports.Ajv2020 = s, Object.defineProperty(e, "__esModule", { value: !0 }), e.default = s;
4766
+ var c = R();
4767
+ Object.defineProperty(e, "KeywordCxt", {
4768
+ enumerable: !0,
4769
+ get: function() {
4770
+ return c.KeywordCxt;
4771
+ }
4772
+ });
4773
+ var l = C();
4774
+ Object.defineProperty(e, "_", {
4775
+ enumerable: !0,
4776
+ get: function() {
4777
+ return l._;
4778
+ }
4779
+ }), Object.defineProperty(e, "str", {
4780
+ enumerable: !0,
4781
+ get: function() {
4782
+ return l.str;
4783
+ }
4784
+ }), Object.defineProperty(e, "stringify", {
4785
+ enumerable: !0,
4786
+ get: function() {
4787
+ return l.stringify;
4788
+ }
4789
+ }), Object.defineProperty(e, "nil", {
4790
+ enumerable: !0,
4791
+ get: function() {
4792
+ return l.nil;
4793
+ }
4794
+ }), Object.defineProperty(e, "Name", {
4795
+ enumerable: !0,
4796
+ get: function() {
4797
+ return l.Name;
4798
+ }
4799
+ }), Object.defineProperty(e, "CodeGen", {
4800
+ enumerable: !0,
4801
+ get: function() {
4802
+ return l.CodeGen;
4803
+ }
4804
+ });
4805
+ var u = z();
4806
+ Object.defineProperty(e, "ValidationError", {
4807
+ enumerable: !0,
4808
+ get: function() {
4809
+ return u.default;
4810
+ }
4811
+ });
4812
+ var d = B();
4813
+ Object.defineProperty(e, "MissingRefError", {
4814
+ enumerable: !0,
4815
+ get: function() {
4816
+ return d.default;
4817
+ }
4818
+ });
4819
+ })))(), Mn = /* @__PURE__ */ new Map();
4820
+ function Nn(e) {
4821
+ let t = Mn.get(e);
4822
+ if (t) return t;
4823
+ let n = new jn.Ajv2020({
4824
+ allErrors: !0,
4825
+ strict: !1
4826
+ }).compile(_(e));
4827
+ return Mn.set(e, n), n;
4828
+ }
4829
+ function Pn(e) {
4830
+ return (e ?? []).map((e) => `${e.instancePath === "" ? "<root>" : e.instancePath}: ${e.message ?? "invalid"}`);
4831
+ }
4832
+ function Fn(e, t) {
4833
+ let n = Nn(e);
4834
+ if (n(t)) return {
4835
+ ok: !0,
4836
+ value: t
4837
+ };
4838
+ let r = Pn(n.errors);
4839
+ return {
4840
+ ok: !1,
4841
+ error: {
4842
+ kind: "contract-violation",
4843
+ schema: e,
4844
+ errors: r,
4845
+ message: `the quire payload does not satisfy the published ${e} contract (${r.length} error${r.length === 1 ? "" : "s"}). This is a shape drift between the quire release in use and the contract quoin pins, not a defect in the document being read.`
4846
+ }
4847
+ };
4848
+ }
4849
+ function In(e) {
4850
+ return Fn("coverage-v1.schema.json", e);
4851
+ }
4852
+ function Ln(e) {
4853
+ return Fn("properties-v1.schema.json", e);
4854
+ }
4855
+ function Rn(e) {
4856
+ return Bn(e, "coverage-v1.schema.json", In);
4857
+ }
4858
+ function zn(e) {
4859
+ return Bn(e, "properties-v1.schema.json", Ln);
4860
+ }
4861
+ function Bn(e, t, n) {
4862
+ let r;
4863
+ try {
4864
+ r = JSON.parse(e);
4865
+ } catch (e) {
4866
+ return {
4867
+ ok: !1,
4868
+ error: {
4869
+ kind: "contract-violation",
4870
+ schema: t,
4871
+ errors: [`<root>: ${e instanceof Error ? e.message : String(e)}`],
4872
+ message: `the quire output is not valid JSON, so the ${t} contract could not be checked. Run the command directly to see what it emitted — a diagnostic on stdout rather than stderr is the usual cause.`
4873
+ }
4874
+ };
4875
+ }
4876
+ return n(r);
4877
+ }
4878
+ //#endregion
4879
+ //#region src/quire/exec.ts
4880
+ function Vn(e) {
4881
+ try {
4882
+ return i("quire", e, {
4883
+ encoding: "utf8",
4884
+ stdio: [
4885
+ "ignore",
4886
+ "pipe",
4887
+ "pipe"
4888
+ ]
4889
+ });
4890
+ } catch (t) {
4891
+ let n = t, r = String(n.stderr ?? "").trim();
4892
+ throw Error(`quire ${e.join(" ")} exited ${n.status ?? "abnormally"}` + (r ? `:\n${r}` : " with no diagnostic on stderr."));
4893
+ }
4894
+ }
4895
+ function Hn(e) {
4896
+ try {
4897
+ return {
4898
+ stdout: i("quire", e, {
4899
+ encoding: "utf8",
4900
+ stdio: [
4901
+ "ignore",
4902
+ "pipe",
4903
+ "pipe"
4904
+ ]
4905
+ }),
4906
+ stderr: "",
4907
+ ok: !0
4908
+ };
4909
+ } catch (e) {
4910
+ let t = e;
4911
+ return {
4912
+ stdout: String(t.stdout ?? ""),
4913
+ stderr: String(t.stderr ?? "").trim(),
4914
+ ok: !1
4915
+ };
4916
+ }
4917
+ }
4918
+ function Un() {
4919
+ try {
4920
+ return i("quire", ["--version"], { encoding: "utf8" });
4921
+ } catch {
4922
+ return null;
4923
+ }
4924
+ }
4925
+ //#endregion
4926
+ export { zn as a, Rn as i, Vn as n, b as o, Hn as r, Un as t };