@hyperjump/json-schema 0.18.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 (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +176 -0
  3. package/dist/json-schema-amd.js +4710 -0
  4. package/dist/json-schema-amd.js.map +1 -0
  5. package/dist/json-schema-amd.min.js +2 -0
  6. package/dist/json-schema-amd.min.js.map +1 -0
  7. package/dist/json-schema-cjs.js +4708 -0
  8. package/dist/json-schema-cjs.js.map +1 -0
  9. package/dist/json-schema-cjs.min.js +2 -0
  10. package/dist/json-schema-cjs.min.js.map +1 -0
  11. package/dist/json-schema-esm.js +4691 -0
  12. package/dist/json-schema-esm.js.map +1 -0
  13. package/dist/json-schema-esm.min.js +2 -0
  14. package/dist/json-schema-esm.min.js.map +1 -0
  15. package/dist/json-schema-iife.js +4713 -0
  16. package/dist/json-schema-iife.js.map +1 -0
  17. package/dist/json-schema-iife.min.js +2 -0
  18. package/dist/json-schema-iife.min.js.map +1 -0
  19. package/dist/json-schema-system.js +4698 -0
  20. package/dist/json-schema-system.js.map +1 -0
  21. package/dist/json-schema-system.min.js +2 -0
  22. package/dist/json-schema-system.min.js.map +1 -0
  23. package/dist/json-schema-umd.js +4714 -0
  24. package/dist/json-schema-umd.js.map +1 -0
  25. package/dist/json-schema-umd.min.js +2 -0
  26. package/dist/json-schema-umd.min.js.map +1 -0
  27. package/lib/common.js +13 -0
  28. package/lib/draft-04.d.ts +40 -0
  29. package/lib/draft-04.js +94 -0
  30. package/lib/draft-06.d.ts +44 -0
  31. package/lib/draft-06.js +51 -0
  32. package/lib/draft-07.d.ts +52 -0
  33. package/lib/draft-07.js +55 -0
  34. package/lib/draft-2019-09.d.ts +62 -0
  35. package/lib/draft-2019-09.js +92 -0
  36. package/lib/draft-2020-12.d.ts +62 -0
  37. package/lib/draft-2020-12.js +103 -0
  38. package/lib/index.d.ts +28 -0
  39. package/lib/index.js +26 -0
  40. package/lib/index.mjs +18 -0
  41. package/lib/keywords/additionalItems.js +27 -0
  42. package/lib/keywords/additionalItems6.js +23 -0
  43. package/lib/keywords/additionalProperties.js +33 -0
  44. package/lib/keywords/additionalProperties6.js +28 -0
  45. package/lib/keywords/allOf.js +28 -0
  46. package/lib/keywords/anyOf.js +29 -0
  47. package/lib/keywords/const.js +8 -0
  48. package/lib/keywords/contains-minContains-maxContains.js +33 -0
  49. package/lib/keywords/contains.js +10 -0
  50. package/lib/keywords/definitions.js +15 -0
  51. package/lib/keywords/dependencies.js +29 -0
  52. package/lib/keywords/dependentRequired.js +19 -0
  53. package/lib/keywords/dependentSchemas.js +30 -0
  54. package/lib/keywords/dynamicRef.js +24 -0
  55. package/lib/keywords/else.js +43 -0
  56. package/lib/keywords/enum.js +8 -0
  57. package/lib/keywords/exclusiveMaximum.js +7 -0
  58. package/lib/keywords/exclusiveMinimum.js +7 -0
  59. package/lib/keywords/if.js +19 -0
  60. package/lib/keywords/index.js +55 -0
  61. package/lib/keywords/items.js +31 -0
  62. package/lib/keywords/items202012.js +23 -0
  63. package/lib/keywords/maxItems.js +7 -0
  64. package/lib/keywords/maxLength.js +7 -0
  65. package/lib/keywords/maxLength6.js +7 -0
  66. package/lib/keywords/maxProperties.js +7 -0
  67. package/lib/keywords/maximum-exclusiveMaximum.js +20 -0
  68. package/lib/keywords/maximum.js +7 -0
  69. package/lib/keywords/minItems.js +7 -0
  70. package/lib/keywords/minLength.js +7 -0
  71. package/lib/keywords/minLength6.js +7 -0
  72. package/lib/keywords/minProperties.js +7 -0
  73. package/lib/keywords/minimum-exclusiveMinimum.js +20 -0
  74. package/lib/keywords/minimum.js +7 -0
  75. package/lib/keywords/multipleOf.js +17 -0
  76. package/lib/keywords/not.js +7 -0
  77. package/lib/keywords/oneOf.js +48 -0
  78. package/lib/keywords/pattern.js +7 -0
  79. package/lib/keywords/patternProperties.js +23 -0
  80. package/lib/keywords/properties.js +25 -0
  81. package/lib/keywords/propertyNames.js +11 -0
  82. package/lib/keywords/ref.js +13 -0
  83. package/lib/keywords/required.js +10 -0
  84. package/lib/keywords/then.js +43 -0
  85. package/lib/keywords/tupleItems.js +24 -0
  86. package/lib/keywords/type.js +7 -0
  87. package/lib/keywords/unevaluatedItems.js +23 -0
  88. package/lib/keywords/unevaluatedProperties.js +24 -0
  89. package/lib/keywords/uniqueItems.js +16 -0
  90. package/meta/draft/2019-09/meta/applicator.js +55 -0
  91. package/meta/draft/2019-09/meta/content.js +17 -0
  92. package/meta/draft/2019-09/meta/core.js +57 -0
  93. package/meta/draft/2019-09/meta/format.js +14 -0
  94. package/meta/draft/2019-09/meta/meta-data.js +37 -0
  95. package/meta/draft/2019-09/meta/validation.js +98 -0
  96. package/meta/draft/2019-09/schema.js +42 -0
  97. package/meta/draft/2020-12/meta/applicator.js +49 -0
  98. package/meta/draft/2020-12/meta/content.js +17 -0
  99. package/meta/draft/2020-12/meta/core.js +57 -0
  100. package/meta/draft/2020-12/meta/format-annotation.js +14 -0
  101. package/meta/draft/2020-12/meta/format-assertion.js +14 -0
  102. package/meta/draft/2020-12/meta/meta-data.js +37 -0
  103. package/meta/draft/2020-12/meta/unevaluated.js +15 -0
  104. package/meta/draft/2020-12/meta/validation.js +98 -0
  105. package/meta/draft/2020-12/schema.js +44 -0
  106. package/meta/draft-04/hyper-schema.js +136 -0
  107. package/meta/draft-04/schema.js +149 -0
  108. package/meta/draft-06/schema.js +154 -0
  109. package/meta/draft-07/schema.js +172 -0
  110. package/package.json +57 -0
@@ -0,0 +1,4708 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var justCurryIt = curry;
6
+
7
+ /*
8
+ function add(a, b, c) {
9
+ return a + b + c;
10
+ }
11
+ curry(add)(1)(2)(3); // 6
12
+ curry(add)(1)(2)(2); // 5
13
+ curry(add)(2)(4, 3); // 9
14
+
15
+ function add(...args) {
16
+ return args.reduce((sum, n) => sum + n, 0)
17
+ }
18
+ var curryAdd4 = curry(add, 4)
19
+ curryAdd4(1)(2, 3)(4); // 10
20
+
21
+ function converter(ratio, input) {
22
+ return (input*ratio).toFixed(1);
23
+ }
24
+ const curriedConverter = curry(converter)
25
+ const milesToKm = curriedConverter(1.62);
26
+ milesToKm(35); // 56.7
27
+ milesToKm(10); // 16.2
28
+ */
29
+
30
+ function curry(fn, arity) {
31
+ return function curried() {
32
+ if (arity == null) {
33
+ arity = fn.length;
34
+ }
35
+ var args = [].slice.call(arguments);
36
+ if (args.length >= arity) {
37
+ return fn.apply(this, args);
38
+ } else {
39
+ return function() {
40
+ return curried.apply(this, args.concat([].slice.call(arguments)));
41
+ };
42
+ }
43
+ };
44
+ }
45
+
46
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
47
+
48
+ function createCommonjsModule(fn, module) {
49
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
50
+ }
51
+
52
+ var pubsub = createCommonjsModule(function (module, exports) {
53
+ /**
54
+ * Copyright (c) 2010,2011,2012,2013,2014 Morgan Roderick http://roderick.dk
55
+ * License: MIT - http://mrgnrdrck.mit-license.org
56
+ *
57
+ * https://github.com/mroderick/PubSubJS
58
+ */
59
+
60
+ (function (root, factory){
61
+
62
+ var PubSub = {};
63
+ root.PubSub = PubSub;
64
+ factory(PubSub);
65
+ // CommonJS and Node.js module support
66
+ {
67
+ if (module !== undefined && module.exports) {
68
+ exports = module.exports = PubSub; // Node.js specific `module.exports`
69
+ }
70
+ exports.PubSub = PubSub; // CommonJS module 1.1.1 spec
71
+ module.exports = exports = PubSub; // CommonJS
72
+ }
73
+
74
+ }(( typeof window === 'object' && window ) || commonjsGlobal, function (PubSub){
75
+
76
+ var messages = {},
77
+ lastUid = -1,
78
+ ALL_SUBSCRIBING_MSG = '*';
79
+
80
+ function hasKeys(obj){
81
+ var key;
82
+
83
+ for (key in obj){
84
+ if ( Object.prototype.hasOwnProperty.call(obj, key) ){
85
+ return true;
86
+ }
87
+ }
88
+ return false;
89
+ }
90
+
91
+ /**
92
+ * Returns a function that throws the passed exception, for use as argument for setTimeout
93
+ * @alias throwException
94
+ * @function
95
+ * @param { Object } ex An Error object
96
+ */
97
+ function throwException( ex ){
98
+ return function reThrowException(){
99
+ throw ex;
100
+ };
101
+ }
102
+
103
+ function callSubscriberWithDelayedExceptions( subscriber, message, data ){
104
+ try {
105
+ subscriber( message, data );
106
+ } catch( ex ){
107
+ setTimeout( throwException( ex ), 0);
108
+ }
109
+ }
110
+
111
+ function callSubscriberWithImmediateExceptions( subscriber, message, data ){
112
+ subscriber( message, data );
113
+ }
114
+
115
+ function deliverMessage( originalMessage, matchedMessage, data, immediateExceptions ){
116
+ var subscribers = messages[matchedMessage],
117
+ callSubscriber = immediateExceptions ? callSubscriberWithImmediateExceptions : callSubscriberWithDelayedExceptions,
118
+ s;
119
+
120
+ if ( !Object.prototype.hasOwnProperty.call( messages, matchedMessage ) ) {
121
+ return;
122
+ }
123
+
124
+ for (s in subscribers){
125
+ if ( Object.prototype.hasOwnProperty.call(subscribers, s)){
126
+ callSubscriber( subscribers[s], originalMessage, data );
127
+ }
128
+ }
129
+ }
130
+
131
+ function createDeliveryFunction( message, data, immediateExceptions ){
132
+ return function deliverNamespaced(){
133
+ var topic = String( message ),
134
+ position = topic.lastIndexOf( '.' );
135
+
136
+ // deliver the message as it is now
137
+ deliverMessage(message, message, data, immediateExceptions);
138
+
139
+ // trim the hierarchy and deliver message to each level
140
+ while( position !== -1 ){
141
+ topic = topic.substr( 0, position );
142
+ position = topic.lastIndexOf('.');
143
+ deliverMessage( message, topic, data, immediateExceptions );
144
+ }
145
+
146
+ deliverMessage(message, ALL_SUBSCRIBING_MSG, data, immediateExceptions);
147
+ };
148
+ }
149
+
150
+ function hasDirectSubscribersFor( message ) {
151
+ var topic = String( message ),
152
+ found = Boolean(Object.prototype.hasOwnProperty.call( messages, topic ) && hasKeys(messages[topic]));
153
+
154
+ return found;
155
+ }
156
+
157
+ function messageHasSubscribers( message ){
158
+ var topic = String( message ),
159
+ found = hasDirectSubscribersFor(topic) || hasDirectSubscribersFor(ALL_SUBSCRIBING_MSG),
160
+ position = topic.lastIndexOf( '.' );
161
+
162
+ while ( !found && position !== -1 ){
163
+ topic = topic.substr( 0, position );
164
+ position = topic.lastIndexOf( '.' );
165
+ found = hasDirectSubscribersFor(topic);
166
+ }
167
+
168
+ return found;
169
+ }
170
+
171
+ function publish( message, data, sync, immediateExceptions ){
172
+ message = (typeof message === 'symbol') ? message.toString() : message;
173
+
174
+ var deliver = createDeliveryFunction( message, data, immediateExceptions ),
175
+ hasSubscribers = messageHasSubscribers( message );
176
+
177
+ if ( !hasSubscribers ){
178
+ return false;
179
+ }
180
+
181
+ if ( sync === true ){
182
+ deliver();
183
+ } else {
184
+ setTimeout( deliver, 0 );
185
+ }
186
+ return true;
187
+ }
188
+
189
+ /**
190
+ * Publishes the message, passing the data to it's subscribers
191
+ * @function
192
+ * @alias publish
193
+ * @param { String } message The message to publish
194
+ * @param {} data The data to pass to subscribers
195
+ * @return { Boolean }
196
+ */
197
+ PubSub.publish = function( message, data ){
198
+ return publish( message, data, false, PubSub.immediateExceptions );
199
+ };
200
+
201
+ /**
202
+ * Publishes the message synchronously, passing the data to it's subscribers
203
+ * @function
204
+ * @alias publishSync
205
+ * @param { String } message The message to publish
206
+ * @param {} data The data to pass to subscribers
207
+ * @return { Boolean }
208
+ */
209
+ PubSub.publishSync = function( message, data ){
210
+ return publish( message, data, true, PubSub.immediateExceptions );
211
+ };
212
+
213
+ /**
214
+ * Subscribes the passed function to the passed message. Every returned token is unique and should be stored if you need to unsubscribe
215
+ * @function
216
+ * @alias subscribe
217
+ * @param { String } message The message to subscribe to
218
+ * @param { Function } func The function to call when a new message is published
219
+ * @return { String }
220
+ */
221
+ PubSub.subscribe = function( message, func ){
222
+ if ( typeof func !== 'function'){
223
+ return false;
224
+ }
225
+
226
+ message = (typeof message === 'symbol') ? message.toString() : message;
227
+
228
+ // message is not registered yet
229
+ if ( !Object.prototype.hasOwnProperty.call( messages, message ) ){
230
+ messages[message] = {};
231
+ }
232
+
233
+ // forcing token as String, to allow for future expansions without breaking usage
234
+ // and allow for easy use as key names for the 'messages' object
235
+ var token = 'uid_' + String(++lastUid);
236
+ messages[message][token] = func;
237
+
238
+ // return token for unsubscribing
239
+ return token;
240
+ };
241
+
242
+ PubSub.subscribeAll = function( func ){
243
+ return PubSub.subscribe(ALL_SUBSCRIBING_MSG, func);
244
+ };
245
+
246
+ /**
247
+ * Subscribes the passed function to the passed message once
248
+ * @function
249
+ * @alias subscribeOnce
250
+ * @param { String } message The message to subscribe to
251
+ * @param { Function } func The function to call when a new message is published
252
+ * @return { PubSub }
253
+ */
254
+ PubSub.subscribeOnce = function( message, func ){
255
+ var token = PubSub.subscribe( message, function(){
256
+ // before func apply, unsubscribe message
257
+ PubSub.unsubscribe( token );
258
+ func.apply( this, arguments );
259
+ });
260
+ return PubSub;
261
+ };
262
+
263
+ /**
264
+ * Clears all subscriptions
265
+ * @function
266
+ * @public
267
+ * @alias clearAllSubscriptions
268
+ */
269
+ PubSub.clearAllSubscriptions = function clearAllSubscriptions(){
270
+ messages = {};
271
+ };
272
+
273
+ /**
274
+ * Clear subscriptions by the topic
275
+ * @function
276
+ * @public
277
+ * @alias clearAllSubscriptions
278
+ * @return { int }
279
+ */
280
+ PubSub.clearSubscriptions = function clearSubscriptions(topic){
281
+ var m;
282
+ for (m in messages){
283
+ if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){
284
+ delete messages[m];
285
+ }
286
+ }
287
+ };
288
+
289
+ /**
290
+ Count subscriptions by the topic
291
+ * @function
292
+ * @public
293
+ * @alias countSubscriptions
294
+ * @return { Array }
295
+ */
296
+ PubSub.countSubscriptions = function countSubscriptions(topic){
297
+ var m;
298
+ // eslint-disable-next-line no-unused-vars
299
+ var token;
300
+ var count = 0;
301
+ for (m in messages) {
302
+ if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0) {
303
+ for (token in messages[m]) {
304
+ count++;
305
+ }
306
+ break;
307
+ }
308
+ }
309
+ return count;
310
+ };
311
+
312
+
313
+ /**
314
+ Gets subscriptions by the topic
315
+ * @function
316
+ * @public
317
+ * @alias getSubscriptions
318
+ */
319
+ PubSub.getSubscriptions = function getSubscriptions(topic){
320
+ var m;
321
+ var list = [];
322
+ for (m in messages){
323
+ if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){
324
+ list.push(m);
325
+ }
326
+ }
327
+ return list;
328
+ };
329
+
330
+ /**
331
+ * Removes subscriptions
332
+ *
333
+ * - When passed a token, removes a specific subscription.
334
+ *
335
+ * - When passed a function, removes all subscriptions for that function
336
+ *
337
+ * - When passed a topic, removes all subscriptions for that topic (hierarchy)
338
+ * @function
339
+ * @public
340
+ * @alias subscribeOnce
341
+ * @param { String | Function } value A token, function or topic to unsubscribe from
342
+ * @example // Unsubscribing with a token
343
+ * var token = PubSub.subscribe('mytopic', myFunc);
344
+ * PubSub.unsubscribe(token);
345
+ * @example // Unsubscribing with a function
346
+ * PubSub.unsubscribe(myFunc);
347
+ * @example // Unsubscribing from a topic
348
+ * PubSub.unsubscribe('mytopic');
349
+ */
350
+ PubSub.unsubscribe = function(value){
351
+ var descendantTopicExists = function(topic) {
352
+ var m;
353
+ for ( m in messages ){
354
+ if ( Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0 ){
355
+ // a descendant of the topic exists:
356
+ return true;
357
+ }
358
+ }
359
+
360
+ return false;
361
+ },
362
+ isTopic = typeof value === 'string' && ( Object.prototype.hasOwnProperty.call(messages, value) || descendantTopicExists(value) ),
363
+ isToken = !isTopic && typeof value === 'string',
364
+ isFunction = typeof value === 'function',
365
+ result = false,
366
+ m, message, t;
367
+
368
+ if (isTopic){
369
+ PubSub.clearSubscriptions(value);
370
+ return;
371
+ }
372
+
373
+ for ( m in messages ){
374
+ if ( Object.prototype.hasOwnProperty.call( messages, m ) ){
375
+ message = messages[m];
376
+
377
+ if ( isToken && message[value] ){
378
+ delete message[value];
379
+ result = value;
380
+ // tokens are unique, so we can just stop here
381
+ break;
382
+ }
383
+
384
+ if (isFunction) {
385
+ for ( t in message ){
386
+ if (Object.prototype.hasOwnProperty.call(message, t) && message[t] === value){
387
+ delete message[t];
388
+ result = true;
389
+ }
390
+ }
391
+ }
392
+ }
393
+ }
394
+
395
+ return result;
396
+ };
397
+ }));
398
+ });
399
+ pubsub.PubSub;
400
+
401
+ var urlResolveBrowser = urlResolve;
402
+
403
+ /*
404
+ The majority of the module is built by following RFC1808
405
+ url: https://tools.ietf.org/html/rfc1808
406
+ */
407
+
408
+ // adds a slash at end if not present
409
+ function _addSlash (url) {
410
+ return url + (url[url.length-1] === '/' ? '' : '/');
411
+ }
412
+
413
+ // resolve the ..'s (directory up) and such
414
+ function _pathResolve (path) {
415
+ let pathSplit = path.split('/');
416
+
417
+ // happens when path starts with /
418
+ if (pathSplit[0] === '') {
419
+ pathSplit = pathSplit.slice(1);
420
+ }
421
+
422
+ // let segmentCount = 0; // number of segments that have been passed
423
+ let resultArray = [];
424
+ pathSplit.forEach((current, index) => {
425
+ // skip occurances of '.'
426
+ if (current !== '.') {
427
+ if (current === '..') {
428
+ resultArray.pop(); // remove previous
429
+ } else if (current !== '' || index === pathSplit.length - 1) {
430
+ resultArray.push(current);
431
+ }
432
+ }
433
+ });
434
+ return '/' + resultArray.join('/');
435
+ }
436
+
437
+ // parses a base url string into an object containing host, path and query
438
+ function _baseParse (base) {
439
+ const resultObject = {
440
+ host: '',
441
+ path: '',
442
+ query: '',
443
+ protocol: ''
444
+ };
445
+
446
+ let path = base;
447
+ let protocolEndIndex = base.indexOf('//');
448
+
449
+ resultObject.protocol = path.substring(0, protocolEndIndex);
450
+
451
+ protocolEndIndex += 2; // add two to pass double slash
452
+
453
+ const pathIndex = base.indexOf('/', protocolEndIndex);
454
+ const queryIndex = base.indexOf('?');
455
+ const hashIndex = base.indexOf('#');
456
+
457
+ if (hashIndex !== -1) {
458
+ path = path.substring(0, hashIndex); // remove hash, not needed for base
459
+ }
460
+
461
+ if (queryIndex !== -1) {
462
+ const query = path.substring(queryIndex); // remove query, save in return obj
463
+ resultObject.query = query;
464
+ path = path.substring(0, queryIndex);
465
+ }
466
+
467
+ if (pathIndex !== -1) {
468
+ const host = path.substring(0, pathIndex); // separate host & path
469
+ resultObject.host = host;
470
+ path = path.substring(pathIndex);
471
+ resultObject.path = path;
472
+ } else {
473
+ resultObject.host = path; // there was no path, therefore path is host
474
+ }
475
+
476
+ return resultObject;
477
+ }
478
+
479
+ // https://tools.ietf.org/html/rfc3986#section-3.1
480
+ const _scheme = '[a-z][a-z0-9+.-]*'; // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )]
481
+ const _isAbsolute = new RegExp(`^(${_scheme}:)?//`, 'i');
482
+
483
+ // parses a relative url string into an object containing the href,
484
+ // hash, query and whether it is a net path, absolute path or relative path
485
+ function _relativeParse (relative) {
486
+ const resultObject = {
487
+ href: relative, // href is always what was passed through
488
+ hash: '',
489
+ query: '',
490
+ netPath: false,
491
+ absolutePath: false,
492
+ relativePath: false
493
+ };
494
+ // check for protocol
495
+ // if protocol exists, is net path (absolute URL)
496
+ if (_isAbsolute.test(relative)) {
497
+ resultObject.netPath = true;
498
+ // return, in this case the relative is the resolved url, no need to parse.
499
+ return resultObject;
500
+ }
501
+
502
+ // if / is first, this is an absolute path,
503
+ // I.E. it overwrites the base URL's path
504
+ if (relative[0] === '/') {
505
+ resultObject.absolutePath = true;
506
+ // return resultObject
507
+ } else if (relative !== '') {
508
+ resultObject.relativePath = true;
509
+ }
510
+
511
+ let path = relative;
512
+ const queryIndex = relative.indexOf('?');
513
+ const hashIndex = relative.indexOf('#');
514
+
515
+ if (hashIndex !== -1) {
516
+ const hash = path.substring(hashIndex);
517
+ resultObject.hash = hash;
518
+ path = path.substring(0, hashIndex);
519
+ }
520
+
521
+ if (queryIndex !== -1) {
522
+ const query = path.substring(queryIndex);
523
+ resultObject.query = query;
524
+ path = path.substring(0, queryIndex);
525
+ }
526
+
527
+ resultObject.path = path; // whatever is left is path
528
+ return resultObject;
529
+ }
530
+
531
+ function _shouldAddSlash (url) {
532
+ const protocolIndex = url.indexOf('//') + 2;
533
+ const noPath = !(url.includes('/', protocolIndex));
534
+ const noQuery = !(url.includes('?', protocolIndex));
535
+ const noHash = !(url.includes('#', protocolIndex));
536
+ return (noPath && noQuery && noHash);
537
+ }
538
+
539
+ function _shouldAddProtocol (url) {
540
+ return url.startsWith('//');
541
+ }
542
+
543
+ /*
544
+ * PRECONDITION: Base is a fully qualified URL. e.g. http://example.com/
545
+ * optional: path, query or hash
546
+ * returns the resolved url
547
+ */
548
+ function urlResolve (base, relative) {
549
+ base = base.trim();
550
+ relative = relative.trim();
551
+
552
+ // about is always absolute
553
+ if (relative.startsWith('about:')) {
554
+ return relative;
555
+ }
556
+
557
+ const baseObj = _baseParse(base);
558
+ const relativeObj = _relativeParse(relative);
559
+
560
+ if (!baseObj.protocol && !relativeObj.netPath) {
561
+ throw new Error('Error, protocol is not specified');
562
+ }
563
+
564
+ if (relativeObj.netPath) { // relative is full qualified URL
565
+ if (_shouldAddProtocol(relativeObj.href)) {
566
+ relativeObj.href = baseObj.protocol + relativeObj.href;
567
+ }
568
+
569
+ if (_shouldAddSlash(relativeObj.href)) {
570
+ return _addSlash(relativeObj.href);
571
+ }
572
+
573
+ return relativeObj.href;
574
+ } else if (relativeObj.absolutePath) { // relative is an absolute path
575
+ const {path, query, hash} = relativeObj;
576
+
577
+ return baseObj.host + _pathResolve(path) + query + hash;
578
+ } else if (relativeObj.relativePath) { // relative is a relative path
579
+ const {path, query, hash} = relativeObj;
580
+
581
+ let basePath = baseObj.path;
582
+ let resultString = baseObj.host;
583
+
584
+ let resolvePath;
585
+
586
+ if (path.length === 0) {
587
+ resolvePath = basePath;
588
+ } else {
589
+ // remove last segment if no slash at end
590
+ basePath = basePath.substring(0, basePath.lastIndexOf('/'));
591
+ resolvePath = _pathResolve(basePath + '/' + path);
592
+ }
593
+
594
+ // if result is just the base host, add /
595
+ if ((resolvePath === '') && (!query) && (!hash)) {
596
+ resultString += '/';
597
+ } else {
598
+ resultString += resolvePath + query + hash;
599
+ }
600
+
601
+ return resultString;
602
+ } else {
603
+ const {host, path, query} = baseObj;
604
+ // when path and query aren't supplied add slash
605
+ if ((!path) && (!query)) {
606
+ return _addSlash(host);
607
+ }
608
+ return host + path + query + relativeObj.hash;
609
+ }
610
+ }
611
+
612
+ const isObject$1 = (value) => typeof value === "object" && !Array.isArray(value) && value !== null;
613
+ const isType = {
614
+ null: (value) => value === null,
615
+ boolean: (value) => typeof value === "boolean",
616
+ object: isObject$1,
617
+ array: (value) => Array.isArray(value),
618
+ number: (value) => typeof value === "number",
619
+ integer: (value) => Number.isInteger(value),
620
+ string: (value) => typeof value === "string"
621
+ };
622
+ const jsonTypeOf$2 = (value, type) => isType[type](value);
623
+
624
+ const splitUrl$4 = (url) => {
625
+ const indexOfHash = url.indexOf("#");
626
+ const ndx = indexOfHash === -1 ? url.length : indexOfHash;
627
+ const urlReference = url.slice(0, ndx);
628
+ const urlFragment = url.slice(ndx + 1);
629
+
630
+ return [decodeURI(urlReference), decodeURI(urlFragment)];
631
+ };
632
+
633
+ const getScheme = (url) => {
634
+ const matches = RegExp(/^(.+):\/\//).exec(url);
635
+ return matches ? matches[1] : "";
636
+ };
637
+
638
+ const safeResolveUrl$1 = (contextUrl, url) => {
639
+ const resolvedUrl = urlResolveBrowser(contextUrl, url);
640
+ const contextId = splitUrl$4(contextUrl)[0];
641
+ if (contextId && getScheme(resolvedUrl) === "file" && getScheme(contextId) !== "file") {
642
+ throw Error(`Can't access file '${resolvedUrl}' resource from network context '${contextUrl}'`);
643
+ }
644
+ return resolvedUrl;
645
+ };
646
+
647
+ var common$1 = { jsonTypeOf: jsonTypeOf$2, splitUrl: splitUrl$4, safeResolveUrl: safeResolveUrl$1 };
648
+
649
+ const nil$2 = "";
650
+
651
+ const compile$P = (pointer) => {
652
+ if (pointer.length > 0 && pointer[0] !== "/") {
653
+ throw Error("Invalid JSON Pointer");
654
+ }
655
+
656
+ return pointer.split("/").slice(1).map(unescape);
657
+ };
658
+
659
+ const get$1 = (pointer, value = undefined) => {
660
+ const ptr = compile$P(pointer);
661
+
662
+ const fn = (value) => ptr.reduce(([value, pointer], segment) => {
663
+ return [applySegment(value, segment, pointer), append(segment, pointer)];
664
+ }, [value, ""])[0];
665
+
666
+ return value === undefined ? fn : fn(value);
667
+ };
668
+
669
+ const set = (pointer, subject = undefined, value = undefined) => {
670
+ const ptr = compile$P(pointer);
671
+ const fn = justCurryIt((subject, value) => _set(ptr, subject, value, nil$2));
672
+ return subject === undefined ? fn : fn(subject, value);
673
+ };
674
+
675
+ const _set = (pointer, subject, value, cursor) => {
676
+ if (pointer.length === 0) {
677
+ return value;
678
+ } else if (pointer.length > 1) {
679
+ const segment = pointer.shift();
680
+ return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
681
+ } else if (Array.isArray(subject)) {
682
+ const clonedSubject = [...subject];
683
+ const segment = computeSegment(subject, pointer[0]);
684
+ clonedSubject[segment] = value;
685
+ return clonedSubject;
686
+ } else if (typeof subject === "object" && subject !== null) {
687
+ return { ...subject, [pointer[0]]: value };
688
+ } else {
689
+ return applySegment(subject, pointer[0], cursor);
690
+ }
691
+ };
692
+
693
+ const assign = (pointer, subject = undefined, value = undefined) => {
694
+ const ptr = compile$P(pointer);
695
+ const fn = justCurryIt((subject, value) => _assign(ptr, subject, value, nil$2));
696
+ return subject === undefined ? fn : fn(subject, value);
697
+ };
698
+
699
+ const _assign = (pointer, subject, value, cursor) => {
700
+ if (pointer.length === 0) {
701
+ return;
702
+ } else if (pointer.length === 1 && !isScalar(subject)) {
703
+ const segment = computeSegment(subject, pointer[0]);
704
+ subject[segment] = value;
705
+ } else {
706
+ const segment = pointer.shift();
707
+ _assign(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor));
708
+ }
709
+ };
710
+
711
+ const unset = (pointer, subject = undefined) => {
712
+ const ptr = compile$P(pointer);
713
+ const fn = (subject) => _unset(ptr, subject, nil$2);
714
+ return subject === undefined ? fn : fn(subject);
715
+ };
716
+
717
+ const _unset = (pointer, subject, cursor) => {
718
+ if (pointer.length == 0) {
719
+ return undefined;
720
+ } else if (pointer.length > 1) {
721
+ const segment = pointer.shift();
722
+ const value = applySegment(subject, segment, cursor);
723
+ return { ...subject, [segment]: _unset(pointer, value, append(segment, cursor)) };
724
+ } else if (Array.isArray(subject)) {
725
+ return subject.filter((_, ndx) => ndx != pointer[0]);
726
+ } else if (typeof subject === "object" && subject !== null) {
727
+ // eslint-disable-next-line no-unused-vars
728
+ const { [pointer[0]]: _, ...result } = subject;
729
+ return result;
730
+ } else {
731
+ return applySegment(subject, pointer[0], cursor);
732
+ }
733
+ };
734
+
735
+ const remove = (pointer, subject = undefined) => {
736
+ const ptr = compile$P(pointer);
737
+ const fn = (subject) => _remove(ptr, subject, nil$2);
738
+ return subject === undefined ? fn : fn(subject);
739
+ };
740
+
741
+ const _remove = (pointer, subject, cursor) => {
742
+ if (pointer.length === 0) {
743
+ return;
744
+ } else if (pointer.length > 1) {
745
+ const segment = pointer.shift();
746
+ const value = applySegment(subject, segment, cursor);
747
+ _remove(pointer, value, append(segment, cursor));
748
+ } else if (Array.isArray(subject)) {
749
+ subject.splice(pointer[0], 1);
750
+ } else if (typeof subject === "object" && subject !== null) {
751
+ delete subject[pointer[0]];
752
+ } else {
753
+ applySegment(subject, pointer[0], cursor);
754
+ }
755
+ };
756
+
757
+ const append = justCurryIt((segment, pointer) => pointer + "/" + escape(segment));
758
+
759
+ const escape = (segment) => segment.toString().replace(/~/g, "~0").replace(/\//g, "~1");
760
+ const unescape = (segment) => segment.toString().replace(/~1/g, "/").replace(/~0/g, "~");
761
+ const computeSegment = (value, segment) => Array.isArray(value) && segment === "-" ? value.length : segment;
762
+
763
+ const applySegment = (value, segment, cursor = "") => {
764
+ if (value === undefined) {
765
+ throw TypeError(`Value at '${cursor}' is undefined and does not have property '${segment}'`);
766
+ } else if (value === null) {
767
+ throw TypeError(`Value at '${cursor}' is null and does not have property '${segment}'`);
768
+ } else if (isScalar(value)) {
769
+ throw TypeError(`Value at '${cursor}' is a ${typeof value} and does not have property '${segment}'`);
770
+ } else {
771
+ const computedSegment = computeSegment(value, segment);
772
+ return value[computedSegment];
773
+ }
774
+ };
775
+
776
+ const isScalar = (value) => value === null || typeof value !== "object";
777
+
778
+ var lib$3 = { nil: nil$2, append, get: get$1, set, assign, unset, remove };
779
+ lib$3.nil;
780
+ lib$3.append;
781
+ lib$3.get;
782
+ lib$3.set;
783
+ lib$3.assign;
784
+ lib$3.unset;
785
+ lib$3.remove;
786
+
787
+ const $__value = Symbol("$__value");
788
+ const $__href = Symbol("$__href");
789
+
790
+ const cons$1 = (href, value) => Object.freeze({
791
+ [$__href]: href,
792
+ [$__value]: value
793
+ });
794
+
795
+ const isReference = (ref) => ref && ref[$__href] !== undefined;
796
+ const href = (ref) => ref[$__href];
797
+ const value$2 = (ref) => ref[$__value];
798
+
799
+ var reference = { cons: cons$1, isReference, href, value: value$2 };
800
+
801
+ const { jsonTypeOf: jsonTypeOf$1 } = common$1;
802
+
803
+
804
+
805
+ const nil$1 = Object.freeze({ id: "", pointer: "", instance: undefined, value: undefined });
806
+ const cons = (instance, id = "") => Object.freeze({ ...nil$1, id, instance, value: instance });
807
+ const uri$1 = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;
808
+ const value$1 = (doc) => reference.isReference(doc.value) ? reference.value(doc.value) : doc.value;
809
+ const has$1 = (key, doc) => key in value$1(doc);
810
+ const typeOf$1 = justCurryIt((doc, type) => jsonTypeOf$1(value$1(doc), type));
811
+
812
+ const step$1 = (key, doc) => Object.freeze({
813
+ ...doc,
814
+ pointer: lib$3.append(key, doc.pointer),
815
+ value: value$1(doc)[key]
816
+ });
817
+
818
+ const entries$2 = (doc) => Object.keys(value$1(doc))
819
+ .map((key) => [key, step$1(key, doc)]);
820
+
821
+ const keys$1 = (doc) => Object.keys(value$1(doc));
822
+
823
+ const map$2 = justCurryIt((fn, doc) => value$1(doc)
824
+ .map((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
825
+
826
+ const filter$1 = justCurryIt((fn, doc) => value$1(doc)
827
+ .map((item, ndx, array, thisArg) => step$1(ndx, doc))
828
+ .filter((item, ndx, array, thisArg) => fn(item, ndx, array, thisArg)));
829
+
830
+ const reduce$1 = justCurryIt((fn, acc, doc) => value$1(doc)
831
+ .reduce((acc, item, ndx) => fn(acc, step$1(ndx, doc), ndx), acc));
832
+
833
+ const every$1 = justCurryIt((fn, doc) => value$1(doc)
834
+ .every((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
835
+
836
+ const some$1 = justCurryIt((fn, doc) => value$1(doc)
837
+ .some((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
838
+
839
+ const length$1 = (doc) => value$1(doc).length;
840
+
841
+ var instance = { nil: nil$1, cons, uri: uri$1, value: value$1, has: has$1, typeOf: typeOf$1, step: step$1, entries: entries$2, keys: keys$1, map: map$2, filter: filter$1, reduce: reduce$1, every: every$1, some: some$1, length: length$1 };
842
+ instance.nil;
843
+ instance.cons;
844
+ instance.uri;
845
+ instance.value;
846
+ instance.has;
847
+ instance.typeOf;
848
+ instance.step;
849
+ instance.entries;
850
+ instance.keys;
851
+ instance.map;
852
+ instance.filter;
853
+ instance.reduce;
854
+ instance.every;
855
+ instance.some;
856
+ instance.length;
857
+
858
+ /*!
859
+ * content-type
860
+ * Copyright(c) 2015 Douglas Christopher Wilson
861
+ * MIT Licensed
862
+ */
863
+
864
+ /**
865
+ * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
866
+ *
867
+ * parameter = token "=" ( token / quoted-string )
868
+ * token = 1*tchar
869
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
870
+ * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
871
+ * / DIGIT / ALPHA
872
+ * ; any VCHAR, except delimiters
873
+ * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
874
+ * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
875
+ * obs-text = %x80-FF
876
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
877
+ */
878
+ var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
879
+ var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;
880
+ var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
881
+
882
+ /**
883
+ * RegExp to match quoted-pair in RFC 7230 sec 3.2.6
884
+ *
885
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
886
+ * obs-text = %x80-FF
887
+ */
888
+ var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
889
+
890
+ /**
891
+ * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
892
+ */
893
+ var QUOTE_REGEXP = /([\\"])/g;
894
+
895
+ /**
896
+ * RegExp to match type in RFC 7231 sec 3.1.1.1
897
+ *
898
+ * media-type = type "/" subtype
899
+ * type = token
900
+ * subtype = token
901
+ */
902
+ var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
903
+
904
+ /**
905
+ * Module exports.
906
+ * @public
907
+ */
908
+
909
+ var format_1 = format$1;
910
+ var parse_1 = parse;
911
+
912
+ /**
913
+ * Format object to media type.
914
+ *
915
+ * @param {object} obj
916
+ * @return {string}
917
+ * @public
918
+ */
919
+
920
+ function format$1 (obj) {
921
+ if (!obj || typeof obj !== 'object') {
922
+ throw new TypeError('argument obj is required')
923
+ }
924
+
925
+ var parameters = obj.parameters;
926
+ var type = obj.type;
927
+
928
+ if (!type || !TYPE_REGEXP.test(type)) {
929
+ throw new TypeError('invalid type')
930
+ }
931
+
932
+ var string = type;
933
+
934
+ // append parameters
935
+ if (parameters && typeof parameters === 'object') {
936
+ var param;
937
+ var params = Object.keys(parameters).sort();
938
+
939
+ for (var i = 0; i < params.length; i++) {
940
+ param = params[i];
941
+
942
+ if (!TOKEN_REGEXP.test(param)) {
943
+ throw new TypeError('invalid parameter name')
944
+ }
945
+
946
+ string += '; ' + param + '=' + qstring(parameters[param]);
947
+ }
948
+ }
949
+
950
+ return string
951
+ }
952
+
953
+ /**
954
+ * Parse media type to object.
955
+ *
956
+ * @param {string|object} string
957
+ * @return {Object}
958
+ * @public
959
+ */
960
+
961
+ function parse (string) {
962
+ if (!string) {
963
+ throw new TypeError('argument string is required')
964
+ }
965
+
966
+ // support req/res-like objects as argument
967
+ var header = typeof string === 'object'
968
+ ? getcontenttype(string)
969
+ : string;
970
+
971
+ if (typeof header !== 'string') {
972
+ throw new TypeError('argument string is required to be a string')
973
+ }
974
+
975
+ var index = header.indexOf(';');
976
+ var type = index !== -1
977
+ ? header.substr(0, index).trim()
978
+ : header.trim();
979
+
980
+ if (!TYPE_REGEXP.test(type)) {
981
+ throw new TypeError('invalid media type')
982
+ }
983
+
984
+ var obj = new ContentType(type.toLowerCase());
985
+
986
+ // parse parameters
987
+ if (index !== -1) {
988
+ var key;
989
+ var match;
990
+ var value;
991
+
992
+ PARAM_REGEXP.lastIndex = index;
993
+
994
+ while ((match = PARAM_REGEXP.exec(header))) {
995
+ if (match.index !== index) {
996
+ throw new TypeError('invalid parameter format')
997
+ }
998
+
999
+ index += match[0].length;
1000
+ key = match[1].toLowerCase();
1001
+ value = match[2];
1002
+
1003
+ if (value[0] === '"') {
1004
+ // remove quotes and escapes
1005
+ value = value
1006
+ .substr(1, value.length - 2)
1007
+ .replace(QESC_REGEXP, '$1');
1008
+ }
1009
+
1010
+ obj.parameters[key] = value;
1011
+ }
1012
+
1013
+ if (index !== header.length) {
1014
+ throw new TypeError('invalid parameter format')
1015
+ }
1016
+ }
1017
+
1018
+ return obj
1019
+ }
1020
+
1021
+ /**
1022
+ * Get content-type from req/res objects.
1023
+ *
1024
+ * @param {object}
1025
+ * @return {Object}
1026
+ * @private
1027
+ */
1028
+
1029
+ function getcontenttype (obj) {
1030
+ var header;
1031
+
1032
+ if (typeof obj.getHeader === 'function') {
1033
+ // res-like
1034
+ header = obj.getHeader('content-type');
1035
+ } else if (typeof obj.headers === 'object') {
1036
+ // req-like
1037
+ header = obj.headers && obj.headers['content-type'];
1038
+ }
1039
+
1040
+ if (typeof header !== 'string') {
1041
+ throw new TypeError('content-type header is missing from object')
1042
+ }
1043
+
1044
+ return header
1045
+ }
1046
+
1047
+ /**
1048
+ * Quote a string if necessary.
1049
+ *
1050
+ * @param {string} val
1051
+ * @return {string}
1052
+ * @private
1053
+ */
1054
+
1055
+ function qstring (val) {
1056
+ var str = String(val);
1057
+
1058
+ // no need to quote tokens
1059
+ if (TOKEN_REGEXP.test(str)) {
1060
+ return str
1061
+ }
1062
+
1063
+ if (str.length > 0 && !TEXT_REGEXP.test(str)) {
1064
+ throw new TypeError('invalid parameter value')
1065
+ }
1066
+
1067
+ return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'
1068
+ }
1069
+
1070
+ /**
1071
+ * Class to represent a content type.
1072
+ * @private
1073
+ */
1074
+ function ContentType (type) {
1075
+ this.parameters = Object.create(null);
1076
+ this.type = type;
1077
+ }
1078
+
1079
+ var contentType = {
1080
+ format: format_1,
1081
+ parse: parse_1
1082
+ };
1083
+
1084
+ var entries$1 = async (doc) => Object.entries(await doc);
1085
+
1086
+ var map$1 = justCurryIt(async (fn, doc) => (await doc).map(fn));
1087
+
1088
+ var reduce = justCurryIt(async (fn, acc, doc) => {
1089
+ return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
1090
+ });
1091
+
1092
+ var filter = justCurryIt(async (fn, doc, options = {}) => {
1093
+ return reduce(async (acc, item) => {
1094
+ return (await fn(item)) ? acc.concat([item]) : acc;
1095
+ }, [], doc, options);
1096
+ });
1097
+
1098
+ var some = justCurryIt(async (fn, doc) => {
1099
+ const results = await map$1(fn, doc);
1100
+ return (await Promise.all(results))
1101
+ .some((a) => a);
1102
+ });
1103
+
1104
+ var every = justCurryIt(async (fn, doc) => {
1105
+ const results = await map$1(fn, doc);
1106
+ return (await Promise.all(results))
1107
+ .every((a) => a);
1108
+ });
1109
+
1110
+ var pipeline = justCurryIt((fns, doc) => {
1111
+ return fns.reduce(async (acc, fn) => fn(await acc), doc);
1112
+ });
1113
+
1114
+ var all = (doc) => Promise.all(doc);
1115
+
1116
+ var allValues = (doc) => {
1117
+ return pipeline([
1118
+ entries$1,
1119
+ reduce(async (acc, [propertyName, propertyValue]) => {
1120
+ acc[propertyName] = await propertyValue;
1121
+ return acc;
1122
+ }, {})
1123
+ ], doc);
1124
+ };
1125
+
1126
+ var lib$2 = {
1127
+ entries: entries$1,
1128
+ map: map$1,
1129
+ filter: filter,
1130
+ reduce: reduce,
1131
+ some: some,
1132
+ every: every,
1133
+ pipeline: pipeline,
1134
+ all: all,
1135
+ allValues: allValues
1136
+ };
1137
+ lib$2.entries;
1138
+ lib$2.map;
1139
+ lib$2.filter;
1140
+ lib$2.reduce;
1141
+ lib$2.some;
1142
+ lib$2.every;
1143
+ lib$2.pipeline;
1144
+ lib$2.all;
1145
+ lib$2.allValues;
1146
+
1147
+ var fetch_browser = fetch;
1148
+
1149
+ const { jsonTypeOf, splitUrl: splitUrl$3, safeResolveUrl } = common$1;
1150
+
1151
+
1152
+
1153
+
1154
+ // Config
1155
+ const config = {};
1156
+ const configAlias = {};
1157
+
1158
+ const setConfig = (schemaVersion, key, value) => {
1159
+ if (!config[schemaVersion]) {
1160
+ config[schemaVersion] = {};
1161
+ }
1162
+ config[schemaVersion][key] = value;
1163
+ };
1164
+
1165
+ const getConfig = (schemaVersion, key) => {
1166
+ const configVersion = schemaVersion in configAlias ? configAlias[schemaVersion] : schemaVersion;
1167
+ if (configVersion in config) {
1168
+ return config[configVersion][key];
1169
+ }
1170
+ };
1171
+
1172
+ // Schema Management
1173
+ const schemaStore = {};
1174
+ const schemaStoreAlias = {};
1175
+
1176
+ const add$1 = (schema, url = "", defaultSchemaVersion = "") => {
1177
+ schema = JSON.parse(JSON.stringify(schema));
1178
+
1179
+ // Schema Version
1180
+ const schemaVersion = splitUrl$3(schema["$schema"] || defaultSchemaVersion)[0];
1181
+ if (!schemaVersion) {
1182
+ throw Error("Couldn't determine schema version");
1183
+ }
1184
+ delete schema["$schema"];
1185
+
1186
+ // Identifier
1187
+ const baseToken = getConfig(schemaVersion, "baseToken");
1188
+ const anchorToken = getConfig(schemaVersion, "anchorToken");
1189
+ const externalId = splitUrl$3(url)[0];
1190
+ if (!externalId && !splitUrl$3(schema[baseToken] || "")[0]) {
1191
+ throw Error("Couldn't determine an identifier for the schema");
1192
+ }
1193
+ const internalUrl = safeResolveUrl(externalId, schema[baseToken] || "");
1194
+ const [id, fragment] = splitUrl$3(internalUrl);
1195
+ delete schema[baseToken];
1196
+ if (fragment && baseToken === anchorToken) {
1197
+ schema[anchorToken] = anchorToken !== baseToken ? encodeURI(fragment) : `#${encodeURI(fragment)}`;
1198
+ }
1199
+ if (externalId) {
1200
+ schemaStoreAlias[externalId] = id;
1201
+ }
1202
+
1203
+ // recursiveAnchor
1204
+ const dynamicAnchors = {};
1205
+ const recursiveAnchorToken = getConfig(schemaVersion, "recursiveAnchorToken");
1206
+ if (schema[recursiveAnchorToken] === true) {
1207
+ dynamicAnchors[""] = `${id}#`;
1208
+ schema[anchorToken] = "";
1209
+ delete schema[recursiveAnchorToken];
1210
+ }
1211
+
1212
+ // Vocabulary
1213
+ let vocabulary;
1214
+ const vocabularyToken = getConfig(schemaVersion, "vocabularyToken");
1215
+ if (jsonTypeOf(schema[vocabularyToken], "object")) {
1216
+ configAlias[id] = schemaVersion;
1217
+ vocabulary = schema[vocabularyToken];
1218
+ delete schema[vocabularyToken];
1219
+ } else {
1220
+ configAlias[id] = schemaVersion;
1221
+ vocabulary = { [schemaVersion]: true };
1222
+ }
1223
+
1224
+ // Store Schema
1225
+ const anchors = { "": "" };
1226
+ schemaStore[id] = {
1227
+ id: id,
1228
+ schemaVersion: schemaVersion,
1229
+ schema: processSchema(schema, id, schemaVersion, lib$3.nil, anchors, dynamicAnchors),
1230
+ anchors: anchors,
1231
+ dynamicAnchors: dynamicAnchors,
1232
+ vocabulary: vocabulary,
1233
+ validated: false
1234
+ };
1235
+
1236
+ return schemaStore[id];
1237
+ };
1238
+
1239
+ const processSchema = (subject, id, schemaVersion, pointer, anchors, dynamicAnchors) => {
1240
+ if (jsonTypeOf(subject, "object")) {
1241
+ const embeddedSchemaVersion = typeof subject["$schema"] === "string" ? splitUrl$3(subject["$schema"])[0] : schemaVersion;
1242
+ const embeddedEmbeddedToken = getConfig(embeddedSchemaVersion, "embeddedToken");
1243
+ const embeddedAnchorToken = getConfig(embeddedSchemaVersion, "anchorToken");
1244
+ if (typeof subject[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || subject[embeddedEmbeddedToken][0] !== "#")) {
1245
+ const ref = safeResolveUrl(id, subject[embeddedEmbeddedToken]);
1246
+ subject[embeddedEmbeddedToken] = ref;
1247
+ add$1(subject, ref, schemaVersion);
1248
+ return reference.cons(subject[embeddedEmbeddedToken], subject);
1249
+ }
1250
+
1251
+ const anchorToken = getConfig(schemaVersion, "anchorToken");
1252
+ const dynamicAnchorToken = getConfig(schemaVersion, "dynamicAnchorToken");
1253
+ if (typeof subject[dynamicAnchorToken] === "string") {
1254
+ dynamicAnchors[subject[dynamicAnchorToken]] = `${id}#${encodeURI(pointer)}`;
1255
+ anchors[subject[dynamicAnchorToken]] = pointer;
1256
+ delete subject[dynamicAnchorToken];
1257
+ }
1258
+
1259
+ const embeddedToken = getConfig(schemaVersion, "embeddedToken");
1260
+ if (typeof subject[anchorToken] === "string") {
1261
+ const anchor = anchorToken !== embeddedToken ? subject[anchorToken] : subject[anchorToken].slice(1);
1262
+ anchors[anchor] = pointer;
1263
+ delete subject[anchorToken];
1264
+ }
1265
+
1266
+ const jrefToken = getConfig(schemaVersion, "jrefToken");
1267
+ if (typeof subject[jrefToken] === "string") {
1268
+ return reference.cons(subject[jrefToken], subject);
1269
+ }
1270
+
1271
+ for (const key in subject) {
1272
+ subject[key] = processSchema(subject[key], id, schemaVersion, lib$3.append(key, pointer), anchors, dynamicAnchors);
1273
+ }
1274
+
1275
+ return subject;
1276
+ } else if (Array.isArray(subject)) {
1277
+ return subject.map((item, ndx) => processSchema(item, id, schemaVersion, lib$3.append(ndx, pointer), anchors, dynamicAnchors));
1278
+ } else {
1279
+ return subject;
1280
+ }
1281
+ };
1282
+
1283
+ const hasStoredSchema = (id) => id in schemaStore || id in schemaStoreAlias;
1284
+ const getStoredSchema = (id) => schemaStore[schemaStoreAlias[id]] || schemaStore[id];
1285
+
1286
+ const markValidated = (id) => {
1287
+ schemaStore[id].validated = true;
1288
+ };
1289
+
1290
+ // Schema Retrieval
1291
+ const nil = Object.freeze({
1292
+ id: "",
1293
+ schemaVersion: undefined,
1294
+ vocabulary: {},
1295
+ pointer: lib$3.nil,
1296
+ schema: undefined,
1297
+ value: undefined,
1298
+ anchors: {},
1299
+ dynamicAnchors: {},
1300
+ validated: true
1301
+ });
1302
+
1303
+ const get = async (url, contextDoc = nil) => {
1304
+ const resolvedUrl = safeResolveUrl(uri(contextDoc), url);
1305
+ const [id, fragment] = splitUrl$3(resolvedUrl);
1306
+
1307
+ if (!hasStoredSchema(id)) {
1308
+ const response = await fetch_browser(id, { headers: { Accept: "application/schema+json" } });
1309
+ if (response.status >= 400) {
1310
+ await response.text(); // Sometimes node hangs without this hack
1311
+ throw Error(`Failed to retrieve schema with id: ${id}`);
1312
+ }
1313
+
1314
+ if (response.headers.has("content-type")) {
1315
+ const contentType$1 = contentType.parse(response.headers.get("content-type")).type;
1316
+ if (contentType$1 !== "application/schema+json") {
1317
+ throw Error(`${id} is not a schema. Found a document with media type: ${contentType$1}`);
1318
+ }
1319
+ }
1320
+
1321
+ add$1(await response.json(), id);
1322
+ }
1323
+
1324
+ const storedSchema = getStoredSchema(id);
1325
+ const pointer = fragment[0] !== "/" ? getAnchorPointer(storedSchema, fragment) : fragment;
1326
+ const doc = Object.freeze({
1327
+ ...storedSchema,
1328
+ pointer: pointer,
1329
+ value: lib$3.get(pointer, storedSchema.schema)
1330
+ });
1331
+
1332
+ return followReferences$1(doc);
1333
+ };
1334
+
1335
+ const followReferences$1 = (doc) => reference.isReference(doc.value) ? get(reference.href(doc.value), doc) : doc;
1336
+
1337
+ const getAnchorPointer = (schema, fragment) => {
1338
+ if (!(fragment in schema.anchors)) {
1339
+ throw Error(`No such anchor '${encodeURI(schema.id)}#${encodeURI(fragment)}'`);
1340
+ }
1341
+
1342
+ return schema.anchors[fragment];
1343
+ };
1344
+
1345
+ // Utility Functions
1346
+ const uri = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;
1347
+ const value = (doc) => reference.isReference(doc.value) ? reference.value(doc.value) : doc.value;
1348
+ const has = (key, doc) => key in value(doc);
1349
+ const typeOf = (doc, type) => jsonTypeOf(value(doc), type);
1350
+
1351
+ const step = (key, doc) => {
1352
+ const storedSchema = getStoredSchema(doc.id);
1353
+ const nextDoc = Object.freeze({
1354
+ ...doc,
1355
+ pointer: lib$3.append(key, doc.pointer),
1356
+ value: value(doc)[key],
1357
+ validated: storedSchema.validated
1358
+ });
1359
+ return followReferences$1(nextDoc);
1360
+ };
1361
+
1362
+ const keys = (doc) => Object.keys(value(doc));
1363
+
1364
+ const entries = (doc) => lib$2.pipeline([
1365
+ value,
1366
+ Object.keys,
1367
+ lib$2.map(async (key) => [key, await step(key, doc)]),
1368
+ lib$2.all
1369
+ ], doc);
1370
+
1371
+ const map = justCurryIt((fn, doc) => lib$2.pipeline([
1372
+ value,
1373
+ lib$2.map(async (item, ndx) => fn(await step(ndx, doc), ndx)),
1374
+ lib$2.all
1375
+ ], doc));
1376
+
1377
+ const length = (doc) => value(doc).length;
1378
+
1379
+ var schema$5 = {
1380
+ setConfig, getConfig,
1381
+ add: add$1, get, markValidated,
1382
+ uri, value, getAnchorPointer, typeOf, has, step, keys, entries, map, length
1383
+ };
1384
+ schema$5.setConfig;
1385
+ schema$5.getConfig;
1386
+ schema$5.add;
1387
+ schema$5.get;
1388
+ schema$5.markValidated;
1389
+ schema$5.uri;
1390
+ schema$5.value;
1391
+ schema$5.getAnchorPointer;
1392
+ schema$5.typeOf;
1393
+ schema$5.has;
1394
+ schema$5.step;
1395
+ schema$5.keys;
1396
+ schema$5.entries;
1397
+ schema$5.map;
1398
+ schema$5.length;
1399
+
1400
+ class InvalidSchemaError$1 extends Error {
1401
+ constructor(output) {
1402
+ super("Invalid Schema");
1403
+ this.name = this.constructor.name;
1404
+ this.output = output;
1405
+ }
1406
+ }
1407
+
1408
+ var invalidSchemaError = InvalidSchemaError$1;
1409
+
1410
+ const { splitUrl: splitUrl$2 } = common$1;
1411
+
1412
+
1413
+
1414
+
1415
+
1416
+ const FLAG = "FLAG", BASIC = "BASIC", DETAILED = "DETAILED", VERBOSE = "VERBOSE";
1417
+
1418
+ let metaOutputFormat = DETAILED;
1419
+ let shouldMetaValidate = true;
1420
+
1421
+ const validate$1 = async (schema, value = undefined, outputFormat = undefined) => {
1422
+ const compiled = await compile$O(schema);
1423
+ const interpretAst = (value, outputFormat) => interpret$O(compiled, instance.cons(value), outputFormat);
1424
+
1425
+ return value === undefined ? interpretAst : interpretAst(value, outputFormat);
1426
+ };
1427
+
1428
+ const compile$O = async (schema) => {
1429
+ const ast = { metaData: {} };
1430
+ const schemaUri = await compileSchema(schema, ast);
1431
+ return { ast, schemaUri };
1432
+ };
1433
+
1434
+ const interpret$O = justCurryIt(({ ast, schemaUri }, value, outputFormat = FLAG) => {
1435
+ if (![FLAG, BASIC, DETAILED, VERBOSE].includes(outputFormat)) {
1436
+ throw Error(`The '${outputFormat}' error format is not supported`);
1437
+ }
1438
+
1439
+ const output = [];
1440
+ const subscriptionToken = pubsub.subscribe("result", outputHandler(outputFormat, output));
1441
+ interpretSchema(schemaUri, value, ast, {});
1442
+ pubsub.unsubscribe(subscriptionToken);
1443
+
1444
+ return output[0];
1445
+ });
1446
+
1447
+ const outputHandler = (outputFormat, output) => {
1448
+ const resultStack = [];
1449
+
1450
+ return (message, keywordResult) => {
1451
+ if (message === "result") {
1452
+ const { keyword, absoluteKeywordLocation, instanceLocation, valid } = keywordResult;
1453
+ const result = { keyword, absoluteKeywordLocation, instanceLocation, valid, errors: [] };
1454
+ resultStack.push(result);
1455
+ } else if (message === "result.start") {
1456
+ resultStack.push(message);
1457
+ } else if (message === "result.end") {
1458
+ const result = resultStack.pop();
1459
+ while (resultStack[resultStack.length - 1] !== "result.start") {
1460
+ const topResult = resultStack.pop();
1461
+
1462
+ const errors = [topResult];
1463
+ if (outputFormat === BASIC) {
1464
+ errors.push(...topResult.errors);
1465
+ delete topResult.errors;
1466
+ }
1467
+
1468
+ if (outputFormat === VERBOSE || (outputFormat !== FLAG && !topResult.valid)) {
1469
+ result.errors.unshift(...errors);
1470
+ }
1471
+ }
1472
+ resultStack[resultStack.length - 1] = result;
1473
+
1474
+ output[0] = result;
1475
+ }
1476
+ };
1477
+ };
1478
+
1479
+ const setMetaOutputFormat = (format) => {
1480
+ metaOutputFormat = format;
1481
+ };
1482
+
1483
+ const setShouldMetaValidate = (isEnabled) => {
1484
+ shouldMetaValidate = isEnabled;
1485
+ };
1486
+
1487
+ const _keywords = {};
1488
+ const getKeyword = (id) => _keywords[id];
1489
+ const hasKeyword = (id) => id in _keywords;
1490
+ const addKeyword = (id, keywordHandler) => {
1491
+ _keywords[id] = {
1492
+ collectEvaluatedItems: (keywordValue, instance, ast, dynamicAnchors, isTop) => keywordHandler.interpret(keywordValue, instance, ast, dynamicAnchors, isTop) && new Set(),
1493
+ collectEvaluatedProperties: (keywordValue, instance, ast, dynamicAnchors, isTop) => keywordHandler.interpret(keywordValue, instance, ast, dynamicAnchors, isTop) && [],
1494
+ ...keywordHandler
1495
+ };
1496
+ };
1497
+
1498
+ const _vocabularies = {};
1499
+ const defineVocabulary = (id, keywords) => {
1500
+ _vocabularies[id] = keywords;
1501
+ };
1502
+
1503
+ const metaValidators = {};
1504
+ const compileSchema = async (schema, ast) => {
1505
+ schema = await followReferences(schema);
1506
+
1507
+ // Vocabularies
1508
+ if (!hasKeyword(`${schema.schemaVersion}#validate`)) {
1509
+ const metaSchema = await schema$5.get(schema.schemaVersion);
1510
+
1511
+ // Check for mandatory vocabularies
1512
+ const mandatoryVocabularies = schema$5.getConfig(metaSchema.id, "mandatoryVocabularies") || [];
1513
+ mandatoryVocabularies.forEach((vocabularyId) => {
1514
+ if (!metaSchema.vocabulary[vocabularyId]) {
1515
+ throw Error(`Vocabulary '${vocabularyId}' must be explicitly declared and required`);
1516
+ }
1517
+ });
1518
+
1519
+ // Load vocabularies
1520
+ Object.entries(metaSchema.vocabulary)
1521
+ .forEach(([vocabularyId, isRequired]) => {
1522
+ if (vocabularyId in _vocabularies) {
1523
+ Object.entries(_vocabularies[vocabularyId])
1524
+ .forEach(([keyword, keywordHandler]) => {
1525
+ addKeyword(`${metaSchema.id}#${keyword}`, keywordHandler);
1526
+ });
1527
+ } else if (isRequired) {
1528
+ throw Error(`Missing required vocabulary: ${vocabularyId}`);
1529
+ }
1530
+ });
1531
+ }
1532
+
1533
+ // Meta validation
1534
+ if (shouldMetaValidate && !schema.validated) {
1535
+ schema$5.markValidated(schema.id);
1536
+
1537
+ // Compile
1538
+ if (!(schema.schemaVersion in metaValidators)) {
1539
+ const metaSchema = await schema$5.get(schema.schemaVersion);
1540
+ const compiledSchema = await compile$O(metaSchema);
1541
+ metaValidators[metaSchema.id] = interpret$O(compiledSchema);
1542
+ }
1543
+
1544
+ // Interpret
1545
+ const schemaInstance = instance.cons(schema.schema, schema.id);
1546
+ const metaResults = metaValidators[schema.schemaVersion](schemaInstance, metaOutputFormat);
1547
+ if (!metaResults.valid) {
1548
+ throw new invalidSchemaError(metaResults);
1549
+ }
1550
+ }
1551
+
1552
+ // Compile
1553
+ if (!(schema.id in ast.metaData)) {
1554
+ ast.metaData[schema.id] = {
1555
+ id: schema.id,
1556
+ dynamicAnchors: schema.dynamicAnchors,
1557
+ anchors: schema.anchors
1558
+ };
1559
+ }
1560
+ return getKeyword(`${schema.schemaVersion}#validate`).compile(schema, ast);
1561
+ };
1562
+
1563
+ const followReferences = async (doc) => {
1564
+ return schema$5.typeOf(doc, "string") ? followReferences(await schema$5.get(schema$5.value(doc), doc)) : doc;
1565
+ };
1566
+
1567
+ const interpretSchema = (schemaUri, instance, ast, dynamicAnchors) => {
1568
+ const keywordId = getKeywordId(schemaUri, ast);
1569
+ const id = splitUrl$2(schemaUri)[0];
1570
+ return getKeyword(keywordId).interpret(schemaUri, instance, ast, { ...ast.metaData[id].dynamicAnchors, ...dynamicAnchors });
1571
+ };
1572
+
1573
+ const collectEvaluatedProperties$e = (schemaUri, instance, ast, dynamicAnchors, isTop) => {
1574
+ const keywordId = getKeywordId(schemaUri, ast);
1575
+ return getKeyword(keywordId).collectEvaluatedProperties(schemaUri, instance, ast, dynamicAnchors, isTop);
1576
+ };
1577
+
1578
+ const collectEvaluatedItems$f = (schemaUri, instance, ast, dynamicAnchors, isTop) => {
1579
+ const keywordId = getKeywordId(schemaUri, ast);
1580
+ return getKeyword(keywordId).collectEvaluatedItems(schemaUri, instance, ast, dynamicAnchors, isTop);
1581
+ };
1582
+
1583
+ const getKeywordId = (schemaUri, ast) => {
1584
+ if (!(schemaUri in ast)) {
1585
+ throw Error(`No schema found at ${schemaUri}`);
1586
+ }
1587
+
1588
+ return ast[schemaUri][0];
1589
+ };
1590
+
1591
+ const add = (schema, url = "", defaultSchemaVersion = "") => {
1592
+ const doc = schema$5.add(schema, url, defaultSchemaVersion);
1593
+ delete metaValidators[doc.id];
1594
+
1595
+ return doc;
1596
+ };
1597
+
1598
+ var core$2 = {
1599
+ validate: validate$1, compile: compile$O, interpret: interpret$O,
1600
+ setMetaOutputFormat, setShouldMetaValidate, FLAG, BASIC, DETAILED, VERBOSE,
1601
+ add, getKeyword, hasKeyword, defineVocabulary,
1602
+ compileSchema, interpretSchema, collectEvaluatedProperties: collectEvaluatedProperties$e, collectEvaluatedItems: collectEvaluatedItems$f
1603
+ };
1604
+ core$2.validate;
1605
+ core$2.compile;
1606
+ core$2.interpret;
1607
+ core$2.setMetaOutputFormat;
1608
+ core$2.setShouldMetaValidate;
1609
+ core$2.FLAG;
1610
+ core$2.BASIC;
1611
+ core$2.DETAILED;
1612
+ core$2.VERBOSE;
1613
+ core$2.add;
1614
+ core$2.getKeyword;
1615
+ core$2.hasKeyword;
1616
+ core$2.defineVocabulary;
1617
+ core$2.compileSchema;
1618
+ core$2.interpretSchema;
1619
+ core$2.collectEvaluatedProperties;
1620
+ core$2.collectEvaluatedItems;
1621
+
1622
+ const compile$N = (schema) => schema$5.value(schema);
1623
+ const interpret$N = () => true;
1624
+
1625
+ var metaData$2 = { compile: compile$N, interpret: interpret$N };
1626
+ metaData$2.compile;
1627
+ metaData$2.interpret;
1628
+
1629
+ const compile$M = async (schema, ast) => {
1630
+ const url = schema$5.uri(schema);
1631
+ if (!(url in ast)) {
1632
+ ast[url] = false; // Place dummy entry in ast to avoid recursive loops
1633
+
1634
+ const schemaValue = schema$5.value(schema);
1635
+ if (!["object", "boolean"].includes(typeof schemaValue)) {
1636
+ throw Error(`No schema found at '${schema$5.uri(schema)}'`);
1637
+ }
1638
+
1639
+ ast[url] = [
1640
+ `${schema.schemaVersion}#validate`,
1641
+ schema$5.uri(schema),
1642
+ typeof schemaValue === "boolean" ? schemaValue : await lib$2.pipeline([
1643
+ schema$5.entries,
1644
+ lib$2.map(([keyword, keywordSchema]) => [`${schema.schemaVersion}#${keyword}`, keywordSchema]),
1645
+ lib$2.filter(([keywordId]) => core$2.hasKeyword(keywordId) && keywordId !== `${schema.schemaVersion}#validate`),
1646
+ lib$2.map(async ([keywordId, keywordSchema]) => {
1647
+ const keywordAst = await core$2.getKeyword(keywordId).compile(keywordSchema, ast, schema);
1648
+ return [keywordId, schema$5.uri(keywordSchema), keywordAst];
1649
+ }),
1650
+ lib$2.all
1651
+ ], schema)
1652
+ ];
1653
+ }
1654
+
1655
+ return url;
1656
+ };
1657
+
1658
+ const interpret$M = (uri, instance$1, ast, dynamicAnchors) => {
1659
+ const [keywordId, schemaUrl, nodes] = ast[uri];
1660
+
1661
+ pubsub.publishSync("result.start");
1662
+ const isValid = typeof nodes === "boolean" ? nodes : nodes
1663
+ .every(([keywordId, schemaUrl, keywordValue]) => {
1664
+ pubsub.publishSync("result.start");
1665
+ const isValid = core$2.getKeyword(keywordId).interpret(keywordValue, instance$1, ast, dynamicAnchors);
1666
+
1667
+ pubsub.publishSync("result", {
1668
+ keyword: keywordId,
1669
+ absoluteKeywordLocation: schemaUrl,
1670
+ instanceLocation: instance.uri(instance$1),
1671
+ valid: isValid,
1672
+ ast: keywordValue
1673
+ });
1674
+ pubsub.publishSync("result.end");
1675
+ return isValid;
1676
+ });
1677
+
1678
+ pubsub.publishSync("result", {
1679
+ keyword: keywordId,
1680
+ absoluteKeywordLocation: schemaUrl,
1681
+ instanceLocation: instance.uri(instance$1),
1682
+ valid: isValid,
1683
+ ast: uri
1684
+ });
1685
+ pubsub.publishSync("result.end");
1686
+ return isValid;
1687
+ };
1688
+
1689
+ const collectEvaluatedProperties$d = (uri, instance, ast, dynamicAnchors, isTop = false) => {
1690
+ const nodes = ast[uri][2];
1691
+
1692
+ if (typeof nodes === "boolean") {
1693
+ return nodes ? [] : false;
1694
+ }
1695
+
1696
+ return nodes
1697
+ .filter(([keywordId]) => !isTop || !keywordId.endsWith("#unevaluatedProperties"))
1698
+ .reduce((acc, [keywordId, , keywordValue]) => {
1699
+ const propertyNames = acc && core$2.getKeyword(keywordId).collectEvaluatedProperties(keywordValue, instance, ast, dynamicAnchors);
1700
+ return propertyNames !== false && [...acc, ...propertyNames];
1701
+ }, []);
1702
+ };
1703
+
1704
+ const collectEvaluatedItems$e = (uri, instance, ast, dynamicAnchors, isTop = false) => {
1705
+ const nodes = ast[uri][2];
1706
+
1707
+ if (typeof nodes === "boolean") {
1708
+ return nodes ? new Set() : false;
1709
+ }
1710
+
1711
+ return nodes
1712
+ .filter(([keywordId]) => !isTop || !keywordId.endsWith("#unevaluatedItems"))
1713
+ .reduce((acc, [keywordId, , keywordValue]) => {
1714
+ const itemIndexes = acc !== false && core$2.getKeyword(keywordId).collectEvaluatedItems(keywordValue, instance, ast, dynamicAnchors);
1715
+ return itemIndexes !== false && new Set([...acc, ...itemIndexes]);
1716
+ }, new Set());
1717
+ };
1718
+
1719
+ var validate = { compile: compile$M, interpret: interpret$M, collectEvaluatedProperties: collectEvaluatedProperties$d, collectEvaluatedItems: collectEvaluatedItems$e };
1720
+ validate.compile;
1721
+ validate.interpret;
1722
+ validate.collectEvaluatedProperties;
1723
+ validate.collectEvaluatedItems;
1724
+
1725
+ var keywords$1 = { metaData: metaData$2, validate };
1726
+ keywords$1.metaData;
1727
+ keywords$1.validate;
1728
+
1729
+ var lib$1 = { Core: core$2, Schema: schema$5, Instance: instance, Keywords: keywords$1 };
1730
+
1731
+ const { Core: Core$v, Schema: Schema$N, Instance: Instance$B } = lib$1;
1732
+
1733
+
1734
+ const compile$L = async (schema, ast, parentSchema) => {
1735
+ const items = await Schema$N.step("items", parentSchema);
1736
+ const numberOfItems = Schema$N.typeOf(items, "array") ? Schema$N.length(items) : Number.MAX_SAFE_INTEGER;
1737
+
1738
+ if (Schema$N.typeOf(schema, "boolean")) {
1739
+ return [numberOfItems, Schema$N.value(schema)];
1740
+ } else {
1741
+ return [numberOfItems, await Core$v.compileSchema(schema, ast)];
1742
+ }
1743
+ };
1744
+
1745
+ const interpret$L = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
1746
+ if (!Instance$B.typeOf(instance, "array")) {
1747
+ return true;
1748
+ }
1749
+
1750
+ if (typeof additionalItems === "string") {
1751
+ return Instance$B.every((item, ndx) => ndx < numberOfItems || Core$v.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
1752
+ } else {
1753
+ return Instance$B.every((item, ndx) => ndx < numberOfItems ? true : additionalItems, instance);
1754
+ }
1755
+ };
1756
+
1757
+ var additionalItems = { compile: compile$L, interpret: interpret$L };
1758
+ additionalItems.compile;
1759
+ additionalItems.interpret;
1760
+
1761
+ const { Core: Core$u, Schema: Schema$M, Instance: Instance$A } = lib$1;
1762
+
1763
+
1764
+ const compile$K = async (schema, ast, parentSchema) => {
1765
+ const items = await Schema$M.step("items", parentSchema);
1766
+ const numberOfItems = Schema$M.typeOf(items, "array") ? Schema$M.length(items) : Number.MAX_SAFE_INTEGER;
1767
+
1768
+ return [numberOfItems, await Core$u.compileSchema(schema, ast)];
1769
+ };
1770
+
1771
+ const interpret$K = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
1772
+ if (!Instance$A.typeOf(instance, "array")) {
1773
+ return true;
1774
+ }
1775
+
1776
+ return Instance$A.every((item, ndx) => ndx < numberOfItems || Core$u.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
1777
+ };
1778
+
1779
+ const collectEvaluatedItems$d = (keywordValue, instance, ast, dynamicAnchors) => {
1780
+ return interpret$K(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$A.map((item, ndx) => ndx, instance));
1781
+ };
1782
+
1783
+ var additionalItems6 = { compile: compile$K, interpret: interpret$K, collectEvaluatedItems: collectEvaluatedItems$d };
1784
+ additionalItems6.compile;
1785
+ additionalItems6.interpret;
1786
+ additionalItems6.collectEvaluatedItems;
1787
+
1788
+ const { Core: Core$t, Schema: Schema$L, Instance: Instance$z } = lib$1;
1789
+
1790
+
1791
+ const compile$J = async (schema, ast, parentSchema) => {
1792
+ const properties = await Schema$L.step("properties", parentSchema);
1793
+ const propertyNames = Schema$L.typeOf(properties, "object") ? Schema$L.keys(properties) : [];
1794
+
1795
+ const patternProperties = await Schema$L.step("patternProperties", parentSchema);
1796
+ const propertyNamePatterns = Schema$L.typeOf(patternProperties, "object") ? Schema$L.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
1797
+
1798
+ if (Schema$L.typeOf(schema, "boolean")) {
1799
+ return [propertyNames, propertyNamePatterns, Schema$L.value(schema)];
1800
+ } else {
1801
+ return [propertyNames, propertyNamePatterns, await Core$t.compileSchema(schema, ast)];
1802
+ }
1803
+ };
1804
+
1805
+ const interpret$J = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
1806
+ if (!Instance$z.typeOf(instance, "object")) {
1807
+ return true;
1808
+ }
1809
+
1810
+ const properties = Instance$z.entries(instance)
1811
+ .filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)));
1812
+
1813
+ if (typeof additionalProperties === "string") {
1814
+ return properties.every(([, property]) => Core$t.interpretSchema(additionalProperties, property, ast, dynamicAnchors));
1815
+ } else {
1816
+ return properties.length === 0 || additionalProperties;
1817
+ }
1818
+ };
1819
+
1820
+ var additionalProperties = { compile: compile$J, interpret: interpret$J };
1821
+ additionalProperties.compile;
1822
+ additionalProperties.interpret;
1823
+
1824
+ const { Core: Core$s, Schema: Schema$K, Instance: Instance$y } = lib$1;
1825
+
1826
+
1827
+ const compile$I = async (schema, ast, parentSchema) => {
1828
+ const propertiesSchema = await Schema$K.step("properties", parentSchema);
1829
+ const propertyNames = Schema$K.typeOf(propertiesSchema, "object") ? Schema$K.keys(propertiesSchema) : [];
1830
+
1831
+ const patternProperties = await Schema$K.step("patternProperties", parentSchema);
1832
+ const propertyNamePatterns = Schema$K.typeOf(patternProperties, "object") ? Schema$K.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
1833
+
1834
+ return [propertyNames, propertyNamePatterns, await Core$s.compileSchema(schema, ast)];
1835
+ };
1836
+
1837
+ const interpret$I = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
1838
+ if (!Instance$y.typeOf(instance, "object")) {
1839
+ return true;
1840
+ }
1841
+
1842
+ return Instance$y.entries(instance)
1843
+ .filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)))
1844
+ .every(([, property]) => Core$s.interpretSchema(additionalProperties, property, ast, dynamicAnchors));
1845
+ };
1846
+
1847
+ const collectEvaluatedProperties$c = (keywordValue, instance, ast, dynamicAnchors) => {
1848
+ return interpret$I(keywordValue, instance, ast, dynamicAnchors) && [new RegExp("")];
1849
+ };
1850
+
1851
+ var additionalProperties6 = { compile: compile$I, interpret: interpret$I, collectEvaluatedProperties: collectEvaluatedProperties$c };
1852
+ additionalProperties6.compile;
1853
+ additionalProperties6.interpret;
1854
+ additionalProperties6.collectEvaluatedProperties;
1855
+
1856
+ const { Core: Core$r, Schema: Schema$J } = lib$1;
1857
+
1858
+
1859
+
1860
+ const compile$H = (schema, ast) => lib$2.pipeline([
1861
+ Schema$J.map(async (itemSchema) => Core$r.compileSchema(await itemSchema, ast)),
1862
+ lib$2.all
1863
+ ], schema);
1864
+
1865
+ const interpret$H = (allOf, instance, ast, dynamicAnchors) => {
1866
+ return allOf.every((schemaUrl) => Core$r.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
1867
+ };
1868
+
1869
+ const collectEvaluatedProperties$b = (allOf, instance, ast, dynamicAnchors) => {
1870
+ return allOf.reduce((acc, schemaUrl) => {
1871
+ const propertyNames = acc && Core$r.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors);
1872
+ return propertyNames !== false && [...acc, ...propertyNames];
1873
+ }, []);
1874
+ };
1875
+
1876
+ const collectEvaluatedItems$c = (allOf, instance, ast, dynamicAnchors) => {
1877
+ return allOf.reduce((acc, schemaUrl) => {
1878
+ const itemIndexes = acc !== false && Core$r.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors);
1879
+ return itemIndexes !== false && new Set([...acc, ...itemIndexes]);
1880
+ }, new Set());
1881
+ };
1882
+
1883
+ var allOf = { compile: compile$H, interpret: interpret$H, collectEvaluatedProperties: collectEvaluatedProperties$b, collectEvaluatedItems: collectEvaluatedItems$c };
1884
+ allOf.compile;
1885
+ allOf.interpret;
1886
+ allOf.collectEvaluatedProperties;
1887
+ allOf.collectEvaluatedItems;
1888
+
1889
+ const { Core: Core$q, Schema: Schema$I } = lib$1;
1890
+
1891
+
1892
+
1893
+ const compile$G = (schema, ast) => lib$2.pipeline([
1894
+ Schema$I.map(async (itemSchema) => Core$q.compileSchema(await itemSchema, ast)),
1895
+ lib$2.all
1896
+ ], schema);
1897
+
1898
+ const interpret$G = (anyOf, instance, ast, dynamicAnchors) => {
1899
+ const matches = anyOf.filter((schemaUrl) => Core$q.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
1900
+ return matches.length > 0;
1901
+ };
1902
+
1903
+ const collectEvaluatedProperties$a = (anyOf, instance, ast, dynamicAnchors) => {
1904
+ return anyOf.reduce((acc, schemaUrl) => {
1905
+ const propertyNames = Core$q.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors);
1906
+ return propertyNames !== false ? [...acc || [], ...propertyNames] : acc;
1907
+ }, false);
1908
+ };
1909
+
1910
+ const collectEvaluatedItems$b = (anyOf, instance, ast, dynamicAnchors) => {
1911
+ return anyOf.reduce((acc, schemaUrl) => {
1912
+ const itemIndexes = Core$q.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors);
1913
+ return itemIndexes !== false ? new Set([...acc || [], ...itemIndexes]) : acc;
1914
+ }, false);
1915
+ };
1916
+
1917
+ var anyOf = { compile: compile$G, interpret: interpret$G, collectEvaluatedProperties: collectEvaluatedProperties$a, collectEvaluatedItems: collectEvaluatedItems$b };
1918
+ anyOf.compile;
1919
+ anyOf.interpret;
1920
+ anyOf.collectEvaluatedProperties;
1921
+ anyOf.collectEvaluatedItems;
1922
+
1923
+ var keyList = Object.keys;
1924
+ var native_stringify = JSON.stringify;
1925
+
1926
+ function stringify(val, allowUndefined) {
1927
+ var i, max, str, keys, key, propVal, tipeof;
1928
+
1929
+ tipeof = typeof val;
1930
+
1931
+ if (tipeof === 'string') return native_stringify(val);
1932
+ if (val === true) return 'true';
1933
+ if (val === false) return 'false';
1934
+ if (val === null) return 'null';
1935
+
1936
+ if (val instanceof Array) {
1937
+ str = '[';
1938
+ max = val.length - 1;
1939
+ for(i = 0; i < max; i++)
1940
+ str += stringify(val[i], false) + ',';
1941
+ if (max > -1) {
1942
+ str += stringify(val[i], false);
1943
+ }
1944
+
1945
+ return str + ']';
1946
+ }
1947
+
1948
+ if (val instanceof Object) {
1949
+ if (typeof val.toJSON === 'function')
1950
+ return stringify(val.toJSON(), allowUndefined);
1951
+
1952
+ // only object is left
1953
+ keys = keyList(val).sort();
1954
+ max = keys.length;
1955
+ str = '';
1956
+ i = 0;
1957
+ while (i < max) {
1958
+ key = keys[i];
1959
+ propVal = stringify(val[key], true);
1960
+ if (propVal !== undefined) {
1961
+ if (i && str !== '') { //if the string is empty, don't add comma to avoid the json to become invalid.
1962
+ str += ',';
1963
+ }
1964
+ str += native_stringify(key) + ':' + propVal;
1965
+ }
1966
+ i++;
1967
+ }
1968
+ return '{' + str + '}';
1969
+ }
1970
+
1971
+ switch (tipeof) {
1972
+ case 'function':
1973
+ case 'undefined':
1974
+ return allowUndefined ? undefined : null;
1975
+ default:
1976
+ return isFinite(val) ? val : null;
1977
+ }
1978
+ }
1979
+
1980
+ var fastestStableStringify = function(obj) { return '' + stringify(obj, false); };
1981
+
1982
+ const { Schema: Schema$H, Instance: Instance$x } = lib$1;
1983
+
1984
+
1985
+
1986
+ const compile$F = (schema) => fastestStableStringify(Schema$H.value(schema));
1987
+ const interpret$F = (const_, instance) => fastestStableStringify(Instance$x.value(instance)) === const_;
1988
+
1989
+ var _const = { compile: compile$F, interpret: interpret$F };
1990
+ _const.compile;
1991
+ _const.interpret;
1992
+
1993
+ const { Core: Core$p, Instance: Instance$w } = lib$1;
1994
+
1995
+
1996
+ const compile$E = (schema, ast) => Core$p.compileSchema(schema, ast);
1997
+
1998
+ const interpret$E = (contains, instance, ast, dynamicAnchors) => {
1999
+ return !Instance$w.typeOf(instance, "array") || Instance$w.some((item) => Core$p.interpretSchema(contains, item, ast, dynamicAnchors), instance);
2000
+ };
2001
+
2002
+ var contains = { compile: compile$E, interpret: interpret$E };
2003
+ contains.compile;
2004
+ contains.interpret;
2005
+
2006
+ const { Core: Core$o, Schema: Schema$G, Instance: Instance$v } = lib$1;
2007
+
2008
+
2009
+ const compile$D = async (schema, ast, parentSchema) => {
2010
+ const contains = await Core$o.compileSchema(schema, ast);
2011
+
2012
+ const minContainsSchema = await Schema$G.step("minContains", parentSchema);
2013
+ const minContains = Schema$G.typeOf(minContainsSchema, "number") ? Schema$G.value(minContainsSchema) : 1;
2014
+
2015
+ const maxContainsSchema = await Schema$G.step("maxContains", parentSchema);
2016
+ const maxContains = Schema$G.typeOf(maxContainsSchema, "number") ? Schema$G.value(maxContainsSchema) : Number.MAX_SAFE_INTEGER;
2017
+
2018
+ return { contains, minContains, maxContains };
2019
+ };
2020
+
2021
+ const interpret$D = ({ contains, minContains, maxContains }, instance, ast, dynamicAnchors) => {
2022
+ if (!Instance$v.typeOf(instance, "array")) {
2023
+ return true;
2024
+ }
2025
+
2026
+ const matches = Instance$v.reduce((matches, item) => {
2027
+ return Core$o.interpretSchema(contains, item, ast, dynamicAnchors) ? matches + 1 : matches;
2028
+ }, 0, instance);
2029
+ return matches >= minContains && matches <= maxContains;
2030
+ };
2031
+
2032
+ const collectEvaluatedItems$a = (keywordValue, instance, ast, dynamicAnchors) => {
2033
+ return interpret$D(keywordValue, instance, ast, dynamicAnchors) && Instance$v.reduce((matchedIndexes, item, itemIndex) => {
2034
+ return Core$o.interpretSchema(keywordValue.contains, item, ast, dynamicAnchors) ? matchedIndexes.add(itemIndex) : matchedIndexes;
2035
+ }, new Set(), instance);
2036
+ };
2037
+
2038
+ var containsMinContainsMaxContains = { compile: compile$D, interpret: interpret$D, collectEvaluatedItems: collectEvaluatedItems$a };
2039
+ containsMinContainsMaxContains.compile;
2040
+ containsMinContainsMaxContains.interpret;
2041
+ containsMinContainsMaxContains.collectEvaluatedItems;
2042
+
2043
+ const { Core: Core$n, Schema: Schema$F } = lib$1;
2044
+
2045
+
2046
+
2047
+ const compile$C = async (schema, ast) => {
2048
+ await lib$2.pipeline([
2049
+ Schema$F.entries,
2050
+ lib$2.map(([, definitionSchema]) => Core$n.compileSchema(definitionSchema, ast)),
2051
+ lib$2.all
2052
+ ], schema);
2053
+ };
2054
+
2055
+ const interpret$C = () => true;
2056
+
2057
+ var definitions = { compile: compile$C, interpret: interpret$C };
2058
+ definitions.compile;
2059
+ definitions.interpret;
2060
+
2061
+ const { Core: Core$m, Schema: Schema$E, Instance: Instance$u } = lib$1;
2062
+
2063
+
2064
+
2065
+ const compile$B = (schema, ast) => lib$2.pipeline([
2066
+ Schema$E.entries,
2067
+ lib$2.map(async ([key, dependency]) => {
2068
+ return [key, Schema$E.typeOf(dependency, "array") ? Schema$E.value(dependency) : await Core$m.compileSchema(dependency, ast)];
2069
+ }),
2070
+ lib$2.all
2071
+ ], schema);
2072
+
2073
+ const interpret$B = (dependencies, instance, ast, dynamicAnchors) => {
2074
+ const value = Instance$u.value(instance);
2075
+
2076
+ return !Instance$u.typeOf(instance, "object") || dependencies.every(([propertyName, dependency]) => {
2077
+ if (!(propertyName in value)) {
2078
+ return true;
2079
+ }
2080
+
2081
+ if (Array.isArray(dependency)) {
2082
+ return dependency.every((key) => key in value);
2083
+ } else {
2084
+ return Core$m.interpretSchema(dependency, instance, ast, dynamicAnchors);
2085
+ }
2086
+ });
2087
+ };
2088
+
2089
+ var dependencies = { compile: compile$B, interpret: interpret$B };
2090
+ dependencies.compile;
2091
+ dependencies.interpret;
2092
+
2093
+ const { Schema: Schema$D, Instance: Instance$t } = lib$1;
2094
+
2095
+
2096
+
2097
+ const compile$A = (schema) => lib$2.pipeline([
2098
+ Schema$D.entries,
2099
+ lib$2.map(([key, dependentRequired]) => [key, Schema$D.value(dependentRequired)]),
2100
+ lib$2.all
2101
+ ], schema);
2102
+
2103
+ const interpret$A = (dependentRequired, instance) => {
2104
+ const value = Instance$t.value(instance);
2105
+
2106
+ return !Instance$t.typeOf(instance, "object") || dependentRequired.every(([propertyName, required]) => {
2107
+ return !(propertyName in value) || required.every((key) => key in value);
2108
+ });
2109
+ };
2110
+
2111
+ var dependentRequired = { compile: compile$A, interpret: interpret$A };
2112
+ dependentRequired.compile;
2113
+ dependentRequired.interpret;
2114
+
2115
+ const { Core: Core$l, Schema: Schema$C, Instance: Instance$s } = lib$1;
2116
+
2117
+
2118
+
2119
+ const compile$z = (schema, ast) => lib$2.pipeline([
2120
+ Schema$C.entries,
2121
+ lib$2.map(async ([key, dependentSchema]) => [key, await Core$l.compileSchema(dependentSchema, ast)]),
2122
+ lib$2.all
2123
+ ], schema);
2124
+
2125
+ const interpret$z = (dependentSchemas, instance, ast, dynamicAnchors) => {
2126
+ const value = Instance$s.value(instance);
2127
+
2128
+ return !Instance$s.typeOf(instance, "object") || dependentSchemas.every(([propertyName, dependentSchema]) => {
2129
+ return !(propertyName in value) || Core$l.interpretSchema(dependentSchema, instance, ast, dynamicAnchors);
2130
+ });
2131
+ };
2132
+
2133
+ const collectEvaluatedProperties$9 = (dependentSchemas, instance, ast, dynamicAnchors) => {
2134
+ return dependentSchemas.reduce((acc, [propertyName, dependentSchema]) => {
2135
+ if (!acc || !Instance$s.has(propertyName, instance)) {
2136
+ return acc;
2137
+ }
2138
+
2139
+ const propertyNames = Core$l.collectEvaluatedProperties(dependentSchema, instance, ast, dynamicAnchors);
2140
+ return propertyNames !== false && acc.concat(propertyNames);
2141
+ }, []);
2142
+ };
2143
+
2144
+ var dependentSchemas = { compile: compile$z, interpret: interpret$z, collectEvaluatedProperties: collectEvaluatedProperties$9 };
2145
+ dependentSchemas.compile;
2146
+ dependentSchemas.interpret;
2147
+ dependentSchemas.collectEvaluatedProperties;
2148
+
2149
+ const { Schema: Schema$B, Instance: Instance$r } = lib$1;
2150
+
2151
+
2152
+
2153
+ const compile$y = (schema) => Schema$B.value(schema).map(fastestStableStringify);
2154
+ const interpret$y = (enum_, instance) => enum_.some((enumValue) => fastestStableStringify(Instance$r.value(instance)) === enumValue);
2155
+
2156
+ var _enum = { compile: compile$y, interpret: interpret$y };
2157
+ _enum.compile;
2158
+ _enum.interpret;
2159
+
2160
+ const { Schema: Schema$A, Instance: Instance$q } = lib$1;
2161
+
2162
+
2163
+ const compile$x = async (schema) => Schema$A.value(schema);
2164
+ const interpret$x = (exclusiveMaximum, instance) => !Instance$q.typeOf(instance, "number") || Instance$q.value(instance) < exclusiveMaximum;
2165
+
2166
+ var exclusiveMaximum = { compile: compile$x, interpret: interpret$x };
2167
+ exclusiveMaximum.compile;
2168
+ exclusiveMaximum.interpret;
2169
+
2170
+ const { Schema: Schema$z, Instance: Instance$p } = lib$1;
2171
+
2172
+
2173
+ const compile$w = async (schema) => Schema$z.value(schema);
2174
+ const interpret$w = (exclusiveMinimum, instance) => !Instance$p.typeOf(instance, "number") || Instance$p.value(instance) > exclusiveMinimum;
2175
+
2176
+ var exclusiveMinimum = { compile: compile$w, interpret: interpret$w };
2177
+ exclusiveMinimum.compile;
2178
+ exclusiveMinimum.interpret;
2179
+
2180
+ const { Core: Core$k } = lib$1;
2181
+
2182
+
2183
+ const compile$v = (schema, ast) => Core$k.compileSchema(schema, ast);
2184
+
2185
+ const interpret$v = (ifSchema, instance, ast, dynamicAnchors) => {
2186
+ Core$k.interpretSchema(ifSchema, instance, ast, dynamicAnchors);
2187
+ return true;
2188
+ };
2189
+
2190
+ const collectEvaluatedProperties$8 = (ifSchema, instance, ast, dynamicAnchors) => {
2191
+ return Core$k.collectEvaluatedProperties(ifSchema, instance, ast, dynamicAnchors) || [];
2192
+ };
2193
+
2194
+ const collectEvaluatedItems$9 = (ifSchema, instance, ast, dynamicAnchors) => {
2195
+ return Core$k.collectEvaluatedItems(ifSchema, instance, ast, dynamicAnchors) || new Set();
2196
+ };
2197
+
2198
+ var _if = { compile: compile$v, interpret: interpret$v, collectEvaluatedProperties: collectEvaluatedProperties$8, collectEvaluatedItems: collectEvaluatedItems$9 };
2199
+ _if.compile;
2200
+ _if.interpret;
2201
+ _if.collectEvaluatedProperties;
2202
+ _if.collectEvaluatedItems;
2203
+
2204
+ const { Core: Core$j, Schema: Schema$y } = lib$1;
2205
+
2206
+
2207
+ const compile$u = async (schema, ast, parentSchema) => {
2208
+ if (Schema$y.has("if", parentSchema)) {
2209
+ const ifSchema = await Schema$y.step("if", parentSchema);
2210
+ return [await Core$j.compileSchema(ifSchema, ast), await Core$j.compileSchema(schema, ast)];
2211
+ } else {
2212
+ return [];
2213
+ }
2214
+ };
2215
+
2216
+ const interpret$u = ([guard, block], instance, ast, dynamicAnchors) => {
2217
+ return guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors) || Core$j.interpretSchema(block, instance, ast, dynamicAnchors);
2218
+ };
2219
+
2220
+ // Interpret a schema without events being emitted
2221
+ const quietInterpretSchema$1 = (uri, instance, ast, dynamicAnchors) => {
2222
+ const nodes = ast[uri][2];
2223
+
2224
+ return typeof nodes === "boolean" ? nodes : nodes
2225
+ .every(([keywordId, , keywordValue]) => {
2226
+ return Core$j.getKeyword(keywordId).interpret(keywordValue, instance, ast, dynamicAnchors);
2227
+ });
2228
+ };
2229
+
2230
+ const collectEvaluatedProperties$7 = ([guard, block], instance, ast, dynamicAnchors) => {
2231
+ if (guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors)) {
2232
+ return [];
2233
+ }
2234
+
2235
+ return Core$j.collectEvaluatedProperties(block, instance, ast, dynamicAnchors);
2236
+ };
2237
+
2238
+ const collectEvaluatedItems$8 = ([guard, block], instance, ast, dynamicAnchors) => {
2239
+ if (guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors)) {
2240
+ return new Set();
2241
+ }
2242
+
2243
+ return Core$j.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
2244
+ };
2245
+
2246
+ var then = { compile: compile$u, interpret: interpret$u, collectEvaluatedProperties: collectEvaluatedProperties$7, collectEvaluatedItems: collectEvaluatedItems$8 };
2247
+ then.compile;
2248
+ then.interpret;
2249
+ then.collectEvaluatedProperties;
2250
+ then.collectEvaluatedItems;
2251
+
2252
+ const { Core: Core$i, Schema: Schema$x } = lib$1;
2253
+
2254
+
2255
+ const compile$t = async (schema, ast, parentSchema) => {
2256
+ if (Schema$x.has("if", parentSchema)) {
2257
+ const ifSchema = await Schema$x.step("if", parentSchema);
2258
+ return [await Core$i.compileSchema(ifSchema, ast), await Core$i.compileSchema(schema, ast)];
2259
+ } else {
2260
+ return [];
2261
+ }
2262
+ };
2263
+
2264
+ const interpret$t = ([guard, block], instance, ast, dynamicAnchors) => {
2265
+ return guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors) || Core$i.interpretSchema(block, instance, ast, dynamicAnchors);
2266
+ };
2267
+
2268
+ // Interpret a schema without events being emitted
2269
+ const quietInterpretSchema = (uri, instance, ast, dynamicAnchors) => {
2270
+ const nodes = ast[uri][2];
2271
+
2272
+ return typeof nodes === "boolean" ? nodes : nodes
2273
+ .every(([keywordId, , keywordValue]) => {
2274
+ return Core$i.getKeyword(keywordId).interpret(keywordValue, instance, ast, dynamicAnchors);
2275
+ });
2276
+ };
2277
+
2278
+ const collectEvaluatedProperties$6 = ([guard, block], instance, ast, dynamicAnchors) => {
2279
+ if (guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors)) {
2280
+ return [];
2281
+ }
2282
+
2283
+ return Core$i.collectEvaluatedProperties(block, instance, ast, dynamicAnchors);
2284
+ };
2285
+
2286
+ const collectEvaluatedItems$7 = ([guard, block], instance, ast, dynamicAnchors) => {
2287
+ if (guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors)) {
2288
+ return new Set();
2289
+ }
2290
+
2291
+ return Core$i.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
2292
+ };
2293
+
2294
+ var _else = { compile: compile$t, interpret: interpret$t, collectEvaluatedProperties: collectEvaluatedProperties$6, collectEvaluatedItems: collectEvaluatedItems$7 };
2295
+ _else.compile;
2296
+ _else.interpret;
2297
+ _else.collectEvaluatedProperties;
2298
+ _else.collectEvaluatedItems;
2299
+
2300
+ const { Core: Core$h, Schema: Schema$w, Instance: Instance$o } = lib$1;
2301
+
2302
+
2303
+ const compile$s = async (schema, ast) => {
2304
+ if (Schema$w.typeOf(schema, "array")) {
2305
+ const tupleItems = await Schema$w.map((itemSchema) => Core$h.compileSchema(itemSchema, ast), schema);
2306
+ return Promise.all(tupleItems);
2307
+ } else {
2308
+ return Core$h.compileSchema(schema, ast);
2309
+ }
2310
+ };
2311
+
2312
+ const interpret$s = (items, instance, ast, dynamicAnchors) => {
2313
+ if (!Instance$o.typeOf(instance, "array")) {
2314
+ return true;
2315
+ }
2316
+
2317
+ if (typeof items === "string") {
2318
+ return Instance$o.every((itemValue) => Core$h.interpretSchema(items, itemValue, ast, dynamicAnchors), instance);
2319
+ } else {
2320
+ return Instance$o.every((item, ndx) => !(ndx in items) || Core$h.interpretSchema(items[ndx], item, ast, dynamicAnchors), instance);
2321
+ }
2322
+ };
2323
+
2324
+ const collectEvaluatedItems$6 = (items, instance, ast, dynamicAnchors) => {
2325
+ return interpret$s(items, instance, ast, dynamicAnchors) && (typeof items === "string"
2326
+ ? new Set(Instance$o.map((item, itemIndex) => itemIndex, instance))
2327
+ : new Set(items.map((item, itemIndex) => itemIndex)));
2328
+ };
2329
+
2330
+ var items = { compile: compile$s, interpret: interpret$s, collectEvaluatedItems: collectEvaluatedItems$6 };
2331
+ items.compile;
2332
+ items.interpret;
2333
+ items.collectEvaluatedItems;
2334
+
2335
+ const { Core: Core$g, Schema: Schema$v, Instance: Instance$n } = lib$1;
2336
+
2337
+
2338
+ const compile$r = async (schema, ast, parentSchema) => {
2339
+ const items = await Schema$v.step("prefixItems", parentSchema);
2340
+ const numberOfPrefixItems = Schema$v.typeOf(items, "array") ? Schema$v.length(items) : 0;
2341
+
2342
+ return [numberOfPrefixItems, await Core$g.compileSchema(schema, ast)];
2343
+ };
2344
+
2345
+ const interpret$r = ([numberOfPrefixItems, items], instance, ast, dynamicAnchors) => {
2346
+ if (!Instance$n.typeOf(instance, "array")) {
2347
+ return true;
2348
+ }
2349
+
2350
+ return Instance$n.every((item, ndx) => ndx < numberOfPrefixItems || Core$g.interpretSchema(items, item, ast, dynamicAnchors), instance);
2351
+ };
2352
+
2353
+ const collectEvaluatedItems$5 = (keywordValue, instance, ast, dynamicAnchors) => {
2354
+ return interpret$r(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$n.map((item, ndx) => ndx, instance));
2355
+ };
2356
+
2357
+ var items202012 = { compile: compile$r, interpret: interpret$r, collectEvaluatedItems: collectEvaluatedItems$5 };
2358
+ items202012.compile;
2359
+ items202012.interpret;
2360
+ items202012.collectEvaluatedItems;
2361
+
2362
+ const { Schema: Schema$u, Instance: Instance$m } = lib$1;
2363
+
2364
+
2365
+ const compile$q = (schema) => Schema$u.value(schema);
2366
+ const interpret$q = (maxItems, instance) => !Instance$m.typeOf(instance, "array") || Instance$m.length(instance) <= maxItems;
2367
+
2368
+ var maxItems = { compile: compile$q, interpret: interpret$q };
2369
+ maxItems.compile;
2370
+ maxItems.interpret;
2371
+
2372
+ const { Schema: Schema$t, Instance: Instance$l } = lib$1;
2373
+
2374
+
2375
+ const compile$p = (schema) => Schema$t.value(schema);
2376
+ const interpret$p = (maxLength, instance) => !Instance$l.typeOf(instance, "string") || Instance$l.length(instance) <= maxLength;
2377
+
2378
+ var maxLength = { compile: compile$p, interpret: interpret$p };
2379
+ maxLength.compile;
2380
+ maxLength.interpret;
2381
+
2382
+ const { Schema: Schema$s, Instance: Instance$k } = lib$1;
2383
+
2384
+
2385
+ const compile$o = (schema) => Schema$s.value(schema);
2386
+ const interpret$o = (maxLength, instance) => !Instance$k.typeOf(instance, "string") || [...Instance$k.value(instance)].length <= maxLength;
2387
+
2388
+ var maxLength6 = { compile: compile$o, interpret: interpret$o };
2389
+ maxLength6.compile;
2390
+ maxLength6.interpret;
2391
+
2392
+ const { Schema: Schema$r, Instance: Instance$j } = lib$1;
2393
+
2394
+
2395
+ const compile$n = (schema) => Schema$r.value(schema);
2396
+ const interpret$n = (maxProperties, instance) => !Instance$j.typeOf(instance, "object") || Instance$j.keys(instance).length <= maxProperties;
2397
+
2398
+ var maxProperties = { compile: compile$n, interpret: interpret$n };
2399
+ maxProperties.compile;
2400
+ maxProperties.interpret;
2401
+
2402
+ const { Schema: Schema$q, Instance: Instance$i } = lib$1;
2403
+
2404
+
2405
+ const compile$m = async (schema, ast, parentSchema) => {
2406
+ const exclusiveMaximum = await Schema$q.step("exclusiveMaximum", parentSchema);
2407
+ const isExclusive = Schema$q.value(exclusiveMaximum);
2408
+
2409
+ return [Schema$q.value(schema), isExclusive];
2410
+ };
2411
+
2412
+ const interpret$m = ([maximum, isExclusive], instance) => {
2413
+ if (!Instance$i.typeOf(instance, "number")) {
2414
+ return true;
2415
+ }
2416
+
2417
+ const value = Instance$i.value(instance);
2418
+ return isExclusive ? value < maximum : value <= maximum;
2419
+ };
2420
+
2421
+ var maximumExclusiveMaximum = { compile: compile$m, interpret: interpret$m };
2422
+ maximumExclusiveMaximum.compile;
2423
+ maximumExclusiveMaximum.interpret;
2424
+
2425
+ const { Schema: Schema$p, Instance: Instance$h } = lib$1;
2426
+
2427
+
2428
+ const compile$l = async (schema) => Schema$p.value(schema);
2429
+ const interpret$l = (maximum, instance) => !Instance$h.typeOf(instance, "number") || Instance$h.value(instance) <= maximum;
2430
+
2431
+ var maximum = { compile: compile$l, interpret: interpret$l };
2432
+ maximum.compile;
2433
+ maximum.interpret;
2434
+
2435
+ const { Schema: Schema$o, Instance: Instance$g } = lib$1;
2436
+
2437
+
2438
+ const compile$k = (schema) => Schema$o.value(schema);
2439
+ const interpret$k = (minItems, instance) => !Instance$g.typeOf(instance, "array") || Instance$g.length(instance) >= minItems;
2440
+
2441
+ var minItems = { compile: compile$k, interpret: interpret$k };
2442
+ minItems.compile;
2443
+ minItems.interpret;
2444
+
2445
+ const { Schema: Schema$n, Instance: Instance$f } = lib$1;
2446
+
2447
+
2448
+ const compile$j = (schema) => Schema$n.value(schema);
2449
+ const interpret$j = (minLength, instance) => !Instance$f.typeOf(instance, "string") || Instance$f.length(instance) >= minLength;
2450
+
2451
+ var minLength = { compile: compile$j, interpret: interpret$j };
2452
+ minLength.compile;
2453
+ minLength.interpret;
2454
+
2455
+ const { Schema: Schema$m, Instance: Instance$e } = lib$1;
2456
+
2457
+
2458
+ const compile$i = (schema) => Schema$m.value(schema);
2459
+ const interpret$i = (minLength, instance) => !Instance$e.typeOf(instance, "string") || [...Instance$e.value(instance)].length >= minLength;
2460
+
2461
+ var minLength6 = { compile: compile$i, interpret: interpret$i };
2462
+ minLength6.compile;
2463
+ minLength6.interpret;
2464
+
2465
+ const { Schema: Schema$l, Instance: Instance$d } = lib$1;
2466
+
2467
+
2468
+ const compile$h = (schema) => Schema$l.value(schema);
2469
+ const interpret$h = (minProperties, instance) => !Instance$d.typeOf(instance, "object") || Instance$d.keys(instance).length >= minProperties;
2470
+
2471
+ var minProperties = { compile: compile$h, interpret: interpret$h };
2472
+ minProperties.compile;
2473
+ minProperties.interpret;
2474
+
2475
+ const { Schema: Schema$k, Instance: Instance$c } = lib$1;
2476
+
2477
+
2478
+ const compile$g = async (schema, ast, parentSchema) => {
2479
+ const exclusiveMinimum = await Schema$k.step("exclusiveMinimum", parentSchema);
2480
+ const isExclusive = Schema$k.value(exclusiveMinimum);
2481
+
2482
+ return [Schema$k.value(schema), isExclusive];
2483
+ };
2484
+
2485
+ const interpret$g = ([minimum, isExclusive], instance) => {
2486
+ if (!Instance$c.typeOf(instance, "number")) {
2487
+ return true;
2488
+ }
2489
+
2490
+ const value = Instance$c.value(instance);
2491
+ return isExclusive ? value > minimum : value >= minimum;
2492
+ };
2493
+
2494
+ var minimumExclusiveMinimum = { compile: compile$g, interpret: interpret$g };
2495
+ minimumExclusiveMinimum.compile;
2496
+ minimumExclusiveMinimum.interpret;
2497
+
2498
+ const { Schema: Schema$j, Instance: Instance$b } = lib$1;
2499
+
2500
+
2501
+ const compile$f = async (schema) => Schema$j.value(schema);
2502
+ const interpret$f = (minimum, instance) => !Instance$b.typeOf(instance, "number") || Instance$b.value(instance) >= minimum;
2503
+
2504
+ var minimum = { compile: compile$f, interpret: interpret$f };
2505
+ minimum.compile;
2506
+ minimum.interpret;
2507
+
2508
+ const { Schema: Schema$i, Instance: Instance$a } = lib$1;
2509
+
2510
+
2511
+ const compile$e = (schema) => Schema$i.value(schema);
2512
+
2513
+ const interpret$e = (multipleOf, instance) => {
2514
+ if (!Instance$a.typeOf(instance, "number")) {
2515
+ return true;
2516
+ }
2517
+
2518
+ const remainder = Instance$a.value(instance) % multipleOf;
2519
+ return numberEqual(0, remainder) || numberEqual(multipleOf, remainder);
2520
+ };
2521
+
2522
+ const numberEqual = (a, b) => Math.abs(a - b) < 1.19209290e-7;
2523
+
2524
+ var multipleOf = { compile: compile$e, interpret: interpret$e };
2525
+ multipleOf.compile;
2526
+ multipleOf.interpret;
2527
+
2528
+ const { Core: Core$f } = lib$1;
2529
+
2530
+
2531
+ const compile$d = Core$f.compileSchema;
2532
+ const interpret$d = (not, instance, ast, dynamicAnchors) => !Core$f.interpretSchema(not, instance, ast, dynamicAnchors);
2533
+
2534
+ var not = { compile: compile$d, interpret: interpret$d };
2535
+ not.compile;
2536
+ not.interpret;
2537
+
2538
+ const { Core: Core$e, Schema: Schema$h } = lib$1;
2539
+
2540
+
2541
+ const compile$c = async (schema, ast) => {
2542
+ const oneOf = await Schema$h.map((itemSchema) => Core$e.compileSchema(itemSchema, ast), schema);
2543
+ return Promise.all(oneOf);
2544
+ };
2545
+
2546
+ const interpret$c = (oneOf, instance, ast, dynamicAnchors) => {
2547
+ let validCount = 0;
2548
+ for (const schemaUrl of oneOf) {
2549
+ if (Core$e.interpretSchema(schemaUrl, instance, ast, dynamicAnchors)) {
2550
+ validCount++;
2551
+ }
2552
+
2553
+ if (validCount > 1) {
2554
+ break;
2555
+ }
2556
+ }
2557
+
2558
+ return validCount === 1;
2559
+ };
2560
+
2561
+ const collectEvaluatedProperties$5 = (oneOf, instance, ast, dynamicAnchors) => {
2562
+ let validCount = 0;
2563
+ return oneOf.reduce((acc, schemaUrl) => {
2564
+ if (validCount > 1) {
2565
+ return false;
2566
+ }
2567
+
2568
+ const propertyNames = Core$e.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors);
2569
+ return propertyNames ? validCount++ === 0 && propertyNames : acc;
2570
+ }, false);
2571
+ };
2572
+
2573
+ const collectEvaluatedItems$4 = (oneOf, instance, ast, dynamicAnchors) => {
2574
+ let validCount = 0;
2575
+ return oneOf.reduce((acc, schemaUrl) => {
2576
+ if (validCount > 1) {
2577
+ return false;
2578
+ }
2579
+
2580
+ const itemIndexes = Core$e.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors);
2581
+ return itemIndexes ? validCount++ === 0 && itemIndexes : acc;
2582
+ }, false);
2583
+ };
2584
+
2585
+ var oneOf = { compile: compile$c, interpret: interpret$c, collectEvaluatedProperties: collectEvaluatedProperties$5, collectEvaluatedItems: collectEvaluatedItems$4 };
2586
+ oneOf.compile;
2587
+ oneOf.interpret;
2588
+ oneOf.collectEvaluatedProperties;
2589
+ oneOf.collectEvaluatedItems;
2590
+
2591
+ const { Schema: Schema$g, Instance: Instance$9 } = lib$1;
2592
+
2593
+
2594
+ const compile$b = (schema) => new RegExp(Schema$g.value(schema), "u");
2595
+ const interpret$b = (pattern, instance) => !Instance$9.typeOf(instance, "string") || pattern.test(Instance$9.value(instance));
2596
+
2597
+ var pattern = { compile: compile$b, interpret: interpret$b };
2598
+ pattern.compile;
2599
+ pattern.interpret;
2600
+
2601
+ const { Core: Core$d, Schema: Schema$f, Instance: Instance$8 } = lib$1;
2602
+
2603
+
2604
+
2605
+ const compile$a = (schema, ast) => lib$2.pipeline([
2606
+ Schema$f.entries,
2607
+ lib$2.map(async ([pattern, propertySchema]) => [new RegExp(pattern, "u"), await Core$d.compileSchema(propertySchema, ast)]),
2608
+ lib$2.all
2609
+ ], schema);
2610
+
2611
+ const interpret$a = (patternProperties, instance, ast, dynamicAnchors) => {
2612
+ return !Instance$8.typeOf(instance, "object") || patternProperties.every(([pattern, schemaUrl]) => {
2613
+ return Instance$8.entries(instance)
2614
+ .filter(([propertyName]) => pattern.test(propertyName))
2615
+ .every(([, propertyValue]) => Core$d.interpretSchema(schemaUrl, propertyValue, ast, dynamicAnchors));
2616
+ });
2617
+ };
2618
+
2619
+ const collectEvaluatedProperties$4 = (patternProperties, instance, ast, dynamicAnchors) => {
2620
+ return interpret$a(patternProperties, instance, ast, dynamicAnchors) && patternProperties.map(([pattern]) => pattern);
2621
+ };
2622
+
2623
+ var patternProperties = { compile: compile$a, interpret: interpret$a, collectEvaluatedProperties: collectEvaluatedProperties$4 };
2624
+ patternProperties.compile;
2625
+ patternProperties.interpret;
2626
+ patternProperties.collectEvaluatedProperties;
2627
+
2628
+ const isObject = (value) => typeof value === "object" && !Array.isArray(value) && value !== null;
2629
+ const escapeRegExp$1 = (string) => string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
2630
+
2631
+ const splitUrl$1 = (url) => {
2632
+ const indexOfHash = url.indexOf("#");
2633
+ const ndx = indexOfHash === -1 ? url.length : indexOfHash;
2634
+ const urlReference = url.slice(0, ndx);
2635
+ const urlFragment = url.slice(ndx + 1);
2636
+
2637
+ return [decodeURI(urlReference), decodeURI(urlFragment)];
2638
+ };
2639
+
2640
+ var common = { isObject, escapeRegExp: escapeRegExp$1, splitUrl: splitUrl$1 };
2641
+
2642
+ const { Core: Core$c, Schema: Schema$e, Instance: Instance$7 } = lib$1;
2643
+
2644
+ const { escapeRegExp } = common;
2645
+
2646
+
2647
+ const compile$9 = (schema, ast) => lib$2.pipeline([
2648
+ Schema$e.entries,
2649
+ lib$2.reduce(async (acc, [propertyName, propertySchema]) => {
2650
+ acc[propertyName] = await Core$c.compileSchema(propertySchema, ast);
2651
+ return acc;
2652
+ }, Object.create(null))
2653
+ ], schema);
2654
+
2655
+ const interpret$9 = (properties, instance, ast, dynamicAnchors) => {
2656
+ return !Instance$7.typeOf(instance, "object") || Instance$7.entries(instance)
2657
+ .filter(([propertyName]) => propertyName in properties)
2658
+ .every(([propertyName, schemaUrl]) => Core$c.interpretSchema(properties[propertyName], schemaUrl, ast, dynamicAnchors));
2659
+ };
2660
+
2661
+ const collectEvaluatedProperties$3 = (properties, instance, ast, dynamicAnchors) => {
2662
+ return interpret$9(properties, instance, ast, dynamicAnchors) && Object.keys(properties)
2663
+ .map((propertyName) => new RegExp(`^${escapeRegExp(propertyName)}$`));
2664
+ };
2665
+
2666
+ var properties = { compile: compile$9, interpret: interpret$9, collectEvaluatedProperties: collectEvaluatedProperties$3 };
2667
+ properties.compile;
2668
+ properties.interpret;
2669
+ properties.collectEvaluatedProperties;
2670
+
2671
+ const { Core: Core$b, Instance: Instance$6 } = lib$1;
2672
+
2673
+
2674
+ const compile$8 = (schema, ast) => Core$b.compileSchema(schema, ast);
2675
+
2676
+ const interpret$8 = (propertyNames, instance, ast, dynamicAnchors) => {
2677
+ return !Instance$6.typeOf(instance, "object") || Instance$6.keys(instance)
2678
+ .every((key) => Core$b.interpretSchema(propertyNames, Instance$6.cons(key), ast, dynamicAnchors));
2679
+ };
2680
+
2681
+ var propertyNames = { compile: compile$8, interpret: interpret$8 };
2682
+ propertyNames.compile;
2683
+ propertyNames.interpret;
2684
+
2685
+ const { Core: Core$a, Schema: Schema$d } = lib$1;
2686
+ const { splitUrl } = common;
2687
+
2688
+
2689
+ const compile$7 = async (dynamicRef, ast) => {
2690
+ const [, fragment] = splitUrl(Schema$d.value(dynamicRef));
2691
+ const referencedSchema = await Schema$d.get(Schema$d.value(dynamicRef), dynamicRef);
2692
+ await Core$a.compileSchema(referencedSchema, ast);
2693
+ return [referencedSchema.id, fragment];
2694
+ };
2695
+
2696
+ const interpret$7 = ([id, fragment], instance, ast, dynamicAnchors) => {
2697
+ if (fragment in ast.metaData[id].dynamicAnchors) {
2698
+ return Core$a.interpretSchema(dynamicAnchors[fragment], instance, ast, dynamicAnchors);
2699
+ } else {
2700
+ const pointer = Schema$d.getAnchorPointer(ast.metaData[id], fragment);
2701
+ return Core$a.interpretSchema(`${id}#${encodeURI(pointer)}`, instance, ast, dynamicAnchors);
2702
+ }
2703
+ };
2704
+
2705
+ const collectEvaluatedProperties$2 = Core$a.collectEvaluatedProperties;
2706
+ const collectEvaluatedItems$3 = Core$a.collectEvaluatedItems;
2707
+
2708
+ var dynamicRef = { compile: compile$7, interpret: interpret$7, collectEvaluatedProperties: collectEvaluatedProperties$2, collectEvaluatedItems: collectEvaluatedItems$3 };
2709
+ dynamicRef.compile;
2710
+ dynamicRef.interpret;
2711
+ dynamicRef.collectEvaluatedProperties;
2712
+ dynamicRef.collectEvaluatedItems;
2713
+
2714
+ const { Core: Core$9, Schema: Schema$c } = lib$1;
2715
+
2716
+
2717
+ const compile$6 = async (ref, ast) => {
2718
+ const referencedSchema = await Schema$c.get(Schema$c.value(ref), ref);
2719
+ return Core$9.compileSchema(referencedSchema, ast);
2720
+ };
2721
+
2722
+ const interpret$6 = Core$9.interpretSchema;
2723
+ const collectEvaluatedProperties$1 = Core$9.collectEvaluatedProperties;
2724
+ const collectEvaluatedItems$2 = Core$9.collectEvaluatedItems;
2725
+
2726
+ var ref = { compile: compile$6, interpret: interpret$6, collectEvaluatedProperties: collectEvaluatedProperties$1, collectEvaluatedItems: collectEvaluatedItems$2 };
2727
+ ref.compile;
2728
+ ref.interpret;
2729
+ ref.collectEvaluatedProperties;
2730
+ ref.collectEvaluatedItems;
2731
+
2732
+ const { Schema: Schema$b, Instance: Instance$5 } = lib$1;
2733
+
2734
+
2735
+ const compile$5 = (schema) => Schema$b.value(schema);
2736
+
2737
+ const interpret$5 = (required, instance) => {
2738
+ return !Instance$5.typeOf(instance, "object") || required.every((propertyName) => Object.prototype.hasOwnProperty.call(Instance$5.value(instance), propertyName));
2739
+ };
2740
+
2741
+ var required = { compile: compile$5, interpret: interpret$5 };
2742
+ required.compile;
2743
+ required.interpret;
2744
+
2745
+ const { Core: Core$8, Schema: Schema$a, Instance: Instance$4 } = lib$1;
2746
+
2747
+
2748
+
2749
+ const compile$4 = (schema, ast) => {
2750
+ return lib$2.pipeline([
2751
+ Schema$a.map((itemSchema) => Core$8.compileSchema(itemSchema, ast)),
2752
+ lib$2.all
2753
+ ], schema);
2754
+ };
2755
+
2756
+ const interpret$4 = (items, instance, ast, dynamicAnchors) => {
2757
+ if (!Instance$4.typeOf(instance, "array")) {
2758
+ return true;
2759
+ }
2760
+
2761
+ return Instance$4.every((item, ndx) => !(ndx in items) || Core$8.interpretSchema(items[ndx], item, ast, dynamicAnchors), instance);
2762
+ };
2763
+
2764
+ const collectEvaluatedItems$1 = (items, instance, ast, dynamicAnchors) => {
2765
+ return interpret$4(items, instance, ast, dynamicAnchors) && new Set(items.map((item, ndx) => ndx));
2766
+ };
2767
+
2768
+ var tupleItems = { compile: compile$4, interpret: interpret$4, collectEvaluatedItems: collectEvaluatedItems$1 };
2769
+ tupleItems.compile;
2770
+ tupleItems.interpret;
2771
+ tupleItems.collectEvaluatedItems;
2772
+
2773
+ const { Schema: Schema$9, Instance: Instance$3 } = lib$1;
2774
+
2775
+
2776
+ const compile$3 = (schema) => Schema$9.value(schema);
2777
+ const interpret$3 = (type, instance) => typeof type === "string" ? Instance$3.typeOf(instance, type) : type.some(Instance$3.typeOf(instance));
2778
+
2779
+ var type = { compile: compile$3, interpret: interpret$3 };
2780
+ type.compile;
2781
+ type.interpret;
2782
+
2783
+ const { Core: Core$7, Schema: Schema$8, Instance: Instance$2 } = lib$1;
2784
+
2785
+
2786
+ const compile$2 = async (schema, ast, parentSchema) => {
2787
+ return [Schema$8.uri(parentSchema), await Core$7.compileSchema(schema, ast)];
2788
+ };
2789
+
2790
+ const interpret$2 = ([schemaUrl, unevaluatedItems], instance, ast, dynamicAnchors) => {
2791
+ if (!Instance$2.typeOf(instance, "array")) {
2792
+ return true;
2793
+ }
2794
+
2795
+ const itemIndexes = Core$7.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors, true);
2796
+ return itemIndexes === false || Instance$2.every((item, itemIndex) => {
2797
+ return itemIndexes.has(itemIndex) || Core$7.interpretSchema(unevaluatedItems, Instance$2.step(itemIndex, instance), ast, dynamicAnchors);
2798
+ }, instance);
2799
+ };
2800
+
2801
+ const collectEvaluatedItems = (keywordValue, instance, ast, dynamicAnchors) => {
2802
+ return interpret$2(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$2.map((item, ndx) => ndx, instance));
2803
+ };
2804
+
2805
+ var unevaluatedItems = { compile: compile$2, interpret: interpret$2, collectEvaluatedItems };
2806
+ unevaluatedItems.compile;
2807
+ unevaluatedItems.interpret;
2808
+ unevaluatedItems.collectEvaluatedItems;
2809
+
2810
+ const { Core: Core$6, Schema: Schema$7, Instance: Instance$1 } = lib$1;
2811
+
2812
+
2813
+ const compile$1 = async (schema, ast, parentSchema) => {
2814
+ return [Schema$7.uri(parentSchema), await Core$6.compileSchema(schema, ast)];
2815
+ };
2816
+
2817
+ const interpret$1 = ([schemaUrl, unevaluatedProperties], instance, ast, dynamicAnchors) => {
2818
+ if (!Instance$1.typeOf(instance, "object")) {
2819
+ return true;
2820
+ }
2821
+
2822
+ const evaluatedPropertyNames = Core$6.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors, true);
2823
+
2824
+ return !evaluatedPropertyNames || Instance$1.entries(instance)
2825
+ .filter(([propertyName]) => !evaluatedPropertyNames.some((pattern) => propertyName.match(pattern)))
2826
+ .every(([, property]) => Core$6.interpretSchema(unevaluatedProperties, property, ast, dynamicAnchors));
2827
+ };
2828
+
2829
+ const collectEvaluatedProperties = (keywordValue, instance, ast, dynamicAnchors) =>{
2830
+ return interpret$1(keywordValue, instance, ast, dynamicAnchors) && [new RegExp("")];
2831
+ };
2832
+
2833
+ var unevaluatedProperties = { compile: compile$1, interpret: interpret$1, collectEvaluatedProperties };
2834
+ unevaluatedProperties.compile;
2835
+ unevaluatedProperties.interpret;
2836
+ unevaluatedProperties.collectEvaluatedProperties;
2837
+
2838
+ const { Schema: Schema$6, Instance } = lib$1;
2839
+
2840
+
2841
+
2842
+ const compile = (schema) => Schema$6.value(schema);
2843
+
2844
+ const interpret = (uniqueItems, instance) => {
2845
+ if (!Instance.typeOf(instance, "array") || uniqueItems === false) {
2846
+ return true;
2847
+ }
2848
+
2849
+ const normalizedItems = Instance.map((item) => fastestStableStringify(Instance.value(item)), instance);
2850
+ return new Set(normalizedItems).size === normalizedItems.length;
2851
+ };
2852
+
2853
+ var uniqueItems = { compile, interpret };
2854
+ uniqueItems.compile;
2855
+ uniqueItems.interpret;
2856
+
2857
+ const { Keywords } = lib$1;
2858
+
2859
+
2860
+ var keywords = {
2861
+ additionalItems: additionalItems,
2862
+ additionalItems6: additionalItems6,
2863
+ additionalProperties: additionalProperties,
2864
+ additionalProperties6: additionalProperties6,
2865
+ allOf: allOf,
2866
+ anyOf: anyOf,
2867
+ const: _const,
2868
+ contains: contains,
2869
+ containsMinContainsMaxContains: containsMinContainsMaxContains,
2870
+ definitions: definitions,
2871
+ dependencies: dependencies,
2872
+ dependentRequired: dependentRequired,
2873
+ dependentSchemas: dependentSchemas,
2874
+ enum: _enum,
2875
+ exclusiveMaximum: exclusiveMaximum,
2876
+ exclusiveMinimum: exclusiveMinimum,
2877
+ if: _if,
2878
+ then: then,
2879
+ else: _else,
2880
+ items: items,
2881
+ items202012: items202012,
2882
+ maxItems: maxItems,
2883
+ maxLength: maxLength,
2884
+ maxLength6: maxLength6,
2885
+ maxProperties: maxProperties,
2886
+ maximumExclusiveMaximum: maximumExclusiveMaximum,
2887
+ maximum: maximum,
2888
+ metaData: Keywords.metaData,
2889
+ minItems: minItems,
2890
+ minLength: minLength,
2891
+ minLength6: minLength6,
2892
+ minProperties: minProperties,
2893
+ minimumExclusiveMinimum: minimumExclusiveMinimum,
2894
+ minimum: minimum,
2895
+ multipleOf: multipleOf,
2896
+ not: not,
2897
+ oneOf: oneOf,
2898
+ pattern: pattern,
2899
+ patternProperties: patternProperties,
2900
+ properties: properties,
2901
+ propertyNames: propertyNames,
2902
+ dynamicRef: dynamicRef,
2903
+ ref: ref,
2904
+ required: required,
2905
+ tupleItems: tupleItems,
2906
+ type: type,
2907
+ unevaluatedItems: unevaluatedItems,
2908
+ unevaluatedProperties: unevaluatedProperties,
2909
+ uniqueItems: uniqueItems,
2910
+ validate: Keywords.validate
2911
+ };
2912
+ keywords.additionalItems;
2913
+ keywords.additionalItems6;
2914
+ keywords.additionalProperties;
2915
+ keywords.additionalProperties6;
2916
+ keywords.allOf;
2917
+ keywords.anyOf;
2918
+ keywords.contains;
2919
+ keywords.containsMinContainsMaxContains;
2920
+ keywords.definitions;
2921
+ keywords.dependencies;
2922
+ keywords.dependentRequired;
2923
+ keywords.dependentSchemas;
2924
+ keywords.exclusiveMaximum;
2925
+ keywords.exclusiveMinimum;
2926
+ keywords.then;
2927
+ keywords.items;
2928
+ keywords.items202012;
2929
+ keywords.maxItems;
2930
+ keywords.maxLength;
2931
+ keywords.maxLength6;
2932
+ keywords.maxProperties;
2933
+ keywords.maximumExclusiveMaximum;
2934
+ keywords.maximum;
2935
+ keywords.metaData;
2936
+ keywords.minItems;
2937
+ keywords.minLength;
2938
+ keywords.minLength6;
2939
+ keywords.minProperties;
2940
+ keywords.minimumExclusiveMinimum;
2941
+ keywords.minimum;
2942
+ keywords.multipleOf;
2943
+ keywords.not;
2944
+ keywords.oneOf;
2945
+ keywords.pattern;
2946
+ keywords.patternProperties;
2947
+ keywords.properties;
2948
+ keywords.propertyNames;
2949
+ keywords.dynamicRef;
2950
+ keywords.ref;
2951
+ keywords.required;
2952
+ keywords.tupleItems;
2953
+ keywords.type;
2954
+ keywords.unevaluatedItems;
2955
+ keywords.unevaluatedProperties;
2956
+ keywords.uniqueItems;
2957
+ keywords.validate;
2958
+
2959
+ var schema$4 = `{
2960
+ "id": "http://json-schema.org/draft-04/schema#",
2961
+ "$schema": "http://json-schema.org/draft-04/schema#",
2962
+ "description": "Core schema meta-schema",
2963
+ "definitions": {
2964
+ "schemaArray": {
2965
+ "type": "array",
2966
+ "minItems": 1,
2967
+ "items": { "$ref": "#" }
2968
+ },
2969
+ "positiveInteger": {
2970
+ "type": "integer",
2971
+ "minimum": 0
2972
+ },
2973
+ "positiveIntegerDefault0": {
2974
+ "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
2975
+ },
2976
+ "simpleTypes": {
2977
+ "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
2978
+ },
2979
+ "stringArray": {
2980
+ "type": "array",
2981
+ "items": { "type": "string" },
2982
+ "minItems": 1,
2983
+ "uniqueItems": true
2984
+ }
2985
+ },
2986
+ "type": "object",
2987
+ "properties": {
2988
+ "id": {
2989
+ "type": "string"
2990
+ },
2991
+ "$schema": {
2992
+ "type": "string"
2993
+ },
2994
+ "title": {
2995
+ "type": "string"
2996
+ },
2997
+ "description": {
2998
+ "type": "string"
2999
+ },
3000
+ "default": {},
3001
+ "multipleOf": {
3002
+ "type": "number",
3003
+ "minimum": 0,
3004
+ "exclusiveMinimum": true
3005
+ },
3006
+ "maximum": {
3007
+ "type": "number"
3008
+ },
3009
+ "exclusiveMaximum": {
3010
+ "type": "boolean",
3011
+ "default": false
3012
+ },
3013
+ "minimum": {
3014
+ "type": "number"
3015
+ },
3016
+ "exclusiveMinimum": {
3017
+ "type": "boolean",
3018
+ "default": false
3019
+ },
3020
+ "maxLength": { "$ref": "#/definitions/positiveInteger" },
3021
+ "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
3022
+ "pattern": {
3023
+ "type": "string",
3024
+ "format": "regex"
3025
+ },
3026
+ "additionalItems": {
3027
+ "anyOf": [
3028
+ { "type": "boolean" },
3029
+ { "$ref": "#" }
3030
+ ],
3031
+ "default": {}
3032
+ },
3033
+ "items": {
3034
+ "anyOf": [
3035
+ { "$ref": "#" },
3036
+ { "$ref": "#/definitions/schemaArray" }
3037
+ ],
3038
+ "default": {}
3039
+ },
3040
+ "maxItems": { "$ref": "#/definitions/positiveInteger" },
3041
+ "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
3042
+ "uniqueItems": {
3043
+ "type": "boolean",
3044
+ "default": false
3045
+ },
3046
+ "maxProperties": { "$ref": "#/definitions/positiveInteger" },
3047
+ "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
3048
+ "required": { "$ref": "#/definitions/stringArray" },
3049
+ "additionalProperties": {
3050
+ "anyOf": [
3051
+ { "type": "boolean" },
3052
+ { "$ref": "#" }
3053
+ ],
3054
+ "default": {}
3055
+ },
3056
+ "definitions": {
3057
+ "type": "object",
3058
+ "additionalProperties": { "$ref": "#" },
3059
+ "default": {}
3060
+ },
3061
+ "properties": {
3062
+ "type": "object",
3063
+ "additionalProperties": { "$ref": "#" },
3064
+ "default": {}
3065
+ },
3066
+ "patternProperties": {
3067
+ "type": "object",
3068
+ "additionalProperties": { "$ref": "#" },
3069
+ "default": {}
3070
+ },
3071
+ "dependencies": {
3072
+ "type": "object",
3073
+ "additionalProperties": {
3074
+ "anyOf": [
3075
+ { "$ref": "#" },
3076
+ { "$ref": "#/definitions/stringArray" }
3077
+ ]
3078
+ }
3079
+ },
3080
+ "enum": {
3081
+ "type": "array",
3082
+ "minItems": 1,
3083
+ "uniqueItems": true
3084
+ },
3085
+ "type": {
3086
+ "anyOf": [
3087
+ { "$ref": "#/definitions/simpleTypes" },
3088
+ {
3089
+ "type": "array",
3090
+ "items": { "$ref": "#/definitions/simpleTypes" },
3091
+ "minItems": 1,
3092
+ "uniqueItems": true
3093
+ }
3094
+ ]
3095
+ },
3096
+ "format": { "type": "string" },
3097
+ "allOf": { "$ref": "#/definitions/schemaArray" },
3098
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
3099
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
3100
+ "not": { "$ref": "#" }
3101
+ },
3102
+ "dependencies": {
3103
+ "exclusiveMaximum": [ "maximum" ],
3104
+ "exclusiveMinimum": [ "minimum" ]
3105
+ },
3106
+ "default": {}
3107
+ }`;
3108
+
3109
+ var hyperSchema = `{
3110
+ "$schema": "http://json-schema.org/draft-04/hyper-schema#",
3111
+ "id": "http://json-schema.org/draft-04/hyper-schema#",
3112
+ "title": "JSON Hyper-Schema",
3113
+ "allOf": [
3114
+ {"$ref": "http://json-schema.org/draft-04/schema#"}
3115
+ ],
3116
+ "properties": {
3117
+ "additionalItems": {
3118
+ "anyOf": [
3119
+ {"type": "boolean"},
3120
+ {"$ref": "#"}
3121
+ ]
3122
+ },
3123
+ "additionalProperties": {
3124
+ "anyOf": [
3125
+ {"type": "boolean"},
3126
+ {"$ref": "#"}
3127
+ ]
3128
+ },
3129
+ "dependencies": {
3130
+ "additionalProperties": {
3131
+ "anyOf": [
3132
+ {"$ref": "#"},
3133
+ {"type": "array"}
3134
+ ]
3135
+ }
3136
+ },
3137
+ "items": {
3138
+ "anyOf": [
3139
+ {"$ref": "#"},
3140
+ {"$ref": "#/definitions/schemaArray"}
3141
+ ]
3142
+ },
3143
+ "definitions": {
3144
+ "additionalProperties": {"$ref": "#"}
3145
+ },
3146
+ "patternProperties": {
3147
+ "additionalProperties": {"$ref": "#"}
3148
+ },
3149
+ "properties": {
3150
+ "additionalProperties": {"$ref": "#"}
3151
+ },
3152
+ "allOf": {"$ref": "#/definitions/schemaArray"},
3153
+ "anyOf": {"$ref": "#/definitions/schemaArray"},
3154
+ "oneOf": {"$ref": "#/definitions/schemaArray"},
3155
+ "not": { "$ref": "#" },
3156
+
3157
+ "links": {
3158
+ "type": "array",
3159
+ "items": {"$ref": "#/definitions/linkDescription"}
3160
+ },
3161
+ "fragmentResolution": {
3162
+ "type": "string"
3163
+ },
3164
+ "media": {
3165
+ "type": "object",
3166
+ "properties": {
3167
+ "type": {
3168
+ "description": "A media type, as described in RFC 2046",
3169
+ "type": "string"
3170
+ },
3171
+ "binaryEncoding": {
3172
+ "description": "A content encoding scheme, as described in RFC 2045",
3173
+ "type": "string"
3174
+ }
3175
+ }
3176
+ },
3177
+ "pathStart": {
3178
+ "description": "Instances' URIs must start with this value for this schema to apply to them",
3179
+ "type": "string",
3180
+ "format": "uri"
3181
+ }
3182
+ },
3183
+ "definitions": {
3184
+ "schemaArray": {
3185
+ "type": "array",
3186
+ "items": {"$ref": "#"}
3187
+ },
3188
+ "linkDescription": {
3189
+ "title": "Link Description Object",
3190
+ "type": "object",
3191
+ "required": ["href", "rel"],
3192
+ "properties": {
3193
+ "href": {
3194
+ "description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
3195
+ "type": "string"
3196
+ },
3197
+ "rel": {
3198
+ "description": "relation to the target resource of the link",
3199
+ "type": "string"
3200
+ },
3201
+ "title": {
3202
+ "description": "a title for the link",
3203
+ "type": "string"
3204
+ },
3205
+ "targetSchema": {
3206
+ "description": "JSON Schema describing the link target",
3207
+ "$ref": "#"
3208
+ },
3209
+ "mediaType": {
3210
+ "description": "media type (as defined by RFC 2046) describing the link target",
3211
+ "type": "string"
3212
+ },
3213
+ "method": {
3214
+ "description": "method for requesting the target of the link (e.g. for HTTP this might be \\"GET\\" or \\"DELETE\\")",
3215
+ "type": "string"
3216
+ },
3217
+ "encType": {
3218
+ "description": "The media type in which to submit data along with the request",
3219
+ "type": "string",
3220
+ "default": "application/json"
3221
+ },
3222
+ "schema": {
3223
+ "description": "Schema describing the data to submit along with the request",
3224
+ "$ref": "#"
3225
+ }
3226
+ }
3227
+ },
3228
+ "readOnly": {
3229
+ "description": "If true, indicates that the value of this property is controlled by the server.",
3230
+ "type": "boolean",
3231
+ "default": false
3232
+ }
3233
+ },
3234
+ "links": [
3235
+ {
3236
+ "rel": "self",
3237
+ "href": "{+id}"
3238
+ },
3239
+ {
3240
+ "rel": "full",
3241
+ "href": "{+($ref)}"
3242
+ }
3243
+ ]
3244
+ }`;
3245
+
3246
+ const { Core: Core$5, Schema: Schema$5 } = lib$1;
3247
+
3248
+
3249
+
3250
+
3251
+
3252
+ // JSON Schema Draft-04
3253
+ const schemaVersion$4 = "http://json-schema.org/draft-04/schema";
3254
+
3255
+ Schema$5.setConfig(schemaVersion$4, "baseToken", "id");
3256
+ Schema$5.setConfig(schemaVersion$4, "embeddedToken", "id");
3257
+ Schema$5.setConfig(schemaVersion$4, "anchorToken", "id");
3258
+ Schema$5.setConfig(schemaVersion$4, "jrefToken", "$ref");
3259
+
3260
+ Schema$5.add(JSON.parse(schema$4));
3261
+ Core$5.defineVocabulary(schemaVersion$4, {
3262
+ "validate": keywords.validate,
3263
+ "additionalItems": keywords.additionalItems,
3264
+ "additionalProperties": keywords.additionalProperties,
3265
+ "allOf": keywords.allOf,
3266
+ "anyOf": keywords.anyOf,
3267
+ "default": keywords.metaData,
3268
+ "definitions": keywords.definitions,
3269
+ "dependencies": keywords.dependencies,
3270
+ "description": keywords.metaData,
3271
+ "enum": keywords.enum,
3272
+ "format": keywords.metaData,
3273
+ "items": keywords.items,
3274
+ "maxItems": keywords.maxItems,
3275
+ "maxLength": keywords.maxLength,
3276
+ "maxProperties": keywords.maxProperties,
3277
+ "maximum": keywords.maximumExclusiveMaximum,
3278
+ "minItems": keywords.minItems,
3279
+ "minLength": keywords.minLength,
3280
+ "minProperties": keywords.minProperties,
3281
+ "minimum": keywords.minimumExclusiveMinimum,
3282
+ "multipleOf": keywords.multipleOf,
3283
+ "not": keywords.not,
3284
+ "oneOf": keywords.oneOf,
3285
+ "pattern": keywords.pattern,
3286
+ "patternProperties": keywords.patternProperties,
3287
+ "properties": keywords.properties,
3288
+ "required": keywords.required,
3289
+ "title": keywords.metaData,
3290
+ "type": keywords.type,
3291
+ "uniqueItems": keywords.uniqueItems
3292
+ });
3293
+
3294
+ // JSON Hyper-Schema Draft-04
3295
+ const hyperSchemaVersion = "http://json-schema.org/draft-04/hyper-schema";
3296
+
3297
+ Schema$5.setConfig(hyperSchemaVersion, "baseToken", "id");
3298
+ Schema$5.setConfig(hyperSchemaVersion, "embeddedToken", "id");
3299
+ Schema$5.setConfig(hyperSchemaVersion, "anchorToken", "id");
3300
+ Schema$5.setConfig(hyperSchemaVersion, "jrefToken", "$ref");
3301
+
3302
+ Schema$5.add(JSON.parse(hyperSchema));
3303
+ Core$5.defineVocabulary(hyperSchemaVersion, {
3304
+ "validate": keywords.validate,
3305
+ "additionalItems": keywords.additionalItems,
3306
+ "additionalProperties": keywords.additionalProperties,
3307
+ "allOf": keywords.allOf,
3308
+ "anyOf": keywords.anyOf,
3309
+ "default": keywords.metaData,
3310
+ "definitions": keywords.definitions,
3311
+ "dependencies": keywords.dependencies,
3312
+ "description": keywords.metaData,
3313
+ "enum": keywords.enum,
3314
+ "format": keywords.metaData,
3315
+ "fragmentResolution": keywords.metaData,
3316
+ "items": keywords.items,
3317
+ "maxItems": keywords.maxItems,
3318
+ "minProperties": keywords.minProperties,
3319
+ "maxProperties": keywords.maxProperties,
3320
+ "maximum": keywords.maximumExclusiveMaximum,
3321
+ "media": keywords.metaData,
3322
+ "minItems": keywords.minItems,
3323
+ "minLength": keywords.minLength,
3324
+ "maxLength": keywords.maxLength,
3325
+ "minimum": keywords.minimumExclusiveMinimum,
3326
+ "multipleOf": keywords.multipleOf,
3327
+ "links": keywords.metaData,
3328
+ "not": keywords.not,
3329
+ "oneOf": keywords.oneOf,
3330
+ "pathStart": keywords.metaData,
3331
+ "pattern": keywords.pattern,
3332
+ "patternProperties": keywords.patternProperties,
3333
+ "properties": keywords.properties,
3334
+ "readOnly": keywords.metaData,
3335
+ "required": keywords.required,
3336
+ "title": keywords.metaData,
3337
+ "type": keywords.type,
3338
+ "uniqueItems": keywords.uniqueItems
3339
+ });
3340
+
3341
+ var schema$3 = `{
3342
+ "$schema": "http://json-schema.org/draft-06/schema#",
3343
+ "$id": "http://json-schema.org/draft-06/schema#",
3344
+ "title": "Core schema meta-schema",
3345
+ "definitions": {
3346
+ "schemaArray": {
3347
+ "type": "array",
3348
+ "minItems": 1,
3349
+ "items": { "$ref": "#" }
3350
+ },
3351
+ "nonNegativeInteger": {
3352
+ "type": "integer",
3353
+ "minimum": 0
3354
+ },
3355
+ "nonNegativeIntegerDefault0": {
3356
+ "allOf": [
3357
+ { "$ref": "#/definitions/nonNegativeInteger" },
3358
+ { "default": 0 }
3359
+ ]
3360
+ },
3361
+ "simpleTypes": {
3362
+ "enum": [
3363
+ "array",
3364
+ "boolean",
3365
+ "integer",
3366
+ "null",
3367
+ "number",
3368
+ "object",
3369
+ "string"
3370
+ ]
3371
+ },
3372
+ "stringArray": {
3373
+ "type": "array",
3374
+ "items": { "type": "string" },
3375
+ "uniqueItems": true,
3376
+ "default": []
3377
+ }
3378
+ },
3379
+ "type": ["object", "boolean"],
3380
+ "properties": {
3381
+ "$id": {
3382
+ "type": "string",
3383
+ "format": "uri-reference"
3384
+ },
3385
+ "$schema": {
3386
+ "type": "string",
3387
+ "format": "uri"
3388
+ },
3389
+ "$ref": {
3390
+ "type": "string",
3391
+ "format": "uri-reference"
3392
+ },
3393
+ "title": {
3394
+ "type": "string"
3395
+ },
3396
+ "description": {
3397
+ "type": "string"
3398
+ },
3399
+ "default": {},
3400
+ "examples": {
3401
+ "type": "array",
3402
+ "items": {}
3403
+ },
3404
+ "multipleOf": {
3405
+ "type": "number",
3406
+ "exclusiveMinimum": 0
3407
+ },
3408
+ "maximum": {
3409
+ "type": "number"
3410
+ },
3411
+ "exclusiveMaximum": {
3412
+ "type": "number"
3413
+ },
3414
+ "minimum": {
3415
+ "type": "number"
3416
+ },
3417
+ "exclusiveMinimum": {
3418
+ "type": "number"
3419
+ },
3420
+ "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
3421
+ "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3422
+ "pattern": {
3423
+ "type": "string",
3424
+ "format": "regex"
3425
+ },
3426
+ "additionalItems": { "$ref": "#" },
3427
+ "items": {
3428
+ "anyOf": [
3429
+ { "$ref": "#" },
3430
+ { "$ref": "#/definitions/schemaArray" }
3431
+ ],
3432
+ "default": {}
3433
+ },
3434
+ "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
3435
+ "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3436
+ "uniqueItems": {
3437
+ "type": "boolean",
3438
+ "default": false
3439
+ },
3440
+ "contains": { "$ref": "#" },
3441
+ "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
3442
+ "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3443
+ "required": { "$ref": "#/definitions/stringArray" },
3444
+ "additionalProperties": { "$ref": "#" },
3445
+ "definitions": {
3446
+ "type": "object",
3447
+ "additionalProperties": { "$ref": "#" },
3448
+ "default": {}
3449
+ },
3450
+ "properties": {
3451
+ "type": "object",
3452
+ "additionalProperties": { "$ref": "#" },
3453
+ "default": {}
3454
+ },
3455
+ "patternProperties": {
3456
+ "type": "object",
3457
+ "additionalProperties": { "$ref": "#" },
3458
+ "default": {}
3459
+ },
3460
+ "dependencies": {
3461
+ "type": "object",
3462
+ "additionalProperties": {
3463
+ "anyOf": [
3464
+ { "$ref": "#" },
3465
+ { "$ref": "#/definitions/stringArray" }
3466
+ ]
3467
+ }
3468
+ },
3469
+ "propertyNames": { "$ref": "#" },
3470
+ "const": {},
3471
+ "enum": {
3472
+ "type": "array",
3473
+ "minItems": 1,
3474
+ "uniqueItems": true
3475
+ },
3476
+ "type": {
3477
+ "anyOf": [
3478
+ { "$ref": "#/definitions/simpleTypes" },
3479
+ {
3480
+ "type": "array",
3481
+ "items": { "$ref": "#/definitions/simpleTypes" },
3482
+ "minItems": 1,
3483
+ "uniqueItems": true
3484
+ }
3485
+ ]
3486
+ },
3487
+ "format": { "type": "string" },
3488
+ "allOf": { "$ref": "#/definitions/schemaArray" },
3489
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
3490
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
3491
+ "not": { "$ref": "#" }
3492
+ },
3493
+ "default": {}
3494
+ }`;
3495
+
3496
+ const { Core: Core$4, Schema: Schema$4 } = lib$1;
3497
+
3498
+
3499
+
3500
+
3501
+ const schemaVersion$3 = "http://json-schema.org/draft-06/schema";
3502
+
3503
+ Schema$4.setConfig(schemaVersion$3, "baseToken", "$id");
3504
+ Schema$4.setConfig(schemaVersion$3, "embeddedToken", "$id");
3505
+ Schema$4.setConfig(schemaVersion$3, "anchorToken", "$id");
3506
+ Schema$4.setConfig(schemaVersion$3, "jrefToken", "$ref");
3507
+
3508
+ Schema$4.add(JSON.parse(schema$3));
3509
+ Core$4.defineVocabulary(schemaVersion$3, {
3510
+ "validate": keywords.validate,
3511
+ "additionalItems": keywords.additionalItems6,
3512
+ "additionalProperties": keywords.additionalProperties6,
3513
+ "allOf": keywords.allOf,
3514
+ "anyOf": keywords.anyOf,
3515
+ "const": keywords.const,
3516
+ "contains": keywords.contains,
3517
+ "default": keywords.metaData,
3518
+ "definitions": keywords.definitions,
3519
+ "dependencies": keywords.dependencies,
3520
+ "description": keywords.metaData,
3521
+ "enum": keywords.enum,
3522
+ "examples": keywords.metaData,
3523
+ "exclusiveMaximum": keywords.exclusiveMaximum,
3524
+ "exclusiveMinimum": keywords.exclusiveMinimum,
3525
+ "format": keywords.metaData,
3526
+ "items": keywords.items,
3527
+ "maxItems": keywords.maxItems,
3528
+ "maxLength": keywords.maxLength6,
3529
+ "maxProperties": keywords.maxProperties,
3530
+ "maximum": keywords.maximum,
3531
+ "minItems": keywords.minItems,
3532
+ "minLength": keywords.minLength6,
3533
+ "minProperties": keywords.minProperties,
3534
+ "minimum": keywords.minimum,
3535
+ "multipleOf": keywords.multipleOf,
3536
+ "not": keywords.not,
3537
+ "oneOf": keywords.oneOf,
3538
+ "pattern": keywords.pattern,
3539
+ "patternProperties": keywords.patternProperties,
3540
+ "properties": keywords.properties,
3541
+ "propertyNames": keywords.propertyNames,
3542
+ "required": keywords.required,
3543
+ "title": keywords.metaData,
3544
+ "type": keywords.type,
3545
+ "uniqueItems": keywords.uniqueItems
3546
+ });
3547
+
3548
+ var schema$2 = `{
3549
+ "$schema": "http://json-schema.org/draft-07/schema#",
3550
+ "$id": "http://json-schema.org/draft-07/schema#",
3551
+ "title": "Core schema meta-schema",
3552
+ "definitions": {
3553
+ "schemaArray": {
3554
+ "type": "array",
3555
+ "minItems": 1,
3556
+ "items": { "$ref": "#" }
3557
+ },
3558
+ "nonNegativeInteger": {
3559
+ "type": "integer",
3560
+ "minimum": 0
3561
+ },
3562
+ "nonNegativeIntegerDefault0": {
3563
+ "allOf": [
3564
+ { "$ref": "#/definitions/nonNegativeInteger" },
3565
+ { "default": 0 }
3566
+ ]
3567
+ },
3568
+ "simpleTypes": {
3569
+ "enum": [
3570
+ "array",
3571
+ "boolean",
3572
+ "integer",
3573
+ "null",
3574
+ "number",
3575
+ "object",
3576
+ "string"
3577
+ ]
3578
+ },
3579
+ "stringArray": {
3580
+ "type": "array",
3581
+ "items": { "type": "string" },
3582
+ "uniqueItems": true,
3583
+ "default": []
3584
+ }
3585
+ },
3586
+ "type": ["object", "boolean"],
3587
+ "properties": {
3588
+ "$id": {
3589
+ "type": "string",
3590
+ "format": "uri-reference"
3591
+ },
3592
+ "$schema": {
3593
+ "type": "string",
3594
+ "format": "uri"
3595
+ },
3596
+ "$ref": {
3597
+ "type": "string",
3598
+ "format": "uri-reference"
3599
+ },
3600
+ "$comment": {
3601
+ "type": "string"
3602
+ },
3603
+ "title": {
3604
+ "type": "string"
3605
+ },
3606
+ "description": {
3607
+ "type": "string"
3608
+ },
3609
+ "default": true,
3610
+ "readOnly": {
3611
+ "type": "boolean",
3612
+ "default": false
3613
+ },
3614
+ "writeOnly": {
3615
+ "type": "boolean",
3616
+ "default": false
3617
+ },
3618
+ "examples": {
3619
+ "type": "array",
3620
+ "items": true
3621
+ },
3622
+ "multipleOf": {
3623
+ "type": "number",
3624
+ "exclusiveMinimum": 0
3625
+ },
3626
+ "maximum": {
3627
+ "type": "number"
3628
+ },
3629
+ "exclusiveMaximum": {
3630
+ "type": "number"
3631
+ },
3632
+ "minimum": {
3633
+ "type": "number"
3634
+ },
3635
+ "exclusiveMinimum": {
3636
+ "type": "number"
3637
+ },
3638
+ "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
3639
+ "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3640
+ "pattern": {
3641
+ "type": "string",
3642
+ "format": "regex"
3643
+ },
3644
+ "additionalItems": { "$ref": "#" },
3645
+ "items": {
3646
+ "anyOf": [
3647
+ { "$ref": "#" },
3648
+ { "$ref": "#/definitions/schemaArray" }
3649
+ ],
3650
+ "default": true
3651
+ },
3652
+ "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
3653
+ "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3654
+ "uniqueItems": {
3655
+ "type": "boolean",
3656
+ "default": false
3657
+ },
3658
+ "contains": { "$ref": "#" },
3659
+ "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
3660
+ "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3661
+ "required": { "$ref": "#/definitions/stringArray" },
3662
+ "additionalProperties": { "$ref": "#" },
3663
+ "definitions": {
3664
+ "type": "object",
3665
+ "additionalProperties": { "$ref": "#" },
3666
+ "default": {}
3667
+ },
3668
+ "properties": {
3669
+ "type": "object",
3670
+ "additionalProperties": { "$ref": "#" },
3671
+ "default": {}
3672
+ },
3673
+ "patternProperties": {
3674
+ "type": "object",
3675
+ "additionalProperties": { "$ref": "#" },
3676
+ "propertyNames": { "format": "regex" },
3677
+ "default": {}
3678
+ },
3679
+ "dependencies": {
3680
+ "type": "object",
3681
+ "additionalProperties": {
3682
+ "anyOf": [
3683
+ { "$ref": "#" },
3684
+ { "$ref": "#/definitions/stringArray" }
3685
+ ]
3686
+ }
3687
+ },
3688
+ "propertyNames": { "$ref": "#" },
3689
+ "const": true,
3690
+ "enum": {
3691
+ "type": "array",
3692
+ "items": true,
3693
+ "minItems": 1,
3694
+ "uniqueItems": true
3695
+ },
3696
+ "type": {
3697
+ "anyOf": [
3698
+ { "$ref": "#/definitions/simpleTypes" },
3699
+ {
3700
+ "type": "array",
3701
+ "items": { "$ref": "#/definitions/simpleTypes" },
3702
+ "minItems": 1,
3703
+ "uniqueItems": true
3704
+ }
3705
+ ]
3706
+ },
3707
+ "format": { "type": "string" },
3708
+ "contentMediaType": { "type": "string" },
3709
+ "contentEncoding": { "type": "string" },
3710
+ "if": { "$ref": "#" },
3711
+ "then": { "$ref": "#" },
3712
+ "else": { "$ref": "#" },
3713
+ "allOf": { "$ref": "#/definitions/schemaArray" },
3714
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
3715
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
3716
+ "not": { "$ref": "#" }
3717
+ },
3718
+ "default": true
3719
+ }`;
3720
+
3721
+ const { Core: Core$3, Schema: Schema$3 } = lib$1;
3722
+
3723
+
3724
+
3725
+
3726
+ const schemaVersion$2 = "http://json-schema.org/draft-07/schema";
3727
+
3728
+ Schema$3.setConfig(schemaVersion$2, "baseToken", "$id");
3729
+ Schema$3.setConfig(schemaVersion$2, "embeddedToken", "$id");
3730
+ Schema$3.setConfig(schemaVersion$2, "anchorToken", "$id");
3731
+ Schema$3.setConfig(schemaVersion$2, "jrefToken", "$ref");
3732
+
3733
+ Schema$3.add(JSON.parse(schema$2));
3734
+ Core$3.defineVocabulary(schemaVersion$2, {
3735
+ "validate": keywords.validate,
3736
+ "additionalItems": keywords.additionalItems6,
3737
+ "additionalProperties": keywords.additionalProperties6,
3738
+ "allOf": keywords.allOf,
3739
+ "anyOf": keywords.anyOf,
3740
+ "const": keywords.const,
3741
+ "contains": keywords.contains,
3742
+ "default": keywords.metaData,
3743
+ "definitions": keywords.definitions,
3744
+ "dependencies": keywords.dependencies,
3745
+ "description": keywords.metaData,
3746
+ "enum": keywords.enum,
3747
+ "exclusiveMaximum": keywords.exclusiveMaximum,
3748
+ "exclusiveMinimum": keywords.exclusiveMinimum,
3749
+ "format": keywords.metaData,
3750
+ "if": keywords.if,
3751
+ "then": keywords.then,
3752
+ "else": keywords.else,
3753
+ "items": keywords.items,
3754
+ "maxItems": keywords.maxItems,
3755
+ "maxLength": keywords.maxLength6,
3756
+ "maxProperties": keywords.maxProperties,
3757
+ "maximum": keywords.maximum,
3758
+ "minItems": keywords.minItems,
3759
+ "minLength": keywords.minLength6,
3760
+ "minProperties": keywords.minProperties,
3761
+ "minimum": keywords.minimum,
3762
+ "multipleOf": keywords.multipleOf,
3763
+ "not": keywords.not,
3764
+ "oneOf": keywords.oneOf,
3765
+ "pattern": keywords.pattern,
3766
+ "patternProperties": keywords.patternProperties,
3767
+ "properties": keywords.properties,
3768
+ "propertyNames": keywords.propertyNames,
3769
+ "readOnly": keywords.metaData,
3770
+ "required": keywords.required,
3771
+ "title": keywords.metaData,
3772
+ "type": keywords.type,
3773
+ "uniqueItems": keywords.uniqueItems,
3774
+ "writeOnly": keywords.metaData
3775
+ });
3776
+
3777
+ var schema$1 = `{
3778
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3779
+ "$id": "https://json-schema.org/draft/2019-09/schema",
3780
+ "$vocabulary": {
3781
+ "https://json-schema.org/draft/2019-09/vocab/core": true,
3782
+ "https://json-schema.org/draft/2019-09/vocab/applicator": true,
3783
+ "https://json-schema.org/draft/2019-09/vocab/validation": true,
3784
+ "https://json-schema.org/draft/2019-09/vocab/meta-data": true,
3785
+ "https://json-schema.org/draft/2019-09/vocab/format": false,
3786
+ "https://json-schema.org/draft/2019-09/vocab/content": true
3787
+ },
3788
+ "$recursiveAnchor": true,
3789
+
3790
+ "title": "Core and Validation specifications meta-schema",
3791
+ "allOf": [
3792
+ {"$ref": "meta/core"},
3793
+ {"$ref": "meta/applicator"},
3794
+ {"$ref": "meta/validation"},
3795
+ {"$ref": "meta/meta-data"},
3796
+ {"$ref": "meta/format"},
3797
+ {"$ref": "meta/content"}
3798
+ ],
3799
+ "type": ["object", "boolean"],
3800
+ "properties": {
3801
+ "definitions": {
3802
+ "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",
3803
+ "type": "object",
3804
+ "additionalProperties": { "$recursiveRef": "#" },
3805
+ "default": {}
3806
+ },
3807
+ "dependencies": {
3808
+ "$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",
3809
+ "type": "object",
3810
+ "additionalProperties": {
3811
+ "anyOf": [
3812
+ { "$recursiveRef": "#" },
3813
+ { "$ref": "meta/validation#/$defs/stringArray" }
3814
+ ]
3815
+ }
3816
+ }
3817
+ }
3818
+ }`;
3819
+
3820
+ var core$1 = `{
3821
+ "$id": "https://json-schema.org/draft/2019-09/meta/core",
3822
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3823
+ "$vocabulary": {
3824
+ "https://json-schema.org/draft/2019-09/vocab/core": true
3825
+ },
3826
+ "$recursiveAnchor": true,
3827
+
3828
+ "title": "Core vocabulary meta-schema",
3829
+ "type": ["object", "boolean"],
3830
+ "properties": {
3831
+ "$id": {
3832
+ "type": "string",
3833
+ "format": "uri-reference",
3834
+ "$comment": "Non-empty fragments not allowed.",
3835
+ "pattern": "^[^#]*#?$"
3836
+ },
3837
+ "$schema": {
3838
+ "type": "string",
3839
+ "format": "uri"
3840
+ },
3841
+ "$anchor": {
3842
+ "type": "string",
3843
+ "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$"
3844
+ },
3845
+ "$ref": {
3846
+ "type": "string",
3847
+ "format": "uri-reference"
3848
+ },
3849
+ "$recursiveRef": {
3850
+ "type": "string",
3851
+ "format": "uri-reference"
3852
+ },
3853
+ "$recursiveAnchor": {
3854
+ "type": "boolean",
3855
+ "default": false
3856
+ },
3857
+ "$vocabulary": {
3858
+ "type": "object",
3859
+ "propertyNames": {
3860
+ "type": "string",
3861
+ "format": "uri"
3862
+ },
3863
+ "additionalProperties": {
3864
+ "type": "boolean"
3865
+ }
3866
+ },
3867
+ "$comment": {
3868
+ "type": "string"
3869
+ },
3870
+ "$defs": {
3871
+ "type": "object",
3872
+ "additionalProperties": { "$recursiveRef": "#" },
3873
+ "default": {}
3874
+ }
3875
+ }
3876
+ }`;
3877
+
3878
+ var applicator$1 = `{
3879
+ "$id": "https://json-schema.org/draft/2019-09/meta/applicator",
3880
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3881
+ "$vocabulary": {
3882
+ "https://json-schema.org/draft/2019-09/vocab/applicator": true
3883
+ },
3884
+ "$recursiveAnchor": true,
3885
+
3886
+ "title": "Applicator vocabulary meta-schema",
3887
+ "properties": {
3888
+ "additionalItems": { "$recursiveRef": "#" },
3889
+ "unevaluatedItems": { "$recursiveRef": "#" },
3890
+ "items": {
3891
+ "anyOf": [
3892
+ { "$recursiveRef": "#" },
3893
+ { "$ref": "#/$defs/schemaArray" }
3894
+ ]
3895
+ },
3896
+ "contains": { "$recursiveRef": "#" },
3897
+ "additionalProperties": { "$recursiveRef": "#" },
3898
+ "unevaluatedProperties": { "$recursiveRef": "#" },
3899
+ "properties": {
3900
+ "type": "object",
3901
+ "additionalProperties": { "$recursiveRef": "#" },
3902
+ "default": {}
3903
+ },
3904
+ "patternProperties": {
3905
+ "type": "object",
3906
+ "additionalProperties": { "$recursiveRef": "#" },
3907
+ "propertyNames": { "format": "regex" },
3908
+ "default": {}
3909
+ },
3910
+ "dependentSchemas": {
3911
+ "type": "object",
3912
+ "additionalProperties": {
3913
+ "$recursiveRef": "#"
3914
+ }
3915
+ },
3916
+ "propertyNames": { "$recursiveRef": "#" },
3917
+ "if": { "$recursiveRef": "#" },
3918
+ "then": { "$recursiveRef": "#" },
3919
+ "else": { "$recursiveRef": "#" },
3920
+ "allOf": { "$ref": "#/$defs/schemaArray" },
3921
+ "anyOf": { "$ref": "#/$defs/schemaArray" },
3922
+ "oneOf": { "$ref": "#/$defs/schemaArray" },
3923
+ "not": { "$recursiveRef": "#" }
3924
+ },
3925
+ "$defs": {
3926
+ "schemaArray": {
3927
+ "type": "array",
3928
+ "minItems": 1,
3929
+ "items": { "$recursiveRef": "#" }
3930
+ }
3931
+ }
3932
+ }`;
3933
+
3934
+ var validation$1 = `{
3935
+ "$id": "https://json-schema.org/draft/2019-09/meta/validation",
3936
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3937
+ "$vocabulary": {
3938
+ "https://json-schema.org/draft/2019-09/vocab/validation": true
3939
+ },
3940
+ "$recursiveAnchor": true,
3941
+
3942
+ "title": "Validation vocabulary meta-schema",
3943
+ "type": ["object", "boolean"],
3944
+ "properties": {
3945
+ "multipleOf": {
3946
+ "type": "number",
3947
+ "exclusiveMinimum": 0
3948
+ },
3949
+ "maximum": {
3950
+ "type": "number"
3951
+ },
3952
+ "exclusiveMaximum": {
3953
+ "type": "number"
3954
+ },
3955
+ "minimum": {
3956
+ "type": "number"
3957
+ },
3958
+ "exclusiveMinimum": {
3959
+ "type": "number"
3960
+ },
3961
+ "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
3962
+ "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
3963
+ "pattern": {
3964
+ "type": "string",
3965
+ "format": "regex"
3966
+ },
3967
+ "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
3968
+ "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
3969
+ "uniqueItems": {
3970
+ "type": "boolean",
3971
+ "default": false
3972
+ },
3973
+ "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
3974
+ "minContains": {
3975
+ "$ref": "#/$defs/nonNegativeInteger",
3976
+ "default": 1
3977
+ },
3978
+ "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
3979
+ "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
3980
+ "required": { "$ref": "#/$defs/stringArray" },
3981
+ "dependentRequired": {
3982
+ "type": "object",
3983
+ "additionalProperties": {
3984
+ "$ref": "#/$defs/stringArray"
3985
+ }
3986
+ },
3987
+ "const": true,
3988
+ "enum": {
3989
+ "type": "array",
3990
+ "items": true
3991
+ },
3992
+ "type": {
3993
+ "anyOf": [
3994
+ { "$ref": "#/$defs/simpleTypes" },
3995
+ {
3996
+ "type": "array",
3997
+ "items": { "$ref": "#/$defs/simpleTypes" },
3998
+ "minItems": 1,
3999
+ "uniqueItems": true
4000
+ }
4001
+ ]
4002
+ }
4003
+ },
4004
+ "$defs": {
4005
+ "nonNegativeInteger": {
4006
+ "type": "integer",
4007
+ "minimum": 0
4008
+ },
4009
+ "nonNegativeIntegerDefault0": {
4010
+ "$ref": "#/$defs/nonNegativeInteger",
4011
+ "default": 0
4012
+ },
4013
+ "simpleTypes": {
4014
+ "enum": [
4015
+ "array",
4016
+ "boolean",
4017
+ "integer",
4018
+ "null",
4019
+ "number",
4020
+ "object",
4021
+ "string"
4022
+ ]
4023
+ },
4024
+ "stringArray": {
4025
+ "type": "array",
4026
+ "items": { "type": "string" },
4027
+ "uniqueItems": true,
4028
+ "default": []
4029
+ }
4030
+ }
4031
+ }`;
4032
+
4033
+ var metaData$1 = `{
4034
+ "$id": "https://json-schema.org/draft/2019-09/meta/meta-data",
4035
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4036
+ "$vocabulary": {
4037
+ "https://json-schema.org/draft/2019-09/vocab/meta-data": true
4038
+ },
4039
+ "$recursiveAnchor": true,
4040
+
4041
+ "title": "Meta-data vocabulary meta-schema",
4042
+
4043
+ "type": ["object", "boolean"],
4044
+ "properties": {
4045
+ "title": {
4046
+ "type": "string"
4047
+ },
4048
+ "description": {
4049
+ "type": "string"
4050
+ },
4051
+ "default": true,
4052
+ "deprecated": {
4053
+ "type": "boolean",
4054
+ "default": false
4055
+ },
4056
+ "readOnly": {
4057
+ "type": "boolean",
4058
+ "default": false
4059
+ },
4060
+ "writeOnly": {
4061
+ "type": "boolean",
4062
+ "default": false
4063
+ },
4064
+ "examples": {
4065
+ "type": "array",
4066
+ "items": true
4067
+ }
4068
+ }
4069
+ }`;
4070
+
4071
+ var format = `{
4072
+ "$id": "https://json-schema.org/draft/2019-09/meta/format",
4073
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4074
+ "$vocabulary": {
4075
+ "https://json-schema.org/draft/2019-09/vocab/format": true
4076
+ },
4077
+ "$recursiveAnchor": true,
4078
+
4079
+ "title": "Format vocabulary meta-schema",
4080
+ "type": ["object", "boolean"],
4081
+ "properties": {
4082
+ "format": { "type": "string" }
4083
+ }
4084
+ }`;
4085
+
4086
+ var content$1 = `{
4087
+ "$id": "https://json-schema.org/draft/2019-09/meta/content",
4088
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4089
+ "$vocabulary": {
4090
+ "https://json-schema.org/draft/2019-09/vocab/content": true
4091
+ },
4092
+ "$recursiveAnchor": true,
4093
+
4094
+ "title": "Content vocabulary meta-schema",
4095
+
4096
+ "type": ["object", "boolean"],
4097
+ "properties": {
4098
+ "contentMediaType": { "type": "string" },
4099
+ "contentEncoding": { "type": "string" },
4100
+ "contentSchema": { "$recursiveRef": "#" }
4101
+ }
4102
+ }`;
4103
+
4104
+ const { Core: Core$2, Schema: Schema$2 } = lib$1;
4105
+
4106
+
4107
+
4108
+
4109
+
4110
+
4111
+
4112
+
4113
+
4114
+
4115
+ const schemaVersion$1 = "https://json-schema.org/draft/2019-09/schema";
4116
+
4117
+ Schema$2.setConfig(schemaVersion$1, "baseToken", "$id");
4118
+ Schema$2.setConfig(schemaVersion$1, "embeddedToken", "$id");
4119
+ Schema$2.setConfig(schemaVersion$1, "anchorToken", "$anchor");
4120
+ Schema$2.setConfig(schemaVersion$1, "recursiveAnchorToken", "$recursiveAnchor");
4121
+ Schema$2.setConfig(schemaVersion$1, "vocabularyToken", "$vocabulary");
4122
+ Schema$2.setConfig(schemaVersion$1, "mandatoryVocabularies", ["https://json-schema.org/draft/2019-09/vocab/core"]);
4123
+
4124
+ Schema$2.add(JSON.parse(schema$1));
4125
+
4126
+ Schema$2.add(JSON.parse(core$1));
4127
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/core", {
4128
+ "validate": keywords.validate,
4129
+ "$defs": keywords.definitions,
4130
+ "$recursiveRef": keywords.dynamicRef,
4131
+ "$ref": keywords.ref
4132
+ });
4133
+
4134
+ Schema$2.add(JSON.parse(applicator$1));
4135
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/applicator", {
4136
+ "additionalItems": keywords.additionalItems6,
4137
+ "additionalProperties": keywords.additionalProperties6,
4138
+ "allOf": keywords.allOf,
4139
+ "anyOf": keywords.anyOf,
4140
+ "contains": keywords.containsMinContainsMaxContains,
4141
+ "dependentSchemas": keywords.dependentSchemas,
4142
+ "if": keywords.if,
4143
+ "then": keywords.then,
4144
+ "else": keywords.else,
4145
+ "items": keywords.items,
4146
+ "not": keywords.not,
4147
+ "oneOf": keywords.oneOf,
4148
+ "patternProperties": keywords.patternProperties,
4149
+ "properties": keywords.properties,
4150
+ "propertyNames": keywords.propertyNames,
4151
+ "unevaluatedItems": keywords.unevaluatedItems,
4152
+ "unevaluatedProperties": keywords.unevaluatedProperties
4153
+ });
4154
+
4155
+ Schema$2.add(JSON.parse(validation$1));
4156
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/validation", {
4157
+ "const": keywords.const,
4158
+ "dependentRequired": keywords.dependentRequired,
4159
+ "enum": keywords.enum,
4160
+ "exclusiveMaximum": keywords.exclusiveMaximum,
4161
+ "exclusiveMinimum": keywords.exclusiveMinimum,
4162
+ "maxItems": keywords.maxItems,
4163
+ "maxLength": keywords.maxLength6,
4164
+ "maxProperties": keywords.maxProperties,
4165
+ "maximum": keywords.maximum,
4166
+ "minItems": keywords.minItems,
4167
+ "minLength": keywords.minLength6,
4168
+ "minProperties": keywords.minProperties,
4169
+ "minimum": keywords.minimum,
4170
+ "multipleOf": keywords.multipleOf,
4171
+ "pattern": keywords.pattern,
4172
+ "required": keywords.required,
4173
+ "type": keywords.type,
4174
+ "uniqueItems": keywords.uniqueItems
4175
+ });
4176
+
4177
+ Schema$2.add(JSON.parse(metaData$1));
4178
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/meta-data", {
4179
+ "default": keywords.metaData,
4180
+ "deprecated": keywords.metaData,
4181
+ "description": keywords.metaData,
4182
+ "examples": keywords.metaData,
4183
+ "readOnly": keywords.metaData,
4184
+ "title": keywords.metaData,
4185
+ "writeOnly": keywords.metaData
4186
+ });
4187
+
4188
+ Schema$2.add(JSON.parse(format));
4189
+
4190
+ Schema$2.add(JSON.parse(content$1));
4191
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/content", {
4192
+ "contentEncoding": keywords.metaData,
4193
+ "contentMediaType": keywords.metaData,
4194
+ "contentSchema": keywords.metaData
4195
+ });
4196
+
4197
+ var schema = `{
4198
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4199
+ "$id": "https://json-schema.org/draft/2020-12/schema",
4200
+ "$vocabulary": {
4201
+ "https://json-schema.org/draft/2020-12/vocab/core": true,
4202
+ "https://json-schema.org/draft/2020-12/vocab/applicator": true,
4203
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
4204
+ "https://json-schema.org/draft/2020-12/vocab/validation": true,
4205
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": true,
4206
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
4207
+ "https://json-schema.org/draft/2020-12/vocab/content": true
4208
+ },
4209
+ "$dynamicAnchor": "meta",
4210
+
4211
+ "title": "Core and Validation specifications meta-schema",
4212
+ "allOf": [
4213
+ {"$ref": "meta/core"},
4214
+ {"$ref": "meta/applicator"},
4215
+ {"$ref": "meta/unevaluated"},
4216
+ {"$ref": "meta/validation"},
4217
+ {"$ref": "meta/meta-data"},
4218
+ {"$ref": "meta/format-annotation"},
4219
+ {"$ref": "meta/content"}
4220
+ ],
4221
+ "type": ["object", "boolean"],
4222
+ "properties": {
4223
+ "definitions": {
4224
+ "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",
4225
+ "type": "object",
4226
+ "additionalProperties": { "$dynamicRef": "#meta" },
4227
+ "default": {}
4228
+ },
4229
+ "dependencies": {
4230
+ "$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",
4231
+ "type": "object",
4232
+ "additionalProperties": {
4233
+ "anyOf": [
4234
+ { "$dynamicRef": "#meta" },
4235
+ { "$ref": "meta/validation#/$defs/stringArray" }
4236
+ ]
4237
+ }
4238
+ }
4239
+ }
4240
+ }`;
4241
+
4242
+ var core = `{
4243
+ "$id": "https://json-schema.org/draft/2020-12/meta/core",
4244
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4245
+ "$vocabulary": {
4246
+ "https://json-schema.org/draft/2020-12/vocab/core": true
4247
+ },
4248
+ "$dynamicAnchor": "meta",
4249
+
4250
+ "title": "Core vocabulary meta-schema",
4251
+ "type": ["object", "boolean"],
4252
+ "properties": {
4253
+ "$id": {
4254
+ "type": "string",
4255
+ "format": "uri-reference",
4256
+ "$comment": "Non-empty fragments not allowed.",
4257
+ "pattern": "^[^#]*#?$"
4258
+ },
4259
+ "$schema": {
4260
+ "type": "string",
4261
+ "format": "uri"
4262
+ },
4263
+ "$anchor": {
4264
+ "type": "string",
4265
+ "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
4266
+ },
4267
+ "$ref": {
4268
+ "type": "string",
4269
+ "format": "uri-reference"
4270
+ },
4271
+ "$dynamicRef": {
4272
+ "type": "string",
4273
+ "format": "uri-reference"
4274
+ },
4275
+ "$dynamicAnchor": {
4276
+ "type": "string",
4277
+ "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
4278
+ },
4279
+ "$vocabulary": {
4280
+ "type": "object",
4281
+ "propertyNames": {
4282
+ "type": "string",
4283
+ "format": "uri"
4284
+ },
4285
+ "additionalProperties": {
4286
+ "type": "boolean"
4287
+ }
4288
+ },
4289
+ "$comment": {
4290
+ "type": "string"
4291
+ },
4292
+ "$defs": {
4293
+ "type": "object",
4294
+ "additionalProperties": { "$dynamicRef": "#meta" },
4295
+ "default": {}
4296
+ }
4297
+ }
4298
+ }`;
4299
+
4300
+ var applicator = `{
4301
+ "$id": "https://json-schema.org/draft/2020-12/meta/applicator",
4302
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4303
+ "$vocabulary": {
4304
+ "https://json-schema.org/draft/2020-12/vocab/applicator": true
4305
+ },
4306
+ "$dynamicAnchor": "meta",
4307
+
4308
+ "title": "Applicator vocabulary meta-schema",
4309
+ "type": ["object", "boolean"],
4310
+ "properties": {
4311
+ "prefixItems": { "$ref": "#/$defs/schemaArray" },
4312
+ "items": { "$dynamicRef": "#meta" },
4313
+ "contains": { "$dynamicRef": "#meta" },
4314
+ "additionalProperties": { "$dynamicRef": "#meta" },
4315
+ "properties": {
4316
+ "type": "object",
4317
+ "additionalProperties": { "$dynamicRef": "#meta" },
4318
+ "default": {}
4319
+ },
4320
+ "patternProperties": {
4321
+ "type": "object",
4322
+ "additionalProperties": { "$dynamicRef": "#meta" },
4323
+ "propertyNames": { "format": "regex" },
4324
+ "default": {}
4325
+ },
4326
+ "dependentSchemas": {
4327
+ "type": "object",
4328
+ "additionalProperties": {
4329
+ "$dynamicRef": "#meta"
4330
+ }
4331
+ },
4332
+ "propertyNames": { "$dynamicRef": "#meta" },
4333
+ "if": { "$dynamicRef": "#meta" },
4334
+ "then": { "$dynamicRef": "#meta" },
4335
+ "else": { "$dynamicRef": "#meta" },
4336
+ "allOf": { "$ref": "#/$defs/schemaArray" },
4337
+ "anyOf": { "$ref": "#/$defs/schemaArray" },
4338
+ "oneOf": { "$ref": "#/$defs/schemaArray" },
4339
+ "not": { "$dynamicRef": "#meta" }
4340
+ },
4341
+ "$defs": {
4342
+ "schemaArray": {
4343
+ "type": "array",
4344
+ "minItems": 1,
4345
+ "items": { "$dynamicRef": "#meta" }
4346
+ }
4347
+ }
4348
+ }`;
4349
+
4350
+ var validation = `{
4351
+ "$id": "https://json-schema.org/draft/2020-12/meta/validation",
4352
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4353
+ "$vocabulary": {
4354
+ "https://json-schema.org/draft/2020-12/vocab/validation": true
4355
+ },
4356
+ "$dynamicAnchor": "meta",
4357
+
4358
+ "title": "Validation vocabulary meta-schema",
4359
+ "type": ["object", "boolean"],
4360
+ "properties": {
4361
+ "multipleOf": {
4362
+ "type": "number",
4363
+ "exclusiveMinimum": 0
4364
+ },
4365
+ "maximum": {
4366
+ "type": "number"
4367
+ },
4368
+ "exclusiveMaximum": {
4369
+ "type": "number"
4370
+ },
4371
+ "minimum": {
4372
+ "type": "number"
4373
+ },
4374
+ "exclusiveMinimum": {
4375
+ "type": "number"
4376
+ },
4377
+ "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
4378
+ "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
4379
+ "pattern": {
4380
+ "type": "string",
4381
+ "format": "regex"
4382
+ },
4383
+ "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
4384
+ "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
4385
+ "uniqueItems": {
4386
+ "type": "boolean",
4387
+ "default": false
4388
+ },
4389
+ "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
4390
+ "minContains": {
4391
+ "$ref": "#/$defs/nonNegativeInteger",
4392
+ "default": 1
4393
+ },
4394
+ "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
4395
+ "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
4396
+ "required": { "$ref": "#/$defs/stringArray" },
4397
+ "dependentRequired": {
4398
+ "type": "object",
4399
+ "additionalProperties": {
4400
+ "$ref": "#/$defs/stringArray"
4401
+ }
4402
+ },
4403
+ "const": true,
4404
+ "enum": {
4405
+ "type": "array",
4406
+ "items": true
4407
+ },
4408
+ "type": {
4409
+ "anyOf": [
4410
+ { "$ref": "#/$defs/simpleTypes" },
4411
+ {
4412
+ "type": "array",
4413
+ "items": { "$ref": "#/$defs/simpleTypes" },
4414
+ "minItems": 1,
4415
+ "uniqueItems": true
4416
+ }
4417
+ ]
4418
+ }
4419
+ },
4420
+ "$defs": {
4421
+ "nonNegativeInteger": {
4422
+ "type": "integer",
4423
+ "minimum": 0
4424
+ },
4425
+ "nonNegativeIntegerDefault0": {
4426
+ "$ref": "#/$defs/nonNegativeInteger",
4427
+ "default": 0
4428
+ },
4429
+ "simpleTypes": {
4430
+ "enum": [
4431
+ "array",
4432
+ "boolean",
4433
+ "integer",
4434
+ "null",
4435
+ "number",
4436
+ "object",
4437
+ "string"
4438
+ ]
4439
+ },
4440
+ "stringArray": {
4441
+ "type": "array",
4442
+ "items": { "type": "string" },
4443
+ "uniqueItems": true,
4444
+ "default": []
4445
+ }
4446
+ }
4447
+ }`;
4448
+
4449
+ var metaData = `{
4450
+ "$id": "https://json-schema.org/draft/2020-12/meta/meta-data",
4451
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4452
+ "$vocabulary": {
4453
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": true
4454
+ },
4455
+ "$dynamicAnchor": "meta",
4456
+
4457
+ "title": "Meta-data vocabulary meta-schema",
4458
+
4459
+ "type": ["object", "boolean"],
4460
+ "properties": {
4461
+ "title": {
4462
+ "type": "string"
4463
+ },
4464
+ "description": {
4465
+ "type": "string"
4466
+ },
4467
+ "default": true,
4468
+ "deprecated": {
4469
+ "type": "boolean",
4470
+ "default": false
4471
+ },
4472
+ "readOnly": {
4473
+ "type": "boolean",
4474
+ "default": false
4475
+ },
4476
+ "writeOnly": {
4477
+ "type": "boolean",
4478
+ "default": false
4479
+ },
4480
+ "examples": {
4481
+ "type": "array",
4482
+ "items": true
4483
+ }
4484
+ }
4485
+ }`;
4486
+
4487
+ var formatAnnotation = `{
4488
+ "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
4489
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4490
+ "$vocabulary": {
4491
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": true
4492
+ },
4493
+ "$dynamicAnchor": "meta",
4494
+
4495
+ "title": "Format vocabulary meta-schema for annotation results",
4496
+ "type": ["object", "boolean"],
4497
+ "properties": {
4498
+ "format": { "type": "string" }
4499
+ }
4500
+ }`;
4501
+
4502
+ var formatAssertion = `{
4503
+ "$id": "https://json-schema.org/draft/2020-12/meta/format-assertion",
4504
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4505
+ "$vocabulary": {
4506
+ "https://json-schema.org/draft/2020-12/vocab/format-assertion": true
4507
+ },
4508
+ "$dynamicAnchor": "meta",
4509
+
4510
+ "title": "Format vocabulary meta-schema for assertion results",
4511
+ "type": ["object", "boolean"],
4512
+ "properties": {
4513
+ "format": { "type": "string" }
4514
+ }
4515
+ }`;
4516
+
4517
+ var content = `{
4518
+ "$id": "https://json-schema.org/draft/2020-12/meta/content",
4519
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4520
+ "$vocabulary": {
4521
+ "https://json-schema.org/draft/2020-12/vocab/content": true
4522
+ },
4523
+ "$dynamicAnchor": "meta",
4524
+
4525
+ "title": "Content vocabulary meta-schema",
4526
+
4527
+ "type": ["object", "boolean"],
4528
+ "properties": {
4529
+ "contentMediaType": { "type": "string" },
4530
+ "contentEncoding": { "type": "string" },
4531
+ "contentSchema": { "$dynamicRef": "#meta" }
4532
+ }
4533
+ }`;
4534
+
4535
+ var unevaluated = `{
4536
+ "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",
4537
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4538
+ "$vocabulary": {
4539
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": true
4540
+ },
4541
+ "$dynamicAnchor": "meta",
4542
+
4543
+ "title": "Unevaluated applicator vocabulary meta-schema",
4544
+ "type": ["object", "boolean"],
4545
+ "properties": {
4546
+ "unevaluatedItems": { "$dynamicRef": "#meta" },
4547
+ "unevaluatedProperties": { "$dynamicRef": "#meta" }
4548
+ }
4549
+ }`;
4550
+
4551
+ const { Core: Core$1, Schema: Schema$1 } = lib$1;
4552
+
4553
+
4554
+
4555
+
4556
+
4557
+
4558
+
4559
+
4560
+
4561
+
4562
+
4563
+
4564
+ const schemaVersion = "https://json-schema.org/draft/2020-12/schema";
4565
+
4566
+ Schema$1.setConfig(schemaVersion, "baseToken", "$id");
4567
+ Schema$1.setConfig(schemaVersion, "embeddedToken", "$id");
4568
+ Schema$1.setConfig(schemaVersion, "anchorToken", "$anchor");
4569
+ Schema$1.setConfig(schemaVersion, "dynamicAnchorToken", "$dynamicAnchor");
4570
+ Schema$1.setConfig(schemaVersion, "vocabularyToken", "$vocabulary");
4571
+ Schema$1.setConfig(schemaVersion, "mandatoryVocabularies", ["https://json-schema.org/draft/2020-12/vocab/core"]);
4572
+
4573
+ Schema$1.add(JSON.parse(schema));
4574
+
4575
+ Schema$1.add(JSON.parse(core));
4576
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/core", {
4577
+ "validate": keywords.validate,
4578
+ "$defs": keywords.definitions,
4579
+ "$dynamicRef": keywords.dynamicRef,
4580
+ "$ref": keywords.ref
4581
+ });
4582
+
4583
+ Schema$1.add(JSON.parse(applicator));
4584
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/applicator", {
4585
+ "additionalProperties": keywords.additionalProperties6,
4586
+ "allOf": keywords.allOf,
4587
+ "anyOf": keywords.anyOf,
4588
+ "contains": keywords.containsMinContainsMaxContains,
4589
+ "dependentSchemas": keywords.dependentSchemas,
4590
+ "if": keywords.if,
4591
+ "then": keywords.then,
4592
+ "else": keywords.else,
4593
+ "items": keywords.items202012,
4594
+ "not": keywords.not,
4595
+ "oneOf": keywords.oneOf,
4596
+ "patternProperties": keywords.patternProperties,
4597
+ "prefixItems": keywords.tupleItems,
4598
+ "properties": keywords.properties,
4599
+ "propertyNames": keywords.propertyNames
4600
+ });
4601
+
4602
+ Schema$1.add(JSON.parse(validation));
4603
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/validation", {
4604
+ "const": keywords.const,
4605
+ "dependentRequired": keywords.dependentRequired,
4606
+ "enum": keywords.enum,
4607
+ "exclusiveMaximum": keywords.exclusiveMaximum,
4608
+ "exclusiveMinimum": keywords.exclusiveMinimum,
4609
+ "maxItems": keywords.maxItems,
4610
+ "maxLength": keywords.maxLength6,
4611
+ "maxProperties": keywords.maxProperties,
4612
+ "maximum": keywords.maximum,
4613
+ "minItems": keywords.minItems,
4614
+ "minLength": keywords.minLength6,
4615
+ "minProperties": keywords.minProperties,
4616
+ "minimum": keywords.minimum,
4617
+ "multipleOf": keywords.multipleOf,
4618
+ "pattern": keywords.pattern,
4619
+ "required": keywords.required,
4620
+ "type": keywords.type,
4621
+ "uniqueItems": keywords.uniqueItems
4622
+ });
4623
+
4624
+ Schema$1.add(JSON.parse(metaData));
4625
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/meta-data", {
4626
+ "default": keywords.metaData,
4627
+ "deprecated": keywords.metaData,
4628
+ "description": keywords.metaData,
4629
+ "examples": keywords.metaData,
4630
+ "readOnly": keywords.metaData,
4631
+ "title": keywords.metaData,
4632
+ "writeOnly": keywords.metaData
4633
+ });
4634
+
4635
+ Schema$1.add(JSON.parse(formatAnnotation));
4636
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/format-annotation", {
4637
+ "format": keywords.metaData
4638
+ });
4639
+
4640
+ Schema$1.add(JSON.parse(formatAssertion));
4641
+
4642
+ Schema$1.add(JSON.parse(content));
4643
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/content", {
4644
+ "contentEncoding": keywords.metaData,
4645
+ "contentMediaType": keywords.metaData,
4646
+ "contentSchema": keywords.metaData
4647
+ });
4648
+
4649
+ Schema$1.add(JSON.parse(unevaluated));
4650
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/unevaluated", {
4651
+ "unevaluatedItems": keywords.unevaluatedItems,
4652
+ "unevaluatedProperties": keywords.unevaluatedProperties
4653
+ });
4654
+
4655
+ const { Core, Schema, InvalidSchemaError } = lib$1;
4656
+
4657
+
4658
+
4659
+
4660
+
4661
+
4662
+
4663
+
4664
+
4665
+ var lib = {
4666
+ add: Core.add,
4667
+ get: Schema.get,
4668
+ validate: Core.validate,
4669
+ compile: Core.compile,
4670
+ interpret: Core.interpret,
4671
+ setMetaOutputFormat: Core.setMetaOutputFormat,
4672
+ setShouldMetaValidate: Core.setShouldMetaValidate,
4673
+ FLAG: Core.FLAG,
4674
+ BASIC: Core.BASIC,
4675
+ DETAILED: Core.DETAILED,
4676
+ VERBOSE: Core.VERBOSE,
4677
+ Keywords: keywords,
4678
+ InvalidSchemaError: InvalidSchemaError
4679
+ };
4680
+ var lib_1 = lib.add;
4681
+ var lib_2 = lib.get;
4682
+ var lib_3 = lib.validate;
4683
+ var lib_4 = lib.compile;
4684
+ var lib_5 = lib.interpret;
4685
+ var lib_6 = lib.setMetaOutputFormat;
4686
+ var lib_7 = lib.setShouldMetaValidate;
4687
+ var lib_8 = lib.FLAG;
4688
+ var lib_9 = lib.BASIC;
4689
+ var lib_10 = lib.DETAILED;
4690
+ var lib_11 = lib.VERBOSE;
4691
+ var lib_12 = lib.Keywords;
4692
+ var lib_13 = lib.InvalidSchemaError;
4693
+
4694
+ exports.BASIC = lib_9;
4695
+ exports.DETAILED = lib_10;
4696
+ exports.FLAG = lib_8;
4697
+ exports.InvalidSchemaError = lib_13;
4698
+ exports.Keywords = lib_12;
4699
+ exports.VERBOSE = lib_11;
4700
+ exports.add = lib_1;
4701
+ exports.compile = lib_4;
4702
+ exports['default'] = lib;
4703
+ exports.get = lib_2;
4704
+ exports.interpret = lib_5;
4705
+ exports.setMetaOutputFormat = lib_6;
4706
+ exports.setShouldMetaValidate = lib_7;
4707
+ exports.validate = lib_3;
4708
+ //# sourceMappingURL=json-schema-cjs.js.map