@dicebear/core 11.0.0 → 11.1.0-rc.1

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.
@@ -0,0 +1,1659 @@
1
+ import { OptionsValidationError } from '../Error/OptionsValidationError.js';
2
+ const validate = (function () {
3
+ 'use strict';
4
+ const stringLength = (string) => /[\uD800-\uDFFF]/.test(string) ? [...string].length : string.length;
5
+ const pointerPart = (s) => (/~\//.test(s) ? `${s}`.replace(/~/g, '~0').replace(/\//g, '~1') : s);
6
+ const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
7
+ const ref1 = function validate(data) {
8
+ validate.errors = null;
9
+ let errorCount = 0;
10
+ if (!(typeof data === "string")) {
11
+ if (validate.errors === null)
12
+ validate.errors = [];
13
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
14
+ errorCount++;
15
+ }
16
+ else {
17
+ if (!(data === "none" || data === "horizontal" || data === "vertical" || data === "both")) {
18
+ if (validate.errors === null)
19
+ validate.errors = [];
20
+ validate.errors.push({ keywordLocation: "#/enum", instanceLocation: "#" });
21
+ errorCount++;
22
+ }
23
+ }
24
+ return errorCount === 0;
25
+ };
26
+ const errorMerge = ({ keywordLocation, instanceLocation }, schemaBase, dataBase) => ({
27
+ keywordLocation: `${schemaBase}${keywordLocation.slice(1)}`,
28
+ instanceLocation: `${dataBase}${instanceLocation.slice(1)}`,
29
+ });
30
+ const ref3 = function validate(data) {
31
+ validate.errors = null;
32
+ let errorCount = 0;
33
+ if (!(typeof data === "number")) {
34
+ if (validate.errors === null)
35
+ validate.errors = [];
36
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
37
+ errorCount++;
38
+ }
39
+ else {
40
+ if (!(-360 <= data)) {
41
+ if (validate.errors === null)
42
+ validate.errors = [];
43
+ validate.errors.push({ keywordLocation: "#/minimum", instanceLocation: "#" });
44
+ errorCount++;
45
+ }
46
+ if (!(360 >= data)) {
47
+ if (validate.errors === null)
48
+ validate.errors = [];
49
+ validate.errors.push({ keywordLocation: "#/maximum", instanceLocation: "#" });
50
+ errorCount++;
51
+ }
52
+ }
53
+ return errorCount === 0;
54
+ };
55
+ const ref2 = function validate(data) {
56
+ validate.errors = null;
57
+ let errorCount = 0;
58
+ let suberr3 = null;
59
+ const sub2 = (() => {
60
+ let errorCount = 0;
61
+ const err2 = validate.errors;
62
+ const res2 = ref3(data);
63
+ const suberr4 = ref3.errors;
64
+ validate.errors = err2;
65
+ if (!res2) {
66
+ if (validate.errors === null)
67
+ validate.errors = [];
68
+ validate.errors.push(...suberr4.map(e => errorMerge(e, "#/anyOf/0/$ref", "#")));
69
+ errorCount++;
70
+ }
71
+ return errorCount === 0;
72
+ })();
73
+ if (!sub2) {
74
+ const sub3 = (() => {
75
+ let errorCount = 0;
76
+ if (!Array.isArray(data)) {
77
+ if (suberr3 === null)
78
+ suberr3 = [];
79
+ suberr3.push({ keywordLocation: "#/anyOf/1/type", instanceLocation: "#" });
80
+ errorCount++;
81
+ }
82
+ else {
83
+ if (data.length > 2) {
84
+ if (suberr3 === null)
85
+ suberr3 = [];
86
+ suberr3.push({ keywordLocation: "#/anyOf/1/maxItems", instanceLocation: "#" });
87
+ errorCount++;
88
+ }
89
+ if (data.length < 0) {
90
+ if (suberr3 === null)
91
+ suberr3 = [];
92
+ suberr3.push({ keywordLocation: "#/anyOf/1/minItems", instanceLocation: "#" });
93
+ errorCount++;
94
+ }
95
+ for (let j = 0; j < data.length; j++) {
96
+ if (data[j] !== undefined && hasOwn(data, j)) {
97
+ const err3 = validate.errors;
98
+ const res3 = ref3(data[j]);
99
+ const suberr5 = ref3.errors;
100
+ validate.errors = err3;
101
+ if (!res3) {
102
+ if (validate.errors === null)
103
+ validate.errors = [];
104
+ validate.errors.push(...suberr5.map(e => errorMerge(e, "#/anyOf/1/items/$ref", "#/" + j)));
105
+ errorCount++;
106
+ }
107
+ }
108
+ }
109
+ }
110
+ return errorCount === 0;
111
+ })();
112
+ if (!sub3) {
113
+ if (validate.errors === null)
114
+ validate.errors = [];
115
+ validate.errors.push({ keywordLocation: "#/anyOf", instanceLocation: "#" });
116
+ if (suberr3)
117
+ validate.errors.push(...suberr3);
118
+ errorCount++;
119
+ }
120
+ }
121
+ return errorCount === 0;
122
+ };
123
+ const ref5 = function validate(data) {
124
+ validate.errors = null;
125
+ let errorCount = 0;
126
+ if (!(typeof data === "number")) {
127
+ if (validate.errors === null)
128
+ validate.errors = [];
129
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
130
+ errorCount++;
131
+ }
132
+ else {
133
+ if (!(0 <= data)) {
134
+ if (validate.errors === null)
135
+ validate.errors = [];
136
+ validate.errors.push({ keywordLocation: "#/minimum", instanceLocation: "#" });
137
+ errorCount++;
138
+ }
139
+ if (!(10 >= data)) {
140
+ if (validate.errors === null)
141
+ validate.errors = [];
142
+ validate.errors.push({ keywordLocation: "#/maximum", instanceLocation: "#" });
143
+ errorCount++;
144
+ }
145
+ }
146
+ return errorCount === 0;
147
+ };
148
+ const ref4 = function validate(data) {
149
+ validate.errors = null;
150
+ let errorCount = 0;
151
+ let suberr7 = null;
152
+ const sub4 = (() => {
153
+ let errorCount = 0;
154
+ const err5 = validate.errors;
155
+ const res5 = ref5(data);
156
+ const suberr8 = ref5.errors;
157
+ validate.errors = err5;
158
+ if (!res5) {
159
+ if (validate.errors === null)
160
+ validate.errors = [];
161
+ validate.errors.push(...suberr8.map(e => errorMerge(e, "#/anyOf/0/$ref", "#")));
162
+ errorCount++;
163
+ }
164
+ return errorCount === 0;
165
+ })();
166
+ if (!sub4) {
167
+ const sub5 = (() => {
168
+ let errorCount = 0;
169
+ if (!Array.isArray(data)) {
170
+ if (suberr7 === null)
171
+ suberr7 = [];
172
+ suberr7.push({ keywordLocation: "#/anyOf/1/type", instanceLocation: "#" });
173
+ errorCount++;
174
+ }
175
+ else {
176
+ if (data.length > 2) {
177
+ if (suberr7 === null)
178
+ suberr7 = [];
179
+ suberr7.push({ keywordLocation: "#/anyOf/1/maxItems", instanceLocation: "#" });
180
+ errorCount++;
181
+ }
182
+ if (data.length < 0) {
183
+ if (suberr7 === null)
184
+ suberr7 = [];
185
+ suberr7.push({ keywordLocation: "#/anyOf/1/minItems", instanceLocation: "#" });
186
+ errorCount++;
187
+ }
188
+ for (let k = 0; k < data.length; k++) {
189
+ if (data[k] !== undefined && hasOwn(data, k)) {
190
+ const err6 = validate.errors;
191
+ const res6 = ref5(data[k]);
192
+ const suberr9 = ref5.errors;
193
+ validate.errors = err6;
194
+ if (!res6) {
195
+ if (validate.errors === null)
196
+ validate.errors = [];
197
+ validate.errors.push(...suberr9.map(e => errorMerge(e, "#/anyOf/1/items/$ref", "#/" + k)));
198
+ errorCount++;
199
+ }
200
+ }
201
+ }
202
+ }
203
+ return errorCount === 0;
204
+ })();
205
+ if (!sub5) {
206
+ if (validate.errors === null)
207
+ validate.errors = [];
208
+ validate.errors.push({ keywordLocation: "#/anyOf", instanceLocation: "#" });
209
+ if (suberr7)
210
+ validate.errors.push(...suberr7);
211
+ errorCount++;
212
+ }
213
+ }
214
+ return errorCount === 0;
215
+ };
216
+ const ref7 = function validate(data) {
217
+ validate.errors = null;
218
+ let errorCount = 0;
219
+ if (!(typeof data === "number")) {
220
+ if (validate.errors === null)
221
+ validate.errors = [];
222
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
223
+ errorCount++;
224
+ }
225
+ else {
226
+ if (!(-1000 <= data)) {
227
+ if (validate.errors === null)
228
+ validate.errors = [];
229
+ validate.errors.push({ keywordLocation: "#/minimum", instanceLocation: "#" });
230
+ errorCount++;
231
+ }
232
+ if (!(1000 >= data)) {
233
+ if (validate.errors === null)
234
+ validate.errors = [];
235
+ validate.errors.push({ keywordLocation: "#/maximum", instanceLocation: "#" });
236
+ errorCount++;
237
+ }
238
+ }
239
+ return errorCount === 0;
240
+ };
241
+ const ref6 = function validate(data) {
242
+ validate.errors = null;
243
+ let errorCount = 0;
244
+ let suberr11 = null;
245
+ const sub6 = (() => {
246
+ let errorCount = 0;
247
+ const err8 = validate.errors;
248
+ const res8 = ref7(data);
249
+ const suberr12 = ref7.errors;
250
+ validate.errors = err8;
251
+ if (!res8) {
252
+ if (validate.errors === null)
253
+ validate.errors = [];
254
+ validate.errors.push(...suberr12.map(e => errorMerge(e, "#/anyOf/0/$ref", "#")));
255
+ errorCount++;
256
+ }
257
+ return errorCount === 0;
258
+ })();
259
+ if (!sub6) {
260
+ const sub7 = (() => {
261
+ let errorCount = 0;
262
+ if (!Array.isArray(data)) {
263
+ if (suberr11 === null)
264
+ suberr11 = [];
265
+ suberr11.push({ keywordLocation: "#/anyOf/1/type", instanceLocation: "#" });
266
+ errorCount++;
267
+ }
268
+ else {
269
+ if (data.length > 2) {
270
+ if (suberr11 === null)
271
+ suberr11 = [];
272
+ suberr11.push({ keywordLocation: "#/anyOf/1/maxItems", instanceLocation: "#" });
273
+ errorCount++;
274
+ }
275
+ if (data.length < 0) {
276
+ if (suberr11 === null)
277
+ suberr11 = [];
278
+ suberr11.push({ keywordLocation: "#/anyOf/1/minItems", instanceLocation: "#" });
279
+ errorCount++;
280
+ }
281
+ for (let l = 0; l < data.length; l++) {
282
+ if (data[l] !== undefined && hasOwn(data, l)) {
283
+ const err9 = validate.errors;
284
+ const res9 = ref7(data[l]);
285
+ const suberr13 = ref7.errors;
286
+ validate.errors = err9;
287
+ if (!res9) {
288
+ if (validate.errors === null)
289
+ validate.errors = [];
290
+ validate.errors.push(...suberr13.map(e => errorMerge(e, "#/anyOf/1/items/$ref", "#/" + l)));
291
+ errorCount++;
292
+ }
293
+ }
294
+ }
295
+ }
296
+ return errorCount === 0;
297
+ })();
298
+ if (!sub7) {
299
+ if (validate.errors === null)
300
+ validate.errors = [];
301
+ validate.errors.push({ keywordLocation: "#/anyOf", instanceLocation: "#" });
302
+ if (suberr11)
303
+ validate.errors.push(...suberr11);
304
+ errorCount++;
305
+ }
306
+ }
307
+ return errorCount === 0;
308
+ };
309
+ const ref8 = function validate(data) {
310
+ validate.errors = null;
311
+ let errorCount = 0;
312
+ if (!(typeof data === "number")) {
313
+ if (validate.errors === null)
314
+ validate.errors = [];
315
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
316
+ errorCount++;
317
+ }
318
+ else {
319
+ if (!(0 <= data)) {
320
+ if (validate.errors === null)
321
+ validate.errors = [];
322
+ validate.errors.push({ keywordLocation: "#/minimum", instanceLocation: "#" });
323
+ errorCount++;
324
+ }
325
+ if (!(50 >= data)) {
326
+ if (validate.errors === null)
327
+ validate.errors = [];
328
+ validate.errors.push({ keywordLocation: "#/maximum", instanceLocation: "#" });
329
+ errorCount++;
330
+ }
331
+ }
332
+ return errorCount === 0;
333
+ };
334
+ const pattern0 = new RegExp("^[a-zA-Z0-9_\\-]+( [a-zA-Z0-9_\\-]+)*(, ?[a-zA-Z0-9_\\-]+( [a-zA-Z0-9_\\-]+)*)*$", "u");
335
+ const ref9 = function validate(data) {
336
+ validate.errors = null;
337
+ let errorCount = 0;
338
+ if (!(typeof data === "string")) {
339
+ if (validate.errors === null)
340
+ validate.errors = [];
341
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
342
+ errorCount++;
343
+ }
344
+ else {
345
+ const prev1 = errorCount;
346
+ if (data.length > 256 && stringLength(data) > 256) {
347
+ if (validate.errors === null)
348
+ validate.errors = [];
349
+ validate.errors.push({ keywordLocation: "#/maxLength", instanceLocation: "#" });
350
+ errorCount++;
351
+ }
352
+ if (errorCount === prev1) {
353
+ if (!pattern0.test(data)) {
354
+ if (validate.errors === null)
355
+ validate.errors = [];
356
+ validate.errors.push({ keywordLocation: "#/pattern", instanceLocation: "#" });
357
+ errorCount++;
358
+ }
359
+ }
360
+ }
361
+ return errorCount === 0;
362
+ };
363
+ const ref10 = function validate(data) {
364
+ validate.errors = null;
365
+ let errorCount = 0;
366
+ if (!Number.isInteger(data)) {
367
+ if (validate.errors === null)
368
+ validate.errors = [];
369
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
370
+ errorCount++;
371
+ }
372
+ else {
373
+ if (!(1 <= data)) {
374
+ if (validate.errors === null)
375
+ validate.errors = [];
376
+ validate.errors.push({ keywordLocation: "#/minimum", instanceLocation: "#" });
377
+ errorCount++;
378
+ }
379
+ if (!(1000 >= data)) {
380
+ if (validate.errors === null)
381
+ validate.errors = [];
382
+ validate.errors.push({ keywordLocation: "#/maximum", instanceLocation: "#" });
383
+ errorCount++;
384
+ }
385
+ }
386
+ return errorCount === 0;
387
+ };
388
+ const pattern1 = new RegExp("^!?[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$", "u");
389
+ const ref11 = function validate(data) {
390
+ validate.errors = null;
391
+ let errorCount = 0;
392
+ if (!(typeof data === "string")) {
393
+ if (validate.errors === null)
394
+ validate.errors = [];
395
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
396
+ errorCount++;
397
+ }
398
+ else {
399
+ const prev2 = errorCount;
400
+ if (data.length > 130 && stringLength(data) > 130) {
401
+ if (validate.errors === null)
402
+ validate.errors = [];
403
+ validate.errors.push({ keywordLocation: "#/maxLength", instanceLocation: "#" });
404
+ errorCount++;
405
+ }
406
+ if (errorCount === prev2) {
407
+ if (!pattern1.test(data)) {
408
+ if (validate.errors === null)
409
+ validate.errors = [];
410
+ validate.errors.push({ keywordLocation: "#/pattern", instanceLocation: "#" });
411
+ errorCount++;
412
+ }
413
+ }
414
+ }
415
+ return errorCount === 0;
416
+ };
417
+ const ref13 = function validate(data) {
418
+ validate.errors = null;
419
+ let errorCount = 0;
420
+ if (!(typeof data === "number")) {
421
+ if (validate.errors === null)
422
+ validate.errors = [];
423
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
424
+ errorCount++;
425
+ }
426
+ else {
427
+ if (!(0.1 <= data)) {
428
+ if (validate.errors === null)
429
+ validate.errors = [];
430
+ validate.errors.push({ keywordLocation: "#/minimum", instanceLocation: "#" });
431
+ errorCount++;
432
+ }
433
+ if (!(10 >= data)) {
434
+ if (validate.errors === null)
435
+ validate.errors = [];
436
+ validate.errors.push({ keywordLocation: "#/maximum", instanceLocation: "#" });
437
+ errorCount++;
438
+ }
439
+ }
440
+ return errorCount === 0;
441
+ };
442
+ const ref12 = function validate(data) {
443
+ validate.errors = null;
444
+ let errorCount = 0;
445
+ let suberr28 = null;
446
+ const sub16 = (() => {
447
+ let errorCount = 0;
448
+ const err20 = validate.errors;
449
+ const res20 = ref13(data);
450
+ const suberr29 = ref13.errors;
451
+ validate.errors = err20;
452
+ if (!res20) {
453
+ if (validate.errors === null)
454
+ validate.errors = [];
455
+ validate.errors.push(...suberr29.map(e => errorMerge(e, "#/anyOf/0/$ref", "#")));
456
+ errorCount++;
457
+ }
458
+ return errorCount === 0;
459
+ })();
460
+ if (!sub16) {
461
+ const sub17 = (() => {
462
+ let errorCount = 0;
463
+ if (!Array.isArray(data)) {
464
+ if (suberr28 === null)
465
+ suberr28 = [];
466
+ suberr28.push({ keywordLocation: "#/anyOf/1/type", instanceLocation: "#" });
467
+ errorCount++;
468
+ }
469
+ else {
470
+ if (data.length > 2) {
471
+ if (suberr28 === null)
472
+ suberr28 = [];
473
+ suberr28.push({ keywordLocation: "#/anyOf/1/maxItems", instanceLocation: "#" });
474
+ errorCount++;
475
+ }
476
+ if (data.length < 0) {
477
+ if (suberr28 === null)
478
+ suberr28 = [];
479
+ suberr28.push({ keywordLocation: "#/anyOf/1/minItems", instanceLocation: "#" });
480
+ errorCount++;
481
+ }
482
+ for (let q = 0; q < data.length; q++) {
483
+ if (data[q] !== undefined && hasOwn(data, q)) {
484
+ const err21 = validate.errors;
485
+ const res21 = ref13(data[q]);
486
+ const suberr30 = ref13.errors;
487
+ validate.errors = err21;
488
+ if (!res21) {
489
+ if (validate.errors === null)
490
+ validate.errors = [];
491
+ validate.errors.push(...suberr30.map(e => errorMerge(e, "#/anyOf/1/items/$ref", "#/" + q)));
492
+ errorCount++;
493
+ }
494
+ }
495
+ }
496
+ }
497
+ return errorCount === 0;
498
+ })();
499
+ if (!sub17) {
500
+ if (validate.errors === null)
501
+ validate.errors = [];
502
+ validate.errors.push({ keywordLocation: "#/anyOf", instanceLocation: "#" });
503
+ if (suberr28)
504
+ validate.errors.push(...suberr28);
505
+ errorCount++;
506
+ }
507
+ }
508
+ return errorCount === 0;
509
+ };
510
+ const ref15 = function validate(data) {
511
+ validate.errors = null;
512
+ let errorCount = 0;
513
+ if (!(typeof data === "number")) {
514
+ if (validate.errors === null)
515
+ validate.errors = [];
516
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
517
+ errorCount++;
518
+ }
519
+ else {
520
+ if (!(-3600 <= data)) {
521
+ if (validate.errors === null)
522
+ validate.errors = [];
523
+ validate.errors.push({ keywordLocation: "#/minimum", instanceLocation: "#" });
524
+ errorCount++;
525
+ }
526
+ if (!(3600 >= data)) {
527
+ if (validate.errors === null)
528
+ validate.errors = [];
529
+ validate.errors.push({ keywordLocation: "#/maximum", instanceLocation: "#" });
530
+ errorCount++;
531
+ }
532
+ }
533
+ return errorCount === 0;
534
+ };
535
+ const ref14 = function validate(data) {
536
+ validate.errors = null;
537
+ let errorCount = 0;
538
+ let suberr32 = null;
539
+ const sub18 = (() => {
540
+ let errorCount = 0;
541
+ const err23 = validate.errors;
542
+ const res23 = ref15(data);
543
+ const suberr33 = ref15.errors;
544
+ validate.errors = err23;
545
+ if (!res23) {
546
+ if (validate.errors === null)
547
+ validate.errors = [];
548
+ validate.errors.push(...suberr33.map(e => errorMerge(e, "#/anyOf/0/$ref", "#")));
549
+ errorCount++;
550
+ }
551
+ return errorCount === 0;
552
+ })();
553
+ if (!sub18) {
554
+ const sub19 = (() => {
555
+ let errorCount = 0;
556
+ if (!Array.isArray(data)) {
557
+ if (suberr32 === null)
558
+ suberr32 = [];
559
+ suberr32.push({ keywordLocation: "#/anyOf/1/type", instanceLocation: "#" });
560
+ errorCount++;
561
+ }
562
+ else {
563
+ if (data.length > 2) {
564
+ if (suberr32 === null)
565
+ suberr32 = [];
566
+ suberr32.push({ keywordLocation: "#/anyOf/1/maxItems", instanceLocation: "#" });
567
+ errorCount++;
568
+ }
569
+ if (data.length < 0) {
570
+ if (suberr32 === null)
571
+ suberr32 = [];
572
+ suberr32.push({ keywordLocation: "#/anyOf/1/minItems", instanceLocation: "#" });
573
+ errorCount++;
574
+ }
575
+ for (let r = 0; r < data.length; r++) {
576
+ if (data[r] !== undefined && hasOwn(data, r)) {
577
+ const err24 = validate.errors;
578
+ const res24 = ref15(data[r]);
579
+ const suberr34 = ref15.errors;
580
+ validate.errors = err24;
581
+ if (!res24) {
582
+ if (validate.errors === null)
583
+ validate.errors = [];
584
+ validate.errors.push(...suberr34.map(e => errorMerge(e, "#/anyOf/1/items/$ref", "#/" + r)));
585
+ errorCount++;
586
+ }
587
+ }
588
+ }
589
+ }
590
+ return errorCount === 0;
591
+ })();
592
+ if (!sub19) {
593
+ if (validate.errors === null)
594
+ validate.errors = [];
595
+ validate.errors.push({ keywordLocation: "#/anyOf", instanceLocation: "#" });
596
+ if (suberr32)
597
+ validate.errors.push(...suberr32);
598
+ errorCount++;
599
+ }
600
+ }
601
+ return errorCount === 0;
602
+ };
603
+ const pattern2 = new RegExp("^[a-z][a-zA-Z0-9]*Variant$", "u");
604
+ const pattern3 = new RegExp("^[a-z][a-zA-Z0-9]*$", "u");
605
+ const ref16 = function validate(data) {
606
+ validate.errors = null;
607
+ let errorCount = 0;
608
+ if (!(typeof data === "string")) {
609
+ if (validate.errors === null)
610
+ validate.errors = [];
611
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
612
+ errorCount++;
613
+ }
614
+ else {
615
+ const prev3 = errorCount;
616
+ if (data.length > 64 && stringLength(data) > 64) {
617
+ if (validate.errors === null)
618
+ validate.errors = [];
619
+ validate.errors.push({ keywordLocation: "#/maxLength", instanceLocation: "#" });
620
+ errorCount++;
621
+ }
622
+ if (errorCount === prev3) {
623
+ if (!pattern3.test(data)) {
624
+ if (validate.errors === null)
625
+ validate.errors = [];
626
+ validate.errors.push({ keywordLocation: "#/pattern", instanceLocation: "#" });
627
+ errorCount++;
628
+ }
629
+ }
630
+ }
631
+ return errorCount === 0;
632
+ };
633
+ const pattern4 = new RegExp("^[a-z][a-zA-Z0-9]*Probability$", "u");
634
+ const pattern5 = new RegExp("^[a-z][a-zA-Z0-9]*Color$", "u");
635
+ const pattern6 = new RegExp("^#?([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$", "u");
636
+ const ref17 = function validate(data) {
637
+ validate.errors = null;
638
+ let errorCount = 0;
639
+ if (!(typeof data === "string")) {
640
+ if (validate.errors === null)
641
+ validate.errors = [];
642
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
643
+ errorCount++;
644
+ }
645
+ else {
646
+ const prev4 = errorCount;
647
+ if (errorCount === prev4) {
648
+ if (!pattern6.test(data)) {
649
+ if (validate.errors === null)
650
+ validate.errors = [];
651
+ validate.errors.push({ keywordLocation: "#/pattern", instanceLocation: "#" });
652
+ errorCount++;
653
+ }
654
+ }
655
+ }
656
+ return errorCount === 0;
657
+ };
658
+ const pattern7 = new RegExp("^[a-z][a-zA-Z0-9]*ColorFill$", "u");
659
+ const ref18 = function validate(data) {
660
+ validate.errors = null;
661
+ let errorCount = 0;
662
+ if (!(typeof data === "string")) {
663
+ if (validate.errors === null)
664
+ validate.errors = [];
665
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
666
+ errorCount++;
667
+ }
668
+ else {
669
+ if (!(data === "solid" || data === "linear" || data === "radial")) {
670
+ if (validate.errors === null)
671
+ validate.errors = [];
672
+ validate.errors.push({ keywordLocation: "#/enum", instanceLocation: "#" });
673
+ errorCount++;
674
+ }
675
+ }
676
+ return errorCount === 0;
677
+ };
678
+ const pattern8 = new RegExp("^[a-z][a-zA-Z0-9]*ColorFillStops$", "u");
679
+ const ref19 = function validate(data) {
680
+ validate.errors = null;
681
+ let errorCount = 0;
682
+ if (!Number.isInteger(data)) {
683
+ if (validate.errors === null)
684
+ validate.errors = [];
685
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
686
+ errorCount++;
687
+ }
688
+ else {
689
+ if (!(2 <= data)) {
690
+ if (validate.errors === null)
691
+ validate.errors = [];
692
+ validate.errors.push({ keywordLocation: "#/minimum", instanceLocation: "#" });
693
+ errorCount++;
694
+ }
695
+ }
696
+ return errorCount === 0;
697
+ };
698
+ const pattern9 = new RegExp("^[a-z][a-zA-Z0-9]*ColorAngle$", "u");
699
+ const pattern10 = new RegExp("^[a-z][a-zA-Z0-9]*ColorOrder$", "u");
700
+ const pattern11 = new RegExp("^[a-z][a-zA-Z0-9]*Animation$", "u");
701
+ const pattern12 = new RegExp("^[a-z][a-zA-Z0-9]*AnimationSpeed$", "u");
702
+ const pattern13 = new RegExp("^[a-z][a-zA-Z0-9]*AnimationDelay$", "u");
703
+ const ref0 = function validate(data) {
704
+ validate.errors = null;
705
+ let errorCount = 0;
706
+ if (!(typeof data === "object" && data && !Array.isArray(data))) {
707
+ if (validate.errors === null)
708
+ validate.errors = [];
709
+ validate.errors.push({ keywordLocation: "#/type", instanceLocation: "#" });
710
+ errorCount++;
711
+ }
712
+ else {
713
+ const prev0 = errorCount;
714
+ if (Object.keys(data).length > 512) {
715
+ if (validate.errors === null)
716
+ validate.errors = [];
717
+ validate.errors.push({ keywordLocation: "#/maxProperties", instanceLocation: "#" });
718
+ errorCount++;
719
+ }
720
+ for (const key0 of Object.keys(data)) {
721
+ if (key0.length > 128 && stringLength(key0) > 128) {
722
+ if (validate.errors === null)
723
+ validate.errors = [];
724
+ validate.errors.push({ keywordLocation: "#/propertyNames/maxLength", instanceLocation: "#/" + pointerPart(key0) });
725
+ errorCount++;
726
+ }
727
+ }
728
+ if (data.seed !== undefined && hasOwn(data, "seed")) {
729
+ if (!(typeof data.seed === "string")) {
730
+ if (validate.errors === null)
731
+ validate.errors = [];
732
+ validate.errors.push({ keywordLocation: "#/properties/seed/type", instanceLocation: "#/seed" });
733
+ errorCount++;
734
+ }
735
+ else {
736
+ if (data.seed.length > 1024 && stringLength(data.seed) > 1024) {
737
+ if (validate.errors === null)
738
+ validate.errors = [];
739
+ validate.errors.push({ keywordLocation: "#/properties/seed/maxLength", instanceLocation: "#/seed" });
740
+ errorCount++;
741
+ }
742
+ }
743
+ }
744
+ if (data.size !== undefined && hasOwn(data, "size")) {
745
+ if (!Number.isInteger(data.size)) {
746
+ if (validate.errors === null)
747
+ validate.errors = [];
748
+ validate.errors.push({ keywordLocation: "#/properties/size/type", instanceLocation: "#/size" });
749
+ errorCount++;
750
+ }
751
+ else {
752
+ if (!(1 <= data.size)) {
753
+ if (validate.errors === null)
754
+ validate.errors = [];
755
+ validate.errors.push({ keywordLocation: "#/properties/size/minimum", instanceLocation: "#/size" });
756
+ errorCount++;
757
+ }
758
+ if (!(4096 >= data.size)) {
759
+ if (validate.errors === null)
760
+ validate.errors = [];
761
+ validate.errors.push({ keywordLocation: "#/properties/size/maximum", instanceLocation: "#/size" });
762
+ errorCount++;
763
+ }
764
+ }
765
+ }
766
+ if (data.idRandomization !== undefined && hasOwn(data, "idRandomization")) {
767
+ if (!(typeof data.idRandomization === "boolean")) {
768
+ if (validate.errors === null)
769
+ validate.errors = [];
770
+ validate.errors.push({ keywordLocation: "#/properties/idRandomization/type", instanceLocation: "#/idRandomization" });
771
+ errorCount++;
772
+ }
773
+ }
774
+ if (data.title !== undefined && hasOwn(data, "title")) {
775
+ if (!(typeof data.title === "string")) {
776
+ if (validate.errors === null)
777
+ validate.errors = [];
778
+ validate.errors.push({ keywordLocation: "#/properties/title/type", instanceLocation: "#/title" });
779
+ errorCount++;
780
+ }
781
+ else {
782
+ if (data.title.length > 256 && stringLength(data.title) > 256) {
783
+ if (validate.errors === null)
784
+ validate.errors = [];
785
+ validate.errors.push({ keywordLocation: "#/properties/title/maxLength", instanceLocation: "#/title" });
786
+ errorCount++;
787
+ }
788
+ }
789
+ }
790
+ if (data.flip !== undefined && hasOwn(data, "flip")) {
791
+ let suberr0 = null;
792
+ const sub0 = (() => {
793
+ let errorCount = 0;
794
+ const err0 = validate.errors;
795
+ const res0 = ref1(data.flip);
796
+ const suberr1 = ref1.errors;
797
+ validate.errors = err0;
798
+ if (!res0) {
799
+ if (validate.errors === null)
800
+ validate.errors = [];
801
+ validate.errors.push(...suberr1.map(e => errorMerge(e, "#/properties/flip/anyOf/0/$ref", "#/flip")));
802
+ errorCount++;
803
+ }
804
+ return errorCount === 0;
805
+ })();
806
+ if (!sub0) {
807
+ const sub1 = (() => {
808
+ let errorCount = 0;
809
+ if (!Array.isArray(data.flip)) {
810
+ if (suberr0 === null)
811
+ suberr0 = [];
812
+ suberr0.push({ keywordLocation: "#/properties/flip/anyOf/1/type", instanceLocation: "#/flip" });
813
+ errorCount++;
814
+ }
815
+ else {
816
+ if (data.flip.length > 4) {
817
+ if (suberr0 === null)
818
+ suberr0 = [];
819
+ suberr0.push({ keywordLocation: "#/properties/flip/anyOf/1/maxItems", instanceLocation: "#/flip" });
820
+ errorCount++;
821
+ }
822
+ if (data.flip.length < 0) {
823
+ if (suberr0 === null)
824
+ suberr0 = [];
825
+ suberr0.push({ keywordLocation: "#/properties/flip/anyOf/1/minItems", instanceLocation: "#/flip" });
826
+ errorCount++;
827
+ }
828
+ for (let i = 0; i < data.flip.length; i++) {
829
+ if (data.flip[i] !== undefined && hasOwn(data.flip, i)) {
830
+ const err1 = validate.errors;
831
+ const res1 = ref1(data.flip[i]);
832
+ const suberr2 = ref1.errors;
833
+ validate.errors = err1;
834
+ if (!res1) {
835
+ if (validate.errors === null)
836
+ validate.errors = [];
837
+ validate.errors.push(...suberr2.map(e => errorMerge(e, "#/properties/flip/anyOf/1/items/$ref", "#/flip/" + i)));
838
+ errorCount++;
839
+ }
840
+ }
841
+ }
842
+ }
843
+ return errorCount === 0;
844
+ })();
845
+ if (!sub1) {
846
+ if (validate.errors === null)
847
+ validate.errors = [];
848
+ validate.errors.push({ keywordLocation: "#/properties/flip/anyOf", instanceLocation: "#/flip" });
849
+ if (suberr0)
850
+ validate.errors.push(...suberr0);
851
+ errorCount++;
852
+ }
853
+ }
854
+ }
855
+ if (data.rotate !== undefined && hasOwn(data, "rotate")) {
856
+ const err4 = validate.errors;
857
+ const res4 = ref2(data.rotate);
858
+ const suberr6 = ref2.errors;
859
+ validate.errors = err4;
860
+ if (!res4) {
861
+ if (validate.errors === null)
862
+ validate.errors = [];
863
+ validate.errors.push(...suberr6.map(e => errorMerge(e, "#/properties/rotate/allOf/0/$ref", "#/rotate")));
864
+ errorCount++;
865
+ }
866
+ }
867
+ if (data.scale !== undefined && hasOwn(data, "scale")) {
868
+ const err7 = validate.errors;
869
+ const res7 = ref4(data.scale);
870
+ const suberr10 = ref4.errors;
871
+ validate.errors = err7;
872
+ if (!res7) {
873
+ if (validate.errors === null)
874
+ validate.errors = [];
875
+ validate.errors.push(...suberr10.map(e => errorMerge(e, "#/properties/scale/allOf/0/$ref", "#/scale")));
876
+ errorCount++;
877
+ }
878
+ }
879
+ if (data.translateX !== undefined && hasOwn(data, "translateX")) {
880
+ const err10 = validate.errors;
881
+ const res10 = ref6(data.translateX);
882
+ const suberr14 = ref6.errors;
883
+ validate.errors = err10;
884
+ if (!res10) {
885
+ if (validate.errors === null)
886
+ validate.errors = [];
887
+ validate.errors.push(...suberr14.map(e => errorMerge(e, "#/properties/translateX/allOf/0/$ref", "#/translateX")));
888
+ errorCount++;
889
+ }
890
+ }
891
+ if (data.translateY !== undefined && hasOwn(data, "translateY")) {
892
+ const err11 = validate.errors;
893
+ const res11 = ref6(data.translateY);
894
+ const suberr15 = ref6.errors;
895
+ validate.errors = err11;
896
+ if (!res11) {
897
+ if (validate.errors === null)
898
+ validate.errors = [];
899
+ validate.errors.push(...suberr15.map(e => errorMerge(e, "#/properties/translateY/allOf/0/$ref", "#/translateY")));
900
+ errorCount++;
901
+ }
902
+ }
903
+ if (data.borderRadius !== undefined && hasOwn(data, "borderRadius")) {
904
+ let suberr16 = null;
905
+ const sub8 = (() => {
906
+ let errorCount = 0;
907
+ const err12 = validate.errors;
908
+ const res12 = ref8(data.borderRadius);
909
+ const suberr17 = ref8.errors;
910
+ validate.errors = err12;
911
+ if (!res12) {
912
+ if (validate.errors === null)
913
+ validate.errors = [];
914
+ validate.errors.push(...suberr17.map(e => errorMerge(e, "#/properties/borderRadius/anyOf/0/$ref", "#/borderRadius")));
915
+ errorCount++;
916
+ }
917
+ return errorCount === 0;
918
+ })();
919
+ if (!sub8) {
920
+ const sub9 = (() => {
921
+ let errorCount = 0;
922
+ if (!Array.isArray(data.borderRadius)) {
923
+ if (suberr16 === null)
924
+ suberr16 = [];
925
+ suberr16.push({ keywordLocation: "#/properties/borderRadius/anyOf/1/type", instanceLocation: "#/borderRadius" });
926
+ errorCount++;
927
+ }
928
+ else {
929
+ if (data.borderRadius.length > 2) {
930
+ if (suberr16 === null)
931
+ suberr16 = [];
932
+ suberr16.push({ keywordLocation: "#/properties/borderRadius/anyOf/1/maxItems", instanceLocation: "#/borderRadius" });
933
+ errorCount++;
934
+ }
935
+ if (data.borderRadius.length < 0) {
936
+ if (suberr16 === null)
937
+ suberr16 = [];
938
+ suberr16.push({ keywordLocation: "#/properties/borderRadius/anyOf/1/minItems", instanceLocation: "#/borderRadius" });
939
+ errorCount++;
940
+ }
941
+ for (let m = 0; m < data.borderRadius.length; m++) {
942
+ if (data.borderRadius[m] !== undefined && hasOwn(data.borderRadius, m)) {
943
+ const err13 = validate.errors;
944
+ const res13 = ref8(data.borderRadius[m]);
945
+ const suberr18 = ref8.errors;
946
+ validate.errors = err13;
947
+ if (!res13) {
948
+ if (validate.errors === null)
949
+ validate.errors = [];
950
+ validate.errors.push(...suberr18.map(e => errorMerge(e, "#/properties/borderRadius/anyOf/1/items/$ref", "#/borderRadius/" + m)));
951
+ errorCount++;
952
+ }
953
+ }
954
+ }
955
+ }
956
+ return errorCount === 0;
957
+ })();
958
+ if (!sub9) {
959
+ if (validate.errors === null)
960
+ validate.errors = [];
961
+ validate.errors.push({ keywordLocation: "#/properties/borderRadius/anyOf", instanceLocation: "#/borderRadius" });
962
+ if (suberr16)
963
+ validate.errors.push(...suberr16);
964
+ errorCount++;
965
+ }
966
+ }
967
+ }
968
+ if (data.fontFamily !== undefined && hasOwn(data, "fontFamily")) {
969
+ let suberr19 = null;
970
+ const sub10 = (() => {
971
+ let errorCount = 0;
972
+ const err14 = validate.errors;
973
+ const res14 = ref9(data.fontFamily);
974
+ const suberr20 = ref9.errors;
975
+ validate.errors = err14;
976
+ if (!res14) {
977
+ if (validate.errors === null)
978
+ validate.errors = [];
979
+ validate.errors.push(...suberr20.map(e => errorMerge(e, "#/properties/fontFamily/anyOf/0/$ref", "#/fontFamily")));
980
+ errorCount++;
981
+ }
982
+ return errorCount === 0;
983
+ })();
984
+ if (!sub10) {
985
+ const sub11 = (() => {
986
+ let errorCount = 0;
987
+ if (!Array.isArray(data.fontFamily)) {
988
+ if (suberr19 === null)
989
+ suberr19 = [];
990
+ suberr19.push({ keywordLocation: "#/properties/fontFamily/anyOf/1/type", instanceLocation: "#/fontFamily" });
991
+ errorCount++;
992
+ }
993
+ else {
994
+ if (data.fontFamily.length > 128) {
995
+ if (suberr19 === null)
996
+ suberr19 = [];
997
+ suberr19.push({ keywordLocation: "#/properties/fontFamily/anyOf/1/maxItems", instanceLocation: "#/fontFamily" });
998
+ errorCount++;
999
+ }
1000
+ if (data.fontFamily.length < 0) {
1001
+ if (suberr19 === null)
1002
+ suberr19 = [];
1003
+ suberr19.push({ keywordLocation: "#/properties/fontFamily/anyOf/1/minItems", instanceLocation: "#/fontFamily" });
1004
+ errorCount++;
1005
+ }
1006
+ for (let n = 0; n < data.fontFamily.length; n++) {
1007
+ if (data.fontFamily[n] !== undefined && hasOwn(data.fontFamily, n)) {
1008
+ const err15 = validate.errors;
1009
+ const res15 = ref9(data.fontFamily[n]);
1010
+ const suberr21 = ref9.errors;
1011
+ validate.errors = err15;
1012
+ if (!res15) {
1013
+ if (validate.errors === null)
1014
+ validate.errors = [];
1015
+ validate.errors.push(...suberr21.map(e => errorMerge(e, "#/properties/fontFamily/anyOf/1/items/$ref", "#/fontFamily/" + n)));
1016
+ errorCount++;
1017
+ }
1018
+ }
1019
+ }
1020
+ }
1021
+ return errorCount === 0;
1022
+ })();
1023
+ if (!sub11) {
1024
+ if (validate.errors === null)
1025
+ validate.errors = [];
1026
+ validate.errors.push({ keywordLocation: "#/properties/fontFamily/anyOf", instanceLocation: "#/fontFamily" });
1027
+ if (suberr19)
1028
+ validate.errors.push(...suberr19);
1029
+ errorCount++;
1030
+ }
1031
+ }
1032
+ }
1033
+ if (data.fontWeight !== undefined && hasOwn(data, "fontWeight")) {
1034
+ let suberr22 = null;
1035
+ const sub12 = (() => {
1036
+ let errorCount = 0;
1037
+ const err16 = validate.errors;
1038
+ const res16 = ref10(data.fontWeight);
1039
+ const suberr23 = ref10.errors;
1040
+ validate.errors = err16;
1041
+ if (!res16) {
1042
+ if (validate.errors === null)
1043
+ validate.errors = [];
1044
+ validate.errors.push(...suberr23.map(e => errorMerge(e, "#/properties/fontWeight/anyOf/0/$ref", "#/fontWeight")));
1045
+ errorCount++;
1046
+ }
1047
+ return errorCount === 0;
1048
+ })();
1049
+ if (!sub12) {
1050
+ const sub13 = (() => {
1051
+ let errorCount = 0;
1052
+ if (!Array.isArray(data.fontWeight)) {
1053
+ if (suberr22 === null)
1054
+ suberr22 = [];
1055
+ suberr22.push({ keywordLocation: "#/properties/fontWeight/anyOf/1/type", instanceLocation: "#/fontWeight" });
1056
+ errorCount++;
1057
+ }
1058
+ else {
1059
+ if (data.fontWeight.length > 128) {
1060
+ if (suberr22 === null)
1061
+ suberr22 = [];
1062
+ suberr22.push({ keywordLocation: "#/properties/fontWeight/anyOf/1/maxItems", instanceLocation: "#/fontWeight" });
1063
+ errorCount++;
1064
+ }
1065
+ if (data.fontWeight.length < 0) {
1066
+ if (suberr22 === null)
1067
+ suberr22 = [];
1068
+ suberr22.push({ keywordLocation: "#/properties/fontWeight/anyOf/1/minItems", instanceLocation: "#/fontWeight" });
1069
+ errorCount++;
1070
+ }
1071
+ for (let o = 0; o < data.fontWeight.length; o++) {
1072
+ if (data.fontWeight[o] !== undefined && hasOwn(data.fontWeight, o)) {
1073
+ const err17 = validate.errors;
1074
+ const res17 = ref10(data.fontWeight[o]);
1075
+ const suberr24 = ref10.errors;
1076
+ validate.errors = err17;
1077
+ if (!res17) {
1078
+ if (validate.errors === null)
1079
+ validate.errors = [];
1080
+ validate.errors.push(...suberr24.map(e => errorMerge(e, "#/properties/fontWeight/anyOf/1/items/$ref", "#/fontWeight/" + o)));
1081
+ errorCount++;
1082
+ }
1083
+ }
1084
+ }
1085
+ }
1086
+ return errorCount === 0;
1087
+ })();
1088
+ if (!sub13) {
1089
+ if (validate.errors === null)
1090
+ validate.errors = [];
1091
+ validate.errors.push({ keywordLocation: "#/properties/fontWeight/anyOf", instanceLocation: "#/fontWeight" });
1092
+ if (suberr22)
1093
+ validate.errors.push(...suberr22);
1094
+ errorCount++;
1095
+ }
1096
+ }
1097
+ }
1098
+ if (data.tags !== undefined && hasOwn(data, "tags")) {
1099
+ let suberr25 = null;
1100
+ const sub14 = (() => {
1101
+ let errorCount = 0;
1102
+ const err18 = validate.errors;
1103
+ const res18 = ref11(data.tags);
1104
+ const suberr26 = ref11.errors;
1105
+ validate.errors = err18;
1106
+ if (!res18) {
1107
+ if (validate.errors === null)
1108
+ validate.errors = [];
1109
+ validate.errors.push(...suberr26.map(e => errorMerge(e, "#/properties/tags/anyOf/0/$ref", "#/tags")));
1110
+ errorCount++;
1111
+ }
1112
+ return errorCount === 0;
1113
+ })();
1114
+ if (!sub14) {
1115
+ const sub15 = (() => {
1116
+ let errorCount = 0;
1117
+ if (!Array.isArray(data.tags)) {
1118
+ if (suberr25 === null)
1119
+ suberr25 = [];
1120
+ suberr25.push({ keywordLocation: "#/properties/tags/anyOf/1/type", instanceLocation: "#/tags" });
1121
+ errorCount++;
1122
+ }
1123
+ else {
1124
+ if (data.tags.length > 128) {
1125
+ if (suberr25 === null)
1126
+ suberr25 = [];
1127
+ suberr25.push({ keywordLocation: "#/properties/tags/anyOf/1/maxItems", instanceLocation: "#/tags" });
1128
+ errorCount++;
1129
+ }
1130
+ if (data.tags.length < 0) {
1131
+ if (suberr25 === null)
1132
+ suberr25 = [];
1133
+ suberr25.push({ keywordLocation: "#/properties/tags/anyOf/1/minItems", instanceLocation: "#/tags" });
1134
+ errorCount++;
1135
+ }
1136
+ for (let p = 0; p < data.tags.length; p++) {
1137
+ if (data.tags[p] !== undefined && hasOwn(data.tags, p)) {
1138
+ const err19 = validate.errors;
1139
+ const res19 = ref11(data.tags[p]);
1140
+ const suberr27 = ref11.errors;
1141
+ validate.errors = err19;
1142
+ if (!res19) {
1143
+ if (validate.errors === null)
1144
+ validate.errors = [];
1145
+ validate.errors.push(...suberr27.map(e => errorMerge(e, "#/properties/tags/anyOf/1/items/$ref", "#/tags/" + p)));
1146
+ errorCount++;
1147
+ }
1148
+ }
1149
+ }
1150
+ }
1151
+ return errorCount === 0;
1152
+ })();
1153
+ if (!sub15) {
1154
+ if (validate.errors === null)
1155
+ validate.errors = [];
1156
+ validate.errors.push({ keywordLocation: "#/properties/tags/anyOf", instanceLocation: "#/tags" });
1157
+ if (suberr25)
1158
+ validate.errors.push(...suberr25);
1159
+ errorCount++;
1160
+ }
1161
+ }
1162
+ }
1163
+ if (data.animation !== undefined && hasOwn(data, "animation")) {
1164
+ if (!(typeof data.animation === "boolean")) {
1165
+ if (validate.errors === null)
1166
+ validate.errors = [];
1167
+ validate.errors.push({ keywordLocation: "#/properties/animation/type", instanceLocation: "#/animation" });
1168
+ errorCount++;
1169
+ }
1170
+ }
1171
+ if (data.animationSpeed !== undefined && hasOwn(data, "animationSpeed")) {
1172
+ const err22 = validate.errors;
1173
+ const res22 = ref12(data.animationSpeed);
1174
+ const suberr31 = ref12.errors;
1175
+ validate.errors = err22;
1176
+ if (!res22) {
1177
+ if (validate.errors === null)
1178
+ validate.errors = [];
1179
+ validate.errors.push(...suberr31.map(e => errorMerge(e, "#/properties/animationSpeed/allOf/0/$ref", "#/animationSpeed")));
1180
+ errorCount++;
1181
+ }
1182
+ }
1183
+ if (data.animationDelay !== undefined && hasOwn(data, "animationDelay")) {
1184
+ const err25 = validate.errors;
1185
+ const res25 = ref14(data.animationDelay);
1186
+ const suberr35 = ref14.errors;
1187
+ validate.errors = err25;
1188
+ if (!res25) {
1189
+ if (validate.errors === null)
1190
+ validate.errors = [];
1191
+ validate.errors.push(...suberr35.map(e => errorMerge(e, "#/properties/animationDelay/allOf/0/$ref", "#/animationDelay")));
1192
+ errorCount++;
1193
+ }
1194
+ }
1195
+ if (data.animationRespectReducedMotion !== undefined && hasOwn(data, "animationRespectReducedMotion")) {
1196
+ if (!(typeof data.animationRespectReducedMotion === "boolean")) {
1197
+ if (validate.errors === null)
1198
+ validate.errors = [];
1199
+ validate.errors.push({ keywordLocation: "#/properties/animationRespectReducedMotion/type", instanceLocation: "#/animationRespectReducedMotion" });
1200
+ errorCount++;
1201
+ }
1202
+ }
1203
+ if (errorCount === prev0) {
1204
+ for (const key1 of Object.keys(data)) {
1205
+ if (pattern2.test(key1)) {
1206
+ let suberr36 = null;
1207
+ const sub20 = (() => {
1208
+ let errorCount = 0;
1209
+ const err26 = validate.errors;
1210
+ const res26 = ref16(data[key1]);
1211
+ const suberr37 = ref16.errors;
1212
+ validate.errors = err26;
1213
+ if (!res26) {
1214
+ if (validate.errors === null)
1215
+ validate.errors = [];
1216
+ validate.errors.push(...suberr37.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/0/$ref", "#/" + pointerPart(key1))));
1217
+ errorCount++;
1218
+ }
1219
+ return errorCount === 0;
1220
+ })();
1221
+ if (!sub20) {
1222
+ const sub21 = (() => {
1223
+ let errorCount = 0;
1224
+ if (!(Array.isArray(data[key1]))) {
1225
+ if (suberr36 === null)
1226
+ suberr36 = [];
1227
+ suberr36.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/1/type", instanceLocation: "#/" + pointerPart(key1) });
1228
+ errorCount++;
1229
+ }
1230
+ else {
1231
+ if (data[key1].length > 128) {
1232
+ if (suberr36 === null)
1233
+ suberr36 = [];
1234
+ suberr36.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/1/maxItems", instanceLocation: "#/" + pointerPart(key1) });
1235
+ errorCount++;
1236
+ }
1237
+ if (data[key1].length < 0) {
1238
+ if (suberr36 === null)
1239
+ suberr36 = [];
1240
+ suberr36.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/1/minItems", instanceLocation: "#/" + pointerPart(key1) });
1241
+ errorCount++;
1242
+ }
1243
+ for (let s = 0; s < data[key1].length; s++) {
1244
+ if (data[key1][s] !== undefined && hasOwn(data[key1], s)) {
1245
+ const err27 = validate.errors;
1246
+ const res27 = ref16(data[key1][s]);
1247
+ const suberr38 = ref16.errors;
1248
+ validate.errors = err27;
1249
+ if (!res27) {
1250
+ if (validate.errors === null)
1251
+ validate.errors = [];
1252
+ validate.errors.push(...suberr38.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/1/items/$ref", "#/" + pointerPart(key1) + "/" + s)));
1253
+ errorCount++;
1254
+ }
1255
+ }
1256
+ }
1257
+ }
1258
+ return errorCount === 0;
1259
+ })();
1260
+ if (!sub21) {
1261
+ const sub22 = (() => {
1262
+ let errorCount = 0;
1263
+ if (!(typeof data[key1] === "object" && data[key1] && !Array.isArray(data[key1]))) {
1264
+ if (suberr36 === null)
1265
+ suberr36 = [];
1266
+ suberr36.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/2/type", instanceLocation: "#/" + pointerPart(key1) });
1267
+ errorCount++;
1268
+ }
1269
+ else {
1270
+ if (Object.keys(data[key1]).length > 512) {
1271
+ if (suberr36 === null)
1272
+ suberr36 = [];
1273
+ suberr36.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/2/maxProperties", instanceLocation: "#/" + pointerPart(key1) });
1274
+ errorCount++;
1275
+ }
1276
+ if (Object.keys(data[key1]).length < 1) {
1277
+ if (suberr36 === null)
1278
+ suberr36 = [];
1279
+ suberr36.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/2/minProperties", instanceLocation: "#/" + pointerPart(key1) });
1280
+ errorCount++;
1281
+ }
1282
+ for (const key2 of Object.keys(data[key1])) {
1283
+ const err28 = validate.errors;
1284
+ const res28 = ref16(key2);
1285
+ const suberr39 = ref16.errors;
1286
+ validate.errors = err28;
1287
+ if (!res28) {
1288
+ if (validate.errors === null)
1289
+ validate.errors = [];
1290
+ validate.errors.push(...suberr39.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/2/propertyNames/$ref", "#/" + pointerPart(key1) + "/" + pointerPart(key2))));
1291
+ errorCount++;
1292
+ }
1293
+ }
1294
+ for (const key3 of Object.keys(data[key1])) {
1295
+ if (!(typeof data[key1][key3] === "number")) {
1296
+ if (suberr36 === null)
1297
+ suberr36 = [];
1298
+ suberr36.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/2/additionalProperties/type", instanceLocation: "#/" + pointerPart(key1) + "/" + pointerPart(key3) });
1299
+ errorCount++;
1300
+ }
1301
+ else {
1302
+ if (!(0 <= data[key1][key3])) {
1303
+ if (suberr36 === null)
1304
+ suberr36 = [];
1305
+ suberr36.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf/2/additionalProperties/minimum", instanceLocation: "#/" + pointerPart(key1) + "/" + pointerPart(key3) });
1306
+ errorCount++;
1307
+ }
1308
+ }
1309
+ }
1310
+ }
1311
+ return errorCount === 0;
1312
+ })();
1313
+ if (!sub22) {
1314
+ if (validate.errors === null)
1315
+ validate.errors = [];
1316
+ validate.errors.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Variant$/anyOf", instanceLocation: "#/" + pointerPart(key1) });
1317
+ if (suberr36)
1318
+ validate.errors.push(...suberr36);
1319
+ errorCount++;
1320
+ }
1321
+ }
1322
+ }
1323
+ }
1324
+ if (pattern4.test(key1)) {
1325
+ if (!(typeof data[key1] === "number")) {
1326
+ if (validate.errors === null)
1327
+ validate.errors = [];
1328
+ validate.errors.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Probability$/type", instanceLocation: "#/" + pointerPart(key1) });
1329
+ errorCount++;
1330
+ }
1331
+ else {
1332
+ if (!(0 <= data[key1])) {
1333
+ if (validate.errors === null)
1334
+ validate.errors = [];
1335
+ validate.errors.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Probability$/minimum", instanceLocation: "#/" + pointerPart(key1) });
1336
+ errorCount++;
1337
+ }
1338
+ if (!(100 >= data[key1])) {
1339
+ if (validate.errors === null)
1340
+ validate.errors = [];
1341
+ validate.errors.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Probability$/maximum", instanceLocation: "#/" + pointerPart(key1) });
1342
+ errorCount++;
1343
+ }
1344
+ }
1345
+ }
1346
+ if (pattern5.test(key1)) {
1347
+ let suberr40 = null;
1348
+ const sub23 = (() => {
1349
+ let errorCount = 0;
1350
+ const err29 = validate.errors;
1351
+ const res29 = ref17(data[key1]);
1352
+ const suberr41 = ref17.errors;
1353
+ validate.errors = err29;
1354
+ if (!res29) {
1355
+ if (validate.errors === null)
1356
+ validate.errors = [];
1357
+ validate.errors.push(...suberr41.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*Color$/anyOf/0/$ref", "#/" + pointerPart(key1))));
1358
+ errorCount++;
1359
+ }
1360
+ return errorCount === 0;
1361
+ })();
1362
+ if (!sub23) {
1363
+ const sub24 = (() => {
1364
+ let errorCount = 0;
1365
+ if (!(Array.isArray(data[key1]))) {
1366
+ if (suberr40 === null)
1367
+ suberr40 = [];
1368
+ suberr40.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Color$/anyOf/1/type", instanceLocation: "#/" + pointerPart(key1) });
1369
+ errorCount++;
1370
+ }
1371
+ else {
1372
+ if (data[key1].length > 128) {
1373
+ if (suberr40 === null)
1374
+ suberr40 = [];
1375
+ suberr40.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Color$/anyOf/1/maxItems", instanceLocation: "#/" + pointerPart(key1) });
1376
+ errorCount++;
1377
+ }
1378
+ if (data[key1].length < 0) {
1379
+ if (suberr40 === null)
1380
+ suberr40 = [];
1381
+ suberr40.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Color$/anyOf/1/minItems", instanceLocation: "#/" + pointerPart(key1) });
1382
+ errorCount++;
1383
+ }
1384
+ for (let t = 0; t < data[key1].length; t++) {
1385
+ if (data[key1][t] !== undefined && hasOwn(data[key1], t)) {
1386
+ const err30 = validate.errors;
1387
+ const res30 = ref17(data[key1][t]);
1388
+ const suberr42 = ref17.errors;
1389
+ validate.errors = err30;
1390
+ if (!res30) {
1391
+ if (validate.errors === null)
1392
+ validate.errors = [];
1393
+ validate.errors.push(...suberr42.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*Color$/anyOf/1/items/$ref", "#/" + pointerPart(key1) + "/" + t)));
1394
+ errorCount++;
1395
+ }
1396
+ }
1397
+ }
1398
+ }
1399
+ return errorCount === 0;
1400
+ })();
1401
+ if (!sub24) {
1402
+ if (validate.errors === null)
1403
+ validate.errors = [];
1404
+ validate.errors.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Color$/anyOf", instanceLocation: "#/" + pointerPart(key1) });
1405
+ if (suberr40)
1406
+ validate.errors.push(...suberr40);
1407
+ errorCount++;
1408
+ }
1409
+ }
1410
+ }
1411
+ if (pattern7.test(key1)) {
1412
+ let suberr43 = null;
1413
+ const sub25 = (() => {
1414
+ let errorCount = 0;
1415
+ const err31 = validate.errors;
1416
+ const res31 = ref18(data[key1]);
1417
+ const suberr44 = ref18.errors;
1418
+ validate.errors = err31;
1419
+ if (!res31) {
1420
+ if (validate.errors === null)
1421
+ validate.errors = [];
1422
+ validate.errors.push(...suberr44.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFill$/anyOf/0/$ref", "#/" + pointerPart(key1))));
1423
+ errorCount++;
1424
+ }
1425
+ return errorCount === 0;
1426
+ })();
1427
+ if (!sub25) {
1428
+ const sub26 = (() => {
1429
+ let errorCount = 0;
1430
+ if (!(Array.isArray(data[key1]))) {
1431
+ if (suberr43 === null)
1432
+ suberr43 = [];
1433
+ suberr43.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFill$/anyOf/1/type", instanceLocation: "#/" + pointerPart(key1) });
1434
+ errorCount++;
1435
+ }
1436
+ else {
1437
+ if (data[key1].length > 128) {
1438
+ if (suberr43 === null)
1439
+ suberr43 = [];
1440
+ suberr43.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFill$/anyOf/1/maxItems", instanceLocation: "#/" + pointerPart(key1) });
1441
+ errorCount++;
1442
+ }
1443
+ if (data[key1].length < 0) {
1444
+ if (suberr43 === null)
1445
+ suberr43 = [];
1446
+ suberr43.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFill$/anyOf/1/minItems", instanceLocation: "#/" + pointerPart(key1) });
1447
+ errorCount++;
1448
+ }
1449
+ for (let u = 0; u < data[key1].length; u++) {
1450
+ if (data[key1][u] !== undefined && hasOwn(data[key1], u)) {
1451
+ const err32 = validate.errors;
1452
+ const res32 = ref18(data[key1][u]);
1453
+ const suberr45 = ref18.errors;
1454
+ validate.errors = err32;
1455
+ if (!res32) {
1456
+ if (validate.errors === null)
1457
+ validate.errors = [];
1458
+ validate.errors.push(...suberr45.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFill$/anyOf/1/items/$ref", "#/" + pointerPart(key1) + "/" + u)));
1459
+ errorCount++;
1460
+ }
1461
+ }
1462
+ }
1463
+ }
1464
+ return errorCount === 0;
1465
+ })();
1466
+ if (!sub26) {
1467
+ if (validate.errors === null)
1468
+ validate.errors = [];
1469
+ validate.errors.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFill$/anyOf", instanceLocation: "#/" + pointerPart(key1) });
1470
+ if (suberr43)
1471
+ validate.errors.push(...suberr43);
1472
+ errorCount++;
1473
+ }
1474
+ }
1475
+ }
1476
+ if (pattern8.test(key1)) {
1477
+ let suberr46 = null;
1478
+ const sub27 = (() => {
1479
+ let errorCount = 0;
1480
+ const err33 = validate.errors;
1481
+ const res33 = ref19(data[key1]);
1482
+ const suberr47 = ref19.errors;
1483
+ validate.errors = err33;
1484
+ if (!res33) {
1485
+ if (validate.errors === null)
1486
+ validate.errors = [];
1487
+ validate.errors.push(...suberr47.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFillStops$/anyOf/0/$ref", "#/" + pointerPart(key1))));
1488
+ errorCount++;
1489
+ }
1490
+ return errorCount === 0;
1491
+ })();
1492
+ if (!sub27) {
1493
+ const sub28 = (() => {
1494
+ let errorCount = 0;
1495
+ if (!(Array.isArray(data[key1]))) {
1496
+ if (suberr46 === null)
1497
+ suberr46 = [];
1498
+ suberr46.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFillStops$/anyOf/1/type", instanceLocation: "#/" + pointerPart(key1) });
1499
+ errorCount++;
1500
+ }
1501
+ else {
1502
+ if (data[key1].length > 2) {
1503
+ if (suberr46 === null)
1504
+ suberr46 = [];
1505
+ suberr46.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFillStops$/anyOf/1/maxItems", instanceLocation: "#/" + pointerPart(key1) });
1506
+ errorCount++;
1507
+ }
1508
+ if (data[key1].length < 0) {
1509
+ if (suberr46 === null)
1510
+ suberr46 = [];
1511
+ suberr46.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFillStops$/anyOf/1/minItems", instanceLocation: "#/" + pointerPart(key1) });
1512
+ errorCount++;
1513
+ }
1514
+ for (let v = 0; v < data[key1].length; v++) {
1515
+ if (data[key1][v] !== undefined && hasOwn(data[key1], v)) {
1516
+ const err34 = validate.errors;
1517
+ const res34 = ref19(data[key1][v]);
1518
+ const suberr48 = ref19.errors;
1519
+ validate.errors = err34;
1520
+ if (!res34) {
1521
+ if (validate.errors === null)
1522
+ validate.errors = [];
1523
+ validate.errors.push(...suberr48.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFillStops$/anyOf/1/items/$ref", "#/" + pointerPart(key1) + "/" + v)));
1524
+ errorCount++;
1525
+ }
1526
+ }
1527
+ }
1528
+ }
1529
+ return errorCount === 0;
1530
+ })();
1531
+ if (!sub28) {
1532
+ if (validate.errors === null)
1533
+ validate.errors = [];
1534
+ validate.errors.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorFillStops$/anyOf", instanceLocation: "#/" + pointerPart(key1) });
1535
+ if (suberr46)
1536
+ validate.errors.push(...suberr46);
1537
+ errorCount++;
1538
+ }
1539
+ }
1540
+ }
1541
+ if (pattern9.test(key1)) {
1542
+ const err35 = validate.errors;
1543
+ const res35 = ref2(data[key1]);
1544
+ const suberr49 = ref2.errors;
1545
+ validate.errors = err35;
1546
+ if (!res35) {
1547
+ if (validate.errors === null)
1548
+ validate.errors = [];
1549
+ validate.errors.push(...suberr49.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorAngle$/allOf/0/$ref", "#/" + pointerPart(key1))));
1550
+ errorCount++;
1551
+ }
1552
+ }
1553
+ if (pattern10.test(key1)) {
1554
+ if (!(typeof data[key1] === "string")) {
1555
+ if (validate.errors === null)
1556
+ validate.errors = [];
1557
+ validate.errors.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorOrder$/type", instanceLocation: "#/" + pointerPart(key1) });
1558
+ errorCount++;
1559
+ }
1560
+ else {
1561
+ if (!(data[key1] === "random" || data[key1] === "fixed")) {
1562
+ if (validate.errors === null)
1563
+ validate.errors = [];
1564
+ validate.errors.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*ColorOrder$/enum", instanceLocation: "#/" + pointerPart(key1) });
1565
+ errorCount++;
1566
+ }
1567
+ }
1568
+ }
1569
+ if (pattern11.test(key1)) {
1570
+ if (!(typeof data[key1] === "boolean")) {
1571
+ if (validate.errors === null)
1572
+ validate.errors = [];
1573
+ validate.errors.push({ keywordLocation: "#/patternProperties/^[a-z][a-zA-Z0-9]*Animation$/type", instanceLocation: "#/" + pointerPart(key1) });
1574
+ errorCount++;
1575
+ }
1576
+ }
1577
+ if (pattern12.test(key1)) {
1578
+ const err36 = validate.errors;
1579
+ const res36 = ref12(data[key1]);
1580
+ const suberr50 = ref12.errors;
1581
+ validate.errors = err36;
1582
+ if (!res36) {
1583
+ if (validate.errors === null)
1584
+ validate.errors = [];
1585
+ validate.errors.push(...suberr50.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*AnimationSpeed$/allOf/0/$ref", "#/" + pointerPart(key1))));
1586
+ errorCount++;
1587
+ }
1588
+ }
1589
+ if (pattern13.test(key1)) {
1590
+ const err37 = validate.errors;
1591
+ const res37 = ref14(data[key1]);
1592
+ const suberr51 = ref14.errors;
1593
+ validate.errors = err37;
1594
+ if (!res37) {
1595
+ if (validate.errors === null)
1596
+ validate.errors = [];
1597
+ validate.errors.push(...suberr51.map(e => errorMerge(e, "#/patternProperties/^[a-z][a-zA-Z0-9]*AnimationDelay$/allOf/0/$ref", "#/" + pointerPart(key1))));
1598
+ errorCount++;
1599
+ }
1600
+ }
1601
+ }
1602
+ for (const key4 of Object.keys(data)) {
1603
+ if (key4 !== "seed" && key4 !== "size" && key4 !== "idRandomization" && key4 !== "title" && key4 !== "flip" && key4 !== "rotate" && key4 !== "scale" && key4 !== "translateX" && key4 !== "translateY" && key4 !== "borderRadius" && key4 !== "fontFamily" && key4 !== "fontWeight" && key4 !== "tags" && key4 !== "animation" && key4 !== "animationSpeed" && key4 !== "animationDelay" && key4 !== "animationRespectReducedMotion" && !pattern2.test(key4) && !pattern4.test(key4) && !pattern5.test(key4) && !pattern7.test(key4) && !pattern8.test(key4) && !pattern9.test(key4) && !pattern10.test(key4) && !pattern11.test(key4) && !pattern12.test(key4) && !pattern13.test(key4)) {
1604
+ if (validate.errors === null)
1605
+ validate.errors = [];
1606
+ validate.errors.push({ keywordLocation: "#/additionalProperties", instanceLocation: "#/" + pointerPart(key4) });
1607
+ errorCount++;
1608
+ }
1609
+ }
1610
+ }
1611
+ }
1612
+ return errorCount === 0;
1613
+ };
1614
+ return ref0;
1615
+ })();
1616
+ // schemasafe reports errors as JSON pointers only (instanceLocation into the
1617
+ // data, keywordLocation into the schema) without prose. Derive a short message
1618
+ // from the failing keyword; the detail keeps keywordLocation as schemaPath for
1619
+ // anyone who needs the exact schema rule.
1620
+ const KEYWORD_MESSAGES = {
1621
+ type: 'has an invalid type',
1622
+ enum: 'must be one of the allowed values',
1623
+ const: 'must equal the expected value',
1624
+ pattern: 'does not match the required pattern',
1625
+ required: 'is required but missing',
1626
+ additionalProperties: 'has an unexpected property',
1627
+ propertyNames: 'has an invalid property name',
1628
+ minimum: 'is smaller than allowed',
1629
+ maximum: 'is larger than allowed',
1630
+ exclusiveMinimum: 'is smaller than allowed',
1631
+ exclusiveMaximum: 'is larger than allowed',
1632
+ minLength: 'is too short',
1633
+ maxLength: 'is too long',
1634
+ minItems: 'has too few items',
1635
+ maxItems: 'has too many items',
1636
+ uniqueItems: 'has duplicate items',
1637
+ minProperties: 'has too few properties',
1638
+ maxProperties: 'has too many properties',
1639
+ anyOf: 'does not match any allowed variant',
1640
+ oneOf: 'does not match exactly one allowed variant',
1641
+ allOf: 'does not match all required schemas',
1642
+ not: 'matches a disallowed schema',
1643
+ };
1644
+ function toDetail(error) {
1645
+ const keyword = error.keywordLocation.slice(error.keywordLocation.lastIndexOf('/') + 1);
1646
+ return {
1647
+ instancePath: error.instanceLocation.slice(1),
1648
+ schemaPath: error.keywordLocation,
1649
+ keyword,
1650
+ message: KEYWORD_MESSAGES[keyword] ?? `must satisfy '${keyword}'`,
1651
+ };
1652
+ }
1653
+ export class OptionsSchemaValidator {
1654
+ static validate(data) {
1655
+ if (!validate(data)) {
1656
+ throw new OptionsValidationError((validate.errors ?? []).map(toDetail));
1657
+ }
1658
+ }
1659
+ }