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