Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hyperjump/json-schema-core

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyperjump/json-schema-core - npm Package Compare versions

Comparing version 0.24.0 to 0.25.0

2

dist/json-schema-core-amd.min.js
define(["exports"],(function(e){"use strict";var r=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,r){return e(r={exports:{}},r.exports),r.exports}var o=n((function(e,r){var n,o;n="object"==typeof window&&window||t,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(r=e.exports=o),r.PubSub=o,e.exports=r=o}));o.PubSub;var a,i=n((function(e,r){
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,h=36,d=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=h-d,j=Math.floor,T=String.fromCharCode;function I(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function P(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&I("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&I("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&I("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&I("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&I("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=P(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(T(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&I("overflow"),o+=(E-n)*$,n=E;var _=!0,F=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(_=(U=k.next()).done);_=!0){var q=U.value;if(q<n&&++o>f&&I("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(T(R(H+K%M,0))),L=j(K/M)}r.push(T(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){F=!0,V=e}finally{try{!_&&k.return&&k.return()}finally{if(F)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:V},q={};function L(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function z(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function H(e,r){function t(e){var t=z(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var B=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(B);if(o){J?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=q[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function je(e){var r=z(e);return r.match(Ee)?r:e}var Te={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Ie=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Ie),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Te.scheme]=Te,q[xe.scheme]=xe,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,d(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,d(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,d(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},h=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);h(e,o,d(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},d=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:d,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),d(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>h(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,j=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>C.isReference(e.value)?C.value(e.value):e.value,I=r(((e,r)=>A(T(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:T(r)[e]}),D=r(((e,r)=>T(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),P=r(((e,r)=>T(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=r(((e,r,t)=>T(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>T(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>T(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:j,cons:(e,r="")=>Object.freeze({...j,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,r)=>e in T(r),typeOf:I,step:x,entries:e=>Object.keys(T(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(T(e)),map:D,filter:P,reduce:$,every:R,some:N,length:e=>T(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,V=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,k=/\\([\u000b\u0020-\u00ff])/g,q=/([\\"])/g,L=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,z=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!L.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(k,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function H(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!V.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!L.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},Z=async e=>Object.entries(await e),B=r((async(e,r)=>(await r).map(e))),J=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>J((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await B(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await B(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:B,filter:G,reduce:J,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,J((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae={},ie={},se=(e,r)=>{const t=e in ie?ie[e]:e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=se(n,"baseToken"),a=se(n,"anchorToken"),i=te(r,"");if(!i&&!te(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=te(i,e[o]||""),c=te(s,""),u=ne(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ue[i]=c);const l={},p=se(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=se(n,"vocabularyToken");re(e[h],"object")?(ie[c]=n,f=e[h],delete e[h]):(ie[c]=n,f={[n]:!0});const d={"":""};return ce[c]={id:c,schemaVersion:n,schema:pe(e,c,n,w.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[s]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],he=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),de=async(e,r=he)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?de(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:de,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a=o.$schema||e.schemaVersion,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.schemaVersion,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:je}=c,Te="FLAG",Ie="BASIC",xe="DETAILED",De="VERBOSE";let Pe=xe,$e=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Le(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=Te)=>{if(![Te,Ie,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",_e(n,a));return He(r,t,e,{}),o.unsubscribe(i),a[0]})),_e=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Ie&&(o.push(...r.errors),delete r.errors),(e===De||e!==Te&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},Ve=e=>Fe[e],Ue=e=>e in Fe,ke={},qe={},Le=async(e,r)=>{if(e=await ze(e),!Ue(`${e.schemaVersion}#validate`)){const r=await Ce.get(e.schemaVersion);(Ce.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in ke)Object.entries(ke[e]).forEach((([e,t])=>{((e,r)=>{Fe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if($e&&!e.validated){if(Ce.markValidated(e.id),!(e.schemaVersion in qe)){const r=await Ce.get(e.schemaVersion),t=await Re(r);qe[r.id]=Ne(t)}const r=_.cons(e.schema,e.id),t=qe[e.schemaVersion](r,Pe);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Ve(`${e.schemaVersion}#validate`).compile(e,r)},ze=async e=>Ce.typeOf(e,"string")?ze(await Ce.get(Ce.value(e),e)):e,He=(e,r,t,n)=>{const o=Ke(e,t),a=je(e,"");return Ve(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{Pe=e},setShouldMetaValidate:e=>{$e=e},FLAG:Te,BASIC:Ie,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete qe[n]},getKeyword:Ve,hasKeyword:Ue,defineVocabulary:(e,r)=>{ke[e]=r},compileSchema:Le,interpretSchema:He,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Be={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Me.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Me.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Je={metaData:Ze,validate:Be},Ge={Core:Me,Schema:Ce,Instance:_,Reference:C,Keywords:Je,InvalidSchemaError:Ae},We=Ge.Core,Qe=Ge.Schema,Ye=Ge.Instance,Xe=Ge.Reference,er=Ge.Keywords,rr=Ge.InvalidSchemaError;e.Core=We,e.Instance=Ye,e.InvalidSchemaError=rr,e.Keywords=er,e.Reference=Xe,e.Schema=Qe,e.default=Ge,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var B=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(B);if(o){J?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>C.isReference(e.value)?C.value(e.value):e.value,T=r(((e,r)=>A(j(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:j(r)[e]}),D=r(((e,r)=>j(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),$=r(((e,r)=>j(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=r(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>j(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>j(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:x,entries:e=>Object.keys(j(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(j(e)),map:D,filter:$,reduce:P,every:R,some:N,length:e=>j(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,k=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,q=/\\([\u000b\u0020-\u00ff])/g,L=/([\\"])/g,z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,H=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!z.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(q,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function V(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!k.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(L,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!z.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+V(r[o])}return n},parse:H},Z=async e=>Object.entries(await e),B=r((async(e,r)=>(await r).map(e))),J=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>J((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await B(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await B(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:B,filter:G,reduce:J,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,J((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae={},ie={},se=(e,r)=>{const t=ie[e]||e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema dialect");let o;delete e.$schema,o=!0===e.$vocabulary?.["https://json-schema.org/draft/2019-09/vocab/core"]?"https://json-schema.org/draft/2019-09/vocab/core":!0===e.$vocabulary?.["https://json-schema.org/draft/2020-12/vocab/core"]?"https://json-schema.org/draft/2020-12/vocab/core":ie[n]||n;const a=se(o,"baseToken"),i=se(o,"anchorToken"),s=te(r,"");if(!s&&!te(e[a]||"",""))throw Error("Couldn't determine an identifier for the schema");const c=te(s,e[a]||""),u=te(c,""),l=ne(c);delete e[a],l&&a===i&&(e[i]=i!==a?encodeURI(l):`#${encodeURI(l)}`),s&&(ue[s]=u),ie[u]=o;const p={},f=se(n,"recursiveAnchorToken");let d;!0===e[f]&&(p[""]=`${u}#`,e[i]="",delete e[f]);const h=se(n,"vocabularyToken");re(e[h],"object")?(d=e[h],delete e[h]):d={[ie[n]]:!0};const v={"":""};return ce[u]={id:u,dialectId:n,schema:pe(e,u,n,w.nil,v,p),anchors:v,dynamicAnchors:p,vocabulary:d,validated:!1},u},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[se(i,"baseToken")]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],de=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),he=async(e,r=de)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?he(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:he,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?te(o.$schema,""):e.dialectId,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.dialectId,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:Ie}=c,je="FLAG",Te="BASIC",xe="DETAILED",De="VERBOSE";let $e=xe,Pe=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await ze(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=je)=>{if(![je,Te,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",_e(n,a));return Ve(r,t,e,{}),o.unsubscribe(i),a[0]})),_e=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Te&&(o.push(...r.errors),delete r.errors),(e===De||e!==je&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},ke=e=>Fe[e],Ue=e=>e in Fe,qe={},Le={},ze=async(e,r)=>{if(e=await He(e),!Ue(`${e.dialectId}#validate`)){const r=await Ce.get(e.dialectId);(Ce.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in qe)Object.entries(qe[e]).forEach((([e,t])=>{((e,r)=>{Fe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(Pe&&!e.validated){if(Ce.markValidated(e.id),!(e.dialectId in Le)){const r=await Ce.get(e.dialectId),t=await Re(r);Le[r.id]=Ne(t)}const r=_.cons(e.schema,e.id),t=Le[e.dialectId](r,$e);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),ke(`${e.dialectId}#validate`).compile(e,r)},He=async e=>Ce.typeOf(e,"string")?He(await Ce.get(Ce.value(e),e)):e,Ve=(e,r,t,n)=>{const o=Ke(e,t),a=Ie(e,"");return ke(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{$e=e},setShouldMetaValidate:e=>{Pe=e},FLAG:je,BASIC:Te,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete Le[n]},getKeyword:ke,hasKeyword:Ue,defineVocabulary:(e,r)=>{qe[e]=r},compileSchema:ze,interpretSchema:Ve,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return ke(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return ke(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Be={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.dialectId}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Me.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Me.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Je={metaData:Ze,validate:Be},Ge={Core:Me,Schema:Ce,Instance:_,Reference:C,Keywords:Je,InvalidSchemaError:Ae},We=Ge.Core,Qe=Ge.Schema,Ye=Ge.Instance,Xe=Ge.Reference,er=Ge.Keywords,rr=Ge.InvalidSchemaError;e.Core=We,e.Instance=Ye,e.InvalidSchemaError=rr,e.Keywords=er,e.Reference=Xe,e.Schema=Qe,e.default=Ge,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=json-schema-core-amd.min.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,r){return e(r={exports:{}},r.exports),r.exports}var n=t((function(e,t){var n,o;n="object"==typeof window&&window||r,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(t=e.exports=o),t.PubSub=o,e.exports=t=o}));n.PubSub;var o,a=t((function(e,r){
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,h=36,d=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=h-d,j=Math.floor,x=String.fromCharCode;function T(e){throw new RangeError(O[e])}function I(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+I((e=e.replace(C,".")).split("."),r).join(".")}function P(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&T("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&T("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=P(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(x(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,I=e[Symbol.iterator]();!(S=(A=I.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&I.return&&I.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&T("overflow"),o+=(E-n)*$,n=E;var _=!0,F=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(_=(U=k.next()).done);_=!0){var q=U.value;if(q<n&&++o>f&&T("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(x(R(H+K%M,0))),L=j(K/M)}r.push(x(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){F=!0,V=e}finally{try{!_&&k.return&&k.return()}finally{if(F)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:V},q={};function L(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function z(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function H(e,r){function t(e){var t=z(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var B=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(B);if(o){J?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=q[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function je(e){var r=z(e);return r.match(Ee)?r:e}var xe={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Te=/^([^\:]+)\:(.*)/,Ie={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[xe.scheme]=xe,q[Ie.scheme]=Ie,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(o=a)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default;const i={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var s={jsonTypeOf:(e,r)=>i[r](e),resolveUrl:(e,r)=>{const t=a.resolve(e,r,{iri:!0});if(a.resolve(e,"",{iri:!0})&&"file"===a.parse(t).scheme&&"file"!==a.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>a.unescapeComponent(a.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const c=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(v)},u=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:u(e,m(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[y(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:m(r,e[0],n)},l=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||g(r)){const o=e.shift();l(e,m(r,o,n),t,h(o,n))}else{r[y(r,e[0])]=t}},p=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=m(r,n,t);return{...r,[n]:p(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return m(r,e[0],t)}},f=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=m(r,n,t);f(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:m(r,e[0],t)},h=e(((e,r)=>r+"/"+d(e))),d=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),v=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),y=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,m=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(g(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[y(e,r)]},g=e=>null===e||"object"!=typeof e;var b={nil:"",append:h,get:(e,r)=>{const t=c(e),n=e=>t.reduce((([e,r],t)=>[m(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(r,t,n)=>{const o=c(r),a=e(((e,r)=>u(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(r,t,n)=>{const o=c(r),a=e(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=c(e),n=e=>p(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=c(e),n=e=>f(t,e,"");return void 0===r?n:n(r)}};b.nil,b.append,b.get,b.set,b.assign,b.unset,b.remove;const w=Symbol("$__value"),E=Symbol("$__href");var S={cons:(e,r)=>Object.freeze({[E]:e,[w]:r}),isReference:e=>e&&void 0!==e[E],href:e=>e[E],value:e=>e[w]};const{resolveUrl:C,jsonTypeOf:O}=s,A=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>S.isReference(e.value)?S.value(e.value):e.value,x=e(((e,r)=>O(j(e),r))),T=(e,r)=>Object.freeze({...r,pointer:b.append(e,r.pointer),value:j(r)[e]}),I=e(((e,r)=>j(r).map(((t,n,o,a)=>e(T(n,r),n,o,a))))),D=e(((e,r)=>j(r).map(((e,t,n,o)=>T(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=e(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,T(o,t),o)),r))),$=e(((e,r)=>j(r).every(((t,n,o,a)=>e(T(n,r),n,o,a))))),R=e(((e,r)=>j(r).some(((t,n,o,a)=>e(T(n,r),n,o,a)))));var N={nil:A,cons:(e,r="")=>Object.freeze({...A,id:C(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:x,step:T,entries:e=>Object.keys(j(e)).map((r=>[r,T(r,e)])),keys:e=>Object.keys(j(e)),map:I,filter:D,reduce:P,every:$,some:R,length:e=>j(e).length},_=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,F=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,V=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,U=/\\([\u000b\u0020-\u00ff])/g,k=/([\\"])/g,q=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,L=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!q.test(n))throw new TypeError("invalid media type");var o=new H(n.toLowerCase());if(-1!==t){var a,i,s;for(_.lastIndex=t;i=_.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(U,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function z(e){var r=String(e);if(V.test(r))return r;if(r.length>0&&!F.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(k,"\\$1")+'"'}function H(e){this.parameters=Object.create(null),this.type=e}var K={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!q.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!V.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+z(r[o])}return n},parse:L},M=async e=>Object.entries(await e),Z=e((async(e,r)=>(await r).map(e))),B=e((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),J=e((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),G=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).some((e=>e))})),W=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).every((e=>e))})),Q=e(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),Y={entries:M,map:Z,filter:J,reduce:B,some:G,every:W,pipeline:Q,all:e=>Promise.all(e),allValues:e=>Q([M,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};Y.entries,Y.map,Y.filter,Y.reduce,Y.some,Y.every,Y.pipeline,Y.all,Y.allValues;var X=fetch;const{jsonTypeOf:ee,resolveUrl:re,urlFragment:te,pathRelative:ne}=s,oe={},ae={},ie=(e,r)=>{const t=e in ae?ae[e]:e;if(t in oe)return oe[t][r]},se={},ce={},ue=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=re(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=ie(n,"baseToken"),a=ie(n,"anchorToken"),i=re(r,"");if(!i&&!re(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=re(i,e[o]||""),c=re(s,""),u=te(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ce[i]=c);const l={},p=ie(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=ie(n,"vocabularyToken");ee(e[h],"object")?(ae[c]=n,f=e[h],delete e[h]):(ae[c]=n,f={[n]:!0});const d={"":""};return se[c]={id:c,schemaVersion:n,schema:le(e,c,n,b.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},le=(e,r,t,n,o,a)=>{if(ee(e,"object")){const i="string"==typeof e.$schema?re(e.$schema,""):t,s=ie(i,"embeddedToken"),c=ie(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=re(r,e[s]);return e[s]=n,ue(e,n,t),S.cons(e[s],e)}const u=ie(t,"anchorToken"),l=ie(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ie(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=ie(t,"jrefToken");if("string"==typeof e[f])return S.cons(e[f],e);for(const i in e)e[i]=le(e[i],r,t,b.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>le(e,r,t,b.append(i,n),o,a))):e},pe=e=>se[ce[e]]||se[e],fe=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:b.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),he=async(e,r=fe)=>{const t=re(ye(r),e),n=re(t,""),o=te(t);if(!(e=>e in se||e in ce)(n)){const e=await X(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=K.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}ue(await e.json(),n)}const a=pe(n),i="/"!==o[0]?ve(a,o):o,s=Object.freeze({...a,pointer:i,value:b.get(i,a.schema)});return de(s)},de=e=>S.isReference(e.value)?he(S.href(e.value),e):e,ve=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},ye=e=>`${e.id}#${encodeURI(e.pointer)}`,me=e=>S.isReference(e.value)?S.value(e.value):e.value,ge=(e,r)=>{const t=pe(r.id),n=Object.freeze({...r,pointer:b.append(e,r.pointer),value:me(r)[e],validated:t.validated});return de(n)},be=e(((e,r)=>Y.pipeline([me,Y.map((async(t,n)=>e(await ge(n,r),n))),Y.all],r))),we={parentId:"",parentDialect:"",includeEmbedded:!0},Ee=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ne(t,r.slice(7))}return r};var Se={setConfig:(e,r,t)=>{oe[e]||(oe[e]={}),oe[e][r]=t},getConfig:ie,add:ue,get:he,markValidated:e=>{se[e].validated=!0},uri:ye,value:me,getAnchorPointer:ve,typeOf:(e,r)=>ee(me(e),r),has:(e,r)=>e in me(r),step:ge,keys:e=>Object.keys(me(e)),entries:e=>Y.pipeline([me,Object.keys,Y.map((async r=>[r,await ge(r,e)])),Y.all],e),map:be,length:e=>me(e).length,toSchema:(e,r={})=>{const t={...we,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!S.isReference(n))return n;const o=S.value(n),a=o.$schema||e.schemaVersion,i=ie(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:S.value(n)}))),o=ie(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=te(r);b.assign(t,n,{[o]:e,...b.get(t,n)})}));const a=ie(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{b.assign(r,n,{[a]:e,...b.get(r,n)})}));const i=ie(e.schemaVersion,"baseToken"),s=Ee(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Se.setConfig,Se.getConfig,Se.add,Se.get,Se.markValidated,Se.uri,Se.value,Se.getAnchorPointer,Se.typeOf,Se.has,Se.step,Se.keys,Se.entries,Se.map,Se.length,Se.toSchema;class Ce extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Oe=Ce;const{resolveUrl:Ae}=s,je="FLAG",xe="BASIC",Te="DETAILED",Ie="VERBOSE";let De=Te,Pe=!0;const $e=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await qe(e,r)}},Re=e((({ast:e,schemaUri:r},t,o=je)=>{if(![je,xe,Te,Ie].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",Ne(o,a));return ze(r,t,e,{}),n.unsubscribe(i),a[0]})),Ne=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===xe&&(o.push(...r.errors),delete r.errors),(e===Ie||e!==je&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},_e={},Fe=e=>_e[e],Ve=e=>e in _e,Ue={},ke={},qe=async(e,r)=>{if(e=await Le(e),!Ve(`${e.schemaVersion}#validate`)){const r=await Se.get(e.schemaVersion);(Se.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in Ue)Object.entries(Ue[e]).forEach((([e,t])=>{((e,r)=>{_e[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(Pe&&!e.validated){if(Se.markValidated(e.id),!(e.schemaVersion in ke)){const r=await Se.get(e.schemaVersion),t=await $e(r);ke[r.id]=Re(t)}const r=N.cons(e.schema,e.id),t=ke[e.schemaVersion](r,De);if(!t.valid)throw new Oe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Fe(`${e.schemaVersion}#validate`).compile(e,r)},Le=async e=>Se.typeOf(e,"string")?Le(await Se.get(Se.value(e),e)):e,ze=(e,r,t,n)=>{const o=He(e,t),a=Ae(e,"");return Fe(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},He=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Ke={validate:async(e,r,t)=>{const n=await $e(e),o=(e,r)=>Re(n,N.cons(e),r);return void 0===r?o:o(r,t)},compile:$e,interpret:Re,setMetaOutputFormat:e=>{De=e},setShouldMetaValidate:e=>{Pe=e},FLAG:je,BASIC:xe,DETAILED:Te,VERBOSE:Ie,add:(e,r="",t="")=>{const n=Se.add(e,r,t);delete ke[n]},getKeyword:Fe,hasKeyword:Ve,defineVocabulary:(e,r)=>{Ue[e]=r},compileSchema:qe,interpretSchema:ze,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=He(e,t);return Fe(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=He(e,t);return Fe(a).collectEvaluatedItems(e,r,t,n,o)}};var Me={compile:e=>Se.value(e),interpret:()=>!0};var Ze={compile:async(e,r)=>{const t=Se.uri(e);if(!(t in r)){r[t]=!1;const n=Se.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Se.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Se.uri(e),"boolean"==typeof n?n:await Y.pipeline([Se.entries,Y.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),Y.filter((([r])=>Ke.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),Y.map((async([t,n])=>{const o=await Ke.getKeyword(t).compile(n,r,e);return[t,Se.uri(n),o]})),Y.all],e)]}return t},interpret:(e,r,t,o)=>{const[a,i,s]=t[e];n.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{n.publishSync("result.start");const s=Ke.getKeyword(e).interpret(i,r,t,o);return n.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:N.uri(r),valid:s,ast:i}),n.publishSync("result.end"),s}));return n.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:N.uri(r),valid:c,ast:e}),n.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Ke.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Ke.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Me,validate:Ze},Je={Core:Ke,Schema:Se,Instance:N,Reference:S,Keywords:Be,InvalidSchemaError:Oe},Ge=Je.Core,We=Je.Schema,Qe=Je.Instance,Ye=Je.Reference,Xe=Je.Keywords,er=Je.InvalidSchemaError;exports.Core=Ge,exports.Instance=Qe,exports.InvalidSchemaError=er,exports.Keywords=Xe,exports.Reference=Ye,exports.Schema=We,exports.default=Je;
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function x(e){throw new RangeError(O[e])}function T(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+T((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&x("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&x("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&x("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&x("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&x("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,T=e[Symbol.iterator]();!(S=(A=T.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&T.return&&T.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&x("overflow"),o+=(E-n)*P,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&x("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var B=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(B);if(o){J?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},xe=/^([^\:]+)\:(.*)/,Te={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(xe),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[Te.scheme]=Te,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(o=a)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default;const i={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var s={jsonTypeOf:(e,r)=>i[r](e),resolveUrl:(e,r)=>{const t=a.resolve(e,r,{iri:!0});if(a.resolve(e,"",{iri:!0})&&"file"===a.parse(t).scheme&&"file"!==a.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>a.unescapeComponent(a.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const c=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(v)},u=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:u(e,m(r,o,n),t,d(o,n))}}if(Array.isArray(r)){const n=[...r];return n[y(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:m(r,e[0],n)},l=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||g(r)){const o=e.shift();l(e,m(r,o,n),t,d(o,n))}else{r[y(r,e[0])]=t}},p=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=m(r,n,t);return{...r,[n]:p(e,o,d(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return m(r,e[0],t)}},f=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=m(r,n,t);f(e,o,d(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:m(r,e[0],t)},d=e(((e,r)=>r+"/"+h(e))),h=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),v=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),y=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,m=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(g(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[y(e,r)]},g=e=>null===e||"object"!=typeof e;var b={nil:"",append:d,get:(e,r)=>{const t=c(e),n=e=>t.reduce((([e,r],t)=>[m(e,t,r),d(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(r,t,n)=>{const o=c(r),a=e(((e,r)=>u(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(r,t,n)=>{const o=c(r),a=e(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=c(e),n=e=>p(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=c(e),n=e=>f(t,e,"");return void 0===r?n:n(r)}};b.nil,b.append,b.get,b.set,b.assign,b.unset,b.remove;const w=Symbol("$__value"),E=Symbol("$__href");var S={cons:(e,r)=>Object.freeze({[E]:e,[w]:r}),isReference:e=>e&&void 0!==e[E],href:e=>e[E],value:e=>e[w]};const{resolveUrl:C,jsonTypeOf:O}=s,A=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),I=e=>S.isReference(e.value)?S.value(e.value):e.value,j=e(((e,r)=>O(I(e),r))),x=(e,r)=>Object.freeze({...r,pointer:b.append(e,r.pointer),value:I(r)[e]}),T=e(((e,r)=>I(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),D=e(((e,r)=>I(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=e(((e,r,t)=>I(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),P=e(((e,r)=>I(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),R=e(((e,r)=>I(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var N={nil:A,cons:(e,r="")=>Object.freeze({...A,id:C(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:I,has:(e,r)=>e in I(r),typeOf:j,step:x,entries:e=>Object.keys(I(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(I(e)),map:T,filter:D,reduce:$,every:P,some:R,length:e=>I(e).length},_=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,F=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,k=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,U=/\\([\u000b\u0020-\u00ff])/g,q=/([\\"])/g,L=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,z=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!L.test(n))throw new TypeError("invalid media type");var o=new V(n.toLowerCase());if(-1!==t){var a,i,s;for(_.lastIndex=t;i=_.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(U,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function H(e){var r=String(e);if(k.test(r))return r;if(r.length>0&&!F.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$1")+'"'}function V(e){this.parameters=Object.create(null),this.type=e}var K={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!L.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!k.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},M=async e=>Object.entries(await e),Z=e((async(e,r)=>(await r).map(e))),B=e((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),J=e((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),G=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).some((e=>e))})),W=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).every((e=>e))})),Q=e(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),Y={entries:M,map:Z,filter:J,reduce:B,some:G,every:W,pipeline:Q,all:e=>Promise.all(e),allValues:e=>Q([M,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};Y.entries,Y.map,Y.filter,Y.reduce,Y.some,Y.every,Y.pipeline,Y.all,Y.allValues;var X=fetch;const{jsonTypeOf:ee,resolveUrl:re,urlFragment:te,pathRelative:ne}=s,oe={},ae={},ie=(e,r)=>{const t=ae[e]||e;if(t in oe)return oe[t][r]},se={},ce={},ue=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=re(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema dialect");let o;delete e.$schema,o=!0===e.$vocabulary?.["https://json-schema.org/draft/2019-09/vocab/core"]?"https://json-schema.org/draft/2019-09/vocab/core":!0===e.$vocabulary?.["https://json-schema.org/draft/2020-12/vocab/core"]?"https://json-schema.org/draft/2020-12/vocab/core":ae[n]||n;const a=ie(o,"baseToken"),i=ie(o,"anchorToken"),s=re(r,"");if(!s&&!re(e[a]||"",""))throw Error("Couldn't determine an identifier for the schema");const c=re(s,e[a]||""),u=re(c,""),l=te(c);delete e[a],l&&a===i&&(e[i]=i!==a?encodeURI(l):`#${encodeURI(l)}`),s&&(ce[s]=u),ae[u]=o;const p={},f=ie(n,"recursiveAnchorToken");let d;!0===e[f]&&(p[""]=`${u}#`,e[i]="",delete e[f]);const h=ie(n,"vocabularyToken");ee(e[h],"object")?(d=e[h],delete e[h]):d={[ae[n]]:!0};const v={"":""};return se[u]={id:u,dialectId:n,schema:le(e,u,n,b.nil,v,p),anchors:v,dynamicAnchors:p,vocabulary:d,validated:!1},u},le=(e,r,t,n,o,a)=>{if(ee(e,"object")){const i="string"==typeof e.$schema?re(e.$schema,""):t,s=ie(i,"embeddedToken"),c=ie(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=re(r,e[s]);return e[ie(i,"baseToken")]=n,ue(e,n,t),S.cons(e[s],e)}const u=ie(t,"anchorToken"),l=ie(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ie(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=ie(t,"jrefToken");if("string"==typeof e[f])return S.cons(e[f],e);for(const i in e)e[i]=le(e[i],r,t,b.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>le(e,r,t,b.append(i,n),o,a))):e},pe=e=>se[ce[e]]||se[e],fe=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:b.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),de=async(e,r=fe)=>{const t=re(ye(r),e),n=re(t,""),o=te(t);if(!(e=>e in se||e in ce)(n)){const e=await X(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=K.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}ue(await e.json(),n)}const a=pe(n),i="/"!==o[0]?ve(a,o):o,s=Object.freeze({...a,pointer:i,value:b.get(i,a.schema)});return he(s)},he=e=>S.isReference(e.value)?de(S.href(e.value),e):e,ve=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},ye=e=>`${e.id}#${encodeURI(e.pointer)}`,me=e=>S.isReference(e.value)?S.value(e.value):e.value,ge=(e,r)=>{const t=pe(r.id),n=Object.freeze({...r,pointer:b.append(e,r.pointer),value:me(r)[e],validated:t.validated});return he(n)},be=e(((e,r)=>Y.pipeline([me,Y.map((async(t,n)=>e(await ge(n,r),n))),Y.all],r))),we={parentId:"",parentDialect:"",includeEmbedded:!0},Ee=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ne(t,r.slice(7))}return r};var Se={setConfig:(e,r,t)=>{oe[e]||(oe[e]={}),oe[e][r]=t},getConfig:ie,add:ue,get:de,markValidated:e=>{se[e].validated=!0},uri:ye,value:me,getAnchorPointer:ve,typeOf:(e,r)=>ee(me(e),r),has:(e,r)=>e in me(r),step:ge,keys:e=>Object.keys(me(e)),entries:e=>Y.pipeline([me,Object.keys,Y.map((async r=>[r,await ge(r,e)])),Y.all],e),map:be,length:e=>me(e).length,toSchema:(e,r={})=>{const t={...we,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!S.isReference(n))return n;const o=S.value(n),a="string"==typeof o.$schema?re(o.$schema,""):e.dialectId,i=ie(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:S.value(n)}))),o=ie(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=te(r);b.assign(t,n,{[o]:e,...b.get(t,n)})}));const a=ie(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{b.assign(r,n,{[a]:e,...b.get(r,n)})}));const i=ie(e.dialectId,"baseToken"),s=Ee(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Se.setConfig,Se.getConfig,Se.add,Se.get,Se.markValidated,Se.uri,Se.value,Se.getAnchorPointer,Se.typeOf,Se.has,Se.step,Se.keys,Se.entries,Se.map,Se.length,Se.toSchema;class Ce extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Oe=Ce;const{resolveUrl:Ae}=s,Ie="FLAG",je="BASIC",xe="DETAILED",Te="VERBOSE";let De=xe,$e=!0;const Pe=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Le(e,r)}},Re=e((({ast:e,schemaUri:r},t,o=Ie)=>{if(![Ie,je,xe,Te].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",Ne(o,a));return He(r,t,e,{}),n.unsubscribe(i),a[0]})),Ne=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===je&&(o.push(...r.errors),delete r.errors),(e===Te||e!==Ie&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},_e={},Fe=e=>_e[e],ke=e=>e in _e,Ue={},qe={},Le=async(e,r)=>{if(e=await ze(e),!ke(`${e.dialectId}#validate`)){const r=await Se.get(e.dialectId);(Se.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in Ue)Object.entries(Ue[e]).forEach((([e,t])=>{((e,r)=>{_e[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if($e&&!e.validated){if(Se.markValidated(e.id),!(e.dialectId in qe)){const r=await Se.get(e.dialectId),t=await Pe(r);qe[r.id]=Re(t)}const r=N.cons(e.schema,e.id),t=qe[e.dialectId](r,De);if(!t.valid)throw new Oe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Fe(`${e.dialectId}#validate`).compile(e,r)},ze=async e=>Se.typeOf(e,"string")?ze(await Se.get(Se.value(e),e)):e,He=(e,r,t,n)=>{const o=Ve(e,t),a=Ae(e,"");return Fe(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ve=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Ke={validate:async(e,r,t)=>{const n=await Pe(e),o=(e,r)=>Re(n,N.cons(e),r);return void 0===r?o:o(r,t)},compile:Pe,interpret:Re,setMetaOutputFormat:e=>{De=e},setShouldMetaValidate:e=>{$e=e},FLAG:Ie,BASIC:je,DETAILED:xe,VERBOSE:Te,add:(e,r="",t="")=>{const n=Se.add(e,r,t);delete qe[n]},getKeyword:Fe,hasKeyword:ke,defineVocabulary:(e,r)=>{Ue[e]=r},compileSchema:Le,interpretSchema:He,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ve(e,t);return Fe(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ve(e,t);return Fe(a).collectEvaluatedItems(e,r,t,n,o)}};var Me={compile:e=>Se.value(e),interpret:()=>!0};var Ze={compile:async(e,r)=>{const t=Se.uri(e);if(!(t in r)){r[t]=!1;const n=Se.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Se.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Se.uri(e),"boolean"==typeof n?n:await Y.pipeline([Se.entries,Y.map((([r,t])=>[`${e.dialectId}#${r}`,t])),Y.filter((([r])=>Ke.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),Y.map((async([t,n])=>{const o=await Ke.getKeyword(t).compile(n,r,e);return[t,Se.uri(n),o]})),Y.all],e)]}return t},interpret:(e,r,t,o)=>{const[a,i,s]=t[e];n.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{n.publishSync("result.start");const s=Ke.getKeyword(e).interpret(i,r,t,o);return n.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:N.uri(r),valid:s,ast:i}),n.publishSync("result.end"),s}));return n.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:N.uri(r),valid:c,ast:e}),n.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Ke.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Ke.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Me,validate:Ze},Je={Core:Ke,Schema:Se,Instance:N,Reference:S,Keywords:Be,InvalidSchemaError:Oe},Ge=Je.Core,We=Je.Schema,Qe=Je.Instance,Ye=Je.Reference,Xe=Je.Keywords,er=Je.InvalidSchemaError;exports.Core=Ge,exports.Instance=Qe,exports.InvalidSchemaError=er,exports.Keywords=Xe,exports.Reference=Ye,exports.Schema=We,exports.default=Je;
//# sourceMappingURL=json-schema-core-cjs.min.js.map
var e=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,r){return e(r={exports:{}},r.exports),r.exports}var n=t((function(e,t){var n,o;n="object"==typeof window&&window||r,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(t=e.exports=o),t.PubSub=o,e.exports=t=o}));n.PubSub;var o,a=t((function(e,r){
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,h=36,d=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=h-d,j=Math.floor,T=String.fromCharCode;function I(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function P(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(n+(A+1)*e/(e+y))},F=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&I("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&I("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&I("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&I("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&I("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},_=function(e){var r=[],t=(e=P(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(T(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&I("overflow"),o+=(E-n)*$,n=E;var F=!0,_=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(F=(U=k.next()).done);F=!0){var q=U.value;if(q<n&&++o>f&&I("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(T(R(H+K%M,0))),L=j(K/M)}r.push(T(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){_=!0,V=e}finally{try{!F&&k.return&&k.return()}finally{if(_)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?F(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+_(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:F,encode:_,toASCII:U,toUnicode:V},q={};function L(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function z(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function H(e,r){function t(e){var t=z(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var B=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(B);if(o){J?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=q[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function je(e){var r=z(e);return r.match(Ee)?r:e}var Te={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Ie=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Ie),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Te.scheme]=Te,q[xe.scheme]=xe,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(o=a)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default;const i={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var s={jsonTypeOf:(e,r)=>i[r](e),resolveUrl:(e,r)=>{const t=a.resolve(e,r,{iri:!0});if(a.resolve(e,"",{iri:!0})&&"file"===a.parse(t).scheme&&"file"!==a.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>a.unescapeComponent(a.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const c=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(v)},u=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:u(e,m(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[y(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:m(r,e[0],n)},l=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||g(r)){const o=e.shift();l(e,m(r,o,n),t,h(o,n))}else{r[y(r,e[0])]=t}},p=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=m(r,n,t);return{...r,[n]:p(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return m(r,e[0],t)}},f=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=m(r,n,t);f(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:m(r,e[0],t)},h=e(((e,r)=>r+"/"+d(e))),d=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),v=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),y=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,m=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(g(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[y(e,r)]},g=e=>null===e||"object"!=typeof e;var b={nil:"",append:h,get:(e,r)=>{const t=c(e),n=e=>t.reduce((([e,r],t)=>[m(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(r,t,n)=>{const o=c(r),a=e(((e,r)=>u(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(r,t,n)=>{const o=c(r),a=e(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=c(e),n=e=>p(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=c(e),n=e=>f(t,e,"");return void 0===r?n:n(r)}};b.nil,b.append,b.get,b.set,b.assign,b.unset,b.remove;const w=Symbol("$__value"),E=Symbol("$__href");var S={cons:(e,r)=>Object.freeze({[E]:e,[w]:r}),isReference:e=>e&&void 0!==e[E],href:e=>e[E],value:e=>e[w]};const{resolveUrl:C,jsonTypeOf:O}=s,A=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>S.isReference(e.value)?S.value(e.value):e.value,T=e(((e,r)=>O(j(e),r))),I=(e,r)=>Object.freeze({...r,pointer:b.append(e,r.pointer),value:j(r)[e]}),x=e(((e,r)=>j(r).map(((t,n,o,a)=>e(I(n,r),n,o,a))))),D=e(((e,r)=>j(r).map(((e,t,n,o)=>I(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=e(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,I(o,t),o)),r))),$=e(((e,r)=>j(r).every(((t,n,o,a)=>e(I(n,r),n,o,a))))),R=e(((e,r)=>j(r).some(((t,n,o,a)=>e(I(n,r),n,o,a)))));var N={nil:A,cons:(e,r="")=>Object.freeze({...A,id:C(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:I,entries:e=>Object.keys(j(e)).map((r=>[r,I(r,e)])),keys:e=>Object.keys(j(e)),map:x,filter:D,reduce:P,every:$,some:R,length:e=>j(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,_=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,V=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,U=/\\([\u000b\u0020-\u00ff])/g,k=/([\\"])/g,q=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,L=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!q.test(n))throw new TypeError("invalid media type");var o=new H(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(U,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function z(e){var r=String(e);if(V.test(r))return r;if(r.length>0&&!_.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(k,"\\$1")+'"'}function H(e){this.parameters=Object.create(null),this.type=e}var K={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!q.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!V.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+z(r[o])}return n},parse:L},M=async e=>Object.entries(await e),Z=e((async(e,r)=>(await r).map(e))),B=e((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),J=e((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),G=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).some((e=>e))})),W=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).every((e=>e))})),Q=e(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),Y={entries:M,map:Z,filter:J,reduce:B,some:G,every:W,pipeline:Q,all:e=>Promise.all(e),allValues:e=>Q([M,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};Y.entries,Y.map,Y.filter,Y.reduce,Y.some,Y.every,Y.pipeline,Y.all,Y.allValues;var X=fetch;const{jsonTypeOf:ee,resolveUrl:re,urlFragment:te,pathRelative:ne}=s,oe={},ae={},ie=(e,r)=>{const t=e in ae?ae[e]:e;if(t in oe)return oe[t][r]},se={},ce={},ue=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=re(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=ie(n,"baseToken"),a=ie(n,"anchorToken"),i=re(r,"");if(!i&&!re(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=re(i,e[o]||""),c=re(s,""),u=te(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ce[i]=c);const l={},p=ie(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=ie(n,"vocabularyToken");ee(e[h],"object")?(ae[c]=n,f=e[h],delete e[h]):(ae[c]=n,f={[n]:!0});const d={"":""};return se[c]={id:c,schemaVersion:n,schema:le(e,c,n,b.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},le=(e,r,t,n,o,a)=>{if(ee(e,"object")){const i="string"==typeof e.$schema?re(e.$schema,""):t,s=ie(i,"embeddedToken"),c=ie(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=re(r,e[s]);return e[s]=n,ue(e,n,t),S.cons(e[s],e)}const u=ie(t,"anchorToken"),l=ie(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ie(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=ie(t,"jrefToken");if("string"==typeof e[f])return S.cons(e[f],e);for(const i in e)e[i]=le(e[i],r,t,b.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>le(e,r,t,b.append(i,n),o,a))):e},pe=e=>se[ce[e]]||se[e],fe=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:b.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),he=async(e,r=fe)=>{const t=re(ye(r),e),n=re(t,""),o=te(t);if(!(e=>e in se||e in ce)(n)){const e=await X(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=K.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}ue(await e.json(),n)}const a=pe(n),i="/"!==o[0]?ve(a,o):o,s=Object.freeze({...a,pointer:i,value:b.get(i,a.schema)});return de(s)},de=e=>S.isReference(e.value)?he(S.href(e.value),e):e,ve=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},ye=e=>`${e.id}#${encodeURI(e.pointer)}`,me=e=>S.isReference(e.value)?S.value(e.value):e.value,ge=(e,r)=>{const t=pe(r.id),n=Object.freeze({...r,pointer:b.append(e,r.pointer),value:me(r)[e],validated:t.validated});return de(n)},be=e(((e,r)=>Y.pipeline([me,Y.map((async(t,n)=>e(await ge(n,r),n))),Y.all],r))),we={parentId:"",parentDialect:"",includeEmbedded:!0},Ee=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ne(t,r.slice(7))}return r};var Se={setConfig:(e,r,t)=>{oe[e]||(oe[e]={}),oe[e][r]=t},getConfig:ie,add:ue,get:he,markValidated:e=>{se[e].validated=!0},uri:ye,value:me,getAnchorPointer:ve,typeOf:(e,r)=>ee(me(e),r),has:(e,r)=>e in me(r),step:ge,keys:e=>Object.keys(me(e)),entries:e=>Y.pipeline([me,Object.keys,Y.map((async r=>[r,await ge(r,e)])),Y.all],e),map:be,length:e=>me(e).length,toSchema:(e,r={})=>{const t={...we,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!S.isReference(n))return n;const o=S.value(n),a=o.$schema||e.schemaVersion,i=ie(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:S.value(n)}))),o=ie(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=te(r);b.assign(t,n,{[o]:e,...b.get(t,n)})}));const a=ie(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{b.assign(r,n,{[a]:e,...b.get(r,n)})}));const i=ie(e.schemaVersion,"baseToken"),s=Ee(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Se.setConfig,Se.getConfig,Se.add,Se.get,Se.markValidated,Se.uri,Se.value,Se.getAnchorPointer,Se.typeOf,Se.has,Se.step,Se.keys,Se.entries,Se.map,Se.length,Se.toSchema;class Ce extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Oe=Ce;const{resolveUrl:Ae}=s,je="FLAG",Te="BASIC",Ie="DETAILED",xe="VERBOSE";let De=Ie,Pe=!0;const $e=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await qe(e,r)}},Re=e((({ast:e,schemaUri:r},t,o=je)=>{if(![je,Te,Ie,xe].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",Ne(o,a));return ze(r,t,e,{}),n.unsubscribe(i),a[0]})),Ne=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Te&&(o.push(...r.errors),delete r.errors),(e===xe||e!==je&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},_e=e=>Fe[e],Ve=e=>e in Fe,Ue={},ke={},qe=async(e,r)=>{if(e=await Le(e),!Ve(`${e.schemaVersion}#validate`)){const r=await Se.get(e.schemaVersion);(Se.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in Ue)Object.entries(Ue[e]).forEach((([e,t])=>{((e,r)=>{Fe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(Pe&&!e.validated){if(Se.markValidated(e.id),!(e.schemaVersion in ke)){const r=await Se.get(e.schemaVersion),t=await $e(r);ke[r.id]=Re(t)}const r=N.cons(e.schema,e.id),t=ke[e.schemaVersion](r,De);if(!t.valid)throw new Oe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),_e(`${e.schemaVersion}#validate`).compile(e,r)},Le=async e=>Se.typeOf(e,"string")?Le(await Se.get(Se.value(e),e)):e,ze=(e,r,t,n)=>{const o=He(e,t),a=Ae(e,"");return _e(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},He=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Ke={validate:async(e,r,t)=>{const n=await $e(e),o=(e,r)=>Re(n,N.cons(e),r);return void 0===r?o:o(r,t)},compile:$e,interpret:Re,setMetaOutputFormat:e=>{De=e},setShouldMetaValidate:e=>{Pe=e},FLAG:je,BASIC:Te,DETAILED:Ie,VERBOSE:xe,add:(e,r="",t="")=>{const n=Se.add(e,r,t);delete ke[n]},getKeyword:_e,hasKeyword:Ve,defineVocabulary:(e,r)=>{Ue[e]=r},compileSchema:qe,interpretSchema:ze,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=He(e,t);return _e(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=He(e,t);return _e(a).collectEvaluatedItems(e,r,t,n,o)}};var Me={compile:e=>Se.value(e),interpret:()=>!0};var Ze={compile:async(e,r)=>{const t=Se.uri(e);if(!(t in r)){r[t]=!1;const n=Se.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Se.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Se.uri(e),"boolean"==typeof n?n:await Y.pipeline([Se.entries,Y.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),Y.filter((([r])=>Ke.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),Y.map((async([t,n])=>{const o=await Ke.getKeyword(t).compile(n,r,e);return[t,Se.uri(n),o]})),Y.all],e)]}return t},interpret:(e,r,t,o)=>{const[a,i,s]=t[e];n.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{n.publishSync("result.start");const s=Ke.getKeyword(e).interpret(i,r,t,o);return n.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:N.uri(r),valid:s,ast:i}),n.publishSync("result.end"),s}));return n.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:N.uri(r),valid:c,ast:e}),n.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Ke.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Ke.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Me,validate:Ze},Je={Core:Ke,Schema:Se,Instance:N,Reference:S,Keywords:Be,InvalidSchemaError:Oe},Ge=Je.Core,We=Je.Schema,Qe=Je.Instance,Ye=Je.Reference,Xe=Je.Keywords,er=Je.InvalidSchemaError;export{Ge as Core,Qe as Instance,er as InvalidSchemaError,Xe as Keywords,Ye as Reference,We as Schema,Je as default};
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},F=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},_=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var F=!0,_=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(F=(U=q.next()).done);F=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){_=!0,k=e}finally{try{!F&&q.return&&q.return()}finally{if(_)throw k}}++o,++n}return r.join("")},k=function(e){return D(e,(function(e){return E.test(e)?F(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+_(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:F,encode:_,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var B=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(B);if(o){J?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(o=a)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default;const i={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var s={jsonTypeOf:(e,r)=>i[r](e),resolveUrl:(e,r)=>{const t=a.resolve(e,r,{iri:!0});if(a.resolve(e,"",{iri:!0})&&"file"===a.parse(t).scheme&&"file"!==a.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>a.unescapeComponent(a.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const c=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(v)},u=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:u(e,m(r,o,n),t,d(o,n))}}if(Array.isArray(r)){const n=[...r];return n[y(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:m(r,e[0],n)},l=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||g(r)){const o=e.shift();l(e,m(r,o,n),t,d(o,n))}else{r[y(r,e[0])]=t}},p=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=m(r,n,t);return{...r,[n]:p(e,o,d(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return m(r,e[0],t)}},f=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=m(r,n,t);f(e,o,d(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:m(r,e[0],t)},d=e(((e,r)=>r+"/"+h(e))),h=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),v=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),y=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,m=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(g(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[y(e,r)]},g=e=>null===e||"object"!=typeof e;var b={nil:"",append:d,get:(e,r)=>{const t=c(e),n=e=>t.reduce((([e,r],t)=>[m(e,t,r),d(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(r,t,n)=>{const o=c(r),a=e(((e,r)=>u(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(r,t,n)=>{const o=c(r),a=e(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=c(e),n=e=>p(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=c(e),n=e=>f(t,e,"");return void 0===r?n:n(r)}};b.nil,b.append,b.get,b.set,b.assign,b.unset,b.remove;const w=Symbol("$__value"),E=Symbol("$__href");var S={cons:(e,r)=>Object.freeze({[E]:e,[w]:r}),isReference:e=>e&&void 0!==e[E],href:e=>e[E],value:e=>e[w]};const{resolveUrl:C,jsonTypeOf:O}=s,A=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),I=e=>S.isReference(e.value)?S.value(e.value):e.value,j=e(((e,r)=>O(I(e),r))),T=(e,r)=>Object.freeze({...r,pointer:b.append(e,r.pointer),value:I(r)[e]}),x=e(((e,r)=>I(r).map(((t,n,o,a)=>e(T(n,r),n,o,a))))),D=e(((e,r)=>I(r).map(((e,t,n,o)=>T(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=e(((e,r,t)=>I(t).reduce(((r,n,o)=>e(r,T(o,t),o)),r))),P=e(((e,r)=>I(r).every(((t,n,o,a)=>e(T(n,r),n,o,a))))),R=e(((e,r)=>I(r).some(((t,n,o,a)=>e(T(n,r),n,o,a)))));var N={nil:A,cons:(e,r="")=>Object.freeze({...A,id:C(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:I,has:(e,r)=>e in I(r),typeOf:j,step:T,entries:e=>Object.keys(I(e)).map((r=>[r,T(r,e)])),keys:e=>Object.keys(I(e)),map:x,filter:D,reduce:$,every:P,some:R,length:e=>I(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,_=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,k=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,U=/\\([\u000b\u0020-\u00ff])/g,q=/([\\"])/g,L=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,z=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!L.test(n))throw new TypeError("invalid media type");var o=new V(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(U,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function H(e){var r=String(e);if(k.test(r))return r;if(r.length>0&&!_.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$1")+'"'}function V(e){this.parameters=Object.create(null),this.type=e}var K={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!L.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!k.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},M=async e=>Object.entries(await e),Z=e((async(e,r)=>(await r).map(e))),B=e((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),J=e((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),G=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).some((e=>e))})),W=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).every((e=>e))})),Q=e(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),Y={entries:M,map:Z,filter:J,reduce:B,some:G,every:W,pipeline:Q,all:e=>Promise.all(e),allValues:e=>Q([M,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};Y.entries,Y.map,Y.filter,Y.reduce,Y.some,Y.every,Y.pipeline,Y.all,Y.allValues;var X=fetch;const{jsonTypeOf:ee,resolveUrl:re,urlFragment:te,pathRelative:ne}=s,oe={},ae={},ie=(e,r)=>{const t=ae[e]||e;if(t in oe)return oe[t][r]},se={},ce={},ue=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=re(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema dialect");let o;delete e.$schema,o=!0===e.$vocabulary?.["https://json-schema.org/draft/2019-09/vocab/core"]?"https://json-schema.org/draft/2019-09/vocab/core":!0===e.$vocabulary?.["https://json-schema.org/draft/2020-12/vocab/core"]?"https://json-schema.org/draft/2020-12/vocab/core":ae[n]||n;const a=ie(o,"baseToken"),i=ie(o,"anchorToken"),s=re(r,"");if(!s&&!re(e[a]||"",""))throw Error("Couldn't determine an identifier for the schema");const c=re(s,e[a]||""),u=re(c,""),l=te(c);delete e[a],l&&a===i&&(e[i]=i!==a?encodeURI(l):`#${encodeURI(l)}`),s&&(ce[s]=u),ae[u]=o;const p={},f=ie(n,"recursiveAnchorToken");let d;!0===e[f]&&(p[""]=`${u}#`,e[i]="",delete e[f]);const h=ie(n,"vocabularyToken");ee(e[h],"object")?(d=e[h],delete e[h]):d={[ae[n]]:!0};const v={"":""};return se[u]={id:u,dialectId:n,schema:le(e,u,n,b.nil,v,p),anchors:v,dynamicAnchors:p,vocabulary:d,validated:!1},u},le=(e,r,t,n,o,a)=>{if(ee(e,"object")){const i="string"==typeof e.$schema?re(e.$schema,""):t,s=ie(i,"embeddedToken"),c=ie(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=re(r,e[s]);return e[ie(i,"baseToken")]=n,ue(e,n,t),S.cons(e[s],e)}const u=ie(t,"anchorToken"),l=ie(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ie(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=ie(t,"jrefToken");if("string"==typeof e[f])return S.cons(e[f],e);for(const i in e)e[i]=le(e[i],r,t,b.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>le(e,r,t,b.append(i,n),o,a))):e},pe=e=>se[ce[e]]||se[e],fe=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:b.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),de=async(e,r=fe)=>{const t=re(ye(r),e),n=re(t,""),o=te(t);if(!(e=>e in se||e in ce)(n)){const e=await X(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=K.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}ue(await e.json(),n)}const a=pe(n),i="/"!==o[0]?ve(a,o):o,s=Object.freeze({...a,pointer:i,value:b.get(i,a.schema)});return he(s)},he=e=>S.isReference(e.value)?de(S.href(e.value),e):e,ve=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},ye=e=>`${e.id}#${encodeURI(e.pointer)}`,me=e=>S.isReference(e.value)?S.value(e.value):e.value,ge=(e,r)=>{const t=pe(r.id),n=Object.freeze({...r,pointer:b.append(e,r.pointer),value:me(r)[e],validated:t.validated});return he(n)},be=e(((e,r)=>Y.pipeline([me,Y.map((async(t,n)=>e(await ge(n,r),n))),Y.all],r))),we={parentId:"",parentDialect:"",includeEmbedded:!0},Ee=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ne(t,r.slice(7))}return r};var Se={setConfig:(e,r,t)=>{oe[e]||(oe[e]={}),oe[e][r]=t},getConfig:ie,add:ue,get:de,markValidated:e=>{se[e].validated=!0},uri:ye,value:me,getAnchorPointer:ve,typeOf:(e,r)=>ee(me(e),r),has:(e,r)=>e in me(r),step:ge,keys:e=>Object.keys(me(e)),entries:e=>Y.pipeline([me,Object.keys,Y.map((async r=>[r,await ge(r,e)])),Y.all],e),map:be,length:e=>me(e).length,toSchema:(e,r={})=>{const t={...we,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!S.isReference(n))return n;const o=S.value(n),a="string"==typeof o.$schema?re(o.$schema,""):e.dialectId,i=ie(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:S.value(n)}))),o=ie(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=te(r);b.assign(t,n,{[o]:e,...b.get(t,n)})}));const a=ie(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{b.assign(r,n,{[a]:e,...b.get(r,n)})}));const i=ie(e.dialectId,"baseToken"),s=Ee(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Se.setConfig,Se.getConfig,Se.add,Se.get,Se.markValidated,Se.uri,Se.value,Se.getAnchorPointer,Se.typeOf,Se.has,Se.step,Se.keys,Se.entries,Se.map,Se.length,Se.toSchema;class Ce extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Oe=Ce;const{resolveUrl:Ae}=s,Ie="FLAG",je="BASIC",Te="DETAILED",xe="VERBOSE";let De=Te,$e=!0;const Pe=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Le(e,r)}},Re=e((({ast:e,schemaUri:r},t,o=Ie)=>{if(![Ie,je,Te,xe].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",Ne(o,a));return He(r,t,e,{}),n.unsubscribe(i),a[0]})),Ne=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===je&&(o.push(...r.errors),delete r.errors),(e===xe||e!==Ie&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},_e=e=>Fe[e],ke=e=>e in Fe,Ue={},qe={},Le=async(e,r)=>{if(e=await ze(e),!ke(`${e.dialectId}#validate`)){const r=await Se.get(e.dialectId);(Se.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in Ue)Object.entries(Ue[e]).forEach((([e,t])=>{((e,r)=>{Fe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if($e&&!e.validated){if(Se.markValidated(e.id),!(e.dialectId in qe)){const r=await Se.get(e.dialectId),t=await Pe(r);qe[r.id]=Re(t)}const r=N.cons(e.schema,e.id),t=qe[e.dialectId](r,De);if(!t.valid)throw new Oe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),_e(`${e.dialectId}#validate`).compile(e,r)},ze=async e=>Se.typeOf(e,"string")?ze(await Se.get(Se.value(e),e)):e,He=(e,r,t,n)=>{const o=Ve(e,t),a=Ae(e,"");return _e(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ve=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Ke={validate:async(e,r,t)=>{const n=await Pe(e),o=(e,r)=>Re(n,N.cons(e),r);return void 0===r?o:o(r,t)},compile:Pe,interpret:Re,setMetaOutputFormat:e=>{De=e},setShouldMetaValidate:e=>{$e=e},FLAG:Ie,BASIC:je,DETAILED:Te,VERBOSE:xe,add:(e,r="",t="")=>{const n=Se.add(e,r,t);delete qe[n]},getKeyword:_e,hasKeyword:ke,defineVocabulary:(e,r)=>{Ue[e]=r},compileSchema:Le,interpretSchema:He,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ve(e,t);return _e(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ve(e,t);return _e(a).collectEvaluatedItems(e,r,t,n,o)}};var Me={compile:e=>Se.value(e),interpret:()=>!0};var Ze={compile:async(e,r)=>{const t=Se.uri(e);if(!(t in r)){r[t]=!1;const n=Se.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Se.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Se.uri(e),"boolean"==typeof n?n:await Y.pipeline([Se.entries,Y.map((([r,t])=>[`${e.dialectId}#${r}`,t])),Y.filter((([r])=>Ke.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),Y.map((async([t,n])=>{const o=await Ke.getKeyword(t).compile(n,r,e);return[t,Se.uri(n),o]})),Y.all],e)]}return t},interpret:(e,r,t,o)=>{const[a,i,s]=t[e];n.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{n.publishSync("result.start");const s=Ke.getKeyword(e).interpret(i,r,t,o);return n.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:N.uri(r),valid:s,ast:i}),n.publishSync("result.end"),s}));return n.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:N.uri(r),valid:c,ast:e}),n.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Ke.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Ke.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Me,validate:Ze},Je={Core:Ke,Schema:Se,Instance:N,Reference:S,Keywords:Be,InvalidSchemaError:Oe},Ge=Je.Core,We=Je.Schema,Qe=Je.Instance,Ye=Je.Reference,Xe=Je.Keywords,er=Je.InvalidSchemaError;export{Ge as Core,Qe as Instance,er as InvalidSchemaError,Xe as Keywords,Ye as Reference,We as Schema,Je as default};
//# sourceMappingURL=json-schema-core-esm.min.js.map
var JSC=function(e){"use strict";var r=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,r){return e(r={exports:{}},r.exports),r.exports}var o=n((function(e,r){var n,o;n="object"==typeof window&&window||t,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(r=e.exports=o),r.PubSub=o,e.exports=r=o}));o.PubSub;var a,i=n((function(e,r){
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,h=36,d=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=h-d,j=Math.floor,T=String.fromCharCode;function I(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function P(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&I("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&I("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&I("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&I("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&I("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=P(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(T(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&I("overflow"),o+=(E-n)*$,n=E;var _=!0,F=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(_=(U=k.next()).done);_=!0){var q=U.value;if(q<n&&++o>f&&I("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(T(R(H+K%M,0))),L=j(K/M)}r.push(T(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){F=!0,V=e}finally{try{!_&&k.return&&k.return()}finally{if(F)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:V},q={};function L(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function z(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function H(e,r){function t(e){var t=z(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=q[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function je(e){var r=z(e);return r.match(Ee)?r:e}var Te={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Ie=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Ie),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Te.scheme]=Te,q[xe.scheme]=xe,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,d(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,d(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,d(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},h=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);h(e,o,d(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},d=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:d,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),d(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>h(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,j=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>C.isReference(e.value)?C.value(e.value):e.value,I=r(((e,r)=>A(T(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:T(r)[e]}),D=r(((e,r)=>T(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),P=r(((e,r)=>T(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=r(((e,r,t)=>T(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>T(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>T(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:j,cons:(e,r="")=>Object.freeze({...j,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,r)=>e in T(r),typeOf:I,step:x,entries:e=>Object.keys(T(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(T(e)),map:D,filter:P,reduce:$,every:R,some:N,length:e=>T(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,V=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,k=/\\([\u000b\u0020-\u00ff])/g,q=/([\\"])/g,L=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,z=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!L.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(k,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function H(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!V.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!L.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},Z=async e=>Object.entries(await e),J=r((async(e,r)=>(await r).map(e))),B=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:J,filter:G,reduce:B,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae={},ie={},se=(e,r)=>{const t=e in ie?ie[e]:e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=se(n,"baseToken"),a=se(n,"anchorToken"),i=te(r,"");if(!i&&!te(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=te(i,e[o]||""),c=te(s,""),u=ne(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ue[i]=c);const l={},p=se(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=se(n,"vocabularyToken");re(e[h],"object")?(ie[c]=n,f=e[h],delete e[h]):(ie[c]=n,f={[n]:!0});const d={"":""};return ce[c]={id:c,schemaVersion:n,schema:pe(e,c,n,w.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[s]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],he=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),de=async(e,r=he)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?de(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:de,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a=o.$schema||e.schemaVersion,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.schemaVersion,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:je}=c,Te="FLAG",Ie="BASIC",xe="DETAILED",De="VERBOSE";let Pe=xe,$e=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Le(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=Te)=>{if(![Te,Ie,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",_e(n,a));return He(r,t,e,{}),o.unsubscribe(i),a[0]})),_e=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Ie&&(o.push(...r.errors),delete r.errors),(e===De||e!==Te&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},Ve=e=>Fe[e],Ue=e=>e in Fe,ke={},qe={},Le=async(e,r)=>{if(e=await ze(e),!Ue(`${e.schemaVersion}#validate`)){const r=await Ce.get(e.schemaVersion);(Ce.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in ke)Object.entries(ke[e]).forEach((([e,t])=>{((e,r)=>{Fe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if($e&&!e.validated){if(Ce.markValidated(e.id),!(e.schemaVersion in qe)){const r=await Ce.get(e.schemaVersion),t=await Re(r);qe[r.id]=Ne(t)}const r=_.cons(e.schema,e.id),t=qe[e.schemaVersion](r,Pe);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Ve(`${e.schemaVersion}#validate`).compile(e,r)},ze=async e=>Ce.typeOf(e,"string")?ze(await Ce.get(Ce.value(e),e)):e,He=(e,r,t,n)=>{const o=Ke(e,t),a=je(e,"");return Ve(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{Pe=e},setShouldMetaValidate:e=>{$e=e},FLAG:Te,BASIC:Ie,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete qe[n]},getKeyword:Ve,hasKeyword:Ue,defineVocabulary:(e,r)=>{ke[e]=r},compileSchema:Le,interpretSchema:He,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Je={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Me.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Me.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Ze,validate:Je},Ge={Core:Me,Schema:Ce,Instance:_,Reference:C,Keywords:Be,InvalidSchemaError:Ae},We=Ge.Core,Qe=Ge.Schema,Ye=Ge.Instance,Xe=Ge.Reference,er=Ge.Keywords,rr=Ge.InvalidSchemaError;return e.Core=We,e.Instance=Ye,e.InvalidSchemaError=rr,e.Keywords=er,e.Reference=Xe,e.Schema=Qe,e.default=Ge,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>C.isReference(e.value)?C.value(e.value):e.value,T=r(((e,r)=>A(j(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:j(r)[e]}),D=r(((e,r)=>j(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),$=r(((e,r)=>j(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=r(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>j(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>j(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:x,entries:e=>Object.keys(j(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(j(e)),map:D,filter:$,reduce:P,every:R,some:N,length:e=>j(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,k=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,q=/\\([\u000b\u0020-\u00ff])/g,L=/([\\"])/g,z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,H=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!z.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(q,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function V(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!k.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(L,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!z.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+V(r[o])}return n},parse:H},Z=async e=>Object.entries(await e),J=r((async(e,r)=>(await r).map(e))),B=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:J,filter:G,reduce:B,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae={},ie={},se=(e,r)=>{const t=ie[e]||e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema dialect");let o;delete e.$schema,o=!0===e.$vocabulary?.["https://json-schema.org/draft/2019-09/vocab/core"]?"https://json-schema.org/draft/2019-09/vocab/core":!0===e.$vocabulary?.["https://json-schema.org/draft/2020-12/vocab/core"]?"https://json-schema.org/draft/2020-12/vocab/core":ie[n]||n;const a=se(o,"baseToken"),i=se(o,"anchorToken"),s=te(r,"");if(!s&&!te(e[a]||"",""))throw Error("Couldn't determine an identifier for the schema");const c=te(s,e[a]||""),u=te(c,""),l=ne(c);delete e[a],l&&a===i&&(e[i]=i!==a?encodeURI(l):`#${encodeURI(l)}`),s&&(ue[s]=u),ie[u]=o;const p={},f=se(n,"recursiveAnchorToken");let d;!0===e[f]&&(p[""]=`${u}#`,e[i]="",delete e[f]);const h=se(n,"vocabularyToken");re(e[h],"object")?(d=e[h],delete e[h]):d={[ie[n]]:!0};const v={"":""};return ce[u]={id:u,dialectId:n,schema:pe(e,u,n,w.nil,v,p),anchors:v,dynamicAnchors:p,vocabulary:d,validated:!1},u},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[se(i,"baseToken")]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],de=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),he=async(e,r=de)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?he(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:he,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?te(o.$schema,""):e.dialectId,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.dialectId,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:Ie}=c,je="FLAG",Te="BASIC",xe="DETAILED",De="VERBOSE";let $e=xe,Pe=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await ze(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=je)=>{if(![je,Te,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",_e(n,a));return Ve(r,t,e,{}),o.unsubscribe(i),a[0]})),_e=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Te&&(o.push(...r.errors),delete r.errors),(e===De||e!==je&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},ke=e=>Fe[e],Ue=e=>e in Fe,qe={},Le={},ze=async(e,r)=>{if(e=await He(e),!Ue(`${e.dialectId}#validate`)){const r=await Ce.get(e.dialectId);(Ce.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in qe)Object.entries(qe[e]).forEach((([e,t])=>{((e,r)=>{Fe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(Pe&&!e.validated){if(Ce.markValidated(e.id),!(e.dialectId in Le)){const r=await Ce.get(e.dialectId),t=await Re(r);Le[r.id]=Ne(t)}const r=_.cons(e.schema,e.id),t=Le[e.dialectId](r,$e);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),ke(`${e.dialectId}#validate`).compile(e,r)},He=async e=>Ce.typeOf(e,"string")?He(await Ce.get(Ce.value(e),e)):e,Ve=(e,r,t,n)=>{const o=Ke(e,t),a=Ie(e,"");return ke(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{$e=e},setShouldMetaValidate:e=>{Pe=e},FLAG:je,BASIC:Te,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete Le[n]},getKeyword:ke,hasKeyword:Ue,defineVocabulary:(e,r)=>{qe[e]=r},compileSchema:ze,interpretSchema:Ve,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return ke(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return ke(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Je={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.dialectId}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Me.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Me.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Ze,validate:Je},Ge={Core:Me,Schema:Ce,Instance:_,Reference:C,Keywords:Be,InvalidSchemaError:Ae},We=Ge.Core,Qe=Ge.Schema,Ye=Ge.Instance,Xe=Ge.Reference,er=Ge.Keywords,rr=Ge.InvalidSchemaError;return e.Core=We,e.Instance=Ye,e.InvalidSchemaError=rr,e.Keywords=er,e.Reference=Xe,e.Schema=Qe,e.default=Ge,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=json-schema-core-iife.min.js.map
System.register("JSC",[],(function(e){"use strict";return{execute:function(){var r=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,r){return e(r={exports:{}},r.exports),r.exports}var o=n((function(e,r){var n,o;n="object"==typeof window&&window||t,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(r=e.exports=o),r.PubSub=o,e.exports=r=o}));o.PubSub;var a,i=n((function(e,r){
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,h=36,d=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=h-d,j=Math.floor,T=String.fromCharCode;function I(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function P(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(n+(A+1)*e/(e+y))},F=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&I("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&I("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&I("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&I("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&I("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},_=function(e){var r=[],t=(e=P(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(T(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&I("overflow"),o+=(E-n)*$,n=E;var F=!0,_=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(F=(U=k.next()).done);F=!0){var q=U.value;if(q<n&&++o>f&&I("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(T(R(H+K%M,0))),L=j(K/M)}r.push(T(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){_=!0,V=e}finally{try{!F&&k.return&&k.return()}finally{if(_)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?F(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+_(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:F,encode:_,toASCII:U,toUnicode:V},q={};function L(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function z(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function H(e,r){function t(e){var t=z(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=q[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function je(e){var r=z(e);return r.match(Ee)?r:e}var Te={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Ie=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Ie),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Te.scheme]=Te,q[xe.scheme]=xe,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,d(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,d(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,d(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},h=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);h(e,o,d(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},d=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:d,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),d(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>h(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,j=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>C.isReference(e.value)?C.value(e.value):e.value,I=r(((e,r)=>A(T(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:T(r)[e]}),D=r(((e,r)=>T(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),P=r(((e,r)=>T(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=r(((e,r,t)=>T(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>T(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>T(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var F={nil:j,cons:(e,r="")=>Object.freeze({...j,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,r)=>e in T(r),typeOf:I,step:x,entries:e=>Object.keys(T(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(T(e)),map:D,filter:P,reduce:$,every:R,some:N,length:e=>T(e).length},_=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,V=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,k=/\\([\u000b\u0020-\u00ff])/g,q=/([\\"])/g,L=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,z=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!L.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(_.lastIndex=t;i=_.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(k,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function H(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!V.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!L.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},Z=async e=>Object.entries(await e),J=r((async(e,r)=>(await r).map(e))),B=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:J,filter:G,reduce:B,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae={},ie={},se=(e,r)=>{const t=e in ie?ie[e]:e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=se(n,"baseToken"),a=se(n,"anchorToken"),i=te(r,"");if(!i&&!te(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=te(i,e[o]||""),c=te(s,""),u=ne(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ue[i]=c);const l={},p=se(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=se(n,"vocabularyToken");re(e[h],"object")?(ie[c]=n,f=e[h],delete e[h]):(ie[c]=n,f={[n]:!0});const d={"":""};return ce[c]={id:c,schemaVersion:n,schema:pe(e,c,n,w.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[s]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],he=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),de=async(e,r=he)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?de(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:de,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a=o.$schema||e.schemaVersion,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.schemaVersion,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:je}=c,Te="FLAG",Ie="BASIC",xe="DETAILED",De="VERBOSE";let Pe=xe,$e=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Le(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=Te)=>{if(![Te,Ie,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Fe(n,a));return He(r,t,e,{}),o.unsubscribe(i),a[0]})),Fe=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Ie&&(o.push(...r.errors),delete r.errors),(e===De||e!==Te&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},_e={},Ve=e=>_e[e],Ue=e=>e in _e,ke={},qe={},Le=async(e,r)=>{if(e=await ze(e),!Ue(`${e.schemaVersion}#validate`)){const r=await Ce.get(e.schemaVersion);(Ce.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in ke)Object.entries(ke[e]).forEach((([e,t])=>{((e,r)=>{_e[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if($e&&!e.validated){if(Ce.markValidated(e.id),!(e.schemaVersion in qe)){const r=await Ce.get(e.schemaVersion),t=await Re(r);qe[r.id]=Ne(t)}const r=F.cons(e.schema,e.id),t=qe[e.schemaVersion](r,Pe);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Ve(`${e.schemaVersion}#validate`).compile(e,r)},ze=async e=>Ce.typeOf(e,"string")?ze(await Ce.get(Ce.value(e),e)):e,He=(e,r,t,n)=>{const o=Ke(e,t),a=je(e,"");return Ve(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,F.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{Pe=e},setShouldMetaValidate:e=>{$e=e},FLAG:Te,BASIC:Ie,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete qe[n]},getKeyword:Ve,hasKeyword:Ue,defineVocabulary:(e,r)=>{ke[e]=r},compileSchema:Le,interpretSchema:He,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Je={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Me.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:F.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:F.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Me.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Ze,validate:Je},Ge=e("default",{Core:Me,Schema:Ce,Instance:F,Reference:C,Keywords:Be,InvalidSchemaError:Ae});e("Core",Ge.Core),e("Schema",Ge.Schema),e("Instance",Ge.Instance),e("Reference",Ge.Reference),e("Keywords",Ge.Keywords),e("InvalidSchemaError",Ge.InvalidSchemaError)}}}));
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},F=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},_=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var F=!0,_=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(F=(U=q.next()).done);F=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){_=!0,k=e}finally{try{!F&&q.return&&q.return()}finally{if(_)throw k}}++o,++n}return r.join("")},k=function(e){return D(e,(function(e){return E.test(e)?F(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+_(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:F,encode:_,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>C.isReference(e.value)?C.value(e.value):e.value,T=r(((e,r)=>A(j(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:j(r)[e]}),D=r(((e,r)=>j(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),$=r(((e,r)=>j(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=r(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>j(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>j(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var F={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:x,entries:e=>Object.keys(j(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(j(e)),map:D,filter:$,reduce:P,every:R,some:N,length:e=>j(e).length},_=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,k=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,q=/\\([\u000b\u0020-\u00ff])/g,L=/([\\"])/g,z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,H=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!z.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(_.lastIndex=t;i=_.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(q,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function V(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!k.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(L,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!z.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+V(r[o])}return n},parse:H},Z=async e=>Object.entries(await e),J=r((async(e,r)=>(await r).map(e))),B=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:J,filter:G,reduce:B,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae={},ie={},se=(e,r)=>{const t=ie[e]||e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema dialect");let o;delete e.$schema,o=!0===e.$vocabulary?.["https://json-schema.org/draft/2019-09/vocab/core"]?"https://json-schema.org/draft/2019-09/vocab/core":!0===e.$vocabulary?.["https://json-schema.org/draft/2020-12/vocab/core"]?"https://json-schema.org/draft/2020-12/vocab/core":ie[n]||n;const a=se(o,"baseToken"),i=se(o,"anchorToken"),s=te(r,"");if(!s&&!te(e[a]||"",""))throw Error("Couldn't determine an identifier for the schema");const c=te(s,e[a]||""),u=te(c,""),l=ne(c);delete e[a],l&&a===i&&(e[i]=i!==a?encodeURI(l):`#${encodeURI(l)}`),s&&(ue[s]=u),ie[u]=o;const p={},f=se(n,"recursiveAnchorToken");let d;!0===e[f]&&(p[""]=`${u}#`,e[i]="",delete e[f]);const h=se(n,"vocabularyToken");re(e[h],"object")?(d=e[h],delete e[h]):d={[ie[n]]:!0};const v={"":""};return ce[u]={id:u,dialectId:n,schema:pe(e,u,n,w.nil,v,p),anchors:v,dynamicAnchors:p,vocabulary:d,validated:!1},u},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[se(i,"baseToken")]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],de=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),he=async(e,r=de)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?he(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:he,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?te(o.$schema,""):e.dialectId,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.dialectId,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:Ie}=c,je="FLAG",Te="BASIC",xe="DETAILED",De="VERBOSE";let $e=xe,Pe=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await ze(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=je)=>{if(![je,Te,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Fe(n,a));return Ve(r,t,e,{}),o.unsubscribe(i),a[0]})),Fe=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Te&&(o.push(...r.errors),delete r.errors),(e===De||e!==je&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},_e={},ke=e=>_e[e],Ue=e=>e in _e,qe={},Le={},ze=async(e,r)=>{if(e=await He(e),!Ue(`${e.dialectId}#validate`)){const r=await Ce.get(e.dialectId);(Ce.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in qe)Object.entries(qe[e]).forEach((([e,t])=>{((e,r)=>{_e[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(Pe&&!e.validated){if(Ce.markValidated(e.id),!(e.dialectId in Le)){const r=await Ce.get(e.dialectId),t=await Re(r);Le[r.id]=Ne(t)}const r=F.cons(e.schema,e.id),t=Le[e.dialectId](r,$e);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),ke(`${e.dialectId}#validate`).compile(e,r)},He=async e=>Ce.typeOf(e,"string")?He(await Ce.get(Ce.value(e),e)):e,Ve=(e,r,t,n)=>{const o=Ke(e,t),a=Ie(e,"");return ke(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,F.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{$e=e},setShouldMetaValidate:e=>{Pe=e},FLAG:je,BASIC:Te,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete Le[n]},getKeyword:ke,hasKeyword:Ue,defineVocabulary:(e,r)=>{qe[e]=r},compileSchema:ze,interpretSchema:Ve,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return ke(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return ke(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Je={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.dialectId}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Me.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:F.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:F.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Me.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Ze,validate:Je},Ge=e("default",{Core:Me,Schema:Ce,Instance:F,Reference:C,Keywords:Be,InvalidSchemaError:Ae});e("Core",Ge.Core),e("Schema",Ge.Schema),e("Instance",Ge.Instance),e("Reference",Ge.Reference),e("Keywords",Ge.Keywords),e("InvalidSchemaError",Ge.InvalidSchemaError)}}}));
//# sourceMappingURL=json-schema-core-system.min.js.map
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).JSC={})}(this,(function(e){"use strict";var r=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,r){return e(r={exports:{}},r.exports),r.exports}var o=n((function(e,r){var n,o;n="object"==typeof window&&window||t,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(r=e.exports=o),r.PubSub=o,e.exports=r=o}));o.PubSub;var a,i=n((function(e,r){
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,h=36,d=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=h-d,j=Math.floor,T=String.fromCharCode;function I(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function P(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&I("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&I("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&I("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&I("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&I("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=P(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(T(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&I("overflow"),o+=(E-n)*$,n=E;var _=!0,F=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(_=(U=k.next()).done);_=!0){var q=U.value;if(q<n&&++o>f&&I("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(T(R(H+K%M,0))),L=j(K/M)}r.push(T(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){F=!0,V=e}finally{try{!_&&k.return&&k.return()}finally{if(F)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:V},q={};function L(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function z(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function H(e,r){function t(e){var t=z(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=q[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function je(e){var r=z(e);return r.match(Ee)?r:e}var Te={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Ie=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Ie),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Te.scheme]=Te,q[xe.scheme]=xe,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,d(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,d(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,d(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},h=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);h(e,o,d(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},d=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:d,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),d(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>h(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,j=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>C.isReference(e.value)?C.value(e.value):e.value,I=r(((e,r)=>A(T(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:T(r)[e]}),D=r(((e,r)=>T(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),P=r(((e,r)=>T(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=r(((e,r,t)=>T(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>T(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>T(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:j,cons:(e,r="")=>Object.freeze({...j,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,r)=>e in T(r),typeOf:I,step:x,entries:e=>Object.keys(T(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(T(e)),map:D,filter:P,reduce:$,every:R,some:N,length:e=>T(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,V=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,k=/\\([\u000b\u0020-\u00ff])/g,q=/([\\"])/g,L=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,z=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!L.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(k,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function H(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!V.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!L.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},Z=async e=>Object.entries(await e),J=r((async(e,r)=>(await r).map(e))),B=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:J,filter:G,reduce:B,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae={},ie={},se=(e,r)=>{const t=e in ie?ie[e]:e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=se(n,"baseToken"),a=se(n,"anchorToken"),i=te(r,"");if(!i&&!te(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=te(i,e[o]||""),c=te(s,""),u=ne(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ue[i]=c);const l={},p=se(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=se(n,"vocabularyToken");re(e[h],"object")?(ie[c]=n,f=e[h],delete e[h]):(ie[c]=n,f={[n]:!0});const d={"":""};return ce[c]={id:c,schemaVersion:n,schema:pe(e,c,n,w.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[s]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],he=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),de=async(e,r=he)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?de(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:de,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a=o.$schema||e.schemaVersion,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.schemaVersion,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:je}=c,Te="FLAG",Ie="BASIC",xe="DETAILED",De="VERBOSE";let Pe=xe,$e=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Le(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=Te)=>{if(![Te,Ie,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",_e(n,a));return He(r,t,e,{}),o.unsubscribe(i),a[0]})),_e=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Ie&&(o.push(...r.errors),delete r.errors),(e===De||e!==Te&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},Ve=e=>Fe[e],Ue=e=>e in Fe,ke={},qe={},Le=async(e,r)=>{if(e=await ze(e),!Ue(`${e.schemaVersion}#validate`)){const r=await Ce.get(e.schemaVersion);(Ce.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in ke)Object.entries(ke[e]).forEach((([e,t])=>{((e,r)=>{Fe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if($e&&!e.validated){if(Ce.markValidated(e.id),!(e.schemaVersion in qe)){const r=await Ce.get(e.schemaVersion),t=await Re(r);qe[r.id]=Ne(t)}const r=_.cons(e.schema,e.id),t=qe[e.schemaVersion](r,Pe);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Ve(`${e.schemaVersion}#validate`).compile(e,r)},ze=async e=>Ce.typeOf(e,"string")?ze(await Ce.get(Ce.value(e),e)):e,He=(e,r,t,n)=>{const o=Ke(e,t),a=je(e,"");return Ve(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{Pe=e},setShouldMetaValidate:e=>{$e=e},FLAG:Te,BASIC:Ie,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete qe[n]},getKeyword:Ve,hasKeyword:Ue,defineVocabulary:(e,r)=>{ke[e]=r},compileSchema:Le,interpretSchema:He,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Je={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Me.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Me.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Ze,validate:Je},Ge={Core:Me,Schema:Ce,Instance:_,Reference:C,Keywords:Be,InvalidSchemaError:Ae},We=Ge.Core,Qe=Ge.Schema,Ye=Ge.Instance,Xe=Ge.Reference,er=Ge.Keywords,rr=Ge.InvalidSchemaError;e.Core=We,e.Instance=Ye,e.InvalidSchemaError=rr,e.Keywords=er,e.Reference=Xe,e.Schema=Qe,e.default=Ge,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>C.isReference(e.value)?C.value(e.value):e.value,T=r(((e,r)=>A(j(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:j(r)[e]}),D=r(((e,r)=>j(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),$=r(((e,r)=>j(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=r(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>j(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>j(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:x,entries:e=>Object.keys(j(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(j(e)),map:D,filter:$,reduce:P,every:R,some:N,length:e=>j(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,k=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,q=/\\([\u000b\u0020-\u00ff])/g,L=/([\\"])/g,z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,H=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!z.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(q,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function V(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!k.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(L,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!z.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+V(r[o])}return n},parse:H},Z=async e=>Object.entries(await e),J=r((async(e,r)=>(await r).map(e))),B=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:J,filter:G,reduce:B,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae={},ie={},se=(e,r)=>{const t=ie[e]||e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema dialect");let o;delete e.$schema,o=!0===e.$vocabulary?.["https://json-schema.org/draft/2019-09/vocab/core"]?"https://json-schema.org/draft/2019-09/vocab/core":!0===e.$vocabulary?.["https://json-schema.org/draft/2020-12/vocab/core"]?"https://json-schema.org/draft/2020-12/vocab/core":ie[n]||n;const a=se(o,"baseToken"),i=se(o,"anchorToken"),s=te(r,"");if(!s&&!te(e[a]||"",""))throw Error("Couldn't determine an identifier for the schema");const c=te(s,e[a]||""),u=te(c,""),l=ne(c);delete e[a],l&&a===i&&(e[i]=i!==a?encodeURI(l):`#${encodeURI(l)}`),s&&(ue[s]=u),ie[u]=o;const p={},f=se(n,"recursiveAnchorToken");let d;!0===e[f]&&(p[""]=`${u}#`,e[i]="",delete e[f]);const h=se(n,"vocabularyToken");re(e[h],"object")?(d=e[h],delete e[h]):d={[ie[n]]:!0};const v={"":""};return ce[u]={id:u,dialectId:n,schema:pe(e,u,n,w.nil,v,p),anchors:v,dynamicAnchors:p,vocabulary:d,validated:!1},u},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[se(i,"baseToken")]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],de=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),he=async(e,r=de)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?he(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:he,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?te(o.$schema,""):e.dialectId,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.dialectId,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:Ie}=c,je="FLAG",Te="BASIC",xe="DETAILED",De="VERBOSE";let $e=xe,Pe=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await ze(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=je)=>{if(![je,Te,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",_e(n,a));return Ve(r,t,e,{}),o.unsubscribe(i),a[0]})),_e=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Te&&(o.push(...r.errors),delete r.errors),(e===De||e!==je&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},ke=e=>Fe[e],Ue=e=>e in Fe,qe={},Le={},ze=async(e,r)=>{if(e=await He(e),!Ue(`${e.dialectId}#validate`)){const r=await Ce.get(e.dialectId);(Ce.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in qe)Object.entries(qe[e]).forEach((([e,t])=>{((e,r)=>{Fe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(Pe&&!e.validated){if(Ce.markValidated(e.id),!(e.dialectId in Le)){const r=await Ce.get(e.dialectId),t=await Re(r);Le[r.id]=Ne(t)}const r=_.cons(e.schema,e.id),t=Le[e.dialectId](r,$e);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),ke(`${e.dialectId}#validate`).compile(e,r)},He=async e=>Ce.typeOf(e,"string")?He(await Ce.get(Ce.value(e),e)):e,Ve=(e,r,t,n)=>{const o=Ke(e,t),a=Ie(e,"");return ke(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{$e=e},setShouldMetaValidate:e=>{Pe=e},FLAG:je,BASIC:Te,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete Le[n]},getKeyword:ke,hasKeyword:Ue,defineVocabulary:(e,r)=>{qe[e]=r},compileSchema:ze,interpretSchema:Ve,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return ke(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return ke(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Je={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.dialectId}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Me.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Me.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Ze,validate:Je},Ge={Core:Me,Schema:Ce,Instance:_,Reference:C,Keywords:Be,InvalidSchemaError:Ae},We=Ge.Core,Qe=Ge.Schema,Ye=Ge.Instance,Xe=Ge.Reference,er=Ge.Keywords,rr=Ge.InvalidSchemaError;e.Core=We,e.Instance=Ye,e.InvalidSchemaError=rr,e.Keywords=er,e.Reference=Xe,e.Schema=Qe,e.default=Ge,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=json-schema-core-umd.min.js.map

@@ -101,4 +101,4 @@ const curry = require("just-curry-it");

// Vocabularies
if (!hasKeyword(`${schema.schemaVersion}#validate`)) {
const metaSchema = await Schema.get(schema.schemaVersion);
if (!hasKeyword(`${schema.dialectId}#validate`)) {
const metaSchema = await Schema.get(schema.dialectId);

@@ -132,4 +132,4 @@ // Check for mandatory vocabularies

// Compile
if (!(schema.schemaVersion in metaValidators)) {
const metaSchema = await Schema.get(schema.schemaVersion);
if (!(schema.dialectId in metaValidators)) {
const metaSchema = await Schema.get(schema.dialectId);
const compiledSchema = await compile(metaSchema);

@@ -141,3 +141,3 @@ metaValidators[metaSchema.id] = interpret(compiledSchema);

const schemaInstance = Instance.cons(schema.schema, schema.id);
const metaResults = metaValidators[schema.schemaVersion](schemaInstance, metaOutputFormat);
const metaResults = metaValidators[schema.dialectId](schemaInstance, metaOutputFormat);
if (!metaResults.valid) {

@@ -156,3 +156,3 @@ throw new InvalidSchemaError(metaResults);

}
return getKeyword(`${schema.schemaVersion}#validate`).compile(schema, ast);
return getKeyword(`${schema.dialectId}#validate`).compile(schema, ast);
};

@@ -159,0 +159,0 @@

@@ -19,8 +19,8 @@ const Pact = require("@hyperjump/pact");

ast[url] = [
`${schema.schemaVersion}#validate`,
`${schema.dialectId}#validate`,
Schema.uri(schema),
typeof schemaValue === "boolean" ? schemaValue : await Pact.pipeline([
Schema.entries,
Pact.map(([keyword, keywordSchema]) => [`${schema.schemaVersion}#${keyword}`, keywordSchema]),
Pact.filter(([keywordId]) => Core.hasKeyword(keywordId) && keywordId !== `${schema.schemaVersion}#validate`),
Pact.map(([keyword, keywordSchema]) => [`${schema.dialectId}#${keyword}`, keywordSchema]),
Pact.filter(([keywordId]) => Core.hasKeyword(keywordId) && keywordId !== `${schema.dialectId}#validate`),
Pact.map(async ([keywordId, keywordSchema]) => {

@@ -27,0 +27,0 @@ const keywordAst = await Core.getKeyword(keywordId).compile(keywordSchema, ast, schema);

@@ -5,4 +5,4 @@ import type { JsonType } from "./common";

export type Schema = {
setConfig: <A>(schemaVersion: Dialect, key: string, value: A) => void;
getConfig: <A>(schemaVersion: Dialect, key: string) => A;
setConfig: <A>(dialectId: Dialect, key: string, value: A) => void;
getConfig: <A>(dialectId: Dialect, key: string) => A;
add: <A extends SchemaObject | boolean>(schema: A, url?: string, defaultSchemaVersion?: Dialect) => string;

@@ -55,3 +55,3 @@ get: (uri: string, context?: SchemaDocument) => Promise<SchemaDocument>;

id: string;
schemaVersion: Dialect;
dialectId: Dialect;
pointer: string;

@@ -58,0 +58,0 @@ schema: SchemaObject;

@@ -12,15 +12,15 @@ const contentTypeParser = require("content-type");

const config = {};
const configAlias = {};
const dialectJsonSchemaVersion = {};
const setConfig = (schemaVersion, key, value) => {
if (!config[schemaVersion]) {
config[schemaVersion] = {};
const setConfig = (jsonSchemaVersion, key, value) => {
if (!config[jsonSchemaVersion]) {
config[jsonSchemaVersion] = {};
}
config[schemaVersion][key] = value;
config[jsonSchemaVersion][key] = value;
};
const getConfig = (schemaVersion, key) => {
const configVersion = schemaVersion in configAlias ? configAlias[schemaVersion] : schemaVersion;
if (configVersion in config) {
return config[configVersion][key];
const getConfig = (dialectId, key) => {
const jsonSchemaVersion = dialectJsonSchemaVersion[dialectId] || dialectId;
if (jsonSchemaVersion in config) {
return config[jsonSchemaVersion][key];
}

@@ -36,12 +36,21 @@ };

// Schema Version
const schemaVersion = resolveUrl(schema["$schema"] || defaultSchemaVersion, "");
if (!schemaVersion) {
throw Error("Couldn't determine schema version");
// Dialect / JSON Schema Version
const dialectId = resolveUrl(schema["$schema"] || defaultSchemaVersion, "");
if (!dialectId) {
throw Error("Couldn't determine schema dialect");
}
delete schema["$schema"];
let jsonSchemaVersion;
if (schema.$vocabulary?.["https://json-schema.org/draft/2019-09/vocab/core"] === true) {
jsonSchemaVersion = "https://json-schema.org/draft/2019-09/vocab/core";
} else if (schema.$vocabulary?.["https://json-schema.org/draft/2020-12/vocab/core"] === true) {
jsonSchemaVersion = "https://json-schema.org/draft/2020-12/vocab/core";
} else {
jsonSchemaVersion = dialectJsonSchemaVersion[dialectId] || dialectId;
}
// Identifier
const baseToken = getConfig(schemaVersion, "baseToken");
const anchorToken = getConfig(schemaVersion, "anchorToken");
const baseToken = getConfig(jsonSchemaVersion, "baseToken");
const anchorToken = getConfig(jsonSchemaVersion, "anchorToken");
const externalId = resolveUrl(url, "");

@@ -62,5 +71,8 @@ if (!externalId && !resolveUrl(schema[baseToken] || "", "")) {

// JSON Schema version
dialectJsonSchemaVersion[id] = jsonSchemaVersion;
// recursiveAnchor
const dynamicAnchors = {};
const recursiveAnchorToken = getConfig(schemaVersion, "recursiveAnchorToken");
const recursiveAnchorToken = getConfig(dialectId, "recursiveAnchorToken");
if (schema[recursiveAnchorToken] === true) {

@@ -74,10 +86,8 @@ dynamicAnchors[""] = `${id}#`;

let vocabulary;
const vocabularyToken = getConfig(schemaVersion, "vocabularyToken");
const vocabularyToken = getConfig(dialectId, "vocabularyToken");
if (jsonTypeOf(schema[vocabularyToken], "object")) {
configAlias[id] = schemaVersion;
vocabulary = schema[vocabularyToken];
delete schema[vocabularyToken];
} else {
configAlias[id] = schemaVersion;
vocabulary = { [schemaVersion]: true };
vocabulary = { [dialectJsonSchemaVersion[dialectId]]: true };
}

@@ -89,4 +99,4 @@

id: id,
schemaVersion: schemaVersion,
schema: processSchema(schema, id, schemaVersion, JsonPointer.nil, anchors, dynamicAnchors),
dialectId: dialectId,
schema: processSchema(schema, id, dialectId, JsonPointer.nil, anchors, dynamicAnchors),
anchors: anchors,

@@ -101,16 +111,17 @@ dynamicAnchors: dynamicAnchors,

const processSchema = (subject, id, schemaVersion, pointer, anchors, dynamicAnchors) => {
const processSchema = (subject, id, dialectId, pointer, anchors, dynamicAnchors) => {
if (jsonTypeOf(subject, "object")) {
const embeddedSchemaVersion = typeof subject["$schema"] === "string" ? resolveUrl(subject["$schema"], "") : schemaVersion;
const embeddedEmbeddedToken = getConfig(embeddedSchemaVersion, "embeddedToken");
const embeddedAnchorToken = getConfig(embeddedSchemaVersion, "anchorToken");
const embeddedSchemaDialectId = typeof subject.$schema === "string" ? resolveUrl(subject.$schema, "") : dialectId;
const embeddedEmbeddedToken = getConfig(embeddedSchemaDialectId, "embeddedToken");
const embeddedAnchorToken = getConfig(embeddedSchemaDialectId, "anchorToken");
if (typeof subject[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || subject[embeddedEmbeddedToken][0] !== "#")) {
const ref = resolveUrl(id, subject[embeddedEmbeddedToken]);
subject[embeddedEmbeddedToken] = ref;
add(subject, ref, schemaVersion);
const embeddedBaseToken = getConfig(embeddedSchemaDialectId, "baseToken");
subject[embeddedBaseToken] = ref;
add(subject, ref, dialectId);
return Reference.cons(subject[embeddedEmbeddedToken], subject);
}
const anchorToken = getConfig(schemaVersion, "anchorToken");
const dynamicAnchorToken = getConfig(schemaVersion, "dynamicAnchorToken");
const anchorToken = getConfig(dialectId, "anchorToken");
const dynamicAnchorToken = getConfig(dialectId, "dynamicAnchorToken");
if (typeof subject[dynamicAnchorToken] === "string") {

@@ -122,3 +133,3 @@ dynamicAnchors[subject[dynamicAnchorToken]] = `${id}#${encodeURI(pointer)}`;

const embeddedToken = getConfig(schemaVersion, "embeddedToken");
const embeddedToken = getConfig(dialectId, "embeddedToken");
if (typeof subject[anchorToken] === "string") {

@@ -130,3 +141,3 @@ const anchor = anchorToken !== embeddedToken ? subject[anchorToken] : subject[anchorToken].slice(1);

const jrefToken = getConfig(schemaVersion, "jrefToken");
const jrefToken = getConfig(dialectId, "jrefToken");
if (typeof subject[jrefToken] === "string") {

@@ -137,3 +148,3 @@ return Reference.cons(subject[jrefToken], subject);

for (const key in subject) {
subject[key] = processSchema(subject[key], id, schemaVersion, JsonPointer.append(key, pointer), anchors, dynamicAnchors);
subject[key] = processSchema(subject[key], id, dialectId, JsonPointer.append(key, pointer), anchors, dynamicAnchors);
}

@@ -143,3 +154,3 @@

} else if (Array.isArray(subject)) {
return subject.map((item, ndx) => processSchema(item, id, schemaVersion, JsonPointer.append(ndx, pointer), anchors, dynamicAnchors));
return subject.map((item, ndx) => processSchema(item, id, dialectId, JsonPointer.append(ndx, pointer), anchors, dynamicAnchors));
} else {

@@ -160,3 +171,3 @@ return subject;

id: "",
schemaVersion: undefined,
dialectId: undefined,
vocabulary: {},

@@ -262,3 +273,3 @@ pointer: JsonPointer.nil,

const refValue = Reference.value(value);
const embeddedDialect = refValue.$schema || schemaDoc.schemaVersion;
const embeddedDialect = typeof refValue.$schema === "string" ? resolveUrl(refValue.$schema, "") : schemaDoc.dialectId;
const embeddedToken = getConfig(embeddedDialect, "embeddedToken");

@@ -272,3 +283,3 @@ if (!fullOptions.includeEmbedded && embeddedToken in refValue) {

const dynamicAnchorToken = getConfig(schemaDoc.schemaVersion, "dynamicAnchorToken");
const dynamicAnchorToken = getConfig(schemaDoc.dialectId, "dynamicAnchorToken");
Object.entries(schemaDoc.dynamicAnchors)

@@ -283,3 +294,3 @@ .forEach(([anchor, uri]) => {

const anchorToken = getConfig(schemaDoc.schemaVersion, "anchorToken");
const anchorToken = getConfig(schemaDoc.dialectId, "anchorToken");
Object.entries(schemaDoc.anchors)

@@ -294,5 +305,5 @@ .filter(([anchor]) => anchor !== "")

const baseToken = getConfig(schemaDoc.schemaVersion, "baseToken");
const baseToken = getConfig(schemaDoc.dialectId, "baseToken");
const id = relativeUri(fullOptions.parentId, schemaDoc.id);
const dialect = fullOptions.parentDialect === schemaDoc.schemaVersion ? "" : schemaDoc.schemaVersion;
const dialect = fullOptions.parentDialect === schemaDoc.dialectId ? "" : schemaDoc.dialectId;
return {

@@ -299,0 +310,0 @@ ...(id && { [baseToken]: id }),

{
"name": "@hyperjump/json-schema-core",
"version": "0.24.0",
"version": "0.25.0",
"description": "A framework for building JSON Schema tools",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -49,3 +49,3 @@ # Hyperjump - JSON Schema Core

* **Schema.add**: (schema: object, url?: URI, schemaVersion?: string) => URI
* **Schema.add**: (schema: object, url?: URI, dialectId?: string) => URI

@@ -473,8 +473,8 @@ Load a schema. Returns the identifier for the schema. See the "$id" and

* **Schema.setConfig**: (schemaVersion: string, configName: string, configValue: string) => undefined
* **Schema.setConfig**: (jsonSchemaVersion: string, configName: string, configValue: string) => undefined
Set a configuration value for a schemaVersion.
* **Schema.getConfig**: (schemaVersion: string, configName: string) => any
Set a configuration value for a JSON Schema version.
* **Schema.getConfig**: (dialectId: string, configName: string) => any
Get a configuration value for a schemaVersion.
Get a configuration value for a dialect.

@@ -481,0 +481,0 @@ ### References

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc