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