@kelceyp/swic 0.2.4 → 0.2.5
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/server/Server.js +69 -70
- package/package.json +2 -2
package/dist/server/Server.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
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
2
|
`);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
3
|
`),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.
|
|
4
|
+
`).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=DH(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})},iH,cv;var Lv=V_(()=>{w6();iH=Object.freeze({create:yH}),cv=iH});var C$,p$,iP=(_)=>{if(C$.isId(_))return"project";if(p$.isId(_))return"shared";return},oH=(_)=>{return C$.isId(_)||p$.isId(_)},tv=(_)=>{return _==="project"?C$:p$},cH=(_,q)=>{return tv(q).validateId(_)},LH,oP;var ev=V_(()=>{gP();C$=v6.create({idPattern:/^tpl\d{3,}$/,entityName:"project-template"}),p$=v6.create({idPattern:/^stpl\d{3,}$/,entityName:"shared-template"}),LH=Object.freeze({project:C$,shared:p$,detectScopeFromId:iP,isTemplateId:oH,getResolverForScope:tv,validateIdForScope:cH}),oP=LH});var Lq=p((fh)=>{fh.__esModule=!0;fh.extend=xv;fh.indexOf=BH;fh.escapeExpression=UH;fh.isEmpty=FH;fh.createFrame=QH;fh.blockParams=qh;fh.appendContextPath=_h;var tH={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},eH=/[&<>"'`=]/g,xH=/[&<>"'`=]/;function sH(_){return tH[_]}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;fh.toString=LP;var cP=function _(q){return typeof q==="function"};if(cP(/x/))fh.isFunction=cP=function(_){return typeof _==="function"&&LP.call(_)==="[object Function]"};fh.isFunction=cP;var sv=Array.isArray||function(_){return _&&typeof _==="object"?LP.call(_)==="[object Array]":!1};fh.isArray=sv;function BH(_,q){for(var f=0,K=_.length;f<K;f++)if(_[f]===q)return f;return-1}function UH(_){if(typeof _!=="string"){if(_&&_.toHTML)return _.toHTML();else if(_==null)return"";else if(!_)return _+"";_=""+_}if(!xH.test(_))return _;return _.replace(eH,sH)}function FH(_){if(!_&&_!==0)return!0;else if(sv(_)&&_.length===0)return!0;else return!1}function QH(_){var q=xv({},_);return q._parent=_,q}function qh(_,q){return _.path=q,_}function _h(_,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 Zh(_){return _&&_.__esModule?_:{default:_}}var F6=Lq(),Xh=j_(),Ah=Zh(Xh);_5.default=function(_){_.registerHelper("each",function(q,f){if(!f)throw new Ah.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=F6.appendContextPath(f.data.contextPath,f.ids[0])+".";if(F6.isFunction(q))q=q.call(this);if(f.data)v=F6.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:F6.blockParams([q[h],h],[w+h,null])})}if(q&&typeof q==="object")if(F6.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 mh(_){return _&&_.__esModule?_:{default:_}}var rh=j_(),bh=mh(rh);K5.default=function(_){_.registerHelper("helperMissing",function(){if(arguments.length===1)return;else throw new bh.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};P5.exports=K5.default});var T5=p((O5,Y5)=>{O5.__esModule=!0;function Sh(_){return _&&_.__esModule?_:{default:_}}var v5=Lq(),Nh=j_(),w5=Sh(Nh);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 gh(_){return _&&_.__esModule?_:{default:_}}var Q6=Lq(),dh=j_(),ah=gh(dh);Z5.default=function(_){_.registerHelper("with",function(q,f){if(arguments.length!=2)throw new ah.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(($J)=>{$J.__esModule=!0;$J.registerDefaultHelpers=_J;$J.moveHelperToHooks=fJ;function M8(_){return _&&_.__esModule?_:{default:_}}var yh=q5(),ih=M8(yh),oh=$5(),ch=M8(oh),Lh=j5(),th=M8(Lh),eh=T5(),xh=M8(eh),sh=H5(),Bh=M8(sh),Uh=k5(),Fh=M8(Uh),Qh=A5(),qJ=M8(Qh);function _J(_){ih.default(_),ch.default(_),th.default(_),xh.default(_),Bh.default(_),Fh.default(_),qJ.default(_)}function fJ(_,q,f){if(_.helpers[q]){if(_.hooks[q]=_.helpers[q],!f)delete _.helpers[q]}}});var m5=p((u5,G5)=>{u5.__esModule=!0;var vJ=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=vJ.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((HJ)=>{HJ.__esModule=!0;HJ.registerDefaultDecorators=WJ;function YJ(_){return _&&_.__esModule?_:{default:_}}var TJ=m5(),zJ=YJ(TJ);function WJ(_){zJ.default(_)}});var BP=p((b5,V5)=>{b5.__esModule=!0;var kJ=Lq(),O6={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function _(q){if(typeof q==="string"){var f=kJ.indexOf(O6.methodMap,q.toLowerCase());if(f>=0)q=f;else q=parseInt(q,10)}return q},log:function _(q){if(q=O6.lookupLevel(q),typeof console!=="undefined"&&O6.lookupLevel(O6.level)<=q){var f=O6.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=O6;V5.exports=b5.default});var M5=p((GJ)=>{GJ.__esModule=!0;GJ.createNewLookupObject=uJ;var AJ=Lq();function uJ(){for(var _=arguments.length,q=Array(_),f=0;f<_;f++)q[f]=arguments[f];return AJ.extend.apply(void 0,[Object.create(null)].concat(q))}});var UP=p((lJ)=>{lJ.__esModule=!0;lJ.createProtoAccessControl=SJ;lJ.resultIsAllowed=NJ;lJ.resetLoggedProperties=pJ;function bJ(_){return _&&_.__esModule?_:{default:_}}var S5=M5(),VJ=BP(),MJ=bJ(VJ),l$=Object.create(null);function SJ(_){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 NJ(_,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 CJ(q),!1}function CJ(_){if(l$[_]!==!0)l$[_]=!0,MJ.default.log("error",'Handlebars: Access has been denied to resolve the property "'+_+`" because it is not an "own property" of its parent.
|
|
6
5
|
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
|
|
6
|
+
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`)}function pJ(){Object.keys(l$).forEach(function(_){delete l$[_]})}});var R$=p((eJ)=>{eJ.__esModule=!0;eJ.HandlebarsEnvironment=q3;function C5(_){return _&&_.__esModule?_:{default:_}}var S8=Lq(),dJ=j_(),FP=C5(dJ),aJ=sP(),IJ=r5(),DJ=BP(),n$=C5(DJ),yJ=UP(),iJ="4.7.8";eJ.VERSION=iJ;var oJ=8;eJ.COMPILER_REVISION=oJ;var cJ=7;eJ.LAST_COMPATIBLE_COMPILER_REVISION=cJ;var LJ={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"};eJ.REVISION_CHANGES=LJ;var QP="[object Object]";function q3(_,q,f){this.helpers=_||{},this.partials=q||{},this.decorators=f||{},aJ.registerDefaultHelpers(this),IJ.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 _(){yJ.resetLoggedProperties()}};var tJ=n$.default.log;eJ.log=tJ;eJ.createFrame=S8.createFrame;eJ.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((jk)=>{jk.__esModule=!0;jk.wrapHelper=Pk;function Pk(_,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((uk)=>{uk.__esModule=!0;uk.checkRevision=Hk;uk.template=hk;uk.wrapProgram=E$;uk.resolvePartial=Jk;uk.invokePartial=kk;uk.noop=d5;function Ok(_){return _&&_.__esModule?_:{default:_}}function Yk(_){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 Tk=Lq(),i_=Yk(Tk),zk=j_(),o_=Ok(zk),c_=R$(),E5=sP(),Wk=R5(),g5=UP();function Hk(_){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
7
|
`);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)+`:
|
|
8
|
+
`)}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=Zk(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(Xk(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 Jk(_,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 kk(_,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 Zk(_,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 Xk(_,q){Object.keys(_).forEach(function(f){var K=_[f];_[f]=Ak(K,q)})}function Ak(_,q){var f=q.lookupProperty;return Wk.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 pk=R$(),i5=P3(pk),lk=n5(),nk=K3(lk),Rk=j_(),Ek=K3(Rk),gk=Lq(),$3=P3(gk),dk=I5(),o5=P3(dk),ak=f3(),Ik=K3(ak);function c5(){var _=new i5.HandlebarsEnvironment;return $3.extend(_,i5),_.SafeString=nk.default,_.Exception=Ek.default,_.Utils=$3,_.escapeExpression=$3.escapeExpression,_.VM=o5,_.template=function(q){return o5.template(q,_)},_}var qf=c5();qf.create=c5;Ik.default(qf);qf.default=qf;L5.default=qf;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 ck=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
9
|
`+this.lexer.showPosition()+`
|
|
11
10
|
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
11
|
`+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$()
|
|
12
|
+
`+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=ck;F5.exports=U5.default});var a$=p((fw,$w)=>{fw.__esModule=!0;function ek(_){return _&&_.__esModule?_:{default:_}}var xk=j_(),v3=ek(xk);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 Uk(_){return _&&_.__esModule?_:{default:_}}var Fk=a$(),Qk=Uk(Fk);function p_(){var _=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=_}p_.prototype=new Qk.default;p_.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 _};p_.prototype.BlockStatement=p_.prototype.DecoratorBlock=p_.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};p_.prototype.Decorator=p_.prototype.MustacheStatement=function(_){return _.strip};p_.prototype.PartialStatement=p_.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=p_;Pw.exports=Kw.default});var vw=p((HZ)=>{HZ.__esModule=!0;HZ.SourceLocation=KZ;HZ.id=PZ;HZ.stripFlags=jZ;HZ.stripComment=vZ;HZ.preparePath=wZ;HZ.prepareMustache=OZ;HZ.prepareRawBlock=YZ;HZ.prepareBlock=TZ;HZ.prepareProgram=zZ;HZ.preparePartialBlock=WZ;function fZ(_){return _&&_.__esModule?_:{default:_}}var $Z=j_(),Y3=fZ($Z);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 KZ(_,q){this.source=_,this.start={line:q.first_line,column:q.first_column},this.end={line:q.last_line,column:q.last_column}}function PZ(_){if(/^\[.*\]$/.test(_))return _.substring(1,_.length-1);else return _}function jZ(_,q){return{open:_.charAt(2)==="~",close:q.charAt(q.length-3)==="~"}}function vZ(_){return _.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function wZ(_,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 OZ(_,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 YZ(_,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 TZ(_,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 zZ(_,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 WZ(_,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((RZ)=>{RZ.__esModule=!0;RZ.parseWithoutProcessing=Ow;RZ.parse=nZ;function VZ(_){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 MZ=Q5(),z3=ww(MZ),SZ=jw(),NZ=ww(SZ),CZ=vw(),pZ=VZ(CZ),lZ=Lq();RZ.parser=z3.default;var I$={};lZ.extend(I$,pZ);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 nZ(_,q){var f=Ow(_,q),K=new NZ.default(q);return K.accept(f)}});var Hw=p((cZ)=>{cZ.__esModule=!0;cZ.Compiler=W3;cZ.precompile=iZ;cZ.compile=oZ;function zw(_){return _&&_.__esModule?_:{default:_}}var IZ=j_(),ff=zw(IZ),$f=Lq(),DZ=j3(),_f=zw(DZ),yZ=[].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=$f.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 ff.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 ff.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 ff.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,_f.default.helpers.simpleId(P))},PathExpression:function _(q){this.addDepth(q.depth),this.opcode("getContext",q.depth);var f=q.parts[0],K=_f.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:yZ.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function _(q){if(!q)return;this.useDepths=!0},classifySexpr:function _(q){var f=_f.default.helpers.simpleId(q.path),K=f&&!!this.blockParamIndex(q.path.parts[0]),$=!K&&_f.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&&!_f.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=$&&$f.indexOf($,q);if($&&P>=0)return[f,P]}}};function iZ(_,q,f){if(_==null||typeof _!=="string"&&_.type!=="Program")throw new ff.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 oZ(_,q,f){if(q===void 0)q={};if(_==null||typeof _!=="string"&&_.type!=="Program")throw new ff.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+_);if(q=$f.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($f.isArray(_)&&$f.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((sZ)=>{var hw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");sZ.encode=function(_){if(0<=_&&_<hw.length)return hw[_];throw new TypeError("Must be between 0 and 63: "+_)};sZ.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((qX)=>{var kw=Jw(),H3=5,Zw=1<<H3,Xw=Zw-1,Aw=Zw;function FZ(_){return _<0?(-_<<1)+1:(_<<1)+0}function QZ(_){var q=(_&1)===1,f=_>>1;return q?-f:f}qX.encode=function _(q){var f="",K,$=FZ(q);do{if(K=$&Xw,$>>>=H3,$>0)K|=Aw;f+=kw.encode(K)}while($>0);return f};qX.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=QZ(P),K.rest=f}});var z6=p((WX)=>{function $X(_,q,f){if(q in _)return _[q];else if(arguments.length===3)return f;else throw new Error('"'+q+'" is a required argument.')}WX.getArg=$X;var uw=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,KX=/^data:.+\,.+$/;function Kf(_){var q=_.match(uw);if(!q)return null;return{scheme:q[1],auth:q[2],host:q[3],port:q[4],path:q[5]}}WX.urlParse=Kf;function Y6(_){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}WX.urlGenerate=Y6;function J3(_){var q=_,f=Kf(_);if(f){if(!f.path)return _;q=f.path}var K=WX.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,Y6(f);return q}WX.normalize=J3;function Gw(_,q){if(_==="")_=".";if(q==="")q=".";var f=Kf(q),K=Kf(_);if(K)_=K.path||"/";if(f&&!f.scheme){if(K)f.scheme=K.scheme;return Y6(f)}if(f||q.match(KX))return q;if(K&&!K.host&&!K.path)return K.host=q,Y6(K);var $=q.charAt(0)==="/"?q:J3(_.replace(/\/+$/,"")+"/"+q);if(K)return K.path=$,Y6(K);return $}WX.join=Gw;WX.isAbsolute=function(_){return _.charAt(0)==="/"||uw.test(_)};function PX(_,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)}WX.relative=PX;var mw=function(){var _=Object.create(null);return!("__proto__"in _)}();function rw(_){return _}function jX(_){if(bw(_))return"$"+_;return _}WX.toSetString=mw?rw:jX;function vX(_){if(bw(_))return _.slice(1);return _}WX.fromSetString=mw?rw:vX;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 wX(_,q,f){var K=T6(_.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 T6(_.name,q.name)}WX.compareByOriginalPositions=wX;function OX(_,q,f){var K=_.generatedLine-q.generatedLine;if(K!==0)return K;if(K=_.generatedColumn-q.generatedColumn,K!==0||f)return K;if(K=T6(_.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 T6(_.name,q.name)}WX.compareByGeneratedPositionsDeflated=OX;function T6(_,q){if(_===q)return 0;if(_===null)return 1;if(q===null)return-1;if(_>q)return 1;return-1}function YX(_,q){var f=_.generatedLine-q.generatedLine;if(f!==0)return f;if(f=_.generatedColumn-q.generatedColumn,f!==0)return f;if(f=T6(_.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 T6(_.name,q.name)}WX.compareByGeneratedPositionsInflated=YX;function TX(_){return JSON.parse(_.replace(/^\)]}'[^\n]*\n/,""))}WX.parseSourceMapInput=TX;function zX(_,q,f){if(q=q||"",_){if(_[_.length-1]!=="/"&&q[0]!=="/")_+="/";q=_+q}if(f){var K=Kf(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(Y6(K),q)}return J3(q)}WX.computeSourceURL=zX});var X3=p((SX)=>{var k3=z6(),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()};SX.ArraySet=L_});var Mw=p((pX)=>{var Vw=z6();function CX(_,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(CX(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};pX.MappingList=D$});var A3=p((RX)=>{var Pf=h3(),lq=z6(),y$=X3().ArraySet,nX=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 nX,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+=Pf.encode(O.generatedColumn-q),q=O.generatedColumn,O.source!=null){if(Y=this._sources.indexOf(O.source),w+=Pf.encode(Y-j),j=Y,w+=Pf.encode(O.originalLine-1-$),$=O.originalLine-1,w+=Pf.encode(O.originalColumn-K),K=O.originalColumn,O.name!=null)T=this._names.indexOf(O.name),w+=Pf.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())};RX.SourceMapGenerator=v_});var Nw=p((gX)=>{gX.GREATEST_LOWER_BOUND=1;gX.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==gX.LEAST_UPPER_BOUND)return q<K.length?q:-1;else return j}else{if(j-_>1)return u3(_,j,f,K,$,P);if(P==gX.LEAST_UPPER_BOUND)return j;else return _<0?-1:_}}gX.search=function _(q,f,K,$){if(f.length===0)return-1;var P=u3(-1,f.length,q,f,K,$||gX.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((IX)=>{function m3(_,q,f){var K=_[q];_[q]=_[f],_[f]=K}function aX(_,q){return Math.round(_+Math.random()*(q-_))}function r3(_,q,f,K){if(f<K){var $=aX(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)}}IX.quickSort=function(_,q){r3(_,q,0,_.length-1)}});var lw=p((iX)=>{var s=z6(),b3=Nw(),W6=X3().ArraySet,yX=h3(),jf=Cw().quickSort;function Aq(_,q){var f=_;if(typeof _==="string")f=s.parseSourceMapInput(_);return f.sections!=null?new A_(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 $};iX.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=W6.fromArray(P.map(String),!0),this._sources=W6.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=W6.fromArray(q._names.toArray(),!0),P=K._sources=W6.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 jf(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)yX.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)}jf(h,s.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,jf(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}};iX.BasicSourceMapConsumer=Iq;function A_(_,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 W6,this._names=new W6;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)}})}A_.prototype=Object.create(Aq.prototype);A_.prototype.constructor=Aq;A_.prototype._version=3;Object.defineProperty(A_.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 _}});A_.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})};A_.prototype.hasContentsOfAllSources=function _(){return this._sections.every(function(q){return q.consumer.hasContentsOfAllSources()})};A_.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.')};A_.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}};A_.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)}}jf(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),jf(this.__originalMappings,s.compareByOriginalPositions)};iX.IndexedSourceMapConsumer=A_});var nw=p((sX)=>{var tX=A3().SourceMapGenerator,i$=z6(),eX=/(\r?\n)/,xX=10,H6="$$$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[H6]=!0,K!=null)this.add(K)}q_.fromStringWithSourceMap=function _(q,f,K){var $=new q_,P=q.split(eX),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[H6]||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[H6]||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[H6])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[H6])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][H6])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 tX(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)===xX){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}};sX.SourceNode=q_});var Rw=p((UX)=>{UX.SourceMapGenerator=A3().SourceMapGenerator;UX.SourceMapConsumer=lw().SourceMapConsumer;UX.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,`
|
|
13
|
+
`])}),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$(),$A=j_(),N3=yw($A),KA=Lq(),PA=aw(),Dw=yw(PA);function h6(_){this.value=_}function J6(){}J6.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(!KA.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
14
|
`]),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
15
|
`),this.decorators.push(`}
|
|
17
16
|
`),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(","),`) {
|
|
@@ -23,76 +22,76 @@ Expecting `+m.join(", ")+", got '"+(this.terminals_[n]||n)+"'";else S="Parse err
|
|
|
23
22
|
}
|
|
24
23
|
return undefined
|
|
25
24
|
}
|
|
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((
|
|
28
|
-
`)}}w_.defaultYaml={explicit:!1,version:"1.2"};w_.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
25
|
+
`.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(jA(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:J6,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 h6))q=this.source.wrap(q);return this.inlineStack.push(q),q},pushStackLiteral:function _(q){this.push(new h6(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 h6)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 h6)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 h6)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 h6)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=J6.RESERVED_WORDS={};for(var f=0,K=_.length;f<K;f++)q[_[f]]=!0})();J6.isValidJavaScriptVariableName=function(_){return!J6.RESERVED_WORDS[_]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(_)};function jA(_,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=J6;ow.exports=iw.default});var xw=p((tw,ew)=>{tw.__esModule=!0;function vf(_){return _&&_.__esModule?_:{default:_}}var OA=e5(),YA=vf(OA),TA=j3(),zA=vf(TA),C3=Yw(),p3=Hw(),WA=cw(),HA=vf(WA),hA=a$(),JA=vf(hA),kA=f3(),ZA=vf(kA),XA=YA.default.create;function Lw(){var _=XA();return _.compile=function(q,f){return p3.compile(q,f,_)},_.precompile=function(q,f){return p3.precompile(q,f,_)},_.AST=zA.default,_.Compiler=p3.Compiler,_.JavaScriptCompiler=HA.default,_.Parser=C3.parser,_.parse=C3.parse,_.parseWithoutProcessing=C3.parseWithoutProcessing,_}var k6=Lw();k6.create=Lw;ZA.default(k6);k6.Visitor=JA.default;k6.default=k6;tw.default=k6;ew.exports=tw.default});var sw=p((VA)=>{VA.__esModule=!0;VA.print=bA;VA.PrintVisitor=Sq;function GA(_){return _&&_.__esModule?_:{default:_}}var mA=a$(),rA=GA(mA);function bA(_){return new Sq().accept(_)}function Sq(){this.padding=0}Sq.prototype=new rA.default;Sq.prototype.pad=function(_){var q="";for(var f=0,K=this.padding;f<K;f++)q+=" ";return q+=_+`
|
|
26
|
+
`,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((Vg,Fw)=>{var o$=xw().default,Uw=sw();o$.PrintVisitor=Uw.PrintVisitor;o$.print=Uw.print;Fw.exports=o$;function Bw(_,q){var f=T_("fs"),K=f.readFileSync(q,"utf8");_.exports=o$.compile(K)}if(T_.extensions)T_.extensions[".handlebars"]=Bw,T_.extensions[".hbs"]=Bw});var Oq=p((dA)=>{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"),CA=(_)=>!!_&&typeof _==="object"&&_[t_]===l3,pA=(_)=>!!_&&typeof _==="object"&&_[t_]===q1,lA=(_)=>!!_&&typeof _==="object"&&_[t_]===c$,nA=(_)=>!!_&&typeof _==="object"&&_[t_]===_1,f1=(_)=>!!_&&typeof _==="object"&&_[t_]===n3,RA=(_)=>!!_&&typeof _==="object"&&_[t_]===L$;function $1(_){if(_&&typeof _==="object")switch(_[t_]){case c$:case L$:return!0}return!1}function EA(_){if(_&&typeof _==="object")switch(_[t_]){case l3:case c$:case n3:case L$:return!0}return!1}var gA=(_)=>(f1(_)||$1(_))&&!!_.anchor;dA.ALIAS=l3;dA.DOC=q1;dA.MAP=c$;dA.NODE_TYPE=t_;dA.PAIR=_1;dA.SCALAR=n3;dA.SEQ=L$;dA.hasAnchor=gA;dA.isAlias=CA;dA.isCollection=$1;dA.isDocument=pA;dA.isMap=lA;dA.isNode=EA;dA.isPair=nA;dA.isScalar=f1;dA.isSeq=RA});var wf=p((qu)=>{var Eq=Oq(),Bq=Symbol("break visit"),K1=Symbol("skip children"),l_=Symbol("remove node");function t$(_,q){let f=P1(q);if(Eq.isDocument(_)){if(Z6(null,_.contents,f,Object.freeze([_]))===l_)_.contents=null}else Z6(null,_,f,Object.freeze([]))}t$.BREAK=Bq;t$.SKIP=K1;t$.REMOVE=l_;function Z6(_,q,f,K){let $=j1(_,q,f,K);if(Eq.isNode($)||Eq.isPair($))return v1(_,K,$),Z6(_,$,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=Z6(P,q.items[P],f,K);if(typeof j==="number")P=j-1;else if(j===Bq)return Bq;else if(j===l_)q.items.splice(P,1),P-=1}}else if(Eq.isPair(q)){K=Object.freeze(K.concat(q));let P=Z6("key",q.key,f,K);if(P===Bq)return Bq;else if(P===l_)q.key=null;let j=Z6("value",q.value,f,K);if(j===Bq)return Bq;else if(j===l_)q.value=null}}return $}async function e$(_,q){let f=P1(q);if(Eq.isDocument(_)){if(await X6(null,_.contents,f,Object.freeze([_]))===l_)_.contents=null}else await X6(null,_,f,Object.freeze([]))}e$.BREAK=Bq;e$.SKIP=K1;e$.REMOVE=l_;async function X6(_,q,f,K){let $=await j1(_,q,f,K);if(Eq.isNode($)||Eq.isPair($))return v1(_,K,$),X6(_,$,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 X6(P,q.items[P],f,K);if(typeof j==="number")P=j-1;else if(j===Bq)return Bq;else if(j===l_)q.items.splice(P,1),P-=1}}else if(Eq.isPair(q)){K=Object.freeze(K.concat(q));let P=await X6("key",q.key,f,K);if(P===Bq)return Bq;else if(P===l_)q.key=null;let j=await X6("value",q.value,f,K);if(j===Bq)return Bq;else if(j===l_)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`)}}qu.visit=t$;qu.visitAsync=e$});var R3=p((ju)=>{var w1=Oq(),$u=wf(),Ku={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Pu=(_)=>_.replace(/[!,[\]{}]/g,(q)=>Ku[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+Pu(_.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 $={};$u.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(`
|
|
27
|
+
`)}}w_.defaultYaml={explicit:!1,version:"1.2"};w_.defaultTags={"!!":"tag:yaml.org,2002:"};ju.Directives=w_});var x$=p((Tu)=>{var O1=Oq(),wu=wf();function Ou(_){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 wu.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 Yu(_,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}}Tu.anchorIsValid=Ou;Tu.anchorNames=Y1;Tu.createNodeAnchors=Yu;Tu.findNewAnchor=T1});var E3=p((Ju)=>{function Of(_,q,f,K){if(K&&typeof K==="object")if(Array.isArray(K))for(let $=0,P=K.length;$<P;++$){let j=K[$],v=Of(_,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=Of(_,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=Of(_,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=Of(_,K,$,P);if(j===void 0)delete K[$];else if(j!==P)K[$]=j}return _.call(q,f,K)}Ju.applyReviver=Of});var P8=p((Xu)=>{var Zu=Oq();function z1(_,q,f){if(Array.isArray(_))return _.map((K,$)=>z1(K,String($),f));if(_&&typeof _.toJSON==="function"){if(!f||!Zu.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 _}Xu.toJS=z1});var s$=p((mu)=>{var uu=E3(),W1=Oq(),Gu=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=Gu.toJS(this,"",P);if(typeof K==="function")for(let{count:v,res:w}of P.anchors.values())K(w,v);return typeof $==="function"?uu.applyReviver($,{"":j},"",j):j}}mu.NodeBase=H1});var Yf=p((Nu)=>{var bu=x$(),Vu=wf(),A6=Oq(),Mu=s$(),Su=P8();class h1 extends Mu.NodeBase{constructor(_){super(A6.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=[],Vu.visit(_,{Node:($,P)=>{if(A6.isAlias(P)||A6.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)Su.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(bu.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(A6.isAlias(q)){let K=q.resolve(_),$=f&&K&&f.get(K);return $?$.count*$.aliasCount:0}else if(A6.isCollection(q)){let K=0;for(let $ of q.items){let P=B$(_,$,f);if(P>K)K=P}return K}else if(A6.isPair(q)){let K=B$(_,q.key,f),$=B$(_,q.value,f);return Math.max(K,$)}return 1}Nu.Alias=h1});var nq=p((Eu)=>{var pu=Oq(),lu=s$(),nu=P8(),Ru=(_)=>!_||typeof _!=="function"&&typeof _!=="object";class l8 extends lu.NodeBase{constructor(_){super(pu.SCALAR);this.value=_}toJSON(_,q){return q?.keep?this.value:nu.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";Eu.Scalar=l8;Eu.isScalarValue=Ru});var Tf=p((iu)=>{var au=Yf(),n8=Oq(),J1=nq(),Iu="tag:yaml.org,2002:";function Du(_,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 yu(_,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 au.Alias(w.anchor);else w={anchor:null,node:null},v.set(_,w);if(q?.startsWith("!!"))q=Iu+q.slice(2);let O=Du(_,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}iu.createNode=yu});var U$=p((tu)=>{var cu=Tf(),n_=Oq(),Lu=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 cu.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 Lu.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)=>n_.isNode(f)||n_.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(n_.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(n_.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&&n_.isScalar($)?$.value:$;else return n_.isCollection($)?$.getIn(K,q):void 0}hasAllNullValues(_){return this.items.every((q)=>{if(!n_.isPair(q))return!1;let f=q.value;return f==null||_&&n_.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 n_.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(n_.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}`)}}}tu.Collection=Z1;tu.collectionFromPath=g3;tu.isEmptyPath=k1});var zf=p((Fu)=>{var Bu=(_)=>_.replace(/^(?!$)(?: $)?/gm,"#");function d3(_,q){if(/^\n+$/.test(_))return _.substring(1);return q?_.replace(/^(?! *$)/gm,q):_}var Uu=(_,q,f)=>_.endsWith(`
|
|
29
28
|
`)?d3(f,q):f.includes(`
|
|
30
29
|
`)?`
|
|
31
|
-
`+d3(f,q):(_.endsWith(" ")?"":" ")+f;
|
|
30
|
+
`+d3(f,q):(_.endsWith(" ")?"":" ")+f;Fu.indentComment=d3;Fu.lineComment=Uu;Fu.stringifyComment=Bu});var A1=p(($G)=>{function fG(_,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
31
|
`){if(f==="block")J=X1(_,J,q.length);Y=J+q.length+w,z=void 0}else{if(N===" "&&H&&H!==" "&&H!==`
|
|
33
32
|
`&&H!=="\t"){let n=_[J+1];if(n&&n!==" "&&n!==`
|
|
34
33
|
`&&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
34
|
${q}${_.slice(0,R)}`;else{if(f==="quoted"&&T[n])l+=`${_[n]}\\`;l+=`
|
|
36
35
|
${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}
|
|
38
|
-
`){if(P-j>K)return!0;if(j=P+1,$-j<=K)return!1}return!0}function
|
|
36
|
+
`);K=q,$=q+1,P=_[$]}return K}$G.FOLD_BLOCK="block";$G.FOLD_FLOW="flow";$G.FOLD_QUOTED="quoted";$G.foldFlowLines=fG});var Hf=p((TG)=>{var u_=nq(),j8=A1(),Q$=(_,q)=>({indentAtStart:q?_.indent.length:_.indentAtStart,lineWidth:_.options.lineWidth,minContentWidth:_.options.minContentWidth}),qK=(_)=>/^(%|---|\.\.\.)/m.test(_);function wG(_,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]===`
|
|
37
|
+
`){if(P-j>K)return!0;if(j=P+1,$-j<=K)return!1}return!0}function Wf(_,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
38
|
|
|
40
39
|
`;while(f[w+2]==="\\"&&f[w+3]==="n"&&f[w+4]!=='"')j+=`
|
|
41
40
|
`,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
|
|
43
|
-
${f}`)+"'";return q.implicitKey?K:j8.foldFlowLines(K,f,j8.FOLD_FLOW,Q$(q,!1))}function
|
|
41
|
+
`)||/[ \t]\n|\n[ \t]/.test(_))return Wf(_,q);let f=q.indent||(qK(_)?" ":""),K="'"+_.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
42
|
+
${f}`)+"'";return q.implicitKey?K:j8.foldFlowLines(K,f,j8.FOLD_FLOW,Q$(q,!1))}function u6(_,q){let{singleQuote:f}=q.options,K;if(f===!1)K=Wf;else{let $=_.includes('"'),P=_.includes("'");if($&&!P)K=a3;else if(P&&!$)K=Wf;else K=f?a3:Wf}return K(_,q)}var I3;try{I3=new RegExp(`(^|(?<!
|
|
44
43
|
))
|
|
45
44
|
+(?!
|
|
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
|
|
45
|
+
|$)`,"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 u6(f,K);let O=K.indent||(K.forceBlockIndent||qK(f)?" ":""),T=j==="literal"?!0:j==="folded"||q===u_.Scalar.BLOCK_FOLDED?!1:q===u_.Scalar.BLOCK_LITERAL?!0:!wG(f,w,O.length);if(!f)return T?`|
|
|
47
46
|
`:`>
|
|
48
47
|
`;let Y,z;for(z=f.length;z>0;--z){let R=f[z-1];if(R!==`
|
|
49
48
|
`&&R!=="\t"&&R!==" ")break}let H=f.substring(z),h=H.indexOf(`
|
|
50
49
|
`);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
50
|
`)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
51
|
`)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!==
|
|
52
|
+
$&`).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!==u_.Scalar.BLOCK_FOLDED)V.onOverflow=()=>{g=!0};let M=j8.foldFlowLines(`${l}${R}${H}`,O,j8.FOLD_BLOCK,V);if(!g)return`>${n}
|
|
54
53
|
${O}${M}`}return f=f.replace(/\n+/g,`$&${O}`),`|${n}
|
|
55
|
-
${O}${l}${f}${H}`}function
|
|
56
|
-
`)||T&&/[[\]{},]/.test(P))return
|
|
57
|
-
`)?
|
|
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
|
|
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
|
|
60
|
-
${q.indent}${v}`}
|
|
61
|
-
${v}:`}else if(k=`${k}:`,z)k+=
|
|
54
|
+
${O}${l}${f}${H}`}function OG(_,q,f,K){let{type:$,value:P}=_,{actualString:j,implicitKey:v,indent:w,indentStep:O,inFlow:T}=q;if(v&&P.includes(`
|
|
55
|
+
`)||T&&/[[\]{},]/.test(P))return u6(P,q);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(P))return v||T||!P.includes(`
|
|
56
|
+
`)?u6(P,q):F$(_,q,f,K);if(!v&&!T&&$!==u_.Scalar.PLAIN&&P.includes(`
|
|
57
|
+
`))return F$(_,q,f,K);if(qK(P)){if(w==="")return q.forceBlockIndent=!0,F$(_,q,f,K);else if(v&&w===O)return u6(P,q)}let Y=P.replace(/\n+/g,`$&
|
|
58
|
+
${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 u6(P,q)}return v?Y:j8.foldFlowLines(Y,w,j8.FOLD_FLOW,Q$(q,!1))}function YG(_,q,f,K){let{implicitKey:$,inFlow:P}=q,j=typeof _.value==="string"?_:Object.assign({},_,{value:String(_.value)}),{type:v}=_;if(v!==u_.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(j.value))v=u_.Scalar.QUOTE_DOUBLE}let w=(T)=>{switch(T){case u_.Scalar.BLOCK_FOLDED:case u_.Scalar.BLOCK_LITERAL:return $||P?u6(j.value,q):F$(j,q,f,K);case u_.Scalar.QUOTE_DOUBLE:return Wf(j.value,q);case u_.Scalar.QUOTE_SINGLE:return a3(j.value,q);case u_.Scalar.PLAIN:return OG(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}TG.stringifyString=YG});var hf=p((AG)=>{var WG=x$(),v8=Oq(),HG=zf(),hG=Hf();function JG(_,q){let f=Object.assign({blockQuote:!0,commentString:HG.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 kG(_,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 ZG(_,q,{anchors:f,doc:K}){if(!K.directives)return"";let $=[],P=(v8.isScalar(_)||v8.isCollection(_))&&_.anchor;if(P&&WG.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 XG(_,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});$??($=kG(q.doc.schema.tags,P));let j=ZG(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}
|
|
59
|
+
${q.indent}${v}`}AG.createStringifyContext=JG;AG.stringify=XG});var m1=p((rG)=>{var e_=Oq(),u1=nq(),G1=hf(),Jf=zf();function mG({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+=Jf.lineComment(k,f.indent,O(z));else if(J&&$)$();return k}if(h)z=null;if(H){if(z)k+=Jf.lineComment(k,f.indent,O(z));k=`? ${k}
|
|
60
|
+
${v}:`}else if(k=`${k}:`,z)k+=Jf.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
61
|
`:"",l){let V=O(l);g+=`
|
|
63
|
-
${
|
|
62
|
+
${Jf.indentComment(V,f.indent)}`}if(R===""&&!f.inFlow){if(g===`
|
|
64
63
|
`)g=`
|
|
65
64
|
|
|
66
65
|
`}else g+=`
|
|
67
66
|
${f.indent}`}else if(!H&&e_.isCollection(q)){let V=R[0],M=R.indexOf(`
|
|
68
67
|
`),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
68
|
${f.indent}`}}else if(R===""||R[0]===`
|
|
70
|
-
`)g="";if(k+=g+R,f.inFlow){if(n&&K)K()}else if(N&&!n)k+=
|
|
69
|
+
`)g="";if(k+=g+R,f.inFlow){if(n&&K)K()}else if(N&&!n)k+=Jf.lineComment(k,f.indent,O(N));else if(J&&$)$();return k}rG.stringifyPair=mG});var D3=p((SG)=>{var r1=T_("process");function VG(_,...q){if(_==="debug")console.log(...q)}function MG(_,q){if(_==="debug"||_==="warn")if(typeof r1.emitWarning==="function")r1.emitWarning(q);else console.warn(q)}SG.debug=VG;SG.warn=MG});var $K=p((lG)=>{var kf=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},pG=(_,q)=>(fK.identify(q)||kf.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=_&&kf.isAlias(f)?f.resolve(_.doc):f,kf.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=_&&kf.isAlias(f)?f.resolve(_.doc):f;if(!kf.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}lG.addMergeToJSMap=V1;lG.isMergeKey=pG;lG.merge=fK});var o3=p((DG)=>{var gG=D3(),M1=$K(),dG=hf(),S1=Oq(),i3=P8();function aG(_,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=IG(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 IG(_,q,f){if(q===null)return"";if(typeof q!=="object")return String(q);if(S1.isNode(_)&&f?.doc){let K=dG.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)+'..."';gG.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)}DG.addPairToJSMap=aG});var w8=p((LG)=>{var N1=Tf(),iG=m1(),oG=o3(),KK=Oq();function cG(_,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 oG.addPairToJSMap(q,f,this)}toString(_,q,f){return _?.doc?iG.stringifyPair(this,_,q,f):JSON.stringify(this)}}LG.Pair=PK;LG.createPair=cG});var c3=p((UG)=>{var R8=Oq(),C1=hf(),jK=zf();function xG(_,q,f){return(q.inFlow??_.flow?BG:sG)(_,q,f)}function sG({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
70
|
${w}${J}`:`
|
|
72
71
|
`}}if(_){if(H+=`
|
|
73
|
-
`+jK.indentComment(O(_),w),v)v()}else if(Y&&j)j();return H}function
|
|
72
|
+
`+jK.indentComment(O(_),w),v)v()}else if(Y&&j)j();return H}function BG({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
73
|
`)))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
74
|
${P}${$}${J}`:`
|
|
76
75
|
`;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())}}
|
|
78
|
-
`:" ")}return
|
|
76
|
+
${$}${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())}}UG.stringifyCollection=xG});var Y8=p(($m)=>{var QG=c3(),qm=o3(),_m=U$(),O8=Oq(),wK=w8(),fm=nq();function Zf(_,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 _m.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=Zf(this.items,f.key),$=this.schema?.sortMapEntries;if(K){if(!q)throw new Error(`Key ${f.key} already set`);if(O8.isScalar(K.value)&&fm.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=Zf(this.items,_);if(!q)return!1;return this.items.splice(this.items.indexOf(q),1).length>0}get(_,q){let K=Zf(this.items,_)?.value;return(!q&&O8.isScalar(K)?K.value:K)??void 0}has(_){return!!Zf(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)qm.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 QG.stringifyCollection(this,_,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:_.indent||"",onChompKeep:f,onComment:q})}}$m.YAMLMap=p1;$m.findPair=Zf});var G6=p((wm)=>{var jm=Oq(),l1=Y8(),vm={collection:"map",default:!0,nodeClass:l1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(_,q){if(!jm.isMap(_))q("Expected a mapping for this tag");return _},createNode:(_,q,f)=>l1.YAMLMap.from(_,q,f)};wm.map=vm});var T8=p((hm)=>{var Ym=Tf(),Tm=c3(),zm=U$(),YK=Oq(),Wm=nq(),Hm=P8();class n1 extends zm.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)&&Wm.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(Hm.toJS($,String(K++),q));return f}toString(_,q,f){if(!_)return JSON.stringify(this);return Tm.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(Ym.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 m6=p((Xm)=>{var km=Oq(),R1=T8(),Zm={collection:"seq",default:!0,nodeClass:R1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(_,q){if(!km.isSeq(_))q("Expected a sequence for this tag");return _},createNode:(_,q,f)=>R1.YAMLSeq.from(_,q,f)};Xm.seq=Zm});var Xf=p((mm)=>{var um=Hf(),Gm={identify:(_)=>typeof _==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(_)=>_,stringify(_,q,f,K){return q=Object.assign({actualString:!0},q),um.stringifyString(_,q,f,K)}};mm.string=Gm});var TK=p((bm)=>{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};bm.nullTag=g1});var L3=p((Sm)=>{var Mm=nq(),d1={identify:(_)=>typeof _==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(_)=>new Mm.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}};Sm.boolTag=d1});var r6=p((pm)=>{function Cm({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}pm.stringifyNumber=Cm});var e3=p((dm)=>{var nm=nq(),t3=r6(),Rm={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},Em={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(_)}},gm={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(_){let q=new nm.Scalar(parseFloat(_)),f=_.indexOf(".");if(f!==-1&&_[_.length-1]==="0")q.minFractionDigits=_.length-f-1;return q},stringify:t3.stringifyNumber};dm.float=gm;dm.floatExp=Em;dm.floatNaN=Rm});var s3=p((cm)=>{var a1=r6(),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 ym={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")},im={identify:zK,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(_,q,f)=>x3(_,0,10,f),stringify:a1.stringifyNumber},om={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")};cm.int=im;cm.intHex=om;cm.intOct=ym});var D1=p((qr)=>{var xm=G6(),sm=TK(),Bm=m6(),Um=Xf(),Fm=L3(),B3=e3(),U3=s3(),Qm=[xm.map,Bm.seq,Um.string,sm.nullTag,Fm.boolTag,U3.intOct,U3.int,U3.intHex,B3.floatNaN,B3.floatExp,B3.float];qr.schema=Qm});var i1=p((wr)=>{var fr=nq(),$r=G6(),Kr=m6();function y1(_){return typeof _==="bigint"||Number.isInteger(_)}var WK=({value:_})=>JSON.stringify(_),Pr=[{identify:(_)=>typeof _==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(_)=>_,stringify:WK},{identify:(_)=>_==null,createNode:()=>new fr.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}],jr={default:!0,tag:"",test:/^/,resolve(_,q){return q(`Unresolved plain scalar ${JSON.stringify(_)}`),_}},vr=[$r.map,Kr.seq].concat(Pr,jr);wr.schema=vr});var Q3=p((zr)=>{var Af=T_("buffer"),F3=nq(),Yr=Hf(),Tr={identify:(_)=>_ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(_,q){if(typeof Af.Buffer==="function")return Af.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 Af.Buffer==="function")v=j instanceof Af.Buffer?j.toString("base64"):Af.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?`
|
|
77
|
+
`:" ")}return Yr.stringifyString({comment:_,type:q,value:v},K,$,P)}};zr.binary=Tr});var hK=p((kr)=>{var HK=Oq(),q4=w8(),Hr=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 Hr.Scalar(null));if(K.commentBefore)$.key.commentBefore=$.key.commentBefore?`${K.commentBefore}
|
|
79
78
|
${$.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(
|
|
79
|
+
${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 Jr={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:o1,createNode:c1};kr.createPairs=c1;kr.pairs=Jr;kr.resolvePairs=o1});var f4=p((mr)=>{var L1=Oq(),_4=P8(),uf=Y8(),ur=T8(),t1=hK();class E8 extends ur.YAMLSeq{constructor(){super();this.add=uf.YAMLMap.prototype.add.bind(this),this.delete=uf.YAMLMap.prototype.delete.bind(this),this.get=uf.YAMLMap.prototype.get.bind(this),this.has=uf.YAMLMap.prototype.has.bind(this),this.set=uf.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 Gr={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)};mr.YAMLOMap=E8;mr.omap=Gr});var U1=p((Vr)=>{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};Vr.falseTag=B1;Vr.trueTag=s1});var F1=p((nr)=>{var Nr=nq(),$4=r6(),Cr={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},pr={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(_)}},lr={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(_){let q=new Nr.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};nr.float=lr;nr.floatExp=pr;nr.floatNaN=Cr});var q2=p((yr)=>{var Q1=r6(),Gf=(_)=>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(Gf(K)){let $=K.toString(q);return K<0?"-"+f+$.substr(1):f+$}return Q1.stringifyNumber(_)}var dr={identify:Gf,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")},ar={identify:Gf,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")},Ir={identify:Gf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(_,q,f)=>JK(_,0,10,f),stringify:Q1.stringifyNumber},Dr={identify:Gf,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")};yr.int=Ir;yr.intBin=dr;yr.intHex=Dr;yr.intOct=ar});var P4=p((er)=>{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 tr={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 _}};er.YAMLSet=g8;er.set=tr});var v4=p((Qr)=>{var Br=r6();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 Br.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 Ur={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},Fr={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$/,"")??""};Qr.floatTime=Fr;Qr.intTime=Ur;Qr.timestamp=f2});var K2=p((Wb)=>{var $b=G6(),Kb=TK(),Pb=m6(),jb=Xf(),vb=Q3(),$2=U1(),w4=F1(),AK=q2(),wb=$K(),Ob=f4(),Yb=hK(),Tb=P4(),O4=v4(),zb=[$b.map,Pb.seq,jb.string,Kb.nullTag,$2.trueTag,$2.falseTag,AK.intBin,AK.intOct,AK.int,AK.intHex,w4.floatNaN,w4.floatExp,w4.float,vb.binary,wb.merge,Ob.omap,Yb.pairs,Tb.set,O4.intTime,O4.floatTime,O4.timestamp];Wb.schema=zb});var H2=p((Gb)=>{var w2=G6(),hb=TK(),O2=m6(),Jb=Xf(),kb=L3(),Y4=e3(),T4=s3(),Zb=D1(),Xb=i1(),Y2=Q3(),mf=$K(),T2=f4(),z2=hK(),P2=K2(),W2=P4(),uK=v4(),j2=new Map([["core",Zb.schema],["failsafe",[w2.map,O2.seq,Jb.string]],["json",Xb.schema],["yaml11",P2.schema],["yaml-1.1",P2.schema]]),v2={binary:Y2.binary,bool:kb.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:mf.merge,null:hb.nullTag,omap:T2.omap,pairs:z2.pairs,seq:O2.seq,set:W2.set,timestamp:uK.timestamp},Ab={"tag:yaml.org,2002:binary":Y2.binary,"tag:yaml.org,2002:merge":mf.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 ub(_,q,f){let K=j2.get(q);if(K&&!_)return f&&!K.includes(mf.merge)?K.concat(mf.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(mf.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},[])}Gb.coreKnownTags=Ab;Gb.getTags=ub});var H4=p((Nb)=>{var z4=Oq(),bb=G6(),Vb=m6(),Mb=Xf(),GK=H2(),Sb=(_,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:bb.map}),Object.defineProperty(this,z4.SCALAR,{value:Mb.string}),Object.defineProperty(this,z4.SEQ,{value:Vb.seq}),this.sortMapEntries=typeof P==="function"?P:P===!0?Sb:null}clone(){let _=Object.create(W4.prototype,Object.getOwnPropertyDescriptors(this));return _.tags=this.tags.slice(),_}}Nb.Schema=W4});var h2=p((nb)=>{var pb=Oq(),h4=hf(),rf=zf();function lb(_,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(rf.indentComment(w,""))}let j=!1,v=null;if(_.contents){if(pb.isNode(_.contents)){if(_.contents.spaceBefore&&K)f.push("");if(_.contents.commentBefore){let T=P(_.contents.commentBefore);f.push(rf.indentComment(T,""))}$.forceBlockIndent=!!_.comment,v=_.contents.comment}let w=v?void 0:()=>j=!0,O=h4.stringify(_.contents,$,()=>v=null,w);if(v)O+=rf.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(`
|
|
80
|
+
`))f.push("..."),f.push(rf.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(rf.indentComment(P(w),""))}}return f.join(`
|
|
82
81
|
`)+`
|
|
83
|
-
`}
|
|
82
|
+
`}nb.stringifyDocument=lb});var bf=p((ib)=>{var Eb=Yf(),b6=U$(),O_=Oq(),gb=w8(),db=P8(),ab=H4(),Ib=h2(),J4=x$(),Db=E3(),yb=Tf(),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(V6(this.contents))this.contents.add(_)}addIn(_,q){if(V6(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 Eb.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=yb.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 gb.Pair(K,$)}delete(_){return V6(this.contents)?this.contents.delete(_):!1}deleteIn(_){if(b6.isEmptyPath(_)){if(this.contents==null)return!1;return this.contents=null,!0}return V6(this.contents)?this.contents.deleteIn(_):!1}get(_,q){return O_.isCollection(this.contents)?this.contents.get(_,q):void 0}getIn(_,q){if(b6.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(b6.isEmptyPath(_))return this.contents!==void 0;return O_.isCollection(this.contents)?this.contents.hasIn(_):!1}set(_,q){if(this.contents==null)this.contents=b6.collectionFromPath(this.schema,[_],q);else if(V6(this.contents))this.contents.set(_,q)}setIn(_,q){if(b6.isEmptyPath(_))this.contents=q;else if(this.contents==null)this.contents=b6.collectionFromPath(this.schema,Array.from(_),q);else if(V6(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 ab.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=db.toJS(this.contents,q??"",j);if(typeof $==="function")for(let{count:w,res:O}of j.anchors.values())$(O,w);return typeof P==="function"?Db.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 Ib.stringifyDocument(this,_)}}function V6(_){if(O_.isCollection(_))return!0;throw new Error("Expected a YAML collection as document contents")}ib.Document=Z4});var Vf=p((Lb)=>{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 cb=(_,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="…"+j.substring(v),P-=v-1}if(j.length>80)j=j.substring(0,79)+"…";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)+`…
|
|
84
83
|
`;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
84
|
|
|
86
85
|
${j}
|
|
87
86
|
${O}
|
|
88
|
-
`}};
|
|
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}}
|
|
90
|
-
`+J.comment;else v.comment=J.comment;continue}if(J.newlineAfterProp||
|
|
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}
|
|
92
|
-
`+g.comment;else O.comment=g.comment;Y=g.end;continue}if(!j&&f.options.strict&&
|
|
87
|
+
`}};Lb.YAMLError=mK;Lb.YAMLParseError=J2;Lb.YAMLWarning=k2;Lb.prettifyError=cb});var Mf=p((Ub)=>{function Bb(_,{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}}Ub.resolveProps=Bb});var rK=p((Qb)=>{function X4(_){if(!_)return null;switch(_.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(_.source.includes(`
|
|
88
|
+
`))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}}Qb.containsNewline=X4});var A4=p(($V)=>{var _V=rK();function fV(_,q,f){if(q?.type==="flow-collection"){let K=q.end[0];if(K.indent===_&&(K.source==="]"||K.source==="}")&&_V.containsNewline(q))f(K,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}$V.flowIndentCheck=fV});var u4=p((jV)=>{var Z2=Oq();function PV(_,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))}jV.mapIncludes=PV});var m2=p((zV)=>{var X2=w8(),wV=Y8(),A2=Mf(),OV=rK(),u2=A4(),YV=u4(),G2="All mapping items must start at the same column";function TV({composeNode:_,composeEmptyNode:q},f,K,$,P){let v=new(P?.nodeClass??wV.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+=`
|
|
89
|
+
`+J.comment;else v.comment=J.comment;continue}if(J.newlineAfterProp||OV.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,YV.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+=`
|
|
90
|
+
`+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}zV.resolveBlockMap=TV});var r2=p((ZV)=>{var HV=T8(),hV=Mf(),JV=A4();function kV({composeNode:_,composeEmptyNode:q},f,K,$,P){let v=new(P?.nodeClass??HV.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)JV.flowIndentCheck(K.indent,Y,$);w=H.range[2],v.items.push(H)}return v.range=[K.offset,w,O??w],v}ZV.resolveBlockSeq=kV});var M6=p((uV)=>{function AV(_,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}}uV.resolveEnd=AV});var M2=p((CV)=>{var mV=Oq(),rV=w8(),b2=Y8(),bV=T8(),VV=M6(),V2=Mf(),MV=rK(),SV=u4(),G4="Block collections are not allowed within flow collections",m4=(_)=>_&&(_.type==="block-map"||_.type==="block-seq");function NV({composeNode:_,composeEmptyNode:q},f,K,$,P){let j=K.start.source==="{",v=j?"flow map":"flow sequence",O=new(P?.nodeClass??(j?b2.YAMLMap:bV.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+=`
|
|
91
|
+
`+g.comment;else O.comment=g.comment;Y=g.end;continue}if(!j&&f.options.strict&&MV.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(mV.isPair(M))M=M.value??M.key;if(M.comment)M.comment+=`
|
|
93
92
|
`+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
|
|
95
|
-
`+k.comment;else O.comment=k.comment;O.range=[K.offset,J,k.offset]}else O.range=[K.offset,J,J];return O}
|
|
93
|
+
`+C.comment;else M.comment=C.comment;let r=new rV.Pair(M,a);if(f.options.keepSourceTokens)r.srcToken=X;if(j){let A=O;if(SV.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=VV.resolveEnd(h,J,f.options.strict,$);if(k.comment)if(O.comment)O.comment+=`
|
|
94
|
+
`+k.comment;else O.comment=k.comment;O.range=[K.offset,J,k.offset]}else O.range=[K.offset,J,J];return O}CV.resolveFlowCollection=NV});var S2=p((DV)=>{var lV=Oq(),nV=nq(),RV=Y8(),EV=T8(),gV=m2(),dV=r2(),aV=M2();function r4(_,q,f,K,$,P){let j=f.type==="block-map"?gV.resolveBlockMap(_,q,f,K,P):f.type==="block-seq"?dV.resolveBlockSeq(_,q,f,K,P):aV.resolveFlowCollection(_,q,f,K,P),v=j.constructor;if($==="!"||$===v.tagName)return j.tag=v.tagName,j;if($)j.tag=$;return j}function IV(_,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===RV.YAMLMap.tagName&&v==="map"||j===EV.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=lV.isNode(T)?T:new nV.Scalar(T);if(Y.range=O.range,Y.tag=j,w?.format)Y.format=w.format;return Y}DV.composeCollection=IV});var V4=p((LV)=>{var b4=nq();function iV(_,q,f){let K=q.offset,$=oV(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?cV(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
95
|
`.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
96
|
`;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
97
|
`;else if(k.length>w||X[0]==="\t"){if(z===" ")z=`
|
|
@@ -107,84 +106,84 @@ ${O}
|
|
|
107
106
|
`+j[J][0].slice(w);if(Y[Y.length-1]!==`
|
|
108
107
|
`)Y+=`
|
|
109
108
|
`;break;default:Y+=`
|
|
110
|
-
`}let h=K+$.length+q.source.length;return{value:Y,type:P,comment:$.comment,range:[K,h,h]}}function
|
|
109
|
+
`}let h=K+$.length+q.source.length;return{value:Y,type:P,comment:$.comment,range:[K,h,h]}}function oV({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 cV(_){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}LV.resolveBlockScalar=iV});var S4=p((_M)=>{var M4=nq(),eV=M6();function xV(_,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=sV(P,O);break;case"single-quoted-scalar":v=M4.Scalar.QUOTE_SINGLE,w=BV(P,O);break;case"double-quoted-scalar":v=M4.Scalar.QUOTE_DOUBLE,w=UV(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=eV.resolveEnd(j,T,q,f);return{value:w,type:v,comment:Y.comment,range:[K,T,Y.offset]}}function sV(_,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 BV(_,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
110
|
`,"sy"),f=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
112
111
|
`,"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
112
|
`)$+=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
|
|
113
|
+
`;else $+=P+K[1],P=" ";j=f.lastIndex}let v=/[ \t]*(.*)/sy;return v.lastIndex=j,K=v.exec(_),$+P+(K?.[1]??"")}function UV(_,q){let f="";for(let K=1;K<_.length-1;++K){let $=_[K];if($==="\r"&&_[K+1]===`
|
|
115
114
|
`)continue;if($===`
|
|
116
|
-
`){let{fold:P,offset:j}=
|
|
115
|
+
`){let{fold:P,offset:j}=FV(_,K);f+=P,K=j}else if($==="\\"){let P=_[++K],j=QV[P];if(j)f+=j;else if(P===`
|
|
117
116
|
`){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+=
|
|
117
|
+
`){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+=qM(_,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
118
|
`&&!(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
|
|
119
|
+
`))f+=K>P?_.slice(P,K+1):$}else f+=$}if(_[_.length-1]!=='"'||_.length===1)q(_.length,"MISSING_CHAR",'Missing closing "quote');return f}function FV(_,q){let f="",K=_[q+1];while(K===" "||K==="\t"||K===`
|
|
121
120
|
`||K==="\r"){if(K==="\r"&&_[q+2]!==`
|
|
122
121
|
`)break;if(K===`
|
|
123
122
|
`)f+=`
|
|
124
|
-
`;q+=1,K=_[q+1]}if(!f)f=" ";return{fold:f,offset:q}}var
|
|
125
|
-
`,r:"\r",t:"\t",v:"\v",N:"
|
|
123
|
+
`;q+=1,K=_[q+1]}if(!f)f=" ";return{fold:f,offset:q}}var QV={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
124
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function qM(_,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)}_M.resolveFlowScalar=xV});var p2=p((wM)=>{var d8=Oq(),C2=nq(),$M=V4(),KM=S4();function PM(_,q,f,K){let{value:$,type:P,comment:j,range:v}=q.type==="block-scalar"?$M.resolveBlockScalar(_,q,K):KM.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=jM(_.schema,$,w,f,K);else if(q.type==="scalar")O=vM(_,$,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 jM(_,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 vM({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}wM.composeScalar=PM});var l2=p((TM)=>{function YM(_,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 _}TM.emptyScalarPosition=YM});var E2=p((AM)=>{var WM=Yf(),HM=Oq(),hM=S2(),n2=p2(),JM=M6(),kM=l2(),ZM={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=XM(_,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(ZM,_,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&&(!HM.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:kM.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 XM({options:_},{offset:q,source:f,end:K},$){let P=new WM.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=JM.resolveEnd(K,j,_.strict,$);if(P.range=[q,j,v.offset],v.comment)P.comment=v.comment;return P}AM.composeEmptyNode=N4;AM.composeNode=R2});var d2=p((MM)=>{var mM=bf(),g2=E2(),rM=M6(),bM=Mf();function VM(_,q,{offset:f,start:K,value:$,end:P},j){let v=Object.assign({_directives:q},_),w=new mM.Document(void 0,v),O={atKey:!1,atRoot:!0,directives:w.directives,options:w.options,schema:w.schema},T=bM.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=rM.resolveEnd(P,Y,!1,j);if(z.comment)w.comment=z.comment;return w.range=[f,Y,z.offset],w}MM.composeDoc=VM});var C4=p((RM)=>{var NM=T_("process"),CM=R3(),pM=bf(),Sf=Vf(),a2=Oq(),lM=d2(),nM=M6();function Nf(_){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
125
|
|
|
127
126
|
`:`
|
|
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=
|
|
127
|
+
`)+(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=Nf(q);if($)this.warnings.push(new Sf.YAMLWarning(P,f,K));else this.errors.push(new Sf.YAMLParseError(P,f,K))},this.directives=new CM.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
128
|
${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
129
|
${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(
|
|
132
|
-
${q.comment}`:q.comment}this.doc.range[2]=q.offset;break}default:this.errors.push(new
|
|
130
|
+
${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(NM.env.LOG_STREAM)console.dir(_,{depth:null});switch(_.type){case"directive":this.directives.add(_.source,(q,f,K)=>{let $=Nf(_);$[0]+=q,this.onError($,"BAD_DIRECTIVE",f,K)}),this.prelude.push(_.source),this.atDirectives=!0;break;case"document":{let q=lM.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 Sf.YAMLParseError(Nf(_),"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 Sf.YAMLParseError(Nf(_),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let q=nM.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}
|
|
131
|
+
${q.comment}`:q.comment}this.doc.range[2]=q.offset;break}default:this.errors.push(new Sf.YAMLParseError(Nf(_),"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 pM.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}}}RM.Composer=D2});var o2=p((oM)=>{var gM=V4(),dM=S4(),aM=Vf(),y2=Hf();function IM(_,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 aM.YAMLParseError([v,v+1],P,j)};switch(_.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return dM.resolveFlowScalar(_,q,K);case"block-scalar":return gM.resolveBlockScalar({options:{strict:q}},_,K)}}return null}function DM(_,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
132
|
`}];switch(v[0]){case"|":case">":{let O=v.indexOf(`
|
|
134
133
|
`),T=v.substring(0,O),Y=v.substring(O+1)+`
|
|
135
134
|
`,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
|
|
135
|
+
`});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 yM(_,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">":iM(_,w);break;case'"':p4(_,w,"double-quoted-scalar");break;case"'":p4(_,w,"single-quoted-scalar");break;default:p4(_,w,"scalar")}}function iM(_,q){let f=q.indexOf(`
|
|
137
136
|
`),K=q.substring(0,f),$=q.substring(f+1)+`
|
|
138
137
|
`;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
138
|
`});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:$})}}}
|
|
139
|
+
`};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:$})}}}oM.createScalarToken=DM;oM.resolveAsScalar=IM;oM.setScalarValue=yM});var c2=p((xM)=>{var eM=(_)=>("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 $}xM.stringify=eM});var e2=p((UM)=>{var l4=Symbol("break visit"),BM=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=BM;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}UM.visit=a8});var MK=p((PS)=>{var n4=o2(),QM=c2(),qS=e2(),R4="\uFEFF",E4="\x02",g4="\x18",d4="\x1F",_S=(_)=>!!_&&("items"in _),fS=(_)=>!!_&&(_.type==="scalar"||_.type==="single-quoted-scalar"||_.type==="double-quoted-scalar"||_.type==="block-scalar");function $S(_){switch(_){case R4:return"<BOM>";case E4:return"<DOC>";case g4:return"<FLOW_END>";case d4:return"<SCALAR>";default:return JSON.stringify(_)}}function KS(_){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
140
|
`: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}
|
|
143
|
-
`:case"\r":case"\t":return!0;default:return!1}}var x2=new Set("0123456789ABCDEFabcdef"),
|
|
144
|
-
\r `),a4=(_)=>!_||
|
|
141
|
+
`: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}PS.createScalarToken=n4.createScalarToken;PS.resolveAsScalar=n4.resolveAsScalar;PS.setScalarValue=n4.setScalarValue;PS.stringify=QM.stringify;PS.visit=qS.visit;PS.BOM=R4;PS.DOCUMENT=E4;PS.FLOW_END=g4;PS.SCALAR=d4;PS.isCollection=_S;PS.isScalar=fS;PS.prettyToken=$S;PS.tokenType=KS});var I4=p((uS)=>{var Cf=MK();function G_(_){switch(_){case void 0:case" ":case`
|
|
142
|
+
`:case"\r":case"\t":return!0;default:return!1}}var x2=new Set("0123456789ABCDEFabcdef"),XS=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),SK=new Set(",[]{}"),AS=new Set(` ,[]{}
|
|
143
|
+
\r `),a4=(_)=>!_||AS.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
144
|
`)return!0;if(q==="\r")return this.buffer[_+1]===`
|
|
146
145
|
`;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
146
|
`||!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==="...")&&
|
|
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]===
|
|
147
|
+
`||f>=this.indentNext||!q&&!this.atEnd?_+f:-1}if(q==="-"||q==="."){let f=this.buffer.substr(_,3);if((f==="---"||f==="...")&&G_(this.buffer[_+3]))return-1}return _}getLine(){let _=this.lineEndPos;if(typeof _!=="number"||_!==-1&&_<this.pos)_=this.buffer.indexOf(`
|
|
148
|
+
`,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]===Cf.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 Cf.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==="...")&&G_(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&&!G_(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((_==="-"||_==="?"||_===":")&&G_(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("..."))&&G_(K[3])){if(!(f===this.indentNext-1&&this.flowLevel===1&&(K[0]==="]"||K[0]==="}")))return this.flowLevel=0,yield Cf.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||G_(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
149
|
`,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)=>
|
|
150
|
+
`,$)}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)=>G_(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
151
|
`:_=$,q=0;break;case"\r":{let P=this.buffer[$+1];if(!P&&!this.atEnd)return this.setNext("block-scalar");if(P===`
|
|
153
152
|
`)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
153
|
`,$)}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
154
|
`)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
|
|
155
|
+
`&&$>=this.pos&&$+1+q>j)_=$;else break}while(!0);return yield Cf.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(G_($)||_&&SK.has($))break;q=f}else if(G_(K)){let $=this.buffer[f+1];if(K==="\r")if($===`
|
|
157
156
|
`)f+=1,K=`
|
|
158
157
|
`,$=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
|
|
158
|
+
`){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 Cf.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(G_(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(!G_(q)&&q!==">")q=this.buffer[++_];return yield*this.pushToIndex(q===">"?_+1:_,!1)}else{let _=this.pos+1,q=this.buffer[_];while(q)if(XS.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
159
|
`)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)}}
|
|
160
|
+
`)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)}}uS.Lexer=s2});var D4=p((mS)=>{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}}}}mS.LineCounter=B2});var y4=p((MS)=>{var bS=T_("process"),U2=MK(),VS=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 S6(_){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 VS.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=_,bS.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=S6(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
161
|
`)+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=
|
|
162
|
+
`,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=S6(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=S6(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),$=S6(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
163
|
`)+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=
|
|
164
|
+
`,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=S6(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=S6(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()}}}MS.Parser=_O});var jO=p((gS)=>{var fO=C4(),NS=bf(),pf=Vf(),CS=D3(),pS=Oq(),lS=D4(),$O=y4();function KO(_){let q=_.prettyErrors!==!1;return{lineCounter:_.lineCounter||q&&new lS.LineCounter||null,prettyErrors:q}}function nS(_,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(pf.prettifyError(_,f)),v.warnings.forEach(pf.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 pf.YAMLParseError(v.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(K&&f)j.errors.forEach(pf.prettifyError(_,f)),j.warnings.forEach(pf.prettifyError(_,f));return j}function RS(_,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)=>CS.warn($.options.logLevel,P)),$.errors.length>0)if($.options.logLevel!=="silent")throw $.errors[0];else $.errors=[];return $.toJS(Object.assign({reviver:K},f))}function ES(_,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(pS.isDocument(_)&&!K)return _.toString(f);return new NS.Document(_,K,f).toString(f)}gS.parse=RS;gS.parseAllDocuments=nS;gS.parseDocument=PO;gS.stringify=ES});var wO=p((QS)=>{var yS=C4(),iS=bf(),oS=H4(),i4=Vf(),cS=Yf(),W8=Oq(),LS=w8(),tS=nq(),eS=Y8(),xS=T8(),sS=MK(),BS=I4(),US=D4(),FS=y4(),CK=jO(),vO=wf();QS.Composer=yS.Composer;QS.Document=iS.Document;QS.Schema=oS.Schema;QS.YAMLError=i4.YAMLError;QS.YAMLParseError=i4.YAMLParseError;QS.YAMLWarning=i4.YAMLWarning;QS.Alias=cS.Alias;QS.isAlias=W8.isAlias;QS.isCollection=W8.isCollection;QS.isDocument=W8.isDocument;QS.isMap=W8.isMap;QS.isNode=W8.isNode;QS.isPair=W8.isPair;QS.isScalar=W8.isScalar;QS.isSeq=W8.isSeq;QS.Pair=LS.Pair;QS.Scalar=tS.Scalar;QS.YAMLMap=eS.YAMLMap;QS.YAMLSeq=xS.YAMLSeq;QS.CST=sS;QS.Lexer=BS.Lexer;QS.LineCounter=US.LineCounter;QS.Parser=FS.Parser;QS.parse=CK.parse;QS.parseAllDocuments=CK.parseAllDocuments;QS.parseDocument=CK.parseDocument;QS.stringify=CK.stringify;QS.visit=vO.visit;QS.visitAsync=vO.visitAsync});import{dirname as NN}from"path";var YO,TO,CN=".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 CN},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
165
|
`);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
166
|
`),S=A.slice(0,u+1).join(`
|
|
168
167
|
`),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=
|
|
168
|
+
`).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=NN(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.delete(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=V_(()=>{ev();YO=IK(Qw(),1),TO=IK(wO(),1)});import{resolve as pK,dirname as pN}from"path";import{homedir as lN}from"os";import{existsSync as nN}from"fs";var RN=(_=process.cwd())=>{let q=pK(_),f=pK("/"),K=pK(lN(),".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(nN($))return $;q=pN(q)}throw new Error("Could not find .swic directory. Are you in a SWIC project?")},HO;var hO=V_(()=>{HO=Object.freeze({findProjectRoot:RN})});var XO={};_7(XO,{default:()=>DN});import{mkdirSync as JO}from"node:fs";import{resolve as kO}from"node:path";import{homedir as EN}from"node:os";var lK="docs",nK="templates",gN=".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
169
|
Project: ${_}
|
|
171
170
|
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
|
|
171
|
+
Error: ${K}`)}},dN=()=>{let _;try{_=HO.findProjectRoot()}catch{_=kO(process.cwd(),".swic")}let q=kO(EN(),".swic"),f=`${_}/${lK}`,K=`${q}/${lK}`,$=`${_}/${nK}`,P=`${q}/${nK}`;return ZO(f,K),ZO($,P),{projectDataDir:_,sharedDataDir:q}},aN=(_)=>{let{projectBoundaryDir:q,sharedBoundaryDir:f}=_,K=`${q}/${lK}`,$=`${f}/${lK}`,P=`${q}/${nK}`,j=`${f}/${nK}`,v=B6.create({boundaryDir:K}),w=B6.create({boundaryDir:$}),O=U6.create({boundaryDir:K}),T=U6.create({boundaryDir:$}),Y=B6.create({boundaryDir:P}),z=B6.create({boundaryDir:j}),H=U6.create({boundaryDir:P}),h=U6.create({boundaryDir:j}),J=cv.create({fileServiceByScope:{project:v,shared:w},folderServiceByScope:{project:O,shared:T},indexFilename:gN}),k=zO({projectFileService:Y,projectFolderService:H,sharedFileService:z,sharedFolderService:h});return Object.freeze({DocService:J,TemplateService:k})},IN,DN;var AO=V_(()=>{av();iv();Lv();WO();hO();IN=Object.freeze({createServices:aN,lazilyGetDataDirs:dN}),DN=IN});var W={};_7(W,{void:()=>CY,util:()=>Kq,unknown:()=>SY,union:()=>RY,undefined:()=>bY,tuple:()=>dY,transformer:()=>eY,symbol:()=>rY,string:()=>Y7,strictObject:()=>nY,setErrorMap:()=>sO,set:()=>DY,record:()=>aY,quotelessJson:()=>eO,promise:()=>tY,preprocess:()=>BY,pipeline:()=>UY,ostring:()=>FY,optional:()=>xY,onumber:()=>QY,oboolean:()=>qT,objectUtil:()=>DK,object:()=>lY,number:()=>T7,nullable:()=>sY,null:()=>VY,never:()=>NY,nativeEnum:()=>LY,nan:()=>uY,map:()=>IY,makeIssue:()=>g6,literal:()=>oY,lazy:()=>iY,late:()=>XY,isValid:()=>B_,isDirty:()=>df,isAsync:()=>e8,isAborted:()=>gf,intersection:()=>gY,instanceof:()=>AY,getParsedType:()=>M_,getErrorMap:()=>t8,function:()=>yY,enum:()=>cY,effect:()=>eY,discriminatedUnion:()=>EY,defaultErrorMap:()=>I_,datetimeRegex:()=>v7,date:()=>mY,custom:()=>O7,coerce:()=>_T,boolean:()=>z7,bigint:()=>GY,array:()=>pY,any:()=>MY,addIssueToContext:()=>t,ZodVoid:()=>a6,ZodUnknown:()=>U_,ZodUnion:()=>Q8,ZodUndefined:()=>U8,ZodType:()=>$q,ZodTuple:()=>N_,ZodTransformer:()=>J_,ZodSymbol:()=>d6,ZodString:()=>z_,ZodSet:()=>m8,ZodSchema:()=>$q,ZodRecord:()=>I6,ZodReadonly:()=>j6,ZodPromise:()=>r8,ZodPipeline:()=>i6,ZodParsedType:()=>o,ZodOptional:()=>H_,ZodObject:()=>bq,ZodNumber:()=>F_,ZodNullable:()=>y_,ZodNull:()=>F8,ZodNever:()=>S_,ZodNativeEnum:()=>$6,ZodNaN:()=>y6,ZodMap:()=>D6,ZodLiteral:()=>f6,ZodLazy:()=>_6,ZodIssueCode:()=>y,ZodIntersection:()=>q6,ZodFunction:()=>s8,ZodFirstPartyTypeKind:()=>i,ZodError:()=>eq,ZodEnum:()=>q8,ZodEffects:()=>J_,ZodDiscriminatedUnion:()=>af,ZodDefault:()=>K6,ZodDate:()=>u8,ZodCatch:()=>P6,ZodBranded:()=>If,ZodBoolean:()=>B8,ZodBigInt:()=>Q_,ZodArray:()=>W_,ZodAny:()=>G8,Schema:()=>$q,ParseStatus:()=>aq,OK:()=>yq,NEVER:()=>fT,INVALID:()=>U,EMPTY_PATH:()=>BO,DIRTY:()=>A8,BRAND:()=>ZY});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"]),M_=(_)=>{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"]),eO=(_)=>{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 xO=(_,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_=xO;var f7=I_;function sO(_){f7=_}function t8(){return f7}var g6=(_)=>{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}},BO=[];function t(_,q){let f=t8(),K=g6({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:_}),gf=(_)=>_.status==="aborted",df=(_)=>_.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 M_(_.data)}_getOrReturnCtx(_,q){return q||{common:_.parent.common,data:_.data,parsedType:M_(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}_processInputParams(_){return{status:new aq,ctx:{common:_.parent.common,data:_.data,parsedType:M_(_.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:M_(_)},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:M_(_)};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:M_(_)},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 J_({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 H_.create(this,this._def)}nullable(){return y_.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W_.create(this)}promise(){return r8.create(this,this._def)}or(_){return Q8.create([this,_],this._def)}and(_){return q6.create(this,_,this._def)}transform(_){return new J_({...qq(this._def),schema:this,typeName:i.ZodEffects,effect:{type:"transform",transform:_}})}default(_){let q=typeof _==="function"?_:()=>_;return new K6({...qq(this._def),innerType:this,defaultValue:q,typeName:i.ZodDefault})}brand(){return new If({typeName:i.ZodBranded,type:this,...qq(this._def)})}catch(_){let q=typeof _==="function"?_:()=>_;return new P6({...qq(this._def),innerType:this,catchValue:q,typeName:i.ZodCatch})}describe(_){return new this.constructor({...this._def,description:_})}pipe(_){return i6.create(this,_)}readonly(){return j6.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var UO=/^c[^\s-]{8,}$/i,FO=/^[0-9a-z]+$/,QO=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qY=/^[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,_Y=/^[a-z0-9_-]{21}$/i,fY=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$Y=/^[-+]?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)?)??$/,KY=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yK,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])$/,vY=/^(?:(?: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])$/,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]))$/,OY=/^(([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])$/,YY=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,TY=/^([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])))",zY=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 WY(_){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 HY(_,q){if((q==="v4"||!q)&&jY.test(_))return!0;if((q==="v6"||!q)&&wY.test(_))return!0;return!1}function hY(_,q){if(!fY.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 JY(_,q){if((q==="v4"||!q)&&vY.test(_))return!0;if((q==="v6"||!q)&&OY.test(_))return!0;return!1}class z_ 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(!KY.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(PY,"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(!qY.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"uuid",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="nanoid"){if(!_Y.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"nanoid",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="cuid"){if(!UO.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"cuid",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="cuid2"){if(!FO.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"cuid2",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="ulid"){if(!QO.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(!zY.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{code:y.invalid_string,validation:"date",message:$.message}),f.dirty()}else if($.kind==="time"){if(!WY($).test(_.data))K=this._getOrReturnCtx(_,K),t(K,{code:y.invalid_string,validation:"time",message:$.message}),f.dirty()}else if($.kind==="duration"){if(!$Y.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"duration",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="ip"){if(!HY(_.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(!JY(_.data,$.version))K=this._getOrReturnCtx(_,K),t(K,{validation:"cidr",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="base64"){if(!YY.test(_.data))K=this._getOrReturnCtx(_,K),t(K,{validation:"base64",code:y.invalid_string,message:$.message}),f.dirty()}else if($.kind==="base64url"){if(!TY.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 z_({...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 z_({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new z_({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new z_({...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 _}}z_.create=(_)=>{return new z_({checks:[],typeName:i.ZodString,coerce:_?.coerce??!1,...qq(_)})};function kY(_,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(kY(_.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 d6 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)}}d6.create=(_)=>{return new d6({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 S_ extends $q{_parse(_){let q=this._getOrReturnCtx(_);return t(q,{code:y.invalid_type,expected:o.never,received:q.parsedType}),U}}S_.create=(_)=>{return new S_({typeName:i.ZodNever,...qq(_)})};class a6 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)}}a6.create=(_)=>{return new a6({typeName:i.ZodVoid,...qq(_)})};class W_ 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 W_({...this._def,minLength:{value:_,message:B.toString(q)}})}max(_,q){return new W_({...this._def,maxLength:{value:_,message:B.toString(q)}})}length(_,q){return new W_({...this._def,exactLength:{value:_,message:B.toString(q)}})}nonempty(_){return this.min(1,_)}}W_.create=(_,q)=>{return new W_({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]=H_.create(x8(K))}return new bq({..._._def,shape:()=>q})}else if(_ instanceof W_)return new W_({..._._def,type:x8(_.element)});else if(_ instanceof H_)return H_.create(x8(_.unwrap()));else if(_ instanceof y_)return y_.create(x8(_.unwrap()));else if(_ instanceof N_)return N_.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 S_&&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 S_){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 H_)$=$._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:S_.create(),typeName:i.ZodObject,...qq(q)})};bq.strictCreate=(_,q)=>{return new bq({shape:()=>_,unknownKeys:"strict",catchall:S_.create(),typeName:i.ZodObject,...qq(q)})};bq.lazycreate=(_,q)=>{return new bq({shape:_,unknownKeys:"strip",catchall:S_.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 _6)return D_(_.schema);else if(_ instanceof J_)return D_(_.innerType());else if(_ instanceof f6)return[_.value];else if(_ instanceof q8)return _.options;else if(_ instanceof $6)return Kq.objectValues(_.enum);else if(_ instanceof K6)return D_(_._def.innerType);else if(_ instanceof U8)return[void 0];else if(_ instanceof F8)return[null];else if(_ instanceof H_)return[void 0,...D_(_.unwrap())];else if(_ instanceof y_)return[null,...D_(_.unwrap())];else if(_ instanceof If)return D_(_.unwrap());else if(_ instanceof j6)return D_(_.unwrap());else if(_ instanceof P6)return D_(_._def.innerType);else return[]};class af 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 af({typeName:i.ZodDiscriminatedUnion,discriminator:_,options:q,optionsMap:K,...qq(f)})}}function iK(_,q){let f=M_(_),K=M_(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 q6 extends $q{_parse(_){let{status:q,ctx:f}=this._processInputParams(_),K=($,P)=>{if(gf($)||gf(P))return U;let j=iK($.value,P.value);if(!j.valid)return t(f,{code:y.invalid_intersection_types}),U;if(df($)||df(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}))}}q6.create=(_,q,f)=>{return new q6({left:_,right:q,typeName:i.ZodIntersection,...qq(f)})};class N_ 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 N_({...this._def,rest:_})}}N_.create=(_,q)=>{if(!Array.isArray(_))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new N_({items:_,typeName:i.ZodTuple,rest:null,...qq(q)})};class I6 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 I6({keyType:_,valueType:q,typeName:i.ZodRecord,...qq(f)});return new I6({keyType:z_.create(),valueType:_,typeName:i.ZodRecord,...qq(q)})}}class D6 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}}}}D6.create=(_,q,f)=>{return new D6({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 g6({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 g6({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:N_.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:_?_:N_.create([]).rest(U_.create()),returns:q||U_.create(),typeName:i.ZodFunction,...qq(f)})}}class _6 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})}}_6.create=(_,q)=>{return new _6({getter:_,typeName:i.ZodLazy,...qq(q)})};class f6 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}}f6.create=(_,q)=>{return new f6({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 $6 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}}$6.create=(_,q)=>{return new $6({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 J_ 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)}}J_.create=(_,q,f)=>{return new J_({schema:_,typeName:i.ZodEffects,effect:q,...qq(f)})};J_.createWithPreprocess=(_,q,f)=>{return new J_({schema:q,effect:{type:"preprocess",transform:_},typeName:i.ZodEffects,...qq(f)})};class H_ extends $q{_parse(_){if(this._getType(_)===o.undefined)return yq(void 0);return this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}H_.create=(_,q)=>{return new H_({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 K6 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}}K6.create=(_,q)=>{return new K6({innerType:_,typeName:i.ZodDefault,defaultValue:typeof q.default==="function"?q.default:()=>q.default,...qq(q)})};class P6 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}}P6.create=(_,q)=>{return new P6({innerType:_,typeName:i.ZodCatch,catchValue:typeof q.catch==="function"?q.catch:()=>q.catch,...qq(q)})};class y6 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}}}y6.create=(_)=>{return new y6({typeName:i.ZodNaN,...qq(_)})};var ZY=Symbol("zod_brand");class If 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 i6 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 i6({in:_,out:q,typeName:i.ZodPipeline})}}class j6 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}}j6.create=(_,q)=>{return new j6({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 XY={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 AY=(_,q={message:`Input not instance of ${_.name}`})=>O7((f)=>f instanceof _,q),Y7=z_.create,T7=F_.create,uY=y6.create,GY=Q_.create,z7=B8.create,mY=u8.create,rY=d6.create,bY=U8.create,VY=F8.create,MY=G8.create,SY=U_.create,NY=S_.create,CY=a6.create,pY=W_.create,lY=bq.create,nY=bq.strictCreate,RY=Q8.create,EY=af.create,gY=q6.create,dY=N_.create,aY=I6.create,IY=D6.create,DY=m8.create,yY=s8.create,iY=_6.create,oY=f6.create,cY=q8.create,LY=$6.create,tY=r8.create,eY=J_.create,xY=H_.create,sY=y_.create,BY=J_.createWithPreprocess,UY=i6.create,FY=()=>Y7().optional(),QY=()=>T7().optional(),qT=()=>z7().optional(),_T={string:(_)=>z_.create({..._,coerce:!0}),number:(_)=>F_.create({..._,coerce:!0}),boolean:(_)=>B8.create({..._,coerce:!0}),bigint:(_)=>Q_.create({..._,coerce:!0}),date:(_)=>u8.create({..._,coerce:!0})};var fT=U;var oK="2025-06-18";var W7=[oK,"2025-03-26","2024-11-05","2024-10-07"],Df="2.0",H7=W.union([W.string(),W.number().int()]),h7=W.string(),$T=W.object({progressToken:W.optional(H7)}).passthrough(),K_=W.object({_meta:W.optional($T)}).passthrough(),xq=W.object({method:W.string(),params:W.optional(K_)}),o6=W.object({_meta:W.optional(W.object({}).passthrough())}).passthrough(),C_=W.object({method:W.string(),params:W.optional(o6)}),P_=W.object({_meta:W.optional(W.object({}).passthrough())}).passthrough(),yf=W.union([W.string(),W.number().int()]),J7=W.object({jsonrpc:W.literal(Df),id:yf}).merge(xq).strict(),k7=(_)=>J7.safeParse(_).success,Z7=W.object({jsonrpc:W.literal(Df)}).merge(C_).strict(),X7=(_)=>Z7.safeParse(_).success,A7=W.object({jsonrpc:W.literal(Df),id:yf,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(Df),id:yf,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]),of=P_.strict(),cf=C_.extend({method:W.literal("notifications/cancelled"),params:o6.extend({requestId:yf,reason:W.string().optional()})}),KT=W.object({src:W.string(),mimeType:W.optional(W.string()),sizes:W.optional(W.array(W.string()))}).passthrough(),c6=W.object({icons:W.array(KT).optional()}).passthrough(),L6=W.object({name:W.string(),title:W.optional(W.string())}).passthrough(),r7=L6.extend({version:W.string(),websiteUrl:W.optional(W.string())}).merge(c6),PT=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:PT,clientInfo:r7})});var jT=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(),vT=P_.extend({protocolVersion:W.string(),capabilities:jT,serverInfo:r7,instructions:W.optional(W.string())}),tK=C_.extend({method:W.literal("notifications/initialized")});var Lf=xq.extend({method:W.literal("ping")}),wT=W.object({progress:W.number(),total:W.optional(W.number()),message:W.optional(W.string())}).passthrough(),tf=C_.extend({method:W.literal("notifications/progress"),params:o6.merge(wT).extend({progressToken:H7})}),ef=xq.extend({params:K_.extend({cursor:W.optional(h7)}).optional()}),xf=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=L6.extend({uri:W.string(),description:W.optional(W.string()),mimeType:W.optional(W.string()),_meta:W.optional(W.object({}).passthrough())}).merge(c6),OT=L6.extend({uriTemplate:W.string(),description:W.optional(W.string()),mimeType:W.optional(W.string()),_meta:W.optional(W.object({}).passthrough())}).merge(c6),sf=ef.extend({method:W.literal("resources/list")}),YT=xf.extend({resources:W.array(S7)}),Bf=ef.extend({method:W.literal("resources/templates/list")}),TT=xf.extend({resourceTemplates:W.array(OT)}),Uf=xq.extend({method:W.literal("resources/read"),params:K_.extend({uri:W.string()})}),zT=P_.extend({contents:W.array(W.union([V7,M7]))}),WT=C_.extend({method:W.literal("notifications/resources/list_changed")}),HT=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()})}),JT=C_.extend({method:W.literal("notifications/resources/updated"),params:o6.extend({uri:W.string()})}),kT=W.object({name:W.string(),description:W.optional(W.string()),required:W.optional(W.boolean())}).passthrough(),ZT=L6.extend({description:W.optional(W.string()),arguments:W.optional(W.array(kT)),_meta:W.optional(W.object({}).passthrough())}).merge(c6),Ff=ef.extend({method:W.literal("prompts/list")}),XT=xf.extend({prompts:W.array(ZT)}),Qf=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(),AT=W.object({type:W.literal("resource"),resource:W.union([V7,M7]),_meta:W.optional(W.object({}).passthrough())}).passthrough(),uT=S7.extend({type:W.literal("resource_link")}),N7=W.union([xK,sK,BK,uT,AT]),GT=W.object({role:W.enum(["user","assistant"]),content:N7}).passthrough(),mT=P_.extend({description:W.optional(W.string()),messages:W.array(GT)}),rT=C_.extend({method:W.literal("notifications/prompts/list_changed")}),bT=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(),VT=L6.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(bT),_meta:W.optional(W.object({}).passthrough())}).merge(c6),q$=ef.extend({method:W.literal("tools/list")}),MT=xf.extend({tools:W.array(VT)}),C7=P_.extend({content:W.array(N7).default([]),structuredContent:W.object({}).passthrough().optional(),isError:W.optional(W.boolean())}),SC=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()))})}),ST=C_.extend({method:W.literal("notifications/tools/list_changed")}),t6=W.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),UK=xq.extend({method:W.literal("logging/setLevel"),params:K_.extend({level:t6})}),NT=C_.extend({method:W.literal("notifications/message"),params:o6.extend({level:t6,logger:W.optional(W.string()),data:W.unknown()})}),CT=W.object({name:W.string().optional()}).passthrough(),pT=W.object({hints:W.optional(W.array(CT)),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(),lT=W.object({role:W.enum(["user","assistant"]),content:W.union([xK,sK,BK])}).passthrough(),nT=xq.extend({method:W.literal("sampling/createMessage"),params:K_.extend({messages:W.array(lT),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(pT)})}),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])}),RT=W.object({type:W.literal("boolean"),title:W.optional(W.string()),description:W.optional(W.string()),default:W.optional(W.boolean())}).passthrough(),ET=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(),gT=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(),dT=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(),aT=W.union([RT,ET,gT,dT]),IT=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(),aT),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()))}),DT=W.object({type:W.literal("ref/resource"),uri:W.string()}).passthrough();var yT=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([yT,DT]),argument:W.object({name:W.string(),value:W.string()}).passthrough(),context:W.optional(W.object({arguments:W.optional(W.record(W.string(),W.string()))}))})}),iT=P_.extend({completion:W.object({values:W.array(W.string()).max(100),total:W.optional(W.number().int()),hasMore:W.optional(W.boolean())}).passthrough()}),oT=W.object({uri:W.string().startsWith("file://"),name:W.optional(W.string()),_meta:W.optional(W.object({}).passthrough())}).passthrough(),cT=xq.extend({method:W.literal("roots/list")}),qP=P_.extend({roots:W.array(oT)}),LT=C_.extend({method:W.literal("notifications/roots/list_changed")}),NC=W.union([Lf,LK,f$,UK,Qf,Ff,sf,Bf,Uf,HT,hT,_$,q$]),CC=W.union([cf,tf,tK,LT]),pC=W.union([of,FK,QK,qP]),lC=W.union([Lf,nT,IT,cT]),nC=W.union([cf,tf,NT,JT,WT,ST,rT]),RC=W.union([of,vT,iT,mT,XT,YT,TT,zT,C7,MT]);class Xq extends Error{constructor(_,q,f){super(`MCP error ${_}: ${q}`);this.code=_,this.data=f,this.name="McpError"}}var tT=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(cf,(q)=>{let f=this._requestHandlerAbortControllers.get(q.params.requestId);f===null||f===void 0||f.abort(q.params.reason)}),this.setNotificationHandler(tf,(q)=>{this._onprogress(q)}),this.setRequestHandler(Lf,(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:tT,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(t6.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=t6.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"},of)}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 bW(_,q)}}var bW=(_,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 VW=(_)=>{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(VW(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,k_={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":Z_(f,"email",K.message,q);break;case"format:idn-email":Z_(f,"idn-email",K.message,q);break;case"pattern:zod":cq(f,k_.email,K.message,q);break}break;case"url":Z_(f,"uri",K.message,q);break;case"uuid":Z_(f,"uuid",K.message,q);break;case"regex":cq(f,K.regex,K.message,q);break;case"cuid":cq(f,k_.cuid,K.message,q);break;case"cuid2":cq(f,k_.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":Z_(f,"date-time",K.message,q);break;case"date":Z_(f,"date",K.message,q);break;case"time":Z_(f,"time",K.message,q);break;case"duration":Z_(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")Z_(f,"ipv4",K.message,q);if(K.version!=="v4")Z_(f,"ipv6",K.message,q);break}case"base64url":cq(f,k_.base64url,K.message,q);break;case"jwt":cq(f,k_.jwt,K.message,q);break;case"cidr":{if(K.version!=="v6")cq(f,k_.ipv4Cidr,K.message,q);if(K.version!=="v4")cq(f,k_.ipv6Cidr,K.message,q);break}case"emoji":cq(f,k_.emoji(),K.message,q);break;case"ulid":{cq(f,k_.ulid,K.message,q);break}case"base64":{switch(q.base64Strategy){case"format:binary":{Z_(f,"binary",K.message,q);break}case"contentEncoding:base64":{jq(f,"contentEncoding","base64",K.message,q);break}case"pattern:zod":{cq(f,k_.base64,K.message,q);break}}break}case"nanoid":cq(f,k_.nanoid,K.message,q);case"toLowerCase":case"toUpperCase":case"trim":break;default:(($)=>{})(K)}return f}function CP(_,q){return q.patternStrategy==="escape"?SW(_):_}var MW=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function SW(_){let q="";for(let f=0;f<_.length;f++){if(!MW.has(_[f]))q+="\\";q+=_[f]}return q}function Z_(_,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
172
|
]))`;continue}else if(K[w]==="$"){$+=`($|(?=[\r
|
|
174
173
|
]))`;continue}}if(f.s&&K[w]==="."){$+=j?`${K[w]}\r
|
|
175
174
|
`:`[${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),
|
|
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.
|
|
179
|
-
Applied: ${T.applied} edit operation(s)`}]}}})},
|
|
175
|
+
]`;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 x6={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 x6)&&(!K._def.checks||!K._def.checks.length))){let K=f.reduce(($,P)=>{let j=x6[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:x6[_.innerType._def.typeName],nullable:!0};return{type:[x6[_.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=CW(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=NW(_,q);if(j!==void 0)K.additionalProperties=j;return K}function NW(_,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 CW(_){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=pW(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)lW(_,q,j);if(q.postProcess){let v=q.postProcess(j,_,q);return $.jsonSchema=j,v}return $.jsonSchema=j,j}var pW=(_,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}}},lW=(_,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 s6 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}}s6.create=(_,q)=>{return new s6({type:_,typeName:pP.Completable,complete:q.complete,...nW(q)})};function nW(_){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}):RW,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 s6))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(sf.shape.method.value),this.server.assertCanSetRequestHandler(Bf.shape.method.value),this.server.assertCanSetRequestHandler(Uf.shape.method.value),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(sf,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(Bf,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([q,f])=>({name:q,uriTemplate:f.resourceTemplate.uriTemplate.toString(),...f.metadata}))}}),this.server.setRequestHandler(Uf,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(Ff.shape.method.value),this.server.assertCanSetRequestHandler(Qf.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Ff,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,_])=>_.enabled).map(([_,q])=>{return{name:_,title:q.title,description:q.description,arguments:q.argsSchema?gW(q.argsSchema):void 0}})})),this.server.setRequestHandler(Qf,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 RW={type:"object",properties:{}};function zv(_){if(typeof _!=="object"||_===null)return!1;return Object.keys(_).length===0||Object.values(_).some(EW)}function EW(_){return _!==null&&typeof _==="object"&&"parse"in _&&typeof _.parse==="function"&&"safeParse"in _&&typeof _.safeParse==="function"}function gW(_){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"node:process";class nP{append(_){this._buffer=this._buffer?Buffer.concat([this._buffer,_]):_}readMessage(){if(!this._buffer)return null;let _=this._buffer.indexOf(`
|
|
176
|
+
`);if(_===-1)return null;let q=this._buffer.toString("utf8",0,_).replace(/\r$/,"");return this._buffer=this._buffer.subarray(_+1),dW(q)}clear(){this._buffer=void 0}}function dW(_){return m7.parse(JSON.parse(_))}function Hv(_){return JSON.stringify(_)+`
|
|
177
|
+
`}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.5",description:"Story Workflow Inject Context - 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.1","@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 IW=(_)=>{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}`}]}}})},DW=Object.freeze({create:IW}),Jv=DW;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};w6();var tW=(_)=>{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)}]}}})},eW=Object.freeze({create:tW}),Zv=eW;w6();var xW=(_)=>{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: ${$}
|
|
178
|
+
Applied: ${T.applied} edit operation(s)`}]}}})},sW=Object.freeze({create:xW}),Xv=sW;var BW=(_)=>{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)}]}}})},UW=Object.freeze({create:BW}),Av=UW;w6();var FW=(_)=>{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)}]}}})},QW=Object.freeze({create:FW}),uv=QW;w6();var qH=(_)=>{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
179
|
`))H+=`
|
|
181
180
|
`;if(O.push(H),Y<w.length-1)O.push("")}return{content:[{type:"text",text:O.join(`
|
|
182
|
-
`)}]}}})},
|
|
183
|
-
Applied: ${T.applied} edit operation(s)`}]}}})},
|
|
181
|
+
`)}]}}})},_H=Object.freeze({create:qH}),Gv=_H;var fH=(_)=>{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}`}]}}})},$H=Object.freeze({create:fH}),mv=$H;var KH=(_)=>{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)}]}}})},PH=Object.freeze({create:KH}),rv=PH;var jH=(_)=>{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: ${$}
|
|
182
|
+
Applied: ${T.applied} edit operation(s)`}]}}})},vH=Object.freeze({create:jH}),bv=vH;var wH=(_)=>{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)}]}}})},OH=Object.freeze({create:wH}),Vv=OH;var YH=(_)=>{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} → ${T.newId}`},null,2)}]}}})},TH=Object.freeze({create:YH}),Mv=TH;var zH=(_)=>{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
183
|
`,Y+=`Path: ${H.path}
|
|
185
184
|
`,Y+=`Valid: ${H.isValid}
|
|
186
185
|
`,Y+=`---
|
|
187
186
|
`;if(Y+=H.content,!H.content.endsWith(`
|
|
188
187
|
`))Y+=`
|
|
189
188
|
`;if(z<T.length-1)Y+=`
|
|
190
|
-
`}return{content:[{type:"text",text:Y}]}}})},
|
|
189
|
+
`}return{content:[{type:"text",text:Y}]}}})},WH=Object.freeze({create:zH}),Sv=WH;var HH=(_)=>{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:HH}),Nv=hH;var JH=(_)=>{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)}]}}})},kH=Object.freeze({create:JH}),Cv=kH;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 oN}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`)}})},yN=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()},iN=Object.freeze({create:GO}),cN=T_.main==T_.module??(()=>{try{let _=uO(oN(import.meta.url)),q=uO(process.argv[1]);return _===q}catch{return!1}})();if(cN)yN().catch(console.error);var H0=iN;export{H0 as default};
|