@podlite/markdown
Version:
=markdown - markdown text block
2 lines • 411 kB
JavaScript
var Eh=Object.create;var ys=Object.defineProperty;var _h=Object.getOwnPropertyDescriptor;var Sh=Object.getOwnPropertyNames;var Ph=Object.getPrototypeOf,Fh=Object.prototype.hasOwnProperty;var ge=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),jf=(t,r)=>{for(var e in r)ys(t,e,{get:r[e],enumerable:!0})},Bf=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Sh(r))!Fh.call(t,o)&&o!==e&&ys(t,o,{get:()=>r[o],enumerable:!(n=_h(r,o))||n.enumerable});return t};var Fr=(t,r,e)=>(e=t!=null?Eh(Ph(t)):{},Bf(r||!t||!t.__esModule?ys(e,"default",{value:t,enumerable:!0}):e,t)),Th=t=>Bf(ys({},"__esModule",{value:!0}),t);var Ma=ge(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.getRules=Zi.isJSONType=void 0;var Ih=["string","number","integer","boolean","null","object","array"],Oh=new Set(Ih);function qh(t){return typeof t=="string"&&Oh.has(t)}Zi.isJSONType=qh;function Nh(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Zi.getRules=Nh});var Va=ge(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.shouldUseRule=Gn.shouldUseGroup=Gn.schemaHasRulesForType=void 0;function Dh({schema:t,self:r},e){let n=r.RULES.types[e];return n&&n!==!0&&zf(t,n)}Gn.schemaHasRulesForType=Dh;function zf(t,r){return r.rules.some(e=>Mf(t,e))}Gn.shouldUseGroup=zf;function Mf(t,r){var e;return t[r.keyword]!==void 0||((e=r.definition.implements)===null||e===void 0?void 0:e.some(n=>t[n]!==void 0))}Gn.shouldUseRule=Mf});var $s=ge(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.getProperty=ct.safeStringify=ct.stringify=ct.strConcat=ct.addCodeArg=ct.str=ct._=ct.nil=ct._Code=ct.Name=ct.IDENTIFIER=ct._CodeOrName=void 0;var Ao=class{};ct._CodeOrName=Ao;ct.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var hi=class extends Ao{constructor(r){if(super(),!ct.IDENTIFIER.test(r))throw new Error("CodeGen: name must be a valid identifier");this.str=r}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ct.Name=hi;var dn=class extends Ao{constructor(r){super(),this._items=typeof r=="string"?[r]:r}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let r=this._items[0];return r===""||r==='""'}get str(){var r;return(r=this._str)!==null&&r!==void 0?r:this._str=this._items.reduce((e,n)=>`${e}${n}`,"")}get names(){var r;return(r=this._names)!==null&&r!==void 0?r:this._names=this._items.reduce((e,n)=>(n instanceof hi&&(e[n.str]=(e[n.str]||0)+1),e),{})}};ct._Code=dn;ct.nil=new dn("");function Vf(t,...r){let e=[t[0]],n=0;for(;n<r.length;)Ha(e,r[n]),e.push(t[++n]);return new dn(e)}ct._=Vf;var Ua=new dn("+");function Uf(t,...r){let e=[Eo(t[0])],n=0;for(;n<r.length;)e.push(Ua),Ha(e,r[n]),e.push(Ua,Eo(t[++n]));return Rh(e),new dn(e)}ct.str=Uf;function Ha(t,r){r instanceof dn?t.push(...r._items):r instanceof hi?t.push(r):t.push(Bh(r))}ct.addCodeArg=Ha;function Rh(t){let r=1;for(;r<t.length-1;){if(t[r]===Ua){let e=Lh(t[r-1],t[r+1]);if(e!==void 0){t.splice(r-1,3,e);continue}t[r++]="+"}r++}}function Lh(t,r){if(r==='""')return t;if(t==='""')return r;if(typeof t=="string")return r instanceof hi||t[t.length-1]!=='"'?void 0:typeof r!="string"?`${t.slice(0,-1)}${r}"`:r[0]==='"'?t.slice(0,-1)+r.slice(1):void 0;if(typeof r=="string"&&r[0]==='"'&&!(t instanceof hi))return`"${t}${r.slice(1)}`}function jh(t,r){return r.emptyStr()?t:t.emptyStr()?r:Uf`${t}${r}`}ct.strConcat=jh;function Bh(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Eo(Array.isArray(t)?t.join(","):t)}function zh(t){return new dn(Eo(t))}ct.stringify=zh;function Eo(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ct.safeStringify=Eo;function Mh(t){return typeof t=="string"&&ct.IDENTIFIER.test(t)?new dn(`.${t}`):Vf`[${t}]`}ct.getProperty=Mh});var Za=ge(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.ValueScope=dr.ValueScopeName=dr.Scope=dr.varKinds=dr.UsedValueState=void 0;var Cr=$s(),Ga=class extends Error{constructor(r){super(`CodeGen: "code" for ${r} not defined`),this.value=r.value}},Ka;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ka=dr.UsedValueState||(dr.UsedValueState={}));dr.varKinds={const:new Cr.Name("const"),let:new Cr.Name("let"),var:new Cr.Name("var")};var bs=class{constructor({prefixes:r,parent:e}={}){this._names={},this._prefixes=r,this._parent=e}toName(r){return r instanceof Cr.Name?r:this.name(r)}name(r){return new Cr.Name(this._newName(r))}_newName(r){let e=this._names[r]||this._nameGroup(r);return`${r}${e.index++}`}_nameGroup(r){var e,n;if(((n=(e=this._parent)===null||e===void 0?void 0:e._prefixes)===null||n===void 0?void 0:n.has(r))||this._prefixes&&!this._prefixes.has(r))throw new Error(`CodeGen: prefix "${r}" is not allowed in this scope`);return this._names[r]={prefix:r,index:0}}};dr.Scope=bs;var vs=class extends Cr.Name{constructor(r,e){super(e),this.prefix=r}setValue(r,{property:e,itemIndex:n}){this.value=r,this.scopePath=Cr._`.${new Cr.Name(e)}[${n}]`}};dr.ValueScopeName=vs;var Vh=Cr._`\n`,Wa=class extends bs{constructor(r){super(r),this._values={},this._scope=r.scope,this.opts={...r,_n:r.lines?Vh:Cr.nil}}get(){return this._scope}name(r){return new vs(r,this._newName(r))}value(r,e){var n;if(e.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(r),{prefix:s}=o,l=(n=e.key)!==null&&n!==void 0?n:e.ref,f=this._values[s];if(f){let m=f.get(l);if(m)return m}else f=this._values[s]=new Map;f.set(l,o);let c=this._scope[s]||(this._scope[s]=[]),g=c.length;return c[g]=e.ref,o.setValue(e,{property:s,itemIndex:g}),o}getValue(r,e){let n=this._values[r];if(!!n)return n.get(e)}scopeRefs(r,e=this._values){return this._reduceValues(e,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return Cr._`${r}${n.scopePath}`})}scopeCode(r=this._values,e,n){return this._reduceValues(r,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},e,n)}_reduceValues(r,e,n={},o){let s=Cr.nil;for(let l in r){let f=r[l];if(!f)continue;let c=n[l]=n[l]||new Map;f.forEach(g=>{if(c.has(g))return;c.set(g,Ka.Started);let m=e(g);if(m){let v=this.opts.es5?dr.varKinds.var:dr.varKinds.const;s=Cr._`${s}${v} ${g} = ${m};${this.opts._n}`}else if(m=o==null?void 0:o(g))s=Cr._`${s}${m}${this.opts._n}`;else throw new Ga(g);c.set(g,Ka.Completed)})}return s}};dr.ValueScope=Wa});var Le=ge(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.or=je.and=je.not=je.CodeGen=je.operators=je.varKinds=je.ValueScopeName=je.ValueScope=je.Scope=je.Name=je.stringify=je.getProperty=je.nil=je.strConcat=je.str=je._=void 0;var Ge=$s(),Zr=Za(),$i=$s();Object.defineProperty(je,"_",{enumerable:!0,get:function(){return $i._}});Object.defineProperty(je,"str",{enumerable:!0,get:function(){return $i.str}});Object.defineProperty(je,"strConcat",{enumerable:!0,get:function(){return $i.strConcat}});Object.defineProperty(je,"nil",{enumerable:!0,get:function(){return $i.nil}});Object.defineProperty(je,"getProperty",{enumerable:!0,get:function(){return $i.getProperty}});Object.defineProperty(je,"stringify",{enumerable:!0,get:function(){return $i.stringify}});Object.defineProperty(je,"Name",{enumerable:!0,get:function(){return $i.Name}});var Cs=Za();Object.defineProperty(je,"Scope",{enumerable:!0,get:function(){return Cs.Scope}});Object.defineProperty(je,"ValueScope",{enumerable:!0,get:function(){return Cs.ValueScope}});Object.defineProperty(je,"ValueScopeName",{enumerable:!0,get:function(){return Cs.ValueScopeName}});Object.defineProperty(je,"varKinds",{enumerable:!0,get:function(){return Cs.varKinds}});je.operators={GT:new Ge._Code(">"),GTE:new Ge._Code(">="),LT:new Ge._Code("<"),LTE:new Ge._Code("<="),EQ:new Ge._Code("==="),NEQ:new Ge._Code("!=="),NOT:new Ge._Code("!"),OR:new Ge._Code("||"),AND:new Ge._Code("&&"),ADD:new Ge._Code("+")};var In=class{optimizeNodes(){return this}optimizeNames(r,e){return this}},Ja=class extends In{constructor(r,e,n){super(),this.varKind=r,this.name=e,this.rhs=n}render({es5:r,_n:e}){let n=r?Zr.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+e}optimizeNames(r,e){if(!!r[this.name.str])return this.rhs&&(this.rhs=Qi(this.rhs,r,e)),this}get names(){return this.rhs instanceof Ge._CodeOrName?this.rhs.names:{}}},ks=class extends In{constructor(r,e,n){super(),this.lhs=r,this.rhs=e,this.sideEffects=n}render({_n:r}){return`${this.lhs} = ${this.rhs};`+r}optimizeNames(r,e){if(!(this.lhs instanceof Ge.Name&&!r[this.lhs.str]&&!this.sideEffects))return this.rhs=Qi(this.rhs,r,e),this}get names(){let r=this.lhs instanceof Ge.Name?{}:{...this.lhs.names};return xs(r,this.rhs)}},Qa=class extends ks{constructor(r,e,n,o){super(r,n,o),this.op=e}render({_n:r}){return`${this.lhs} ${this.op}= ${this.rhs};`+r}},Ya=class extends In{constructor(r){super(),this.label=r,this.names={}}render({_n:r}){return`${this.label}:`+r}},Xa=class extends In{constructor(r){super(),this.label=r,this.names={}}render({_n:r}){return`break${this.label?` ${this.label}`:""};`+r}},el=class extends In{constructor(r){super(),this.error=r}render({_n:r}){return`throw ${this.error};`+r}get names(){return this.error.names}},tl=class extends In{constructor(r){super(),this.code=r}render({_n:r}){return`${this.code};`+r}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(r,e){return this.code=Qi(this.code,r,e),this}get names(){return this.code instanceof Ge._CodeOrName?this.code.names:{}}},_o=class extends In{constructor(r=[]){super(),this.nodes=r}render(r){return this.nodes.reduce((e,n)=>e+n.render(r),"")}optimizeNodes(){let{nodes:r}=this,e=r.length;for(;e--;){let n=r[e].optimizeNodes();Array.isArray(n)?r.splice(e,1,...n):n?r[e]=n:r.splice(e,1)}return r.length>0?this:void 0}optimizeNames(r,e){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(r,e)||(Uh(r,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((r,e)=>yi(r,e.names),{})}},On=class extends _o{render(r){return"{"+r._n+super.render(r)+"}"+r._n}},rl=class extends _o{},Ji=class extends On{};Ji.kind="else";var Jr=class extends On{constructor(r,e){super(e),this.condition=r}render(r){let e=`if(${this.condition})`+super.render(r);return this.else&&(e+="else "+this.else.render(r)),e}optimizeNodes(){super.optimizeNodes();let r=this.condition;if(r===!0)return this.nodes;let e=this.else;if(e){let n=e.optimizeNodes();e=this.else=Array.isArray(n)?new Ji(n):n}if(e)return r===!1?e instanceof Jr?e:e.nodes:this.nodes.length?this:new Jr(Hf(r),e instanceof Jr?[e]:e.nodes);if(!(r===!1||!this.nodes.length))return this}optimizeNames(r,e){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(r,e),!!(super.optimizeNames(r,e)||this.else))return this.condition=Qi(this.condition,r,e),this}get names(){let r=super.names;return xs(r,this.condition),this.else&&yi(r,this.else.names),r}};Jr.kind="if";var gi=class extends On{};gi.kind="for";var nl=class extends gi{constructor(r){super(),this.iteration=r}render(r){return`for(${this.iteration})`+super.render(r)}optimizeNames(r,e){if(!!super.optimizeNames(r,e))return this.iteration=Qi(this.iteration,r,e),this}get names(){return yi(super.names,this.iteration.names)}},il=class extends gi{constructor(r,e,n,o){super(),this.varKind=r,this.name=e,this.from=n,this.to=o}render(r){let e=r.es5?Zr.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${e} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(r)}get names(){let r=xs(super.names,this.from);return xs(r,this.to)}},ws=class extends gi{constructor(r,e,n,o){super(),this.loop=r,this.varKind=e,this.name=n,this.iterable=o}render(r){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(r)}optimizeNames(r,e){if(!!super.optimizeNames(r,e))return this.iterable=Qi(this.iterable,r,e),this}get names(){return yi(super.names,this.iterable.names)}},So=class extends On{constructor(r,e,n){super(),this.name=r,this.args=e,this.async=n}render(r){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(r)}};So.kind="func";var Po=class extends _o{render(r){return"return "+super.render(r)}};Po.kind="return";var ol=class extends On{render(r){let e="try"+super.render(r);return this.catch&&(e+=this.catch.render(r)),this.finally&&(e+=this.finally.render(r)),e}optimizeNodes(){var r,e;return super.optimizeNodes(),(r=this.catch)===null||r===void 0||r.optimizeNodes(),(e=this.finally)===null||e===void 0||e.optimizeNodes(),this}optimizeNames(r,e){var n,o;return super.optimizeNames(r,e),(n=this.catch)===null||n===void 0||n.optimizeNames(r,e),(o=this.finally)===null||o===void 0||o.optimizeNames(r,e),this}get names(){let r=super.names;return this.catch&&yi(r,this.catch.names),this.finally&&yi(r,this.finally.names),r}},Fo=class extends On{constructor(r){super(),this.error=r}render(r){return`catch(${this.error})`+super.render(r)}};Fo.kind="catch";var To=class extends On{render(r){return"finally"+super.render(r)}};To.kind="finally";var sl=class{constructor(r,e={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...e,_n:e.lines?`
`:""},this._extScope=r,this._scope=new Zr.Scope({parent:r}),this._nodes=[new rl]}toString(){return this._root.render(this.opts)}name(r){return this._scope.name(r)}scopeName(r){return this._extScope.name(r)}scopeValue(r,e){let n=this._extScope.value(r,e);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(r,e){return this._extScope.getValue(r,e)}scopeRefs(r){return this._extScope.scopeRefs(r,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(r,e,n,o){let s=this._scope.toName(e);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new Ja(r,s,n)),s}const(r,e,n){return this._def(Zr.varKinds.const,r,e,n)}let(r,e,n){return this._def(Zr.varKinds.let,r,e,n)}var(r,e,n){return this._def(Zr.varKinds.var,r,e,n)}assign(r,e,n){return this._leafNode(new ks(r,e,n))}add(r,e){return this._leafNode(new Qa(r,je.operators.ADD,e))}code(r){return typeof r=="function"?r():r!==Ge.nil&&this._leafNode(new tl(r)),this}object(...r){let e=["{"];for(let[n,o]of r)e.length>1&&e.push(","),e.push(n),(n!==o||this.opts.es5)&&(e.push(":"),Ge.addCodeArg(e,o));return e.push("}"),new Ge._Code(e)}if(r,e,n){if(this._blockNode(new Jr(r)),e&&n)this.code(e).else().code(n).endIf();else if(e)this.code(e).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(r){return this._elseNode(new Jr(r))}else(){return this._elseNode(new Ji)}endIf(){return this._endBlockNode(Jr,Ji)}_for(r,e){return this._blockNode(r),e&&this.code(e).endFor(),this}for(r,e){return this._for(new nl(r),e)}forRange(r,e,n,o,s=this.opts.es5?Zr.varKinds.var:Zr.varKinds.let){let l=this._scope.toName(r);return this._for(new il(s,l,e,n),()=>o(l))}forOf(r,e,n,o=Zr.varKinds.const){let s=this._scope.toName(r);if(this.opts.es5){let l=e instanceof Ge.Name?e:this.var("_arr",e);return this.forRange("_i",0,Ge._`${l}.length`,f=>{this.var(s,Ge._`${l}[${f}]`),n(s)})}return this._for(new ws("of",o,s,e),()=>n(s))}forIn(r,e,n,o=this.opts.es5?Zr.varKinds.var:Zr.varKinds.const){if(this.opts.ownProperties)return this.forOf(r,Ge._`Object.keys(${e})`,n);let s=this._scope.toName(r);return this._for(new ws("in",o,s,e),()=>n(s))}endFor(){return this._endBlockNode(gi)}label(r){return this._leafNode(new Ya(r))}break(r){return this._leafNode(new Xa(r))}return(r){let e=new Po;if(this._blockNode(e),this.code(r),e.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Po)}try(r,e,n){if(!e&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new ol;if(this._blockNode(o),this.code(r),e){let s=this.name("e");this._currNode=o.catch=new Fo(s),e(s)}return n&&(this._currNode=o.finally=new To,this.code(n)),this._endBlockNode(Fo,To)}throw(r){return this._leafNode(new el(r))}block(r,e){return this._blockStarts.push(this._nodes.length),r&&this.code(r).endBlock(e),this}endBlock(r){let e=this._blockStarts.pop();if(e===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-e;if(n<0||r!==void 0&&n!==r)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${r} expected`);return this._nodes.length=e,this}func(r,e=Ge.nil,n,o){return this._blockNode(new So(r,e,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(So)}optimize(r=1){for(;r-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(r){return this._currNode.nodes.push(r),this}_blockNode(r){this._currNode.nodes.push(r),this._nodes.push(r)}_endBlockNode(r,e){let n=this._currNode;if(n instanceof r||e&&n instanceof e)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${e?`${r.kind}/${e.kind}`:r.kind}"`)}_elseNode(r){let e=this._currNode;if(!(e instanceof Jr))throw new Error('CodeGen: "else" without "if"');return this._currNode=e.else=r,this}get _root(){return this._nodes[0]}get _currNode(){let r=this._nodes;return r[r.length-1]}set _currNode(r){let e=this._nodes;e[e.length-1]=r}};je.CodeGen=sl;function yi(t,r){for(let e in r)t[e]=(t[e]||0)+(r[e]||0);return t}function xs(t,r){return r instanceof Ge._CodeOrName?yi(t,r.names):t}function Qi(t,r,e){if(t instanceof Ge.Name)return n(t);if(!o(t))return t;return new Ge._Code(t._items.reduce((s,l)=>(l instanceof Ge.Name&&(l=n(l)),l instanceof Ge._Code?s.push(...l._items):s.push(l),s),[]));function n(s){let l=e[s.str];return l===void 0||r[s.str]!==1?s:(delete r[s.str],l)}function o(s){return s instanceof Ge._Code&&s._items.some(l=>l instanceof Ge.Name&&r[l.str]===1&&e[l.str]!==void 0)}}function Uh(t,r){for(let e in r)t[e]=(t[e]||0)-(r[e]||0)}function Hf(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:Ge._`!${al(t)}`}je.not=Hf;var Hh=Gf(je.operators.AND);function Gh(...t){return t.reduce(Hh)}je.and=Gh;var Kh=Gf(je.operators.OR);function Wh(...t){return t.reduce(Kh)}je.or=Wh;function Gf(t){return(r,e)=>r===Ge.nil?e:e===Ge.nil?r:Ge._`${al(r)} ${t} ${al(e)}`}function al(t){return t instanceof Ge.Name?t:Ge._`(${t})`}});var Qr=ge(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});var tr=Le(),Zh={data:new tr.Name("data"),valCxt:new tr.Name("valCxt"),dataPath:new tr.Name("dataPath"),parentData:new tr.Name("parentData"),parentDataProperty:new tr.Name("parentDataProperty"),rootData:new tr.Name("rootData"),dynamicAnchors:new tr.Name("dynamicAnchors"),vErrors:new tr.Name("vErrors"),errors:new tr.Name("errors"),this:new tr.Name("this"),self:new tr.Name("self"),scope:new tr.Name("scope"),json:new tr.Name("json"),jsonPos:new tr.Name("jsonPos"),jsonLen:new tr.Name("jsonLen"),jsonPart:new tr.Name("jsonPart")};ll.default=Zh});var Io=ge(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.extendErrors=rr.resetErrorsCount=rr.reportExtraError=rr.reportError=rr.keyword$DataError=rr.keywordError=void 0;var Ke=Le(),nr=Qr();rr.keywordError={message:({keyword:t})=>Ke.str`should pass "${t}" keyword validation`};rr.keyword$DataError={message:({keyword:t,schemaType:r})=>r?Ke.str`"${t}" keyword must be ${r} ($data)`:Ke.str`"${t}" keyword is invalid ($data)`};function Jh(t,r=rr.keywordError,e){let{it:n}=t,{gen:o,compositeRule:s,allErrors:l}=n,f=Zf(t,r);e??(s||l)?Kf(o,f):Wf(n,Ke._`[${f}]`)}rr.reportError=Jh;function Qh(t,r=rr.keywordError){let{it:e}=t,{gen:n,compositeRule:o,allErrors:s}=e,l=Zf(t,r);Kf(n,l),o||s||Wf(e,nr.default.vErrors)}rr.reportExtraError=Qh;function Yh(t,r){t.assign(nr.default.errors,r),t.if(Ke._`${nr.default.vErrors} !== null`,()=>t.if(r,()=>t.assign(Ke._`${nr.default.vErrors}.length`,r),()=>t.assign(nr.default.vErrors,null)))}rr.resetErrorsCount=Yh;function Xh({gen:t,keyword:r,schemaValue:e,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let l=t.name("err");t.forRange("i",o,nr.default.errors,f=>{t.const(l,Ke._`${nr.default.vErrors}[${f}]`),t.if(Ke._`${l}.dataPath === undefined`,()=>t.assign(Ke._`${l}.dataPath`,Ke.strConcat(nr.default.dataPath,s.errorPath))),t.assign(Ke._`${l}.schemaPath`,Ke.str`${s.errSchemaPath}/${r}`),s.opts.verbose&&(t.assign(Ke._`${l}.schema`,e),t.assign(Ke._`${l}.data`,n))})}rr.extendErrors=Xh;function Kf(t,r){let e=t.const("err",r);t.if(Ke._`${nr.default.vErrors} === null`,()=>t.assign(nr.default.vErrors,Ke._`[${e}]`),Ke._`${nr.default.vErrors}.push(${e})`),t.code(Ke._`${nr.default.errors}++`)}function Wf(t,r){let{gen:e,validateName:n,schemaEnv:o}=t;o.$async?e.throw(Ke._`new ${t.ValidationError}(${r})`):(e.assign(Ke._`${n}.errors`,r),e.return(!1))}var mn={keyword:new Ke.Name("keyword"),schemaPath:new Ke.Name("schemaPath"),params:new Ke.Name("params"),propertyName:new Ke.Name("propertyName"),message:new Ke.Name("message"),schema:new Ke.Name("schema"),parentSchema:new Ke.Name("parentSchema"),instancePath:new Ke.Name("instancePath")};function Zf(t,r){let{createErrors:e,opts:n}=t.it;return e===!1?Ke._`{}`:(n.jtd&&!n.ajvErrors?eg:tg)(t,r)}function eg(t,{message:r}){let{gen:e,keyword:n,it:o}=t,{errorPath:s,errSchemaPath:l,opts:f}=o,c=[[mn.instancePath,Ke.strConcat(nr.default.dataPath,s)],[mn.schemaPath,Ke.str`${l}/${n}`]];return f.messages&&c.push([mn.message,typeof r=="function"?r(t):r]),e.object(...c)}function tg(t,r){let{gen:e,keyword:n,data:o,schemaValue:s,it:l}=t,{topSchemaRef:f,schemaPath:c,errorPath:g,errSchemaPath:m,propertyName:v,opts:x}=l,{params:k,message:_}=r,O=[[mn.keyword,n],[nr.default.dataPath,Ke.strConcat(nr.default.dataPath,g)],[mn.schemaPath,Ke.str`${m}/${n}`],[mn.params,typeof k=="function"?k(t):k||Ke._`{}`]];return v&&O.push([mn.propertyName,v]),x.messages&&O.push([mn.message,typeof _=="function"?_(t):_]),x.verbose&&O.push([mn.schema,s],[mn.parentSchema,Ke._`${f}${c}`],[nr.default.data,o]),e.object(...O)}});var Qf=ge(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.boolOrEmptySchema=Yi.topBoolOrEmptySchema=void 0;var rg=Io(),ng=Le(),ig=Qr(),og={message:"boolean schema is false"};function sg(t){let{gen:r,schema:e,validateName:n}=t;e===!1?Jf(t,!1):typeof e=="object"&&e.$async===!0?r.return(ig.default.data):(r.assign(ng._`${n}.errors`,null),r.return(!0))}Yi.topBoolOrEmptySchema=sg;function ag(t,r){let{gen:e,schema:n}=t;n===!1?(e.var(r,!1),Jf(t)):e.var(r,!0)}Yi.boolOrEmptySchema=ag;function Jf(t,r){let{gen:e,data:n}=t,o={gen:e,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};rg.reportError(o,og,r)}});var Xf=ge(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.assignDefaults=void 0;var Xi=Le(),lg=Tr();function ug(t,r){let{properties:e,items:n}=t.schema;if(r==="object"&&e)for(let o in e)Yf(t,o,e[o].default);else r==="array"&&Array.isArray(n)&&n.forEach((o,s)=>Yf(t,s,o.default))}As.assignDefaults=ug;function Yf(t,r,e){let{gen:n,compositeRule:o,data:s,opts:l}=t;if(e===void 0)return;let f=Xi._`${s}${Xi.getProperty(r)}`;if(o){lg.checkStrictMode(t,`default is ignored for: ${f}`);return}let c=Xi._`${f} === undefined`;l.useDefaults==="empty"&&(c=Xi._`${c} || ${f} === null || ${f} === ""`),n.if(c,Xi._`${f} = ${Xi.stringify(e)}`)}});var vi=ge(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.applySubschema=bi.Type=void 0;var fg=Tr(),ec=St(),ir=Le(),tc;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(tc=bi.Type||(bi.Type={}));function cg(t,r,e){let n=pg(t,r);dg(n,t,r),mg(n,r);let o={...t,...n,items:void 0,props:void 0};return fg.subschemaCode(o,e),o}bi.applySubschema=cg;function pg(t,{keyword:r,schemaProp:e,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:l}){if(r!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(r!==void 0){let f=t.schema[r];return e===void 0?{schema:f,schemaPath:ir._`${t.schemaPath}${ir.getProperty(r)}`,errSchemaPath:`${t.errSchemaPath}/${r}`}:{schema:f[e],schemaPath:ir._`${t.schemaPath}${ir.getProperty(r)}${ir.getProperty(e)}`,errSchemaPath:`${t.errSchemaPath}/${r}/${ec.escapeFragment(e)}`}}if(n!==void 0){if(o===void 0||s===void 0||l===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:l,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}function dg(t,r,{dataProp:e,dataPropType:n,data:o,dataTypes:s,propertyName:l}){if(o!==void 0&&e!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:f}=r;if(e!==void 0){let{errorPath:g,dataPathArr:m,opts:v}=r,x=f.let("data",ir._`${r.data}${ir.getProperty(e)}`,!0);c(x),t.errorPath=ir.str`${g}${hg(e,n,v.jsPropertySyntax)}`,t.parentDataProperty=ir._`${e}`,t.dataPathArr=[...m,t.parentDataProperty]}if(o!==void 0){let g=o instanceof ir.Name?o:f.let("data",o,!0);c(g),l!==void 0&&(t.propertyName=l)}s&&(t.dataTypes=s);function c(g){t.data=g,t.dataLevel=r.dataLevel+1,t.dataTypes=[],r.definedProperties=new Set,t.parentData=r.data,t.dataNames=[...r.dataNames,g]}}function mg(t,{jtdDiscriminator:r,jtdMetadata:e,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=r,t.jtdMetadata=e}function hg(t,r,e){if(t instanceof ir.Name){let n=r===tc.Num;return e?n?ir._`"[" + ${t} + "]"`:ir._`"['" + ${t} + "']"`:n?ir._`"/" + ${t}`:ir._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return e?ir.getProperty(t).toString():"/"+ec.escapeJsonPointer(t)}});var Yr=ge(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.validateUnion=pt.validateArray=pt.usePattern=pt.callValidateCode=pt.schemaProperties=pt.allSchemaProperties=pt.noPropertyInData=pt.propertyInData=pt.isOwnProperty=pt.hasPropFunc=pt.reportMissingProp=pt.checkMissingProp=pt.checkReportMissingProp=void 0;var Ct=Le(),rc=St(),gg=vi(),Kn=Qr();function yg(t,r){let{gen:e,data:n,it:o}=t;e.if(fl(e,n,r,o.opts.ownProperties),()=>{t.setParams({missingProperty:Ct._`${r}`},!0),t.error()})}pt.checkReportMissingProp=yg;function $g({gen:t,data:r,it:{opts:e}},n,o){return Ct.or(...n.map(s=>Ct.and(fl(t,r,s,e.ownProperties),Ct._`${o} = ${s}`)))}pt.checkMissingProp=$g;function bg(t,r){t.setParams({missingProperty:r},!0),t.error()}pt.reportMissingProp=bg;function nc(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Ct._`Object.prototype.hasOwnProperty`})}pt.hasPropFunc=nc;function ul(t,r,e){return Ct._`${nc(t)}.call(${r}, ${e})`}pt.isOwnProperty=ul;function vg(t,r,e,n){let o=Ct._`${r}${Ct.getProperty(e)} !== undefined`;return n?Ct._`${o} && ${ul(t,r,e)}`:o}pt.propertyInData=vg;function fl(t,r,e,n){let o=Ct._`${r}${Ct.getProperty(e)} === undefined`;return n?Ct.or(o,Ct.not(ul(t,r,e))):o}pt.noPropertyInData=fl;function ic(t){return t?Object.keys(t).filter(r=>r!=="__proto__"):[]}pt.allSchemaProperties=ic;function kg(t,r){return ic(r).filter(e=>!rc.alwaysValidSchema(t,r[e]))}pt.schemaProperties=kg;function wg({schemaCode:t,data:r,it:{gen:e,topSchemaRef:n,schemaPath:o,errorPath:s},it:l},f,c,g){let m=g?Ct._`${t}, ${r}, ${n}${o}`:r,v=[[Kn.default.dataPath,Ct.strConcat(Kn.default.dataPath,s)],[Kn.default.parentData,l.parentData],[Kn.default.parentDataProperty,l.parentDataProperty],[Kn.default.rootData,Kn.default.rootData]];l.opts.dynamicRef&&v.push([Kn.default.dynamicAnchors,Kn.default.dynamicAnchors]);let x=Ct._`${m}, ${e.object(...v)}`;return c!==Ct.nil?Ct._`${f}.call(${c}, ${x})`:Ct._`${f}(${x})`}pt.callValidateCode=wg;function xg(t,r){return t.scopeValue("pattern",{key:r,ref:new RegExp(r,"u"),code:Ct._`new RegExp(${r}, "u")`})}pt.usePattern=xg;function Cg(t){let{gen:r,data:e,keyword:n,it:o}=t,s=r.name("valid");if(o.allErrors){let f=r.let("valid",!0);return l(()=>r.assign(f,!1)),f}return r.var(s,!0),l(()=>r.break()),s;function l(f){let c=r.const("len",Ct._`${e}.length`);r.forRange("i",0,c,g=>{t.subschema({keyword:n,dataProp:g,dataPropType:gg.Type.Num},s),r.if(Ct.not(s),f)})}}pt.validateArray=Cg;function Ag(t){let{gen:r,schema:e,keyword:n,it:o}=t;if(!Array.isArray(e))throw new Error("ajv implementation error");if(e.some(c=>rc.alwaysValidSchema(o,c))&&!o.opts.unevaluated)return;let l=r.let("valid",!1),f=r.name("_valid");r.block(()=>e.forEach((c,g)=>{let m=t.subschema({keyword:n,schemaProp:g,compositeRule:!0},f);r.assign(l,Ct._`${l} || ${f}`),t.mergeValidEvaluated(m,f)||r.if(Ct.not(l))})),t.result(l,()=>t.reset(),()=>t.error(!0))}pt.validateUnion=Ag});var lc=ge(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.keywordCode=void 0;var Eg=Oo(),_g=Io(),Sg=Yr(),mr=Le(),ki=Qr();function Pg(t,r,e,n){let o=new Eg.default(t,e,r);"code"in e?e.code(o,n):o.$data&&e.validate?oc(o,e):"macro"in e?Fg(o,e):(e.compile||e.validate)&&oc(o,e)}Es.keywordCode=Pg;function Fg(t,r){let{gen:e,keyword:n,schema:o,parentSchema:s,it:l}=t,f=r.macro.call(l.self,o,s,l),c=ac(e,n,f);l.opts.validateSchema!==!1&&l.self.validateSchema(f,!0);let g=e.name("valid");t.subschema({schema:f,schemaPath:mr.nil,errSchemaPath:`${l.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},g),t.pass(g,()=>t.error(!0))}function oc(t,r){var e;let{gen:n,keyword:o,schema:s,parentSchema:l,$data:f,it:c}=t;Ig(c,r);let g=!f&&r.compile?r.compile.call(c.self,s,l,c):r.validate,m=ac(n,o,g),v=n.let("valid");t.block$data(v,x),t.ok((e=r.valid)!==null&&e!==void 0?e:v);function x(){if(r.errors===!1)O(),r.modifying&&sc(t),D(()=>t.error());else{let M=r.async?k():_();r.modifying&&sc(t),D(()=>Tg(t,M))}}function k(){let M=n.let("ruleErrs",null);return n.try(()=>O(mr._`await `),X=>n.assign(v,!1).if(mr._`${X} instanceof ${c.ValidationError}`,()=>n.assign(M,mr._`${X}.errors`),()=>n.throw(X))),M}function _(){let M=mr._`${m}.errors`;return n.assign(M,null),O(mr.nil),M}function O(M=r.async?mr._`await `:mr.nil){let X=c.opts.passContext?ki.default.this:ki.default.self,le=!("compile"in r&&!f||r.schema===!1);n.assign(v,mr._`${M}${Sg.callValidateCode(t,m,X,le)}`,r.modifying)}function D(M){var X;n.if(mr.not((X=r.valid)!==null&&X!==void 0?X:v),M)}}function sc(t){let{gen:r,data:e,it:n}=t;r.if(n.parentData,()=>r.assign(e,mr._`${n.parentData}[${n.parentDataProperty}]`))}function Tg(t,r){let{gen:e}=t;e.if(mr._`Array.isArray(${r})`,()=>{e.assign(ki.default.vErrors,mr._`${ki.default.vErrors} === null ? ${r} : ${ki.default.vErrors}.concat(${r})`).assign(ki.default.errors,mr._`${ki.default.vErrors}.length`),_g.extendErrors(t)},()=>t.error())}function Ig({schemaEnv:t},r){if(r.async&&!t.$async)throw new Error("async keyword in sync schema")}function ac(t,r,e){if(e===void 0)throw new Error(`keyword "${r}" failed to compile`);return t.scopeValue("keyword",typeof e=="function"?{ref:e}:{ref:e,code:mr.stringify(e)})}});var dc=ge(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.schemaKeywords=void 0;var cl=Va(),uc=eo(),Og=Xf(),pc=lc(),qg=St(),Ng=Tr(),Dg=Le(),Rg=Qr();function Lg(t,r,e,n){let{gen:o,schema:s,data:l,allErrors:f,opts:c,self:g}=t,{RULES:m}=g;if(s.$ref&&(c.ignoreKeywordsWithRef||!qg.schemaHasRulesButRef(s,m))){o.block(()=>pc.keywordCode(t,"$ref",m.all.$ref.definition));return}c.jtd||jg(t,r),o.block(()=>{for(let x of m.rules)v(x);v(m.post)});function v(x){!cl.shouldUseGroup(s,x)||(x.type?(o.if(uc.checkDataType(x.type,l,c.strict)),fc(t,x),r.length===1&&r[0]===x.type&&e&&(o.else(),uc.reportTypeError(t)),o.endIf()):fc(t,x),f||o.if(Dg._`${Rg.default.errors} === ${n||0}`))}}_s.schemaKeywords=Lg;function fc(t,r){let{gen:e,schema:n,opts:{useDefaults:o}}=t;o&&Og.assignDefaults(t,r.type),e.block(()=>{for(let s of r.rules)cl.shouldUseRule(n,s)&&pc.keywordCode(t,s.keyword,s.definition,r.type)})}function jg(t,r){t.schemaEnv.meta||!t.opts.strictTypes||(Bg(t,r),t.opts.allowUnionTypes||zg(t,r),Mg(t,t.dataTypes))}function Bg(t,r){if(!!r.length){if(!t.dataTypes.length){t.dataTypes=r;return}r.forEach(e=>{cc(t.dataTypes,e)||pl(t,`type "${e}" not allowed by context "${t.dataTypes.join(",")}"`)}),t.dataTypes=t.dataTypes.filter(e=>cc(r,e))}}function zg(t,r){r.length>1&&!(r.length===2&&r.includes("null"))&&pl(t,"use allowUnionTypes to allow union type keyword")}function Mg(t,r){let e=t.self.RULES.all;for(let n in e){let o=e[n];if(typeof o=="object"&&cl.shouldUseRule(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(l=>Vg(r,l))&&pl(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function Vg(t,r){return t.includes(r)||r==="number"&&t.includes("integer")}function cc(t,r){return t.includes(r)||r==="integer"&&t.includes("number")}function pl(t,r){let e=t.schemaEnv.baseId+t.errSchemaPath;r+=` at "${e}" (strictTypes)`,Ng.checkStrictMode(t,r,t.opts.strictTypes)}});var qo=ge((Q0,mc)=>{"use strict";mc.exports=function t(r,e){if(r===e)return!0;if(r&&e&&typeof r=="object"&&typeof e=="object"){if(r.constructor!==e.constructor)return!1;var n,o,s;if(Array.isArray(r)){if(n=r.length,n!=e.length)return!1;for(o=n;o--!==0;)if(!t(r[o],e[o]))return!1;return!0}if(r.constructor===RegExp)return r.source===e.source&&r.flags===e.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===e.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===e.toString();if(s=Object.keys(r),n=s.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[o]))return!1;for(o=n;o--!==0;){var l=s[o];if(!t(r[l],e[l]))return!1}return!0}return r!==r&&e!==e}});var gc=ge((Y0,hc)=>{"use strict";var Wn=hc.exports=function(t,r,e){typeof r=="function"&&(e=r,r={}),e=r.cb||e;var n=typeof e=="function"?e:e.pre||function(){},o=e.post||function(){};Ss(r,n,o,t,"",t)};Wn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Wn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Wn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Wn.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};function Ss(t,r,e,n,o,s,l,f,c,g){if(n&&typeof n=="object"&&!Array.isArray(n)){r(n,o,s,l,f,c,g);for(var m in n){var v=n[m];if(Array.isArray(v)){if(m in Wn.arrayKeywords)for(var x=0;x<v.length;x++)Ss(t,r,e,v[x],o+"/"+m+"/"+x,s,o,m,n,x)}else if(m in Wn.propsKeywords){if(v&&typeof v=="object")for(var k in v)Ss(t,r,e,v[k],o+"/"+m+"/"+Ug(k),s,o,m,n,k)}else(m in Wn.keywords||t.allKeys&&!(m in Wn.skipKeywords))&&Ss(t,r,e,v,o+"/"+m,s,o,m,n)}e(n,o,s,l,f,c,g)}}function Ug(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var dl=ge((Ps,yc)=>{(function(t,r){typeof Ps=="object"&&typeof yc<"u"?r(Ps):typeof define=="function"&&define.amd?define(["exports"],r):r(t.URI=t.URI||{})})(Ps,function(t){"use strict";function r(){for(var B=arguments.length,q=Array(B),Z=0;Z<B;Z++)q[Z]=arguments[Z];if(q.length>1){q[0]=q[0].slice(0,-1);for(var ee=q.length-1,re=1;re<ee;++re)q[re]=q[re].slice(1,-1);return q[ee]=q[ee].slice(1),q.join("")}else return q[0]}function e(B){return"(?:"+B+")"}function n(B){return B===void 0?"undefined":B===null?"null":Object.prototype.toString.call(B).split(" ").pop().split("]").shift().toLowerCase()}function o(B){return B.toUpperCase()}function s(B){return B!=null?B instanceof Array?B:typeof B.length!="number"||B.split||B.setInterval||B.call?[B]:Array.prototype.slice.call(B):[]}function l(B,q){var Z=B;if(q)for(var ee in q)Z[ee]=q[ee];return Z}function f(B){var q="[A-Za-z]",Z="[\\x0D]",ee="[0-9]",re="[\\x22]",me=r(ee,"[A-Fa-f]"),Se="[\\x0A]",De="[\\x20]",He=e(e("%[EFef]"+me+"%"+me+me+"%"+me+me)+"|"+e("%[89A-Fa-f]"+me+"%"+me+me)+"|"+e("%"+me+me)),ht="[\\:\\/\\?\\#\\[\\]\\@]",qe="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",it=r(ht,qe),vt=B?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",lt=B?"[\\uE000-\\uF8FF]":"[]",Re=r(q,ee,"[\\-\\.\\_\\~]",vt),ut=e(q+r(q,ee,"[\\+\\-\\.]")+"*"),Ye=e(e(He+"|"+r(Re,qe,"[\\:]"))+"*"),qr=e(e("25[0-5]")+"|"+e("2[0-4]"+ee)+"|"+e("1"+ee+ee)+"|"+e("[1-9]"+ee)+"|"+ee),Ht=e(e("25[0-5]")+"|"+e("2[0-4]"+ee)+"|"+e("1"+ee+ee)+"|"+e("0?[1-9]"+ee)+"|0?0?"+ee),Gt=e(Ht+"\\."+Ht+"\\."+Ht+"\\."+Ht),Qe=e(me+"{1,4}"),zt=e(e(Qe+"\\:"+Qe)+"|"+Gt),Xt=e(e(Qe+"\\:")+"{6}"+zt),br=e("\\:\\:"+e(Qe+"\\:")+"{5}"+zt),Nr=e(e(Qe)+"?\\:\\:"+e(Qe+"\\:")+"{4}"+zt),vr=e(e(e(Qe+"\\:")+"{0,1}"+Qe)+"?\\:\\:"+e(Qe+"\\:")+"{3}"+zt),sn=e(e(e(Qe+"\\:")+"{0,2}"+Qe)+"?\\:\\:"+e(Qe+"\\:")+"{2}"+zt),Cn=e(e(e(Qe+"\\:")+"{0,3}"+Qe)+"?\\:\\:"+Qe+"\\:"+zt),An=e(e(e(Qe+"\\:")+"{0,4}"+Qe)+"?\\:\\:"+zt),Hr=e(e(e(Qe+"\\:")+"{0,5}"+Qe)+"?\\:\\:"+Qe),Gr=e(e(e(Qe+"\\:")+"{0,6}"+Qe)+"?\\:\\:"),kr=e([Xt,br,Nr,vr,sn,Cn,An,Hr,Gr].join("|")),an=e(e(Re+"|"+He)+"+"),i=e(kr+"\\%25"+an),fe=e(kr+e("\\%25|\\%(?!"+me+"{2})")+an),En=e("[vV]"+me+"+\\."+r(Re,qe,"[\\:]")+"+"),pr=e("\\["+e(fe+"|"+kr+"|"+En)+"\\]"),ln=e(e(He+"|"+r(Re,qe))+"*"),w=e(pr+"|"+Gt+"(?!"+ln+")|"+ln),wr=e(ee+"*"),un=e(e(Ye+"@")+"?"+w+e("\\:"+wr)+"?"),_n=e(He+"|"+r(Re,qe,"[\\:\\@]")),yo=e(_n+"*"),$o=e(_n+"+"),ot=e(e(He+"|"+r(Re,qe,"[\\@]"))+"+"),Tt=e(e("\\/"+yo)+"*"),fn=e("\\/"+e($o+Tt)+"?"),oi=e(ot+Tt),zn=e($o+Tt),Dr="(?!"+_n+")",Sn=e(Tt+"|"+fn+"|"+oi+"|"+zn+"|"+Dr),J=e(e(_n+"|"+r("[\\/\\?]",lt))+"*"),Pn=e(e(_n+"|[\\/\\?]")+"*"),si=e(e("\\/\\/"+un+Tt)+"|"+fn+"|"+zn+"|"+Dr),ai=e(ut+"\\:"+si+e("\\?"+J)+"?"+e("\\#"+Pn)+"?"),Mn=e(e("\\/\\/"+un+Tt)+"|"+fn+"|"+oi+"|"+Dr),bo=e(Mn+e("\\?"+J)+"?"+e("\\#"+Pn)+"?"),is=e(ai+"|"+bo),Vn=e(ut+"\\:"+si+e("\\?"+J)+"?"),Kr="^("+ut+")\\:"+e(e("\\/\\/("+e("("+Ye+")@")+"?("+w+")"+e("\\:("+wr+")")+"?)")+"?("+Tt+"|"+fn+"|"+zn+"|"+Dr+")")+e("\\?("+J+")")+"?"+e("\\#("+Pn+")")+"?$",vo="^(){0}"+e(e("\\/\\/("+e("("+Ye+")@")+"?("+w+")"+e("\\:("+wr+")")+"?)")+"?("+Tt+"|"+fn+"|"+oi+"|"+Dr+")")+e("\\?("+J+")")+"?"+e("\\#("+Pn+")")+"?$",ko="^("+ut+")\\:"+e(e("\\/\\/("+e("("+Ye+")@")+"?("+w+")"+e("\\:("+wr+")")+"?)")+"?("+Tt+"|"+fn+"|"+zn+"|"+Dr+")")+e("\\?("+J+")")+"?$",wo="^"+e("\\#("+Pn+")")+"?$",os="^"+e("("+Ye+")@")+"?("+w+")"+e("\\:("+wr+")")+"?$";return{NOT_SCHEME:new RegExp(r("[^]",q,ee,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",Re,qe),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",Re,qe),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",Re,qe),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",Re,qe),"g"),NOT_QUERY:new RegExp(r("[^\\%]",Re,qe,"[\\:\\@\\/\\?]",lt),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",Re,qe,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",Re,qe),"g"),UNRESERVED:new RegExp(Re,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",Re,it),"g"),PCT_ENCODED:new RegExp(He,"g"),IPV4ADDRESS:new RegExp("^("+Gt+")$"),IPV6ADDRESS:new RegExp("^\\[?("+kr+")"+e(e("\\%25|\\%(?!"+me+"{2})")+"("+an+")")+"?\\]?$")}}var c=f(!1),g=f(!0),m=function(){function B(q,Z){var ee=[],re=!0,me=!1,Se=void 0;try{for(var De=q[Symbol.iterator](),He;!(re=(He=De.next()).done)&&(ee.push(He.value),!(Z&&ee.length===Z));re=!0);}catch(ht){me=!0,Se=ht}finally{try{!re&&De.return&&De.return()}finally{if(me)throw Se}}return ee}return function(q,Z){if(Array.isArray(q))return q;if(Symbol.iterator in Object(q))return B(q,Z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),v=function(B){if(Array.isArray(B)){for(var q=0,Z=Array(B.length);q<B.length;q++)Z[q]=B[q];return Z}else return Array.from(B)},x=2147483647,k=36,_=1,O=26,D=38,M=700,X=72,le=128,ve="-",ye=/^xn--/,ie=/[^\0-\x7E]/,ke=/[\x2E\u3002\uFF0E\uFF61]/g,Ee={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},xe=k-_,ze=Math.floor,Fe=String.fromCharCode;function Te(B){throw new RangeError(Ee[B])}function he(B,q){for(var Z=[],ee=B.length;ee--;)Z[ee]=q(B[ee]);return Z}function _e(B,q){var Z=B.split("@"),ee="";Z.length>1&&(ee=Z[0]+"@",B=Z[1]),B=B.replace(ke,".");var re=B.split("."),me=he(re,q).join(".");return ee+me}function st(B){for(var q=[],Z=0,ee=B.length;Z<ee;){var re=B.charCodeAt(Z++);if(re>=55296&&re<=56319&&Z<ee){var me=B.charCodeAt(Z++);(me&64512)==56320?q.push(((re&1023)<<10)+(me&1023)+65536):(q.push(re),Z--)}else q.push(re)}return q}var te=function(q){return String.fromCodePoint.apply(String,v(q))},At=function(q){return q-48<10?q-22:q-65<26?q-65:q-97<26?q-97:k},Je=function(q,Z){return q+22+75*(q<26)-((Z!=0)<<5)},$t=function(q,Z,ee){var re=0;for(q=ee?ze(q/M):q>>1,q+=ze(q/Z);q>xe*O>>1;re+=k)q=ze(q/xe);return ze(re+(xe+1)*q/(q+D))},tt=function(q){var Z=[],ee=q.length,re=0,me=le,Se=X,De=q.lastIndexOf(ve);De<0&&(De=0);for(var He=0;He<De;++He)q.charCodeAt(He)>=128&&Te("not-basic"),Z.push(q.charCodeAt(He));for(var ht=De>0?De+1:0;ht<ee;){for(var qe=re,it=1,vt=k;;vt+=k){ht>=ee&&Te("invalid-input");var lt=At(q.charCodeAt(ht++));(lt>=k||lt>ze((x-re)/it))&&Te("overflow"),re+=lt*it;var Re=vt<=Se?_:vt>=Se+O?O:vt-Se;if(lt<Re)break;var ut=k-Re;it>ze(x/ut)&&Te("overflow"),it*=ut}var Ye=Z.length+1;Se=$t(re-qe,Ye,qe==0),ze(re/Ye)>x-me&&Te("overflow"),me+=ze(re/Ye),re%=Ye,Z.splice(re++,0,me)}return String.fromCodePoint.apply(String,Z)},z=function(q){var Z=[];q=st(q);var ee=q.length,re=le,me=0,Se=X,De=!0,He=!1,ht=void 0;try{for(var qe=q[Symbol.iterator](),it;!(De=(it=qe.next()).done);De=!0){var vt=it.value;vt<128&&Z.push(Fe(vt))}}catch(fe){He=!0,ht=fe}finally{try{!De&&qe.return&&qe.return()}finally{if(He)throw ht}}var lt=Z.length,Re=lt;for(lt&&Z.push(ve);Re<ee;){var ut=x,Ye=!0,qr=!1,Ht=void 0;try{for(var Gt=q[Symbol.iterator](),Qe;!(Ye=(Qe=Gt.next()).done);Ye=!0){var zt=Qe.value;zt>=re&&zt<ut&&(ut=zt)}}catch(fe){qr=!0,Ht=fe}finally{try{!Ye&&Gt.return&&Gt.return()}finally{if(qr)throw Ht}}var Xt=Re+1;ut-re>ze((x-me)/Xt)&&Te("overflow"),me+=(ut-re)*Xt,re=ut;var br=!0,Nr=!1,vr=void 0;try{for(var sn=q[Symbol.iterator](),Cn;!(br=(Cn=sn.next()).done);br=!0){var An=Cn.value;if(An<re&&++me>x&&Te("overflow"),An==re){for(var Hr=me,Gr=k;;Gr+=k){var kr=Gr<=Se?_:Gr>=Se+O?O:Gr-Se;if(Hr<kr)break;var an=Hr-kr,i=k-kr;Z.push(Fe(Je(kr+an%i,0))),Hr=ze(an/i)}Z.push(Fe(Je(Hr,0))),Se=$t(me,Xt,Re==lt),me=0,++Re}}}catch(fe){Nr=!0,vr=fe}finally{try{!br&&sn.return&&sn.return()}finally{if(Nr)throw vr}}++me,++re}return Z.join("")},V=function(q){return _e(q,function(Z){return ye.test(Z)?tt(Z.slice(4).toLowerCase()):Z})},Qt=function(q){return _e(q,function(Z){return ie.test(Z)?"xn--"+z(Z):Z})},Bt={version:"2.1.0",ucs2:{decode:st,encode:te},decode:tt,encode:z,toASCII:Qt,toUnicode:V},wt={};function Pt(B){var q=B.charCodeAt(0),Z=void 0;return q<16?Z="%0"+q.toString(16).toUpperCase():q<128?Z="%"+q.toString(16).toUpperCase():q<2048?Z="%"+(q>>6|192).toString(16).toUpperCase()+"%"+(q&63|128).toString(16).toUpperCase():Z="%"+(q>>12|224).toString(16).toUpperCase()+"%"+(q>>6&63|128).toString(16).toUpperCase()+"%"+(q&63|128).toString(16).toUpperCase(),Z}function Et(B){for(var q="",Z=0,ee=B.length;Z<ee;){var re=parseInt(B.substr(Z+1,2),16);if(re<128)q+=String.fromCharCode(re),Z+=3;else if(re>=194&&re<224){if(ee-Z>=6){var me=parseInt(B.substr(Z+4,2),16);q+=String.fromCharCode((re&31)<<6|me&63)}else q+=B.substr(Z,6);Z+=6}else if(re>=224){if(ee-Z>=9){var Se=parseInt(B.substr(Z+4,2),16),De=parseInt(B.substr(Z+7,2),16);q+=String.fromCharCode((re&15)<<12|(Se&63)<<6|De&63)}else q+=B.substr(Z,9);Z+=9}else q+=B.substr(Z,3),Z+=3}return q}function at(B,q){function Z(ee){var re=Et(ee);return re.match(q.UNRESERVED)?re:ee}return B.scheme&&(B.scheme=String(B.scheme).replace(q.PCT_ENCODED,Z).toLowerCase().replace(q.NOT_SCHEME,"")),B.userinfo!==void 0&&(B.userinfo=String(B.userinfo).replace(q.PCT_ENCODED,Z).replace(q.NOT_USERINFO,Pt).replace(q.PCT_ENCODED,o)),B.host!==void 0&&(B.host=String(B.host).replace(q.PCT_ENCODED,Z).toLowerCase().replace(q.NOT_HOST,Pt).replace(q.PCT_ENCODED,o)),B.path!==void 0&&(B.path=String(B.path).replace(q.PCT_ENCODED,Z).replace(B.scheme?q.NOT_PATH:q.NOT_PATH_NOSCHEME,Pt).replace(q.PCT_ENCODED,o)),B.query!==void 0&&(B.query=String(B.query).replace(q.PCT_ENCODED,Z).replace(q.NOT_QUERY,Pt).replace(q.PCT_ENCODED,o)),B.fragment!==void 0&&(B.fragment=String(B.fragment).replace(q.PCT_ENCODED,Z).replace(q.NOT_FRAGMENT,Pt).replace(q.PCT_ENCODED,o)),B}function _r(B){return B.replace(/^0*(.*)/,"$1")||"0"}function be(B,q){var Z=B.match(q.IPV4ADDRESS)||[],ee=m(Z,2),re=ee[1];return re?re.split(".").map(_r).join("."):B}function $r(B,q){var Z=B.match(q.IPV6ADDRESS)||[],ee=m(Z,3),re=ee[1],me=ee[2];if(re){for(var Se=re.toLowerCase().split("::").reverse(),De=m(Se,2),He=De[0],ht=De[1],qe=ht?ht.split(":").map(_r):[],it=He.split(":").map(_r),vt=q.IPV4ADDRESS.test(it[it.length-1]),lt=vt?7:8,Re=it.length-lt,ut=Array(lt),Ye=0;Ye<lt;++Ye)ut[Ye]=qe[Ye]||it[Re+Ye]||"";vt&&(ut[lt-1]=be(ut[lt-1],q));var qr=ut.reduce(function(Xt,br,Nr){if(!br||br==="0"){var vr=Xt[Xt.length-1];vr&&vr.index+vr.length===Nr?vr.length++:Xt.push({index:Nr,length:1})}return Xt},[]),Ht=qr.sort(function(Xt,br){return br.length-Xt.length})[0],Gt=void 0;if(Ht&&Ht.length>1){var Qe=ut.slice(0,Ht.index),zt=ut.slice(Ht.index+Ht.length);Gt=Qe.join(":")+"::"+zt.join(":")}else Gt=ut.join(":");return me&&(Gt+="%"+me),Gt}else return B}var ur=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,fr="".match(/(){0}/)[1]===void 0;function Yt(B){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z={},ee=q.iri!==!1?g:c;q.reference==="suffix"&&(B=(q.scheme?q.scheme+":":"")+"//"+B);var re=B.match(ur);if(re){fr?(Z.scheme=re[1],Z.userinfo=re[3],Z.host=re[4],Z.port=parseInt(re[5],10),Z.path=re[6]||"",Z.query=re[7],Z.fragment=re[8],isNaN(Z.port)&&(Z.port=re[5])):(Z.scheme=re[1]||void 0,Z.userinfo=B.indexOf("@")!==-1?re[3]:void 0,Z.host=B.indexOf("//")!==-1?re[4]:void 0,Z.port=parseInt(re[5],10),Z.path=re[6]||"",Z.query=B.indexOf("?")!==-1?re[7]:void 0,Z.fragment=B.indexOf("#")!==-1?re[8]:void 0,isNaN(Z.port)&&(Z.port=B.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?re[4]:void 0)),Z.host&&(Z.host=$r(be(Z.host,ee),ee)),Z.scheme===void 0&&Z.userinfo===void 0&&Z.host===void 0&&Z.port===void 0&&!Z.path&&Z.query===void 0?Z.reference="same-document":Z.scheme===void 0?Z.reference="relative":Z.fragment===void 0?Z.reference="absolute":Z.reference="uri",q.reference&&q.reference!=="suffix"&&q.reference!==Z.reference&&(Z.error=Z.error||"URI is not a "+q.reference+" reference.");var me=wt[(q.scheme||Z.scheme||"").toLowerCase()];if(!q.unicodeSupport&&(!me||!me.unicodeSupport)){if(Z.host&&(q.domainHost||me&&me.domainHost))try{Z.host=Bt.toASCII(Z.host.replace(ee.PCT_ENCODED,Et).toLowerCase())}catch(Se){Z.error=Z.error||"Host's domain name can not be converted to ASCII via punycode: "+Se}at(Z,c)}else at(Z,ee);me&&me.parse&&me.parse(Z,q)}else Z.error=Z.error||"URI can not be parsed.";return Z}function Rn(B,q){var Z=q.iri!==!1?g:c,ee=[];return B.userinfo!==void 0&&(ee.push(B.userinfo),ee.push("@")),B.host!==void 0&&ee.push($r(be(String(B.host),Z),Z).replace(Z.IPV6ADDRESS,function(re,me,Se){return"["+me+(Se?"%25"+Se:"")+"]"})),(typeof B.port=="number"||typeof B.port=="string")&&(ee.push(":"),ee.push(String(B.port))),ee.length?ee.join(""):void 0}var Ln=/^\.\.?\//,vn=/^\/\.(\/|$)/,kn=/^\/\.\.(\/|$)/,We=/^\/?(?:.|\n)*?(?=\/|$)/;function Ne(B){for(var q=[];B.length;)if(B.match(Ln))B=B.replace(Ln,"");else if(B.match(vn))B=B.replace(vn,"/");else if(B.match(kn))B=B.replace(kn,"/"),q.pop();else if(B==="."||B==="..")B="";else{var Z=B.match(We);if(Z){var ee=Z[0];B=B.slice(ee.length),q.push(ee)}else throw new Error("Unexpected dot segment condition")}return q.join("")}function Ze(B){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=q.iri?g:c,ee=[],re=wt[(q.scheme||B.scheme||"").toLowerCase()];if(re&&re.serialize&&re.serialize(B,q),B.host&&!Z.IPV6ADDRESS.test(B.host)){if(q.domainHost||re&&re.domainHost)try{B.host=q.iri?Bt.toUnicode(B.host):Bt.toASCII(B.host.replace(Z.PCT_ENCODED,Et).toLowerCase())}catch(De){B.error=B.error||"Host's domain name can not be converted to "+(q.iri?"Unicode":"ASCII")+" via punycode: "+De}}at(B,Z),q.reference!=="suffix"&&B.scheme&&(ee.push(B.scheme),ee.push(":"));var me=Rn(B,q);if(me!==void 0&&(q.reference!=="suffix"&&ee.push("//"),ee.push(me),B.path&&B.path.charAt(0)!=="/"&&ee.push("/")),B.path!==void 0){var Se=B.path;!q.absolutePath&&(!re||!re.absolutePath)&&(Se=Ne(Se)),me===void 0&&(Se=Se.replace(/^\/\//,"/%2F")),ee.push(Se)}return B.query!==void 0&&(ee.push("?"),ee.push(B.query)),B.fragment!==void 0&&(ee.push("#"),ee.push(B.fragment)),ee.join("")}function bt(B,q){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=arguments[3],re={};return ee||(B=Yt(Ze(B,Z),Z),q=Yt(Ze(q,Z),Z)),Z=Z||{},!Z.tolerant&&q.scheme?(re.scheme=q.scheme,re.userinfo=q.userinfo,re.host=q.host,re.port=q.port,re.path=Ne(q.path||""),re.query=q.query):(q.userinfo!==void 0||q.host!==void 0||q.port!==void 0?(re.userinfo=q.userinfo,re.host=q.host,re.port=q.port,re.path=Ne(q.path||""),re.query=q.query):(q.path?(q.path.charAt(0)==="/"?re.path=Ne(q.path):((B.userinfo!==void 0||B.host!==void 0||B.port!==void 0)&&!B.path?re.path="/"+q.path:B.path?re.path=B.path.slice(0,B.path.lastIndexOf("/")+1)+q.path:re.path=q.path,re.path=Ne(re.path)),re.query=q.query):(re.path=B.path,q.query!==void 0?re.query=q.query:re.query=B.query),re.userinfo=B.userinfo,re.host=B.host,re.port=B.port),re.scheme=B.scheme),re.fragment=q.fragment,re}function cr(B,q,Z){var ee=l({scheme:"null"},Z);return Ze(bt(Yt(B,ee),Yt(q,ee),ee,!0),ee)}function Ve(B,q){return typeof B=="string"?B=Ze(Yt(B,q),q):n(B)==="object"&&(B=Yt(Ze(B,q),q)),B}function Ue(B,q,Z){return typeof B=="string"?B=Ze(Yt(B,Z),Z):n(B)==="object"&&(B=Ze(B,Z)),typeof q=="string"?q=Ze(Yt(q,Z),Z):n(q)==="object"&&(q=Ze(q,Z)),B===q}function dt(B,q){return B&&B.toString().replace(!q||!q.iri?c.ESCAPE:g.ESCAPE,Pt)}function rt(B,q){return B&&B.toString().replace(!q||!q.iri?c.PCT_ENCODED:g.PCT_ENCODED,Et)}var ne={scheme:"http",domainHost:!0,parse:function(q,Z){return q.host||(q.error=q.error||"HTTP URIs must have a host."),q},serialize:function(q,Z){var ee=String(q.scheme).toLowerCase()==="https";return(q.port===(ee?443:80)||q.port==="")&&(q.port=void 0),q.path||(q.path="/"),q}},ce={scheme:"https",d