@kelceyp/swic 0.1.11 → 0.2.1
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.
- package/dist/cli/cli.js +256 -70
- package/dist/server/Server.js +189 -17
- package/package.json +6 -3
package/dist/server/Server.js
CHANGED
|
@@ -1,18 +1,190 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var P6=Object.create;var{getPrototypeOf:H6,defineProperty:Z0,getOwnPropertyNames:K6}=Object;var z6=Object.prototype.hasOwnProperty;var L6=(f,v,W)=>{W=f!=null?P6(H6(f)):{};let J=v||!f||!f.__esModule?Z0(W,"default",{value:f,enumerable:!0}):W;for(let Q of K6(f))if(!z6.call(J,Q))Z0(J,Q,{get:()=>f[Q],enumerable:!0});return J};var o=(f,v)=>()=>(v||f((v={exports:{}}).exports,v),v.exports);var v8=(f,v)=>{for(var W in v)Z0(f,W,{get:v[W],enumerable:!0,configurable:!0,set:(J)=>v[W]=()=>J})};var Df=(f,v)=>()=>(f&&(v=f(f=0)),v);var k8=o((J0,R8)=>{(function(f,v){typeof J0==="object"&&typeof R8!=="undefined"?v(J0):typeof define==="function"&&define.amd?define(["exports"],v):v(f.URI=f.URI||{})})(J0,function(f){function v(){for(var N=arguments.length,P=Array(N),E=0;E<N;E++)P[E]=arguments[E];if(P.length>1){P[0]=P[0].slice(0,-1);var U=P.length-1;for(var h=1;h<U;++h)P[h]=P[h].slice(1,-1);return P[U]=P[U].slice(1),P.join("")}else return P[0]}function W(N){return"(?:"+N+")"}function J(N){return N===void 0?"undefined":N===null?"null":Object.prototype.toString.call(N).split(" ").pop().split("]").shift().toLowerCase()}function Q(N){return N.toUpperCase()}function X(N){return N!==void 0&&N!==null?N instanceof Array?N:typeof N.length!=="number"||N.split||N.setInterval||N.call?[N]:Array.prototype.slice.call(N):[]}function Y(N,P){var E=N;if(P)for(var U in P)E[U]=P[U];return E}function w(N){var P="[A-Za-z]",E="[\\x0D]",U="[0-9]",h="[\\x22]",r=v(U,"[A-Fa-f]"),e="[\\x0A]",Xv="[\\x20]",Bv=W(W("%[EFef]"+r+"%"+r+r+"%"+r+r)+"|"+W("%[89A-Fa-f]"+r+"%"+r+r)+"|"+W("%"+r+r)),Uv="[\\:\\/\\?\\#\\[\\]\\@]",Jv="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",$v=v(Uv,Jv),hv=N?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",zv=N?"[\\uE000-\\uF8FF]":"[]",wv=v(P,U,"[\\-\\.\\_\\~]",hv),Mv=W(P+v(P,U,"[\\+\\-\\.]")+"*"),qv=W(W(Bv+"|"+v(wv,Jv,"[\\:]"))+"*"),Sf=W(W("25[0-5]")+"|"+W("2[0-4]"+U)+"|"+W("1"+U+U)+"|"+W("[1-9]"+U)+"|"+U),rv=W(W("25[0-5]")+"|"+W("2[0-4]"+U)+"|"+W("1"+U+U)+"|"+W("0?[1-9]"+U)+"|0?0?"+U),cv=W(rv+"\\."+rv+"\\."+rv+"\\."+rv),Pv=W(r+"{1,4}"),mv=W(W(Pv+"\\:"+Pv)+"|"+cv),nv=W(W(Pv+"\\:")+"{6}"+mv),Yf=W("\\:\\:"+W(Pv+"\\:")+"{5}"+mv),yf=W(W(Pv)+"?\\:\\:"+W(Pv+"\\:")+"{4}"+mv),Kf=W(W(W(Pv+"\\:")+"{0,1}"+Pv)+"?\\:\\:"+W(Pv+"\\:")+"{3}"+mv),L1=W(W(W(Pv+"\\:")+"{0,2}"+Pv)+"?\\:\\:"+W(Pv+"\\:")+"{2}"+mv),l1=W(W(W(Pv+"\\:")+"{0,3}"+Pv)+"?\\:\\:"+Pv+"\\:"+mv),I1=W(W(W(Pv+"\\:")+"{0,4}"+Pv)+"?\\:\\:"+mv),af=W(W(W(Pv+"\\:")+"{0,5}"+Pv)+"?\\:\\:"+Pv),cf=W(W(W(Pv+"\\:")+"{0,6}"+Pv)+"?\\:\\:"),zf=W([nv,Yf,yf,Kf,L1,l1,I1,af,cf].join("|")),nf=W(W(wv+"|"+Bv)+"+"),l0=W(zf+"\\%25"+nf),lf=W(zf+W("\\%25|\\%(?!"+r+"{2})")+nf),J6=W("[vV]"+r+"+\\."+v(wv,Jv,"[\\:]")+"+"),X6=W("\\["+W(lf+"|"+zf+"|"+J6)+"\\]"),oQ=W(W(Bv+"|"+v(wv,Jv))+"*"),$1=W(X6+"|"+cv+"(?!"+oQ+")|"+oQ),M1=W(U+"*"),sQ=W(W(qv+"@")+"?"+$1+W("\\:"+M1)+"?"),N1=W(Bv+"|"+v(wv,Jv,"[\\:\\@]")),Y6=W(N1+"*"),tQ=W(N1+"+"),w6=W(W(Bv+"|"+v(wv,Jv,"[\\@]"))+"+"),Lf=W(W("\\/"+Y6)+"*"),pf=W("\\/"+W(tQ+Lf)+"?"),I0=W(w6+Lf),Z1=W(tQ+Lf),df="(?!"+N1+")",P2=W(Lf+"|"+pf+"|"+I0+"|"+Z1+"|"+df),of=W(W(N1+"|"+v("[\\/\\?]",zv))+"*"),V1=W(W(N1+"|[\\/\\?]")+"*"),eQ=W(W("\\/\\/"+sQ+Lf)+"|"+pf+"|"+Z1+"|"+df),G6=W(Mv+"\\:"+eQ+W("\\?"+of)+"?"+W("\\#"+V1)+"?"),B6=W(W("\\/\\/"+sQ+Lf)+"|"+pf+"|"+I0+"|"+df),q6=W(B6+W("\\?"+of)+"?"+W("\\#"+V1)+"?"),H2=W(G6+"|"+q6),K2=W(Mv+"\\:"+eQ+W("\\?"+of)+"?"),z2="^("+Mv+")\\:"+W(W("\\/\\/("+W("("+qv+")@")+"?("+$1+")"+W("\\:("+M1+")")+"?)")+"?("+Lf+"|"+pf+"|"+Z1+"|"+df+")")+W("\\?("+of+")")+"?"+W("\\#("+V1+")")+"?$",L2="^(){0}"+W(W("\\/\\/("+W("("+qv+")@")+"?("+$1+")"+W("\\:("+M1+")")+"?)")+"?("+Lf+"|"+pf+"|"+I0+"|"+df+")")+W("\\?("+of+")")+"?"+W("\\#("+V1+")")+"?$",$2="^("+Mv+")\\:"+W(W("\\/\\/("+W("("+qv+")@")+"?("+$1+")"+W("\\:("+M1+")")+"?)")+"?("+Lf+"|"+pf+"|"+Z1+"|"+df+")")+W("\\?("+of+")")+"?$",M2="^"+W("\\#("+V1+")")+"?$",N2="^"+W("("+qv+")@")+"?("+$1+")"+W("\\:("+M1+")")+"?$";return{NOT_SCHEME:new RegExp(v("[^]",P,U,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(v("[^\\%\\:]",wv,Jv),"g"),NOT_HOST:new RegExp(v("[^\\%\\[\\]\\:]",wv,Jv),"g"),NOT_PATH:new RegExp(v("[^\\%\\/\\:\\@]",wv,Jv),"g"),NOT_PATH_NOSCHEME:new RegExp(v("[^\\%\\/\\@]",wv,Jv),"g"),NOT_QUERY:new RegExp(v("[^\\%]",wv,Jv,"[\\:\\@\\/\\?]",zv),"g"),NOT_FRAGMENT:new RegExp(v("[^\\%]",wv,Jv,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(v("[^]",wv,Jv),"g"),UNRESERVED:new RegExp(wv,"g"),OTHER_CHARS:new RegExp(v("[^\\%]",wv,$v),"g"),PCT_ENCODED:new RegExp(Bv,"g"),IPV4ADDRESS:new RegExp("^("+cv+")$"),IPV6ADDRESS:new RegExp("^\\[?("+zf+")"+W(W("\\%25|\\%(?!"+r+"{2})")+"("+nf+")")+"?\\]?$")}}var B=w(!1),z=w(!0),H=function(){function N(P,E){var U=[],h=!0,r=!1,e=void 0;try{for(var Xv=P[Symbol.iterator](),Bv;!(h=(Bv=Xv.next()).done);h=!0)if(U.push(Bv.value),E&&U.length===E)break}catch(Uv){r=!0,e=Uv}finally{try{if(!h&&Xv.return)Xv.return()}finally{if(r)throw e}}return U}return function(P,E){if(Array.isArray(P))return P;else if(Symbol.iterator in Object(P))return N(P,E);else throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),$=function(N){if(Array.isArray(N)){for(var P=0,E=Array(N.length);P<N.length;P++)E[P]=N[P];return E}else return Array.from(N)},K=2147483647,q=36,L=1,V=26,M=38,D=700,y=72,F=128,Z="-",C=/^xn--/,T=/[^\0-\x7E]/,O=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},j=q-L,_=Math.floor,l=String.fromCharCode;function R(N){throw new RangeError(A[N])}function g(N,P){var E=[],U=N.length;while(U--)E[U]=P(N[U]);return E}function b(N,P){var E=N.split("@"),U="";if(E.length>1)U=E[0]+"@",N=E[1];N=N.replace(O,".");var h=N.split("."),r=g(h,P).join(".");return U+r}function k(N){var P=[],E=0,U=N.length;while(E<U){var h=N.charCodeAt(E++);if(h>=55296&&h<=56319&&E<U){var r=N.charCodeAt(E++);if((r&64512)==56320)P.push(((h&1023)<<10)+(r&1023)+65536);else P.push(h),E--}else P.push(h)}return P}var m=function N(P){return String.fromCodePoint.apply(String,$(P))},c=function N(P){if(P-48<10)return P-22;if(P-65<26)return P-65;if(P-97<26)return P-97;return q},d=function N(P,E){return P+22+75*(P<26)-((E!=0)<<5)},s=function N(P,E,U){var h=0;P=U?_(P/D):P>>1,P+=_(P/E);for(;P>j*V>>1;h+=q)P=_(P/j);return _(h+(j+1)*P/(P+M))},n=function N(P){var E=[],U=P.length,h=0,r=F,e=y,Xv=P.lastIndexOf(Z);if(Xv<0)Xv=0;for(var Bv=0;Bv<Xv;++Bv){if(P.charCodeAt(Bv)>=128)R("not-basic");E.push(P.charCodeAt(Bv))}for(var Uv=Xv>0?Xv+1:0;Uv<U;){var Jv=h;for(var $v=1,hv=q;;hv+=q){if(Uv>=U)R("invalid-input");var zv=c(P.charCodeAt(Uv++));if(zv>=q||zv>_((K-h)/$v))R("overflow");h+=zv*$v;var wv=hv<=e?L:hv>=e+V?V:hv-e;if(zv<wv)break;var Mv=q-wv;if($v>_(K/Mv))R("overflow");$v*=Mv}var qv=E.length+1;if(e=s(h-Jv,qv,Jv==0),_(h/qv)>K-r)R("overflow");r+=_(h/qv),h%=qv,E.splice(h++,0,r)}return String.fromCodePoint.apply(String,E)},Vv=function N(P){var E=[];P=k(P);var U=P.length,h=F,r=0,e=y,Xv=!0,Bv=!1,Uv=void 0;try{for(var Jv=P[Symbol.iterator](),$v;!(Xv=($v=Jv.next()).done);Xv=!0){var hv=$v.value;if(hv<128)E.push(l(hv))}}catch(lf){Bv=!0,Uv=lf}finally{try{if(!Xv&&Jv.return)Jv.return()}finally{if(Bv)throw Uv}}var zv=E.length,wv=zv;if(zv)E.push(Z);while(wv<U){var Mv=K,qv=!0,Sf=!1,rv=void 0;try{for(var cv=P[Symbol.iterator](),Pv;!(qv=(Pv=cv.next()).done);qv=!0){var mv=Pv.value;if(mv>=h&&mv<Mv)Mv=mv}}catch(lf){Sf=!0,rv=lf}finally{try{if(!qv&&cv.return)cv.return()}finally{if(Sf)throw rv}}var nv=wv+1;if(Mv-h>_((K-r)/nv))R("overflow");r+=(Mv-h)*nv,h=Mv;var Yf=!0,yf=!1,Kf=void 0;try{for(var L1=P[Symbol.iterator](),l1;!(Yf=(l1=L1.next()).done);Yf=!0){var I1=l1.value;if(I1<h&&++r>K)R("overflow");if(I1==h){var af=r;for(var cf=q;;cf+=q){var zf=cf<=e?L:cf>=e+V?V:cf-e;if(af<zf)break;var nf=af-zf,l0=q-zf;E.push(l(d(zf+nf%l0,0))),af=_(nf/l0)}E.push(l(d(af,0))),e=s(r,nv,wv==zv),r=0,++wv}}}catch(lf){yf=!0,Kf=lf}finally{try{if(!Yf&&L1.return)L1.return()}finally{if(yf)throw Kf}}++r,++h}return E.join("")},_v=function N(P){return b(P,function(E){return C.test(E)?n(E.slice(4).toLowerCase()):E})},Sv=function N(P){return b(P,function(E){return T.test(E)?"xn--"+Vv(E):E})},Yv={version:"2.1.0",ucs2:{decode:k,encode:m},decode:n,encode:Vv,toASCII:Sv,toUnicode:_v},jv={};function gv(N){var P=N.charCodeAt(0),E=void 0;if(P<16)E="%0"+P.toString(16).toUpperCase();else if(P<128)E="%"+P.toString(16).toUpperCase();else if(P<2048)E="%"+(P>>6|192).toString(16).toUpperCase()+"%"+(P&63|128).toString(16).toUpperCase();else E="%"+(P>>12|224).toString(16).toUpperCase()+"%"+(P>>6&63|128).toString(16).toUpperCase()+"%"+(P&63|128).toString(16).toUpperCase();return E}function yv(N){var P="",E=0,U=N.length;while(E<U){var h=parseInt(N.substr(E+1,2),16);if(h<128)P+=String.fromCharCode(h),E+=3;else if(h>=194&&h<224){if(U-E>=6){var r=parseInt(N.substr(E+4,2),16);P+=String.fromCharCode((h&31)<<6|r&63)}else P+=N.substr(E,6);E+=6}else if(h>=224){if(U-E>=9){var e=parseInt(N.substr(E+4,2),16),Xv=parseInt(N.substr(E+7,2),16);P+=String.fromCharCode((h&15)<<12|(e&63)<<6|Xv&63)}else P+=N.substr(E,9);E+=9}else P+=N.substr(E,3),E+=3}return P}function Vf(N,P){function E(U){var h=yv(U);return!h.match(P.UNRESERVED)?U:h}if(N.scheme)N.scheme=String(N.scheme).replace(P.PCT_ENCODED,E).toLowerCase().replace(P.NOT_SCHEME,"");if(N.userinfo!==void 0)N.userinfo=String(N.userinfo).replace(P.PCT_ENCODED,E).replace(P.NOT_USERINFO,gv).replace(P.PCT_ENCODED,Q);if(N.host!==void 0)N.host=String(N.host).replace(P.PCT_ENCODED,E).toLowerCase().replace(P.NOT_HOST,gv).replace(P.PCT_ENCODED,Q);if(N.path!==void 0)N.path=String(N.path).replace(P.PCT_ENCODED,E).replace(N.scheme?P.NOT_PATH:P.NOT_PATH_NOSCHEME,gv).replace(P.PCT_ENCODED,Q);if(N.query!==void 0)N.query=String(N.query).replace(P.PCT_ENCODED,E).replace(P.NOT_QUERY,gv).replace(P.PCT_ENCODED,Q);if(N.fragment!==void 0)N.fragment=String(N.fragment).replace(P.PCT_ENCODED,E).replace(P.NOT_FRAGMENT,gv).replace(P.PCT_ENCODED,Q);return N}function Pf(N){return N.replace(/^0*(.*)/,"$1")||"0"}function Ov(N,P){var E=N.match(P.IPV4ADDRESS)||[],U=H(E,2),h=U[1];if(h)return h.split(".").map(Pf).join(".");else return N}function Ev(N,P){var E=N.match(P.IPV6ADDRESS)||[],U=H(E,3),h=U[1],r=U[2];if(h){var e=h.toLowerCase().split("::").reverse(),Xv=H(e,2),Bv=Xv[0],Uv=Xv[1],Jv=Uv?Uv.split(":").map(Pf):[],$v=Bv.split(":").map(Pf),hv=P.IPV4ADDRESS.test($v[$v.length-1]),zv=hv?7:8,wv=$v.length-zv,Mv=Array(zv);for(var qv=0;qv<zv;++qv)Mv[qv]=Jv[qv]||$v[wv+qv]||"";if(hv)Mv[zv-1]=Ov(Mv[zv-1],P);var Sf=Mv.reduce(function(nv,Yf,yf){if(!Yf||Yf==="0"){var Kf=nv[nv.length-1];if(Kf&&Kf.index+Kf.length===yf)Kf.length++;else nv.push({index:yf,length:1})}return nv},[]),rv=Sf.sort(function(nv,Yf){return Yf.length-nv.length})[0],cv=void 0;if(rv&&rv.length>1){var Pv=Mv.slice(0,rv.index),mv=Mv.slice(rv.index+rv.length);cv=Pv.join(":")+"::"+mv.join(":")}else cv=Mv.join(":");if(r)cv+="%"+r;return cv}else return N}var _f=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Rv="".match(/(){0}/)[1]===void 0;function Gv(N){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E={},U=P.iri!==!1?z:B;if(P.reference==="suffix")N=(P.scheme?P.scheme+":":"")+"//"+N;var h=N.match(_f);if(h){if(Rv){if(E.scheme=h[1],E.userinfo=h[3],E.host=h[4],E.port=parseInt(h[5],10),E.path=h[6]||"",E.query=h[7],E.fragment=h[8],isNaN(E.port))E.port=h[5]}else if(E.scheme=h[1]||void 0,E.userinfo=N.indexOf("@")!==-1?h[3]:void 0,E.host=N.indexOf("//")!==-1?h[4]:void 0,E.port=parseInt(h[5],10),E.path=h[6]||"",E.query=N.indexOf("?")!==-1?h[7]:void 0,E.fragment=N.indexOf("#")!==-1?h[8]:void 0,isNaN(E.port))E.port=N.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?h[4]:void 0;if(E.host)E.host=Ev(Ov(E.host,U),U);if(E.scheme===void 0&&E.userinfo===void 0&&E.host===void 0&&E.port===void 0&&!E.path&&E.query===void 0)E.reference="same-document";else if(E.scheme===void 0)E.reference="relative";else if(E.fragment===void 0)E.reference="absolute";else E.reference="uri";if(P.reference&&P.reference!=="suffix"&&P.reference!==E.reference)E.error=E.error||"URI is not a "+P.reference+" reference.";var r=jv[(P.scheme||E.scheme||"").toLowerCase()];if(!P.unicodeSupport&&(!r||!r.unicodeSupport)){if(E.host&&(P.domainHost||r&&r.domainHost))try{E.host=Yv.toASCII(E.host.replace(U.PCT_ENCODED,yv).toLowerCase())}catch(e){E.error=E.error||"Host's domain name can not be converted to ASCII via punycode: "+e}Vf(E,B)}else Vf(E,U);if(r&&r.parse)r.parse(E,P)}else E.error=E.error||"URI can not be parsed.";return E}function Ef(N,P){var E=P.iri!==!1?z:B,U=[];if(N.userinfo!==void 0)U.push(N.userinfo),U.push("@");if(N.host!==void 0)U.push(Ev(Ov(String(N.host),E),E).replace(E.IPV6ADDRESS,function(h,r,e){return"["+r+(e?"%25"+e:"")+"]"}));if(typeof N.port==="number"||typeof N.port==="string")U.push(":"),U.push(String(N.port));return U.length?U.join(""):void 0}var Hf=/^\.\.?\//,Rf=/^\/\.(\/|$)/,kf=/^\/\.\.(\/|$)/,Av=/^\/?(?:.|\n)*?(?=\/|$)/;function av(N){var P=[];while(N.length)if(N.match(Hf))N=N.replace(Hf,"");else if(N.match(Rf))N=N.replace(Rf,"/");else if(N.match(kf))N=N.replace(kf,"/"),P.pop();else if(N==="."||N==="..")N="";else{var E=N.match(Av);if(E){var U=E[0];N=N.slice(U.length),P.push(U)}else throw new Error("Unexpected dot segment condition")}return P.join("")}function Zv(N){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=P.iri?z:B,U=[],h=jv[(P.scheme||N.scheme||"").toLowerCase()];if(h&&h.serialize)h.serialize(N,P);if(N.host){if(E.IPV6ADDRESS.test(N.host));else if(P.domainHost||h&&h.domainHost)try{N.host=!P.iri?Yv.toASCII(N.host.replace(E.PCT_ENCODED,yv).toLowerCase()):Yv.toUnicode(N.host)}catch(Xv){N.error=N.error||"Host's domain name can not be converted to "+(!P.iri?"ASCII":"Unicode")+" via punycode: "+Xv}}if(Vf(N,E),P.reference!=="suffix"&&N.scheme)U.push(N.scheme),U.push(":");var r=Ef(N,P);if(r!==void 0){if(P.reference!=="suffix")U.push("//");if(U.push(r),N.path&&N.path.charAt(0)!=="/")U.push("/")}if(N.path!==void 0){var e=N.path;if(!P.absolutePath&&(!h||!h.absolutePath))e=av(e);if(r===void 0)e=e.replace(/^\/\//,"/%2F");U.push(e)}if(N.query!==void 0)U.push("?"),U.push(N.query);if(N.fragment!==void 0)U.push("#"),U.push(N.fragment);return U.join("")}function lv(N,P){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},U=arguments[3],h={};if(!U)N=Gv(Zv(N,E),E),P=Gv(Zv(P,E),E);if(E=E||{},!E.tolerant&&P.scheme)h.scheme=P.scheme,h.userinfo=P.userinfo,h.host=P.host,h.port=P.port,h.path=av(P.path||""),h.query=P.query;else{if(P.userinfo!==void 0||P.host!==void 0||P.port!==void 0)h.userinfo=P.userinfo,h.host=P.host,h.port=P.port,h.path=av(P.path||""),h.query=P.query;else{if(!P.path)if(h.path=N.path,P.query!==void 0)h.query=P.query;else h.query=N.query;else{if(P.path.charAt(0)==="/")h.path=av(P.path);else{if((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path)h.path="/"+P.path;else if(!N.path)h.path=P.path;else h.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+P.path;h.path=av(h.path)}h.query=P.query}h.userinfo=N.userinfo,h.host=N.host,h.port=N.port}h.scheme=N.scheme}return h.fragment=P.fragment,h}function Jf(N,P,E){var U=Y({scheme:"null"},E);return Zv(lv(Gv(N,U),Gv(P,U),U,!0),U)}function uv(N,P){if(typeof N==="string")N=Zv(Gv(N,P),P);else if(J(N)==="object")N=Gv(Zv(N,P),P);return N}function y1(N,P,E){if(typeof N==="string")N=Zv(Gv(N,E),E);else if(J(N)==="object")N=Zv(N,E);if(typeof P==="string")P=Zv(Gv(P,E),E);else if(J(P)==="object")P=Zv(P,E);return N===P}function S0(N,P){return N&&N.toString().replace(!P||!P.iri?B.ESCAPE:z.ESCAPE,gv)}function dv(N,P){return N&&N.toString().replace(!P||!P.iri?B.PCT_ENCODED:z.PCT_ENCODED,yv)}var K1={scheme:"http",domainHost:!0,parse:function N(P,E){if(!P.host)P.error=P.error||"HTTP URIs must have a host.";return P},serialize:function N(P,E){var U=String(P.scheme).toLowerCase()==="https";if(P.port===(U?443:80)||P.port==="")P.port=void 0;if(!P.path)P.path="/";return P}},rQ={scheme:"https",domainHost:K1.domainHost,parse:K1.parse,serialize:K1.serialize};function mQ(N){return typeof N.secure==="boolean"?N.secure:String(N.scheme).toLowerCase()==="wss"}var z1={scheme:"ws",domainHost:!0,parse:function N(P,E){var U=P;return U.secure=mQ(U),U.resourceName=(U.path||"/")+(U.query?"?"+U.query:""),U.path=void 0,U.query=void 0,U},serialize:function N(P,E){if(P.port===(mQ(P)?443:80)||P.port==="")P.port=void 0;if(typeof P.secure==="boolean")P.scheme=P.secure?"wss":"ws",P.secure=void 0;if(P.resourceName){var U=P.resourceName.split("?"),h=H(U,2),r=h[0],e=h[1];P.path=r&&r!=="/"?r:void 0,P.query=e,P.resourceName=void 0}return P.fragment=void 0,P}},aQ={scheme:"wss",domainHost:z1.domainHost,parse:z1.parse,serialize:z1.serialize},nJ={},pJ=!0,cQ="[A-Za-z0-9\\-\\.\\_\\~"+(pJ?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Xf="[0-9A-Fa-f]",iJ=W(W("%[EFef]"+Xf+"%"+Xf+Xf+"%"+Xf+Xf)+"|"+W("%[89A-Fa-f]"+Xf+"%"+Xf+Xf)+"|"+W("%"+Xf+Xf)),dJ="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",oJ="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",sJ=v(oJ,"[\\\"\\\\]"),tJ="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",eJ=new RegExp(cQ,"g"),mf=new RegExp(iJ,"g"),v6=new RegExp(v("[^]",dJ,"[\\.]","[\\\"]",sJ),"g"),nQ=new RegExp(v("[^]",cQ,tJ),"g"),f6=nQ;function y0(N){var P=yv(N);return!P.match(eJ)?N:P}var pQ={scheme:"mailto",parse:function N(P,E){var U=P,h=U.to=U.path?U.path.split(","):[];if(U.path=void 0,U.query){var r=!1,e={},Xv=U.query.split("&");for(var Bv=0,Uv=Xv.length;Bv<Uv;++Bv){var Jv=Xv[Bv].split("=");switch(Jv[0]){case"to":var $v=Jv[1].split(",");for(var hv=0,zv=$v.length;hv<zv;++hv)h.push($v[hv]);break;case"subject":U.subject=dv(Jv[1],E);break;case"body":U.body=dv(Jv[1],E);break;default:r=!0,e[dv(Jv[0],E)]=dv(Jv[1],E);break}}if(r)U.headers=e}U.query=void 0;for(var wv=0,Mv=h.length;wv<Mv;++wv){var qv=h[wv].split("@");if(qv[0]=dv(qv[0]),!E.unicodeSupport)try{qv[1]=Yv.toASCII(dv(qv[1],E).toLowerCase())}catch(Sf){U.error=U.error||"Email address's domain name can not be converted to ASCII via punycode: "+Sf}else qv[1]=dv(qv[1],E).toLowerCase();h[wv]=qv.join("@")}return U},serialize:function N(P,E){var U=P,h=X(P.to);if(h){for(var r=0,e=h.length;r<e;++r){var Xv=String(h[r]),Bv=Xv.lastIndexOf("@"),Uv=Xv.slice(0,Bv).replace(mf,y0).replace(mf,Q).replace(v6,gv),Jv=Xv.slice(Bv+1);try{Jv=!E.iri?Yv.toASCII(dv(Jv,E).toLowerCase()):Yv.toUnicode(Jv)}catch(wv){U.error=U.error||"Email address's domain name can not be converted to "+(!E.iri?"ASCII":"Unicode")+" via punycode: "+wv}h[r]=Uv+"@"+Jv}U.path=h.join(",")}var $v=P.headers=P.headers||{};if(P.subject)$v.subject=P.subject;if(P.body)$v.body=P.body;var hv=[];for(var zv in $v)if($v[zv]!==nJ[zv])hv.push(zv.replace(mf,y0).replace(mf,Q).replace(nQ,gv)+"="+$v[zv].replace(mf,y0).replace(mf,Q).replace(f6,gv));if(hv.length)U.query=hv.join("&");return U}},Q6=/^([^\:]+)\:(.*)/,iQ={scheme:"urn",parse:function N(P,E){var U=P.path&&P.path.match(Q6),h=P;if(U){var r=E.scheme||h.scheme||"urn",e=U[1].toLowerCase(),Xv=U[2],Bv=r+":"+(E.nid||e),Uv=jv[Bv];if(h.nid=e,h.nss=Xv,h.path=void 0,Uv)h=Uv.parse(h,E)}else h.error=h.error||"URN can not be parsed.";return h},serialize:function N(P,E){var U=E.scheme||P.scheme||"urn",h=P.nid,r=U+":"+(E.nid||h),e=jv[r];if(e)P=e.serialize(P,E);var Xv=P,Bv=P.nss;return Xv.path=(h||E.nid)+":"+Bv,Xv}},W6=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,dQ={scheme:"urn:uuid",parse:function N(P,E){var U=P;if(U.uuid=U.nss,U.nss=void 0,!E.tolerant&&(!U.uuid||!U.uuid.match(W6)))U.error=U.error||"UUID is not valid.";return U},serialize:function N(P,E){var U=P;return U.nss=(P.uuid||"").toLowerCase(),U}};jv[K1.scheme]=K1,jv[rQ.scheme]=rQ,jv[z1.scheme]=z1,jv[aQ.scheme]=aQ,jv[pQ.scheme]=pQ,jv[iQ.scheme]=iQ,jv[dQ.scheme]=dQ,f.SCHEMES=jv,f.pctEncChar=gv,f.pctDecChars=yv,f.parse=Gv,f.removeDotSegments=av,f.serialize=Zv,f.resolveComponents=lv,f.resolve=Jf,f.normalize=uv,f.equal=y1,f.escapeComponent=S0,f.unescapeComponent=dv,Object.defineProperty(f,"__esModule",{value:!0})})});var X0=o((W4,S8)=>{S8.exports=function f(v,W){if(v===W)return!0;if(v&&W&&typeof v=="object"&&typeof W=="object"){if(v.constructor!==W.constructor)return!1;var J,Q,X;if(Array.isArray(v)){if(J=v.length,J!=W.length)return!1;for(Q=J;Q--!==0;)if(!f(v[Q],W[Q]))return!1;return!0}if(v.constructor===RegExp)return v.source===W.source&&v.flags===W.flags;if(v.valueOf!==Object.prototype.valueOf)return v.valueOf()===W.valueOf();if(v.toString!==Object.prototype.toString)return v.toString()===W.toString();if(X=Object.keys(v),J=X.length,J!==Object.keys(W).length)return!1;for(Q=J;Q--!==0;)if(!Object.prototype.hasOwnProperty.call(W,X[Q]))return!1;for(Q=J;Q--!==0;){var Y=X[Q];if(!f(v[Y],W[Y]))return!1}return!0}return v!==v&&W!==W}});var l8=o((J4,y8)=>{y8.exports=function f(v){var W=0,J=v.length,Q=0,X;while(Q<J)if(W++,X=v.charCodeAt(Q++),X>=55296&&X<=56319&&Q<J){if(X=v.charCodeAt(Q),(X&64512)==56320)Q++}return W}});var uf=o((X4,C8)=>{C8.exports={copy:$X,checkDataType:vQ,checkDataTypes:MX,coerceToTypes:NX,toHash:QQ,getProperty:WQ,escapeQuotes:JQ,equal:X0(),ucs2length:l8(),varOccurences:DX,varReplace:jX,schemaHasRules:OX,schemaHasRulesExcept:UX,schemaUnknownRules:hX,toQuotedString:fQ,getPathExpr:FX,getPath:gX,getData:_X,unescapeFragment:RX,unescapeJsonPointer:YQ,escapeFragment:kX,escapeJsonPointer:XQ};function $X(f,v){v=v||{};for(var W in f)v[W]=f[W];return v}function vQ(f,v,W,J){var Q=J?" !== ":" === ",X=J?" || ":" && ",Y=J?"!":"",w=J?"":"!";switch(f){case"null":return v+Q+"null";case"array":return Y+"Array.isArray("+v+")";case"object":return"("+Y+v+X+"typeof "+v+Q+'"object"'+X+w+"Array.isArray("+v+"))";case"integer":return"(typeof "+v+Q+'"number"'+X+w+"("+v+" % 1)"+X+v+Q+v+(W?X+Y+"isFinite("+v+")":"")+")";case"number":return"(typeof "+v+Q+'"'+f+'"'+(W?X+Y+"isFinite("+v+")":"")+")";default:return"typeof "+v+Q+'"'+f+'"'}}function MX(f,v,W){switch(f.length){case 1:return vQ(f[0],v,W,!0);default:var J="",Q=QQ(f);if(Q.array&&Q.object)J=Q.null?"(":"(!"+v+" || ",J+="typeof "+v+' !== "object")',delete Q.null,delete Q.array,delete Q.object;if(Q.number)delete Q.integer;for(var X in Q)J+=(J?" && ":"")+vQ(X,v,W,!0);return J}}var I8=QQ(["string","number","integer","boolean","null"]);function NX(f,v){if(Array.isArray(v)){var W=[];for(var J=0;J<v.length;J++){var Q=v[J];if(I8[Q])W[W.length]=Q;else if(f==="array"&&Q==="array")W[W.length]=Q}if(W.length)return W}else if(I8[v])return[v];else if(f==="array"&&v==="array")return["array"]}function QQ(f){var v={};for(var W=0;W<f.length;W++)v[f[W]]=!0;return v}var VX=/^[a-z$_][a-z$_0-9]*$/i,EX=/'|\\/g;function WQ(f){return typeof f=="number"?"["+f+"]":VX.test(f)?"."+f:"['"+JQ(f)+"']"}function JQ(f){return f.replace(EX,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function DX(f,v){v+="[^0-9]";var W=f.match(new RegExp(v,"g"));return W?W.length:0}function jX(f,v,W){return v+="([^0-9])",W=W.replace(/\$/g,"$$$$"),f.replace(new RegExp(v,"g"),W+"$1")}function OX(f,v){if(typeof f=="boolean")return!f;for(var W in f)if(v[W])return!0}function UX(f,v,W){if(typeof f=="boolean")return!f&&W!="not";for(var J in f)if(J!=W&&v[J])return!0}function hX(f,v){if(typeof f=="boolean")return;for(var W in f)if(!v[W])return W}function fQ(f){return"'"+JQ(f)+"'"}function FX(f,v,W,J){var Q=W?"'/' + "+v+(J?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):J?"'[' + "+v+" + ']'":"'[\\'' + "+v+" + '\\']'";return Z8(f,Q)}function gX(f,v,W){var J=W?fQ("/"+XQ(v)):fQ(WQ(v));return Z8(f,J)}var AX=/^\/(?:[^~]|~0|~1)*$/,bX=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _X(f,v,W){var J,Q,X,Y;if(f==="")return"rootData";if(f[0]=="/"){if(!AX.test(f))throw new Error("Invalid JSON-pointer: "+f);Q=f,X="rootData"}else{if(Y=f.match(bX),!Y)throw new Error("Invalid JSON-pointer: "+f);if(J=+Y[1],Q=Y[2],Q=="#"){if(J>=v)throw new Error("Cannot access property/index "+J+" levels up, current level is "+v);return W[v-J]}if(J>v)throw new Error("Cannot access data "+J+" levels up, current level is "+v);if(X="data"+(v-J||""),!Q)return X}var w=X,B=Q.split("/");for(var z=0;z<B.length;z++){var H=B[z];if(H)X+=WQ(YQ(H)),w+=" && "+X}return w}function Z8(f,v){if(f=='""')return v;return(f+" + "+v).replace(/([^\\])' \+ '/g,"$1")}function RX(f){return YQ(decodeURIComponent(f))}function kX(f){return encodeURIComponent(XQ(f))}function XQ(f){return f.replace(/~/g,"~0").replace(/\//g,"~1")}function YQ(f){return f.replace(/~1/g,"/").replace(/~0/g,"~")}});var wQ=o((Y4,T8)=>{var SX=uf();T8.exports=yX;function yX(f){SX.copy(f,this)}});var u8=o((w4,x8)=>{var gf=x8.exports=function(f,v,W){if(typeof v=="function")W=v,v={};W=v.cb||W;var J=typeof W=="function"?W:W.pre||function(){},Q=W.post||function(){};Y0(v,J,Q,f,"",f)};gf.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};gf.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};gf.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};gf.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 Y0(f,v,W,J,Q,X,Y,w,B,z){if(J&&typeof J=="object"&&!Array.isArray(J)){v(J,Q,X,Y,w,B,z);for(var H in J){var $=J[H];if(Array.isArray($)){if(H in gf.arrayKeywords)for(var K=0;K<$.length;K++)Y0(f,v,W,$[K],Q+"/"+H+"/"+K,X,Q,H,J,K)}else if(H in gf.propsKeywords){if($&&typeof $=="object")for(var q in $)Y0(f,v,W,$[q],Q+"/"+H+"/"+lX(q),X,Q,H,J,q)}else if(H in gf.keywords||f.allKeys&&!(H in gf.skipKeywords))Y0(f,v,W,$,Q+"/"+H,X,Q,H,J)}W(J,Q,X,Y,w,B,z)}}function lX(f){return f.replace(/~/g,"~0").replace(/\//g,"~1")}});var H0=o((G4,c8)=>{var R1=k8(),r8=X0(),q0=uf(),w0=wQ(),IX=u8();c8.exports=bf;bf.normalizeId=Af;bf.fullPath=G0;bf.url=B0;bf.ids=uX;bf.inlineRef=GQ;bf.schema=P0;function bf(f,v,W){var J=this._refs[W];if(typeof J=="string")if(this._refs[J])J=this._refs[J];else return bf.call(this,f,v,J);if(J=J||this._schemas[W],J instanceof w0)return GQ(J.schema,this._opts.inlineRefs)?J.schema:J.validate||this._compile(J);var Q=P0.call(this,v,W),X,Y,w;if(Q)X=Q.schema,v=Q.root,w=Q.baseId;if(X instanceof w0)Y=X.validate||f.call(this,X.schema,v,void 0,w);else if(X!==void 0)Y=GQ(X,this._opts.inlineRefs)?X:f.call(this,X,v,void 0,w);return Y}function P0(f,v){var W=R1.parse(v),J=a8(W),Q=G0(this._getId(f.schema));if(Object.keys(f.schema).length===0||J!==Q){var X=Af(J),Y=this._refs[X];if(typeof Y=="string")return ZX.call(this,f,Y,W);else if(Y instanceof w0){if(!Y.validate)this._compile(Y);f=Y}else if(Y=this._schemas[X],Y instanceof w0){if(!Y.validate)this._compile(Y);if(X==Af(v))return{schema:Y,root:f,baseId:Q};f=Y}else return;if(!f.schema)return;Q=G0(this._getId(f.schema))}return m8.call(this,W,Q,f.schema,f)}function ZX(f,v,W){var J=P0.call(this,f,v);if(J){var{schema:Q,baseId:X}=J;f=J.root;var Y=this._getId(Q);if(Y)X=B0(X,Y);return m8.call(this,W,X,Q,f)}}var CX=q0.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function m8(f,v,W,J){if(f.fragment=f.fragment||"",f.fragment.slice(0,1)!="/")return;var Q=f.fragment.split("/");for(var X=1;X<Q.length;X++){var Y=Q[X];if(Y){if(Y=q0.unescapeFragment(Y),W=W[Y],W===void 0)break;var w;if(!CX[Y]){if(w=this._getId(W),w)v=B0(v,w);if(W.$ref){var B=B0(v,W.$ref),z=P0.call(this,J,B);if(z)W=z.schema,J=z.root,v=z.baseId}}}}if(W!==void 0&&W!==J.schema)return{schema:W,root:J,baseId:v}}var TX=q0.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function GQ(f,v){if(v===!1)return!1;if(v===void 0||v===!0)return BQ(f);else if(v)return qQ(f)<=v}function BQ(f){var v;if(Array.isArray(f)){for(var W=0;W<f.length;W++)if(v=f[W],typeof v=="object"&&!BQ(v))return!1}else for(var J in f){if(J=="$ref")return!1;if(v=f[J],typeof v=="object"&&!BQ(v))return!1}return!0}function qQ(f){var v=0,W;if(Array.isArray(f))for(var J=0;J<f.length;J++){if(W=f[J],typeof W=="object")v+=qQ(W);if(v==1/0)return 1/0}else for(var Q in f){if(Q=="$ref")return 1/0;if(TX[Q])v++;else{if(W=f[Q],typeof W=="object")v+=qQ(W)+1;if(v==1/0)return 1/0}}return v}function G0(f,v){if(v!==!1)f=Af(f);var W=R1.parse(f);return a8(W)}function a8(f){return R1.serialize(f).split("#")[0]+"#"}var xX=/#\/?$/;function Af(f){return f?f.replace(xX,""):""}function B0(f,v){return v=Af(v),R1.resolve(f,v)}function uX(f){var v=Af(this._getId(f)),W={"":v},J={"":G0(v,!1)},Q={},X=this;return IX(f,{allKeys:!0},function(Y,w,B,z,H,$,K){if(w==="")return;var q=X._getId(Y),L=W[z],V=J[z]+"/"+H;if(K!==void 0)V+="/"+(typeof K=="number"?K:q0.escapeFragment(K));if(typeof q=="string"){q=L=Af(L?R1.resolve(L,q):q);var M=X._refs[q];if(typeof M=="string")M=X._refs[M];if(M&&M.schema){if(!r8(Y,M.schema))throw new Error('id "'+q+'" resolves to more than one schema')}else if(q!=Af(V))if(q[0]=="#"){if(Q[q]&&!r8(Y,Q[q]))throw new Error('id "'+q+'" resolves to more than one schema');Q[q]=Y}else X._refs[q]=V}W[w]=L,J[w]=V}),Q}});var K0=o((B4,p8)=>{var PQ=H0();p8.exports={Validation:n8(rX),MissingRef:n8(HQ)};function rX(f){this.message="validation failed",this.errors=f,this.ajv=this.validation=!0}HQ.message=function(f,v){return"can't resolve reference "+v+" from id "+f};function HQ(f,v,W){this.message=W||HQ.message(f,v),this.missingRef=PQ.url(f,v),this.missingSchema=PQ.normalizeId(PQ.fullPath(this.missingRef))}function n8(f){return f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,f}});var KQ=o((q4,i8)=>{i8.exports=function(f,v){if(!v)v={};if(typeof v==="function")v={cmp:v};var W=typeof v.cycles==="boolean"?v.cycles:!1,J=v.cmp&&function(X){return function(Y){return function(w,B){var z={key:w,value:Y[w]},H={key:B,value:Y[B]};return X(z,H)}}}(v.cmp),Q=[];return function X(Y){if(Y&&Y.toJSON&&typeof Y.toJSON==="function")Y=Y.toJSON();if(Y===void 0)return;if(typeof Y=="number")return isFinite(Y)?""+Y:"null";if(typeof Y!=="object")return JSON.stringify(Y);var w,B;if(Array.isArray(Y)){B="[";for(w=0;w<Y.length;w++){if(w)B+=",";B+=X(Y[w])||"null"}return B+"]"}if(Y===null)return"null";if(Q.indexOf(Y)!==-1){if(W)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var z=Q.push(Y)-1,H=Object.keys(Y).sort(J&&J(Y));B="";for(w=0;w<H.length;w++){var $=H[w],K=X(Y[$]);if(!K)continue;if(B)B+=",";B+=JSON.stringify($)+":"+K}return Q.splice(z,1),"{"+B+"}"}(f)}});var zQ=o((P4,d8)=>{d8.exports=function f(v,W,J){var Q="",X=v.schema.$async===!0,Y=v.util.schemaHasRulesExcept(v.schema,v.RULES.all,"$ref"),w=v.self._getId(v.schema);if(v.opts.strictKeywords){var B=v.util.schemaUnknownRules(v.schema,v.RULES.keywords);if(B){var z="unknown keyword: "+B;if(v.opts.strictKeywords==="log")v.logger.warn(z);else throw new Error(z)}}if(v.isTop){if(Q+=" var validate = ",X)v.async=!0,Q+="async ";if(Q+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",w&&(v.opts.sourceCode||v.opts.processCode))Q+=" "+("/*# sourceURL="+w+" */")+" "}if(typeof v.schema=="boolean"||!(Y||v.schema.$ref)){var W="false schema",H=v.level,$=v.dataLevel,K=v.schema[W],q=v.schemaPath+v.util.getProperty(W),L=v.errSchemaPath+"/"+W,C=!v.opts.allErrors,A,V="data"+($||""),Z="valid"+H;if(v.schema===!1){if(v.isTop)C=!0;else Q+=" var "+Z+" = false; ";var M=M||[];if(M.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(A||"false schema")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(L)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'boolean schema is false' ";if(v.opts.verbose)Q+=" , schema: false , parentSchema: validate.schema"+v.schemaPath+" , data: "+V+" ";Q+=" } "}else Q+=" {} ";var D=Q;if(Q=M.pop(),!v.compositeRule&&C)if(v.async)Q+=" throw new ValidationError(["+D+"]); ";else Q+=" validate.errors = ["+D+"]; return false; ";else Q+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else if(v.isTop)if(X)Q+=" return data; ";else Q+=" validate.errors = null; return true; ";else Q+=" var "+Z+" = true; ";if(v.isTop)Q+=" }; return validate; ";return Q}if(v.isTop){var y=v.isTop,H=v.level=0,$=v.dataLevel=0,V="data";if(v.rootId=v.resolve.fullPath(v.self._getId(v.root.schema)),v.baseId=v.baseId||v.rootId,delete v.isTop,v.dataPathArr=[""],v.schema.default!==void 0&&v.opts.useDefaults&&v.opts.strictDefaults){var F="default is ignored in the schema root";if(v.opts.strictDefaults==="log")v.logger.warn(F);else throw new Error(F)}Q+=" var vErrors = null; ",Q+=" var errors = 0; ",Q+=" if (rootData === undefined) rootData = data; "}else{var{level:H,dataLevel:$}=v,V="data"+($||"");if(w)v.baseId=v.resolve.url(v.baseId,w);if(X&&!v.async)throw new Error("async schema in sync schema");Q+=" var errs_"+H+" = errors;"}var Z="valid"+H,C=!v.opts.allErrors,T="",O="",A,j=v.schema.type,_=Array.isArray(j);if(j&&v.opts.nullable&&v.schema.nullable===!0){if(_){if(j.indexOf("null")==-1)j=j.concat("null")}else if(j!="null")j=[j,"null"],_=!0}if(_&&j.length==1)j=j[0],_=!1;if(v.schema.$ref&&Y){if(v.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+v.errSchemaPath+'" (see option extendRefs)');else if(v.opts.extendRefs!==!0)Y=!1,v.logger.warn('$ref: keywords ignored in schema at path "'+v.errSchemaPath+'"')}if(v.schema.$comment&&v.opts.$comment)Q+=" "+v.RULES.all.$comment.code(v,"$comment");if(j){if(v.opts.coerceTypes)var l=v.util.coerceToTypes(v.opts.coerceTypes,j);var R=v.RULES.types[j];if(l||_||R===!0||R&&!Av(R)){var q=v.schemaPath+".type",L=v.errSchemaPath+"/type",q=v.schemaPath+".type",L=v.errSchemaPath+"/type",g=_?"checkDataTypes":"checkDataType";if(Q+=" if ("+v.util[g](j,V,v.opts.strictNumbers,!0)+") { ",l){var b="dataType"+H,k="coerced"+H;if(Q+=" var "+b+" = typeof "+V+"; var "+k+" = undefined; ",v.opts.coerceTypes=="array")Q+=" if ("+b+" == 'object' && Array.isArray("+V+") && "+V+".length == 1) { "+V+" = "+V+"[0]; "+b+" = typeof "+V+"; if ("+v.util.checkDataType(v.schema.type,V,v.opts.strictNumbers)+") "+k+" = "+V+"; } ";Q+=" if ("+k+" !== undefined) ; ";var m=l;if(m){var c,d=-1,s=m.length-1;while(d<s)if(c=m[d+=1],c=="string")Q+=" else if ("+b+" == 'number' || "+b+" == 'boolean') "+k+" = '' + "+V+"; else if ("+V+" === null) "+k+" = ''; ";else if(c=="number"||c=="integer"){if(Q+=" else if ("+b+" == 'boolean' || "+V+" === null || ("+b+" == 'string' && "+V+" && "+V+" == +"+V+" ",c=="integer")Q+=" && !("+V+" % 1)";Q+=")) "+k+" = +"+V+"; "}else if(c=="boolean")Q+=" else if ("+V+" === 'false' || "+V+" === 0 || "+V+" === null) "+k+" = false; else if ("+V+" === 'true' || "+V+" === 1) "+k+" = true; ";else if(c=="null")Q+=" else if ("+V+" === '' || "+V+" === 0 || "+V+" === false) "+k+" = null; ";else if(v.opts.coerceTypes=="array"&&c=="array")Q+=" else if ("+b+" == 'string' || "+b+" == 'number' || "+b+" == 'boolean' || "+V+" == null) "+k+" = ["+V+"]; "}Q+=" else { ";var M=M||[];if(M.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(A||"type")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(L)+" , params: { type: '",_)Q+=""+j.join(",");else Q+=""+j;if(Q+="' } ",v.opts.messages!==!1){if(Q+=" , message: 'should be ",_)Q+=""+j.join(",");else Q+=""+j;Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+q+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+V+" ";Q+=" } "}else Q+=" {} ";var D=Q;if(Q=M.pop(),!v.compositeRule&&C)if(v.async)Q+=" throw new ValidationError(["+D+"]); ";else Q+=" validate.errors = ["+D+"]; return false; ";else Q+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } if ("+k+" !== undefined) { ";var n=$?"data"+($-1||""):"parentData",Vv=$?v.dataPathArr[$]:"parentDataProperty";if(Q+=" "+V+" = "+k+"; ",!$)Q+="if ("+n+" !== undefined)";Q+=" "+n+"["+Vv+"] = "+k+"; } "}else{var M=M||[];if(M.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(A||"type")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(L)+" , params: { type: '",_)Q+=""+j.join(",");else Q+=""+j;if(Q+="' } ",v.opts.messages!==!1){if(Q+=" , message: 'should be ",_)Q+=""+j.join(",");else Q+=""+j;Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+q+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+V+" ";Q+=" } "}else Q+=" {} ";var D=Q;if(Q=M.pop(),!v.compositeRule&&C)if(v.async)Q+=" throw new ValidationError(["+D+"]); ";else Q+=" validate.errors = ["+D+"]; return false; ";else Q+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}Q+=" } "}}if(v.schema.$ref&&!Y){if(Q+=" "+v.RULES.all.$ref.code(v,"$ref")+" ",C){if(Q+=" } if (errors === ",y)Q+="0";else Q+="errs_"+H;Q+=") { ",O+="}"}}else{var _v=v.RULES;if(_v){var R,Sv=-1,Yv=_v.length-1;while(Sv<Yv)if(R=_v[Sv+=1],Av(R)){if(R.type)Q+=" if ("+v.util.checkDataType(R.type,V,v.opts.strictNumbers)+") { ";if(v.opts.useDefaults){if(R.type=="object"&&v.schema.properties){var K=v.schema.properties,jv=Object.keys(K),gv=jv;if(gv){var yv,Vf=-1,Pf=gv.length-1;while(Vf<Pf){yv=gv[Vf+=1];var Ov=K[yv];if(Ov.default!==void 0){var Ev=V+v.util.getProperty(yv);if(v.compositeRule){if(v.opts.strictDefaults){var F="default is ignored for: "+Ev;if(v.opts.strictDefaults==="log")v.logger.warn(F);else throw new Error(F)}}else{if(Q+=" if ("+Ev+" === undefined ",v.opts.useDefaults=="empty")Q+=" || "+Ev+" === null || "+Ev+" === '' ";if(Q+=" ) "+Ev+" = ",v.opts.useDefaults=="shared")Q+=" "+v.useDefault(Ov.default)+" ";else Q+=" "+JSON.stringify(Ov.default)+" ";Q+="; "}}}}}else if(R.type=="array"&&Array.isArray(v.schema.items)){var _f=v.schema.items;if(_f){var Ov,d=-1,Rv=_f.length-1;while(d<Rv)if(Ov=_f[d+=1],Ov.default!==void 0){var Ev=V+"["+d+"]";if(v.compositeRule){if(v.opts.strictDefaults){var F="default is ignored for: "+Ev;if(v.opts.strictDefaults==="log")v.logger.warn(F);else throw new Error(F)}}else{if(Q+=" if ("+Ev+" === undefined ",v.opts.useDefaults=="empty")Q+=" || "+Ev+" === null || "+Ev+" === '' ";if(Q+=" ) "+Ev+" = ",v.opts.useDefaults=="shared")Q+=" "+v.useDefault(Ov.default)+" ";else Q+=" "+JSON.stringify(Ov.default)+" ";Q+="; "}}}}}var Gv=R.rules;if(Gv){var Ef,Hf=-1,Rf=Gv.length-1;while(Hf<Rf)if(Ef=Gv[Hf+=1],av(Ef)){var kf=Ef.code(v,Ef.keyword,R.type);if(kf){if(Q+=" "+kf+" ",C)T+="}"}}}if(C)Q+=" "+T+" ",T="";if(R.type){if(Q+=" } ",j&&j===R.type&&!l){Q+=" else { ";var q=v.schemaPath+".type",L=v.errSchemaPath+"/type",M=M||[];if(M.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(A||"type")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(L)+" , params: { type: '",_)Q+=""+j.join(",");else Q+=""+j;if(Q+="' } ",v.opts.messages!==!1){if(Q+=" , message: 'should be ",_)Q+=""+j.join(",");else Q+=""+j;Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+q+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+V+" ";Q+=" } "}else Q+=" {} ";var D=Q;if(Q=M.pop(),!v.compositeRule&&C)if(v.async)Q+=" throw new ValidationError(["+D+"]); ";else Q+=" validate.errors = ["+D+"]; return false; ";else Q+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } "}}if(C){if(Q+=" if (errors === ",y)Q+="0";else Q+="errs_"+H;Q+=") { ",O+="}"}}}}if(C)Q+=" "+O+" ";if(y){if(X)Q+=" if (errors === 0) return data; ",Q+=" else throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; ",Q+=" return errors === 0; ";Q+=" }; return validate;"}else Q+=" var "+Z+" = errors === errs_"+H+";";function Av(lv){var Jf=lv.rules;for(var uv=0;uv<Jf.length;uv++)if(av(Jf[uv]))return!0}function av(lv){return v.schema[lv.keyword]!==void 0||lv.implements&&Zv(lv)}function Zv(lv){var Jf=lv.implements;for(var uv=0;uv<Jf.length;uv++)if(v.schema[Jf[uv]]!==void 0)return!0}return Q}});var vW=o((H4,e8)=>{var z0=H0(),$0=uf(),s8=K0(),mX=KQ(),o8=zQ(),aX=$0.ucs2length,cX=X0(),nX=s8.Validation;e8.exports=LQ;function LQ(f,v,W,J){var Q=this,X=this._opts,Y=[void 0],w={},B=[],z={},H=[],$={},K=[];v=v||{schema:f,refVal:Y,refs:w};var q=pX.call(this,f,v,J),L=this._compilations[q.index];if(q.compiling)return L.callValidate=F;var V=this._formats,M=this.RULES;try{var D=Z(f,v,W,J);L.validate=D;var y=L.callValidate;if(y){if(y.schema=D.schema,y.errors=null,y.refs=D.refs,y.refVal=D.refVal,y.root=D.root,y.$async=D.$async,X.sourceCode)y.source=D.source}return D}finally{iX.call(this,f,v,J)}function F(){var g=L.validate,b=g.apply(this,arguments);return F.errors=g.errors,b}function Z(g,b,k,m){var c=!b||b&&b.schema==g;if(b.schema!=v.schema)return LQ.call(Q,g,b,k,m);var d=g.$async===!0,s=o8({isTop:!0,schema:g,isRoot:c,baseId:m,root:b,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:s8.MissingRef,RULES:M,validate:o8,util:$0,resolve:z0,resolveRef:C,usePattern:_,useDefault:l,useCustomRule:R,opts:X,formats:V,logger:Q.logger,self:Q});if(s=L0(Y,sX)+L0(B,dX)+L0(H,oX)+L0(K,tX)+s,X.processCode)s=X.processCode(s,g);var n;try{var Vv=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",s);n=Vv(Q,M,V,v,Y,H,K,cX,aX,nX),Y[0]=n}catch(_v){throw Q.logger.error("Error compiling schema, function code:",s),_v}if(n.schema=g,n.errors=null,n.refs=w,n.refVal=Y,n.root=c?n:b,d)n.$async=!0;if(X.sourceCode===!0)n.source={code:s,patterns:B,defaults:H};return n}function C(g,b,k){b=z0.url(g,b);var m=w[b],c,d;if(m!==void 0)return c=Y[m],d="refVal["+m+"]",j(c,d);if(!k&&v.refs){var s=v.refs[b];if(s!==void 0)return c=v.refVal[s],d=T(b,c),j(c,d)}d=T(b);var n=z0.call(Q,Z,v,b);if(n===void 0){var Vv=W&&W[b];if(Vv)n=z0.inlineRef(Vv,X.inlineRefs)?Vv:LQ.call(Q,Vv,v,W,g)}if(n===void 0)O(b);else return A(b,n),j(n,d)}function T(g,b){var k=Y.length;return Y[k]=b,w[g]=k,"refVal"+k}function O(g){delete w[g]}function A(g,b){var k=w[g];Y[k]=b}function j(g,b){return typeof g=="object"||typeof g=="boolean"?{code:b,schema:g,inline:!0}:{code:b,$async:g&&!!g.$async}}function _(g){var b=z[g];if(b===void 0)b=z[g]=B.length,B[b]=g;return"pattern"+b}function l(g){switch(typeof g){case"boolean":case"number":return""+g;case"string":return $0.toQuotedString(g);case"object":if(g===null)return"null";var b=mX(g),k=$[b];if(k===void 0)k=$[b]=H.length,H[k]=g;return"default"+k}}function R(g,b,k,m){if(Q._opts.validateSchema!==!1){var c=g.definition.dependencies;if(c&&!c.every(function(gv){return Object.prototype.hasOwnProperty.call(k,gv)}))throw new Error("parent schema must have all required keywords: "+c.join(","));var d=g.definition.validateSchema;if(d){var s=d(b);if(!s){var n="keyword schema is invalid: "+Q.errorsText(d.errors);if(Q._opts.validateSchema=="log")Q.logger.error(n);else throw new Error(n)}}}var Vv=g.definition.compile,_v=g.definition.inline,Sv=g.definition.macro,Yv;if(Vv)Yv=Vv.call(Q,b,k,m);else if(Sv){if(Yv=Sv.call(Q,b,k,m),X.validateSchema!==!1)Q.validateSchema(Yv,!0)}else if(_v)Yv=_v.call(Q,m,g.keyword,b,k);else if(Yv=g.definition.validate,!Yv)return;if(Yv===void 0)throw new Error('custom keyword "'+g.keyword+'"failed to compile');var jv=K.length;return K[jv]=Yv,{code:"customRule"+jv,validate:Yv}}}function pX(f,v,W){var J=t8.call(this,f,v,W);if(J>=0)return{index:J,compiling:!0};return J=this._compilations.length,this._compilations[J]={schema:f,root:v,baseId:W},{index:J,compiling:!1}}function iX(f,v,W){var J=t8.call(this,f,v,W);if(J>=0)this._compilations.splice(J,1)}function t8(f,v,W){for(var J=0;J<this._compilations.length;J++){var Q=this._compilations[J];if(Q.schema==f&&Q.root==v&&Q.baseId==W)return J}return-1}function dX(f,v){return"var pattern"+f+" = new RegExp("+$0.toQuotedString(v[f])+");"}function oX(f){return"var default"+f+" = defaults["+f+"];"}function sX(f,v){return v[f]===void 0?"":"var refVal"+f+" = refVal["+f+"];"}function tX(f){return"var customRule"+f+" = customRules["+f+"];"}function L0(f,v){if(!f.length)return"";var W="";for(var J=0;J<f.length;J++)W+=v(J,f);return W}});var QW=o((K4,fW)=>{var M0=fW.exports=function f(){this._cache={}};M0.prototype.put=function f(v,W){this._cache[v]=W};M0.prototype.get=function f(v){return this._cache[v]};M0.prototype.del=function f(v){delete this._cache[v]};M0.prototype.clear=function f(){this._cache={}}});var zW=o((z4,KW)=>{var eX=uf(),vY=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,fY=[0,31,28,31,30,31,30,31,31,30,31,30,31],QY=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,WW=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,WY=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,JY=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,JW=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,XW=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,YW=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,wW=/^(?:\/(?:[^~/]|~0|~1)*)*$/,GW=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,BW=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;KW.exports=N0;function N0(f){return f=f=="full"?"full":"fast",eX.copy(N0[f])}N0.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":JW,url:XW,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:WW,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:HW,uuid:YW,"json-pointer":wW,"json-pointer-uri-fragment":GW,"relative-json-pointer":BW};N0.full={date:qW,time:PW,"date-time":wY,uri:BY,"uri-reference":JY,"uri-template":JW,url:XW,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:WW,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:HW,uuid:YW,"json-pointer":wW,"json-pointer-uri-fragment":GW,"relative-json-pointer":BW};function XY(f){return f%4===0&&(f%100!==0||f%400===0)}function qW(f){var v=f.match(vY);if(!v)return!1;var W=+v[1],J=+v[2],Q=+v[3];return J>=1&&J<=12&&Q>=1&&Q<=(J==2&&XY(W)?29:fY[J])}function PW(f,v){var W=f.match(QY);if(!W)return!1;var J=W[1],Q=W[2],X=W[3],Y=W[5];return(J<=23&&Q<=59&&X<=59||J==23&&Q==59&&X==60)&&(!v||Y)}var YY=/t|\s/i;function wY(f){var v=f.split(YY);return v.length==2&&qW(v[0])&&PW(v[1],!0)}var GY=/\/|:/;function BY(f){return GY.test(f)&&WY.test(f)}var qY=/[^\\]\\Z/;function HW(f){if(qY.test(f))return!1;try{return new RegExp(f),!0}catch(v){return!1}}});var $W=o((L4,LW)=>{LW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.errSchemaPath+"/"+W,z=!v.opts.allErrors,H="data"+(Y||""),$="valid"+X,K,q;if(w=="#"||w=="#/")if(v.isRoot)K=v.async,q="validate";else K=v.root.schema.$async===!0,q="root.refVal[0]";else{var L=v.resolveRef(v.baseId,w,v.isRoot);if(L===void 0){var V=v.MissingRefError.message(v.baseId,w);if(v.opts.missingRefs=="fail"){v.logger.error(V);var M=M||[];if(M.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(B)+" , params: { ref: '"+v.util.escapeQuotes(w)+"' } ",v.opts.messages!==!1)Q+=" , message: 'can\\'t resolve reference "+v.util.escapeQuotes(w)+"' ";if(v.opts.verbose)Q+=" , schema: "+v.util.toQuotedString(w)+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+H+" ";Q+=" } "}else Q+=" {} ";var D=Q;if(Q=M.pop(),!v.compositeRule&&z)if(v.async)Q+=" throw new ValidationError(["+D+"]); ";else Q+=" validate.errors = ["+D+"]; return false; ";else Q+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(z)Q+=" if (false) { "}else if(v.opts.missingRefs=="ignore"){if(v.logger.warn(V),z)Q+=" if (true) { "}else throw new v.MissingRefError(v.baseId,w,V)}else if(L.inline){var y=v.util.copy(v);y.level++;var F="valid"+y.level;y.schema=L.schema,y.schemaPath="",y.errSchemaPath=w;var Z=v.validate(y).replace(/validate\.schema/g,L.code);if(Q+=" "+Z+" ",z)Q+=" if ("+F+") { "}else K=L.$async===!0||v.async&&L.$async!==!1,q=L.code}if(q){var M=M||[];if(M.push(Q),Q="",v.opts.passContext)Q+=" "+q+".call(this, ";else Q+=" "+q+"( ";if(Q+=" "+H+", (dataPath || '')",v.errorPath!='""')Q+=" + "+v.errorPath;var C=Y?"data"+(Y-1||""):"parentData",T=Y?v.dataPathArr[Y]:"parentDataProperty";Q+=" , "+C+" , "+T+", rootData) ";var O=Q;if(Q=M.pop(),K){if(!v.async)throw new Error("async schema referenced by sync schema");if(z)Q+=" var "+$+"; ";if(Q+=" try { await "+O+"; ",z)Q+=" "+$+" = true; ";if(Q+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",z)Q+=" "+$+" = false; ";if(Q+=" } ",z)Q+=" if ("+$+") { "}else if(Q+=" if (!"+O+") { if (vErrors === null) vErrors = "+q+".errors; else vErrors = vErrors.concat("+q+".errors); errors = vErrors.length; } ",z)Q+=" else { "}return Q}});var NW=o(($4,MW)=>{MW.exports=function f(v,W,J){var Q=" ",X=v.schema[W],Y=v.schemaPath+v.util.getProperty(W),w=v.errSchemaPath+"/"+W,B=!v.opts.allErrors,z=v.util.copy(v),H="";z.level++;var $="valid"+z.level,K=z.baseId,q=!0,L=X;if(L){var V,M=-1,D=L.length-1;while(M<D)if(V=L[M+=1],v.opts.strictKeywords?typeof V=="object"&&Object.keys(V).length>0||V===!1:v.util.schemaHasRules(V,v.RULES.all)){if(q=!1,z.schema=V,z.schemaPath=Y+"["+M+"]",z.errSchemaPath=w+"/"+M,Q+=" "+v.validate(z)+" ",z.baseId=K,B)Q+=" if ("+$+") { ",H+="}"}}if(B)if(q)Q+=" if (true) { ";else Q+=" "+H.slice(0,-1)+" ";return Q}});var EW=o((M4,VW)=>{VW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="valid"+X,q="errs__"+X,L=v.util.copy(v),V="";L.level++;var M="valid"+L.level,D=w.every(function(A){return v.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:v.util.schemaHasRules(A,v.RULES.all)});if(D){var y=L.baseId;Q+=" var "+q+" = errors; var "+K+" = false; ";var F=v.compositeRule;v.compositeRule=L.compositeRule=!0;var Z=w;if(Z){var C,T=-1,O=Z.length-1;while(T<O)C=Z[T+=1],L.schema=C,L.schemaPath=B+"["+T+"]",L.errSchemaPath=z+"/"+T,Q+=" "+v.validate(L)+" ",L.baseId=y,Q+=" "+K+" = "+K+" || "+M+"; if (!"+K+") { ",V+="}"}if(v.compositeRule=L.compositeRule=F,Q+=" "+V+" if (!"+K+") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should match some schema in anyOf' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(Q+=" } else { errors = "+q+"; if (vErrors !== null) { if ("+q+") vErrors.length = "+q+"; else vErrors = null; } ",v.opts.allErrors)Q+=" } "}else if(H)Q+=" if (true) { ";return Q}});var jW=o((N4,DW)=>{DW.exports=function f(v,W,J){var Q=" ",X=v.schema[W],Y=v.errSchemaPath+"/"+W,w=!v.opts.allErrors,B=v.util.toQuotedString(X);if(v.opts.$comment===!0)Q+=" console.log("+B+");";else if(typeof v.opts.$comment=="function")Q+=" self._opts.$comment("+B+", "+v.util.toQuotedString(Y)+", validate.root.schema);";return Q}});var UW=o((V4,OW)=>{OW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="valid"+X,q=v.opts.$data&&w&&w.$data,L;if(q)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",L="schema"+X;else L=w;if(!q)Q+=" var schema"+X+" = validate.schema"+B+";";Q+="var "+K+" = equal("+$+", schema"+X+"); if (!"+K+") { ";var V=V||[];if(V.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'const' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { allowedValue: schema"+X+" } ",v.opts.messages!==!1)Q+=" , message: 'should be equal to constant' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var M=Q;if(Q=V.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+M+"]); ";else Q+=" validate.errors = ["+M+"]; return false; ";else Q+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" }",H)Q+=" else { ";return Q}});var FW=o((E4,hW)=>{hW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="valid"+X,q="errs__"+X,L=v.util.copy(v),V="";L.level++;var M="valid"+L.level,D="i"+X,y=L.dataLevel=v.dataLevel+1,F="data"+y,Z=v.baseId,C=v.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:v.util.schemaHasRules(w,v.RULES.all);if(Q+="var "+q+" = errors;var "+K+";",C){var T=v.compositeRule;v.compositeRule=L.compositeRule=!0,L.schema=w,L.schemaPath=B,L.errSchemaPath=z,Q+=" var "+M+" = false; for (var "+D+" = 0; "+D+" < "+$+".length; "+D+"++) { ",L.errorPath=v.util.getPathExpr(v.errorPath,D,v.opts.jsonPointers,!0);var O=$+"["+D+"]";L.dataPathArr[y]=D;var A=v.validate(L);if(L.baseId=Z,v.util.varOccurences(A,F)<2)Q+=" "+v.util.varReplace(A,F,O)+" ";else Q+=" var "+F+" = "+O+"; "+A+" ";Q+=" if ("+M+") break; } ",v.compositeRule=L.compositeRule=T,Q+=" "+V+" if (!"+M+") {"}else Q+=" if ("+$+".length == 0) {";var j=j||[];if(j.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should contain a valid item' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var _=Q;if(Q=j.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+_+"]); ";else Q+=" validate.errors = ["+_+"]; return false; ";else Q+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } else { ",C)Q+=" errors = "+q+"; if (vErrors !== null) { if ("+q+") vErrors.length = "+q+"; else vErrors = null; } ";if(v.opts.allErrors)Q+=" } ";return Q}});var AW=o((D4,gW)=>{gW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="errs__"+X,q=v.util.copy(v),L="";q.level++;var V="valid"+q.level,M={},D={},y=v.opts.ownProperties;for(T in w){if(T=="__proto__")continue;var F=w[T],Z=Array.isArray(F)?D:M;Z[T]=F}Q+="var "+K+" = errors;";var C=v.errorPath;Q+="var missing"+X+";";for(var T in D)if(Z=D[T],Z.length){if(Q+=" if ( "+$+v.util.getProperty(T)+" !== undefined ",y)Q+=" && Object.prototype.hasOwnProperty.call("+$+", '"+v.util.escapeQuotes(T)+"') ";if(H){Q+=" && ( ";var O=Z;if(O){var A,j=-1,_=O.length-1;while(j<_){if(A=O[j+=1],j)Q+=" || ";var l=v.util.getProperty(A),R=$+l;if(Q+=" ( ( "+R+" === undefined ",y)Q+=" || ! Object.prototype.hasOwnProperty.call("+$+", '"+v.util.escapeQuotes(A)+"') ";Q+=") && (missing"+X+" = "+v.util.toQuotedString(v.opts.jsonPointers?A:l)+") ) "}}Q+=")) { ";var g="missing"+X,b="' + "+g+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.opts.jsonPointers?v.util.getPathExpr(C,g,!0):C+" + "+g;var k=k||[];if(k.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { property: '"+v.util.escapeQuotes(T)+"', missingProperty: '"+b+"', depsCount: "+Z.length+", deps: '"+v.util.escapeQuotes(Z.length==1?Z[0]:Z.join(", "))+"' } ",v.opts.messages!==!1){if(Q+=" , message: 'should have ",Z.length==1)Q+="property "+v.util.escapeQuotes(Z[0]);else Q+="properties "+v.util.escapeQuotes(Z.join(", "));Q+=" when property "+v.util.escapeQuotes(T)+" is present' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var m=Q;if(Q=k.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+m+"]); ";else Q+=" validate.errors = ["+m+"]; return false; ";else Q+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{Q+=" ) { ";var c=Z;if(c){var A,d=-1,s=c.length-1;while(d<s){A=c[d+=1];var l=v.util.getProperty(A),b=v.util.escapeQuotes(A),R=$+l;if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPath(C,A,v.opts.jsonPointers);if(Q+=" if ( "+R+" === undefined ",y)Q+=" || ! Object.prototype.hasOwnProperty.call("+$+", '"+v.util.escapeQuotes(A)+"') ";if(Q+=") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { property: '"+v.util.escapeQuotes(T)+"', missingProperty: '"+b+"', depsCount: "+Z.length+", deps: '"+v.util.escapeQuotes(Z.length==1?Z[0]:Z.join(", "))+"' } ",v.opts.messages!==!1){if(Q+=" , message: 'should have ",Z.length==1)Q+="property "+v.util.escapeQuotes(Z[0]);else Q+="properties "+v.util.escapeQuotes(Z.join(", "));Q+=" when property "+v.util.escapeQuotes(T)+" is present' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}if(Q+=" } ",H)L+="}",Q+=" else { "}v.errorPath=C;var n=q.baseId;for(var T in M){var F=M[T];if(v.opts.strictKeywords?typeof F=="object"&&Object.keys(F).length>0||F===!1:v.util.schemaHasRules(F,v.RULES.all)){if(Q+=" "+V+" = true; if ( "+$+v.util.getProperty(T)+" !== undefined ",y)Q+=" && Object.prototype.hasOwnProperty.call("+$+", '"+v.util.escapeQuotes(T)+"') ";if(Q+=") { ",q.schema=F,q.schemaPath=B+v.util.getProperty(T),q.errSchemaPath=z+"/"+v.util.escapeFragment(T),Q+=" "+v.validate(q)+" ",q.baseId=n,Q+=" } ",H)Q+=" if ("+V+") { ",L+="}"}}if(H)Q+=" "+L+" if ("+K+" == errors) {";return Q}});var _W=o((j4,bW)=>{bW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="valid"+X,q=v.opts.$data&&w&&w.$data,L;if(q)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",L="schema"+X;else L=w;var V="i"+X,M="schema"+X;if(!q)Q+=" var "+M+" = validate.schema"+B+";";if(Q+="var "+K+";",q)Q+=" if (schema"+X+" === undefined) "+K+" = true; else if (!Array.isArray(schema"+X+")) "+K+" = false; else {";if(Q+=""+K+" = false;for (var "+V+"=0; "+V+"<"+M+".length; "+V+"++) if (equal("+$+", "+M+"["+V+"])) { "+K+" = true; break; }",q)Q+=" } ";Q+=" if (!"+K+") { ";var D=D||[];if(D.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { allowedValues: schema"+X+" } ",v.opts.messages!==!1)Q+=" , message: 'should be equal to one of the allowed values' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var y=Q;if(Q=D.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+y+"]); ";else Q+=" validate.errors = ["+y+"]; return false; ";else Q+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" }",H)Q+=" else { ";return Q}});var kW=o((O4,RW)=>{RW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||"");if(v.opts.format===!1){if(H)Q+=" if (true) { ";return Q}var K=v.opts.$data&&w&&w.$data,q;if(K)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",q="schema"+X;else q=w;var L=v.opts.unknownFormats,V=Array.isArray(L);if(K){var M="format"+X,D="isObject"+X,y="formatType"+X;if(Q+=" var "+M+" = formats["+q+"]; var "+D+" = typeof "+M+" == 'object' && !("+M+" instanceof RegExp) && "+M+".validate; var "+y+" = "+D+" && "+M+".type || 'string'; if ("+D+") { ",v.async)Q+=" var async"+X+" = "+M+".async; ";if(Q+=" "+M+" = "+M+".validate; } if ( ",K)Q+=" ("+q+" !== undefined && typeof "+q+" != 'string') || ";if(Q+=" (",L!="ignore"){if(Q+=" ("+q+" && !"+M+" ",V)Q+=" && self._opts.unknownFormats.indexOf("+q+") == -1 ";Q+=") || "}if(Q+=" ("+M+" && "+y+" == '"+J+"' && !(typeof "+M+" == 'function' ? ",v.async)Q+=" (async"+X+" ? await "+M+"("+$+") : "+M+"("+$+")) ";else Q+=" "+M+"("+$+") ";Q+=" : "+M+".test("+$+"))))) {"}else{var M=v.formats[w];if(!M)if(L=="ignore"){if(v.logger.warn('unknown format "'+w+'" ignored in schema at path "'+v.errSchemaPath+'"'),H)Q+=" if (true) { ";return Q}else if(V&&L.indexOf(w)>=0){if(H)Q+=" if (true) { ";return Q}else throw new Error('unknown format "'+w+'" is used in schema at path "'+v.errSchemaPath+'"');var D=typeof M=="object"&&!(M instanceof RegExp)&&M.validate,y=D&&M.type||"string";if(D){var F=M.async===!0;M=M.validate}if(y!=J){if(H)Q+=" if (true) { ";return Q}if(F){if(!v.async)throw new Error("async format in sync schema");var Z="formats"+v.util.getProperty(w)+".validate";Q+=" if (!(await "+Z+"("+$+"))) { "}else{Q+=" if (! ";var Z="formats"+v.util.getProperty(w);if(D)Z+=".validate";if(typeof M=="function")Q+=" "+Z+"("+$+") ";else Q+=" "+Z+".test("+$+") ";Q+=") { "}}var C=C||[];if(C.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'format' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { format: ",K)Q+=""+q;else Q+=""+v.util.toQuotedString(w);if(Q+=" } ",v.opts.messages!==!1){if(Q+=` , message: 'should match format "`,K)Q+="' + "+q+" + '";else Q+=""+v.util.escapeQuotes(w);Q+=`"' `}if(v.opts.verbose){if(Q+=" , schema: ",K)Q+="validate.schema"+B;else Q+=""+v.util.toQuotedString(w);Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" "}Q+=" } "}else Q+=" {} ";var T=Q;if(Q=C.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+T+"]); ";else Q+=" validate.errors = ["+T+"]; return false; ";else Q+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",H)Q+=" else { ";return Q}});var yW=o((U4,SW)=>{SW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="valid"+X,q="errs__"+X,L=v.util.copy(v);L.level++;var V="valid"+L.level,M=v.schema.then,D=v.schema.else,y=M!==void 0&&(v.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:v.util.schemaHasRules(M,v.RULES.all)),F=D!==void 0&&(v.opts.strictKeywords?typeof D=="object"&&Object.keys(D).length>0||D===!1:v.util.schemaHasRules(D,v.RULES.all)),Z=L.baseId;if(y||F){var C;L.createErrors=!1,L.schema=w,L.schemaPath=B,L.errSchemaPath=z,Q+=" var "+q+" = errors; var "+K+" = true; ";var T=v.compositeRule;if(v.compositeRule=L.compositeRule=!0,Q+=" "+v.validate(L)+" ",L.baseId=Z,L.createErrors=!0,Q+=" errors = "+q+"; if (vErrors !== null) { if ("+q+") vErrors.length = "+q+"; else vErrors = null; } ",v.compositeRule=L.compositeRule=T,y){if(Q+=" if ("+V+") { ",L.schema=v.schema.then,L.schemaPath=v.schemaPath+".then",L.errSchemaPath=v.errSchemaPath+"/then",Q+=" "+v.validate(L)+" ",L.baseId=Z,Q+=" "+K+" = "+V+"; ",y&&F)C="ifClause"+X,Q+=" var "+C+" = 'then'; ";else C="'then'";if(Q+=" } ",F)Q+=" else { "}else Q+=" if (!"+V+") { ";if(F){if(L.schema=v.schema.else,L.schemaPath=v.schemaPath+".else",L.errSchemaPath=v.errSchemaPath+"/else",Q+=" "+v.validate(L)+" ",L.baseId=Z,Q+=" "+K+" = "+V+"; ",y&&F)C="ifClause"+X,Q+=" var "+C+" = 'else'; ";else C="'else'";Q+=" } "}if(Q+=" if (!"+K+") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'if' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { failingKeyword: "+C+" } ",v.opts.messages!==!1)Q+=` , message: 'should match "' + `+C+` + '" schema' `;if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(Q+=" } ",H)Q+=" else { "}else if(H)Q+=" if (true) { ";return Q}});var IW=o((h4,lW)=>{lW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="valid"+X,q="errs__"+X,L=v.util.copy(v),V="";L.level++;var M="valid"+L.level,D="i"+X,y=L.dataLevel=v.dataLevel+1,F="data"+y,Z=v.baseId;if(Q+="var "+q+" = errors;var "+K+";",Array.isArray(w)){var C=v.schema.additionalItems;if(C===!1){Q+=" "+K+" = "+$+".length <= "+w.length+"; ";var T=z;z=v.errSchemaPath+"/additionalItems",Q+=" if (!"+K+") { ";var O=O||[];if(O.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { limit: "+w.length+" } ",v.opts.messages!==!1)Q+=" , message: 'should NOT have more than "+w.length+" items' ";if(v.opts.verbose)Q+=" , schema: false , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var A=Q;if(Q=O.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+A+"]); ";else Q+=" validate.errors = ["+A+"]; return false; ";else Q+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",z=T,H)V+="}",Q+=" else { "}var j=w;if(j){var _,l=-1,R=j.length-1;while(l<R)if(_=j[l+=1],v.opts.strictKeywords?typeof _=="object"&&Object.keys(_).length>0||_===!1:v.util.schemaHasRules(_,v.RULES.all)){Q+=" "+M+" = true; if ("+$+".length > "+l+") { ";var g=$+"["+l+"]";L.schema=_,L.schemaPath=B+"["+l+"]",L.errSchemaPath=z+"/"+l,L.errorPath=v.util.getPathExpr(v.errorPath,l,v.opts.jsonPointers,!0),L.dataPathArr[y]=l;var b=v.validate(L);if(L.baseId=Z,v.util.varOccurences(b,F)<2)Q+=" "+v.util.varReplace(b,F,g)+" ";else Q+=" var "+F+" = "+g+"; "+b+" ";if(Q+=" } ",H)Q+=" if ("+M+") { ",V+="}"}}if(typeof C=="object"&&(v.opts.strictKeywords?typeof C=="object"&&Object.keys(C).length>0||C===!1:v.util.schemaHasRules(C,v.RULES.all))){L.schema=C,L.schemaPath=v.schemaPath+".additionalItems",L.errSchemaPath=v.errSchemaPath+"/additionalItems",Q+=" "+M+" = true; if ("+$+".length > "+w.length+") { for (var "+D+" = "+w.length+"; "+D+" < "+$+".length; "+D+"++) { ",L.errorPath=v.util.getPathExpr(v.errorPath,D,v.opts.jsonPointers,!0);var g=$+"["+D+"]";L.dataPathArr[y]=D;var b=v.validate(L);if(L.baseId=Z,v.util.varOccurences(b,F)<2)Q+=" "+v.util.varReplace(b,F,g)+" ";else Q+=" var "+F+" = "+g+"; "+b+" ";if(H)Q+=" if (!"+M+") break; ";if(Q+=" } } ",H)Q+=" if ("+M+") { ",V+="}"}}else if(v.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:v.util.schemaHasRules(w,v.RULES.all)){L.schema=w,L.schemaPath=B,L.errSchemaPath=z,Q+=" for (var "+D+" = 0; "+D+" < "+$+".length; "+D+"++) { ",L.errorPath=v.util.getPathExpr(v.errorPath,D,v.opts.jsonPointers,!0);var g=$+"["+D+"]";L.dataPathArr[y]=D;var b=v.validate(L);if(L.baseId=Z,v.util.varOccurences(b,F)<2)Q+=" "+v.util.varReplace(b,F,g)+" ";else Q+=" var "+F+" = "+g+"; "+b+" ";if(H)Q+=" if (!"+M+") break; ";Q+=" }"}if(H)Q+=" "+V+" if ("+q+" == errors) {";return Q}});var $Q=o((F4,ZW)=>{ZW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,Z,$="data"+(Y||""),K=v.opts.$data&&w&&w.$data,q;if(K)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",q="schema"+X;else q=w;var L=W=="maximum",V=L?"exclusiveMaximum":"exclusiveMinimum",M=v.schema[V],D=v.opts.$data&&M&&M.$data,y=L?"<":">",F=L?">":"<",Z=void 0;if(!(K||typeof w=="number"||w===void 0))throw new Error(W+" must be number");if(!(D||M===void 0||typeof M=="number"||typeof M=="boolean"))throw new Error(V+" must be number or boolean");if(D){var C=v.util.getData(M.$data,Y,v.dataPathArr),T="exclusive"+X,O="exclType"+X,A="exclIsNumber"+X,j="op"+X,_="' + "+j+" + '";Q+=" var schemaExcl"+X+" = "+C+"; ",C="schemaExcl"+X,Q+=" var "+T+"; var "+O+" = typeof "+C+"; if ("+O+" != 'boolean' && "+O+" != 'undefined' && "+O+" != 'number') { ";var Z=V,l=l||[];if(l.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(Z||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: '"+V+" should be boolean' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var R=Q;if(Q=l.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+R+"]); ";else Q+=" validate.errors = ["+R+"]; return false; ";else Q+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } else if ( ",K)Q+=" ("+q+" !== undefined && typeof "+q+" != 'number') || ";if(Q+=" "+O+" == 'number' ? ( ("+T+" = "+q+" === undefined || "+C+" "+y+"= "+q+") ? "+$+" "+F+"= "+C+" : "+$+" "+F+" "+q+" ) : ( ("+T+" = "+C+" === true) ? "+$+" "+F+"= "+q+" : "+$+" "+F+" "+q+" ) || "+$+" !== "+$+") { var op"+X+" = "+T+" ? '"+y+"' : '"+y+"='; ",w===void 0)Z=V,z=v.errSchemaPath+"/"+V,q=C,K=D}else{var A=typeof M=="number",_=y;if(A&&K){var j="'"+_+"'";if(Q+=" if ( ",K)Q+=" ("+q+" !== undefined && typeof "+q+" != 'number') || ";Q+=" ( "+q+" === undefined || "+M+" "+y+"= "+q+" ? "+$+" "+F+"= "+M+" : "+$+" "+F+" "+q+" ) || "+$+" !== "+$+") { "}else{if(A&&w===void 0)T=!0,Z=V,z=v.errSchemaPath+"/"+V,q=M,F+="=";else{if(A)q=Math[L?"min":"max"](M,w);if(M===(A?q:!0))T=!0,Z=V,z=v.errSchemaPath+"/"+V,F+="=";else T=!1,_+="="}var j="'"+_+"'";if(Q+=" if ( ",K)Q+=" ("+q+" !== undefined && typeof "+q+" != 'number') || ";Q+=" "+$+" "+F+" "+q+" || "+$+" !== "+$+") { "}}Z=Z||W;var l=l||[];if(l.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(Z||"_limit")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { comparison: "+j+", limit: "+q+", exclusive: "+T+" } ",v.opts.messages!==!1)if(Q+=" , message: 'should be "+_+" ",K)Q+="' + "+q;else Q+=""+q+"'";if(v.opts.verbose){if(Q+=" , schema: ",K)Q+="validate.schema"+B;else Q+=""+w;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" "}Q+=" } "}else Q+=" {} ";var R=Q;if(Q=l.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+R+"]); ";else Q+=" validate.errors = ["+R+"]; return false; ";else Q+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",H)Q+=" else { ";return Q}});var MQ=o((g4,CW)=>{CW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,V,$="data"+(Y||""),K=v.opts.$data&&w&&w.$data,q;if(K)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",q="schema"+X;else q=w;if(!(K||typeof w=="number"))throw new Error(W+" must be number");var L=W=="maxItems"?">":"<";if(Q+="if ( ",K)Q+=" ("+q+" !== undefined && typeof "+q+" != 'number') || ";Q+=" "+$+".length "+L+" "+q+") { ";var V=W,M=M||[];if(M.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(V||"_limitItems")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { limit: "+q+" } ",v.opts.messages!==!1){if(Q+=" , message: 'should NOT have ",W=="maxItems")Q+="more";else Q+="fewer";if(Q+=" than ",K)Q+="' + "+q+" + '";else Q+=""+w;Q+=" items' "}if(v.opts.verbose){if(Q+=" , schema: ",K)Q+="validate.schema"+B;else Q+=""+w;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" "}Q+=" } "}else Q+=" {} ";var D=Q;if(Q=M.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+D+"]); ";else Q+=" validate.errors = ["+D+"]; return false; ";else Q+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",H)Q+=" else { ";return Q}});var NQ=o((A4,TW)=>{TW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,V,$="data"+(Y||""),K=v.opts.$data&&w&&w.$data,q;if(K)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",q="schema"+X;else q=w;if(!(K||typeof w=="number"))throw new Error(W+" must be number");var L=W=="maxLength"?">":"<";if(Q+="if ( ",K)Q+=" ("+q+" !== undefined && typeof "+q+" != 'number') || ";if(v.opts.unicode===!1)Q+=" "+$+".length ";else Q+=" ucs2length("+$+") ";Q+=" "+L+" "+q+") { ";var V=W,M=M||[];if(M.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(V||"_limitLength")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { limit: "+q+" } ",v.opts.messages!==!1){if(Q+=" , message: 'should NOT be ",W=="maxLength")Q+="longer";else Q+="shorter";if(Q+=" than ",K)Q+="' + "+q+" + '";else Q+=""+w;Q+=" characters' "}if(v.opts.verbose){if(Q+=" , schema: ",K)Q+="validate.schema"+B;else Q+=""+w;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" "}Q+=" } "}else Q+=" {} ";var D=Q;if(Q=M.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+D+"]); ";else Q+=" validate.errors = ["+D+"]; return false; ";else Q+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",H)Q+=" else { ";return Q}});var VQ=o((b4,xW)=>{xW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,V,$="data"+(Y||""),K=v.opts.$data&&w&&w.$data,q;if(K)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",q="schema"+X;else q=w;if(!(K||typeof w=="number"))throw new Error(W+" must be number");var L=W=="maxProperties"?">":"<";if(Q+="if ( ",K)Q+=" ("+q+" !== undefined && typeof "+q+" != 'number') || ";Q+=" Object.keys("+$+").length "+L+" "+q+") { ";var V=W,M=M||[];if(M.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(V||"_limitProperties")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { limit: "+q+" } ",v.opts.messages!==!1){if(Q+=" , message: 'should NOT have ",W=="maxProperties")Q+="more";else Q+="fewer";if(Q+=" than ",K)Q+="' + "+q+" + '";else Q+=""+w;Q+=" properties' "}if(v.opts.verbose){if(Q+=" , schema: ",K)Q+="validate.schema"+B;else Q+=""+w;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" "}Q+=" } "}else Q+=" {} ";var D=Q;if(Q=M.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+D+"]); ";else Q+=" validate.errors = ["+D+"]; return false; ";else Q+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",H)Q+=" else { ";return Q}});var rW=o((_4,uW)=>{uW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K=v.opts.$data&&w&&w.$data,q;if(K)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",q="schema"+X;else q=w;if(!(K||typeof w=="number"))throw new Error(W+" must be number");if(Q+="var division"+X+";if (",K)Q+=" "+q+" !== undefined && ( typeof "+q+" != 'number' || ";if(Q+=" (division"+X+" = "+$+" / "+q+", ",v.opts.multipleOfPrecision)Q+=" Math.abs(Math.round(division"+X+") - division"+X+") > 1e-"+v.opts.multipleOfPrecision+" ";else Q+=" division"+X+" !== parseInt(division"+X+") ";if(Q+=" ) ",K)Q+=" ) ";Q+=" ) { ";var L=L||[];if(L.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { multipleOf: "+q+" } ",v.opts.messages!==!1)if(Q+=" , message: 'should be multiple of ",K)Q+="' + "+q;else Q+=""+q+"'";if(v.opts.verbose){if(Q+=" , schema: ",K)Q+="validate.schema"+B;else Q+=""+w;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" "}Q+=" } "}else Q+=" {} ";var V=Q;if(Q=L.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+V+"]); ";else Q+=" validate.errors = ["+V+"]; return false; ";else Q+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",H)Q+=" else { ";return Q}});var aW=o((R4,mW)=>{mW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="errs__"+X,q=v.util.copy(v);q.level++;var L="valid"+q.level;if(v.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:v.util.schemaHasRules(w,v.RULES.all)){q.schema=w,q.schemaPath=B,q.errSchemaPath=z,Q+=" var "+K+" = errors; ";var V=v.compositeRule;v.compositeRule=q.compositeRule=!0,q.createErrors=!1;var M;if(q.opts.allErrors)M=q.opts.allErrors,q.opts.allErrors=!1;if(Q+=" "+v.validate(q)+" ",q.createErrors=!0,M)q.opts.allErrors=M;v.compositeRule=q.compositeRule=V,Q+=" if ("+L+") { ";var D=D||[];if(D.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'not' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should NOT be valid' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var y=Q;if(Q=D.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+y+"]); ";else Q+=" validate.errors = ["+y+"]; return false; ";else Q+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } else { errors = "+K+"; if (vErrors !== null) { if ("+K+") vErrors.length = "+K+"; else vErrors = null; } ",v.opts.allErrors)Q+=" } "}else{if(Q+=" var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'not' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should NOT be valid' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",H)Q+=" if (false) { "}return Q}});var nW=o((k4,cW)=>{cW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="valid"+X,q="errs__"+X,L=v.util.copy(v),V="";L.level++;var M="valid"+L.level,D=L.baseId,y="prevValid"+X,F="passingSchemas"+X;Q+="var "+q+" = errors , "+y+" = false , "+K+" = false , "+F+" = null; ";var Z=v.compositeRule;v.compositeRule=L.compositeRule=!0;var C=w;if(C){var T,O=-1,A=C.length-1;while(O<A){if(T=C[O+=1],v.opts.strictKeywords?typeof T=="object"&&Object.keys(T).length>0||T===!1:v.util.schemaHasRules(T,v.RULES.all))L.schema=T,L.schemaPath=B+"["+O+"]",L.errSchemaPath=z+"/"+O,Q+=" "+v.validate(L)+" ",L.baseId=D;else Q+=" var "+M+" = true; ";if(O)Q+=" if ("+M+" && "+y+") { "+K+" = false; "+F+" = ["+F+", "+O+"]; } else { ",V+="}";Q+=" if ("+M+") { "+K+" = "+y+" = true; "+F+" = "+O+"; }"}}if(v.compositeRule=L.compositeRule=Z,Q+=""+V+"if (!"+K+") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { passingSchemas: "+F+" } ",v.opts.messages!==!1)Q+=" , message: 'should match exactly one schema in oneOf' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(Q+="} else { errors = "+q+"; if (vErrors !== null) { if ("+q+") vErrors.length = "+q+"; else vErrors = null; }",v.opts.allErrors)Q+=" } ";return Q}});var iW=o((S4,pW)=>{pW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K=v.opts.$data&&w&&w.$data,q;if(K)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",q="schema"+X;else q=w;var L=K?"(new RegExp("+q+"))":v.usePattern(w);if(Q+="if ( ",K)Q+=" ("+q+" !== undefined && typeof "+q+" != 'string') || ";Q+=" !"+L+".test("+$+") ) { ";var V=V||[];if(V.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { pattern: ",K)Q+=""+q;else Q+=""+v.util.toQuotedString(w);if(Q+=" } ",v.opts.messages!==!1){if(Q+=` , message: 'should match pattern "`,K)Q+="' + "+q+" + '";else Q+=""+v.util.escapeQuotes(w);Q+=`"' `}if(v.opts.verbose){if(Q+=" , schema: ",K)Q+="validate.schema"+B;else Q+=""+v.util.toQuotedString(w);Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" "}Q+=" } "}else Q+=" {} ";var M=Q;if(Q=V.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+M+"]); ";else Q+=" validate.errors = ["+M+"]; return false; ";else Q+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",H)Q+=" else { ";return Q}});var oW=o((y4,dW)=>{dW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="errs__"+X,q=v.util.copy(v),L="";q.level++;var V="valid"+q.level,M="key"+X,D="idx"+X,y=q.dataLevel=v.dataLevel+1,F="data"+y,Z="dataProperties"+X,C=Object.keys(w||{}).filter(d),T=v.schema.patternProperties||{},O=Object.keys(T).filter(d),A=v.schema.additionalProperties,j=C.length||O.length,_=A===!1,l=typeof A=="object"&&Object.keys(A).length,R=v.opts.removeAdditional,g=_||l||R,b=v.opts.ownProperties,k=v.baseId,m=v.schema.required;if(m&&!(v.opts.$data&&m.$data)&&m.length<v.opts.loopRequired)var c=v.util.toHash(m);function d(dv){return dv!=="__proto__"}if(Q+="var "+K+" = errors;var "+V+" = true;",b)Q+=" var "+Z+" = undefined;";if(g){if(b)Q+=" "+Z+" = "+Z+" || Object.keys("+$+"); for (var "+D+"=0; "+D+"<"+Z+".length; "+D+"++) { var "+M+" = "+Z+"["+D+"]; ";else Q+=" for (var "+M+" in "+$+") { ";if(j){if(Q+=" var isAdditional"+X+" = !(false ",C.length)if(C.length>8)Q+=" || validate.schema"+B+".hasOwnProperty("+M+") ";else{var s=C;if(s){var n,Vv=-1,_v=s.length-1;while(Vv<_v)n=s[Vv+=1],Q+=" || "+M+" == "+v.util.toQuotedString(n)+" "}}if(O.length){var Sv=O;if(Sv){var Yv,jv=-1,gv=Sv.length-1;while(jv<gv)Yv=Sv[jv+=1],Q+=" || "+v.usePattern(Yv)+".test("+M+") "}}Q+=" ); if (isAdditional"+X+") { "}if(R=="all")Q+=" delete "+$+"["+M+"]; ";else{var yv=v.errorPath,Vf="' + "+M+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPathExpr(v.errorPath,M,v.opts.jsonPointers);if(_)if(R)Q+=" delete "+$+"["+M+"]; ";else{Q+=" "+V+" = false; ";var Pf=z;z=v.errSchemaPath+"/additionalProperties";var Ov=Ov||[];if(Ov.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { additionalProperty: '"+Vf+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is an invalid additional property";else Q+="should NOT have additional properties";Q+="' "}if(v.opts.verbose)Q+=" , schema: false , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var Ev=Q;if(Q=Ov.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+Ev+"]); ";else Q+=" validate.errors = ["+Ev+"]; return false; ";else Q+=" var err = "+Ev+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(z=Pf,H)Q+=" break; "}else if(l)if(R=="failing"){Q+=" var "+K+" = errors; ";var _f=v.compositeRule;v.compositeRule=q.compositeRule=!0,q.schema=A,q.schemaPath=v.schemaPath+".additionalProperties",q.errSchemaPath=v.errSchemaPath+"/additionalProperties",q.errorPath=v.opts._errorDataPathProperty?v.errorPath:v.util.getPathExpr(v.errorPath,M,v.opts.jsonPointers);var Rv=$+"["+M+"]";q.dataPathArr[y]=M;var Gv=v.validate(q);if(q.baseId=k,v.util.varOccurences(Gv,F)<2)Q+=" "+v.util.varReplace(Gv,F,Rv)+" ";else Q+=" var "+F+" = "+Rv+"; "+Gv+" ";Q+=" if (!"+V+") { errors = "+K+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+$+"["+M+"]; } ",v.compositeRule=q.compositeRule=_f}else{q.schema=A,q.schemaPath=v.schemaPath+".additionalProperties",q.errSchemaPath=v.errSchemaPath+"/additionalProperties",q.errorPath=v.opts._errorDataPathProperty?v.errorPath:v.util.getPathExpr(v.errorPath,M,v.opts.jsonPointers);var Rv=$+"["+M+"]";q.dataPathArr[y]=M;var Gv=v.validate(q);if(q.baseId=k,v.util.varOccurences(Gv,F)<2)Q+=" "+v.util.varReplace(Gv,F,Rv)+" ";else Q+=" var "+F+" = "+Rv+"; "+Gv+" ";if(H)Q+=" if (!"+V+") break; "}v.errorPath=yv}if(j)Q+=" } ";if(Q+=" } ",H)Q+=" if ("+V+") { ",L+="}"}var Ef=v.opts.useDefaults&&!v.compositeRule;if(C.length){var Hf=C;if(Hf){var n,Rf=-1,kf=Hf.length-1;while(Rf<kf){n=Hf[Rf+=1];var Av=w[n];if(v.opts.strictKeywords?typeof Av=="object"&&Object.keys(Av).length>0||Av===!1:v.util.schemaHasRules(Av,v.RULES.all)){var av=v.util.getProperty(n),Rv=$+av,Zv=Ef&&Av.default!==void 0;q.schema=Av,q.schemaPath=B+av,q.errSchemaPath=z+"/"+v.util.escapeFragment(n),q.errorPath=v.util.getPath(v.errorPath,n,v.opts.jsonPointers),q.dataPathArr[y]=v.util.toQuotedString(n);var Gv=v.validate(q);if(q.baseId=k,v.util.varOccurences(Gv,F)<2){Gv=v.util.varReplace(Gv,F,Rv);var lv=Rv}else{var lv=F;Q+=" var "+F+" = "+Rv+"; "}if(Zv)Q+=" "+Gv+" ";else{if(c&&c[n]){if(Q+=" if ( "+lv+" === undefined ",b)Q+=" || ! Object.prototype.hasOwnProperty.call("+$+", '"+v.util.escapeQuotes(n)+"') ";Q+=") { "+V+" = false; ";var yv=v.errorPath,Pf=z,Jf=v.util.escapeQuotes(n);if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPath(yv,n,v.opts.jsonPointers);z=v.errSchemaPath+"/required";var Ov=Ov||[];if(Ov.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { missingProperty: '"+Jf+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+Jf+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var Ev=Q;if(Q=Ov.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+Ev+"]); ";else Q+=" validate.errors = ["+Ev+"]; return false; ";else Q+=" var err = "+Ev+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";z=Pf,v.errorPath=yv,Q+=" } else { "}else if(H){if(Q+=" if ( "+lv+" === undefined ",b)Q+=" || ! Object.prototype.hasOwnProperty.call("+$+", '"+v.util.escapeQuotes(n)+"') ";Q+=") { "+V+" = true; } else { "}else{if(Q+=" if ("+lv+" !== undefined ",b)Q+=" && Object.prototype.hasOwnProperty.call("+$+", '"+v.util.escapeQuotes(n)+"') ";Q+=" ) { "}Q+=" "+Gv+" } "}}if(H)Q+=" if ("+V+") { ",L+="}"}}}if(O.length){var uv=O;if(uv){var Yv,y1=-1,S0=uv.length-1;while(y1<S0){Yv=uv[y1+=1];var Av=T[Yv];if(v.opts.strictKeywords?typeof Av=="object"&&Object.keys(Av).length>0||Av===!1:v.util.schemaHasRules(Av,v.RULES.all)){if(q.schema=Av,q.schemaPath=v.schemaPath+".patternProperties"+v.util.getProperty(Yv),q.errSchemaPath=v.errSchemaPath+"/patternProperties/"+v.util.escapeFragment(Yv),b)Q+=" "+Z+" = "+Z+" || Object.keys("+$+"); for (var "+D+"=0; "+D+"<"+Z+".length; "+D+"++) { var "+M+" = "+Z+"["+D+"]; ";else Q+=" for (var "+M+" in "+$+") { ";Q+=" if ("+v.usePattern(Yv)+".test("+M+")) { ",q.errorPath=v.util.getPathExpr(v.errorPath,M,v.opts.jsonPointers);var Rv=$+"["+M+"]";q.dataPathArr[y]=M;var Gv=v.validate(q);if(q.baseId=k,v.util.varOccurences(Gv,F)<2)Q+=" "+v.util.varReplace(Gv,F,Rv)+" ";else Q+=" var "+F+" = "+Rv+"; "+Gv+" ";if(H)Q+=" if (!"+V+") break; ";if(Q+=" } ",H)Q+=" else "+V+" = true; ";if(Q+=" } ",H)Q+=" if ("+V+") { ",L+="}"}}}}if(H)Q+=" "+L+" if ("+K+" == errors) {";return Q}});var tW=o((l4,sW)=>{sW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="errs__"+X,q=v.util.copy(v),L="";q.level++;var V="valid"+q.level;if(Q+="var "+K+" = errors;",v.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:v.util.schemaHasRules(w,v.RULES.all)){q.schema=w,q.schemaPath=B,q.errSchemaPath=z;var M="key"+X,D="idx"+X,y="i"+X,F="' + "+M+" + '",Z=q.dataLevel=v.dataLevel+1,C="data"+Z,T="dataProperties"+X,O=v.opts.ownProperties,A=v.baseId;if(O)Q+=" var "+T+" = undefined; ";if(O)Q+=" "+T+" = "+T+" || Object.keys("+$+"); for (var "+D+"=0; "+D+"<"+T+".length; "+D+"++) { var "+M+" = "+T+"["+D+"]; ";else Q+=" for (var "+M+" in "+$+") { ";Q+=" var startErrs"+X+" = errors; ";var j=M,_=v.compositeRule;v.compositeRule=q.compositeRule=!0;var l=v.validate(q);if(q.baseId=A,v.util.varOccurences(l,C)<2)Q+=" "+v.util.varReplace(l,C,j)+" ";else Q+=" var "+C+" = "+j+"; "+l+" ";if(v.compositeRule=q.compositeRule=_,Q+=" if (!"+V+") { for (var "+y+"=startErrs"+X+"; "+y+"<errors; "+y+"++) { vErrors["+y+"].propertyName = "+M+"; } var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { propertyName: '"+F+"' } ",v.opts.messages!==!1)Q+=" , message: 'property name \\'"+F+"\\' is invalid' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(H)Q+=" break; ";Q+=" } }"}if(H)Q+=" "+L+" if ("+K+" == errors) {";return Q}});var v9=o((I4,eW)=>{eW.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="valid"+X,q=v.opts.$data&&w&&w.$data,L;if(q)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",L="schema"+X;else L=w;var V="schema"+X;if(!q)if(w.length<v.opts.loopRequired&&v.schema.properties&&Object.keys(v.schema.properties).length){var M=[],D=w;if(D){var y,F=-1,Z=D.length-1;while(F<Z){y=D[F+=1];var C=v.schema.properties[y];if(!(C&&(v.opts.strictKeywords?typeof C=="object"&&Object.keys(C).length>0||C===!1:v.util.schemaHasRules(C,v.RULES.all))))M[M.length]=y}}}else var M=w;if(q||M.length){var T=v.errorPath,O=q||M.length>=v.opts.loopRequired,A=v.opts.ownProperties;if(H)if(Q+=" var missing"+X+"; ",O){if(!q)Q+=" var "+V+" = validate.schema"+B+"; ";var j="i"+X,_="schema"+X+"["+j+"]",l="' + "+_+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPathExpr(T,_,v.opts.jsonPointers);if(Q+=" var "+K+" = true; ",q)Q+=" if (schema"+X+" === undefined) "+K+" = true; else if (!Array.isArray(schema"+X+")) "+K+" = false; else {";if(Q+=" for (var "+j+" = 0; "+j+" < "+V+".length; "+j+"++) { "+K+" = "+$+"["+V+"["+j+"]] !== undefined ",A)Q+=" && Object.prototype.hasOwnProperty.call("+$+", "+V+"["+j+"]) ";if(Q+="; if (!"+K+") break; } ",q)Q+=" } ";Q+=" if (!"+K+") { ";var R=R||[];if(R.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { missingProperty: '"+l+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+l+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var g=Q;if(Q=R.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+g+"]); ";else Q+=" validate.errors = ["+g+"]; return false; ";else Q+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } else { "}else{Q+=" if ( ";var b=M;if(b){var k,j=-1,m=b.length-1;while(j<m){if(k=b[j+=1],j)Q+=" || ";var c=v.util.getProperty(k),d=$+c;if(Q+=" ( ( "+d+" === undefined ",A)Q+=" || ! Object.prototype.hasOwnProperty.call("+$+", '"+v.util.escapeQuotes(k)+"') ";Q+=") && (missing"+X+" = "+v.util.toQuotedString(v.opts.jsonPointers?k:c)+") ) "}}Q+=") { ";var _="missing"+X,l="' + "+_+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.opts.jsonPointers?v.util.getPathExpr(T,_,!0):T+" + "+_;var R=R||[];if(R.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { missingProperty: '"+l+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+l+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";var g=Q;if(Q=R.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+g+"]); ";else Q+=" validate.errors = ["+g+"]; return false; ";else Q+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } else { "}else if(O){if(!q)Q+=" var "+V+" = validate.schema"+B+"; ";var j="i"+X,_="schema"+X+"["+j+"]",l="' + "+_+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPathExpr(T,_,v.opts.jsonPointers);if(q){if(Q+=" if ("+V+" && !Array.isArray("+V+")) { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { missingProperty: '"+l+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+l+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+V+" !== undefined) { "}if(Q+=" for (var "+j+" = 0; "+j+" < "+V+".length; "+j+"++) { if ("+$+"["+V+"["+j+"]] === undefined ",A)Q+=" || ! Object.prototype.hasOwnProperty.call("+$+", "+V+"["+j+"]) ";if(Q+=") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { missingProperty: '"+l+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+l+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",q)Q+=" } "}else{var s=M;if(s){var k,n=-1,Vv=s.length-1;while(n<Vv){k=s[n+=1];var c=v.util.getProperty(k),l=v.util.escapeQuotes(k),d=$+c;if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPath(T,k,v.opts.jsonPointers);if(Q+=" if ( "+d+" === undefined ",A)Q+=" || ! Object.prototype.hasOwnProperty.call("+$+", '"+v.util.escapeQuotes(k)+"') ";if(Q+=") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { missingProperty: '"+l+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+l+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" ";Q+=" } "}else Q+=" {} ";Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}v.errorPath=T}else if(H)Q+=" if (true) {";return Q}});var Q9=o((Z4,f9)=>{f9.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$="data"+(Y||""),K="valid"+X,q=v.opts.$data&&w&&w.$data,L;if(q)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",L="schema"+X;else L=w;if((w||q)&&v.opts.uniqueItems!==!1){if(q)Q+=" var "+K+"; if ("+L+" === false || "+L+" === undefined) "+K+" = true; else if (typeof "+L+" != 'boolean') "+K+" = false; else { ";Q+=" var i = "+$+".length , "+K+" = true , j; if (i > 1) { ";var V=v.schema.items&&v.schema.items.type,M=Array.isArray(V);if(!V||V=="object"||V=="array"||M&&(V.indexOf("object")>=0||V.indexOf("array")>=0))Q+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+$+"[i], "+$+"[j])) { "+K+" = false; break outer; } } } ";else{Q+=" var itemIndices = {}, item; for (;i--;) { var item = "+$+"[i]; ";var D="checkDataType"+(M?"s":"");if(Q+=" if ("+v.util[D](V,"item",v.opts.strictNumbers,!0)+") continue; ",M)Q+=` if (typeof item == 'string') item = '"' + item; `;Q+=" if (typeof itemIndices[item] == 'number') { "+K+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}if(Q+=" } ",q)Q+=" } ";Q+=" if (!"+K+") { ";var y=y||[];if(y.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { i: i, j: j } ",v.opts.messages!==!1)Q+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";if(v.opts.verbose){if(Q+=" , schema: ",q)Q+="validate.schema"+B;else Q+=""+w;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+$+" "}Q+=" } "}else Q+=" {} ";var F=Q;if(Q=y.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",H)Q+=" else { "}else if(H)Q+=" if (true) { ";return Q}});var J9=o((C4,W9)=>{W9.exports={$ref:$W(),allOf:NW(),anyOf:EW(),$comment:jW(),const:UW(),contains:FW(),dependencies:AW(),enum:_W(),format:kW(),if:yW(),items:IW(),maximum:$Q(),minimum:$Q(),maxItems:MQ(),minItems:MQ(),maxLength:NQ(),minLength:NQ(),maxProperties:VQ(),minProperties:VQ(),multipleOf:rW(),not:aW(),oneOf:nW(),pattern:iW(),properties:oW(),propertyNames:tW(),required:v9(),uniqueItems:Q9(),validate:zQ()}});var w9=o((T4,Y9)=>{var X9=J9(),EQ=uf().toHash;Y9.exports=function f(){var v=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],W=["type","$comment"],J=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],Q=["number","integer","string","array","object","boolean","null"];return v.all=EQ(W),v.types=EQ(Q),v.forEach(function(X){if(X.rules=X.rules.map(function(Y){var w;if(typeof Y=="object"){var B=Object.keys(Y)[0];w=Y[B],Y=B,w.forEach(function(H){W.push(H),v.all[H]=!0})}W.push(Y);var z=v.all[Y]={keyword:Y,code:X9[Y],implements:w};return z}),v.all.$comment={keyword:"$comment",code:X9.$comment},X.type)v.types[X.type]=X}),v.keywords=EQ(W.concat(J)),v.custom={},v}});var q9=o((x4,B9)=>{var G9=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];B9.exports=function(f,v){for(var W=0;W<v.length;W++){f=JSON.parse(JSON.stringify(f));var J=v[W].split("/"),Q=f,X;for(X=1;X<J.length;X++)Q=Q[J[X]];for(X=0;X<G9.length;X++){var Y=G9[X],w=Q[Y];if(w)Q[Y]={anyOf:[w,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}}}return f}});var K9=o((u4,H9)=>{var PY=K0().MissingRef;H9.exports=P9;function P9(f,v,W){var J=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof v=="function")W=v,v=void 0;var Q=X(f).then(function(){var w=J._addSchema(f,void 0,v);return w.validate||Y(w)});if(W)Q.then(function(w){W(null,w)},W);return Q;function X(w){var B=w.$schema;return B&&!J.getSchema(B)?P9.call(J,{$ref:B},!0):Promise.resolve()}function Y(w){try{return J._compile(w)}catch(z){if(z instanceof PY)return B(z);throw z}function B(z){var H=z.missingSchema;if(q(H))throw new Error("Schema "+H+" is loaded but "+z.missingRef+" cannot be resolved");var $=J._loadingSchemas[H];if(!$)$=J._loadingSchemas[H]=J._opts.loadSchema(H),$.then(K,K);return $.then(function(L){if(!q(H))return X(L).then(function(){if(!q(H))J.addSchema(L,H,void 0,v)})}).then(function(){return Y(w)});function K(){delete J._loadingSchemas[H]}function q(L){return J._refs[L]||J._schemas[L]}}}}});var L9=o((r4,z9)=>{z9.exports=function f(v,W,J){var Q=" ",X=v.level,Y=v.dataLevel,w=v.schema[W],B=v.schemaPath+v.util.getProperty(W),z=v.errSchemaPath+"/"+W,H=!v.opts.allErrors,$,K="data"+(Y||""),q="valid"+X,L="errs__"+X,V=v.opts.$data&&w&&w.$data,M;if(V)Q+=" var schema"+X+" = "+v.util.getData(w.$data,Y,v.dataPathArr)+"; ",M="schema"+X;else M=w;var D=this,y="definition"+X,F=D.definition,Z="",C,T,O,A,j;if(V&&F.$data){j="keywordValidate"+X;var _=F.validateSchema;Q+=" var "+y+" = RULES.custom['"+W+"'].definition; var "+j+" = "+y+".validate;"}else{if(A=v.useCustomRule(D,w,v.schema,v),!A)return;M="validate.schema"+B,j=A.code,C=F.compile,T=F.inline,O=F.macro}var l=j+".errors",R="i"+X,g="ruleErr"+X,b=F.async;if(b&&!v.async)throw new Error("async keyword in sync schema");if(!(T||O))Q+=""+l+" = null;";if(Q+="var "+L+" = errors;var "+q+";",V&&F.$data){if(Z+="}",Q+=" if ("+M+" === undefined) { "+q+" = true; } else { ",_)Z+="}",Q+=" "+q+" = "+y+".validateSchema("+M+"); if ("+q+") { "}if(T)if(F.statements)Q+=" "+A.validate+" ";else Q+=" "+q+" = "+A.validate+"; ";else if(O){var k=v.util.copy(v),Z="";k.level++;var m="valid"+k.level;k.schema=A.validate,k.schemaPath="";var c=v.compositeRule;v.compositeRule=k.compositeRule=!0;var d=v.validate(k).replace(/validate\.schema/g,j);v.compositeRule=k.compositeRule=c,Q+=" "+d}else{var s=s||[];if(s.push(Q),Q="",Q+=" "+j+".call( ",v.opts.passContext)Q+="this";else Q+="self";if(C||F.schema===!1)Q+=" , "+K+" ";else Q+=" , "+M+" , "+K+" , validate.schema"+v.schemaPath+" ";if(Q+=" , (dataPath || '')",v.errorPath!='""')Q+=" + "+v.errorPath;var n=Y?"data"+(Y-1||""):"parentData",Vv=Y?v.dataPathArr[Y]:"parentDataProperty";Q+=" , "+n+" , "+Vv+" , rootData ) ";var _v=Q;if(Q=s.pop(),F.errors===!1){if(Q+=" "+q+" = ",b)Q+="await ";Q+=""+_v+"; "}else if(b)l="customErrors"+X,Q+=" var "+l+" = null; try { "+q+" = await "+_v+"; } catch (e) { "+q+" = false; if (e instanceof ValidationError) "+l+" = e.errors; else throw e; } ";else Q+=" "+l+" = null; "+q+" = "+_v+"; "}if(F.modifying)Q+=" if ("+n+") "+K+" = "+n+"["+Vv+"];";if(Q+=""+Z,F.valid){if(H)Q+=" if (true) { "}else{if(Q+=" if ( ",F.valid===void 0)if(Q+=" !",O)Q+=""+m;else Q+=""+q;else Q+=" "+!F.valid+" ";Q+=") { ",$=D.keyword;var s=s||[];s.push(Q),Q="";var s=s||[];if(s.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+($||"custom")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { keyword: '"+D.keyword+"' } ",v.opts.messages!==!1)Q+=` , message: 'should pass "`+D.keyword+`" keyword validation' `;if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+K+" ";Q+=" } "}else Q+=" {} ";var Sv=Q;if(Q=s.pop(),!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(["+Sv+"]); ";else Q+=" validate.errors = ["+Sv+"]; return false; ";else Q+=" var err = "+Sv+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var Yv=Q;if(Q=s.pop(),T)if(F.errors){if(F.errors!="full"){if(Q+=" for (var "+R+"="+L+"; "+R+"<errors; "+R+"++) { var "+g+" = vErrors["+R+"]; if ("+g+".dataPath === undefined) "+g+".dataPath = (dataPath || '') + "+v.errorPath+"; if ("+g+".schemaPath === undefined) { "+g+'.schemaPath = "'+z+'"; } ',v.opts.verbose)Q+=" "+g+".schema = "+M+"; "+g+".data = "+K+"; ";Q+=" } "}}else if(F.errors===!1)Q+=" "+Yv+" ";else{if(Q+=" if ("+L+" == errors) { "+Yv+" } else { for (var "+R+"="+L+"; "+R+"<errors; "+R+"++) { var "+g+" = vErrors["+R+"]; if ("+g+".dataPath === undefined) "+g+".dataPath = (dataPath || '') + "+v.errorPath+"; if ("+g+".schemaPath === undefined) { "+g+'.schemaPath = "'+z+'"; } ',v.opts.verbose)Q+=" "+g+".schema = "+M+"; "+g+".data = "+K+"; ";Q+=" } } "}else if(O){if(Q+=" var err = ",v.createErrors!==!1){if(Q+=" { keyword: '"+($||"custom")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(z)+" , params: { keyword: '"+D.keyword+"' } ",v.opts.messages!==!1)Q+=` , message: 'should pass "`+D.keyword+`" keyword validation' `;if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+K+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&H)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; "}else if(F.errors===!1)Q+=" "+Yv+" ";else{if(Q+=" if (Array.isArray("+l+")) { if (vErrors === null) vErrors = "+l+"; else vErrors = vErrors.concat("+l+"); errors = vErrors.length; for (var "+R+"="+L+"; "+R+"<errors; "+R+"++) { var "+g+" = vErrors["+R+"]; if ("+g+".dataPath === undefined) "+g+".dataPath = (dataPath || '') + "+v.errorPath+"; "+g+'.schemaPath = "'+z+'"; ',v.opts.verbose)Q+=" "+g+".schema = "+M+"; "+g+".data = "+K+"; ";Q+=" } } else { "+Yv+" } "}if(Q+=" } ",H)Q+=" else { "}return Q}});var DQ=o((m4,HY)=>{HY.exports={$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}});var N9=o((a4,M9)=>{var $9=DQ();M9.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:$9.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:$9.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var E9=o((c4,V9)=>{var KY=/^[a-z_$][a-z0-9_$-]*$/i,zY=L9(),LY=N9();V9.exports={add:$Y,get:MY,remove:NY,validate:jQ};function $Y(f,v){var W=this.RULES;if(W.keywords[f])throw new Error("Keyword "+f+" is already defined");if(!KY.test(f))throw new Error("Keyword "+f+" is not a valid identifier");if(v){this.validateKeyword(v,!0);var J=v.type;if(Array.isArray(J))for(var Q=0;Q<J.length;Q++)Y(f,J[Q],v);else Y(f,J,v);var X=v.metaSchema;if(X){if(v.$data&&this._opts.$data)X={anyOf:[X,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]};v.validateSchema=this.compile(X,!0)}}W.keywords[f]=W.all[f]=!0;function Y(w,B,z){var H;for(var $=0;$<W.length;$++){var K=W[$];if(K.type==B){H=K;break}}if(!H)H={type:B,rules:[]},W.push(H);var q={keyword:w,definition:z,custom:!0,code:zY,implements:z.implements};H.rules.push(q),W.custom[w]=q}return this}function MY(f){var v=this.RULES.custom[f];return v?v.definition:this.RULES.keywords[f]||!1}function NY(f){var v=this.RULES;delete v.keywords[f],delete v.all[f],delete v.custom[f];for(var W=0;W<v.length;W++){var J=v[W].rules;for(var Q=0;Q<J.length;Q++)if(J[Q].keyword==f){J.splice(Q,1);break}}return this}function jQ(f,v){jQ.errors=null;var W=this._validateKeyword=this._validateKeyword||this.compile(LY,!0);if(W(f))return!0;if(jQ.errors=W.errors,v)throw new Error("custom keyword definition is invalid: "+this.errorsText(W.errors));else return!1}});var D9=o((n4,VY)=>{VY.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var R9=o((p4,_9)=>{var O9=vW(),rf=H0(),EY=QW(),U9=wQ(),DY=KQ(),jY=zW(),OY=w9(),h9=q9(),F9=uf();_9.exports=Dv;Dv.prototype.validate=hY;Dv.prototype.compile=FY;Dv.prototype.addSchema=gY;Dv.prototype.addMetaSchema=AY;Dv.prototype.validateSchema=bY;Dv.prototype.getSchema=RY;Dv.prototype.removeSchema=SY;Dv.prototype.addFormat=uY;Dv.prototype.errorsText=xY;Dv.prototype._addSchema=yY;Dv.prototype._compile=lY;Dv.prototype.compileAsync=K9();var D0=E9();Dv.prototype.addKeyword=D0.add;Dv.prototype.getKeyword=D0.get;Dv.prototype.removeKeyword=D0.remove;Dv.prototype.validateKeyword=D0.validate;var g9=K0();Dv.ValidationError=g9.Validation;Dv.MissingRefError=g9.MissingRef;Dv.$dataMetaSchema=h9;var E0="http://json-schema.org/draft-07/schema",j9=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],UY=["/properties"];function Dv(f){if(!(this instanceof Dv))return new Dv(f);if(f=this._opts=F9.copy(f)||{},pY(this),this._schemas={},this._refs={},this._fragments={},this._formats=jY(f.format),this._cache=f.cache||new EY,this._loadingSchemas={},this._compilations=[],this.RULES=OY(),this._getId=IY(f),f.loopRequired=f.loopRequired||1/0,f.errorDataPath=="property")f._errorDataPathProperty=!0;if(f.serialize===void 0)f.serialize=DY;if(this._metaOpts=nY(this),f.formats)aY(this);if(f.keywords)cY(this);if(rY(this),typeof f.meta=="object")this.addMetaSchema(f.meta);if(f.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});mY(this)}function hY(f,v){var W;if(typeof f=="string"){if(W=this.getSchema(f),!W)throw new Error('no schema with key or ref "'+f+'"')}else{var J=this._addSchema(f);W=J.validate||this._compile(J)}var Q=W(v);if(W.$async!==!0)this.errors=W.errors;return Q}function FY(f,v){var W=this._addSchema(f,void 0,v);return W.validate||this._compile(W)}function gY(f,v,W,J){if(Array.isArray(f)){for(var Q=0;Q<f.length;Q++)this.addSchema(f[Q],void 0,W,J);return this}var X=this._getId(f);if(X!==void 0&&typeof X!="string")throw new Error("schema id must be string");return v=rf.normalizeId(v||X),b9(this,v),this._schemas[v]=this._addSchema(f,W,J,!0),this}function AY(f,v,W){return this.addSchema(f,v,W,!0),this}function bY(f,v){var W=f.$schema;if(W!==void 0&&typeof W!="string")throw new Error("$schema must be a string");if(W=W||this._opts.defaultMeta||_Y(this),!W)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var J=this.validate(W,f);if(!J&&v){var Q="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(Q);else throw new Error(Q)}return J}function _Y(f){var v=f._opts.meta;return f._opts.defaultMeta=typeof v=="object"?f._getId(v)||v:f.getSchema(E0)?E0:void 0,f._opts.defaultMeta}function RY(f){var v=A9(this,f);switch(typeof v){case"object":return v.validate||this._compile(v);case"string":return this.getSchema(v);case"undefined":return kY(this,f)}}function kY(f,v){var W=rf.schema.call(f,{schema:{}},v);if(W){var{schema:J,root:Q,baseId:X}=W,Y=O9.call(f,J,Q,void 0,X);return f._fragments[v]=new U9({ref:v,fragment:!0,schema:J,root:Q,baseId:X,validate:Y}),Y}}function A9(f,v){return v=rf.normalizeId(v),f._schemas[v]||f._refs[v]||f._fragments[v]}function SY(f){if(f instanceof RegExp)return V0(this,this._schemas,f),V0(this,this._refs,f),this;switch(typeof f){case"undefined":return V0(this,this._schemas),V0(this,this._refs),this._cache.clear(),this;case"string":var v=A9(this,f);if(v)this._cache.del(v.cacheKey);return delete this._schemas[f],delete this._refs[f],this;case"object":var W=this._opts.serialize,J=W?W(f):f;this._cache.del(J);var Q=this._getId(f);if(Q)Q=rf.normalizeId(Q),delete this._schemas[Q],delete this._refs[Q]}return this}function V0(f,v,W){for(var J in v){var Q=v[J];if(!Q.meta&&(!W||W.test(J)))f._cache.del(Q.cacheKey),delete v[J]}}function yY(f,v,W,J){if(typeof f!="object"&&typeof f!="boolean")throw new Error("schema should be object or boolean");var Q=this._opts.serialize,X=Q?Q(f):f,Y=this._cache.get(X);if(Y)return Y;J=J||this._opts.addUsedSchema!==!1;var w=rf.normalizeId(this._getId(f));if(w&&J)b9(this,w);var B=this._opts.validateSchema!==!1&&!v,z;if(B&&!(z=w&&w==rf.normalizeId(f.$schema)))this.validateSchema(f,!0);var H=rf.ids.call(this,f),$=new U9({id:w,schema:f,localRefs:H,cacheKey:X,meta:W});if(w[0]!="#"&&J)this._refs[w]=$;if(this._cache.put(X,$),B&&z)this.validateSchema(f,!0);return $}function lY(f,v){if(f.compiling){if(f.validate=Q,Q.schema=f.schema,Q.errors=null,Q.root=v?v:Q,f.schema.$async===!0)Q.$async=!0;return Q}f.compiling=!0;var W;if(f.meta)W=this._opts,this._opts=this._metaOpts;var J;try{J=O9.call(this,f.schema,v,f.localRefs)}catch(X){throw delete f.validate,X}finally{if(f.compiling=!1,f.meta)this._opts=W}return f.validate=J,f.refs=J.refs,f.refVal=J.refVal,f.root=J.root,J;function Q(){var X=f.validate,Y=X.apply(this,arguments);return Q.errors=X.errors,Y}}function IY(f){switch(f.schemaId){case"auto":return TY;case"id":return ZY;default:return CY}}function ZY(f){if(f.$id)this.logger.warn("schema $id ignored",f.$id);return f.id}function CY(f){if(f.id)this.logger.warn("schema id ignored",f.id);return f.$id}function TY(f){if(f.$id&&f.id&&f.$id!=f.id)throw new Error("schema $id is different from id");return f.$id||f.id}function xY(f,v){if(f=f||this.errors,!f)return"No errors";v=v||{};var W=v.separator===void 0?", ":v.separator,J=v.dataVar===void 0?"data":v.dataVar,Q="";for(var X=0;X<f.length;X++){var Y=f[X];if(Y)Q+=J+Y.dataPath+" "+Y.message+W}return Q.slice(0,-W.length)}function uY(f,v){if(typeof v=="string")v=new RegExp(v);return this._formats[f]=v,this}function rY(f){var v;if(f._opts.$data)v=D9(),f.addMetaSchema(v,v.$id,!0);if(f._opts.meta===!1)return;var W=DQ();if(f._opts.$data)W=h9(W,UY);f.addMetaSchema(W,E0,!0),f._refs["http://json-schema.org/schema"]=E0}function mY(f){var v=f._opts.schemas;if(!v)return;if(Array.isArray(v))f.addSchema(v);else for(var W in v)f.addSchema(v[W],W)}function aY(f){for(var v in f._opts.formats){var W=f._opts.formats[v];f.addFormat(v,W)}}function cY(f){for(var v in f._opts.keywords){var W=f._opts.keywords[v];f.addKeyword(v,W)}}function b9(f,v){if(f._schemas[v]||f._refs[v])throw new Error('schema with key or id "'+v+'" already exists')}function nY(f){var v=F9.copy(f._opts);for(var W=0;W<j9.length;W++)delete v[j9[W]];return v}function pY(f){var v=f._opts.logger;if(v===!1)f.logger={log:OQ,warn:OQ,error:OQ};else{if(v===void 0)v=console;if(!(typeof v=="object"&&v.log&&v.warn&&v.error))throw new Error("logger must implement log, warn and error methods");f.logger=v}}function OQ(){}});var q7=(f)=>{let{idPattern:v,entityName:W}=f,J=(B)=>{return v.test(B)};return Object.freeze({isId:J,validateId:(B)=>{return J(B)},resolve:(B)=>{if(J(B))return{kind:"id",value:B};return{kind:"path",value:B}},getPattern:()=>{return v},getEntityName:()=>{return W}})},P7,yQ;var $J=Df(()=>{P7=Object.freeze({create:q7}),yQ=P7});var b0,_0,lQ=(f)=>{if(b0.isId(f))return"project";if(_0.isId(f))return"shared";return},H7=(f)=>{return b0.isId(f)||_0.isId(f)},MJ=(f)=>{return f==="project"?b0:_0},K7=(f,v)=>{return MJ(v).validateId(f)},z7,xv;var H1=Df(()=>{$J();b0=yQ.create({idPattern:/^doc\d{3,}$/,entityName:"project-doc"}),_0=yQ.create({idPattern:/^sdoc\d{3,}$/,entityName:"shared-doc"}),z7=Object.freeze({project:b0,shared:_0,detectScopeFromId:lQ,isdocId:H7,getResolverForScope:MJ,validateIdForScope:K7}),xv=z7});import{resolve as UJ,relative as FJ,normalize as h7,isAbsolute as gJ}from"path";import{realpath as hJ,lstat as F7}from"fs/promises";var Wf=(f,v,W)=>{let J=new Error(v);return J.name=f,J.code=f,J.details=W,J},AJ=(f)=>{if(!f)throw Wf("VALIDATION_ERROR","Empty path");if(gJ(f))throw Wf("VALIDATION_ERROR","Absolute path not allowed",{path:f});let v=h7(f).replaceAll("\\","/");if(v.split("/").some((J)=>J===".."))throw Wf("BOUNDARY_VIOLATION","Path contains ..",{path:f});return v},IQ=(f,v)=>{let W=FJ(f,v);return W!==""&&!W.startsWith("..")&&!gJ(W)},g7=async(f,v,W)=>{let J=AJ(v),Q=UJ(f),X=UJ(Q,J);if(W?.followSymlinks)try{X=await hJ(X)}catch(w){if(w.code!=="ENOENT")throw w}else try{if((await F7(X)).isSymbolicLink()){let B=await hJ(X);if(!IQ(Q,B))throw Wf("BOUNDARY_VIOLATION",`Symlink target escapes boundary: '${v}' \u2192 '${B}'`,{path:v,resolved:X,target:B})}}catch(w){if(w.code!=="ENOENT"&&w.code!=="BOUNDARY_VIOLATION")throw w;if(w.code==="BOUNDARY_VIOLATION")throw w}if(!IQ(Q,X)&&X!==Q)throw Wf("BOUNDARY_VIOLATION",`Path escapes boundary: '${v}' \u2192 '${X}'`,{path:v,resolved:X,boundary:Q});let Y=FJ(Q,X).replaceAll("\\","/");return{abs:X,rel:Y}},A7=(f,v)=>{let W=f.code,J=v?.path?v.resolved?`'${v.path}' \u2192 '${v.resolved}'`:`'${v.path}'`:"";switch(W){case"ENOENT":return Wf("NOT_FOUND",`File or directory not found${J?`: ${J}`:""}`,{...v,originalCode:W});case"ENOTEMPTY":return Wf("DIRECTORY_NOT_EMPTY",`Directory not empty${J?`: ${J}`:""}`,{...v,originalCode:W});case"ENOTDIR":case"EISDIR":return Wf("VALIDATION_ERROR",`Invalid path type${J?`: ${J}`:""}`,{...v,originalCode:W,reason:W==="ENOTDIR"?"not a directory":"is a directory"});case"EACCES":case"EPERM":return Wf("FS_ERROR",`Permission denied${J?`: ${J}`:""}`,{...v,originalCode:W});case"EBUSY":return Wf("FS_ERROR",`Resource busy or locked${J?`: ${J}`:""}`,{...v,originalCode:W});default:if(v)f.context=v;return f}},b7,Wv;var ZQ=Df(()=>{b7=Object.freeze({fsError:Wf,validateRelative:AJ,insideBoundary:IQ,resolveWithinBoundary:g7,mapOsError:A7}),Wv=b7});import{readFile as _7,writeFile as R7,unlink as bJ,stat as CQ,rename as k7,access as S7,mkdir as y7}from"fs/promises";import{constants as l7}from"fs";import{resolve as I7,dirname as TQ,isAbsolute as Z7}from"path";var C7=(f)=>{let{boundaryDir:v}=f;if(!v)throw Wv.fsError("VALIDATION_ERROR","boundaryDir is required (empty string)",{boundaryDir:v});if(!Z7(v))throw Wv.fsError("VALIDATION_ERROR",`boundaryDir must be an absolute path: '${v}'`,{boundaryDir:v});let W=I7(v),J=async(K)=>{let{abs:q}=await Wv.resolveWithinBoundary(W,K);return q},Q=async(K)=>{let q=await J(K);try{return await S7(q,l7.F_OK),!0}catch{return!1}},X=async(K)=>{let q=await J(K);try{return await CQ(q)}catch(L){throw Wv.mapOsError(L,{path:K,resolved:q,operation:"stat"})}},Y=async(K)=>{let q=await J(K),L;try{L=await CQ(q)}catch(V){throw Wv.mapOsError(V,{path:K,resolved:q,operation:"stat"})}if(!L.isFile())throw Wv.fsError("VALIDATION_ERROR","Target is not a regular file",{path:K,resolved:q});try{return await _7(q,"utf-8")}catch(V){throw Wv.mapOsError(V,{path:K,resolved:q,operation:"readFile"})}},w=async(K,q)=>{let L=await J(K),V;try{V=await CQ(L)}catch(D){if(D.code==="ENOENT")V=null;else throw Wv.mapOsError(D,{path:K,resolved:L,operation:"stat"})}if(V&&!V.isFile())throw Wv.fsError("VALIDATION_ERROR","Target path exists and is not a regular file",{path:K,resolved:L});try{await y7(TQ(L),{recursive:!0})}catch(D){throw Wv.mapOsError(D,{path:TQ(K),resolved:TQ(L),operation:"mkdir"})}let M=`${L}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{await R7(M,q,{encoding:"utf-8",mode:384}),await k7(M,L)}catch(D){try{await bJ(M)}catch{}throw Wv.mapOsError(D,{path:K,resolved:L,operation:"writeText"})}},B=async(K)=>{let q=await J(K);try{return await bJ(q),{deleted:!0}}catch(L){if(L.code==="ENOENT")return{deleted:!1};throw Wv.mapOsError(L,{path:K,resolved:q,operation:"delete"})}},z=(K,q,L)=>{for(let D=0;D<q.length;D++){let{oldText:y}=q[D];if(y.length===0)throw Wv.fsError("VALIDATION_ERROR",`Empty oldText in replacement at index ${D} would cause infinite loop`,{index:D})}let V=K,M=0;for(let{oldText:D,newText:y}of q)if(V.includes(D))V=V.replace(D,y),M++;if(L?.requireAll&&M!==q.length)throw Wv.fsError("VALIDATION_ERROR",`Only ${M} of ${q.length} replacements were applied (requireAll=true)`,{applied:M,total:q.length});return{wouldContent:V,applied:M}};return Object.freeze({exists:Q,stat:X,readText:Y,resolveSafe:async(K)=>{return Wv.resolveWithinBoundary(W,K)},writeText:w,delete:B,previewReplaceFirst:z,applyReplaceFirst:async(K,q,L)=>{let V=await Y(K),{wouldContent:M,applied:D}=z(V,q,L);if(D===0)return{applied:0};return await w(K,M),{applied:D}}})},T7,xQ;var _J=Df(()=>{ZQ();T7=Object.freeze({create:C7}),xQ=T7});import{mkdir as x7,rm as u7,rmdir as r7,stat as RJ,readdir as m7}from"fs/promises";import{resolve as kJ,dirname as a7,isAbsolute as SJ}from"path";var c7=(f)=>{let{boundaryDir:v}=f;if(!v)throw Wv.fsError("VALIDATION_ERROR","boundaryDir is required (empty string)",{boundaryDir:v});if(!SJ(v))throw Wv.fsError("VALIDATION_ERROR",`boundaryDir must be an absolute path: '${v}'`,{boundaryDir:v});let W=kJ(v),J=(H)=>{let $=H.toLowerCase().replace(/[^a-z0-9-_]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");if(!$)throw Wv.fsError("VALIDATION_ERROR",`normalizeName produced empty result from input: '${H}'`,{name:H,normalized:$});return $},Q=async(H,$)=>{return await Wv.resolveWithinBoundary(W,H,$)};return Object.freeze({normalizeName:J,resolve:Q,isInsideBoundary:(H)=>{if(!SJ(H))throw Wv.fsError("VALIDATION_ERROR",`targetAbs must be an absolute path: '${H}'`,{targetAbs:H});let $=kJ(H);return Wv.insideBoundary(W,$)},ensureDir:async(H)=>{let{abs:$}=await Q(H);try{await x7($,{recursive:!0})}catch(K){throw Wv.mapOsError(K,{path:H,resolved:$,operation:"ensureDir"})}},parentDir:(H)=>{let $=Wv.validateRelative(H),K=a7($);return K==="."?K:K.replaceAll("\\","/")},stat:async(H)=>{let{abs:$}=await Q(H);try{return await RJ($)}catch(K){throw Wv.mapOsError(K,{path:H,resolved:$,operation:"stat"})}},deleteDir:async(H,$)=>{if($?.requireEmpty&&$?.recursive)throw Wv.fsError("VALIDATION_ERROR","requireEmpty and recursive are mutually exclusive",{path:H});let{abs:K}=await Q(H);if(K===W)throw Wv.fsError("VALIDATION_ERROR",`Cannot delete boundary root: '${H}' \u2192 '${K}'`,{path:H,resolved:K,boundary:W});let q;try{q=await RJ(K)}catch(L){if(L.code==="ENOENT")return{deleted:!1,reason:"NOT_FOUND"};throw Wv.mapOsError(L,{path:H,resolved:K,operation:"stat"})}if(!q.isDirectory())return{deleted:!1,reason:"NOT_DIR"};if($?.requireEmpty){let L;try{L=await m7(K)}catch(V){throw Wv.mapOsError(V,{path:H,resolved:K,operation:"readdir"})}if(L.length>0)throw Wv.fsError("DIRECTORY_NOT_EMPTY",`Directory not empty: '${H}' \u2192 '${K}'`,{path:H,resolved:K});try{return await r7(K),{deleted:!0}}catch(V){if(V.code==="ENOENT")return{deleted:!1,reason:"NOT_FOUND"};if(V.code==="ENOTEMPTY")throw Wv.fsError("DIRECTORY_NOT_EMPTY",`Directory not empty (race condition): '${H}' \u2192 '${K}'`,{path:H,resolved:K});throw Wv.mapOsError(V,{path:H,resolved:K,operation:"rmdir"})}}try{return await u7(K,{recursive:$?.recursive??!1}),{deleted:!0}}catch(L){if(L.code==="ENOENT")return{deleted:!1,reason:"NOT_FOUND"};if(L.code==="ENOTEMPTY"||L.code==="EISDIR"||L.code==="EACCES")throw Wv.fsError("DIRECTORY_NOT_EMPTY",`Directory not empty: '${H}' \u2192 '${K}'`,{path:H,resolved:K,originalCode:L.code});throw Wv.mapOsError(L,{path:H,resolved:K,operation:"deleteDir"})}}})},n7,uQ;var yJ=Df(()=>{ZQ();n7=Object.freeze({create:c7}),uQ=n7});import{dirname as p7}from"path";var lJ="---",Fv=(f,v,W)=>{let J=new Error(v);if(J.code=f,W!==void 0)J.data=W;throw J},i7=(f)=>{let{fileServiceByScope:v,folderServiceByScope:W,indexFilename:J}=f,Q=(O)=>{if(O==="project")return v.project;if(O==="shared")return v.shared;return Fv("INVALID_SCOPE",`Unknown scope '${O}'`,{scope:O})},X=(O)=>{if(O==="project")return W.project;if(O==="shared")return W.shared;return Fv("INVALID_SCOPE",`Unknown scope '${O}'`,{scope:O})},Y=async(O)=>{if(O.scope)return{scope:O.scope};if(O.kind==="id"){let j=lQ(O.id);if(!j)Fv("INVALID_ID_FORMAT",`Invalid doc ID format: '${O.id}'. Expected docNNN or sdocNNN`,{id:O.id});return{scope:j}}if(O.kind==="path"){try{let j=await B("project");if(Object.entries(j.index).find(([l,R])=>R===O.path))return{scope:"project"}}catch{}try{let j=await B("shared");if(Object.entries(j.index).find(([l,R])=>R===O.path))return{scope:"shared",fallback:!0}}catch{}return{scope:"project"}}let A=O;return Fv("VALIDATION_ERROR",`Unknown address kind: ${JSON.stringify(A)}`)},w=(O)=>{return J},B=async(O)=>{let A=w(O),j=Q(O);try{let _=await j.readText(A);return JSON.parse(_)}catch(_){if(_.code==="NOT_FOUND")return{};throw _}},z=async(O,A)=>{let j=w(O),_=Q(O),l=JSON.stringify(A,null,2);await _.writeText(j,l)},H=(O)=>{let A=O.split(`
|
|
3
|
-
`);if(
|
|
4
|
-
`),
|
|
5
|
-
`).trim(),g=(k)=>{if(k.startsWith('"')&&k.endsWith('"')||k.startsWith("'")&&k.endsWith("'"))return k.slice(1,-1);return k},b={};for(let k of _){let m=k.indexOf(":");if(m===-1)continue;let c=k.slice(0,m).trim(),d=k.slice(m+1).trim();b[c]=g(d)}return{rawFrontMatter:l,frontMatter:Object.keys(b).length>0?b:void 0,bodyContent:R}},$=(O,A)=>{switch(A.op){case"replaceOnce":{let{oldText:j,newText:_}=A;if(!O.includes(j))return{newContent:O,applied:!1};return{newContent:O.replace(j,_),applied:!0}}case"replaceAll":{let{oldText:j,newText:_}=A;if(!O.includes(j))return{newContent:O,applied:!1};let l=new RegExp(j.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");return{newContent:O.replace(l,_),applied:!0}}case"replaceRegex":{let{pattern:j,flags:_,replacement:l}=A,R=new RegExp(j,_);if(!R.test(O))return{newContent:O,applied:!1};return{newContent:O.replace(R,l),applied:!0}}case"replaceAllContent":{let{content:j}=A;return{newContent:j,applied:!0}}default:{let j=A;return Fv("VALIDATION_ERROR",`Unknown edit operation: ${JSON.stringify(j)}`)}}},K=(O)=>{return xv.isdocId(O)},q=(O)=>{if(!O||O.trim().length===0)return{valid:!1,reason:"Path cannot be empty"};if(O.startsWith("/"))return{valid:!1,reason:"Path must be relative (no leading slash)"};if(O.includes(".."))return{valid:!1,reason:'Path cannot contain ".." segments'};let j=O.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");if(/[<>:"|?*\0]/.test(j))return{valid:!1,reason:"Path contains invalid characters"};return{valid:!0,normalized:j}},L=(O)=>{let{scope:A,path:j}=O;if(A!=="project"&&A!=="shared")Fv("INVALID_SCOPE",`Scope must be 'project' or 'shared', got '${A}'`,{scope:A});let _=q(j);if(!_.valid)Fv("INVALID_PATH_FORMAT",_.reason,{path:j});return{scope:A,path:_.normalized}},V=async(O)=>{let{scope:A}=await Y(O),j=X(A),_;if(O.kind==="path")_=L({...O,scope:A}).path;else{let{id:R}=O;if(!K(R))Fv("INVALID_ID_FORMAT",`ID must match pattern doc\\d{3,} or sdoc\\d{3,}, got '${R}'`,{id:R});let g=await B(A);if(!g[R])Fv("doc_NOT_FOUND",`No doc with ID '${R}' in scope '${A}'`,{id:R,scope:A});_=g[R]}return{...await j.resolve(_),scope:A}},M=async(O)=>{if(O!=="project"&&O!=="shared")Fv("INVALID_SCOPE",`Scope must be 'project' or 'shared', got '${O}'`,{scope:O});let A=await B(O),j=O==="project"?"doc":"sdoc",_=new RegExp(`^${j}(\\d{3,})$`),l=0;for(let b of Object.keys(A)){let k=b.match(_);if(k){let m=parseInt(k[1],10);if(m>l)l=m}}let R=l+1;return`${j}${R.toString().padStart(3,"0")}`},D=async(O)=>{let{address:A,content:j}=O;if(A.kind!=="path")Fv("VALIDATION_ERROR","Create requires path-based addressing");let _=A.scope??"project",l=L({...A,scope:_}),{path:R}=l;if(xv.isdocId(R))Fv("INVALID_PATH_FORMAT",`Cannot create doc with path '${R}' - matches ID pattern`,{path:R,scope:_});let g=Q(_),b=X(_),k=await M(_);if(await g.exists(R))Fv("doc_ALREADY_EXISTS",`doc already exists at path '${R}'`,{path:R,scope:_});let c=p7(R);if(c!==".")await b.ensureDir(c);await g.writeText(R,j);let d=await B(_);return d[k]=R,await z(_,d),{id:k,path:R}},y=async(O)=>{let{rel:A,scope:j}=await V(O),l=await Q(j).readText(A),{frontMatter:R,bodyContent:g,rawFrontMatter:b}=H(l),k,m;if(O.kind==="path"){k=L({...O,scope:j}).path;let d=await B(j),s=Object.keys(d).find((n)=>d[n]===k);if(!s)return Fv("doc_NOT_FOUND",`doc exists but not in index: '${k}'`,{path:k,scope:j});m=s}else if(O.kind==="id"){m=O.id;let d=(await B(j))[m];if(!d)return Fv("doc_NOT_FOUND",`No doc with ID '${m}'`,{id:m,scope:j});k=d}else{let c=O;return Fv("VALIDATION_ERROR",`Unknown address kind: ${JSON.stringify(c)}`)}return{address:O,content:l,frontMatter:R,bodyContent:g,path:k,id:m}},F=async(O,A)=>{let{rel:j,scope:_}=await V(O),l=Q(_),g=await l.readText(j),b=0;for(let k of A){let{newContent:m,applied:c}=$(g,k);if(g=m,c)b++}if(b===0)return{applied:0};return await l.writeText(j,g),{applied:b}},Z=async(O)=>{let{rel:A,scope:j}=await V(O),_=await(async()=>{if(O.kind==="id")return O.id;else if(O.kind==="path"){let k=L({...O,scope:j}),m=await B(j),c=Object.keys(m).find((d)=>m[d]===k.path);if(!c)return Fv("doc_NOT_FOUND",`doc not in index: '${k.path}'`,{path:k.path,scope:j});return c}else{let b=O;return Fv("VALIDATION_ERROR",`Unknown address kind: ${JSON.stringify(b)}`)}})(),l=Q(j),R=!1;try{R=(await l.delete(A)).deleted}catch(b){if(b.code==="NOT_FOUND")R=!1;else throw b}let g=await B(j);if(g[_])delete g[_],await z(j,g);return{deleted:R}},C=async(O)=>{let{scope:A,pathPrefix:j,includeContent:_=!1}=O;if(A){if(A!=="project"&&A!=="shared")Fv("INVALID_SCOPE",`Scope must be 'project' or 'shared', got '${A}'`,{scope:A});return await T(A,j,_)}let l=await T("project",j,_),R=await T("shared",j,_),g=new Set(l.map((m)=>m.path)),b=new Set(R.map((m)=>m.path));for(let m of l)if(b.has(m.path))m.override="overrides";for(let m of R)if(g.has(m.path))m.override="overridden";let k=[...l,...R];return k.sort((m,c)=>m.path.localeCompare(c.path)),k},T=async(O,A,j=!1)=>{let _=Q(O),l;try{l=await B(O)}catch(g){if(g.code==="NOT_FOUND"||g.code==="ENOENT")return[];throw g}let R=[];for(let[g,b]of Object.entries(l)){if(A&&!b.startsWith(A))continue;try{if(j){let k=await _.readText(b),m=await _.stat(b),{frontMatter:c}=H(k);R.push({scope:O,id:g,path:b,synopsis:c?.synopsis,modifiedAt:m.mtime})}else{let k=await _.stat(b);R.push({scope:O,id:g,path:b,modifiedAt:k.mtime})}}catch{continue}}return R.sort((g,b)=>g.path.localeCompare(b.path)),R};return Object.freeze({create:D,read:y,editLatest:F,deleteLatest:Z,list:C})},d7,IJ;var ZJ=Df(()=>{H1();d7=Object.freeze({create:i7}),IJ=d7});import{resolve as R0,dirname as o7}from"path";import{homedir as s7}from"os";import{existsSync as t7}from"fs";var e7=(f=process.cwd())=>{let v=R0(f),W=R0("/"),J=R0(s7(),".swic");while(v!==W){let Q=R0(v,".swic");if(Q===J)throw new Error("Not in a project directory (found ~/.swic instead). Run swic from within a project.");if(t7(Q))return Q;v=o7(v)}throw new Error("Could not find .swic directory. Are you in a SWIC project?")},CJ;var TJ=Df(()=>{CJ=Object.freeze({findProjectRoot:e7})});var rJ={};v8(rJ,{default:()=>Y2});import{mkdirSync as xJ}from"fs";import{resolve as uJ}from"path";import{homedir as v2}from"os";var k0="docs",f2=".index.json",Q2=(f,v)=>{try{xJ(f,{recursive:!0}),xJ(v,{recursive:!0})}catch(W){let J=W instanceof Error?W.message:String(W);throw new Error(`Failed to create swic directories. Please check permissions.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Error: ${J}`)}},W2=()=>{let f;try{f=CJ.findProjectRoot()}catch{f=uJ(process.cwd(),".swic")}let v=uJ(v2(),".swic"),W=`${f}/${k0}`,J=`${v}/${k0}`;return Q2(W,J),{projectDataDir:f,sharedDataDir:v}},J2=(f)=>{let{projectBoundaryDir:v,sharedBoundaryDir:W}=f,J=`${v}/${k0}`,Q=`${W}/${k0}`,X=xQ.create({boundaryDir:J}),Y=xQ.create({boundaryDir:Q}),w=uQ.create({boundaryDir:J}),B=uQ.create({boundaryDir:Q}),z=IJ.create({fileServiceByScope:{project:X,shared:Y},folderServiceByScope:{project:w,shared:B},indexFilename:f2});return Object.freeze({DocService:z})},X2,Y2;var mJ=Df(()=>{_J();yJ();ZJ();TJ();X2=Object.freeze({createServices:J2,lazilyGetDataDirs:W2}),Y2=X2});var G={};v8(G,{void:()=>e6,util:()=>fv,unknown:()=>s6,union:()=>W5,undefined:()=>i6,tuple:()=>Y5,transformer:()=>$5,symbol:()=>p6,string:()=>B8,strictObject:()=>Q5,setErrorMap:()=>N6,set:()=>B5,record:()=>w5,quotelessJson:()=>$6,promise:()=>L5,preprocess:()=>V5,pipeline:()=>E5,ostring:()=>D5,optional:()=>M5,onumber:()=>j5,oboolean:()=>O5,objectUtil:()=>C0,object:()=>f5,number:()=>q8,nullable:()=>N5,null:()=>d6,never:()=>t6,nativeEnum:()=>z5,nan:()=>a6,map:()=>G5,makeIssue:()=>E1,literal:()=>H5,lazy:()=>P5,late:()=>r6,isValid:()=>jf,isDirty:()=>T1,isAsync:()=>tf,isAborted:()=>C1,intersection:()=>X5,instanceof:()=>m6,getParsedType:()=>wf,getErrorMap:()=>sf,function:()=>q5,enum:()=>K5,effect:()=>$5,discriminatedUnion:()=>J5,defaultErrorMap:()=>$f,datetimeRegex:()=>Y8,date:()=>n6,custom:()=>G8,coerce:()=>U5,boolean:()=>P8,bigint:()=>c6,array:()=>v5,any:()=>o6,addIssueToContext:()=>u,ZodVoid:()=>j1,ZodUnknown:()=>Of,ZodUnion:()=>J1,ZodUndefined:()=>Q1,ZodType:()=>vv,ZodTuple:()=>Bf,ZodTransformer:()=>vf,ZodSymbol:()=>D1,ZodString:()=>ov,ZodSet:()=>Tf,ZodSchema:()=>vv,ZodRecord:()=>O1,ZodReadonly:()=>P1,ZodPromise:()=>xf,ZodPipeline:()=>F1,ZodParsedType:()=>x,ZodOptional:()=>tv,ZodObject:()=>Nv,ZodNumber:()=>Uf,ZodNullable:()=>Nf,ZodNull:()=>W1,ZodNever:()=>Gf,ZodNativeEnum:()=>G1,ZodNaN:()=>h1,ZodMap:()=>U1,ZodLiteral:()=>w1,ZodLazy:()=>Y1,ZodIssueCode:()=>S,ZodIntersection:()=>X1,ZodFunction:()=>v1,ZodFirstPartyTypeKind:()=>I,ZodError:()=>Cv,ZodEnum:()=>Ff,ZodEffects:()=>vf,ZodDiscriminatedUnion:()=>x1,ZodDefault:()=>B1,ZodDate:()=>Zf,ZodCatch:()=>q1,ZodBranded:()=>u1,ZodBoolean:()=>f1,ZodBigInt:()=>hf,ZodArray:()=>sv,ZodAny:()=>Cf,Schema:()=>vv,ParseStatus:()=>bv,OK:()=>kv,NEVER:()=>h5,INVALID:()=>p,EMPTY_PATH:()=>V6,DIRTY:()=>If,BRAND:()=>u6});var fv;(function(f){f.assertEqual=(Q)=>{};function v(Q){}f.assertIs=v;function W(Q){throw new Error}f.assertNever=W,f.arrayToEnum=(Q)=>{let X={};for(let Y of Q)X[Y]=Y;return X},f.getValidEnumValues=(Q)=>{let X=f.objectKeys(Q).filter((w)=>typeof Q[Q[w]]!=="number"),Y={};for(let w of X)Y[w]=Q[w];return f.objectValues(Y)},f.objectValues=(Q)=>{return f.objectKeys(Q).map(function(X){return Q[X]})},f.objectKeys=typeof Object.keys==="function"?(Q)=>Object.keys(Q):(Q)=>{let X=[];for(let Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))X.push(Y);return X},f.find=(Q,X)=>{for(let Y of Q)if(X(Y))return Y;return},f.isInteger=typeof Number.isInteger==="function"?(Q)=>Number.isInteger(Q):(Q)=>typeof Q==="number"&&Number.isFinite(Q)&&Math.floor(Q)===Q;function J(Q,X=" | "){return Q.map((Y)=>typeof Y==="string"?`'${Y}'`:Y).join(X)}f.joinValues=J,f.jsonStringifyReplacer=(Q,X)=>{if(typeof X==="bigint")return X.toString();return X}})(fv||(fv={}));var C0;(function(f){f.mergeShapes=(v,W)=>{return{...v,...W}}})(C0||(C0={}));var x=fv.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wf=(f)=>{switch(typeof f){case"undefined":return x.undefined;case"string":return x.string;case"number":return Number.isNaN(f)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":if(Array.isArray(f))return x.array;if(f===null)return x.null;if(f.then&&typeof f.then==="function"&&f.catch&&typeof f.catch==="function")return x.promise;if(typeof Map!=="undefined"&&f instanceof Map)return x.map;if(typeof Set!=="undefined"&&f instanceof Set)return x.set;if(typeof Date!=="undefined"&&f instanceof Date)return x.date;return x.object;default:return x.unknown}};var S=fv.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),$6=(f)=>{return JSON.stringify(f,null,2).replace(/"([^"]+)":/g,"$1:")};class Cv extends Error{get errors(){return this.issues}constructor(f){super();this.issues=[],this.addIssue=(W)=>{this.issues=[...this.issues,W]},this.addIssues=(W=[])=>{this.issues=[...this.issues,...W]};let v=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,v);else this.__proto__=v;this.name="ZodError",this.issues=f}format(f){let v=f||function(Q){return Q.message},W={_errors:[]},J=(Q)=>{for(let X of Q.issues)if(X.code==="invalid_union")X.unionErrors.map(J);else if(X.code==="invalid_return_type")J(X.returnTypeError);else if(X.code==="invalid_arguments")J(X.argumentsError);else if(X.path.length===0)W._errors.push(v(X));else{let Y=W,w=0;while(w<X.path.length){let B=X.path[w];if(w!==X.path.length-1)Y[B]=Y[B]||{_errors:[]};else Y[B]=Y[B]||{_errors:[]},Y[B]._errors.push(v(X));Y=Y[B],w++}}};return J(this),W}static assert(f){if(!(f instanceof Cv))throw new Error(`Not a ZodError: ${f}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,fv.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(f=(v)=>v.message){let v={},W=[];for(let J of this.issues)if(J.path.length>0){let Q=J.path[0];v[Q]=v[Q]||[],v[Q].push(f(J))}else W.push(f(J));return{formErrors:W,fieldErrors:v}}get formErrors(){return this.flatten()}}Cv.create=(f)=>{return new Cv(f)};var M6=(f,v)=>{let W;switch(f.code){case S.invalid_type:if(f.received===x.undefined)W="Required";else W=`Expected ${f.expected}, received ${f.received}`;break;case S.invalid_literal:W=`Invalid literal value, expected ${JSON.stringify(f.expected,fv.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:W=`Unrecognized key(s) in object: ${fv.joinValues(f.keys,", ")}`;break;case S.invalid_union:W="Invalid input";break;case S.invalid_union_discriminator:W=`Invalid discriminator value. Expected ${fv.joinValues(f.options)}`;break;case S.invalid_enum_value:W=`Invalid enum value. Expected ${fv.joinValues(f.options)}, received '${f.received}'`;break;case S.invalid_arguments:W="Invalid function arguments";break;case S.invalid_return_type:W="Invalid function return type";break;case S.invalid_date:W="Invalid date";break;case S.invalid_string:if(typeof f.validation==="object")if("includes"in f.validation){if(W=`Invalid input: must include "${f.validation.includes}"`,typeof f.validation.position==="number")W=`${W} at one or more positions greater than or equal to ${f.validation.position}`}else if("startsWith"in f.validation)W=`Invalid input: must start with "${f.validation.startsWith}"`;else if("endsWith"in f.validation)W=`Invalid input: must end with "${f.validation.endsWith}"`;else fv.assertNever(f.validation);else if(f.validation!=="regex")W=`Invalid ${f.validation}`;else W="Invalid";break;case S.too_small:if(f.type==="array")W=`Array must contain ${f.exact?"exactly":f.inclusive?"at least":"more than"} ${f.minimum} element(s)`;else if(f.type==="string")W=`String must contain ${f.exact?"exactly":f.inclusive?"at least":"over"} ${f.minimum} character(s)`;else if(f.type==="number")W=`Number must be ${f.exact?"exactly equal to ":f.inclusive?"greater than or equal to ":"greater than "}${f.minimum}`;else if(f.type==="bigint")W=`Number must be ${f.exact?"exactly equal to ":f.inclusive?"greater than or equal to ":"greater than "}${f.minimum}`;else if(f.type==="date")W=`Date must be ${f.exact?"exactly equal to ":f.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(f.minimum))}`;else W="Invalid input";break;case S.too_big:if(f.type==="array")W=`Array must contain ${f.exact?"exactly":f.inclusive?"at most":"less than"} ${f.maximum} element(s)`;else if(f.type==="string")W=`String must contain ${f.exact?"exactly":f.inclusive?"at most":"under"} ${f.maximum} character(s)`;else if(f.type==="number")W=`Number must be ${f.exact?"exactly":f.inclusive?"less than or equal to":"less than"} ${f.maximum}`;else if(f.type==="bigint")W=`BigInt must be ${f.exact?"exactly":f.inclusive?"less than or equal to":"less than"} ${f.maximum}`;else if(f.type==="date")W=`Date must be ${f.exact?"exactly":f.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(f.maximum))}`;else W="Invalid input";break;case S.custom:W="Invalid input";break;case S.invalid_intersection_types:W="Intersection results could not be merged";break;case S.not_multiple_of:W=`Number must be a multiple of ${f.multipleOf}`;break;case S.not_finite:W="Number must be finite";break;default:W=v.defaultError,fv.assertNever(f)}return{message:W}},$f=M6;var f8=$f;function N6(f){f8=f}function sf(){return f8}var E1=(f)=>{let{data:v,path:W,errorMaps:J,issueData:Q}=f,X=[...W,...Q.path||[]],Y={...Q,path:X};if(Q.message!==void 0)return{...Q,path:X,message:Q.message};let w="",B=J.filter((z)=>!!z).slice().reverse();for(let z of B)w=z(Y,{data:v,defaultError:w}).message;return{...Q,path:X,message:w}},V6=[];function u(f,v){let W=sf(),J=E1({issueData:v,data:f.data,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,W,W===$f?void 0:$f].filter((Q)=>!!Q)});f.common.issues.push(J)}class bv{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(f,v){let W=[];for(let J of v){if(J.status==="aborted")return p;if(J.status==="dirty")f.dirty();W.push(J.value)}return{status:f.value,value:W}}static async mergeObjectAsync(f,v){let W=[];for(let J of v){let Q=await J.key,X=await J.value;W.push({key:Q,value:X})}return bv.mergeObjectSync(f,W)}static mergeObjectSync(f,v){let W={};for(let J of v){let{key:Q,value:X}=J;if(Q.status==="aborted")return p;if(X.status==="aborted")return p;if(Q.status==="dirty")f.dirty();if(X.status==="dirty")f.dirty();if(Q.value!=="__proto__"&&(typeof X.value!=="undefined"||J.alwaysSet))W[Q.value]=X.value}return{status:f.value,value:W}}}var p=Object.freeze({status:"aborted"}),If=(f)=>({status:"dirty",value:f}),kv=(f)=>({status:"valid",value:f}),C1=(f)=>f.status==="aborted",T1=(f)=>f.status==="dirty",jf=(f)=>f.status==="valid",tf=(f)=>typeof Promise!=="undefined"&&f instanceof Promise;var a;(function(f){f.errToObj=(v)=>typeof v==="string"?{message:v}:v||{},f.toString=(v)=>typeof v==="string"?v:v?.message})(a||(a={}));class ev{constructor(f,v,W,J){this._cachedPath=[],this.parent=f,this.data=v,this._path=W,this._key=J}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var Q8=(f,v)=>{if(jf(v))return{success:!0,data:v.value};else{if(!f.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let W=new Cv(f.common.issues);return this._error=W,this._error}}}};function t(f){if(!f)return{};let{errorMap:v,invalid_type_error:W,required_error:J,description:Q}=f;if(v&&(W||J))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(v)return{errorMap:v,description:Q};return{errorMap:(Y,w)=>{let{message:B}=f;if(Y.code==="invalid_enum_value")return{message:B??w.defaultError};if(typeof w.data==="undefined")return{message:B??J??w.defaultError};if(Y.code!=="invalid_type")return{message:w.defaultError};return{message:B??W??w.defaultError}},description:Q}}class vv{get description(){return this._def.description}_getType(f){return wf(f.data)}_getOrReturnCtx(f,v){return v||{common:f.parent.common,data:f.data,parsedType:wf(f.data),schemaErrorMap:this._def.errorMap,path:f.path,parent:f.parent}}_processInputParams(f){return{status:new bv,ctx:{common:f.parent.common,data:f.data,parsedType:wf(f.data),schemaErrorMap:this._def.errorMap,path:f.path,parent:f.parent}}}_parseSync(f){let v=this._parse(f);if(tf(v))throw new Error("Synchronous parse encountered promise.");return v}_parseAsync(f){let v=this._parse(f);return Promise.resolve(v)}parse(f,v){let W=this.safeParse(f,v);if(W.success)return W.data;throw W.error}safeParse(f,v){let W={common:{issues:[],async:v?.async??!1,contextualErrorMap:v?.errorMap},path:v?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:f,parsedType:wf(f)},J=this._parseSync({data:f,path:W.path,parent:W});return Q8(W,J)}"~validate"(f){let v={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:f,parsedType:wf(f)};if(!this["~standard"].async)try{let W=this._parseSync({data:f,path:[],parent:v});return jf(W)?{value:W.value}:{issues:v.common.issues}}catch(W){if(W?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;v.common={issues:[],async:!0}}return this._parseAsync({data:f,path:[],parent:v}).then((W)=>jf(W)?{value:W.value}:{issues:v.common.issues})}async parseAsync(f,v){let W=await this.safeParseAsync(f,v);if(W.success)return W.data;throw W.error}async safeParseAsync(f,v){let W={common:{issues:[],contextualErrorMap:v?.errorMap,async:!0},path:v?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:f,parsedType:wf(f)},J=this._parse({data:f,path:W.path,parent:W}),Q=await(tf(J)?J:Promise.resolve(J));return Q8(W,Q)}refine(f,v){let W=(J)=>{if(typeof v==="string"||typeof v==="undefined")return{message:v};else if(typeof v==="function")return v(J);else return v};return this._refinement((J,Q)=>{let X=f(J),Y=()=>Q.addIssue({code:S.custom,...W(J)});if(typeof Promise!=="undefined"&&X instanceof Promise)return X.then((w)=>{if(!w)return Y(),!1;else return!0});if(!X)return Y(),!1;else return!0})}refinement(f,v){return this._refinement((W,J)=>{if(!f(W))return J.addIssue(typeof v==="function"?v(W,J):v),!1;else return!0})}_refinement(f){return new vf({schema:this,typeName:I.ZodEffects,effect:{type:"refinement",refinement:f}})}superRefine(f){return this._refinement(f)}constructor(f){this.spa=this.safeParseAsync,this._def=f,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(v)=>this["~validate"](v)}}optional(){return tv.create(this,this._def)}nullable(){return Nf.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sv.create(this)}promise(){return xf.create(this,this._def)}or(f){return J1.create([this,f],this._def)}and(f){return X1.create(this,f,this._def)}transform(f){return new vf({...t(this._def),schema:this,typeName:I.ZodEffects,effect:{type:"transform",transform:f}})}default(f){let v=typeof f==="function"?f:()=>f;return new B1({...t(this._def),innerType:this,defaultValue:v,typeName:I.ZodDefault})}brand(){return new u1({typeName:I.ZodBranded,type:this,...t(this._def)})}catch(f){let v=typeof f==="function"?f:()=>f;return new q1({...t(this._def),innerType:this,catchValue:v,typeName:I.ZodCatch})}describe(f){return new this.constructor({...this._def,description:f})}pipe(f){return F1.create(this,f)}readonly(){return P1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var E6=/^c[^\s-]{8,}$/i,D6=/^[0-9a-z]+$/,j6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,O6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,U6=/^[a-z0-9_-]{21}$/i,h6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,F6=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,g6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,A6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",T0,b6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,R6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,k6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,S6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,y6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,J8="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",l6=new RegExp(`^${J8}$`);function X8(f){let v="[0-5]\\d";if(f.precision)v=`${v}\\.\\d{${f.precision}}`;else if(f.precision==null)v=`${v}(\\.\\d+)?`;let W=f.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${v})${W}`}function I6(f){return new RegExp(`^${X8(f)}$`)}function Y8(f){let v=`${J8}T${X8(f)}`,W=[];if(W.push(f.local?"Z?":"Z"),f.offset)W.push("([+-]\\d{2}:?\\d{2})");return v=`${v}(${W.join("|")})`,new RegExp(`^${v}$`)}function Z6(f,v){if((v==="v4"||!v)&&b6.test(f))return!0;if((v==="v6"||!v)&&R6.test(f))return!0;return!1}function C6(f,v){if(!h6.test(f))return!1;try{let[W]=f.split(".");if(!W)return!1;let J=W.replace(/-/g,"+").replace(/_/g,"/").padEnd(W.length+(4-W.length%4)%4,"="),Q=JSON.parse(atob(J));if(typeof Q!=="object"||Q===null)return!1;if("typ"in Q&&Q?.typ!=="JWT")return!1;if(!Q.alg)return!1;if(v&&Q.alg!==v)return!1;return!0}catch{return!1}}function T6(f,v){if((v==="v4"||!v)&&_6.test(f))return!0;if((v==="v6"||!v)&&k6.test(f))return!0;return!1}class ov extends vv{_parse(f){if(this._def.coerce)f.data=String(f.data);if(this._getType(f)!==x.string){let Q=this._getOrReturnCtx(f);return u(Q,{code:S.invalid_type,expected:x.string,received:Q.parsedType}),p}let W=new bv,J=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(f.data.length<Q.value)J=this._getOrReturnCtx(f,J),u(J,{code:S.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),W.dirty()}else if(Q.kind==="max"){if(f.data.length>Q.value)J=this._getOrReturnCtx(f,J),u(J,{code:S.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),W.dirty()}else if(Q.kind==="length"){let X=f.data.length>Q.value,Y=f.data.length<Q.value;if(X||Y){if(J=this._getOrReturnCtx(f,J),X)u(J,{code:S.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});else if(Y)u(J,{code:S.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});W.dirty()}}else if(Q.kind==="email"){if(!g6.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"email",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="emoji"){if(!T0)T0=new RegExp(A6,"u");if(!T0.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"emoji",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="uuid"){if(!O6.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"uuid",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="nanoid"){if(!U6.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"nanoid",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="cuid"){if(!E6.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"cuid",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="cuid2"){if(!D6.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"cuid2",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="ulid"){if(!j6.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"ulid",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="url")try{new URL(f.data)}catch{J=this._getOrReturnCtx(f,J),u(J,{validation:"url",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="regex"){if(Q.regex.lastIndex=0,!Q.regex.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"regex",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="trim")f.data=f.data.trim();else if(Q.kind==="includes"){if(!f.data.includes(Q.value,Q.position))J=this._getOrReturnCtx(f,J),u(J,{code:S.invalid_string,validation:{includes:Q.value,position:Q.position},message:Q.message}),W.dirty()}else if(Q.kind==="toLowerCase")f.data=f.data.toLowerCase();else if(Q.kind==="toUpperCase")f.data=f.data.toUpperCase();else if(Q.kind==="startsWith"){if(!f.data.startsWith(Q.value))J=this._getOrReturnCtx(f,J),u(J,{code:S.invalid_string,validation:{startsWith:Q.value},message:Q.message}),W.dirty()}else if(Q.kind==="endsWith"){if(!f.data.endsWith(Q.value))J=this._getOrReturnCtx(f,J),u(J,{code:S.invalid_string,validation:{endsWith:Q.value},message:Q.message}),W.dirty()}else if(Q.kind==="datetime"){if(!Y8(Q).test(f.data))J=this._getOrReturnCtx(f,J),u(J,{code:S.invalid_string,validation:"datetime",message:Q.message}),W.dirty()}else if(Q.kind==="date"){if(!l6.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{code:S.invalid_string,validation:"date",message:Q.message}),W.dirty()}else if(Q.kind==="time"){if(!I6(Q).test(f.data))J=this._getOrReturnCtx(f,J),u(J,{code:S.invalid_string,validation:"time",message:Q.message}),W.dirty()}else if(Q.kind==="duration"){if(!F6.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"duration",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="ip"){if(!Z6(f.data,Q.version))J=this._getOrReturnCtx(f,J),u(J,{validation:"ip",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="jwt"){if(!C6(f.data,Q.alg))J=this._getOrReturnCtx(f,J),u(J,{validation:"jwt",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="cidr"){if(!T6(f.data,Q.version))J=this._getOrReturnCtx(f,J),u(J,{validation:"cidr",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="base64"){if(!S6.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"base64",code:S.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="base64url"){if(!y6.test(f.data))J=this._getOrReturnCtx(f,J),u(J,{validation:"base64url",code:S.invalid_string,message:Q.message}),W.dirty()}else fv.assertNever(Q);return{status:W.value,value:f.data}}_regex(f,v,W){return this.refinement((J)=>f.test(J),{validation:v,code:S.invalid_string,...a.errToObj(W)})}_addCheck(f){return new ov({...this._def,checks:[...this._def.checks,f]})}email(f){return this._addCheck({kind:"email",...a.errToObj(f)})}url(f){return this._addCheck({kind:"url",...a.errToObj(f)})}emoji(f){return this._addCheck({kind:"emoji",...a.errToObj(f)})}uuid(f){return this._addCheck({kind:"uuid",...a.errToObj(f)})}nanoid(f){return this._addCheck({kind:"nanoid",...a.errToObj(f)})}cuid(f){return this._addCheck({kind:"cuid",...a.errToObj(f)})}cuid2(f){return this._addCheck({kind:"cuid2",...a.errToObj(f)})}ulid(f){return this._addCheck({kind:"ulid",...a.errToObj(f)})}base64(f){return this._addCheck({kind:"base64",...a.errToObj(f)})}base64url(f){return this._addCheck({kind:"base64url",...a.errToObj(f)})}jwt(f){return this._addCheck({kind:"jwt",...a.errToObj(f)})}ip(f){return this._addCheck({kind:"ip",...a.errToObj(f)})}cidr(f){return this._addCheck({kind:"cidr",...a.errToObj(f)})}datetime(f){if(typeof f==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:f});return this._addCheck({kind:"datetime",precision:typeof f?.precision==="undefined"?null:f?.precision,offset:f?.offset??!1,local:f?.local??!1,...a.errToObj(f?.message)})}date(f){return this._addCheck({kind:"date",message:f})}time(f){if(typeof f==="string")return this._addCheck({kind:"time",precision:null,message:f});return this._addCheck({kind:"time",precision:typeof f?.precision==="undefined"?null:f?.precision,...a.errToObj(f?.message)})}duration(f){return this._addCheck({kind:"duration",...a.errToObj(f)})}regex(f,v){return this._addCheck({kind:"regex",regex:f,...a.errToObj(v)})}includes(f,v){return this._addCheck({kind:"includes",value:f,position:v?.position,...a.errToObj(v?.message)})}startsWith(f,v){return this._addCheck({kind:"startsWith",value:f,...a.errToObj(v)})}endsWith(f,v){return this._addCheck({kind:"endsWith",value:f,...a.errToObj(v)})}min(f,v){return this._addCheck({kind:"min",value:f,...a.errToObj(v)})}max(f,v){return this._addCheck({kind:"max",value:f,...a.errToObj(v)})}length(f,v){return this._addCheck({kind:"length",value:f,...a.errToObj(v)})}nonempty(f){return this.min(1,a.errToObj(f))}trim(){return new ov({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ov({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ov({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((f)=>f.kind==="datetime")}get isDate(){return!!this._def.checks.find((f)=>f.kind==="date")}get isTime(){return!!this._def.checks.find((f)=>f.kind==="time")}get isDuration(){return!!this._def.checks.find((f)=>f.kind==="duration")}get isEmail(){return!!this._def.checks.find((f)=>f.kind==="email")}get isURL(){return!!this._def.checks.find((f)=>f.kind==="url")}get isEmoji(){return!!this._def.checks.find((f)=>f.kind==="emoji")}get isUUID(){return!!this._def.checks.find((f)=>f.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((f)=>f.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((f)=>f.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((f)=>f.kind==="cuid2")}get isULID(){return!!this._def.checks.find((f)=>f.kind==="ulid")}get isIP(){return!!this._def.checks.find((f)=>f.kind==="ip")}get isCIDR(){return!!this._def.checks.find((f)=>f.kind==="cidr")}get isBase64(){return!!this._def.checks.find((f)=>f.kind==="base64")}get isBase64url(){return!!this._def.checks.find((f)=>f.kind==="base64url")}get minLength(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f}get maxLength(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f}}ov.create=(f)=>{return new ov({checks:[],typeName:I.ZodString,coerce:f?.coerce??!1,...t(f)})};function x6(f,v){let W=(f.toString().split(".")[1]||"").length,J=(v.toString().split(".")[1]||"").length,Q=W>J?W:J,X=Number.parseInt(f.toFixed(Q).replace(".","")),Y=Number.parseInt(v.toFixed(Q).replace(".",""));return X%Y/10**Q}class Uf extends vv{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(f){if(this._def.coerce)f.data=Number(f.data);if(this._getType(f)!==x.number){let Q=this._getOrReturnCtx(f);return u(Q,{code:S.invalid_type,expected:x.number,received:Q.parsedType}),p}let W=void 0,J=new bv;for(let Q of this._def.checks)if(Q.kind==="int"){if(!fv.isInteger(f.data))W=this._getOrReturnCtx(f,W),u(W,{code:S.invalid_type,expected:"integer",received:"float",message:Q.message}),J.dirty()}else if(Q.kind==="min"){if(Q.inclusive?f.data<Q.value:f.data<=Q.value)W=this._getOrReturnCtx(f,W),u(W,{code:S.too_small,minimum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),J.dirty()}else if(Q.kind==="max"){if(Q.inclusive?f.data>Q.value:f.data>=Q.value)W=this._getOrReturnCtx(f,W),u(W,{code:S.too_big,maximum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),J.dirty()}else if(Q.kind==="multipleOf"){if(x6(f.data,Q.value)!==0)W=this._getOrReturnCtx(f,W),u(W,{code:S.not_multiple_of,multipleOf:Q.value,message:Q.message}),J.dirty()}else if(Q.kind==="finite"){if(!Number.isFinite(f.data))W=this._getOrReturnCtx(f,W),u(W,{code:S.not_finite,message:Q.message}),J.dirty()}else fv.assertNever(Q);return{status:J.value,value:f.data}}gte(f,v){return this.setLimit("min",f,!0,a.toString(v))}gt(f,v){return this.setLimit("min",f,!1,a.toString(v))}lte(f,v){return this.setLimit("max",f,!0,a.toString(v))}lt(f,v){return this.setLimit("max",f,!1,a.toString(v))}setLimit(f,v,W,J){return new Uf({...this._def,checks:[...this._def.checks,{kind:f,value:v,inclusive:W,message:a.toString(J)}]})}_addCheck(f){return new Uf({...this._def,checks:[...this._def.checks,f]})}int(f){return this._addCheck({kind:"int",message:a.toString(f)})}positive(f){return this._addCheck({kind:"min",value:0,inclusive:!1,message:a.toString(f)})}negative(f){return this._addCheck({kind:"max",value:0,inclusive:!1,message:a.toString(f)})}nonpositive(f){return this._addCheck({kind:"max",value:0,inclusive:!0,message:a.toString(f)})}nonnegative(f){return this._addCheck({kind:"min",value:0,inclusive:!0,message:a.toString(f)})}multipleOf(f,v){return this._addCheck({kind:"multipleOf",value:f,message:a.toString(v)})}finite(f){return this._addCheck({kind:"finite",message:a.toString(f)})}safe(f){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:a.toString(f)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:a.toString(f)})}get minValue(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f}get maxValue(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f}get isInt(){return!!this._def.checks.find((f)=>f.kind==="int"||f.kind==="multipleOf"&&fv.isInteger(f.value))}get isFinite(){let f=null,v=null;for(let W of this._def.checks)if(W.kind==="finite"||W.kind==="int"||W.kind==="multipleOf")return!0;else if(W.kind==="min"){if(v===null||W.value>v)v=W.value}else if(W.kind==="max"){if(f===null||W.value<f)f=W.value}return Number.isFinite(v)&&Number.isFinite(f)}}Uf.create=(f)=>{return new Uf({checks:[],typeName:I.ZodNumber,coerce:f?.coerce||!1,...t(f)})};class hf extends vv{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(f){if(this._def.coerce)try{f.data=BigInt(f.data)}catch{return this._getInvalidInput(f)}if(this._getType(f)!==x.bigint)return this._getInvalidInput(f);let W=void 0,J=new bv;for(let Q of this._def.checks)if(Q.kind==="min"){if(Q.inclusive?f.data<Q.value:f.data<=Q.value)W=this._getOrReturnCtx(f,W),u(W,{code:S.too_small,type:"bigint",minimum:Q.value,inclusive:Q.inclusive,message:Q.message}),J.dirty()}else if(Q.kind==="max"){if(Q.inclusive?f.data>Q.value:f.data>=Q.value)W=this._getOrReturnCtx(f,W),u(W,{code:S.too_big,type:"bigint",maximum:Q.value,inclusive:Q.inclusive,message:Q.message}),J.dirty()}else if(Q.kind==="multipleOf"){if(f.data%Q.value!==BigInt(0))W=this._getOrReturnCtx(f,W),u(W,{code:S.not_multiple_of,multipleOf:Q.value,message:Q.message}),J.dirty()}else fv.assertNever(Q);return{status:J.value,value:f.data}}_getInvalidInput(f){let v=this._getOrReturnCtx(f);return u(v,{code:S.invalid_type,expected:x.bigint,received:v.parsedType}),p}gte(f,v){return this.setLimit("min",f,!0,a.toString(v))}gt(f,v){return this.setLimit("min",f,!1,a.toString(v))}lte(f,v){return this.setLimit("max",f,!0,a.toString(v))}lt(f,v){return this.setLimit("max",f,!1,a.toString(v))}setLimit(f,v,W,J){return new hf({...this._def,checks:[...this._def.checks,{kind:f,value:v,inclusive:W,message:a.toString(J)}]})}_addCheck(f){return new hf({...this._def,checks:[...this._def.checks,f]})}positive(f){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:a.toString(f)})}negative(f){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:a.toString(f)})}nonpositive(f){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:a.toString(f)})}nonnegative(f){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:a.toString(f)})}multipleOf(f,v){return this._addCheck({kind:"multipleOf",value:f,message:a.toString(v)})}get minValue(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f}get maxValue(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f}}hf.create=(f)=>{return new hf({checks:[],typeName:I.ZodBigInt,coerce:f?.coerce??!1,...t(f)})};class f1 extends vv{_parse(f){if(this._def.coerce)f.data=Boolean(f.data);if(this._getType(f)!==x.boolean){let W=this._getOrReturnCtx(f);return u(W,{code:S.invalid_type,expected:x.boolean,received:W.parsedType}),p}return kv(f.data)}}f1.create=(f)=>{return new f1({typeName:I.ZodBoolean,coerce:f?.coerce||!1,...t(f)})};class Zf extends vv{_parse(f){if(this._def.coerce)f.data=new Date(f.data);if(this._getType(f)!==x.date){let Q=this._getOrReturnCtx(f);return u(Q,{code:S.invalid_type,expected:x.date,received:Q.parsedType}),p}if(Number.isNaN(f.data.getTime())){let Q=this._getOrReturnCtx(f);return u(Q,{code:S.invalid_date}),p}let W=new bv,J=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(f.data.getTime()<Q.value)J=this._getOrReturnCtx(f,J),u(J,{code:S.too_small,message:Q.message,inclusive:!0,exact:!1,minimum:Q.value,type:"date"}),W.dirty()}else if(Q.kind==="max"){if(f.data.getTime()>Q.value)J=this._getOrReturnCtx(f,J),u(J,{code:S.too_big,message:Q.message,inclusive:!0,exact:!1,maximum:Q.value,type:"date"}),W.dirty()}else fv.assertNever(Q);return{status:W.value,value:new Date(f.data.getTime())}}_addCheck(f){return new Zf({...this._def,checks:[...this._def.checks,f]})}min(f,v){return this._addCheck({kind:"min",value:f.getTime(),message:a.toString(v)})}max(f,v){return this._addCheck({kind:"max",value:f.getTime(),message:a.toString(v)})}get minDate(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f!=null?new Date(f):null}get maxDate(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f!=null?new Date(f):null}}Zf.create=(f)=>{return new Zf({checks:[],coerce:f?.coerce||!1,typeName:I.ZodDate,...t(f)})};class D1 extends vv{_parse(f){if(this._getType(f)!==x.symbol){let W=this._getOrReturnCtx(f);return u(W,{code:S.invalid_type,expected:x.symbol,received:W.parsedType}),p}return kv(f.data)}}D1.create=(f)=>{return new D1({typeName:I.ZodSymbol,...t(f)})};class Q1 extends vv{_parse(f){if(this._getType(f)!==x.undefined){let W=this._getOrReturnCtx(f);return u(W,{code:S.invalid_type,expected:x.undefined,received:W.parsedType}),p}return kv(f.data)}}Q1.create=(f)=>{return new Q1({typeName:I.ZodUndefined,...t(f)})};class W1 extends vv{_parse(f){if(this._getType(f)!==x.null){let W=this._getOrReturnCtx(f);return u(W,{code:S.invalid_type,expected:x.null,received:W.parsedType}),p}return kv(f.data)}}W1.create=(f)=>{return new W1({typeName:I.ZodNull,...t(f)})};class Cf extends vv{constructor(){super(...arguments);this._any=!0}_parse(f){return kv(f.data)}}Cf.create=(f)=>{return new Cf({typeName:I.ZodAny,...t(f)})};class Of extends vv{constructor(){super(...arguments);this._unknown=!0}_parse(f){return kv(f.data)}}Of.create=(f)=>{return new Of({typeName:I.ZodUnknown,...t(f)})};class Gf extends vv{_parse(f){let v=this._getOrReturnCtx(f);return u(v,{code:S.invalid_type,expected:x.never,received:v.parsedType}),p}}Gf.create=(f)=>{return new Gf({typeName:I.ZodNever,...t(f)})};class j1 extends vv{_parse(f){if(this._getType(f)!==x.undefined){let W=this._getOrReturnCtx(f);return u(W,{code:S.invalid_type,expected:x.void,received:W.parsedType}),p}return kv(f.data)}}j1.create=(f)=>{return new j1({typeName:I.ZodVoid,...t(f)})};class sv extends vv{_parse(f){let{ctx:v,status:W}=this._processInputParams(f),J=this._def;if(v.parsedType!==x.array)return u(v,{code:S.invalid_type,expected:x.array,received:v.parsedType}),p;if(J.exactLength!==null){let X=v.data.length>J.exactLength.value,Y=v.data.length<J.exactLength.value;if(X||Y)u(v,{code:X?S.too_big:S.too_small,minimum:Y?J.exactLength.value:void 0,maximum:X?J.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:J.exactLength.message}),W.dirty()}if(J.minLength!==null){if(v.data.length<J.minLength.value)u(v,{code:S.too_small,minimum:J.minLength.value,type:"array",inclusive:!0,exact:!1,message:J.minLength.message}),W.dirty()}if(J.maxLength!==null){if(v.data.length>J.maxLength.value)u(v,{code:S.too_big,maximum:J.maxLength.value,type:"array",inclusive:!0,exact:!1,message:J.maxLength.message}),W.dirty()}if(v.common.async)return Promise.all([...v.data].map((X,Y)=>{return J.type._parseAsync(new ev(v,X,v.path,Y))})).then((X)=>{return bv.mergeArray(W,X)});let Q=[...v.data].map((X,Y)=>{return J.type._parseSync(new ev(v,X,v.path,Y))});return bv.mergeArray(W,Q)}get element(){return this._def.type}min(f,v){return new sv({...this._def,minLength:{value:f,message:a.toString(v)}})}max(f,v){return new sv({...this._def,maxLength:{value:f,message:a.toString(v)}})}length(f,v){return new sv({...this._def,exactLength:{value:f,message:a.toString(v)}})}nonempty(f){return this.min(1,f)}}sv.create=(f,v)=>{return new sv({type:f,minLength:null,maxLength:null,exactLength:null,typeName:I.ZodArray,...t(v)})};function ef(f){if(f instanceof Nv){let v={};for(let W in f.shape){let J=f.shape[W];v[W]=tv.create(ef(J))}return new Nv({...f._def,shape:()=>v})}else if(f instanceof sv)return new sv({...f._def,type:ef(f.element)});else if(f instanceof tv)return tv.create(ef(f.unwrap()));else if(f instanceof Nf)return Nf.create(ef(f.unwrap()));else if(f instanceof Bf)return Bf.create(f.items.map((v)=>ef(v)));else return f}class Nv extends vv{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let f=this._def.shape(),v=fv.objectKeys(f);return this._cached={shape:f,keys:v},this._cached}_parse(f){if(this._getType(f)!==x.object){let B=this._getOrReturnCtx(f);return u(B,{code:S.invalid_type,expected:x.object,received:B.parsedType}),p}let{status:W,ctx:J}=this._processInputParams(f),{shape:Q,keys:X}=this._getCached(),Y=[];if(!(this._def.catchall instanceof Gf&&this._def.unknownKeys==="strip")){for(let B in J.data)if(!X.includes(B))Y.push(B)}let w=[];for(let B of X){let z=Q[B],H=J.data[B];w.push({key:{status:"valid",value:B},value:z._parse(new ev(J,H,J.path,B)),alwaysSet:B in J.data})}if(this._def.catchall instanceof Gf){let B=this._def.unknownKeys;if(B==="passthrough")for(let z of Y)w.push({key:{status:"valid",value:z},value:{status:"valid",value:J.data[z]}});else if(B==="strict"){if(Y.length>0)u(J,{code:S.unrecognized_keys,keys:Y}),W.dirty()}else if(B==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let B=this._def.catchall;for(let z of Y){let H=J.data[z];w.push({key:{status:"valid",value:z},value:B._parse(new ev(J,H,J.path,z)),alwaysSet:z in J.data})}}if(J.common.async)return Promise.resolve().then(async()=>{let B=[];for(let z of w){let H=await z.key,$=await z.value;B.push({key:H,value:$,alwaysSet:z.alwaysSet})}return B}).then((B)=>{return bv.mergeObjectSync(W,B)});else return bv.mergeObjectSync(W,w)}get shape(){return this._def.shape()}strict(f){return a.errToObj,new Nv({...this._def,unknownKeys:"strict",...f!==void 0?{errorMap:(v,W)=>{let J=this._def.errorMap?.(v,W).message??W.defaultError;if(v.code==="unrecognized_keys")return{message:a.errToObj(f).message??J};return{message:J}}}:{}})}strip(){return new Nv({...this._def,unknownKeys:"strip"})}passthrough(){return new Nv({...this._def,unknownKeys:"passthrough"})}extend(f){return new Nv({...this._def,shape:()=>({...this._def.shape(),...f})})}merge(f){return new Nv({unknownKeys:f._def.unknownKeys,catchall:f._def.catchall,shape:()=>({...this._def.shape(),...f._def.shape()}),typeName:I.ZodObject})}setKey(f,v){return this.augment({[f]:v})}catchall(f){return new Nv({...this._def,catchall:f})}pick(f){let v={};for(let W of fv.objectKeys(f))if(f[W]&&this.shape[W])v[W]=this.shape[W];return new Nv({...this._def,shape:()=>v})}omit(f){let v={};for(let W of fv.objectKeys(this.shape))if(!f[W])v[W]=this.shape[W];return new Nv({...this._def,shape:()=>v})}deepPartial(){return ef(this)}partial(f){let v={};for(let W of fv.objectKeys(this.shape)){let J=this.shape[W];if(f&&!f[W])v[W]=J;else v[W]=J.optional()}return new Nv({...this._def,shape:()=>v})}required(f){let v={};for(let W of fv.objectKeys(this.shape))if(f&&!f[W])v[W]=this.shape[W];else{let Q=this.shape[W];while(Q instanceof tv)Q=Q._def.innerType;v[W]=Q}return new Nv({...this._def,shape:()=>v})}keyof(){return w8(fv.objectKeys(this.shape))}}Nv.create=(f,v)=>{return new Nv({shape:()=>f,unknownKeys:"strip",catchall:Gf.create(),typeName:I.ZodObject,...t(v)})};Nv.strictCreate=(f,v)=>{return new Nv({shape:()=>f,unknownKeys:"strict",catchall:Gf.create(),typeName:I.ZodObject,...t(v)})};Nv.lazycreate=(f,v)=>{return new Nv({shape:f,unknownKeys:"strip",catchall:Gf.create(),typeName:I.ZodObject,...t(v)})};class J1 extends vv{_parse(f){let{ctx:v}=this._processInputParams(f),W=this._def.options;function J(Q){for(let Y of Q)if(Y.result.status==="valid")return Y.result;for(let Y of Q)if(Y.result.status==="dirty")return v.common.issues.push(...Y.ctx.common.issues),Y.result;let X=Q.map((Y)=>new Cv(Y.ctx.common.issues));return u(v,{code:S.invalid_union,unionErrors:X}),p}if(v.common.async)return Promise.all(W.map(async(Q)=>{let X={...v,common:{...v.common,issues:[]},parent:null};return{result:await Q._parseAsync({data:v.data,path:v.path,parent:X}),ctx:X}})).then(J);else{let Q=void 0,X=[];for(let w of W){let B={...v,common:{...v.common,issues:[]},parent:null},z=w._parseSync({data:v.data,path:v.path,parent:B});if(z.status==="valid")return z;else if(z.status==="dirty"&&!Q)Q={result:z,ctx:B};if(B.common.issues.length)X.push(B.common.issues)}if(Q)return v.common.issues.push(...Q.ctx.common.issues),Q.result;let Y=X.map((w)=>new Cv(w));return u(v,{code:S.invalid_union,unionErrors:Y}),p}}get options(){return this._def.options}}J1.create=(f,v)=>{return new J1({options:f,typeName:I.ZodUnion,...t(v)})};var Mf=(f)=>{if(f instanceof Y1)return Mf(f.schema);else if(f instanceof vf)return Mf(f.innerType());else if(f instanceof w1)return[f.value];else if(f instanceof Ff)return f.options;else if(f instanceof G1)return fv.objectValues(f.enum);else if(f instanceof B1)return Mf(f._def.innerType);else if(f instanceof Q1)return[void 0];else if(f instanceof W1)return[null];else if(f instanceof tv)return[void 0,...Mf(f.unwrap())];else if(f instanceof Nf)return[null,...Mf(f.unwrap())];else if(f instanceof u1)return Mf(f.unwrap());else if(f instanceof P1)return Mf(f.unwrap());else if(f instanceof q1)return Mf(f._def.innerType);else return[]};class x1 extends vv{_parse(f){let{ctx:v}=this._processInputParams(f);if(v.parsedType!==x.object)return u(v,{code:S.invalid_type,expected:x.object,received:v.parsedType}),p;let W=this.discriminator,J=v.data[W],Q=this.optionsMap.get(J);if(!Q)return u(v,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[W]}),p;if(v.common.async)return Q._parseAsync({data:v.data,path:v.path,parent:v});else return Q._parseSync({data:v.data,path:v.path,parent:v})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(f,v,W){let J=new Map;for(let Q of v){let X=Mf(Q.shape[f]);if(!X.length)throw new Error(`A discriminator value for key \`${f}\` could not be extracted from all schema options`);for(let Y of X){if(J.has(Y))throw new Error(`Discriminator property ${String(f)} has duplicate value ${String(Y)}`);J.set(Y,Q)}}return new x1({typeName:I.ZodDiscriminatedUnion,discriminator:f,options:v,optionsMap:J,...t(W)})}}function x0(f,v){let W=wf(f),J=wf(v);if(f===v)return{valid:!0,data:f};else if(W===x.object&&J===x.object){let Q=fv.objectKeys(v),X=fv.objectKeys(f).filter((w)=>Q.indexOf(w)!==-1),Y={...f,...v};for(let w of X){let B=x0(f[w],v[w]);if(!B.valid)return{valid:!1};Y[w]=B.data}return{valid:!0,data:Y}}else if(W===x.array&&J===x.array){if(f.length!==v.length)return{valid:!1};let Q=[];for(let X=0;X<f.length;X++){let Y=f[X],w=v[X],B=x0(Y,w);if(!B.valid)return{valid:!1};Q.push(B.data)}return{valid:!0,data:Q}}else if(W===x.date&&J===x.date&&+f===+v)return{valid:!0,data:f};else return{valid:!1}}class X1 extends vv{_parse(f){let{status:v,ctx:W}=this._processInputParams(f),J=(Q,X)=>{if(C1(Q)||C1(X))return p;let Y=x0(Q.value,X.value);if(!Y.valid)return u(W,{code:S.invalid_intersection_types}),p;if(T1(Q)||T1(X))v.dirty();return{status:v.value,value:Y.data}};if(W.common.async)return Promise.all([this._def.left._parseAsync({data:W.data,path:W.path,parent:W}),this._def.right._parseAsync({data:W.data,path:W.path,parent:W})]).then(([Q,X])=>J(Q,X));else return J(this._def.left._parseSync({data:W.data,path:W.path,parent:W}),this._def.right._parseSync({data:W.data,path:W.path,parent:W}))}}X1.create=(f,v,W)=>{return new X1({left:f,right:v,typeName:I.ZodIntersection,...t(W)})};class Bf extends vv{_parse(f){let{status:v,ctx:W}=this._processInputParams(f);if(W.parsedType!==x.array)return u(W,{code:S.invalid_type,expected:x.array,received:W.parsedType}),p;if(W.data.length<this._def.items.length)return u(W,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;if(!this._def.rest&&W.data.length>this._def.items.length)u(W,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v.dirty();let Q=[...W.data].map((X,Y)=>{let w=this._def.items[Y]||this._def.rest;if(!w)return null;return w._parse(new ev(W,X,W.path,Y))}).filter((X)=>!!X);if(W.common.async)return Promise.all(Q).then((X)=>{return bv.mergeArray(v,X)});else return bv.mergeArray(v,Q)}get items(){return this._def.items}rest(f){return new Bf({...this._def,rest:f})}}Bf.create=(f,v)=>{if(!Array.isArray(f))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bf({items:f,typeName:I.ZodTuple,rest:null,...t(v)})};class O1 extends vv{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(f){let{status:v,ctx:W}=this._processInputParams(f);if(W.parsedType!==x.object)return u(W,{code:S.invalid_type,expected:x.object,received:W.parsedType}),p;let J=[],Q=this._def.keyType,X=this._def.valueType;for(let Y in W.data)J.push({key:Q._parse(new ev(W,Y,W.path,Y)),value:X._parse(new ev(W,W.data[Y],W.path,Y)),alwaysSet:Y in W.data});if(W.common.async)return bv.mergeObjectAsync(v,J);else return bv.mergeObjectSync(v,J)}get element(){return this._def.valueType}static create(f,v,W){if(v instanceof vv)return new O1({keyType:f,valueType:v,typeName:I.ZodRecord,...t(W)});return new O1({keyType:ov.create(),valueType:f,typeName:I.ZodRecord,...t(v)})}}class U1 extends vv{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(f){let{status:v,ctx:W}=this._processInputParams(f);if(W.parsedType!==x.map)return u(W,{code:S.invalid_type,expected:x.map,received:W.parsedType}),p;let J=this._def.keyType,Q=this._def.valueType,X=[...W.data.entries()].map(([Y,w],B)=>{return{key:J._parse(new ev(W,Y,W.path,[B,"key"])),value:Q._parse(new ev(W,w,W.path,[B,"value"]))}});if(W.common.async){let Y=new Map;return Promise.resolve().then(async()=>{for(let w of X){let B=await w.key,z=await w.value;if(B.status==="aborted"||z.status==="aborted")return p;if(B.status==="dirty"||z.status==="dirty")v.dirty();Y.set(B.value,z.value)}return{status:v.value,value:Y}})}else{let Y=new Map;for(let w of X){let{key:B,value:z}=w;if(B.status==="aborted"||z.status==="aborted")return p;if(B.status==="dirty"||z.status==="dirty")v.dirty();Y.set(B.value,z.value)}return{status:v.value,value:Y}}}}U1.create=(f,v,W)=>{return new U1({valueType:v,keyType:f,typeName:I.ZodMap,...t(W)})};class Tf extends vv{_parse(f){let{status:v,ctx:W}=this._processInputParams(f);if(W.parsedType!==x.set)return u(W,{code:S.invalid_type,expected:x.set,received:W.parsedType}),p;let J=this._def;if(J.minSize!==null){if(W.data.size<J.minSize.value)u(W,{code:S.too_small,minimum:J.minSize.value,type:"set",inclusive:!0,exact:!1,message:J.minSize.message}),v.dirty()}if(J.maxSize!==null){if(W.data.size>J.maxSize.value)u(W,{code:S.too_big,maximum:J.maxSize.value,type:"set",inclusive:!0,exact:!1,message:J.maxSize.message}),v.dirty()}let Q=this._def.valueType;function X(w){let B=new Set;for(let z of w){if(z.status==="aborted")return p;if(z.status==="dirty")v.dirty();B.add(z.value)}return{status:v.value,value:B}}let Y=[...W.data.values()].map((w,B)=>Q._parse(new ev(W,w,W.path,B)));if(W.common.async)return Promise.all(Y).then((w)=>X(w));else return X(Y)}min(f,v){return new Tf({...this._def,minSize:{value:f,message:a.toString(v)}})}max(f,v){return new Tf({...this._def,maxSize:{value:f,message:a.toString(v)}})}size(f,v){return this.min(f,v).max(f,v)}nonempty(f){return this.min(1,f)}}Tf.create=(f,v)=>{return new Tf({valueType:f,minSize:null,maxSize:null,typeName:I.ZodSet,...t(v)})};class v1 extends vv{constructor(){super(...arguments);this.validate=this.implement}_parse(f){let{ctx:v}=this._processInputParams(f);if(v.parsedType!==x.function)return u(v,{code:S.invalid_type,expected:x.function,received:v.parsedType}),p;function W(Y,w){return E1({data:Y,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,sf(),$f].filter((B)=>!!B),issueData:{code:S.invalid_arguments,argumentsError:w}})}function J(Y,w){return E1({data:Y,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,sf(),$f].filter((B)=>!!B),issueData:{code:S.invalid_return_type,returnTypeError:w}})}let Q={errorMap:v.common.contextualErrorMap},X=v.data;if(this._def.returns instanceof xf){let Y=this;return kv(async function(...w){let B=new Cv([]),z=await Y._def.args.parseAsync(w,Q).catch((K)=>{throw B.addIssue(W(w,K)),B}),H=await Reflect.apply(X,this,z);return await Y._def.returns._def.type.parseAsync(H,Q).catch((K)=>{throw B.addIssue(J(H,K)),B})})}else{let Y=this;return kv(function(...w){let B=Y._def.args.safeParse(w,Q);if(!B.success)throw new Cv([W(w,B.error)]);let z=Reflect.apply(X,this,B.data),H=Y._def.returns.safeParse(z,Q);if(!H.success)throw new Cv([J(z,H.error)]);return H.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...f){return new v1({...this._def,args:Bf.create(f).rest(Of.create())})}returns(f){return new v1({...this._def,returns:f})}implement(f){return this.parse(f)}strictImplement(f){return this.parse(f)}static create(f,v,W){return new v1({args:f?f:Bf.create([]).rest(Of.create()),returns:v||Of.create(),typeName:I.ZodFunction,...t(W)})}}class Y1 extends vv{get schema(){return this._def.getter()}_parse(f){let{ctx:v}=this._processInputParams(f);return this._def.getter()._parse({data:v.data,path:v.path,parent:v})}}Y1.create=(f,v)=>{return new Y1({getter:f,typeName:I.ZodLazy,...t(v)})};class w1 extends vv{_parse(f){if(f.data!==this._def.value){let v=this._getOrReturnCtx(f);return u(v,{received:v.data,code:S.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:f.data}}get value(){return this._def.value}}w1.create=(f,v)=>{return new w1({value:f,typeName:I.ZodLiteral,...t(v)})};function w8(f,v){return new Ff({values:f,typeName:I.ZodEnum,...t(v)})}class Ff extends vv{_parse(f){if(typeof f.data!=="string"){let v=this._getOrReturnCtx(f),W=this._def.values;return u(v,{expected:fv.joinValues(W),received:v.parsedType,code:S.invalid_type}),p}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(f.data)){let v=this._getOrReturnCtx(f),W=this._def.values;return u(v,{received:v.data,code:S.invalid_enum_value,options:W}),p}return kv(f.data)}get options(){return this._def.values}get enum(){let f={};for(let v of this._def.values)f[v]=v;return f}get Values(){let f={};for(let v of this._def.values)f[v]=v;return f}get Enum(){let f={};for(let v of this._def.values)f[v]=v;return f}extract(f,v=this._def){return Ff.create(f,{...this._def,...v})}exclude(f,v=this._def){return Ff.create(this.options.filter((W)=>!f.includes(W)),{...this._def,...v})}}Ff.create=w8;class G1 extends vv{_parse(f){let v=fv.getValidEnumValues(this._def.values),W=this._getOrReturnCtx(f);if(W.parsedType!==x.string&&W.parsedType!==x.number){let J=fv.objectValues(v);return u(W,{expected:fv.joinValues(J),received:W.parsedType,code:S.invalid_type}),p}if(!this._cache)this._cache=new Set(fv.getValidEnumValues(this._def.values));if(!this._cache.has(f.data)){let J=fv.objectValues(v);return u(W,{received:W.data,code:S.invalid_enum_value,options:J}),p}return kv(f.data)}get enum(){return this._def.values}}G1.create=(f,v)=>{return new G1({values:f,typeName:I.ZodNativeEnum,...t(v)})};class xf extends vv{unwrap(){return this._def.type}_parse(f){let{ctx:v}=this._processInputParams(f);if(v.parsedType!==x.promise&&v.common.async===!1)return u(v,{code:S.invalid_type,expected:x.promise,received:v.parsedType}),p;let W=v.parsedType===x.promise?v.data:Promise.resolve(v.data);return kv(W.then((J)=>{return this._def.type.parseAsync(J,{path:v.path,errorMap:v.common.contextualErrorMap})}))}}xf.create=(f,v)=>{return new xf({type:f,typeName:I.ZodPromise,...t(v)})};class vf extends vv{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===I.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(f){let{status:v,ctx:W}=this._processInputParams(f),J=this._def.effect||null,Q={addIssue:(X)=>{if(u(W,X),X.fatal)v.abort();else v.dirty()},get path(){return W.path}};if(Q.addIssue=Q.addIssue.bind(Q),J.type==="preprocess"){let X=J.transform(W.data,Q);if(W.common.async)return Promise.resolve(X).then(async(Y)=>{if(v.value==="aborted")return p;let w=await this._def.schema._parseAsync({data:Y,path:W.path,parent:W});if(w.status==="aborted")return p;if(w.status==="dirty")return If(w.value);if(v.value==="dirty")return If(w.value);return w});else{if(v.value==="aborted")return p;let Y=this._def.schema._parseSync({data:X,path:W.path,parent:W});if(Y.status==="aborted")return p;if(Y.status==="dirty")return If(Y.value);if(v.value==="dirty")return If(Y.value);return Y}}if(J.type==="refinement"){let X=(Y)=>{let w=J.refinement(Y,Q);if(W.common.async)return Promise.resolve(w);if(w instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Y};if(W.common.async===!1){let Y=this._def.schema._parseSync({data:W.data,path:W.path,parent:W});if(Y.status==="aborted")return p;if(Y.status==="dirty")v.dirty();return X(Y.value),{status:v.value,value:Y.value}}else return this._def.schema._parseAsync({data:W.data,path:W.path,parent:W}).then((Y)=>{if(Y.status==="aborted")return p;if(Y.status==="dirty")v.dirty();return X(Y.value).then(()=>{return{status:v.value,value:Y.value}})})}if(J.type==="transform")if(W.common.async===!1){let X=this._def.schema._parseSync({data:W.data,path:W.path,parent:W});if(!jf(X))return p;let Y=J.transform(X.value,Q);if(Y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:v.value,value:Y}}else return this._def.schema._parseAsync({data:W.data,path:W.path,parent:W}).then((X)=>{if(!jf(X))return p;return Promise.resolve(J.transform(X.value,Q)).then((Y)=>({status:v.value,value:Y}))});fv.assertNever(J)}}vf.create=(f,v,W)=>{return new vf({schema:f,typeName:I.ZodEffects,effect:v,...t(W)})};vf.createWithPreprocess=(f,v,W)=>{return new vf({schema:v,effect:{type:"preprocess",transform:f},typeName:I.ZodEffects,...t(W)})};class tv extends vv{_parse(f){if(this._getType(f)===x.undefined)return kv(void 0);return this._def.innerType._parse(f)}unwrap(){return this._def.innerType}}tv.create=(f,v)=>{return new tv({innerType:f,typeName:I.ZodOptional,...t(v)})};class Nf extends vv{_parse(f){if(this._getType(f)===x.null)return kv(null);return this._def.innerType._parse(f)}unwrap(){return this._def.innerType}}Nf.create=(f,v)=>{return new Nf({innerType:f,typeName:I.ZodNullable,...t(v)})};class B1 extends vv{_parse(f){let{ctx:v}=this._processInputParams(f),W=v.data;if(v.parsedType===x.undefined)W=this._def.defaultValue();return this._def.innerType._parse({data:W,path:v.path,parent:v})}removeDefault(){return this._def.innerType}}B1.create=(f,v)=>{return new B1({innerType:f,typeName:I.ZodDefault,defaultValue:typeof v.default==="function"?v.default:()=>v.default,...t(v)})};class q1 extends vv{_parse(f){let{ctx:v}=this._processInputParams(f),W={...v,common:{...v.common,issues:[]}},J=this._def.innerType._parse({data:W.data,path:W.path,parent:{...W}});if(tf(J))return J.then((Q)=>{return{status:"valid",value:Q.status==="valid"?Q.value:this._def.catchValue({get error(){return new Cv(W.common.issues)},input:W.data})}});else return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new Cv(W.common.issues)},input:W.data})}}removeCatch(){return this._def.innerType}}q1.create=(f,v)=>{return new q1({innerType:f,typeName:I.ZodCatch,catchValue:typeof v.catch==="function"?v.catch:()=>v.catch,...t(v)})};class h1 extends vv{_parse(f){if(this._getType(f)!==x.nan){let W=this._getOrReturnCtx(f);return u(W,{code:S.invalid_type,expected:x.nan,received:W.parsedType}),p}return{status:"valid",value:f.data}}}h1.create=(f)=>{return new h1({typeName:I.ZodNaN,...t(f)})};var u6=Symbol("zod_brand");class u1 extends vv{_parse(f){let{ctx:v}=this._processInputParams(f),W=v.data;return this._def.type._parse({data:W,path:v.path,parent:v})}unwrap(){return this._def.type}}class F1 extends vv{_parse(f){let{status:v,ctx:W}=this._processInputParams(f);if(W.common.async)return(async()=>{let Q=await this._def.in._parseAsync({data:W.data,path:W.path,parent:W});if(Q.status==="aborted")return p;if(Q.status==="dirty")return v.dirty(),If(Q.value);else return this._def.out._parseAsync({data:Q.value,path:W.path,parent:W})})();else{let J=this._def.in._parseSync({data:W.data,path:W.path,parent:W});if(J.status==="aborted")return p;if(J.status==="dirty")return v.dirty(),{status:"dirty",value:J.value};else return this._def.out._parseSync({data:J.value,path:W.path,parent:W})}}static create(f,v){return new F1({in:f,out:v,typeName:I.ZodPipeline})}}class P1 extends vv{_parse(f){let v=this._def.innerType._parse(f),W=(J)=>{if(jf(J))J.value=Object.freeze(J.value);return J};return tf(v)?v.then((J)=>W(J)):W(v)}unwrap(){return this._def.innerType}}P1.create=(f,v)=>{return new P1({innerType:f,typeName:I.ZodReadonly,...t(v)})};function W8(f,v){let W=typeof f==="function"?f(v):typeof f==="string"?{message:f}:f;return typeof W==="string"?{message:W}:W}function G8(f,v={},W){if(f)return Cf.create().superRefine((J,Q)=>{let X=f(J);if(X instanceof Promise)return X.then((Y)=>{if(!Y){let w=W8(v,J),B=w.fatal??W??!0;Q.addIssue({code:"custom",...w,fatal:B})}});if(!X){let Y=W8(v,J),w=Y.fatal??W??!0;Q.addIssue({code:"custom",...Y,fatal:w})}return});return Cf.create()}var r6={object:Nv.lazycreate},I;(function(f){f.ZodString="ZodString",f.ZodNumber="ZodNumber",f.ZodNaN="ZodNaN",f.ZodBigInt="ZodBigInt",f.ZodBoolean="ZodBoolean",f.ZodDate="ZodDate",f.ZodSymbol="ZodSymbol",f.ZodUndefined="ZodUndefined",f.ZodNull="ZodNull",f.ZodAny="ZodAny",f.ZodUnknown="ZodUnknown",f.ZodNever="ZodNever",f.ZodVoid="ZodVoid",f.ZodArray="ZodArray",f.ZodObject="ZodObject",f.ZodUnion="ZodUnion",f.ZodDiscriminatedUnion="ZodDiscriminatedUnion",f.ZodIntersection="ZodIntersection",f.ZodTuple="ZodTuple",f.ZodRecord="ZodRecord",f.ZodMap="ZodMap",f.ZodSet="ZodSet",f.ZodFunction="ZodFunction",f.ZodLazy="ZodLazy",f.ZodLiteral="ZodLiteral",f.ZodEnum="ZodEnum",f.ZodEffects="ZodEffects",f.ZodNativeEnum="ZodNativeEnum",f.ZodOptional="ZodOptional",f.ZodNullable="ZodNullable",f.ZodDefault="ZodDefault",f.ZodCatch="ZodCatch",f.ZodPromise="ZodPromise",f.ZodBranded="ZodBranded",f.ZodPipeline="ZodPipeline",f.ZodReadonly="ZodReadonly"})(I||(I={}));var m6=(f,v={message:`Input not instance of ${f.name}`})=>G8((W)=>W instanceof f,v),B8=ov.create,q8=Uf.create,a6=h1.create,c6=hf.create,P8=f1.create,n6=Zf.create,p6=D1.create,i6=Q1.create,d6=W1.create,o6=Cf.create,s6=Of.create,t6=Gf.create,e6=j1.create,v5=sv.create,f5=Nv.create,Q5=Nv.strictCreate,W5=J1.create,J5=x1.create,X5=X1.create,Y5=Bf.create,w5=O1.create,G5=U1.create,B5=Tf.create,q5=v1.create,P5=Y1.create,H5=w1.create,K5=Ff.create,z5=G1.create,L5=xf.create,$5=vf.create,M5=tv.create,N5=Nf.create,V5=vf.createWithPreprocess,E5=F1.create,D5=()=>B8().optional(),j5=()=>q8().optional(),O5=()=>P8().optional(),U5={string:(f)=>ov.create({...f,coerce:!0}),number:(f)=>Uf.create({...f,coerce:!0}),boolean:(f)=>f1.create({...f,coerce:!0}),bigint:(f)=>hf.create({...f,coerce:!0}),date:(f)=>Zf.create({...f,coerce:!0})};var h5=p;var u0="2025-06-18";var H8=[u0,"2025-03-26","2024-11-05","2024-10-07"],r1="2.0",K8=G.union([G.string(),G.number().int()]),z8=G.string(),F5=G.object({progressToken:G.optional(K8)}).passthrough(),pv=G.object({_meta:G.optional(F5)}).passthrough(),Tv=G.object({method:G.string(),params:G.optional(pv)}),g1=G.object({_meta:G.optional(G.object({}).passthrough())}).passthrough(),qf=G.object({method:G.string(),params:G.optional(g1)}),iv=G.object({_meta:G.optional(G.object({}).passthrough())}).passthrough(),m1=G.union([G.string(),G.number().int()]),L8=G.object({jsonrpc:G.literal(r1),id:m1}).merge(Tv).strict(),$8=(f)=>L8.safeParse(f).success,M8=G.object({jsonrpc:G.literal(r1)}).merge(qf).strict(),N8=(f)=>M8.safeParse(f).success,V8=G.object({jsonrpc:G.literal(r1),id:m1,result:iv}).strict(),r0=(f)=>V8.safeParse(f).success,Hv;(function(f){f[f.ConnectionClosed=-32000]="ConnectionClosed",f[f.RequestTimeout=-32001]="RequestTimeout",f[f.ParseError=-32700]="ParseError",f[f.InvalidRequest=-32600]="InvalidRequest",f[f.MethodNotFound=-32601]="MethodNotFound",f[f.InvalidParams=-32602]="InvalidParams",f[f.InternalError=-32603]="InternalError"})(Hv||(Hv={}));var E8=G.object({jsonrpc:G.literal(r1),id:m1,error:G.object({code:G.number().int(),message:G.string(),data:G.optional(G.unknown())})}).strict(),D8=(f)=>E8.safeParse(f).success,j8=G.union([L8,M8,V8,E8]),a1=iv.strict(),c1=qf.extend({method:G.literal("notifications/cancelled"),params:g1.extend({requestId:m1,reason:G.string().optional()})}),g5=G.object({src:G.string(),mimeType:G.optional(G.string()),sizes:G.optional(G.array(G.string()))}).passthrough(),A1=G.object({icons:G.array(g5).optional()}).passthrough(),b1=G.object({name:G.string(),title:G.optional(G.string())}).passthrough(),O8=b1.extend({version:G.string(),websiteUrl:G.optional(G.string())}).merge(A1),A5=G.object({experimental:G.optional(G.object({}).passthrough()),sampling:G.optional(G.object({}).passthrough()),elicitation:G.optional(G.object({}).passthrough()),roots:G.optional(G.object({listChanged:G.optional(G.boolean())}).passthrough())}).passthrough(),m0=Tv.extend({method:G.literal("initialize"),params:pv.extend({protocolVersion:G.string(),capabilities:A5,clientInfo:O8})});var b5=G.object({experimental:G.optional(G.object({}).passthrough()),logging:G.optional(G.object({}).passthrough()),completions:G.optional(G.object({}).passthrough()),prompts:G.optional(G.object({listChanged:G.optional(G.boolean())}).passthrough()),resources:G.optional(G.object({subscribe:G.optional(G.boolean()),listChanged:G.optional(G.boolean())}).passthrough()),tools:G.optional(G.object({listChanged:G.optional(G.boolean())}).passthrough())}).passthrough(),_5=iv.extend({protocolVersion:G.string(),capabilities:b5,serverInfo:O8,instructions:G.optional(G.string())}),a0=qf.extend({method:G.literal("notifications/initialized")});var n1=Tv.extend({method:G.literal("ping")}),R5=G.object({progress:G.number(),total:G.optional(G.number()),message:G.optional(G.string())}).passthrough(),p1=qf.extend({method:G.literal("notifications/progress"),params:g1.merge(R5).extend({progressToken:K8})}),i1=Tv.extend({params:pv.extend({cursor:G.optional(z8)}).optional()}),d1=iv.extend({nextCursor:G.optional(z8)}),U8=G.object({uri:G.string(),mimeType:G.optional(G.string()),_meta:G.optional(G.object({}).passthrough())}).passthrough(),h8=U8.extend({text:G.string()}),c0=G.string().refine((f)=>{try{return atob(f),!0}catch(v){return!1}},{message:"Invalid Base64 string"}),F8=U8.extend({blob:c0}),g8=b1.extend({uri:G.string(),description:G.optional(G.string()),mimeType:G.optional(G.string()),_meta:G.optional(G.object({}).passthrough())}).merge(A1),k5=b1.extend({uriTemplate:G.string(),description:G.optional(G.string()),mimeType:G.optional(G.string()),_meta:G.optional(G.object({}).passthrough())}).merge(A1),o1=i1.extend({method:G.literal("resources/list")}),S5=d1.extend({resources:G.array(g8)}),s1=i1.extend({method:G.literal("resources/templates/list")}),y5=d1.extend({resourceTemplates:G.array(k5)}),t1=Tv.extend({method:G.literal("resources/read"),params:pv.extend({uri:G.string()})}),l5=iv.extend({contents:G.array(G.union([h8,F8]))}),I5=qf.extend({method:G.literal("notifications/resources/list_changed")}),Z5=Tv.extend({method:G.literal("resources/subscribe"),params:pv.extend({uri:G.string()})}),C5=Tv.extend({method:G.literal("resources/unsubscribe"),params:pv.extend({uri:G.string()})}),T5=qf.extend({method:G.literal("notifications/resources/updated"),params:g1.extend({uri:G.string()})}),x5=G.object({name:G.string(),description:G.optional(G.string()),required:G.optional(G.boolean())}).passthrough(),u5=b1.extend({description:G.optional(G.string()),arguments:G.optional(G.array(x5)),_meta:G.optional(G.object({}).passthrough())}).merge(A1),e1=i1.extend({method:G.literal("prompts/list")}),r5=d1.extend({prompts:G.array(u5)}),v0=Tv.extend({method:G.literal("prompts/get"),params:pv.extend({name:G.string(),arguments:G.optional(G.record(G.string()))})}),n0=G.object({type:G.literal("text"),text:G.string(),_meta:G.optional(G.object({}).passthrough())}).passthrough(),p0=G.object({type:G.literal("image"),data:c0,mimeType:G.string(),_meta:G.optional(G.object({}).passthrough())}).passthrough(),i0=G.object({type:G.literal("audio"),data:c0,mimeType:G.string(),_meta:G.optional(G.object({}).passthrough())}).passthrough(),m5=G.object({type:G.literal("resource"),resource:G.union([h8,F8]),_meta:G.optional(G.object({}).passthrough())}).passthrough(),a5=g8.extend({type:G.literal("resource_link")}),A8=G.union([n0,p0,i0,a5,m5]),c5=G.object({role:G.enum(["user","assistant"]),content:A8}).passthrough(),n5=iv.extend({description:G.optional(G.string()),messages:G.array(c5)}),p5=qf.extend({method:G.literal("notifications/prompts/list_changed")}),i5=G.object({title:G.optional(G.string()),readOnlyHint:G.optional(G.boolean()),destructiveHint:G.optional(G.boolean()),idempotentHint:G.optional(G.boolean()),openWorldHint:G.optional(G.boolean())}).passthrough(),d5=b1.extend({description:G.optional(G.string()),inputSchema:G.object({type:G.literal("object"),properties:G.optional(G.object({}).passthrough()),required:G.optional(G.array(G.string()))}).passthrough(),outputSchema:G.optional(G.object({type:G.literal("object"),properties:G.optional(G.object({}).passthrough()),required:G.optional(G.array(G.string()))}).passthrough()),annotations:G.optional(i5),_meta:G.optional(G.object({}).passthrough())}).merge(A1),f0=i1.extend({method:G.literal("tools/list")}),o5=d1.extend({tools:G.array(d5)}),b8=iv.extend({content:G.array(A8).default([]),structuredContent:G.object({}).passthrough().optional(),isError:G.optional(G.boolean())}),p2=b8.or(iv.extend({toolResult:G.unknown()})),Q0=Tv.extend({method:G.literal("tools/call"),params:pv.extend({name:G.string(),arguments:G.optional(G.record(G.unknown()))})}),s5=qf.extend({method:G.literal("notifications/tools/list_changed")}),_1=G.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),d0=Tv.extend({method:G.literal("logging/setLevel"),params:pv.extend({level:_1})}),t5=qf.extend({method:G.literal("notifications/message"),params:g1.extend({level:_1,logger:G.optional(G.string()),data:G.unknown()})}),e5=G.object({name:G.string().optional()}).passthrough(),vX=G.object({hints:G.optional(G.array(e5)),costPriority:G.optional(G.number().min(0).max(1)),speedPriority:G.optional(G.number().min(0).max(1)),intelligencePriority:G.optional(G.number().min(0).max(1))}).passthrough(),fX=G.object({role:G.enum(["user","assistant"]),content:G.union([n0,p0,i0])}).passthrough(),QX=Tv.extend({method:G.literal("sampling/createMessage"),params:pv.extend({messages:G.array(fX),systemPrompt:G.optional(G.string()),includeContext:G.optional(G.enum(["none","thisServer","allServers"])),temperature:G.optional(G.number()),maxTokens:G.number().int(),stopSequences:G.optional(G.array(G.string())),metadata:G.optional(G.object({}).passthrough()),modelPreferences:G.optional(vX)})}),o0=iv.extend({model:G.string(),stopReason:G.optional(G.enum(["endTurn","stopSequence","maxTokens"]).or(G.string())),role:G.enum(["user","assistant"]),content:G.discriminatedUnion("type",[n0,p0,i0])}),WX=G.object({type:G.literal("boolean"),title:G.optional(G.string()),description:G.optional(G.string()),default:G.optional(G.boolean())}).passthrough(),JX=G.object({type:G.literal("string"),title:G.optional(G.string()),description:G.optional(G.string()),minLength:G.optional(G.number()),maxLength:G.optional(G.number()),format:G.optional(G.enum(["email","uri","date","date-time"]))}).passthrough(),XX=G.object({type:G.enum(["number","integer"]),title:G.optional(G.string()),description:G.optional(G.string()),minimum:G.optional(G.number()),maximum:G.optional(G.number())}).passthrough(),YX=G.object({type:G.literal("string"),title:G.optional(G.string()),description:G.optional(G.string()),enum:G.array(G.string()),enumNames:G.optional(G.array(G.string()))}).passthrough(),wX=G.union([WX,JX,XX,YX]),GX=Tv.extend({method:G.literal("elicitation/create"),params:pv.extend({message:G.string(),requestedSchema:G.object({type:G.literal("object"),properties:G.record(G.string(),wX),required:G.optional(G.array(G.string()))}).passthrough()})}),s0=iv.extend({action:G.enum(["accept","decline","cancel"]),content:G.optional(G.record(G.string(),G.unknown()))}),BX=G.object({type:G.literal("ref/resource"),uri:G.string()}).passthrough();var qX=G.object({type:G.literal("ref/prompt"),name:G.string()}).passthrough(),W0=Tv.extend({method:G.literal("completion/complete"),params:pv.extend({ref:G.union([qX,BX]),argument:G.object({name:G.string(),value:G.string()}).passthrough(),context:G.optional(G.object({arguments:G.optional(G.record(G.string(),G.string()))}))})}),PX=iv.extend({completion:G.object({values:G.array(G.string()).max(100),total:G.optional(G.number().int()),hasMore:G.optional(G.boolean())}).passthrough()}),HX=G.object({uri:G.string().startsWith("file://"),name:G.optional(G.string()),_meta:G.optional(G.object({}).passthrough())}).passthrough(),KX=Tv.extend({method:G.literal("roots/list")}),t0=iv.extend({roots:G.array(HX)}),zX=qf.extend({method:G.literal("notifications/roots/list_changed")}),i2=G.union([n1,m0,W0,d0,v0,e1,o1,s1,t1,Z5,C5,Q0,f0]),d2=G.union([c1,p1,a0,zX]),o2=G.union([a1,o0,s0,t0]),s2=G.union([n1,QX,GX,KX]),t2=G.union([c1,p1,t5,T5,I5,s5,p5]),e2=G.union([a1,_5,PX,n5,r5,S5,y5,l5,b8,o5]);class Kv extends Error{constructor(f,v,W){super(`MCP error ${f}: ${v}`);this.code=f,this.data=W,this.name="McpError"}}var LX=60000;class e0{constructor(f){this._options=f,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(c1,(v)=>{let W=this._requestHandlerAbortControllers.get(v.params.requestId);W===null||W===void 0||W.abort(v.params.reason)}),this.setNotificationHandler(p1,(v)=>{this._onprogress(v)}),this.setRequestHandler(n1,(v)=>({}))}_setupTimeout(f,v,W,J,Q=!1){this._timeoutInfo.set(f,{timeoutId:setTimeout(J,v),startTime:Date.now(),timeout:v,maxTotalTimeout:W,resetTimeoutOnProgress:Q,onTimeout:J})}_resetTimeout(f){let v=this._timeoutInfo.get(f);if(!v)return!1;let W=Date.now()-v.startTime;if(v.maxTotalTimeout&&W>=v.maxTotalTimeout)throw this._timeoutInfo.delete(f),new Kv(Hv.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:v.maxTotalTimeout,totalElapsed:W});return clearTimeout(v.timeoutId),v.timeoutId=setTimeout(v.onTimeout,v.timeout),!0}_cleanupTimeout(f){let v=this._timeoutInfo.get(f);if(v)clearTimeout(v.timeoutId),this._timeoutInfo.delete(f)}async connect(f){var v,W,J;this._transport=f;let Q=(v=this.transport)===null||v===void 0?void 0:v.onclose;this._transport.onclose=()=>{Q===null||Q===void 0||Q(),this._onclose()};let X=(W=this.transport)===null||W===void 0?void 0:W.onerror;this._transport.onerror=(w)=>{X===null||X===void 0||X(w),this._onerror(w)};let Y=(J=this._transport)===null||J===void 0?void 0:J.onmessage;this._transport.onmessage=(w,B)=>{if(Y===null||Y===void 0||Y(w,B),r0(w)||D8(w))this._onresponse(w);else if($8(w))this._onrequest(w,B);else if(N8(w))this._onnotification(w);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(w)}`))},await this._transport.start()}_onclose(){var f;let v=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(f=this.onclose)===null||f===void 0||f.call(this);let W=new Kv(Hv.ConnectionClosed,"Connection closed");for(let J of v.values())J(W)}_onerror(f){var v;(v=this.onerror)===null||v===void 0||v.call(this,f)}_onnotification(f){var v;let W=(v=this._notificationHandlers.get(f.method))!==null&&v!==void 0?v:this.fallbackNotificationHandler;if(W===void 0)return;Promise.resolve().then(()=>W(f)).catch((J)=>this._onerror(new Error(`Uncaught error in notification handler: ${J}`)))}_onrequest(f,v){var W,J;let Q=(W=this._requestHandlers.get(f.method))!==null&&W!==void 0?W:this.fallbackRequestHandler,X=this._transport;if(Q===void 0){X===null||X===void 0||X.send({jsonrpc:"2.0",id:f.id,error:{code:Hv.MethodNotFound,message:"Method not found"}}).catch((B)=>this._onerror(new Error(`Failed to send an error response: ${B}`)));return}let Y=new AbortController;this._requestHandlerAbortControllers.set(f.id,Y);let w={signal:Y.signal,sessionId:X===null||X===void 0?void 0:X.sessionId,_meta:(J=f.params)===null||J===void 0?void 0:J._meta,sendNotification:(B)=>this.notification(B,{relatedRequestId:f.id}),sendRequest:(B,z,H)=>this.request(B,z,{...H,relatedRequestId:f.id}),authInfo:v===null||v===void 0?void 0:v.authInfo,requestId:f.id,requestInfo:v===null||v===void 0?void 0:v.requestInfo};Promise.resolve().then(()=>Q(f,w)).then((B)=>{if(Y.signal.aborted)return;return X===null||X===void 0?void 0:X.send({result:B,jsonrpc:"2.0",id:f.id})},(B)=>{var z;if(Y.signal.aborted)return;return X===null||X===void 0?void 0:X.send({jsonrpc:"2.0",id:f.id,error:{code:Number.isSafeInteger(B.code)?B.code:Hv.InternalError,message:(z=B.message)!==null&&z!==void 0?z:"Internal error"}})}).catch((B)=>this._onerror(new Error(`Failed to send response: ${B}`))).finally(()=>{this._requestHandlerAbortControllers.delete(f.id)})}_onprogress(f){let{progressToken:v,...W}=f.params,J=Number(v),Q=this._progressHandlers.get(J);if(!Q){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(f)}`));return}let X=this._responseHandlers.get(J),Y=this._timeoutInfo.get(J);if(Y&&X&&Y.resetTimeoutOnProgress)try{this._resetTimeout(J)}catch(w){X(w);return}Q(W)}_onresponse(f){let v=Number(f.id),W=this._responseHandlers.get(v);if(W===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(f)}`));return}if(this._responseHandlers.delete(v),this._progressHandlers.delete(v),this._cleanupTimeout(v),r0(f))W(f);else{let J=new Kv(f.error.code,f.error.message,f.error.data);W(J)}}get transport(){return this._transport}async close(){var f;await((f=this._transport)===null||f===void 0?void 0:f.close())}request(f,v,W){let{relatedRequestId:J,resumptionToken:Q,onresumptiontoken:X}=W!==null&&W!==void 0?W:{};return new Promise((Y,w)=>{var B,z,H,$,K,q;if(!this._transport){w(new Error("Not connected"));return}if(((B=this._options)===null||B===void 0?void 0:B.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod(f.method);(z=W===null||W===void 0?void 0:W.signal)===null||z===void 0||z.throwIfAborted();let L=this._requestMessageId++,V={...f,jsonrpc:"2.0",id:L};if(W===null||W===void 0?void 0:W.onprogress)this._progressHandlers.set(L,W.onprogress),V.params={...f.params,_meta:{...((H=f.params)===null||H===void 0?void 0:H._meta)||{},progressToken:L}};let M=(F)=>{var Z;this._responseHandlers.delete(L),this._progressHandlers.delete(L),this._cleanupTimeout(L),(Z=this._transport)===null||Z===void 0||Z.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:L,reason:String(F)}},{relatedRequestId:J,resumptionToken:Q,onresumptiontoken:X}).catch((C)=>this._onerror(new Error(`Failed to send cancellation: ${C}`))),w(F)};this._responseHandlers.set(L,(F)=>{var Z;if((Z=W===null||W===void 0?void 0:W.signal)===null||Z===void 0?void 0:Z.aborted)return;if(F instanceof Error)return w(F);try{let C=v.parse(F.result);Y(C)}catch(C){w(C)}}),($=W===null||W===void 0?void 0:W.signal)===null||$===void 0||$.addEventListener("abort",()=>{var F;M((F=W===null||W===void 0?void 0:W.signal)===null||F===void 0?void 0:F.reason)});let D=(K=W===null||W===void 0?void 0:W.timeout)!==null&&K!==void 0?K:LX,y=()=>M(new Kv(Hv.RequestTimeout,"Request timed out",{timeout:D}));this._setupTimeout(L,D,W===null||W===void 0?void 0:W.maxTotalTimeout,y,(q=W===null||W===void 0?void 0:W.resetTimeoutOnProgress)!==null&&q!==void 0?q:!1),this._transport.send(V,{relatedRequestId:J,resumptionToken:Q,onresumptiontoken:X}).catch((F)=>{this._cleanupTimeout(L),w(F)})})}async notification(f,v){var W,J;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(f.method),((J=(W=this._options)===null||W===void 0?void 0:W.debouncedNotificationMethods)!==null&&J!==void 0?J:[]).includes(f.method)&&!f.params&&!(v===null||v===void 0?void 0:v.relatedRequestId)){if(this._pendingDebouncedNotifications.has(f.method))return;this._pendingDebouncedNotifications.add(f.method),Promise.resolve().then(()=>{var w;if(this._pendingDebouncedNotifications.delete(f.method),!this._transport)return;let B={...f,jsonrpc:"2.0"};(w=this._transport)===null||w===void 0||w.send(B,v).catch((z)=>this._onerror(z))});return}let Y={...f,jsonrpc:"2.0"};await this._transport.send(Y,v)}setRequestHandler(f,v){let W=f.shape.method.value;this.assertRequestHandlerCapability(W),this._requestHandlers.set(W,(J,Q)=>{return Promise.resolve(v(f.parse(J),Q))})}removeRequestHandler(f){this._requestHandlers.delete(f)}assertCanSetRequestHandler(f){if(this._requestHandlers.has(f))throw new Error(`A request handler for ${f} already exists, which would be overridden`)}setNotificationHandler(f,v){this._notificationHandlers.set(f.shape.method.value,(W)=>Promise.resolve(v(f.parse(W))))}removeNotificationHandler(f){this._notificationHandlers.delete(f)}}function _8(f,v){return Object.entries(v).reduce((W,[J,Q])=>{if(Q&&typeof Q==="object")W[J]=W[J]?{...W[J],...Q}:Q;else W[J]=Q;return W},{...f})}var k9=L6(R9(),1);class UQ extends e0{constructor(f,v){var W;super(v);if(this._serverInfo=f,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(_1.options.map((J,Q)=>[J,Q])),this.isMessageIgnored=(J,Q)=>{let X=this._loggingLevels.get(Q);return X?this.LOG_LEVEL_SEVERITY.get(J)<this.LOG_LEVEL_SEVERITY.get(X):!1},this._capabilities=(W=v===null||v===void 0?void 0:v.capabilities)!==null&&W!==void 0?W:{},this._instructions=v===null||v===void 0?void 0:v.instructions,this.setRequestHandler(m0,(J)=>this._oninitialize(J)),this.setNotificationHandler(a0,()=>{var J;return(J=this.oninitialized)===null||J===void 0?void 0:J.call(this)}),this._capabilities.logging)this.setRequestHandler(d0,async(J,Q)=>{var X;let Y=Q.sessionId||((X=Q.requestInfo)===null||X===void 0?void 0:X.headers["mcp-session-id"])||void 0,{level:w}=J.params,B=_1.safeParse(w);if(B.success)this._loggingLevels.set(Y,B.data);return{}})}registerCapabilities(f){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=_8(this._capabilities,f)}assertCapabilityForMethod(f){var v,W,J;switch(f){case"sampling/createMessage":if(!((v=this._clientCapabilities)===null||v===void 0?void 0:v.sampling))throw new Error(`Client does not support sampling (required for ${f})`);break;case"elicitation/create":if(!((W=this._clientCapabilities)===null||W===void 0?void 0:W.elicitation))throw new Error(`Client does not support elicitation (required for ${f})`);break;case"roots/list":if(!((J=this._clientCapabilities)===null||J===void 0?void 0:J.roots))throw new Error(`Client does not support listing roots (required for ${f})`);break;case"ping":break}}assertNotificationCapability(f){switch(f){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${f})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${f})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${f})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${f})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(f){switch(f){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${f})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${f})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${f})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${f})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${f})`);break;case"ping":case"initialize":break}}async _oninitialize(f){let v=f.params.protocolVersion;return this._clientCapabilities=f.params.capabilities,this._clientVersion=f.params.clientInfo,{protocolVersion:H8.includes(v)?v:u0,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},a1)}async createMessage(f,v){return this.request({method:"sampling/createMessage",params:f},o0,v)}async elicitInput(f,v){let W=await this.request({method:"elicitation/create",params:f},s0,v);if(W.action==="accept"&&W.content)try{let J=new k9.default,Q=J.compile(f.requestedSchema);if(!Q(W.content))throw new Kv(Hv.InvalidParams,`Elicitation response content does not match requested schema: ${J.errorsText(Q.errors)}`)}catch(J){if(J instanceof Kv)throw J;throw new Kv(Hv.InternalError,`Error validating elicitation response: ${J}`)}return W}async listRoots(f,v){return this.request({method:"roots/list",params:f},t0,v)}async sendLoggingMessage(f,v){if(this._capabilities.logging){if(!this.isMessageIgnored(f.level,v))return this.notification({method:"notifications/message",params:f})}}async sendResourceUpdated(f){return this.notification({method:"notifications/resources/updated",params:f})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var y9=Symbol("Let zodToJsonSchema decide on which parser to use");var S9={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},l9=(f)=>typeof f==="string"?{...S9,name:f}:{...S9,...f};var I9=(f)=>{let v=l9(f),W=v.name!==void 0?[...v.basePath,v.definitionPath,v.name]:v.basePath;return{...v,flags:{hasReferencedOpenAiAnyType:!1},currentPath:W,propertyPath:void 0,seen:new Map(Object.entries(v.definitions).map(([J,Q])=>[Q._def,{def:Q._def,path:[...v.basePath,v.definitionPath,J],jsonSchema:void 0}]))}};function hQ(f,v,W,J){if(!J?.errorMessages)return;if(W)f.errorMessage={...f.errorMessage,[v]:W}}function Qv(f,v,W,J,Q){f[v]=W,hQ(f,v,J,Q)}var j0=(f,v)=>{let W=0;for(;W<f.length&&W<v.length;W++)if(f[W]!==v[W])break;return[(f.length-W).toString(),...v.slice(W)].join("/")};function Lv(f){if(f.target!=="openAi")return{};let v=[...f.basePath,f.definitionPath,f.openAiAnyTypeName];return f.flags.hasReferencedOpenAiAnyType=!0,{$ref:f.$refStrategy==="relative"?j0(v,f.currentPath):v.join("/")}}function Z9(f,v){let W={type:"array"};if(f.type?._def&&f.type?._def?.typeName!==I.ZodAny)W.items=i(f.type._def,{...v,currentPath:[...v.currentPath,"items"]});if(f.minLength)Qv(W,"minItems",f.minLength.value,f.minLength.message,v);if(f.maxLength)Qv(W,"maxItems",f.maxLength.value,f.maxLength.message,v);if(f.exactLength)Qv(W,"minItems",f.exactLength.value,f.exactLength.message,v),Qv(W,"maxItems",f.exactLength.value,f.exactLength.message,v);return W}function C9(f,v){let W={type:"integer",format:"int64"};if(!f.checks)return W;for(let J of f.checks)switch(J.kind){case"min":if(v.target==="jsonSchema7")if(J.inclusive)Qv(W,"minimum",J.value,J.message,v);else Qv(W,"exclusiveMinimum",J.value,J.message,v);else{if(!J.inclusive)W.exclusiveMinimum=!0;Qv(W,"minimum",J.value,J.message,v)}break;case"max":if(v.target==="jsonSchema7")if(J.inclusive)Qv(W,"maximum",J.value,J.message,v);else Qv(W,"exclusiveMaximum",J.value,J.message,v);else{if(!J.inclusive)W.exclusiveMaximum=!0;Qv(W,"maximum",J.value,J.message,v)}break;case"multipleOf":Qv(W,"multipleOf",J.value,J.message,v);break}return W}function T9(){return{type:"boolean"}}function O0(f,v){return i(f.type._def,v)}var x9=(f,v)=>{return i(f.innerType._def,v)};function FQ(f,v,W){let J=W??v.dateStrategy;if(Array.isArray(J))return{anyOf:J.map((Q,X)=>FQ(f,v,Q))};switch(J){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return iY(f,v)}}var iY=(f,v)=>{let W={type:"integer",format:"unix-time"};if(v.target==="openApi3")return W;for(let J of f.checks)switch(J.kind){case"min":Qv(W,"minimum",J.value,J.message,v);break;case"max":Qv(W,"maximum",J.value,J.message,v);break}return W};function u9(f,v){return{...i(f.innerType._def,v),default:f.defaultValue()}}function r9(f,v){return v.effectStrategy==="input"?i(f.schema._def,v):Lv(v)}function m9(f){return{type:"string",enum:Array.from(f.values)}}var dY=(f)=>{if("type"in f&&f.type==="string")return!1;return"allOf"in f};function a9(f,v){let W=[i(f.left._def,{...v,currentPath:[...v.currentPath,"allOf","0"]}),i(f.right._def,{...v,currentPath:[...v.currentPath,"allOf","1"]})].filter((X)=>!!X),J=v.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,Q=[];return W.forEach((X)=>{if(dY(X)){if(Q.push(...X.allOf),X.unevaluatedProperties===void 0)J=void 0}else{let Y=X;if("additionalProperties"in X&&X.additionalProperties===!1){let{additionalProperties:w,...B}=X;Y=B}else J=void 0;Q.push(Y)}}),Q.length?{allOf:Q,...J}:void 0}function c9(f,v){let W=typeof f.value;if(W!=="bigint"&&W!=="number"&&W!=="boolean"&&W!=="string")return{type:Array.isArray(f.value)?"array":"object"};if(v.target==="openApi3")return{type:W==="bigint"?"integer":W,enum:[f.value]};return{type:W==="bigint"?"integer":W,const:f.value}}var gQ=void 0,ff={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(gQ===void 0)gQ=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return gQ},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function U0(f,v){let W={type:"string"};if(f.checks)for(let J of f.checks)switch(J.kind){case"min":Qv(W,"minLength",typeof W.minLength==="number"?Math.max(W.minLength,J.value):J.value,J.message,v);break;case"max":Qv(W,"maxLength",typeof W.maxLength==="number"?Math.min(W.maxLength,J.value):J.value,J.message,v);break;case"email":switch(v.emailStrategy){case"format:email":Qf(W,"email",J.message,v);break;case"format:idn-email":Qf(W,"idn-email",J.message,v);break;case"pattern:zod":Iv(W,ff.email,J.message,v);break}break;case"url":Qf(W,"uri",J.message,v);break;case"uuid":Qf(W,"uuid",J.message,v);break;case"regex":Iv(W,J.regex,J.message,v);break;case"cuid":Iv(W,ff.cuid,J.message,v);break;case"cuid2":Iv(W,ff.cuid2,J.message,v);break;case"startsWith":Iv(W,RegExp(`^${AQ(J.value,v)}`),J.message,v);break;case"endsWith":Iv(W,RegExp(`${AQ(J.value,v)}$`),J.message,v);break;case"datetime":Qf(W,"date-time",J.message,v);break;case"date":Qf(W,"date",J.message,v);break;case"time":Qf(W,"time",J.message,v);break;case"duration":Qf(W,"duration",J.message,v);break;case"length":Qv(W,"minLength",typeof W.minLength==="number"?Math.max(W.minLength,J.value):J.value,J.message,v),Qv(W,"maxLength",typeof W.maxLength==="number"?Math.min(W.maxLength,J.value):J.value,J.message,v);break;case"includes":{Iv(W,RegExp(AQ(J.value,v)),J.message,v);break}case"ip":{if(J.version!=="v6")Qf(W,"ipv4",J.message,v);if(J.version!=="v4")Qf(W,"ipv6",J.message,v);break}case"base64url":Iv(W,ff.base64url,J.message,v);break;case"jwt":Iv(W,ff.jwt,J.message,v);break;case"cidr":{if(J.version!=="v6")Iv(W,ff.ipv4Cidr,J.message,v);if(J.version!=="v4")Iv(W,ff.ipv6Cidr,J.message,v);break}case"emoji":Iv(W,ff.emoji(),J.message,v);break;case"ulid":{Iv(W,ff.ulid,J.message,v);break}case"base64":{switch(v.base64Strategy){case"format:binary":{Qf(W,"binary",J.message,v);break}case"contentEncoding:base64":{Qv(W,"contentEncoding","base64",J.message,v);break}case"pattern:zod":{Iv(W,ff.base64,J.message,v);break}}break}case"nanoid":Iv(W,ff.nanoid,J.message,v);case"toLowerCase":case"toUpperCase":case"trim":break;default:((Q)=>{})(J)}return W}function AQ(f,v){return v.patternStrategy==="escape"?sY(f):f}var oY=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function sY(f){let v="";for(let W=0;W<f.length;W++){if(!oY.has(f[W]))v+="\\";v+=f[W]}return v}function Qf(f,v,W,J){if(f.format||f.anyOf?.some((Q)=>Q.format)){if(!f.anyOf)f.anyOf=[];if(f.format){if(f.anyOf.push({format:f.format,...f.errorMessage&&J.errorMessages&&{errorMessage:{format:f.errorMessage.format}}}),delete f.format,f.errorMessage){if(delete f.errorMessage.format,Object.keys(f.errorMessage).length===0)delete f.errorMessage}}f.anyOf.push({format:v,...W&&J.errorMessages&&{errorMessage:{format:W}}})}else Qv(f,"format",v,W,J)}function Iv(f,v,W,J){if(f.pattern||f.allOf?.some((Q)=>Q.pattern)){if(!f.allOf)f.allOf=[];if(f.pattern){if(f.allOf.push({pattern:f.pattern,...f.errorMessage&&J.errorMessages&&{errorMessage:{pattern:f.errorMessage.pattern}}}),delete f.pattern,f.errorMessage){if(delete f.errorMessage.pattern,Object.keys(f.errorMessage).length===0)delete f.errorMessage}}f.allOf.push({pattern:n9(v,J),...W&&J.errorMessages&&{errorMessage:{pattern:W}}})}else Qv(f,"pattern",n9(v,J),W,J)}function n9(f,v){if(!v.applyRegexFlags||!f.flags)return f.source;let W={i:f.flags.includes("i"),m:f.flags.includes("m"),s:f.flags.includes("s")},J=W.i?f.source.toLowerCase():f.source,Q="",X=!1,Y=!1,w=!1;for(let B=0;B<J.length;B++){if(X){Q+=J[B],X=!1;continue}if(W.i){if(Y){if(J[B].match(/[a-z]/)){if(w)Q+=J[B],Q+=`${J[B-2]}-${J[B]}`.toUpperCase(),w=!1;else if(J[B+1]==="-"&&J[B+2]?.match(/[a-z]/))Q+=J[B],w=!0;else Q+=`${J[B]}${J[B].toUpperCase()}`;continue}}else if(J[B].match(/[a-z]/)){Q+=`[${J[B]}${J[B].toUpperCase()}]`;continue}}if(W.m){if(J[B]==="^"){Q+=`(^|(?<=[\r
|
|
9
|
-
]))`;continue}else if(J[B]==="$"){Q+=`($|(?=[\r
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
]`;continue}if(Q+=J[B],J[B]==="\\")X=!0;else if(Y&&J[B]==="]")Y=!1;else if(!Y&&J[B]==="[")Y=!0}try{new RegExp(Q)}catch{return console.warn(`Could not convert regex pattern at ${v.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),f.source}return Q}function h0(f,v){if(v.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(v.target==="openApi3"&&f.keyType?._def.typeName===I.ZodEnum)return{type:"object",required:f.keyType._def.values,properties:f.keyType._def.values.reduce((J,Q)=>({...J,[Q]:i(f.valueType._def,{...v,currentPath:[...v.currentPath,"properties",Q]})??Lv(v)}),{}),additionalProperties:v.rejectedAdditionalProperties};let W={type:"object",additionalProperties:i(f.valueType._def,{...v,currentPath:[...v.currentPath,"additionalProperties"]})??v.allowedAdditionalProperties};if(v.target==="openApi3")return W;if(f.keyType?._def.typeName===I.ZodString&&f.keyType._def.checks?.length){let{type:J,...Q}=U0(f.keyType._def,v);return{...W,propertyNames:Q}}else if(f.keyType?._def.typeName===I.ZodEnum)return{...W,propertyNames:{enum:f.keyType._def.values}};else if(f.keyType?._def.typeName===I.ZodBranded&&f.keyType._def.type._def.typeName===I.ZodString&&f.keyType._def.type._def.checks?.length){let{type:J,...Q}=O0(f.keyType._def,v);return{...W,propertyNames:Q}}return W}function p9(f,v){if(v.mapStrategy==="record")return h0(f,v);let W=i(f.keyType._def,{...v,currentPath:[...v.currentPath,"items","items","0"]})||Lv(v),J=i(f.valueType._def,{...v,currentPath:[...v.currentPath,"items","items","1"]})||Lv(v);return{type:"array",maxItems:125,items:{type:"array",items:[W,J],minItems:2,maxItems:2}}}function i9(f){let v=f.values,J=Object.keys(f.values).filter((X)=>{return typeof v[v[X]]!=="number"}).map((X)=>v[X]),Q=Array.from(new Set(J.map((X)=>typeof X)));return{type:Q.length===1?Q[0]==="string"?"string":"number":["string","number"],enum:J}}function d9(f){return f.target==="openAi"?void 0:{not:Lv({...f,currentPath:[...f.currentPath,"not"]})}}function o9(f){return f.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var k1={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function t9(f,v){if(v.target==="openApi3")return s9(f,v);let W=f.options instanceof Map?Array.from(f.options.values()):f.options;if(W.every((J)=>(J._def.typeName in k1)&&(!J._def.checks||!J._def.checks.length))){let J=W.reduce((Q,X)=>{let Y=k1[X._def.typeName];return Y&&!Q.includes(Y)?[...Q,Y]:Q},[]);return{type:J.length>1?J:J[0]}}else if(W.every((J)=>J._def.typeName==="ZodLiteral"&&!J.description)){let J=W.reduce((Q,X)=>{let Y=typeof X._def.value;switch(Y){case"string":case"number":case"boolean":return[...Q,Y];case"bigint":return[...Q,"integer"];case"object":if(X._def.value===null)return[...Q,"null"];case"symbol":case"undefined":case"function":default:return Q}},[]);if(J.length===W.length){let Q=J.filter((X,Y,w)=>w.indexOf(X)===Y);return{type:Q.length>1?Q:Q[0],enum:W.reduce((X,Y)=>{return X.includes(Y._def.value)?X:[...X,Y._def.value]},[])}}}else if(W.every((J)=>J._def.typeName==="ZodEnum"))return{type:"string",enum:W.reduce((J,Q)=>[...J,...Q._def.values.filter((X)=>!J.includes(X))],[])};return s9(f,v)}var s9=(f,v)=>{let W=(f.options instanceof Map?Array.from(f.options.values()):f.options).map((J,Q)=>i(J._def,{...v,currentPath:[...v.currentPath,"anyOf",`${Q}`]})).filter((J)=>!!J&&(!v.strictUnions||typeof J==="object"&&Object.keys(J).length>0));return W.length?{anyOf:W}:void 0};function e9(f,v){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(f.innerType._def.typeName)&&(!f.innerType._def.checks||!f.innerType._def.checks.length)){if(v.target==="openApi3")return{type:k1[f.innerType._def.typeName],nullable:!0};return{type:[k1[f.innerType._def.typeName],"null"]}}if(v.target==="openApi3"){let J=i(f.innerType._def,{...v,currentPath:[...v.currentPath]});if(J&&"$ref"in J)return{allOf:[J],nullable:!0};return J&&{...J,nullable:!0}}let W=i(f.innerType._def,{...v,currentPath:[...v.currentPath,"anyOf","0"]});return W&&{anyOf:[W,{type:"null"}]}}function vJ(f,v){let W={type:"number"};if(!f.checks)return W;for(let J of f.checks)switch(J.kind){case"int":W.type="integer",hQ(W,"type",J.message,v);break;case"min":if(v.target==="jsonSchema7")if(J.inclusive)Qv(W,"minimum",J.value,J.message,v);else Qv(W,"exclusiveMinimum",J.value,J.message,v);else{if(!J.inclusive)W.exclusiveMinimum=!0;Qv(W,"minimum",J.value,J.message,v)}break;case"max":if(v.target==="jsonSchema7")if(J.inclusive)Qv(W,"maximum",J.value,J.message,v);else Qv(W,"exclusiveMaximum",J.value,J.message,v);else{if(!J.inclusive)W.exclusiveMaximum=!0;Qv(W,"maximum",J.value,J.message,v)}break;case"multipleOf":Qv(W,"multipleOf",J.value,J.message,v);break}return W}function fJ(f,v){let W=v.target==="openAi",J={type:"object",properties:{}},Q=[],X=f.shape();for(let w in X){let B=X[w];if(B===void 0||B._def===void 0)continue;let z=eY(B);if(z&&W){if(B._def.typeName==="ZodOptional")B=B._def.innerType;if(!B.isNullable())B=B.nullable();z=!1}let H=i(B._def,{...v,currentPath:[...v.currentPath,"properties",w],propertyPath:[...v.currentPath,"properties",w]});if(H===void 0)continue;if(J.properties[w]=H,!z)Q.push(w)}if(Q.length)J.required=Q;let Y=tY(f,v);if(Y!==void 0)J.additionalProperties=Y;return J}function tY(f,v){if(f.catchall._def.typeName!=="ZodNever")return i(f.catchall._def,{...v,currentPath:[...v.currentPath,"additionalProperties"]});switch(f.unknownKeys){case"passthrough":return v.allowedAdditionalProperties;case"strict":return v.rejectedAdditionalProperties;case"strip":return v.removeAdditionalStrategy==="strict"?v.allowedAdditionalProperties:v.rejectedAdditionalProperties}}function eY(f){try{return f.isOptional()}catch{return!0}}var QJ=(f,v)=>{if(v.currentPath.toString()===v.propertyPath?.toString())return i(f.innerType._def,v);let W=i(f.innerType._def,{...v,currentPath:[...v.currentPath,"anyOf","1"]});return W?{anyOf:[{not:Lv(v)},W]}:Lv(v)};var WJ=(f,v)=>{if(v.pipeStrategy==="input")return i(f.in._def,v);else if(v.pipeStrategy==="output")return i(f.out._def,v);let W=i(f.in._def,{...v,currentPath:[...v.currentPath,"allOf","0"]}),J=i(f.out._def,{...v,currentPath:[...v.currentPath,"allOf",W?"1":"0"]});return{allOf:[W,J].filter((Q)=>Q!==void 0)}};function JJ(f,v){return i(f.type._def,v)}function XJ(f,v){let J={type:"array",uniqueItems:!0,items:i(f.valueType._def,{...v,currentPath:[...v.currentPath,"items"]})};if(f.minSize)Qv(J,"minItems",f.minSize.value,f.minSize.message,v);if(f.maxSize)Qv(J,"maxItems",f.maxSize.value,f.maxSize.message,v);return J}function YJ(f,v){if(f.rest)return{type:"array",minItems:f.items.length,items:f.items.map((W,J)=>i(W._def,{...v,currentPath:[...v.currentPath,"items",`${J}`]})).reduce((W,J)=>J===void 0?W:[...W,J],[]),additionalItems:i(f.rest._def,{...v,currentPath:[...v.currentPath,"additionalItems"]})};else return{type:"array",minItems:f.items.length,maxItems:f.items.length,items:f.items.map((W,J)=>i(W._def,{...v,currentPath:[...v.currentPath,"items",`${J}`]})).reduce((W,J)=>J===void 0?W:[...W,J],[])}}function wJ(f){return{not:Lv(f)}}function GJ(f){return Lv(f)}var BJ=(f,v)=>{return i(f.innerType._def,v)};var qJ=(f,v,W)=>{switch(v){case I.ZodString:return U0(f,W);case I.ZodNumber:return vJ(f,W);case I.ZodObject:return fJ(f,W);case I.ZodBigInt:return C9(f,W);case I.ZodBoolean:return T9();case I.ZodDate:return FQ(f,W);case I.ZodUndefined:return wJ(W);case I.ZodNull:return o9(W);case I.ZodArray:return Z9(f,W);case I.ZodUnion:case I.ZodDiscriminatedUnion:return t9(f,W);case I.ZodIntersection:return a9(f,W);case I.ZodTuple:return YJ(f,W);case I.ZodRecord:return h0(f,W);case I.ZodLiteral:return c9(f,W);case I.ZodEnum:return m9(f);case I.ZodNativeEnum:return i9(f);case I.ZodNullable:return e9(f,W);case I.ZodOptional:return QJ(f,W);case I.ZodMap:return p9(f,W);case I.ZodSet:return XJ(f,W);case I.ZodLazy:return()=>f.getter()._def;case I.ZodPromise:return JJ(f,W);case I.ZodNaN:case I.ZodNever:return d9(W);case I.ZodEffects:return r9(f,W);case I.ZodAny:return Lv(W);case I.ZodUnknown:return GJ(W);case I.ZodDefault:return u9(f,W);case I.ZodBranded:return O0(f,W);case I.ZodReadonly:return BJ(f,W);case I.ZodCatch:return x9(f,W);case I.ZodPipeline:return WJ(f,W);case I.ZodFunction:case I.ZodVoid:case I.ZodSymbol:return;default:return((J)=>{return})(v)}};function i(f,v,W=!1){let J=v.seen.get(f);if(v.override){let w=v.override?.(f,v,J,W);if(w!==y9)return w}if(J&&!W){let w=v7(J,v);if(w!==void 0)return w}let Q={def:f,path:v.currentPath,jsonSchema:void 0};v.seen.set(f,Q);let X=qJ(f,f.typeName,v),Y=typeof X==="function"?i(X(),v):X;if(Y)f7(f,v,Y);if(v.postProcess){let w=v.postProcess(Y,f,v);return Q.jsonSchema=Y,w}return Q.jsonSchema=Y,Y}var v7=(f,v)=>{switch(v.$refStrategy){case"root":return{$ref:f.path.join("/")};case"relative":return{$ref:j0(v.currentPath,f.path)};case"none":case"seen":{if(f.path.length<v.currentPath.length&&f.path.every((W,J)=>v.currentPath[J]===W))return console.warn(`Recursive reference detected at ${v.currentPath.join("/")}! Defaulting to any`),Lv(v);return v.$refStrategy==="seen"?Lv(v):void 0}}},f7=(f,v,W)=>{if(f.description){if(W.description=f.description,v.markdownDescription)W.markdownDescription=f.description}return W};var F0=(f,v)=>{let W=I9(v),J=typeof v==="object"&&v.definitions?Object.entries(v.definitions).reduce((B,[z,H])=>({...B,[z]:i(H._def,{...W,currentPath:[...W.basePath,W.definitionPath,z]},!0)??Lv(W)}),{}):void 0,Q=typeof v==="string"?v:v?.nameStrategy==="title"?void 0:v?.name,X=i(f._def,Q===void 0?W:{...W,currentPath:[...W.basePath,W.definitionPath,Q]},!1)??Lv(W),Y=typeof v==="object"&&v.name!==void 0&&v.nameStrategy==="title"?v.name:void 0;if(Y!==void 0)X.title=Y;if(W.flags.hasReferencedOpenAiAnyType){if(!J)J={};if(!J[W.openAiAnyTypeName])J[W.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:W.$refStrategy==="relative"?"1":[...W.basePath,W.definitionPath,W.openAiAnyTypeName].join("/")}}}let w=Q===void 0?J?{...X,[W.definitionPath]:J}:X:{$ref:[...W.$refStrategy==="relative"?[]:W.basePath,W.definitionPath,Q].join("/"),[W.definitionPath]:{...J,[Q]:X}};if(W.target==="jsonSchema7")w.$schema="http://json-schema.org/draft-07/schema#";else if(W.target==="jsonSchema2019-09"||W.target==="openAi")w.$schema="https://json-schema.org/draft/2019-09/schema#";if(W.target==="openAi"&&(("anyOf"in w)||("oneOf"in w)||("allOf"in w)||("type"in w)&&Array.isArray(w.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return w};var bQ;(function(f){f.Completable="McpCompletable"})(bQ||(bQ={}));class S1 extends vv{_parse(f){let{ctx:v}=this._processInputParams(f),W=v.data;return this._def.type._parse({data:W,path:v.path,parent:v})}unwrap(){return this._def.type}}S1.create=(f,v)=>{return new S1({type:f,typeName:bQ.Completable,complete:v.complete,...Q7(v)})};function Q7(f){if(!f)return{};let{errorMap:v,invalid_type_error:W,required_error:J,description:Q}=f;if(v&&(W||J))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(v)return{errorMap:v,description:Q};return{errorMap:(Y,w)=>{var B,z;let{message:H}=f;if(Y.code==="invalid_enum_value")return{message:H!==null&&H!==void 0?H:w.defaultError};if(typeof w.data==="undefined")return{message:(B=H!==null&&H!==void 0?H:J)!==null&&B!==void 0?B:w.defaultError};if(Y.code!=="invalid_type")return{message:w.defaultError};return{message:(z=H!==null&&H!==void 0?H:W)!==null&&z!==void 0?z:w.defaultError}},description:Q}}class _Q{constructor(f,v){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new UQ(f,v)}async connect(f){return await this.server.connect(f)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(f0.shape.method.value),this.server.assertCanSetRequestHandler(Q0.shape.method.value),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(f0,()=>({tools:Object.entries(this._registeredTools).filter(([,f])=>f.enabled).map(([f,v])=>{let W={name:f,title:v.title,description:v.description,inputSchema:v.inputSchema?F0(v.inputSchema,{strictUnions:!0}):W7,annotations:v.annotations,_meta:v._meta};if(v.outputSchema)W.outputSchema=F0(v.outputSchema,{strictUnions:!0});return W})})),this.server.setRequestHandler(Q0,async(f,v)=>{let W=this._registeredTools[f.params.name];if(!W)throw new Kv(Hv.InvalidParams,`Tool ${f.params.name} not found`);if(!W.enabled)throw new Kv(Hv.InvalidParams,`Tool ${f.params.name} disabled`);let J;if(W.inputSchema){let Q=await W.inputSchema.safeParseAsync(f.params.arguments);if(!Q.success)throw new Kv(Hv.InvalidParams,`Invalid arguments for tool ${f.params.name}: ${Q.error.message}`);let X=Q.data,Y=W.callback;try{J=await Promise.resolve(Y(X,v))}catch(w){J={content:[{type:"text",text:w instanceof Error?w.message:String(w)}],isError:!0}}}else{let Q=W.callback;try{J=await Promise.resolve(Q(v))}catch(X){J={content:[{type:"text",text:X instanceof Error?X.message:String(X)}],isError:!0}}}if(W.outputSchema&&!J.isError){if(!J.structuredContent)throw new Kv(Hv.InvalidParams,`Tool ${f.params.name} has an output schema but no structured content was provided`);let Q=await W.outputSchema.safeParseAsync(J.structuredContent);if(!Q.success)throw new Kv(Hv.InvalidParams,`Invalid structured content for tool ${f.params.name}: ${Q.error.message}`)}return J}),this._toolHandlersInitialized=!0}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(W0.shape.method.value),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(W0,async(f)=>{switch(f.params.ref.type){case"ref/prompt":return this.handlePromptCompletion(f,f.params.ref);case"ref/resource":return this.handleResourceCompletion(f,f.params.ref);default:throw new Kv(Hv.InvalidParams,`Invalid completion reference: ${f.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(f,v){let W=this._registeredPrompts[v.name];if(!W)throw new Kv(Hv.InvalidParams,`Prompt ${v.name} not found`);if(!W.enabled)throw new Kv(Hv.InvalidParams,`Prompt ${v.name} disabled`);if(!W.argsSchema)return g0;let J=W.argsSchema.shape[f.params.argument.name];if(!(J instanceof S1))return g0;let X=await J._def.complete(f.params.argument.value,f.params.context);return HJ(X)}async handleResourceCompletion(f,v){let W=Object.values(this._registeredResourceTemplates).find((X)=>X.resourceTemplate.uriTemplate.toString()===v.uri);if(!W){if(this._registeredResources[v.uri])return g0;throw new Kv(Hv.InvalidParams,`Resource template ${f.params.ref.uri} not found`)}let J=W.resourceTemplate.completeCallback(f.params.argument.name);if(!J)return g0;let Q=await J(f.params.argument.value,f.params.context);return HJ(Q)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(o1.shape.method.value),this.server.assertCanSetRequestHandler(s1.shape.method.value),this.server.assertCanSetRequestHandler(t1.shape.method.value),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(o1,async(f,v)=>{let W=Object.entries(this._registeredResources).filter(([Q,X])=>X.enabled).map(([Q,X])=>({uri:Q,name:X.name,...X.metadata})),J=[];for(let Q of Object.values(this._registeredResourceTemplates)){if(!Q.resourceTemplate.listCallback)continue;let X=await Q.resourceTemplate.listCallback(v);for(let Y of X.resources)J.push({...Q.metadata,...Y})}return{resources:[...W,...J]}}),this.server.setRequestHandler(s1,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([v,W])=>({name:v,uriTemplate:W.resourceTemplate.uriTemplate.toString(),...W.metadata}))}}),this.server.setRequestHandler(t1,async(f,v)=>{let W=new URL(f.params.uri),J=this._registeredResources[W.toString()];if(J){if(!J.enabled)throw new Kv(Hv.InvalidParams,`Resource ${W} disabled`);return J.readCallback(W,v)}for(let Q of Object.values(this._registeredResourceTemplates)){let X=Q.resourceTemplate.uriTemplate.match(W.toString());if(X)return Q.readCallback(W,X,v)}throw new Kv(Hv.InvalidParams,`Resource ${W} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(e1.shape.method.value),this.server.assertCanSetRequestHandler(v0.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(e1,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,f])=>f.enabled).map(([f,v])=>{return{name:f,title:v.title,description:v.description,arguments:v.argsSchema?X7(v.argsSchema):void 0}})})),this.server.setRequestHandler(v0,async(f,v)=>{let W=this._registeredPrompts[f.params.name];if(!W)throw new Kv(Hv.InvalidParams,`Prompt ${f.params.name} not found`);if(!W.enabled)throw new Kv(Hv.InvalidParams,`Prompt ${f.params.name} disabled`);if(W.argsSchema){let J=await W.argsSchema.safeParseAsync(f.params.arguments);if(!J.success)throw new Kv(Hv.InvalidParams,`Invalid arguments for prompt ${f.params.name}: ${J.error.message}`);let Q=J.data,X=W.callback;return await Promise.resolve(X(Q,v))}else{let J=W.callback;return await Promise.resolve(J(v))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0}resource(f,v,...W){let J;if(typeof W[0]==="object")J=W.shift();let Q=W[0];if(typeof v==="string"){if(this._registeredResources[v])throw new Error(`Resource ${v} is already registered`);let X=this._createRegisteredResource(f,void 0,v,J,Q);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),X}else{if(this._registeredResourceTemplates[f])throw new Error(`Resource template ${f} is already registered`);let X=this._createRegisteredResourceTemplate(f,void 0,v,J,Q);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),X}}registerResource(f,v,W,J){if(typeof v==="string"){if(this._registeredResources[v])throw new Error(`Resource ${v} is already registered`);let Q=this._createRegisteredResource(f,W.title,v,W,J);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),Q}else{if(this._registeredResourceTemplates[f])throw new Error(`Resource template ${f} is already registered`);let Q=this._createRegisteredResourceTemplate(f,W.title,v,W,J);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),Q}}_createRegisteredResource(f,v,W,J,Q){let X={name:f,title:v,metadata:J,readCallback:Q,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({uri:null}),update:(Y)=>{if(typeof Y.uri!=="undefined"&&Y.uri!==W){if(delete this._registeredResources[W],Y.uri)this._registeredResources[Y.uri]=X}if(typeof Y.name!=="undefined")X.name=Y.name;if(typeof Y.title!=="undefined")X.title=Y.title;if(typeof Y.metadata!=="undefined")X.metadata=Y.metadata;if(typeof Y.callback!=="undefined")X.readCallback=Y.callback;if(typeof Y.enabled!=="undefined")X.enabled=Y.enabled;this.sendResourceListChanged()}};return this._registeredResources[W]=X,X}_createRegisteredResourceTemplate(f,v,W,J,Q){let X={resourceTemplate:W,title:v,metadata:J,readCallback:Q,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Y)=>{if(typeof Y.name!=="undefined"&&Y.name!==f){if(delete this._registeredResourceTemplates[f],Y.name)this._registeredResourceTemplates[Y.name]=X}if(typeof Y.title!=="undefined")X.title=Y.title;if(typeof Y.template!=="undefined")X.resourceTemplate=Y.template;if(typeof Y.metadata!=="undefined")X.metadata=Y.metadata;if(typeof Y.callback!=="undefined")X.readCallback=Y.callback;if(typeof Y.enabled!=="undefined")X.enabled=Y.enabled;this.sendResourceListChanged()}};return this._registeredResourceTemplates[f]=X,X}_createRegisteredPrompt(f,v,W,J,Q){let X={title:v,description:W,argsSchema:J===void 0?void 0:G.object(J),callback:Q,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Y)=>{if(typeof Y.name!=="undefined"&&Y.name!==f){if(delete this._registeredPrompts[f],Y.name)this._registeredPrompts[Y.name]=X}if(typeof Y.title!=="undefined")X.title=Y.title;if(typeof Y.description!=="undefined")X.description=Y.description;if(typeof Y.argsSchema!=="undefined")X.argsSchema=G.object(Y.argsSchema);if(typeof Y.callback!=="undefined")X.callback=Y.callback;if(typeof Y.enabled!=="undefined")X.enabled=Y.enabled;this.sendPromptListChanged()}};return this._registeredPrompts[f]=X,X}_createRegisteredTool(f,v,W,J,Q,X,Y,w){let B={title:v,description:W,inputSchema:J===void 0?void 0:G.object(J),outputSchema:Q===void 0?void 0:G.object(Q),annotations:X,_meta:Y,callback:w,enabled:!0,disable:()=>B.update({enabled:!1}),enable:()=>B.update({enabled:!0}),remove:()=>B.update({name:null}),update:(z)=>{if(typeof z.name!=="undefined"&&z.name!==f){if(delete this._registeredTools[f],z.name)this._registeredTools[z.name]=B}if(typeof z.title!=="undefined")B.title=z.title;if(typeof z.description!=="undefined")B.description=z.description;if(typeof z.paramsSchema!=="undefined")B.inputSchema=G.object(z.paramsSchema);if(typeof z.callback!=="undefined")B.callback=z.callback;if(typeof z.annotations!=="undefined")B.annotations=z.annotations;if(typeof z._meta!=="undefined")B._meta=z._meta;if(typeof z.enabled!=="undefined")B.enabled=z.enabled;this.sendToolListChanged()}};return this._registeredTools[f]=B,this.setToolRequestHandlers(),this.sendToolListChanged(),B}tool(f,...v){if(this._registeredTools[f])throw new Error(`Tool ${f} is already registered`);let W,J,Q,X;if(typeof v[0]==="string")W=v.shift();if(v.length>1){let w=v[0];if(PJ(w)){if(J=v.shift(),v.length>1&&typeof v[0]==="object"&&v[0]!==null&&!PJ(v[0]))X=v.shift()}else if(typeof w==="object"&&w!==null)X=v.shift()}let Y=v[0];return this._createRegisteredTool(f,void 0,W,J,Q,X,void 0,Y)}registerTool(f,v,W){if(this._registeredTools[f])throw new Error(`Tool ${f} is already registered`);let{title:J,description:Q,inputSchema:X,outputSchema:Y,annotations:w,_meta:B}=v;return this._createRegisteredTool(f,J,Q,X,Y,w,B,W)}prompt(f,...v){if(this._registeredPrompts[f])throw new Error(`Prompt ${f} is already registered`);let W;if(typeof v[0]==="string")W=v.shift();let J;if(v.length>1)J=v.shift();let Q=v[0],X=this._createRegisteredPrompt(f,void 0,W,J,Q);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),X}registerPrompt(f,v,W){if(this._registeredPrompts[f])throw new Error(`Prompt ${f} is already registered`);let{title:J,description:Q,argsSchema:X}=v,Y=this._createRegisteredPrompt(f,J,Q,X,W);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),Y}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(f,v){return this.server.sendLoggingMessage(f,v)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var W7={type:"object",properties:{}};function PJ(f){if(typeof f!=="object"||f===null)return!1;return Object.keys(f).length===0||Object.values(f).some(J7)}function J7(f){return f!==null&&typeof f==="object"&&"parse"in f&&typeof f.parse==="function"&&"safeParse"in f&&typeof f.safeParse==="function"}function X7(f){return Object.entries(f.shape).map(([v,W])=>({name:v,description:W.description,required:!W.isOptional()}))}function HJ(f){return{completion:{values:f.slice(0,100),total:f.length,hasMore:f.length>100}}}var g0={completion:{values:[],hasMore:!1}};import zJ from"process";class RQ{append(f){this._buffer=this._buffer?Buffer.concat([this._buffer,f]):f}readMessage(){if(!this._buffer)return null;let f=this._buffer.indexOf(`
|
|
13
|
-
`);if(f===-1)return null;let v=this._buffer.toString("utf8",0,f).replace(/\r$/,"");return this._buffer=this._buffer.subarray(f+1),Y7(v)}clear(){this._buffer=void 0}}function Y7(f){return j8.parse(JSON.parse(f))}function KJ(f){return JSON.stringify(f)+`
|
|
14
|
-
`}
|
|
15
|
-
|
|
16
|
-
`)
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
var iO=Object.create;var{getPrototypeOf:oO,defineProperty:aK,getOwnPropertyNames:cO}=Object;var LO=Object.prototype.hasOwnProperty;var IK=(_,q,f)=>{f=_!=null?iO(oO(_)):{};let K=q||!_||!_.__esModule?aK(f,"default",{value:_,enumerable:!0}):f;for(let $ of cO(_))if(!LO.call(K,$))aK(K,$,{get:()=>_[$],enumerable:!0});return K};var p=(_,q)=>()=>(q||_((q={exports:{}}).exports,q),q.exports);var _7=(_,q)=>{for(var f in q)aK(_,f,{get:q[f],enumerable:!0,configurable:!0,set:(K)=>q[f]=()=>K})};var b_=(_,q)=>()=>(_&&(q=_(_=0)),q);var a_=import.meta.require;var n7=p(($$,l7)=>{(function(_,q){typeof $$==="object"&&typeof l7!=="undefined"?q($$):typeof define==="function"&&define.amd?define(["exports"],q):q(_.URI=_.URI||{})})($$,function(_){function q(){for(var G=arguments.length,Z=Array(G),b=0;b<G;b++)Z[b]=arguments[b];if(Z.length>1){Z[0]=Z[0].slice(0,-1);var E=Z.length-1;for(var d=1;d<E;++d)Z[d]=Z[d].slice(1,-1);return Z[E]=Z[E].slice(1),Z.join("")}else return Z[0]}function f(G){return"(?:"+G+")"}function K(G){return G===void 0?"undefined":G===null?"null":Object.prototype.toString.call(G).split(" ").pop().split("]").shift().toLowerCase()}function $(G){return G.toUpperCase()}function P(G){return G!==void 0&&G!==null?G instanceof Array?G:typeof G.length!=="number"||G.split||G.setInterval||G.call?[G]:Array.prototype.slice.call(G):[]}function j(G,Z){var b=G;if(Z)for(var E in Z)b[E]=Z[E];return b}function v(G){var Z="[A-Za-z]",b="[\\x0D]",E="[0-9]",d="[\\x22]",x=q(E,"[A-Fa-f]"),fq="[\\x0A]",Yq="[\\x20]",Wq=f(f("%[EFef]"+x+"%"+x+x+"%"+x+x)+"|"+f("%[89A-Fa-f]"+x+"%"+x+x)+"|"+f("%"+x+x)),Cq="[\\:\\/\\?\\#\\[\\]\\@]",wq="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",mq=q(Cq,wq),pq=G?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",uq=G?"[\\uE000-\\uF8FF]":"[]",Tq=q(Z,E,"[\\-\\.\\_\\~]",pq),rq=f(Z+q(Z,E,"[\\+\\-\\.]")+"*"),hq=f(f(Wq+"|"+q(Tq,wq,"[\\:]"))+"*"),k8=f(f("25[0-5]")+"|"+f("2[0-4]"+E)+"|"+f("1"+E+E)+"|"+f("[1-9]"+E)+"|"+E),Fq=f(f("25[0-5]")+"|"+f("2[0-4]"+E)+"|"+f("1"+E+E)+"|"+f("0?[1-9]"+E)+"|0?0?"+E),f_=f(Fq+"\\."+Fq+"\\."+Fq+"\\."+Fq),Jq=f(x+"{1,4}"),Qq=f(f(Jq+"\\:"+Jq)+"|"+f_),$_=f(f(Jq+"\\:")+"{6}"+Qq),r_=f("\\:\\:"+f(Jq+"\\:")+"{5}"+Qq),Z8=f(f(Jq)+"?\\:\\:"+f(Jq+"\\:")+"{4}"+Qq),E_=f(f(f(Jq+"\\:")+"{0,1}"+Jq)+"?\\:\\:"+f(Jq+"\\:")+"{3}"+Qq),pf=f(f(f(Jq+"\\:")+"{0,2}"+Jq)+"?\\:\\:"+f(Jq+"\\:")+"{2}"+Qq),R6=f(f(f(Jq+"\\:")+"{0,3}"+Jq)+"?\\:\\:"+Jq+"\\:"+Qq),E6=f(f(f(Jq+"\\:")+"{0,4}"+Jq)+"?\\:\\:"+Qq),D8=f(f(f(Jq+"\\:")+"{0,5}"+Jq)+"?\\:\\:"+Jq),y8=f(f(f(Jq+"\\:")+"{0,6}"+Jq)+"?\\:\\:"),g_=f([$_,r_,Z8,E_,pf,R6,E6,D8,y8].join("|")),i8=f(f(Tq+"|"+Wq)+"+"),gK=f(g_+"\\%25"+i8),X8=f(g_+f("\\%25|\\%(?!"+x+"{2})")+i8),EO=f("[vV]"+x+"+\\."+q(Tq,wq,"[\\:]")+"+"),gO=f("\\["+f(X8+"|"+g_+"|"+EO)+"\\]"),U4=f(f(Wq+"|"+q(Tq,wq))+"*"),lf=f(gO+"|"+f_+"(?!"+U4+")|"+U4),nf=f(E+"*"),F4=f(f(hq+"@")+"?"+lf+f("\\:"+nf)+"?"),Rf=f(Wq+"|"+q(Tq,wq,"[\\:\\@]")),dO=f(Rf+"*"),Q4=f(Rf+"+"),aO=f(f(Wq+"|"+q(Tq,wq,"[\\@]"))+"+"),d_=f(f("\\/"+dO)+"*"),o8=f("\\/"+f(Q4+d_)+"?"),dK=f(aO+d_),g6=f(Q4+d_),c8="(?!"+Rf+")",cN=f(d_+"|"+o8+"|"+dK+"|"+g6+"|"+c8),L8=f(f(Rf+"|"+q("[\\/\\?]",uq))+"*"),Ef=f(f(Rf+"|[\\/\\?]")+"*"),q7=f(f("\\/\\/"+F4+d_)+"|"+o8+"|"+g6+"|"+c8),IO=f(rq+"\\:"+q7+f("\\?"+L8)+"?"+f("\\#"+Ef)+"?"),DO=f(f("\\/\\/"+F4+d_)+"|"+o8+"|"+dK+"|"+c8),yO=f(DO+f("\\?"+L8)+"?"+f("\\#"+Ef)+"?"),LN=f(IO+"|"+yO),tN=f(rq+"\\:"+q7+f("\\?"+L8)+"?"),eN="^("+rq+")\\:"+f(f("\\/\\/("+f("("+hq+")@")+"?("+lf+")"+f("\\:("+nf+")")+"?)")+"?("+d_+"|"+o8+"|"+g6+"|"+c8+")")+f("\\?("+L8+")")+"?"+f("\\#("+Ef+")")+"?$",xN="^(){0}"+f(f("\\/\\/("+f("("+hq+")@")+"?("+lf+")"+f("\\:("+nf+")")+"?)")+"?("+d_+"|"+o8+"|"+dK+"|"+c8+")")+f("\\?("+L8+")")+"?"+f("\\#("+Ef+")")+"?$",sN="^("+rq+")\\:"+f(f("\\/\\/("+f("("+hq+")@")+"?("+lf+")"+f("\\:("+nf+")")+"?)")+"?("+d_+"|"+o8+"|"+g6+"|"+c8+")")+f("\\?("+L8+")")+"?$",BN="^"+f("\\#("+Ef+")")+"?$",UN="^"+f("("+hq+")@")+"?("+lf+")"+f("\\:("+nf+")")+"?$";return{NOT_SCHEME:new RegExp(q("[^]",Z,E,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(q("[^\\%\\:]",Tq,wq),"g"),NOT_HOST:new RegExp(q("[^\\%\\[\\]\\:]",Tq,wq),"g"),NOT_PATH:new RegExp(q("[^\\%\\/\\:\\@]",Tq,wq),"g"),NOT_PATH_NOSCHEME:new RegExp(q("[^\\%\\/\\@]",Tq,wq),"g"),NOT_QUERY:new RegExp(q("[^\\%]",Tq,wq,"[\\:\\@\\/\\?]",uq),"g"),NOT_FRAGMENT:new RegExp(q("[^\\%]",Tq,wq,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(q("[^]",Tq,wq),"g"),UNRESERVED:new RegExp(Tq,"g"),OTHER_CHARS:new RegExp(q("[^\\%]",Tq,mq),"g"),PCT_ENCODED:new RegExp(Wq,"g"),IPV4ADDRESS:new RegExp("^("+f_+")$"),IPV6ADDRESS:new RegExp("^\\[?("+g_+")"+f(f("\\%25|\\%(?!"+x+"{2})")+"("+i8+")")+"?\\]?$")}}var w=v(!1),O=v(!0),T=function(){function G(Z,b){var E=[],d=!0,x=!1,fq=void 0;try{for(var Yq=Z[Symbol.iterator](),Wq;!(d=(Wq=Yq.next()).done);d=!0)if(E.push(Wq.value),b&&E.length===b)break}catch(Cq){x=!0,fq=Cq}finally{try{if(!d&&Yq.return)Yq.return()}finally{if(x)throw fq}}return E}return function(Z,b){if(Array.isArray(Z))return Z;else if(Symbol.iterator in Object(Z))return G(Z,b);else throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Y=function(G){if(Array.isArray(G)){for(var Z=0,b=Array(G.length);Z<G.length;Z++)b[Z]=G[Z];return b}else return Array.from(G)},z=2147483647,H=36,h=1,J=26,k=38,X=700,l=72,N=128,n="-",R=/^xn--/,g=/[^\0-\x7E]/,V=/[\x2E\u3002\uFF0E\uFF61]/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=H-h,a=Math.floor,r=String.fromCharCode;function A(G){throw new RangeError(M[G])}function u(G,Z){var b=[],E=G.length;while(E--)b[E]=Z(G[E]);return b}function m(G,Z){var b=G.split("@"),E="";if(b.length>1)E=b[0]+"@",G=b[1];G=G.replace(V,".");var d=G.split("."),x=u(d,Z).join(".");return E+x}function S(G){var Z=[],b=0,E=G.length;while(b<E){var d=G.charCodeAt(b++);if(d>=55296&&d<=56319&&b<E){var x=G.charCodeAt(b++);if((x&64512)==56320)Z.push(((d&1023)<<10)+(x&1023)+65536);else Z.push(d),b--}else Z.push(d)}return Z}var I=function G(Z){return String.fromCodePoint.apply(String,Y(Z))},D=function G(Z){if(Z-48<10)return Z-22;if(Z-65<26)return Z-65;if(Z-97<26)return Z-97;return H},c=function G(Z,b){return Z+22+75*(Z<26)-((b!=0)<<5)},e=function G(Z,b,E){var d=0;Z=E?a(Z/X):Z>>1,Z+=a(Z/b);for(;Z>C*J>>1;d+=H)Z=a(Z/C);return a(d+(C+1)*Z/(Z+k))},L=function G(Z){var b=[],E=Z.length,d=0,x=N,fq=l,Yq=Z.lastIndexOf(n);if(Yq<0)Yq=0;for(var Wq=0;Wq<Yq;++Wq){if(Z.charCodeAt(Wq)>=128)A("not-basic");b.push(Z.charCodeAt(Wq))}for(var Cq=Yq>0?Yq+1:0;Cq<E;){var wq=d;for(var mq=1,pq=H;;pq+=H){if(Cq>=E)A("invalid-input");var uq=D(Z.charCodeAt(Cq++));if(uq>=H||uq>a((z-d)/mq))A("overflow");d+=uq*mq;var Tq=pq<=fq?h:pq>=fq+J?J:pq-fq;if(uq<Tq)break;var rq=H-Tq;if(mq>a(z/rq))A("overflow");mq*=rq}var hq=b.length+1;if(fq=e(d-wq,hq,wq==0),a(d/hq)>z-x)A("overflow");x+=a(d/hq),d%=hq,b.splice(d++,0,x)}return String.fromCodePoint.apply(String,b)},Q=function G(Z){var b=[];Z=S(Z);var E=Z.length,d=N,x=0,fq=l,Yq=!0,Wq=!1,Cq=void 0;try{for(var wq=Z[Symbol.iterator](),mq;!(Yq=(mq=wq.next()).done);Yq=!0){var pq=mq.value;if(pq<128)b.push(r(pq))}}catch(X8){Wq=!0,Cq=X8}finally{try{if(!Yq&&wq.return)wq.return()}finally{if(Wq)throw Cq}}var uq=b.length,Tq=uq;if(uq)b.push(n);while(Tq<E){var rq=z,hq=!0,k8=!1,Fq=void 0;try{for(var f_=Z[Symbol.iterator](),Jq;!(hq=(Jq=f_.next()).done);hq=!0){var Qq=Jq.value;if(Qq>=d&&Qq<rq)rq=Qq}}catch(X8){k8=!0,Fq=X8}finally{try{if(!hq&&f_.return)f_.return()}finally{if(k8)throw Fq}}var $_=Tq+1;if(rq-d>a((z-x)/$_))A("overflow");x+=(rq-d)*$_,d=rq;var r_=!0,Z8=!1,E_=void 0;try{for(var pf=Z[Symbol.iterator](),R6;!(r_=(R6=pf.next()).done);r_=!0){var E6=R6.value;if(E6<d&&++x>z)A("overflow");if(E6==d){var D8=x;for(var y8=H;;y8+=H){var g_=y8<=fq?h:y8>=fq+J?J:y8-fq;if(D8<g_)break;var i8=D8-g_,gK=H-g_;b.push(r(c(g_+i8%gK,0))),D8=a(i8/gK)}b.push(r(c(D8,0))),fq=e(x,$_,Tq==uq),x=0,++Tq}}}catch(X8){Z8=!0,E_=X8}finally{try{if(!r_&&pf.return)pf.return()}finally{if(Z8)throw E_}}++x,++d}return b.join("")},Hq=function G(Z){return m(Z,function(b){return R.test(b)?L(b.slice(4).toLowerCase()):b})},Pq=function G(Z){return m(Z,function(b){return g.test(b)?"xn--"+Q(b):b})},_q={version:"2.1.0",ucs2:{decode:S,encode:I},decode:L,encode:Q,toASCII:Pq,toUnicode:Hq},kq={};function gq(G){var Z=G.charCodeAt(0),b=void 0;if(Z<16)b="%0"+Z.toString(16).toUpperCase();else if(Z<128)b="%"+Z.toString(16).toUpperCase();else if(Z<2048)b="%"+(Z>>6|192).toString(16).toUpperCase()+"%"+(Z&63|128).toString(16).toUpperCase();else b="%"+(Z>>12|224).toString(16).toUpperCase()+"%"+(Z>>6&63|128).toString(16).toUpperCase()+"%"+(Z&63|128).toString(16).toUpperCase();return b}function iq(G){var Z="",b=0,E=G.length;while(b<E){var d=parseInt(G.substr(b+1,2),16);if(d<128)Z+=String.fromCharCode(d),b+=3;else if(d>=194&&d<224){if(E-b>=6){var x=parseInt(G.substr(b+4,2),16);Z+=String.fromCharCode((d&31)<<6|x&63)}else Z+=G.substr(b,6);b+=6}else if(d>=224){if(E-b>=9){var fq=parseInt(G.substr(b+4,2),16),Yq=parseInt(G.substr(b+7,2),16);Z+=String.fromCharCode((d&15)<<12|(fq&63)<<6|Yq&63)}else Z+=G.substr(b,9);b+=9}else Z+=G.substr(b,3),b+=3}return Z}function x_(G,Z){function b(E){var d=iq(E);return!d.match(Z.UNRESERVED)?E:d}if(G.scheme)G.scheme=String(G.scheme).replace(Z.PCT_ENCODED,b).toLowerCase().replace(Z.NOT_SCHEME,"");if(G.userinfo!==void 0)G.userinfo=String(G.userinfo).replace(Z.PCT_ENCODED,b).replace(Z.NOT_USERINFO,gq).replace(Z.PCT_ENCODED,$);if(G.host!==void 0)G.host=String(G.host).replace(Z.PCT_ENCODED,b).toLowerCase().replace(Z.NOT_HOST,gq).replace(Z.PCT_ENCODED,$);if(G.path!==void 0)G.path=String(G.path).replace(Z.PCT_ENCODED,b).replace(G.scheme?Z.NOT_PATH:Z.NOT_PATH_NOSCHEME,gq).replace(Z.PCT_ENCODED,$);if(G.query!==void 0)G.query=String(G.query).replace(Z.PCT_ENCODED,b).replace(Z.NOT_QUERY,gq).replace(Z.PCT_ENCODED,$);if(G.fragment!==void 0)G.fragment=String(G.fragment).replace(Z.PCT_ENCODED,b).replace(Z.NOT_FRAGMENT,gq).replace(Z.PCT_ENCODED,$);return G}function n_(G){return G.replace(/^0*(.*)/,"$1")||"0"}function Nq(G,Z){var b=G.match(Z.IPV4ADDRESS)||[],E=T(b,2),d=E[1];if(d)return d.split(".").map(n_).join(".");else return G}function Vq(G,Z){var b=G.match(Z.IPV6ADDRESS)||[],E=T(b,3),d=E[1],x=E[2];if(d){var fq=d.toLowerCase().split("::").reverse(),Yq=T(fq,2),Wq=Yq[0],Cq=Yq[1],wq=Cq?Cq.split(":").map(n_):[],mq=Wq.split(":").map(n_),pq=Z.IPV4ADDRESS.test(mq[mq.length-1]),uq=pq?7:8,Tq=mq.length-uq,rq=Array(uq);for(var hq=0;hq<uq;++hq)rq[hq]=wq[hq]||mq[Tq+hq]||"";if(pq)rq[uq-1]=Nq(rq[uq-1],Z);var k8=rq.reduce(function($_,r_,Z8){if(!r_||r_==="0"){var E_=$_[$_.length-1];if(E_&&E_.index+E_.length===Z8)E_.length++;else $_.push({index:Z8,length:1})}return $_},[]),Fq=k8.sort(function($_,r_){return r_.length-$_.length})[0],f_=void 0;if(Fq&&Fq.length>1){var Jq=rq.slice(0,Fq.index),Qq=rq.slice(Fq.index+Fq.length);f_=Jq.join(":")+"::"+Qq.join(":")}else f_=rq.join(":");if(x)f_+="%"+x;return f_}else return G}var H8=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Dq="".match(/(){0}/)[1]===void 0;function zq(G){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b={},E=Z.iri!==!1?O:w;if(Z.reference==="suffix")G=(Z.scheme?Z.scheme+":":"")+"//"+G;var d=G.match(H8);if(d){if(Dq){if(b.scheme=d[1],b.userinfo=d[3],b.host=d[4],b.port=parseInt(d[5],10),b.path=d[6]||"",b.query=d[7],b.fragment=d[8],isNaN(b.port))b.port=d[5]}else if(b.scheme=d[1]||void 0,b.userinfo=G.indexOf("@")!==-1?d[3]:void 0,b.host=G.indexOf("//")!==-1?d[4]:void 0,b.port=parseInt(d[5],10),b.path=d[6]||"",b.query=G.indexOf("?")!==-1?d[7]:void 0,b.fragment=G.indexOf("#")!==-1?d[8]:void 0,isNaN(b.port))b.port=G.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?d[4]:void 0;if(b.host)b.host=Vq(Nq(b.host,E),E);if(b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&!b.path&&b.query===void 0)b.reference="same-document";else if(b.scheme===void 0)b.reference="relative";else if(b.fragment===void 0)b.reference="absolute";else b.reference="uri";if(Z.reference&&Z.reference!=="suffix"&&Z.reference!==b.reference)b.error=b.error||"URI is not a "+Z.reference+" reference.";var x=kq[(Z.scheme||b.scheme||"").toLowerCase()];if(!Z.unicodeSupport&&(!x||!x.unicodeSupport)){if(b.host&&(Z.domainHost||x&&x.domainHost))try{b.host=_q.toASCII(b.host.replace(E.PCT_ENCODED,iq).toLowerCase())}catch(fq){b.error=b.error||"Host's domain name can not be converted to ASCII via punycode: "+fq}x_(b,w)}else x_(b,E);if(x&&x.parse)x.parse(b,Z)}else b.error=b.error||"URI can not be parsed.";return b}function s_(G,Z){var b=Z.iri!==!1?O:w,E=[];if(G.userinfo!==void 0)E.push(G.userinfo),E.push("@");if(G.host!==void 0)E.push(Vq(Nq(String(G.host),b),b).replace(b.IPV6ADDRESS,function(d,x,fq){return"["+x+(fq?"%25"+fq:"")+"]"}));if(typeof G.port==="number"||typeof G.port==="string")E.push(":"),E.push(String(G.port));return E.length?E.join(""):void 0}var R_=/^\.\.?\//,h8=/^\/\.(\/|$)/,J8=/^\/\.\.(\/|$)/,dq=/^\/?(?:.|\n)*?(?=\/|$)/;function __(G){var Z=[];while(G.length)if(G.match(R_))G=G.replace(R_,"");else if(G.match(h8))G=G.replace(h8,"/");else if(G.match(J8))G=G.replace(J8,"/"),Z.pop();else if(G==="."||G==="..")G="";else{var b=G.match(dq);if(b){var E=b[0];G=G.slice(E.length),Z.push(E)}else throw new Error("Unexpected dot segment condition")}return Z.join("")}function tq(G){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=Z.iri?O:w,E=[],d=kq[(Z.scheme||G.scheme||"").toLowerCase()];if(d&&d.serialize)d.serialize(G,Z);if(G.host){if(b.IPV6ADDRESS.test(G.host));else if(Z.domainHost||d&&d.domainHost)try{G.host=!Z.iri?_q.toASCII(G.host.replace(b.PCT_ENCODED,iq).toLowerCase()):_q.toUnicode(G.host)}catch(Yq){G.error=G.error||"Host's domain name can not be converted to "+(!Z.iri?"ASCII":"Unicode")+" via punycode: "+Yq}}if(x_(G,b),Z.reference!=="suffix"&&G.scheme)E.push(G.scheme),E.push(":");var x=s_(G,Z);if(x!==void 0){if(Z.reference!=="suffix")E.push("//");if(E.push(x),G.path&&G.path.charAt(0)!=="/")E.push("/")}if(G.path!==void 0){var fq=G.path;if(!Z.absolutePath&&(!d||!d.absolutePath))fq=__(fq);if(x===void 0)fq=fq.replace(/^\/\//,"/%2F");E.push(fq)}if(G.query!==void 0)E.push("?"),E.push(G.query);if(G.fragment!==void 0)E.push("#"),E.push(G.fragment);return E.join("")}function oq(G,Z){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments[3],d={};if(!E)G=zq(tq(G,b),b),Z=zq(tq(Z,b),b);if(b=b||{},!b.tolerant&&Z.scheme)d.scheme=Z.scheme,d.userinfo=Z.userinfo,d.host=Z.host,d.port=Z.port,d.path=__(Z.path||""),d.query=Z.query;else{if(Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0)d.userinfo=Z.userinfo,d.host=Z.host,d.port=Z.port,d.path=__(Z.path||""),d.query=Z.query;else{if(!Z.path)if(d.path=G.path,Z.query!==void 0)d.query=Z.query;else d.query=G.query;else{if(Z.path.charAt(0)==="/")d.path=__(Z.path);else{if((G.userinfo!==void 0||G.host!==void 0||G.port!==void 0)&&!G.path)d.path="/"+Z.path;else if(!G.path)d.path=Z.path;else d.path=G.path.slice(0,G.path.lastIndexOf("/")+1)+Z.path;d.path=__(d.path)}d.query=Z.query}d.userinfo=G.userinfo,d.host=G.host,d.port=G.port}d.scheme=G.scheme}return d.fragment=Z.fragment,d}function G_(G,Z,b){var E=j({scheme:"null"},b);return tq(oq(zq(G,E),zq(Z,E),E,!0),E)}function Uq(G,Z){if(typeof G==="string")G=tq(zq(G,Z),Z);else if(K(G)==="object")G=zq(tq(G,Z),Z);return G}function n6(G,Z,b){if(typeof G==="string")G=tq(zq(G,b),b);else if(K(G)==="object")G=tq(G,b);if(typeof Z==="string")Z=tq(zq(Z,b),b);else if(K(Z)==="object")Z=tq(Z,b);return G===Z}function RK(G,Z){return G&&G.toString().replace(!Z||!Z.iri?w.ESCAPE:O.ESCAPE,gq)}function Y_(G,Z){return G&&G.toString().replace(!Z||!Z.iri?w.PCT_ENCODED:O.PCT_ENCODED,iq)}var Nf={scheme:"http",domainHost:!0,parse:function G(Z,b){if(!Z.host)Z.error=Z.error||"HTTP URIs must have a host.";return Z},serialize:function G(Z,b){var E=String(Z.scheme).toLowerCase()==="https";if(Z.port===(E?443:80)||Z.port==="")Z.port=void 0;if(!Z.path)Z.path="/";return Z}},o4={scheme:"https",domainHost:Nf.domainHost,parse:Nf.parse,serialize:Nf.serialize};function c4(G){return typeof G.secure==="boolean"?G.secure:String(G.scheme).toLowerCase()==="wss"}var Cf={scheme:"ws",domainHost:!0,parse:function G(Z,b){var E=Z;return E.secure=c4(E),E.resourceName=(E.path||"/")+(E.query?"?"+E.query:""),E.path=void 0,E.query=void 0,E},serialize:function G(Z,b){if(Z.port===(c4(Z)?443:80)||Z.port==="")Z.port=void 0;if(typeof Z.secure==="boolean")Z.scheme=Z.secure?"wss":"ws",Z.secure=void 0;if(Z.resourceName){var E=Z.resourceName.split("?"),d=T(E,2),x=d[0],fq=d[1];Z.path=x&&x!=="/"?x:void 0,Z.query=fq,Z.resourceName=void 0}return Z.fragment=void 0,Z}},L4={scheme:"wss",domainHost:Cf.domainHost,parse:Cf.parse,serialize:Cf.serialize},mO={},rO=!0,t4="[A-Za-z0-9\\-\\.\\_\\~"+(rO?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",m_="[0-9A-Fa-f]",bO=f(f("%[EFef]"+m_+"%"+m_+m_+"%"+m_+m_)+"|"+f("%[89A-Fa-f]"+m_+"%"+m_+m_)+"|"+f("%"+m_+m_)),VO="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",MO="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",SO=q(MO,"[\\\"\\\\]"),NO="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",CO=new RegExp(t4,"g"),I8=new RegExp(bO,"g"),pO=new RegExp(q("[^]",VO,"[\\.]","[\\\"]",SO),"g"),e4=new RegExp(q("[^]",t4,NO),"g"),lO=e4;function EK(G){var Z=iq(G);return!Z.match(CO)?G:Z}var x4={scheme:"mailto",parse:function G(Z,b){var E=Z,d=E.to=E.path?E.path.split(","):[];if(E.path=void 0,E.query){var x=!1,fq={},Yq=E.query.split("&");for(var Wq=0,Cq=Yq.length;Wq<Cq;++Wq){var wq=Yq[Wq].split("=");switch(wq[0]){case"to":var mq=wq[1].split(",");for(var pq=0,uq=mq.length;pq<uq;++pq)d.push(mq[pq]);break;case"subject":E.subject=Y_(wq[1],b);break;case"body":E.body=Y_(wq[1],b);break;default:x=!0,fq[Y_(wq[0],b)]=Y_(wq[1],b);break}}if(x)E.headers=fq}E.query=void 0;for(var Tq=0,rq=d.length;Tq<rq;++Tq){var hq=d[Tq].split("@");if(hq[0]=Y_(hq[0]),!b.unicodeSupport)try{hq[1]=_q.toASCII(Y_(hq[1],b).toLowerCase())}catch(k8){E.error=E.error||"Email address's domain name can not be converted to ASCII via punycode: "+k8}else hq[1]=Y_(hq[1],b).toLowerCase();d[Tq]=hq.join("@")}return E},serialize:function G(Z,b){var E=Z,d=P(Z.to);if(d){for(var x=0,fq=d.length;x<fq;++x){var Yq=String(d[x]),Wq=Yq.lastIndexOf("@"),Cq=Yq.slice(0,Wq).replace(I8,EK).replace(I8,$).replace(pO,gq),wq=Yq.slice(Wq+1);try{wq=!b.iri?_q.toASCII(Y_(wq,b).toLowerCase()):_q.toUnicode(wq)}catch(Tq){E.error=E.error||"Email address's domain name can not be converted to "+(!b.iri?"ASCII":"Unicode")+" via punycode: "+Tq}d[x]=Cq+"@"+wq}E.path=d.join(",")}var mq=Z.headers=Z.headers||{};if(Z.subject)mq.subject=Z.subject;if(Z.body)mq.body=Z.body;var pq=[];for(var uq in mq)if(mq[uq]!==mO[uq])pq.push(uq.replace(I8,EK).replace(I8,$).replace(e4,gq)+"="+mq[uq].replace(I8,EK).replace(I8,$).replace(lO,gq));if(pq.length)E.query=pq.join("&");return E}},nO=/^([^\:]+)\:(.*)/,s4={scheme:"urn",parse:function G(Z,b){var E=Z.path&&Z.path.match(nO),d=Z;if(E){var x=b.scheme||d.scheme||"urn",fq=E[1].toLowerCase(),Yq=E[2],Wq=x+":"+(b.nid||fq),Cq=kq[Wq];if(d.nid=fq,d.nss=Yq,d.path=void 0,Cq)d=Cq.parse(d,b)}else d.error=d.error||"URN can not be parsed.";return d},serialize:function G(Z,b){var E=b.scheme||Z.scheme||"urn",d=Z.nid,x=E+":"+(b.nid||d),fq=kq[x];if(fq)Z=fq.serialize(Z,b);var Yq=Z,Wq=Z.nss;return Yq.path=(d||b.nid)+":"+Wq,Yq}},RO=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,B4={scheme:"urn:uuid",parse:function G(Z,b){var E=Z;if(E.uuid=E.nss,E.nss=void 0,!b.tolerant&&(!E.uuid||!E.uuid.match(RO)))E.error=E.error||"UUID is not valid.";return E},serialize:function G(Z,b){var E=Z;return E.nss=(Z.uuid||"").toLowerCase(),E}};kq[Nf.scheme]=Nf,kq[o4.scheme]=o4,kq[Cf.scheme]=Cf,kq[L4.scheme]=L4,kq[x4.scheme]=x4,kq[s4.scheme]=s4,kq[B4.scheme]=B4,_.SCHEMES=kq,_.pctEncChar=gq,_.pctDecChars=iq,_.parse=zq,_.removeDotSegments=__,_.serialize=tq,_.resolveComponents=oq,_.resolve=G_,_.normalize=Uq,_.equal=n6,_.escapeComponent=RK,_.unescapeComponent=Y_,Object.defineProperty(_,"__esModule",{value:!0})})});var K$=p((gC,R7)=>{R7.exports=function _(q,f){if(q===f)return!0;if(q&&f&&typeof q=="object"&&typeof f=="object"){if(q.constructor!==f.constructor)return!1;var K,$,P;if(Array.isArray(q)){if(K=q.length,K!=f.length)return!1;for($=K;$--!==0;)if(!_(q[$],f[$]))return!1;return!0}if(q.constructor===RegExp)return q.source===f.source&&q.flags===f.flags;if(q.valueOf!==Object.prototype.valueOf)return q.valueOf()===f.valueOf();if(q.toString!==Object.prototype.toString)return q.toString()===f.toString();if(P=Object.keys(q),K=P.length,K!==Object.keys(f).length)return!1;for($=K;$--!==0;)if(!Object.prototype.hasOwnProperty.call(f,P[$]))return!1;for($=K;$--!==0;){var j=P[$];if(!_(q[j],f[j]))return!1}return!0}return q!==q&&f!==f}});var g7=p((dC,E7)=>{E7.exports=function _(q){var f=0,K=q.length,$=0,P;while($<K)if(f++,P=q.charCodeAt($++),P>=55296&&P<=56319&&$<K){if(P=q.charCodeAt($),(P&64512)==56320)$++}return f}});var b8=p((aC,I7)=>{I7.exports={copy:tT,checkDataType:fP,checkDataTypes:eT,coerceToTypes:xT,toHash:KP,getProperty:PP,escapeQuotes:jP,equal:K$(),ucs2length:g7(),varOccurences:UT,varReplace:FT,schemaHasRules:QT,schemaHasRulesExcept:qz,schemaUnknownRules:_z,toQuotedString:$P,getPathExpr:fz,getPath:$z,getData:jz,unescapeFragment:vz,unescapeJsonPointer:wP,escapeFragment:wz,escapeJsonPointer:vP};function tT(_,q){q=q||{};for(var f in _)q[f]=_[f];return q}function fP(_,q,f,K){var $=K?" !== ":" === ",P=K?" || ":" && ",j=K?"!":"",v=K?"":"!";switch(_){case"null":return q+$+"null";case"array":return j+"Array.isArray("+q+")";case"object":return"("+j+q+P+"typeof "+q+$+'"object"'+P+v+"Array.isArray("+q+"))";case"integer":return"(typeof "+q+$+'"number"'+P+v+"("+q+" % 1)"+P+q+$+q+(f?P+j+"isFinite("+q+")":"")+")";case"number":return"(typeof "+q+$+'"'+_+'"'+(f?P+j+"isFinite("+q+")":"")+")";default:return"typeof "+q+$+'"'+_+'"'}}function eT(_,q,f){switch(_.length){case 1:return fP(_[0],q,f,!0);default:var K="",$=KP(_);if($.array&&$.object)K=$.null?"(":"(!"+q+" || ",K+="typeof "+q+' !== "object")',delete $.null,delete $.array,delete $.object;if($.number)delete $.integer;for(var P in $)K+=(K?" && ":"")+fP(P,q,f,!0);return K}}var d7=KP(["string","number","integer","boolean","null"]);function xT(_,q){if(Array.isArray(q)){var f=[];for(var K=0;K<q.length;K++){var $=q[K];if(d7[$])f[f.length]=$;else if(_==="array"&&$==="array")f[f.length]=$}if(f.length)return f}else if(d7[q])return[q];else if(_==="array"&&q==="array")return["array"]}function KP(_){var q={};for(var f=0;f<_.length;f++)q[_[f]]=!0;return q}var sT=/^[a-z$_][a-z$_0-9]*$/i,BT=/'|\\/g;function PP(_){return typeof _=="number"?"["+_+"]":sT.test(_)?"."+_:"['"+jP(_)+"']"}function jP(_){return _.replace(BT,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function UT(_,q){q+="[^0-9]";var f=_.match(new RegExp(q,"g"));return f?f.length:0}function FT(_,q,f){return q+="([^0-9])",f=f.replace(/\$/g,"$$$$"),_.replace(new RegExp(q,"g"),f+"$1")}function QT(_,q){if(typeof _=="boolean")return!_;for(var f in _)if(q[f])return!0}function qz(_,q,f){if(typeof _=="boolean")return!_&&f!="not";for(var K in _)if(K!=f&&q[K])return!0}function _z(_,q){if(typeof _=="boolean")return;for(var f in _)if(!q[f])return f}function $P(_){return"'"+jP(_)+"'"}function fz(_,q,f,K){var $=f?"'/' + "+q+(K?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):K?"'[' + "+q+" + ']'":"'[\\'' + "+q+" + '\\']'";return a7(_,$)}function $z(_,q,f){var K=f?$P("/"+vP(q)):$P(PP(q));return a7(_,K)}var Kz=/^\/(?:[^~]|~0|~1)*$/,Pz=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function jz(_,q,f){var K,$,P,j;if(_==="")return"rootData";if(_[0]=="/"){if(!Kz.test(_))throw new Error("Invalid JSON-pointer: "+_);$=_,P="rootData"}else{if(j=_.match(Pz),!j)throw new Error("Invalid JSON-pointer: "+_);if(K=+j[1],$=j[2],$=="#"){if(K>=q)throw new Error("Cannot access property/index "+K+" levels up, current level is "+q);return f[q-K]}if(K>q)throw new Error("Cannot access data "+K+" levels up, current level is "+q);if(P="data"+(q-K||""),!$)return P}var v=P,w=$.split("/");for(var O=0;O<w.length;O++){var T=w[O];if(T)P+=PP(wP(T)),v+=" && "+P}return v}function a7(_,q){if(_=='""')return q;return(_+" + "+q).replace(/([^\\])' \+ '/g,"$1")}function vz(_){return wP(decodeURIComponent(_))}function wz(_){return encodeURIComponent(vP(_))}function vP(_){return _.replace(/~/g,"~0").replace(/\//g,"~1")}function wP(_){return _.replace(/~1/g,"/").replace(/~0/g,"~")}});var OP=p((IC,D7)=>{var Oz=b8();D7.exports=Yz;function Yz(_){Oz.copy(_,this)}});var i7=p((DC,y7)=>{var _8=y7.exports=function(_,q,f){if(typeof q=="function")f=q,q={};f=q.cb||f;var K=typeof f=="function"?f:f.pre||function(){},$=f.post||function(){};P$(q,K,$,_,"",_)};_8.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};_8.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};_8.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};_8.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 P$(_,q,f,K,$,P,j,v,w,O){if(K&&typeof K=="object"&&!Array.isArray(K)){q(K,$,P,j,v,w,O);for(var T in K){var Y=K[T];if(Array.isArray(Y)){if(T in _8.arrayKeywords)for(var z=0;z<Y.length;z++)P$(_,q,f,Y[z],$+"/"+T+"/"+z,P,$,T,K,z)}else if(T in _8.propsKeywords){if(Y&&typeof Y=="object")for(var H in Y)P$(_,q,f,Y[H],$+"/"+T+"/"+Tz(H),P,$,T,K,H)}else if(T in _8.keywords||_.allKeys&&!(T in _8.skipKeywords))P$(_,q,f,Y,$+"/"+T,P,$,T,K)}f(K,$,P,j,v,w,O)}}function Tz(_){return _.replace(/~/g,"~0").replace(/\//g,"~1")}});var T$=p((yC,t7)=>{var xf=n7(),o7=K$(),O$=b8(),j$=OP(),zz=i7();t7.exports=$8;$8.normalizeId=f8;$8.fullPath=v$;$8.url=w$;$8.ids=kz;$8.inlineRef=YP;$8.schema=Y$;function $8(_,q,f){var K=this._refs[f];if(typeof K=="string")if(this._refs[K])K=this._refs[K];else return $8.call(this,_,q,K);if(K=K||this._schemas[f],K instanceof j$)return YP(K.schema,this._opts.inlineRefs)?K.schema:K.validate||this._compile(K);var $=Y$.call(this,q,f),P,j,v;if($)P=$.schema,q=$.root,v=$.baseId;if(P instanceof j$)j=P.validate||_.call(this,P.schema,q,void 0,v);else if(P!==void 0)j=YP(P,this._opts.inlineRefs)?P:_.call(this,P,q,void 0,v);return j}function Y$(_,q){var f=xf.parse(q),K=L7(f),$=v$(this._getId(_.schema));if(Object.keys(_.schema).length===0||K!==$){var P=f8(K),j=this._refs[P];if(typeof j=="string")return Wz.call(this,_,j,f);else if(j instanceof j$){if(!j.validate)this._compile(j);_=j}else if(j=this._schemas[P],j instanceof j$){if(!j.validate)this._compile(j);if(P==f8(q))return{schema:j,root:_,baseId:$};_=j}else return;if(!_.schema)return;$=v$(this._getId(_.schema))}return c7.call(this,f,$,_.schema,_)}function Wz(_,q,f){var K=Y$.call(this,_,q);if(K){var{schema:$,baseId:P}=K;_=K.root;var j=this._getId($);if(j)P=w$(P,j);return c7.call(this,f,P,$,_)}}var Hz=O$.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function c7(_,q,f,K){if(_.fragment=_.fragment||"",_.fragment.slice(0,1)!="/")return;var $=_.fragment.split("/");for(var P=1;P<$.length;P++){var j=$[P];if(j){if(j=O$.unescapeFragment(j),f=f[j],f===void 0)break;var v;if(!Hz[j]){if(v=this._getId(f),v)q=w$(q,v);if(f.$ref){var w=w$(q,f.$ref),O=Y$.call(this,K,w);if(O)f=O.schema,K=O.root,q=O.baseId}}}}if(f!==void 0&&f!==K.schema)return{schema:f,root:K,baseId:q}}var hz=O$.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function YP(_,q){if(q===!1)return!1;if(q===void 0||q===!0)return TP(_);else if(q)return zP(_)<=q}function TP(_){var q;if(Array.isArray(_)){for(var f=0;f<_.length;f++)if(q=_[f],typeof q=="object"&&!TP(q))return!1}else for(var K in _){if(K=="$ref")return!1;if(q=_[K],typeof q=="object"&&!TP(q))return!1}return!0}function zP(_){var q=0,f;if(Array.isArray(_))for(var K=0;K<_.length;K++){if(f=_[K],typeof f=="object")q+=zP(f);if(q==1/0)return 1/0}else for(var $ in _){if($=="$ref")return 1/0;if(hz[$])q++;else{if(f=_[$],typeof f=="object")q+=zP(f)+1;if(q==1/0)return 1/0}}return q}function v$(_,q){if(q!==!1)_=f8(_);var f=xf.parse(_);return L7(f)}function L7(_){return xf.serialize(_).split("#")[0]+"#"}var Jz=/#\/?$/;function f8(_){return _?_.replace(Jz,""):""}function w$(_,q){return q=f8(q),xf.resolve(_,q)}function kz(_){var q=f8(this._getId(_)),f={"":q},K={"":v$(q,!1)},$={},P=this;return zz(_,{allKeys:!0},function(j,v,w,O,T,Y,z){if(v==="")return;var H=P._getId(j),h=f[O],J=K[O]+"/"+T;if(z!==void 0)J+="/"+(typeof z=="number"?z:O$.escapeFragment(z));if(typeof H=="string"){H=h=f8(h?xf.resolve(h,H):H);var k=P._refs[H];if(typeof k=="string")k=P._refs[k];if(k&&k.schema){if(!o7(j,k.schema))throw new Error('id "'+H+'" resolves to more than one schema')}else if(H!=f8(J))if(H[0]=="#"){if($[H]&&!o7(j,$[H]))throw new Error('id "'+H+'" resolves to more than one schema');$[H]=j}else P._refs[H]=J}f[v]=h,K[v]=J}),$}});var z$=p((iC,x7)=>{var WP=T$();x7.exports={Validation:e7(Zz),MissingRef:e7(HP)};function Zz(_){this.message="validation failed",this.errors=_,this.ajv=this.validation=!0}HP.message=function(_,q){return"can't resolve reference "+q+" from id "+_};function HP(_,q,f){this.message=f||HP.message(_,q),this.missingRef=WP.url(_,q),this.missingSchema=WP.normalizeId(WP.fullPath(this.missingRef))}function e7(_){return _.prototype=Object.create(Error.prototype),_.prototype.constructor=_,_}});var hP=p((oC,s7)=>{s7.exports=function(_,q){if(!q)q={};if(typeof q==="function")q={cmp:q};var f=typeof q.cycles==="boolean"?q.cycles:!1,K=q.cmp&&function(P){return function(j){return function(v,w){var O={key:v,value:j[v]},T={key:w,value:j[w]};return P(O,T)}}}(q.cmp),$=[];return function P(j){if(j&&j.toJSON&&typeof j.toJSON==="function")j=j.toJSON();if(j===void 0)return;if(typeof j=="number")return isFinite(j)?""+j:"null";if(typeof j!=="object")return JSON.stringify(j);var v,w;if(Array.isArray(j)){w="[";for(v=0;v<j.length;v++){if(v)w+=",";w+=P(j[v])||"null"}return w+"]"}if(j===null)return"null";if($.indexOf(j)!==-1){if(f)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var O=$.push(j)-1,T=Object.keys(j).sort(K&&K(j));w="";for(v=0;v<T.length;v++){var Y=T[v],z=P(j[Y]);if(!z)continue;if(w)w+=",";w+=JSON.stringify(Y)+":"+z}return $.splice(O,1),"{"+w+"}"}(_)}});var JP=p((cC,B7)=>{B7.exports=function _(q,f,K){var $="",P=q.schema.$async===!0,j=q.util.schemaHasRulesExcept(q.schema,q.RULES.all,"$ref"),v=q.self._getId(q.schema);if(q.opts.strictKeywords){var w=q.util.schemaUnknownRules(q.schema,q.RULES.keywords);if(w){var O="unknown keyword: "+w;if(q.opts.strictKeywords==="log")q.logger.warn(O);else throw new Error(O)}}if(q.isTop){if($+=" var validate = ",P)q.async=!0,$+="async ";if($+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",v&&(q.opts.sourceCode||q.opts.processCode))$+=" "+("/*# sourceURL="+v+" */")+" "}if(typeof q.schema=="boolean"||!(j||q.schema.$ref)){var f="false schema",T=q.level,Y=q.dataLevel,z=q.schema[f],H=q.schemaPath+q.util.getProperty(f),h=q.errSchemaPath+"/"+f,R=!q.opts.allErrors,M,J="data"+(Y||""),n="valid"+T;if(q.schema===!1){if(q.isTop)R=!0;else $+=" var "+n+" = false; ";var k=k||[];if(k.push($),$="",q.createErrors!==!1){if($+=" { keyword: '"+(M||"false schema")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(h)+" , params: {} ",q.opts.messages!==!1)$+=" , message: 'boolean schema is false' ";if(q.opts.verbose)$+=" , schema: false , parentSchema: validate.schema"+q.schemaPath+" , data: "+J+" ";$+=" } "}else $+=" {} ";var X=$;if($=k.pop(),!q.compositeRule&&R)if(q.async)$+=" throw new ValidationError(["+X+"]); ";else $+=" validate.errors = ["+X+"]; return false; ";else $+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else if(q.isTop)if(P)$+=" return data; ";else $+=" validate.errors = null; return true; ";else $+=" var "+n+" = true; ";if(q.isTop)$+=" }; return validate; ";return $}if(q.isTop){var l=q.isTop,T=q.level=0,Y=q.dataLevel=0,J="data";if(q.rootId=q.resolve.fullPath(q.self._getId(q.root.schema)),q.baseId=q.baseId||q.rootId,delete q.isTop,q.dataPathArr=[""],q.schema.default!==void 0&&q.opts.useDefaults&&q.opts.strictDefaults){var N="default is ignored in the schema root";if(q.opts.strictDefaults==="log")q.logger.warn(N);else throw new Error(N)}$+=" var vErrors = null; ",$+=" var errors = 0; ",$+=" if (rootData === undefined) rootData = data; "}else{var{level:T,dataLevel:Y}=q,J="data"+(Y||"");if(v)q.baseId=q.resolve.url(q.baseId,v);if(P&&!q.async)throw new Error("async schema in sync schema");$+=" var errs_"+T+" = errors;"}var n="valid"+T,R=!q.opts.allErrors,g="",V="",M,C=q.schema.type,a=Array.isArray(C);if(C&&q.opts.nullable&&q.schema.nullable===!0){if(a){if(C.indexOf("null")==-1)C=C.concat("null")}else if(C!="null")C=[C,"null"],a=!0}if(a&&C.length==1)C=C[0],a=!1;if(q.schema.$ref&&j){if(q.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+q.errSchemaPath+'" (see option extendRefs)');else if(q.opts.extendRefs!==!0)j=!1,q.logger.warn('$ref: keywords ignored in schema at path "'+q.errSchemaPath+'"')}if(q.schema.$comment&&q.opts.$comment)$+=" "+q.RULES.all.$comment.code(q,"$comment");if(C){if(q.opts.coerceTypes)var r=q.util.coerceToTypes(q.opts.coerceTypes,C);var A=q.RULES.types[C];if(r||a||A===!0||A&&!dq(A)){var H=q.schemaPath+".type",h=q.errSchemaPath+"/type",H=q.schemaPath+".type",h=q.errSchemaPath+"/type",u=a?"checkDataTypes":"checkDataType";if($+=" if ("+q.util[u](C,J,q.opts.strictNumbers,!0)+") { ",r){var m="dataType"+T,S="coerced"+T;if($+=" var "+m+" = typeof "+J+"; var "+S+" = undefined; ",q.opts.coerceTypes=="array")$+=" if ("+m+" == 'object' && Array.isArray("+J+") && "+J+".length == 1) { "+J+" = "+J+"[0]; "+m+" = typeof "+J+"; if ("+q.util.checkDataType(q.schema.type,J,q.opts.strictNumbers)+") "+S+" = "+J+"; } ";$+=" if ("+S+" !== undefined) ; ";var I=r;if(I){var D,c=-1,e=I.length-1;while(c<e)if(D=I[c+=1],D=="string")$+=" else if ("+m+" == 'number' || "+m+" == 'boolean') "+S+" = '' + "+J+"; else if ("+J+" === null) "+S+" = ''; ";else if(D=="number"||D=="integer"){if($+=" else if ("+m+" == 'boolean' || "+J+" === null || ("+m+" == 'string' && "+J+" && "+J+" == +"+J+" ",D=="integer")$+=" && !("+J+" % 1)";$+=")) "+S+" = +"+J+"; "}else if(D=="boolean")$+=" else if ("+J+" === 'false' || "+J+" === 0 || "+J+" === null) "+S+" = false; else if ("+J+" === 'true' || "+J+" === 1) "+S+" = true; ";else if(D=="null")$+=" else if ("+J+" === '' || "+J+" === 0 || "+J+" === false) "+S+" = null; ";else if(q.opts.coerceTypes=="array"&&D=="array")$+=" else if ("+m+" == 'string' || "+m+" == 'number' || "+m+" == 'boolean' || "+J+" == null) "+S+" = ["+J+"]; "}$+=" else { ";var k=k||[];if(k.push($),$="",q.createErrors!==!1){if($+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(h)+" , params: { type: '",a)$+=""+C.join(",");else $+=""+C;if($+="' } ",q.opts.messages!==!1){if($+=" , message: 'should be ",a)$+=""+C.join(",");else $+=""+C;$+="' "}if(q.opts.verbose)$+=" , schema: validate.schema"+H+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+J+" ";$+=" } "}else $+=" {} ";var X=$;if($=k.pop(),!q.compositeRule&&R)if(q.async)$+=" throw new ValidationError(["+X+"]); ";else $+=" validate.errors = ["+X+"]; return false; ";else $+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";$+=" } if ("+S+" !== undefined) { ";var L=Y?"data"+(Y-1||""):"parentData",Q=Y?q.dataPathArr[Y]:"parentDataProperty";if($+=" "+J+" = "+S+"; ",!Y)$+="if ("+L+" !== undefined)";$+=" "+L+"["+Q+"] = "+S+"; } "}else{var k=k||[];if(k.push($),$="",q.createErrors!==!1){if($+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(h)+" , params: { type: '",a)$+=""+C.join(",");else $+=""+C;if($+="' } ",q.opts.messages!==!1){if($+=" , message: 'should be ",a)$+=""+C.join(",");else $+=""+C;$+="' "}if(q.opts.verbose)$+=" , schema: validate.schema"+H+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+J+" ";$+=" } "}else $+=" {} ";var X=$;if($=k.pop(),!q.compositeRule&&R)if(q.async)$+=" throw new ValidationError(["+X+"]); ";else $+=" validate.errors = ["+X+"]; return false; ";else $+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}$+=" } "}}if(q.schema.$ref&&!j){if($+=" "+q.RULES.all.$ref.code(q,"$ref")+" ",R){if($+=" } if (errors === ",l)$+="0";else $+="errs_"+T;$+=") { ",V+="}"}}else{var Hq=q.RULES;if(Hq){var A,Pq=-1,_q=Hq.length-1;while(Pq<_q)if(A=Hq[Pq+=1],dq(A)){if(A.type)$+=" if ("+q.util.checkDataType(A.type,J,q.opts.strictNumbers)+") { ";if(q.opts.useDefaults){if(A.type=="object"&&q.schema.properties){var z=q.schema.properties,kq=Object.keys(z),gq=kq;if(gq){var iq,x_=-1,n_=gq.length-1;while(x_<n_){iq=gq[x_+=1];var Nq=z[iq];if(Nq.default!==void 0){var Vq=J+q.util.getProperty(iq);if(q.compositeRule){if(q.opts.strictDefaults){var N="default is ignored for: "+Vq;if(q.opts.strictDefaults==="log")q.logger.warn(N);else throw new Error(N)}}else{if($+=" if ("+Vq+" === undefined ",q.opts.useDefaults=="empty")$+=" || "+Vq+" === null || "+Vq+" === '' ";if($+=" ) "+Vq+" = ",q.opts.useDefaults=="shared")$+=" "+q.useDefault(Nq.default)+" ";else $+=" "+JSON.stringify(Nq.default)+" ";$+="; "}}}}}else if(A.type=="array"&&Array.isArray(q.schema.items)){var H8=q.schema.items;if(H8){var Nq,c=-1,Dq=H8.length-1;while(c<Dq)if(Nq=H8[c+=1],Nq.default!==void 0){var Vq=J+"["+c+"]";if(q.compositeRule){if(q.opts.strictDefaults){var N="default is ignored for: "+Vq;if(q.opts.strictDefaults==="log")q.logger.warn(N);else throw new Error(N)}}else{if($+=" if ("+Vq+" === undefined ",q.opts.useDefaults=="empty")$+=" || "+Vq+" === null || "+Vq+" === '' ";if($+=" ) "+Vq+" = ",q.opts.useDefaults=="shared")$+=" "+q.useDefault(Nq.default)+" ";else $+=" "+JSON.stringify(Nq.default)+" ";$+="; "}}}}}var zq=A.rules;if(zq){var s_,R_=-1,h8=zq.length-1;while(R_<h8)if(s_=zq[R_+=1],__(s_)){var J8=s_.code(q,s_.keyword,A.type);if(J8){if($+=" "+J8+" ",R)g+="}"}}}if(R)$+=" "+g+" ",g="";if(A.type){if($+=" } ",C&&C===A.type&&!r){$+=" else { ";var H=q.schemaPath+".type",h=q.errSchemaPath+"/type",k=k||[];if(k.push($),$="",q.createErrors!==!1){if($+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(h)+" , params: { type: '",a)$+=""+C.join(",");else $+=""+C;if($+="' } ",q.opts.messages!==!1){if($+=" , message: 'should be ",a)$+=""+C.join(",");else $+=""+C;$+="' "}if(q.opts.verbose)$+=" , schema: validate.schema"+H+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+J+" ";$+=" } "}else $+=" {} ";var X=$;if($=k.pop(),!q.compositeRule&&R)if(q.async)$+=" throw new ValidationError(["+X+"]); ";else $+=" validate.errors = ["+X+"]; return false; ";else $+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";$+=" } "}}if(R){if($+=" if (errors === ",l)$+="0";else $+="errs_"+T;$+=") { ",V+="}"}}}}if(R)$+=" "+V+" ";if(l){if(P)$+=" if (errors === 0) return data; ",$+=" else throw new ValidationError(vErrors); ";else $+=" validate.errors = vErrors; ",$+=" return errors === 0; ";$+=" }; return validate;"}else $+=" var "+n+" = errors === errs_"+T+";";function dq(oq){var G_=oq.rules;for(var Uq=0;Uq<G_.length;Uq++)if(__(G_[Uq]))return!0}function __(oq){return q.schema[oq.keyword]!==void 0||oq.implements&&tq(oq)}function tq(oq){var G_=oq.implements;for(var Uq=0;Uq<G_.length;Uq++)if(q.schema[G_[Uq]]!==void 0)return!0}return $}});var _j=p((LC,qj)=>{var W$=T$(),h$=b8(),F7=z$(),Xz=hP(),U7=JP(),Az=h$.ucs2length,uz=K$(),Gz=F7.Validation;qj.exports=kP;function kP(_,q,f,K){var $=this,P=this._opts,j=[void 0],v={},w=[],O={},T=[],Y={},z=[];q=q||{schema:_,refVal:j,refs:v};var H=mz.call(this,_,q,K),h=this._compilations[H.index];if(H.compiling)return h.callValidate=N;var J=this._formats,k=this.RULES;try{var X=n(_,q,f,K);h.validate=X;var l=h.callValidate;if(l){if(l.schema=X.schema,l.errors=null,l.refs=X.refs,l.refVal=X.refVal,l.root=X.root,l.$async=X.$async,P.sourceCode)l.source=X.source}return X}finally{rz.call(this,_,q,K)}function N(){var u=h.validate,m=u.apply(this,arguments);return N.errors=u.errors,m}function n(u,m,S,I){var D=!m||m&&m.schema==u;if(m.schema!=q.schema)return kP.call($,u,m,S,I);var c=u.$async===!0,e=U7({isTop:!0,schema:u,isRoot:D,baseId:I,root:m,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:F7.MissingRef,RULES:k,validate:U7,util:h$,resolve:W$,resolveRef:R,usePattern:a,useDefault:r,useCustomRule:A,opts:P,formats:J,logger:$.logger,self:$});if(e=H$(j,Mz)+H$(w,bz)+H$(T,Vz)+H$(z,Sz)+e,P.processCode)e=P.processCode(e,u);var L;try{var Q=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",e);L=Q($,k,J,q,j,T,z,uz,Az,Gz),j[0]=L}catch(Hq){throw $.logger.error("Error compiling schema, function code:",e),Hq}if(L.schema=u,L.errors=null,L.refs=v,L.refVal=j,L.root=D?L:m,c)L.$async=!0;if(P.sourceCode===!0)L.source={code:e,patterns:w,defaults:T};return L}function R(u,m,S){m=W$.url(u,m);var I=v[m],D,c;if(I!==void 0)return D=j[I],c="refVal["+I+"]",C(D,c);if(!S&&q.refs){var e=q.refs[m];if(e!==void 0)return D=q.refVal[e],c=g(m,D),C(D,c)}c=g(m);var L=W$.call($,n,q,m);if(L===void 0){var Q=f&&f[m];if(Q)L=W$.inlineRef(Q,P.inlineRefs)?Q:kP.call($,Q,q,f,u)}if(L===void 0)V(m);else return M(m,L),C(L,c)}function g(u,m){var S=j.length;return j[S]=m,v[u]=S,"refVal"+S}function V(u){delete v[u]}function M(u,m){var S=v[u];j[S]=m}function C(u,m){return typeof u=="object"||typeof u=="boolean"?{code:m,schema:u,inline:!0}:{code:m,$async:u&&!!u.$async}}function a(u){var m=O[u];if(m===void 0)m=O[u]=w.length,w[m]=u;return"pattern"+m}function r(u){switch(typeof u){case"boolean":case"number":return""+u;case"string":return h$.toQuotedString(u);case"object":if(u===null)return"null";var m=Xz(u),S=Y[m];if(S===void 0)S=Y[m]=T.length,T[S]=u;return"default"+S}}function A(u,m,S,I){if($._opts.validateSchema!==!1){var D=u.definition.dependencies;if(D&&!D.every(function(gq){return Object.prototype.hasOwnProperty.call(S,gq)}))throw new Error("parent schema must have all required keywords: "+D.join(","));var c=u.definition.validateSchema;if(c){var e=c(m);if(!e){var L="keyword schema is invalid: "+$.errorsText(c.errors);if($._opts.validateSchema=="log")$.logger.error(L);else throw new Error(L)}}}var Q=u.definition.compile,Hq=u.definition.inline,Pq=u.definition.macro,_q;if(Q)_q=Q.call($,m,S,I);else if(Pq){if(_q=Pq.call($,m,S,I),P.validateSchema!==!1)$.validateSchema(_q,!0)}else if(Hq)_q=Hq.call($,I,u.keyword,m,S);else if(_q=u.definition.validate,!_q)return;if(_q===void 0)throw new Error('custom keyword "'+u.keyword+'"failed to compile');var kq=z.length;return z[kq]=_q,{code:"customRule"+kq,validate:_q}}}function mz(_,q,f){var K=Q7.call(this,_,q,f);if(K>=0)return{index:K,compiling:!0};return K=this._compilations.length,this._compilations[K]={schema:_,root:q,baseId:f},{index:K,compiling:!1}}function rz(_,q,f){var K=Q7.call(this,_,q,f);if(K>=0)this._compilations.splice(K,1)}function Q7(_,q,f){for(var K=0;K<this._compilations.length;K++){var $=this._compilations[K];if($.schema==_&&$.root==q&&$.baseId==f)return K}return-1}function bz(_,q){return"var pattern"+_+" = new RegExp("+h$.toQuotedString(q[_])+");"}function Vz(_){return"var default"+_+" = defaults["+_+"];"}function Mz(_,q){return q[_]===void 0?"":"var refVal"+_+" = refVal["+_+"];"}function Sz(_){return"var customRule"+_+" = customRules["+_+"];"}function H$(_,q){if(!_.length)return"";var f="";for(var K=0;K<_.length;K++)f+=q(K,_);return f}});var $j=p((tC,fj)=>{var J$=fj.exports=function _(){this._cache={}};J$.prototype.put=function _(q,f){this._cache[q]=f};J$.prototype.get=function _(q){return this._cache[q]};J$.prototype.del=function _(q){delete this._cache[q]};J$.prototype.clear=function _(){this._cache={}}});var hj=p((eC,Hj)=>{var Nz=b8(),Cz=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,pz=[0,31,28,31,30,31,30,31,31,30,31,30,31],lz=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Kj=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,nz=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Rz=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Pj=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,jj=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,vj=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,wj=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Oj=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Yj=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Hj.exports=k$;function k$(_){return _=_=="full"?"full":"fast",Nz.copy(k$[_])}k$.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":Pj,url:jj,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:Kj,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:Wj,uuid:vj,"json-pointer":wj,"json-pointer-uri-fragment":Oj,"relative-json-pointer":Yj};k$.full={date:Tj,time:zj,"date-time":dz,uri:Iz,"uri-reference":Rz,"uri-template":Pj,url:jj,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:Kj,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:Wj,uuid:vj,"json-pointer":wj,"json-pointer-uri-fragment":Oj,"relative-json-pointer":Yj};function Ez(_){return _%4===0&&(_%100!==0||_%400===0)}function Tj(_){var q=_.match(Cz);if(!q)return!1;var f=+q[1],K=+q[2],$=+q[3];return K>=1&&K<=12&&$>=1&&$<=(K==2&&Ez(f)?29:pz[K])}function zj(_,q){var f=_.match(lz);if(!f)return!1;var K=f[1],$=f[2],P=f[3],j=f[5];return(K<=23&&$<=59&&P<=59||K==23&&$==59&&P==60)&&(!q||j)}var gz=/t|\s/i;function dz(_){var q=_.split(gz);return q.length==2&&Tj(q[0])&&zj(q[1],!0)}var az=/\/|:/;function Iz(_){return az.test(_)&&nz.test(_)}var Dz=/[^\\]\\Z/;function Wj(_){if(Dz.test(_))return!1;try{return new RegExp(_),!0}catch(q){return!1}}});var kj=p((xC,Jj)=>{Jj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.errSchemaPath+"/"+f,O=!q.opts.allErrors,T="data"+(j||""),Y="valid"+P,z,H;if(v=="#"||v=="#/")if(q.isRoot)z=q.async,H="validate";else z=q.root.schema.$async===!0,H="root.refVal[0]";else{var h=q.resolveRef(q.baseId,v,q.isRoot);if(h===void 0){var J=q.MissingRefError.message(q.baseId,v);if(q.opts.missingRefs=="fail"){q.logger.error(J);var k=k||[];if(k.push($),$="",q.createErrors!==!1){if($+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(w)+" , params: { ref: '"+q.util.escapeQuotes(v)+"' } ",q.opts.messages!==!1)$+=" , message: 'can\\'t resolve reference "+q.util.escapeQuotes(v)+"' ";if(q.opts.verbose)$+=" , schema: "+q.util.toQuotedString(v)+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+T+" ";$+=" } "}else $+=" {} ";var X=$;if($=k.pop(),!q.compositeRule&&O)if(q.async)$+=" throw new ValidationError(["+X+"]); ";else $+=" validate.errors = ["+X+"]; return false; ";else $+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(O)$+=" if (false) { "}else if(q.opts.missingRefs=="ignore"){if(q.logger.warn(J),O)$+=" if (true) { "}else throw new q.MissingRefError(q.baseId,v,J)}else if(h.inline){var l=q.util.copy(q);l.level++;var N="valid"+l.level;l.schema=h.schema,l.schemaPath="",l.errSchemaPath=v;var n=q.validate(l).replace(/validate\.schema/g,h.code);if($+=" "+n+" ",O)$+=" if ("+N+") { "}else z=h.$async===!0||q.async&&h.$async!==!1,H=h.code}if(H){var k=k||[];if(k.push($),$="",q.opts.passContext)$+=" "+H+".call(this, ";else $+=" "+H+"( ";if($+=" "+T+", (dataPath || '')",q.errorPath!='""')$+=" + "+q.errorPath;var R=j?"data"+(j-1||""):"parentData",g=j?q.dataPathArr[j]:"parentDataProperty";$+=" , "+R+" , "+g+", rootData) ";var V=$;if($=k.pop(),z){if(!q.async)throw new Error("async schema referenced by sync schema");if(O)$+=" var "+Y+"; ";if($+=" try { await "+V+"; ",O)$+=" "+Y+" = true; ";if($+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",O)$+=" "+Y+" = false; ";if($+=" } ",O)$+=" if ("+Y+") { "}else if($+=" if (!"+V+") { if (vErrors === null) vErrors = "+H+".errors; else vErrors = vErrors.concat("+H+".errors); errors = vErrors.length; } ",O)$+=" else { "}return $}});var Xj=p((sC,Zj)=>{Zj.exports=function _(q,f,K){var $=" ",P=q.schema[f],j=q.schemaPath+q.util.getProperty(f),v=q.errSchemaPath+"/"+f,w=!q.opts.allErrors,O=q.util.copy(q),T="";O.level++;var Y="valid"+O.level,z=O.baseId,H=!0,h=P;if(h){var J,k=-1,X=h.length-1;while(k<X)if(J=h[k+=1],q.opts.strictKeywords?typeof J=="object"&&Object.keys(J).length>0||J===!1:q.util.schemaHasRules(J,q.RULES.all)){if(H=!1,O.schema=J,O.schemaPath=j+"["+k+"]",O.errSchemaPath=v+"/"+k,$+=" "+q.validate(O)+" ",O.baseId=z,w)$+=" if ("+Y+") { ",T+="}"}}if(w)if(H)$+=" if (true) { ";else $+=" "+T.slice(0,-1)+" ";return $}});var uj=p((BC,Aj)=>{Aj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="valid"+P,H="errs__"+P,h=q.util.copy(q),J="";h.level++;var k="valid"+h.level,X=v.every(function(M){return q.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:q.util.schemaHasRules(M,q.RULES.all)});if(X){var l=h.baseId;$+=" var "+H+" = errors; var "+z+" = false; ";var N=q.compositeRule;q.compositeRule=h.compositeRule=!0;var n=v;if(n){var R,g=-1,V=n.length-1;while(g<V)R=n[g+=1],h.schema=R,h.schemaPath=w+"["+g+"]",h.errSchemaPath=O+"/"+g,$+=" "+q.validate(h)+" ",h.baseId=l,$+=" "+z+" = "+z+" || "+k+"; if (!"+z+") { ",J+="}"}if(q.compositeRule=h.compositeRule=N,$+=" "+J+" if (!"+z+") { var err = ",q.createErrors!==!1){if($+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: {} ",q.opts.messages!==!1)$+=" , message: 'should match some schema in anyOf' ";if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";if($+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(vErrors); ";else $+=" validate.errors = vErrors; return false; ";if($+=" } else { errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ",q.opts.allErrors)$+=" } "}else if(T)$+=" if (true) { ";return $}});var mj=p((UC,Gj)=>{Gj.exports=function _(q,f,K){var $=" ",P=q.schema[f],j=q.errSchemaPath+"/"+f,v=!q.opts.allErrors,w=q.util.toQuotedString(P);if(q.opts.$comment===!0)$+=" console.log("+w+");";else if(typeof q.opts.$comment=="function")$+=" self._opts.$comment("+w+", "+q.util.toQuotedString(j)+", validate.root.schema);";return $}});var bj=p((FC,rj)=>{rj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="valid"+P,H=q.opts.$data&&v&&v.$data,h;if(H)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",h="schema"+P;else h=v;if(!H)$+=" var schema"+P+" = validate.schema"+w+";";$+="var "+z+" = equal("+Y+", schema"+P+"); if (!"+z+") { ";var J=J||[];if(J.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'const' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { allowedValue: schema"+P+" } ",q.opts.messages!==!1)$+=" , message: 'should be equal to constant' ";if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var k=$;if($=J.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+k+"]); ";else $+=" validate.errors = ["+k+"]; return false; ";else $+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+=" }",T)$+=" else { ";return $}});var Mj=p((QC,Vj)=>{Vj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="valid"+P,H="errs__"+P,h=q.util.copy(q),J="";h.level++;var k="valid"+h.level,X="i"+P,l=h.dataLevel=q.dataLevel+1,N="data"+l,n=q.baseId,R=q.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:q.util.schemaHasRules(v,q.RULES.all);if($+="var "+H+" = errors;var "+z+";",R){var g=q.compositeRule;q.compositeRule=h.compositeRule=!0,h.schema=v,h.schemaPath=w,h.errSchemaPath=O,$+=" var "+k+" = false; for (var "+X+" = 0; "+X+" < "+Y+".length; "+X+"++) { ",h.errorPath=q.util.getPathExpr(q.errorPath,X,q.opts.jsonPointers,!0);var V=Y+"["+X+"]";h.dataPathArr[l]=X;var M=q.validate(h);if(h.baseId=n,q.util.varOccurences(M,N)<2)$+=" "+q.util.varReplace(M,N,V)+" ";else $+=" var "+N+" = "+V+"; "+M+" ";$+=" if ("+k+") break; } ",q.compositeRule=h.compositeRule=g,$+=" "+J+" if (!"+k+") {"}else $+=" if ("+Y+".length == 0) {";var C=C||[];if(C.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: {} ",q.opts.messages!==!1)$+=" , message: 'should contain a valid item' ";if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var a=$;if($=C.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+a+"]); ";else $+=" validate.errors = ["+a+"]; return false; ";else $+=" var err = "+a+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+=" } else { ",R)$+=" errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ";if(q.opts.allErrors)$+=" } ";return $}});var Nj=p((qp,Sj)=>{Sj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="errs__"+P,H=q.util.copy(q),h="";H.level++;var J="valid"+H.level,k={},X={},l=q.opts.ownProperties;for(g in v){if(g=="__proto__")continue;var N=v[g],n=Array.isArray(N)?X:k;n[g]=N}$+="var "+z+" = errors;";var R=q.errorPath;$+="var missing"+P+";";for(var g in X)if(n=X[g],n.length){if($+=" if ( "+Y+q.util.getProperty(g)+" !== undefined ",l)$+=" && Object.prototype.hasOwnProperty.call("+Y+", '"+q.util.escapeQuotes(g)+"') ";if(T){$+=" && ( ";var V=n;if(V){var M,C=-1,a=V.length-1;while(C<a){if(M=V[C+=1],C)$+=" || ";var r=q.util.getProperty(M),A=Y+r;if($+=" ( ( "+A+" === undefined ",l)$+=" || ! Object.prototype.hasOwnProperty.call("+Y+", '"+q.util.escapeQuotes(M)+"') ";$+=") && (missing"+P+" = "+q.util.toQuotedString(q.opts.jsonPointers?M:r)+") ) "}}$+=")) { ";var u="missing"+P,m="' + "+u+" + '";if(q.opts._errorDataPathProperty)q.errorPath=q.opts.jsonPointers?q.util.getPathExpr(R,u,!0):R+" + "+u;var S=S||[];if(S.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { property: '"+q.util.escapeQuotes(g)+"', missingProperty: '"+m+"', depsCount: "+n.length+", deps: '"+q.util.escapeQuotes(n.length==1?n[0]:n.join(", "))+"' } ",q.opts.messages!==!1){if($+=" , message: 'should have ",n.length==1)$+="property "+q.util.escapeQuotes(n[0]);else $+="properties "+q.util.escapeQuotes(n.join(", "));$+=" when property "+q.util.escapeQuotes(g)+" is present' "}if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var I=$;if($=S.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+I+"]); ";else $+=" validate.errors = ["+I+"]; return false; ";else $+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{$+=" ) { ";var D=n;if(D){var M,c=-1,e=D.length-1;while(c<e){M=D[c+=1];var r=q.util.getProperty(M),m=q.util.escapeQuotes(M),A=Y+r;if(q.opts._errorDataPathProperty)q.errorPath=q.util.getPath(R,M,q.opts.jsonPointers);if($+=" if ( "+A+" === undefined ",l)$+=" || ! Object.prototype.hasOwnProperty.call("+Y+", '"+q.util.escapeQuotes(M)+"') ";if($+=") { var err = ",q.createErrors!==!1){if($+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { property: '"+q.util.escapeQuotes(g)+"', missingProperty: '"+m+"', depsCount: "+n.length+", deps: '"+q.util.escapeQuotes(n.length==1?n[0]:n.join(", "))+"' } ",q.opts.messages!==!1){if($+=" , message: 'should have ",n.length==1)$+="property "+q.util.escapeQuotes(n[0]);else $+="properties "+q.util.escapeQuotes(n.join(", "));$+=" when property "+q.util.escapeQuotes(g)+" is present' "}if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";$+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}if($+=" } ",T)h+="}",$+=" else { "}q.errorPath=R;var L=H.baseId;for(var g in k){var N=k[g];if(q.opts.strictKeywords?typeof N=="object"&&Object.keys(N).length>0||N===!1:q.util.schemaHasRules(N,q.RULES.all)){if($+=" "+J+" = true; if ( "+Y+q.util.getProperty(g)+" !== undefined ",l)$+=" && Object.prototype.hasOwnProperty.call("+Y+", '"+q.util.escapeQuotes(g)+"') ";if($+=") { ",H.schema=N,H.schemaPath=w+q.util.getProperty(g),H.errSchemaPath=O+"/"+q.util.escapeFragment(g),$+=" "+q.validate(H)+" ",H.baseId=L,$+=" } ",T)$+=" if ("+J+") { ",h+="}"}}if(T)$+=" "+h+" if ("+z+" == errors) {";return $}});var pj=p((_p,Cj)=>{Cj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="valid"+P,H=q.opts.$data&&v&&v.$data,h;if(H)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",h="schema"+P;else h=v;var J="i"+P,k="schema"+P;if(!H)$+=" var "+k+" = validate.schema"+w+";";if($+="var "+z+";",H)$+=" if (schema"+P+" === undefined) "+z+" = true; else if (!Array.isArray(schema"+P+")) "+z+" = false; else {";if($+=""+z+" = false;for (var "+J+"=0; "+J+"<"+k+".length; "+J+"++) if (equal("+Y+", "+k+"["+J+"])) { "+z+" = true; break; }",H)$+=" } ";$+=" if (!"+z+") { ";var X=X||[];if(X.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { allowedValues: schema"+P+" } ",q.opts.messages!==!1)$+=" , message: 'should be equal to one of the allowed values' ";if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var l=$;if($=X.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+l+"]); ";else $+=" validate.errors = ["+l+"]; return false; ";else $+=" var err = "+l+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+=" }",T)$+=" else { ";return $}});var nj=p((fp,lj)=>{lj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||"");if(q.opts.format===!1){if(T)$+=" if (true) { ";return $}var z=q.opts.$data&&v&&v.$data,H;if(z)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",H="schema"+P;else H=v;var h=q.opts.unknownFormats,J=Array.isArray(h);if(z){var k="format"+P,X="isObject"+P,l="formatType"+P;if($+=" var "+k+" = formats["+H+"]; var "+X+" = typeof "+k+" == 'object' && !("+k+" instanceof RegExp) && "+k+".validate; var "+l+" = "+X+" && "+k+".type || 'string'; if ("+X+") { ",q.async)$+=" var async"+P+" = "+k+".async; ";if($+=" "+k+" = "+k+".validate; } if ( ",z)$+=" ("+H+" !== undefined && typeof "+H+" != 'string') || ";if($+=" (",h!="ignore"){if($+=" ("+H+" && !"+k+" ",J)$+=" && self._opts.unknownFormats.indexOf("+H+") == -1 ";$+=") || "}if($+=" ("+k+" && "+l+" == '"+K+"' && !(typeof "+k+" == 'function' ? ",q.async)$+=" (async"+P+" ? await "+k+"("+Y+") : "+k+"("+Y+")) ";else $+=" "+k+"("+Y+") ";$+=" : "+k+".test("+Y+"))))) {"}else{var k=q.formats[v];if(!k)if(h=="ignore"){if(q.logger.warn('unknown format "'+v+'" ignored in schema at path "'+q.errSchemaPath+'"'),T)$+=" if (true) { ";return $}else if(J&&h.indexOf(v)>=0){if(T)$+=" if (true) { ";return $}else throw new Error('unknown format "'+v+'" is used in schema at path "'+q.errSchemaPath+'"');var X=typeof k=="object"&&!(k instanceof RegExp)&&k.validate,l=X&&k.type||"string";if(X){var N=k.async===!0;k=k.validate}if(l!=K){if(T)$+=" if (true) { ";return $}if(N){if(!q.async)throw new Error("async format in sync schema");var n="formats"+q.util.getProperty(v)+".validate";$+=" if (!(await "+n+"("+Y+"))) { "}else{$+=" if (! ";var n="formats"+q.util.getProperty(v);if(X)n+=".validate";if(typeof k=="function")$+=" "+n+"("+Y+") ";else $+=" "+n+".test("+Y+") ";$+=") { "}}var R=R||[];if(R.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'format' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { format: ",z)$+=""+H;else $+=""+q.util.toQuotedString(v);if($+=" } ",q.opts.messages!==!1){if($+=` , message: 'should match format "`,z)$+="' + "+H+" + '";else $+=""+q.util.escapeQuotes(v);$+=`"' `}if(q.opts.verbose){if($+=" , schema: ",z)$+="validate.schema"+w;else $+=""+q.util.toQuotedString(v);$+=" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" "}$+=" } "}else $+=" {} ";var g=$;if($=R.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+g+"]); ";else $+=" validate.errors = ["+g+"]; return false; ";else $+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+=" } ",T)$+=" else { ";return $}});var Ej=p(($p,Rj)=>{Rj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="valid"+P,H="errs__"+P,h=q.util.copy(q);h.level++;var J="valid"+h.level,k=q.schema.then,X=q.schema.else,l=k!==void 0&&(q.opts.strictKeywords?typeof k=="object"&&Object.keys(k).length>0||k===!1:q.util.schemaHasRules(k,q.RULES.all)),N=X!==void 0&&(q.opts.strictKeywords?typeof X=="object"&&Object.keys(X).length>0||X===!1:q.util.schemaHasRules(X,q.RULES.all)),n=h.baseId;if(l||N){var R;h.createErrors=!1,h.schema=v,h.schemaPath=w,h.errSchemaPath=O,$+=" var "+H+" = errors; var "+z+" = true; ";var g=q.compositeRule;if(q.compositeRule=h.compositeRule=!0,$+=" "+q.validate(h)+" ",h.baseId=n,h.createErrors=!0,$+=" errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ",q.compositeRule=h.compositeRule=g,l){if($+=" if ("+J+") { ",h.schema=q.schema.then,h.schemaPath=q.schemaPath+".then",h.errSchemaPath=q.errSchemaPath+"/then",$+=" "+q.validate(h)+" ",h.baseId=n,$+=" "+z+" = "+J+"; ",l&&N)R="ifClause"+P,$+=" var "+R+" = 'then'; ";else R="'then'";if($+=" } ",N)$+=" else { "}else $+=" if (!"+J+") { ";if(N){if(h.schema=q.schema.else,h.schemaPath=q.schemaPath+".else",h.errSchemaPath=q.errSchemaPath+"/else",$+=" "+q.validate(h)+" ",h.baseId=n,$+=" "+z+" = "+J+"; ",l&&N)R="ifClause"+P,$+=" var "+R+" = 'else'; ";else R="'else'";$+=" } "}if($+=" if (!"+z+") { var err = ",q.createErrors!==!1){if($+=" { keyword: 'if' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { failingKeyword: "+R+" } ",q.opts.messages!==!1)$+=` , message: 'should match "' + `+R+` + '" schema' `;if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";if($+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(vErrors); ";else $+=" validate.errors = vErrors; return false; ";if($+=" } ",T)$+=" else { "}else if(T)$+=" if (true) { ";return $}});var dj=p((Kp,gj)=>{gj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="valid"+P,H="errs__"+P,h=q.util.copy(q),J="";h.level++;var k="valid"+h.level,X="i"+P,l=h.dataLevel=q.dataLevel+1,N="data"+l,n=q.baseId;if($+="var "+H+" = errors;var "+z+";",Array.isArray(v)){var R=q.schema.additionalItems;if(R===!1){$+=" "+z+" = "+Y+".length <= "+v.length+"; ";var g=O;O=q.errSchemaPath+"/additionalItems",$+=" if (!"+z+") { ";var V=V||[];if(V.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { limit: "+v.length+" } ",q.opts.messages!==!1)$+=" , message: 'should NOT have more than "+v.length+" items' ";if(q.opts.verbose)$+=" , schema: false , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var M=$;if($=V.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+M+"]); ";else $+=" validate.errors = ["+M+"]; return false; ";else $+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+=" } ",O=g,T)J+="}",$+=" else { "}var C=v;if(C){var a,r=-1,A=C.length-1;while(r<A)if(a=C[r+=1],q.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:q.util.schemaHasRules(a,q.RULES.all)){$+=" "+k+" = true; if ("+Y+".length > "+r+") { ";var u=Y+"["+r+"]";h.schema=a,h.schemaPath=w+"["+r+"]",h.errSchemaPath=O+"/"+r,h.errorPath=q.util.getPathExpr(q.errorPath,r,q.opts.jsonPointers,!0),h.dataPathArr[l]=r;var m=q.validate(h);if(h.baseId=n,q.util.varOccurences(m,N)<2)$+=" "+q.util.varReplace(m,N,u)+" ";else $+=" var "+N+" = "+u+"; "+m+" ";if($+=" } ",T)$+=" if ("+k+") { ",J+="}"}}if(typeof R=="object"&&(q.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:q.util.schemaHasRules(R,q.RULES.all))){h.schema=R,h.schemaPath=q.schemaPath+".additionalItems",h.errSchemaPath=q.errSchemaPath+"/additionalItems",$+=" "+k+" = true; if ("+Y+".length > "+v.length+") { for (var "+X+" = "+v.length+"; "+X+" < "+Y+".length; "+X+"++) { ",h.errorPath=q.util.getPathExpr(q.errorPath,X,q.opts.jsonPointers,!0);var u=Y+"["+X+"]";h.dataPathArr[l]=X;var m=q.validate(h);if(h.baseId=n,q.util.varOccurences(m,N)<2)$+=" "+q.util.varReplace(m,N,u)+" ";else $+=" var "+N+" = "+u+"; "+m+" ";if(T)$+=" if (!"+k+") break; ";if($+=" } } ",T)$+=" if ("+k+") { ",J+="}"}}else if(q.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:q.util.schemaHasRules(v,q.RULES.all)){h.schema=v,h.schemaPath=w,h.errSchemaPath=O,$+=" for (var "+X+" = 0; "+X+" < "+Y+".length; "+X+"++) { ",h.errorPath=q.util.getPathExpr(q.errorPath,X,q.opts.jsonPointers,!0);var u=Y+"["+X+"]";h.dataPathArr[l]=X;var m=q.validate(h);if(h.baseId=n,q.util.varOccurences(m,N)<2)$+=" "+q.util.varReplace(m,N,u)+" ";else $+=" var "+N+" = "+u+"; "+m+" ";if(T)$+=" if (!"+k+") break; ";$+=" }"}if(T)$+=" "+J+" if ("+H+" == errors) {";return $}});var ZP=p((Pp,aj)=>{aj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,n,Y="data"+(j||""),z=q.opts.$data&&v&&v.$data,H;if(z)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",H="schema"+P;else H=v;var h=f=="maximum",J=h?"exclusiveMaximum":"exclusiveMinimum",k=q.schema[J],X=q.opts.$data&&k&&k.$data,l=h?"<":">",N=h?">":"<",n=void 0;if(!(z||typeof v=="number"||v===void 0))throw new Error(f+" must be number");if(!(X||k===void 0||typeof k=="number"||typeof k=="boolean"))throw new Error(J+" must be number or boolean");if(X){var R=q.util.getData(k.$data,j,q.dataPathArr),g="exclusive"+P,V="exclType"+P,M="exclIsNumber"+P,C="op"+P,a="' + "+C+" + '";$+=" var schemaExcl"+P+" = "+R+"; ",R="schemaExcl"+P,$+=" var "+g+"; var "+V+" = typeof "+R+"; if ("+V+" != 'boolean' && "+V+" != 'undefined' && "+V+" != 'number') { ";var n=J,r=r||[];if(r.push($),$="",q.createErrors!==!1){if($+=" { keyword: '"+(n||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: {} ",q.opts.messages!==!1)$+=" , message: '"+J+" should be boolean' ";if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var A=$;if($=r.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+A+"]); ";else $+=" validate.errors = ["+A+"]; return false; ";else $+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+=" } else if ( ",z)$+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";if($+=" "+V+" == 'number' ? ( ("+g+" = "+H+" === undefined || "+R+" "+l+"= "+H+") ? "+Y+" "+N+"= "+R+" : "+Y+" "+N+" "+H+" ) : ( ("+g+" = "+R+" === true) ? "+Y+" "+N+"= "+H+" : "+Y+" "+N+" "+H+" ) || "+Y+" !== "+Y+") { var op"+P+" = "+g+" ? '"+l+"' : '"+l+"='; ",v===void 0)n=J,O=q.errSchemaPath+"/"+J,H=R,z=X}else{var M=typeof k=="number",a=l;if(M&&z){var C="'"+a+"'";if($+=" if ( ",z)$+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";$+=" ( "+H+" === undefined || "+k+" "+l+"= "+H+" ? "+Y+" "+N+"= "+k+" : "+Y+" "+N+" "+H+" ) || "+Y+" !== "+Y+") { "}else{if(M&&v===void 0)g=!0,n=J,O=q.errSchemaPath+"/"+J,H=k,N+="=";else{if(M)H=Math[h?"min":"max"](k,v);if(k===(M?H:!0))g=!0,n=J,O=q.errSchemaPath+"/"+J,N+="=";else g=!1,a+="="}var C="'"+a+"'";if($+=" if ( ",z)$+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";$+=" "+Y+" "+N+" "+H+" || "+Y+" !== "+Y+") { "}}n=n||f;var r=r||[];if(r.push($),$="",q.createErrors!==!1){if($+=" { keyword: '"+(n||"_limit")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { comparison: "+C+", limit: "+H+", exclusive: "+g+" } ",q.opts.messages!==!1)if($+=" , message: 'should be "+a+" ",z)$+="' + "+H;else $+=""+H+"'";if(q.opts.verbose){if($+=" , schema: ",z)$+="validate.schema"+w;else $+=""+v;$+=" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" "}$+=" } "}else $+=" {} ";var A=$;if($=r.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+A+"]); ";else $+=" validate.errors = ["+A+"]; return false; ";else $+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+=" } ",T)$+=" else { ";return $}});var XP=p((jp,Ij)=>{Ij.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,J,Y="data"+(j||""),z=q.opts.$data&&v&&v.$data,H;if(z)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",H="schema"+P;else H=v;if(!(z||typeof v=="number"))throw new Error(f+" must be number");var h=f=="maxItems"?">":"<";if($+="if ( ",z)$+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";$+=" "+Y+".length "+h+" "+H+") { ";var J=f,k=k||[];if(k.push($),$="",q.createErrors!==!1){if($+=" { keyword: '"+(J||"_limitItems")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { limit: "+H+" } ",q.opts.messages!==!1){if($+=" , message: 'should NOT have ",f=="maxItems")$+="more";else $+="fewer";if($+=" than ",z)$+="' + "+H+" + '";else $+=""+v;$+=" items' "}if(q.opts.verbose){if($+=" , schema: ",z)$+="validate.schema"+w;else $+=""+v;$+=" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" "}$+=" } "}else $+=" {} ";var X=$;if($=k.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+X+"]); ";else $+=" validate.errors = ["+X+"]; return false; ";else $+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+="} ",T)$+=" else { ";return $}});var AP=p((vp,Dj)=>{Dj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,J,Y="data"+(j||""),z=q.opts.$data&&v&&v.$data,H;if(z)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",H="schema"+P;else H=v;if(!(z||typeof v=="number"))throw new Error(f+" must be number");var h=f=="maxLength"?">":"<";if($+="if ( ",z)$+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";if(q.opts.unicode===!1)$+=" "+Y+".length ";else $+=" ucs2length("+Y+") ";$+=" "+h+" "+H+") { ";var J=f,k=k||[];if(k.push($),$="",q.createErrors!==!1){if($+=" { keyword: '"+(J||"_limitLength")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { limit: "+H+" } ",q.opts.messages!==!1){if($+=" , message: 'should NOT be ",f=="maxLength")$+="longer";else $+="shorter";if($+=" than ",z)$+="' + "+H+" + '";else $+=""+v;$+=" characters' "}if(q.opts.verbose){if($+=" , schema: ",z)$+="validate.schema"+w;else $+=""+v;$+=" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" "}$+=" } "}else $+=" {} ";var X=$;if($=k.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+X+"]); ";else $+=" validate.errors = ["+X+"]; return false; ";else $+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+="} ",T)$+=" else { ";return $}});var uP=p((wp,yj)=>{yj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,J,Y="data"+(j||""),z=q.opts.$data&&v&&v.$data,H;if(z)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",H="schema"+P;else H=v;if(!(z||typeof v=="number"))throw new Error(f+" must be number");var h=f=="maxProperties"?">":"<";if($+="if ( ",z)$+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";$+=" Object.keys("+Y+").length "+h+" "+H+") { ";var J=f,k=k||[];if(k.push($),$="",q.createErrors!==!1){if($+=" { keyword: '"+(J||"_limitProperties")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { limit: "+H+" } ",q.opts.messages!==!1){if($+=" , message: 'should NOT have ",f=="maxProperties")$+="more";else $+="fewer";if($+=" than ",z)$+="' + "+H+" + '";else $+=""+v;$+=" properties' "}if(q.opts.verbose){if($+=" , schema: ",z)$+="validate.schema"+w;else $+=""+v;$+=" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" "}$+=" } "}else $+=" {} ";var X=$;if($=k.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+X+"]); ";else $+=" validate.errors = ["+X+"]; return false; ";else $+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+="} ",T)$+=" else { ";return $}});var oj=p((Op,ij)=>{ij.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z=q.opts.$data&&v&&v.$data,H;if(z)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",H="schema"+P;else H=v;if(!(z||typeof v=="number"))throw new Error(f+" must be number");if($+="var division"+P+";if (",z)$+=" "+H+" !== undefined && ( typeof "+H+" != 'number' || ";if($+=" (division"+P+" = "+Y+" / "+H+", ",q.opts.multipleOfPrecision)$+=" Math.abs(Math.round(division"+P+") - division"+P+") > 1e-"+q.opts.multipleOfPrecision+" ";else $+=" division"+P+" !== parseInt(division"+P+") ";if($+=" ) ",z)$+=" ) ";$+=" ) { ";var h=h||[];if(h.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { multipleOf: "+H+" } ",q.opts.messages!==!1)if($+=" , message: 'should be multiple of ",z)$+="' + "+H;else $+=""+H+"'";if(q.opts.verbose){if($+=" , schema: ",z)$+="validate.schema"+w;else $+=""+v;$+=" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" "}$+=" } "}else $+=" {} ";var J=$;if($=h.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+J+"]); ";else $+=" validate.errors = ["+J+"]; return false; ";else $+=" var err = "+J+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+="} ",T)$+=" else { ";return $}});var Lj=p((Yp,cj)=>{cj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="errs__"+P,H=q.util.copy(q);H.level++;var h="valid"+H.level;if(q.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:q.util.schemaHasRules(v,q.RULES.all)){H.schema=v,H.schemaPath=w,H.errSchemaPath=O,$+=" var "+z+" = errors; ";var J=q.compositeRule;q.compositeRule=H.compositeRule=!0,H.createErrors=!1;var k;if(H.opts.allErrors)k=H.opts.allErrors,H.opts.allErrors=!1;if($+=" "+q.validate(H)+" ",H.createErrors=!0,k)H.opts.allErrors=k;q.compositeRule=H.compositeRule=J,$+=" if ("+h+") { ";var X=X||[];if(X.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'not' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: {} ",q.opts.messages!==!1)$+=" , message: 'should NOT be valid' ";if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var l=$;if($=X.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+l+"]); ";else $+=" validate.errors = ["+l+"]; return false; ";else $+=" var err = "+l+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+=" } else { errors = "+z+"; if (vErrors !== null) { if ("+z+") vErrors.length = "+z+"; else vErrors = null; } ",q.opts.allErrors)$+=" } "}else{if($+=" var err = ",q.createErrors!==!1){if($+=" { keyword: 'not' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: {} ",q.opts.messages!==!1)$+=" , message: 'should NOT be valid' ";if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";if($+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",T)$+=" if (false) { "}return $}});var ej=p((Tp,tj)=>{tj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="valid"+P,H="errs__"+P,h=q.util.copy(q),J="";h.level++;var k="valid"+h.level,X=h.baseId,l="prevValid"+P,N="passingSchemas"+P;$+="var "+H+" = errors , "+l+" = false , "+z+" = false , "+N+" = null; ";var n=q.compositeRule;q.compositeRule=h.compositeRule=!0;var R=v;if(R){var g,V=-1,M=R.length-1;while(V<M){if(g=R[V+=1],q.opts.strictKeywords?typeof g=="object"&&Object.keys(g).length>0||g===!1:q.util.schemaHasRules(g,q.RULES.all))h.schema=g,h.schemaPath=w+"["+V+"]",h.errSchemaPath=O+"/"+V,$+=" "+q.validate(h)+" ",h.baseId=X;else $+=" var "+k+" = true; ";if(V)$+=" if ("+k+" && "+l+") { "+z+" = false; "+N+" = ["+N+", "+V+"]; } else { ",J+="}";$+=" if ("+k+") { "+z+" = "+l+" = true; "+N+" = "+V+"; }"}}if(q.compositeRule=h.compositeRule=n,$+=""+J+"if (!"+z+") { var err = ",q.createErrors!==!1){if($+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { passingSchemas: "+N+" } ",q.opts.messages!==!1)$+=" , message: 'should match exactly one schema in oneOf' ";if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";if($+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(vErrors); ";else $+=" validate.errors = vErrors; return false; ";if($+="} else { errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; }",q.opts.allErrors)$+=" } ";return $}});var sj=p((zp,xj)=>{xj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z=q.opts.$data&&v&&v.$data,H;if(z)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",H="schema"+P;else H=v;var h=z?"(new RegExp("+H+"))":q.usePattern(v);if($+="if ( ",z)$+=" ("+H+" !== undefined && typeof "+H+" != 'string') || ";$+=" !"+h+".test("+Y+") ) { ";var J=J||[];if(J.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { pattern: ",z)$+=""+H;else $+=""+q.util.toQuotedString(v);if($+=" } ",q.opts.messages!==!1){if($+=` , message: 'should match pattern "`,z)$+="' + "+H+" + '";else $+=""+q.util.escapeQuotes(v);$+=`"' `}if(q.opts.verbose){if($+=" , schema: ",z)$+="validate.schema"+w;else $+=""+q.util.toQuotedString(v);$+=" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" "}$+=" } "}else $+=" {} ";var k=$;if($=J.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+k+"]); ";else $+=" validate.errors = ["+k+"]; return false; ";else $+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+="} ",T)$+=" else { ";return $}});var Uj=p((Wp,Bj)=>{Bj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="errs__"+P,H=q.util.copy(q),h="";H.level++;var J="valid"+H.level,k="key"+P,X="idx"+P,l=H.dataLevel=q.dataLevel+1,N="data"+l,n="dataProperties"+P,R=Object.keys(v||{}).filter(c),g=q.schema.patternProperties||{},V=Object.keys(g).filter(c),M=q.schema.additionalProperties,C=R.length||V.length,a=M===!1,r=typeof M=="object"&&Object.keys(M).length,A=q.opts.removeAdditional,u=a||r||A,m=q.opts.ownProperties,S=q.baseId,I=q.schema.required;if(I&&!(q.opts.$data&&I.$data)&&I.length<q.opts.loopRequired)var D=q.util.toHash(I);function c(Y_){return Y_!=="__proto__"}if($+="var "+z+" = errors;var "+J+" = true;",m)$+=" var "+n+" = undefined;";if(u){if(m)$+=" "+n+" = "+n+" || Object.keys("+Y+"); for (var "+X+"=0; "+X+"<"+n+".length; "+X+"++) { var "+k+" = "+n+"["+X+"]; ";else $+=" for (var "+k+" in "+Y+") { ";if(C){if($+=" var isAdditional"+P+" = !(false ",R.length)if(R.length>8)$+=" || validate.schema"+w+".hasOwnProperty("+k+") ";else{var e=R;if(e){var L,Q=-1,Hq=e.length-1;while(Q<Hq)L=e[Q+=1],$+=" || "+k+" == "+q.util.toQuotedString(L)+" "}}if(V.length){var Pq=V;if(Pq){var _q,kq=-1,gq=Pq.length-1;while(kq<gq)_q=Pq[kq+=1],$+=" || "+q.usePattern(_q)+".test("+k+") "}}$+=" ); if (isAdditional"+P+") { "}if(A=="all")$+=" delete "+Y+"["+k+"]; ";else{var iq=q.errorPath,x_="' + "+k+" + '";if(q.opts._errorDataPathProperty)q.errorPath=q.util.getPathExpr(q.errorPath,k,q.opts.jsonPointers);if(a)if(A)$+=" delete "+Y+"["+k+"]; ";else{$+=" "+J+" = false; ";var n_=O;O=q.errSchemaPath+"/additionalProperties";var Nq=Nq||[];if(Nq.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { additionalProperty: '"+x_+"' } ",q.opts.messages!==!1){if($+=" , message: '",q.opts._errorDataPathProperty)$+="is an invalid additional property";else $+="should NOT have additional properties";$+="' "}if(q.opts.verbose)$+=" , schema: false , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var Vq=$;if($=Nq.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+Vq+"]); ";else $+=" validate.errors = ["+Vq+"]; return false; ";else $+=" var err = "+Vq+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(O=n_,T)$+=" break; "}else if(r)if(A=="failing"){$+=" var "+z+" = errors; ";var H8=q.compositeRule;q.compositeRule=H.compositeRule=!0,H.schema=M,H.schemaPath=q.schemaPath+".additionalProperties",H.errSchemaPath=q.errSchemaPath+"/additionalProperties",H.errorPath=q.opts._errorDataPathProperty?q.errorPath:q.util.getPathExpr(q.errorPath,k,q.opts.jsonPointers);var Dq=Y+"["+k+"]";H.dataPathArr[l]=k;var zq=q.validate(H);if(H.baseId=S,q.util.varOccurences(zq,N)<2)$+=" "+q.util.varReplace(zq,N,Dq)+" ";else $+=" var "+N+" = "+Dq+"; "+zq+" ";$+=" if (!"+J+") { errors = "+z+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+Y+"["+k+"]; } ",q.compositeRule=H.compositeRule=H8}else{H.schema=M,H.schemaPath=q.schemaPath+".additionalProperties",H.errSchemaPath=q.errSchemaPath+"/additionalProperties",H.errorPath=q.opts._errorDataPathProperty?q.errorPath:q.util.getPathExpr(q.errorPath,k,q.opts.jsonPointers);var Dq=Y+"["+k+"]";H.dataPathArr[l]=k;var zq=q.validate(H);if(H.baseId=S,q.util.varOccurences(zq,N)<2)$+=" "+q.util.varReplace(zq,N,Dq)+" ";else $+=" var "+N+" = "+Dq+"; "+zq+" ";if(T)$+=" if (!"+J+") break; "}q.errorPath=iq}if(C)$+=" } ";if($+=" } ",T)$+=" if ("+J+") { ",h+="}"}var s_=q.opts.useDefaults&&!q.compositeRule;if(R.length){var R_=R;if(R_){var L,h8=-1,J8=R_.length-1;while(h8<J8){L=R_[h8+=1];var dq=v[L];if(q.opts.strictKeywords?typeof dq=="object"&&Object.keys(dq).length>0||dq===!1:q.util.schemaHasRules(dq,q.RULES.all)){var __=q.util.getProperty(L),Dq=Y+__,tq=s_&&dq.default!==void 0;H.schema=dq,H.schemaPath=w+__,H.errSchemaPath=O+"/"+q.util.escapeFragment(L),H.errorPath=q.util.getPath(q.errorPath,L,q.opts.jsonPointers),H.dataPathArr[l]=q.util.toQuotedString(L);var zq=q.validate(H);if(H.baseId=S,q.util.varOccurences(zq,N)<2){zq=q.util.varReplace(zq,N,Dq);var oq=Dq}else{var oq=N;$+=" var "+N+" = "+Dq+"; "}if(tq)$+=" "+zq+" ";else{if(D&&D[L]){if($+=" if ( "+oq+" === undefined ",m)$+=" || ! Object.prototype.hasOwnProperty.call("+Y+", '"+q.util.escapeQuotes(L)+"') ";$+=") { "+J+" = false; ";var iq=q.errorPath,n_=O,G_=q.util.escapeQuotes(L);if(q.opts._errorDataPathProperty)q.errorPath=q.util.getPath(iq,L,q.opts.jsonPointers);O=q.errSchemaPath+"/required";var Nq=Nq||[];if(Nq.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'required' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { missingProperty: '"+G_+"' } ",q.opts.messages!==!1){if($+=" , message: '",q.opts._errorDataPathProperty)$+="is a required property";else $+="should have required property \\'"+G_+"\\'";$+="' "}if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var Vq=$;if($=Nq.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+Vq+"]); ";else $+=" validate.errors = ["+Vq+"]; return false; ";else $+=" var err = "+Vq+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";O=n_,q.errorPath=iq,$+=" } else { "}else if(T){if($+=" if ( "+oq+" === undefined ",m)$+=" || ! Object.prototype.hasOwnProperty.call("+Y+", '"+q.util.escapeQuotes(L)+"') ";$+=") { "+J+" = true; } else { "}else{if($+=" if ("+oq+" !== undefined ",m)$+=" && Object.prototype.hasOwnProperty.call("+Y+", '"+q.util.escapeQuotes(L)+"') ";$+=" ) { "}$+=" "+zq+" } "}}if(T)$+=" if ("+J+") { ",h+="}"}}}if(V.length){var Uq=V;if(Uq){var _q,n6=-1,RK=Uq.length-1;while(n6<RK){_q=Uq[n6+=1];var dq=g[_q];if(q.opts.strictKeywords?typeof dq=="object"&&Object.keys(dq).length>0||dq===!1:q.util.schemaHasRules(dq,q.RULES.all)){if(H.schema=dq,H.schemaPath=q.schemaPath+".patternProperties"+q.util.getProperty(_q),H.errSchemaPath=q.errSchemaPath+"/patternProperties/"+q.util.escapeFragment(_q),m)$+=" "+n+" = "+n+" || Object.keys("+Y+"); for (var "+X+"=0; "+X+"<"+n+".length; "+X+"++) { var "+k+" = "+n+"["+X+"]; ";else $+=" for (var "+k+" in "+Y+") { ";$+=" if ("+q.usePattern(_q)+".test("+k+")) { ",H.errorPath=q.util.getPathExpr(q.errorPath,k,q.opts.jsonPointers);var Dq=Y+"["+k+"]";H.dataPathArr[l]=k;var zq=q.validate(H);if(H.baseId=S,q.util.varOccurences(zq,N)<2)$+=" "+q.util.varReplace(zq,N,Dq)+" ";else $+=" var "+N+" = "+Dq+"; "+zq+" ";if(T)$+=" if (!"+J+") break; ";if($+=" } ",T)$+=" else "+J+" = true; ";if($+=" } ",T)$+=" if ("+J+") { ",h+="}"}}}}if(T)$+=" "+h+" if ("+z+" == errors) {";return $}});var Qj=p((Hp,Fj)=>{Fj.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="errs__"+P,H=q.util.copy(q),h="";H.level++;var J="valid"+H.level;if($+="var "+z+" = errors;",q.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:q.util.schemaHasRules(v,q.RULES.all)){H.schema=v,H.schemaPath=w,H.errSchemaPath=O;var k="key"+P,X="idx"+P,l="i"+P,N="' + "+k+" + '",n=H.dataLevel=q.dataLevel+1,R="data"+n,g="dataProperties"+P,V=q.opts.ownProperties,M=q.baseId;if(V)$+=" var "+g+" = undefined; ";if(V)$+=" "+g+" = "+g+" || Object.keys("+Y+"); for (var "+X+"=0; "+X+"<"+g+".length; "+X+"++) { var "+k+" = "+g+"["+X+"]; ";else $+=" for (var "+k+" in "+Y+") { ";$+=" var startErrs"+P+" = errors; ";var C=k,a=q.compositeRule;q.compositeRule=H.compositeRule=!0;var r=q.validate(H);if(H.baseId=M,q.util.varOccurences(r,R)<2)$+=" "+q.util.varReplace(r,R,C)+" ";else $+=" var "+R+" = "+C+"; "+r+" ";if(q.compositeRule=H.compositeRule=a,$+=" if (!"+J+") { for (var "+l+"=startErrs"+P+"; "+l+"<errors; "+l+"++) { vErrors["+l+"].propertyName = "+k+"; } var err = ",q.createErrors!==!1){if($+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { propertyName: '"+N+"' } ",q.opts.messages!==!1)$+=" , message: 'property name \\'"+N+"\\' is invalid' ";if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";if($+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(vErrors); ";else $+=" validate.errors = vErrors; return false; ";if(T)$+=" break; ";$+=" } }"}if(T)$+=" "+h+" if ("+z+" == errors) {";return $}});var _9=p((hp,q9)=>{q9.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="valid"+P,H=q.opts.$data&&v&&v.$data,h;if(H)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",h="schema"+P;else h=v;var J="schema"+P;if(!H)if(v.length<q.opts.loopRequired&&q.schema.properties&&Object.keys(q.schema.properties).length){var k=[],X=v;if(X){var l,N=-1,n=X.length-1;while(N<n){l=X[N+=1];var R=q.schema.properties[l];if(!(R&&(q.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:q.util.schemaHasRules(R,q.RULES.all))))k[k.length]=l}}}else var k=v;if(H||k.length){var g=q.errorPath,V=H||k.length>=q.opts.loopRequired,M=q.opts.ownProperties;if(T)if($+=" var missing"+P+"; ",V){if(!H)$+=" var "+J+" = validate.schema"+w+"; ";var C="i"+P,a="schema"+P+"["+C+"]",r="' + "+a+" + '";if(q.opts._errorDataPathProperty)q.errorPath=q.util.getPathExpr(g,a,q.opts.jsonPointers);if($+=" var "+z+" = true; ",H)$+=" if (schema"+P+" === undefined) "+z+" = true; else if (!Array.isArray(schema"+P+")) "+z+" = false; else {";if($+=" for (var "+C+" = 0; "+C+" < "+J+".length; "+C+"++) { "+z+" = "+Y+"["+J+"["+C+"]] !== undefined ",M)$+=" && Object.prototype.hasOwnProperty.call("+Y+", "+J+"["+C+"]) ";if($+="; if (!"+z+") break; } ",H)$+=" } ";$+=" if (!"+z+") { ";var A=A||[];if(A.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'required' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { missingProperty: '"+r+"' } ",q.opts.messages!==!1){if($+=" , message: '",q.opts._errorDataPathProperty)$+="is a required property";else $+="should have required property \\'"+r+"\\'";$+="' "}if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var u=$;if($=A.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+u+"]); ";else $+=" validate.errors = ["+u+"]; return false; ";else $+=" var err = "+u+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";$+=" } else { "}else{$+=" if ( ";var m=k;if(m){var S,C=-1,I=m.length-1;while(C<I){if(S=m[C+=1],C)$+=" || ";var D=q.util.getProperty(S),c=Y+D;if($+=" ( ( "+c+" === undefined ",M)$+=" || ! Object.prototype.hasOwnProperty.call("+Y+", '"+q.util.escapeQuotes(S)+"') ";$+=") && (missing"+P+" = "+q.util.toQuotedString(q.opts.jsonPointers?S:D)+") ) "}}$+=") { ";var a="missing"+P,r="' + "+a+" + '";if(q.opts._errorDataPathProperty)q.errorPath=q.opts.jsonPointers?q.util.getPathExpr(g,a,!0):g+" + "+a;var A=A||[];if(A.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'required' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { missingProperty: '"+r+"' } ",q.opts.messages!==!1){if($+=" , message: '",q.opts._errorDataPathProperty)$+="is a required property";else $+="should have required property \\'"+r+"\\'";$+="' "}if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";var u=$;if($=A.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+u+"]); ";else $+=" validate.errors = ["+u+"]; return false; ";else $+=" var err = "+u+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";$+=" } else { "}else if(V){if(!H)$+=" var "+J+" = validate.schema"+w+"; ";var C="i"+P,a="schema"+P+"["+C+"]",r="' + "+a+" + '";if(q.opts._errorDataPathProperty)q.errorPath=q.util.getPathExpr(g,a,q.opts.jsonPointers);if(H){if($+=" if ("+J+" && !Array.isArray("+J+")) { var err = ",q.createErrors!==!1){if($+=" { keyword: 'required' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { missingProperty: '"+r+"' } ",q.opts.messages!==!1){if($+=" , message: '",q.opts._errorDataPathProperty)$+="is a required property";else $+="should have required property \\'"+r+"\\'";$+="' "}if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";$+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+J+" !== undefined) { "}if($+=" for (var "+C+" = 0; "+C+" < "+J+".length; "+C+"++) { if ("+Y+"["+J+"["+C+"]] === undefined ",M)$+=" || ! Object.prototype.hasOwnProperty.call("+Y+", "+J+"["+C+"]) ";if($+=") { var err = ",q.createErrors!==!1){if($+=" { keyword: 'required' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { missingProperty: '"+r+"' } ",q.opts.messages!==!1){if($+=" , message: '",q.opts._errorDataPathProperty)$+="is a required property";else $+="should have required property \\'"+r+"\\'";$+="' "}if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";if($+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",H)$+=" } "}else{var e=k;if(e){var S,L=-1,Q=e.length-1;while(L<Q){S=e[L+=1];var D=q.util.getProperty(S),r=q.util.escapeQuotes(S),c=Y+D;if(q.opts._errorDataPathProperty)q.errorPath=q.util.getPath(g,S,q.opts.jsonPointers);if($+=" if ( "+c+" === undefined ",M)$+=" || ! Object.prototype.hasOwnProperty.call("+Y+", '"+q.util.escapeQuotes(S)+"') ";if($+=") { var err = ",q.createErrors!==!1){if($+=" { keyword: 'required' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { missingProperty: '"+r+"' } ",q.opts.messages!==!1){if($+=" , message: '",q.opts._errorDataPathProperty)$+="is a required property";else $+="should have required property \\'"+r+"\\'";$+="' "}if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" ";$+=" } "}else $+=" {} ";$+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}q.errorPath=g}else if(T)$+=" if (true) {";return $}});var $9=p((Jp,f9)=>{f9.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y="data"+(j||""),z="valid"+P,H=q.opts.$data&&v&&v.$data,h;if(H)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",h="schema"+P;else h=v;if((v||H)&&q.opts.uniqueItems!==!1){if(H)$+=" var "+z+"; if ("+h+" === false || "+h+" === undefined) "+z+" = true; else if (typeof "+h+" != 'boolean') "+z+" = false; else { ";$+=" var i = "+Y+".length , "+z+" = true , j; if (i > 1) { ";var J=q.schema.items&&q.schema.items.type,k=Array.isArray(J);if(!J||J=="object"||J=="array"||k&&(J.indexOf("object")>=0||J.indexOf("array")>=0))$+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+Y+"[i], "+Y+"[j])) { "+z+" = false; break outer; } } } ";else{$+=" var itemIndices = {}, item; for (;i--;) { var item = "+Y+"[i]; ";var X="checkDataType"+(k?"s":"");if($+=" if ("+q.util[X](J,"item",q.opts.strictNumbers,!0)+") continue; ",k)$+=` if (typeof item == 'string') item = '"' + item; `;$+=" if (typeof itemIndices[item] == 'number') { "+z+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}if($+=" } ",H)$+=" } ";$+=" if (!"+z+") { ";var l=l||[];if(l.push($),$="",q.createErrors!==!1){if($+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { i: i, j: j } ",q.opts.messages!==!1)$+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";if(q.opts.verbose){if($+=" , schema: ",H)$+="validate.schema"+w;else $+=""+v;$+=" , parentSchema: validate.schema"+q.schemaPath+" , data: "+Y+" "}$+=" } "}else $+=" {} ";var N=$;if($=l.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+N+"]); ";else $+=" validate.errors = ["+N+"]; return false; ";else $+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if($+=" } ",T)$+=" else { "}else if(T)$+=" if (true) { ";return $}});var P9=p((kp,K9)=>{K9.exports={$ref:kj(),allOf:Xj(),anyOf:uj(),$comment:mj(),const:bj(),contains:Mj(),dependencies:Nj(),enum:pj(),format:nj(),if:Ej(),items:dj(),maximum:ZP(),minimum:ZP(),maxItems:XP(),minItems:XP(),maxLength:AP(),minLength:AP(),maxProperties:uP(),minProperties:uP(),multipleOf:oj(),not:Lj(),oneOf:ej(),pattern:sj(),properties:Uj(),propertyNames:Qj(),required:_9(),uniqueItems:$9(),validate:JP()}});var w9=p((Zp,v9)=>{var j9=P9(),GP=b8().toHash;v9.exports=function _(){var q=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],f=["type","$comment"],K=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],$=["number","integer","string","array","object","boolean","null"];return q.all=GP(f),q.types=GP($),q.forEach(function(P){if(P.rules=P.rules.map(function(j){var v;if(typeof j=="object"){var w=Object.keys(j)[0];v=j[w],j=w,v.forEach(function(T){f.push(T),q.all[T]=!0})}f.push(j);var O=q.all[j]={keyword:j,code:j9[j],implements:v};return O}),q.all.$comment={keyword:"$comment",code:j9.$comment},P.type)q.types[P.type]=P}),q.keywords=GP(f.concat(K)),q.custom={},q}});var T9=p((Xp,Y9)=>{var O9=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];Y9.exports=function(_,q){for(var f=0;f<q.length;f++){_=JSON.parse(JSON.stringify(_));var K=q[f].split("/"),$=_,P;for(P=1;P<K.length;P++)$=$[K[P]];for(P=0;P<O9.length;P++){var j=O9[P],v=$[j];if(v)$[j]={anyOf:[v,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}}}return _}});var H9=p((Ap,W9)=>{var yz=z$().MissingRef;W9.exports=z9;function z9(_,q,f){var K=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof q=="function")f=q,q=void 0;var $=P(_).then(function(){var v=K._addSchema(_,void 0,q);return v.validate||j(v)});if(f)$.then(function(v){f(null,v)},f);return $;function P(v){var w=v.$schema;return w&&!K.getSchema(w)?z9.call(K,{$ref:w},!0):Promise.resolve()}function j(v){try{return K._compile(v)}catch(O){if(O instanceof yz)return w(O);throw O}function w(O){var T=O.missingSchema;if(H(T))throw new Error("Schema "+T+" is loaded but "+O.missingRef+" cannot be resolved");var Y=K._loadingSchemas[T];if(!Y)Y=K._loadingSchemas[T]=K._opts.loadSchema(T),Y.then(z,z);return Y.then(function(h){if(!H(T))return P(h).then(function(){if(!H(T))K.addSchema(h,T,void 0,q)})}).then(function(){return j(v)});function z(){delete K._loadingSchemas[T]}function H(h){return K._refs[h]||K._schemas[h]}}}}});var J9=p((up,h9)=>{h9.exports=function _(q,f,K){var $=" ",P=q.level,j=q.dataLevel,v=q.schema[f],w=q.schemaPath+q.util.getProperty(f),O=q.errSchemaPath+"/"+f,T=!q.opts.allErrors,Y,z="data"+(j||""),H="valid"+P,h="errs__"+P,J=q.opts.$data&&v&&v.$data,k;if(J)$+=" var schema"+P+" = "+q.util.getData(v.$data,j,q.dataPathArr)+"; ",k="schema"+P;else k=v;var X=this,l="definition"+P,N=X.definition,n="",R,g,V,M,C;if(J&&N.$data){C="keywordValidate"+P;var a=N.validateSchema;$+=" var "+l+" = RULES.custom['"+f+"'].definition; var "+C+" = "+l+".validate;"}else{if(M=q.useCustomRule(X,v,q.schema,q),!M)return;k="validate.schema"+w,C=M.code,R=N.compile,g=N.inline,V=N.macro}var r=C+".errors",A="i"+P,u="ruleErr"+P,m=N.async;if(m&&!q.async)throw new Error("async keyword in sync schema");if(!(g||V))$+=""+r+" = null;";if($+="var "+h+" = errors;var "+H+";",J&&N.$data){if(n+="}",$+=" if ("+k+" === undefined) { "+H+" = true; } else { ",a)n+="}",$+=" "+H+" = "+l+".validateSchema("+k+"); if ("+H+") { "}if(g)if(N.statements)$+=" "+M.validate+" ";else $+=" "+H+" = "+M.validate+"; ";else if(V){var S=q.util.copy(q),n="";S.level++;var I="valid"+S.level;S.schema=M.validate,S.schemaPath="";var D=q.compositeRule;q.compositeRule=S.compositeRule=!0;var c=q.validate(S).replace(/validate\.schema/g,C);q.compositeRule=S.compositeRule=D,$+=" "+c}else{var e=e||[];if(e.push($),$="",$+=" "+C+".call( ",q.opts.passContext)$+="this";else $+="self";if(R||N.schema===!1)$+=" , "+z+" ";else $+=" , "+k+" , "+z+" , validate.schema"+q.schemaPath+" ";if($+=" , (dataPath || '')",q.errorPath!='""')$+=" + "+q.errorPath;var L=j?"data"+(j-1||""):"parentData",Q=j?q.dataPathArr[j]:"parentDataProperty";$+=" , "+L+" , "+Q+" , rootData ) ";var Hq=$;if($=e.pop(),N.errors===!1){if($+=" "+H+" = ",m)$+="await ";$+=""+Hq+"; "}else if(m)r="customErrors"+P,$+=" var "+r+" = null; try { "+H+" = await "+Hq+"; } catch (e) { "+H+" = false; if (e instanceof ValidationError) "+r+" = e.errors; else throw e; } ";else $+=" "+r+" = null; "+H+" = "+Hq+"; "}if(N.modifying)$+=" if ("+L+") "+z+" = "+L+"["+Q+"];";if($+=""+n,N.valid){if(T)$+=" if (true) { "}else{if($+=" if ( ",N.valid===void 0)if($+=" !",V)$+=""+I;else $+=""+H;else $+=" "+!N.valid+" ";$+=") { ",Y=X.keyword;var e=e||[];e.push($),$="";var e=e||[];if(e.push($),$="",q.createErrors!==!1){if($+=" { keyword: '"+(Y||"custom")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { keyword: '"+X.keyword+"' } ",q.opts.messages!==!1)$+=` , message: 'should pass "`+X.keyword+`" keyword validation' `;if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+z+" ";$+=" } "}else $+=" {} ";var Pq=$;if($=e.pop(),!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(["+Pq+"]); ";else $+=" validate.errors = ["+Pq+"]; return false; ";else $+=" var err = "+Pq+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var _q=$;if($=e.pop(),g)if(N.errors){if(N.errors!="full"){if($+=" for (var "+A+"="+h+"; "+A+"<errors; "+A+"++) { var "+u+" = vErrors["+A+"]; if ("+u+".dataPath === undefined) "+u+".dataPath = (dataPath || '') + "+q.errorPath+"; if ("+u+".schemaPath === undefined) { "+u+'.schemaPath = "'+O+'"; } ',q.opts.verbose)$+=" "+u+".schema = "+k+"; "+u+".data = "+z+"; ";$+=" } "}}else if(N.errors===!1)$+=" "+_q+" ";else{if($+=" if ("+h+" == errors) { "+_q+" } else { for (var "+A+"="+h+"; "+A+"<errors; "+A+"++) { var "+u+" = vErrors["+A+"]; if ("+u+".dataPath === undefined) "+u+".dataPath = (dataPath || '') + "+q.errorPath+"; if ("+u+".schemaPath === undefined) { "+u+'.schemaPath = "'+O+'"; } ',q.opts.verbose)$+=" "+u+".schema = "+k+"; "+u+".data = "+z+"; ";$+=" } } "}else if(V){if($+=" var err = ",q.createErrors!==!1){if($+=" { keyword: '"+(Y||"custom")+"' , dataPath: (dataPath || '') + "+q.errorPath+" , schemaPath: "+q.util.toQuotedString(O)+" , params: { keyword: '"+X.keyword+"' } ",q.opts.messages!==!1)$+=` , message: 'should pass "`+X.keyword+`" keyword validation' `;if(q.opts.verbose)$+=" , schema: validate.schema"+w+" , parentSchema: validate.schema"+q.schemaPath+" , data: "+z+" ";$+=" } "}else $+=" {} ";if($+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!q.compositeRule&&T)if(q.async)$+=" throw new ValidationError(vErrors); ";else $+=" validate.errors = vErrors; return false; "}else if(N.errors===!1)$+=" "+_q+" ";else{if($+=" if (Array.isArray("+r+")) { if (vErrors === null) vErrors = "+r+"; else vErrors = vErrors.concat("+r+"); errors = vErrors.length; for (var "+A+"="+h+"; "+A+"<errors; "+A+"++) { var "+u+" = vErrors["+A+"]; if ("+u+".dataPath === undefined) "+u+".dataPath = (dataPath || '') + "+q.errorPath+"; "+u+'.schemaPath = "'+O+'"; ',q.opts.verbose)$+=" "+u+".schema = "+k+"; "+u+".data = "+z+"; ";$+=" } } else { "+_q+" } "}if($+=" } ",T)$+=" else { "}return $}});var mP=p((Gp,iz)=>{iz.exports={$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}});var X9=p((mp,Z9)=>{var k9=mP();Z9.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:k9.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:k9.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var u9=p((rp,A9)=>{var oz=/^[a-z_$][a-z0-9_$-]*$/i,cz=J9(),Lz=X9();A9.exports={add:tz,get:ez,remove:xz,validate:rP};function tz(_,q){var f=this.RULES;if(f.keywords[_])throw new Error("Keyword "+_+" is already defined");if(!oz.test(_))throw new Error("Keyword "+_+" is not a valid identifier");if(q){this.validateKeyword(q,!0);var K=q.type;if(Array.isArray(K))for(var $=0;$<K.length;$++)j(_,K[$],q);else j(_,K,q);var P=q.metaSchema;if(P){if(q.$data&&this._opts.$data)P={anyOf:[P,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]};q.validateSchema=this.compile(P,!0)}}f.keywords[_]=f.all[_]=!0;function j(v,w,O){var T;for(var Y=0;Y<f.length;Y++){var z=f[Y];if(z.type==w){T=z;break}}if(!T)T={type:w,rules:[]},f.push(T);var H={keyword:v,definition:O,custom:!0,code:cz,implements:O.implements};T.rules.push(H),f.custom[v]=H}return this}function ez(_){var q=this.RULES.custom[_];return q?q.definition:this.RULES.keywords[_]||!1}function xz(_){var q=this.RULES;delete q.keywords[_],delete q.all[_],delete q.custom[_];for(var f=0;f<q.length;f++){var K=q[f].rules;for(var $=0;$<K.length;$++)if(K[$].keyword==_){K.splice($,1);break}}return this}function rP(_,q){rP.errors=null;var f=this._validateKeyword=this._validateKeyword||this.compile(Lz,!0);if(f(_))return!0;if(rP.errors=f.errors,q)throw new Error("custom keyword definition is invalid: "+this.errorsText(f.errors));else return!1}});var G9=p((bp,sz)=>{sz.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var l9=p((Vp,p9)=>{var r9=_j(),V8=T$(),Bz=$j(),b9=OP(),Uz=hP(),Fz=hj(),Qz=w9(),V9=T9(),M9=b8();p9.exports=Mq;Mq.prototype.validate=_W;Mq.prototype.compile=fW;Mq.prototype.addSchema=$W;Mq.prototype.addMetaSchema=KW;Mq.prototype.validateSchema=PW;Mq.prototype.getSchema=vW;Mq.prototype.removeSchema=OW;Mq.prototype.addFormat=kW;Mq.prototype.errorsText=JW;Mq.prototype._addSchema=YW;Mq.prototype._compile=TW;Mq.prototype.compileAsync=H9();var A$=u9();Mq.prototype.addKeyword=A$.add;Mq.prototype.getKeyword=A$.get;Mq.prototype.removeKeyword=A$.remove;Mq.prototype.validateKeyword=A$.validate;var S9=z$();Mq.ValidationError=S9.Validation;Mq.MissingRefError=S9.MissingRef;Mq.$dataMetaSchema=V9;var X$="http://json-schema.org/draft-07/schema",m9=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],qW=["/properties"];function Mq(_){if(!(this instanceof Mq))return new Mq(_);if(_=this._opts=M9.copy(_)||{},mW(this),this._schemas={},this._refs={},this._fragments={},this._formats=Fz(_.format),this._cache=_.cache||new Bz,this._loadingSchemas={},this._compilations=[],this.RULES=Qz(),this._getId=zW(_),_.loopRequired=_.loopRequired||1/0,_.errorDataPath=="property")_._errorDataPathProperty=!0;if(_.serialize===void 0)_.serialize=Uz;if(this._metaOpts=GW(this),_.formats)AW(this);if(_.keywords)uW(this);if(ZW(this),typeof _.meta=="object")this.addMetaSchema(_.meta);if(_.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});XW(this)}function _W(_,q){var f;if(typeof _=="string"){if(f=this.getSchema(_),!f)throw new Error('no schema with key or ref "'+_+'"')}else{var K=this._addSchema(_);f=K.validate||this._compile(K)}var $=f(q);if(f.$async!==!0)this.errors=f.errors;return $}function fW(_,q){var f=this._addSchema(_,void 0,q);return f.validate||this._compile(f)}function $W(_,q,f,K){if(Array.isArray(_)){for(var $=0;$<_.length;$++)this.addSchema(_[$],void 0,f,K);return this}var P=this._getId(_);if(P!==void 0&&typeof P!="string")throw new Error("schema id must be string");return q=V8.normalizeId(q||P),C9(this,q),this._schemas[q]=this._addSchema(_,f,K,!0),this}function KW(_,q,f){return this.addSchema(_,q,f,!0),this}function PW(_,q){var f=_.$schema;if(f!==void 0&&typeof f!="string")throw new Error("$schema must be a string");if(f=f||this._opts.defaultMeta||jW(this),!f)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var K=this.validate(f,_);if(!K&&q){var $="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error($);else throw new Error($)}return K}function jW(_){var q=_._opts.meta;return _._opts.defaultMeta=typeof q=="object"?_._getId(q)||q:_.getSchema(X$)?X$:void 0,_._opts.defaultMeta}function vW(_){var q=N9(this,_);switch(typeof q){case"object":return q.validate||this._compile(q);case"string":return this.getSchema(q);case"undefined":return wW(this,_)}}function wW(_,q){var f=V8.schema.call(_,{schema:{}},q);if(f){var{schema:K,root:$,baseId:P}=f,j=r9.call(_,K,$,void 0,P);return _._fragments[q]=new b9({ref:q,fragment:!0,schema:K,root:$,baseId:P,validate:j}),j}}function N9(_,q){return q=V8.normalizeId(q),_._schemas[q]||_._refs[q]||_._fragments[q]}function OW(_){if(_ instanceof RegExp)return Z$(this,this._schemas,_),Z$(this,this._refs,_),this;switch(typeof _){case"undefined":return Z$(this,this._schemas),Z$(this,this._refs),this._cache.clear(),this;case"string":var q=N9(this,_);if(q)this._cache.del(q.cacheKey);return delete this._schemas[_],delete this._refs[_],this;case"object":var f=this._opts.serialize,K=f?f(_):_;this._cache.del(K);var $=this._getId(_);if($)$=V8.normalizeId($),delete this._schemas[$],delete this._refs[$]}return this}function Z$(_,q,f){for(var K in q){var $=q[K];if(!$.meta&&(!f||f.test(K)))_._cache.del($.cacheKey),delete q[K]}}function YW(_,q,f,K){if(typeof _!="object"&&typeof _!="boolean")throw new Error("schema should be object or boolean");var $=this._opts.serialize,P=$?$(_):_,j=this._cache.get(P);if(j)return j;K=K||this._opts.addUsedSchema!==!1;var v=V8.normalizeId(this._getId(_));if(v&&K)C9(this,v);var w=this._opts.validateSchema!==!1&&!q,O;if(w&&!(O=v&&v==V8.normalizeId(_.$schema)))this.validateSchema(_,!0);var T=V8.ids.call(this,_),Y=new b9({id:v,schema:_,localRefs:T,cacheKey:P,meta:f});if(v[0]!="#"&&K)this._refs[v]=Y;if(this._cache.put(P,Y),w&&O)this.validateSchema(_,!0);return Y}function TW(_,q){if(_.compiling){if(_.validate=$,$.schema=_.schema,$.errors=null,$.root=q?q:$,_.schema.$async===!0)$.$async=!0;return $}_.compiling=!0;var f;if(_.meta)f=this._opts,this._opts=this._metaOpts;var K;try{K=r9.call(this,_.schema,q,_.localRefs)}catch(P){throw delete _.validate,P}finally{if(_.compiling=!1,_.meta)this._opts=f}return _.validate=K,_.refs=K.refs,_.refVal=K.refVal,_.root=K.root,K;function $(){var P=_.validate,j=P.apply(this,arguments);return $.errors=P.errors,j}}function zW(_){switch(_.schemaId){case"auto":return hW;case"id":return WW;default:return HW}}function WW(_){if(_.$id)this.logger.warn("schema $id ignored",_.$id);return _.id}function HW(_){if(_.id)this.logger.warn("schema id ignored",_.id);return _.$id}function hW(_){if(_.$id&&_.id&&_.$id!=_.id)throw new Error("schema $id is different from id");return _.$id||_.id}function JW(_,q){if(_=_||this.errors,!_)return"No errors";q=q||{};var f=q.separator===void 0?", ":q.separator,K=q.dataVar===void 0?"data":q.dataVar,$="";for(var P=0;P<_.length;P++){var j=_[P];if(j)$+=K+j.dataPath+" "+j.message+f}return $.slice(0,-f.length)}function kW(_,q){if(typeof q=="string")q=new RegExp(q);return this._formats[_]=q,this}function ZW(_){var q;if(_._opts.$data)q=G9(),_.addMetaSchema(q,q.$id,!0);if(_._opts.meta===!1)return;var f=mP();if(_._opts.$data)f=V9(f,qW);_.addMetaSchema(f,X$,!0),_._refs["http://json-schema.org/schema"]=X$}function XW(_){var q=_._opts.schemas;if(!q)return;if(Array.isArray(q))_.addSchema(q);else for(var f in q)_.addSchema(q[f],f)}function AW(_){for(var q in _._opts.formats){var f=_._opts.formats[q];_.addFormat(q,f)}}function uW(_){for(var q in _._opts.keywords){var f=_._opts.keywords[q];_.addKeyword(q,f)}}function C9(_,q){if(_._schemas[q]||_._refs[q])throw new Error('schema with key or id "'+q+'" already exists')}function GW(_){var q=M9.copy(_._opts);for(var f=0;f<m9.length;f++)delete q[m9[f]];return q}function mW(_){var q=_._opts.logger;if(q===!1)_.logger={log:bP,warn:bP,error:bP};else{if(q===void 0)q=console;if(!(typeof q=="object"&&q.log&&q.warn&&q.error))throw new Error("logger must implement log, warn and error methods");_.logger=q}}function bP(){}});var DW=(_)=>{let{idPattern:q,entityName:f}=_,K=(w)=>{return q.test(w)};return Object.freeze({isId:K,validateId:(w)=>{return K(w)},resolve:(w)=>{if(K(w))return{kind:"id",value:w};return{kind:"path",value:w}},getPattern:()=>{return q},getEntityName:()=>{return f}})},yW,vf;var gP=b_(()=>{yW=Object.freeze({create:DW}),vf=yW});var S$,N$,dP=(_)=>{if(S$.isId(_))return"project";if(N$.isId(_))return"shared";return},iW=(_)=>{return S$.isId(_)||N$.isId(_)},kv=(_)=>{return _==="project"?S$:N$},oW=(_,q)=>{return kv(q).validateId(_)},cW,sq;var wf=b_(()=>{gP();S$=vf.create({idPattern:/^doc\d{3,}$/,entityName:"project-doc"}),N$=vf.create({idPattern:/^sdoc\d{3,}$/,entityName:"shared-doc"}),cW=Object.freeze({project:S$,shared:N$,detectScopeFromId:dP,isdocId:iW,getResolverForScope:kv,validateIdForScope:oW}),sq=cW});import{resolve as lv,relative as Rv,normalize as kH,isAbsolute as Ev}from"path";import{realpath as nv,lstat as ZH}from"fs/promises";var Z_=(_,q,f)=>{let K=new Error(q);return K.name=_,K.code=_,K.details=f,K},gv=(_)=>{if(!_)throw Z_("VALIDATION_ERROR","Empty path");if(Ev(_))throw Z_("VALIDATION_ERROR","Absolute path not allowed",{path:_});let q=kH(_).replaceAll("\\","/");if(q.split("/").some((K)=>K===".."))throw Z_("BOUNDARY_VIOLATION","Path contains ..",{path:_});return q},aP=(_,q)=>{let f=Rv(_,q);return f!==""&&!f.startsWith("..")&&!Ev(f)},XH=async(_,q,f)=>{let K=gv(q),$=lv(_),P=lv($,K);if(f?.followSymlinks)try{P=await nv(P)}catch(v){if(v.code!=="ENOENT")throw v}else try{if((await ZH(P)).isSymbolicLink()){let w=await nv(P);if(!aP($,w))throw Z_("BOUNDARY_VIOLATION",`Symlink target escapes boundary: '${q}' \u2192 '${w}'`,{path:q,resolved:P,target:w})}}catch(v){if(v.code!=="ENOENT"&&v.code!=="BOUNDARY_VIOLATION")throw v;if(v.code==="BOUNDARY_VIOLATION")throw v}if(!aP($,P)&&P!==$)throw Z_("BOUNDARY_VIOLATION",`Path escapes boundary: '${q}' \u2192 '${P}'`,{path:q,resolved:P,boundary:$});let j=Rv($,P).replaceAll("\\","/");return{abs:P,rel:j}},AH=(_,q)=>{let f=_.code,K=q?.path?q.resolved?`'${q.path}' \u2192 '${q.resolved}'`:`'${q.path}'`:"";switch(f){case"ENOENT":return Z_("NOT_FOUND",`File or directory not found${K?`: ${K}`:""}`,{...q,originalCode:f});case"ENOTEMPTY":return Z_("DIRECTORY_NOT_EMPTY",`Directory not empty${K?`: ${K}`:""}`,{...q,originalCode:f});case"ENOTDIR":case"EISDIR":return Z_("VALIDATION_ERROR",`Invalid path type${K?`: ${K}`:""}`,{...q,originalCode:f,reason:f==="ENOTDIR"?"not a directory":"is a directory"});case"EACCES":case"EPERM":return Z_("FS_ERROR",`Permission denied${K?`: ${K}`:""}`,{...q,originalCode:f});case"EBUSY":return Z_("FS_ERROR",`Resource busy or locked${K?`: ${K}`:""}`,{...q,originalCode:f});default:if(q)_.context=q;return _}},uH,vq;var IP=b_(()=>{uH=Object.freeze({fsError:Z_,validateRelative:gv,insideBoundary:aP,resolveWithinBoundary:XH,mapOsError:AH}),vq=uH});import{readFile as GH,writeFile as mH,unlink as dv,stat as DP,rename as rH,access as bH,mkdir as VH}from"fs/promises";import{constants as MH}from"fs";import{resolve as SH,dirname as yP,isAbsolute as NH}from"path";var CH=(_)=>{let{boundaryDir:q}=_;if(!q)throw vq.fsError("VALIDATION_ERROR","boundaryDir is required (empty string)",{boundaryDir:q});if(!NH(q))throw vq.fsError("VALIDATION_ERROR",`boundaryDir must be an absolute path: '${q}'`,{boundaryDir:q});let f=SH(q),K=async(z)=>{let{abs:H}=await vq.resolveWithinBoundary(f,z);return H},$=async(z)=>{let H=await K(z);try{return await bH(H,MH.F_OK),!0}catch{return!1}},P=async(z)=>{let H=await K(z);try{return await DP(H)}catch(h){throw vq.mapOsError(h,{path:z,resolved:H,operation:"stat"})}},j=async(z)=>{let H=await K(z),h;try{h=await DP(H)}catch(J){throw vq.mapOsError(J,{path:z,resolved:H,operation:"stat"})}if(!h.isFile())throw vq.fsError("VALIDATION_ERROR","Target is not a regular file",{path:z,resolved:H});try{return await GH(H,"utf-8")}catch(J){throw vq.mapOsError(J,{path:z,resolved:H,operation:"readFile"})}},v=async(z,H)=>{let h=await K(z),J;try{J=await DP(h)}catch(X){if(X.code==="ENOENT")J=null;else throw vq.mapOsError(X,{path:z,resolved:h,operation:"stat"})}if(J&&!J.isFile())throw vq.fsError("VALIDATION_ERROR","Target path exists and is not a regular file",{path:z,resolved:h});try{await VH(yP(h),{recursive:!0})}catch(X){throw vq.mapOsError(X,{path:yP(z),resolved:yP(h),operation:"mkdir"})}let k=`${h}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{await mH(k,H,{encoding:"utf-8",mode:384}),await rH(k,h)}catch(X){try{await dv(k)}catch{}throw vq.mapOsError(X,{path:z,resolved:h,operation:"writeText"})}},w=async(z)=>{let H=await K(z);try{return await dv(H),{deleted:!0}}catch(h){if(h.code==="ENOENT")return{deleted:!1};throw vq.mapOsError(h,{path:z,resolved:H,operation:"delete"})}},O=(z,H,h)=>{for(let X=0;X<H.length;X++){let{oldText:l}=H[X];if(l.length===0)throw vq.fsError("VALIDATION_ERROR",`Empty oldText in replacement at index ${X} would cause infinite loop`,{index:X})}let J=z,k=0;for(let{oldText:X,newText:l}of H)if(J.includes(X))J=J.replace(X,l),k++;if(h?.requireAll&&k!==H.length)throw vq.fsError("VALIDATION_ERROR",`Only ${k} of ${H.length} replacements were applied (requireAll=true)`,{applied:k,total:H.length});return{wouldContent:J,applied:k}};return Object.freeze({exists:$,stat:P,readText:j,resolveSafe:async(z)=>{return vq.resolveWithinBoundary(f,z)},writeText:v,delete:w,previewReplaceFirst:O,applyReplaceFirst:async(z,H,h)=>{let J=await j(z),{wouldContent:k,applied:X}=O(J,H,h);if(X===0)return{applied:0};return await v(z,k),{applied:X}}})},pH,Uf;var av=b_(()=>{IP();pH=Object.freeze({create:CH}),Uf=pH});import{mkdir as lH,rm as nH,rmdir as RH,stat as Iv,readdir as EH}from"fs/promises";import{resolve as Dv,dirname as gH,isAbsolute as yv}from"path";var dH=(_)=>{let{boundaryDir:q}=_;if(!q)throw vq.fsError("VALIDATION_ERROR","boundaryDir is required (empty string)",{boundaryDir:q});if(!yv(q))throw vq.fsError("VALIDATION_ERROR",`boundaryDir must be an absolute path: '${q}'`,{boundaryDir:q});let f=Dv(q),K=(T)=>{let Y=T.toLowerCase().replace(/[^a-z0-9-_]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");if(!Y)throw vq.fsError("VALIDATION_ERROR",`normalizeName produced empty result from input: '${T}'`,{name:T,normalized:Y});return Y},$=async(T,Y)=>{return await vq.resolveWithinBoundary(f,T,Y)};return Object.freeze({normalizeName:K,resolve:$,isInsideBoundary:(T)=>{if(!yv(T))throw vq.fsError("VALIDATION_ERROR",`targetAbs must be an absolute path: '${T}'`,{targetAbs:T});let Y=Dv(T);return vq.insideBoundary(f,Y)},ensureDir:async(T)=>{let{abs:Y}=await $(T);try{await lH(Y,{recursive:!0})}catch(z){throw vq.mapOsError(z,{path:T,resolved:Y,operation:"ensureDir"})}},parentDir:(T)=>{let Y=vq.validateRelative(T),z=gH(Y);return z==="."?z:z.replaceAll("\\","/")},stat:async(T)=>{let{abs:Y}=await $(T);try{return await Iv(Y)}catch(z){throw vq.mapOsError(z,{path:T,resolved:Y,operation:"stat"})}},deleteDir:async(T,Y)=>{if(Y?.requireEmpty&&Y?.recursive)throw vq.fsError("VALIDATION_ERROR","requireEmpty and recursive are mutually exclusive",{path:T});let{abs:z}=await $(T);if(z===f)throw vq.fsError("VALIDATION_ERROR",`Cannot delete boundary root: '${T}' \u2192 '${z}'`,{path:T,resolved:z,boundary:f});let H;try{H=await Iv(z)}catch(h){if(h.code==="ENOENT")return{deleted:!1,reason:"NOT_FOUND"};throw vq.mapOsError(h,{path:T,resolved:z,operation:"stat"})}if(!H.isDirectory())return{deleted:!1,reason:"NOT_DIR"};if(Y?.requireEmpty){let h;try{h=await EH(z)}catch(J){throw vq.mapOsError(J,{path:T,resolved:z,operation:"readdir"})}if(h.length>0)throw vq.fsError("DIRECTORY_NOT_EMPTY",`Directory not empty: '${T}' \u2192 '${z}'`,{path:T,resolved:z});try{return await RH(z),{deleted:!0}}catch(J){if(J.code==="ENOENT")return{deleted:!1,reason:"NOT_FOUND"};if(J.code==="ENOTEMPTY")throw vq.fsError("DIRECTORY_NOT_EMPTY",`Directory not empty (race condition): '${T}' \u2192 '${z}'`,{path:T,resolved:z});throw vq.mapOsError(J,{path:T,resolved:z,operation:"rmdir"})}}try{return await nH(z,{recursive:Y?.recursive??!1}),{deleted:!0}}catch(h){if(h.code==="ENOENT")return{deleted:!1,reason:"NOT_FOUND"};if(h.code==="ENOTEMPTY"||h.code==="EISDIR"||h.code==="EACCES")throw vq.fsError("DIRECTORY_NOT_EMPTY",`Directory not empty: '${T}' \u2192 '${z}'`,{path:T,resolved:z,originalCode:h.code});throw vq.mapOsError(h,{path:T,resolved:z,operation:"deleteDir"})}}})},aH,Ff;var iv=b_(()=>{IP();aH=Object.freeze({create:dH}),Ff=aH});import{dirname as IH}from"path";var ov="---",Rq=(_,q,f)=>{let K=new Error(q);if(K.code=_,f!==void 0)K.data=f;throw K},DH=(_)=>{let{fileServiceByScope:q,folderServiceByScope:f,indexFilename:K}=_,$=(V)=>{if(V==="project")return q.project;if(V==="shared")return q.shared;return Rq("INVALID_SCOPE",`Unknown scope '${V}'`,{scope:V})},P=(V)=>{if(V==="project")return f.project;if(V==="shared")return f.shared;return Rq("INVALID_SCOPE",`Unknown scope '${V}'`,{scope:V})},j=async(V)=>{if(V.scope)return{scope:V.scope};if(V.kind==="id"){let C=dP(V.id);if(!C)Rq("INVALID_ID_FORMAT",`Invalid doc ID format: '${V.id}'. Expected docNNN or sdocNNN`,{id:V.id});return{scope:C}}if(V.kind==="path"){try{if((await w("project")).pathToId[V.path])return{scope:"project"}}catch{}try{if((await w("shared")).pathToId[V.path])return{scope:"shared",fallback:!0}}catch{}return{scope:"project"}}let M=V;return Rq("VALIDATION_ERROR",`Unknown address kind: ${JSON.stringify(M)}`)},v=(V)=>{return K},w=async(V)=>{let M=v(V),C=$(V);try{let a=await C.readText(M),r=JSON.parse(a);if(!r.id&&!r.pathToId){let u={id:{},pathToId:{}};for(let[m,S]of Object.entries(r))u.id[m]={path:S},u.pathToId[S]=m;return await O(V,u),u}return r}catch(a){if(a.code==="NOT_FOUND")return{id:{},pathToId:{}};throw a}},O=async(V,M)=>{let C=v(V),a=$(V),r=JSON.stringify(M,null,2);await a.writeText(C,r)},T=(V)=>{let M=V.split(`
|
|
3
|
+
`);if(M.length<3||M[0].trim()!==ov)return{bodyContent:V};let C=-1;for(let S=1;S<M.length;S++)if(M[S].trim()===ov){C=S;break}if(C===-1)return{bodyContent:V};let a=M.slice(1,C),r=M.slice(0,C+1).join(`
|
|
4
|
+
`),A=M.slice(C+1).join(`
|
|
5
|
+
`).trim(),u=(S)=>{if(S.startsWith('"')&&S.endsWith('"')||S.startsWith("'")&&S.endsWith("'"))return S.slice(1,-1);return S},m={};for(let S of a){let I=S.indexOf(":");if(I===-1)continue;let D=S.slice(0,I).trim(),c=S.slice(I+1).trim();m[D]=u(c)}return{rawFrontMatter:r,frontMatter:Object.keys(m).length>0?m:void 0,bodyContent:A}},Y=(V,M)=>{switch(M.op){case"replaceOnce":{let{oldText:C,newText:a}=M;if(!V.includes(C))return{newContent:V,applied:!1};return{newContent:V.replace(C,a),applied:!0}}case"replaceAll":{let{oldText:C,newText:a}=M;if(!V.includes(C))return{newContent:V,applied:!1};let r=new RegExp(C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");return{newContent:V.replace(r,a),applied:!0}}case"replaceRegex":{let{pattern:C,flags:a,replacement:r}=M,A=new RegExp(C,a);if(!A.test(V))return{newContent:V,applied:!1};return{newContent:V.replace(A,r),applied:!0}}case"replaceAllContent":{let{content:C}=M;return{newContent:C,applied:!0}}default:{let C=M;return Rq("VALIDATION_ERROR",`Unknown edit operation: ${JSON.stringify(C)}`)}}},z=(V)=>{return sq.isdocId(V)},H=(V)=>{if(!V||V.trim().length===0)return{valid:!1,reason:"Path cannot be empty"};if(V.startsWith("/"))return{valid:!1,reason:"Path must be relative (no leading slash)"};if(V.includes(".."))return{valid:!1,reason:'Path cannot contain ".." segments'};let C=V.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");if(/[<>:"|?*\0]/.test(C))return{valid:!1,reason:"Path contains invalid characters"};return{valid:!0,normalized:C}},h=(V)=>{let{scope:M,path:C}=V;if(M!=="project"&&M!=="shared")Rq("INVALID_SCOPE",`Scope must be 'project' or 'shared', got '${M}'`,{scope:M});let a=H(C);if(!a.valid)Rq("INVALID_PATH_FORMAT",a.reason,{path:C});return{scope:M,path:a.normalized}},J=async(V)=>{let{scope:M}=await j(V),C=P(M),a;if(V.kind==="path")a=h({...V,scope:M}).path;else{let{id:A}=V;if(!z(A))Rq("INVALID_ID_FORMAT",`ID must match pattern doc\\d{3,} or sdoc\\d{3,}, got '${A}'`,{id:A});let u=await w(M);if(!u.id[A])Rq("doc_NOT_FOUND",`No doc with ID '${A}' in scope '${M}'`,{id:A,scope:M});a=u.id[A].path}return{...await C.resolve(a),scope:M}},k=async(V)=>{if(V!=="project"&&V!=="shared")Rq("INVALID_SCOPE",`Scope must be 'project' or 'shared', got '${V}'`,{scope:V});let M=await w(V),C=V==="project"?"doc":"sdoc",a=new RegExp(`^${C}(\\d{3,})$`),r=0;for(let m of Object.keys(M.id)){let S=m.match(a);if(S){let I=parseInt(S[1],10);if(I>r)r=I}}let A=r+1;return`${C}${A.toString().padStart(3,"0")}`},X=async(V)=>{let{address:M,content:C}=V;if(M.kind!=="path")Rq("VALIDATION_ERROR","Create requires path-based addressing");let a=M.scope??"project",r=h({...M,scope:a}),{path:A}=r;if(sq.isdocId(A))Rq("INVALID_PATH_FORMAT",`Cannot create doc with path '${A}' - matches ID pattern`,{path:A,scope:a});let u=$(a),m=P(a),S=await k(a);if(await u.exists(A))Rq("doc_ALREADY_EXISTS",`doc already exists at path '${A}'`,{path:A,scope:a});let D=IH(A);if(D!==".")await m.ensureDir(D);await u.writeText(A,C);let c=await w(a);return c.id[S]={path:A},c.pathToId[A]=S,await O(a,c),{id:S,path:A}},l=async(V)=>{let{rel:M,scope:C}=await J(V),r=await $(C).readText(M),{frontMatter:A,bodyContent:u,rawFrontMatter:m}=T(r),S,I;if(V.kind==="path"){S=h({...V,scope:C}).path;let e=(await w(C)).pathToId[S];if(!e)return Rq("doc_NOT_FOUND",`doc exists but not in index: '${S}'`,{path:S,scope:C});I=e}else if(V.kind==="id"){I=V.id;let c=(await w(C)).id[I]?.path;if(!c)return Rq("doc_NOT_FOUND",`No doc with ID '${I}'`,{id:I,scope:C});S=c}else{let D=V;return Rq("VALIDATION_ERROR",`Unknown address kind: ${JSON.stringify(D)}`)}return{address:V,content:r,frontMatter:A,bodyContent:u,path:S,id:I}},N=async(V,M)=>{let{rel:C,scope:a}=await J(V),r=$(a),u=await r.readText(C),m=0;for(let S of M){let{newContent:I,applied:D}=Y(u,S);if(u=I,D)m++}if(m===0)return{applied:0};return await r.writeText(C,u),{applied:m}},n=async(V)=>{let{rel:M,scope:C}=await J(V),a=await(async()=>{if(V.kind==="id")return V.id;else if(V.kind==="path"){let S=h({...V,scope:C}),D=(await w(C)).pathToId[S.path];if(!D)return Rq("doc_NOT_FOUND",`doc not in index: '${S.path}'`,{path:S.path,scope:C});return D}else{let m=V;return Rq("VALIDATION_ERROR",`Unknown address kind: ${JSON.stringify(m)}`)}})(),r=$(C),A=!1;try{A=(await r.delete(M)).deleted}catch(m){if(m.code==="NOT_FOUND")A=!1;else throw m}let u=await w(C);if(u.id[a]){let m=u.id[a].path;delete u.id[a],delete u.pathToId[m],await O(C,u)}return{deleted:A}},R=async(V)=>{let{scope:M,pathPrefix:C,includeContent:a=!1}=V;if(M){if(M!=="project"&&M!=="shared")Rq("INVALID_SCOPE",`Scope must be 'project' or 'shared', got '${M}'`,{scope:M});return await g(M,C,a)}let r=await g("project",C,a),A=await g("shared",C,a),u=new Set(r.map((I)=>I.path)),m=new Set(A.map((I)=>I.path));for(let I of r)if(m.has(I.path))I.override="overrides";for(let I of A)if(u.has(I.path))I.override="overridden";let S=[...r,...A];return S.sort((I,D)=>I.path.localeCompare(D.path)),S},g=async(V,M,C=!1)=>{let a=$(V),r;try{r=await w(V)}catch(u){if(u.code==="NOT_FOUND"||u.code==="ENOENT")return[];throw u}let A=[];for(let[u,m]of Object.entries(r.id)){let S=m.path;if(M&&!S.startsWith(M))continue;try{if(C){let I=await a.readText(S),D=await a.stat(S),{frontMatter:c}=T(I);A.push({scope:V,id:u,path:S,synopsis:c?.synopsis,modifiedAt:D.mtime})}else{let I=await a.stat(S);A.push({scope:V,id:u,path:S,modifiedAt:I.mtime})}}catch{continue}}return A.sort((u,m)=>u.path.localeCompare(m.path)),A};return Object.freeze({create:X,read:l,editLatest:N,deleteLatest:n,list:R})},yH,cv;var Lv=b_(()=>{wf();yH=Object.freeze({create:DH}),cv=yH});var C$,p$,iP=(_)=>{if(C$.isId(_))return"project";if(p$.isId(_))return"shared";return},iH=(_)=>{return C$.isId(_)||p$.isId(_)},tv=(_)=>{return _==="project"?C$:p$},oH=(_,q)=>{return tv(q).validateId(_)},cH,oP;var ev=b_(()=>{gP();C$=vf.create({idPattern:/^tpl\d{3,}$/,entityName:"project-template"}),p$=vf.create({idPattern:/^stpl\d{3,}$/,entityName:"shared-template"}),cH=Object.freeze({project:C$,shared:p$,detectScopeFromId:iP,isTemplateId:iH,getResolverForScope:tv,validateIdForScope:oH}),oP=cH});var Lq=p((_h)=>{_h.__esModule=!0;_h.extend=xv;_h.indexOf=sH;_h.escapeExpression=BH;_h.isEmpty=UH;_h.createFrame=FH;_h.blockParams=QH;_h.appendContextPath=qh;var LH={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},tH=/[&<>"'`=]/g,eH=/[&<>"'`=]/;function xH(_){return LH[_]}function xv(_){for(var q=1;q<arguments.length;q++)for(var f in arguments[q])if(Object.prototype.hasOwnProperty.call(arguments[q],f))_[f]=arguments[q][f];return _}var LP=Object.prototype.toString;_h.toString=LP;var cP=function _(q){return typeof q==="function"};if(cP(/x/))_h.isFunction=cP=function(_){return typeof _==="function"&&LP.call(_)==="[object Function]"};_h.isFunction=cP;var sv=Array.isArray||function(_){return _&&typeof _==="object"?LP.call(_)==="[object Array]":!1};_h.isArray=sv;function sH(_,q){for(var f=0,K=_.length;f<K;f++)if(_[f]===q)return f;return-1}function BH(_){if(typeof _!=="string"){if(_&&_.toHTML)return _.toHTML();else if(_==null)return"";else if(!_)return _+"";_=""+_}if(!eH.test(_))return _;return _.replace(tH,xH)}function UH(_){if(!_&&_!==0)return!0;else if(sv(_)&&_.length===0)return!0;else return!1}function FH(_){var q=xv({},_);return q._parent=_,q}function QH(_,q){return _.path=q,_}function qh(_,q){return(_?_+".":"")+q}});var j_=p((Bv,Uv)=>{Bv.__esModule=!0;var tP=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function eP(_,q){var f=q&&q.loc,K=void 0,$=void 0,P=void 0,j=void 0;if(f)K=f.start.line,$=f.end.line,P=f.start.column,j=f.end.column,_+=" - "+K+":"+P;var v=Error.prototype.constructor.call(this,_);for(var w=0;w<tP.length;w++)this[tP[w]]=v[tP[w]];if(Error.captureStackTrace)Error.captureStackTrace(this,eP);try{if(f)if(this.lineNumber=K,this.endLineNumber=$,Object.defineProperty)Object.defineProperty(this,"column",{value:P,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:j,enumerable:!0});else this.column=P,this.endColumn=j}catch(O){}}eP.prototype=new Error;Bv.default=eP;Uv.exports=Bv.default});var q5=p((Fv,Qv)=>{Fv.__esModule=!0;var xP=Lq();Fv.default=function(_){_.registerHelper("blockHelperMissing",function(q,f){var{inverse:K,fn:$}=f;if(q===!0)return $(this);else if(q===!1||q==null)return K(this);else if(xP.isArray(q))if(q.length>0){if(f.ids)f.ids=[f.name];return _.helpers.each(q,f)}else return K(this);else{if(f.data&&f.ids){var P=xP.createFrame(f.data);P.contextPath=xP.appendContextPath(f.data.contextPath,f.name),f={data:P}}return $(q,f)}})};Qv.exports=Fv.default});var $5=p((_5,f5)=>{_5.__esModule=!0;function kh(_){return _&&_.__esModule?_:{default:_}}var Qf=Lq(),Zh=j_(),Xh=kh(Zh);_5.default=function(_){_.registerHelper("each",function(q,f){if(!f)throw new Xh.default("Must pass iterator to #each");var{fn:K,inverse:$}=f,P=0,j="",v=void 0,w=void 0;if(f.data&&f.ids)w=Qf.appendContextPath(f.data.contextPath,f.ids[0])+".";if(Qf.isFunction(q))q=q.call(this);if(f.data)v=Qf.createFrame(f.data);function O(h,J,k){if(v){if(v.key=h,v.index=J,v.first=J===0,v.last=!!k,w)v.contextPath=w+h}j=j+K(q[h],{data:v,blockParams:Qf.blockParams([q[h],h],[w+h,null])})}if(q&&typeof q==="object")if(Qf.isArray(q)){for(var T=q.length;P<T;P++)if(P in q)O(P,P,P===q.length-1)}else if(typeof Symbol==="function"&&q[Symbol.iterator]){var Y=[],z=q[Symbol.iterator]();for(var H=z.next();!H.done;H=z.next())Y.push(H.value);q=Y;for(var T=q.length;P<T;P++)O(P,P,P===q.length-1)}else(function(){var h=void 0;if(Object.keys(q).forEach(function(J){if(h!==void 0)O(h,P-1);h=J,P++}),h!==void 0)O(h,P-1,!0)})();if(P===0)j=$(this);return j})};f5.exports=_5.default});var j5=p((K5,P5)=>{K5.__esModule=!0;function Gh(_){return _&&_.__esModule?_:{default:_}}var mh=j_(),rh=Gh(mh);K5.default=function(_){_.registerHelper("helperMissing",function(){if(arguments.length===1)return;else throw new rh.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};P5.exports=K5.default});var T5=p((O5,Y5)=>{O5.__esModule=!0;function Mh(_){return _&&_.__esModule?_:{default:_}}var v5=Lq(),Sh=j_(),w5=Mh(Sh);O5.default=function(_){_.registerHelper("if",function(q,f){if(arguments.length!=2)throw new w5.default("#if requires exactly one argument");if(v5.isFunction(q))q=q.call(this);if(!f.hash.includeZero&&!q||v5.isEmpty(q))return f.inverse(this);else return f.fn(this)}),_.registerHelper("unless",function(q,f){if(arguments.length!=2)throw new w5.default("#unless requires exactly one argument");return _.helpers.if.call(this,q,{fn:f.inverse,inverse:f.fn,hash:f.hash})})};Y5.exports=O5.default});var H5=p((z5,W5)=>{z5.__esModule=!0;z5.default=function(_){_.registerHelper("log",function(){var q=[void 0],f=arguments[arguments.length-1];for(var K=0;K<arguments.length-1;K++)q.push(arguments[K]);var $=1;if(f.hash.level!=null)$=f.hash.level;else if(f.data&&f.data.level!=null)$=f.data.level;q[0]=$,_.log.apply(_,q)})};W5.exports=z5.default});var k5=p((h5,J5)=>{h5.__esModule=!0;h5.default=function(_){_.registerHelper("lookup",function(q,f,K){if(!q)return q;return K.lookupProperty(q,f)})};J5.exports=h5.default});var A5=p((Z5,X5)=>{Z5.__esModule=!0;function Eh(_){return _&&_.__esModule?_:{default:_}}var q6=Lq(),gh=j_(),dh=Eh(gh);Z5.default=function(_){_.registerHelper("with",function(q,f){if(arguments.length!=2)throw new dh.default("#with requires exactly one argument");if(q6.isFunction(q))q=q.call(this);var K=f.fn;if(!q6.isEmpty(q)){var $=f.data;if(f.data&&f.ids)$=q6.createFrame(f.data),$.contextPath=q6.appendContextPath(f.data.contextPath,f.ids[0]);return K(q,{data:$,blockParams:q6.blockParams([q],[$&&$.contextPath])})}else return f.inverse(this)})};X5.exports=Z5.default});var sP=p((fJ)=>{fJ.__esModule=!0;fJ.registerDefaultHelpers=qJ;fJ.moveHelperToHooks=_J;function M8(_){return _&&_.__esModule?_:{default:_}}var Dh=q5(),yh=M8(Dh),ih=$5(),oh=M8(ih),ch=j5(),Lh=M8(ch),th=T5(),eh=M8(th),xh=H5(),sh=M8(xh),Bh=k5(),Uh=M8(Bh),Fh=A5(),Qh=M8(Fh);function qJ(_){yh.default(_),oh.default(_),Lh.default(_),eh.default(_),sh.default(_),Uh.default(_),Qh.default(_)}function _J(_,q,f){if(_.helpers[q]){if(_.hooks[q]=_.helpers[q],!f)delete _.helpers[q]}}});var m5=p((u5,G5)=>{u5.__esModule=!0;var jJ=Lq();u5.default=function(_){_.registerDecorator("inline",function(q,f,K,$){var P=q;if(!f.partials)f.partials={},P=function(j,v){var w=K.partials;K.partials=jJ.extend({},w,f.partials);var O=q(j,v);return K.partials=w,O};return f.partials[$.args[0]]=$.fn,P})};G5.exports=u5.default});var r5=p((WJ)=>{WJ.__esModule=!0;WJ.registerDefaultDecorators=zJ;function OJ(_){return _&&_.__esModule?_:{default:_}}var YJ=m5(),TJ=OJ(YJ);function zJ(_){TJ.default(_)}});var BP=p((b5,V5)=>{b5.__esModule=!0;var JJ=Lq(),Of={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function _(q){if(typeof q==="string"){var f=JJ.indexOf(Of.methodMap,q.toLowerCase());if(f>=0)q=f;else q=parseInt(q,10)}return q},log:function _(q){if(q=Of.lookupLevel(q),typeof console!=="undefined"&&Of.lookupLevel(Of.level)<=q){var f=Of.methodMap[q];if(!console[f])f="log";for(var K=arguments.length,$=Array(K>1?K-1:0),P=1;P<K;P++)$[P-1]=arguments[P];console[f].apply(console,$)}}};b5.default=Of;V5.exports=b5.default});var M5=p((uJ)=>{uJ.__esModule=!0;uJ.createNewLookupObject=AJ;var XJ=Lq();function AJ(){for(var _=arguments.length,q=Array(_),f=0;f<_;f++)q[f]=arguments[f];return XJ.extend.apply(void 0,[Object.create(null)].concat(q))}});var UP=p((pJ)=>{pJ.__esModule=!0;pJ.createProtoAccessControl=MJ;pJ.resultIsAllowed=SJ;pJ.resetLoggedProperties=CJ;function rJ(_){return _&&_.__esModule?_:{default:_}}var S5=M5(),bJ=BP(),VJ=rJ(bJ),l$=Object.create(null);function MJ(_){var q=Object.create(null);q.constructor=!1,q.__defineGetter__=!1,q.__defineSetter__=!1,q.__lookupGetter__=!1;var f=Object.create(null);return f.__proto__=!1,{properties:{whitelist:S5.createNewLookupObject(f,_.allowedProtoProperties),defaultValue:_.allowProtoPropertiesByDefault},methods:{whitelist:S5.createNewLookupObject(q,_.allowedProtoMethods),defaultValue:_.allowProtoMethodsByDefault}}}function SJ(_,q,f){if(typeof _==="function")return N5(q.methods,f);else return N5(q.properties,f)}function N5(_,q){if(_.whitelist[q]!==void 0)return _.whitelist[q]===!0;if(_.defaultValue!==void 0)return _.defaultValue;return NJ(q),!1}function NJ(_){if(l$[_]!==!0)l$[_]=!0,VJ.default.log("error",'Handlebars: Access has been denied to resolve the property "'+_+`" because it is not an "own property" of its parent.
|
|
6
|
+
You can add a runtime option to disable the check or this warning:
|
|
7
|
+
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`)}function CJ(){Object.keys(l$).forEach(function(_){delete l$[_]})}});var R$=p((tJ)=>{tJ.__esModule=!0;tJ.HandlebarsEnvironment=q3;function C5(_){return _&&_.__esModule?_:{default:_}}var S8=Lq(),gJ=j_(),FP=C5(gJ),dJ=sP(),aJ=r5(),IJ=BP(),n$=C5(IJ),DJ=UP(),yJ="4.7.8";tJ.VERSION=yJ;var iJ=8;tJ.COMPILER_REVISION=iJ;var oJ=7;tJ.LAST_COMPATIBLE_COMPILER_REVISION=oJ;var cJ={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};tJ.REVISION_CHANGES=cJ;var QP="[object Object]";function q3(_,q,f){this.helpers=_||{},this.partials=q||{},this.decorators=f||{},dJ.registerDefaultHelpers(this),aJ.registerDefaultDecorators(this)}q3.prototype={constructor:q3,logger:n$.default,log:n$.default.log,registerHelper:function _(q,f){if(S8.toString.call(q)===QP){if(f)throw new FP.default("Arg not supported with multiple helpers");S8.extend(this.helpers,q)}else this.helpers[q]=f},unregisterHelper:function _(q){delete this.helpers[q]},registerPartial:function _(q,f){if(S8.toString.call(q)===QP)S8.extend(this.partials,q);else{if(typeof f==="undefined")throw new FP.default('Attempting to register a partial called "'+q+'" as undefined');this.partials[q]=f}},unregisterPartial:function _(q){delete this.partials[q]},registerDecorator:function _(q,f){if(S8.toString.call(q)===QP){if(f)throw new FP.default("Arg not supported with multiple decorators");S8.extend(this.decorators,q)}else this.decorators[q]=f},unregisterDecorator:function _(q){delete this.decorators[q]},resetLoggedPropertyAccesses:function _(){DJ.resetLoggedProperties()}};var LJ=n$.default.log;tJ.log=LJ;tJ.createFrame=S8.createFrame;tJ.logger=n$.default});var n5=p((p5,l5)=>{p5.__esModule=!0;function _3(_){this.string=_}_3.prototype.toString=_3.prototype.toHTML=function(){return""+this.string};p5.default=_3;l5.exports=p5.default});var R5=p((Pk)=>{Pk.__esModule=!0;Pk.wrapHelper=Kk;function Kk(_,q){if(typeof _!=="function")return _;var f=function K(){var $=arguments[arguments.length-1];return arguments[arguments.length-1]=q($),_.apply(this,arguments)};return f}});var I5=p((Ak)=>{Ak.__esModule=!0;Ak.checkRevision=Wk;Ak.template=Hk;Ak.wrapProgram=E$;Ak.resolvePartial=hk;Ak.invokePartial=Jk;Ak.noop=d5;function wk(_){return _&&_.__esModule?_:{default:_}}function Ok(_){if(_&&_.__esModule)return _;else{var q={};if(_!=null){for(var f in _)if(Object.prototype.hasOwnProperty.call(_,f))q[f]=_[f]}return q.default=_,q}}var Yk=Lq(),i_=Ok(Yk),Tk=j_(),o_=wk(Tk),c_=R$(),E5=sP(),zk=R5(),g5=UP();function Wk(_){var q=_&&_[0]||1,f=c_.COMPILER_REVISION;if(q>=c_.LAST_COMPATIBLE_COMPILER_REVISION&&q<=c_.COMPILER_REVISION)return;if(q<c_.LAST_COMPATIBLE_COMPILER_REVISION){var K=c_.REVISION_CHANGES[f],$=c_.REVISION_CHANGES[q];throw new o_.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+K+") or downgrade your runtime to an older version ("+$+").")}else throw new o_.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+_[1]+").")}function Hk(_,q){if(!q)throw new o_.default("No environment passed to template");if(!_||!_.main)throw new o_.default("Unknown template object: "+typeof _);_.main.decorator=_.main_d,q.VM.checkRevision(_.compiler);var f=_.compiler&&_.compiler[0]===7;function K(j,v,w){if(w.hash){if(v=i_.extend({},v,w.hash),w.ids)w.ids[0]=!0}j=q.VM.resolvePartial.call(this,j,v,w);var O=i_.extend({},w,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),T=q.VM.invokePartial.call(this,j,v,O);if(T==null&&q.compile)w.partials[w.name]=q.compile(j,_.compilerOptions,q),T=w.partials[w.name](v,O);if(T!=null){if(w.indent){var Y=T.split(`
|
|
8
|
+
`);for(var z=0,H=Y.length;z<H;z++){if(!Y[z]&&z+1===H)break;Y[z]=w.indent+Y[z]}T=Y.join(`
|
|
9
|
+
`)}return T}else throw new o_.default("The partial "+w.name+" could not be compiled when running in runtime-only mode")}var $={strict:function j(v,w,O){if(!v||!(w in v))throw new o_.default('"'+w+'" not defined in '+v,{loc:O});return $.lookupProperty(v,w)},lookupProperty:function j(v,w){var O=v[w];if(O==null)return O;if(Object.prototype.hasOwnProperty.call(v,w))return O;if(g5.resultIsAllowed(O,$.protoAccessControl,w))return O;return},lookup:function j(v,w){var O=v.length;for(var T=0;T<O;T++){var Y=v[T]&&$.lookupProperty(v[T],w);if(Y!=null)return v[T][w]}},lambda:function j(v,w){return typeof v==="function"?v.call(w):v},escapeExpression:i_.escapeExpression,invokePartial:K,fn:function j(v){var w=_[v];return w.decorator=_[v+"_d"],w},programs:[],program:function j(v,w,O,T,Y){var z=this.programs[v],H=this.fn(v);if(w||Y||T||O)z=E$(this,v,H,w,O,T,Y);else if(!z)z=this.programs[v]=E$(this,v,H);return z},data:function j(v,w){while(v&&w--)v=v._parent;return v},mergeIfNeeded:function j(v,w){var O=v||w;if(v&&w&&v!==w)O=i_.extend({},w,v);return O},nullContext:Object.seal({}),noop:q.VM.noop,compilerInfo:_.compiler};function P(j){var v=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],w=v.data;if(P._setup(v),!v.partial&&_.useData)w=kk(j,w);var O=void 0,T=_.useBlockParams?[]:void 0;if(_.useDepths)if(v.depths)O=j!=v.depths[0]?[j].concat(v.depths):v.depths;else O=[j];function Y(z){return""+_.main($,z,$.helpers,$.partials,w,T,O)}return Y=a5(_.main,Y,$,v.depths||[],w,T),Y(j,v)}return P.isTop=!0,P._setup=function(j){if(!j.partial){var v=i_.extend({},q.helpers,j.helpers);if(Zk(v,$),$.helpers=v,_.usePartial)$.partials=$.mergeIfNeeded(j.partials,q.partials);if(_.usePartial||_.useDecorators)$.decorators=i_.extend({},q.decorators,j.decorators);$.hooks={},$.protoAccessControl=g5.createProtoAccessControl(j);var w=j.allowCallsToHelperMissing||f;E5.moveHelperToHooks($,"helperMissing",w),E5.moveHelperToHooks($,"blockHelperMissing",w)}else $.protoAccessControl=j.protoAccessControl,$.helpers=j.helpers,$.partials=j.partials,$.decorators=j.decorators,$.hooks=j.hooks},P._child=function(j,v,w,O){if(_.useBlockParams&&!w)throw new o_.default("must pass block params");if(_.useDepths&&!O)throw new o_.default("must pass parent depths");return E$($,j,_[j],v,0,w,O)},P}function E$(_,q,f,K,$,P,j){function v(w){var O=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],T=j;if(j&&w!=j[0]&&!(w===_.nullContext&&j[0]===null))T=[w].concat(j);return f(_,w,_.helpers,_.partials,O.data||K,P&&[O.blockParams].concat(P),T)}return v=a5(f,v,_,j,K,P),v.program=q,v.depth=j?j.length:0,v.blockParams=$||0,v}function hk(_,q,f){if(!_)if(f.name==="@partial-block")_=f.data["partial-block"];else _=f.partials[f.name];else if(!_.call&&!f.name)f.name=_,_=f.partials[_];return _}function Jk(_,q,f){var K=f.data&&f.data["partial-block"];if(f.partial=!0,f.ids)f.data.contextPath=f.ids[0]||f.data.contextPath;var $=void 0;if(f.fn&&f.fn!==d5)(function(){f.data=c_.createFrame(f.data);var P=f.fn;if($=f.data["partial-block"]=function j(v){var w=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return w.data=c_.createFrame(w.data),w.data["partial-block"]=K,P(v,w)},P.partials)f.partials=i_.extend({},f.partials,P.partials)})();if(_===void 0&&$)_=$;if(_===void 0)throw new o_.default("The partial "+f.name+" could not be found");else if(_ instanceof Function)return _(q,f)}function d5(){return""}function kk(_,q){if(!q||!("root"in q))q=q?c_.createFrame(q):{},q.root=_;return q}function a5(_,q,f,K,$,P){if(_.decorator){var j={};q=_.decorator(q,j,f,K&&K[0],$,P,K),i_.extend(q,j)}return q}function Zk(_,q){Object.keys(_).forEach(function(f){var K=_[f];_[f]=Xk(K,q)})}function Xk(_,q){var f=q.lookupProperty;return zk.wrapHelper(_,function(K){return i_.extend({lookupProperty:f},K)})}});var f3=p((D5,y5)=>{D5.__esModule=!0;D5.default=function(_){(function(){if(typeof globalThis==="object")return;Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__})();var q=globalThis.Handlebars;_.noConflict=function(){if(globalThis.Handlebars===_)globalThis.Handlebars=q;return _}};y5.exports=D5.default});var e5=p((L5,t5)=>{L5.__esModule=!0;function K3(_){return _&&_.__esModule?_:{default:_}}function P3(_){if(_&&_.__esModule)return _;else{var q={};if(_!=null){for(var f in _)if(Object.prototype.hasOwnProperty.call(_,f))q[f]=_[f]}return q.default=_,q}}var Ck=R$(),i5=P3(Ck),pk=n5(),lk=K3(pk),nk=j_(),Rk=K3(nk),Ek=Lq(),$3=P3(Ek),gk=I5(),o5=P3(gk),dk=f3(),ak=K3(dk);function c5(){var _=new i5.HandlebarsEnvironment;return $3.extend(_,i5),_.SafeString=lk.default,_.Exception=Rk.default,_.Utils=$3,_.escapeExpression=$3.escapeExpression,_.VM=o5,_.template=function(q){return o5.template(q,_)},_}var _6=c5();_6.create=c5;ak.default(_6);_6.default=_6;L5.default=_6;t5.exports=L5.default});var j3=p((s5,B5)=>{s5.__esModule=!0;var x5={helpers:{helperExpression:function _(q){return q.type==="SubExpression"||(q.type==="MustacheStatement"||q.type==="BlockStatement")&&!!(q.params&&q.params.length||q.hash)},scopedId:function _(q){return/^\.|this\b/.test(q.original)},simpleId:function _(q){return q.parts.length===1&&!x5.helpers.scopedId(q)&&!q.depth}}};s5.default=x5;B5.exports=s5.default});var Q5=p((U5,F5)=>{U5.__esModule=!0;var ok=function(){var _={trace:function K(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function K($,P,j,v,w,O,T){var Y=O.length-1;switch(w){case 1:return O[Y-1];case 2:this.$=v.prepareProgram(O[Y]);break;case 3:this.$=O[Y];break;case 4:this.$=O[Y];break;case 5:this.$=O[Y];break;case 6:this.$=O[Y];break;case 7:this.$=O[Y];break;case 8:this.$=O[Y];break;case 9:this.$={type:"CommentStatement",value:v.stripComment(O[Y]),strip:v.stripFlags(O[Y],O[Y]),loc:v.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:O[Y],value:O[Y],loc:v.locInfo(this._$)};break;case 11:this.$=v.prepareRawBlock(O[Y-2],O[Y-1],O[Y],this._$);break;case 12:this.$={path:O[Y-3],params:O[Y-2],hash:O[Y-1]};break;case 13:this.$=v.prepareBlock(O[Y-3],O[Y-2],O[Y-1],O[Y],!1,this._$);break;case 14:this.$=v.prepareBlock(O[Y-3],O[Y-2],O[Y-1],O[Y],!0,this._$);break;case 15:this.$={open:O[Y-5],path:O[Y-4],params:O[Y-3],hash:O[Y-2],blockParams:O[Y-1],strip:v.stripFlags(O[Y-5],O[Y])};break;case 16:this.$={path:O[Y-4],params:O[Y-3],hash:O[Y-2],blockParams:O[Y-1],strip:v.stripFlags(O[Y-5],O[Y])};break;case 17:this.$={path:O[Y-4],params:O[Y-3],hash:O[Y-2],blockParams:O[Y-1],strip:v.stripFlags(O[Y-5],O[Y])};break;case 18:this.$={strip:v.stripFlags(O[Y-1],O[Y-1]),program:O[Y]};break;case 19:var z=v.prepareBlock(O[Y-2],O[Y-1],O[Y],O[Y],!1,this._$),H=v.prepareProgram([z],O[Y-1].loc);H.chained=!0,this.$={strip:O[Y-2].strip,program:H,chain:!0};break;case 20:this.$=O[Y];break;case 21:this.$={path:O[Y-1],strip:v.stripFlags(O[Y-2],O[Y])};break;case 22:this.$=v.prepareMustache(O[Y-3],O[Y-2],O[Y-1],O[Y-4],v.stripFlags(O[Y-4],O[Y]),this._$);break;case 23:this.$=v.prepareMustache(O[Y-3],O[Y-2],O[Y-1],O[Y-4],v.stripFlags(O[Y-4],O[Y]),this._$);break;case 24:this.$={type:"PartialStatement",name:O[Y-3],params:O[Y-2],hash:O[Y-1],indent:"",strip:v.stripFlags(O[Y-4],O[Y]),loc:v.locInfo(this._$)};break;case 25:this.$=v.preparePartialBlock(O[Y-2],O[Y-1],O[Y],this._$);break;case 26:this.$={path:O[Y-3],params:O[Y-2],hash:O[Y-1],strip:v.stripFlags(O[Y-4],O[Y])};break;case 27:this.$=O[Y];break;case 28:this.$=O[Y];break;case 29:this.$={type:"SubExpression",path:O[Y-3],params:O[Y-2],hash:O[Y-1],loc:v.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:O[Y],loc:v.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:v.id(O[Y-2]),value:O[Y],loc:v.locInfo(this._$)};break;case 32:this.$=v.id(O[Y-1]);break;case 33:this.$=O[Y];break;case 34:this.$=O[Y];break;case 35:this.$={type:"StringLiteral",value:O[Y],original:O[Y],loc:v.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(O[Y]),original:Number(O[Y]),loc:v.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:O[Y]==="true",original:O[Y]==="true",loc:v.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:v.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:v.locInfo(this._$)};break;case 40:this.$=O[Y];break;case 41:this.$=O[Y];break;case 42:this.$=v.preparePath(!0,O[Y],this._$);break;case 43:this.$=v.preparePath(!1,O[Y],this._$);break;case 44:O[Y-2].push({part:v.id(O[Y]),original:O[Y],separator:O[Y-1]}),this.$=O[Y-2];break;case 45:this.$=[{part:v.id(O[Y]),original:O[Y]}];break;case 46:this.$=[];break;case 47:O[Y-1].push(O[Y]);break;case 48:this.$=[];break;case 49:O[Y-1].push(O[Y]);break;case 50:this.$=[];break;case 51:O[Y-1].push(O[Y]);break;case 58:this.$=[];break;case 59:O[Y-1].push(O[Y]);break;case 64:this.$=[];break;case 65:O[Y-1].push(O[Y]);break;case 70:this.$=[];break;case 71:O[Y-1].push(O[Y]);break;case 78:this.$=[];break;case 79:O[Y-1].push(O[Y]);break;case 82:this.$=[];break;case 83:O[Y-1].push(O[Y]);break;case 86:this.$=[];break;case 87:O[Y-1].push(O[Y]);break;case 90:this.$=[];break;case 91:O[Y-1].push(O[Y]);break;case 94:this.$=[];break;case 95:O[Y-1].push(O[Y]);break;case 98:this.$=[O[Y]];break;case 99:O[Y-1].push(O[Y]);break;case 100:this.$=[O[Y]];break;case 101:O[Y-1].push(O[Y]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function K($,P){throw new Error($)},parse:function K($){var P=this,j=[0],v=[null],w=[],O=this.table,T="",Y=0,z=0,H=0,h=2,J=1;if(this.lexer.setInput($),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var k=this.lexer.yylloc;w.push(k);var X=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function l(I){j.length=j.length-2*I,v.length=v.length-I,w.length=w.length-I}function N(){var I=P.lexer.lex()||1;if(typeof I!=="number")I=P.symbols_[I]||I;return I}var n,R,g,V,M,C,a={},r,A,u,m;while(!0){if(g=j[j.length-1],this.defaultActions[g])V=this.defaultActions[g];else{if(n===null||typeof n=="undefined")n=N();V=O[g]&&O[g][n]}if(typeof V==="undefined"||!V.length||!V[0]){var S="";if(!H){m=[];for(r in O[g])if(this.terminals_[r]&&r>2)m.push("'"+this.terminals_[r]+"'");if(this.lexer.showPosition)S="Parse error on line "+(Y+1)+`:
|
|
10
|
+
`+this.lexer.showPosition()+`
|
|
11
|
+
Expecting `+m.join(", ")+", got '"+(this.terminals_[n]||n)+"'";else S="Parse error on line "+(Y+1)+": Unexpected "+(n==1?"end of input":"'"+(this.terminals_[n]||n)+"'");this.parseError(S,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:k,expected:m})}}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+n);switch(V[0]){case 1:if(j.push(n),v.push(this.lexer.yytext),w.push(this.lexer.yylloc),j.push(V[1]),n=null,!R){if(z=this.lexer.yyleng,T=this.lexer.yytext,Y=this.lexer.yylineno,k=this.lexer.yylloc,H>0)H--}else n=R,R=null;break;case 2:if(A=this.productions_[V[1]][1],a.$=v[v.length-A],a._$={first_line:w[w.length-(A||1)].first_line,last_line:w[w.length-1].last_line,first_column:w[w.length-(A||1)].first_column,last_column:w[w.length-1].last_column},X)a._$.range=[w[w.length-(A||1)].range[0],w[w.length-1].range[1]];if(C=this.performAction.call(a,T,z,Y,this.yy,V[1],v,w),typeof C!=="undefined")return C;if(A)j=j.slice(0,-1*A*2),v=v.slice(0,-1*A),w=w.slice(0,-1*A);j.push(this.productions_[V[1]][0]),v.push(a.$),w.push(a._$),u=O[j[j.length-2]][j[j.length-1]],j.push(u);break;case 3:return!0}}return!0}},q=function(){var K={EOF:1,parseError:function $(P,j){if(this.yy.parser)this.yy.parser.parseError(P,j);else throw new Error(P)},setInput:function $(P){if(this._input=P,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},input:function $(){var P=this._input[0];this.yytext+=P,this.yyleng++,this.offset++,this.match+=P,this.matched+=P;var j=P.match(/(?:\r\n?|\n).*/g);if(j)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),P},unput:function $(P){var j=P.length,v=P.split(/(?:\r\n?|\n)/g);this._input=P+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-j-1),this.offset-=j;var w=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1)this.yylineno-=v.length-1;var O=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:v?(v.length===w.length?this.yylloc.first_column:0)+w[w.length-v.length].length-v[0].length:this.yylloc.first_column-j},this.options.ranges)this.yylloc.range=[O[0],O[0]+this.yyleng-j];return this},more:function $(){return this._more=!0,this},less:function $(P){this.unput(this.match.slice(P))},pastInput:function $(){var P=this.matched.substr(0,this.matched.length-this.match.length);return(P.length>20?"...":"")+P.substr(-20).replace(/\n/g,"")},upcomingInput:function $(){var P=this.match;if(P.length<20)P+=this._input.substr(0,20-P.length);return(P.substr(0,20)+(P.length>20?"...":"")).replace(/\n/g,"")},showPosition:function $(){var P=this.pastInput(),j=new Array(P.length+1).join("-");return P+this.upcomingInput()+`
|
|
12
|
+
`+j+"^"},next:function $(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var P,j,v,w,O,T;if(!this._more)this.yytext="",this.match="";var Y=this._currentRules();for(var z=0;z<Y.length;z++)if(v=this._input.match(this.rules[Y[z]]),v&&(!j||v[0].length>j[0].length)){if(j=v,w=z,!this.options.flex)break}if(j){if(T=j[0].match(/(?:\r\n?|\n).*/g),T)this.yylineno+=T.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:T?T[T.length-1].length-T[T.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+j[0].length},this.yytext+=j[0],this.match+=j[0],this.matches=j,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._input=this._input.slice(j[0].length),this.matched+=j[0],P=this.performAction.call(this,this.yy,this,Y[w],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(P)return P;else return}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
13
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function $(){var P=this.next();if(typeof P!=="undefined")return P;else return this.lex()},begin:function $(P){this.conditionStack.push(P)},popState:function $(){return this.conditionStack.pop()},_currentRules:function $(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function $(){return this.conditionStack[this.conditionStack.length-2]},pushState:function $(P){this.begin(P)}};return K.options={},K.performAction=function $(P,j,v,w){function O(Y,z){return j.yytext=j.yytext.substring(Y,j.yyleng-z+Y)}var T=w;switch(v){case 0:if(j.yytext.slice(-2)==="\\\\")O(0,1),this.begin("mu");else if(j.yytext.slice(-1)==="\\")O(0,1),this.begin("emu");else this.begin("mu");if(j.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:if(this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw")return 15;else return O(5,9),"END_RAW_BLOCK";break;case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(j.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return j.yytext=O(1,2).replace(/\\"/g,'"'),80;break;case 32:return j.yytext=O(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return j.yytext=j.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},K.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],K.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},K}();_.lexer=q;function f(){this.yy={}}return f.prototype=_,_.Parser=f,new f}();U5.default=ok;F5.exports=U5.default});var a$=p((fw,$w)=>{fw.__esModule=!0;function tk(_){return _&&_.__esModule?_:{default:_}}var ek=j_(),v3=tk(ek);function g$(){this.parents=[]}g$.prototype={constructor:g$,mutating:!1,acceptKey:function _(q,f){var K=this.accept(q[f]);if(this.mutating){if(K&&!g$.prototype[K.type])throw new v3.default('Unexpected node type "'+K.type+'" found when accepting '+f+" on "+q.type);q[f]=K}},acceptRequired:function _(q,f){if(this.acceptKey(q,f),!q[f])throw new v3.default(q.type+" requires "+f)},acceptArray:function _(q){for(var f=0,K=q.length;f<K;f++)if(this.acceptKey(q,f),!q[f])q.splice(f,1),f--,K--},accept:function _(q){if(!q)return;if(!this[q.type])throw new v3.default("Unknown type: "+q.type,q);if(this.current)this.parents.unshift(this.current);this.current=q;var f=this[q.type](q);if(this.current=this.parents.shift(),!this.mutating||f)return f;else if(f!==!1)return q},Program:function _(q){this.acceptArray(q.body)},MustacheStatement:d$,Decorator:d$,BlockStatement:qw,DecoratorBlock:qw,PartialStatement:_w,PartialBlockStatement:function _(q){_w.call(this,q),this.acceptKey(q,"program")},ContentStatement:function _(){},CommentStatement:function _(){},SubExpression:d$,PathExpression:function _(){},StringLiteral:function _(){},NumberLiteral:function _(){},BooleanLiteral:function _(){},UndefinedLiteral:function _(){},NullLiteral:function _(){},Hash:function _(q){this.acceptArray(q.pairs)},HashPair:function _(q){this.acceptRequired(q,"value")}};function d$(_){this.acceptRequired(_,"path"),this.acceptArray(_.params),this.acceptKey(_,"hash")}function qw(_){d$.call(this,_),this.acceptKey(_,"program"),this.acceptKey(_,"inverse")}function _w(_){this.acceptRequired(_,"name"),this.acceptArray(_.params),this.acceptKey(_,"hash")}fw.default=g$;$w.exports=fw.default});var jw=p((Kw,Pw)=>{Kw.__esModule=!0;function Bk(_){return _&&_.__esModule?_:{default:_}}var Uk=a$(),Fk=Bk(Uk);function C_(){var _=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=_}C_.prototype=new Fk.default;C_.prototype.Program=function(_){var q=!this.options.ignoreStandalone,f=!this.isRootSeen;this.isRootSeen=!0;var K=_.body;for(var $=0,P=K.length;$<P;$++){var j=K[$],v=this.accept(j);if(!v)continue;var w=w3(K,$,f),O=O3(K,$,f),T=v.openStandalone&&w,Y=v.closeStandalone&&O,z=v.inlineStandalone&&w&&O;if(v.close)N8(K,$,!0);if(v.open)K8(K,$,!0);if(q&&z){if(N8(K,$),K8(K,$)){if(j.type==="PartialStatement")j.indent=/([ \t]+$)/.exec(K[$-1].original)[1]}}if(q&&T)N8((j.program||j.inverse).body),K8(K,$);if(q&&Y)N8(K,$),K8((j.inverse||j.program).body)}return _};C_.prototype.BlockStatement=C_.prototype.DecoratorBlock=C_.prototype.PartialBlockStatement=function(_){this.accept(_.program),this.accept(_.inverse);var q=_.program||_.inverse,f=_.program&&_.inverse,K=f,$=f;if(f&&f.chained){K=f.body[0].program;while($.chained)$=$.body[$.body.length-1].program}var P={open:_.openStrip.open,close:_.closeStrip.close,openStandalone:O3(q.body),closeStandalone:w3((K||q).body)};if(_.openStrip.close)N8(q.body,null,!0);if(f){var j=_.inverseStrip;if(j.open)K8(q.body,null,!0);if(j.close)N8(K.body,null,!0);if(_.closeStrip.open)K8($.body,null,!0);if(!this.options.ignoreStandalone&&w3(q.body)&&O3(K.body))K8(q.body),N8(K.body)}else if(_.closeStrip.open)K8(q.body,null,!0);return P};C_.prototype.Decorator=C_.prototype.MustacheStatement=function(_){return _.strip};C_.prototype.PartialStatement=C_.prototype.CommentStatement=function(_){var q=_.strip||{};return{inlineStandalone:!0,open:q.open,close:q.close}};function w3(_,q,f){if(q===void 0)q=_.length;var K=_[q-1],$=_[q-2];if(!K)return f;if(K.type==="ContentStatement")return($||!f?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(K.original)}function O3(_,q,f){if(q===void 0)q=-1;var K=_[q+1],$=_[q+2];if(!K)return f;if(K.type==="ContentStatement")return($||!f?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(K.original)}function N8(_,q,f){var K=_[q==null?0:q+1];if(!K||K.type!=="ContentStatement"||!f&&K.rightStripped)return;var $=K.value;K.value=K.value.replace(f?/^\s+/:/^[ \t]*\r?\n?/,""),K.rightStripped=K.value!==$}function K8(_,q,f){var K=_[q==null?_.length-1:q-1];if(!K||K.type!=="ContentStatement"||!f&&K.leftStripped)return;var $=K.value;return K.value=K.value.replace(f?/\s+$/:/[ \t]+$/,""),K.leftStripped=K.value!==$,K.leftStripped}Kw.default=C_;Pw.exports=Kw.default});var vw=p((WZ)=>{WZ.__esModule=!0;WZ.SourceLocation=$Z;WZ.id=KZ;WZ.stripFlags=PZ;WZ.stripComment=jZ;WZ.preparePath=vZ;WZ.prepareMustache=wZ;WZ.prepareRawBlock=OZ;WZ.prepareBlock=YZ;WZ.prepareProgram=TZ;WZ.preparePartialBlock=zZ;function _Z(_){return _&&_.__esModule?_:{default:_}}var fZ=j_(),Y3=_Z(fZ);function T3(_,q){if(q=q.path?q.path.original:q,_.path.original!==q){var f={loc:_.path.loc};throw new Y3.default(_.path.original+" doesn't match "+q,f)}}function $Z(_,q){this.source=_,this.start={line:q.first_line,column:q.first_column},this.end={line:q.last_line,column:q.last_column}}function KZ(_){if(/^\[.*\]$/.test(_))return _.substring(1,_.length-1);else return _}function PZ(_,q){return{open:_.charAt(2)==="~",close:q.charAt(q.length-3)==="~"}}function jZ(_){return _.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function vZ(_,q,f){f=this.locInfo(f);var K=_?"@":"",$=[],P=0;for(var j=0,v=q.length;j<v;j++){var w=q[j].part,O=q[j].original!==w;if(K+=(q[j].separator||"")+w,!O&&(w===".."||w==="."||w==="this")){if($.length>0)throw new Y3.default("Invalid path: "+K,{loc:f});else if(w==="..")P++}else $.push(w)}return{type:"PathExpression",data:_,depth:P,parts:$,original:K,loc:f}}function wZ(_,q,f,K,$,P){var j=K.charAt(3)||K.charAt(2),v=j!=="{"&&j!=="&",w=/\*/.test(K);return{type:w?"Decorator":"MustacheStatement",path:_,params:q,hash:f,escaped:v,strip:$,loc:this.locInfo(P)}}function OZ(_,q,f,K){T3(_,f),K=this.locInfo(K);var $={type:"Program",body:q,strip:{},loc:K};return{type:"BlockStatement",path:_.path,params:_.params,hash:_.hash,program:$,openStrip:{},inverseStrip:{},closeStrip:{},loc:K}}function YZ(_,q,f,K,$,P){if(K&&K.path)T3(_,K);var j=/\*/.test(_.open);q.blockParams=_.blockParams;var v=void 0,w=void 0;if(f){if(j)throw new Y3.default("Unexpected inverse block on decorator",f);if(f.chain)f.program.body[0].closeStrip=K.strip;w=f.strip,v=f.program}if($)$=v,v=q,q=$;return{type:j?"DecoratorBlock":"BlockStatement",path:_.path,params:_.params,hash:_.hash,program:q,inverse:v,openStrip:_.strip,inverseStrip:w,closeStrip:K&&K.strip,loc:this.locInfo(P)}}function TZ(_,q){if(!q&&_.length){var f=_[0].loc,K=_[_.length-1].loc;if(f&&K)q={source:f.source,start:{line:f.start.line,column:f.start.column},end:{line:K.end.line,column:K.end.column}}}return{type:"Program",body:_,strip:{},loc:q}}function zZ(_,q,f,K){return T3(_,f),{type:"PartialBlockStatement",name:_.path,params:_.params,hash:_.hash,program:q,openStrip:_.strip,closeStrip:f&&f.strip,loc:this.locInfo(K)}}});var Yw=p((nZ)=>{nZ.__esModule=!0;nZ.parseWithoutProcessing=Ow;nZ.parse=lZ;function bZ(_){if(_&&_.__esModule)return _;else{var q={};if(_!=null){for(var f in _)if(Object.prototype.hasOwnProperty.call(_,f))q[f]=_[f]}return q.default=_,q}}function ww(_){return _&&_.__esModule?_:{default:_}}var VZ=Q5(),z3=ww(VZ),MZ=jw(),SZ=ww(MZ),NZ=vw(),CZ=bZ(NZ),pZ=Lq();nZ.parser=z3.default;var I$={};pZ.extend(I$,CZ);function Ow(_,q){if(_.type==="Program")return _;z3.default.yy=I$,I$.locInfo=function(K){return new I$.SourceLocation(q&&q.srcName,K)};var f=z3.default.parse(_);return f}function lZ(_,q){var f=Ow(_,q),K=new SZ.default(q);return K.accept(f)}});var Hw=p((oZ)=>{oZ.__esModule=!0;oZ.Compiler=W3;oZ.precompile=yZ;oZ.compile=iZ;function zw(_){return _&&_.__esModule?_:{default:_}}var aZ=j_(),$6=zw(aZ),K6=Lq(),IZ=j3(),f6=zw(IZ),DZ=[].slice;function W3(){}W3.prototype={compiler:W3,equals:function _(q){var f=this.opcodes.length;if(q.opcodes.length!==f)return!1;for(var K=0;K<f;K++){var $=this.opcodes[K],P=q.opcodes[K];if($.opcode!==P.opcode||!Ww($.args,P.args))return!1}f=this.children.length;for(var K=0;K<f;K++)if(!this.children[K].equals(q.children[K]))return!1;return!0},guid:0,compile:function _(q,f){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=f,this.stringParams=f.stringParams,this.trackIds=f.trackIds,f.blockParams=f.blockParams||[],f.knownHelpers=K6.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},f.knownHelpers),this.accept(q)},compileProgram:function _(q){var f=new this.compiler,K=f.compile(q,this.options),$=this.guid++;return this.usePartial=this.usePartial||K.usePartial,this.children[$]=K,this.useDepths=this.useDepths||K.useDepths,$},accept:function _(q){if(!this[q.type])throw new $6.default("Unknown type: "+q.type,q);this.sourceNode.unshift(q);var f=this[q.type](q);return this.sourceNode.shift(),f},Program:function _(q){this.options.blockParams.unshift(q.blockParams);var f=q.body,K=f.length;for(var $=0;$<K;$++)this.accept(f[$]);return this.options.blockParams.shift(),this.isSimple=K===1,this.blockParams=q.blockParams?q.blockParams.length:0,this},BlockStatement:function _(q){Tw(q);var{program:f,inverse:K}=q;f=f&&this.compileProgram(f),K=K&&this.compileProgram(K);var $=this.classifySexpr(q);if($==="helper")this.helperSexpr(q,f,K);else if($==="simple")this.simpleSexpr(q),this.opcode("pushProgram",f),this.opcode("pushProgram",K),this.opcode("emptyHash"),this.opcode("blockValue",q.path.original);else this.ambiguousSexpr(q,f,K),this.opcode("pushProgram",f),this.opcode("pushProgram",K),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue");this.opcode("append")},DecoratorBlock:function _(q){var f=q.program&&this.compileProgram(q.program),K=this.setupFullMustacheParams(q,f,void 0),$=q.path;this.useDecorators=!0,this.opcode("registerDecorator",K.length,$.original)},PartialStatement:function _(q){this.usePartial=!0;var f=q.program;if(f)f=this.compileProgram(q.program);var K=q.params;if(K.length>1)throw new $6.default("Unsupported number of partial arguments: "+K.length,q);else if(!K.length)if(this.options.explicitPartialContext)this.opcode("pushLiteral","undefined");else K.push({type:"PathExpression",parts:[],depth:0});var $=q.name.original,P=q.name.type==="SubExpression";if(P)this.accept(q.name);this.setupFullMustacheParams(q,f,void 0,!0);var j=q.indent||"";if(this.options.preventIndent&&j)this.opcode("appendContent",j),j="";this.opcode("invokePartial",P,$,j),this.opcode("append")},PartialBlockStatement:function _(q){this.PartialStatement(q)},MustacheStatement:function _(q){if(this.SubExpression(q),q.escaped&&!this.options.noEscape)this.opcode("appendEscaped");else this.opcode("append")},Decorator:function _(q){this.DecoratorBlock(q)},ContentStatement:function _(q){if(q.value)this.opcode("appendContent",q.value)},CommentStatement:function _(){},SubExpression:function _(q){Tw(q);var f=this.classifySexpr(q);if(f==="simple")this.simpleSexpr(q);else if(f==="helper")this.helperSexpr(q);else this.ambiguousSexpr(q)},ambiguousSexpr:function _(q,f,K){var $=q.path,P=$.parts[0],j=f!=null||K!=null;this.opcode("getContext",$.depth),this.opcode("pushProgram",f),this.opcode("pushProgram",K),$.strict=!0,this.accept($),this.opcode("invokeAmbiguous",P,j)},simpleSexpr:function _(q){var f=q.path;f.strict=!0,this.accept(f),this.opcode("resolvePossibleLambda")},helperSexpr:function _(q,f,K){var $=this.setupFullMustacheParams(q,f,K),P=q.path,j=P.parts[0];if(this.options.knownHelpers[j])this.opcode("invokeKnownHelper",$.length,j);else if(this.options.knownHelpersOnly)throw new $6.default("You specified knownHelpersOnly, but used the unknown helper "+j,q);else P.strict=!0,P.falsy=!0,this.accept(P),this.opcode("invokeHelper",$.length,P.original,f6.default.helpers.simpleId(P))},PathExpression:function _(q){this.addDepth(q.depth),this.opcode("getContext",q.depth);var f=q.parts[0],K=f6.default.helpers.scopedId(q),$=!q.depth&&!K&&this.blockParamIndex(f);if($)this.opcode("lookupBlockParam",$,q.parts);else if(!f)this.opcode("pushContext");else if(q.data)this.options.data=!0,this.opcode("lookupData",q.depth,q.parts,q.strict);else this.opcode("lookupOnContext",q.parts,q.falsy,q.strict,K)},StringLiteral:function _(q){this.opcode("pushString",q.value)},NumberLiteral:function _(q){this.opcode("pushLiteral",q.value)},BooleanLiteral:function _(q){this.opcode("pushLiteral",q.value)},UndefinedLiteral:function _(){this.opcode("pushLiteral","undefined")},NullLiteral:function _(){this.opcode("pushLiteral","null")},Hash:function _(q){var f=q.pairs,K=0,$=f.length;this.opcode("pushHash");for(;K<$;K++)this.pushParam(f[K].value);while(K--)this.opcode("assignToHash",f[K].key);this.opcode("popHash")},opcode:function _(q){this.opcodes.push({opcode:q,args:DZ.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function _(q){if(!q)return;this.useDepths=!0},classifySexpr:function _(q){var f=f6.default.helpers.simpleId(q.path),K=f&&!!this.blockParamIndex(q.path.parts[0]),$=!K&&f6.default.helpers.helperExpression(q),P=!K&&($||f);if(P&&!$){var j=q.path.parts[0],v=this.options;if(v.knownHelpers[j])$=!0;else if(v.knownHelpersOnly)P=!1}if($)return"helper";else if(P)return"ambiguous";else return"simple"},pushParams:function _(q){for(var f=0,K=q.length;f<K;f++)this.pushParam(q[f])},pushParam:function _(q){var f=q.value!=null?q.value:q.original||"";if(this.stringParams){if(f.replace)f=f.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".");if(q.depth)this.addDepth(q.depth);if(this.opcode("getContext",q.depth||0),this.opcode("pushStringParam",f,q.type),q.type==="SubExpression")this.accept(q)}else{if(this.trackIds){var K=void 0;if(q.parts&&!f6.default.helpers.scopedId(q)&&!q.depth)K=this.blockParamIndex(q.parts[0]);if(K){var $=q.parts.slice(1).join(".");this.opcode("pushId","BlockParam",K,$)}else{if(f=q.original||f,f.replace)f=f.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"");this.opcode("pushId",q.type,f)}}this.accept(q)}},setupFullMustacheParams:function _(q,f,K,$){var P=q.params;if(this.pushParams(P),this.opcode("pushProgram",f),this.opcode("pushProgram",K),q.hash)this.accept(q.hash);else this.opcode("emptyHash",$);return P},blockParamIndex:function _(q){for(var f=0,K=this.options.blockParams.length;f<K;f++){var $=this.options.blockParams[f],P=$&&K6.indexOf($,q);if($&&P>=0)return[f,P]}}};function yZ(_,q,f){if(_==null||typeof _!=="string"&&_.type!=="Program")throw new $6.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+_);if(q=q||{},!("data"in q))q.data=!0;if(q.compat)q.useDepths=!0;var K=f.parse(_,q),$=new f.Compiler().compile(K,q);return new f.JavaScriptCompiler().compile($,q)}function iZ(_,q,f){if(q===void 0)q={};if(_==null||typeof _!=="string"&&_.type!=="Program")throw new $6.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+_);if(q=K6.extend({},q),!("data"in q))q.data=!0;if(q.compat)q.useDepths=!0;var K=void 0;function $(){var j=f.parse(_,q),v=new f.Compiler().compile(j,q),w=new f.JavaScriptCompiler().compile(v,q,void 0,!0);return f.template(w)}function P(j,v){if(!K)K=$();return K.call(this,j,v)}return P._setup=function(j){if(!K)K=$();return K._setup(j)},P._child=function(j,v,w,O){if(!K)K=$();return K._child(j,v,w,O)},P}function Ww(_,q){if(_===q)return!0;if(K6.isArray(_)&&K6.isArray(q)&&_.length===q.length){for(var f=0;f<_.length;f++)if(!Ww(_[f],q[f]))return!1;return!0}}function Tw(_){if(!_.path.parts){var q=_.path;_.path={type:"PathExpression",data:!1,depth:0,parts:[q.original+""],original:q.original+"",loc:q.loc}}}});var Jw=p((xZ)=>{var hw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");xZ.encode=function(_){if(0<=_&&_<hw.length)return hw[_];throw new TypeError("Must be between 0 and 63: "+_)};xZ.decode=function(_){var q=65,f=90,K=97,$=122,P=48,j=57,v=43,w=47,O=26,T=52;if(q<=_&&_<=f)return _-q;if(K<=_&&_<=$)return _-K+O;if(P<=_&&_<=j)return _-P+T;if(_==v)return 62;if(_==w)return 63;return-1}});var h3=p((QZ)=>{var kw=Jw(),H3=5,Zw=1<<H3,Xw=Zw-1,Aw=Zw;function UZ(_){return _<0?(-_<<1)+1:(_<<1)+0}function FZ(_){var q=(_&1)===1,f=_>>1;return q?-f:f}QZ.encode=function _(q){var f="",K,$=UZ(q);do{if(K=$&Xw,$>>>=H3,$>0)K|=Aw;f+=kw.encode(K)}while($>0);return f};QZ.decode=function _(q,f,K){var $=q.length,P=0,j=0,v,w;do{if(f>=$)throw new Error("Expected more digits in base 64 VLQ value.");if(w=kw.decode(q.charCodeAt(f++)),w===-1)throw new Error("Invalid base64 digit: "+q.charAt(f-1));v=!!(w&Aw),w&=Xw,P=P+(w<<j),j+=H3}while(v);K.value=FZ(P),K.rest=f}});var zf=p((zX)=>{function fX(_,q,f){if(q in _)return _[q];else if(arguments.length===3)return f;else throw new Error('"'+q+'" is a required argument.')}zX.getArg=fX;var uw=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,$X=/^data:.+\,.+$/;function P6(_){var q=_.match(uw);if(!q)return null;return{scheme:q[1],auth:q[2],host:q[3],port:q[4],path:q[5]}}zX.urlParse=P6;function Yf(_){var q="";if(_.scheme)q+=_.scheme+":";if(q+="//",_.auth)q+=_.auth+"@";if(_.host)q+=_.host;if(_.port)q+=":"+_.port;if(_.path)q+=_.path;return q}zX.urlGenerate=Yf;function J3(_){var q=_,f=P6(_);if(f){if(!f.path)return _;q=f.path}var K=zX.isAbsolute(q),$=q.split(/\/+/);for(var P,j=0,v=$.length-1;v>=0;v--)if(P=$[v],P===".")$.splice(v,1);else if(P==="..")j++;else if(j>0)if(P==="")$.splice(v+1,j),j=0;else $.splice(v,2),j--;if(q=$.join("/"),q==="")q=K?"/":".";if(f)return f.path=q,Yf(f);return q}zX.normalize=J3;function Gw(_,q){if(_==="")_=".";if(q==="")q=".";var f=P6(q),K=P6(_);if(K)_=K.path||"/";if(f&&!f.scheme){if(K)f.scheme=K.scheme;return Yf(f)}if(f||q.match($X))return q;if(K&&!K.host&&!K.path)return K.host=q,Yf(K);var $=q.charAt(0)==="/"?q:J3(_.replace(/\/+$/,"")+"/"+q);if(K)return K.path=$,Yf(K);return $}zX.join=Gw;zX.isAbsolute=function(_){return _.charAt(0)==="/"||uw.test(_)};function KX(_,q){if(_==="")_=".";_=_.replace(/\/$/,"");var f=0;while(q.indexOf(_+"/")!==0){var K=_.lastIndexOf("/");if(K<0)return q;if(_=_.slice(0,K),_.match(/^([^\/]+:\/)?\/*$/))return q;++f}return Array(f+1).join("../")+q.substr(_.length+1)}zX.relative=KX;var mw=function(){var _=Object.create(null);return!("__proto__"in _)}();function rw(_){return _}function PX(_){if(bw(_))return"$"+_;return _}zX.toSetString=mw?rw:PX;function jX(_){if(bw(_))return _.slice(1);return _}zX.fromSetString=mw?rw:jX;function bw(_){if(!_)return!1;var q=_.length;if(q<9)return!1;if(_.charCodeAt(q-1)!==95||_.charCodeAt(q-2)!==95||_.charCodeAt(q-3)!==111||_.charCodeAt(q-4)!==116||_.charCodeAt(q-5)!==111||_.charCodeAt(q-6)!==114||_.charCodeAt(q-7)!==112||_.charCodeAt(q-8)!==95||_.charCodeAt(q-9)!==95)return!1;for(var f=q-10;f>=0;f--)if(_.charCodeAt(f)!==36)return!1;return!0}function vX(_,q,f){var K=Tf(_.source,q.source);if(K!==0)return K;if(K=_.originalLine-q.originalLine,K!==0)return K;if(K=_.originalColumn-q.originalColumn,K!==0||f)return K;if(K=_.generatedColumn-q.generatedColumn,K!==0)return K;if(K=_.generatedLine-q.generatedLine,K!==0)return K;return Tf(_.name,q.name)}zX.compareByOriginalPositions=vX;function wX(_,q,f){var K=_.generatedLine-q.generatedLine;if(K!==0)return K;if(K=_.generatedColumn-q.generatedColumn,K!==0||f)return K;if(K=Tf(_.source,q.source),K!==0)return K;if(K=_.originalLine-q.originalLine,K!==0)return K;if(K=_.originalColumn-q.originalColumn,K!==0)return K;return Tf(_.name,q.name)}zX.compareByGeneratedPositionsDeflated=wX;function Tf(_,q){if(_===q)return 0;if(_===null)return 1;if(q===null)return-1;if(_>q)return 1;return-1}function OX(_,q){var f=_.generatedLine-q.generatedLine;if(f!==0)return f;if(f=_.generatedColumn-q.generatedColumn,f!==0)return f;if(f=Tf(_.source,q.source),f!==0)return f;if(f=_.originalLine-q.originalLine,f!==0)return f;if(f=_.originalColumn-q.originalColumn,f!==0)return f;return Tf(_.name,q.name)}zX.compareByGeneratedPositionsInflated=OX;function YX(_){return JSON.parse(_.replace(/^\)]}'[^\n]*\n/,""))}zX.parseSourceMapInput=YX;function TX(_,q,f){if(q=q||"",_){if(_[_.length-1]!=="/"&&q[0]!=="/")_+="/";q=_+q}if(f){var K=P6(f);if(!K)throw new Error("sourceMapURL could not be parsed");if(K.path){var $=K.path.lastIndexOf("/");if($>=0)K.path=K.path.substring(0,$+1)}q=Gw(Yf(K),q)}return J3(q)}zX.computeSourceURL=TX});var X3=p((MX)=>{var k3=zf(),Z3=Object.prototype.hasOwnProperty,C8=typeof Map!=="undefined";function L_(){this._array=[],this._set=C8?new Map:Object.create(null)}L_.fromArray=function _(q,f){var K=new L_;for(var $=0,P=q.length;$<P;$++)K.add(q[$],f);return K};L_.prototype.size=function _(){return C8?this._set.size:Object.getOwnPropertyNames(this._set).length};L_.prototype.add=function _(q,f){var K=C8?q:k3.toSetString(q),$=C8?this.has(q):Z3.call(this._set,K),P=this._array.length;if(!$||f)this._array.push(q);if(!$)if(C8)this._set.set(q,P);else this._set[K]=P};L_.prototype.has=function _(q){if(C8)return this._set.has(q);else{var f=k3.toSetString(q);return Z3.call(this._set,f)}};L_.prototype.indexOf=function _(q){if(C8){var f=this._set.get(q);if(f>=0)return f}else{var K=k3.toSetString(q);if(Z3.call(this._set,K))return this._set[K]}throw new Error('"'+q+'" is not in the set.')};L_.prototype.at=function _(q){if(q>=0&&q<this._array.length)return this._array[q];throw new Error("No element indexed by "+q)};L_.prototype.toArray=function _(){return this._array.slice()};MX.ArraySet=L_});var Mw=p((CX)=>{var Vw=zf();function NX(_,q){var f=_.generatedLine,K=q.generatedLine,$=_.generatedColumn,P=q.generatedColumn;return K>f||K==f&&P>=$||Vw.compareByGeneratedPositionsInflated(_,q)<=0}function D$(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}D$.prototype.unsortedForEach=function _(q,f){this._array.forEach(q,f)};D$.prototype.add=function _(q){if(NX(this._last,q))this._last=q,this._array.push(q);else this._sorted=!1,this._array.push(q)};D$.prototype.toArray=function _(){if(!this._sorted)this._array.sort(Vw.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};CX.MappingList=D$});var A3=p((nX)=>{var j6=h3(),lq=zf(),y$=X3().ArraySet,lX=Mw().MappingList;function v_(_){if(!_)_={};this._file=lq.getArg(_,"file",null),this._sourceRoot=lq.getArg(_,"sourceRoot",null),this._skipValidation=lq.getArg(_,"skipValidation",!1),this._sources=new y$,this._names=new y$,this._mappings=new lX,this._sourcesContents=null}v_.prototype._version=3;v_.fromSourceMap=function _(q){var f=q.sourceRoot,K=new v_({file:q.file,sourceRoot:f});return q.eachMapping(function($){var P={generated:{line:$.generatedLine,column:$.generatedColumn}};if($.source!=null){if(P.source=$.source,f!=null)P.source=lq.relative(f,P.source);if(P.original={line:$.originalLine,column:$.originalColumn},$.name!=null)P.name=$.name}K.addMapping(P)}),q.sources.forEach(function($){var P=$;if(f!==null)P=lq.relative(f,$);if(!K._sources.has(P))K._sources.add(P);var j=q.sourceContentFor($);if(j!=null)K.setSourceContent($,j)}),K};v_.prototype.addMapping=function _(q){var f=lq.getArg(q,"generated"),K=lq.getArg(q,"original",null),$=lq.getArg(q,"source",null),P=lq.getArg(q,"name",null);if(!this._skipValidation)this._validateMapping(f,K,$,P);if($!=null){if($=String($),!this._sources.has($))this._sources.add($)}if(P!=null){if(P=String(P),!this._names.has(P))this._names.add(P)}this._mappings.add({generatedLine:f.line,generatedColumn:f.column,originalLine:K!=null&&K.line,originalColumn:K!=null&&K.column,source:$,name:P})};v_.prototype.setSourceContent=function _(q,f){var K=q;if(this._sourceRoot!=null)K=lq.relative(this._sourceRoot,K);if(f!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[lq.toSetString(K)]=f}else if(this._sourcesContents){if(delete this._sourcesContents[lq.toSetString(K)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};v_.prototype.applySourceMap=function _(q,f,K){var $=f;if(f==null){if(q.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);$=q.file}var P=this._sourceRoot;if(P!=null)$=lq.relative(P,$);var j=new y$,v=new y$;this._mappings.unsortedForEach(function(w){if(w.source===$&&w.originalLine!=null){var O=q.originalPositionFor({line:w.originalLine,column:w.originalColumn});if(O.source!=null){if(w.source=O.source,K!=null)w.source=lq.join(K,w.source);if(P!=null)w.source=lq.relative(P,w.source);if(w.originalLine=O.line,w.originalColumn=O.column,O.name!=null)w.name=O.name}}var T=w.source;if(T!=null&&!j.has(T))j.add(T);var Y=w.name;if(Y!=null&&!v.has(Y))v.add(Y)},this),this._sources=j,this._names=v,q.sources.forEach(function(w){var O=q.sourceContentFor(w);if(O!=null){if(K!=null)w=lq.join(K,w);if(P!=null)w=lq.relative(P,w);this.setSourceContent(w,O)}},this)};v_.prototype._validateMapping=function _(q,f,K,$){if(f&&typeof f.line!=="number"&&typeof f.column!=="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(q&&"line"in q&&"column"in q&&q.line>0&&q.column>=0&&!f&&!K&&!$)return;else if(q&&"line"in q&&"column"in q&&f&&"line"in f&&"column"in f&&q.line>0&&q.column>=0&&f.line>0&&f.column>=0&&K)return;else throw new Error("Invalid mapping: "+JSON.stringify({generated:q,source:K,original:f,name:$}))};v_.prototype._serializeMappings=function _(){var q=0,f=1,K=0,$=0,P=0,j=0,v="",w,O,T,Y,z=this._mappings.toArray();for(var H=0,h=z.length;H<h;H++){if(O=z[H],w="",O.generatedLine!==f){q=0;while(O.generatedLine!==f)w+=";",f++}else if(H>0){if(!lq.compareByGeneratedPositionsInflated(O,z[H-1]))continue;w+=","}if(w+=j6.encode(O.generatedColumn-q),q=O.generatedColumn,O.source!=null){if(Y=this._sources.indexOf(O.source),w+=j6.encode(Y-j),j=Y,w+=j6.encode(O.originalLine-1-$),$=O.originalLine-1,w+=j6.encode(O.originalColumn-K),K=O.originalColumn,O.name!=null)T=this._names.indexOf(O.name),w+=j6.encode(T-P),P=T}v+=w}return v};v_.prototype._generateSourcesContent=function _(q,f){return q.map(function(K){if(!this._sourcesContents)return null;if(f!=null)K=lq.relative(f,K);var $=lq.toSetString(K);return Object.prototype.hasOwnProperty.call(this._sourcesContents,$)?this._sourcesContents[$]:null},this)};v_.prototype.toJSON=function _(){var q={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)q.file=this._file;if(this._sourceRoot!=null)q.sourceRoot=this._sourceRoot;if(this._sourcesContents)q.sourcesContent=this._generateSourcesContent(q.sources,q.sourceRoot);return q};v_.prototype.toString=function _(){return JSON.stringify(this.toJSON())};nX.SourceMapGenerator=v_});var Nw=p((EX)=>{EX.GREATEST_LOWER_BOUND=1;EX.LEAST_UPPER_BOUND=2;function u3(_,q,f,K,$,P){var j=Math.floor((q-_)/2)+_,v=$(f,K[j],!0);if(v===0)return j;else if(v>0){if(q-j>1)return u3(j,q,f,K,$,P);if(P==EX.LEAST_UPPER_BOUND)return q<K.length?q:-1;else return j}else{if(j-_>1)return u3(_,j,f,K,$,P);if(P==EX.LEAST_UPPER_BOUND)return j;else return _<0?-1:_}}EX.search=function _(q,f,K,$){if(f.length===0)return-1;var P=u3(-1,f.length,q,f,K,$||EX.GREATEST_LOWER_BOUND);if(P<0)return-1;while(P-1>=0){if(K(f[P],f[P-1],!0)!==0)break;--P}return P}});var Cw=p((aX)=>{function m3(_,q,f){var K=_[q];_[q]=_[f],_[f]=K}function dX(_,q){return Math.round(_+Math.random()*(q-_))}function r3(_,q,f,K){if(f<K){var $=dX(f,K),P=f-1;m3(_,$,K);var j=_[K];for(var v=f;v<K;v++)if(q(_[v],j)<=0)P+=1,m3(_,P,v);m3(_,P+1,v);var w=P+1;r3(_,q,f,w-1),r3(_,q,w+1,K)}}aX.quickSort=function(_,q){r3(_,q,0,_.length-1)}});var lw=p((yX)=>{var s=zf(),b3=Nw(),Wf=X3().ArraySet,DX=h3(),v6=Cw().quickSort;function Aq(_,q){var f=_;if(typeof _==="string")f=s.parseSourceMapInput(_);return f.sections!=null?new X_(f,q):new Iq(f,q)}Aq.fromSourceMap=function(_,q){return Iq.fromSourceMap(_,q)};Aq.prototype._version=3;Aq.prototype.__generatedMappings=null;Object.defineProperty(Aq.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});Aq.prototype.__originalMappings=null;Object.defineProperty(Aq.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});Aq.prototype._charIsMappingSeparator=function _(q,f){var K=q.charAt(f);return K===";"||K===","};Aq.prototype._parseMappings=function _(q,f){throw new Error("Subclasses must implement _parseMappings")};Aq.GENERATED_ORDER=1;Aq.ORIGINAL_ORDER=2;Aq.GREATEST_LOWER_BOUND=1;Aq.LEAST_UPPER_BOUND=2;Aq.prototype.eachMapping=function _(q,f,K){var $=f||null,P=K||Aq.GENERATED_ORDER,j;switch(P){case Aq.GENERATED_ORDER:j=this._generatedMappings;break;case Aq.ORIGINAL_ORDER:j=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var v=this.sourceRoot;j.map(function(w){var O=w.source===null?null:this._sources.at(w.source);return O=s.computeSourceURL(v,O,this._sourceMapURL),{source:O,generatedLine:w.generatedLine,generatedColumn:w.generatedColumn,originalLine:w.originalLine,originalColumn:w.originalColumn,name:w.name===null?null:this._names.at(w.name)}},this).forEach(q,$)};Aq.prototype.allGeneratedPositionsFor=function _(q){var f=s.getArg(q,"line"),K={source:s.getArg(q,"source"),originalLine:f,originalColumn:s.getArg(q,"column",0)};if(K.source=this._findSourceIndex(K.source),K.source<0)return[];var $=[],P=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,b3.LEAST_UPPER_BOUND);if(P>=0){var j=this._originalMappings[P];if(q.column===void 0){var v=j.originalLine;while(j&&j.originalLine===v)$.push({line:s.getArg(j,"generatedLine",null),column:s.getArg(j,"generatedColumn",null),lastColumn:s.getArg(j,"lastGeneratedColumn",null)}),j=this._originalMappings[++P]}else{var w=j.originalColumn;while(j&&j.originalLine===f&&j.originalColumn==w)$.push({line:s.getArg(j,"generatedLine",null),column:s.getArg(j,"generatedColumn",null),lastColumn:s.getArg(j,"lastGeneratedColumn",null)}),j=this._originalMappings[++P]}}return $};yX.SourceMapConsumer=Aq;function Iq(_,q){var f=_;if(typeof _==="string")f=s.parseSourceMapInput(_);var K=s.getArg(f,"version"),$=s.getArg(f,"sources"),P=s.getArg(f,"names",[]),j=s.getArg(f,"sourceRoot",null),v=s.getArg(f,"sourcesContent",null),w=s.getArg(f,"mappings"),O=s.getArg(f,"file",null);if(K!=this._version)throw new Error("Unsupported version: "+K);if(j)j=s.normalize(j);$=$.map(String).map(s.normalize).map(function(T){return j&&s.isAbsolute(j)&&s.isAbsolute(T)?s.relative(j,T):T}),this._names=Wf.fromArray(P.map(String),!0),this._sources=Wf.fromArray($,!0),this._absoluteSources=this._sources.toArray().map(function(T){return s.computeSourceURL(j,T,q)}),this.sourceRoot=j,this.sourcesContent=v,this._mappings=w,this._sourceMapURL=q,this.file=O}Iq.prototype=Object.create(Aq.prototype);Iq.prototype.consumer=Aq;Iq.prototype._findSourceIndex=function(_){var q=_;if(this.sourceRoot!=null)q=s.relative(this.sourceRoot,q);if(this._sources.has(q))return this._sources.indexOf(q);var f;for(f=0;f<this._absoluteSources.length;++f)if(this._absoluteSources[f]==_)return f;return-1};Iq.fromSourceMap=function _(q,f){var K=Object.create(Iq.prototype),$=K._names=Wf.fromArray(q._names.toArray(),!0),P=K._sources=Wf.fromArray(q._sources.toArray(),!0);K.sourceRoot=q._sourceRoot,K.sourcesContent=q._generateSourcesContent(K._sources.toArray(),K.sourceRoot),K.file=q._file,K._sourceMapURL=f,K._absoluteSources=K._sources.toArray().map(function(H){return s.computeSourceURL(K.sourceRoot,H,f)});var j=q._mappings.toArray().slice(),v=K.__generatedMappings=[],w=K.__originalMappings=[];for(var O=0,T=j.length;O<T;O++){var Y=j[O],z=new pw;if(z.generatedLine=Y.generatedLine,z.generatedColumn=Y.generatedColumn,Y.source){if(z.source=P.indexOf(Y.source),z.originalLine=Y.originalLine,z.originalColumn=Y.originalColumn,Y.name)z.name=$.indexOf(Y.name);w.push(z)}v.push(z)}return v6(K.__originalMappings,s.compareByOriginalPositions),K};Iq.prototype._version=3;Object.defineProperty(Iq.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function pw(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Iq.prototype._parseMappings=function _(q,f){var K=1,$=0,P=0,j=0,v=0,w=0,O=q.length,T=0,Y={},z={},H=[],h=[],J,k,X,l,N;while(T<O)if(q.charAt(T)===";")K++,T++,$=0;else if(q.charAt(T)===",")T++;else{J=new pw,J.generatedLine=K;for(l=T;l<O;l++)if(this._charIsMappingSeparator(q,l))break;if(k=q.slice(T,l),X=Y[k],X)T+=k.length;else{X=[];while(T<l)DX.decode(q,T,z),N=z.value,T=z.rest,X.push(N);if(X.length===2)throw new Error("Found a source, but no line and column");if(X.length===3)throw new Error("Found a source and line, but no column");Y[k]=X}if(J.generatedColumn=$+X[0],$=J.generatedColumn,X.length>1){if(J.source=v+X[1],v+=X[1],J.originalLine=P+X[2],P=J.originalLine,J.originalLine+=1,J.originalColumn=j+X[3],j=J.originalColumn,X.length>4)J.name=w+X[4],w+=X[4]}if(h.push(J),typeof J.originalLine==="number")H.push(J)}v6(h,s.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,v6(H,s.compareByOriginalPositions),this.__originalMappings=H};Iq.prototype._findMapping=function _(q,f,K,$,P,j){if(q[K]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+q[K]);if(q[$]<0)throw new TypeError("Column must be greater than or equal to 0, got "+q[$]);return b3.search(q,f,P,j)};Iq.prototype.computeColumnSpans=function _(){for(var q=0;q<this._generatedMappings.length;++q){var f=this._generatedMappings[q];if(q+1<this._generatedMappings.length){var K=this._generatedMappings[q+1];if(f.generatedLine===K.generatedLine){f.lastGeneratedColumn=K.generatedColumn-1;continue}}f.lastGeneratedColumn=1/0}};Iq.prototype.originalPositionFor=function _(q){var f={generatedLine:s.getArg(q,"line"),generatedColumn:s.getArg(q,"column")},K=this._findMapping(f,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(q,"bias",Aq.GREATEST_LOWER_BOUND));if(K>=0){var $=this._generatedMappings[K];if($.generatedLine===f.generatedLine){var P=s.getArg($,"source",null);if(P!==null)P=this._sources.at(P),P=s.computeSourceURL(this.sourceRoot,P,this._sourceMapURL);var j=s.getArg($,"name",null);if(j!==null)j=this._names.at(j);return{source:P,line:s.getArg($,"originalLine",null),column:s.getArg($,"originalColumn",null),name:j}}}return{source:null,line:null,column:null,name:null}};Iq.prototype.hasContentsOfAllSources=function _(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(q){return q==null})};Iq.prototype.sourceContentFor=function _(q,f){if(!this.sourcesContent)return null;var K=this._findSourceIndex(q);if(K>=0)return this.sourcesContent[K];var $=q;if(this.sourceRoot!=null)$=s.relative(this.sourceRoot,$);var P;if(this.sourceRoot!=null&&(P=s.urlParse(this.sourceRoot))){var j=$.replace(/^file:\/\//,"");if(P.scheme=="file"&&this._sources.has(j))return this.sourcesContent[this._sources.indexOf(j)];if((!P.path||P.path=="/")&&this._sources.has("/"+$))return this.sourcesContent[this._sources.indexOf("/"+$)]}if(f)return null;else throw new Error('"'+$+'" is not in the SourceMap.')};Iq.prototype.generatedPositionFor=function _(q){var f=s.getArg(q,"source");if(f=this._findSourceIndex(f),f<0)return{line:null,column:null,lastColumn:null};var K={source:f,originalLine:s.getArg(q,"line"),originalColumn:s.getArg(q,"column")},$=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(q,"bias",Aq.GREATEST_LOWER_BOUND));if($>=0){var P=this._originalMappings[$];if(P.source===K.source)return{line:s.getArg(P,"generatedLine",null),column:s.getArg(P,"generatedColumn",null),lastColumn:s.getArg(P,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};yX.BasicSourceMapConsumer=Iq;function X_(_,q){var f=_;if(typeof _==="string")f=s.parseSourceMapInput(_);var K=s.getArg(f,"version"),$=s.getArg(f,"sections");if(K!=this._version)throw new Error("Unsupported version: "+K);this._sources=new Wf,this._names=new Wf;var P={line:-1,column:0};this._sections=$.map(function(j){if(j.url)throw new Error("Support for url field in sections not implemented.");var v=s.getArg(j,"offset"),w=s.getArg(v,"line"),O=s.getArg(v,"column");if(w<P.line||w===P.line&&O<P.column)throw new Error("Section offsets must be ordered and non-overlapping.");return P=v,{generatedOffset:{generatedLine:w+1,generatedColumn:O+1},consumer:new Aq(s.getArg(j,"map"),q)}})}X_.prototype=Object.create(Aq.prototype);X_.prototype.constructor=Aq;X_.prototype._version=3;Object.defineProperty(X_.prototype,"sources",{get:function(){var _=[];for(var q=0;q<this._sections.length;q++)for(var f=0;f<this._sections[q].consumer.sources.length;f++)_.push(this._sections[q].consumer.sources[f]);return _}});X_.prototype.originalPositionFor=function _(q){var f={generatedLine:s.getArg(q,"line"),generatedColumn:s.getArg(q,"column")},K=b3.search(f,this._sections,function(P,j){var v=P.generatedLine-j.generatedOffset.generatedLine;if(v)return v;return P.generatedColumn-j.generatedOffset.generatedColumn}),$=this._sections[K];if(!$)return{source:null,line:null,column:null,name:null};return $.consumer.originalPositionFor({line:f.generatedLine-($.generatedOffset.generatedLine-1),column:f.generatedColumn-($.generatedOffset.generatedLine===f.generatedLine?$.generatedOffset.generatedColumn-1:0),bias:q.bias})};X_.prototype.hasContentsOfAllSources=function _(){return this._sections.every(function(q){return q.consumer.hasContentsOfAllSources()})};X_.prototype.sourceContentFor=function _(q,f){for(var K=0;K<this._sections.length;K++){var $=this._sections[K],P=$.consumer.sourceContentFor(q,!0);if(P)return P}if(f)return null;else throw new Error('"'+q+'" is not in the SourceMap.')};X_.prototype.generatedPositionFor=function _(q){for(var f=0;f<this._sections.length;f++){var K=this._sections[f];if(K.consumer._findSourceIndex(s.getArg(q,"source"))===-1)continue;var $=K.consumer.generatedPositionFor(q);if($){var P={line:$.line+(K.generatedOffset.generatedLine-1),column:$.column+(K.generatedOffset.generatedLine===$.line?K.generatedOffset.generatedColumn-1:0)};return P}}return{line:null,column:null}};X_.prototype._parseMappings=function _(q,f){this.__generatedMappings=[],this.__originalMappings=[];for(var K=0;K<this._sections.length;K++){var $=this._sections[K],P=$.consumer._generatedMappings;for(var j=0;j<P.length;j++){var v=P[j],w=$.consumer._sources.at(v.source);w=s.computeSourceURL($.consumer.sourceRoot,w,this._sourceMapURL),this._sources.add(w),w=this._sources.indexOf(w);var O=null;if(v.name)O=$.consumer._names.at(v.name),this._names.add(O),O=this._names.indexOf(O);var T={source:w,generatedLine:v.generatedLine+($.generatedOffset.generatedLine-1),generatedColumn:v.generatedColumn+($.generatedOffset.generatedLine===v.generatedLine?$.generatedOffset.generatedColumn-1:0),originalLine:v.originalLine,originalColumn:v.originalColumn,name:O};if(this.__generatedMappings.push(T),typeof T.originalLine==="number")this.__originalMappings.push(T)}}v6(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),v6(this.__originalMappings,s.compareByOriginalPositions)};yX.IndexedSourceMapConsumer=X_});var nw=p((xX)=>{var LX=A3().SourceMapGenerator,i$=zf(),tX=/(\r?\n)/,eX=10,Hf="$$$isSourceNode$$$";function q_(_,q,f,K,$){if(this.children=[],this.sourceContents={},this.line=_==null?null:_,this.column=q==null?null:q,this.source=f==null?null:f,this.name=$==null?null:$,this[Hf]=!0,K!=null)this.add(K)}q_.fromStringWithSourceMap=function _(q,f,K){var $=new q_,P=q.split(tX),j=0,v=function(){var z=h(),H=h()||"";return z+H;function h(){return j<P.length?P[j++]:void 0}},w=1,O=0,T=null;if(f.eachMapping(function(z){if(T!==null)if(w<z.generatedLine)Y(T,v()),w++,O=0;else{var H=P[j]||"",h=H.substr(0,z.generatedColumn-O);P[j]=H.substr(z.generatedColumn-O),O=z.generatedColumn,Y(T,h),T=z;return}while(w<z.generatedLine)$.add(v()),w++;if(O<z.generatedColumn){var H=P[j]||"";$.add(H.substr(0,z.generatedColumn)),P[j]=H.substr(z.generatedColumn),O=z.generatedColumn}T=z},this),j<P.length){if(T)Y(T,v());$.add(P.splice(j).join(""))}return f.sources.forEach(function(z){var H=f.sourceContentFor(z);if(H!=null){if(K!=null)z=i$.join(K,z);$.setSourceContent(z,H)}}),$;function Y(z,H){if(z===null||z.source===void 0)$.add(H);else{var h=K?i$.join(K,z.source):z.source;$.add(new q_(z.originalLine,z.originalColumn,h,H,z.name))}}};q_.prototype.add=function _(q){if(Array.isArray(q))q.forEach(function(f){this.add(f)},this);else if(q[Hf]||typeof q==="string"){if(q)this.children.push(q)}else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+q);return this};q_.prototype.prepend=function _(q){if(Array.isArray(q))for(var f=q.length-1;f>=0;f--)this.prepend(q[f]);else if(q[Hf]||typeof q==="string")this.children.unshift(q);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+q);return this};q_.prototype.walk=function _(q){var f;for(var K=0,$=this.children.length;K<$;K++)if(f=this.children[K],f[Hf])f.walk(q);else if(f!=="")q(f,{source:this.source,line:this.line,column:this.column,name:this.name})};q_.prototype.join=function _(q){var f,K,$=this.children.length;if($>0){f=[];for(K=0;K<$-1;K++)f.push(this.children[K]),f.push(q);f.push(this.children[K]),this.children=f}return this};q_.prototype.replaceRight=function _(q,f){var K=this.children[this.children.length-1];if(K[Hf])K.replaceRight(q,f);else if(typeof K==="string")this.children[this.children.length-1]=K.replace(q,f);else this.children.push("".replace(q,f));return this};q_.prototype.setSourceContent=function _(q,f){this.sourceContents[i$.toSetString(q)]=f};q_.prototype.walkSourceContents=function _(q){for(var f=0,K=this.children.length;f<K;f++)if(this.children[f][Hf])this.children[f].walkSourceContents(q);var $=Object.keys(this.sourceContents);for(var f=0,K=$.length;f<K;f++)q(i$.fromSetString($[f]),this.sourceContents[$[f]])};q_.prototype.toString=function _(){var q="";return this.walk(function(f){q+=f}),q};q_.prototype.toStringWithSourceMap=function _(q){var f={code:"",line:1,column:0},K=new LX(q),$=!1,P=null,j=null,v=null,w=null;return this.walk(function(O,T){if(f.code+=O,T.source!==null&&T.line!==null&&T.column!==null){if(P!==T.source||j!==T.line||v!==T.column||w!==T.name)K.addMapping({source:T.source,original:{line:T.line,column:T.column},generated:{line:f.line,column:f.column},name:T.name});P=T.source,j=T.line,v=T.column,w=T.name,$=!0}else if($)K.addMapping({generated:{line:f.line,column:f.column}}),P=null,$=!1;for(var Y=0,z=O.length;Y<z;Y++)if(O.charCodeAt(Y)===eX){if(f.line++,f.column=0,Y+1===z)P=null,$=!1;else if($)K.addMapping({source:T.source,original:{line:T.line,column:T.column},generated:{line:f.line,column:f.column},name:T.name})}else f.column++}),this.walkSourceContents(function(O,T){K.setSourceContent(O,T)}),{code:f.code,map:K}};xX.SourceNode=q_});var Rw=p((BX)=>{BX.SourceMapGenerator=A3().SourceMapGenerator;BX.SourceMapConsumer=lw().SourceMapConsumer;BX.SourceNode=nw().SourceNode});var aw=p((gw,dw)=>{gw.__esModule=!0;var M3=Lq(),p8=void 0;try{if(typeof define!=="function"||!define.amd)S3=Rw(),p8=S3.SourceNode}catch(_){}var S3;if(!p8)p8=function(_,q,f,K){if(this.src="",K)this.add(K)},p8.prototype={add:function _(q){if(M3.isArray(q))q=q.join("");this.src+=q},prepend:function _(q){if(M3.isArray(q))q=q.join("");this.src=q+this.src},toStringWithSourceMap:function _(){return{code:this.toString()}},toString:function _(){return this.src}};function V3(_,q,f){if(M3.isArray(_)){var K=[];for(var $=0,P=_.length;$<P;$++)K.push(q.wrap(_[$],f));return K}else if(typeof _==="boolean"||typeof _==="number")return _+"";return _}function Ew(_){this.srcFile=_,this.source=[]}Ew.prototype={isEmpty:function _(){return!this.source.length},prepend:function _(q,f){this.source.unshift(this.wrap(q,f))},push:function _(q,f){this.source.push(this.wrap(q,f))},merge:function _(){var q=this.empty();return this.each(function(f){q.add([" ",f,`
|
|
14
|
+
`])}),q},each:function _(q){for(var f=0,K=this.source.length;f<K;f++)q(this.source[f])},empty:function _(){var q=this.currentLocation||{start:{}};return new p8(q.start.line,q.start.column,this.srcFile)},wrap:function _(q){var f=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];if(q instanceof p8)return q;return q=V3(q,this,f),new p8(f.start.line,f.start.column,this.srcFile,q)},functionCall:function _(q,f,K){return K=this.generateList(K),this.wrap([q,f?"."+f+"(":"(",K,")"])},quotedString:function _(q){return'"'+(q+"").replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function _(q){var f=this,K=[];Object.keys(q).forEach(function(P){var j=V3(q[P],f);if(j!=="undefined")K.push([f.quotedString(P),":",j])});var $=this.generateList(K);return $.prepend("{"),$.add("}"),$},generateList:function _(q){var f=this.empty();for(var K=0,$=q.length;K<$;K++){if(K)f.add(",");f.add(V3(q[K],this))}return f},generateArray:function _(q){var f=this.generateList(q);return f.prepend("["),f.add("]"),f}};gw.default=Ew;dw.exports=gw.default});var cw=p((iw,ow)=>{iw.__esModule=!0;function yw(_){return _&&_.__esModule?_:{default:_}}var Iw=R$(),fA=j_(),N3=yw(fA),$A=Lq(),KA=aw(),Dw=yw(KA);function hf(_){this.value=_}function Jf(){}Jf.prototype={nameLookup:function _(q,f){return this.internalNameLookup(q,f)},depthedLookup:function _(q){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(q),")"]},compilerInfo:function _(){var q=Iw.COMPILER_REVISION,f=Iw.REVISION_CHANGES[q];return[q,f]},appendToBuffer:function _(q,f,K){if(!$A.isArray(q))q=[q];if(q=this.source.wrap(q,f),this.environment.isSimple)return["return ",q,";"];else if(K)return["buffer += ",q,";"];else return q.appendToBuffer=!0,q},initializeBuffer:function _(){return this.quotedString("")},internalNameLookup:function _(q,f){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",q,",",JSON.stringify(f),")"]},lookupPropertyFunctionIsUsed:!1,compile:function _(q,f,K,$){this.environment=q,this.options=f,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!$,this.name=this.environment.name,this.isChild=!!K,this.context=K||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(q,f),this.useDepths=this.useDepths||q.useDepths||q.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||q.useBlockParams;var P=q.opcodes,j=void 0,v=void 0,w=void 0,O=void 0;for(w=0,O=P.length;w<O;w++)j=P[w],this.source.currentLocation=j.loc,v=v||j.loc,this[j.opcode].apply(this,j.args);if(this.source.currentLocation=v,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new N3.default("Compile completed with content left on stack");if(!this.decorators.isEmpty())if(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
|
|
15
|
+
`]),this.decorators.push("return fn;"),$)this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]);else this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
|
|
16
|
+
`),this.decorators.push(`}
|
|
17
|
+
`),this.decorators=this.decorators.merge();else this.decorators=void 0;var T=this.createFunctionContext($);if(!this.isChild){var Y={compiler:this.compilerInfo(),main:T};if(this.decorators)Y.main_d=this.decorators,Y.useDecorators=!0;var z=this.context,H=z.programs,h=z.decorators;for(w=0,O=H.length;w<O;w++)if(H[w]){if(Y[w]=H[w],h[w])Y[w+"_d"]=h[w],Y.useDecorators=!0}if(this.environment.usePartial)Y.usePartial=!0;if(this.options.data)Y.useData=!0;if(this.useDepths)Y.useDepths=!0;if(this.useBlockParams)Y.useBlockParams=!0;if(this.options.compat)Y.compat=!0;if(!$)if(Y.compiler=JSON.stringify(Y.compiler),this.source.currentLocation={start:{line:1,column:0}},Y=this.objectLiteral(Y),f.srcName)Y=Y.toStringWithSourceMap({file:f.destName}),Y.map=Y.map&&Y.map.toString();else Y=Y.toString();else Y.compilerOptions=this.options;return Y}else return T},preamble:function _(){this.lastContext=0,this.source=new Dw.default(this.options.srcName),this.decorators=new Dw.default(this.options.srcName)},createFunctionContext:function _(q){var f=this,K="",$=this.stackVars.concat(this.registers.list);if($.length>0)K+=", "+$.join(", ");var P=0;if(Object.keys(this.aliases).forEach(function(w){var O=f.aliases[w];if(O.children&&O.referenceCount>1)K+=", alias"+ ++P+"="+w,O.children[0]="alias"+P}),this.lookupPropertyFunctionIsUsed)K+=", "+this.lookupPropertyFunctionVarDeclaration();var j=["container","depth0","helpers","partials","data"];if(this.useBlockParams||this.useDepths)j.push("blockParams");if(this.useDepths)j.push("depths");var v=this.mergeSource(K);if(q)return j.push(v),Function.apply(this,j);else return this.source.wrap(["function(",j.join(","),`) {
|
|
18
|
+
`,v,"}"])},mergeSource:function _(q){var f=this.environment.isSimple,K=!this.forceBuffer,$=void 0,P=void 0,j=void 0,v=void 0;if(this.source.each(function(w){if(w.appendToBuffer){if(j)w.prepend(" + ");else j=w;v=w}else{if(j){if(!P)$=!0;else j.prepend("buffer += ");v.add(";"),j=v=void 0}if(P=!0,!f)K=!1}}),K){if(j)j.prepend("return "),v.add(";");else if(!P)this.source.push('return "";')}else if(q+=", buffer = "+($?"":this.initializeBuffer()),j)j.prepend("return buffer + "),v.add(";");else this.source.push("return buffer;");if(q)this.source.prepend("var "+q.substring(2)+($?"":`;
|
|
19
|
+
`));return this.source.merge()},lookupPropertyFunctionVarDeclaration:function _(){return`
|
|
20
|
+
lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
22
|
+
return parent[propertyName];
|
|
23
|
+
}
|
|
24
|
+
return undefined
|
|
25
|
+
}
|
|
26
|
+
`.trim()},blockValue:function _(q){var f=this.aliasable("container.hooks.blockHelperMissing"),K=[this.contextName(0)];this.setupHelperArgs(q,0,K);var $=this.popStack();K.splice(1,0,$),this.push(this.source.functionCall(f,"call",K))},ambiguousBlockValue:function _(){var q=this.aliasable("container.hooks.blockHelperMissing"),f=[this.contextName(0)];this.setupHelperArgs("",0,f,!0),this.flushInline();var K=this.topStack();f.splice(1,0,K),this.pushSource(["if (!",this.lastHelper,") { ",K," = ",this.source.functionCall(q,"call",f),"}"])},appendContent:function _(q){if(this.pendingContent)q=this.pendingContent+q;else this.pendingLocation=this.source.currentLocation;this.pendingContent=q},append:function _(){if(this.isInline())this.replaceStack(function(f){return[" != null ? ",f,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var q=this.popStack();if(this.pushSource(["if (",q," != null) { ",this.appendToBuffer(q,void 0,!0)," }"]),this.environment.isSimple)this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function _(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function _(q){this.lastContext=q},pushContext:function _(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function _(q,f,K,$){var P=0;if(!$&&this.options.compat&&!this.lastContext)this.push(this.depthedLookup(q[P++]));else this.pushContext();this.resolvePath("context",q,P,f,K)},lookupBlockParam:function _(q,f){this.useBlockParams=!0,this.push(["blockParams[",q[0],"][",q[1],"]"]),this.resolvePath("context",f,1)},lookupData:function _(q,f,K){if(!q)this.pushStackLiteral("data");else this.pushStackLiteral("container.data(data, "+q+")");this.resolvePath("data",f,0,!0,K)},resolvePath:function _(q,f,K,$,P){var j=this;if(this.options.strict||this.options.assumeObjects){this.push(PA(this.options.strict&&P,this,f,K,q));return}var v=f.length;for(;K<v;K++)this.replaceStack(function(w){var O=j.nameLookup(w,f[K],q);if(!$)return[" != null ? ",O," : ",w];else return[" && ",O]})},resolvePossibleLambda:function _(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function _(q,f){if(this.pushContext(),this.pushString(f),f!=="SubExpression")if(typeof q==="string")this.pushString(q);else this.pushStackLiteral(q)},emptyHash:function _(q){if(this.trackIds)this.push("{}");if(this.stringParams)this.push("{}"),this.push("{}");this.pushStackLiteral(q?"undefined":"{}")},pushHash:function _(){if(this.hash)this.hashes.push(this.hash);this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function _(){var q=this.hash;if(this.hash=this.hashes.pop(),this.trackIds)this.push(this.objectLiteral(q.ids));if(this.stringParams)this.push(this.objectLiteral(q.contexts)),this.push(this.objectLiteral(q.types));this.push(this.objectLiteral(q.values))},pushString:function _(q){this.pushStackLiteral(this.quotedString(q))},pushLiteral:function _(q){this.pushStackLiteral(q)},pushProgram:function _(q){if(q!=null)this.pushStackLiteral(this.programExpression(q));else this.pushStackLiteral(null)},registerDecorator:function _(q,f){var K=this.nameLookup("decorators",f,"decorator"),$=this.setupHelperArgs(f,q);this.decorators.push(["fn = ",this.decorators.functionCall(K,"",["fn","props","container",$])," || fn;"])},invokeHelper:function _(q,f,K){var $=this.popStack(),P=this.setupHelper(q,f),j=[];if(K)j.push(P.name);if(j.push($),!this.options.strict)j.push(this.aliasable("container.hooks.helperMissing"));var v=["(",this.itemsSeparatedBy(j,"||"),")"],w=this.source.functionCall(v,"call",P.callParams);this.push(w)},itemsSeparatedBy:function _(q,f){var K=[];K.push(q[0]);for(var $=1;$<q.length;$++)K.push(f,q[$]);return K},invokeKnownHelper:function _(q,f){var K=this.setupHelper(q,f);this.push(this.source.functionCall(K.name,"call",K.callParams))},invokeAmbiguous:function _(q,f){this.useRegister("helper");var K=this.popStack();this.emptyHash();var $=this.setupHelper(0,q,f),P=this.lastHelper=this.nameLookup("helpers",q,"helper"),j=["(","(helper = ",P," || ",K,")"];if(!this.options.strict)j[0]="(helper = ",j.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"));this.push(["(",j,$.paramsInit?["),(",$.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",$.callParams)," : helper))"])},invokePartial:function _(q,f,K){var $=[],P=this.setupParams(f,1,$);if(q)f=this.popStack(),delete P.name;if(K)P.indent=JSON.stringify(K);if(P.helpers="helpers",P.partials="partials",P.decorators="container.decorators",!q)$.unshift(this.nameLookup("partials",f,"partial"));else $.unshift(f);if(this.options.compat)P.depths="depths";P=this.objectLiteral(P),$.push(P),this.push(this.source.functionCall("container.invokePartial","",$))},assignToHash:function _(q){var f=this.popStack(),K=void 0,$=void 0,P=void 0;if(this.trackIds)P=this.popStack();if(this.stringParams)$=this.popStack(),K=this.popStack();var j=this.hash;if(K)j.contexts[q]=K;if($)j.types[q]=$;if(P)j.ids[q]=P;j.values[q]=f},pushId:function _(q,f,K){if(q==="BlockParam")this.pushStackLiteral("blockParams["+f[0]+"].path["+f[1]+"]"+(K?" + "+JSON.stringify("."+K):""));else if(q==="PathExpression")this.pushString(f);else if(q==="SubExpression")this.pushStackLiteral("true");else this.pushStackLiteral("null")},compiler:Jf,compileChildren:function _(q,f){var K=q.children,$=void 0,P=void 0;for(var j=0,v=K.length;j<v;j++){$=K[j],P=new this.compiler;var w=this.matchExistingProgram($);if(w==null){this.context.programs.push("");var O=this.context.programs.length;$.index=O,$.name="program"+O,this.context.programs[O]=P.compile($,f,this.context,!this.precompile),this.context.decorators[O]=P.decorators,this.context.environments[O]=$,this.useDepths=this.useDepths||P.useDepths,this.useBlockParams=this.useBlockParams||P.useBlockParams,$.useDepths=this.useDepths,$.useBlockParams=this.useBlockParams}else $.index=w.index,$.name="program"+w.index,this.useDepths=this.useDepths||w.useDepths,this.useBlockParams=this.useBlockParams||w.useBlockParams}},matchExistingProgram:function _(q){for(var f=0,K=this.context.environments.length;f<K;f++){var $=this.context.environments[f];if($&&$.equals(q))return $}},programExpression:function _(q){var f=this.environment.children[q],K=[f.index,"data",f.blockParams];if(this.useBlockParams||this.useDepths)K.push("blockParams");if(this.useDepths)K.push("depths");return"container.program("+K.join(", ")+")"},useRegister:function _(q){if(!this.registers[q])this.registers[q]=!0,this.registers.list.push(q)},push:function _(q){if(!(q instanceof hf))q=this.source.wrap(q);return this.inlineStack.push(q),q},pushStackLiteral:function _(q){this.push(new hf(q))},pushSource:function _(q){if(this.pendingContent)this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0;if(q)this.source.push(q)},replaceStack:function _(q){var f=["("],K=void 0,$=void 0,P=void 0;if(!this.isInline())throw new N3.default("replaceStack on non-inline");var j=this.popStack(!0);if(j instanceof hf)K=[j.value],f=["(",K],P=!0;else{$=!0;var v=this.incrStack();f=["((",this.push(v)," = ",j,")"],K=this.topStack()}var w=q.call(this,K);if(!P)this.popStack();if($)this.stackSlot--;this.push(f.concat(w,")"))},incrStack:function _(){if(this.stackSlot++,this.stackSlot>this.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function _(){return"stack"+this.stackSlot},flushInline:function _(){var q=this.inlineStack;this.inlineStack=[];for(var f=0,K=q.length;f<K;f++){var $=q[f];if($ instanceof hf)this.compileStack.push($);else{var P=this.incrStack();this.pushSource([P," = ",$,";"]),this.compileStack.push(P)}}},isInline:function _(){return this.inlineStack.length},popStack:function _(q){var f=this.isInline(),K=(f?this.inlineStack:this.compileStack).pop();if(!q&&K instanceof hf)return K.value;else{if(!f){if(!this.stackSlot)throw new N3.default("Invalid stack pop");this.stackSlot--}return K}},topStack:function _(){var q=this.isInline()?this.inlineStack:this.compileStack,f=q[q.length-1];if(f instanceof hf)return f.value;else return f},contextName:function _(q){if(this.useDepths&&q)return"depths["+q+"]";else return"depth"+q},quotedString:function _(q){return this.source.quotedString(q)},objectLiteral:function _(q){return this.source.objectLiteral(q)},aliasable:function _(q){var f=this.aliases[q];if(f)return f.referenceCount++,f;return f=this.aliases[q]=this.source.wrap(q),f.aliasable=!0,f.referenceCount=1,f},setupHelper:function _(q,f,K){var $=[],P=this.setupHelperArgs(f,q,$,K),j=this.nameLookup("helpers",f,"helper"),v=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:$,paramsInit:P,name:j,callParams:[v].concat($)}},setupParams:function _(q,f,K){var $={},P=[],j=[],v=[],w=!K,O=void 0;if(w)K=[];if($.name=this.quotedString(q),$.hash=this.popStack(),this.trackIds)$.hashIds=this.popStack();if(this.stringParams)$.hashTypes=this.popStack(),$.hashContexts=this.popStack();var T=this.popStack(),Y=this.popStack();if(Y||T)$.fn=Y||"container.noop",$.inverse=T||"container.noop";var z=f;while(z--){if(O=this.popStack(),K[z]=O,this.trackIds)v[z]=this.popStack();if(this.stringParams)j[z]=this.popStack(),P[z]=this.popStack()}if(w)$.args=this.source.generateArray(K);if(this.trackIds)$.ids=this.source.generateArray(v);if(this.stringParams)$.types=this.source.generateArray(j),$.contexts=this.source.generateArray(P);if(this.options.data)$.data="data";if(this.useBlockParams)$.blockParams="blockParams";return $},setupHelperArgs:function _(q,f,K,$){var P=this.setupParams(q,f,K);if(P.loc=JSON.stringify(this.source.currentLocation),P=this.objectLiteral(P),$)return this.useRegister("options"),K.push("options"),["options=",P];else if(K)return K.push(P),"";else return P}};(function(){var _="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),q=Jf.RESERVED_WORDS={};for(var f=0,K=_.length;f<K;f++)q[_[f]]=!0})();Jf.isValidJavaScriptVariableName=function(_){return!Jf.RESERVED_WORDS[_]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(_)};function PA(_,q,f,K,$){var P=q.popStack(),j=f.length;if(_)j--;for(;K<j;K++)P=q.nameLookup(P,f[K],$);if(_)return[q.aliasable("container.strict"),"(",P,", ",q.quotedString(f[K]),", ",JSON.stringify(q.source.currentLocation)," )"];else return P}iw.default=Jf;ow.exports=iw.default});var xw=p((tw,ew)=>{tw.__esModule=!0;function w6(_){return _&&_.__esModule?_:{default:_}}var wA=e5(),OA=w6(wA),YA=j3(),TA=w6(YA),C3=Yw(),p3=Hw(),zA=cw(),WA=w6(zA),HA=a$(),hA=w6(HA),JA=f3(),kA=w6(JA),ZA=OA.default.create;function Lw(){var _=ZA();return _.compile=function(q,f){return p3.compile(q,f,_)},_.precompile=function(q,f){return p3.precompile(q,f,_)},_.AST=TA.default,_.Compiler=p3.Compiler,_.JavaScriptCompiler=WA.default,_.Parser=C3.parser,_.parse=C3.parse,_.parseWithoutProcessing=C3.parseWithoutProcessing,_}var kf=Lw();kf.create=Lw;kA.default(kf);kf.Visitor=hA.default;kf.default=kf;tw.default=kf;ew.exports=tw.default});var sw=p((bA)=>{bA.__esModule=!0;bA.print=rA;bA.PrintVisitor=Sq;function uA(_){return _&&_.__esModule?_:{default:_}}var GA=a$(),mA=uA(GA);function rA(_){return new Sq().accept(_)}function Sq(){this.padding=0}Sq.prototype=new mA.default;Sq.prototype.pad=function(_){var q="";for(var f=0,K=this.padding;f<K;f++)q+=" ";return q+=_+`
|
|
27
|
+
`,q};Sq.prototype.Program=function(_){var q="",f=_.body,K=void 0,$=void 0;if(_.blockParams){var P="BLOCK PARAMS: [";for(K=0,$=_.blockParams.length;K<$;K++)P+=" "+_.blockParams[K];P+=" ]",q+=this.pad(P)}for(K=0,$=f.length;K<$;K++)q+=this.accept(f[K]);return this.padding--,q};Sq.prototype.MustacheStatement=function(_){return this.pad("{{ "+this.SubExpression(_)+" }}")};Sq.prototype.Decorator=function(_){return this.pad("{{ DIRECTIVE "+this.SubExpression(_)+" }}")};Sq.prototype.BlockStatement=Sq.prototype.DecoratorBlock=function(_){var q="";if(q+=this.pad((_.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,q+=this.pad(this.SubExpression(_)),_.program)q+=this.pad("PROGRAM:"),this.padding++,q+=this.accept(_.program),this.padding--;if(_.inverse){if(_.program)this.padding++;if(q+=this.pad("{{^}}"),this.padding++,q+=this.accept(_.inverse),this.padding--,_.program)this.padding--}return this.padding--,q};Sq.prototype.PartialStatement=function(_){var q="PARTIAL:"+_.name.original;if(_.params[0])q+=" "+this.accept(_.params[0]);if(_.hash)q+=" "+this.accept(_.hash);return this.pad("{{> "+q+" }}")};Sq.prototype.PartialBlockStatement=function(_){var q="PARTIAL BLOCK:"+_.name.original;if(_.params[0])q+=" "+this.accept(_.params[0]);if(_.hash)q+=" "+this.accept(_.hash);return q+=" "+this.pad("PROGRAM:"),this.padding++,q+=this.accept(_.program),this.padding--,this.pad("{{> "+q+" }}")};Sq.prototype.ContentStatement=function(_){return this.pad("CONTENT[ '"+_.value+"' ]")};Sq.prototype.CommentStatement=function(_){return this.pad("{{! '"+_.value+"' }}")};Sq.prototype.SubExpression=function(_){var q=_.params,f=[],K=void 0;for(var $=0,P=q.length;$<P;$++)f.push(this.accept(q[$]));return q="["+f.join(", ")+"]",K=_.hash?" "+this.accept(_.hash):"",this.accept(_.path)+" "+q+K};Sq.prototype.PathExpression=function(_){var q=_.parts.join("/");return(_.data?"@":"")+"PATH:"+q};Sq.prototype.StringLiteral=function(_){return'"'+_.value+'"'};Sq.prototype.NumberLiteral=function(_){return"NUMBER{"+_.value+"}"};Sq.prototype.BooleanLiteral=function(_){return"BOOLEAN{"+_.value+"}"};Sq.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Sq.prototype.NullLiteral=function(){return"NULL"};Sq.prototype.Hash=function(_){var q=_.pairs,f=[];for(var K=0,$=q.length;K<$;K++)f.push(this.accept(q[K]));return"HASH{"+f.join(", ")+"}"};Sq.prototype.HashPair=function(_){return _.key+"="+this.accept(_.value)}});var Qw=p((rg,Fw)=>{var o$=xw().default,Uw=sw();o$.PrintVisitor=Uw.PrintVisitor;o$.print=Uw.print;Fw.exports=o$;function Bw(_,q){var f=a_("fs"),K=f.readFileSync(q,"utf8");_.exports=o$.compile(K)}if(a_.extensions)a_.extensions[".handlebars"]=Bw,a_.extensions[".hbs"]=Bw});var Oq=p((gA)=>{var l3=Symbol.for("yaml.alias"),q1=Symbol.for("yaml.document"),c$=Symbol.for("yaml.map"),_1=Symbol.for("yaml.pair"),n3=Symbol.for("yaml.scalar"),L$=Symbol.for("yaml.seq"),t_=Symbol.for("yaml.node.type"),NA=(_)=>!!_&&typeof _==="object"&&_[t_]===l3,CA=(_)=>!!_&&typeof _==="object"&&_[t_]===q1,pA=(_)=>!!_&&typeof _==="object"&&_[t_]===c$,lA=(_)=>!!_&&typeof _==="object"&&_[t_]===_1,f1=(_)=>!!_&&typeof _==="object"&&_[t_]===n3,nA=(_)=>!!_&&typeof _==="object"&&_[t_]===L$;function $1(_){if(_&&typeof _==="object")switch(_[t_]){case c$:case L$:return!0}return!1}function RA(_){if(_&&typeof _==="object")switch(_[t_]){case l3:case c$:case n3:case L$:return!0}return!1}var EA=(_)=>(f1(_)||$1(_))&&!!_.anchor;gA.ALIAS=l3;gA.DOC=q1;gA.MAP=c$;gA.NODE_TYPE=t_;gA.PAIR=_1;gA.SCALAR=n3;gA.SEQ=L$;gA.hasAnchor=EA;gA.isAlias=NA;gA.isCollection=$1;gA.isDocument=CA;gA.isMap=pA;gA.isNode=RA;gA.isPair=lA;gA.isScalar=f1;gA.isSeq=nA});var O6=p((QA)=>{var Eq=Oq(),Bq=Symbol("break visit"),K1=Symbol("skip children"),p_=Symbol("remove node");function t$(_,q){let f=P1(q);if(Eq.isDocument(_)){if(Zf(null,_.contents,f,Object.freeze([_]))===p_)_.contents=null}else Zf(null,_,f,Object.freeze([]))}t$.BREAK=Bq;t$.SKIP=K1;t$.REMOVE=p_;function Zf(_,q,f,K){let $=j1(_,q,f,K);if(Eq.isNode($)||Eq.isPair($))return v1(_,K,$),Zf(_,$,f,K);if(typeof $!=="symbol"){if(Eq.isCollection(q)){K=Object.freeze(K.concat(q));for(let P=0;P<q.items.length;++P){let j=Zf(P,q.items[P],f,K);if(typeof j==="number")P=j-1;else if(j===Bq)return Bq;else if(j===p_)q.items.splice(P,1),P-=1}}else if(Eq.isPair(q)){K=Object.freeze(K.concat(q));let P=Zf("key",q.key,f,K);if(P===Bq)return Bq;else if(P===p_)q.key=null;let j=Zf("value",q.value,f,K);if(j===Bq)return Bq;else if(j===p_)q.value=null}}return $}async function e$(_,q){let f=P1(q);if(Eq.isDocument(_)){if(await Xf(null,_.contents,f,Object.freeze([_]))===p_)_.contents=null}else await Xf(null,_,f,Object.freeze([]))}e$.BREAK=Bq;e$.SKIP=K1;e$.REMOVE=p_;async function Xf(_,q,f,K){let $=await j1(_,q,f,K);if(Eq.isNode($)||Eq.isPair($))return v1(_,K,$),Xf(_,$,f,K);if(typeof $!=="symbol"){if(Eq.isCollection(q)){K=Object.freeze(K.concat(q));for(let P=0;P<q.items.length;++P){let j=await Xf(P,q.items[P],f,K);if(typeof j==="number")P=j-1;else if(j===Bq)return Bq;else if(j===p_)q.items.splice(P,1),P-=1}}else if(Eq.isPair(q)){K=Object.freeze(K.concat(q));let P=await Xf("key",q.key,f,K);if(P===Bq)return Bq;else if(P===p_)q.key=null;let j=await Xf("value",q.value,f,K);if(j===Bq)return Bq;else if(j===p_)q.value=null}}return $}function P1(_){if(typeof _==="object"&&(_.Collection||_.Node||_.Value))return Object.assign({Alias:_.Node,Map:_.Node,Scalar:_.Node,Seq:_.Node},_.Value&&{Map:_.Value,Scalar:_.Value,Seq:_.Value},_.Collection&&{Map:_.Collection,Seq:_.Collection},_);return _}function j1(_,q,f,K){if(typeof f==="function")return f(_,q,K);if(Eq.isMap(q))return f.Map?.(_,q,K);if(Eq.isSeq(q))return f.Seq?.(_,q,K);if(Eq.isPair(q))return f.Pair?.(_,q,K);if(Eq.isScalar(q))return f.Scalar?.(_,q,K);if(Eq.isAlias(q))return f.Alias?.(_,q,K);return}function v1(_,q,f){let K=q[q.length-1];if(Eq.isCollection(K))K.items[_]=f;else if(Eq.isPair(K))if(_==="key")K.key=f;else K.value=f;else if(Eq.isDocument(K))K.contents=f;else{let $=Eq.isAlias(K)?"alias":"scalar";throw new Error(`Cannot replace node with ${$} parent`)}}QA.visit=t$;QA.visitAsync=e$});var R3=p((Pu)=>{var w1=Oq(),fu=O6(),$u={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ku=(_)=>_.replace(/[!,[\]{}]/g,(q)=>$u[q]);class w_{constructor(_,q){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},w_.defaultYaml,_),this.tags=Object.assign({},w_.defaultTags,q)}clone(){let _=new w_(this.yaml,this.tags);return _.docStart=this.docStart,_}atDocument(){let _=new w_(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:w_.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},w_.defaultTags);break}return _}add(_,q){if(this.atNextDocument)this.yaml={explicit:w_.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},w_.defaultTags),this.atNextDocument=!1;let f=_.trim().split(/[ \t]+/),K=f.shift();switch(K){case"%TAG":{if(f.length!==2){if(q(0,"%TAG directive should contain exactly two parts"),f.length<2)return!1}let[$,P]=f;return this.tags[$]=P,!0}case"%YAML":{if(this.yaml.explicit=!0,f.length!==1)return q(0,"%YAML directive should contain exactly one part"),!1;let[$]=f;if($==="1.1"||$==="1.2")return this.yaml.version=$,!0;else{let P=/^\d+\.\d+$/.test($);return q(6,`Unsupported YAML version ${$}`,P),!1}}default:return q(0,`Unknown directive ${K}`,!0),!1}}tagName(_,q){if(_==="!")return"!";if(_[0]!=="!")return q(`Not a valid tag: ${_}`),null;if(_[1]==="<"){let P=_.slice(2,-1);if(P==="!"||P==="!!")return q(`Verbatim tags aren't resolved, so ${_} is invalid.`),null;if(_[_.length-1]!==">")q("Verbatim tags must end with a >");return P}let[,f,K]=_.match(/^(.*!)([^!]*)$/s);if(!K)q(`The ${_} tag has no suffix`);let $=this.tags[f];if($)try{return $+decodeURIComponent(K)}catch(P){return q(String(P)),null}if(f==="!")return _;return q(`Could not resolve tag: ${_}`),null}tagString(_){for(let[q,f]of Object.entries(this.tags))if(_.startsWith(f))return q+Ku(_.substring(f.length));return _[0]==="!"?_:`!<${_}>`}toString(_){let q=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],f=Object.entries(this.tags),K;if(_&&f.length>0&&w1.isNode(_.contents)){let $={};fu.visit(_.contents,(P,j)=>{if(w1.isNode(j)&&j.tag)$[j.tag]=!0}),K=Object.keys($)}else K=[];for(let[$,P]of f){if($==="!!"&&P==="tag:yaml.org,2002:")continue;if(!_||K.some((j)=>j.startsWith(P)))q.push(`%TAG ${$} ${P}`)}return q.join(`
|
|
28
|
+
`)}}w_.defaultYaml={explicit:!1,version:"1.2"};w_.defaultTags={"!!":"tag:yaml.org,2002:"};Pu.Directives=w_});var x$=p((Yu)=>{var O1=Oq(),vu=O6();function wu(_){if(/[\x00-\x19\s,[\]{}]/.test(_)){let f=`Anchor must not contain whitespace or control characters: ${JSON.stringify(_)}`;throw new Error(f)}return!0}function Y1(_){let q=new Set;return vu.visit(_,{Value(f,K){if(K.anchor)q.add(K.anchor)}}),q}function T1(_,q){for(let f=1;;++f){let K=`${_}${f}`;if(!q.has(K))return K}}function Ou(_,q){let f=[],K=new Map,$=null;return{onAnchor:(P)=>{f.push(P),$??($=Y1(_));let j=T1(q,$);return $.add(j),j},setAnchors:()=>{for(let P of f){let j=K.get(P);if(typeof j==="object"&&j.anchor&&(O1.isScalar(j.node)||O1.isCollection(j.node)))j.node.anchor=j.anchor;else{let v=new Error("Failed to resolve repeated object (this should not happen)");throw v.source=P,v}}},sourceObjects:K}}Yu.anchorIsValid=wu;Yu.anchorNames=Y1;Yu.createNodeAnchors=Ou;Yu.findNewAnchor=T1});var E3=p((hu)=>{function Y6(_,q,f,K){if(K&&typeof K==="object")if(Array.isArray(K))for(let $=0,P=K.length;$<P;++$){let j=K[$],v=Y6(_,K,String($),j);if(v===void 0)delete K[$];else if(v!==j)K[$]=v}else if(K instanceof Map)for(let $ of Array.from(K.keys())){let P=K.get($),j=Y6(_,K,$,P);if(j===void 0)K.delete($);else if(j!==P)K.set($,j)}else if(K instanceof Set)for(let $ of Array.from(K)){let P=Y6(_,K,$,$);if(P===void 0)K.delete($);else if(P!==$)K.delete($),K.add(P)}else for(let[$,P]of Object.entries(K)){let j=Y6(_,K,$,P);if(j===void 0)delete K[$];else if(j!==P)K[$]=j}return _.call(q,f,K)}hu.applyReviver=Y6});var P8=p((Zu)=>{var ku=Oq();function z1(_,q,f){if(Array.isArray(_))return _.map((K,$)=>z1(K,String($),f));if(_&&typeof _.toJSON==="function"){if(!f||!ku.hasAnchor(_))return _.toJSON(q,f);let K={aliasCount:0,count:1,res:void 0};f.anchors.set(_,K),f.onCreate=(P)=>{K.res=P,delete f.onCreate};let $=_.toJSON(q,f);if(f.onCreate)f.onCreate($);return $}if(typeof _==="bigint"&&!f?.keep)return Number(_);return _}Zu.toJS=z1});var s$=p((Gu)=>{var Au=E3(),W1=Oq(),uu=P8();class H1{constructor(_){Object.defineProperty(this,W1.NODE_TYPE,{value:_})}clone(){let _=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)_.range=this.range.slice();return _}toJS(_,{mapAsMap:q,maxAliasCount:f,onAnchor:K,reviver:$}={}){if(!W1.isDocument(_))throw new TypeError("A document argument is required");let P={anchors:new Map,doc:_,keep:!0,mapAsMap:q===!0,mapKeyWarned:!1,maxAliasCount:typeof f==="number"?f:100},j=uu.toJS(this,"",P);if(typeof K==="function")for(let{count:v,res:w}of P.anchors.values())K(w,v);return typeof $==="function"?Au.applyReviver($,{"":j},"",j):j}}Gu.NodeBase=H1});var T6=p((Su)=>{var ru=x$(),bu=O6(),Af=Oq(),Vu=s$(),Mu=P8();class h1 extends Vu.NodeBase{constructor(_){super(Af.ALIAS);this.source=_,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(_,q){let f;if(q?.aliasResolveCache)f=q.aliasResolveCache;else if(f=[],bu.visit(_,{Node:($,P)=>{if(Af.isAlias(P)||Af.hasAnchor(P))f.push(P)}}),q)q.aliasResolveCache=f;let K=void 0;for(let $ of f){if($===this)break;if($.anchor===this.source)K=$}return K}toJSON(_,q){if(!q)return{source:this.source};let{anchors:f,doc:K,maxAliasCount:$}=q,P=this.resolve(K,q);if(!P){let v=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(v)}let j=f.get(P);if(!j)Mu.toJS(P,null,q),j=f.get(P);if(!j||j.res===void 0)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if($>=0){if(j.count+=1,j.aliasCount===0)j.aliasCount=B$(K,P,f);if(j.count*j.aliasCount>$)throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return j.res}toString(_,q,f){let K=`*${this.source}`;if(_){if(ru.anchorIsValid(this.source),_.options.verifyAliasOrder&&!_.anchors.has(this.source)){let $=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error($)}if(_.implicitKey)return`${K} `}return K}}function B$(_,q,f){if(Af.isAlias(q)){let K=q.resolve(_),$=f&&K&&f.get(K);return $?$.count*$.aliasCount:0}else if(Af.isCollection(q)){let K=0;for(let $ of q.items){let P=B$(_,$,f);if(P>K)K=P}return K}else if(Af.isPair(q)){let K=B$(_,q.key,f),$=B$(_,q.value,f);return Math.max(K,$)}return 1}Su.Alias=h1});var nq=p((Ru)=>{var Cu=Oq(),pu=s$(),lu=P8(),nu=(_)=>!_||typeof _!=="function"&&typeof _!=="object";class l8 extends pu.NodeBase{constructor(_){super(Cu.SCALAR);this.value=_}toJSON(_,q){return q?.keep?this.value:lu.toJS(this.value,_,q)}toString(){return String(this.value)}}l8.BLOCK_FOLDED="BLOCK_FOLDED";l8.BLOCK_LITERAL="BLOCK_LITERAL";l8.PLAIN="PLAIN";l8.QUOTE_DOUBLE="QUOTE_DOUBLE";l8.QUOTE_SINGLE="QUOTE_SINGLE";Ru.Scalar=l8;Ru.isScalarValue=nu});var z6=p((yu)=>{var du=T6(),n8=Oq(),J1=nq(),au="tag:yaml.org,2002:";function Iu(_,q,f){if(q){let K=f.filter((P)=>P.tag===q),$=K.find((P)=>!P.format)??K[0];if(!$)throw new Error(`Tag ${q} not found`);return $}return f.find((K)=>K.identify?.(_)&&!K.format)}function Du(_,q,f){if(n8.isDocument(_))_=_.contents;if(n8.isNode(_))return _;if(n8.isPair(_)){let Y=f.schema[n8.MAP].createNode?.(f.schema,null,f);return Y.items.push(_),Y}if(_ instanceof String||_ instanceof Number||_ instanceof Boolean||typeof BigInt!=="undefined"&&_ instanceof BigInt)_=_.valueOf();let{aliasDuplicateObjects:K,onAnchor:$,onTagObj:P,schema:j,sourceObjects:v}=f,w=void 0;if(K&&_&&typeof _==="object")if(w=v.get(_),w)return w.anchor??(w.anchor=$(_)),new du.Alias(w.anchor);else w={anchor:null,node:null},v.set(_,w);if(q?.startsWith("!!"))q=au+q.slice(2);let O=Iu(_,q,j.tags);if(!O){if(_&&typeof _.toJSON==="function")_=_.toJSON();if(!_||typeof _!=="object"){let Y=new J1.Scalar(_);if(w)w.node=Y;return Y}O=_ instanceof Map?j[n8.MAP]:(Symbol.iterator in Object(_))?j[n8.SEQ]:j[n8.MAP]}if(P)P(O),delete f.onTagObj;let T=O?.createNode?O.createNode(f.schema,_,f):typeof O?.nodeClass?.from==="function"?O.nodeClass.from(f.schema,_,f):new J1.Scalar(_);if(q)T.tag=q;else if(!O.default)T.tag=O.tag;if(w)w.node=T;return T}yu.createNode=Du});var U$=p((Lu)=>{var ou=z6(),l_=Oq(),cu=s$();function g3(_,q,f){let K=f;for(let $=q.length-1;$>=0;--$){let P=q[$];if(typeof P==="number"&&Number.isInteger(P)&&P>=0){let j=[];j[P]=K,K=j}else K=new Map([[P,K]])}return ou.createNode(K,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:_,sourceObjects:new Map})}var k1=(_)=>_==null||typeof _==="object"&&!!_[Symbol.iterator]().next().done;class Z1 extends cu.NodeBase{constructor(_,q){super(_);Object.defineProperty(this,"schema",{value:q,configurable:!0,enumerable:!1,writable:!0})}clone(_){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(_)q.schema=_;if(q.items=q.items.map((f)=>l_.isNode(f)||l_.isPair(f)?f.clone(_):f),this.range)q.range=this.range.slice();return q}addIn(_,q){if(k1(_))this.add(q);else{let[f,...K]=_,$=this.get(f,!0);if(l_.isCollection($))$.addIn(K,q);else if($===void 0&&this.schema)this.set(f,g3(this.schema,K,q));else throw new Error(`Expected YAML collection at ${f}. Remaining path: ${K}`)}}deleteIn(_){let[q,...f]=_;if(f.length===0)return this.delete(q);let K=this.get(q,!0);if(l_.isCollection(K))return K.deleteIn(f);else throw new Error(`Expected YAML collection at ${q}. Remaining path: ${f}`)}getIn(_,q){let[f,...K]=_,$=this.get(f,!0);if(K.length===0)return!q&&l_.isScalar($)?$.value:$;else return l_.isCollection($)?$.getIn(K,q):void 0}hasAllNullValues(_){return this.items.every((q)=>{if(!l_.isPair(q))return!1;let f=q.value;return f==null||_&&l_.isScalar(f)&&f.value==null&&!f.commentBefore&&!f.comment&&!f.tag})}hasIn(_){let[q,...f]=_;if(f.length===0)return this.has(q);let K=this.get(q,!0);return l_.isCollection(K)?K.hasIn(f):!1}setIn(_,q){let[f,...K]=_;if(K.length===0)this.set(f,q);else{let $=this.get(f,!0);if(l_.isCollection($))$.setIn(K,q);else if($===void 0&&this.schema)this.set(f,g3(this.schema,K,q));else throw new Error(`Expected YAML collection at ${f}. Remaining path: ${K}`)}}}Lu.Collection=Z1;Lu.collectionFromPath=g3;Lu.isEmptyPath=k1});var W6=p((Uu)=>{var su=(_)=>_.replace(/^(?!$)(?: $)?/gm,"#");function d3(_,q){if(/^\n+$/.test(_))return _.substring(1);return q?_.replace(/^(?! *$)/gm,q):_}var Bu=(_,q,f)=>_.endsWith(`
|
|
29
|
+
`)?d3(f,q):f.includes(`
|
|
30
|
+
`)?`
|
|
31
|
+
`+d3(f,q):(_.endsWith(" ")?"":" ")+f;Uu.indentComment=d3;Uu.lineComment=Bu;Uu.stringifyComment=su});var A1=p((fG)=>{function _G(_,q,f="flow",{indentAtStart:K,lineWidth:$=80,minContentWidth:P=20,onFold:j,onOverflow:v}={}){if(!$||$<0)return _;if($<P)P=0;let w=Math.max(1+P,1+$-q.length);if(_.length<=w)return _;let O=[],T={},Y=$-q.length;if(typeof K==="number")if(K>$-Math.max(2,P))O.push(0);else Y=$-K;let z=void 0,H=void 0,h=!1,J=-1,k=-1,X=-1;if(f==="block"){if(J=X1(_,J,q.length),J!==-1)Y=J+w}for(let N;N=_[J+=1];){if(f==="quoted"&&N==="\\"){switch(k=J,_[J+1]){case"x":J+=3;break;case"u":J+=5;break;case"U":J+=9;break;default:J+=1}X=J}if(N===`
|
|
32
|
+
`){if(f==="block")J=X1(_,J,q.length);Y=J+q.length+w,z=void 0}else{if(N===" "&&H&&H!==" "&&H!==`
|
|
33
|
+
`&&H!=="\t"){let n=_[J+1];if(n&&n!==" "&&n!==`
|
|
34
|
+
`&&n!=="\t")z=J}if(J>=Y)if(z)O.push(z),Y=z+w,z=void 0;else if(f==="quoted"){while(H===" "||H==="\t")H=N,N=_[J+=1],h=!0;let n=J>X+1?J-2:k-1;if(T[n])return _;O.push(n),T[n]=!0,Y=n+w,z=void 0}else h=!0}H=N}if(h&&v)v();if(O.length===0)return _;if(j)j();let l=_.slice(0,O[0]);for(let N=0;N<O.length;++N){let n=O[N],R=O[N+1]||_.length;if(n===0)l=`
|
|
35
|
+
${q}${_.slice(0,R)}`;else{if(f==="quoted"&&T[n])l+=`${_[n]}\\`;l+=`
|
|
36
|
+
${q}${_.slice(n+1,R)}`}}return l}function X1(_,q,f){let K=q,$=q+1,P=_[$];while(P===" "||P==="\t")if(q<$+f)P=_[++q];else{do P=_[++q];while(P&&P!==`
|
|
37
|
+
`);K=q,$=q+1,P=_[$]}return K}fG.FOLD_BLOCK="block";fG.FOLD_FLOW="flow";fG.FOLD_QUOTED="quoted";fG.foldFlowLines=_G});var h6=p((YG)=>{var A_=nq(),j8=A1(),Q$=(_,q)=>({indentAtStart:q?_.indent.length:_.indentAtStart,lineWidth:_.options.lineWidth,minContentWidth:_.options.minContentWidth}),qK=(_)=>/^(%|---|\.\.\.)/m.test(_);function vG(_,q,f){if(!q||q<0)return!1;let K=q-f,$=_.length;if($<=K)return!1;for(let P=0,j=0;P<$;++P)if(_[P]===`
|
|
38
|
+
`){if(P-j>K)return!0;if(j=P+1,$-j<=K)return!1}return!0}function H6(_,q){let f=JSON.stringify(_);if(q.options.doubleQuotedAsJSON)return f;let{implicitKey:K}=q,$=q.options.doubleQuotedMinMultiLineLength,P=q.indent||(qK(_)?" ":""),j="",v=0;for(let w=0,O=f[w];O;O=f[++w]){if(O===" "&&f[w+1]==="\\"&&f[w+2]==="n")j+=f.slice(v,w)+"\\ ",w+=1,v=w,O="\\";if(O==="\\")switch(f[w+1]){case"u":{j+=f.slice(v,w);let T=f.substr(w+2,4);switch(T){case"0000":j+="\\0";break;case"0007":j+="\\a";break;case"000b":j+="\\v";break;case"001b":j+="\\e";break;case"0085":j+="\\N";break;case"00a0":j+="\\_";break;case"2028":j+="\\L";break;case"2029":j+="\\P";break;default:if(T.substr(0,2)==="00")j+="\\x"+T.substr(2);else j+=f.substr(w,6)}w+=5,v=w+1}break;case"n":if(K||f[w+2]==='"'||f.length<$)w+=1;else{j+=f.slice(v,w)+`
|
|
39
|
+
|
|
40
|
+
`;while(f[w+2]==="\\"&&f[w+3]==="n"&&f[w+4]!=='"')j+=`
|
|
41
|
+
`,w+=2;if(j+=P,f[w+2]===" ")j+="\\";w+=1,v=w+1}break;default:w+=1}}return j=v?j+f.slice(v):f,K?j:j8.foldFlowLines(j,P,j8.FOLD_QUOTED,Q$(q,!1))}function a3(_,q){if(q.options.singleQuote===!1||q.implicitKey&&_.includes(`
|
|
42
|
+
`)||/[ \t]\n|\n[ \t]/.test(_))return H6(_,q);let f=q.indent||(qK(_)?" ":""),K="'"+_.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
43
|
+
${f}`)+"'";return q.implicitKey?K:j8.foldFlowLines(K,f,j8.FOLD_FLOW,Q$(q,!1))}function uf(_,q){let{singleQuote:f}=q.options,K;if(f===!1)K=H6;else{let $=_.includes('"'),P=_.includes("'");if($&&!P)K=a3;else if(P&&!$)K=H6;else K=f?a3:H6}return K(_,q)}var I3;try{I3=new RegExp(`(^|(?<!
|
|
44
|
+
))
|
|
45
|
+
+(?!
|
|
46
|
+
|$)`,"g")}catch{I3=/\n+(?!\n|$)/g}function F$({comment:_,type:q,value:f},K,$,P){let{blockQuote:j,commentString:v,lineWidth:w}=K.options;if(!j||/\n[\t ]+$/.test(f))return uf(f,K);let O=K.indent||(K.forceBlockIndent||qK(f)?" ":""),T=j==="literal"?!0:j==="folded"||q===A_.Scalar.BLOCK_FOLDED?!1:q===A_.Scalar.BLOCK_LITERAL?!0:!vG(f,w,O.length);if(!f)return T?`|
|
|
47
|
+
`:`>
|
|
48
|
+
`;let Y,z;for(z=f.length;z>0;--z){let R=f[z-1];if(R!==`
|
|
49
|
+
`&&R!=="\t"&&R!==" ")break}let H=f.substring(z),h=H.indexOf(`
|
|
50
|
+
`);if(h===-1)Y="-";else if(f===H||h!==H.length-1){if(Y="+",P)P()}else Y="";if(H){if(f=f.slice(0,-H.length),H[H.length-1]===`
|
|
51
|
+
`)H=H.slice(0,-1);H=H.replace(I3,`$&${O}`)}let J=!1,k,X=-1;for(k=0;k<f.length;++k){let R=f[k];if(R===" ")J=!0;else if(R===`
|
|
52
|
+
`)X=k;else break}let l=f.substring(0,X<k?X+1:k);if(l)f=f.substring(l.length),l=l.replace(/\n+/g,`$&${O}`);let n=(J?O?"2":"1":"")+Y;if(_){if(n+=" "+v(_.replace(/ ?[\r\n]+/g," ")),$)$()}if(!T){let R=f.replace(/\n+/g,`
|
|
53
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${O}`),g=!1,V=Q$(K,!0);if(j!=="folded"&&q!==A_.Scalar.BLOCK_FOLDED)V.onOverflow=()=>{g=!0};let M=j8.foldFlowLines(`${l}${R}${H}`,O,j8.FOLD_BLOCK,V);if(!g)return`>${n}
|
|
54
|
+
${O}${M}`}return f=f.replace(/\n+/g,`$&${O}`),`|${n}
|
|
55
|
+
${O}${l}${f}${H}`}function wG(_,q,f,K){let{type:$,value:P}=_,{actualString:j,implicitKey:v,indent:w,indentStep:O,inFlow:T}=q;if(v&&P.includes(`
|
|
56
|
+
`)||T&&/[[\]{},]/.test(P))return uf(P,q);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(P))return v||T||!P.includes(`
|
|
57
|
+
`)?uf(P,q):F$(_,q,f,K);if(!v&&!T&&$!==A_.Scalar.PLAIN&&P.includes(`
|
|
58
|
+
`))return F$(_,q,f,K);if(qK(P)){if(w==="")return q.forceBlockIndent=!0,F$(_,q,f,K);else if(v&&w===O)return uf(P,q)}let Y=P.replace(/\n+/g,`$&
|
|
59
|
+
${w}`);if(j){let z=(J)=>J.default&&J.tag!=="tag:yaml.org,2002:str"&&J.test?.test(Y),{compat:H,tags:h}=q.doc.schema;if(h.some(z)||H?.some(z))return uf(P,q)}return v?Y:j8.foldFlowLines(Y,w,j8.FOLD_FLOW,Q$(q,!1))}function OG(_,q,f,K){let{implicitKey:$,inFlow:P}=q,j=typeof _.value==="string"?_:Object.assign({},_,{value:String(_.value)}),{type:v}=_;if(v!==A_.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(j.value))v=A_.Scalar.QUOTE_DOUBLE}let w=(T)=>{switch(T){case A_.Scalar.BLOCK_FOLDED:case A_.Scalar.BLOCK_LITERAL:return $||P?uf(j.value,q):F$(j,q,f,K);case A_.Scalar.QUOTE_DOUBLE:return H6(j.value,q);case A_.Scalar.QUOTE_SINGLE:return a3(j.value,q);case A_.Scalar.PLAIN:return wG(j,q,f,K);default:return null}},O=w(v);if(O===null){let{defaultKeyType:T,defaultStringType:Y}=q.options,z=$&&T||Y;if(O=w(z),O===null)throw new Error(`Unsupported default string type ${z}`)}return O}YG.stringifyString=OG});var J6=p((XG)=>{var zG=x$(),v8=Oq(),WG=W6(),HG=h6();function hG(_,q){let f=Object.assign({blockQuote:!0,commentString:WG.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},_.schema.toStringOptions,q),K;switch(f.collectionStyle){case"block":K=!1;break;case"flow":K=!0;break;default:K=null}return{anchors:new Set,doc:_,flowCollectionPadding:f.flowCollectionPadding?" ":"",indent:"",indentStep:typeof f.indent==="number"?" ".repeat(f.indent):" ",inFlow:K,options:f}}function JG(_,q){if(q.tag){let $=_.filter((P)=>P.tag===q.tag);if($.length>0)return $.find((P)=>P.format===q.format)??$[0]}let f=void 0,K;if(v8.isScalar(q)){K=q.value;let $=_.filter((P)=>P.identify?.(K));if($.length>1){let P=$.filter((j)=>j.test);if(P.length>0)$=P}f=$.find((P)=>P.format===q.format)??$.find((P)=>!P.format)}else K=q,f=_.find(($)=>$.nodeClass&&K instanceof $.nodeClass);if(!f){let $=K?.constructor?.name??(K===null?"null":typeof K);throw new Error(`Tag not resolved for ${$} value`)}return f}function kG(_,q,{anchors:f,doc:K}){if(!K.directives)return"";let $=[],P=(v8.isScalar(_)||v8.isCollection(_))&&_.anchor;if(P&&zG.anchorIsValid(P))f.add(P),$.push(`&${P}`);let j=_.tag??(q.default?null:q.tag);if(j)$.push(K.directives.tagString(j));return $.join(" ")}function ZG(_,q,f,K){if(v8.isPair(_))return _.toString(q,f,K);if(v8.isAlias(_)){if(q.doc.directives)return _.toString(q);if(q.resolvedAliases?.has(_))throw new TypeError("Cannot stringify circular structure without alias nodes");else{if(q.resolvedAliases)q.resolvedAliases.add(_);else q.resolvedAliases=new Set([_]);_=_.resolve(q.doc)}}let $=void 0,P=v8.isNode(_)?_:q.doc.createNode(_,{onTagObj:(w)=>$=w});$??($=JG(q.doc.schema.tags,P));let j=kG(P,$,q);if(j.length>0)q.indentAtStart=(q.indentAtStart??0)+j.length+1;let v=typeof $.stringify==="function"?$.stringify(P,q,f,K):v8.isScalar(P)?HG.stringifyString(P,q,f,K):P.toString(q,f,K);if(!j)return v;return v8.isScalar(P)||v[0]==="{"||v[0]==="["?`${j} ${v}`:`${j}
|
|
60
|
+
${q.indent}${v}`}XG.createStringifyContext=hG;XG.stringify=ZG});var m1=p((mG)=>{var e_=Oq(),u1=nq(),G1=J6(),k6=W6();function GG({key:_,value:q},f,K,$){let{allNullValues:P,doc:j,indent:v,indentStep:w,options:{commentString:O,indentSeq:T,simpleKeys:Y}}=f,z=e_.isNode(_)&&_.comment||null;if(Y){if(z)throw new Error("With simple keys, key nodes cannot have comments");if(e_.isCollection(_)||!e_.isNode(_)&&typeof _==="object")throw new Error("With simple keys, collection cannot be used as a key value")}let H=!Y&&(!_||z&&q==null&&!f.inFlow||e_.isCollection(_)||(e_.isScalar(_)?_.type===u1.Scalar.BLOCK_FOLDED||_.type===u1.Scalar.BLOCK_LITERAL:typeof _==="object"));f=Object.assign({},f,{allNullValues:!1,implicitKey:!H&&(Y||!P),indent:v+w});let h=!1,J=!1,k=G1.stringify(_,f,()=>h=!0,()=>J=!0);if(!H&&!f.inFlow&&k.length>1024){if(Y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");H=!0}if(f.inFlow){if(P||q==null){if(h&&K)K();return k===""?"?":H?`? ${k}`:k}}else if(P&&!Y||q==null&&H){if(k=`? ${k}`,z&&!h)k+=k6.lineComment(k,f.indent,O(z));else if(J&&$)$();return k}if(h)z=null;if(H){if(z)k+=k6.lineComment(k,f.indent,O(z));k=`? ${k}
|
|
61
|
+
${v}:`}else if(k=`${k}:`,z)k+=k6.lineComment(k,f.indent,O(z));let X,l,N;if(e_.isNode(q))X=!!q.spaceBefore,l=q.commentBefore,N=q.comment;else if(X=!1,l=null,N=null,q&&typeof q==="object")q=j.createNode(q);if(f.implicitKey=!1,!H&&!z&&e_.isScalar(q))f.indentAtStart=k.length+1;if(J=!1,!T&&w.length>=2&&!f.inFlow&&!H&&e_.isSeq(q)&&!q.flow&&!q.tag&&!q.anchor)f.indent=f.indent.substring(2);let n=!1,R=G1.stringify(q,f,()=>n=!0,()=>J=!0),g=" ";if(z||X||l){if(g=X?`
|
|
62
|
+
`:"",l){let V=O(l);g+=`
|
|
63
|
+
${k6.indentComment(V,f.indent)}`}if(R===""&&!f.inFlow){if(g===`
|
|
64
|
+
`)g=`
|
|
65
|
+
|
|
66
|
+
`}else g+=`
|
|
67
|
+
${f.indent}`}else if(!H&&e_.isCollection(q)){let V=R[0],M=R.indexOf(`
|
|
68
|
+
`),C=M!==-1,a=f.inFlow??q.flow??q.items.length===0;if(C||!a){let r=!1;if(C&&(V==="&"||V==="!")){let A=R.indexOf(" ");if(V==="&"&&A!==-1&&A<M&&R[A+1]==="!")A=R.indexOf(" ",A+1);if(A===-1||M<A)r=!0}if(!r)g=`
|
|
69
|
+
${f.indent}`}}else if(R===""||R[0]===`
|
|
70
|
+
`)g="";if(k+=g+R,f.inFlow){if(n&&K)K()}else if(N&&!n)k+=k6.lineComment(k,f.indent,O(N));else if(J&&$)$();return k}mG.stringifyPair=GG});var D3=p((MG)=>{var r1=a_("process");function bG(_,...q){if(_==="debug")console.log(...q)}function VG(_,q){if(_==="debug"||_==="warn")if(typeof r1.emitWarning==="function")r1.emitWarning(q);else console.warn(q)}MG.debug=bG;MG.warn=VG});var $K=p((pG)=>{var Z6=Oq(),b1=nq(),_K="<<",fK={identify:(_)=>_===_K||typeof _==="symbol"&&_.description===_K,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new b1.Scalar(Symbol(_K)),{addToJSMap:V1}),stringify:()=>_K},CG=(_,q)=>(fK.identify(q)||Z6.isScalar(q)&&(!q.type||q.type===b1.Scalar.PLAIN)&&fK.identify(q.value))&&_?.doc.schema.tags.some((f)=>f.tag===fK.tag&&f.default);function V1(_,q,f){if(f=_&&Z6.isAlias(f)?f.resolve(_.doc):f,Z6.isSeq(f))for(let K of f.items)y3(_,q,K);else if(Array.isArray(f))for(let K of f)y3(_,q,K);else y3(_,q,f)}function y3(_,q,f){let K=_&&Z6.isAlias(f)?f.resolve(_.doc):f;if(!Z6.isMap(K))throw new Error("Merge sources must be maps or map aliases");let $=K.toJSON(null,_,Map);for(let[P,j]of $)if(q instanceof Map){if(!q.has(P))q.set(P,j)}else if(q instanceof Set)q.add(P);else if(!Object.prototype.hasOwnProperty.call(q,P))Object.defineProperty(q,P,{value:j,writable:!0,enumerable:!0,configurable:!0});return q}pG.addMergeToJSMap=V1;pG.isMergeKey=CG;pG.merge=fK});var o3=p((IG)=>{var EG=D3(),M1=$K(),gG=J6(),S1=Oq(),i3=P8();function dG(_,q,{key:f,value:K}){if(S1.isNode(f)&&f.addToJSMap)f.addToJSMap(_,q,K);else if(M1.isMergeKey(_,f))M1.addMergeToJSMap(_,q,K);else{let $=i3.toJS(f,"",_);if(q instanceof Map)q.set($,i3.toJS(K,$,_));else if(q instanceof Set)q.add($);else{let P=aG(f,$,_),j=i3.toJS(K,P,_);if(P in q)Object.defineProperty(q,P,{value:j,writable:!0,enumerable:!0,configurable:!0});else q[P]=j}}return q}function aG(_,q,f){if(q===null)return"";if(typeof q!=="object")return String(q);if(S1.isNode(_)&&f?.doc){let K=gG.createStringifyContext(f.doc,{});K.anchors=new Set;for(let P of f.anchors.keys())K.anchors.add(P.anchor);K.inFlow=!0,K.inStringifyKey=!0;let $=_.toString(K);if(!f.mapKeyWarned){let P=JSON.stringify($);if(P.length>40)P=P.substring(0,36)+'..."';EG.warn(f.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${P}. Set mapAsMap: true to use object keys.`),f.mapKeyWarned=!0}return $}return JSON.stringify(q)}IG.addPairToJSMap=dG});var w8=p((cG)=>{var N1=z6(),yG=m1(),iG=o3(),KK=Oq();function oG(_,q,f){let K=N1.createNode(_,void 0,f),$=N1.createNode(q,void 0,f);return new PK(K,$)}class PK{constructor(_,q=null){Object.defineProperty(this,KK.NODE_TYPE,{value:KK.PAIR}),this.key=_,this.value=q}clone(_){let{key:q,value:f}=this;if(KK.isNode(q))q=q.clone(_);if(KK.isNode(f))f=f.clone(_);return new PK(q,f)}toJSON(_,q){let f=q?.mapAsMap?new Map:{};return iG.addPairToJSMap(q,f,this)}toString(_,q,f){return _?.doc?yG.stringifyPair(this,_,q,f):JSON.stringify(this)}}cG.Pair=PK;cG.createPair=oG});var c3=p((BG)=>{var R8=Oq(),C1=J6(),jK=W6();function eG(_,q,f){return(q.inFlow??_.flow?sG:xG)(_,q,f)}function xG({comment:_,items:q},f,{blockItemPrefix:K,flowChars:$,itemIndent:P,onChompKeep:j,onComment:v}){let{indent:w,options:{commentString:O}}=f,T=Object.assign({},f,{indent:P,type:null}),Y=!1,z=[];for(let h=0;h<q.length;++h){let J=q[h],k=null;if(R8.isNode(J)){if(!Y&&J.spaceBefore)z.push("");if(vK(f,z,J.commentBefore,Y),J.comment)k=J.comment}else if(R8.isPair(J)){let l=R8.isNode(J.key)?J.key:null;if(l){if(!Y&&l.spaceBefore)z.push("");vK(f,z,l.commentBefore,Y)}}Y=!1;let X=C1.stringify(J,T,()=>k=null,()=>Y=!0);if(k)X+=jK.lineComment(X,P,O(k));if(Y&&k)Y=!1;z.push(K+X)}let H;if(z.length===0)H=$.start+$.end;else{H=z[0];for(let h=1;h<z.length;++h){let J=z[h];H+=J?`
|
|
71
|
+
${w}${J}`:`
|
|
72
|
+
`}}if(_){if(H+=`
|
|
73
|
+
`+jK.indentComment(O(_),w),v)v()}else if(Y&&j)j();return H}function sG({items:_},q,{flowChars:f,itemIndent:K}){let{indent:$,indentStep:P,flowCollectionPadding:j,options:{commentString:v}}=q;K+=P;let w=Object.assign({},q,{indent:K,inFlow:!0,type:null}),O=!1,T=0,Y=[];for(let h=0;h<_.length;++h){let J=_[h],k=null;if(R8.isNode(J)){if(J.spaceBefore)Y.push("");if(vK(q,Y,J.commentBefore,!1),J.comment)k=J.comment}else if(R8.isPair(J)){let l=R8.isNode(J.key)?J.key:null;if(l){if(l.spaceBefore)Y.push("");if(vK(q,Y,l.commentBefore,!1),l.comment)O=!0}let N=R8.isNode(J.value)?J.value:null;if(N){if(N.comment)k=N.comment;if(N.commentBefore)O=!0}else if(J.value==null&&l?.comment)k=l.comment}if(k)O=!0;let X=C1.stringify(J,w,()=>k=null);if(h<_.length-1)X+=",";if(k)X+=jK.lineComment(X,K,v(k));if(!O&&(Y.length>T||X.includes(`
|
|
74
|
+
`)))O=!0;Y.push(X),T=Y.length}let{start:z,end:H}=f;if(Y.length===0)return z+H;else{if(!O){let h=Y.reduce((J,k)=>J+k.length+2,2);O=q.options.lineWidth>0&&h>q.options.lineWidth}if(O){let h=z;for(let J of Y)h+=J?`
|
|
75
|
+
${P}${$}${J}`:`
|
|
76
|
+
`;return`${h}
|
|
77
|
+
${$}${H}`}else return`${z}${j}${Y.join(" ")}${j}${H}`}}function vK({indent:_,options:{commentString:q}},f,K,$){if(K&&$)K=K.replace(/^\n+/,"");if(K){let P=jK.indentComment(q(K),_);f.push(P.trimStart())}}BG.stringifyCollection=eG});var Y8=p((fm)=>{var FG=c3(),QG=o3(),qm=U$(),O8=Oq(),wK=w8(),_m=nq();function X6(_,q){let f=O8.isScalar(q)?q.value:q;for(let K of _)if(O8.isPair(K)){if(K.key===q||K.key===f)return K;if(O8.isScalar(K.key)&&K.key.value===f)return K}return}class p1 extends qm.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(_){super(O8.MAP,_);this.items=[]}static from(_,q,f){let{keepUndefined:K,replacer:$}=f,P=new this(_),j=(v,w)=>{if(typeof $==="function")w=$.call(q,v,w);else if(Array.isArray($)&&!$.includes(v))return;if(w!==void 0||K)P.items.push(wK.createPair(v,w,f))};if(q instanceof Map)for(let[v,w]of q)j(v,w);else if(q&&typeof q==="object")for(let v of Object.keys(q))j(v,q[v]);if(typeof _.sortMapEntries==="function")P.items.sort(_.sortMapEntries);return P}add(_,q){let f;if(O8.isPair(_))f=_;else if(!_||typeof _!=="object"||!("key"in _))f=new wK.Pair(_,_?.value);else f=new wK.Pair(_.key,_.value);let K=X6(this.items,f.key),$=this.schema?.sortMapEntries;if(K){if(!q)throw new Error(`Key ${f.key} already set`);if(O8.isScalar(K.value)&&_m.isScalarValue(f.value))K.value.value=f.value;else K.value=f.value}else if($){let P=this.items.findIndex((j)=>$(f,j)<0);if(P===-1)this.items.push(f);else this.items.splice(P,0,f)}else this.items.push(f)}delete(_){let q=X6(this.items,_);if(!q)return!1;return this.items.splice(this.items.indexOf(q),1).length>0}get(_,q){let K=X6(this.items,_)?.value;return(!q&&O8.isScalar(K)?K.value:K)??void 0}has(_){return!!X6(this.items,_)}set(_,q){this.add(new wK.Pair(_,q),!0)}toJSON(_,q,f){let K=f?new f:q?.mapAsMap?new Map:{};if(q?.onCreate)q.onCreate(K);for(let $ of this.items)QG.addPairToJSMap(q,K,$);return K}toString(_,q,f){if(!_)return JSON.stringify(this);for(let K of this.items)if(!O8.isPair(K))throw new Error(`Map items must all be pairs; found ${JSON.stringify(K)} instead`);if(!_.allNullValues&&this.hasAllNullValues(!1))_=Object.assign({},_,{allNullValues:!0});return FG.stringifyCollection(this,_,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:_.indent||"",onChompKeep:f,onComment:q})}}fm.YAMLMap=p1;fm.findPair=X6});var Gf=p((vm)=>{var Pm=Oq(),l1=Y8(),jm={collection:"map",default:!0,nodeClass:l1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(_,q){if(!Pm.isMap(_))q("Expected a mapping for this tag");return _},createNode:(_,q,f)=>l1.YAMLMap.from(_,q,f)};vm.map=jm});var T8=p((Hm)=>{var Om=z6(),Ym=c3(),Tm=U$(),YK=Oq(),zm=nq(),Wm=P8();class n1 extends Tm.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(_){super(YK.SEQ,_);this.items=[]}add(_){this.items.push(_)}delete(_){let q=OK(_);if(typeof q!=="number")return!1;return this.items.splice(q,1).length>0}get(_,q){let f=OK(_);if(typeof f!=="number")return;let K=this.items[f];return!q&&YK.isScalar(K)?K.value:K}has(_){let q=OK(_);return typeof q==="number"&&q<this.items.length}set(_,q){let f=OK(_);if(typeof f!=="number")throw new Error(`Expected a valid index, not ${_}.`);let K=this.items[f];if(YK.isScalar(K)&&zm.isScalarValue(q))K.value=q;else this.items[f]=q}toJSON(_,q){let f=[];if(q?.onCreate)q.onCreate(f);let K=0;for(let $ of this.items)f.push(Wm.toJS($,String(K++),q));return f}toString(_,q,f){if(!_)return JSON.stringify(this);return Ym.stringifyCollection(this,_,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(_.indent||"")+" ",onChompKeep:f,onComment:q})}static from(_,q,f){let{replacer:K}=f,$=new this(_);if(q&&Symbol.iterator in Object(q)){let P=0;for(let j of q){if(typeof K==="function"){let v=q instanceof Set?j:String(P++);j=K.call(q,v,j)}$.items.push(Om.createNode(j,void 0,f))}}return $}}function OK(_){let q=YK.isScalar(_)?_.value:_;if(q&&typeof q==="string")q=Number(q);return typeof q==="number"&&Number.isInteger(q)&&q>=0?q:null}Hm.YAMLSeq=n1});var mf=p((Zm)=>{var Jm=Oq(),R1=T8(),km={collection:"seq",default:!0,nodeClass:R1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(_,q){if(!Jm.isSeq(_))q("Expected a sequence for this tag");return _},createNode:(_,q,f)=>R1.YAMLSeq.from(_,q,f)};Zm.seq=km});var A6=p((Gm)=>{var Am=h6(),um={identify:(_)=>typeof _==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(_)=>_,stringify(_,q,f,K){return q=Object.assign({actualString:!0},q),Am.stringifyString(_,q,f,K)}};Gm.string=um});var TK=p((rm)=>{var E1=nq(),g1={identify:(_)=>_==null,createNode:()=>new E1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new E1.Scalar(null),stringify:({source:_},q)=>typeof _==="string"&&g1.test.test(_)?_:q.options.nullStr};rm.nullTag=g1});var L3=p((Mm)=>{var Vm=nq(),d1={identify:(_)=>typeof _==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(_)=>new Vm.Scalar(_[0]==="t"||_[0]==="T"),stringify({source:_,value:q},f){if(_&&d1.test.test(_)){let K=_[0]==="t"||_[0]==="T";if(q===K)return _}return q?f.options.trueStr:f.options.falseStr}};Mm.boolTag=d1});var rf=p((Cm)=>{function Nm({format:_,minFractionDigits:q,tag:f,value:K}){if(typeof K==="bigint")return String(K);let $=typeof K==="number"?K:Number(K);if(!isFinite($))return isNaN($)?".nan":$<0?"-.inf":".inf";let P=JSON.stringify(K);if(!_&&q&&(!f||f==="tag:yaml.org,2002:float")&&/^\d/.test(P)){let j=P.indexOf(".");if(j<0)j=P.length,P+=".";let v=q-(P.length-j-1);while(v-- >0)P+="0"}return P}Cm.stringifyNumber=Nm});var e3=p((gm)=>{var lm=nq(),t3=rf(),nm={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(_)=>_.slice(-3).toLowerCase()==="nan"?NaN:_[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t3.stringifyNumber},Rm={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(_)=>parseFloat(_),stringify(_){let q=Number(_.value);return isFinite(q)?q.toExponential():t3.stringifyNumber(_)}},Em={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(_){let q=new lm.Scalar(parseFloat(_)),f=_.indexOf(".");if(f!==-1&&_[_.length-1]==="0")q.minFractionDigits=_.length-f-1;return q},stringify:t3.stringifyNumber};gm.float=Em;gm.floatExp=Rm;gm.floatNaN=nm});var s3=p((om)=>{var a1=rf(),zK=(_)=>typeof _==="bigint"||Number.isInteger(_),x3=(_,q,f,{intAsBigInt:K})=>K?BigInt(_):parseInt(_.substring(q),f);function I1(_,q,f){let{value:K}=_;if(zK(K)&&K>=0)return f+K.toString(q);return a1.stringifyNumber(_)}var Dm={identify:(_)=>zK(_)&&_>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(_,q,f)=>x3(_,2,8,f),stringify:(_)=>I1(_,8,"0o")},ym={identify:zK,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(_,q,f)=>x3(_,0,10,f),stringify:a1.stringifyNumber},im={identify:(_)=>zK(_)&&_>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(_,q,f)=>x3(_,2,16,f),stringify:(_)=>I1(_,16,"0x")};om.int=ym;om.intHex=im;om.intOct=Dm});var D1=p((Qm)=>{var em=Gf(),xm=TK(),sm=mf(),Bm=A6(),Um=L3(),B3=e3(),U3=s3(),Fm=[em.map,sm.seq,Bm.string,xm.nullTag,Um.boolTag,U3.intOct,U3.int,U3.intHex,B3.floatNaN,B3.floatExp,B3.float];Qm.schema=Fm});var i1=p((vr)=>{var _r=nq(),fr=Gf(),$r=mf();function y1(_){return typeof _==="bigint"||Number.isInteger(_)}var WK=({value:_})=>JSON.stringify(_),Kr=[{identify:(_)=>typeof _==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(_)=>_,stringify:WK},{identify:(_)=>_==null,createNode:()=>new _r.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:WK},{identify:(_)=>typeof _==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(_)=>_==="true",stringify:WK},{identify:y1,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(_,q,{intAsBigInt:f})=>f?BigInt(_):parseInt(_,10),stringify:({value:_})=>y1(_)?_.toString():JSON.stringify(_)},{identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(_)=>parseFloat(_),stringify:WK}],Pr={default:!0,tag:"",test:/^/,resolve(_,q){return q(`Unresolved plain scalar ${JSON.stringify(_)}`),_}},jr=[fr.map,$r.seq].concat(Kr,Pr);vr.schema=jr});var Q3=p((Tr)=>{var u6=a_("buffer"),F3=nq(),Or=h6(),Yr={identify:(_)=>_ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(_,q){if(typeof u6.Buffer==="function")return u6.Buffer.from(_,"base64");else if(typeof atob==="function"){let f=atob(_.replace(/[\n\r]/g,"")),K=new Uint8Array(f.length);for(let $=0;$<f.length;++$)K[$]=f.charCodeAt($);return K}else return q("This environment does not support reading binary tags; either Buffer or atob is required"),_},stringify({comment:_,type:q,value:f},K,$,P){if(!f)return"";let j=f,v;if(typeof u6.Buffer==="function")v=j instanceof u6.Buffer?j.toString("base64"):u6.Buffer.from(j.buffer).toString("base64");else if(typeof btoa==="function"){let w="";for(let O=0;O<j.length;++O)w+=String.fromCharCode(j[O]);v=btoa(w)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(q??(q=F3.Scalar.BLOCK_LITERAL),q!==F3.Scalar.QUOTE_DOUBLE){let w=Math.max(K.options.lineWidth-K.indent.length,K.options.minContentWidth),O=Math.ceil(v.length/w),T=new Array(O);for(let Y=0,z=0;Y<O;++Y,z+=w)T[Y]=v.substr(z,w);v=T.join(q===F3.Scalar.BLOCK_LITERAL?`
|
|
78
|
+
`:" ")}return Or.stringifyString({comment:_,type:q,value:v},K,$,P)}};Tr.binary=Yr});var hK=p((Jr)=>{var HK=Oq(),q4=w8(),Wr=nq(),Hr=T8();function o1(_,q){if(HK.isSeq(_))for(let f=0;f<_.items.length;++f){let K=_.items[f];if(HK.isPair(K))continue;else if(HK.isMap(K)){if(K.items.length>1)q("Each pair must have its own sequence indicator");let $=K.items[0]||new q4.Pair(new Wr.Scalar(null));if(K.commentBefore)$.key.commentBefore=$.key.commentBefore?`${K.commentBefore}
|
|
79
|
+
${$.key.commentBefore}`:K.commentBefore;if(K.comment){let P=$.value??$.key;P.comment=P.comment?`${K.comment}
|
|
80
|
+
${P.comment}`:K.comment}K=$}_.items[f]=HK.isPair(K)?K:new q4.Pair(K)}else q("Expected a sequence for this tag");return _}function c1(_,q,f){let{replacer:K}=f,$=new Hr.YAMLSeq(_);$.tag="tag:yaml.org,2002:pairs";let P=0;if(q&&Symbol.iterator in Object(q))for(let j of q){if(typeof K==="function")j=K.call(q,String(P++),j);let v,w;if(Array.isArray(j))if(j.length===2)v=j[0],w=j[1];else throw new TypeError(`Expected [key, value] tuple: ${j}`);else if(j&&j instanceof Object){let O=Object.keys(j);if(O.length===1)v=O[0],w=j[v];else throw new TypeError(`Expected tuple with one key, not ${O.length} keys`)}else v=j;$.items.push(q4.createPair(v,w,f))}return $}var hr={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:o1,createNode:c1};Jr.createPairs=c1;Jr.pairs=hr;Jr.resolvePairs=o1});var f4=p((Gr)=>{var L1=Oq(),_4=P8(),G6=Y8(),Ar=T8(),t1=hK();class E8 extends Ar.YAMLSeq{constructor(){super();this.add=G6.YAMLMap.prototype.add.bind(this),this.delete=G6.YAMLMap.prototype.delete.bind(this),this.get=G6.YAMLMap.prototype.get.bind(this),this.has=G6.YAMLMap.prototype.has.bind(this),this.set=G6.YAMLMap.prototype.set.bind(this),this.tag=E8.tag}toJSON(_,q){if(!q)return super.toJSON(_);let f=new Map;if(q?.onCreate)q.onCreate(f);for(let K of this.items){let $,P;if(L1.isPair(K))$=_4.toJS(K.key,"",q),P=_4.toJS(K.value,$,q);else $=_4.toJS(K,"",q);if(f.has($))throw new Error("Ordered maps must not include duplicate keys");f.set($,P)}return f}static from(_,q,f){let K=t1.createPairs(_,q,f),$=new this;return $.items=K.items,$}}E8.tag="tag:yaml.org,2002:omap";var ur={collection:"seq",identify:(_)=>_ instanceof Map,nodeClass:E8,default:!1,tag:"tag:yaml.org,2002:omap",resolve(_,q){let f=t1.resolvePairs(_,q),K=[];for(let{key:$}of f.items)if(L1.isScalar($))if(K.includes($.value))q(`Ordered maps must not include duplicate keys: ${$.value}`);else K.push($.value);return Object.assign(new E8,f)},createNode:(_,q,f)=>E8.from(_,q,f)};Gr.YAMLOMap=E8;Gr.omap=ur});var U1=p((br)=>{var e1=nq();function x1({value:_,source:q},f){if(q&&(_?s1:B1).test.test(q))return q;return _?f.options.trueStr:f.options.falseStr}var s1={identify:(_)=>_===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new e1.Scalar(!0),stringify:x1},B1={identify:(_)=>_===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new e1.Scalar(!1),stringify:x1};br.falseTag=B1;br.trueTag=s1});var F1=p((lr)=>{var Sr=nq(),$4=rf(),Nr={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(_)=>_.slice(-3).toLowerCase()==="nan"?NaN:_[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$4.stringifyNumber},Cr={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(_)=>parseFloat(_.replace(/_/g,"")),stringify(_){let q=Number(_.value);return isFinite(q)?q.toExponential():$4.stringifyNumber(_)}},pr={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(_){let q=new Sr.Scalar(parseFloat(_.replace(/_/g,""))),f=_.indexOf(".");if(f!==-1){let K=_.substring(f+1).replace(/_/g,"");if(K[K.length-1]==="0")q.minFractionDigits=K.length}return q},stringify:$4.stringifyNumber};lr.float=pr;lr.floatExp=Cr;lr.floatNaN=Nr});var q2=p((Dr)=>{var Q1=rf(),m6=(_)=>typeof _==="bigint"||Number.isInteger(_);function JK(_,q,f,{intAsBigInt:K}){let $=_[0];if($==="-"||$==="+")q+=1;if(_=_.substring(q).replace(/_/g,""),K){switch(f){case 2:_=`0b${_}`;break;case 8:_=`0o${_}`;break;case 16:_=`0x${_}`;break}let j=BigInt(_);return $==="-"?BigInt(-1)*j:j}let P=parseInt(_,f);return $==="-"?-1*P:P}function K4(_,q,f){let{value:K}=_;if(m6(K)){let $=K.toString(q);return K<0?"-"+f+$.substr(1):f+$}return Q1.stringifyNumber(_)}var gr={identify:m6,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(_,q,f)=>JK(_,2,2,f),stringify:(_)=>K4(_,2,"0b")},dr={identify:m6,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(_,q,f)=>JK(_,1,8,f),stringify:(_)=>K4(_,8,"0")},ar={identify:m6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(_,q,f)=>JK(_,0,10,f),stringify:Q1.stringifyNumber},Ir={identify:m6,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(_,q,f)=>JK(_,2,16,f),stringify:(_)=>K4(_,16,"0x")};Dr.int=ar;Dr.intBin=gr;Dr.intHex=Ir;Dr.intOct=dr});var P4=p((tr)=>{var XK=Oq(),kK=w8(),ZK=Y8();class g8 extends ZK.YAMLMap{constructor(_){super(_);this.tag=g8.tag}add(_){let q;if(XK.isPair(_))q=_;else if(_&&typeof _==="object"&&"key"in _&&"value"in _&&_.value===null)q=new kK.Pair(_.key,null);else q=new kK.Pair(_,null);if(!ZK.findPair(this.items,q.key))this.items.push(q)}get(_,q){let f=ZK.findPair(this.items,_);return!q&&XK.isPair(f)?XK.isScalar(f.key)?f.key.value:f.key:f}set(_,q){if(typeof q!=="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof q}`);let f=ZK.findPair(this.items,_);if(f&&!q)this.items.splice(this.items.indexOf(f),1);else if(!f&&q)this.items.push(new kK.Pair(_))}toJSON(_,q){return super.toJSON(_,q,Set)}toString(_,q,f){if(!_)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},_,{allNullValues:!0}),q,f);else throw new Error("Set items must all have null values")}static from(_,q,f){let{replacer:K}=f,$=new this(_);if(q&&Symbol.iterator in Object(q))for(let P of q){if(typeof K==="function")P=K.call(q,P,P);$.items.push(kK.createPair(P,null,f))}return $}}g8.tag="tag:yaml.org,2002:set";var Lr={collection:"map",identify:(_)=>_ instanceof Set,nodeClass:g8,default:!1,tag:"tag:yaml.org,2002:set",createNode:(_,q,f)=>g8.from(_,q,f),resolve(_,q){if(XK.isMap(_))if(_.hasAllNullValues(!0))return Object.assign(new g8,_);else q("Set items must all have null values");else q("Expected a mapping for this tag");return _}};tr.YAMLSet=g8;tr.set=Lr});var v4=p((Fr)=>{var sr=rf();function j4(_,q){let f=_[0],K=f==="-"||f==="+"?_.substring(1):_,$=(j)=>q?BigInt(j):Number(j),P=K.replace(/_/g,"").split(":").reduce((j,v)=>j*$(60)+$(v),$(0));return f==="-"?$(-1)*P:P}function _2(_){let{value:q}=_,f=(j)=>j;if(typeof q==="bigint")f=(j)=>BigInt(j);else if(isNaN(q)||!isFinite(q))return sr.stringifyNumber(_);let K="";if(q<0)K="-",q*=f(-1);let $=f(60),P=[q%$];if(q<60)P.unshift(0);else if(q=(q-P[0])/$,P.unshift(q%$),q>=60)q=(q-P[0])/$,P.unshift(q);return K+P.map((j)=>String(j).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Br={identify:(_)=>typeof _==="bigint"||Number.isInteger(_),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(_,q,{intAsBigInt:f})=>j4(_,f),stringify:_2},Ur={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(_)=>j4(_,!1),stringify:_2},f2={identify:(_)=>_ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(_){let q=_.match(f2.test);if(!q)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,f,K,$,P,j,v]=q.map(Number),w=q[7]?Number((q[7]+"00").substr(1,3)):0,O=Date.UTC(f,K-1,$,P||0,j||0,v||0,w),T=q[8];if(T&&T!=="Z"){let Y=j4(T,!1);if(Math.abs(Y)<30)Y*=60;O-=60000*Y}return new Date(O)},stringify:({value:_})=>_?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Fr.floatTime=Ur;Fr.intTime=Br;Fr.timestamp=f2});var K2=p((zb)=>{var fb=Gf(),$b=TK(),Kb=mf(),Pb=A6(),jb=Q3(),$2=U1(),w4=F1(),AK=q2(),vb=$K(),wb=f4(),Ob=hK(),Yb=P4(),O4=v4(),Tb=[fb.map,Kb.seq,Pb.string,$b.nullTag,$2.trueTag,$2.falseTag,AK.intBin,AK.intOct,AK.int,AK.intHex,w4.floatNaN,w4.floatExp,w4.float,jb.binary,vb.merge,wb.omap,Ob.pairs,Yb.set,O4.intTime,O4.floatTime,O4.timestamp];zb.schema=Tb});var H2=p((ub)=>{var w2=Gf(),Hb=TK(),O2=mf(),hb=A6(),Jb=L3(),Y4=e3(),T4=s3(),kb=D1(),Zb=i1(),Y2=Q3(),r6=$K(),T2=f4(),z2=hK(),P2=K2(),W2=P4(),uK=v4(),j2=new Map([["core",kb.schema],["failsafe",[w2.map,O2.seq,hb.string]],["json",Zb.schema],["yaml11",P2.schema],["yaml-1.1",P2.schema]]),v2={binary:Y2.binary,bool:Jb.boolTag,float:Y4.float,floatExp:Y4.floatExp,floatNaN:Y4.floatNaN,floatTime:uK.floatTime,int:T4.int,intHex:T4.intHex,intOct:T4.intOct,intTime:uK.intTime,map:w2.map,merge:r6.merge,null:Hb.nullTag,omap:T2.omap,pairs:z2.pairs,seq:O2.seq,set:W2.set,timestamp:uK.timestamp},Xb={"tag:yaml.org,2002:binary":Y2.binary,"tag:yaml.org,2002:merge":r6.merge,"tag:yaml.org,2002:omap":T2.omap,"tag:yaml.org,2002:pairs":z2.pairs,"tag:yaml.org,2002:set":W2.set,"tag:yaml.org,2002:timestamp":uK.timestamp};function Ab(_,q,f){let K=j2.get(q);if(K&&!_)return f&&!K.includes(r6.merge)?K.concat(r6.merge):K.slice();let $=K;if(!$)if(Array.isArray(_))$=[];else{let P=Array.from(j2.keys()).filter((j)=>j!=="yaml11").map((j)=>JSON.stringify(j)).join(", ");throw new Error(`Unknown schema "${q}"; use one of ${P} or define customTags array`)}if(Array.isArray(_))for(let P of _)$=$.concat(P);else if(typeof _==="function")$=_($.slice());if(f)$=$.concat(r6.merge);return $.reduce((P,j)=>{let v=typeof j==="string"?v2[j]:j;if(!v){let w=JSON.stringify(j),O=Object.keys(v2).map((T)=>JSON.stringify(T)).join(", ");throw new Error(`Unknown custom tag ${w}; use one of ${O}`)}if(!P.includes(v))P.push(v);return P},[])}ub.coreKnownTags=Xb;ub.getTags=Ab});var H4=p((Sb)=>{var z4=Oq(),rb=Gf(),bb=mf(),Vb=A6(),GK=H2(),Mb=(_,q)=>_.key<q.key?-1:_.key>q.key?1:0;class W4{constructor({compat:_,customTags:q,merge:f,resolveKnownTags:K,schema:$,sortMapEntries:P,toStringDefaults:j}){this.compat=Array.isArray(_)?GK.getTags(_,"compat"):_?GK.getTags(null,_):null,this.name=typeof $==="string"&&$||"core",this.knownTags=K?GK.coreKnownTags:{},this.tags=GK.getTags(q,this.name,f),this.toStringOptions=j??null,Object.defineProperty(this,z4.MAP,{value:rb.map}),Object.defineProperty(this,z4.SCALAR,{value:Vb.string}),Object.defineProperty(this,z4.SEQ,{value:bb.seq}),this.sortMapEntries=typeof P==="function"?P:P===!0?Mb:null}clone(){let _=Object.create(W4.prototype,Object.getOwnPropertyDescriptors(this));return _.tags=this.tags.slice(),_}}Sb.Schema=W4});var h2=p((lb)=>{var Cb=Oq(),h4=J6(),b6=W6();function pb(_,q){let f=[],K=q.directives===!0;if(q.directives!==!1&&_.directives){let w=_.directives.toString(_);if(w)f.push(w),K=!0;else if(_.directives.docStart)K=!0}if(K)f.push("---");let $=h4.createStringifyContext(_,q),{commentString:P}=$.options;if(_.commentBefore){if(f.length!==1)f.unshift("");let w=P(_.commentBefore);f.unshift(b6.indentComment(w,""))}let j=!1,v=null;if(_.contents){if(Cb.isNode(_.contents)){if(_.contents.spaceBefore&&K)f.push("");if(_.contents.commentBefore){let T=P(_.contents.commentBefore);f.push(b6.indentComment(T,""))}$.forceBlockIndent=!!_.comment,v=_.contents.comment}let w=v?void 0:()=>j=!0,O=h4.stringify(_.contents,$,()=>v=null,w);if(v)O+=b6.lineComment(O,"",P(v));if((O[0]==="|"||O[0]===">")&&f[f.length-1]==="---")f[f.length-1]=`--- ${O}`;else f.push(O)}else f.push(h4.stringify(_.contents,$));if(_.directives?.docEnd)if(_.comment){let w=P(_.comment);if(w.includes(`
|
|
81
|
+
`))f.push("..."),f.push(b6.indentComment(w,""));else f.push(`... ${w}`)}else f.push("...");else{let w=_.comment;if(w&&j)w=w.replace(/^\n+/,"");if(w){if((!j||v)&&f[f.length-1]!=="")f.push("");f.push(b6.indentComment(P(w),""))}}return f.join(`
|
|
82
|
+
`)+`
|
|
83
|
+
`}lb.stringifyDocument=pb});var V6=p((yb)=>{var Rb=T6(),bf=U$(),O_=Oq(),Eb=w8(),gb=P8(),db=H4(),ab=h2(),J4=x$(),Ib=E3(),Db=z6(),k4=R3();class Z4{constructor(_,q,f){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,O_.NODE_TYPE,{value:O_.DOC});let K=null;if(typeof q==="function"||Array.isArray(q))K=q;else if(f===void 0&&q)f=q,q=void 0;let $=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},f);this.options=$;let{version:P}=$;if(f?._directives){if(this.directives=f._directives.atDocument(),this.directives.yaml.explicit)P=this.directives.yaml.version}else this.directives=new k4.Directives({version:P});this.setSchema(P,f),this.contents=_===void 0?null:this.createNode(_,K,f)}clone(){let _=Object.create(Z4.prototype,{[O_.NODE_TYPE]:{value:O_.DOC}});if(_.commentBefore=this.commentBefore,_.comment=this.comment,_.errors=this.errors.slice(),_.warnings=this.warnings.slice(),_.options=Object.assign({},this.options),this.directives)_.directives=this.directives.clone();if(_.schema=this.schema.clone(),_.contents=O_.isNode(this.contents)?this.contents.clone(_.schema):this.contents,this.range)_.range=this.range.slice();return _}add(_){if(Vf(this.contents))this.contents.add(_)}addIn(_,q){if(Vf(this.contents))this.contents.addIn(_,q)}createAlias(_,q){if(!_.anchor){let f=J4.anchorNames(this);_.anchor=!q||f.has(q)?J4.findNewAnchor(q||"a",f):q}return new Rb.Alias(_.anchor)}createNode(_,q,f){let K=void 0;if(typeof q==="function")_=q.call({"":_},"",_),K=q;else if(Array.isArray(q)){let J=(X)=>typeof X==="number"||X instanceof String||X instanceof Number,k=q.filter(J).map(String);if(k.length>0)q=q.concat(k);K=q}else if(f===void 0&&q)f=q,q=void 0;let{aliasDuplicateObjects:$,anchorPrefix:P,flow:j,keepUndefined:v,onTagObj:w,tag:O}=f??{},{onAnchor:T,setAnchors:Y,sourceObjects:z}=J4.createNodeAnchors(this,P||"a"),H={aliasDuplicateObjects:$??!0,keepUndefined:v??!1,onAnchor:T,onTagObj:w,replacer:K,schema:this.schema,sourceObjects:z},h=Db.createNode(_,O,H);if(j&&O_.isCollection(h))h.flow=!0;return Y(),h}createPair(_,q,f={}){let K=this.createNode(_,null,f),$=this.createNode(q,null,f);return new Eb.Pair(K,$)}delete(_){return Vf(this.contents)?this.contents.delete(_):!1}deleteIn(_){if(bf.isEmptyPath(_)){if(this.contents==null)return!1;return this.contents=null,!0}return Vf(this.contents)?this.contents.deleteIn(_):!1}get(_,q){return O_.isCollection(this.contents)?this.contents.get(_,q):void 0}getIn(_,q){if(bf.isEmptyPath(_))return!q&&O_.isScalar(this.contents)?this.contents.value:this.contents;return O_.isCollection(this.contents)?this.contents.getIn(_,q):void 0}has(_){return O_.isCollection(this.contents)?this.contents.has(_):!1}hasIn(_){if(bf.isEmptyPath(_))return this.contents!==void 0;return O_.isCollection(this.contents)?this.contents.hasIn(_):!1}set(_,q){if(this.contents==null)this.contents=bf.collectionFromPath(this.schema,[_],q);else if(Vf(this.contents))this.contents.set(_,q)}setIn(_,q){if(bf.isEmptyPath(_))this.contents=q;else if(this.contents==null)this.contents=bf.collectionFromPath(this.schema,Array.from(_),q);else if(Vf(this.contents))this.contents.setIn(_,q)}setSchema(_,q={}){if(typeof _==="number")_=String(_);let f;switch(_){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new k4.Directives({version:"1.1"});f={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=_;else this.directives=new k4.Directives({version:_});f={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;f=null;break;default:{let K=JSON.stringify(_);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${K}`)}}if(q.schema instanceof Object)this.schema=q.schema;else if(f)this.schema=new db.Schema(Object.assign(f,q));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:_,jsonArg:q,mapAsMap:f,maxAliasCount:K,onAnchor:$,reviver:P}={}){let j={anchors:new Map,doc:this,keep:!_,mapAsMap:f===!0,mapKeyWarned:!1,maxAliasCount:typeof K==="number"?K:100},v=gb.toJS(this.contents,q??"",j);if(typeof $==="function")for(let{count:w,res:O}of j.anchors.values())$(O,w);return typeof P==="function"?Ib.applyReviver(P,{"":v},"",v):v}toJSON(_,q){return this.toJS({json:!0,jsonArg:_,mapAsMap:!1,onAnchor:q})}toString(_={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in _&&(!Number.isInteger(_.indent)||Number(_.indent)<=0)){let q=JSON.stringify(_.indent);throw new Error(`"indent" option must be a positive integer, not ${q}`)}return ab.stringifyDocument(this,_)}}function Vf(_){if(O_.isCollection(_))return!0;throw new Error("Expected a YAML collection as document contents")}yb.Document=Z4});var M6=p((cb)=>{class mK extends Error{constructor(_,q,f,K){super();this.name=_,this.code=f,this.message=K,this.pos=q}}class J2 extends mK{constructor(_,q,f){super("YAMLParseError",_,q,f)}}class k2 extends mK{constructor(_,q,f){super("YAMLWarning",_,q,f)}}var ob=(_,q)=>(f)=>{if(f.pos[0]===-1)return;f.linePos=f.pos.map((v)=>q.linePos(v));let{line:K,col:$}=f.linePos[0];f.message+=` at line ${K}, column ${$}`;let P=$-1,j=_.substring(q.lineStarts[K-1],q.lineStarts[K]).replace(/[\n\r]+$/,"");if(P>=60&&j.length>80){let v=Math.min(P-39,j.length-79);j="\u2026"+j.substring(v),P-=v-1}if(j.length>80)j=j.substring(0,79)+"\u2026";if(K>1&&/^ *$/.test(j.substring(0,P))){let v=_.substring(q.lineStarts[K-2],q.lineStarts[K-1]);if(v.length>80)v=v.substring(0,79)+`\u2026
|
|
84
|
+
`;j=v+j}if(/[^ ]/.test(j)){let v=1,w=f.linePos[1];if(w&&w.line===K&&w.col>$)v=Math.max(1,Math.min(w.col-$,80-P));let O=" ".repeat(P)+"^".repeat(v);f.message+=`:
|
|
85
|
+
|
|
86
|
+
${j}
|
|
87
|
+
${O}
|
|
88
|
+
`}};cb.YAMLError=mK;cb.YAMLParseError=J2;cb.YAMLWarning=k2;cb.prettifyError=ob});var S6=p((Bb)=>{function sb(_,{flow:q,indicator:f,next:K,offset:$,onError:P,parentIndent:j,startOnNewline:v}){let w=!1,O=v,T=v,Y="",z="",H=!1,h=!1,J=null,k=null,X=null,l=null,N=null,n=null,R=null;for(let M of _){if(h){if(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma")P(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");h=!1}if(J){if(O&&M.type!=="comment"&&M.type!=="newline")P(J,"TAB_AS_INDENT","Tabs are not allowed as indentation");J=null}switch(M.type){case"space":if(!q&&(f!=="doc-start"||K?.type!=="flow-collection")&&M.source.includes("\t"))J=M;T=!0;break;case"comment":{if(!T)P(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=M.source.substring(1)||" ";if(!Y)Y=C;else Y+=z+C;z="",O=!1;break}case"newline":if(O){if(Y)Y+=M.source;else if(!n||f!=="seq-item-ind")w=!0}else z+=M.source;if(O=!0,H=!0,k||X)l=M;T=!0;break;case"anchor":if(k)P(M,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(M.source.endsWith(":"))P(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);k=M,R??(R=M.offset),O=!1,T=!1,h=!0;break;case"tag":{if(X)P(M,"MULTIPLE_TAGS","A node can have at most one tag");X=M,R??(R=M.offset),O=!1,T=!1,h=!0;break}case f:if(k||X)P(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`);if(n)P(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${q??"collection"}`);n=M,O=f==="seq-item-ind"||f==="explicit-key-ind",T=!1;break;case"comma":if(q){if(N)P(M,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`);N=M,O=!1,T=!1;break}default:P(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),O=!1,T=!1}}let g=_[_.length-1],V=g?g.offset+g.source.length:$;if(h&&K&&K.type!=="space"&&K.type!=="newline"&&K.type!=="comma"&&(K.type!=="scalar"||K.source!==""))P(K.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(J&&(O&&J.indent<=j||K?.type==="block-map"||K?.type==="block-seq"))P(J,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:N,found:n,spaceBefore:w,comment:Y,hasNewline:H,anchor:k,tag:X,newlineAfterProp:l,end:V,start:R??V}}Bb.resolveProps=sb});var rK=p((Fb)=>{function X4(_){if(!_)return null;switch(_.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(_.source.includes(`
|
|
89
|
+
`))return!0;if(_.end){for(let q of _.end)if(q.type==="newline")return!0}return!1;case"flow-collection":for(let q of _.items){for(let f of q.start)if(f.type==="newline")return!0;if(q.sep){for(let f of q.sep)if(f.type==="newline")return!0}if(X4(q.key)||X4(q.value))return!0}return!1;default:return!0}}Fb.containsNewline=X4});var A4=p((fV)=>{var qV=rK();function _V(_,q,f){if(q?.type==="flow-collection"){let K=q.end[0];if(K.indent===_&&(K.source==="]"||K.source==="}")&&qV.containsNewline(q))f(K,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}fV.flowIndentCheck=_V});var u4=p((PV)=>{var Z2=Oq();function KV(_,q,f){let{uniqueKeys:K}=_.options;if(K===!1)return!1;let $=typeof K==="function"?K:(P,j)=>P===j||Z2.isScalar(P)&&Z2.isScalar(j)&&P.value===j.value;return q.some((P)=>$(P.key,f))}PV.mapIncludes=KV});var m2=p((TV)=>{var X2=w8(),vV=Y8(),A2=S6(),wV=rK(),u2=A4(),OV=u4(),G2="All mapping items must start at the same column";function YV({composeNode:_,composeEmptyNode:q},f,K,$,P){let v=new(P?.nodeClass??vV.YAMLMap)(f.schema);if(f.atRoot)f.atRoot=!1;let w=K.offset,O=null;for(let T of K.items){let{start:Y,key:z,sep:H,value:h}=T,J=A2.resolveProps(Y,{indicator:"explicit-key-ind",next:z??H?.[0],offset:w,onError:$,parentIndent:K.indent,startOnNewline:!0}),k=!J.found;if(k){if(z){if(z.type==="block-seq")$(w,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in z&&z.indent!==K.indent)$(w,"BAD_INDENT",G2)}if(!J.anchor&&!J.tag&&!H){if(O=J.end,J.comment)if(v.comment)v.comment+=`
|
|
90
|
+
`+J.comment;else v.comment=J.comment;continue}if(J.newlineAfterProp||wV.containsNewline(z))$(z??Y[Y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(J.found?.indent!==K.indent)$(w,"BAD_INDENT",G2);f.atKey=!0;let X=J.end,l=z?_(f,z,J,$):q(f,X,Y,null,J,$);if(f.schema.compat)u2.flowIndentCheck(K.indent,z,$);if(f.atKey=!1,OV.mapIncludes(f,v.items,l))$(X,"DUPLICATE_KEY","Map keys must be unique");let N=A2.resolveProps(H??[],{indicator:"map-value-ind",next:h,offset:l.range[2],onError:$,parentIndent:K.indent,startOnNewline:!z||z.type==="block-scalar"});if(w=N.end,N.found){if(k){if(h?.type==="block-map"&&!N.hasNewline)$(w,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(f.options.strict&&J.start<N.found.offset-1024)$(l.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let n=h?_(f,h,N,$):q(f,w,H,null,N,$);if(f.schema.compat)u2.flowIndentCheck(K.indent,h,$);w=n.range[2];let R=new X2.Pair(l,n);if(f.options.keepSourceTokens)R.srcToken=T;v.items.push(R)}else{if(k)$(l.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(N.comment)if(l.comment)l.comment+=`
|
|
91
|
+
`+N.comment;else l.comment=N.comment;let n=new X2.Pair(l);if(f.options.keepSourceTokens)n.srcToken=T;v.items.push(n)}}if(O&&O<w)$(O,"IMPOSSIBLE","Map comment with trailing content");return v.range=[K.offset,w,O??w],v}TV.resolveBlockMap=YV});var r2=p((kV)=>{var WV=T8(),HV=S6(),hV=A4();function JV({composeNode:_,composeEmptyNode:q},f,K,$,P){let v=new(P?.nodeClass??WV.YAMLSeq)(f.schema);if(f.atRoot)f.atRoot=!1;if(f.atKey)f.atKey=!1;let w=K.offset,O=null;for(let{start:T,value:Y}of K.items){let z=HV.resolveProps(T,{indicator:"seq-item-ind",next:Y,offset:w,onError:$,parentIndent:K.indent,startOnNewline:!0});if(!z.found)if(z.anchor||z.tag||Y)if(Y&&Y.type==="block-seq")$(z.end,"BAD_INDENT","All sequence items must start at the same column");else $(w,"MISSING_CHAR","Sequence item without - indicator");else{if(O=z.end,z.comment)v.comment=z.comment;continue}let H=Y?_(f,Y,z,$):q(f,z.end,T,null,z,$);if(f.schema.compat)hV.flowIndentCheck(K.indent,Y,$);w=H.range[2],v.items.push(H)}return v.range=[K.offset,w,O??w],v}kV.resolveBlockSeq=JV});var Mf=p((AV)=>{function XV(_,q,f,K){let $="";if(_){let P=!1,j="";for(let v of _){let{source:w,type:O}=v;switch(O){case"space":P=!0;break;case"comment":{if(f&&!P)K(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=w.substring(1)||" ";if(!$)$=T;else $+=j+T;j="";break}case"newline":if($)j+=w;P=!0;break;default:K(v,"UNEXPECTED_TOKEN",`Unexpected ${O} at node end`)}q+=w.length}}return{comment:$,offset:q}}AV.resolveEnd=XV});var M2=p((NV)=>{var GV=Oq(),mV=w8(),b2=Y8(),rV=T8(),bV=Mf(),V2=S6(),VV=rK(),MV=u4(),G4="Block collections are not allowed within flow collections",m4=(_)=>_&&(_.type==="block-map"||_.type==="block-seq");function SV({composeNode:_,composeEmptyNode:q},f,K,$,P){let j=K.start.source==="{",v=j?"flow map":"flow sequence",O=new(P?.nodeClass??(j?b2.YAMLMap:rV.YAMLSeq))(f.schema);O.flow=!0;let T=f.atRoot;if(T)f.atRoot=!1;if(f.atKey)f.atKey=!1;let Y=K.offset+K.start.source.length;for(let k=0;k<K.items.length;++k){let X=K.items[k],{start:l,key:N,sep:n,value:R}=X,g=V2.resolveProps(l,{flow:v,indicator:"explicit-key-ind",next:N??n?.[0],offset:Y,onError:$,parentIndent:K.indent,startOnNewline:!1});if(!g.found){if(!g.anchor&&!g.tag&&!n&&!R){if(k===0&&g.comma)$(g.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${v}`);else if(k<K.items.length-1)$(g.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${v}`);if(g.comment)if(O.comment)O.comment+=`
|
|
92
|
+
`+g.comment;else O.comment=g.comment;Y=g.end;continue}if(!j&&f.options.strict&&VV.containsNewline(N))$(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(k===0){if(g.comma)$(g.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${v}`)}else{if(!g.comma)$(g.start,"MISSING_CHAR",`Missing , between ${v} items`);if(g.comment){let V="";q:for(let M of l)switch(M.type){case"comma":case"space":break;case"comment":V=M.source.substring(1);break q;default:break q}if(V){let M=O.items[O.items.length-1];if(GV.isPair(M))M=M.value??M.key;if(M.comment)M.comment+=`
|
|
93
|
+
`+V;else M.comment=V;g.comment=g.comment.substring(V.length+1)}}}if(!j&&!n&&!g.found){let V=R?_(f,R,g,$):q(f,g.end,n,null,g,$);if(O.items.push(V),Y=V.range[2],m4(R))$(V.range,"BLOCK_IN_FLOW",G4)}else{f.atKey=!0;let V=g.end,M=N?_(f,N,g,$):q(f,V,l,null,g,$);if(m4(N))$(M.range,"BLOCK_IN_FLOW",G4);f.atKey=!1;let C=V2.resolveProps(n??[],{flow:v,indicator:"map-value-ind",next:R,offset:M.range[2],onError:$,parentIndent:K.indent,startOnNewline:!1});if(C.found){if(!j&&!g.found&&f.options.strict){if(n)for(let A of n){if(A===C.found)break;if(A.type==="newline"){$(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(g.start<C.found.offset-1024)$(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(R)if("source"in R&&R.source&&R.source[0]===":")$(R,"MISSING_CHAR",`Missing space after : in ${v}`);else $(C.start,"MISSING_CHAR",`Missing , or : between ${v} items`);let a=R?_(f,R,C,$):C.found?q(f,C.end,n,null,C,$):null;if(a){if(m4(R))$(a.range,"BLOCK_IN_FLOW",G4)}else if(C.comment)if(M.comment)M.comment+=`
|
|
94
|
+
`+C.comment;else M.comment=C.comment;let r=new mV.Pair(M,a);if(f.options.keepSourceTokens)r.srcToken=X;if(j){let A=O;if(MV.mapIncludes(f,A.items,M))$(V,"DUPLICATE_KEY","Map keys must be unique");A.items.push(r)}else{let A=new b2.YAMLMap(f.schema);A.flow=!0,A.items.push(r);let u=(a??M).range;A.range=[M.range[0],u[1],u[2]],O.items.push(A)}Y=a?a.range[2]:C.end}}let z=j?"}":"]",[H,...h]=K.end,J=Y;if(H&&H.source===z)J=H.offset+H.source.length;else{let k=v[0].toUpperCase()+v.substring(1),X=T?`${k} must end with a ${z}`:`${k} in block collection must be sufficiently indented and end with a ${z}`;if($(Y,T?"MISSING_CHAR":"BAD_INDENT",X),H&&H.source.length!==1)h.unshift(H)}if(h.length>0){let k=bV.resolveEnd(h,J,f.options.strict,$);if(k.comment)if(O.comment)O.comment+=`
|
|
95
|
+
`+k.comment;else O.comment=k.comment;O.range=[K.offset,J,k.offset]}else O.range=[K.offset,J,J];return O}NV.resolveFlowCollection=SV});var S2=p((IV)=>{var pV=Oq(),lV=nq(),nV=Y8(),RV=T8(),EV=m2(),gV=r2(),dV=M2();function r4(_,q,f,K,$,P){let j=f.type==="block-map"?EV.resolveBlockMap(_,q,f,K,P):f.type==="block-seq"?gV.resolveBlockSeq(_,q,f,K,P):dV.resolveFlowCollection(_,q,f,K,P),v=j.constructor;if($==="!"||$===v.tagName)return j.tag=v.tagName,j;if($)j.tag=$;return j}function aV(_,q,f,K,$){let P=K.tag,j=!P?null:q.directives.tagName(P.source,(z)=>$(P,"TAG_RESOLVE_FAILED",z));if(f.type==="block-seq"){let{anchor:z,newlineAfterProp:H}=K,h=z&&P?z.offset>P.offset?z:P:z??P;if(h&&(!H||H.offset<h.offset))$(h,"MISSING_CHAR","Missing newline after block sequence props")}let v=f.type==="block-map"?"map":f.type==="block-seq"?"seq":f.start.source==="{"?"map":"seq";if(!P||!j||j==="!"||j===nV.YAMLMap.tagName&&v==="map"||j===RV.YAMLSeq.tagName&&v==="seq")return r4(_,q,f,$,j);let w=q.schema.tags.find((z)=>z.tag===j&&z.collection===v);if(!w){let z=q.schema.knownTags[j];if(z&&z.collection===v)q.schema.tags.push(Object.assign({},z,{default:!1})),w=z;else{if(z)$(P,"BAD_COLLECTION_TYPE",`${z.tag} used for ${v} collection, but expects ${z.collection??"scalar"}`,!0);else $(P,"TAG_RESOLVE_FAILED",`Unresolved tag: ${j}`,!0);return r4(_,q,f,$,j)}}let O=r4(_,q,f,$,j,w),T=w.resolve?.(O,(z)=>$(P,"TAG_RESOLVE_FAILED",z),q.options)??O,Y=pV.isNode(T)?T:new lV.Scalar(T);if(Y.range=O.range,Y.tag=j,w?.format)Y.format=w.format;return Y}IV.composeCollection=aV});var V4=p((cV)=>{var b4=nq();function yV(_,q,f){let K=q.offset,$=iV(q,_.options.strict,f);if(!$)return{value:"",type:null,comment:"",range:[K,K,K]};let P=$.mode===">"?b4.Scalar.BLOCK_FOLDED:b4.Scalar.BLOCK_LITERAL,j=q.source?oV(q.source):[],v=j.length;for(let J=j.length-1;J>=0;--J){let k=j[J][1];if(k===""||k==="\r")v=J;else break}if(v===0){let J=$.chomp==="+"&&j.length>0?`
|
|
96
|
+
`.repeat(Math.max(1,j.length-1)):"",k=K+$.length;if(q.source)k+=q.source.length;return{value:J,type:P,comment:$.comment,range:[K,k,k]}}let w=q.indent+$.indent,O=q.offset+$.length,T=0;for(let J=0;J<v;++J){let[k,X]=j[J];if(X===""||X==="\r"){if($.indent===0&&k.length>w)w=k.length}else{if(k.length<w)f(O+k.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if($.indent===0)w=k.length;if(T=J,w===0&&!_.atRoot)f(O,"BAD_INDENT","Block scalar values in collections must be indented");break}O+=k.length+X.length+1}for(let J=j.length-1;J>=v;--J)if(j[J][0].length>w)v=J+1;let Y="",z="",H=!1;for(let J=0;J<T;++J)Y+=j[J][0].slice(w)+`
|
|
97
|
+
`;for(let J=T;J<v;++J){let[k,X]=j[J];O+=k.length+X.length+1;let l=X[X.length-1]==="\r";if(l)X=X.slice(0,-1);if(X&&k.length<w){let n=`Block scalar lines must not be less indented than their ${$.indent?"explicit indentation indicator":"first line"}`;f(O-X.length-(l?2:1),"BAD_INDENT",n),k=""}if(P===b4.Scalar.BLOCK_LITERAL)Y+=z+k.slice(w)+X,z=`
|
|
98
|
+
`;else if(k.length>w||X[0]==="\t"){if(z===" ")z=`
|
|
99
|
+
`;else if(!H&&z===`
|
|
100
|
+
`)z=`
|
|
101
|
+
|
|
102
|
+
`;Y+=z+k.slice(w)+X,z=`
|
|
103
|
+
`,H=!0}else if(X==="")if(z===`
|
|
104
|
+
`)Y+=`
|
|
105
|
+
`;else z=`
|
|
106
|
+
`;else Y+=z+X,z=" ",H=!1}switch($.chomp){case"-":break;case"+":for(let J=v;J<j.length;++J)Y+=`
|
|
107
|
+
`+j[J][0].slice(w);if(Y[Y.length-1]!==`
|
|
108
|
+
`)Y+=`
|
|
109
|
+
`;break;default:Y+=`
|
|
110
|
+
`}let h=K+$.length+q.source.length;return{value:Y,type:P,comment:$.comment,range:[K,h,h]}}function iV({offset:_,props:q},f,K){if(q[0].type!=="block-scalar-header")return K(q[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:$}=q[0],P=$[0],j=0,v="",w=-1;for(let z=1;z<$.length;++z){let H=$[z];if(!v&&(H==="-"||H==="+"))v=H;else{let h=Number(H);if(!j&&h)j=h;else if(w===-1)w=_+z}}if(w!==-1)K(w,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${$}`);let O=!1,T="",Y=$.length;for(let z=1;z<q.length;++z){let H=q[z];switch(H.type){case"space":O=!0;case"newline":Y+=H.source.length;break;case"comment":if(f&&!O)K(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Y+=H.source.length,T=H.source.substring(1);break;case"error":K(H,"UNEXPECTED_TOKEN",H.message),Y+=H.source.length;break;default:{let h=`Unexpected token in block scalar header: ${H.type}`;K(H,"UNEXPECTED_TOKEN",h);let J=H.source;if(J&&typeof J==="string")Y+=J.length}}}return{mode:P,indent:j,chomp:v,comment:T,length:Y}}function oV(_){let q=_.split(/\n( *)/),f=q[0],K=f.match(/^( *)/),P=[K?.[1]?[K[1],f.slice(K[1].length)]:["",f]];for(let j=1;j<q.length;j+=2)P.push([q[j],q[j+1]]);return P}cV.resolveBlockScalar=yV});var S4=p((qM)=>{var M4=nq(),tV=Mf();function eV(_,q,f){let{offset:K,type:$,source:P,end:j}=_,v,w,O=(z,H,h)=>f(K+z,H,h);switch($){case"scalar":v=M4.Scalar.PLAIN,w=xV(P,O);break;case"single-quoted-scalar":v=M4.Scalar.QUOTE_SINGLE,w=sV(P,O);break;case"double-quoted-scalar":v=M4.Scalar.QUOTE_DOUBLE,w=BV(P,O);break;default:return f(_,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${$}`),{value:"",type:null,comment:"",range:[K,K+P.length,K+P.length]}}let T=K+P.length,Y=tV.resolveEnd(j,T,q,f);return{value:w,type:v,comment:Y.comment,range:[K,T,Y.offset]}}function xV(_,q){let f="";switch(_[0]){case"\t":f="a tab character";break;case",":f="flow indicator character ,";break;case"%":f="directive indicator character %";break;case"|":case">":{f=`block scalar indicator ${_[0]}`;break}case"@":case"`":{f=`reserved character ${_[0]}`;break}}if(f)q(0,"BAD_SCALAR_START",`Plain value cannot start with ${f}`);return N2(_)}function sV(_,q){if(_[_.length-1]!=="'"||_.length===1)q(_.length,"MISSING_CHAR","Missing closing 'quote");return N2(_.slice(1,-1)).replace(/''/g,"'")}function N2(_){let q,f;try{q=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
111
|
+
`,"sy"),f=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
112
|
+
`,"sy")}catch{q=/(.*?)[ \t]*\r?\n/sy,f=/[ \t]*(.*?)[ \t]*\r?\n/sy}let K=q.exec(_);if(!K)return _;let $=K[1],P=" ",j=q.lastIndex;f.lastIndex=j;while(K=f.exec(_)){if(K[1]==="")if(P===`
|
|
113
|
+
`)$+=P;else P=`
|
|
114
|
+
`;else $+=P+K[1],P=" ";j=f.lastIndex}let v=/[ \t]*(.*)/sy;return v.lastIndex=j,K=v.exec(_),$+P+(K?.[1]??"")}function BV(_,q){let f="";for(let K=1;K<_.length-1;++K){let $=_[K];if($==="\r"&&_[K+1]===`
|
|
115
|
+
`)continue;if($===`
|
|
116
|
+
`){let{fold:P,offset:j}=UV(_,K);f+=P,K=j}else if($==="\\"){let P=_[++K],j=FV[P];if(j)f+=j;else if(P===`
|
|
117
|
+
`){P=_[K+1];while(P===" "||P==="\t")P=_[++K+1]}else if(P==="\r"&&_[K+1]===`
|
|
118
|
+
`){P=_[++K+1];while(P===" "||P==="\t")P=_[++K+1]}else if(P==="x"||P==="u"||P==="U"){let v={x:2,u:4,U:8}[P];f+=QV(_,K+1,v,q),K+=v}else{let v=_.substr(K-1,2);q(K-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${v}`),f+=v}}else if($===" "||$==="\t"){let P=K,j=_[K+1];while(j===" "||j==="\t")j=_[++K+1];if(j!==`
|
|
119
|
+
`&&!(j==="\r"&&_[K+2]===`
|
|
120
|
+
`))f+=K>P?_.slice(P,K+1):$}else f+=$}if(_[_.length-1]!=='"'||_.length===1)q(_.length,"MISSING_CHAR",'Missing closing "quote');return f}function UV(_,q){let f="",K=_[q+1];while(K===" "||K==="\t"||K===`
|
|
121
|
+
`||K==="\r"){if(K==="\r"&&_[q+2]!==`
|
|
122
|
+
`)break;if(K===`
|
|
123
|
+
`)f+=`
|
|
124
|
+
`;q+=1,K=_[q+1]}if(!f)f=" ";return{fold:f,offset:q}}var FV={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
125
|
+
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function QV(_,q,f,K){let $=_.substr(q,f),j=$.length===f&&/^[0-9a-fA-F]+$/.test($)?parseInt($,16):NaN;if(isNaN(j)){let v=_.substr(q-2,f+2);return K(q-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${v}`),v}return String.fromCodePoint(j)}qM.resolveFlowScalar=eV});var p2=p((vM)=>{var d8=Oq(),C2=nq(),fM=V4(),$M=S4();function KM(_,q,f,K){let{value:$,type:P,comment:j,range:v}=q.type==="block-scalar"?fM.resolveBlockScalar(_,q,K):$M.resolveFlowScalar(q,_.options.strict,K),w=f?_.directives.tagName(f.source,(Y)=>K(f,"TAG_RESOLVE_FAILED",Y)):null,O;if(_.options.stringKeys&&_.atKey)O=_.schema[d8.SCALAR];else if(w)O=PM(_.schema,$,w,f,K);else if(q.type==="scalar")O=jM(_,$,q,K);else O=_.schema[d8.SCALAR];let T;try{let Y=O.resolve($,(z)=>K(f??q,"TAG_RESOLVE_FAILED",z),_.options);T=d8.isScalar(Y)?Y:new C2.Scalar(Y)}catch(Y){let z=Y instanceof Error?Y.message:String(Y);K(f??q,"TAG_RESOLVE_FAILED",z),T=new C2.Scalar($)}if(T.range=v,T.source=$,P)T.type=P;if(w)T.tag=w;if(O.format)T.format=O.format;if(j)T.comment=j;return T}function PM(_,q,f,K,$){if(f==="!")return _[d8.SCALAR];let P=[];for(let v of _.tags)if(!v.collection&&v.tag===f)if(v.default&&v.test)P.push(v);else return v;for(let v of P)if(v.test?.test(q))return v;let j=_.knownTags[f];if(j&&!j.collection)return _.tags.push(Object.assign({},j,{default:!1,test:void 0})),j;return $(K,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,f!=="tag:yaml.org,2002:str"),_[d8.SCALAR]}function jM({atKey:_,directives:q,schema:f},K,$,P){let j=f.tags.find((v)=>(v.default===!0||_&&v.default==="key")&&v.test?.test(K))||f[d8.SCALAR];if(f.compat){let v=f.compat.find((w)=>w.default&&w.test?.test(K))??f[d8.SCALAR];if(j.tag!==v.tag){let w=q.tagString(j.tag),O=q.tagString(v.tag),T=`Value may be parsed as either ${w} or ${O}`;P($,"TAG_RESOLVE_FAILED",T,!0)}}return j}vM.composeScalar=KM});var l2=p((YM)=>{function OM(_,q,f){if(q){f??(f=q.length);for(let K=f-1;K>=0;--K){let $=q[K];switch($.type){case"space":case"comment":case"newline":_-=$.source.length;continue}$=q[++K];while($?.type==="space")_+=$.source.length,$=q[++K];break}}return _}YM.emptyScalarPosition=OM});var E2=p((XM)=>{var zM=T6(),WM=Oq(),HM=S2(),n2=p2(),hM=Mf(),JM=l2(),kM={composeNode:R2,composeEmptyNode:N4};function R2(_,q,f,K){let $=_.atKey,{spaceBefore:P,comment:j,anchor:v,tag:w}=f,O,T=!0;switch(q.type){case"alias":if(O=ZM(_,q,K),v||w)K(q,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(O=n2.composeScalar(_,q,w,K),v)O.anchor=v.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(O=HM.composeCollection(kM,_,q,f,K),v)O.anchor=v.source.substring(1);break;default:{let Y=q.type==="error"?q.message:`Unsupported token (type: ${q.type})`;K(q,"UNEXPECTED_TOKEN",Y),O=N4(_,q.offset,void 0,null,f,K),T=!1}}if(v&&O.anchor==="")K(v,"BAD_ALIAS","Anchor cannot be an empty string");if($&&_.options.stringKeys&&(!WM.isScalar(O)||typeof O.value!=="string"||O.tag&&O.tag!=="tag:yaml.org,2002:str"))K(w??q,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(P)O.spaceBefore=!0;if(j)if(q.type==="scalar"&&q.source==="")O.comment=j;else O.commentBefore=j;if(_.options.keepSourceTokens&&T)O.srcToken=q;return O}function N4(_,q,f,K,{spaceBefore:$,comment:P,anchor:j,tag:v,end:w},O){let T={type:"scalar",offset:JM.emptyScalarPosition(q,f,K),indent:-1,source:""},Y=n2.composeScalar(_,T,v,O);if(j){if(Y.anchor=j.source.substring(1),Y.anchor==="")O(j,"BAD_ALIAS","Anchor cannot be an empty string")}if($)Y.spaceBefore=!0;if(P)Y.comment=P,Y.range[2]=w;return Y}function ZM({options:_},{offset:q,source:f,end:K},$){let P=new zM.Alias(f.substring(1));if(P.source==="")$(q,"BAD_ALIAS","Alias cannot be an empty string");if(P.source.endsWith(":"))$(q+f.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let j=q+f.length,v=hM.resolveEnd(K,j,_.strict,$);if(P.range=[q,j,v.offset],v.comment)P.comment=v.comment;return P}XM.composeEmptyNode=N4;XM.composeNode=R2});var d2=p((VM)=>{var GM=V6(),g2=E2(),mM=Mf(),rM=S6();function bM(_,q,{offset:f,start:K,value:$,end:P},j){let v=Object.assign({_directives:q},_),w=new GM.Document(void 0,v),O={atKey:!1,atRoot:!0,directives:w.directives,options:w.options,schema:w.schema},T=rM.resolveProps(K,{indicator:"doc-start",next:$??P?.[0],offset:f,onError:j,parentIndent:0,startOnNewline:!0});if(T.found){if(w.directives.docStart=!0,$&&($.type==="block-map"||$.type==="block-seq")&&!T.hasNewline)j(T.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}w.contents=$?g2.composeNode(O,$,T,j):g2.composeEmptyNode(O,T.end,K,null,T,j);let Y=w.contents.range[2],z=mM.resolveEnd(P,Y,!1,j);if(z.comment)w.comment=z.comment;return w.range=[f,Y,z.offset],w}VM.composeDoc=bM});var C4=p((nM)=>{var SM=a_("process"),NM=R3(),CM=V6(),N6=M6(),a2=Oq(),pM=d2(),lM=Mf();function C6(_){if(typeof _==="number")return[_,_+1];if(Array.isArray(_))return _.length===2?_:[_[0],_[1]];let{offset:q,source:f}=_;return[q,q+(typeof f==="string"?f.length:1)]}function I2(_){let q="",f=!1,K=!1;for(let $=0;$<_.length;++$){let P=_[$];switch(P[0]){case"#":q+=(q===""?"":K?`
|
|
126
|
+
|
|
127
|
+
`:`
|
|
128
|
+
`)+(P.substring(1)||" "),f=!0,K=!1;break;case"%":if(_[$+1]?.[0]!=="#")$+=1;f=!1;break;default:if(!f)K=!0;f=!1}}return{comment:q,afterEmptyLine:K}}class D2{constructor(_={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(q,f,K,$)=>{let P=C6(q);if($)this.warnings.push(new N6.YAMLWarning(P,f,K));else this.errors.push(new N6.YAMLParseError(P,f,K))},this.directives=new NM.Directives({version:_.version||"1.2"}),this.options=_}decorate(_,q){let{comment:f,afterEmptyLine:K}=I2(this.prelude);if(f){let $=_.contents;if(q)_.comment=_.comment?`${_.comment}
|
|
129
|
+
${f}`:f;else if(K||_.directives.docStart||!$)_.commentBefore=f;else if(a2.isCollection($)&&!$.flow&&$.items.length>0){let P=$.items[0];if(a2.isPair(P))P=P.key;let j=P.commentBefore;P.commentBefore=j?`${f}
|
|
130
|
+
${j}`:f}else{let P=$.commentBefore;$.commentBefore=P?`${f}
|
|
131
|
+
${P}`:f}}if(q)Array.prototype.push.apply(_.errors,this.errors),Array.prototype.push.apply(_.warnings,this.warnings);else _.errors=this.errors,_.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:I2(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(_,q=!1,f=-1){for(let K of _)yield*this.next(K);yield*this.end(q,f)}*next(_){if(SM.env.LOG_STREAM)console.dir(_,{depth:null});switch(_.type){case"directive":this.directives.add(_.source,(q,f,K)=>{let $=C6(_);$[0]+=q,this.onError($,"BAD_DIRECTIVE",f,K)}),this.prelude.push(_.source),this.atDirectives=!0;break;case"document":{let q=pM.composeDoc(this.options,this.directives,_,this.onError);if(this.atDirectives&&!q.directives.docStart)this.onError(_,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(q,!1),this.doc)yield this.doc;this.doc=q,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(_.source);break;case"error":{let q=_.source?`${_.message}: ${JSON.stringify(_.source)}`:_.message,f=new N6.YAMLParseError(C6(_),"UNEXPECTED_TOKEN",q);if(this.atDirectives||!this.doc)this.errors.push(f);else this.doc.errors.push(f);break}case"doc-end":{if(!this.doc){this.errors.push(new N6.YAMLParseError(C6(_),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let q=lM.resolveEnd(_.end,_.offset+_.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),q.comment){let f=this.doc.comment;this.doc.comment=f?`${f}
|
|
132
|
+
${q.comment}`:q.comment}this.doc.range[2]=q.offset;break}default:this.errors.push(new N6.YAMLParseError(C6(_),"UNEXPECTED_TOKEN",`Unsupported token ${_.type}`))}}*end(_=!1,q=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(_){let f=Object.assign({_directives:this.directives},this.options),K=new CM.Document(void 0,f);if(this.atDirectives)this.onError(q,"MISSING_CHAR","Missing directives-end indicator line");K.range=[0,q,q],this.decorate(K,!1),yield K}}}nM.Composer=D2});var o2=p((iM)=>{var EM=V4(),gM=S4(),dM=M6(),y2=h6();function aM(_,q=!0,f){if(_){let K=($,P,j)=>{let v=typeof $==="number"?$:Array.isArray($)?$[0]:$.offset;if(f)f(v,P,j);else throw new dM.YAMLParseError([v,v+1],P,j)};switch(_.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return gM.resolveFlowScalar(_,q,K);case"block-scalar":return EM.resolveBlockScalar({options:{strict:q}},_,K)}}return null}function IM(_,q){let{implicitKey:f=!1,indent:K,inFlow:$=!1,offset:P=-1,type:j="PLAIN"}=q,v=y2.stringifyString({type:j,value:_},{implicitKey:f,indent:K>0?" ".repeat(K):"",inFlow:$,options:{blockQuote:!0,lineWidth:-1}}),w=q.end??[{type:"newline",offset:-1,indent:K,source:`
|
|
133
|
+
`}];switch(v[0]){case"|":case">":{let O=v.indexOf(`
|
|
134
|
+
`),T=v.substring(0,O),Y=v.substring(O+1)+`
|
|
135
|
+
`,z=[{type:"block-scalar-header",offset:P,indent:K,source:T}];if(!i2(z,w))z.push({type:"newline",offset:-1,indent:K,source:`
|
|
136
|
+
`});return{type:"block-scalar",offset:P,indent:K,props:z,source:Y}}case'"':return{type:"double-quoted-scalar",offset:P,indent:K,source:v,end:w};case"'":return{type:"single-quoted-scalar",offset:P,indent:K,source:v,end:w};default:return{type:"scalar",offset:P,indent:K,source:v,end:w}}}function DM(_,q,f={}){let{afterKey:K=!1,implicitKey:$=!1,inFlow:P=!1,type:j}=f,v="indent"in _?_.indent:null;if(K&&typeof v==="number")v+=2;if(!j)switch(_.type){case"single-quoted-scalar":j="QUOTE_SINGLE";break;case"double-quoted-scalar":j="QUOTE_DOUBLE";break;case"block-scalar":{let O=_.props[0];if(O.type!=="block-scalar-header")throw new Error("Invalid block scalar header");j=O.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:j="PLAIN"}let w=y2.stringifyString({type:j,value:q},{implicitKey:$||v===null,indent:v!==null&&v>0?" ".repeat(v):"",inFlow:P,options:{blockQuote:!0,lineWidth:-1}});switch(w[0]){case"|":case">":yM(_,w);break;case'"':p4(_,w,"double-quoted-scalar");break;case"'":p4(_,w,"single-quoted-scalar");break;default:p4(_,w,"scalar")}}function yM(_,q){let f=q.indexOf(`
|
|
137
|
+
`),K=q.substring(0,f),$=q.substring(f+1)+`
|
|
138
|
+
`;if(_.type==="block-scalar"){let P=_.props[0];if(P.type!=="block-scalar-header")throw new Error("Invalid block scalar header");P.source=K,_.source=$}else{let{offset:P}=_,j="indent"in _?_.indent:-1,v=[{type:"block-scalar-header",offset:P,indent:j,source:K}];if(!i2(v,"end"in _?_.end:void 0))v.push({type:"newline",offset:-1,indent:j,source:`
|
|
139
|
+
`});for(let w of Object.keys(_))if(w!=="type"&&w!=="offset")delete _[w];Object.assign(_,{type:"block-scalar",indent:j,props:v,source:$})}}function i2(_,q){if(q)for(let f of q)switch(f.type){case"space":case"comment":_.push(f);break;case"newline":return _.push(f),!0}return!1}function p4(_,q,f){switch(_.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":_.type=f,_.source=q;break;case"block-scalar":{let K=_.props.slice(1),$=q.length;if(_.props[0].type==="block-scalar-header")$-=_.props[0].source.length;for(let P of K)P.offset+=$;delete _.props,Object.assign(_,{type:f,source:q,end:K});break}case"block-map":case"block-seq":{let $={type:"newline",offset:_.offset+q.length,indent:_.indent,source:`
|
|
140
|
+
`};delete _.items,Object.assign(_,{type:f,source:q,end:[$]});break}default:{let K="indent"in _?_.indent:-1,$="end"in _&&Array.isArray(_.end)?_.end.filter((P)=>P.type==="space"||P.type==="comment"||P.type==="newline"):[];for(let P of Object.keys(_))if(P!=="type"&&P!=="offset")delete _[P];Object.assign(_,{type:f,indent:K,source:q,end:$})}}}iM.createScalarToken=IM;iM.resolveAsScalar=aM;iM.setScalarValue=DM});var c2=p((eM)=>{var tM=(_)=>("type"in _)?VK(_):bK(_);function VK(_){switch(_.type){case"block-scalar":{let q="";for(let f of _.props)q+=VK(f);return q+_.source}case"block-map":case"block-seq":{let q="";for(let f of _.items)q+=bK(f);return q}case"flow-collection":{let q=_.start.source;for(let f of _.items)q+=bK(f);for(let f of _.end)q+=f.source;return q}case"document":{let q=bK(_);if(_.end)for(let f of _.end)q+=f.source;return q}default:{let q=_.source;if("end"in _&&_.end)for(let f of _.end)q+=f.source;return q}}}function bK({start:_,key:q,sep:f,value:K}){let $="";for(let P of _)$+=P.source;if(q)$+=VK(q);if(f)for(let P of f)$+=P.source;if(K)$+=VK(K);return $}eM.stringify=tM});var e2=p((BM)=>{var l4=Symbol("break visit"),sM=Symbol("skip children"),L2=Symbol("remove item");function a8(_,q){if("type"in _&&_.type==="document")_={start:_.start,value:_.value};t2(Object.freeze([]),_,q)}a8.BREAK=l4;a8.SKIP=sM;a8.REMOVE=L2;a8.itemAtPath=(_,q)=>{let f=_;for(let[K,$]of q){let P=f?.[K];if(P&&"items"in P)f=P.items[$];else return}return f};a8.parentCollection=(_,q)=>{let f=a8.itemAtPath(_,q.slice(0,-1)),K=q[q.length-1][0],$=f?.[K];if($&&"items"in $)return $;throw new Error("Parent collection not found")};function t2(_,q,f){let K=f(q,_);if(typeof K==="symbol")return K;for(let $ of["key","value"]){let P=q[$];if(P&&"items"in P){for(let j=0;j<P.items.length;++j){let v=t2(Object.freeze(_.concat([[$,j]])),P.items[j],f);if(typeof v==="number")j=v-1;else if(v===l4)return l4;else if(v===L2)P.items.splice(j,1),j-=1}if(typeof K==="function"&&$==="key")K=K(q,_)}}return typeof K==="function"?K(q,_):K}BM.visit=a8});var MK=p((KS)=>{var n4=o2(),FM=c2(),QM=e2(),R4="\uFEFF",E4="\x02",g4="\x18",d4="\x1F",qS=(_)=>!!_&&("items"in _),_S=(_)=>!!_&&(_.type==="scalar"||_.type==="single-quoted-scalar"||_.type==="double-quoted-scalar"||_.type==="block-scalar");function fS(_){switch(_){case R4:return"<BOM>";case E4:return"<DOC>";case g4:return"<FLOW_END>";case d4:return"<SCALAR>";default:return JSON.stringify(_)}}function $S(_){switch(_){case R4:return"byte-order-mark";case E4:return"doc-mode";case g4:return"flow-error-end";case d4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
141
|
+
`:case`\r
|
|
142
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(_[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}KS.createScalarToken=n4.createScalarToken;KS.resolveAsScalar=n4.resolveAsScalar;KS.setScalarValue=n4.setScalarValue;KS.stringify=FM.stringify;KS.visit=QM.visit;KS.BOM=R4;KS.DOCUMENT=E4;KS.FLOW_END=g4;KS.SCALAR=d4;KS.isCollection=qS;KS.isScalar=_S;KS.prettyToken=fS;KS.tokenType=$S});var I4=p((AS)=>{var p6=MK();function u_(_){switch(_){case void 0:case" ":case`
|
|
143
|
+
`:case"\r":case"\t":return!0;default:return!1}}var x2=new Set("0123456789ABCDEFabcdef"),ZS=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),SK=new Set(",[]{}"),XS=new Set(` ,[]{}
|
|
144
|
+
\r `),a4=(_)=>!_||XS.has(_);class s2{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(_,q=!1){if(_){if(typeof _!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+_:_,this.lineEndPos=null}this.atEnd=!q;let f=this.next??"stream";while(f&&(q||this.hasChars(1)))f=yield*this.parseNext(f)}atLineEnd(){let _=this.pos,q=this.buffer[_];while(q===" "||q==="\t")q=this.buffer[++_];if(!q||q==="#"||q===`
|
|
145
|
+
`)return!0;if(q==="\r")return this.buffer[_+1]===`
|
|
146
|
+
`;return!1}charAt(_){return this.buffer[this.pos+_]}continueScalar(_){let q=this.buffer[_];if(this.indentNext>0){let f=0;while(q===" ")q=this.buffer[++f+_];if(q==="\r"){let K=this.buffer[f+_+1];if(K===`
|
|
147
|
+
`||!K&&!this.atEnd)return _+f+1}return q===`
|
|
148
|
+
`||f>=this.indentNext||!q&&!this.atEnd?_+f:-1}if(q==="-"||q==="."){let f=this.buffer.substr(_,3);if((f==="---"||f==="...")&&u_(this.buffer[_+3]))return-1}return _}getLine(){let _=this.lineEndPos;if(typeof _!=="number"||_!==-1&&_<this.pos)_=this.buffer.indexOf(`
|
|
149
|
+
`,this.pos),this.lineEndPos=_;if(_===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[_-1]==="\r")_-=1;return this.buffer.substring(this.pos,_)}hasChars(_){return this.pos+_<=this.buffer.length}setNext(_){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=_,null}peek(_){return this.buffer.substr(this.pos,_)}*parseNext(_){switch(_){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let _=this.getLine();if(_===null)return this.setNext("stream");if(_[0]===p6.BOM)yield*this.pushCount(1),_=_.substring(1);if(_[0]==="%"){let q=_.length,f=_.indexOf("#");while(f!==-1){let $=_[f-1];if($===" "||$==="\t"){q=f-1;break}else f=_.indexOf("#",f+1)}while(!0){let $=_[q-1];if($===" "||$==="\t")q-=1;else break}let K=(yield*this.pushCount(q))+(yield*this.pushSpaces(!0));return yield*this.pushCount(_.length-K),this.pushNewline(),"stream"}if(this.atLineEnd()){let q=yield*this.pushSpaces(!0);return yield*this.pushCount(_.length-q),yield*this.pushNewline(),"stream"}return yield p6.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let _=this.charAt(0);if(!_&&!this.atEnd)return this.setNext("line-start");if(_==="-"||_==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let q=this.peek(3);if((q==="---"||q==="...")&&u_(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,q==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!u_(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[_,q]=this.peek(2);if(!q&&!this.atEnd)return this.setNext("block-start");if((_==="-"||_==="?"||_===":")&&u_(q)){let f=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=f,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let _=this.getLine();if(_===null)return this.setNext("doc");let q=yield*this.pushIndicators();switch(_[q]){case"#":yield*this.pushCount(_.length-q);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(a4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return q+=yield*this.parseBlockScalarHeader(),q+=yield*this.pushSpaces(!0),yield*this.pushCount(_.length-q),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let _,q,f=-1;do{if(_=yield*this.pushNewline(),_>0)q=yield*this.pushSpaces(!1),this.indentValue=f=q;else q=0;q+=yield*this.pushSpaces(!0)}while(_+q>0);let K=this.getLine();if(K===null)return this.setNext("flow");if(f!==-1&&f<this.indentNext&&K[0]!=="#"||f===0&&(K.startsWith("---")||K.startsWith("..."))&&u_(K[3])){if(!(f===this.indentNext-1&&this.flowLevel===1&&(K[0]==="]"||K[0]==="}")))return this.flowLevel=0,yield p6.FLOW_END,yield*this.parseLineStart()}let $=0;while(K[$]===",")$+=yield*this.pushCount(1),$+=yield*this.pushSpaces(!0),this.flowKey=!1;switch($+=yield*this.pushIndicators(),K[$]){case void 0:return"flow";case"#":return yield*this.pushCount(K.length-$),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(a4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let P=this.charAt(1);if(this.flowKey||u_(P)||P===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let _=this.charAt(0),q=this.buffer.indexOf(_,this.pos+1);if(_==="'")while(q!==-1&&this.buffer[q+1]==="'")q=this.buffer.indexOf("'",q+2);else while(q!==-1){let $=0;while(this.buffer[q-1-$]==="\\")$+=1;if($%2===0)break;q=this.buffer.indexOf('"',q+1)}let f=this.buffer.substring(0,q),K=f.indexOf(`
|
|
150
|
+
`,this.pos);if(K!==-1){while(K!==-1){let $=this.continueScalar(K+1);if($===-1)break;K=f.indexOf(`
|
|
151
|
+
`,$)}if(K!==-1)q=K-(f[K-1]==="\r"?2:1)}if(q===-1){if(!this.atEnd)return this.setNext("quoted-scalar");q=this.buffer.length}return yield*this.pushToIndex(q+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let _=this.pos;while(!0){let q=this.buffer[++_];if(q==="+")this.blockScalarKeep=!0;else if(q>"0"&&q<="9")this.blockScalarIndent=Number(q)-1;else if(q!=="-")break}return yield*this.pushUntil((q)=>u_(q)||q==="#")}*parseBlockScalar(){let _=this.pos-1,q=0,f;q:for(let $=this.pos;f=this.buffer[$];++$)switch(f){case" ":q+=1;break;case`
|
|
152
|
+
`:_=$,q=0;break;case"\r":{let P=this.buffer[$+1];if(!P&&!this.atEnd)return this.setNext("block-scalar");if(P===`
|
|
153
|
+
`)break}default:break q}if(!f&&!this.atEnd)return this.setNext("block-scalar");if(q>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=q;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let $=this.continueScalar(_+1);if($===-1)break;_=this.buffer.indexOf(`
|
|
154
|
+
`,$)}while(_!==-1);if(_===-1){if(!this.atEnd)return this.setNext("block-scalar");_=this.buffer.length}}let K=_+1;f=this.buffer[K];while(f===" ")f=this.buffer[++K];if(f==="\t"){while(f==="\t"||f===" "||f==="\r"||f===`
|
|
155
|
+
`)f=this.buffer[++K];_=K-1}else if(!this.blockScalarKeep)do{let $=_-1,P=this.buffer[$];if(P==="\r")P=this.buffer[--$];let j=$;while(P===" ")P=this.buffer[--$];if(P===`
|
|
156
|
+
`&&$>=this.pos&&$+1+q>j)_=$;else break}while(!0);return yield p6.SCALAR,yield*this.pushToIndex(_+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let _=this.flowLevel>0,q=this.pos-1,f=this.pos-1,K;while(K=this.buffer[++f])if(K===":"){let $=this.buffer[f+1];if(u_($)||_&&SK.has($))break;q=f}else if(u_(K)){let $=this.buffer[f+1];if(K==="\r")if($===`
|
|
157
|
+
`)f+=1,K=`
|
|
158
|
+
`,$=this.buffer[f+1];else q=f;if($==="#"||_&&SK.has($))break;if(K===`
|
|
159
|
+
`){let P=this.continueScalar(f+1);if(P===-1)break;f=Math.max(f,P-2)}}else{if(_&&SK.has(K))break;q=f}if(!K&&!this.atEnd)return this.setNext("plain-scalar");return yield p6.SCALAR,yield*this.pushToIndex(q+1,!0),_?"flow":"doc"}*pushCount(_){if(_>0)return yield this.buffer.substr(this.pos,_),this.pos+=_,_;return 0}*pushToIndex(_,q){let f=this.buffer.slice(this.pos,_);if(f)return yield f,this.pos+=f.length,f.length;else if(q)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(a4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let _=this.flowLevel>0,q=this.charAt(1);if(u_(q)||_&&SK.has(q)){if(!_)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let _=this.pos+2,q=this.buffer[_];while(!u_(q)&&q!==">")q=this.buffer[++_];return yield*this.pushToIndex(q===">"?_+1:_,!1)}else{let _=this.pos+1,q=this.buffer[_];while(q)if(ZS.has(q))q=this.buffer[++_];else if(q==="%"&&x2.has(this.buffer[_+1])&&x2.has(this.buffer[_+2]))q=this.buffer[_+=3];else break;return yield*this.pushToIndex(_,!1)}}*pushNewline(){let _=this.buffer[this.pos];if(_===`
|
|
160
|
+
`)return yield*this.pushCount(1);else if(_==="\r"&&this.charAt(1)===`
|
|
161
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(_){let q=this.pos-1,f;do f=this.buffer[++q];while(f===" "||_&&f==="\t");let K=q-this.pos;if(K>0)yield this.buffer.substr(this.pos,K),this.pos=q;return K}*pushUntil(_){let q=this.pos,f=this.buffer[q];while(!_(f))f=this.buffer[++q];return yield*this.pushToIndex(q,!1)}}AS.Lexer=s2});var D4=p((GS)=>{class B2{constructor(){this.lineStarts=[],this.addNewLine=(_)=>this.lineStarts.push(_),this.linePos=(_)=>{let q=0,f=this.lineStarts.length;while(q<f){let $=q+f>>1;if(this.lineStarts[$]<_)q=$+1;else f=$}if(this.lineStarts[q]===_)return{line:q+1,col:1};if(q===0)return{line:0,col:_};let K=this.lineStarts[q-1];return{line:q,col:_-K+1}}}}GS.LineCounter=B2});var y4=p((VS)=>{var rS=a_("process"),U2=MK(),bS=I4();function z8(_,q){for(let f=0;f<_.length;++f)if(_[f].type===q)return!0;return!1}function F2(_){for(let q=0;q<_.length;++q)switch(_[q].type){case"space":case"comment":case"newline":break;default:return q}return-1}function qO(_){switch(_?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function NK(_){switch(_.type){case"document":return _.start;case"block-map":{let q=_.items[_.items.length-1];return q.sep??q.start}case"block-seq":return _.items[_.items.length-1].start;default:return[]}}function Sf(_){if(_.length===0)return[];let q=_.length;q:while(--q>=0)switch(_[q].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(_[++q]?.type==="space");return _.splice(q,_.length)}function Q2(_){if(_.start.type==="flow-seq-start"){for(let q of _.items)if(q.sep&&!q.value&&!z8(q.start,"explicit-key-ind")&&!z8(q.sep,"map-value-ind")){if(q.key)q.value=q.key;if(delete q.key,qO(q.value))if(q.value.end)Array.prototype.push.apply(q.value.end,q.sep);else q.value.end=q.sep;else Array.prototype.push.apply(q.start,q.sep);delete q.sep}}}class _O{constructor(_){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new bS.Lexer,this.onNewLine=_}*parse(_,q=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let f of this.lexer.lex(_,q))yield*this.next(f);if(!q)yield*this.end()}*next(_){if(this.source=_,rS.env.LOG_TOKENS)console.log("|",U2.prettyToken(_));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=_.length;return}let q=U2.tokenType(_);if(!q){let f=`Not a YAML token: ${_}`;yield*this.pop({type:"error",offset:this.offset,message:f,source:_}),this.offset+=_.length}else if(q==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=q,yield*this.step(),q){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+_.length);break;case"space":if(this.atNewLine&&_[0]===" ")this.indent+=_.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=_.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=_.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let _=this.peek(1);if(this.type==="doc-end"&&(!_||_.type!=="doc-end")){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!_)return yield*this.stream();switch(_.type){case"document":return yield*this.document(_);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(_);case"block-scalar":return yield*this.blockScalar(_);case"block-map":return yield*this.blockMap(_);case"block-seq":return yield*this.blockSequence(_);case"flow-collection":return yield*this.flowCollection(_);case"doc-end":return yield*this.documentEnd(_)}yield*this.pop()}peek(_){return this.stack[this.stack.length-_]}*pop(_){let q=_??this.stack.pop();if(!q)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield q;else{let f=this.peek(1);if(q.type==="block-scalar")q.indent="indent"in f?f.indent:0;else if(q.type==="flow-collection"&&f.type==="document")q.indent=0;if(q.type==="flow-collection")Q2(q);switch(f.type){case"document":f.value=q;break;case"block-scalar":f.props.push(q);break;case"block-map":{let K=f.items[f.items.length-1];if(K.value){f.items.push({start:[],key:q,sep:[]}),this.onKeyLine=!0;return}else if(K.sep)K.value=q;else{Object.assign(K,{key:q,sep:[]}),this.onKeyLine=!K.explicitKey;return}break}case"block-seq":{let K=f.items[f.items.length-1];if(K.value)f.items.push({start:[],value:q});else K.value=q;break}case"flow-collection":{let K=f.items[f.items.length-1];if(!K||K.value)f.items.push({start:[],key:q,sep:[]});else if(K.sep)K.value=q;else Object.assign(K,{key:q,sep:[]});return}default:yield*this.pop(),yield*this.pop(q)}if((f.type==="document"||f.type==="block-map"||f.type==="block-seq")&&(q.type==="block-map"||q.type==="block-seq")){let K=q.items[q.items.length-1];if(K&&!K.sep&&!K.value&&K.start.length>0&&F2(K.start)===-1&&(q.indent===0||K.start.every(($)=>$.type!=="comment"||$.indent<q.indent))){if(f.type==="document")f.end=K.start;else f.items.push({start:K.start});q.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let _={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")_.start.push(this.sourceToken);this.stack.push(_);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(_){if(_.value)return yield*this.lineEnd(_);switch(this.type){case"doc-start":{if(F2(_.start)!==-1)yield*this.pop(),yield*this.step();else _.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":_.start.push(this.sourceToken);return}let q=this.startBlockValue(_);if(q)this.stack.push(q);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(_){if(this.type==="map-value-ind"){let q=NK(this.peek(2)),f=Sf(q),K;if(_.end)K=_.end,K.push(this.sourceToken),delete _.end;else K=[this.sourceToken];let $={type:"block-map",offset:_.offset,indent:_.indent,items:[{start:f,key:_,sep:K}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=$}else yield*this.lineEnd(_)}*blockScalar(_){switch(this.type){case"space":case"comment":case"newline":_.props.push(this.sourceToken);return;case"scalar":if(_.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let q=this.source.indexOf(`
|
|
162
|
+
`)+1;while(q!==0)this.onNewLine(this.offset+q),q=this.source.indexOf(`
|
|
163
|
+
`,q)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(_){let q=_.items[_.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,q.value){let f="end"in q.value?q.value.end:void 0;if((Array.isArray(f)?f[f.length-1]:void 0)?.type==="comment")f?.push(this.sourceToken);else _.items.push({start:[this.sourceToken]})}else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"space":case"comment":if(q.value)_.items.push({start:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else{if(this.atIndentedComment(q.start,_.indent)){let K=_.items[_.items.length-2]?.value?.end;if(Array.isArray(K)){Array.prototype.push.apply(K,q.start),K.push(this.sourceToken),_.items.pop();return}}q.start.push(this.sourceToken)}return}if(this.indent>=_.indent){let f=!this.onKeyLine&&this.indent===_.indent,K=f&&(q.sep||q.explicitKey)&&this.type!=="seq-item-ind",$=[];if(K&&q.sep&&!q.value){let P=[];for(let j=0;j<q.sep.length;++j){let v=q.sep[j];switch(v.type){case"newline":P.push(j);break;case"space":break;case"comment":if(v.indent>_.indent)P.length=0;break;default:P.length=0}}if(P.length>=2)$=q.sep.splice(P[1])}switch(this.type){case"anchor":case"tag":if(K||q.value)$.push(this.sourceToken),_.items.push({start:$}),this.onKeyLine=!0;else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"explicit-key-ind":if(!q.sep&&!q.explicitKey)q.start.push(this.sourceToken),q.explicitKey=!0;else if(K||q.value)$.push(this.sourceToken),_.items.push({start:$,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(q.explicitKey)if(!q.sep)if(z8(q.start,"newline"))Object.assign(q,{key:null,sep:[this.sourceToken]});else{let P=Sf(q.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:P,key:null,sep:[this.sourceToken]}]})}else if(q.value)_.items.push({start:[],key:null,sep:[this.sourceToken]});else if(z8(q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]});else if(qO(q.key)&&!z8(q.sep,"newline")){let P=Sf(q.start),j=q.key,v=q.sep;v.push(this.sourceToken),delete q.key,delete q.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:P,key:j,sep:v}]})}else if($.length>0)q.sep=q.sep.concat($,this.sourceToken);else q.sep.push(this.sourceToken);else if(!q.sep)Object.assign(q,{key:null,sep:[this.sourceToken]});else if(q.value||K)_.items.push({start:$,key:null,sep:[this.sourceToken]});else if(z8(q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else q.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let P=this.flowScalar(this.type);if(K||q.value)_.items.push({start:$,key:P,sep:[]}),this.onKeyLine=!0;else if(q.sep)this.stack.push(P);else Object.assign(q,{key:P,sep:[]}),this.onKeyLine=!0;return}default:{let P=this.startBlockValue(_);if(P){if(P.type==="block-seq"){if(!q.explicitKey&&q.sep&&!z8(q.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(f)_.items.push({start:$});this.stack.push(P);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(_){let q=_.items[_.items.length-1];switch(this.type){case"newline":if(q.value){let f="end"in q.value?q.value.end:void 0;if((Array.isArray(f)?f[f.length-1]:void 0)?.type==="comment")f?.push(this.sourceToken);else _.items.push({start:[this.sourceToken]})}else q.start.push(this.sourceToken);return;case"space":case"comment":if(q.value)_.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(q.start,_.indent)){let K=_.items[_.items.length-2]?.value?.end;if(Array.isArray(K)){Array.prototype.push.apply(K,q.start),K.push(this.sourceToken),_.items.pop();return}}q.start.push(this.sourceToken)}return;case"anchor":case"tag":if(q.value||this.indent<=_.indent)break;q.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==_.indent)break;if(q.value||z8(q.start,"seq-item-ind"))_.items.push({start:[this.sourceToken]});else q.start.push(this.sourceToken);return}if(this.indent>_.indent){let f=this.startBlockValue(_);if(f){this.stack.push(f);return}}yield*this.pop(),yield*this.step()}*flowCollection(_){let q=_.items[_.items.length-1];if(this.type==="flow-error-end"){let f;do yield*this.pop(),f=this.peek(1);while(f&&f.type==="flow-collection")}else if(_.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!q||q.sep)_.items.push({start:[this.sourceToken]});else q.start.push(this.sourceToken);return;case"map-value-ind":if(!q||q.value)_.items.push({start:[],key:null,sep:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else Object.assign(q,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!q||q.value)_.items.push({start:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let K=this.flowScalar(this.type);if(!q||q.value)_.items.push({start:[],key:K,sep:[]});else if(q.sep)this.stack.push(K);else Object.assign(q,{key:K,sep:[]});return}case"flow-map-end":case"flow-seq-end":_.end.push(this.sourceToken);return}let f=this.startBlockValue(_);if(f)this.stack.push(f);else yield*this.pop(),yield*this.step()}else{let f=this.peek(2);if(f.type==="block-map"&&(this.type==="map-value-ind"&&f.indent===_.indent||this.type==="newline"&&!f.items[f.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&f.type!=="flow-collection"){let K=NK(f),$=Sf(K);Q2(_);let P=_.end.splice(1,_.end.length);P.push(this.sourceToken);let j={type:"block-map",offset:_.offset,indent:_.indent,items:[{start:$,key:_,sep:P}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=j}else yield*this.lineEnd(_)}}flowScalar(_){if(this.onNewLine){let q=this.source.indexOf(`
|
|
164
|
+
`)+1;while(q!==0)this.onNewLine(this.offset+q),q=this.source.indexOf(`
|
|
165
|
+
`,q)+1}return{type:_,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(_){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let q=NK(_),f=Sf(q);return f.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let q=NK(_),f=Sf(q);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(_,q){if(this.type!=="comment")return!1;if(this.indent<=q)return!1;return _.every((f)=>f.type==="newline"||f.type==="space")}*documentEnd(_){if(this.type!=="doc-mode"){if(_.end)_.end.push(this.sourceToken);else _.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(_){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(_.end)_.end.push(this.sourceToken);else _.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}VS.Parser=_O});var jO=p((ES)=>{var fO=C4(),SS=V6(),l6=M6(),NS=D3(),CS=Oq(),pS=D4(),$O=y4();function KO(_){let q=_.prettyErrors!==!1;return{lineCounter:_.lineCounter||q&&new pS.LineCounter||null,prettyErrors:q}}function lS(_,q={}){let{lineCounter:f,prettyErrors:K}=KO(q),$=new $O.Parser(f?.addNewLine),P=new fO.Composer(q),j=Array.from(P.compose($.parse(_)));if(K&&f)for(let v of j)v.errors.forEach(l6.prettifyError(_,f)),v.warnings.forEach(l6.prettifyError(_,f));if(j.length>0)return j;return Object.assign([],{empty:!0},P.streamInfo())}function PO(_,q={}){let{lineCounter:f,prettyErrors:K}=KO(q),$=new $O.Parser(f?.addNewLine),P=new fO.Composer(q),j=null;for(let v of P.compose($.parse(_),!0,_.length))if(!j)j=v;else if(j.options.logLevel!=="silent"){j.errors.push(new l6.YAMLParseError(v.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(K&&f)j.errors.forEach(l6.prettifyError(_,f)),j.warnings.forEach(l6.prettifyError(_,f));return j}function nS(_,q,f){let K=void 0;if(typeof q==="function")K=q;else if(f===void 0&&q&&typeof q==="object")f=q;let $=PO(_,f);if(!$)return null;if($.warnings.forEach((P)=>NS.warn($.options.logLevel,P)),$.errors.length>0)if($.options.logLevel!=="silent")throw $.errors[0];else $.errors=[];return $.toJS(Object.assign({reviver:K},f))}function RS(_,q,f){let K=null;if(typeof q==="function"||Array.isArray(q))K=q;else if(f===void 0&&q)f=q;if(typeof f==="string")f=f.length;if(typeof f==="number"){let $=Math.round(f);f=$<1?void 0:$>8?{indent:8}:{indent:$}}if(_===void 0){let{keepUndefined:$}=f??q??{};if(!$)return}if(CS.isDocument(_)&&!K)return _.toString(f);return new SS.Document(_,K,f).toString(f)}ES.parse=nS;ES.parseAllDocuments=lS;ES.parseDocument=PO;ES.stringify=RS});var wO=p((FS)=>{var DS=C4(),yS=V6(),iS=H4(),i4=M6(),oS=T6(),W8=Oq(),cS=w8(),LS=nq(),tS=Y8(),eS=T8(),xS=MK(),sS=I4(),BS=D4(),US=y4(),CK=jO(),vO=O6();FS.Composer=DS.Composer;FS.Document=yS.Document;FS.Schema=iS.Schema;FS.YAMLError=i4.YAMLError;FS.YAMLParseError=i4.YAMLParseError;FS.YAMLWarning=i4.YAMLWarning;FS.Alias=oS.Alias;FS.isAlias=W8.isAlias;FS.isCollection=W8.isCollection;FS.isDocument=W8.isDocument;FS.isMap=W8.isMap;FS.isNode=W8.isNode;FS.isPair=W8.isPair;FS.isScalar=W8.isScalar;FS.isSeq=W8.isSeq;FS.Pair=cS.Pair;FS.Scalar=LS.Scalar;FS.YAMLMap=tS.YAMLMap;FS.YAMLSeq=eS.YAMLSeq;FS.CST=xS;FS.Lexer=sS.Lexer;FS.LineCounter=BS.LineCounter;FS.Parser=US.Parser;FS.parse=CK.parse;FS.parseAllDocuments=CK.parseAllDocuments;FS.parseDocument=CK.parseDocument;FS.stringify=CK.stringify;FS.visit=vO.visit;FS.visitAsync=vO.visitAsync});import{dirname as SN}from"path";var YO,TO,NN=".index.json",OO="---",zO=(_)=>{let{projectFileService:q,projectFolderService:f,sharedFileService:K,sharedFolderService:$}=_,P=(r)=>{return r==="project"?q:K},j=(r)=>{return r==="project"?f:$},v=(r)=>{return NN},w=(r,A,u)=>{let m=new Error(A);if(m.code=r,u!==void 0)m.data=u;throw m},O=(r)=>{if(!r||r.trim().length===0)return{valid:!1,reason:"Path cannot be empty"};if(r.startsWith("/"))return{valid:!1,reason:"Path cannot start with /"};if(r.includes(".."))return{valid:!1,reason:"Path cannot contain .."};if(/[<>:"|?*\x00]/.test(r))return{valid:!1,reason:"Path contains invalid characters"};return{valid:!0,normalized:r.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"")}},T=async(r)=>{let A=v(r),u=P(r);try{let m=await u.readText(A);return JSON.parse(m)}catch(m){if(m.code==="NOT_FOUND")return{id:{},pathToId:{}};throw m}},Y=async(r,A)=>{let u=v(r),m=P(r),S=JSON.stringify(A,null,2);await m.writeText(u,S)},z=(r)=>{let A=r.split(`
|
|
166
|
+
`);if(A.length<3||A[0].trim()!==OO)return{bodyContent:r,isValid:!1,validationError:"Missing front matter delimiter"};let u=-1;for(let Q=1;Q<A.length;Q++)if(A[Q].trim()===OO){u=Q;break}if(u===-1)return{bodyContent:r,isValid:!1,validationError:"Missing closing front matter delimiter"};let m=A.slice(1,u).join(`
|
|
167
|
+
`),S=A.slice(0,u+1).join(`
|
|
168
|
+
`),I=A.slice(u+1).join(`
|
|
169
|
+
`).trim(),D;try{D=TO.default.parse(m)}catch(Q){return{bodyContent:r,isValid:!1,validationError:`YAML parse error: ${Q.message}`}}if(!D.type)return{rawFrontMatter:S,bodyContent:I,isValid:!1,validationError:"Missing required field: type"};let c=["prompt","doc","story-spec","story-tech-doc","subtask","review","feedback","feedback-review","retro"];if(!c.includes(D.type))return{rawFrontMatter:S,bodyContent:I,isValid:!1,validationError:`Invalid type: ${D.type}. Must be one of: ${c.join(", ")}`};if(!D.params)return{rawFrontMatter:S,bodyContent:I,isValid:!1,validationError:"Missing required field: params"};if(typeof D.params!=="object"||Array.isArray(D.params))return{rawFrontMatter:S,bodyContent:I,isValid:!1,validationError:"params must be an object"};let e=["string","number","boolean"],L={};for(let[Q,Hq]of Object.entries(D.params)){if(typeof Hq!=="object"||Array.isArray(Hq))return{rawFrontMatter:S,bodyContent:I,isValid:!1,validationError:`Parameter ${Q} definition must be an object`};let Pq=Hq;if(!Pq.type)return{rawFrontMatter:S,bodyContent:I,isValid:!1,validationError:`Parameter ${Q} missing type field`};if(!e.includes(Pq.type))return{rawFrontMatter:S,bodyContent:I,isValid:!1,validationError:`Parameter ${Q} has invalid type: ${Pq.type}. Must be one of: ${e.join(", ")}`};if(Pq.required!==void 0&&typeof Pq.required!=="boolean")return{rawFrontMatter:S,bodyContent:I,isValid:!1,validationError:`Parameter ${Q} required field must be boolean`};L[Q]={type:Pq.type,required:Pq.required??!1,description:Pq.description,default:Pq.default}}return{rawFrontMatter:S,frontMatter:{type:D.type,params:L,synopsis:D.synopsis,...D},bodyContent:I,isValid:!0}},H=(r,A)=>{let u=r,m=0;for(let S of A){let I=u;switch(S.op){case"replaceOnce":u=u.replace(S.oldText,S.newText);break;case"replaceAll":{let D=S.oldText.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");u=u.replace(new RegExp(D,"g"),S.newText);break}case"replaceRegex":{let D=new RegExp(S.pattern,S.flags||"");u=u.replace(D,S.replacement);break}case"replaceAllContent":u=S.content;break}if(u!==I||S.op==="replaceAllContent")m++}return{content:u,applied:m}},h=async(r)=>{if(r.kind==="id"){let A=r.scope;if(!A){let S=iP(r.id);if(!S)w("INVALID_ID_FORMAT",`Invalid template ID format: ${r.id}`);A=S}if(!oP.validateIdForScope(r.id,A))w("INVALID_ID_FORMAT",`Invalid template ID format for ${A} scope: ${r.id}`);let m=(await T(A)).id[r.id];if(!m)w("TEMPLATE_NOT_FOUND",`Template not found: ${r.id}`);return{scope:A,path:m.path,id:r.id}}else{let A=O(r.path);if(!A.valid)w("INVALID_PATH_FORMAT",A.reason||"Invalid path format");let u=A.normalized;if(r.scope){let S=(await T(r.scope)).pathToId[u];if(!S)w("TEMPLATE_NOT_FOUND",`Template not found: ${u} in ${r.scope} scope`);return{scope:r.scope,path:u,id:S}}else{let S=(await T("project")).pathToId[u];if(S)return{scope:"project",path:u,id:S};let D=(await T("shared")).pathToId[u];if(D)return{scope:"shared",path:u,id:D};w("TEMPLATE_NOT_FOUND",`Template not found: ${u}`)}}},J=async(r)=>{let A=await T(r),u=r==="project"?"tpl":"stpl",m=new RegExp(`^${u}(\\d{3,})$`),S=0;for(let D of Object.keys(A.id)){let c=D.match(m);if(c){let e=parseInt(c[1],10);if(e>S)S=e}}let I=S+1;return`${u}${I.toString().padStart(3,"0")}`},k=(r,A,u)=>{if(A==="string")return String(r);if(A==="number"){if(typeof r==="number")return r;let m=parseFloat(String(r));if(isNaN(m))w("INVALID_PARAM_TYPE",`Parameter ${u} must be a valid number, got: ${r}`);return m}if(A==="boolean"){if(typeof r==="boolean")return r;let m=String(r).toLowerCase();if(m==="true"||m==="1")return!0;if(m==="false"||m==="0")return!1;w("INVALID_PARAM_TYPE",`Parameter ${u} must be a boolean (true/false/1/0), got: ${r}`)}return r},X=async(r)=>{let A=r.address.scope||"project",u=O(r.address.path);if(!u.valid)w("INVALID_PATH_FORMAT",u.reason||"Invalid path format");let m=u.normalized;if(oP.isTemplateId(m))w("INVALID_PATH_FORMAT","Cannot create template with ID pattern as path");let S=await T(A);if(S.pathToId[m])w("TEMPLATE_ALREADY_EXISTS",`Template already exists at path: ${m}`);let I=z(r.content);if(!I.isValid)w("TEMPLATE_INVALID",I.validationError||"Invalid front matter");let D=await J(A),c=P(A),e=j(A),L=SN(m);if(L&&L!==".")await e.ensureDir(L);return await c.writeText(m,r.content),S.id[D]={path:m,isValid:!0,params:I.frontMatter.params},S.pathToId[m]=D,await Y(A,S),{id:D,path:m}},l=async(r)=>{let A=await h(r),m=await P(A.scope).readText(A.path),S=z(m);return{address:r,content:m,frontMatter:S.frontMatter,bodyContent:S.bodyContent,path:A.path,id:A.id,isValid:S.isValid}},N=async(r,A)=>{let u=Array.from(new Map(r.map((m)=>[JSON.stringify(m),m])).values());return Promise.all(u.map((m)=>l(m)))},n=async(r,A)=>{let u=await h(r),m=P(u.scope),S=await m.readText(u.path),{content:I,applied:D}=H(S,A),c=z(I);await m.writeText(u.path,I);let e=await T(u.scope);if(e.id[u.id]){if(e.id[u.id].isValid=c.isValid,c.isValid&&c.frontMatter)e.id[u.id].params=c.frontMatter.params;await Y(u.scope,e)}return{applied:D}},R=async(r)=>{try{let A=await h(r),u=P(A.scope);try{await u.deleteFile(A.path)}catch(S){if(S.code==="NOT_FOUND"){let I=await T(A.scope);return delete I.id[A.id],delete I.pathToId[A.path],await Y(A.scope,I),{deleted:!1}}throw S}let m=await T(A.scope);return delete m.id[A.id],delete m.pathToId[A.path],await Y(A.scope,m),{deleted:!0}}catch(A){if(A.code==="TEMPLATE_NOT_FOUND")return{deleted:!1};throw A}};return Object.freeze({create:X,read:l,readMany:N,edit:n,delete:R,deleteMany:async(r)=>{let A=Array.from(new Map(r.map((m)=>[JSON.stringify(m),m])).values()),u=[];for(let m of A)u.push(await R(m));return u},list:async(r)=>{let{scope:A,pathPrefix:u,includeContent:m}=r||{};if(A){let S=await T(A),I=[];for(let[D,c]of Object.entries(S.id)){if(u&&!c.path.startsWith(u))continue;let e;if(m)try{let Q=await P(A).readText(c.path);e=z(Q).frontMatter?.synopsis}catch{}I.push({scope:A,id:D,path:c.path,synopsis:e,isValid:c.isValid})}return I.sort((D,c)=>D.path.localeCompare(c.path))}else{let S=await T("project"),I=await T("shared"),D=[],c=new Map;for(let e of Object.values(S.id)){if(!c.has(e.path))c.set(e.path,new Set);c.get(e.path).add("project")}for(let e of Object.values(I.id)){if(!c.has(e.path))c.set(e.path,new Set);c.get(e.path).add("shared")}for(let[e,L]of Object.entries(S.id)){if(u&&!L.path.startsWith(u))continue;let Q;if(m)try{let _q=await q.readText(L.path);Q=z(_q).frontMatter?.synopsis}catch{}let Hq=c.get(L.path),Pq=Hq&&Hq.size>1?"overrides":void 0;D.push({scope:"project",id:e,path:L.path,synopsis:Q,isValid:L.isValid,override:Pq})}for(let[e,L]of Object.entries(I.id)){if(u&&!L.path.startsWith(u))continue;let Q;if(m)try{let _q=await K.readText(L.path);Q=z(_q).frontMatter?.synopsis}catch{}let Hq=c.get(L.path),Pq=Hq&&Hq.size>1?"overridden":void 0;D.push({scope:"shared",id:e,path:L.path,synopsis:Q,isValid:L.isValid,override:Pq})}return D.sort((e,L)=>e.path.localeCompare(L.path))}},move:async(r,A,u)=>{let m=await h(r),S=u||m.scope,I=O(A);if(!I.valid)w("INVALID_PATH_FORMAT",I.reason||"Invalid destination path");let D=I.normalized;if(m.scope===S&&m.path===D)w("TEMPLATE_ALREADY_EXISTS","Source and destination are identical");if((await T(S)).pathToId[D])w("TEMPLATE_ALREADY_EXISTS",`Destination already exists: ${D}`);let L=await P(m.scope).readText(m.path),Q=await X({address:{kind:"path",scope:S,path:D},content:L});return await R(r),{oldId:m.id,newId:Q.id,oldPath:m.path,newPath:D,sourceScope:m.scope,destinationScope:S}},render:async(r,A)=>{let u=await h(r);if(!(await T(u.scope)).id[u.id].isValid)w("TEMPLATE_INVALID",`Template has invalid front matter: ${u.id}`);let D=await P(u.scope).readText(u.path),c=z(D);if(!c.isValid||!c.frontMatter)w("TEMPLATE_INVALID",`Template has invalid front matter: ${u.id}`);let e=c.frontMatter.params,L={};for(let[Pq,_q]of Object.entries(e)){if(_q.required&&!(Pq in A))w("MISSING_REQUIRED_PARAM",`Missing required parameter: ${Pq} for template ${u.id}`);let kq;if(Pq in A)kq=k(A[Pq],_q.type,Pq);else if(_q.default!==void 0)kq=_q.default;else continue;L[Pq]=kq}let Q=YO.default.create();return Q.registerHelper("helperMissing",function(){throw new Error("Custom helpers are not supported")}),Q.compile(c.bodyContent,{strict:!0,noEscape:!1,preventIndent:!1})(L)},getParameters:async(r)=>{let A=await h(r),m=(await T(A.scope)).id[A.id];if(!m.isValid)w("TEMPLATE_INVALID",`Template has invalid front matter: ${A.id}`);return m.params}})};var WO=b_(()=>{ev();YO=IK(Qw(),1),TO=IK(wO(),1)});import{resolve as pK,dirname as CN}from"path";import{homedir as pN}from"os";import{existsSync as lN}from"fs";var nN=(_=process.cwd())=>{let q=pK(_),f=pK("/"),K=pK(pN(),".swic");while(q!==f){let $=pK(q,".swic");if($===K)throw new Error("Not in a project directory (found ~/.swic instead). Run swic from within a project.");if(lN($))return $;q=CN(q)}throw new Error("Could not find .swic directory. Are you in a SWIC project?")},HO;var hO=b_(()=>{HO=Object.freeze({findProjectRoot:nN})});var XO={};_7(XO,{default:()=>IN});import{mkdirSync as JO}from"fs";import{resolve as kO}from"path";import{homedir as RN}from"os";var lK="docs",nK="templates",EN=".index.json",ZO=(_,q)=>{try{JO(_,{recursive:!0}),JO(q,{recursive:!0})}catch(f){let K=f instanceof Error?f.message:String(f);throw new Error(`Failed to create swic directories. Please check permissions.
|
|
170
|
+
Project: ${_}
|
|
171
|
+
Shared: ${q}
|
|
172
|
+
Error: ${K}`)}},gN=()=>{let _;try{_=HO.findProjectRoot()}catch{_=kO(process.cwd(),".swic")}let q=kO(RN(),".swic"),f=`${_}/${lK}`,K=`${q}/${lK}`,$=`${_}/${nK}`,P=`${q}/${nK}`;return ZO(f,K),ZO($,P),{projectDataDir:_,sharedDataDir:q}},dN=(_)=>{let{projectBoundaryDir:q,sharedBoundaryDir:f}=_,K=`${q}/${lK}`,$=`${f}/${lK}`,P=`${q}/${nK}`,j=`${f}/${nK}`,v=Uf.create({boundaryDir:K}),w=Uf.create({boundaryDir:$}),O=Ff.create({boundaryDir:K}),T=Ff.create({boundaryDir:$}),Y=Uf.create({boundaryDir:P}),z=Uf.create({boundaryDir:j}),H=Ff.create({boundaryDir:P}),h=Ff.create({boundaryDir:j}),J=cv.create({fileServiceByScope:{project:v,shared:w},folderServiceByScope:{project:O,shared:T},indexFilename:EN}),k=zO({projectFileService:Y,projectFolderService:H,sharedFileService:z,sharedFolderService:h});return Object.freeze({DocService:J,TemplateService:k})},aN,IN;var AO=b_(()=>{av();iv();Lv();WO();hO();aN=Object.freeze({createServices:dN,lazilyGetDataDirs:gN}),IN=aN});var W={};_7(W,{void:()=>NY,util:()=>Kq,unknown:()=>MY,union:()=>nY,undefined:()=>rY,tuple:()=>gY,transformer:()=>tY,symbol:()=>mY,string:()=>Y7,strictObject:()=>lY,setErrorMap:()=>xO,set:()=>IY,record:()=>dY,quotelessJson:()=>tO,promise:()=>LY,preprocess:()=>sY,pipeline:()=>BY,ostring:()=>UY,optional:()=>eY,onumber:()=>FY,oboolean:()=>QY,objectUtil:()=>DK,object:()=>pY,number:()=>T7,nullable:()=>xY,null:()=>bY,never:()=>SY,nativeEnum:()=>cY,nan:()=>AY,map:()=>aY,makeIssue:()=>gf,literal:()=>iY,lazy:()=>yY,late:()=>ZY,isValid:()=>B_,isDirty:()=>a6,isAsync:()=>e8,isAborted:()=>d6,intersection:()=>EY,instanceof:()=>XY,getParsedType:()=>V_,getErrorMap:()=>t8,function:()=>DY,enum:()=>oY,effect:()=>tY,discriminatedUnion:()=>RY,defaultErrorMap:()=>I_,datetimeRegex:()=>v7,date:()=>GY,custom:()=>O7,coerce:()=>qT,boolean:()=>z7,bigint:()=>uY,array:()=>CY,any:()=>VY,addIssueToContext:()=>t,ZodVoid:()=>af,ZodUnknown:()=>U_,ZodUnion:()=>Q8,ZodUndefined:()=>U8,ZodType:()=>$q,ZodTuple:()=>S_,ZodTransformer:()=>h_,ZodSymbol:()=>df,ZodString:()=>T_,ZodSet:()=>m8,ZodSchema:()=>$q,ZodRecord:()=>If,ZodReadonly:()=>jf,ZodPromise:()=>r8,ZodPipeline:()=>of,ZodParsedType:()=>o,ZodOptional:()=>W_,ZodObject:()=>bq,ZodNumber:()=>F_,ZodNullable:()=>y_,ZodNull:()=>F8,ZodNever:()=>M_,ZodNativeEnum:()=>$f,ZodNaN:()=>yf,ZodMap:()=>Df,ZodLiteral:()=>ff,ZodLazy:()=>_f,ZodIssueCode:()=>y,ZodIntersection:()=>qf,ZodFunction:()=>s8,ZodFirstPartyTypeKind:()=>i,ZodError:()=>eq,ZodEnum:()=>q8,ZodEffects:()=>h_,ZodDiscriminatedUnion:()=>I6,ZodDefault:()=>Kf,ZodDate:()=>u8,ZodCatch:()=>Pf,ZodBranded:()=>D6,ZodBoolean:()=>B8,ZodBigInt:()=>Q_,ZodArray:()=>z_,ZodAny:()=>G8,Schema:()=>$q,ParseStatus:()=>aq,OK:()=>yq,NEVER:()=>_T,INVALID:()=>U,EMPTY_PATH:()=>sO,DIRTY:()=>A8,BRAND:()=>kY});var Kq;(function(_){_.assertEqual=($)=>{};function q($){}_.assertIs=q;function f($){throw new Error}_.assertNever=f,_.arrayToEnum=($)=>{let P={};for(let j of $)P[j]=j;return P},_.getValidEnumValues=($)=>{let P=_.objectKeys($).filter((v)=>typeof $[$[v]]!=="number"),j={};for(let v of P)j[v]=$[v];return _.objectValues(j)},_.objectValues=($)=>{return _.objectKeys($).map(function(P){return $[P]})},_.objectKeys=typeof Object.keys==="function"?($)=>Object.keys($):($)=>{let P=[];for(let j in $)if(Object.prototype.hasOwnProperty.call($,j))P.push(j);return P},_.find=($,P)=>{for(let j of $)if(P(j))return j;return},_.isInteger=typeof Number.isInteger==="function"?($)=>Number.isInteger($):($)=>typeof $==="number"&&Number.isFinite($)&&Math.floor($)===$;function K($,P=" | "){return $.map((j)=>typeof j==="string"?`'${j}'`:j).join(P)}_.joinValues=K,_.jsonStringifyReplacer=($,P)=>{if(typeof P==="bigint")return P.toString();return P}})(Kq||(Kq={}));var DK;(function(_){_.mergeShapes=(q,f)=>{return{...q,...f}}})(DK||(DK={}));var o=Kq.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),V_=(_)=>{switch(typeof _){case"undefined":return o.undefined;case"string":return o.string;case"number":return Number.isNaN(_)?o.nan:o.number;case"boolean":return o.boolean;case"function":return o.function;case"bigint":return o.bigint;case"symbol":return o.symbol;case"object":if(Array.isArray(_))return o.array;if(_===null)return o.null;if(_.then&&typeof _.then==="function"&&_.catch&&typeof _.catch==="function")return o.promise;if(typeof Map!=="undefined"&&_ instanceof Map)return o.map;if(typeof Set!=="undefined"&&_ instanceof Set)return o.set;if(typeof Date!=="undefined"&&_ instanceof Date)return o.date;return o.object;default:return o.unknown}};var y=Kq.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),tO=(_)=>{return JSON.stringify(_,null,2).replace(/"([^"]+)":/g,"$1:")};class eq extends Error{get errors(){return this.issues}constructor(_){super();this.issues=[],this.addIssue=(f)=>{this.issues=[...this.issues,f]},this.addIssues=(f=[])=>{this.issues=[...this.issues,...f]};let q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,q);else this.__proto__=q;this.name="ZodError",this.issues=_}format(_){let q=_||function($){return $.message},f={_errors:[]},K=($)=>{for(let P of $.issues)if(P.code==="invalid_union")P.unionErrors.map(K);else if(P.code==="invalid_return_type")K(P.returnTypeError);else if(P.code==="invalid_arguments")K(P.argumentsError);else if(P.path.length===0)f._errors.push(q(P));else{let j=f,v=0;while(v<P.path.length){let w=P.path[v];if(v!==P.path.length-1)j[w]=j[w]||{_errors:[]};else j[w]=j[w]||{_errors:[]},j[w]._errors.push(q(P));j=j[w],v++}}};return K(this),f}static assert(_){if(!(_ instanceof eq))throw new Error(`Not a ZodError: ${_}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Kq.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(_=(q)=>q.message){let q={},f=[];for(let K of this.issues)if(K.path.length>0){let $=K.path[0];q[$]=q[$]||[],q[$].push(_(K))}else f.push(_(K));return{formErrors:f,fieldErrors:q}}get formErrors(){return this.flatten()}}eq.create=(_)=>{return new eq(_)};var eO=(_,q)=>{let f;switch(_.code){case y.invalid_type:if(_.received===o.undefined)f="Required";else f=`Expected ${_.expected}, received ${_.received}`;break;case y.invalid_literal:f=`Invalid literal value, expected ${JSON.stringify(_.expected,Kq.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:f=`Unrecognized key(s) in object: ${Kq.joinValues(_.keys,", ")}`;break;case y.invalid_union:f="Invalid input";break;case y.invalid_union_discriminator:f=`Invalid discriminator value. Expected ${Kq.joinValues(_.options)}`;break;case y.invalid_enum_value:f=`Invalid enum value. Expected ${Kq.joinValues(_.options)}, received '${_.received}'`;break;case y.invalid_arguments:f="Invalid function arguments";break;case y.invalid_return_type:f="Invalid function return type";break;case y.invalid_date:f="Invalid date";break;case y.invalid_string:if(typeof _.validation==="object")if("includes"in _.validation){if(f=`Invalid input: must include "${_.validation.includes}"`,typeof _.validation.position==="number")f=`${f} at one or more positions greater than or equal to ${_.validation.position}`}else if("startsWith"in _.validation)f=`Invalid input: must start with "${_.validation.startsWith}"`;else if("endsWith"in _.validation)f=`Invalid input: must end with "${_.validation.endsWith}"`;else Kq.assertNever(_.validation);else if(_.validation!=="regex")f=`Invalid ${_.validation}`;else f="Invalid";break;case y.too_small:if(_.type==="array")f=`Array must contain ${_.exact?"exactly":_.inclusive?"at least":"more than"} ${_.minimum} element(s)`;else if(_.type==="string")f=`String must contain ${_.exact?"exactly":_.inclusive?"at least":"over"} ${_.minimum} character(s)`;else if(_.type==="number")f=`Number must be ${_.exact?"exactly equal to ":_.inclusive?"greater than or equal to ":"greater than "}${_.minimum}`;else if(_.type==="bigint")f=`Number must be ${_.exact?"exactly equal to ":_.inclusive?"greater than or equal to ":"greater than "}${_.minimum}`;else if(_.type==="date")f=`Date must be ${_.exact?"exactly equal to ":_.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(_.minimum))}`;else f="Invalid input";break;case y.too_big:if(_.type==="array")f=`Array must contain ${_.exact?"exactly":_.inclusive?"at most":"less than"} ${_.maximum} element(s)`;else if(_.type==="string")f=`String must contain ${_.exact?"exactly":_.inclusive?"at most":"under"} ${_.maximum} character(s)`;else if(_.type==="number")f=`Number must be ${_.exact?"exactly":_.inclusive?"less than or equal to":"less than"} ${_.maximum}`;else if(_.type==="bigint")f=`BigInt must be ${_.exact?"exactly":_.inclusive?"less than or equal to":"less than"} ${_.maximum}`;else if(_.type==="date")f=`Date must be ${_.exact?"exactly":_.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(_.maximum))}`;else f="Invalid input";break;case y.custom:f="Invalid input";break;case y.invalid_intersection_types:f="Intersection results could not be merged";break;case y.not_multiple_of:f=`Number must be a multiple of ${_.multipleOf}`;break;case y.not_finite:f="Number must be finite";break;default:f=q.defaultError,Kq.assertNever(_)}return{message:f}},I_=eO;var f7=I_;function xO(_){f7=_}function t8(){return f7}var gf=(_)=>{let{data:q,path:f,errorMaps:K,issueData:$}=_,P=[...f,...$.path||[]],j={...$,path:P};if($.message!==void 0)return{...$,path:P,message:$.message};let v="",w=K.filter((O)=>!!O).slice().reverse();for(let O of w)v=O(j,{data:q,defaultError:v}).message;return{...$,path:P,message:v}},sO=[];function t(_,q){let f=t8(),K=gf({issueData:q,data:_.data,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,f,f===I_?void 0:I_].filter(($)=>!!$)});_.common.issues.push(K)}class aq{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(_,q){let f=[];for(let K of q){if(K.status==="aborted")return U;if(K.status==="dirty")_.dirty();f.push(K.value)}return{status:_.value,value:f}}static async mergeObjectAsync(_,q){let f=[];for(let K of q){let $=await K.key,P=await K.value;f.push({key:$,value:P})}return aq.mergeObjectSync(_,f)}static mergeObjectSync(_,q){let f={};for(let K of q){let{key:$,value:P}=K;if($.status==="aborted")return U;if(P.status==="aborted")return U;if($.status==="dirty")_.dirty();if(P.status==="dirty")_.dirty();if($.value!=="__proto__"&&(typeof P.value!=="undefined"||K.alwaysSet))f[$.value]=P.value}return{status:_.value,value:f}}}var U=Object.freeze({status:"aborted"}),A8=(_)=>({status:"dirty",value:_}),yq=(_)=>({status:"valid",value:_}),d6=(_)=>_.status==="aborted",a6=(_)=>_.status==="dirty",B_=(_)=>_.status==="valid",e8=(_)=>typeof Promise!=="undefined"&&_ instanceof Promise;var B;(function(_){_.errToObj=(q)=>typeof q==="string"?{message:q}:q||{},_.toString=(q)=>typeof q==="string"?q:q?.message})(B||(B={}));class H_{constructor(_,q,f,K){this._cachedPath=[],this.parent=_,this.data=q,this._path=f,this._key=K}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var $7=(_,q)=>{if(B_(q))return{success:!0,data:q.value};else{if(!_.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let f=new eq(_.common.issues);return this._error=f,this._error}}}};function qq(_){if(!_)return{};let{errorMap:q,invalid_type_error:f,required_error:K,description:$}=_;if(q&&(f||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(q)return{errorMap:q,description:$};return{errorMap:(j,v)=>{let{message:w}=_;if(j.code==="invalid_enum_value")return{message:w??v.defaultError};if(typeof v.data==="undefined")return{message:w??K??v.defaultError};if(j.code!=="invalid_type")return{message:v.defaultError};return{message:w??f??v.defaultError}},description:$}}class $q{get description(){return this._def.description}_getType(_){return V_(_.data)}_getOrReturnCtx(_,q){return q||{common:_.parent.common,data:_.data,parsedType:V_(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}_processInputParams(_){return{status:new aq,ctx:{common:_.parent.common,data:_.data,parsedType:V_(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}}_parseSync(_){let q=this._parse(_);if(e8(q))throw new Error("Synchronous parse encountered promise.");return q}_parseAsync(_){let q=this._parse(_);return Promise.resolve(q)}parse(_,q){let f=this.safeParse(_,q);if(f.success)return f.data;throw f.error}safeParse(_,q){let f={common:{issues:[],async:q?.async??!1,contextualErrorMap:q?.errorMap},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:V_(_)},K=this._parseSync({data:_,path:f.path,parent:f});return $7(f,K)}"~validate"(_){let q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:V_(_)};if(!this["~standard"].async)try{let f=this._parseSync({data:_,path:[],parent:q});return B_(f)?{value:f.value}:{issues:q.common.issues}}catch(f){if(f?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;q.common={issues:[],async:!0}}return this._parseAsync({data:_,path:[],parent:q}).then((f)=>B_(f)?{value:f.value}:{issues:q.common.issues})}async parseAsync(_,q){let f=await this.safeParseAsync(_,q);if(f.success)return f.data;throw f.error}async safeParseAsync(_,q){let f={common:{issues:[],contextualErrorMap:q?.errorMap,async:!0},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:V_(_)},K=this._parse({data:_,path:f.path,parent:f}),$=await(e8(K)?K:Promise.resolve(K));return $7(f,$)}refine(_,q){let f=(K)=>{if(typeof q==="string"||typeof q==="undefined")return{message:q};else if(typeof q==="function")return q(K);else return q};return this._refinement((K,$)=>{let P=_(K),j=()=>$.addIssue({code:y.custom,...f(K)});if(typeof Promise!=="undefined"&&P instanceof Promise)return P.then((v)=>{if(!v)return j(),!1;else return!0});if(!P)return j(),!1;else return!0})}refinement(_,q){return this._refinement((f,K)=>{if(!_(f))return K.addIssue(typeof q==="function"?q(f,K):q),!1;else return!0})}_refinement(_){return new h_({schema:this,typeName:i.ZodEffects,effect:{type:"refinement",refinement:_}})}superRefine(_){return this._refinement(_)}constructor(_){this.spa=this.safeParseAsync,this._def=_,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(q)=>this["~validate"](q)}}optional(){return W_.create(this,this._def)}nullable(){return y_.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return z_.create(this)}promise(){return r8.create(this,this._def)}or(_){return Q8.create([this,_],this._def)}and(_){return qf.create(this,_,this._def)}transform(_){return new h_({...qq(this._def),schema:this,typeName:i.ZodEffects,effect:{type:"transform",transform:_}})}default(_){let q=typeof _==="function"?_:()=>_;return new Kf({...qq(this._def),innerType:this,defaultValue:q,typeName:i.ZodDefault})}brand(){return new D6({typeName:i.ZodBranded,type:this,...qq(this._def)})}catch(_){let q=typeof _==="function"?_:()=>_;return new Pf({...qq(this._def),innerType:this,catchValue:q,typeName:i.ZodCatch})}describe(_){return new this.constructor({...this._def,description:_})}pipe(_){return of.create(this,_)}readonly(){return jf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var BO=/^c[^\s-]{8,}$/i,UO=/^[0-9a-z]+$/,FO=/^[0-9A-HJKMNP-TV-Z]{26}$/i,QO=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qY=/^[a-z0-9_-]{21}$/i,_Y=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fY=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$Y=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yK,PY=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,jY=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,vY=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,wY=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,OY=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,YY=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,P7="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",TY=new RegExp(`^${P7}$`);function j7(_){let q="[0-5]\\d";if(_.precision)q=`${q}\\.\\d{${_.precision}}`;else if(_.precision==null)q=`${q}(\\.\\d+)?`;let f=_.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${q})${f}`}function zY(_){return new RegExp(`^${j7(_)}$`)}function v7(_){let q=`${P7}T${j7(_)}`,f=[];if(f.push(_.local?"Z?":"Z"),_.offset)f.push("([+-]\\d{2}:?\\d{2})");return q=`${q}(${f.join("|")})`,new RegExp(`^${q}$`)}function WY(_,q){if((q==="v4"||!q)&&PY.test(_))return!0;if((q==="v6"||!q)&&vY.test(_))return!0;return!1}function HY(_,q){if(!_Y.test(_))return!1;try{let[f]=_.split(".");if(!f)return!1;let K=f.replace(/-/g,"+").replace(/_/g,"/").padEnd(f.length+(4-f.length%4)%4,"="),$=JSON.parse(atob(K));if(typeof $!=="object"||$===null)return!1;if("typ"in $&&$?.typ!=="JWT")return!1;if(!$.alg)return!1;if(q&&$.alg!==q)return!1;return!0}catch{return!1}}function hY(_,q){if((q==="v4"||!q)&&jY.test(_))return!0;if((q==="v6"||!q)&&wY.test(_))return!0;return!1}class T_ extends $q{_parse(_){if(this._def.coerce)_.data=String(_.data);if(this._getType(_)!==o.string){let $=this._getOrReturnCtx(_);return t($,{code:y.invalid_type,expected:o.string,received:$.parsedType}),U}let f=new aq,K=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(_.data.length<$.value)K=this._getOrReturnCtx(_,K),t(K,{code:y.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),f.dirty()}else if($.kind==="max"){if(_.data.length>$.value)K=this._getOrReturnCtx(_,K),t(K,{code:y.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),f.dirty()}else if($.kind==="length"){let P=_.data.length>$.value,j=_.data.length<$.value;if(P||j){if(K=this._getOrReturnCtx(_,K),P)t(K,{code:y.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});else if(j)t(K,{code:y.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});f.dirty()}}else if($.kind==="email"){if(!$Y.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"email",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="emoji"){if(!yK)yK=new RegExp(KY,"u");if(!yK.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"emoji",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="uuid"){if(!QO.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"uuid",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="nanoid"){if(!qY.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"nanoid",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="cuid"){if(!BO.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"cuid",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="cuid2"){if(!UO.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"cuid2",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="ulid"){if(!FO.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"ulid",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="url")try{new URL(_.data)}catch{K=this._getOrReturnCtx(_,K),t(K,{validation:"url",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="regex"){if($.regex.lastIndex=0,!$.regex.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"regex",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="trim")_.data=_.data.trim();else if($.kind==="includes"){if(!_.data.includes($.value,$.position))K=this._getOrReturnCtx(_,K),t(K,{code:y.invalid_string,validation:{includes:$.value,position:$.position},message:$.message}),f.dirty()}else if($.kind==="toLowerCase")_.data=_.data.toLowerCase();else if($.kind==="toUpperCase")_.data=_.data.toUpperCase();else if($.kind==="startsWith"){if(!_.data.startsWith($.value))K=this._getOrReturnCtx(_,K),t(K,{code:y.invalid_string,validation:{startsWith:$.value},message:$.message}),f.dirty()}else if($.kind==="endsWith"){if(!_.data.endsWith($.value))K=this._getOrReturnCtx(_,K),t(K,{code:y.invalid_string,validation:{endsWith:$.value},message:$.message}),f.dirty()}else if($.kind==="datetime"){if(!v7($).test(_.data))K=this._getOrReturnCtx(_,K),t(K,{code:y.invalid_string,validation:"datetime",message:$.message}),f.dirty()}else if($.kind==="date"){if(!TY.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{code:y.invalid_string,validation:"date",message:$.message}),f.dirty()}else if($.kind==="time"){if(!zY($).test(_.data))K=this._getOrReturnCtx(_,K),t(K,{code:y.invalid_string,validation:"time",message:$.message}),f.dirty()}else if($.kind==="duration"){if(!fY.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"duration",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="ip"){if(!WY(_.data,$.version))K=this._getOrReturnCtx(_,K),t(K,{validation:"ip",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="jwt"){if(!HY(_.data,$.alg))K=this._getOrReturnCtx(_,K),t(K,{validation:"jwt",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="cidr"){if(!hY(_.data,$.version))K=this._getOrReturnCtx(_,K),t(K,{validation:"cidr",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="base64"){if(!OY.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"base64",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="base64url"){if(!YY.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"base64url",code:y.invalid_string,message:$.message}),f.dirty()}else Kq.assertNever($);return{status:f.value,value:_.data}}_regex(_,q,f){return this.refinement((K)=>_.test(K),{validation:q,code:y.invalid_string,...B.errToObj(f)})}_addCheck(_){return new T_({...this._def,checks:[...this._def.checks,_]})}email(_){return this._addCheck({kind:"email",...B.errToObj(_)})}url(_){return this._addCheck({kind:"url",...B.errToObj(_)})}emoji(_){return this._addCheck({kind:"emoji",...B.errToObj(_)})}uuid(_){return this._addCheck({kind:"uuid",...B.errToObj(_)})}nanoid(_){return this._addCheck({kind:"nanoid",...B.errToObj(_)})}cuid(_){return this._addCheck({kind:"cuid",...B.errToObj(_)})}cuid2(_){return this._addCheck({kind:"cuid2",...B.errToObj(_)})}ulid(_){return this._addCheck({kind:"ulid",...B.errToObj(_)})}base64(_){return this._addCheck({kind:"base64",...B.errToObj(_)})}base64url(_){return this._addCheck({kind:"base64url",...B.errToObj(_)})}jwt(_){return this._addCheck({kind:"jwt",...B.errToObj(_)})}ip(_){return this._addCheck({kind:"ip",...B.errToObj(_)})}cidr(_){return this._addCheck({kind:"cidr",...B.errToObj(_)})}datetime(_){if(typeof _==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:_});return this._addCheck({kind:"datetime",precision:typeof _?.precision==="undefined"?null:_?.precision,offset:_?.offset??!1,local:_?.local??!1,...B.errToObj(_?.message)})}date(_){return this._addCheck({kind:"date",message:_})}time(_){if(typeof _==="string")return this._addCheck({kind:"time",precision:null,message:_});return this._addCheck({kind:"time",precision:typeof _?.precision==="undefined"?null:_?.precision,...B.errToObj(_?.message)})}duration(_){return this._addCheck({kind:"duration",...B.errToObj(_)})}regex(_,q){return this._addCheck({kind:"regex",regex:_,...B.errToObj(q)})}includes(_,q){return this._addCheck({kind:"includes",value:_,position:q?.position,...B.errToObj(q?.message)})}startsWith(_,q){return this._addCheck({kind:"startsWith",value:_,...B.errToObj(q)})}endsWith(_,q){return this._addCheck({kind:"endsWith",value:_,...B.errToObj(q)})}min(_,q){return this._addCheck({kind:"min",value:_,...B.errToObj(q)})}max(_,q){return this._addCheck({kind:"max",value:_,...B.errToObj(q)})}length(_,q){return this._addCheck({kind:"length",value:_,...B.errToObj(q)})}nonempty(_){return this.min(1,B.errToObj(_))}trim(){return new T_({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new T_({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new T_({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((_)=>_.kind==="datetime")}get isDate(){return!!this._def.checks.find((_)=>_.kind==="date")}get isTime(){return!!this._def.checks.find((_)=>_.kind==="time")}get isDuration(){return!!this._def.checks.find((_)=>_.kind==="duration")}get isEmail(){return!!this._def.checks.find((_)=>_.kind==="email")}get isURL(){return!!this._def.checks.find((_)=>_.kind==="url")}get isEmoji(){return!!this._def.checks.find((_)=>_.kind==="emoji")}get isUUID(){return!!this._def.checks.find((_)=>_.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((_)=>_.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((_)=>_.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((_)=>_.kind==="cuid2")}get isULID(){return!!this._def.checks.find((_)=>_.kind==="ulid")}get isIP(){return!!this._def.checks.find((_)=>_.kind==="ip")}get isCIDR(){return!!this._def.checks.find((_)=>_.kind==="cidr")}get isBase64(){return!!this._def.checks.find((_)=>_.kind==="base64")}get isBase64url(){return!!this._def.checks.find((_)=>_.kind==="base64url")}get minLength(){let _=null;for(let q of this._def.checks)if(q.kind==="min"){if(_===null||q.value>_)_=q.value}return _}get maxLength(){let _=null;for(let q of this._def.checks)if(q.kind==="max"){if(_===null||q.value<_)_=q.value}return _}}T_.create=(_)=>{return new T_({checks:[],typeName:i.ZodString,coerce:_?.coerce??!1,...qq(_)})};function JY(_,q){let f=(_.toString().split(".")[1]||"").length,K=(q.toString().split(".")[1]||"").length,$=f>K?f:K,P=Number.parseInt(_.toFixed($).replace(".","")),j=Number.parseInt(q.toFixed($).replace(".",""));return P%j/10**$}class F_ extends $q{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(_){if(this._def.coerce)_.data=Number(_.data);if(this._getType(_)!==o.number){let $=this._getOrReturnCtx(_);return t($,{code:y.invalid_type,expected:o.number,received:$.parsedType}),U}let f=void 0,K=new aq;for(let $ of this._def.checks)if($.kind==="int"){if(!Kq.isInteger(_.data))f=this._getOrReturnCtx(_,f),t(f,{code:y.invalid_type,expected:"integer",received:"float",message:$.message}),K.dirty()}else if($.kind==="min"){if($.inclusive?_.data<$.value:_.data<=$.value)f=this._getOrReturnCtx(_,f),t(f,{code:y.too_small,minimum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),K.dirty()}else if($.kind==="max"){if($.inclusive?_.data>$.value:_.data>=$.value)f=this._getOrReturnCtx(_,f),t(f,{code:y.too_big,maximum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),K.dirty()}else if($.kind==="multipleOf"){if(JY(_.data,$.value)!==0)f=this._getOrReturnCtx(_,f),t(f,{code:y.not_multiple_of,multipleOf:$.value,message:$.message}),K.dirty()}else if($.kind==="finite"){if(!Number.isFinite(_.data))f=this._getOrReturnCtx(_,f),t(f,{code:y.not_finite,message:$.message}),K.dirty()}else Kq.assertNever($);return{status:K.value,value:_.data}}gte(_,q){return this.setLimit("min",_,!0,B.toString(q))}gt(_,q){return this.setLimit("min",_,!1,B.toString(q))}lte(_,q){return this.setLimit("max",_,!0,B.toString(q))}lt(_,q){return this.setLimit("max",_,!1,B.toString(q))}setLimit(_,q,f,K){return new F_({...this._def,checks:[...this._def.checks,{kind:_,value:q,inclusive:f,message:B.toString(K)}]})}_addCheck(_){return new F_({...this._def,checks:[...this._def.checks,_]})}int(_){return this._addCheck({kind:"int",message:B.toString(_)})}positive(_){return this._addCheck({kind:"min",value:0,inclusive:!1,message:B.toString(_)})}negative(_){return this._addCheck({kind:"max",value:0,inclusive:!1,message:B.toString(_)})}nonpositive(_){return this._addCheck({kind:"max",value:0,inclusive:!0,message:B.toString(_)})}nonnegative(_){return this._addCheck({kind:"min",value:0,inclusive:!0,message:B.toString(_)})}multipleOf(_,q){return this._addCheck({kind:"multipleOf",value:_,message:B.toString(q)})}finite(_){return this._addCheck({kind:"finite",message:B.toString(_)})}safe(_){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:B.toString(_)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:B.toString(_)})}get minValue(){let _=null;for(let q of this._def.checks)if(q.kind==="min"){if(_===null||q.value>_)_=q.value}return _}get maxValue(){let _=null;for(let q of this._def.checks)if(q.kind==="max"){if(_===null||q.value<_)_=q.value}return _}get isInt(){return!!this._def.checks.find((_)=>_.kind==="int"||_.kind==="multipleOf"&&Kq.isInteger(_.value))}get isFinite(){let _=null,q=null;for(let f of this._def.checks)if(f.kind==="finite"||f.kind==="int"||f.kind==="multipleOf")return!0;else if(f.kind==="min"){if(q===null||f.value>q)q=f.value}else if(f.kind==="max"){if(_===null||f.value<_)_=f.value}return Number.isFinite(q)&&Number.isFinite(_)}}F_.create=(_)=>{return new F_({checks:[],typeName:i.ZodNumber,coerce:_?.coerce||!1,...qq(_)})};class Q_ extends $q{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(_){if(this._def.coerce)try{_.data=BigInt(_.data)}catch{return this._getInvalidInput(_)}if(this._getType(_)!==o.bigint)return this._getInvalidInput(_);let f=void 0,K=new aq;for(let $ of this._def.checks)if($.kind==="min"){if($.inclusive?_.data<$.value:_.data<=$.value)f=this._getOrReturnCtx(_,f),t(f,{code:y.too_small,type:"bigint",minimum:$.value,inclusive:$.inclusive,message:$.message}),K.dirty()}else if($.kind==="max"){if($.inclusive?_.data>$.value:_.data>=$.value)f=this._getOrReturnCtx(_,f),t(f,{code:y.too_big,type:"bigint",maximum:$.value,inclusive:$.inclusive,message:$.message}),K.dirty()}else if($.kind==="multipleOf"){if(_.data%$.value!==BigInt(0))f=this._getOrReturnCtx(_,f),t(f,{code:y.not_multiple_of,multipleOf:$.value,message:$.message}),K.dirty()}else Kq.assertNever($);return{status:K.value,value:_.data}}_getInvalidInput(_){let q=this._getOrReturnCtx(_);return t(q,{code:y.invalid_type,expected:o.bigint,received:q.parsedType}),U}gte(_,q){return this.setLimit("min",_,!0,B.toString(q))}gt(_,q){return this.setLimit("min",_,!1,B.toString(q))}lte(_,q){return this.setLimit("max",_,!0,B.toString(q))}lt(_,q){return this.setLimit("max",_,!1,B.toString(q))}setLimit(_,q,f,K){return new Q_({...this._def,checks:[...this._def.checks,{kind:_,value:q,inclusive:f,message:B.toString(K)}]})}_addCheck(_){return new Q_({...this._def,checks:[...this._def.checks,_]})}positive(_){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:B.toString(_)})}negative(_){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:B.toString(_)})}nonpositive(_){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:B.toString(_)})}nonnegative(_){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:B.toString(_)})}multipleOf(_,q){return this._addCheck({kind:"multipleOf",value:_,message:B.toString(q)})}get minValue(){let _=null;for(let q of this._def.checks)if(q.kind==="min"){if(_===null||q.value>_)_=q.value}return _}get maxValue(){let _=null;for(let q of this._def.checks)if(q.kind==="max"){if(_===null||q.value<_)_=q.value}return _}}Q_.create=(_)=>{return new Q_({checks:[],typeName:i.ZodBigInt,coerce:_?.coerce??!1,...qq(_)})};class B8 extends $q{_parse(_){if(this._def.coerce)_.data=Boolean(_.data);if(this._getType(_)!==o.boolean){let f=this._getOrReturnCtx(_);return t(f,{code:y.invalid_type,expected:o.boolean,received:f.parsedType}),U}return yq(_.data)}}B8.create=(_)=>{return new B8({typeName:i.ZodBoolean,coerce:_?.coerce||!1,...qq(_)})};class u8 extends $q{_parse(_){if(this._def.coerce)_.data=new Date(_.data);if(this._getType(_)!==o.date){let $=this._getOrReturnCtx(_);return t($,{code:y.invalid_type,expected:o.date,received:$.parsedType}),U}if(Number.isNaN(_.data.getTime())){let $=this._getOrReturnCtx(_);return t($,{code:y.invalid_date}),U}let f=new aq,K=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(_.data.getTime()<$.value)K=this._getOrReturnCtx(_,K),t(K,{code:y.too_small,message:$.message,inclusive:!0,exact:!1,minimum:$.value,type:"date"}),f.dirty()}else if($.kind==="max"){if(_.data.getTime()>$.value)K=this._getOrReturnCtx(_,K),t(K,{code:y.too_big,message:$.message,inclusive:!0,exact:!1,maximum:$.value,type:"date"}),f.dirty()}else Kq.assertNever($);return{status:f.value,value:new Date(_.data.getTime())}}_addCheck(_){return new u8({...this._def,checks:[...this._def.checks,_]})}min(_,q){return this._addCheck({kind:"min",value:_.getTime(),message:B.toString(q)})}max(_,q){return this._addCheck({kind:"max",value:_.getTime(),message:B.toString(q)})}get minDate(){let _=null;for(let q of this._def.checks)if(q.kind==="min"){if(_===null||q.value>_)_=q.value}return _!=null?new Date(_):null}get maxDate(){let _=null;for(let q of this._def.checks)if(q.kind==="max"){if(_===null||q.value<_)_=q.value}return _!=null?new Date(_):null}}u8.create=(_)=>{return new u8({checks:[],coerce:_?.coerce||!1,typeName:i.ZodDate,...qq(_)})};class df extends $q{_parse(_){if(this._getType(_)!==o.symbol){let f=this._getOrReturnCtx(_);return t(f,{code:y.invalid_type,expected:o.symbol,received:f.parsedType}),U}return yq(_.data)}}df.create=(_)=>{return new df({typeName:i.ZodSymbol,...qq(_)})};class U8 extends $q{_parse(_){if(this._getType(_)!==o.undefined){let f=this._getOrReturnCtx(_);return t(f,{code:y.invalid_type,expected:o.undefined,received:f.parsedType}),U}return yq(_.data)}}U8.create=(_)=>{return new U8({typeName:i.ZodUndefined,...qq(_)})};class F8 extends $q{_parse(_){if(this._getType(_)!==o.null){let f=this._getOrReturnCtx(_);return t(f,{code:y.invalid_type,expected:o.null,received:f.parsedType}),U}return yq(_.data)}}F8.create=(_)=>{return new F8({typeName:i.ZodNull,...qq(_)})};class G8 extends $q{constructor(){super(...arguments);this._any=!0}_parse(_){return yq(_.data)}}G8.create=(_)=>{return new G8({typeName:i.ZodAny,...qq(_)})};class U_ extends $q{constructor(){super(...arguments);this._unknown=!0}_parse(_){return yq(_.data)}}U_.create=(_)=>{return new U_({typeName:i.ZodUnknown,...qq(_)})};class M_ extends $q{_parse(_){let q=this._getOrReturnCtx(_);return t(q,{code:y.invalid_type,expected:o.never,received:q.parsedType}),U}}M_.create=(_)=>{return new M_({typeName:i.ZodNever,...qq(_)})};class af extends $q{_parse(_){if(this._getType(_)!==o.undefined){let f=this._getOrReturnCtx(_);return t(f,{code:y.invalid_type,expected:o.void,received:f.parsedType}),U}return yq(_.data)}}af.create=(_)=>{return new af({typeName:i.ZodVoid,...qq(_)})};class z_ extends $q{_parse(_){let{ctx:q,status:f}=this._processInputParams(_),K=this._def;if(q.parsedType!==o.array)return t(q,{code:y.invalid_type,expected:o.array,received:q.parsedType}),U;if(K.exactLength!==null){let P=q.data.length>K.exactLength.value,j=q.data.length<K.exactLength.value;if(P||j)t(q,{code:P?y.too_big:y.too_small,minimum:j?K.exactLength.value:void 0,maximum:P?K.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:K.exactLength.message}),f.dirty()}if(K.minLength!==null){if(q.data.length<K.minLength.value)t(q,{code:y.too_small,minimum:K.minLength.value,type:"array",inclusive:!0,exact:!1,message:K.minLength.message}),f.dirty()}if(K.maxLength!==null){if(q.data.length>K.maxLength.value)t(q,{code:y.too_big,maximum:K.maxLength.value,type:"array",inclusive:!0,exact:!1,message:K.maxLength.message}),f.dirty()}if(q.common.async)return Promise.all([...q.data].map((P,j)=>{return K.type._parseAsync(new H_(q,P,q.path,j))})).then((P)=>{return aq.mergeArray(f,P)});let $=[...q.data].map((P,j)=>{return K.type._parseSync(new H_(q,P,q.path,j))});return aq.mergeArray(f,$)}get element(){return this._def.type}min(_,q){return new z_({...this._def,minLength:{value:_,message:B.toString(q)}})}max(_,q){return new z_({...this._def,maxLength:{value:_,message:B.toString(q)}})}length(_,q){return new z_({...this._def,exactLength:{value:_,message:B.toString(q)}})}nonempty(_){return this.min(1,_)}}z_.create=(_,q)=>{return new z_({type:_,minLength:null,maxLength:null,exactLength:null,typeName:i.ZodArray,...qq(q)})};function x8(_){if(_ instanceof bq){let q={};for(let f in _.shape){let K=_.shape[f];q[f]=W_.create(x8(K))}return new bq({..._._def,shape:()=>q})}else if(_ instanceof z_)return new z_({..._._def,type:x8(_.element)});else if(_ instanceof W_)return W_.create(x8(_.unwrap()));else if(_ instanceof y_)return y_.create(x8(_.unwrap()));else if(_ instanceof S_)return S_.create(_.items.map((q)=>x8(q)));else return _}class bq extends $q{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let _=this._def.shape(),q=Kq.objectKeys(_);return this._cached={shape:_,keys:q},this._cached}_parse(_){if(this._getType(_)!==o.object){let w=this._getOrReturnCtx(_);return t(w,{code:y.invalid_type,expected:o.object,received:w.parsedType}),U}let{status:f,ctx:K}=this._processInputParams(_),{shape:$,keys:P}=this._getCached(),j=[];if(!(this._def.catchall instanceof M_&&this._def.unknownKeys==="strip")){for(let w in K.data)if(!P.includes(w))j.push(w)}let v=[];for(let w of P){let O=$[w],T=K.data[w];v.push({key:{status:"valid",value:w},value:O._parse(new H_(K,T,K.path,w)),alwaysSet:w in K.data})}if(this._def.catchall instanceof M_){let w=this._def.unknownKeys;if(w==="passthrough")for(let O of j)v.push({key:{status:"valid",value:O},value:{status:"valid",value:K.data[O]}});else if(w==="strict"){if(j.length>0)t(K,{code:y.unrecognized_keys,keys:j}),f.dirty()}else if(w==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let w=this._def.catchall;for(let O of j){let T=K.data[O];v.push({key:{status:"valid",value:O},value:w._parse(new H_(K,T,K.path,O)),alwaysSet:O in K.data})}}if(K.common.async)return Promise.resolve().then(async()=>{let w=[];for(let O of v){let T=await O.key,Y=await O.value;w.push({key:T,value:Y,alwaysSet:O.alwaysSet})}return w}).then((w)=>{return aq.mergeObjectSync(f,w)});else return aq.mergeObjectSync(f,v)}get shape(){return this._def.shape()}strict(_){return B.errToObj,new bq({...this._def,unknownKeys:"strict",..._!==void 0?{errorMap:(q,f)=>{let K=this._def.errorMap?.(q,f).message??f.defaultError;if(q.code==="unrecognized_keys")return{message:B.errToObj(_).message??K};return{message:K}}}:{}})}strip(){return new bq({...this._def,unknownKeys:"strip"})}passthrough(){return new bq({...this._def,unknownKeys:"passthrough"})}extend(_){return new bq({...this._def,shape:()=>({...this._def.shape(),..._})})}merge(_){return new bq({unknownKeys:_._def.unknownKeys,catchall:_._def.catchall,shape:()=>({...this._def.shape(),..._._def.shape()}),typeName:i.ZodObject})}setKey(_,q){return this.augment({[_]:q})}catchall(_){return new bq({...this._def,catchall:_})}pick(_){let q={};for(let f of Kq.objectKeys(_))if(_[f]&&this.shape[f])q[f]=this.shape[f];return new bq({...this._def,shape:()=>q})}omit(_){let q={};for(let f of Kq.objectKeys(this.shape))if(!_[f])q[f]=this.shape[f];return new bq({...this._def,shape:()=>q})}deepPartial(){return x8(this)}partial(_){let q={};for(let f of Kq.objectKeys(this.shape)){let K=this.shape[f];if(_&&!_[f])q[f]=K;else q[f]=K.optional()}return new bq({...this._def,shape:()=>q})}required(_){let q={};for(let f of Kq.objectKeys(this.shape))if(_&&!_[f])q[f]=this.shape[f];else{let $=this.shape[f];while($ instanceof W_)$=$._def.innerType;q[f]=$}return new bq({...this._def,shape:()=>q})}keyof(){return w7(Kq.objectKeys(this.shape))}}bq.create=(_,q)=>{return new bq({shape:()=>_,unknownKeys:"strip",catchall:M_.create(),typeName:i.ZodObject,...qq(q)})};bq.strictCreate=(_,q)=>{return new bq({shape:()=>_,unknownKeys:"strict",catchall:M_.create(),typeName:i.ZodObject,...qq(q)})};bq.lazycreate=(_,q)=>{return new bq({shape:_,unknownKeys:"strip",catchall:M_.create(),typeName:i.ZodObject,...qq(q)})};class Q8 extends $q{_parse(_){let{ctx:q}=this._processInputParams(_),f=this._def.options;function K($){for(let j of $)if(j.result.status==="valid")return j.result;for(let j of $)if(j.result.status==="dirty")return q.common.issues.push(...j.ctx.common.issues),j.result;let P=$.map((j)=>new eq(j.ctx.common.issues));return t(q,{code:y.invalid_union,unionErrors:P}),U}if(q.common.async)return Promise.all(f.map(async($)=>{let P={...q,common:{...q.common,issues:[]},parent:null};return{result:await $._parseAsync({data:q.data,path:q.path,parent:P}),ctx:P}})).then(K);else{let $=void 0,P=[];for(let v of f){let w={...q,common:{...q.common,issues:[]},parent:null},O=v._parseSync({data:q.data,path:q.path,parent:w});if(O.status==="valid")return O;else if(O.status==="dirty"&&!$)$={result:O,ctx:w};if(w.common.issues.length)P.push(w.common.issues)}if($)return q.common.issues.push(...$.ctx.common.issues),$.result;let j=P.map((v)=>new eq(v));return t(q,{code:y.invalid_union,unionErrors:j}),U}}get options(){return this._def.options}}Q8.create=(_,q)=>{return new Q8({options:_,typeName:i.ZodUnion,...qq(q)})};var D_=(_)=>{if(_ instanceof _f)return D_(_.schema);else if(_ instanceof h_)return D_(_.innerType());else if(_ instanceof ff)return[_.value];else if(_ instanceof q8)return _.options;else if(_ instanceof $f)return Kq.objectValues(_.enum);else if(_ instanceof Kf)return D_(_._def.innerType);else if(_ instanceof U8)return[void 0];else if(_ instanceof F8)return[null];else if(_ instanceof W_)return[void 0,...D_(_.unwrap())];else if(_ instanceof y_)return[null,...D_(_.unwrap())];else if(_ instanceof D6)return D_(_.unwrap());else if(_ instanceof jf)return D_(_.unwrap());else if(_ instanceof Pf)return D_(_._def.innerType);else return[]};class I6 extends $q{_parse(_){let{ctx:q}=this._processInputParams(_);if(q.parsedType!==o.object)return t(q,{code:y.invalid_type,expected:o.object,received:q.parsedType}),U;let f=this.discriminator,K=q.data[f],$=this.optionsMap.get(K);if(!$)return t(q,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[f]}),U;if(q.common.async)return $._parseAsync({data:q.data,path:q.path,parent:q});else return $._parseSync({data:q.data,path:q.path,parent:q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(_,q,f){let K=new Map;for(let $ of q){let P=D_($.shape[_]);if(!P.length)throw new Error(`A discriminator value for key \`${_}\` could not be extracted from all schema options`);for(let j of P){if(K.has(j))throw new Error(`Discriminator property ${String(_)} has duplicate value ${String(j)}`);K.set(j,$)}}return new I6({typeName:i.ZodDiscriminatedUnion,discriminator:_,options:q,optionsMap:K,...qq(f)})}}function iK(_,q){let f=V_(_),K=V_(q);if(_===q)return{valid:!0,data:_};else if(f===o.object&&K===o.object){let $=Kq.objectKeys(q),P=Kq.objectKeys(_).filter((v)=>$.indexOf(v)!==-1),j={..._,...q};for(let v of P){let w=iK(_[v],q[v]);if(!w.valid)return{valid:!1};j[v]=w.data}return{valid:!0,data:j}}else if(f===o.array&&K===o.array){if(_.length!==q.length)return{valid:!1};let $=[];for(let P=0;P<_.length;P++){let j=_[P],v=q[P],w=iK(j,v);if(!w.valid)return{valid:!1};$.push(w.data)}return{valid:!0,data:$}}else if(f===o.date&&K===o.date&&+_===+q)return{valid:!0,data:_};else return{valid:!1}}class qf extends $q{_parse(_){let{status:q,ctx:f}=this._processInputParams(_),K=($,P)=>{if(d6($)||d6(P))return U;let j=iK($.value,P.value);if(!j.valid)return t(f,{code:y.invalid_intersection_types}),U;if(a6($)||a6(P))q.dirty();return{status:q.value,value:j.data}};if(f.common.async)return Promise.all([this._def.left._parseAsync({data:f.data,path:f.path,parent:f}),this._def.right._parseAsync({data:f.data,path:f.path,parent:f})]).then(([$,P])=>K($,P));else return K(this._def.left._parseSync({data:f.data,path:f.path,parent:f}),this._def.right._parseSync({data:f.data,path:f.path,parent:f}))}}qf.create=(_,q,f)=>{return new qf({left:_,right:q,typeName:i.ZodIntersection,...qq(f)})};class S_ extends $q{_parse(_){let{status:q,ctx:f}=this._processInputParams(_);if(f.parsedType!==o.array)return t(f,{code:y.invalid_type,expected:o.array,received:f.parsedType}),U;if(f.data.length<this._def.items.length)return t(f,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),U;if(!this._def.rest&&f.data.length>this._def.items.length)t(f,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q.dirty();let $=[...f.data].map((P,j)=>{let v=this._def.items[j]||this._def.rest;if(!v)return null;return v._parse(new H_(f,P,f.path,j))}).filter((P)=>!!P);if(f.common.async)return Promise.all($).then((P)=>{return aq.mergeArray(q,P)});else return aq.mergeArray(q,$)}get items(){return this._def.items}rest(_){return new S_({...this._def,rest:_})}}S_.create=(_,q)=>{if(!Array.isArray(_))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new S_({items:_,typeName:i.ZodTuple,rest:null,...qq(q)})};class If extends $q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(_){let{status:q,ctx:f}=this._processInputParams(_);if(f.parsedType!==o.object)return t(f,{code:y.invalid_type,expected:o.object,received:f.parsedType}),U;let K=[],$=this._def.keyType,P=this._def.valueType;for(let j in f.data)K.push({key:$._parse(new H_(f,j,f.path,j)),value:P._parse(new H_(f,f.data[j],f.path,j)),alwaysSet:j in f.data});if(f.common.async)return aq.mergeObjectAsync(q,K);else return aq.mergeObjectSync(q,K)}get element(){return this._def.valueType}static create(_,q,f){if(q instanceof $q)return new If({keyType:_,valueType:q,typeName:i.ZodRecord,...qq(f)});return new If({keyType:T_.create(),valueType:_,typeName:i.ZodRecord,...qq(q)})}}class Df extends $q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(_){let{status:q,ctx:f}=this._processInputParams(_);if(f.parsedType!==o.map)return t(f,{code:y.invalid_type,expected:o.map,received:f.parsedType}),U;let K=this._def.keyType,$=this._def.valueType,P=[...f.data.entries()].map(([j,v],w)=>{return{key:K._parse(new H_(f,j,f.path,[w,"key"])),value:$._parse(new H_(f,v,f.path,[w,"value"]))}});if(f.common.async){let j=new Map;return Promise.resolve().then(async()=>{for(let v of P){let w=await v.key,O=await v.value;if(w.status==="aborted"||O.status==="aborted")return U;if(w.status==="dirty"||O.status==="dirty")q.dirty();j.set(w.value,O.value)}return{status:q.value,value:j}})}else{let j=new Map;for(let v of P){let{key:w,value:O}=v;if(w.status==="aborted"||O.status==="aborted")return U;if(w.status==="dirty"||O.status==="dirty")q.dirty();j.set(w.value,O.value)}return{status:q.value,value:j}}}}Df.create=(_,q,f)=>{return new Df({valueType:q,keyType:_,typeName:i.ZodMap,...qq(f)})};class m8 extends $q{_parse(_){let{status:q,ctx:f}=this._processInputParams(_);if(f.parsedType!==o.set)return t(f,{code:y.invalid_type,expected:o.set,received:f.parsedType}),U;let K=this._def;if(K.minSize!==null){if(f.data.size<K.minSize.value)t(f,{code:y.too_small,minimum:K.minSize.value,type:"set",inclusive:!0,exact:!1,message:K.minSize.message}),q.dirty()}if(K.maxSize!==null){if(f.data.size>K.maxSize.value)t(f,{code:y.too_big,maximum:K.maxSize.value,type:"set",inclusive:!0,exact:!1,message:K.maxSize.message}),q.dirty()}let $=this._def.valueType;function P(v){let w=new Set;for(let O of v){if(O.status==="aborted")return U;if(O.status==="dirty")q.dirty();w.add(O.value)}return{status:q.value,value:w}}let j=[...f.data.values()].map((v,w)=>$._parse(new H_(f,v,f.path,w)));if(f.common.async)return Promise.all(j).then((v)=>P(v));else return P(j)}min(_,q){return new m8({...this._def,minSize:{value:_,message:B.toString(q)}})}max(_,q){return new m8({...this._def,maxSize:{value:_,message:B.toString(q)}})}size(_,q){return this.min(_,q).max(_,q)}nonempty(_){return this.min(1,_)}}m8.create=(_,q)=>{return new m8({valueType:_,minSize:null,maxSize:null,typeName:i.ZodSet,...qq(q)})};class s8 extends $q{constructor(){super(...arguments);this.validate=this.implement}_parse(_){let{ctx:q}=this._processInputParams(_);if(q.parsedType!==o.function)return t(q,{code:y.invalid_type,expected:o.function,received:q.parsedType}),U;function f(j,v){return gf({data:j,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,t8(),I_].filter((w)=>!!w),issueData:{code:y.invalid_arguments,argumentsError:v}})}function K(j,v){return gf({data:j,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,t8(),I_].filter((w)=>!!w),issueData:{code:y.invalid_return_type,returnTypeError:v}})}let $={errorMap:q.common.contextualErrorMap},P=q.data;if(this._def.returns instanceof r8){let j=this;return yq(async function(...v){let w=new eq([]),O=await j._def.args.parseAsync(v,$).catch((z)=>{throw w.addIssue(f(v,z)),w}),T=await Reflect.apply(P,this,O);return await j._def.returns._def.type.parseAsync(T,$).catch((z)=>{throw w.addIssue(K(T,z)),w})})}else{let j=this;return yq(function(...v){let w=j._def.args.safeParse(v,$);if(!w.success)throw new eq([f(v,w.error)]);let O=Reflect.apply(P,this,w.data),T=j._def.returns.safeParse(O,$);if(!T.success)throw new eq([K(O,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(..._){return new s8({...this._def,args:S_.create(_).rest(U_.create())})}returns(_){return new s8({...this._def,returns:_})}implement(_){return this.parse(_)}strictImplement(_){return this.parse(_)}static create(_,q,f){return new s8({args:_?_:S_.create([]).rest(U_.create()),returns:q||U_.create(),typeName:i.ZodFunction,...qq(f)})}}class _f extends $q{get schema(){return this._def.getter()}_parse(_){let{ctx:q}=this._processInputParams(_);return this._def.getter()._parse({data:q.data,path:q.path,parent:q})}}_f.create=(_,q)=>{return new _f({getter:_,typeName:i.ZodLazy,...qq(q)})};class ff extends $q{_parse(_){if(_.data!==this._def.value){let q=this._getOrReturnCtx(_);return t(q,{received:q.data,code:y.invalid_literal,expected:this._def.value}),U}return{status:"valid",value:_.data}}get value(){return this._def.value}}ff.create=(_,q)=>{return new ff({value:_,typeName:i.ZodLiteral,...qq(q)})};function w7(_,q){return new q8({values:_,typeName:i.ZodEnum,...qq(q)})}class q8 extends $q{_parse(_){if(typeof _.data!=="string"){let q=this._getOrReturnCtx(_),f=this._def.values;return t(q,{expected:Kq.joinValues(f),received:q.parsedType,code:y.invalid_type}),U}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(_.data)){let q=this._getOrReturnCtx(_),f=this._def.values;return t(q,{received:q.data,code:y.invalid_enum_value,options:f}),U}return yq(_.data)}get options(){return this._def.values}get enum(){let _={};for(let q of this._def.values)_[q]=q;return _}get Values(){let _={};for(let q of this._def.values)_[q]=q;return _}get Enum(){let _={};for(let q of this._def.values)_[q]=q;return _}extract(_,q=this._def){return q8.create(_,{...this._def,...q})}exclude(_,q=this._def){return q8.create(this.options.filter((f)=>!_.includes(f)),{...this._def,...q})}}q8.create=w7;class $f extends $q{_parse(_){let q=Kq.getValidEnumValues(this._def.values),f=this._getOrReturnCtx(_);if(f.parsedType!==o.string&&f.parsedType!==o.number){let K=Kq.objectValues(q);return t(f,{expected:Kq.joinValues(K),received:f.parsedType,code:y.invalid_type}),U}if(!this._cache)this._cache=new Set(Kq.getValidEnumValues(this._def.values));if(!this._cache.has(_.data)){let K=Kq.objectValues(q);return t(f,{received:f.data,code:y.invalid_enum_value,options:K}),U}return yq(_.data)}get enum(){return this._def.values}}$f.create=(_,q)=>{return new $f({values:_,typeName:i.ZodNativeEnum,...qq(q)})};class r8 extends $q{unwrap(){return this._def.type}_parse(_){let{ctx:q}=this._processInputParams(_);if(q.parsedType!==o.promise&&q.common.async===!1)return t(q,{code:y.invalid_type,expected:o.promise,received:q.parsedType}),U;let f=q.parsedType===o.promise?q.data:Promise.resolve(q.data);return yq(f.then((K)=>{return this._def.type.parseAsync(K,{path:q.path,errorMap:q.common.contextualErrorMap})}))}}r8.create=(_,q)=>{return new r8({type:_,typeName:i.ZodPromise,...qq(q)})};class h_ extends $q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===i.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(_){let{status:q,ctx:f}=this._processInputParams(_),K=this._def.effect||null,$={addIssue:(P)=>{if(t(f,P),P.fatal)q.abort();else q.dirty()},get path(){return f.path}};if($.addIssue=$.addIssue.bind($),K.type==="preprocess"){let P=K.transform(f.data,$);if(f.common.async)return Promise.resolve(P).then(async(j)=>{if(q.value==="aborted")return U;let v=await this._def.schema._parseAsync({data:j,path:f.path,parent:f});if(v.status==="aborted")return U;if(v.status==="dirty")return A8(v.value);if(q.value==="dirty")return A8(v.value);return v});else{if(q.value==="aborted")return U;let j=this._def.schema._parseSync({data:P,path:f.path,parent:f});if(j.status==="aborted")return U;if(j.status==="dirty")return A8(j.value);if(q.value==="dirty")return A8(j.value);return j}}if(K.type==="refinement"){let P=(j)=>{let v=K.refinement(j,$);if(f.common.async)return Promise.resolve(v);if(v instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return j};if(f.common.async===!1){let j=this._def.schema._parseSync({data:f.data,path:f.path,parent:f});if(j.status==="aborted")return U;if(j.status==="dirty")q.dirty();return P(j.value),{status:q.value,value:j.value}}else return this._def.schema._parseAsync({data:f.data,path:f.path,parent:f}).then((j)=>{if(j.status==="aborted")return U;if(j.status==="dirty")q.dirty();return P(j.value).then(()=>{return{status:q.value,value:j.value}})})}if(K.type==="transform")if(f.common.async===!1){let P=this._def.schema._parseSync({data:f.data,path:f.path,parent:f});if(!B_(P))return U;let j=K.transform(P.value,$);if(j instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:q.value,value:j}}else return this._def.schema._parseAsync({data:f.data,path:f.path,parent:f}).then((P)=>{if(!B_(P))return U;return Promise.resolve(K.transform(P.value,$)).then((j)=>({status:q.value,value:j}))});Kq.assertNever(K)}}h_.create=(_,q,f)=>{return new h_({schema:_,typeName:i.ZodEffects,effect:q,...qq(f)})};h_.createWithPreprocess=(_,q,f)=>{return new h_({schema:q,effect:{type:"preprocess",transform:_},typeName:i.ZodEffects,...qq(f)})};class W_ extends $q{_parse(_){if(this._getType(_)===o.undefined)return yq(void 0);return this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}W_.create=(_,q)=>{return new W_({innerType:_,typeName:i.ZodOptional,...qq(q)})};class y_ extends $q{_parse(_){if(this._getType(_)===o.null)return yq(null);return this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}y_.create=(_,q)=>{return new y_({innerType:_,typeName:i.ZodNullable,...qq(q)})};class Kf extends $q{_parse(_){let{ctx:q}=this._processInputParams(_),f=q.data;if(q.parsedType===o.undefined)f=this._def.defaultValue();return this._def.innerType._parse({data:f,path:q.path,parent:q})}removeDefault(){return this._def.innerType}}Kf.create=(_,q)=>{return new Kf({innerType:_,typeName:i.ZodDefault,defaultValue:typeof q.default==="function"?q.default:()=>q.default,...qq(q)})};class Pf extends $q{_parse(_){let{ctx:q}=this._processInputParams(_),f={...q,common:{...q.common,issues:[]}},K=this._def.innerType._parse({data:f.data,path:f.path,parent:{...f}});if(e8(K))return K.then(($)=>{return{status:"valid",value:$.status==="valid"?$.value:this._def.catchValue({get error(){return new eq(f.common.issues)},input:f.data})}});else return{status:"valid",value:K.status==="valid"?K.value:this._def.catchValue({get error(){return new eq(f.common.issues)},input:f.data})}}removeCatch(){return this._def.innerType}}Pf.create=(_,q)=>{return new Pf({innerType:_,typeName:i.ZodCatch,catchValue:typeof q.catch==="function"?q.catch:()=>q.catch,...qq(q)})};class yf extends $q{_parse(_){if(this._getType(_)!==o.nan){let f=this._getOrReturnCtx(_);return t(f,{code:y.invalid_type,expected:o.nan,received:f.parsedType}),U}return{status:"valid",value:_.data}}}yf.create=(_)=>{return new yf({typeName:i.ZodNaN,...qq(_)})};var kY=Symbol("zod_brand");class D6 extends $q{_parse(_){let{ctx:q}=this._processInputParams(_),f=q.data;return this._def.type._parse({data:f,path:q.path,parent:q})}unwrap(){return this._def.type}}class of extends $q{_parse(_){let{status:q,ctx:f}=this._processInputParams(_);if(f.common.async)return(async()=>{let $=await this._def.in._parseAsync({data:f.data,path:f.path,parent:f});if($.status==="aborted")return U;if($.status==="dirty")return q.dirty(),A8($.value);else return this._def.out._parseAsync({data:$.value,path:f.path,parent:f})})();else{let K=this._def.in._parseSync({data:f.data,path:f.path,parent:f});if(K.status==="aborted")return U;if(K.status==="dirty")return q.dirty(),{status:"dirty",value:K.value};else return this._def.out._parseSync({data:K.value,path:f.path,parent:f})}}static create(_,q){return new of({in:_,out:q,typeName:i.ZodPipeline})}}class jf extends $q{_parse(_){let q=this._def.innerType._parse(_),f=(K)=>{if(B_(K))K.value=Object.freeze(K.value);return K};return e8(q)?q.then((K)=>f(K)):f(q)}unwrap(){return this._def.innerType}}jf.create=(_,q)=>{return new jf({innerType:_,typeName:i.ZodReadonly,...qq(q)})};function K7(_,q){let f=typeof _==="function"?_(q):typeof _==="string"?{message:_}:_;return typeof f==="string"?{message:f}:f}function O7(_,q={},f){if(_)return G8.create().superRefine((K,$)=>{let P=_(K);if(P instanceof Promise)return P.then((j)=>{if(!j){let v=K7(q,K),w=v.fatal??f??!0;$.addIssue({code:"custom",...v,fatal:w})}});if(!P){let j=K7(q,K),v=j.fatal??f??!0;$.addIssue({code:"custom",...j,fatal:v})}return});return G8.create()}var ZY={object:bq.lazycreate},i;(function(_){_.ZodString="ZodString",_.ZodNumber="ZodNumber",_.ZodNaN="ZodNaN",_.ZodBigInt="ZodBigInt",_.ZodBoolean="ZodBoolean",_.ZodDate="ZodDate",_.ZodSymbol="ZodSymbol",_.ZodUndefined="ZodUndefined",_.ZodNull="ZodNull",_.ZodAny="ZodAny",_.ZodUnknown="ZodUnknown",_.ZodNever="ZodNever",_.ZodVoid="ZodVoid",_.ZodArray="ZodArray",_.ZodObject="ZodObject",_.ZodUnion="ZodUnion",_.ZodDiscriminatedUnion="ZodDiscriminatedUnion",_.ZodIntersection="ZodIntersection",_.ZodTuple="ZodTuple",_.ZodRecord="ZodRecord",_.ZodMap="ZodMap",_.ZodSet="ZodSet",_.ZodFunction="ZodFunction",_.ZodLazy="ZodLazy",_.ZodLiteral="ZodLiteral",_.ZodEnum="ZodEnum",_.ZodEffects="ZodEffects",_.ZodNativeEnum="ZodNativeEnum",_.ZodOptional="ZodOptional",_.ZodNullable="ZodNullable",_.ZodDefault="ZodDefault",_.ZodCatch="ZodCatch",_.ZodPromise="ZodPromise",_.ZodBranded="ZodBranded",_.ZodPipeline="ZodPipeline",_.ZodReadonly="ZodReadonly"})(i||(i={}));var XY=(_,q={message:`Input not instance of ${_.name}`})=>O7((f)=>f instanceof _,q),Y7=T_.create,T7=F_.create,AY=yf.create,uY=Q_.create,z7=B8.create,GY=u8.create,mY=df.create,rY=U8.create,bY=F8.create,VY=G8.create,MY=U_.create,SY=M_.create,NY=af.create,CY=z_.create,pY=bq.create,lY=bq.strictCreate,nY=Q8.create,RY=I6.create,EY=qf.create,gY=S_.create,dY=If.create,aY=Df.create,IY=m8.create,DY=s8.create,yY=_f.create,iY=ff.create,oY=q8.create,cY=$f.create,LY=r8.create,tY=h_.create,eY=W_.create,xY=y_.create,sY=h_.createWithPreprocess,BY=of.create,UY=()=>Y7().optional(),FY=()=>T7().optional(),QY=()=>z7().optional(),qT={string:(_)=>T_.create({..._,coerce:!0}),number:(_)=>F_.create({..._,coerce:!0}),boolean:(_)=>B8.create({..._,coerce:!0}),bigint:(_)=>Q_.create({..._,coerce:!0}),date:(_)=>u8.create({..._,coerce:!0})};var _T=U;var oK="2025-06-18";var W7=[oK,"2025-03-26","2024-11-05","2024-10-07"],y6="2.0",H7=W.union([W.string(),W.number().int()]),h7=W.string(),fT=W.object({progressToken:W.optional(H7)}).passthrough(),K_=W.object({_meta:W.optional(fT)}).passthrough(),xq=W.object({method:W.string(),params:W.optional(K_)}),cf=W.object({_meta:W.optional(W.object({}).passthrough())}).passthrough(),N_=W.object({method:W.string(),params:W.optional(cf)}),P_=W.object({_meta:W.optional(W.object({}).passthrough())}).passthrough(),i6=W.union([W.string(),W.number().int()]),J7=W.object({jsonrpc:W.literal(y6),id:i6}).merge(xq).strict(),k7=(_)=>J7.safeParse(_).success,Z7=W.object({jsonrpc:W.literal(y6)}).merge(N_).strict(),X7=(_)=>Z7.safeParse(_).success,A7=W.object({jsonrpc:W.literal(y6),id:i6,result:P_}).strict(),cK=(_)=>A7.safeParse(_).success,Zq;(function(_){_[_.ConnectionClosed=-32000]="ConnectionClosed",_[_.RequestTimeout=-32001]="RequestTimeout",_[_.ParseError=-32700]="ParseError",_[_.InvalidRequest=-32600]="InvalidRequest",_[_.MethodNotFound=-32601]="MethodNotFound",_[_.InvalidParams=-32602]="InvalidParams",_[_.InternalError=-32603]="InternalError"})(Zq||(Zq={}));var u7=W.object({jsonrpc:W.literal(y6),id:i6,error:W.object({code:W.number().int(),message:W.string(),data:W.optional(W.unknown())})}).strict(),G7=(_)=>u7.safeParse(_).success,m7=W.union([J7,Z7,A7,u7]),o6=P_.strict(),c6=N_.extend({method:W.literal("notifications/cancelled"),params:cf.extend({requestId:i6,reason:W.string().optional()})}),$T=W.object({src:W.string(),mimeType:W.optional(W.string()),sizes:W.optional(W.array(W.string()))}).passthrough(),Lf=W.object({icons:W.array($T).optional()}).passthrough(),tf=W.object({name:W.string(),title:W.optional(W.string())}).passthrough(),r7=tf.extend({version:W.string(),websiteUrl:W.optional(W.string())}).merge(Lf),KT=W.object({experimental:W.optional(W.object({}).passthrough()),sampling:W.optional(W.object({}).passthrough()),elicitation:W.optional(W.object({}).passthrough()),roots:W.optional(W.object({listChanged:W.optional(W.boolean())}).passthrough())}).passthrough(),LK=xq.extend({method:W.literal("initialize"),params:K_.extend({protocolVersion:W.string(),capabilities:KT,clientInfo:r7})});var PT=W.object({experimental:W.optional(W.object({}).passthrough()),logging:W.optional(W.object({}).passthrough()),completions:W.optional(W.object({}).passthrough()),prompts:W.optional(W.object({listChanged:W.optional(W.boolean())}).passthrough()),resources:W.optional(W.object({subscribe:W.optional(W.boolean()),listChanged:W.optional(W.boolean())}).passthrough()),tools:W.optional(W.object({listChanged:W.optional(W.boolean())}).passthrough())}).passthrough(),jT=P_.extend({protocolVersion:W.string(),capabilities:PT,serverInfo:r7,instructions:W.optional(W.string())}),tK=N_.extend({method:W.literal("notifications/initialized")});var L6=xq.extend({method:W.literal("ping")}),vT=W.object({progress:W.number(),total:W.optional(W.number()),message:W.optional(W.string())}).passthrough(),t6=N_.extend({method:W.literal("notifications/progress"),params:cf.merge(vT).extend({progressToken:H7})}),e6=xq.extend({params:K_.extend({cursor:W.optional(h7)}).optional()}),x6=P_.extend({nextCursor:W.optional(h7)}),b7=W.object({uri:W.string(),mimeType:W.optional(W.string()),_meta:W.optional(W.object({}).passthrough())}).passthrough(),V7=b7.extend({text:W.string()}),eK=W.string().refine((_)=>{try{return atob(_),!0}catch(q){return!1}},{message:"Invalid Base64 string"}),M7=b7.extend({blob:eK}),S7=tf.extend({uri:W.string(),description:W.optional(W.string()),mimeType:W.optional(W.string()),_meta:W.optional(W.object({}).passthrough())}).merge(Lf),wT=tf.extend({uriTemplate:W.string(),description:W.optional(W.string()),mimeType:W.optional(W.string()),_meta:W.optional(W.object({}).passthrough())}).merge(Lf),s6=e6.extend({method:W.literal("resources/list")}),OT=x6.extend({resources:W.array(S7)}),B6=e6.extend({method:W.literal("resources/templates/list")}),YT=x6.extend({resourceTemplates:W.array(wT)}),U6=xq.extend({method:W.literal("resources/read"),params:K_.extend({uri:W.string()})}),TT=P_.extend({contents:W.array(W.union([V7,M7]))}),zT=N_.extend({method:W.literal("notifications/resources/list_changed")}),WT=xq.extend({method:W.literal("resources/subscribe"),params:K_.extend({uri:W.string()})}),HT=xq.extend({method:W.literal("resources/unsubscribe"),params:K_.extend({uri:W.string()})}),hT=N_.extend({method:W.literal("notifications/resources/updated"),params:cf.extend({uri:W.string()})}),JT=W.object({name:W.string(),description:W.optional(W.string()),required:W.optional(W.boolean())}).passthrough(),kT=tf.extend({description:W.optional(W.string()),arguments:W.optional(W.array(JT)),_meta:W.optional(W.object({}).passthrough())}).merge(Lf),F6=e6.extend({method:W.literal("prompts/list")}),ZT=x6.extend({prompts:W.array(kT)}),Q6=xq.extend({method:W.literal("prompts/get"),params:K_.extend({name:W.string(),arguments:W.optional(W.record(W.string()))})}),xK=W.object({type:W.literal("text"),text:W.string(),_meta:W.optional(W.object({}).passthrough())}).passthrough(),sK=W.object({type:W.literal("image"),data:eK,mimeType:W.string(),_meta:W.optional(W.object({}).passthrough())}).passthrough(),BK=W.object({type:W.literal("audio"),data:eK,mimeType:W.string(),_meta:W.optional(W.object({}).passthrough())}).passthrough(),XT=W.object({type:W.literal("resource"),resource:W.union([V7,M7]),_meta:W.optional(W.object({}).passthrough())}).passthrough(),AT=S7.extend({type:W.literal("resource_link")}),N7=W.union([xK,sK,BK,AT,XT]),uT=W.object({role:W.enum(["user","assistant"]),content:N7}).passthrough(),GT=P_.extend({description:W.optional(W.string()),messages:W.array(uT)}),mT=N_.extend({method:W.literal("notifications/prompts/list_changed")}),rT=W.object({title:W.optional(W.string()),readOnlyHint:W.optional(W.boolean()),destructiveHint:W.optional(W.boolean()),idempotentHint:W.optional(W.boolean()),openWorldHint:W.optional(W.boolean())}).passthrough(),bT=tf.extend({description:W.optional(W.string()),inputSchema:W.object({type:W.literal("object"),properties:W.optional(W.object({}).passthrough()),required:W.optional(W.array(W.string()))}).passthrough(),outputSchema:W.optional(W.object({type:W.literal("object"),properties:W.optional(W.object({}).passthrough()),required:W.optional(W.array(W.string()))}).passthrough()),annotations:W.optional(rT),_meta:W.optional(W.object({}).passthrough())}).merge(Lf),q$=e6.extend({method:W.literal("tools/list")}),VT=x6.extend({tools:W.array(bT)}),C7=P_.extend({content:W.array(N7).default([]),structuredContent:W.object({}).passthrough().optional(),isError:W.optional(W.boolean())}),VC=C7.or(P_.extend({toolResult:W.unknown()})),_$=xq.extend({method:W.literal("tools/call"),params:K_.extend({name:W.string(),arguments:W.optional(W.record(W.unknown()))})}),MT=N_.extend({method:W.literal("notifications/tools/list_changed")}),ef=W.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),UK=xq.extend({method:W.literal("logging/setLevel"),params:K_.extend({level:ef})}),ST=N_.extend({method:W.literal("notifications/message"),params:cf.extend({level:ef,logger:W.optional(W.string()),data:W.unknown()})}),NT=W.object({name:W.string().optional()}).passthrough(),CT=W.object({hints:W.optional(W.array(NT)),costPriority:W.optional(W.number().min(0).max(1)),speedPriority:W.optional(W.number().min(0).max(1)),intelligencePriority:W.optional(W.number().min(0).max(1))}).passthrough(),pT=W.object({role:W.enum(["user","assistant"]),content:W.union([xK,sK,BK])}).passthrough(),lT=xq.extend({method:W.literal("sampling/createMessage"),params:K_.extend({messages:W.array(pT),systemPrompt:W.optional(W.string()),includeContext:W.optional(W.enum(["none","thisServer","allServers"])),temperature:W.optional(W.number()),maxTokens:W.number().int(),stopSequences:W.optional(W.array(W.string())),metadata:W.optional(W.object({}).passthrough()),modelPreferences:W.optional(CT)})}),FK=P_.extend({model:W.string(),stopReason:W.optional(W.enum(["endTurn","stopSequence","maxTokens"]).or(W.string())),role:W.enum(["user","assistant"]),content:W.discriminatedUnion("type",[xK,sK,BK])}),nT=W.object({type:W.literal("boolean"),title:W.optional(W.string()),description:W.optional(W.string()),default:W.optional(W.boolean())}).passthrough(),RT=W.object({type:W.literal("string"),title:W.optional(W.string()),description:W.optional(W.string()),minLength:W.optional(W.number()),maxLength:W.optional(W.number()),format:W.optional(W.enum(["email","uri","date","date-time"]))}).passthrough(),ET=W.object({type:W.enum(["number","integer"]),title:W.optional(W.string()),description:W.optional(W.string()),minimum:W.optional(W.number()),maximum:W.optional(W.number())}).passthrough(),gT=W.object({type:W.literal("string"),title:W.optional(W.string()),description:W.optional(W.string()),enum:W.array(W.string()),enumNames:W.optional(W.array(W.string()))}).passthrough(),dT=W.union([nT,RT,ET,gT]),aT=xq.extend({method:W.literal("elicitation/create"),params:K_.extend({message:W.string(),requestedSchema:W.object({type:W.literal("object"),properties:W.record(W.string(),dT),required:W.optional(W.array(W.string()))}).passthrough()})}),QK=P_.extend({action:W.enum(["accept","decline","cancel"]),content:W.optional(W.record(W.string(),W.unknown()))}),IT=W.object({type:W.literal("ref/resource"),uri:W.string()}).passthrough();var DT=W.object({type:W.literal("ref/prompt"),name:W.string()}).passthrough(),f$=xq.extend({method:W.literal("completion/complete"),params:K_.extend({ref:W.union([DT,IT]),argument:W.object({name:W.string(),value:W.string()}).passthrough(),context:W.optional(W.object({arguments:W.optional(W.record(W.string(),W.string()))}))})}),yT=P_.extend({completion:W.object({values:W.array(W.string()).max(100),total:W.optional(W.number().int()),hasMore:W.optional(W.boolean())}).passthrough()}),iT=W.object({uri:W.string().startsWith("file://"),name:W.optional(W.string()),_meta:W.optional(W.object({}).passthrough())}).passthrough(),oT=xq.extend({method:W.literal("roots/list")}),qP=P_.extend({roots:W.array(iT)}),cT=N_.extend({method:W.literal("notifications/roots/list_changed")}),MC=W.union([L6,LK,f$,UK,Q6,F6,s6,B6,U6,WT,HT,_$,q$]),SC=W.union([c6,t6,tK,cT]),NC=W.union([o6,FK,QK,qP]),CC=W.union([L6,lT,aT,oT]),pC=W.union([c6,t6,ST,hT,zT,MT,mT]),lC=W.union([o6,jT,yT,GT,ZT,OT,YT,TT,C7,VT]);class Xq extends Error{constructor(_,q,f){super(`MCP error ${_}: ${q}`);this.code=_,this.data=f,this.name="McpError"}}var LT=60000;class _P{constructor(_){this._options=_,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(c6,(q)=>{let f=this._requestHandlerAbortControllers.get(q.params.requestId);f===null||f===void 0||f.abort(q.params.reason)}),this.setNotificationHandler(t6,(q)=>{this._onprogress(q)}),this.setRequestHandler(L6,(q)=>({}))}_setupTimeout(_,q,f,K,$=!1){this._timeoutInfo.set(_,{timeoutId:setTimeout(K,q),startTime:Date.now(),timeout:q,maxTotalTimeout:f,resetTimeoutOnProgress:$,onTimeout:K})}_resetTimeout(_){let q=this._timeoutInfo.get(_);if(!q)return!1;let f=Date.now()-q.startTime;if(q.maxTotalTimeout&&f>=q.maxTotalTimeout)throw this._timeoutInfo.delete(_),new Xq(Zq.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:q.maxTotalTimeout,totalElapsed:f});return clearTimeout(q.timeoutId),q.timeoutId=setTimeout(q.onTimeout,q.timeout),!0}_cleanupTimeout(_){let q=this._timeoutInfo.get(_);if(q)clearTimeout(q.timeoutId),this._timeoutInfo.delete(_)}async connect(_){var q,f,K;this._transport=_;let $=(q=this.transport)===null||q===void 0?void 0:q.onclose;this._transport.onclose=()=>{$===null||$===void 0||$(),this._onclose()};let P=(f=this.transport)===null||f===void 0?void 0:f.onerror;this._transport.onerror=(v)=>{P===null||P===void 0||P(v),this._onerror(v)};let j=(K=this._transport)===null||K===void 0?void 0:K.onmessage;this._transport.onmessage=(v,w)=>{if(j===null||j===void 0||j(v,w),cK(v)||G7(v))this._onresponse(v);else if(k7(v))this._onrequest(v,w);else if(X7(v))this._onnotification(v);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(v)}`))},await this._transport.start()}_onclose(){var _;let q=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(_=this.onclose)===null||_===void 0||_.call(this);let f=new Xq(Zq.ConnectionClosed,"Connection closed");for(let K of q.values())K(f)}_onerror(_){var q;(q=this.onerror)===null||q===void 0||q.call(this,_)}_onnotification(_){var q;let f=(q=this._notificationHandlers.get(_.method))!==null&&q!==void 0?q:this.fallbackNotificationHandler;if(f===void 0)return;Promise.resolve().then(()=>f(_)).catch((K)=>this._onerror(new Error(`Uncaught error in notification handler: ${K}`)))}_onrequest(_,q){var f,K;let $=(f=this._requestHandlers.get(_.method))!==null&&f!==void 0?f:this.fallbackRequestHandler,P=this._transport;if($===void 0){P===null||P===void 0||P.send({jsonrpc:"2.0",id:_.id,error:{code:Zq.MethodNotFound,message:"Method not found"}}).catch((w)=>this._onerror(new Error(`Failed to send an error response: ${w}`)));return}let j=new AbortController;this._requestHandlerAbortControllers.set(_.id,j);let v={signal:j.signal,sessionId:P===null||P===void 0?void 0:P.sessionId,_meta:(K=_.params)===null||K===void 0?void 0:K._meta,sendNotification:(w)=>this.notification(w,{relatedRequestId:_.id}),sendRequest:(w,O,T)=>this.request(w,O,{...T,relatedRequestId:_.id}),authInfo:q===null||q===void 0?void 0:q.authInfo,requestId:_.id,requestInfo:q===null||q===void 0?void 0:q.requestInfo};Promise.resolve().then(()=>$(_,v)).then((w)=>{if(j.signal.aborted)return;return P===null||P===void 0?void 0:P.send({result:w,jsonrpc:"2.0",id:_.id})},(w)=>{var O;if(j.signal.aborted)return;return P===null||P===void 0?void 0:P.send({jsonrpc:"2.0",id:_.id,error:{code:Number.isSafeInteger(w.code)?w.code:Zq.InternalError,message:(O=w.message)!==null&&O!==void 0?O:"Internal error"}})}).catch((w)=>this._onerror(new Error(`Failed to send response: ${w}`))).finally(()=>{this._requestHandlerAbortControllers.delete(_.id)})}_onprogress(_){let{progressToken:q,...f}=_.params,K=Number(q),$=this._progressHandlers.get(K);if(!$){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(_)}`));return}let P=this._responseHandlers.get(K),j=this._timeoutInfo.get(K);if(j&&P&&j.resetTimeoutOnProgress)try{this._resetTimeout(K)}catch(v){P(v);return}$(f)}_onresponse(_){let q=Number(_.id),f=this._responseHandlers.get(q);if(f===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(_)}`));return}if(this._responseHandlers.delete(q),this._progressHandlers.delete(q),this._cleanupTimeout(q),cK(_))f(_);else{let K=new Xq(_.error.code,_.error.message,_.error.data);f(K)}}get transport(){return this._transport}async close(){var _;await((_=this._transport)===null||_===void 0?void 0:_.close())}request(_,q,f){let{relatedRequestId:K,resumptionToken:$,onresumptiontoken:P}=f!==null&&f!==void 0?f:{};return new Promise((j,v)=>{var w,O,T,Y,z,H;if(!this._transport){v(new Error("Not connected"));return}if(((w=this._options)===null||w===void 0?void 0:w.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod(_.method);(O=f===null||f===void 0?void 0:f.signal)===null||O===void 0||O.throwIfAborted();let h=this._requestMessageId++,J={..._,jsonrpc:"2.0",id:h};if(f===null||f===void 0?void 0:f.onprogress)this._progressHandlers.set(h,f.onprogress),J.params={..._.params,_meta:{...((T=_.params)===null||T===void 0?void 0:T._meta)||{},progressToken:h}};let k=(N)=>{var n;this._responseHandlers.delete(h),this._progressHandlers.delete(h),this._cleanupTimeout(h),(n=this._transport)===null||n===void 0||n.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(N)}},{relatedRequestId:K,resumptionToken:$,onresumptiontoken:P}).catch((R)=>this._onerror(new Error(`Failed to send cancellation: ${R}`))),v(N)};this._responseHandlers.set(h,(N)=>{var n;if((n=f===null||f===void 0?void 0:f.signal)===null||n===void 0?void 0:n.aborted)return;if(N instanceof Error)return v(N);try{let R=q.parse(N.result);j(R)}catch(R){v(R)}}),(Y=f===null||f===void 0?void 0:f.signal)===null||Y===void 0||Y.addEventListener("abort",()=>{var N;k((N=f===null||f===void 0?void 0:f.signal)===null||N===void 0?void 0:N.reason)});let X=(z=f===null||f===void 0?void 0:f.timeout)!==null&&z!==void 0?z:LT,l=()=>k(new Xq(Zq.RequestTimeout,"Request timed out",{timeout:X}));this._setupTimeout(h,X,f===null||f===void 0?void 0:f.maxTotalTimeout,l,(H=f===null||f===void 0?void 0:f.resetTimeoutOnProgress)!==null&&H!==void 0?H:!1),this._transport.send(J,{relatedRequestId:K,resumptionToken:$,onresumptiontoken:P}).catch((N)=>{this._cleanupTimeout(h),v(N)})})}async notification(_,q){var f,K;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(_.method),((K=(f=this._options)===null||f===void 0?void 0:f.debouncedNotificationMethods)!==null&&K!==void 0?K:[]).includes(_.method)&&!_.params&&!(q===null||q===void 0?void 0:q.relatedRequestId)){if(this._pendingDebouncedNotifications.has(_.method))return;this._pendingDebouncedNotifications.add(_.method),Promise.resolve().then(()=>{var v;if(this._pendingDebouncedNotifications.delete(_.method),!this._transport)return;let w={..._,jsonrpc:"2.0"};(v=this._transport)===null||v===void 0||v.send(w,q).catch((O)=>this._onerror(O))});return}let j={..._,jsonrpc:"2.0"};await this._transport.send(j,q)}setRequestHandler(_,q){let f=_.shape.method.value;this.assertRequestHandlerCapability(f),this._requestHandlers.set(f,(K,$)=>{return Promise.resolve(q(_.parse(K),$))})}removeRequestHandler(_){this._requestHandlers.delete(_)}assertCanSetRequestHandler(_){if(this._requestHandlers.has(_))throw new Error(`A request handler for ${_} already exists, which would be overridden`)}setNotificationHandler(_,q){this._notificationHandlers.set(_.shape.method.value,(f)=>Promise.resolve(q(_.parse(f))))}removeNotificationHandler(_){this._notificationHandlers.delete(_)}}function p7(_,q){return Object.entries(q).reduce((f,[K,$])=>{if($&&typeof $==="object")f[K]=f[K]?{...f[K],...$}:$;else f[K]=$;return f},{..._})}var n9=IK(l9(),1);class VP extends _P{constructor(_,q){var f;super(q);if(this._serverInfo=_,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(ef.options.map((K,$)=>[K,$])),this.isMessageIgnored=(K,$)=>{let P=this._loggingLevels.get($);return P?this.LOG_LEVEL_SEVERITY.get(K)<this.LOG_LEVEL_SEVERITY.get(P):!1},this._capabilities=(f=q===null||q===void 0?void 0:q.capabilities)!==null&&f!==void 0?f:{},this._instructions=q===null||q===void 0?void 0:q.instructions,this.setRequestHandler(LK,(K)=>this._oninitialize(K)),this.setNotificationHandler(tK,()=>{var K;return(K=this.oninitialized)===null||K===void 0?void 0:K.call(this)}),this._capabilities.logging)this.setRequestHandler(UK,async(K,$)=>{var P;let j=$.sessionId||((P=$.requestInfo)===null||P===void 0?void 0:P.headers["mcp-session-id"])||void 0,{level:v}=K.params,w=ef.safeParse(v);if(w.success)this._loggingLevels.set(j,w.data);return{}})}registerCapabilities(_){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=p7(this._capabilities,_)}assertCapabilityForMethod(_){var q,f,K;switch(_){case"sampling/createMessage":if(!((q=this._clientCapabilities)===null||q===void 0?void 0:q.sampling))throw new Error(`Client does not support sampling (required for ${_})`);break;case"elicitation/create":if(!((f=this._clientCapabilities)===null||f===void 0?void 0:f.elicitation))throw new Error(`Client does not support elicitation (required for ${_})`);break;case"roots/list":if(!((K=this._clientCapabilities)===null||K===void 0?void 0:K.roots))throw new Error(`Client does not support listing roots (required for ${_})`);break;case"ping":break}}assertNotificationCapability(_){switch(_){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${_})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${_})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${_})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${_})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(_){switch(_){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${_})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${_})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${_})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${_})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${_})`);break;case"ping":case"initialize":break}}async _oninitialize(_){let q=_.params.protocolVersion;return this._clientCapabilities=_.params.capabilities,this._clientVersion=_.params.clientInfo,{protocolVersion:W7.includes(q)?q:oK,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},o6)}async createMessage(_,q){return this.request({method:"sampling/createMessage",params:_},FK,q)}async elicitInput(_,q){let f=await this.request({method:"elicitation/create",params:_},QK,q);if(f.action==="accept"&&f.content)try{let K=new n9.default,$=K.compile(_.requestedSchema);if(!$(f.content))throw new Xq(Zq.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorsText($.errors)}`)}catch(K){if(K instanceof Xq)throw K;throw new Xq(Zq.InternalError,`Error validating elicitation response: ${K}`)}return f}async listRoots(_,q){return this.request({method:"roots/list",params:_},qP,q)}async sendLoggingMessage(_,q){if(this._capabilities.logging){if(!this.isMessageIgnored(_.level,q))return this.notification({method:"notifications/message",params:_})}}async sendResourceUpdated(_){return this.notification({method:"notifications/resources/updated",params:_})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var E9=Symbol("Let zodToJsonSchema decide on which parser to use");var R9={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},g9=(_)=>typeof _==="string"?{...R9,name:_}:{...R9,..._};var d9=(_)=>{let q=g9(_),f=q.name!==void 0?[...q.basePath,q.definitionPath,q.name]:q.basePath;return{...q,flags:{hasReferencedOpenAiAnyType:!1},currentPath:f,propertyPath:void 0,seen:new Map(Object.entries(q.definitions).map(([K,$])=>[$._def,{def:$._def,path:[...q.basePath,q.definitionPath,K],jsonSchema:void 0}]))}};function MP(_,q,f,K){if(!K?.errorMessages)return;if(f)_.errorMessage={..._.errorMessage,[q]:f}}function jq(_,q,f,K,$){_[q]=f,MP(_,q,K,$)}var u$=(_,q)=>{let f=0;for(;f<_.length&&f<q.length;f++)if(_[f]!==q[f])break;return[(_.length-f).toString(),...q.slice(f)].join("/")};function Gq(_){if(_.target!=="openAi")return{};let q=[..._.basePath,_.definitionPath,_.openAiAnyTypeName];return _.flags.hasReferencedOpenAiAnyType=!0,{$ref:_.$refStrategy==="relative"?u$(q,_.currentPath):q.join("/")}}function a9(_,q){let f={type:"array"};if(_.type?._def&&_.type?._def?.typeName!==i.ZodAny)f.items=F(_.type._def,{...q,currentPath:[...q.currentPath,"items"]});if(_.minLength)jq(f,"minItems",_.minLength.value,_.minLength.message,q);if(_.maxLength)jq(f,"maxItems",_.maxLength.value,_.maxLength.message,q);if(_.exactLength)jq(f,"minItems",_.exactLength.value,_.exactLength.message,q),jq(f,"maxItems",_.exactLength.value,_.exactLength.message,q);return f}function I9(_,q){let f={type:"integer",format:"int64"};if(!_.checks)return f;for(let K of _.checks)switch(K.kind){case"min":if(q.target==="jsonSchema7")if(K.inclusive)jq(f,"minimum",K.value,K.message,q);else jq(f,"exclusiveMinimum",K.value,K.message,q);else{if(!K.inclusive)f.exclusiveMinimum=!0;jq(f,"minimum",K.value,K.message,q)}break;case"max":if(q.target==="jsonSchema7")if(K.inclusive)jq(f,"maximum",K.value,K.message,q);else jq(f,"exclusiveMaximum",K.value,K.message,q);else{if(!K.inclusive)f.exclusiveMaximum=!0;jq(f,"maximum",K.value,K.message,q)}break;case"multipleOf":jq(f,"multipleOf",K.value,K.message,q);break}return f}function D9(){return{type:"boolean"}}function G$(_,q){return F(_.type._def,q)}var y9=(_,q)=>{return F(_.innerType._def,q)};function SP(_,q,f){let K=f??q.dateStrategy;if(Array.isArray(K))return{anyOf:K.map(($,P)=>SP(_,q,$))};switch(K){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return rW(_,q)}}var rW=(_,q)=>{let f={type:"integer",format:"unix-time"};if(q.target==="openApi3")return f;for(let K of _.checks)switch(K.kind){case"min":jq(f,"minimum",K.value,K.message,q);break;case"max":jq(f,"maximum",K.value,K.message,q);break}return f};function i9(_,q){return{...F(_.innerType._def,q),default:_.defaultValue()}}function o9(_,q){return q.effectStrategy==="input"?F(_.schema._def,q):Gq(q)}function c9(_){return{type:"string",enum:Array.from(_.values)}}var bW=(_)=>{if("type"in _&&_.type==="string")return!1;return"allOf"in _};function L9(_,q){let f=[F(_.left._def,{...q,currentPath:[...q.currentPath,"allOf","0"]}),F(_.right._def,{...q,currentPath:[...q.currentPath,"allOf","1"]})].filter((P)=>!!P),K=q.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,$=[];return f.forEach((P)=>{if(bW(P)){if($.push(...P.allOf),P.unevaluatedProperties===void 0)K=void 0}else{let j=P;if("additionalProperties"in P&&P.additionalProperties===!1){let{additionalProperties:v,...w}=P;j=w}else K=void 0;$.push(j)}}),$.length?{allOf:$,...K}:void 0}function t9(_,q){let f=typeof _.value;if(f!=="bigint"&&f!=="number"&&f!=="boolean"&&f!=="string")return{type:Array.isArray(_.value)?"array":"object"};if(q.target==="openApi3")return{type:f==="bigint"?"integer":f,enum:[_.value]};return{type:f==="bigint"?"integer":f,const:_.value}}var NP=void 0,J_={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(NP===void 0)NP=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return NP},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function m$(_,q){let f={type:"string"};if(_.checks)for(let K of _.checks)switch(K.kind){case"min":jq(f,"minLength",typeof f.minLength==="number"?Math.max(f.minLength,K.value):K.value,K.message,q);break;case"max":jq(f,"maxLength",typeof f.maxLength==="number"?Math.min(f.maxLength,K.value):K.value,K.message,q);break;case"email":switch(q.emailStrategy){case"format:email":k_(f,"email",K.message,q);break;case"format:idn-email":k_(f,"idn-email",K.message,q);break;case"pattern:zod":cq(f,J_.email,K.message,q);break}break;case"url":k_(f,"uri",K.message,q);break;case"uuid":k_(f,"uuid",K.message,q);break;case"regex":cq(f,K.regex,K.message,q);break;case"cuid":cq(f,J_.cuid,K.message,q);break;case"cuid2":cq(f,J_.cuid2,K.message,q);break;case"startsWith":cq(f,RegExp(`^${CP(K.value,q)}`),K.message,q);break;case"endsWith":cq(f,RegExp(`${CP(K.value,q)}$`),K.message,q);break;case"datetime":k_(f,"date-time",K.message,q);break;case"date":k_(f,"date",K.message,q);break;case"time":k_(f,"time",K.message,q);break;case"duration":k_(f,"duration",K.message,q);break;case"length":jq(f,"minLength",typeof f.minLength==="number"?Math.max(f.minLength,K.value):K.value,K.message,q),jq(f,"maxLength",typeof f.maxLength==="number"?Math.min(f.maxLength,K.value):K.value,K.message,q);break;case"includes":{cq(f,RegExp(CP(K.value,q)),K.message,q);break}case"ip":{if(K.version!=="v6")k_(f,"ipv4",K.message,q);if(K.version!=="v4")k_(f,"ipv6",K.message,q);break}case"base64url":cq(f,J_.base64url,K.message,q);break;case"jwt":cq(f,J_.jwt,K.message,q);break;case"cidr":{if(K.version!=="v6")cq(f,J_.ipv4Cidr,K.message,q);if(K.version!=="v4")cq(f,J_.ipv6Cidr,K.message,q);break}case"emoji":cq(f,J_.emoji(),K.message,q);break;case"ulid":{cq(f,J_.ulid,K.message,q);break}case"base64":{switch(q.base64Strategy){case"format:binary":{k_(f,"binary",K.message,q);break}case"contentEncoding:base64":{jq(f,"contentEncoding","base64",K.message,q);break}case"pattern:zod":{cq(f,J_.base64,K.message,q);break}}break}case"nanoid":cq(f,J_.nanoid,K.message,q);case"toLowerCase":case"toUpperCase":case"trim":break;default:(($)=>{})(K)}return f}function CP(_,q){return q.patternStrategy==="escape"?MW(_):_}var VW=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function MW(_){let q="";for(let f=0;f<_.length;f++){if(!VW.has(_[f]))q+="\\";q+=_[f]}return q}function k_(_,q,f,K){if(_.format||_.anyOf?.some(($)=>$.format)){if(!_.anyOf)_.anyOf=[];if(_.format){if(_.anyOf.push({format:_.format,..._.errorMessage&&K.errorMessages&&{errorMessage:{format:_.errorMessage.format}}}),delete _.format,_.errorMessage){if(delete _.errorMessage.format,Object.keys(_.errorMessage).length===0)delete _.errorMessage}}_.anyOf.push({format:q,...f&&K.errorMessages&&{errorMessage:{format:f}}})}else jq(_,"format",q,f,K)}function cq(_,q,f,K){if(_.pattern||_.allOf?.some(($)=>$.pattern)){if(!_.allOf)_.allOf=[];if(_.pattern){if(_.allOf.push({pattern:_.pattern,..._.errorMessage&&K.errorMessages&&{errorMessage:{pattern:_.errorMessage.pattern}}}),delete _.pattern,_.errorMessage){if(delete _.errorMessage.pattern,Object.keys(_.errorMessage).length===0)delete _.errorMessage}}_.allOf.push({pattern:e9(q,K),...f&&K.errorMessages&&{errorMessage:{pattern:f}}})}else jq(_,"pattern",e9(q,K),f,K)}function e9(_,q){if(!q.applyRegexFlags||!_.flags)return _.source;let f={i:_.flags.includes("i"),m:_.flags.includes("m"),s:_.flags.includes("s")},K=f.i?_.source.toLowerCase():_.source,$="",P=!1,j=!1,v=!1;for(let w=0;w<K.length;w++){if(P){$+=K[w],P=!1;continue}if(f.i){if(j){if(K[w].match(/[a-z]/)){if(v)$+=K[w],$+=`${K[w-2]}-${K[w]}`.toUpperCase(),v=!1;else if(K[w+1]==="-"&&K[w+2]?.match(/[a-z]/))$+=K[w],v=!0;else $+=`${K[w]}${K[w].toUpperCase()}`;continue}}else if(K[w].match(/[a-z]/)){$+=`[${K[w]}${K[w].toUpperCase()}]`;continue}}if(f.m){if(K[w]==="^"){$+=`(^|(?<=[\r
|
|
173
|
+
]))`;continue}else if(K[w]==="$"){$+=`($|(?=[\r
|
|
174
|
+
]))`;continue}}if(f.s&&K[w]==="."){$+=j?`${K[w]}\r
|
|
175
|
+
`:`[${K[w]}\r
|
|
176
|
+
]`;continue}if($+=K[w],K[w]==="\\")P=!0;else if(j&&K[w]==="]")j=!1;else if(!j&&K[w]==="[")j=!0}try{new RegExp($)}catch{return console.warn(`Could not convert regex pattern at ${q.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),_.source}return $}function r$(_,q){if(q.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(q.target==="openApi3"&&_.keyType?._def.typeName===i.ZodEnum)return{type:"object",required:_.keyType._def.values,properties:_.keyType._def.values.reduce((K,$)=>({...K,[$]:F(_.valueType._def,{...q,currentPath:[...q.currentPath,"properties",$]})??Gq(q)}),{}),additionalProperties:q.rejectedAdditionalProperties};let f={type:"object",additionalProperties:F(_.valueType._def,{...q,currentPath:[...q.currentPath,"additionalProperties"]})??q.allowedAdditionalProperties};if(q.target==="openApi3")return f;if(_.keyType?._def.typeName===i.ZodString&&_.keyType._def.checks?.length){let{type:K,...$}=m$(_.keyType._def,q);return{...f,propertyNames:$}}else if(_.keyType?._def.typeName===i.ZodEnum)return{...f,propertyNames:{enum:_.keyType._def.values}};else if(_.keyType?._def.typeName===i.ZodBranded&&_.keyType._def.type._def.typeName===i.ZodString&&_.keyType._def.type._def.checks?.length){let{type:K,...$}=G$(_.keyType._def,q);return{...f,propertyNames:$}}return f}function x9(_,q){if(q.mapStrategy==="record")return r$(_,q);let f=F(_.keyType._def,{...q,currentPath:[...q.currentPath,"items","items","0"]})||Gq(q),K=F(_.valueType._def,{...q,currentPath:[...q.currentPath,"items","items","1"]})||Gq(q);return{type:"array",maxItems:125,items:{type:"array",items:[f,K],minItems:2,maxItems:2}}}function s9(_){let q=_.values,K=Object.keys(_.values).filter((P)=>{return typeof q[q[P]]!=="number"}).map((P)=>q[P]),$=Array.from(new Set(K.map((P)=>typeof P)));return{type:$.length===1?$[0]==="string"?"string":"number":["string","number"],enum:K}}function B9(_){return _.target==="openAi"?void 0:{not:Gq({..._,currentPath:[..._.currentPath,"not"]})}}function U9(_){return _.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var sf={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Q9(_,q){if(q.target==="openApi3")return F9(_,q);let f=_.options instanceof Map?Array.from(_.options.values()):_.options;if(f.every((K)=>(K._def.typeName in sf)&&(!K._def.checks||!K._def.checks.length))){let K=f.reduce(($,P)=>{let j=sf[P._def.typeName];return j&&!$.includes(j)?[...$,j]:$},[]);return{type:K.length>1?K:K[0]}}else if(f.every((K)=>K._def.typeName==="ZodLiteral"&&!K.description)){let K=f.reduce(($,P)=>{let j=typeof P._def.value;switch(j){case"string":case"number":case"boolean":return[...$,j];case"bigint":return[...$,"integer"];case"object":if(P._def.value===null)return[...$,"null"];case"symbol":case"undefined":case"function":default:return $}},[]);if(K.length===f.length){let $=K.filter((P,j,v)=>v.indexOf(P)===j);return{type:$.length>1?$:$[0],enum:f.reduce((P,j)=>{return P.includes(j._def.value)?P:[...P,j._def.value]},[])}}}else if(f.every((K)=>K._def.typeName==="ZodEnum"))return{type:"string",enum:f.reduce((K,$)=>[...K,...$._def.values.filter((P)=>!K.includes(P))],[])};return F9(_,q)}var F9=(_,q)=>{let f=(_.options instanceof Map?Array.from(_.options.values()):_.options).map((K,$)=>F(K._def,{...q,currentPath:[...q.currentPath,"anyOf",`${$}`]})).filter((K)=>!!K&&(!q.strictUnions||typeof K==="object"&&Object.keys(K).length>0));return f.length?{anyOf:f}:void 0};function qv(_,q){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(_.innerType._def.typeName)&&(!_.innerType._def.checks||!_.innerType._def.checks.length)){if(q.target==="openApi3")return{type:sf[_.innerType._def.typeName],nullable:!0};return{type:[sf[_.innerType._def.typeName],"null"]}}if(q.target==="openApi3"){let K=F(_.innerType._def,{...q,currentPath:[...q.currentPath]});if(K&&"$ref"in K)return{allOf:[K],nullable:!0};return K&&{...K,nullable:!0}}let f=F(_.innerType._def,{...q,currentPath:[...q.currentPath,"anyOf","0"]});return f&&{anyOf:[f,{type:"null"}]}}function _v(_,q){let f={type:"number"};if(!_.checks)return f;for(let K of _.checks)switch(K.kind){case"int":f.type="integer",MP(f,"type",K.message,q);break;case"min":if(q.target==="jsonSchema7")if(K.inclusive)jq(f,"minimum",K.value,K.message,q);else jq(f,"exclusiveMinimum",K.value,K.message,q);else{if(!K.inclusive)f.exclusiveMinimum=!0;jq(f,"minimum",K.value,K.message,q)}break;case"max":if(q.target==="jsonSchema7")if(K.inclusive)jq(f,"maximum",K.value,K.message,q);else jq(f,"exclusiveMaximum",K.value,K.message,q);else{if(!K.inclusive)f.exclusiveMaximum=!0;jq(f,"maximum",K.value,K.message,q)}break;case"multipleOf":jq(f,"multipleOf",K.value,K.message,q);break}return f}function fv(_,q){let f=q.target==="openAi",K={type:"object",properties:{}},$=[],P=_.shape();for(let v in P){let w=P[v];if(w===void 0||w._def===void 0)continue;let O=NW(w);if(O&&f){if(w._def.typeName==="ZodOptional")w=w._def.innerType;if(!w.isNullable())w=w.nullable();O=!1}let T=F(w._def,{...q,currentPath:[...q.currentPath,"properties",v],propertyPath:[...q.currentPath,"properties",v]});if(T===void 0)continue;if(K.properties[v]=T,!O)$.push(v)}if($.length)K.required=$;let j=SW(_,q);if(j!==void 0)K.additionalProperties=j;return K}function SW(_,q){if(_.catchall._def.typeName!=="ZodNever")return F(_.catchall._def,{...q,currentPath:[...q.currentPath,"additionalProperties"]});switch(_.unknownKeys){case"passthrough":return q.allowedAdditionalProperties;case"strict":return q.rejectedAdditionalProperties;case"strip":return q.removeAdditionalStrategy==="strict"?q.allowedAdditionalProperties:q.rejectedAdditionalProperties}}function NW(_){try{return _.isOptional()}catch{return!0}}var $v=(_,q)=>{if(q.currentPath.toString()===q.propertyPath?.toString())return F(_.innerType._def,q);let f=F(_.innerType._def,{...q,currentPath:[...q.currentPath,"anyOf","1"]});return f?{anyOf:[{not:Gq(q)},f]}:Gq(q)};var Kv=(_,q)=>{if(q.pipeStrategy==="input")return F(_.in._def,q);else if(q.pipeStrategy==="output")return F(_.out._def,q);let f=F(_.in._def,{...q,currentPath:[...q.currentPath,"allOf","0"]}),K=F(_.out._def,{...q,currentPath:[...q.currentPath,"allOf",f?"1":"0"]});return{allOf:[f,K].filter(($)=>$!==void 0)}};function Pv(_,q){return F(_.type._def,q)}function jv(_,q){let K={type:"array",uniqueItems:!0,items:F(_.valueType._def,{...q,currentPath:[...q.currentPath,"items"]})};if(_.minSize)jq(K,"minItems",_.minSize.value,_.minSize.message,q);if(_.maxSize)jq(K,"maxItems",_.maxSize.value,_.maxSize.message,q);return K}function vv(_,q){if(_.rest)return{type:"array",minItems:_.items.length,items:_.items.map((f,K)=>F(f._def,{...q,currentPath:[...q.currentPath,"items",`${K}`]})).reduce((f,K)=>K===void 0?f:[...f,K],[]),additionalItems:F(_.rest._def,{...q,currentPath:[...q.currentPath,"additionalItems"]})};else return{type:"array",minItems:_.items.length,maxItems:_.items.length,items:_.items.map((f,K)=>F(f._def,{...q,currentPath:[...q.currentPath,"items",`${K}`]})).reduce((f,K)=>K===void 0?f:[...f,K],[])}}function wv(_){return{not:Gq(_)}}function Ov(_){return Gq(_)}var Yv=(_,q)=>{return F(_.innerType._def,q)};var Tv=(_,q,f)=>{switch(q){case i.ZodString:return m$(_,f);case i.ZodNumber:return _v(_,f);case i.ZodObject:return fv(_,f);case i.ZodBigInt:return I9(_,f);case i.ZodBoolean:return D9();case i.ZodDate:return SP(_,f);case i.ZodUndefined:return wv(f);case i.ZodNull:return U9(f);case i.ZodArray:return a9(_,f);case i.ZodUnion:case i.ZodDiscriminatedUnion:return Q9(_,f);case i.ZodIntersection:return L9(_,f);case i.ZodTuple:return vv(_,f);case i.ZodRecord:return r$(_,f);case i.ZodLiteral:return t9(_,f);case i.ZodEnum:return c9(_);case i.ZodNativeEnum:return s9(_);case i.ZodNullable:return qv(_,f);case i.ZodOptional:return $v(_,f);case i.ZodMap:return x9(_,f);case i.ZodSet:return jv(_,f);case i.ZodLazy:return()=>_.getter()._def;case i.ZodPromise:return Pv(_,f);case i.ZodNaN:case i.ZodNever:return B9(f);case i.ZodEffects:return o9(_,f);case i.ZodAny:return Gq(f);case i.ZodUnknown:return Ov(f);case i.ZodDefault:return i9(_,f);case i.ZodBranded:return G$(_,f);case i.ZodReadonly:return Yv(_,f);case i.ZodCatch:return y9(_,f);case i.ZodPipeline:return Kv(_,f);case i.ZodFunction:case i.ZodVoid:case i.ZodSymbol:return;default:return((K)=>{return})(q)}};function F(_,q,f=!1){let K=q.seen.get(_);if(q.override){let v=q.override?.(_,q,K,f);if(v!==E9)return v}if(K&&!f){let v=CW(K,q);if(v!==void 0)return v}let $={def:_,path:q.currentPath,jsonSchema:void 0};q.seen.set(_,$);let P=Tv(_,_.typeName,q),j=typeof P==="function"?F(P(),q):P;if(j)pW(_,q,j);if(q.postProcess){let v=q.postProcess(j,_,q);return $.jsonSchema=j,v}return $.jsonSchema=j,j}var CW=(_,q)=>{switch(q.$refStrategy){case"root":return{$ref:_.path.join("/")};case"relative":return{$ref:u$(q.currentPath,_.path)};case"none":case"seen":{if(_.path.length<q.currentPath.length&&_.path.every((f,K)=>q.currentPath[K]===f))return console.warn(`Recursive reference detected at ${q.currentPath.join("/")}! Defaulting to any`),Gq(q);return q.$refStrategy==="seen"?Gq(q):void 0}}},pW=(_,q,f)=>{if(_.description){if(f.description=_.description,q.markdownDescription)f.markdownDescription=_.description}return f};var b$=(_,q)=>{let f=d9(q),K=typeof q==="object"&&q.definitions?Object.entries(q.definitions).reduce((w,[O,T])=>({...w,[O]:F(T._def,{...f,currentPath:[...f.basePath,f.definitionPath,O]},!0)??Gq(f)}),{}):void 0,$=typeof q==="string"?q:q?.nameStrategy==="title"?void 0:q?.name,P=F(_._def,$===void 0?f:{...f,currentPath:[...f.basePath,f.definitionPath,$]},!1)??Gq(f),j=typeof q==="object"&&q.name!==void 0&&q.nameStrategy==="title"?q.name:void 0;if(j!==void 0)P.title=j;if(f.flags.hasReferencedOpenAiAnyType){if(!K)K={};if(!K[f.openAiAnyTypeName])K[f.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:f.$refStrategy==="relative"?"1":[...f.basePath,f.definitionPath,f.openAiAnyTypeName].join("/")}}}let v=$===void 0?K?{...P,[f.definitionPath]:K}:P:{$ref:[...f.$refStrategy==="relative"?[]:f.basePath,f.definitionPath,$].join("/"),[f.definitionPath]:{...K,[$]:P}};if(f.target==="jsonSchema7")v.$schema="http://json-schema.org/draft-07/schema#";else if(f.target==="jsonSchema2019-09"||f.target==="openAi")v.$schema="https://json-schema.org/draft/2019-09/schema#";if(f.target==="openAi"&&(("anyOf"in v)||("oneOf"in v)||("allOf"in v)||("type"in v)&&Array.isArray(v.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return v};var pP;(function(_){_.Completable="McpCompletable"})(pP||(pP={}));class Bf extends $q{_parse(_){let{ctx:q}=this._processInputParams(_),f=q.data;return this._def.type._parse({data:f,path:q.path,parent:q})}unwrap(){return this._def.type}}Bf.create=(_,q)=>{return new Bf({type:_,typeName:pP.Completable,complete:q.complete,...lW(q)})};function lW(_){if(!_)return{};let{errorMap:q,invalid_type_error:f,required_error:K,description:$}=_;if(q&&(f||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(q)return{errorMap:q,description:$};return{errorMap:(j,v)=>{var w,O;let{message:T}=_;if(j.code==="invalid_enum_value")return{message:T!==null&&T!==void 0?T:v.defaultError};if(typeof v.data==="undefined")return{message:(w=T!==null&&T!==void 0?T:K)!==null&&w!==void 0?w:v.defaultError};if(j.code!=="invalid_type")return{message:v.defaultError};return{message:(O=T!==null&&T!==void 0?T:f)!==null&&O!==void 0?O:v.defaultError}},description:$}}class lP{constructor(_,q){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new VP(_,q)}async connect(_){return await this.server.connect(_)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(q$.shape.method.value),this.server.assertCanSetRequestHandler(_$.shape.method.value),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(q$,()=>({tools:Object.entries(this._registeredTools).filter(([,_])=>_.enabled).map(([_,q])=>{let f={name:_,title:q.title,description:q.description,inputSchema:q.inputSchema?b$(q.inputSchema,{strictUnions:!0}):nW,annotations:q.annotations,_meta:q._meta};if(q.outputSchema)f.outputSchema=b$(q.outputSchema,{strictUnions:!0});return f})})),this.server.setRequestHandler(_$,async(_,q)=>{let f=this._registeredTools[_.params.name];if(!f)throw new Xq(Zq.InvalidParams,`Tool ${_.params.name} not found`);if(!f.enabled)throw new Xq(Zq.InvalidParams,`Tool ${_.params.name} disabled`);let K;if(f.inputSchema){let $=await f.inputSchema.safeParseAsync(_.params.arguments);if(!$.success)throw new Xq(Zq.InvalidParams,`Invalid arguments for tool ${_.params.name}: ${$.error.message}`);let P=$.data,j=f.callback;try{K=await Promise.resolve(j(P,q))}catch(v){K={content:[{type:"text",text:v instanceof Error?v.message:String(v)}],isError:!0}}}else{let $=f.callback;try{K=await Promise.resolve($(q))}catch(P){K={content:[{type:"text",text:P instanceof Error?P.message:String(P)}],isError:!0}}}if(f.outputSchema&&!K.isError){if(!K.structuredContent)throw new Xq(Zq.InvalidParams,`Tool ${_.params.name} has an output schema but no structured content was provided`);let $=await f.outputSchema.safeParseAsync(K.structuredContent);if(!$.success)throw new Xq(Zq.InvalidParams,`Invalid structured content for tool ${_.params.name}: ${$.error.message}`)}return K}),this._toolHandlersInitialized=!0}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(f$.shape.method.value),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(f$,async(_)=>{switch(_.params.ref.type){case"ref/prompt":return this.handlePromptCompletion(_,_.params.ref);case"ref/resource":return this.handleResourceCompletion(_,_.params.ref);default:throw new Xq(Zq.InvalidParams,`Invalid completion reference: ${_.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(_,q){let f=this._registeredPrompts[q.name];if(!f)throw new Xq(Zq.InvalidParams,`Prompt ${q.name} not found`);if(!f.enabled)throw new Xq(Zq.InvalidParams,`Prompt ${q.name} disabled`);if(!f.argsSchema)return V$;let K=f.argsSchema.shape[_.params.argument.name];if(!(K instanceof Bf))return V$;let P=await K._def.complete(_.params.argument.value,_.params.context);return Wv(P)}async handleResourceCompletion(_,q){let f=Object.values(this._registeredResourceTemplates).find((P)=>P.resourceTemplate.uriTemplate.toString()===q.uri);if(!f){if(this._registeredResources[q.uri])return V$;throw new Xq(Zq.InvalidParams,`Resource template ${_.params.ref.uri} not found`)}let K=f.resourceTemplate.completeCallback(_.params.argument.name);if(!K)return V$;let $=await K(_.params.argument.value,_.params.context);return Wv($)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(s6.shape.method.value),this.server.assertCanSetRequestHandler(B6.shape.method.value),this.server.assertCanSetRequestHandler(U6.shape.method.value),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(s6,async(_,q)=>{let f=Object.entries(this._registeredResources).filter(([$,P])=>P.enabled).map(([$,P])=>({uri:$,name:P.name,...P.metadata})),K=[];for(let $ of Object.values(this._registeredResourceTemplates)){if(!$.resourceTemplate.listCallback)continue;let P=await $.resourceTemplate.listCallback(q);for(let j of P.resources)K.push({...$.metadata,...j})}return{resources:[...f,...K]}}),this.server.setRequestHandler(B6,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([q,f])=>({name:q,uriTemplate:f.resourceTemplate.uriTemplate.toString(),...f.metadata}))}}),this.server.setRequestHandler(U6,async(_,q)=>{let f=new URL(_.params.uri),K=this._registeredResources[f.toString()];if(K){if(!K.enabled)throw new Xq(Zq.InvalidParams,`Resource ${f} disabled`);return K.readCallback(f,q)}for(let $ of Object.values(this._registeredResourceTemplates)){let P=$.resourceTemplate.uriTemplate.match(f.toString());if(P)return $.readCallback(f,P,q)}throw new Xq(Zq.InvalidParams,`Resource ${f} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(F6.shape.method.value),this.server.assertCanSetRequestHandler(Q6.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(F6,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,_])=>_.enabled).map(([_,q])=>{return{name:_,title:q.title,description:q.description,arguments:q.argsSchema?EW(q.argsSchema):void 0}})})),this.server.setRequestHandler(Q6,async(_,q)=>{let f=this._registeredPrompts[_.params.name];if(!f)throw new Xq(Zq.InvalidParams,`Prompt ${_.params.name} not found`);if(!f.enabled)throw new Xq(Zq.InvalidParams,`Prompt ${_.params.name} disabled`);if(f.argsSchema){let K=await f.argsSchema.safeParseAsync(_.params.arguments);if(!K.success)throw new Xq(Zq.InvalidParams,`Invalid arguments for prompt ${_.params.name}: ${K.error.message}`);let $=K.data,P=f.callback;return await Promise.resolve(P($,q))}else{let K=f.callback;return await Promise.resolve(K(q))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0}resource(_,q,...f){let K;if(typeof f[0]==="object")K=f.shift();let $=f[0];if(typeof q==="string"){if(this._registeredResources[q])throw new Error(`Resource ${q} is already registered`);let P=this._createRegisteredResource(_,void 0,q,K,$);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),P}else{if(this._registeredResourceTemplates[_])throw new Error(`Resource template ${_} is already registered`);let P=this._createRegisteredResourceTemplate(_,void 0,q,K,$);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),P}}registerResource(_,q,f,K){if(typeof q==="string"){if(this._registeredResources[q])throw new Error(`Resource ${q} is already registered`);let $=this._createRegisteredResource(_,f.title,q,f,K);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),$}else{if(this._registeredResourceTemplates[_])throw new Error(`Resource template ${_} is already registered`);let $=this._createRegisteredResourceTemplate(_,f.title,q,f,K);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),$}}_createRegisteredResource(_,q,f,K,$){let P={name:_,title:q,metadata:K,readCallback:$,enabled:!0,disable:()=>P.update({enabled:!1}),enable:()=>P.update({enabled:!0}),remove:()=>P.update({uri:null}),update:(j)=>{if(typeof j.uri!=="undefined"&&j.uri!==f){if(delete this._registeredResources[f],j.uri)this._registeredResources[j.uri]=P}if(typeof j.name!=="undefined")P.name=j.name;if(typeof j.title!=="undefined")P.title=j.title;if(typeof j.metadata!=="undefined")P.metadata=j.metadata;if(typeof j.callback!=="undefined")P.readCallback=j.callback;if(typeof j.enabled!=="undefined")P.enabled=j.enabled;this.sendResourceListChanged()}};return this._registeredResources[f]=P,P}_createRegisteredResourceTemplate(_,q,f,K,$){let P={resourceTemplate:f,title:q,metadata:K,readCallback:$,enabled:!0,disable:()=>P.update({enabled:!1}),enable:()=>P.update({enabled:!0}),remove:()=>P.update({name:null}),update:(j)=>{if(typeof j.name!=="undefined"&&j.name!==_){if(delete this._registeredResourceTemplates[_],j.name)this._registeredResourceTemplates[j.name]=P}if(typeof j.title!=="undefined")P.title=j.title;if(typeof j.template!=="undefined")P.resourceTemplate=j.template;if(typeof j.metadata!=="undefined")P.metadata=j.metadata;if(typeof j.callback!=="undefined")P.readCallback=j.callback;if(typeof j.enabled!=="undefined")P.enabled=j.enabled;this.sendResourceListChanged()}};return this._registeredResourceTemplates[_]=P,P}_createRegisteredPrompt(_,q,f,K,$){let P={title:q,description:f,argsSchema:K===void 0?void 0:W.object(K),callback:$,enabled:!0,disable:()=>P.update({enabled:!1}),enable:()=>P.update({enabled:!0}),remove:()=>P.update({name:null}),update:(j)=>{if(typeof j.name!=="undefined"&&j.name!==_){if(delete this._registeredPrompts[_],j.name)this._registeredPrompts[j.name]=P}if(typeof j.title!=="undefined")P.title=j.title;if(typeof j.description!=="undefined")P.description=j.description;if(typeof j.argsSchema!=="undefined")P.argsSchema=W.object(j.argsSchema);if(typeof j.callback!=="undefined")P.callback=j.callback;if(typeof j.enabled!=="undefined")P.enabled=j.enabled;this.sendPromptListChanged()}};return this._registeredPrompts[_]=P,P}_createRegisteredTool(_,q,f,K,$,P,j,v){let w={title:q,description:f,inputSchema:K===void 0?void 0:W.object(K),outputSchema:$===void 0?void 0:W.object($),annotations:P,_meta:j,callback:v,enabled:!0,disable:()=>w.update({enabled:!1}),enable:()=>w.update({enabled:!0}),remove:()=>w.update({name:null}),update:(O)=>{if(typeof O.name!=="undefined"&&O.name!==_){if(delete this._registeredTools[_],O.name)this._registeredTools[O.name]=w}if(typeof O.title!=="undefined")w.title=O.title;if(typeof O.description!=="undefined")w.description=O.description;if(typeof O.paramsSchema!=="undefined")w.inputSchema=W.object(O.paramsSchema);if(typeof O.callback!=="undefined")w.callback=O.callback;if(typeof O.annotations!=="undefined")w.annotations=O.annotations;if(typeof O._meta!=="undefined")w._meta=O._meta;if(typeof O.enabled!=="undefined")w.enabled=O.enabled;this.sendToolListChanged()}};return this._registeredTools[_]=w,this.setToolRequestHandlers(),this.sendToolListChanged(),w}tool(_,...q){if(this._registeredTools[_])throw new Error(`Tool ${_} is already registered`);let f,K,$,P;if(typeof q[0]==="string")f=q.shift();if(q.length>1){let v=q[0];if(zv(v)){if(K=q.shift(),q.length>1&&typeof q[0]==="object"&&q[0]!==null&&!zv(q[0]))P=q.shift()}else if(typeof v==="object"&&v!==null)P=q.shift()}let j=q[0];return this._createRegisteredTool(_,void 0,f,K,$,P,void 0,j)}registerTool(_,q,f){if(this._registeredTools[_])throw new Error(`Tool ${_} is already registered`);let{title:K,description:$,inputSchema:P,outputSchema:j,annotations:v,_meta:w}=q;return this._createRegisteredTool(_,K,$,P,j,v,w,f)}prompt(_,...q){if(this._registeredPrompts[_])throw new Error(`Prompt ${_} is already registered`);let f;if(typeof q[0]==="string")f=q.shift();let K;if(q.length>1)K=q.shift();let $=q[0],P=this._createRegisteredPrompt(_,void 0,f,K,$);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),P}registerPrompt(_,q,f){if(this._registeredPrompts[_])throw new Error(`Prompt ${_} is already registered`);let{title:K,description:$,argsSchema:P}=q,j=this._createRegisteredPrompt(_,K,$,P,f);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),j}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(_,q){return this.server.sendLoggingMessage(_,q)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var nW={type:"object",properties:{}};function zv(_){if(typeof _!=="object"||_===null)return!1;return Object.keys(_).length===0||Object.values(_).some(RW)}function RW(_){return _!==null&&typeof _==="object"&&"parse"in _&&typeof _.parse==="function"&&"safeParse"in _&&typeof _.safeParse==="function"}function EW(_){return Object.entries(_.shape).map(([q,f])=>({name:q,description:f.description,required:!f.isOptional()}))}function Wv(_){return{completion:{values:_.slice(0,100),total:_.length,hasMore:_.length>100}}}var V$={completion:{values:[],hasMore:!1}};import hv from"process";class nP{append(_){this._buffer=this._buffer?Buffer.concat([this._buffer,_]):_}readMessage(){if(!this._buffer)return null;let _=this._buffer.indexOf(`
|
|
177
|
+
`);if(_===-1)return null;let q=this._buffer.toString("utf8",0,_).replace(/\r$/,"");return this._buffer=this._buffer.subarray(_+1),gW(q)}clear(){this._buffer=void 0}}function gW(_){return m7.parse(JSON.parse(_))}function Hv(_){return JSON.stringify(_)+`
|
|
178
|
+
`}class RP{constructor(_=hv.stdin,q=hv.stdout){this._stdin=_,this._stdout=q,this._readBuffer=new nP,this._started=!1,this._ondata=(f)=>{this._readBuffer.append(f),this.processReadBuffer()},this._onerror=(f)=>{var K;(K=this.onerror)===null||K===void 0||K.call(this,f)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){var _,q;while(!0)try{let f=this._readBuffer.readMessage();if(f===null)break;(_=this.onmessage)===null||_===void 0||_.call(this,f)}catch(f){(q=this.onerror)===null||q===void 0||q.call(this,f)}}async close(){var _;if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),(_=this.onclose)===null||_===void 0||_.call(this)}send(_){return new Promise((q)=>{let f=Hv(_);if(this._stdout.write(f))q();else this._stdout.once("drain",q)})}}var EP={name:"@kelceyp/swic",version:"0.2.1",description:"Story Workflow Integration Controller - MCP server for managing stories, subtasks, and pipelines",type:"module",main:"dist/server/Server.js",bin:{"swic-mcp":"./dist/server/Server.js",swic:"./dist/cli/cli.js"},files:["dist/","README.md","LICENSE"],scripts:{"build-server":"bun run scripts/server/build-dist.ts","build-cli":"bun run scripts/cli/build-dist.ts",build:"bun run scripts/build-all.ts",prepublishOnly:"bun run build","test:e2e":"bash tests/e2e/run-e2e-tests.sh","test:e2e:build":"bash tests/e2e/build-test-image.sh","test:e2e:rebuild":"bash tests/e2e/build-test-image.sh && bash tests/e2e/run-e2e-tests.sh",lint:"eslint src scripts archive --ext .ts","lint:fix":"eslint src scripts archive --ext .ts --fix"},dependencies:{"@kelceyp/clibuilder":"^0.2.0","@modelcontextprotocol/sdk":"^1.0.0","@types/handlebars":"^4.0.40","@types/yaml":"^1.9.6",debug:"^4.4.3",handlebars:"^4.7.8",yaml:"^2.8.1"},devDependencies:{"@types/bun":"latest","@types/debug":"^4.1.12","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^8.46.2","@typescript-eslint/parser":"^8.46.2",esbuild:"^0.25.11",eslint:"8",typescript:"^5.0.0"},engines:{bun:">=1.0.0"},repository:{type:"git",url:"https://github.com/kelceyp/swic.git"},author:"Paul Kelcey",license:"MIT",keywords:["mcp","model-context-protocol","workflow","story-management","pipeline-orchestration","development-workflow","sdlc"]};var aW=(_)=>{let q={name:"doc_create",description:"Create a new doc with content. Returns the created doc ID.",inputSchema:{scope:W.enum(["project","shared"]).describe("Scope for the doc (project or shared)"),path:W.string().describe('Path for the doc (e.g., "auth/jwt-setup.md")'),content:W.string().describe("Content of the doc")}};return Object.freeze({definition:q,handler:async(K)=>{let{scope:$,path:P,content:j}=K,v=await _.DocService.create({address:{kind:"path",scope:$,path:P},content:j});return{content:[{type:"text",text:`Created doc: ${v.id} at ${v.path}`}]}}})},IW=Object.freeze({create:aW}),Jv=IW;var M$=(_)=>{let q;if(typeof _==="string")q=[_];else if(Array.isArray(_)){if(_.length===0)throw new Error("identifier array cannot be empty");q=_}else throw new Error("identifier must be a string or array of strings");for(let $ of q)if(typeof $!=="string"||$.trim().length===0)throw new Error("All identifiers must be non-empty strings");let f=q.map(($)=>$.trim()),K=[...new Set(f)];if(K.length===0)throw new Error("No valid identifiers provided");return K};wf();var LW=(_)=>{let q={name:"doc_delete",description:"Delete one or more docs. Idempotent - does not error if doc already deleted. Supports bulk operations by passing an array of identifiers.",inputSchema:{identifier:W.union([W.string().describe('Single doc ID (e.g., "doc001") or path (e.g., "auth/jwt-setup.md")'),W.array(W.string()).describe("Array of doc IDs or paths for bulk delete")]).describe("doc identifier(s) - ID or path, single or array"),scope:W.enum(["project","shared"]).optional().describe("Optional scope. Auto-resolves if omitted (checks project first, then shared, or infers from ID prefix)")}};return Object.freeze({definition:q,handler:async(K)=>{let{identifier:$,scope:P}=K,j=M$($),v=await Promise.all(j.map(async(z)=>{let h=sq.isdocId(z)?{kind:"id",scope:P,id:z}:{kind:"path",scope:P,path:z},J=await _.DocService.read(h);return{identifier:z,address:h,doc:J}})),w=[];for(let z of v){let H=await _.DocService.deleteLatest(z.address);w.push({id:z.doc.id,deleted:H.deleted})}let O=w.filter((z)=>z.deleted),T=w.length-O.length,Y={deleted:O.map((z)=>z.id),alreadyDeleted:w.filter((z)=>!z.deleted).map((z)=>z.id),message:`Deleted ${O.length} doc${O.length!==1?"s":""}`+(T>0?`, ${T} ${T!==1?"were":"was"} already deleted`:"")};return{content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}})},tW=Object.freeze({create:LW}),Zv=tW;wf();var eW=(_)=>{let q={name:"doc_edit",description:"Edit doc content using text replacement operations. Uses last-write-wins semantics.",inputSchema:{identifier:W.string().describe('doc ID (e.g., "doc001") or path (e.g., "auth/jwt-setup.md")'),scope:W.enum(["project","shared"]).optional().describe("Optional scope. Auto-resolves if omitted (checks project first, then shared, or infers from ID prefix)"),operation:W.discriminatedUnion("type",[W.object({type:W.literal("replaceOnce"),oldText:W.string(),newText:W.string()}),W.object({type:W.literal("replaceAll"),oldText:W.string(),newText:W.string()}),W.object({type:W.literal("replaceRegex"),pattern:W.string(),flags:W.string().optional(),replacement:W.string()}),W.object({type:W.literal("replaceAllContent"),content:W.string()})]).describe("Edit operation to perform")}};return Object.freeze({definition:q,handler:async(K)=>{let{identifier:$,scope:P,operation:j}=K,v;switch(j.type){case"replaceOnce":v={op:"replaceOnce",oldText:j.oldText,newText:j.newText};break;case"replaceAll":v={op:"replaceAll",oldText:j.oldText,newText:j.newText};break;case"replaceRegex":v={op:"replaceRegex",pattern:j.pattern,flags:j.flags||"",replacement:j.replacement};break;case"replaceAllContent":v={op:"replaceAllContent",content:j.content};break;default:throw new Error(`Unknown operation type: ${j.type}`)}let O=sq.isdocId($)?{kind:"id",scope:P,id:$}:{kind:"path",scope:P,path:$},T=await _.DocService.editLatest(O,[v]);return{content:[{type:"text",text:`Edited doc: ${$}
|
|
179
|
+
Applied: ${T.applied} edit operation(s)`}]}}})},xW=Object.freeze({create:eW}),Xv=xW;var sW=(_)=>{let q={name:"doc_list",description:"List docs with optional filtering. Returns structured JSON with doc metadata. When no scope specified, lists from both scopes with override detection.",inputSchema:{scope:W.enum(["project","shared"]).optional().describe("Optional scope filter. If omitted, lists from both scopes and detects overrides (project docs that shadow shared ones)"),pathPrefix:W.string().optional().describe('Optional path prefix filter (e.g., "auth/" to list only docs in auth namespace)'),includeContent:W.boolean().optional().default(!1).describe("Include synopsis from front matter in results")}};return Object.freeze({definition:q,handler:async(K)=>{let{scope:$,pathPrefix:P,includeContent:j}=K,v=await _.DocService.list({scope:$,pathPrefix:P,includeContent:j===!0}),w;if(!$){let T=v.filter((h)=>h.id.startsWith("doc")),Y=v.filter((h)=>h.id.startsWith("sdoc")),z=new Set(T.map((h)=>h.path)),H=new Set(Y.map((h)=>h.path));w=v.map((h)=>{let J=h.id.startsWith("doc"),k;if(J&&H.has(h.path))k="overrides";else if(!J&&z.has(h.path))k="overridden";return{id:h.id,path:h.path,scope:J?"project":"shared",override:k,synopsis:h.synopsis,modifiedAt:h.modifiedAt}})}else w=v.map((T)=>({id:T.id,path:T.path,scope:T.id.startsWith("doc")?"project":"shared",synopsis:T.synopsis,modifiedAt:T.modifiedAt}));w.sort((T,Y)=>T.path.localeCompare(Y.path));let O={docs:w,count:w.length};return{content:[{type:"text",text:JSON.stringify(O,null,2)}]}}})},BW=Object.freeze({create:sW}),Av=BW;wf();var UW=(_)=>{let q={name:"doc_move",description:"Move or rename a doc to a new path. Generates a new ID. Supports cross-scope moves.",inputSchema:{source:W.string().describe('Source doc ID (e.g., "doc001") or path (e.g., "auth/jwt-setup.md")'),destination:W.string().describe("Destination path (not ID) for the doc"),sourceScope:W.enum(["project","shared"]).optional().describe("Optional. Source scope. Auto-resolves if omitted."),destinationScope:W.enum(["project","shared"]).optional().describe("Optional. Destination scope. Defaults to source scope if omitted.")}};return Object.freeze({definition:q,handler:async(K)=>{let{source:$,destination:P,sourceScope:j,destinationScope:v}=K,O=sq.isdocId($)?{kind:"id",scope:j,id:$}:{kind:"path",scope:j,path:$},T=await _.DocService.read(O),Y=T.id.startsWith("sdoc")?"shared":"project",z=v||Y,H=Y!==z;if(T.path===P&&Y===z)throw new Error("Source and destination are identical");try{throw await _.DocService.read({kind:"path",scope:z,path:P}),new Error(`Destination already exists: ${z} ${P}`)}catch(k){if(!(k.message.includes("No doc")||k.message.includes("not found")||k.message.includes("File or directory")))throw k}let h=await _.DocService.create({address:{kind:"path",path:P,scope:z},content:T.content});await _.DocService.deleteLatest(O,T.hash);let J={oldId:T.id,newId:h.id,oldPath:T.path,newPath:P,oldScope:Y,newScope:z,message:H?`Moved doc across scopes from ${Y} ${T.path} (${T.id}) to ${z} ${P} (new ID: ${h.id})`:`Moved doc from ${T.path} (${T.id}) to ${P} (new ID: ${h.id})`};return{content:[{type:"text",text:JSON.stringify(J,null,2)}]}}})},FW=Object.freeze({create:UW}),uv=FW;wf();var QW=(_)=>{let q={name:"doc_read",description:"Read one or more docs by ID or path. Returns content with optional metadata. Supports bulk operations by passing an array of identifiers.",inputSchema:{identifier:W.union([W.string().describe('Single doc ID (e.g., "doc001") or path (e.g., "auth/jwt-setup.md")'),W.array(W.string()).describe("Array of doc IDs or paths for bulk read")]).describe("doc identifier(s) - ID or path, single or array"),scope:W.enum(["project","shared"]).optional().describe("Optional scope. If omitted, auto-resolves (checks project first, then shared, or infers from ID prefix)"),includeMetadata:W.boolean().optional().default(!1).describe("Include ID and path metadata header for each doc")}};return Object.freeze({definition:q,handler:async(K)=>{let{identifier:$,scope:P,includeMetadata:j}=K,v=M$($),w=await Promise.all(v.map(async(Y)=>{let z=sq.isdocId(Y);return await _.DocService.read(z?{kind:"id",scope:P,id:Y}:{kind:"path",scope:P,path:Y})})),O=[];for(let Y=0;Y<w.length;Y++){let z=w[Y];if(j)O.push(`ID: ${z.id}`),O.push(`Path: ${z.path}`),O.push("---");let H=z.content;if(!H.endsWith(`
|
|
180
|
+
`))H+=`
|
|
181
|
+
`;if(O.push(H),Y<w.length-1)O.push("")}return{content:[{type:"text",text:O.join(`
|
|
182
|
+
`)}]}}})},qH=Object.freeze({create:QW}),Gv=qH;var _H=(_)=>{let q={name:"template_create",description:"Create a new template with content. Returns the created template ID.",inputSchema:{scope:W.enum(["project","shared"]).describe("Scope for the template (project or shared)"),path:W.string().describe('Path for the template (e.g., "prompts/story-init.md")'),content:W.string().describe("Content of the template including front matter")}};return Object.freeze({definition:q,handler:async(K)=>{let{scope:$,path:P,content:j}=K,v=await _.TemplateService.create({address:{kind:"path",scope:$,path:P},content:j});return{content:[{type:"text",text:`Created template: ${v.id} at ${v.path}`}]}}})},fH=Object.freeze({create:_H}),mv=fH;var $H=(_)=>{let q={name:"template_delete",description:"Delete one or more templates. Idempotent - does not error if template already deleted. Supports bulk operations by passing an array of identifiers.",inputSchema:{identifier:W.union([W.string(),W.array(W.string())]).describe('Template ID (e.g., "tpl001") or path (e.g., "prompts/story-init.md"), single or array'),scope:W.enum(["project","shared"]).optional().describe("Optional scope. Auto-resolves if omitted (checks project first, then shared, or infers from ID prefix)")}};return Object.freeze({definition:q,handler:async(K)=>{let{identifier:$,scope:P}=K,j=Array.isArray($)?$:[$],w=[...new Set(j)].map((z)=>{if(/^(tpl|stpl)\d{3,}$/.test(z))return{kind:"id",id:z,scope:P};else return{kind:"path",path:z,scope:P}}),O=w.length===1?[await _.TemplateService.delete(w[0])]:await _.TemplateService.deleteMany(w),T=O.filter((z)=>z.deleted).length,Y=O.length-T;return{content:[{type:"text",text:JSON.stringify({deleted:T,alreadyDeleted:Y,total:O.length},null,2)}]}}})},KH=Object.freeze({create:$H}),rv=KH;var PH=(_)=>{let q={name:"template_edit",description:"Edit template content using text replacement operations. Uses last-write-wins semantics.",inputSchema:{identifier:W.string().describe('Template ID (e.g., "tpl001") or path (e.g., "prompts/story-init.md")'),scope:W.enum(["project","shared"]).optional().describe("Optional scope. Auto-resolves if omitted"),operation:W.union([W.object({type:W.literal("replaceOnce"),oldText:W.string(),newText:W.string()}),W.object({type:W.literal("replaceAll"),oldText:W.string(),newText:W.string()}),W.object({type:W.literal("replaceRegex"),pattern:W.string(),replacement:W.string(),flags:W.string().optional()}),W.object({type:W.literal("replaceAllContent"),content:W.string()})]).describe("Edit operation to perform")}};return Object.freeze({definition:q,handler:async(K)=>{let{identifier:$,scope:P,operation:j}=K,w=/^(tpl|stpl)\d{3,}$/.test($)?{kind:"id",id:$,scope:P}:{kind:"path",path:$,scope:P},O;if(j.type==="replaceOnce")O={op:"replaceOnce",oldText:j.oldText,newText:j.newText};else if(j.type==="replaceAll")O={op:"replaceAll",oldText:j.oldText,newText:j.newText};else if(j.type==="replaceRegex")O={op:"replaceRegex",pattern:j.pattern,replacement:j.replacement,flags:j.flags};else O={op:"replaceAllContent",content:j.content};let T=await _.TemplateService.edit(w,[O]);return{content:[{type:"text",text:`Edited template: ${$}
|
|
183
|
+
Applied: ${T.applied} edit operation(s)`}]}}})},jH=Object.freeze({create:PH}),bv=jH;var vH=(_)=>{let q={name:"template_list",description:"List templates with optional filtering. Returns structured JSON with template metadata.",inputSchema:{scope:W.enum(["project","shared"]).optional().describe("Optional scope filter. If omitted, lists from both scopes and detects overrides (project templates that shadow shared ones)"),pathPrefix:W.string().optional().describe('Optional path prefix filter (e.g., "prompts/" to list only templates in prompts namespace)'),includeContent:W.boolean().optional().default(!1).describe("Include synopsis from front matter in results")}};return Object.freeze({definition:q,handler:async(K)=>{let{scope:$,pathPrefix:P,includeContent:j}=K,v=await _.TemplateService.list({scope:$,pathPrefix:P,includeContent:j});return{content:[{type:"text",text:JSON.stringify({templates:v.map((w)=>({id:w.id,path:w.path,scope:w.scope,isValid:w.isValid,synopsis:w.synopsis,override:w.override})),count:v.length},null,2)}]}}})},wH=Object.freeze({create:vH}),Vv=wH;var OH=(_)=>{let q={name:"template_move",description:"Move or rename a template to a new path. Generates a new ID. Supports cross-scope moves.",inputSchema:{source:W.string().describe('Source template ID (e.g., "tpl001") or path (e.g., "prompts/story-init.md")'),destination:W.string().describe("Destination path (not ID) for the template"),sourceScope:W.enum(["project","shared"]).optional().describe("Optional. Source scope. Auto-resolves if omitted."),destinationScope:W.enum(["project","shared"]).optional().describe("Optional. Destination scope. Defaults to source scope if omitted.")}};return Object.freeze({definition:q,handler:async(K)=>{let{source:$,destination:P,sourceScope:j,destinationScope:v}=K,O=/^(tpl|stpl)\d{3,}$/.test($)?{kind:"id",id:$,scope:j}:{kind:"path",path:$,scope:j},T=await _.TemplateService.move(O,P,v);return{content:[{type:"text",text:JSON.stringify({oldId:T.oldId,newId:T.newId,oldPath:T.oldPath,newPath:T.newPath,sourceScope:T.sourceScope,destinationScope:T.destinationScope,message:`Moved template: ${T.oldId} \u2192 ${T.newId}`},null,2)}]}}})},YH=Object.freeze({create:OH}),Mv=YH;var TH=(_)=>{let q={name:"template_read",description:"Read one or more templates by ID or path. Supports bulk operations by passing an array of identifiers.",inputSchema:{identifier:W.union([W.string(),W.array(W.string())]).describe('Single template ID (e.g., "tpl001") or path (e.g., "prompts/story-init.md"), or array for bulk read'),scope:W.enum(["project","shared"]).optional().describe("Optional scope. If omitted, auto-resolves (checks project first, then shared, or infers from ID prefix)"),includeMetadata:W.boolean().optional().default(!1).describe("Include ID and path metadata header for each template")}};return Object.freeze({definition:q,handler:async(K)=>{let{identifier:$,scope:P,includeMetadata:j}=K,v=Array.isArray($)?$:[$],O=[...new Set(v)].map((z)=>{if(/^(tpl|stpl)\d{3,}$/.test(z))return{kind:"id",id:z,scope:P};else return{kind:"path",path:z,scope:P}}),T=O.length===1?[await _.TemplateService.read(O[0])]:await _.TemplateService.readMany(O,j),Y="";for(let z=0;z<T.length;z++){let H=T[z];if(j)Y+=`ID: ${H.id}
|
|
184
|
+
`,Y+=`Path: ${H.path}
|
|
185
|
+
`,Y+=`Valid: ${H.isValid}
|
|
186
|
+
`,Y+=`---
|
|
187
|
+
`;if(Y+=H.content,!H.content.endsWith(`
|
|
188
|
+
`))Y+=`
|
|
189
|
+
`;if(z<T.length-1)Y+=`
|
|
190
|
+
`}return{content:[{type:"text",text:Y}]}}})},zH=Object.freeze({create:TH}),Sv=zH;var WH=(_)=>{let q={name:"template_render",description:"Render a template with provided parameters. Validates required parameters before rendering.",inputSchema:{identifier:W.string().describe('Template ID (e.g., "tpl001") or path (e.g., "prompts/story-init.md")'),scope:W.enum(["project","shared"]).optional().describe("Optional scope. Auto-resolves if omitted"),params:W.record(W.union([W.string(),W.number(),W.boolean()])).describe("Parameter values as key-value pairs")}};return Object.freeze({definition:q,handler:async(K)=>{let{identifier:$,scope:P,params:j}=K,w=/^(tpl|stpl)\d{3,}$/.test($)?{kind:"id",id:$,scope:P}:{kind:"path",path:$,scope:P};return{content:[{type:"text",text:await _.TemplateService.render(w,j||{})}]}}})},HH=Object.freeze({create:WH}),Nv=HH;var hH=(_)=>{let q={name:"template_get_parameters",description:"Get parameter definitions for a template. Extracts parameter metadata from front matter.",inputSchema:{identifier:W.string().describe('Template ID (e.g., "tpl001") or path (e.g., "prompts/story-init.md")'),scope:W.enum(["project","shared"]).optional().describe("Optional scope. Auto-resolves if omitted")}};return Object.freeze({definition:q,handler:async(K)=>{let{identifier:$,scope:P}=K,v=/^(tpl|stpl)\d{3,}$/.test($)?{kind:"id",id:$,scope:P}:{kind:"path",path:$,scope:P},w=await _.TemplateService.getParameters(v);return{content:[{type:"text",text:JSON.stringify({parameters:w},null,2)}]}}})},JH=Object.freeze({create:hH}),Cv=JH;var pv=[Jv.create,Zv.create,Xv.create,Av.create,uv.create,Gv.create,mv.create,rv.create,bv.create,Vv.create,Mv.create,Sv.create,Nv.create,Cv.create];import{fileURLToPath as iN}from"url";import{realpathSync as uO}from"fs";var GO=(_)=>{let{services:q}=_,f=EP.name,K=EP.version,$=new lP({name:f,version:K});return Object.freeze({start:async()=>{for(let v of pv){let w=v(q);$.registerTool(w.definition.name,{description:w.definition.description,inputSchema:w.definition.inputSchema},async(O)=>w.handler(O))}let j=new RP;await $.connect(j),console.error(`${f} v${K} running on stdio`)}})},DN=async()=>{let{default:_}=await Promise.resolve().then(() => (AO(),XO)),{projectDataDir:q,sharedDataDir:f}=_.lazilyGetDataDirs(),K=_.createServices({projectBoundaryDir:q,sharedBoundaryDir:f});await GO({services:K}).start()},yN=Object.freeze({create:GO}),oN=import.meta.main??(()=>{try{let _=uO(iN(import.meta.url)),q=uO(process.argv[1]);return _===q}catch{return!1}})();if(oN)DN().catch(console.error);var z0=yN;export{z0 as default};
|