@blackglory/match 0.3.0 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/es2015/index.min.mjs +1 -8
  3. package/dist/es2015/index.min.mjs.map +1 -1
  4. package/dist/es2015/index.mjs +1731 -7791
  5. package/dist/es2015/index.mjs.map +1 -1
  6. package/dist/es2015/index.umd.js +1733 -7793
  7. package/dist/es2015/index.umd.js.map +1 -1
  8. package/dist/es2015/index.umd.min.js +1 -8
  9. package/dist/es2015/index.umd.min.js.map +1 -1
  10. package/dist/es2018/index.min.mjs +1 -8
  11. package/dist/es2018/index.min.mjs.map +1 -1
  12. package/dist/es2018/index.mjs +1731 -7791
  13. package/dist/es2018/index.mjs.map +1 -1
  14. package/dist/es2018/index.umd.js +1733 -7793
  15. package/dist/es2018/index.umd.js.map +1 -1
  16. package/dist/es2018/index.umd.min.js +1 -8
  17. package/dist/es2018/index.umd.min.js.map +1 -1
  18. package/lib/es2015/match-element.js +2 -2
  19. package/lib/es2015/match-element.js.map +1 -1
  20. package/lib/es2015/match.js +2 -2
  21. package/lib/es2015/match.js.map +1 -1
  22. package/lib/es2015/matchers/child-nodes.js +2 -2
  23. package/lib/es2015/matchers/child-nodes.js.map +1 -1
  24. package/lib/es2015/matchers/children.js +2 -2
  25. package/lib/es2015/matchers/children.js.map +1 -1
  26. package/lib/es2015/matchers/css.js +2 -2
  27. package/lib/es2015/matchers/css.js.map +1 -1
  28. package/lib/es2015/matchers/element.js +5 -5
  29. package/lib/es2015/matchers/element.js.map +1 -1
  30. package/lib/es2015/matchers/multiple.js +5 -5
  31. package/lib/es2015/matchers/multiple.js.map +1 -1
  32. package/lib/es2015/matchers/node.js +4 -4
  33. package/lib/es2015/matchers/node.js.map +1 -1
  34. package/lib/es2015/matchers/optional.js +1 -1
  35. package/lib/es2015/matchers/optional.js.map +1 -1
  36. package/lib/es2015/matchers/repeat.js +2 -2
  37. package/lib/es2015/matchers/repeat.js.map +1 -1
  38. package/lib/es2015/matchers/text-content-equals.js +1 -1
  39. package/lib/es2015/matchers/text-content-equals.js.map +1 -1
  40. package/lib/es2015/matchers/text-content-includes.js +1 -1
  41. package/lib/es2015/matchers/text-content-includes.js.map +1 -1
  42. package/lib/es2015/matchers/text-content-matches.js +1 -1
  43. package/lib/es2015/matchers/text-content-matches.js.map +1 -1
  44. package/lib/es2015/matchers/text-node.js +5 -5
  45. package/lib/es2015/matchers/text-node.js.map +1 -1
  46. package/lib/es2015/matchers/xpath.js +3 -3
  47. package/lib/es2015/matchers/xpath.js.map +1 -1
  48. package/lib/es2015/utils/match-multiple.js +1 -1
  49. package/lib/es2015/utils/match-multiple.js.map +1 -1
  50. package/lib/es2015/utils/match-one-by-one.js +3 -3
  51. package/lib/es2015/utils/match-one-by-one.js.map +1 -1
  52. package/lib/es2015/utils/merge.js +4 -3
  53. package/lib/es2015/utils/merge.js.map +1 -1
  54. package/lib/es2018/match-element.js +2 -2
  55. package/lib/es2018/match-element.js.map +1 -1
  56. package/lib/es2018/match.js +2 -2
  57. package/lib/es2018/match.js.map +1 -1
  58. package/lib/es2018/matchers/child-nodes.js +2 -2
  59. package/lib/es2018/matchers/child-nodes.js.map +1 -1
  60. package/lib/es2018/matchers/children.js +2 -2
  61. package/lib/es2018/matchers/children.js.map +1 -1
  62. package/lib/es2018/matchers/css.js +2 -2
  63. package/lib/es2018/matchers/css.js.map +1 -1
  64. package/lib/es2018/matchers/element.js +5 -5
  65. package/lib/es2018/matchers/element.js.map +1 -1
  66. package/lib/es2018/matchers/multiple.js +5 -5
  67. package/lib/es2018/matchers/multiple.js.map +1 -1
  68. package/lib/es2018/matchers/node.js +4 -4
  69. package/lib/es2018/matchers/node.js.map +1 -1
  70. package/lib/es2018/matchers/optional.js +1 -1
  71. package/lib/es2018/matchers/optional.js.map +1 -1
  72. package/lib/es2018/matchers/repeat.js +2 -2
  73. package/lib/es2018/matchers/repeat.js.map +1 -1
  74. package/lib/es2018/matchers/text-content-equals.js +1 -1
  75. package/lib/es2018/matchers/text-content-equals.js.map +1 -1
  76. package/lib/es2018/matchers/text-content-includes.js +1 -1
  77. package/lib/es2018/matchers/text-content-includes.js.map +1 -1
  78. package/lib/es2018/matchers/text-content-matches.js +1 -1
  79. package/lib/es2018/matchers/text-content-matches.js.map +1 -1
  80. package/lib/es2018/matchers/text-node.js +5 -5
  81. package/lib/es2018/matchers/text-node.js.map +1 -1
  82. package/lib/es2018/matchers/xpath.js +3 -3
  83. package/lib/es2018/matchers/xpath.js.map +1 -1
  84. package/lib/es2018/utils/match-multiple.js +1 -1
  85. package/lib/es2018/utils/match-multiple.js.map +1 -1
  86. package/lib/es2018/utils/match-one-by-one.js +3 -3
  87. package/lib/es2018/utils/match-one-by-one.js.map +1 -1
  88. package/lib/es2018/utils/merge.js +4 -3
  89. package/lib/es2018/utils/merge.js.map +1 -1
  90. package/package.json +24 -25
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.3.4](https://github.com/BlackGlory/match/compare/v0.3.3...v0.3.4) (2021-12-12)
6
+
7
+ ### [0.3.3](https://github.com/BlackGlory/match/compare/v0.3.2...v0.3.3) (2021-10-14)
8
+
9
+ ### [0.3.2](https://github.com/BlackGlory/match/compare/v0.3.1...v0.3.2) (2021-07-13)
10
+
11
+ ### [0.3.1](https://github.com/BlackGlory/match/compare/v0.3.0...v0.3.1) (2021-07-03)
12
+
5
13
  ## [0.3.0](https://github.com/BlackGlory/match/compare/v0.2.4...v0.3.0) (2021-05-16)
6
14
 
7
15
 
@@ -1,9 +1,2 @@
1
- var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t={},r={},n={};function o(e){return e.cloneNode(!0)}n.copyNodesToChildNodes=n.cloneNodes=n.clone=void 0,n.clone=o,n.cloneNodes=function(e){return e.map((e=>o(e)))},n.copyNodesToChildNodes=function(e,t){e.forEach((e=>t.appendChild(e)))};var a={};a.removeAllChildren=void 0,a.removeAllChildren=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},r.flatMap=void 0;const s=n,i=a;r.flatMap=function e(t,r){return s.cloneNodes(r(s.clone(t))).map((t=>{const n=[];for(const o of t.childNodes)n.push(...s.cloneNodes(e(o,r)));return i.removeAllChildren(t),s.copyNodesToChildNodes(n,t),t}))};var c={map:void 0};const u=n;c.map=function e(t,r){const n=u.clone(r(u.clone(t)));for(const t of n.childNodes)n.replaceChild(e(t,r),t);return n};var l={filter:void 0};const d=r;l.filter=function(e,t){const r=d.flatMap(e,(e=>t(e)?[e]:[]));if(1===r.length)return r[0]};var f,h,m={},p={},y={},v={},g={},$={};$.go=void 0,$.go=function(e){return e()},f=g,h=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),(e&&e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||h(t,e,r)})($,f);var b={},w={CustomError:void 0};class _ extends Error{get name(){return this.constructor.name}}w.CustomError=_;var E={ExpectedError:void 0};const N=w;class S extends N.CustomError{}E.ExpectedError=S;var T={AssertionError:void 0};const P=w;class O extends P.CustomError{}T.AssertionError=O;var A={};A.normalize=void 0,A.normalize=function(e){var t;return{name:e.name,message:e.message,stack:null!==(t=e.stack)&&void 0!==t?t:null}};var C={refute:void 0};const k=E;C.refute=function(e,t){if(e)throw new k.ExpectedError(t)};var D={assert:void 0};const I=T;D.assert=function(e,t){if(!e)throw new I.AssertionError(t)},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(w,t),n(E,t),n(T,t),n(A,t),n(C,t),n(D,t)}(b),v.chunkAsync=void 0;const R=g,x=b;v.chunkAsync=function(e,t){return x.assert(Number.isInteger(t),"The parameter size must be an integer"),x.assert(t>0,"The parameter size must be greater than 0"),R.go((async function*(){let r=[];for await(const n of e)r.push(n),r.length>=t&&(yield r,r=[]);r.length&&(yield r)}))};var j={},U={},M={},V={};function q(e){return null===e}V.isntNull=V.isNull=void 0,V.isNull=q,V.isntNull=function(e){return!q(e)};var F={};function z(e){return void 0===e}F.isntUndefined=F.isUndefined=void 0,F.isUndefined=z,F.isntUndefined=function(e){return!z(e)},M.isntAsyncIterable=M.isAsyncIterable=void 0;const L=V,K=F;function B(e){return L.isntNull(e)&&K.isntUndefined(e)&&"function"==typeof e[Symbol.asyncIterator]}M.isAsyncIterable=B,M.isntAsyncIterable=function(e){return!B(e)};var J={};function H(e){return"boolean"==typeof e}J.isntBoolean=J.isBoolean=void 0,J.isBoolean=H,J.isntBoolean=function(e){return!H(e)};var G={},Y={};function X(e){return W(e)||Q(e)}function W(e){return"string"==typeof e}function Q(e){return"object"==typeof e&&e instanceof String}Y.isntStringObject=Y.isStringObject=Y.isntStringPrimitive=Y.isStringPrimitive=Y.isntString=Y.isString=void 0,Y.isString=X,Y.isntString=function(e){return!X(e)},Y.isStringPrimitive=W,Y.isntStringPrimitive=function(e){return!W(e)},Y.isStringObject=Q,Y.isntStringObject=function(e){return!Q(e)},G.isntCharObject=G.isCharObject=G.isntCharPrimitive=G.isCharPrimitive=G.isntChar=G.isChar=void 0;const Z=Y;function ee(e){return(Z.isString(e)||Z.isStringObject(e))&&1===e.length}function te(e){return Z.isString(e)&&1===e.length}function re(e){return Z.isStringObject(e)&&1===e.length}G.isChar=ee,G.isntChar=function(e){return!ee(e)},G.isCharPrimitive=te,G.isntCharPrimitive=function(e){return!te(e)},G.isCharObject=re,G.isntCharObject=function(e){return!re(e)};var ne={};function oe(e){return e instanceof Date}ne.isntDate=ne.isDate=void 0,ne.isDate=oe,ne.isntDate=function(e){return!oe(e)};var ae={};function se(e){return!e}ae.isntFalsy=ae.isFalsy=void 0,ae.isFalsy=se,ae.isntFalsy=function(e){return!se(e)};var ie={};function ce(e){return"function"==typeof e}ie.isntFunction=ie.isFunction=void 0,ie.isFunction=ce,ie.isntFunction=function(e){return!ce(e)};var ue={};ue.isntIterable=ue.isIterable=void 0;const le=V,de=F;function fe(e){return le.isntNull(e)&&de.isntUndefined(e)&&"function"==typeof e[Symbol.iterator]}ue.isIterable=fe,ue.isntIterable=function(e){return!fe(e)};var he={},me={exports:{}},pe={},ye={},ve={},ge={},$e={},be={};!function(e){e.regexpCode=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e,...t){const r=[e[0]];let o=0;for(;o<t.length;)i(r,t[o]),r.push(e[++o]);return new n(r)}e._Code=n,e.nil=new n(""),e._=o;const a=new n("+");function s(e,...t){const r=[u(e[0])];let o=0;for(;o<t.length;)r.push(a),i(r,t[o]),r.push(a,u(e[++o]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const r=c(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new n(r)}function i(e,t){var o;t instanceof n?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(o=t)||"boolean"==typeof o||null===o?o:u(Array.isArray(o)?o.join(","):o))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=s,e.addCodeArg=i,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},e.stringify=function(e){return new n(u(e))},e.safeStringify=u,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new n(`.${t}`):o`[${t}]`},e.regexpCode=function(e){return new n(e.toString())}}(be);var we={};!function(e){e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=be;class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var n;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(n=e.UsedValueState||(e.UsedValueState={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}e.Scope=o;class a extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=t._`.${new t.Name(r)}[${n}]`}}e.ValueScopeName=a;const s=t._`\n`;e.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:o}=n,a=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[o];if(s){const e=s.get(a);if(e)return e}else s=this._values[o]=new Map;s.set(a,n);const i=this._scope[o]||(this._scope[o]=[]),c=i.length;return i[c]=t.ref,n.setValue(t,{property:o,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,(r=>{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(o,a,s={},i){let c=t.nil;for(const u in o){const l=o[u];if(!l)continue;const d=s[u]=s[u]||new Map;l.forEach((o=>{if(d.has(o))return;d.set(o,n.Started);let s=a(o);if(s){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${o} = ${s};${this.opts._n}`}else{if(!(s=null==i?void 0:i(o)))throw new r(o);c=t._`${c}${s}${this.opts._n}`}d.set(o,n.Completed)}))}return c}}}(we),function(e){e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=be,r=we;var n=be;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var o=we;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class s extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,o=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,e,r),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends i{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class l extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=A(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const o=r[n];o.optimizeNames(e,t)||(C(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>P(e,t.names)),{})}}class m extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class p extends h{}class y extends m{}y.kind="else";class v extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(k(e),t instanceof v?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=A(this.condition,e,t),this}get names(){const e=super.names;return O(e,this.condition),this.else&&P(e,this.else.names),e}}v.kind="if";class g extends m{}g.kind="for";class $ extends g{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=A(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class b extends g{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:o,to:a}=this;return`for(${t} ${n}=${o}; ${n}<${a}; ${n}++)`+super.render(e)}get names(){const e=O(super.names,this.from);return O(e,this.to)}}class w extends g{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=A(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class _ extends m{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}_.kind="func";class E extends h{render(e){return"return "+super.render(e)}}E.kind="return";class N extends m{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class S extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}S.kind="catch";class T extends m{render(e){return"finally"+super.render(e)}}T.kind="finally";function P(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function O(e,r){return r instanceof t._CodeOrName?P(e,r.names):e}function A(e,r,n){return e instanceof t.Name?a(e):(o=e)instanceof t._Code&&o._items.some((e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str]))?new t._Code(e._items.reduce(((e,r)=>(r instanceof t.Name&&(r=a(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e)),[])):e;var o;function a(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function C(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function k(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${x(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new p]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const o=this._scope.toName(t);return void 0!==r&&n&&(this._constants[o.str]=r),this._leafNode(new s(e,o,r)),o}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new i(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){const r=["{"];for(const[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),t.addCodeArg(r,o));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new v(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new v(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(v,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new $(e),t)}forRange(e,t,n,o,a=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const s=this._scope.toName(e);return this._for(new b(a,s,t,n),(()=>o(s)))}forOf(e,n,o,a=r.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,(r=>{this.var(s,t._`${e}[${r}]`),o(s)}))}return this._for(new w("of",a,s,n),(()=>o(s)))}forIn(e,n,o,a=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,o);const s=this._scope.toName(e);return this._for(new w("in",a,s,n),(()=>o(s)))}endFor(){return this._endBlockNode(g)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new l(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new N;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new S(e),t(e)}return r&&(this._currNode=n.finally=new T,this.code(r)),this._endBlockNode(S,T)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,o){return this._blockNode(new _(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof v))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=k;const D=R(e.operators.AND);e.and=function(...e){return e.reduce(D)};const I=R(e.operators.OR);function R(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${x(r)} ${e} ${x(n)}`}function x(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(I)}}($e);var _e={};!function(e){e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=$e,r=be;function n(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=n.RULES.keywords;for(const r in t)o[r]||f(e,`unknown keyword: "${r}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function s(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function i({mergeNames:e,mergeToName:r,mergeValues:n,resultToName:o}){return(a,s,i,c)=>{const u=void 0===i?s:i instanceof t.Name?(s instanceof t.Name?e(a,s,i):r(a,s,i),i):s instanceof t.Name?(r(a,i,s),s):n(s,i);return c!==t.Name||u instanceof t.Name?u:o(a,u)}}function c(e,r){if(!0===r)return e.var("props",!0);const n=e.var("props",t._`{}`);return void 0!==r&&u(e,n,r),n}function u(e,r,n){Object.keys(n).forEach((n=>e.assign(t._`${r}${t.getProperty(n)}`,!0)))}e.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!o(t,e.self.RULES.all))},e.checkUnknownRules=n,e.schemaHasRules=o,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:r},n,o,a){if(!a){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return t._`${n}`}return t._`${e}${r}${t.getProperty(o)}`},e.unescapeFragment=function(e){return s(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(a(e))},e.escapeJsonPointer=a,e.unescapeJsonPointer=s,e.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},e.mergeEvaluated={props:i({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>{e.if(t._`${r} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,t._`${n} || {}`).code(t._`Object.assign(${n}, ${r})`)))})),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>{!0===r?e.assign(n,!0):(e.assign(n,t._`${n} || {}`),u(e,n,r))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:i({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>e.assign(n,t._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`))),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>e.assign(n,!0===r||t._`${n} > ${r} ? ${n} : ${r}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=c,e.setEvaluated=u;const l={};var d;function f(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:l[t.code]||(l[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=e.Type||(e.Type={})),e.getErrorPath=function(e,r,n){if(e instanceof t.Name){const o=r===d.Num;return n?o?t._`"[" + ${e} + "]"`:t._`"['" + ${e} + "']"`:o?t._`"/" + ${e}`:t._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?t.getProperty(e).toString():"/"+a(e)},e.checkStrictMode=f}(_e);var Ee={};const Ne=$e,Se={data:new Ne.Name("data"),valCxt:new Ne.Name("valCxt"),instancePath:new Ne.Name("instancePath"),parentData:new Ne.Name("parentData"),parentDataProperty:new Ne.Name("parentDataProperty"),rootData:new Ne.Name("rootData"),dynamicAnchors:new Ne.Name("dynamicAnchors"),vErrors:new Ne.Name("vErrors"),errors:new Ne.Name("errors"),this:new Ne.Name("this"),self:new Ne.Name("self"),scope:new Ne.Name("scope"),json:new Ne.Name("json"),jsonPos:new Ne.Name("jsonPos"),jsonLen:new Ne.Name("jsonLen"),jsonPart:new Ne.Name("jsonPart")};Ee.default=Se,function(e){e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=$e,r=_e,n=Ee;function o(e,r){const o=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,(()=>e.assign(n.default.vErrors,t._`[${o}]`)),t._`${n.default.vErrors}.push(${o})`),e.code(t._`${n.default.errors}++`)}function a(e,r){const{gen:n,validateName:o,schemaEnv:a}=e;a.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${o}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`should pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,s,c){const{it:u}=r,{gen:l,compositeRule:d,allErrors:f}=u,h=i(r,n,s);(null!=c?c:d||f)?o(l,h):a(u,t._`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,s){const{it:c}=t,{gen:u,compositeRule:l,allErrors:d}=c;o(u,i(t,r,s)),l||d||a(c,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,(()=>e.if(r,(()=>e.assign(t._`${n.default.vErrors}.length`,r)),(()=>e.assign(n.default.vErrors,null)))))},e.extendErrors=function({gen:e,keyword:r,schemaValue:o,data:a,errsCount:s,it:i}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,n.default.errors,(s=>{e.const(c,t._`${n.default.vErrors}[${s}]`),e.if(t._`${c}.instancePath === undefined`,(()=>e.assign(t._`${c}.instancePath`,t.strConcat(n.default.instancePath,i.errorPath)))),e.assign(t._`${c}.schemaPath`,t.str`${i.errSchemaPath}/${r}`),i.opts.verbose&&(e.assign(t._`${c}.schema`,o),e.assign(t._`${c}.data`,a))}))};const s={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function i(e,r,o){const{createErrors:a}=e.it;return!1===a?t._`{}`:function(e,r,o={}){const{gen:a,it:i}=e,l=[c(i,o),u(e,o)];return function(e,{params:r,message:o},a){const{keyword:i,data:c,schemaValue:u,it:l}=e,{opts:d,propertyName:f,topSchemaRef:h,schemaPath:m}=l;a.push([s.keyword,i],[s.params,"function"==typeof r?r(e):r||t._`{}`]),d.messages&&a.push([s.message,"function"==typeof o?o(e):o]);d.verbose&&a.push([s.schema,u],[s.parentSchema,t._`${h}${m}`],[n.default.data,c]);f&&a.push([s.propertyName,f])}(e,r,l),a.object(...l)}(e,r,o)}function c({errorPath:e},{instancePath:o}){const a=o?t.str`${e}${r.getErrorPath(o,r.Type.Str)}`:e;return[n.default.instancePath,t.strConcat(n.default.instancePath,a)]}function u({keyword:e,it:{errSchemaPath:n}},{schemaPath:o,parentSchema:a}){let i=a?n:t.str`${n}/${e}`;return o&&(i=t.str`${i}${r.getErrorPath(o,r.Type.Str)}`),[s.schemaPath,i]}}(ge),ve.boolOrEmptySchema=ve.topBoolOrEmptySchema=void 0;const Te=ge,Pe=$e,Oe=Ee,Ae={message:"boolean schema is false"};function Ce(e,t){const{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};Te.reportError(o,Ae,void 0,t)}ve.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?Ce(e,!1):"object"==typeof r&&!0===r.$async?t.return(Oe.default.data):(t.assign(Pe._`${n}.errors`,null),t.return(!0))},ve.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),Ce(e)):r.var(t,!0)};var ke={},De={};De.getRules=De.isJSONType=void 0;const Ie=new Set(["string","number","integer","boolean","null","object","array"]);De.isJSONType=function(e){return"string"==typeof e&&Ie.has(e)},De.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}};var Re={};function xe(e,t){return t.rules.some((t=>je(e,t)))}function je(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Re.shouldUseRule=Re.shouldUseGroup=Re.schemaHasRulesForType=void 0,Re.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&xe(e,n)},Re.shouldUseGroup=xe,Re.shouldUseRule=je,function(e){e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=De,r=Re,n=ge,o=$e,a=_e;var s;function i(e){const r=Array.isArray(e)?e:e?[e]:[];if(r.every(t.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(s=e.DataType||(e.DataType={})),e.getSchemaTypes=function(e){const t=i(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=i,e.coerceAndCheckDataType=function(e,t){const{gen:n,data:a,opts:i}=e,u=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,i.coerceTypes),d=t.length>0&&!(0===u.length&&1===t.length&&r.schemaHasRulesForType(e,t[0]));if(d){const r=l(t,a,i.strictNumbers,s.Wrong);n.if(r,(()=>{u.length?function(e,t,r){const{gen:n,data:a,opts:s}=e,i=n.let("dataType",o._`typeof ${a}`),u=n.let("coerced",o._`undefined`);"array"===s.coerceTypes&&n.if(o._`${i} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,(()=>n.assign(a,o._`${a}[0]`).assign(i,o._`typeof ${a}`).if(l(t,a,s.strictNumbers),(()=>n.assign(u,a)))));n.if(o._`${u} !== undefined`);for(const e of r)(c.has(e)||"array"===e&&"array"===s.coerceTypes)&&d(e);function d(e){switch(e){case"string":return void n.elseIf(o._`${i} == "number" || ${i} == "boolean"`).assign(u,o._`"" + ${a}`).elseIf(o._`${a} === null`).assign(u,o._`""`);case"number":return void n.elseIf(o._`${i} == "boolean" || ${a} === null
2
- || (${i} == "string" && ${a} && ${a} == +${a})`).assign(u,o._`+${a}`);case"integer":return void n.elseIf(o._`${i} === "boolean" || ${a} === null
3
- || (${i} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(u,o._`+${a}`);case"boolean":return void n.elseIf(o._`${a} === "false" || ${a} === 0 || ${a} === null`).assign(u,!1).elseIf(o._`${a} === "true" || ${a} === 1`).assign(u,!0);case"null":return n.elseIf(o._`${a} === "" || ${a} === 0 || ${a} === false`),void n.assign(u,null);case"array":n.elseIf(o._`${i} === "string" || ${i} === "number"
4
- || ${i} === "boolean" || ${a} === null`).assign(u,o._`[${a}]`)}}n.else(),f(e),n.endIf(),n.if(o._`${u} !== undefined`,(()=>{n.assign(a,u),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(o._`${t} !== undefined`,(()=>e.assign(o._`${t}[${r}]`,n)))}(e,u)}))}(e,t,u):f(e)}))}return d};const c=new Set(["string","number","integer","boolean","null"]);function u(e,t,r,n=s.Correct){const a=n===s.Correct?o.operators.EQ:o.operators.NEQ;let i;switch(e){case"null":return o._`${t} ${a} null`;case"array":i=o._`Array.isArray(${t})`;break;case"object":i=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=c(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=c();break;default:return o._`typeof ${t} ${a} ${e}`}return n===s.Correct?i:o.not(i);function c(e=o.nil){return o.and(o._`typeof ${t} == "number"`,e,r?o._`isFinite(${t})`:o.nil)}}function l(e,t,r,n){if(1===e.length)return u(e[0],t,r,n);let s;const i=a.toHash(e);if(i.array&&i.object){const e=o._`typeof ${t} != "object"`;s=i.null?e:o._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else s=o.nil;i.number&&delete i.integer;for(const e in i)s=o.and(s,u(e,t,r,n));return s}e.checkDataType=u,e.checkDataTypes=l;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:r,schema:n}=e,o=a.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}(e);n.reportError(t,d)}e.reportTypeError=f}(ke);var Ue={assignDefaults:void 0};const Me=$e,Ve=_e;function qe(e,t,r){const{gen:n,compositeRule:o,data:a,opts:s}=e;if(void 0===r)return;const i=Me._`${a}${Me.getProperty(t)}`;if(o)return void Ve.checkStrictMode(e,`default is ignored for: ${i}`);let c=Me._`${i} === undefined`;"empty"===s.useDefaults&&(c=Me._`${c} || ${i} === null || ${i} === ""`),n.if(c,Me._`${i} = ${Me.stringify(r)}`)}Ue.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)qe(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>qe(e,r,t.default)))};var Fe={},ze={};ze.validateUnion=ze.validateArray=ze.usePattern=ze.callValidateCode=ze.schemaProperties=ze.allSchemaProperties=ze.noPropertyInData=ze.propertyInData=ze.isOwnProperty=ze.hasPropFunc=ze.reportMissingProp=ze.checkMissingProp=ze.checkReportMissingProp=void 0;const Le=$e,Ke=_e,Be=Ee;function Je(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Le._`Object.prototype.hasOwnProperty`})}function He(e,t,r){return Le._`${Je(e)}.call(${t}, ${r})`}function Ge(e,t,r,n){const o=Le._`${t}${Le.getProperty(r)} === undefined`;return n?Le.or(o,Le.not(He(e,t,r))):o}function Ye(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}ze.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:o}=e;r.if(Ge(r,n,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:Le._`${t}`},!0),e.error()}))},ze.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,o){return Le.or(...n.map((n=>Le.and(Ge(e,t,n,r.ownProperties),Le._`${o} = ${n}`))))},ze.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},ze.hasPropFunc=Je,ze.isOwnProperty=He,ze.propertyInData=function(e,t,r,n){const o=Le._`${t}${Le.getProperty(r)} !== undefined`;return n?Le._`${o} && ${He(e,t,r)}`:o},ze.noPropertyInData=Ge,ze.allSchemaProperties=Ye,ze.schemaProperties=function(e,t){return Ye(t).filter((r=>!Ke.alwaysValidSchema(e,t[r])))},ze.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:a},it:s},i,c,u){const l=u?Le._`${e}, ${t}, ${n}${o}`:t,d=[[Be.default.instancePath,Le.strConcat(Be.default.instancePath,a)],[Be.default.parentData,s.parentData],[Be.default.parentDataProperty,s.parentDataProperty],[Be.default.rootData,Be.default.rootData]];s.opts.dynamicRef&&d.push([Be.default.dynamicAnchors,Be.default.dynamicAnchors]);const f=Le._`${l}, ${r.object(...d)}`;return c!==Le.nil?Le._`${i}.call(${c}, ${f})`:Le._`${i}(${f})`},ze.usePattern=function(e,t){return e.scopeValue("pattern",{key:t,ref:new RegExp(t,"u"),code:Le._`new RegExp(${t}, "u")`})},ze.validateArray=function(e){const{gen:t,data:r,keyword:n,it:o}=e,a=t.name("valid");if(o.allErrors){const e=t.let("valid",!0);return s((()=>t.assign(e,!1))),e}return t.var(a,!0),s((()=>t.break())),a;function s(o){const s=t.const("len",Le._`${r}.length`);t.forRange("i",0,s,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:Ke.Type.Num},a),t.if(Le.not(a),o)}))}},ze.validateUnion=function(e){const{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>Ke.alwaysValidSchema(o,e)))&&!o.opts.unevaluated)return;const a=t.let("valid",!1),s=t.name("_valid");t.block((()=>r.forEach(((r,o)=>{const i=e.subschema({keyword:n,schemaProp:o,compositeRule:!0},s);t.assign(a,Le._`${a} || ${s}`);e.mergeValidEvaluated(i,s)||t.if(Le.not(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))},Fe.validateKeywordUsage=Fe.validSchemaType=Fe.funcKeywordCode=Fe.macroKeywordCode=void 0;const Xe=$e,We=Ee,Qe=ze,Ze=ge;function et(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,Xe._`${n.parentData}[${n.parentDataProperty}]`)))}function tt(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:Xe.stringify(r)})}Fe.macroKeywordCode=function(e,t){const{gen:r,keyword:n,schema:o,parentSchema:a,it:s}=e,i=t.macro.call(s.self,o,a,s),c=tt(r,n,i);!1!==s.opts.validateSchema&&s.self.validateSchema(i,!0);const u=r.name("valid");e.subschema({schema:i,schemaPath:Xe.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},Fe.funcKeywordCode=function(e,t){var r;const{gen:n,keyword:o,schema:a,parentSchema:s,$data:i,it:c}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(c,t);const u=!i&&t.compile?t.compile.call(c.self,a,s,c):t.validate,l=tt(n,o,u),d=n.let("valid");function f(r=(t.async?Xe._`await `:Xe.nil)){const o=c.opts.passContext?We.default.this:We.default.self,a=!("compile"in t&&!i||!1===t.schema);n.assign(d,Xe._`${r}${Qe.callValidateCode(e,l,o,a)}`,t.modifying)}function h(e){var r;n.if(Xe.not(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)f(),t.modifying&&et(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>f(Xe._`await `)),(t=>n.assign(d,!1).if(Xe._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,Xe._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=Xe._`${l}.errors`;return n.assign(e,null),f(Xe.nil),e}();t.modifying&&et(e),h((()=>function(e,t){const{gen:r}=e;r.if(Xe._`Array.isArray(${t})`,(()=>{r.assign(We.default.vErrors,Xe._`${We.default.vErrors} === null ? ${t} : ${We.default.vErrors}.concat(${t})`).assign(We.default.errors,Xe._`${We.default.vErrors}.length`),Ze.extendErrors(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},Fe.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},Fe.validateKeywordUsage=function({schema:e,opts:t,self:r},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw new Error("ajv implementation error");const a=n.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(n.validateSchema){if(!n.validateSchema(e[o])){const e="keyword value is invalid: "+r.errorsText(n.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}};var rt={};rt.extendSubschemaMode=rt.extendSubschemaData=rt.getSubschema=void 0;const nt=$e,ot=_e;rt.getSubschema=function(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:a,topSchemaRef:s}){if(void 0!==t&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const n=e.schema[t];return void 0===r?{schema:n,schemaPath:nt._`${e.schemaPath}${nt.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:nt._`${e.schemaPath}${nt.getProperty(t)}${nt.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${ot.escapeFragment(r)}`}}if(void 0!==n){if(void 0===o||void 0===a||void 0===s)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},rt.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:a,propertyName:s}){if(void 0!==o&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:i}=t;if(void 0!==r){const{errorPath:o,dataPathArr:a,opts:s}=t;c(i.let("data",nt._`${t.data}${nt.getProperty(r)}`,!0)),e.errorPath=nt.str`${o}${ot.getErrorPath(r,n,s.jsPropertySyntax)}`,e.parentDataProperty=nt._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}if(void 0!==o){c(o instanceof nt.Name?o:i.let("data",o,!0)),void 0!==s&&(e.propertyName=s)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}a&&(e.dataTypes=a)},rt.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:a}){void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==a&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r};var at={},st=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!=o--;){var s=a[o];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r},it={exports:{}},ct=it.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),ut(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function ut(e,t,r,n,o,a,s,i,c,u){if(n&&"object"==typeof n&&!Array.isArray(n)){for(var l in t(n,o,a,s,i,c,u),n){var d=n[l];if(Array.isArray(d)){if(l in ct.arrayKeywords)for(var f=0;f<d.length;f++)ut(e,t,r,d[f],o+"/"+l+"/"+f,a,o,l,n,f)}else if(l in ct.propsKeywords){if(d&&"object"==typeof d)for(var h in d)ut(e,t,r,d[h],o+"/"+l+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),a,o,l,n,h)}else(l in ct.keywords||e.allKeys&&!(l in ct.skipKeywords))&&ut(e,t,r,d,o+"/"+l,a,o,l,n)}r(n,o,a,s,i,c,u)}}ct.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},ct.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},ct.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},ct.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};var lt={exports:{}};
5
- /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,o=1;o<n;++o)t[o]=t[o].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(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 s(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}function i(e){var n="[A-Za-z]",o="[0-9]",a=t(o,"[A-Fa-f]"),s=r(r("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+r("%[89A-Fa-f]"+a+"%"+a+a)+"|"+r("%"+a+a)),i="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",i),u=e?"[\\uE000-\\uF8FF]":"[]",l=t(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");r(n+t(n,o,"[\\+\\-\\.]")+"*"),r(r(s+"|"+t(l,i,"[\\:]"))+"*");var d=r(r("25[0-5]")+"|"+r("2[0-4]"+o)+"|"+r("1"+o+o)+"|"+r("0?[1-9]"+o)+"|0?0?"+o),f=r(d+"\\."+d+"\\."+d+"\\."+d),h=r(a+"{1,4}"),m=r(r(h+"\\:"+h)+"|"+f),p=r(r(h+"\\:")+"{6}"+m),y=r("\\:\\:"+r(h+"\\:")+"{5}"+m),v=r(r(h)+"?\\:\\:"+r(h+"\\:")+"{4}"+m),g=r(r(r(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+r(h+"\\:")+"{3}"+m),$=r(r(r(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+r(h+"\\:")+"{2}"+m),b=r(r(r(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+m),w=r(r(r(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+m),_=r(r(r(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),E=r(r(r(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),N=r([p,y,v,g,$,b,w,_,E].join("|")),S=r(r(l+"|"+s)+"+");r("[vV]"+a+"+\\."+t(l,i,"[\\:]")+"+"),r(r(s+"|"+t(l,i))+"*");var T=r(s+"|"+t(l,i,"[\\:\\@]"));return r(r(s+"|"+t(l,i,"[\\@]"))+"+"),r(r(T+"|"+t("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(t("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",l,i),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",l,i),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",l,i),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",l,i),"g"),NOT_QUERY:new RegExp(t("[^\\%]",l,i,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",l,i,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",l,i),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+N+")"+r(r("\\%25|\\%(?!"+a+"{2})")+"("+S+")")+"?\\]?$")}}var c=i(!1),u=i(!0),l=function(){function e(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var s,i=e[Symbol.iterator]();!(n=(s=i.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(o)throw a}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},f=2147483647,h=36,m=1,p=26,y=38,v=700,g=72,$=128,b="-",w=/^xn--/,_=/[^\0-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=h-m,T=Math.floor,P=String.fromCharCode;function O(e){throw new RangeError(N[e])}function A(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function C(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+A((e=e.replace(E,".")).split("."),t).join(".")}function k(e){for(var t=[],r=0,n=e.length;r<n;){var o=e.charCodeAt(r++);if(o>=55296&&o<=56319&&r<n){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&o)<<10)+(1023&a)+65536):(t.push(o),r--)}else t.push(o)}return t}var D=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},I=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},R=function(e,t,r){var n=0;for(e=r?T(e/v):e>>1,e+=T(e/t);e>S*p>>1;n+=h)e=T(e/S);return T(n+(S+1)*e/(e+y))},x=function(e){var t=[],r=e.length,n=0,o=$,a=g,s=e.lastIndexOf(b);s<0&&(s=0);for(var i=0;i<s;++i)e.charCodeAt(i)>=128&&O("not-basic"),t.push(e.charCodeAt(i));for(var c=s>0?s+1:0;c<r;){for(var u=n,l=1,d=h;;d+=h){c>=r&&O("invalid-input");var y=D(e.charCodeAt(c++));(y>=h||y>T((f-n)/l))&&O("overflow"),n+=y*l;var v=d<=a?m:d>=a+p?p:d-a;if(y<v)break;var w=h-v;l>T(f/w)&&O("overflow"),l*=w}var _=t.length+1;a=R(n-u,_,0==u),T(n/_)>f-o&&O("overflow"),o+=T(n/_),n%=_,t.splice(n++,0,o)}return String.fromCodePoint.apply(String,t)},j=function(e){var t=[],r=(e=k(e)).length,n=$,o=0,a=g,s=!0,i=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(s=(u=l.next()).done);s=!0){var d=u.value;d<128&&t.push(P(d))}}catch(e){i=!0,c=e}finally{try{!s&&l.return&&l.return()}finally{if(i)throw c}}var y=t.length,v=y;for(y&&t.push(b);v<r;){var w=f,_=!0,E=!1,N=void 0;try{for(var S,A=e[Symbol.iterator]();!(_=(S=A.next()).done);_=!0){var C=S.value;C>=n&&C<w&&(w=C)}}catch(e){E=!0,N=e}finally{try{!_&&A.return&&A.return()}finally{if(E)throw N}}var D=v+1;w-n>T((f-o)/D)&&O("overflow"),o+=(w-n)*D,n=w;var x=!0,j=!1,U=void 0;try{for(var M,V=e[Symbol.iterator]();!(x=(M=V.next()).done);x=!0){var q=M.value;if(q<n&&++o>f&&O("overflow"),q==n){for(var F=o,z=h;;z+=h){var L=z<=a?m:z>=a+p?p:z-a;if(F<L)break;var K=F-L,B=h-L;t.push(P(I(L+K%B,0))),F=T(K/B)}t.push(P(I(F,0))),a=R(o,D,v==y),o=0,++v}}}catch(e){j=!0,U=e}finally{try{!x&&V.return&&V.return()}finally{if(j)throw U}}++o,++n}return t.join("")},U=function(e){return C(e,(function(e){return w.test(e)?x(e.slice(4).toLowerCase()):e}))},M=function(e){return C(e,(function(e){return _.test(e)?"xn--"+j(e):e}))},V={version:"2.1.0",ucs2:{decode:k,encode:function(e){return String.fromCodePoint.apply(String,d(e))}},decode:x,encode:j,toASCII:M,toUnicode:U},q={};function F(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function z(e){for(var t="",r=0,n=e.length;r<n;){var o=parseInt(e.substr(r+1,2),16);if(o<128)t+=String.fromCharCode(o),r+=3;else if(o>=194&&o<224){if(n-r>=6){var a=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&o)<<6|63&a)}else t+=e.substr(r,6);r+=6}else if(o>=224){if(n-r>=9){var s=parseInt(e.substr(r+4,2),16),i=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&s)<<6|63&i)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function L(e,t){function r(e){var r=z(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,F).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,F).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,F).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,F).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,F).replace(t.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function B(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=l(r,2)[1];return n?n.split(".").map(K).join("."):e}function J(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=l(r,3),o=n[1],a=n[2];if(o){for(var s=o.toLowerCase().split("::").reverse(),i=l(s,2),c=i[0],u=i[1],d=u?u.split(":").map(K):[],f=c.split(":").map(K),h=t.IPV4ADDRESS.test(f[f.length-1]),m=h?7:8,p=f.length-m,y=Array(m),v=0;v<m;++v)y[v]=d[v]||f[p+v]||"";h&&(y[m-1]=B(y[m-1],t));var g=y.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],$=void 0;if(g&&g.length>1){var b=y.slice(0,g.index),w=y.slice(g.index+g.length);$=b.join(":")+"::"+w.join(":")}else $=y.join(":");return a&&($+="%"+a),$}return e}var H=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,G=void 0==="".match(/(){0}/)[1];function Y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(H);if(o){G?(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5])):(r.scheme=o[1]||void 0,r.userinfo=-1!==e.indexOf("@")?o[3]:void 0,r.host=-1!==e.indexOf("//")?o[4]:void 0,r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=-1!==e.indexOf("?")?o[7]:void 0,r.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),r.host&&(r.host=J(B(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=q[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)L(r,n);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=V.toASCII(r.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}L(r,c)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function X(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(J(B(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var W=/^\.\.?\//,Q=/^\/\.(\/|$)/,Z=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(W))e=e.replace(W,"");else if(e.match(Q))e=e.replace(Q,"/");else if(e.match(Z))e=e.replace(Z,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],o=q[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?V.toUnicode(e.host):V.toASCII(e.host.replace(r.PCT_ENCODED,z).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}L(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=X(e,t);if(void 0!==a&&("suffix"!==t.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var s=e.path;t.absolutePath||o&&o.absolutePath||(s=te(s)),void 0===a&&(s=s.replace(/^\/\//,"/%2F")),n.push(s)}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,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=Y(re(e,r),r),t=Y(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.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)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function oe(e,t,r){var n=s({scheme:"null"},r);return re(ne(Y(e,n),Y(t,n),n,!0),n)}function ae(e,t){return"string"==typeof e?e=re(Y(e,t),t):"object"===n(e)&&(e=Y(re(e,t),t)),e}function se(e,t,r){return"string"==typeof e?e=re(Y(e,r),r):"object"===n(e)&&(e=re(e,r)),"string"==typeof t?t=re(Y(t,r),r):"object"===n(t)&&(t=re(t,r)),e===t}function ie(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,F)}function ce(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}var ue={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?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 de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=de(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(de(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 r=e.resourceName.split("?"),n=l(r,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},me={},pe="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",ve=r(r("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+r("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+r("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",$e=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),be="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",we=new RegExp(pe,"g"),_e=new RegExp(ve,"g"),Ee=new RegExp(t("[^]",ge,"[\\.]",'[\\"]',$e),"g"),Ne=new RegExp(t("[^]",pe,be),"g"),Se=Ne;function Te(e){var t=z(e);return t.match(we)?t:e}var Pe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var o=!1,a={},s=r.query.split("&"),i=0,c=s.length;i<c;++i){var u=s[i].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),d=0,f=l.length;d<f;++d)n.push(l[d]);break;case"subject":r.subject=ce(u[1],t);break;case"body":r.body=ce(u[1],t);break;default:o=!0,a[ce(u[0],t)]=ce(u[1],t)}}o&&(r.headers=a)}r.query=void 0;for(var h=0,m=n.length;h<m;++h){var p=n[h].split("@");if(p[0]=ce(p[0]),t.unicodeSupport)p[1]=ce(p[1],t).toLowerCase();else try{p[1]=V.toASCII(ce(p[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=p.join("@")}return r},serialize:function(e,t){var r=e,n=a(e.to);if(n){for(var s=0,i=n.length;s<i;++s){var c=String(n[s]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(_e,Te).replace(_e,o).replace(Ee,F),d=c.slice(u+1);try{d=t.iri?V.toUnicode(d):V.toASCII(ce(d,t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}n[s]=l+"@"+d}r.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 m in f)f[m]!==me[m]&&h.push(m.replace(_e,Te).replace(_e,o).replace(Ne,F)+"="+f[m].replace(_e,Te).replace(_e,o).replace(Se,F));return h.length&&(r.query=h.join("&")),r}},Oe=/^([^\:]+)\:(.*)/,Ae={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(Oe),n=e;if(r){var o=t.scheme||n.scheme||"urn",a=r[1].toLowerCase(),s=r[2],i=o+":"+(t.nid||a),c=q[i];n.nid=a,n.nss=s,n.path=void 0,c&&(n=c.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,o=r+":"+(t.nid||n),a=q[o];a&&(e=a.serialize(e,t));var s=e,i=e.nss;return s.path=(n||t.nid)+":"+i,s}},Ce=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ke={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(Ce)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Pe.scheme]=Pe,q[Ae.scheme]=Ae,q[ke.scheme]=ke,e.SCHEMES=q,e.pctEncChar=F,e.pctDecChars=z,e.parse=Y,e.removeDotSegments=te,e.serialize=re,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=se,e.escapeComponent=ie,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(lt.exports),at.getSchemaRefs=at.resolveUrl=at.normalizeId=at._getFullPath=at.getFullPath=at.inlineRef=void 0;const dt=_e,ft=st,ht=it.exports,mt=lt.exports,pt=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);at.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!vt(e):!!t&&gt(e)<=t)};const yt=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function vt(e){for(const t in e){if(yt.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(vt))return!0;if("object"==typeof r&&vt(r))return!0}return!1}function gt(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!pt.has(r)&&("object"==typeof e[r]&&dt.eachItem(e[r],(e=>t+=gt(e))),t===1/0))return 1/0}return t}function $t(e="",t){!1!==t&&(e=_t(e));return bt(mt.parse(e))}function bt(e){return mt.serialize(e).split("#")[0]+"#"}at.getFullPath=$t,at._getFullPath=bt;const wt=/#\/?$/;function _t(e){return e?e.replace(wt,""):""}at.normalizeId=_t,at.resolveUrl=function(e,t){return t=_t(t),mt.resolve(e,t)};const Et=/^[a-z_][-a-z0-9._]*$/i;at.getSchemaRefs=function(e){if("boolean"==typeof e)return{};const t=_t(e.$id),r={"":t},n=$t(t,!1),o={},a=new Set;return ht(e,{allKeys:!0},((e,t,c,u)=>{if(void 0===u)return;const l=n+t;let d=r[u];function f(t){if(t=_t(d?mt.resolve(d,t):t),a.has(t))throw i(t);a.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?s(e,r.schema,t):t!==_t(l)&&("#"===t[0]?(s(e,o[t],t),o[t]=e):this.refs[t]=l),t}function h(e){if("string"==typeof e){if(!Et.test(e))throw new Error(`invalid anchor "${e}"`);f.call(this,`#${e}`)}}"string"==typeof e.$id&&(d=f.call(this,e.$id)),h.call(this,e.$anchor),h.call(this,e.$dynamicAnchor),r[t]=d})),o;function s(e,t,r){if(void 0!==t&&!ft(e,t))throw i(r)}function i(e){return new Error(`reference "${e}" resolves to more than one schema`)}},ye.getData=ye.KeywordCxt=ye.validateFunctionCode=void 0;const Nt=ve,St=ke,Tt=Re,Pt=ke,Ot=Ue,At=Fe,Ct=rt,kt=$e,Dt=Ee,It=at,Rt=_e,xt=ge;function jt({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},a){o.code.es5?e.func(t,kt._`${Dt.default.data}, ${Dt.default.valCxt}`,n.$async,(()=>{e.code(kt._`"use strict"; ${Ut(r,o)}`),function(e,t){e.if(Dt.default.valCxt,(()=>{e.var(Dt.default.instancePath,kt._`${Dt.default.valCxt}.${Dt.default.instancePath}`),e.var(Dt.default.parentData,kt._`${Dt.default.valCxt}.${Dt.default.parentData}`),e.var(Dt.default.parentDataProperty,kt._`${Dt.default.valCxt}.${Dt.default.parentDataProperty}`),e.var(Dt.default.rootData,kt._`${Dt.default.valCxt}.${Dt.default.rootData}`),t.dynamicRef&&e.var(Dt.default.dynamicAnchors,kt._`${Dt.default.valCxt}.${Dt.default.dynamicAnchors}`)}),(()=>{e.var(Dt.default.instancePath,kt._`""`),e.var(Dt.default.parentData,kt._`undefined`),e.var(Dt.default.parentDataProperty,kt._`undefined`),e.var(Dt.default.rootData,Dt.default.data),t.dynamicRef&&e.var(Dt.default.dynamicAnchors,kt._`{}`)}))}(e,o),e.code(a)})):e.func(t,kt._`${Dt.default.data}, ${function(e){return kt._`{${Dt.default.instancePath}="", ${Dt.default.parentData}, ${Dt.default.parentDataProperty}, ${Dt.default.rootData}=${Dt.default.data}${e.dynamicRef?kt._`, ${Dt.default.dynamicAnchors}={}`:kt.nil}}={}`}(o)}`,n.$async,(()=>e.code(Ut(r,o)).code(a)))}function Ut(e,t){return"object"==typeof e&&e.$id&&(t.code.source||t.code.process)?kt._`/*# sourceURL=${e.$id} */`:kt.nil}function Mt(e,t){qt(e)&&(Ft(e),Vt(e))?function(e,t){const{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&Lt(e);(function(e){e.schema.$id&&(e.baseId=It.resolveUrl(e.baseId,e.schema.$id))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const a=n.const("_errs",Dt.default.errors);zt(e,a),n.var(t,kt._`${a} === ${Dt.default.errors}`)}(e,t):Nt.boolOrEmptySchema(e,t)}function Vt({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function qt(e){return"boolean"!=typeof e.schema}function Ft(e){Rt.checkUnknownRules(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&Rt.schemaHasRulesButRef(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function zt(e,t){if(e.opts.jtd)return Kt(e,[],!1,t);const r=St.getSchemaTypes(e.schema);Kt(e,r,!St.coerceAndCheckDataType(e,r),t)}function Lt({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){const a=r.$comment;if(!0===o.$comment)e.code(kt._`${Dt.default.self}.logger.log(${a})`);else if("function"==typeof o.$comment){const r=kt.str`${n}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(kt._`${Dt.default.self}.opts.$comment(${a}, ${r}, ${o}.schema)`)}}function Kt(e,t,r,n){const{gen:o,schema:a,data:s,allErrors:i,opts:c,self:u}=e,{RULES:l}=u;function d(u){Tt.shouldUseGroup(a,u)&&(u.type?(o.if(Pt.checkDataType(u.type,s,c.strictNumbers)),Bt(e,u),1===t.length&&t[0]===u.type&&r&&(o.else(),Pt.reportTypeError(e)),o.endIf()):Bt(e,u),i||o.if(kt._`${Dt.default.errors} === ${n||0}`))}!a.$ref||!c.ignoreKeywordsWithRef&&Rt.schemaHasRulesButRef(a,l)?(c.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{Ht(e.dataTypes,t)||Gt(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>Ht(t,e)))})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&Gt(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const n in r){const o=r[n];if("object"==typeof o&&Tt.shouldUseRule(e.schema,o)){const{type:r}=o.definition;r.length&&!r.some((e=>Jt(t,e)))&&Gt(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),o.block((()=>{for(const e of l.rules)d(e);d(l.post)}))):o.block((()=>Xt(e,"$ref",l.all.$ref.definition)))}function Bt(e,t){const{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&Ot.assignDefaults(e,t.type),r.block((()=>{for(const r of t.rules)Tt.shouldUseRule(n,r)&&Xt(e,r.keyword,r.definition,t.type)}))}function Jt(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function Ht(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function Gt(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,Rt.checkStrictMode(e,t,e.opts.strictTypes)}ye.validateFunctionCode=function(e){qt(e)&&(Ft(e),Vt(e))?function(e){const{schema:t,opts:r,gen:n}=e;jt(e,(()=>{r.$comment&&t.$comment&&Lt(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&Rt.checkStrictMode(e,"default is ignored in the schema root")}(e),n.let(Dt.default.vErrors,null),n.let(Dt.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",kt._`${r}.evaluated`),t.if(kt._`${e.evaluated}.dynamicProps`,(()=>t.assign(kt._`${e.evaluated}.props`,kt._`undefined`))),t.if(kt._`${e.evaluated}.dynamicItems`,(()=>t.assign(kt._`${e.evaluated}.items`,kt._`undefined`)))}(e),zt(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:a}=e;r.$async?t.if(kt._`${Dt.default.errors} === 0`,(()=>t.return(Dt.default.data)),(()=>t.throw(kt._`new ${o}(${Dt.default.vErrors})`))):(t.assign(kt._`${n}.errors`,Dt.default.vErrors),a.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof kt.Name&&e.assign(kt._`${t}.props`,r);n instanceof kt.Name&&e.assign(kt._`${t}.items`,n)}(e),t.return(kt._`${Dt.default.errors} === 0`))}(e)}))}(e):jt(e,(()=>Nt.topBoolOrEmptySchema(e)))};class Yt{constructor(e,t,r){if(At.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Rt.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",Zt(this.$data,e));else if(this.schemaCode=this.schemaValue,!At.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",Dt.default.errors))}result(e,t,r){this.gen.if(kt.not(e)),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.result(e,void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(kt._`${t} !== undefined && (${kt.or(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?xt.reportExtraError:xt.reportError)(this,this.def.error,t)}$dataError(){xt.reportError(this,this.def.$dataError||xt.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');xt.resetErrorsCount(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=kt.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=kt.nil,t=kt.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:o,def:a}=this;r.if(kt.or(kt._`${n} === undefined`,t)),e!==kt.nil&&r.assign(e,!0),(o.length||a.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==kt.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:o}=this;return kt.or(function(){if(r.length){if(!(t instanceof kt.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return kt._`${Pt.checkDataTypes(e,t,o.opts.strictNumbers,Pt.DataType.Wrong)}`}return kt.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return kt._`!${r}(${t})`}return kt.nil}())}subschema(e,t){const r=Ct.getSubschema(this.it,e);Ct.extendSubschemaData(r,this.it,e),Ct.extendSubschemaMode(r,e);const n={...this.it,...r,items:void 0,props:void 0};return Mt(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=Rt.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=Rt.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,kt.Name))),!0}}function Xt(e,t,r,n){const o=new Yt(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?At.funcKeywordCode(o,r):"macro"in r?At.macroKeywordCode(o,r):(r.compile||r.validate)&&At.funcKeywordCode(o,r)}ye.KeywordCxt=Yt;const Wt=/^\/(?:[^~]|~0|~1)*$/,Qt=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Zt(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,a;if(""===e)return Dt.default.rootData;if("/"===e[0]){if(!Wt.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,a=Dt.default.rootData}else{const s=Qt.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+s[1];if(o=s[2],"#"===o){if(i>=t)throw new Error(c("property/index",i));return n[t-i]}if(i>t)throw new Error(c("data",i));if(a=r[t-i],!o)return a}let s=a;const i=o.split("/");for(const e of i)e&&(a=kt._`${a}${kt.getProperty(Rt.unescapeJsonPointer(e))}`,s=kt._`${s} && ${a}`);return s;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}ye.getData=Zt;var er={};class tr extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}er.default=tr;var rr={};const nr=at;class or extends Error{constructor(e,t,r){super(r||`can't resolve reference ${t} from id ${e}`),this.missingRef=nr.resolveUrl(e,t),this.missingSchema=nr.normalizeId(nr.getFullPath(this.missingRef))}}rr.default=or;var ar={};ar.resolveSchema=ar.getCompilingSchema=ar.resolveRef=ar.compileSchema=ar.SchemaEnv=void 0;const sr=$e,ir=er,cr=Ee,ur=at,lr=_e,dr=ye,fr=lt.exports;class hr{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:ur.normalizeId(null==r?void 0:r.$id),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function mr(e){const t=yr.call(this,e);if(t)return t;const r=ur.getFullPath(e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:a}=this.opts,s=new sr.CodeGen(this.scope,{es5:n,lines:o,ownProperties:a});let i;e.$async&&(i=s.scopeValue("Error",{ref:ir.default,code:sr._`require("ajv/dist/runtime/validation_error").default`}));const c=s.scopeName("validate");e.validateName=c;const u={gen:s,allErrors:this.opts.allErrors,data:cr.default.data,parentData:cr.default.parentData,parentDataProperty:cr.default.parentDataProperty,dataNames:[cr.default.data],dataPathArr:[sr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:sr.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:sr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:sr._`""`,opts:this.opts,self:this};let l;try{this._compilations.add(e),dr.validateFunctionCode(u),s.optimize(this.opts.code.optimize);const t=s.toString();l=`${s.scopeRefs(cr.default.scope)}return ${t}`,this.opts.code.process&&(l=this.opts.code.process(l,e));const r=new Function(`${cr.default.self}`,`${cr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:c,validateCode:t,scopeValues:s._values}),this.opts.unevaluated){const{props:e,items:t}=u;r.evaluated={props:e instanceof sr.Name?void 0:e,items:t instanceof sr.Name?void 0:t,dynamicProps:e instanceof sr.Name,dynamicItems:t instanceof sr.Name},r.source&&(r.source.evaluated=sr.stringify(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),t}finally{this._compilations.delete(e)}}function pr(e){return ur.inlineRef(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:mr.call(this,e)}function yr(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function vr(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||gr.call(this,e,t)}function gr(e,t){const r=fr.parse(t),n=ur._getFullPath(r);let o=ur.getFullPath(e.baseId);if(Object.keys(e.schema).length>0&&n===o)return br.call(this,r,e);const a=ur.normalizeId(n),s=this.refs[a]||this.schemas[a];if("string"==typeof s){const t=gr.call(this,e,s);if("object"!=typeof(null==t?void 0:t.schema))return;return br.call(this,r,t)}if("object"==typeof(null==s?void 0:s.schema)){if(s.validate||mr.call(this,s),a===ur.normalizeId(t)){const{schema:t}=s;return t.$id&&(o=ur.resolveUrl(o,t.$id)),new hr({schema:t,root:e,baseId:o})}return br.call(this,r,s)}}ar.SchemaEnv=hr,ar.compileSchema=mr,ar.resolveRef=function(e,t,r){var n;r=ur.resolveUrl(t,r);const o=e.refs[r];if(o)return o;let a=vr.call(this,e,r);if(void 0===a){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r];o&&(a=new hr({schema:o,root:e,baseId:t}))}return void 0!==a?e.refs[r]=pr.call(this,a):void 0},ar.getCompilingSchema=yr,ar.resolveSchema=gr;const $r=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function br(e,{baseId:t,schema:r,root:n}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;if(void 0===(r=r[lr.unescapeFragment(n)]))return;!$r.has(n)&&"object"==typeof r&&r.$id&&(t=ur.resolveUrl(t,r.$id))}let a;if("boolean"!=typeof r&&r.$ref&&!lr.schemaHasRulesButRef(r,this.RULES)){const e=ur.resolveUrl(t,r.$ref);a=gr.call(this,n,e)}return a=a||new hr({schema:r,root:n,baseId:t}),a.schema!==a.root.schema?a:void 0}var wr={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};!function(e){e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=ye;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=$e;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=er,o=rr,a=De,s=ar,i=$e,c=at,u=ke,l=_e,d=wr,f=["removeAdditional","useDefaults","coerceTypes"],h=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),m={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",schemaId:"JSON Schema draft-04 is not supported in Ajv v7/8.",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now, see option `strict`."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function y(e){var t,r,n,o,a,s,i,c,u,l,d,f,h,m,p,y,v,g,$;const b=e.strict,w=null===(t=e.code)||void 0===t?void 0:t.optimize,_=!0===w||void 0===w?1:w||0;return{strictSchema:null===(n=null!==(r=e.strictSchema)&&void 0!==r?r:b)||void 0===n||n,strictNumbers:null===(a=null!==(o=e.strictNumbers)&&void 0!==o?o:b)||void 0===a||a,strictTypes:null!==(i=null!==(s=e.strictTypes)&&void 0!==s?s:b)&&void 0!==i?i:"log",strictTuples:null!==(u=null!==(c=e.strictTuples)&&void 0!==c?c:b)&&void 0!==u?u:"log",strictRequired:null!==(d=null!==(l=e.strictRequired)&&void 0!==l?l:b)&&void 0!==d&&d,code:e.code?{...e.code,optimize:_}:{optimize:_},loopRequired:null!==(f=e.loopRequired)&&void 0!==f?f:200,loopEnum:null!==(h=e.loopEnum)&&void 0!==h?h:200,meta:null===(m=e.meta)||void 0===m||m,messages:null===(p=e.messages)||void 0===p||p,inlineRefs:null===(y=e.inlineRefs)||void 0===y||y,addUsedSchema:null===(v=e.addUsedSchema)||void 0===v||v,validateSchema:null===(g=e.validateSchema)||void 0===g||g,validateFormats:null===($=e.validateFormats)||void 0===$||$}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...y(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:h,es5:t,lines:r}),this.logger=function(e){if(!1===e)return N;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=a.getRules(),g.call(this,m,e,"NOT SUPPORTED"),g.call(this,p,e,"DEPRECATED","warn"),this._metaOpts=E.call(this),e.formats&&w.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&_.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),b.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t}=this.opts;t&&e&&this.addMetaSchema(d,d.$id,!1)}defaultMeta(){const{meta:e}=this.opts;return this.opts.defaultMeta="object"==typeof e?e.$id||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await a.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||s.call(this,r)}async function a(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return i.call(this,t),await c.call(this,t.missingSchema),s.call(this,e)}}function i({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await a.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let o;if("object"==typeof e&&(o=e.$id,void 0!==o&&"string"!=typeof o))throw new Error("schema $id must be string");return t=c.normalizeId(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=$.call(this,e));)e=t;if(void 0===t){const r=new s.SchemaEnv({schema:{}});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=$.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e.$id;return r&&(r=c.normalizeId(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(T.call(this,r,t),!t)return l.eachItem(r,(e=>P.call(this,e))),this;A.call(this,t);const n={...t,type:u.getJSONTypes(t.type),schemaType:u.getJSONTypes(t.schemaType)};return l.eachItem(r,0===n.type.length?e=>P.call(this,e,n):e=>n.type.forEach((t=>P.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,a=o[e];n&&a&&(o[e]=k(a))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let a;if("object"==typeof e)a=e.$id;else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let i=this._cache.get(e);if(void 0!==i)return i;const u=c.getSchemaRefs.call(this,e);return r=c.normalizeId(a||r),i=new s.SchemaEnv({schema:e,meta:t,baseId:r,localRefs:u}),this._cache.set(i.schema,i),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=i),n&&this.validateSchema(e,!0),i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}}function g(e,t,r,n="error"){for(const o in e){const a=o;a in t&&this.logger[n](`${r}: option ${o}. ${e[a]}`)}}function $(e){return e=c.normalizeId(e),this.schemas[e]||this.refs[e]}function b(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function w(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function _(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function E(){const e={...this.opts};for(const t of f)delete e[t];return e}e.default=v,v.ValidationError=n.default,v.MissingRefError=o.default;const N={log(){},warn(){},error(){}};const S=/^[a-z_$][a-z0-9_$:-]*$/i;function T(e,t){const{RULES:r}=this;if(l.eachItem(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!S.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function P(e,t,r){var n;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:a}=this;let s=o?a.post:a.rules.find((({type:e})=>e===r));if(s||(s={type:r,rules:[]},a.rules.push(s)),a.keywords[e]=!0,!t)return;const i={keyword:e,definition:{...t,type:u.getJSONTypes(t.type),schemaType:u.getJSONTypes(t.schemaType)}};t.before?O.call(this,s,i,t.before):s.rules.push(i),a.all[e]=i,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function O(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function A(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=k(t)),e.validateSchema=this.compile(t,!0))}const C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function k(e){return{anyOf:[e,C]}}}(pe);var _r={},Er={},Nr={};const Sr={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Nr.default=Sr;var Tr={};Tr.callRef=Tr.getValidate=void 0;const Pr=rr,Or=ze,Ar=$e,Cr=Ee,kr=ar,Dr=_e,Ir={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:a,validateName:s,opts:i,self:c}=n,{root:u}=a;if(("#"===r||"#/"===r)&&o===u.baseId)return function(){if(a===u)return xr(e,s,a,a.$async);const r=t.scopeValue("root",{ref:u});return xr(e,Ar._`${r}.validate`,u,u.$async)}();const l=kr.resolveRef.call(c,u,o,r);if(void 0===l)throw new Pr.default(o,r);return l instanceof kr.SchemaEnv?function(t){const r=Rr(e,t);xr(e,r,t,t.$async)}(l):function(n){const o=t.scopeValue("schema",!0===i.code.source?{ref:n,code:Ar.stringify(n)}:{ref:n}),a=t.name("valid"),s=e.subschema({schema:n,dataTypes:[],schemaPath:Ar.nil,topSchemaRef:o,errSchemaPath:r},a);e.mergeEvaluated(s),e.ok(a)}(l)}};function Rr(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Ar._`${r.scopeValue("wrapper",{ref:t})}.validate`}function xr(e,t,r,n){const{gen:o,it:a}=e,{allErrors:s,schemaEnv:i,opts:c}=a,u=c.passContext?Cr.default.this:Ar.nil;function l(e){const t=Ar._`${e}.errors`;o.assign(Cr.default.vErrors,Ar._`${Cr.default.vErrors} === null ? ${t} : ${Cr.default.vErrors}.concat(${t})`),o.assign(Cr.default.errors,Ar._`${Cr.default.vErrors}.length`)}function d(e){var t;if(!a.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==a.props)if(n&&!n.dynamicProps)void 0!==n.props&&(a.props=Dr.mergeEvaluated.props(o,n.props,a.props));else{const t=o.var("props",Ar._`${e}.evaluated.props`);a.props=Dr.mergeEvaluated.props(o,t,a.props,Ar.Name)}if(!0!==a.items)if(n&&!n.dynamicItems)void 0!==n.items&&(a.items=Dr.mergeEvaluated.items(o,n.items,a.items));else{const t=o.var("items",Ar._`${e}.evaluated.items`);a.items=Dr.mergeEvaluated.items(o,t,a.items,Ar.Name)}}n?function(){if(!i.$async)throw new Error("async schema referenced by sync schema");const r=o.let("valid");o.try((()=>{o.code(Ar._`await ${Or.callValidateCode(e,t,u)}`),d(t),s||o.assign(r,!0)}),(e=>{o.if(Ar._`!(${e} instanceof ${a.ValidationError})`,(()=>o.throw(e))),l(e),s||o.assign(r,!1)})),e.ok(r)}():e.result(Or.callValidateCode(e,t,u),(()=>d(t)),(()=>l(t)))}Tr.getValidate=Rr,Tr.callRef=xr,Tr.default=Ir;const jr=Tr,Ur=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Nr.default,jr.default];Er.default=Ur;var Mr={},Vr={};const qr=$e,Fr=qr.operators,zr={maximum:{okStr:"<=",ok:Fr.LTE,fail:Fr.GT},minimum:{okStr:">=",ok:Fr.GTE,fail:Fr.LT},exclusiveMaximum:{okStr:"<",ok:Fr.LT,fail:Fr.GTE},exclusiveMinimum:{okStr:">",ok:Fr.GT,fail:Fr.LTE}},Lr={message:({keyword:e,schemaCode:t})=>qr.str`must be ${zr[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>qr._`{comparison: ${zr[e].okStr}, limit: ${t}}`},Kr={keyword:Object.keys(zr),type:"number",schemaType:"number",$data:!0,error:Lr,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(qr._`${r} ${zr[t].fail} ${n} || isNaN(${r})`)}};Vr.default=Kr;var Br={};const Jr=$e,Hr={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>Jr.str`must be multiple of ${e}`,params:({schemaCode:e})=>Jr._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:o}=e,a=o.opts.multipleOfPrecision,s=t.let("res"),i=a?Jr._`Math.abs(Math.round(${s}) - ${s}) > 1e-${a}`:Jr._`${s} !== parseInt(${s})`;e.fail$data(Jr._`(${n} === 0 || (${s} = ${r}/${n}, ${i}))`)}};Br.default=Hr;var Gr={},Yr={};function Xr(e){const t=e.length;let r,n=0,o=0;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return n}Yr.default=Xr,Xr.code='require("ajv/dist/runtime/ucs2length").default';const Wr=$e,Qr=_e,Zr=Yr,en={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>Wr.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>Wr._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:n,it:o}=e,a="maxLength"===t?Wr.operators.GT:Wr.operators.LT,s=!1===o.opts.unicode?Wr._`${r}.length`:Wr._`${Qr.useFunc(e.gen,Zr.default)}(${r})`;e.fail$data(Wr._`${s} ${a} ${n}`)}};Gr.default=en;var tn={};const rn=ze,nn=$e,on={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>nn.str`must match pattern "${e}"`,params:({schemaCode:e})=>nn._`{pattern: ${e}}`},code(e){const{gen:t,data:r,$data:n,schema:o,schemaCode:a}=e,s=n?nn._`(new RegExp(${a}, "u"))`:rn.usePattern(t,o);e.fail$data(nn._`!${s}.test(${r})`)}};tn.default=on;var an={};const sn=$e,cn={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>sn.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>sn._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:n}=e,o="maxProperties"===t?sn.operators.GT:sn.operators.LT;e.fail$data(sn._`Object.keys(${r}).length ${o} ${n}`)}};an.default=cn;var un={};const ln=ze,dn=$e,fn=_e,hn={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>dn.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>dn._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:n,data:o,$data:a,it:s}=e,{opts:i}=s;if(!a&&0===r.length)return;const c=r.length>=i.loopRequired;if(s.allErrors?function(){if(c||a)e.block$data(dn.nil,u);else for(const t of r)ln.checkReportMissingProp(e,t)}():function(){const s=t.let("missing");if(c||a){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,a){e.setParams({missingProperty:r}),t.forOf(r,n,(()=>{t.assign(a,ln.propertyInData(t,o,r,i.ownProperties)),t.if(dn.not(a),(()=>{e.error(),t.break()}))}),dn.nil)}(s,r))),e.ok(r)}else t.if(ln.checkMissingProp(e,r,s)),ln.reportMissingProp(e,s),t.else()}(),i.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${s.schemaEnv.baseId+s.errSchemaPath}" (strictRequired)`;fn.checkStrictMode(s,t,s.opts.strictRequired)}}function u(){t.forOf("prop",n,(r=>{e.setParams({missingProperty:r}),t.if(ln.noPropertyInData(t,o,r,i.ownProperties),(()=>e.error()))}))}}};un.default=hn;var mn={};const pn=$e,yn={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>pn.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>pn._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:n}=e,o="maxItems"===t?pn.operators.GT:pn.operators.LT;e.fail$data(pn._`${r}.length ${o} ${n}`)}};mn.default=yn;var vn={},gn={};const $n=st;$n.code='require("ajv/dist/runtime/equal").default',gn.default=$n;const bn=ke,wn=$e,_n=_e,En=gn,Nn={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>wn.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>wn._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:n,schema:o,parentSchema:a,schemaCode:s,it:i}=e;if(!n&&!o)return;const c=t.let("valid"),u=a.items?bn.getSchemaTypes(a.items):[];function l(n,o){const a=t.name("item"),s=bn.checkDataTypes(u,a,i.opts.strictNumbers,bn.DataType.Wrong),l=t.const("indices",wn._`{}`);t.for(wn._`;${n}--;`,(()=>{t.let(a,wn._`${r}[${n}]`),t.if(s,wn._`continue`),u.length>1&&t.if(wn._`typeof ${a} == "string"`,wn._`${a} += "_"`),t.if(wn._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(o,wn._`${l}[${a}]`),e.error(),t.assign(c,!1).break()})).code(wn._`${l}[${a}] = ${n}`)}))}function d(n,o){const a=_n.useFunc(t,En.default),s=t.name("outer");t.label(s).for(wn._`;${n}--;`,(()=>t.for(wn._`${o} = ${n}; ${o}--;`,(()=>t.if(wn._`${a}(${r}[${n}], ${r}[${o}])`,(()=>{e.error(),t.assign(c,!1).break(s)}))))))}e.block$data(c,(function(){const n=t.let("i",wn._`${r}.length`),o=t.let("j");e.setParams({i:n,j:o}),t.assign(c,!0),t.if(wn._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?l:d)(n,o)))}),wn._`${s} === false`),e.ok(c)}};vn.default=Nn;var Sn={};const Tn=$e,Pn=_e,On=gn,An={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>Tn._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n}=e;e.fail$data(Tn._`!${Pn.useFunc(t,On.default)}(${r}, ${n})`)}};Sn.default=An;var Cn={};const kn=$e,Dn=_e,In=gn,Rn={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>kn._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:n,schema:o,schemaCode:a,it:s}=e;if(!n&&0===o.length)throw new Error("enum must have non-empty array");const i=o.length>=s.opts.loopEnum,c=Dn.useFunc(t,In.default);let u;if(i||n)u=t.let("valid"),e.block$data(u,(function(){t.assign(u,!1),t.forOf("v",a,(e=>t.if(kn._`${c}(${r}, ${e})`,(()=>t.assign(u,!0).break()))))}));else{if(!Array.isArray(o))throw new Error("ajv implementation error");const e=t.const("vSchema",a);u=kn.or(...o.map(((t,n)=>function(e,t){const n=o[t];return n&&"object"==typeof n?kn._`${c}(${r}, ${e}[${t}])`:kn._`${r} === ${n}`}(e,n))))}e.pass(u)}};Cn.default=Rn;const xn=Br,jn=Gr,Un=tn,Mn=an,Vn=un,qn=mn,Fn=vn,zn=Sn,Ln=Cn,Kn=[Vr.default,xn.default,jn.default,Un.default,Mn.default,Vn.default,qn.default,Fn.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},zn.default,Ln.default];Mr.default=Kn;var Bn={},Jn={validateAdditionalItems:void 0};const Hn=$e,Gn=_e,Yn={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>Hn.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Hn._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?Xn(e,n):Gn.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function Xn(e,t){const{gen:r,schema:n,data:o,keyword:a,it:s}=e;s.items=!0;const i=r.const("len",Hn._`${o}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(Hn._`${i} <= ${t.length}`);else if("object"==typeof n&&!Gn.alwaysValidSchema(s,n)){const n=r.var("valid",Hn._`${i} <= ${t.length}`);r.if(Hn.not(n),(()=>function(n){r.forRange("i",t.length,i,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:Gn.Type.Num},n),s.allErrors||r.if(Hn.not(n),(()=>r.break()))}))}(n))),e.ok(n)}}Jn.validateAdditionalItems=Xn,Jn.default=Yn;var Wn={},Qn={validateTuple:void 0};const Zn=$e,eo=_e,to=ze,ro={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return no(e,"additionalItems",t);r.items=!0,eo.alwaysValidSchema(r,t)||e.ok(to.validateArray(e))}};function no(e,t,r=e.schema){const{gen:n,parentSchema:o,data:a,keyword:s,it:i}=e;!function(e){const{opts:n,errSchemaPath:o}=i,a=r.length,c=a===e.minItems&&(a===e.maxItems||!1===e[t]);if(n.strictTuples&&!c){const e=`"${s}" is ${a}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;eo.checkStrictMode(i,e,n.strictTuples)}}(o),i.opts.unevaluated&&r.length&&!0!==i.items&&(i.items=eo.mergeEvaluated.items(n,r.length,i.items));const c=n.name("valid"),u=n.const("len",Zn._`${a}.length`);r.forEach(((t,r)=>{eo.alwaysValidSchema(i,t)||(n.if(Zn._`${u} > ${r}`,(()=>e.subschema({keyword:s,schemaProp:r,dataProp:r},c))),e.ok(c))}))}Qn.validateTuple=no,Qn.default=ro;const oo=Qn,ao={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>oo.validateTuple(e,"items")};Wn.default=ao;var so={};const io=$e,co=_e,uo=ze,lo=Jn,fo={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>io.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>io._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,co.alwaysValidSchema(n,t)||(o?lo.validateAdditionalItems(e,o):e.ok(uo.validateArray(e)))}};so.default=fo;var ho={};const mo=$e,po=_e,yo={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?mo.str`must contain at least ${e} valid item(s)`:mo.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?mo._`{minContains: ${e}}`:mo._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:o,it:a}=e;let s,i;const{minContains:c,maxContains:u}=n;a.opts.next?(s=void 0===c?1:c,i=u):s=1;const l=t.const("len",mo._`${o}.length`);if(e.setParams({min:s,max:i}),void 0===i&&0===s)return void po.checkStrictMode(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==i&&s>i)return po.checkStrictMode(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if(po.alwaysValidSchema(a,r)){let t=mo._`${l} >= ${s}`;return void 0!==i&&(t=mo._`${t} && ${l} <= ${i}`),void e.pass(t)}a.items=!0;const d=t.name("valid");if(void 0===i&&1===s)f(d,(()=>t.if(d,(()=>t.break()))));else{t.let(d,!1);const e=t.name("_valid"),r=t.let("count",0);f(e,(()=>t.if(e,(()=>function(e){t.code(mo._`${e}++`),void 0===i?t.if(mo._`${e} >= ${s}`,(()=>t.assign(d,!0).break())):(t.if(mo._`${e} > ${i}`,(()=>t.assign(d,!1).break())),1===s?t.assign(d,!0):t.if(mo._`${e} >= ${s}`,(()=>t.assign(d,!0))))}(r)))))}function f(r,n){t.forRange("i",0,l,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:po.Type.Num,compositeRule:!0},r),n()}))}e.result(d,(()=>e.reset()))}};ho.default=yo;var vo={};!function(e){e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=$e,r=_e,n=ze;e.error={message:({params:{property:e,depsCount:r,deps:n}})=>t.str`must have ${1===r?"property":"properties"} ${n} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:n,missingProperty:o}})=>t._`{property: ${e},
6
- missingProperty: ${o},
7
- depsCount: ${r},
8
- deps: ${n}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:r)[n]=e[n]}return[t,r]}(e);a(e,t),s(e,r)}};function a(e,r=e.schema){const{gen:o,data:a,it:s}=e;if(0===Object.keys(r).length)return;const i=o.let("missing");for(const c in r){const u=r[c];if(0===u.length)continue;const l=n.propertyInData(o,a,c,s.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),s.allErrors?o.if(l,(()=>{for(const t of u)n.checkReportMissingProp(e,t)})):(o.if(t._`${l} && (${n.checkMissingProp(e,u,i)})`),n.reportMissingProp(e,i),o.else())}}function s(e,t=e.schema){const{gen:o,data:a,keyword:s,it:i}=e,c=o.name("valid");for(const u in t)r.alwaysValidSchema(i,t[u])||(o.if(n.propertyInData(o,a,u,i.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>o.var(c,!0))),e.ok(c))}e.validatePropertyDeps=a,e.validateSchemaDeps=s,e.default=o}(vo);var go={};const $o=$e,bo=_e,wo={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>$o._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:o}=e;if(bo.alwaysValidSchema(o,r))return;const a=t.name("valid");t.forIn("key",n,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if($o.not(a),(()=>{e.error(!0),o.allErrors||t.break()}))})),e.ok(a)}};go.default=wo;var _o={};const Eo=ze,No=$e,So=Ee,To=_e,Po={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>No._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:o,errsCount:a,it:s}=e;if(!a)throw new Error("ajv implementation error");const{allErrors:i,opts:c}=s;if(s.props=!0,"all"!==c.removeAdditional&&To.alwaysValidSchema(s,r))return;const u=Eo.allSchemaProperties(n.properties),l=Eo.allSchemaProperties(n.patternProperties);function d(e){t.code(No._`delete ${o}[${e}]`)}function f(n){if("all"===c.removeAdditional||c.removeAdditional&&!1===r)d(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(i||t.break());if("object"==typeof r&&!To.alwaysValidSchema(s,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if(No.not(r),(()=>{e.reset(),d(n)}))):(h(n,r),i||t.if(No.not(r),(()=>t.break())))}}}function h(t,r,n){const o={keyword:"additionalProperties",dataProp:t,dataPropType:To.Type.Str};!1===n&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,r)}t.forIn("key",o,(e=>{u.length||l.length?t.if(function(e){let r;if(u.length>8){const o=To.schemaRefOrVal(s,n.properties,"properties");r=Eo.isOwnProperty(t,o,e)}else r=u.length?No.or(...u.map((t=>No._`${e} === ${t}`))):No.nil;return l.length&&(r=No.or(r,...l.map((r=>No._`${Eo.usePattern(t,r)}.test(${e})`)))),No.not(r)}(e),(()=>f(e))):f(e)})),e.ok(No._`${a} === ${So.default.errors}`)}};_o.default=Po;var Oo={};const Ao=ye,Co=ze,ko=_e,Do=_o,Io={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:o,it:a}=e;"all"===a.opts.removeAdditional&&void 0===n.additionalProperties&&Do.default.code(new Ao.KeywordCxt(a,Do.default,"additionalProperties"));const s=Co.allSchemaProperties(r);for(const e of s)a.definedProperties.add(e);a.opts.unevaluated&&s.length&&!0!==a.props&&(a.props=ko.mergeEvaluated.props(t,ko.toHash(s),a.props));const i=s.filter((e=>!ko.alwaysValidSchema(a,r[e])));if(0===i.length)return;const c=t.name("valid");for(const r of i)u(r)?l(r):(t.if(Co.propertyInData(t,o,r,a.opts.ownProperties)),l(r),a.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(c);function u(e){return a.opts.useDefaults&&!a.compositeRule&&void 0!==r[e].default}function l(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};Oo.default=Io;var Ro={};const xo=ze,jo=$e,Uo=_e,Mo=_e,Vo={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:o,it:a}=e,{opts:s}=a,i=xo.schemaProperties(a,r);if(0===i.length)return;const c=s.strictSchema&&!s.allowMatchingProperties&&o.properties,u=t.name("valid");!0===a.props||a.props instanceof jo.Name||(a.props=Mo.evaluatedPropsToName(t,a.props));const{props:l}=a;function d(e){for(const t in c)new RegExp(e).test(t)&&Uo.checkStrictMode(a,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function f(r){t.forIn("key",n,(n=>{t.if(jo._`${xo.usePattern(t,r)}.test(${n})`,(()=>{e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:Mo.Type.Str},u),a.opts.unevaluated&&!0!==l?t.assign(jo._`${l}[${n}]`,!0):a.allErrors||t.if(jo.not(u),(()=>t.break()))}))}))}!function(){for(const e of i)c&&d(e),a.allErrors?f(e):(t.var(u,!0),f(e),t.if(u))}()}};Ro.default=Vo;var qo={};const Fo=_e,zo={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if(Fo.alwaysValidSchema(n,r))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.result(o,(()=>e.error()),(()=>e.reset()))},error:{message:"must NOT be valid"}};qo.default=zo;var Lo={};const Ko={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ze.validateUnion,error:{message:"must match a schema in anyOf"}};Lo.default=Ko;var Bo={};const Jo=$e,Ho=_e,Go={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>Jo._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;const a=r,s=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block((function(){a.forEach(((r,n)=>{let a;Ho.alwaysValidSchema(o,r)?t.var(c,!0):a=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(Jo._`${c} && ${s}`).assign(s,!1).assign(i,Jo._`[${i}, ${n}]`).else(),t.if(c,(()=>{t.assign(s,!0),t.assign(i,n),a&&e.mergeEvaluated(a,Jo.Name)}))}))})),e.result(s,(()=>e.reset()),(()=>e.error(!0)))}};Bo.default=Go;var Yo={};const Xo=_e,Wo={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const o=t.name("valid");r.forEach(((t,r)=>{if(Xo.alwaysValidSchema(n,t))return;const a=e.subschema({keyword:"allOf",schemaProp:r},o);e.ok(o),e.mergeEvaluated(a)}))}};Yo.default=Wo;var Qo={};const Zo=$e,ea=_e,ta={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>Zo.str`must match "${e.ifClause}" schema`,params:({params:e})=>Zo._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&ea.checkStrictMode(n,'"if" without "then" and "else" is ignored');const o=ra(n,"then"),a=ra(n,"else");if(!o&&!a)return;const s=t.let("valid",!0),i=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(t)}(),e.reset(),o&&a){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(i,c("then",r),c("else",r))}else o?t.if(i,c("then")):t.if(Zo.not(i),c("else"));function c(r,n){return()=>{const o=e.subschema({keyword:r},i);t.assign(s,i),e.mergeValidEvaluated(o,s),n?t.assign(n,Zo._`${r}`):e.setParams({ifClause:r})}}e.pass(s,(()=>e.error(!0)))}};function ra(e,t){const r=e.schema[t];return void 0!==r&&!ea.alwaysValidSchema(e,r)}Qo.default=ta;var na={};const oa=_e,aa={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&oa.checkStrictMode(r,`"${e}" without "if" is ignored`)}};na.default=aa;const sa=Jn,ia=Wn,ca=Qn,ua=so,la=ho,da=vo,fa=go,ha=_o,ma=Oo,pa=Ro,ya=qo,va=Lo,ga=Bo,$a=Yo,ba=Qo,wa=na;Bn.default=function(e=!1){const t=[ya.default,va.default,ga.default,$a.default,ba.default,wa.default,fa.default,ha.default,da.default,ma.default,pa.default];return e?t.push(ia.default,ua.default):t.push(sa.default,ca.default),t.push(la.default),t};var _a={},Ea={};const Na=$e,Sa={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Na.str`must match format "${e}"`,params:({schemaCode:e})=>Na._`{format: ${e}}`},code(e,t){const{gen:r,data:n,$data:o,schema:a,schemaCode:s,it:i}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=i;c.validateFormats&&(o?function(){const o=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),a=r.const("fDef",Na._`${o}[${s}]`),i=r.let("fType"),u=r.let("format");r.if(Na._`typeof ${a} == "object" && !(${a} instanceof RegExp)`,(()=>r.assign(i,Na._`${a}.type || "string"`).assign(u,Na._`${a}.validate`)),(()=>r.assign(i,Na._`"string"`).assign(u,a))),e.fail$data(Na.or(!1===c.strictSchema?Na.nil:Na._`${s} && !${u}`,function(){const e=l.$async?Na._`(${a}.async ? await ${u}(${n}) : ${u}(${n}))`:Na._`${u}(${n})`,r=Na._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return Na._`${u} && ${u} !== true && ${i} === ${t} && !${r}`}()))}():function(){const o=d.formats[a];if(!o)return void function(){if(!1===c.strictSchema)return void d.logger.warn(e());throw new Error(e());function e(){return`unknown format "${a}" ignored in schema at path "${u}"`}}();if(!0===o)return;const[s,i,f]=function(e){const t=e instanceof RegExp?Na.regexpCode(e):c.code.formats?Na._`${c.code.formats}${Na.getProperty(a)}`:void 0,n=r.scopeValue("formats",{key:a,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,Na._`${n}.validate`];return["string",e,n]}(o);s===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!l.$async)throw new Error("async format in sync schema");return Na._`await ${f}(${n})`}return"function"==typeof i?Na._`${f}(${n})`:Na._`${f}.test(${n})`}())}())}};Ea.default=Sa;const Ta=[Ea.default];_a.default=Ta;var Pa={};Pa.contentVocabulary=Pa.metadataVocabulary=void 0,Pa.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Pa.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];const Oa=Mr,Aa=Bn,Ca=_a,ka=Pa,Da=[Er.default,Oa.default,Aa.default(),Ca.default,ka.metadataVocabulary,ka.contentVocabulary];_r.default=Da;var Ia={},Ra={};!function(e){var t;e.DiscrError=void 0,(t=e.DiscrError||(e.DiscrError={})).Tag="tag",t.Mapping="mapping"}(Ra);const xa=$e,ja=Ra,Ua={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===ja.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>xa._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:n,parentSchema:o,it:a}=e,{oneOf:s}=o;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const i=n.propertyName;if("string"!=typeof i)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",xa._`${r}${xa.getProperty(i)}`);function l(r){const n=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(o,xa.Name),n}t.if(xa._`typeof ${u} == "string"`,(()=>function(){const r=function(){var e;const t={},r=a(o);let n=!0;for(let t=0;t<s.length;t++){const o=s[t],u=null===(e=o.properties)||void 0===e?void 0:e[i];if("object"!=typeof u)throw new Error(`discriminator: oneOf schemas must have "properties/${i}"`);n=n&&(r||a(o)),c(u,t)}if(!n)throw new Error(`discriminator: "${i}" must be required`);return t;function a({required:e}){return Array.isArray(e)&&e.includes(i)}function c(e,t){if(e.const)u(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${i}" must have "const" or "enum"`);for(const r of e.enum)u(r,t)}}function u(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${i}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(xa._`${u} === ${e}`),t.assign(c,l(r[e]));t.else(),e.error(!1,{discrError:ja.DiscrError.Mapping,tag:u,tagName:i}),t.endIf()}()),(()=>e.error(!1,{discrError:ja.DiscrError.Tag,tag:u,tagName:i}))),e.ok(c)}};Ia.default=Ua;var Ma={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};!function(e,t){t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=pe,n=_r,o=Ia,a=Ma,s=["/properties"],i="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(a,s):a;this.addMetaSchema(e,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}e.exports=t=c,t.default=c;var u=ye;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=$e;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}})}(me,me.exports),he.isntJsonRpcError=he.isJsonRpcError=he.isntJsonRpcSuccess=he.isJsonRpcSuccess=he.isntJsonRpcRequest=he.isJsonRpcRequest=he.isntJsonRpcNotification=he.isJsonRpcNotification=void 0;const Va=me.exports,qa={oneOf:[{type:"string"},{type:"number"}]},Fa={oneOf:[{type:"array"},{type:"object"}]},za={type:"object",properties:{jsonrpc:{type:"string"},method:{type:"string"},params:Fa,id:!1},required:["jsonrpc","method"]},La={type:"object",properties:{jsonrpc:{type:"string"},id:qa,method:{type:"string"},params:Fa},required:["jsonrpc","id","method"]},Ka={type:"object",properties:{jsonrpc:{type:"string"},id:qa,result:{}},required:["jsonrpc","id","result"]},Ba={type:"object",properties:{jsonrpc:{type:"string"},id:qa,error:{type:"object",properties:{code:{type:"number"},message:{type:"string"},data:{}},required:["code","message"]}},required:["jsonrpc","id","error"]};let Ja;function Ha(e){return Ja||(Ja=new Va.default),Ja.validate(za,e)}function Ga(e){return Ja||(Ja=new Va.default),Ja.validate(La,e)}function Ya(e){return Ja||(Ja=new Va.default),Ja.validate(Ka,e)}function Xa(e){return Ja||(Ja=new Va.default),Ja.validate(Ba,e)}he.isJsonRpcNotification=Ha,he.isntJsonRpcNotification=function(e){return!Ha(e)},he.isJsonRpcRequest=Ga,he.isntJsonRpcRequest=function(e){return!Ga(e)},he.isJsonRpcSuccess=Ya,he.isntJsonRpcSuccess=function(e){return!Ya(e)},he.isJsonRpcError=Xa,he.isntJsonRpcError=function(e){return!Xa(e)};var Wa={};Wa.isntJson=Wa.isJson=void 0,Wa.isJson=function(e){try{return JSON.stringify(e),!0}catch(e){return!1}},Wa.isntJson=function e(t){return!e()};var Qa={};function Za(e){return"number"==typeof e}Qa.isntNumber=Qa.isNumber=void 0,Qa.isNumber=Za,Qa.isntNumber=function(e){return!Za(e)};var es={};function ts(e){return null!==e&&"object"==typeof e}es.isntObject=es.isObject=void 0,es.isObject=ts,es.isntObject=function(e){return!ts(e)};var rs={};rs.isAbsoluteURL=void 0,rs.isAbsoluteURL=function(e){try{return new URL(e),!0}catch(e){return!1}},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(M,t),n(J,t),n(G,t),n(ne,t),n(ae,t),n(ie,t),n(ue,t),n(he,t),n(Wa,t),n(V,t),n(Qa,t),n(es,t),n(Y,t),n(F,t),n(rs,t)}(U),j.chunkByAsync=void 0;const ns=U;j.chunkByAsync=function(e,t){return ns.isAsyncIterable(e)?async function*(e){let r=[],n=0;for await(const o of e)r.push(o),await t(o,n)&&(yield r,r=[]),n++;r.length&&(yield r)}(e):async function*(e){let r=[],n=0;for(const o of e)r.push(o),await t(o,n)&&(yield r,r=[]),n++;r.length&&(yield r)}(e)};var os={};os.chunkBy=void 0,os.chunkBy=function*(e,t){let r=[],n=0;for(const o of e)r.push(o),t(o,n)&&(yield r,r=[]),n++;r.length&&(yield r)};var as={chunk:void 0};const ss=g,is=b;as.chunk=function(e,t){return is.assert(Number.isInteger(t),"The parameter size must be an integer"),is.assert(t>0,"The parameter size must be greater than 0"),ss.go((function*(){let r=[];for(const n of e)r.push(n),r.length>=t&&(yield r,r=[]);r.length&&(yield r)}))};var cs={concatAsync:void 0};const us=U,ls=g;cs.concatAsync=function(e,...t){return ls.go((async function*(){for(const r of[e,...t])if(us.isAsyncIterable(r))for await(const e of r)yield e;else for(const e of r)yield e}))};var ds={concat:void 0};const fs=g;ds.concat=function(e,...t){return fs.go((function*(){for(const r of[e,...t])yield*r}))};var hs={},ms={};ms.copyIterable=ms.copyAsyncIterable=void 0,ms.copyAsyncIterable=async function*(e){for await(const t of e)yield t},ms.copyIterable=function*(e){for(const t of e)yield t},hs.dropAsync=void 0;const ps=g,ys=ms,vs=b;hs.dropAsync=function(e,t){return vs.assert(Number.isInteger(t),"The parameter count must be an integer"),vs.assert(t>=0,"The parameter count must be greater than or equal to 0"),0===t?ys.copyAsyncIterable(e):ps.go((async function*(){const r=e[Symbol.asyncIterator]();let n;for(;!(n=await r.next(),n.done||t<=0);)t--;for(;!n.done;)yield n.value,n=await r.next()}))};var gs={dropRightAsync:void 0};const $s=g,bs=ms,ws=b;gs.dropRightAsync=function(e,t){return ws.assert(Number.isInteger(t),"The parameter count must be an integer"),ws.assert(t>=0,"The parameter count must be greater than or equal to 0"),0===t?bs.copyAsyncIterable(e):$s.go((async function*(){const r=(await async function(e){const t=[];for await(const r of e)t.push(r);return t}(e)).slice(0,-t);for(const e of r)yield e}))};var _s={dropRight:void 0};const Es=g,Ns=ms,Ss=b;_s.dropRight=function(e,t){return Ss.assert(Number.isInteger(t),"The parameter count must be an integer"),Ss.assert(t>=0,"The parameter count must be greater than or equal to 0"),0===t?Ns.copyIterable(e):Es.go((function*(){const r=Array.from(e);yield*r.slice(0,-t)}))};var Ts={dropUntilAsync:void 0};const Ps=U;Ts.dropUntilAsync=function(e,t){return Ps.isAsyncIterable(e)?async function*(e){const r=e[Symbol.asyncIterator]();let n,o=0;for(;!(n=await r.next(),n.done||await t(n.value,o++)););for(;!n.done;)yield n.value,n=await r.next()}(e):async function*(e){const r=e[Symbol.iterator]();let n,o=0;for(;!(n=r.next(),n.done||await t(n.value,o++)););for(;!n.done;)yield n.value,n=r.next()}(e)};var Os={};Os.dropUntil=void 0,Os.dropUntil=function*(e,t){const r=e[Symbol.iterator]();let n,o=0;for(;!(n=r.next(),n.done||t(n.value,o++)););for(;!n.done;)yield n.value,n=r.next()};var As={drop:void 0};const Cs=g,ks=ms,Ds=b;As.drop=function(e,t){return Ds.assert(Number.isInteger(t),"The parameter count must be an integer"),Ds.assert(t>=0,"The parameter count must be greater than or equal to 0"),0===t?ks.copyIterable(e):Cs.go((function*(){const r=e[Symbol.iterator]();let n;for(;!(n=r.next(),n.done||t<=0);)t--;for(;!n.done;)yield n.value,n=r.next()}))};var Is={filterAsync:void 0};const Rs=U;Is.filterAsync=function(e,t){return Rs.isAsyncIterable(e)?async function*(e){let r=0;for await(const n of e)await t(n,r)&&(yield n),r++}(e):async function*(e){let r=0;for(const n of e)await t(n,r)&&(yield n),r++}(e)};var xs={};xs.filter=void 0,xs.filter=function*(e,t){let r=0;for(const n of e)t(n,r)&&(yield n),r++};var js={},Us={},Ms={flattenByAsync:void 0};const Vs=U;function qs(e){return Vs.isIterable(e)&&Vs.isntChar(e)}Ms.flattenByAsync=function(e,t){return Vs.isAsyncIterable(e)?async function*(e){const n=1;for await(const o of e)qs(o)&&await t(o,n)?yield*r(o,n+1):yield o}(e):function(e){return r(e,1)}(e);async function*r(e,n){for(const o of e)qs(o)&&await t(o,n)?yield*r(o,n+1):yield o}},Us.flattenDeepAsync=void 0;const Fs=Ms,zs=b;Us.flattenDeepAsync=function(e,t=1/0){return zs.assert(t===1/0||Number.isInteger(t),"The parameter depth must be an integer"),zs.assert(t>=0,"The parameter depth must be greater than or equal to 0"),Fs.flattenByAsync(e,((e,r)=>r<=t))},js.flattenAsync=void 0;const Ls=Us;js.flattenAsync=function(e){return Ls.flattenDeepAsync(e,1)};var Ks={flattenBy:void 0};const Bs=U;Ks.flattenBy=function(e,t){return function*e(r,n){for(const a of r)o=a,Bs.isIterable(o)&&Bs.isntChar(o)&&t(a,n)?yield*e(a,n+1):yield a;var o}(e,1)};var Js={flattenDeep:void 0};const Hs=Ks,Gs=b;Js.flattenDeep=function(e,t=1/0){return Gs.assert(t===1/0||Number.isInteger(t),"The parameter depth must be an integer"),Gs.assert(t>=0,"The parameter depth must be greater than or equal to 0"),Hs.flattenBy(e,((e,r)=>r<=t))};var Ys={flatten:void 0};const Xs=Js;Ys.flatten=function(e){return Xs.flattenDeep(e,1)};var Ws={mapAsync:void 0};const Qs=U;Ws.mapAsync=function(e,t){return Qs.isAsyncIterable(e)?async function*(e){let r=0;for await(const n of e)yield await t(n,r),r++}(e):async function*(e){let r=0;for(const n of e)yield await t(n,r),r++}(e)};var Zs={};Zs.map=void 0,Zs.map=function*(e,t){let r=0;for(const n of e)yield t(n,r),r++};var ei={repeatAsync:void 0};const ti=g,ri=b;ei.repeatAsync=function(e,t){return ri.assert(t===1/0||Number.isInteger(t),"The parameter times must be an integer"),ri.assert(t>=0,"The parameter times must be greater than or equal to 0"),t===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),ti.go((async function*(){const r=[];if(t>0){for await(const t of e)yield t,r.push(t);t--}for(;t>0;)yield*r,t--}))};var ni={repeat:void 0};const oi=g,ai=b;ni.repeat=function(e,t){return ai.assert(t===1/0||Number.isInteger(t),"The parameter times must be an integer"),ai.assert(t>=0,"The parameter times must be greater than or equal to 0"),t===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),oi.go((function*(){const r=[];if(t>0){for(const t of e)yield t,r.push(t);t--}for(;t>0;)yield*r,t--}))};var si={sliceAsync:void 0};const ii=g,ci=b;si.sliceAsync=function(e,t,r=1/0){return ci.assert(Number.isInteger(t),"The parameter start must be an integer"),ci.assert(t>=0,"The parameter start must be greater than or equal to 0"),ci.assert(Number.isInteger(r),"The parameter end must be an integer"),ci.assert(r>=t,"The parameter end must be greater than or equal to start"),ii.go((async function*(){let n=0;for await(const o of e){if(n>=r)break;n>=t&&(yield o),n++}}))};var ui={slice:void 0};const li=g,di=b;ui.slice=function(e,t,r=1/0){return di.assert(Number.isInteger(t),"The parameter start must be an integer"),di.assert(t>=0,"The parameter start must be greater than or equal to 0"),di.assert(Number.isInteger(r),"The parameter end must be an integer"),di.assert(r>=t,"The parameter end must be greater than or equal to start"),li.go((function*(){let n=0;for(const o of e){if(n>=r)break;n>=t&&(yield o),n++}}))};var fi={};fi.splitAsync=void 0,fi.splitAsync=async function*(e,t){let r=[];for await(const n of e)n===t?(yield r,r=[]):r.push(n);yield r};var hi={splitByAsync:void 0};const mi=U;hi.splitByAsync=function(e,t){return mi.isAsyncIterable(e)?async function*(e){let r=[],n=0;for await(const o of e)await t(o,n)?(yield r,r=[]):r.push(o),n++;yield r}(e):async function*(e){let r=[],n=0;for(const o of e)await t(o,n)?(yield r,r=[]):r.push(o),n++;yield r}(e)};var pi={};pi.splitBy=void 0,pi.splitBy=function*(e,t){let r=[],n=0;for(const o of e)t(o,n)?(yield r,r=[]):r.push(o),n++;yield r};var yi={};yi.split=void 0,yi.split=function*(e,t){let r=[];for(const n of e)n===t?(yield r,r=[]):r.push(n);yield r};var vi={takeAsync:void 0};const gi=g,$i=b;vi.takeAsync=function(e,t){return $i.assert(Number.isInteger(t),"The parameter count must be an integer"),$i.assert(t>=0,"The parameter count must be greater than or equal to 0"),gi.go((async function*(){if(0!==t)for await(const r of e)if(yield r,0===--t)break}))};var bi={takeRightAsync:void 0};const wi=g,_i=b;bi.takeRightAsync=function(e,t){return _i.assert(Number.isInteger(t),"The parameter count must be an integer"),_i.assert(t>=0,"The parameter count must be greater than or equal to 0"),wi.go((async function*(){const r=e[Symbol.asyncIterator](),n=[];let o;for(;o=await r.next(),!o.done;)n.push(o.value),n.length>t&&n.shift();yield*n}))};var Ei={takeRight:void 0};const Ni=g,Si=b;Ei.takeRight=function(e,t){return Si.assert(Number.isInteger(t),"The parameter count must be an integer"),Si.assert(t>=0,"The parameter count must be greater than or equal to 0"),Ni.go((function*(){const r=e[Symbol.iterator](),n=[];let o;for(;o=r.next(),!o.done;)n.push(o.value),n.length>t&&n.shift();yield*n}))};var Ti={takeUntilAsync:void 0};const Pi=U;Ti.takeUntilAsync=function(e,t){return Pi.isAsyncIterable(e)?async function*(e){let r=0;for await(const n of e){if(await t(n,r))break;yield n,r++}}(e):async function*(e){let r=0;for(const n of e){if(await t(n,r))break;yield n,r++}}(e)};var Oi={};Oi.takeUntil=void 0,Oi.takeUntil=function*(e,t){let r=0;for(const n of e){if(t(n,r))break;yield n,r++}};var Ai={take:void 0};const Ci=g,ki=b;Ai.take=function(e,t){return ki.assert(Number.isInteger(t),"The parameter count must be an integer"),ki.assert(t>=0,"The parameter count must be greater than or equal to 0"),Ci.go((function*(){if(0!==t)for(const r of e)if(yield r,0===--t)break}))};var Di={tapAsync:void 0};const Ii=U;Di.tapAsync=function(e,t){return Ii.isAsyncIterable(e)?async function*(e){let r=0;for await(const n of e)await t(n,r),yield n,r++}(e):async function*(e){let r=0;for(const n of e)await t(n,r),yield n,r++}(e)};var Ri={};Ri.tap=void 0,Ri.tap=function*(e,t){let r=0;for(const n of e)t(n,r),yield n,r++};var xi={};xi.toAsyncIterable=void 0,xi.toAsyncIterable=async function*(e){for(const t of e)yield t};var ji={};ji.transformAsync=void 0,ji.transformAsync=async function*(e,t){yield*t(e)};var Ui={};Ui.transform=void 0,Ui.transform=function*(e,t){yield*t(e)};var Mi={};Mi.uniqAsync=void 0,Mi.uniqAsync=async function*(e){const t=new Set;for await(const r of e)t.has(r)||(yield r,t.add(r))};var Vi={uniqByAsync:void 0};const qi=U;Vi.uniqByAsync=function(e,t){return qi.isAsyncIterable(e)?async function*(e){const r=new Set;let n=0;for await(const o of e){const e=await t(o,n);r.has(e)||(yield o,r.add(e)),n++}}(e):async function*(e){const r=new Set;let n=0;for(const o of e){const e=await t(o,n);r.has(e)||(yield o,r.add(e)),n++}}(e)};var Fi={};Fi.uniqBy=void 0,Fi.uniqBy=function*(e,t){const r=new Set;let n=0;for(const o of e){const e=t(o,n);r.has(e)||(yield o,r.add(e)),n++}};var zi={};zi.uniq=void 0,zi.uniq=function*(e){const t=new Set;for(const r of e)t.has(r)||(yield r,t.add(r))};var Li={zipAsync:void 0};const Ki=U;Li.zipAsync=function(e,...t){return async function*(...e){const t=e.length,r=e.map((e=>Ki.isAsyncIterable(e)?[Symbol.asyncIterator,e[Symbol.asyncIterator]()]:[Symbol.iterator,e[Symbol.iterator]()]));for(;;){const e=new Array(t);for(let n=0;n<t;n++){const[t,o]=r[n];let a;if(a=t===Symbol.asyncIterator?await o.next():o.next(),a.done)return;e[n]=a.value}yield e}}(e,...t)};var Bi={};Bi.zip=void 0,Bi.zip=function(e,...t){return function*(...e){const t=e.length,r=e.map((e=>e[Symbol.iterator]()));for(;;){const e=new Array(t);for(let n=0;n<t;n++){const{value:t,done:o}=r[n].next();if(o)return;e[n]=t}yield e}}(e,...t)},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(v,t),n(j,t),n(os,t),n(as,t),n(cs,t),n(ds,t),n(hs,t),n(gs,t),n(_s,t),n(Ts,t),n(Os,t),n(As,t),n(Is,t),n(xs,t),n(js,t),n(Ms,t),n(Ks,t),n(Us,t),n(Js,t),n(Ys,t),n(Ws,t),n(Zs,t),n(ei,t),n(ni,t),n(si,t),n(ui,t),n(fi,t),n(hi,t),n(pi,t),n(yi,t),n(vi,t),n(bi,t),n(Ei,t),n(Ti,t),n(Oi,t),n(Ai,t),n(Di,t),n(Ri,t),n(xi,t),n(ji,t),n(Ui,t),n(Mi,t),n(Vi,t),n(Fi,t),n(zi,t),n(Li,t),n(Bi,t)}(y);var Ji={},Hi={};Hi.consume=void 0,Hi.consume=function(e,t){return t(e)};var Gi={eachAsync:void 0};const Yi=U;Gi.eachAsync=function(e,t){return Yi.isAsyncIterable(e)?async function(e){let r=0;for await(const n of e)await t(n,r),r++}(e):async function(e){let r=0;for(const n of e)await t(n,r),r++}(e)};var Xi={};Xi.each=void 0,Xi.each=function(e,t){let r=0;for(const n of e)t(n,r),r++};var Wi={everyAsync:void 0};const Qi=U;Wi.everyAsync=function(e,t){return Qi.isAsyncIterable(e)?async function(e){let r=0;for await(const n of e){if(!await t(n,r))return!1;r++}return!0}(e):async function(e){let r=0;for(const n of e){if(!await t(n,r))return!1;r++}return!0}(e)};var Zi={};Zi.every=void 0,Zi.every=function(e,t){let r=0;for(const n of e){if(!t(n,r))return!1;r++}return!0};var ec={findAsync:void 0};const tc=U;ec.findAsync=function(e,t){return tc.isAsyncIterable(e)?async function(e){let r=0;for await(const n of e){if(await t(n,r))return n;r++}return}(e):async function(e){let r=0;for(const n of e){if(await t(n,r))return n;r++}return}(e)};var rc={};rc.find=void 0,rc.find=function(e,t){let r=0;for(const n of e){if(t(n,r))return n;r++}};var nc={};nc.firstAsync=void 0,nc.firstAsync=async function(e){for await(const t of e)return t};var oc={};oc.first=void 0,oc.first=function(e){for(const t of e)return t};var ac={};ac.includesAsync=void 0,ac.includesAsync=async function(e,t){for await(const r of e)if(r===t)return!0;return!1};var sc={};sc.includes=void 0,sc.includes=function(e,t){for(const r of e)if(r===t)return!0;return!1};var ic={};ic.matchAsync=void 0,ic.matchAsync=async function(e,t){const r=t.length;let n=0;for await(const o of e)if(o===t[n]&&n++,n===r)return!0;return!1};var cc={};cc.match=void 0,cc.match=function(e,t){const r=t.length;let n=0;for(const o of e)if(o===t[n]&&n++,n===r)return!0;return!1};var uc={reduceAsync:void 0};const lc=U;uc.reduceAsync=function(e,t,r){return lc.isUndefined(r)?function(e,t){return lc.isAsyncIterable(e)?r(e):n(e);async function r(e){const[r,n]=await s(e);let o=r,a=1;for(;;){const e=await n.next();if(e.done)break;const r=e.value;o=await t(o,r,a++)}return o;async function s(e){const t=e[Symbol.asyncIterator](),r=await t.next();if(r.done)throw new Error("Reduce of empty iterable with no initial value");return[r.value,t]}}async function n(e){const[r,n]=s(e);let o=r,a=1;for(;;){const e=n.next();if(e.done)break;const r=e.value;o=await t(o,r,a++)}return o;function s(e){const t=e[Symbol.iterator](),r=t.next();if(r.done)throw new Error("Reduce of empty iterable with no initial value");return[r.value,t]}}}(e,t):function(e,t,r){return lc.isAsyncIterable(e)?o(e):n(e);async function n(e){let n=r,o=0;for(const r of e)n=await t(n,r,o++);return n}async function o(e){let n=r,o=0;for await(const r of e)n=await t(n,r,o++);return n}}(e,t,r)};var dc={reduce:void 0};const fc=U;dc.reduce=function(e,t,r){return fc.isUndefined(r)?function(e,t){const[r,n]=s(e);let o=r,a=1;for(;;){const e=n.next();if(e.done)break;o=t(o,e.value,a++)}return o;function s(e){const t=e[Symbol.iterator](),r=t.next();if(r.done)throw new Error("Reduce of empty iterable with no initial value");return[r.value,t]}}(e,t):function(e,t,r){let n=r,o=0;for(const r of e)n=t(n,r,o++);return n}(e,t,r)};var hc={someAsync:void 0};const mc=U;hc.someAsync=function(e,t){return mc.isAsyncIterable(e)?async function(e){let r=0;for await(const n of e){if(await t(n,r))return!0;r++}return!1}(e):async function(e){let r=0;for(const n of e){if(await t(n,r))return!0;r++}return!1}(e)};var pc={};pc.some=void 0,pc.some=function(e,t){let r=0;for(const n of e){if(t(n,r))return!0;r++}return!1};var yc={};yc.lastAsync=void 0,yc.lastAsync=async function(e){const t=e[Symbol.asyncIterator]();let{value:r,done:n}=await t.next();if(n)return;let o=r;for(;({value:r,done:n}=await t.next()),!n;)o=r;return o};var vc={};vc.last=void 0,vc.last=function(e){const t=e[Symbol.iterator]();let{value:r,done:n}=t.next();if(n)return;let o=r;for(;({value:r,done:n}=t.next()),!n;)o=r;return o};var gc={toArrayAsync:void 0};const $c=Hi;gc.toArrayAsync=function(e){return $c.consume(e,(async e=>{const t=[];for await(const r of e)t.push(r);return t}))};var bc={toArray:void 0};const wc=Hi;bc.toArray=function(e){return wc.consume(e,(e=>Array.from(e)))};var _c={toSetAsync:void 0};const Ec=Hi;_c.toSetAsync=function(e){return Ec.consume(e,(async e=>{const t=new Set;for await(const r of e)t.add(r);return t}))};var Nc={toSet:void 0};const Sc=Hi;Nc.toSet=function(e){return Sc.consume(e,(e=>new Set(e)))},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(Hi,t),n(Gi,t),n(Xi,t),n(Wi,t),n(Zi,t),n(ec,t),n(rc,t),n(nc,t),n(oc,t),n(ac,t),n(sc,t),n(ic,t),n(cc,t),n(uc,t),n(dc,t),n(hc,t),n(pc,t),n(yc,t),n(vc,t),n(gc,t),n(bc,t),n(_c,t),n(Nc,t)}(Ji),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(y,t),n(Ji,t)}(p),m.unwrap=void 0;const Tc=r,Pc=p;m.unwrap=function e(t,r){return Tc.flatMap(t,(t=>r(t)?Pc.toArray(Pc.flatten(Pc.map(t.childNodes,(t=>e(t,r))))):[t]))};var Oc={},Ac={},Cc={};Cc.traverseDescendantNodes=void 0,Cc.traverseDescendantNodes=function*e(t){for(const r of t.childNodes)yield r,yield*e(r)},Ac.findInDescendantNodes=void 0;const kc=Cc,Dc=p;Ac.findInDescendantNodes=function(e,t){return Dc.find(kc.traverseDescendantNodes(e),(e=>t(e)))},Oc.find=void 0;const Ic=Ac;Oc.find=function(e,t){return t(e)?e:Ic.findInDescendantNodes(e,t)};var Rc={};Rc.parse=void 0,Rc.parse=function(e){const t=document.createElement("div");return t.innerHTML=e,[...t.childNodes]};var xc={};xc.stringify=void 0,xc.stringify=function(e){const t=document.createElement("div");return e.forEach((e=>t.append(e.cloneNode(!0)))),t.innerHTML};var jc={normalize:void 0};const Uc=Rc,Mc=xc;jc.normalize=function(e){return Mc.stringify(Uc.parse(e))};var Vc={};Vc.removeAttributes=void 0,Vc.removeAttributes=function(e,t){if(e instanceof Element){const r=Array.from(e.attributes).map((e=>e.name));for(const n of r)t(n)&&e.removeAttribute(n)}};var qc={},Fc={},zc={};!function(e){e.NodeType=void 0;const t="Node"in globalThis;var r;(r=e.NodeType||(e.NodeType={}))[r.ELEMENT_NODE=t?globalThis.Node.ELEMENT_NODE:1]="ELEMENT_NODE",r[r.ATTRIBUTE_NODE=t?globalThis.Node.ATTRIBUTE_NODE:2]="ATTRIBUTE_NODE",r[r.TEXT_NODE=t?globalThis.Node.TEXT_NODE:3]="TEXT_NODE",r[r.CDATA_SECTION_NODE=t?globalThis.Node.CDATA_SECTION_NODE:4]="CDATA_SECTION_NODE",r[r.ENTITY_REFERENCE_NODE=t?globalThis.Node.ENTITY_REFERENCE_NODE:5]="ENTITY_REFERENCE_NODE",r[r.ENTITY_NODE=t?globalThis.Node.ENTITY_NODE:6]="ENTITY_NODE",r[r.PROCESSING_INSTRUCTION_NODE=t?globalThis.Node.PROCESSING_INSTRUCTION_NODE:7]="PROCESSING_INSTRUCTION_NODE",r[r.COMMENT_NODE=t?globalThis.Node.COMMENT_NODE:8]="COMMENT_NODE",r[r.DOCUMENT_NODE=t?globalThis.Node.DOCUMENT_NODE:9]="DOCUMENT_NODE",r[r.DOCUMENT_TYPE_NODE=t?globalThis.Node.DOCUMENT_TYPE_NODE:10]="DOCUMENT_TYPE_NODE",r[r.DOCUMENT_FRAGMENT_NODE=t?globalThis.Node.DOCUMENT_FRAGMENT_NODE:11]="DOCUMENT_FRAGMENT_NODE",r[r.NOTATION_NODE=t?globalThis.Node.NOTATION_NODE:12]="NOTATION_NODE"}(zc),Fc.isDocument=void 0;const Lc=zc,Kc=U;Fc.isDocument=function(e){return"HTMLDocument"in globalThis&&e instanceof HTMLDocument||Kc.isObject(e)&&e.nodeType===Lc.NodeType.DOCUMENT_NODE};var Bc={isElement:void 0};const Jc=zc,Hc=U;Bc.isElement=function(e){return"HTMLElement"in globalThis&&e instanceof HTMLElement||Hc.isObject(e)&&e.nodeType===Jc.NodeType.ELEMENT_NODE},qc.getBySelector=void 0;const Gc=Fc,Yc=Bc;qc.getBySelector=function(e){const t=(Yc.isElement(this)||Gc.isDocument(this)?this:document).querySelector(e);if(t)return t;throw new Error(`Could not find any elements matching ${e}`)};var Xc={getAllBySelector:void 0};const Wc=Fc,Qc=Bc;Xc.getAllBySelector=function(e){const t=(Qc.isElement(this)||Wc.isDocument(this)?this:document).querySelectorAll(e);if(t.length)return Array.from(t);throw new Error(`Could not find any elements matching ${e}`)};var Zc={};Zc.traverseAncestorNodes=void 0,Zc.traverseAncestorNodes=function*e(t){const r=t.parentNode;r&&(yield r,yield*e(r))};var eu={findInAncestorNodes:void 0};const tu=Zc,ru=p;eu.findInAncestorNodes=function(e,t){return ru.find(tu.traverseAncestorNodes(e),(e=>t(e)))};var nu={};nu.findInFollowingSiblingNodes=void 0,nu.findInFollowingSiblingNodes=function e(t,r){const n=t.nextSibling;if(n)return r(n)?n:e(n,r)};var ou={};ou.findInPrecedingSiblingNodes=void 0,ou.findInPrecedingSiblingNodes=function e(t,r){const n=t.previousSibling;if(n)return r(n)?n:e(n,r)};var au={parentNode:void 0};const su=b;function iu(e,t){const r=e.parentNode;if(r)return 1===t?r:iu(r,t-1)}au.parentNode=function(e,t=1){return su.assert(Number.isInteger(t),"parameter distance must be an integer"),su.assert(t>=1,"parameter distance must be greater than or equal to 1"),iu(e,t)};var cu={nextSibling:void 0};const uu=b;function lu(e,t){const r=e.nextSibling;if(r)return 1===t?r:lu(r,t-1)}cu.nextSibling=function(e,t=1){return uu.assert(Number.isInteger(t),"parameter distance must be an integer"),uu.assert(t>=1,"parameter distance must be greater than or equal to 1"),lu(e,t)};var du={previousSibling:void 0};const fu=b;function hu(e,t=1){const r=e.previousSibling;if(r)return 1===t?r:hu(r,t-1)}du.previousSibling=function(e,t=1){return fu.assert(Number.isInteger(t),"parameter distance must be an integer"),fu.assert(t>=1,"parameter distance must be greater than or equal to 1"),hu(e,t)};var mu={nextElementSibling:void 0};const pu=Bc,yu=b;function vu(e,t){const r=e.nextSibling;if(r)return pu.isElement(r)?1===t?r:vu(r,t-1):vu(r,t)}mu.nextElementSibling=function(e,t=1){return yu.assert(Number.isInteger(t),"parameter distance must be an integer"),yu.assert(t>=1,"parameter distance must be greater than or equal to 1"),vu(e,t)};var gu={previousElementSibling:void 0};const $u=Bc,bu=b;function wu(e,t=1){const r=e.previousSibling;if(r)return $u.isElement(r)?1===t?r:wu(r,t-1):wu(r,t)}gu.previousElementSibling=function(e,t=1){return bu.assert(Number.isInteger(t),"parameter distance must be an integer"),bu.assert(t>=1,"parameter distance must be greater than or equal to 1"),wu(e,t)};var _u={isntDocument:void 0};const Eu=Fc;_u.isntDocument=function(e){return!Eu.isDocument(e)};var Nu={isntElement:void 0};const Su=Bc;Nu.isntElement=function(e){return!Su.isElement(e)};var Tu={isNode:void 0};const Pu=U;Tu.isNode=function(e){return"Node"in globalThis&&e instanceof Node||Pu.isObject(e)&&"nodeType"in e};var Ou={isntNode:void 0};const Au=Tu;Ou.isntNode=function(e){return!Au.isNode(e)};var Cu={isTextNode:void 0};const ku=zc,Du=U;Cu.isTextNode=function(e){return"Text"in globalThis&&e instanceof Text||Du.isObject(e)&&e.nodeType===ku.NodeType.TEXT_NODE};var Iu={isntTextNode:void 0};const Ru=Cu;Iu.isntTextNode=function(e){return!Ru.isTextNode(e)};var xu={isParentNode:void 0};const ju=Tu;xu.isParentNode=function(e){return ju.isNode(e)&&"children"in e};var Uu={isntParentNode:void 0};const Mu=xu;Uu.isntParentNode=function(e){return!Mu.isParentNode(e)};var Vu={};!function(e){e.XPathResultType=void 0;const t="XPathResult"in globalThis;var r;(r=e.XPathResultType||(e.XPathResultType={}))[r.ANY_TYPE=t?globalThis.XPathResult.ANY_TYPE:0]="ANY_TYPE",r[r.NUMBER_TYPE=t?globalThis.XPathResult.NUMBER_TYPE:1]="NUMBER_TYPE",r[r.STRING_TYPE=t?globalThis.XPathResult.STRING_TYPE:2]="STRING_TYPE",r[r.BOOLEAN_TYPE=t?globalThis.XPathResult.BOOLEAN_TYPE:3]="BOOLEAN_TYPE",r[r.UNORDERED_NODE_ITERATOR_TYPE=t?globalThis.XPathResult.UNORDERED_NODE_ITERATOR_TYPE:4]="UNORDERED_NODE_ITERATOR_TYPE",r[r.ORDERED_NODE_ITERATOR_TYPE=t?globalThis.XPathResult.ORDERED_NODE_ITERATOR_TYPE:5]="ORDERED_NODE_ITERATOR_TYPE",r[r.UNORDERED_NODE_SNAPSHOT_TYPE=t?globalThis.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:6]="UNORDERED_NODE_SNAPSHOT_TYPE",r[r.ORDERED_NODE_SNAPSHOT_TYPE=t?globalThis.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:7]="ORDERED_NODE_SNAPSHOT_TYPE",r[r.ANY_UNORDERED_NODE_TYPE=t?globalThis.XPathResult.ANY_UNORDERED_NODE_TYPE:8]="ANY_UNORDERED_NODE_TYPE",r[r.FIRST_ORDERED_NODE_TYPE=t?globalThis.XPathResult.FIRST_ORDERED_NODE_TYPE:9]="FIRST_ORDERED_NODE_TYPE"}(Vu);var qu={replaceBrWithNewline:void 0};const Fu=c;qu.replaceBrWithNewline=function(e){return Fu.map(e,(e=>"BR"===e.nodeName?document.createTextNode("\n"):e))};var zu={};zu.isBefore=void 0,zu.isBefore=function(e,t){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)};var Lu={};function Ku(e,t,...r){if(0===r.length)return!0;if(!t)return!1;const[n,...o]=r,a=Reflect.apply(n,e,[t]);if(U.isBoolean(a)){if(a){const r=e.next(t);return Ku(e,r,...o)}return!1}if(U.isNumber(a)){const r=a,n=e.next(t,r);return Ku(e,n,...o)}if(U.isIterable(a)){for(const r of a){const n=e.next(t,r);if(Ku(e,n,...o))return!0}return!1}throw new Error("Unknown return value")}function Bu(e,r=1){return 0===r?e:t.nextSibling(e,r)}function Ju(e,...r){const n={document:t.isDocument(this)?this:globalThis.document,collection:{},next:Bu};return Ku(n,e,...r)?n.collection:null}function Hu(e,r=1){return 0===r?e:t.nextElementSibling(e,r)}function Gu(e,...r){const n={document:t.isDocument(this)?this:globalThis.document,collection:{},next:Hu};return Ku(n,e,...r)?n.collection:null}function Yu(...e){return function(t){return e.some((e=>e.call(this,t)))}}function Xu(e,t){for(const[r,n]of Object.entries(t))e[r]?Array.isArray(e[r])?Array.isArray(n)?e[r]=[...e[r],...n]:e[r]=[...e[r],n]:Array.isArray(n)?e[r]=[e[r],...n]:e[r]=[e[r],n]:e[r]=n}function Wu(...e){return function(t){if(0===e.length)return 0===t.childNodes.length;if(0===t.childNodes.length)return!1;const r=Object.assign(Object.assign({},this),{collection:{},next:Bu}),n=Ku(r,t.childNodes[0],...e);return n&&Xu(this.collection,r.collection),n}}function Qu(...e){return function(t){if(0===e.length)return 0===t.children.length;if(0===t.children.length)return!1;const r=Object.assign(Object.assign({},this),{collection:{},next:Hu}),n=Ku(r,t.children[0],...e);return n&&Xu(this.collection,r.collection),n}}function Zu(e,t){const r=[];for(let n=0,o=t.length;n<o;n++)r.push(e[n]),r.push(t[n]);return r.push(e[e.length-1]),r}function el(...e){if(U.isString(e[0])){const[t]=e;return e=>e.matches(t)}{const[t,...r]=e;return el(Zu(t,r).join(""))}}function tl(...e){if(Array.isArray(e[0])){const[t,...r]=e,n=Zu(t,r).join("");return(...e)=>tl(n,...e)}if(U.isString(e[0])){const[t,...r]=e;return function(e){const n=tl(...r).call(this,e);return n&&Xu(this.collection,{[t]:e}),n}}const[...r]=e;return function(e){return!t.isntElement(e)&&(0===r.length||r.every((t=>t.call(this,e))))}}Lu.isAfter=void 0,Lu.isAfter=function(e,t){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)},function(t){var n=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=e&&e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};o(r,t),o(c,t),o(l,t),o(m,t),o(Oc,t),o(Rc,t),o(xc,t),o(jc,t),o(a,t),o(Vc,t),o(qc,t),o(Xc,t),o(Zc,t),o(eu,t),o(Cc,t),o(Ac,t),o(nu,t),o(ou,t),o(au,t),o(cu,t),o(du,t),o(mu,t),o(gu,t),o(Fc,t),o(_u,t),o(Bc,t),o(Nu,t),o(Tu,t),o(Ou,t),o(Cu,t),o(Iu,t),o(xu,t),o(Uu,t),o(zc,t),o(Vu,t),o(qu,t),o(zu,t),o(Lu,t)}(t);var rl={},nl={};nl.of=void 0,nl.of=function*(e){yield e};var ol={repeat:void 0};const al=b;ol.repeat=function(e,t=1/0){return al.assert(t===1/0||Number.isInteger(t),"The parameter times must be an integer"),function*(){for(;t-- >0;)yield e}()};var sl={};sl.countdown=void 0,sl.countdown=function*(e,t){if(!(e<t))for(let r=e;r>=t;r--)yield r};var il={};il.countup=void 0,il.countup=function*(e,t){if(!(e>t))for(let r=e;r<=t;r++)yield r};var cl={range:void 0};const ul=b;cl.range=function(e,t,r=1){return ul.assert(r>0,"step parameter must be greater than 0"),function*(e,t,r){if(e<t)for(let n=e;n<t;n+=r)yield n;else for(let n=e;n>t;n-=r)yield n}(e,t,r)};var ll={};ll.stringifyJSONStream=void 0,ll.stringifyJSONStream=function*(e){const t=e[Symbol.iterator](),r=t.next();for(yield"[",r.done||(yield JSON.stringify(r.value));;){const e=t.next();if(e.done)break;yield","+JSON.stringify(e.value)}yield"]"};var dl={};dl.stringifyJSONStreamAsync=void 0,dl.stringifyJSONStreamAsync=async function*(e){const t=e[Symbol.asyncIterator](),r=await t.next();for(yield"[",r.done||(yield JSON.stringify(r.value));;){const e=await t.next();if(e.done)break;yield","+JSON.stringify(e.value)}yield"]"};var fl={};fl.stringifyNDJSONStream=void 0,fl.stringifyNDJSONStream=function*(e){const t=e[Symbol.iterator](),r=t.next();for(r.done||(yield JSON.stringify(r.value));;){const e=t.next();if(e.done)break;yield"\n"+JSON.stringify(e.value)}};var hl={};hl.stringifyNDJSONStreamAsync=void 0,hl.stringifyNDJSONStreamAsync=async function*(e){const t=e[Symbol.asyncIterator](),r=await t.next();for(r.done||(yield JSON.stringify(r.value));;){const e=await t.next();if(e.done)break;yield"\n"+JSON.stringify(e.value)}};var ml,pl={};function yl(e,t,r){let n=e;for(const e of rl.countup(1,t)){if(!n)return e-1;if(!r.call(this,n))return e-1;n=this.next(n)}return t}function vl([e,t],r,n={greedy:!0}){return b.assert(Number.isInteger(e),"parameter min must be an integer"),b.assert(Number.isInteger(t)||t===1/0,"parameter max must be an integer or Infinity"),b.assert(e>=0,"parameter min must be greater than or equal to 0"),b.assert(e<=t,"parameter max must be greater than or equal to min"),function*(o){if(n.greedy){let n=t;for(;;){const t=yl.call(this,o,n,r);if(t<e)break;if(yield t,n=t-1,n<e)break}}else for(const n of rl.countup(e,t)){const e=yl.call(this,o,n,r);if(e<n)break;e===n&&(yield n)}}}function gl(...e){if(Array.isArray(e[0])){const[t,...r]=e,n=Zu(t,r).join("");return(...e)=>gl(n,...e)}if(U.isString(e[0])){const[t,...r]=e;return function(e){const n=gl(...r).call(this,e);return n&&Xu(this.collection,{[t]:e}),n}}const[...t]=e;return function(e){return 0===t.length||t.every((t=>t.call(this,e)))}}function $l(e){return vl([0,1],e,{greedy:!0})}function bl(e,t){return b.assert(Number.isInteger(e),"parameter times must be an integer"),b.assert(e>=0,"parameter number must be greater than or equal to 0"),function(r){return yl.call(this,r,e,t)===e&&e}}function wl(e,t){return function(r){const n=e.call(this,r);return t(n),n}}function _l(e,{caseSensitive:t=!0,trim:r=!1}={}){return n=>{if(U.isNull(n.textContent))return!1;let o=n.textContent;return t||(o=o.toLowerCase(),e=e.toLowerCase()),r&&(o=o.trim()),o===e}}function El(e,{caseSensitive:t=!0,trim:r=!1}={}){return n=>{if(U.isNull(n.textContent))return!1;let o=n.textContent;return t||(o=o.toLowerCase(),e=e.toLowerCase()),r&&(o=o.trim()),o.includes(e)}}function Nl(e,{trim:t=!1}={}){return r=>{if(U.isNull(r.textContent))return!1;let n=r.textContent;return t&&(n=n.trim()),e.test(n)}}function Sl(...e){if(Array.isArray(e[0])){const[t,...r]=e,n=Zu(t,r).join("");return(...e)=>Sl(n,...e)}if(U.isString(e[0])){const[t,...r]=e;return function(e){const n=Sl(...r).call(this,e);return n&&Xu(this.collection,{[t]:e}),n}}const[...r]=e;return function(e){return!t.isntTextNode(e)&&(0===r.length||r.every((t=>t.call(this,e))))}}pl.sse=void 0,pl.sse=function*(e){e.event&&(yield`event: ${e.event}\n`);for(const t of e.data.split("\n"))yield`data: ${t}\n`;e.id&&(yield`id: ${e.id}\n`),e.retry&&(yield`retry: ${e.retry}\n`),yield"\n"},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};n(nl,t),n(ol,t),n(sl,t),n(il,t),n(cl,t),n(ll,t),n(dl,t),n(fl,t),n(hl,t),n(pl,t)}(rl),function(e){e[e.Min=0]="Min",e[e.Max=1]="Max"}(ml||(ml={}));const Tl="XPathResult"in globalThis?XPathResult.UNORDERED_NODE_ITERATOR_TYPE:4;function Pl(...e){if(U.isString(e[0])){const[t]=e;return b.assert(t.startsWith("//*"),'XPath expressions must start with "//*"'),function(e){return function(e,t,r){const n=e.evaluate(t,r,null,Tl,null);let o;for(;null!==(o=n.iterateNext());)if(o===r)return!0;return!1}(this.document,t,e)}}{const[t,...r]=e;return Pl(Zu(t,r).join(""))}}export{Yu as anyOf,Wu as childNodes,Qu as children,el as css,tl as element,Ju as match,Gu as matchElement,vl as multiple,gl as node,$l as optional,bl as repeat,wl as tap,_l as textContentEquals,El as textContentIncludes,Nl as textContentMatches,Sl as textNode,Pl as xpath};
1
+ var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n={},e={},r={};function o(t){return t.cloneNode(!0)}r.copyNodesToChildNodes=r.cloneNodes=r.clone=void 0,r.clone=o,r.cloneNodes=function(t){return t.map((t=>o(t)))},r.copyNodesToChildNodes=function(t,n){t.forEach((t=>n.appendChild(t)))};var i={};i.removeAllChildren=void 0,i.removeAllChildren=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},e.flatMap=void 0;const s=r,a=i;e.flatMap=function t(n,e){return(0,s.cloneNodes)(e((0,s.clone)(n))).map((n=>{const r=[];for(const o of n.childNodes)r.push(...(0,s.cloneNodes)(t(o,e)));return(0,a.removeAllChildren)(n),(0,s.copyNodesToChildNodes)(r,n),n}))};var c={map:void 0};const u=r;c.map=function t(n,e){const r=(0,u.clone)(e((0,u.clone)(n)));for(const n of r.childNodes)r.replaceChild(t(n,e),n);return r};var l={filter:void 0};const f=e;l.filter=function(t,n){const e=(0,f.flatMap)(t,(t=>n(t)?[t]:[]));if(1===e.length)return e[0]};var d,y,v={},m={},p={},h={},b={},g={};g.go=void 0,g.go=function(t){return t()},d=b,y=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),(t&&t.__exportStar||function(t,n){for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(n,e)||y(n,t,e)})(g,d);var N={},E={CustomError:void 0};class T extends Error{get name(){return this.constructor.name}}E.CustomError=T;var O={ExpectedError:void 0};const A=E;class w extends A.CustomError{}O.ExpectedError=w;var _={AssertionError:void 0};const S=E;class R extends S.CustomError{}_.AssertionError=R;var I={};I.normalize=void 0,I.normalize=function(t){var n;return{name:t.name,message:t.message,stack:null!==(n=t.stack)&&void 0!==n?n:null}};var D={refute:void 0};const P=O;D.refute=function(t,n){if(t)throw new P.ExpectedError(n)};var x={assert:void 0};const j=_;x.assert=function(t,n){if(!t)throw new j.AssertionError(n)},function(n){var e=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=t&&t.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(E,n),r(O,n),r(_,n),r(I,n),r(D,n),r(x,n)}(N),h.chunkAsync=void 0;const C=b,B=N;h.chunkAsync=function(t,n){return(0,B.assert)(Number.isInteger(n),"The parameter size must be an integer"),(0,B.assert)(n>0,"The parameter size must be greater than 0"),(0,C.go)((async function*(){let e=[];for await(const r of t)e.push(r),e.length>=n&&(yield e,e=[]);e.length&&(yield e)}))};var U={},J={},Y={};function M(t){return Array.isArray(t)}Y.isntEmptyArray=Y.isEmptyArray=Y.isntArray=Y.isArray=void 0,Y.isArray=M,Y.isntArray=function(t){return!M(t)},Y.isEmptyArray=function(t){return 0===t.length},Y.isntEmptyArray=function(t){return 0!==t.length};var q={},k={};function F(t){return null===t}k.isntNull=k.isNull=void 0,k.isNull=F,k.isntNull=function(t){return!F(t)};var L={};function X(t){return void 0===t}L.isntUndefined=L.isUndefined=void 0,L.isUndefined=X,L.isntUndefined=function(t){return!X(t)},q.isntAsyncIterable=q.isAsyncIterable=void 0;const z=k,G=L;function H(t){return(0,z.isntNull)(t)&&(0,G.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}q.isAsyncIterable=H,q.isntAsyncIterable=function(t){return!H(t)};var $={};function W(t){return"bigint"==typeof t}$.isntBigInt=$.isBigInt=void 0,$.isBigInt=W,$.isntBigInt=function(t){return!W(t)};var V={};function K(t){return"boolean"==typeof t}V.isntBoolean=V.isBoolean=void 0,V.isBoolean=K,V.isntBoolean=function(t){return!K(t)};var Q={},Z={};function tt(t){return"string"==typeof t}Z.isntString=Z.isString=void 0,Z.isString=tt,Z.isntString=function(t){return!tt(t)},Q.isntChar=Q.isChar=void 0;const nt=Z;function et(t){return(0,nt.isString)(t)&&1===t.length}Q.isChar=et,Q.isntChar=function(t){return!et(t)};var rt={};function ot(t){return t instanceof Date}rt.isntDate=rt.isDate=void 0,rt.isDate=ot,rt.isntDate=function(t){return!ot(t)};var it={};it.inEnum=void 0,it.inEnum=function(t,n){return Object.values(n).includes(t)};var st={};function at(t){return t instanceof Error}st.isntError=st.isError=void 0,st.isError=at,st.isntError=function(t){return!at(t)};var ct={};function ut(t){return!t}ct.isntFalsy=ct.isFalsy=void 0,ct.isFalsy=ut,ct.isntFalsy=function(t){return!ut(t)};var lt={};function ft(t){return"function"==typeof t}lt.isntFunction=lt.isFunction=void 0,lt.isFunction=ft,lt.isntFunction=function(t){return!ft(t)};var dt={};dt.isntIterable=dt.isIterable=void 0;const yt=k,vt=L;function mt(t){return(0,yt.isntNull)(t)&&(0,vt.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}dt.isIterable=mt,dt.isntIterable=function(t){return!mt(t)};var pt={},ht={};function bt(t){return null!==t&&"object"==typeof t}ht.isntEmptyObject=ht.isEmptyObject=ht.isRecord=ht.isntObject=ht.isObject=void 0,ht.isObject=bt,ht.isntObject=function(t){return!bt(t)},ht.isRecord=function(t){return bt(t)},ht.isEmptyObject=function(t){return 0===Object.keys(t).length},ht.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var gt={};function Nt(t){return"number"==typeof t}gt.isntNumber=gt.isNumber=void 0,gt.isNumber=Nt,gt.isntNumber=function(t){return!Nt(t)},pt.isntJsonRpcError=pt.isJsonRpcError=pt.isntJsonRpcSuccess=pt.isJsonRpcSuccess=pt.isntJsonRpcRequest=pt.isJsonRpcRequest=pt.isntJsonRpcNotification=pt.isJsonRpcNotification=void 0;const Et=Y,Tt=ht,Ot=Z,At=gt,wt=L;function _t(t){return(0,Ot.isString)(t)||(0,At.isNumber)(t)}function St(t){return(0,Et.isArray)(t)||(0,Tt.isObject)(t)}function Rt(t){return(0,Tt.isRecord)(t)&&(0,Ot.isString)(t.jsonrpc)&&(0,Ot.isString)(t.method)&&(0,wt.isUndefined)(t.id)&&St(t.params)}function It(t){return(0,Tt.isRecord)(t)&&(0,Ot.isString)(t.jsonrpc)&&(0,Ot.isString)(t.method)&&_t(t.id)&&St(t.params)}function Dt(t){return(0,Tt.isRecord)(t)&&(0,Ot.isString)(t.jsonrpc)&&(0,Ot.isString)(t.id)&&(0,wt.isntUndefined)(t.result)}function Pt(t){return(0,Tt.isRecord)(t)&&(0,Ot.isString)(t.jsonrpc)&&_t(t.id)&&function(t){return(0,Tt.isRecord)(t)&&(0,At.isNumber)(t.code)&&(0,Ot.isString)(t.message)&&((0,wt.isUndefined)(t.data)||(0,Tt.isObject)(t.data))}(t.error)}pt.isJsonRpcNotification=Rt,pt.isntJsonRpcNotification=function(t){return!Rt(t)},pt.isJsonRpcRequest=It,pt.isntJsonRpcRequest=function(t){return!It(t)},pt.isJsonRpcSuccess=Dt,pt.isntJsonRpcSuccess=function(t){return!Dt(t)},pt.isJsonRpcError=Pt,pt.isntJsonRpcError=function(t){return!Pt(t)};var xt={};xt.isntJson=xt.isJson=void 0,xt.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},xt.isntJson=function t(n){return!t()};var jt={};jt.isAbsoluteURL=void 0,jt.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(n){var e=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=t&&t.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Y,n),r(q,n),r($,n),r(V,n),r(Q,n),r(rt,n),r(it,n),r(st,n),r(ct,n),r(lt,n),r(dt,n),r(pt,n),r(xt,n),r(k,n),r(gt,n),r(ht,n),r(Z,n),r(L,n),r(jt,n)}(J),U.chunkByAsync=void 0;const Ct=J;U.chunkByAsync=function(t,n){return(0,Ct.isAsyncIterable)(t)?async function*(t){let e=[],r=0;for await(const o of t)e.push(o),await n(o,r)&&(yield e,e=[]),r++;e.length&&(yield e)}(t):async function*(t){let e=[],r=0;for(const o of t)e.push(o),await n(o,r)&&(yield e,e=[]),r++;e.length&&(yield e)}(t)};var Bt={};Bt.chunkBy=void 0,Bt.chunkBy=function*(t,n){let e=[],r=0;for(const o of t)e.push(o),n(o,r)&&(yield e,e=[]),r++;e.length&&(yield e)};var Ut={chunk:void 0};const Jt=b,Yt=N;Ut.chunk=function(t,n){return(0,Yt.assert)(Number.isInteger(n),"The parameter size must be an integer"),(0,Yt.assert)(n>0,"The parameter size must be greater than 0"),(0,Jt.go)((function*(){let e=[];for(const r of t)e.push(r),e.length>=n&&(yield e,e=[]);e.length&&(yield e)}))};var Mt={concatAsync:void 0};const qt=J,kt=b;Mt.concatAsync=function(t,...n){return(0,kt.go)((async function*(){for(const e of[t,...n])if((0,qt.isAsyncIterable)(e))for await(const t of e)yield t;else for(const t of e)yield t}))};var Ft={concat:void 0};const Lt=b;Ft.concat=function(t,...n){return(0,Lt.go)((function*(){for(const e of[t,...n])yield*e}))};var Xt={},zt={};zt.copyIterable=zt.copyAsyncIterable=void 0,zt.copyAsyncIterable=async function*(t){for await(const n of t)yield n},zt.copyIterable=function*(t){for(const n of t)yield n},Xt.dropAsync=void 0;const Gt=b,Ht=zt,$t=N;Xt.dropAsync=function(t,n){return(0,$t.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,$t.assert)(n>=0,"The parameter count must be greater than or equal to 0"),0===n?(0,Ht.copyAsyncIterable)(t):(0,Gt.go)((async function*(){var e;const r=t[Symbol.asyncIterator]();let o;try{let t;for(;!(({value:t,done:o}=await r.next()),o||n<=0);)n--;for(;!o;)yield t,({value:t,done:o}=await r.next())}finally{o||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}}))};var Wt={dropRightAsync:void 0};const Vt=b,Kt=zt,Qt=N;Wt.dropRightAsync=function(t,n){return(0,Qt.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,Qt.assert)(n>=0,"The parameter count must be greater than or equal to 0"),0===n?(0,Kt.copyAsyncIterable)(t):(0,Vt.go)((async function*(){const e=(await async function(t){const n=[];for await(const e of t)n.push(e);return n}(t)).slice(0,-n);for(const t of e)yield t}))};var Zt={dropRight:void 0};const tn=b,nn=zt,en=N;Zt.dropRight=function(t,n){return(0,en.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,en.assert)(n>=0,"The parameter count must be greater than or equal to 0"),0===n?(0,nn.copyIterable)(t):(0,tn.go)((function*(){const e=Array.from(t);yield*e.slice(0,-n)}))};var rn={dropUntilAsync:void 0};const on=J;rn.dropUntilAsync=function(t,n){return(0,on.isAsyncIterable)(t)?async function*(t){var e;const r=t[Symbol.asyncIterator]();let o;try{let t,i=0;for(;!(({value:t,done:o}=await r.next()),o||await n(t,i++)););for(;!o;)yield t,({value:t,done:o}=await r.next())}finally{o||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}}(t):async function*(t){var e;const r=t[Symbol.iterator]();let o;try{let t,i=0;for(;!(({value:t,done:o}=r.next()),o||await n(t,i++)););for(;!o;)yield t,({value:t,done:o}=r.next())}finally{o||null===(e=r.return)||void 0===e||e.call(r)}}(t)};var sn={};sn.dropUntil=void 0,sn.dropUntil=function*(t,n){var e;const r=t[Symbol.iterator]();let o;try{let t,i=0;for(;!(({value:t,done:o}=r.next()),o||n(t,i++)););for(;!o;)yield t,({value:t,done:o}=r.next())}finally{o||null===(e=r.return)||void 0===e||e.call(r)}};var an={drop:void 0};const cn=b,un=zt,ln=N;an.drop=function(t,n){return(0,ln.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,ln.assert)(n>=0,"The parameter count must be greater than or equal to 0"),0===n?(0,un.copyIterable)(t):(0,cn.go)((function*(){var e;const r=t[Symbol.iterator]();let o;try{let t;for(;!(({value:t,done:o}=r.next()),o||n<=0);)n--;for(;!o;)yield t,({value:t,done:o}=r.next())}finally{o||null===(e=r.return)||void 0===e||e.call(r)}}))};var fn={filterAsync:void 0};const dn=J;fn.filterAsync=function(t,n){return(0,dn.isAsyncIterable)(t)?async function*(t){let e=0;for await(const r of t)await n(r,e)&&(yield r),e++}(t):async function*(t){let e=0;for(const r of t)await n(r,e)&&(yield r),e++}(t)};var yn={};yn.filter=void 0,yn.filter=function*(t,n){let e=0;for(const r of t)n(r,e)&&(yield r),e++};var vn={},mn={},pn={flattenByAsync:void 0};const hn=J;function bn(t){return(0,hn.isIterable)(t)&&(0,hn.isntChar)(t)}pn.flattenByAsync=function(t,n){return(0,hn.isAsyncIterable)(t)?async function*(t){const r=1;for await(const o of t)bn(o)&&await n(o,r)?yield*e(o,r+1):yield o}(t):function(t){return e(t,1)}(t);async function*e(t,r){for(const o of t)bn(o)&&await n(o,r)?yield*e(o,r+1):yield o}},mn.flattenDeepAsync=void 0;const gn=pn,Nn=N;mn.flattenDeepAsync=function(t,n=1/0){return(0,Nn.assert)(n===1/0||Number.isInteger(n),"The parameter depth must be an integer"),(0,Nn.assert)(n>=0,"The parameter depth must be greater than or equal to 0"),(0,gn.flattenByAsync)(t,((t,e)=>e<=n))},vn.flattenAsync=void 0;const En=mn;vn.flattenAsync=function(t){return(0,En.flattenDeepAsync)(t,1)};var Tn={flattenBy:void 0};const On=J;Tn.flattenBy=function(t,n){return function*t(e,r){for(const i of e)(0,On.isIterable)(o=i)&&(0,On.isntChar)(o)&&n(i,r)?yield*t(i,r+1):yield i;var o}(t,1)};var An={flattenDeep:void 0};const wn=Tn,_n=N;An.flattenDeep=function(t,n=1/0){return(0,_n.assert)(n===1/0||Number.isInteger(n),"The parameter depth must be an integer"),(0,_n.assert)(n>=0,"The parameter depth must be greater than or equal to 0"),(0,wn.flattenBy)(t,((t,e)=>e<=n))};var Sn={flatten:void 0};const Rn=An;Sn.flatten=function(t){return(0,Rn.flattenDeep)(t,1)};var In={mapAsync:void 0};const Dn=J;In.mapAsync=function(t,n){return(0,Dn.isAsyncIterable)(t)?async function*(t){let e=0;for await(const r of t)yield await n(r,e),e++}(t):async function*(t){let e=0;for(const r of t)yield await n(r,e),e++}(t)};var Pn={};Pn.map=void 0,Pn.map=function*(t,n){let e=0;for(const r of t)yield n(r,e),e++};var xn={repeatAsync:void 0};const jn=b,Cn=N;xn.repeatAsync=function(t,n){return(0,Cn.assert)(n===1/0||Number.isInteger(n),"The parameter times must be an integer"),(0,Cn.assert)(n>=0,"The parameter times must be greater than or equal to 0"),n===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,jn.go)((async function*(){const e=[];if(n>0){for await(const n of t)yield n,e.push(n);n--}for(;n>0;)yield*e,n--}))};var Bn={repeat:void 0};const Un=b,Jn=N;Bn.repeat=function(t,n){return(0,Jn.assert)(n===1/0||Number.isInteger(n),"The parameter times must be an integer"),(0,Jn.assert)(n>=0,"The parameter times must be greater than or equal to 0"),n===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,Un.go)((function*(){const e=[];if(n>0){for(const n of t)yield n,e.push(n);n--}for(;n>0;)yield*e,n--}))};var Yn={sliceAsync:void 0};const Mn=b,qn=N;Yn.sliceAsync=function(t,n,e=1/0){return(0,qn.assert)(Number.isInteger(n),"The parameter start must be an integer"),(0,qn.assert)(n>=0,"The parameter start must be greater than or equal to 0"),(0,qn.assert)(Number.isInteger(e),"The parameter end must be an integer"),(0,qn.assert)(e>=n,"The parameter end must be greater than or equal to start"),(0,Mn.go)((async function*(){let r=0;for await(const o of t){if(r>=e)break;r>=n&&(yield o),r++}}))};var kn={slice:void 0};const Fn=b,Ln=N;kn.slice=function(t,n,e=1/0){return(0,Ln.assert)(Number.isInteger(n),"The parameter start must be an integer"),(0,Ln.assert)(n>=0,"The parameter start must be greater than or equal to 0"),(0,Ln.assert)(Number.isInteger(e),"The parameter end must be an integer"),(0,Ln.assert)(e>=n,"The parameter end must be greater than or equal to start"),(0,Fn.go)((function*(){let r=0;for(const o of t){if(r>=e)break;r>=n&&(yield o),r++}}))};var Xn={};Xn.splitAsync=void 0,Xn.splitAsync=async function*(t,n){let e=[];for await(const r of t)r===n?(yield e,e=[]):e.push(r);yield e};var zn={splitByAsync:void 0};const Gn=J;zn.splitByAsync=function(t,n){return(0,Gn.isAsyncIterable)(t)?async function*(t){let e=[],r=0;for await(const o of t)await n(o,r)?(yield e,e=[]):e.push(o),r++;yield e}(t):async function*(t){let e=[],r=0;for(const o of t)await n(o,r)?(yield e,e=[]):e.push(o),r++;yield e}(t)};var Hn={};Hn.splitBy=void 0,Hn.splitBy=function*(t,n){let e=[],r=0;for(const o of t)n(o,r)?(yield e,e=[]):e.push(o),r++;yield e};var $n={};$n.split=void 0,$n.split=function*(t,n){let e=[];for(const r of t)r===n?(yield e,e=[]):e.push(r);yield e};var Wn={takeAsync:void 0};const Vn=b,Kn=N;Wn.takeAsync=function(t,n){return(0,Kn.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,Kn.assert)(n>=0,"The parameter count must be greater than or equal to 0"),(0,Vn.go)((async function*(){if(0!==n)for await(const e of t)if(yield e,0===--n)break}))};var Qn={takeRightAsync:void 0};const Zn=b,te=N;Qn.takeRightAsync=function(t,n){return(0,te.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,te.assert)(n>=0,"The parameter count must be greater than or equal to 0"),(0,Zn.go)((async function*(){var e;const r=t[Symbol.asyncIterator]();let o;try{const t=[];let i;for(;({value:i,done:o}=await r.next()),!o;)t.push(i),t.length>n&&t.shift();yield*t}finally{o||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}}))};var ne={takeRight:void 0};const ee=b,re=N;ne.takeRight=function(t,n){return(0,re.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,re.assert)(n>=0,"The parameter count must be greater than or equal to 0"),(0,ee.go)((function*(){var e;const r=t[Symbol.iterator]();let o;try{const t=[];let i;for(;({value:i,done:o}=r.next()),!o;)t.push(i),t.length>n&&t.shift();yield*t}finally{o||null===(e=r.return)||void 0===e||e.call(r)}}))};var oe={takeUntilAsync:void 0};const ie=J;oe.takeUntilAsync=function(t,n){return(0,ie.isAsyncIterable)(t)?async function*(t){let e=0;for await(const r of t){if(await n(r,e))break;yield r,e++}}(t):async function*(t){let e=0;for(const r of t){if(await n(r,e))break;yield r,e++}}(t)};var se={};se.takeUntil=void 0,se.takeUntil=function*(t,n){let e=0;for(const r of t){if(n(r,e))break;yield r,e++}};var ae={take:void 0};const ce=b,ue=N;ae.take=function(t,n){return(0,ue.assert)(Number.isInteger(n),"The parameter count must be an integer"),(0,ue.assert)(n>=0,"The parameter count must be greater than or equal to 0"),(0,ce.go)((function*(){if(0!==n)for(const e of t)if(yield e,0===--n)break}))};var le={tapAsync:void 0};const fe=J;le.tapAsync=function(t,n){return(0,fe.isAsyncIterable)(t)?async function*(t){let e=0;for await(const r of t)await n(r,e),yield r,e++}(t):async function*(t){let e=0;for(const r of t)await n(r,e),yield r,e++}(t)};var de={};de.tap=void 0,de.tap=function*(t,n){let e=0;for(const r of t)n(r,e),yield r,e++};var ye={};ye.toAsyncIterable=void 0,ye.toAsyncIterable=async function*(t){for(const n of t)yield n};var ve={};ve.transformAsync=void 0,ve.transformAsync=async function*(t,n){yield*n(t)};var me={};me.transform=void 0,me.transform=function*(t,n){yield*n(t)};var pe={};pe.uniqAsync=void 0,pe.uniqAsync=async function*(t){const n=new Set;for await(const e of t)n.has(e)||(yield e,n.add(e))};var he={uniqByAsync:void 0};const be=J;he.uniqByAsync=function(t,n){return(0,be.isAsyncIterable)(t)?async function*(t){const e=new Set;let r=0;for await(const o of t){const t=await n(o,r);e.has(t)||(yield o,e.add(t)),r++}}(t):async function*(t){const e=new Set;let r=0;for(const o of t){const t=await n(o,r);e.has(t)||(yield o,e.add(t)),r++}}(t)};var ge={};ge.uniqBy=void 0,ge.uniqBy=function*(t,n){const e=new Set;let r=0;for(const o of t){const t=n(o,r);e.has(t)||(yield o,e.add(t)),r++}};var Ne={};Ne.uniq=void 0,Ne.uniq=function*(t){const n=new Set;for(const e of t)n.has(e)||(yield e,n.add(e))};var Ee={zipAsync:void 0};const Te=J;var Oe;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(Oe||(Oe={})),Ee.zipAsync=function(t,...n){return async function*(...t){var n,e,r,o;const i=t.length,s=t.map((t=>(0,Te.isAsyncIterable)(t)?[Oe.Async,t[Symbol.asyncIterator]()]:[Oe.Sync,t[Symbol.iterator]()])),a=s.map((()=>!1));try{for(;;){const t=new Array(i);for(let n=0;n<i;n++){const[e,r]=s[n];let o;if(o=e===Oe.Async?await r.next():r.next(),o.done)return void(a[n]=!0);t[n]=o.value}yield t}}finally{const t=s.filter(((t,n)=>!a[n]));for(const[i,s]of t)i===Oe.Async?await(null===(e=(n=s).return)||void 0===e?void 0:e.call(n)):null===(o=(r=s).return)||void 0===o||o.call(r)}}(t,...n)};var Ae={};Ae.zip=void 0,Ae.zip=function(t,...n){return function*(...t){const n=t.length,e=t.map((t=>t[Symbol.iterator]())),r=e.map((()=>!1));try{for(;;){const t=new Array(n);for(let o=0;o<n;o++){const{value:n,done:i}=e[o].next();if(i)return void(r[o]=!0);t[o]=n}yield t}}finally{e.filter(((t,n)=>!r[n])).forEach((t=>{var n;return null===(n=t.return)||void 0===n?void 0:n.call(t)}))}}(t,...n)},function(n){var e=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=t&&t.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(h,n),r(U,n),r(Bt,n),r(Ut,n),r(Mt,n),r(Ft,n),r(Xt,n),r(Wt,n),r(Zt,n),r(rn,n),r(sn,n),r(an,n),r(fn,n),r(yn,n),r(vn,n),r(pn,n),r(Tn,n),r(mn,n),r(An,n),r(Sn,n),r(In,n),r(Pn,n),r(xn,n),r(Bn,n),r(Yn,n),r(kn,n),r(Xn,n),r(zn,n),r(Hn,n),r($n,n),r(Wn,n),r(Qn,n),r(ne,n),r(oe,n),r(se,n),r(ae,n),r(le,n),r(de,n),r(ye,n),r(ve,n),r(me,n),r(pe,n),r(he,n),r(ge,n),r(Ne,n),r(Ee,n),r(Ae,n)}(p);var we={},_e={};_e.consume=void 0,_e.consume=function(t,n){return n(t)};var Se={eachAsync:void 0};const Re=J;Se.eachAsync=function(t,n){return(0,Re.isAsyncIterable)(t)?async function(t){let e=0;for await(const r of t)await n(r,e),e++}(t):async function(t){let e=0;for(const r of t)await n(r,e),e++}(t)};var Ie={};Ie.each=void 0,Ie.each=function(t,n){let e=0;for(const r of t)n(r,e),e++};var De={everyAsync:void 0};const Pe=J;De.everyAsync=function(t,n){return(0,Pe.isAsyncIterable)(t)?async function(t){let e=0;for await(const r of t){if(!await n(r,e))return!1;e++}return!0}(t):async function(t){let e=0;for(const r of t){if(!await n(r,e))return!1;e++}return!0}(t)};var xe={};xe.every=void 0,xe.every=function(t,n){let e=0;for(const r of t){if(!n(r,e))return!1;e++}return!0};var je={findAsync:void 0};const Ce=J;je.findAsync=function(t,n){return(0,Ce.isAsyncIterable)(t)?async function(t){let e=0;for await(const r of t){if(await n(r,e))return r;e++}return}(t):async function(t){let e=0;for(const r of t){if(await n(r,e))return r;e++}return}(t)};var Be={};Be.find=void 0,Be.find=function(t,n){let e=0;for(const r of t){if(n(r,e))return r;e++}};var Ue={};Ue.firstAsync=void 0,Ue.firstAsync=async function(t){for await(const n of t)return n};var Je={};Je.first=void 0,Je.first=function(t){for(const n of t)return n};var Ye={};Ye.includesAsync=void 0,Ye.includesAsync=async function(t,n){for await(const e of t)if(e===n)return!0;return!1};var Me={};Me.includes=void 0,Me.includes=function(t,n){for(const e of t)if(e===n)return!0;return!1};var qe={};qe.matchAsync=void 0,qe.matchAsync=async function(t,n){const e=n.length;let r=0;for await(const o of t)if(o===n[r]&&r++,r===e)return!0;return!1};var ke={};ke.match=void 0,ke.match=function(t,n){const e=n.length;let r=0;for(const o of t)if(o===n[r]&&r++,r===e)return!0;return!1};var Fe={reduceAsync:void 0};const Le=J;Fe.reduceAsync=function(t,n,e){return(0,Le.isUndefined)(e)?function(t,n){return(0,Le.isAsyncIterable)(t)?e(t):r(t);async function e(t){var e;const r=t[Symbol.asyncIterator]();let o;try{let t,s=await i(r),a=1;for(;({value:t,done:o}=await r.next()),!o;)s=await n(s,t,a++);return s}finally{o||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}async function i(t){const n=await t.next();if(n.done)throw o=!0,new Error("Reduce of empty iterable with no initial value");return n.value}}async function r(t){var e;const r=t[Symbol.iterator]();let o;try{let t,s=i(r),a=1;for(;({value:t,done:o}=r.next()),!o;)s=await n(s,t,a++);return s}finally{o||null===(e=r.return)||void 0===e||e.call(r)}function i(t){const n=t.next();if(n.done)throw o=!0,new Error("Reduce of empty iterable with no initial value");return n.value}}}(t,n):function(t,n,e){return(0,Le.isAsyncIterable)(t)?o(t):r(t);async function r(t){let r=e,o=0;for(const e of t)r=await n(r,e,o++);return r}async function o(t){let r=e,o=0;for await(const e of t)r=await n(r,e,o++);return r}}(t,n,e)};var Xe={reduce:void 0};const ze=J;Xe.reduce=function(t,n,e){return(0,ze.isUndefined)(e)?function(t,n){var e;const r=t[Symbol.iterator]();let o;try{let t,s=i(r),a=1;for(;({value:t,done:o}=r.next()),!o;)s=n(s,t,a++);return s}finally{o||null===(e=r.return)||void 0===e||e.call(r)}function i(t){const n=t.next();if(n.done)throw o=!0,new Error("Reduce of empty iterable with no initial value");return n.value}}(t,n):function(t,n,e){let r=e,o=0;for(const e of t)r=n(r,e,o++);return r}(t,n,e)};var Ge={someAsync:void 0};const He=J;Ge.someAsync=function(t,n){return(0,He.isAsyncIterable)(t)?async function(t){let e=0;for await(const r of t){if(await n(r,e))return!0;e++}return!1}(t):async function(t){let e=0;for(const r of t){if(await n(r,e))return!0;e++}return!1}(t)};var $e={};$e.some=void 0,$e.some=function(t,n){let e=0;for(const r of t){if(n(r,e))return!0;e++}return!1};var We={};We.lastAsync=void 0,We.lastAsync=async function(t){var n;const e=t[Symbol.asyncIterator]();let r;try{let t,o;for(;({value:t,done:r}=await e.next()),!r;)o=t;return o}finally{r||await(null===(n=e.return)||void 0===n?void 0:n.call(e))}};var Ve={};Ve.last=void 0,Ve.last=function(t){var n;const e=t[Symbol.iterator]();let r;try{let t,o;for(;({value:t,done:r}=e.next()),!r;)o=t;return o}finally{r||null===(n=e.return)||void 0===n||n.call(e)}};var Ke={toArrayAsync:void 0};const Qe=_e;Ke.toArrayAsync=function(t){return(0,Qe.consume)(t,(async t=>{const n=[];for await(const e of t)n.push(e);return n}))};var Ze={toArray:void 0};const tr=_e;Ze.toArray=function(t){return(0,tr.consume)(t,(t=>Array.from(t)))};var nr={toSetAsync:void 0};const er=_e;nr.toSetAsync=function(t){return(0,er.consume)(t,(async t=>{const n=new Set;for await(const e of t)n.add(e);return n}))};var rr={toSet:void 0};const or=_e;rr.toSet=function(t){return(0,or.consume)(t,(t=>new Set(t)))},function(n){var e=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=t&&t.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(_e,n),r(Se,n),r(Ie,n),r(De,n),r(xe,n),r(je,n),r(Be,n),r(Ue,n),r(Je,n),r(Ye,n),r(Me,n),r(qe,n),r(ke,n),r(Fe,n),r(Xe,n),r(Ge,n),r($e,n),r(We,n),r(Ve,n),r(Ke,n),r(Ze,n),r(nr,n),r(rr,n)}(we),function(n){var e=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=t&&t.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(p,n),r(we,n)}(m),v.unwrap=void 0;const ir=e,sr=m;v.unwrap=function t(n,e){return(0,ir.flatMap)(n,(n=>e(n)?(0,sr.toArray)((0,sr.flatten)((0,sr.map)(n.childNodes,(n=>t(n,e))))):[n]))};var ar={},cr={},ur={};ur.traverseDescendantNodes=void 0,ur.traverseDescendantNodes=function*t(n){for(const e of n.childNodes)yield e,yield*t(e)},cr.findInDescendantNodes=void 0;const lr=ur,fr=m;cr.findInDescendantNodes=function(t,n){return(0,fr.find)((0,lr.traverseDescendantNodes)(t),(t=>n(t)))},ar.find=void 0;const dr=cr;ar.find=function(t,n){return n(t)?t:(0,dr.findInDescendantNodes)(t,n)};var yr={};yr.parse=void 0,yr.parse=function(t){const n=document.createElement("div");return n.innerHTML=t,[...n.childNodes]};var vr={};vr.stringify=void 0,vr.stringify=function(t){const n=document.createElement("div");return t.forEach((t=>n.append(t.cloneNode(!0)))),n.innerHTML};var mr={normalize:void 0};const pr=yr,hr=vr;mr.normalize=function(t){return(0,hr.stringify)((0,pr.parse)(t))};var br={};br.removeAttributes=void 0,br.removeAttributes=function(t,n){if(t instanceof Element){const e=Array.from(t.attributes).map((t=>t.name));for(const r of e)n(r)&&t.removeAttribute(r)}};var gr={},Nr={},Er={};!function(t){t.NodeType=void 0;const n="Node"in globalThis;var e;(e=t.NodeType||(t.NodeType={}))[e.ELEMENT_NODE=n?globalThis.Node.ELEMENT_NODE:1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=n?globalThis.Node.ATTRIBUTE_NODE:2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=n?globalThis.Node.TEXT_NODE:3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=n?globalThis.Node.CDATA_SECTION_NODE:4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=n?globalThis.Node.ENTITY_REFERENCE_NODE:5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=n?globalThis.Node.ENTITY_NODE:6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=n?globalThis.Node.PROCESSING_INSTRUCTION_NODE:7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=n?globalThis.Node.COMMENT_NODE:8]="COMMENT_NODE",e[e.DOCUMENT_NODE=n?globalThis.Node.DOCUMENT_NODE:9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=n?globalThis.Node.DOCUMENT_TYPE_NODE:10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=n?globalThis.Node.DOCUMENT_FRAGMENT_NODE:11]="DOCUMENT_FRAGMENT_NODE",e[e.NOTATION_NODE=n?globalThis.Node.NOTATION_NODE:12]="NOTATION_NODE"}(Er);var Tr={},Or={};function Ar(t){return Array.isArray(t)}Or.isntEmptyArray=Or.isEmptyArray=Or.isntArray=Or.isArray=void 0,Or.isArray=Ar,Or.isntArray=function(t){return!Ar(t)},Or.isEmptyArray=function(t){return 0===t.length},Or.isntEmptyArray=function(t){return 0!==t.length};var wr={},_r={};function Sr(t){return null===t}_r.isntNull=_r.isNull=void 0,_r.isNull=Sr,_r.isntNull=function(t){return!Sr(t)};var Rr={};function Ir(t){return void 0===t}Rr.isntUndefined=Rr.isUndefined=void 0,Rr.isUndefined=Ir,Rr.isntUndefined=function(t){return!Ir(t)},wr.isntAsyncIterable=wr.isAsyncIterable=void 0;const Dr=_r,Pr=Rr;function xr(t){return(0,Dr.isntNull)(t)&&(0,Pr.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}wr.isAsyncIterable=xr,wr.isntAsyncIterable=function(t){return!xr(t)};var jr={};function Cr(t){return"bigint"==typeof t}jr.isntBigInt=jr.isBigInt=void 0,jr.isBigInt=Cr,jr.isntBigInt=function(t){return!Cr(t)};var Br={};function Ur(t){return"boolean"==typeof t}Br.isntBoolean=Br.isBoolean=void 0,Br.isBoolean=Ur,Br.isntBoolean=function(t){return!Ur(t)};var Jr={},Yr={};function Mr(t){return"string"==typeof t}Yr.isntString=Yr.isString=void 0,Yr.isString=Mr,Yr.isntString=function(t){return!Mr(t)},Jr.isntChar=Jr.isChar=void 0;const qr=Yr;function kr(t){return(0,qr.isString)(t)&&1===t.length}Jr.isChar=kr,Jr.isntChar=function(t){return!kr(t)};var Fr={};function Lr(t){return t instanceof Date}Fr.isntDate=Fr.isDate=void 0,Fr.isDate=Lr,Fr.isntDate=function(t){return!Lr(t)};var Xr={};Xr.inEnum=void 0,Xr.inEnum=function(t,n){return Object.values(n).includes(t)};var zr={};function Gr(t){return t instanceof Error}zr.isntError=zr.isError=void 0,zr.isError=Gr,zr.isntError=function(t){return!Gr(t)};var Hr={};function $r(t){return!t}Hr.isntFalsy=Hr.isFalsy=void 0,Hr.isFalsy=$r,Hr.isntFalsy=function(t){return!$r(t)};var Wr={};function Vr(t){return"function"==typeof t}Wr.isntFunction=Wr.isFunction=void 0,Wr.isFunction=Vr,Wr.isntFunction=function(t){return!Vr(t)};var Kr={};Kr.isntIterable=Kr.isIterable=void 0;const Qr=_r,Zr=Rr;function to(t){return(0,Qr.isntNull)(t)&&(0,Zr.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}Kr.isIterable=to,Kr.isntIterable=function(t){return!to(t)};var no={},eo={};function ro(t){return null!==t&&"object"==typeof t}eo.isntEmptyObject=eo.isEmptyObject=eo.isRecord=eo.isntObject=eo.isObject=void 0,eo.isObject=ro,eo.isntObject=function(t){return!ro(t)},eo.isRecord=function(t){return ro(t)},eo.isEmptyObject=function(t){return 0===Object.keys(t).length},eo.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var oo={};function io(t){return"number"==typeof t}oo.isntNumber=oo.isNumber=void 0,oo.isNumber=io,oo.isntNumber=function(t){return!io(t)},no.isntJsonRpcError=no.isJsonRpcError=no.isntJsonRpcSuccess=no.isJsonRpcSuccess=no.isntJsonRpcRequest=no.isJsonRpcRequest=no.isntJsonRpcNotification=no.isJsonRpcNotification=void 0;const so=Or,ao=eo,co=Yr,uo=oo,lo=Rr;function fo(t){return(0,co.isString)(t)||(0,uo.isNumber)(t)}function yo(t){return(0,so.isArray)(t)||(0,ao.isObject)(t)}function vo(t){return(0,ao.isRecord)(t)&&(0,co.isString)(t.jsonrpc)&&(0,co.isString)(t.method)&&(0,lo.isUndefined)(t.id)&&yo(t.params)}function mo(t){return(0,ao.isRecord)(t)&&(0,co.isString)(t.jsonrpc)&&(0,co.isString)(t.method)&&fo(t.id)&&yo(t.params)}function po(t){return(0,ao.isRecord)(t)&&(0,co.isString)(t.jsonrpc)&&(0,co.isString)(t.id)&&"result"in t}function ho(t){return(0,ao.isRecord)(t)&&(0,co.isString)(t.jsonrpc)&&fo(t.id)&&function(t){return(0,ao.isRecord)(t)&&(0,uo.isNumber)(t.code)&&(0,co.isString)(t.message)&&((0,lo.isUndefined)(t.data)||(0,ao.isObject)(t.data))}(t.error)}no.isJsonRpcNotification=vo,no.isntJsonRpcNotification=function(t){return!vo(t)},no.isJsonRpcRequest=mo,no.isntJsonRpcRequest=function(t){return!mo(t)},no.isJsonRpcSuccess=po,no.isntJsonRpcSuccess=function(t){return!po(t)},no.isJsonRpcError=ho,no.isntJsonRpcError=function(t){return!ho(t)};var bo={};bo.isntJson=bo.isJson=void 0,bo.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},bo.isntJson=function t(n){return!t()};var go={};go.isAbsoluteURL=void 0,go.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(n){var e=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=t&&t.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Or,n),r(wr,n),r(jr,n),r(Br,n),r(Jr,n),r(Fr,n),r(Xr,n),r(zr,n),r(Hr,n),r(Wr,n),r(Kr,n),r(no,n),r(bo,n),r(_r,n),r(oo,n),r(eo,n),r(Yr,n),r(Rr,n),r(go,n)}(Tr),Nr.isDocument=void 0;const No=Er,Eo=Tr;Nr.isDocument=function(t){return"HTMLDocument"in globalThis&&t instanceof HTMLDocument||(0,Eo.isRecord)(t)&&t.nodeType===No.NodeType.DOCUMENT_NODE};var To={isElement:void 0};const Oo=Er,Ao=Tr;To.isElement=function(t){return"HTMLElement"in globalThis&&t instanceof HTMLElement||(0,Ao.isRecord)(t)&&t.nodeType===Oo.NodeType.ELEMENT_NODE},gr.getBySelector=void 0;const wo=Nr,_o=To;gr.getBySelector=function(t){const n=((0,_o.isElement)(this)||(0,wo.isDocument)(this)?this:document).querySelector(t);if(n)return n;throw new Error(`Could not find any elements matching ${t}`)};var So={getAllBySelector:void 0};const Ro=Nr,Io=To;So.getAllBySelector=function(t){const n=((0,Io.isElement)(this)||(0,Ro.isDocument)(this)?this:document).querySelectorAll(t);if(n.length)return Array.from(n);throw new Error(`Could not find any elements matching ${t}`)};var Do={};Do.traverseAncestorNodes=void 0,Do.traverseAncestorNodes=function*t(n){const e=n.parentNode;e&&(yield e,yield*t(e))};var Po={findInAncestorNodes:void 0};const xo=Do,jo=m;Po.findInAncestorNodes=function(t,n){return(0,jo.find)((0,xo.traverseAncestorNodes)(t),(t=>n(t)))};var Co={};Co.findInFollowingSiblingNodes=void 0,Co.findInFollowingSiblingNodes=function t(n,e){const r=n.nextSibling;if(r)return e(r)?r:t(r,e)};var Bo={};Bo.findInPrecedingSiblingNodes=void 0,Bo.findInPrecedingSiblingNodes=function t(n,e){const r=n.previousSibling;if(r)return e(r)?r:t(r,e)};var Uo={parentNode:void 0};const Jo=N;function Yo(t,n){const e=t.parentNode;if(e)return 1===n?e:Yo(e,n-1)}Uo.parentNode=function(t,n=1){return(0,Jo.assert)(Number.isInteger(n),"parameter distance must be an integer"),(0,Jo.assert)(n>=1,"parameter distance must be greater than or equal to 1"),Yo(t,n)};var Mo={nextSibling:void 0};const qo=N;function ko(t,n){const e=t.nextSibling;if(e)return 1===n?e:ko(e,n-1)}Mo.nextSibling=function(t,n=1){return(0,qo.assert)(Number.isInteger(n),"parameter distance must be an integer"),(0,qo.assert)(n>=1,"parameter distance must be greater than or equal to 1"),ko(t,n)};var Fo={previousSibling:void 0};const Lo=N;Fo.previousSibling=function(t,n=1){return(0,Lo.assert)(Number.isInteger(n),"parameter distance must be an integer"),(0,Lo.assert)(n>=1,"parameter distance must be greater than or equal to 1"),function t(n,e=1){const r=n.previousSibling;if(!r)return;return 1===e?r:t(r,e-1)}(t,n)};var Xo={nextElementSibling:void 0};const zo=To,Go=N;function Ho(t,n){const e=t.nextSibling;if(e)return(0,zo.isElement)(e)?1===n?e:Ho(e,n-1):Ho(e,n)}Xo.nextElementSibling=function(t,n=1){return(0,Go.assert)(Number.isInteger(n),"parameter distance must be an integer"),(0,Go.assert)(n>=1,"parameter distance must be greater than or equal to 1"),Ho(t,n)};var $o={previousElementSibling:void 0};const Wo=To,Vo=N;$o.previousElementSibling=function(t,n=1){return(0,Vo.assert)(Number.isInteger(n),"parameter distance must be an integer"),(0,Vo.assert)(n>=1,"parameter distance must be greater than or equal to 1"),function t(n,e=1){const r=n.previousSibling;if(!r)return;return(0,Wo.isElement)(r)?1===e?r:t(r,e-1):t(r,e)}(t,n)};var Ko={isntDocument:void 0};const Qo=Nr;Ko.isntDocument=function(t){return!(0,Qo.isDocument)(t)};var Zo={isntElement:void 0};const ti=To;Zo.isntElement=function(t){return!(0,ti.isElement)(t)};var ni={isNode:void 0};const ei=Tr;ni.isNode=function(t){return"Node"in globalThis&&t instanceof Node||(0,ei.isObject)(t)&&"nodeType"in t};var ri={isntNode:void 0};const oi=ni;ri.isntNode=function(t){return!(0,oi.isNode)(t)};var ii={isTextNode:void 0};const si=Er,ai=Tr;ii.isTextNode=function(t){return"Text"in globalThis&&t instanceof Text||(0,ai.isRecord)(t)&&t.nodeType===si.NodeType.TEXT_NODE};var ci={isntTextNode:void 0};const ui=ii;ci.isntTextNode=function(t){return!(0,ui.isTextNode)(t)};var li={isParentNode:void 0};const fi=ni;li.isParentNode=function(t){return(0,fi.isNode)(t)&&"children"in t};var di={isntParentNode:void 0};const yi=li;di.isntParentNode=function(t){return!(0,yi.isParentNode)(t)};var vi={};!function(t){t.XPathResultType=void 0;const n="XPathResult"in globalThis;var e;(e=t.XPathResultType||(t.XPathResultType={}))[e.ANY_TYPE=n?globalThis.XPathResult.ANY_TYPE:0]="ANY_TYPE",e[e.NUMBER_TYPE=n?globalThis.XPathResult.NUMBER_TYPE:1]="NUMBER_TYPE",e[e.STRING_TYPE=n?globalThis.XPathResult.STRING_TYPE:2]="STRING_TYPE",e[e.BOOLEAN_TYPE=n?globalThis.XPathResult.BOOLEAN_TYPE:3]="BOOLEAN_TYPE",e[e.UNORDERED_NODE_ITERATOR_TYPE=n?globalThis.XPathResult.UNORDERED_NODE_ITERATOR_TYPE:4]="UNORDERED_NODE_ITERATOR_TYPE",e[e.ORDERED_NODE_ITERATOR_TYPE=n?globalThis.XPathResult.ORDERED_NODE_ITERATOR_TYPE:5]="ORDERED_NODE_ITERATOR_TYPE",e[e.UNORDERED_NODE_SNAPSHOT_TYPE=n?globalThis.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:6]="UNORDERED_NODE_SNAPSHOT_TYPE",e[e.ORDERED_NODE_SNAPSHOT_TYPE=n?globalThis.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:7]="ORDERED_NODE_SNAPSHOT_TYPE",e[e.ANY_UNORDERED_NODE_TYPE=n?globalThis.XPathResult.ANY_UNORDERED_NODE_TYPE:8]="ANY_UNORDERED_NODE_TYPE",e[e.FIRST_ORDERED_NODE_TYPE=n?globalThis.XPathResult.FIRST_ORDERED_NODE_TYPE:9]="FIRST_ORDERED_NODE_TYPE"}(vi);var mi={replaceBrWithNewline:void 0};const pi=c;mi.replaceBrWithNewline=function(t){return(0,pi.map)(t,(t=>"BR"===t.nodeName?document.createTextNode("\n"):t))};var hi={};hi.isBefore=void 0,hi.isBefore=function(t,n){return!!(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)};var bi={};function gi(t,n,...e){if(0===e.length)return!0;if(!n)return!1;const[r,...o]=e,i=Reflect.apply(r,t,[n]);if(Tr.isBoolean(i)){if(i){const e=t.next(n);return gi(t,e,...o)}return!1}if(Tr.isNumber(i)){const e=i,r=t.next(n,e);return gi(t,r,...o)}if(Tr.isIterable(i)){for(const e of i){const r=t.next(n,e);if(gi(t,r,...o))return!0}return!1}throw new Error("Unknown return value")}function Ni(t,e=1){return 0===e?t:n.nextSibling(t,e)}function Ei(t,...e){const r={document:n.isDocument(this)?this:globalThis.document,collection:{},next:Ni};return gi(r,t,...e)?r.collection:null}function Ti(t,e=1){return 0===e?t:n.nextElementSibling(t,e)}function Oi(t,...e){const r={document:n.isDocument(this)?this:globalThis.document,collection:{},next:Ti};return gi(r,t,...e)?r.collection:null}function Ai(...t){return function(n){return t.some((t=>t.call(this,n)))}}function wi(t,n){for(const[e,r]of Object.entries(n))t[e]?Tr.isArray(t[e])?Tr.isArray(r)?t[e]=[...t[e],...r]:t[e]=[...t[e],r]:Tr.isArray(r)?t[e]=[t[e],...r]:t[e]=[t[e],r]:t[e]=r}function _i(...t){return function(n){if(0===t.length)return 0===n.childNodes.length;if(0===n.childNodes.length)return!1;const e=Object.assign(Object.assign({},this),{collection:{},next:Ni}),r=gi(e,n.childNodes[0],...t);return r&&wi(this.collection,e.collection),r}}function Si(...t){return function(n){if(0===t.length)return 0===n.children.length;if(0===n.children.length)return!1;const e=Object.assign(Object.assign({},this),{collection:{},next:Ti}),r=gi(e,n.children[0],...t);return r&&wi(this.collection,e.collection),r}}function Ri(t,n){const e=[];for(let r=0,o=n.length;r<o;r++)e.push(t[r]),e.push(n[r]);return e.push(t[t.length-1]),e}function Ii(...t){if(Tr.isString(t[0])){const[n]=t;return t=>t.matches(n)}{const[n,...e]=t;return Ii(Ri(n,e).join(""))}}function Di(...t){if(Tr.isArray(t[0])){const[n,...e]=t,r=Ri(n,e).join("");return(...t)=>Di(r,...t)}if(Tr.isString(t[0])){const[n,...e]=t;return function(t){const r=Di(...e).call(this,t);return r&&wi(this.collection,{[n]:t}),r}}const[...e]=t;return function(t){return!n.isntElement(t)&&(0===e.length||e.every((n=>n.call(this,t))))}}bi.isAfter=void 0,bi.isAfter=function(t,n){return!!(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)},function(n){var r=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),o=t&&t.__exportStar||function(t,n){for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(n,e)||r(n,t,e)};o(e,n),o(c,n),o(l,n),o(v,n),o(ar,n),o(yr,n),o(vr,n),o(mr,n),o(i,n),o(br,n),o(gr,n),o(So,n),o(Do,n),o(Po,n),o(ur,n),o(cr,n),o(Co,n),o(Bo,n),o(Uo,n),o(Mo,n),o(Fo,n),o(Xo,n),o($o,n),o(Nr,n),o(Ko,n),o(To,n),o(Zo,n),o(ni,n),o(ri,n),o(ii,n),o(ci,n),o(li,n),o(di,n),o(Er,n),o(vi,n),o(mi,n),o(hi,n),o(bi,n)}(n);var Pi={},xi={};xi.of=void 0,xi.of=function*(t){yield t};var ji={},Ci={},Bi={};Bi.go=void 0,Bi.go=function(t){return t()},function(n){var e=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]});(t&&t.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)})(Bi,n)}(Ci),ji.repeat=void 0;const Ui=N,Ji=Ci;ji.repeat=function(t,n=1/0){return(0,Ui.assert)(n===1/0||Number.isInteger(n),"The parameter times must be an integer"),(0,Ji.go)((function*(){for(;n-- >0;)yield t}))};var Yi={};Yi.countdown=void 0,Yi.countdown=function*(t,n){if(!(t<n))for(let e=t;e>=n;e--)yield e};var Mi={};Mi.countup=void 0,Mi.countup=function*(t,n){if(!(t>n))for(let e=t;e<=n;e++)yield e};var qi={range:void 0};const ki=N;qi.range=function(t,n,e=1){return(0,ki.assert)(e>0,"step parameter must be greater than 0"),function*(t,n,e){if(t<n)for(let r=t;r<n;r+=e)yield r;else for(let r=t;r>n;r-=e)yield r}(t,n,e)};var Fi={};Fi.stringifyJSONStream=void 0,Fi.stringifyJSONStream=function*(t){var n;const e=t[Symbol.iterator]();let r;try{let t;for(({value:t,done:r}=e.next()),yield"[",r||(yield JSON.stringify(t));({value:t,done:r}=e.next()),!r;)yield","+JSON.stringify(t);yield"]"}finally{r||null===(n=e.return)||void 0===n||n.call(e)}};var Li={};Li.stringifyJSONStreamAsync=void 0,Li.stringifyJSONStreamAsync=async function*(t){var n;const e=t[Symbol.asyncIterator]();let r;try{let t;for(({value:t,done:r}=await e.next()),yield"[",r||(yield JSON.stringify(t));({value:t,done:r}=await e.next()),!r;)yield","+JSON.stringify(t);yield"]"}finally{r||await(null===(n=e.return)||void 0===n?void 0:n.call(e))}};var Xi={};Xi.stringifyNDJSONStream=void 0,Xi.stringifyNDJSONStream=function*(t){var n;const e=t[Symbol.iterator]();let r;try{let t;for(({value:t,done:r}=e.next()),r||(yield JSON.stringify(t));({value:t,done:r}=e.next()),!r;)yield"\n"+JSON.stringify(t)}finally{r||null===(n=e.return)||void 0===n||n.call(e)}};var zi={};zi.stringifyNDJSONStreamAsync=void 0,zi.stringifyNDJSONStreamAsync=async function*(t){var n;const e=t[Symbol.asyncIterator]();let r;try{let t;for(({value:t,done:r}=await e.next()),r||(yield JSON.stringify(t));({value:t,done:r}=await e.next()),!r;)yield"\n"+JSON.stringify(t)}finally{r||await(null===(n=e.return)||void 0===n?void 0:n.call(e))}};var Gi={};Gi.sse=void 0,Gi.sse=function*(t){t.event&&(yield`event: ${t.event}\n`);for(const n of t.data.split("\n"))yield`data: ${n}\n`;t.id&&(yield`id: ${t.id}\n`),t.retry&&(yield`retry: ${t.retry}\n`),yield"\n"};var Hi={},$i={},Wi={},Vi=17976931348623157e292,Ki=/^\s+|\s+$/g,Qi=/^[-+]0x[0-9a-f]+$/i,Zi=/^0b[01]+$/i,ts=/^0o[0-7]+$/i,ns=parseInt,es=Object.prototype.toString;function rs(t,n){var e;if("function"!=typeof n)throw new TypeError("Expected a function");return t=function(t){var n=function(t){if(!t)return 0===t?t:0;if(Infinity===(t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==es.call(t)}(t))return NaN;if(os(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=os(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Ki,"");var e=Zi.test(t);return e||ts.test(t)?ns(t.slice(2),e?2:8):Qi.test(t)?NaN:+t}(t))||-Infinity===t){return(t<0?-1:1)*Vi}return t==t?t:0}(t),e=n%1;return n==n?e?n-e:n:0}(t),function(){return--t>0&&(e=n.apply(this,arguments)),t<=1&&(n=void 0),e}}function os(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var is=function(t){return rs(2,t)},ss=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Wi.lazy=void 0;const as=ss(is);Wi.lazy=function(t){return(0,as.default)(t)};var cs={lazyFunction:void 0};const us=Wi;cs.lazyFunction=function(t){const n=(0,us.lazy)(t);return(...t)=>n()(...t)},function(n){var e=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=t&&t.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Wi,n),r(cs,n)}($i);var ls,fs=t&&t.__classPrivateFieldGet||function(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)},ds=t&&t.__classPrivateFieldSet||function(t,n,e,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!o:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,e):o?o.value=e:n.set(t,e),e};Hi.ReusableIterable=void 0;const ys=$i;class vs{constructor(t){ls.set(this,void 0),this.getIterator=(0,ys.lazy)((()=>t[Symbol.iterator]()))}get done(){return fs(this,ls,"f")}close(){var t,n;this.done||(ds(this,ls,!0,"f"),null===(n=(t=this.getIterator()).return)||void 0===n||n.call(t))}[(ls=new WeakMap,Symbol.iterator)](){return{next:()=>{if(fs(this,ls,"f"))return{done:!0,value:void 0};const{value:t,done:n}=this.getIterator().next();return n&&ds(this,ls,!0,"f"),{value:t,done:n}}}}}Hi.ReusableIterable=vs;var ms,ps={},hs=t&&t.__classPrivateFieldGet||function(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)},bs=t&&t.__classPrivateFieldSet||function(t,n,e,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!o:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,e):o?o.value=e:n.set(t,e),e};ps.ReusableAsyncIterable=void 0;const gs=$i;class Ns{constructor(t){ms.set(this,void 0),this.getIterator=(0,gs.lazy)((()=>t[Symbol.asyncIterator]()))}get done(){return hs(this,ms,"f")}async close(){var t,n;this.done||(bs(this,ms,!0,"f"),await(null===(n=(t=this.getIterator()).return)||void 0===n?void 0:n.call(t)))}[(ms=new WeakMap,Symbol.asyncIterator)](){return{next:async()=>{if(hs(this,ms,"f"))return{done:!0,value:void 0};const{value:t,done:n}=await this.getIterator().next();return n&&bs(this,ms,!0,"f"),{value:t,done:n}}}}}ps.ReusableAsyncIterable=Ns;var Es,Ts={};function Os(t,n,e){let r=t;for(const t of Pi.countup(1,n)){if(!r)return t-1;if(!e.call(this,r))return t-1;r=this.next(r)}return n}function As([t,n],e,r={greedy:!0}){return N.assert(Number.isInteger(t),"parameter min must be an integer"),N.assert(Number.isInteger(n)||n===1/0,"parameter max must be an integer or Infinity"),N.assert(t>=0,"parameter min must be greater than or equal to 0"),N.assert(t<=n,"parameter max must be greater than or equal to min"),function*(o){if(r.greedy){let r=n;for(;;){const n=Os.call(this,o,r,e);if(n<t)break;if(yield n,r=n-1,r<t)break}}else for(const r of Pi.countup(t,n)){const t=Os.call(this,o,r,e);if(t<r)break;t===r&&(yield r)}}}function ws(...t){if(Tr.isArray(t[0])){const[n,...e]=t,r=Ri(n,e).join("");return(...t)=>ws(r,...t)}if(Tr.isString(t[0])){const[n,...e]=t;return function(t){const r=ws(...e).call(this,t);return r&&wi(this.collection,{[n]:t}),r}}const[...n]=t;return function(t){return 0===n.length||n.every((n=>n.call(this,t)))}}function _s(t){return As([0,1],t,{greedy:!0})}function Ss(t,n){return N.assert(Number.isInteger(t),"parameter times must be an integer"),N.assert(t>=0,"parameter number must be greater than or equal to 0"),function(e){return Os.call(this,e,t,n)===t&&t}}function Rs(t,n){return function(e){const r=t.call(this,e);return n(r),r}}function Is(t,{caseSensitive:n=!0,trim:e=!1}={}){return r=>{if(Tr.isNull(r.textContent))return!1;let o=r.textContent;return n||(o=o.toLowerCase(),t=t.toLowerCase()),e&&(o=o.trim()),o===t}}function Ds(t,{caseSensitive:n=!0,trim:e=!1}={}){return r=>{if(Tr.isNull(r.textContent))return!1;let o=r.textContent;return n||(o=o.toLowerCase(),t=t.toLowerCase()),e&&(o=o.trim()),o.includes(t)}}function Ps(t,{trim:n=!1}={}){return e=>{if(Tr.isNull(e.textContent))return!1;let r=e.textContent;return n&&(r=r.trim()),t.test(r)}}function xs(...t){if(Tr.isArray(t[0])){const[n,...e]=t,r=Ri(n,e).join("");return(...t)=>xs(r,...t)}if(Tr.isString(t[0])){const[n,...e]=t;return function(t){const r=xs(...e).call(this,t);return r&&wi(this.collection,{[n]:t}),r}}const[...e]=t;return function(t){return!n.isntTextNode(t)&&(0===e.length||e.every((n=>n.call(this,t))))}}Ts.timestampBasedId=void 0,Ts.timestampBasedId=function*(){const t=Date.now();yield[t,0];let n=t,e=0;for(;;){const t=Date.now();t===n?yield[n,++e]:(e=0,n=t,yield[n,e])}},function(n){var e=t&&t.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),r=t&&t.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(xi,n),r(ji,n),r(Yi,n),r(Mi,n),r(qi,n),r(Fi,n),r(Li,n),r(Xi,n),r(zi,n),r(Gi,n),r(Hi,n),r(ps,n),r(Ts,n)}(Pi),function(t){t[t.Min=0]="Min",t[t.Max=1]="Max"}(Es||(Es={}));const js="XPathResult"in globalThis?XPathResult.UNORDERED_NODE_ITERATOR_TYPE:4;function Cs(...t){if(Tr.isString(t[0])){const[n]=t;return N.assert(n.startsWith("//*"),'XPath expressions must start with "//*"'),function(t){return function(t,n,e){const r=t.evaluate(n,e,null,js,null);let o;for(;null!==(o=r.iterateNext());)if(o===e)return!0;return!1}(this.document,n,t)}}{const[n,...e]=t;return Cs(Ri(n,e).join(""))}}export{Ai as anyOf,_i as childNodes,Si as children,Ii as css,Di as element,Ei as match,Oi as matchElement,As as multiple,ws as node,_s as optional,Ss as repeat,Rs as tap,Is as textContentEquals,Ds as textContentIncludes,Ps as textContentMatches,xs as textNode,Cs as xpath};
9
2
  //# sourceMappingURL=index.min.mjs.map